https://gstreamer.freedesktop.org/documentation/frequently-asked-questions/developing.html#what-is-the-coding-style-for-gstreamer-code
states:
Comments should be in /* ANSI C comment style */ and code should generally be compatible with ANSI C89, so please declare all variables at the beginning of the block, etc.
Thus, we have updated commenting style.
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
g_assert (offset % 4);
- // @TODO: We don't know if outbuf is already allocated at this point, yet!
+ /* @TODO: We don't know if outbuf is already allocated at this point, yet! */
g_assert (gst_buffer_get_size (outbuf) >=
filter->dimension[0] * filter->dimension[1] * filter->dimension[2] *
filter->dimension[3]);
if (offset % 4)
offset += 4 - (offset % 4);
- // Refer: https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html
+ /* Refer: https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html */
gst_buffer_map (inbuf, &src_info, GST_MAP_READ);
gst_buffer_map (outbuf, &dest_info, GST_MAP_WRITE);
srcptr = src_info.data;
destptr = dest_info.data;
- for (d0 = 0; d0 < filter->dimension[3]; d0++) { // Supposed to be 0 only
+ for (d0 = 0; d0 < filter->dimension[3]; d0++) { /* Supposed to be 0 only */
g_assert (d0 == 0);
- for (d1 = 0; d1 < filter->dimension[2]; d1++) { // Height
+ for (d1 = 0; d1 < filter->dimension[2]; d1++) { /* Height */
memcpy (destptr + dest_idx, srcptr + src_idx, size);
dest_idx += size;
src_idx += offset;
switch (filter->input_media_type) {
case _NNS_VIDEO:
if (filter->removePadding == TRUE) {
- // Remove zero-padding between rows
+ /* Remove zero-padding between rows */
unsigned char *ptr;
unsigned int row, d0;
unsigned int dest_idx = 0, src_idx = 0;
g_assert (offset % 4);
if (offset % 4)
offset += 4 - (offset % 4);
- // Refer: https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html
+ /* Refer: https://gstreamer.freedesktop.org/documentation/design/mediatype-video-raw.html */
gst_buffer_map (buf, &info, GST_MAP_READWRITE);
ptr = info.data;
- for (d0 = 0; d0 < filter->dimension[3]; d0++) { // Supposed to be 0 only
+ for (d0 = 0; d0 < filter->dimension[3]; d0++) { /* Supposed to be 0 only */
g_assert (d0 == 0);
- for (row = 0; row < filter->dimension[2]; row++) { // Height
+ for (row = 0; row < filter->dimension[2]; row++) { /* Height */
if (dest_idx != src_idx)
memmove (ptr + dest_idx, ptr + src_idx, size);
dest_idx += size;
src_idx += offset;
}
}
- // @TODO: Remove the clutter (reduce the size?) after memcpy. (Check if that's really helpful, first)
+ /* @TODO: Remove the clutter (reduce the size?) after memcpy. (Check if that's really helpful, first) */
gst_buffer_unmap (buf, &info);
g_printerr
trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_tensor_filter_set_caps);
/* Allocation units */
- // @TODO Fill these in!
- // trans_class-> ...
+ /* @TODO Fill these in! trans_class-> ... */
}
/* initialize the new element
filter->outputConfigured = FALSE;
filter->modelFilename = NULL;
- filter->inputDimension[0] = 1; // innermost
+ filter->inputDimension[0] = 1; /* innermost */
filter->inputDimension[1] = 1;
filter->inputDimension[2] = 1;
- filter->inputDimension[3] = 1; // out
- filter->inputType = _NNS_END; // not initialized
+ filter->inputDimension[3] = 1; /* out */
+ filter->inputType = _NNS_END; /* not initialized */
filter->inputCapNegotiated = FALSE;
- filter->outputDimension[0] = 1; // innermost
+ filter->outputDimension[0] = 1; /* innermost */
filter->outputDimension[1] = 1;
filter->outputDimension[2] = 1;
- filter->outputDimension[3] = 1; // out
- filter->outputType = _NNS_END; // not initialized
+ filter->outputDimension[3] = 1; /* out */
+ filter->outputType = _NNS_END; /* not initialized */
filter->outputCapNegotiated = FALSE;
- filter->privateData = NULL; // mark not initialized.
+ filter->privateData = NULL; /* mark not initialized. */
}
/**
for (i = 0; i < NNS_TENSOR_RANK_LIMIT; i++)
g_array_append_val (input, filter->inputDimension[i]);
g_value_take_boxed (value, input);
- // take function hands the object over from here so that we don't need to free it.
+ /* take function hands the object over from here so that we don't need to free it. */
}
break;
case PROP_OUTPUT:{
for (i = 0; i < NNS_TENSOR_RANK_LIMIT; i++)
g_array_append_val (output, filter->outputDimension[i]);
g_value_take_boxed (value, output);
- // take function hands the object over from here so that we don't need to free it.
+ /* take function hands the object over from here so that we don't need to free it. */
}
break;
case PROP_INPUTTYPE:
GstTensor_Filter_Framework NNS_support_custom = {
.name = "custom",
- .allow_in_place = FALSE, // custom cannot support in-place (outptr == inptr).
+ .allow_in_place = FALSE, /* custom cannot support in-place (outptr == inptr). */
.invoke_NN = custom_invoke,
.getInputDimension = custom_getInputDim,
.getOutputDimension = custom_getOutputDim,
static int
tflite_invoke (GstTensor_Filter * filter, uint8_t * inptr, uint8_t * outptr)
{
- return 0; // NYI
+ return 0; /* NYI */
}
/**
tflite_getInputDim (GstTensor_Filter * filter, uint32_t * inputDimension,
tensor_type * type)
{
- // @TODO fill in *inputDimension (uint32_t[MAX_RANK]), *type
+ /* @TODO fill in *inputDimension (uint32_t[MAX_RANK]), *type */
return 0; // NYI
}
tflite_getOutputDim (GstTensor_Filter * filter, uint32_t * outputDimension,
tensor_type * type)
{
- // @TODO fill in *outputDimension (uint32_t[MAX_RANK]), *type
- return 0; // NYI
+ /* @TODO fill in *outputDimension (uint32_t[MAX_RANK]), *type */
+ return 0; /* NYI */
}
GstTensor_Filter_Framework NNS_support_tensorflow_lite = {
.name = "tensorflow-lite",
- .allow_in_place = FALSE, // Let's not do this yet. @TODO: support this to optimize performance later.
+ .allow_in_place = FALSE, /* Let's not do this yet. @TODO: support this to optimize performance later. */
.invoke_NN = tflite_invoke,
.getInputDimension = tflite_getInputDim,
.getOutputDimension = tflite_getOutputDim,