Doxygen Book
gsttensor_transform.h
Go to the documentation of this file.
1 
28 #ifndef __GST_TENSOR_TRANSFORM_H__
29 #define __GST_TENSOR_TRANSFORM_H__
30 
31 #ifdef HAVE_CONFIG_H
32 #include <config.h>
33 #endif
34 
35 #include <gst/gst.h>
36 #include <gst/base/gstbasetransform.h>
37 #include <tensor_common.h>
38 #include <tensor_data.h>
39 
40 G_BEGIN_DECLS
41 
42 #define GST_TYPE_TENSOR_TRANSFORM \
43  (gst_tensor_transform_get_type())
44 #define GST_TENSOR_TRANSFORM(obj) \
45  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_TENSOR_TRANSFORM,GstTensorTransform))
46 #define GST_TENSOR_TRANSFORM_CLASS(klass) \
47  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_TENSOR_TRANSFORM,GstTensorTransformClass))
48 #define GST_IS_TENSOR_TRANSFORM(obj) \
49  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TENSOR_TRANSFORM))
50 #define GST_IS_TENSOR_TRANSFORM_CLASS(klass) \
51  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TENSOR_TRANSFORM))
52 #define GST_TENSOR_TRANSFORM_CAST(obj) ((GstTensorTransform *)(obj))
53 
56 
58 {
59  GTT_DIMCHG = 0, /* Dimension Change. "dimchg" */
60  GTT_TYPECAST, /* Type change. "typecast" */
61  GTT_ARITHMETIC, /* Arithmetic. "arithmetic" */
62  GTT_TRANSPOSE, /* Transpose. "transpose" */
63  GTT_STAND, /* Standardization. "stand" */
64  GTT_CLAMP, /* Clamp, "clamp" */
65  GTT_PADDING, /* Padding, "padding" */
66 
67  GTT_UNKNOWN = -1, /* Unknown/Not-implemented-yet Mode. "unknown" */
69 
70 typedef enum
71 {
76 
79 
80 typedef enum
81 {
86 
87 typedef enum
88 {
97 
101 typedef struct _tensor_transform_dimchg {
102  int from;
103  int to;
105 
112 
116 typedef struct
117 {
122 
129  guint ch_dim;
131 
138 
142 typedef struct _tensor_transform_stand {
145  gboolean per_channel;
147 
151 typedef struct _tensor_transform_clamp {
152  double min, max;
154 
162 
167 {
168  GstBaseTransform element;
170  gboolean silent;
172  gchar *option;
173  union {
181  };
182  gboolean loaded;
183  gboolean acceleration;
184  GSList *operators;
188  GList *apply;
189 };
190 
199 {
200  GstBaseTransformClass parent_class;
201 };
202 
206 GType gst_tensor_transform_get_type (void);
207 
208 G_END_DECLS
209 
210 #endif /* __GST_TENSOR_TRANSFORM_H__ */
_GstTensorTransform::data_padding
tensor_transform_padding data_padding
Definition: gsttensor_transform.h:180
GTT_TRANSPOSE
@ GTT_TRANSPOSE
Definition: gsttensor_transform.h:62
tensor_transform_arithmetic
struct _tensor_transform_arithmetic tensor_transform_arithmetic
Internal data structure for arithmetic mode.
tensor_transform_stand_mode
tensor_transform_stand_mode
Definition: gsttensor_transform.h:80
tensor_transform_operator_s::op
tensor_transform_operator op
Definition: gsttensor_transform.h:118
tensor_data.h
Internal functions to handle various tensor type and value.
_tensor_transform_clamp::min
double min
Definition: gsttensor_transform.h:152
_GstTensorTransform::element
GstBaseTransform element
Definition: gsttensor_transform.h:168
_tensor_transform_padding::layout
tensor_layout layout
Definition: gsttensor_transform.h:160
_GstTensorTransform::operators
GSList * operators
Definition: gsttensor_transform.h:184
tensor_data_s
Structure for tensor data.
Definition: tensor_data.h:23
_GstTensorTransform::option
gchar * option
Definition: gsttensor_transform.h:172
GTT_DIMCHG
@ GTT_DIMCHG
Definition: gsttensor_transform.h:59
PADDING_LEFT
@ PADDING_LEFT
Definition: gsttensor_transform.h:89
_tensor_transform_padding
Internal data structure for padding mode.
Definition: gsttensor_transform.h:158
tensor_transform_operator_s
Internal data structure for operator of arithmetic mode.
Definition: gsttensor_transform.h:116
_tensor_transform_typecast
Internal data structure for typecast mode.
Definition: gsttensor_transform.h:109
STAND_END
@ STAND_END
Definition: gsttensor_transform.h:84
_tensor_transform_arithmetic::out_type
tensor_type out_type
Definition: gsttensor_transform.h:127
_GstTensorTransform::acceleration
gboolean acceleration
Definition: gsttensor_transform.h:183
PADDING_TOP
@ PADDING_TOP
Definition: gsttensor_transform.h:91
GTT_OP_DIV
@ GTT_OP_DIV
Definition: gsttensor_transform.h:75
GTT_OP_TYPECAST
@ GTT_OP_TYPECAST
Definition: gsttensor_transform.h:72
_GstTensorTransform::out_config
GstTensorsConfig out_config
Definition: gsttensor_transform.h:187
GTT_CLAMP
@ GTT_CLAMP
Definition: gsttensor_transform.h:64
_tensor_transform_stand::per_channel
gboolean per_channel
Definition: gsttensor_transform.h:145
GTT_OP_UNKNOWN
@ GTT_OP_UNKNOWN
Definition: gsttensor_transform.h:77
_tensor_transform_arithmetic
Internal data structure for arithmetic mode.
Definition: gsttensor_transform.h:126
_tensor_transform_stand::out_type
tensor_type out_type
Definition: gsttensor_transform.h:144
GTT_PADDING
@ GTT_PADDING
Definition: gsttensor_transform.h:65
tensor_transform_operator_s::value
tensor_data_s value
Definition: gsttensor_transform.h:120
tensor_transform_stand
struct _tensor_transform_stand tensor_transform_stand
Internal data structure for stand mode.
tensor_type
enum _nns_tensor_type tensor_type
Possible data element types of other/tensor.
_GstTensorTransform::data_dimchg
tensor_transform_dimchg data_dimchg
Definition: gsttensor_transform.h:174
_GstTensorTransform::silent
gboolean silent
Definition: gsttensor_transform.h:170
PADDING_RIGHT
@ PADDING_RIGHT
Definition: gsttensor_transform.h:90
_tensor_transform_padding::pad
guint pad[NNS_TENSOR_RANK_LIMIT]
Definition: gsttensor_transform.h:159
PADDING_BACK
@ PADDING_BACK
Definition: gsttensor_transform.h:94
STAND_DEFAULT
@ STAND_DEFAULT
Definition: gsttensor_transform.h:82
_tensor_transform_mode
_tensor_transform_mode
Definition: gsttensor_transform.h:57
_GstTensorTransform::in_config
GstTensorsConfig in_config
Definition: gsttensor_transform.h:186
tensor_layout
enum _nns_tensor_layout tensor_layout
Tensor layout format for other/tensor.
_tensor_transform_dimchg::to
int to
Definition: gsttensor_transform.h:103
_GstTensorTransformClass::parent_class
GstBaseTransformClass parent_class
Definition: gsttensor_transform.h:200
GstTensorsConfig
Internal data structure for configured tensors info (for other/tensors).
Definition: tensor_typedef.h:284
_tensor_transform_dimchg::from
int from
Definition: gsttensor_transform.h:102
tensor_transform_padding
struct _tensor_transform_padding tensor_transform_padding
Internal data structure for padding mode.
GTT_ARITHMETIC
@ GTT_ARITHMETIC
Definition: gsttensor_transform.h:61
tensor_transform_operator_s::applying_ch
int applying_ch
Definition: gsttensor_transform.h:119
tensor_transform_mode
enum _tensor_transform_mode tensor_transform_mode
_GstTensorTransform::apply
GList * apply
Definition: gsttensor_transform.h:188
PADDING_END
@ PADDING_END
Definition: gsttensor_transform.h:95
tensor_transform_transpose
struct _tensor_transform_transpose tensor_transform_transpose
Internal data structure for transpose mode.
_tensor_transform_transpose::trans_order
uint8_t trans_order[NNS_TENSOR_RANK_LIMIT]
Definition: gsttensor_transform.h:136
_GstTensorTransform::data_stand
tensor_transform_stand data_stand
Definition: gsttensor_transform.h:178
GTT_UNKNOWN
@ GTT_UNKNOWN
Definition: gsttensor_transform.h:67
_tensor_transform_stand::mode
tensor_transform_stand_mode mode
Definition: gsttensor_transform.h:143
tensor_common.h
Common header file for NNStreamer, the GStreamer plugin for neural networks.
STAND_DC_AVERAGE
@ STAND_DC_AVERAGE
Definition: gsttensor_transform.h:83
GTT_OP_MUL
@ GTT_OP_MUL
Definition: gsttensor_transform.h:74
PADDING_BOTTOM
@ PADDING_BOTTOM
Definition: gsttensor_transform.h:92
PADDING_FRONT
@ PADDING_FRONT
Definition: gsttensor_transform.h:93
_tensor_transform_stand
Internal data structure for stand mode.
Definition: gsttensor_transform.h:142
tensor_transform_dimchg
struct _tensor_transform_dimchg tensor_transform_dimchg
Internal data structure for dimchg mode.
_tensor_transform_arithmetic::ch_dim
guint ch_dim
Definition: gsttensor_transform.h:129
_GstTensorTransform::data_typecast
tensor_transform_typecast data_typecast
Definition: gsttensor_transform.h:175
gst_tensor_transform_get_type
GType gst_tensor_transform_get_type(void)
Get Type function required for gst elements.
GTT_OP_ADD
@ GTT_OP_ADD
Definition: gsttensor_transform.h:73
_tensor_transform_dimchg
Internal data structure for dimchg mode.
Definition: gsttensor_transform.h:101
_tensor_transform_clamp::max
double max
Definition: gsttensor_transform.h:152
_GstTensorTransform::data_clamp
tensor_transform_clamp data_clamp
Definition: gsttensor_transform.h:179
_tensor_transform_clamp
Internal data structure for clamp mode.
Definition: gsttensor_transform.h:151
GTT_STAND
@ GTT_STAND
Definition: gsttensor_transform.h:63
_GstTensorTransform::data_arithmetic
tensor_transform_arithmetic data_arithmetic
Definition: gsttensor_transform.h:176
tensor_transform_typecast
struct _tensor_transform_typecast tensor_transform_typecast
Internal data structure for typecast mode.
_tensor_transform_arithmetic::per_channel_arith
gboolean per_channel_arith
Definition: gsttensor_transform.h:128
_GstTensorTransform::data_transpose
tensor_transform_transpose data_transpose
Definition: gsttensor_transform.h:177
tensor_transform_padding_axis
tensor_transform_padding_axis
Definition: gsttensor_transform.h:87
_GstTensorTransformClass
GstTensorTransformClass inherits GstBaseTransformClass.
Definition: gsttensor_transform.h:198
NNS_TENSOR_RANK_LIMIT
#define NNS_TENSOR_RANK_LIMIT
Definition: tensor_typedef.h:34
tensor_transform_operator
tensor_transform_operator
Definition: gsttensor_transform.h:70
_tensor_transform_typecast::to
tensor_type to
Definition: gsttensor_transform.h:110
GTT_TYPECAST
@ GTT_TYPECAST
Definition: gsttensor_transform.h:60
_GstTensorTransform::loaded
gboolean loaded
Definition: gsttensor_transform.h:182
tensor_transform_clamp
struct _tensor_transform_clamp tensor_transform_clamp
Internal data structure for clamp mode.
_GstTensorTransform
Internal data structure for tensor_transform instances.
Definition: gsttensor_transform.h:166
_tensor_transform_transpose
Internal data structure for transpose mode.
Definition: gsttensor_transform.h:135
_GstTensorTransform::mode
tensor_transform_mode mode
Definition: gsttensor_transform.h:171