[Code Clean] Comments Cleaned Up
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Mon, 16 Jul 2018 09:07:06 +0000 (18:07 +0900)
committer함명주/동작제어Lab(SR)/Principal Engineer/삼성전자 <myungjoo.ham@samsung.com>
Thu, 19 Jul 2018 04:29:59 +0000 (13:29 +0900)
This is part of #169

A few comment lines were cleaned up (Style Fixes)

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
common/tensor_common.c
gst/tensor_converter/tensor_converter.c
gst/tensor_filter/tensor_filter.c
gst/tensor_transform/tensor_transform.c
include/tensor_common.h
include/tensor_typedef.h

index f34dd66..7e9b7a2 100644 (file)
@@ -59,7 +59,10 @@ get_tensor_type (const gchar * typestr)
   len = strlen (typestr);
 
   if (typestr[0] == 'u' || typestr[0] == 'U') {
-    /* Let's believe the developer and the following three letters are "int" (case insensitive) */
+    /**
+     * Let's believe the developer and the following three letters are "int"
+     * (case insensitive)
+     */
     if (len == 6) {             /* uint16, uint32 */
       if (typestr[4] == '1' && typestr[5] == '6')
         return _NNS_UINT16;
@@ -70,7 +73,10 @@ get_tensor_type (const gchar * typestr)
         return _NNS_UINT8;
     }
   } else if (typestr[0] == 'i' || typestr[0] == 'I') {
-    /* Let's believe the developer and the following two letters are "nt" (case insensitive) */
+    /**
+     * Let's believe the developer and the following two letters are "nt"
+     * (case insensitive)
+     */
     if (len == 5) {             /* int16, int32 */
       if (typestr[3] == '1' && typestr[4] == '6')
         return _NNS_INT16;
index 951328a..3f6b4f8 100644 (file)
@@ -88,7 +88,8 @@ enum
   PROP_FORCE_MEMCPY,
 };
 
-/* the capabilities of the inputs
+/**
+ * the capabilities of the inputs
  *
  * In v0.0.1, this is "bitmap" image stream
  */
@@ -317,8 +318,10 @@ gst_tensor_converter_configure_tensor (const GstCaps * caps,
     return FALSE;
   }
 
-  /* Emit Warning if RSTRIDE = RU4 (3BPP) && Width % 4 > 0 */
-  /** @todo: Add more conditions! */
+  /**
+   * Emit Warning if RSTRIDE = RU4 (3BPP) && Width % 4 > 0
+   * @todo: Add more conditions!
+   */
   if (remove_stride_padding_per_row (format, dimension[1])) {
     filter->removePadding = TRUE;
   }
@@ -371,7 +374,8 @@ gst_tensor_converter_configure_tensor (const GstCaps * caps,
 static gboolean
 tensor_converter_init (GstPlugin * tensor_converter)
 {
-  /* debug category for fltering log messages
+  /**
+   * debug category for fltering log messages
    *
    * exchange the string 'Template tensor_converter' with your description
    */
@@ -392,7 +396,8 @@ tensor_converter_init (GstPlugin * tensor_converter)
 #define PACKAGE "tensor_converter"
 #endif
 
-/* gstreamer looks for this structure to register tensor_converters
+/**
+ * gstreamer looks for this structure to register tensor_converters
  *
  * exchange the string 'Template tensor_converter' with your tensor_converter description
  */
@@ -617,10 +622,11 @@ gst_tensor_converter_transform_caps (GstBaseTransform * trans,
   if (direction == GST_PAD_SINK) {
     GstStructure *structure;
     gchar *str;
-    /* Skip verifying if caps is compatible: let's assume sink_factory will do that. */
-    /** @todo: Verify if this assumption is correct */
-
-    /** @todo CRITICAL: Handle when caps is in range, not fixed */
+    /**
+     * Skip verifying if caps is compatible: let's assume sink_factory will do that.
+     * @todo: Verify if this assumption is correct
+     * @todo CRITICAL: Handle when caps is in range, not fixed
+     */
 
     /* Construct bogusFilter from caps (sinkpad) */
     ret = gst_tensor_converter_configure_tensor (caps, &bogusFilter);
@@ -671,9 +677,11 @@ gst_tensor_converter_transform_caps (GstBaseTransform * trans,
       tmp = gst_caps_from_string (str2);
       debug_print (!obj->silent, "Structure from caps to = %s\n", str2);
 
-      /* If given caps are in range for width/height,
-         we cannot configure tensor, however, we may return proper srcpad caps */
-      /** @todo: see if the error is from ranging width/height before entering here */
+      /**
+       * If given caps are in range for width/height,
+       * we cannot configure tensor, however, we may return proper srcpad caps
+       * @todo: see if the error is from ranging width/height before entering here
+       */
       return tmp;
     }
 
@@ -714,8 +722,10 @@ gst_tensor_converter_transform_caps (GstBaseTransform * trans,
     GstStructure *structure;
     gchar *str;
 
-    /* Construct possible GstCap (sinkpad) with src_factory */
-    /** @todo This supports video only! */
+    /**
+     * Construct possible GstCap (sinkpad) with src_factory
+     * @todo This supports video only!
+     */
     GstStaticCaps staticcap =
         GST_STATIC_CAPS
         ("video/x-raw, format = (string){RGB, BGRx}, views = (int)1, "
@@ -816,8 +826,10 @@ gst_tensor_converter_set_caps (GstBaseTransform * trans,
   GST_DEBUG_OBJECT (trans, "converting from  %" GST_PTR_FORMAT
       " to %" GST_PTR_FORMAT, incaps, outcaps);
 
-  /** @todo Supports video only */
-  /* input caps */
+  /**
+   * @todo Supports video only
+   * input caps
+   */
   if (!gst_video_info_from_caps (&in_info, incaps)) {
     err_print ("Cannot set_caps\n");
     return FALSE;
index b911e93..ed22c5a 100644 (file)
@@ -328,7 +328,7 @@ gst_tensor_filter_generate_dim_from_cap (GstCaps * caps, tensor_dim dim,
  * We need both type and dimension to do this.
  * This is supposed to be used by set_properties, restrting pad-caps before attaching input/output elements
  *
- * @TODO Looks like this is buggy!!!
+ * @todo Looks like this is buggy!!!
  */
 static GstCaps *
 gst_tensor_filter_fix_caps (GstTensor_Filter * filter, gboolean isInput,
@@ -654,7 +654,8 @@ gst_tensor_filter_get_property (GObject * object, guint prop_id,
 static gboolean
 tensor_filter_init (GstPlugin * tensor_filter)
 {
-  /* debug category for fltering log messages
+  /**
+   * debug category for fltering log messages
    *
    * exchange the string 'Template tensor_filter' with your description
    */
@@ -665,7 +666,8 @@ tensor_filter_init (GstPlugin * tensor_filter)
       GST_TYPE_TENSOR_FILTER);
 }
 
-/* PACKAGE: this is usually set by autotools depending on some _INIT macro
+/**
+ * PACKAGE: this is usually set by autotools depending on some _INIT macro
  * in configure.ac and then written into and defined in config.h, but we can
  * just set it ourselves here in case someone doesn't use autotools to
  * compile this code. GST_PLUGIN_DEFINE needs PACKAGE to be defined.
@@ -722,7 +724,7 @@ gst_tensor_filter_transform (GstBaseTransform * trans,
     outBufSize = tensor_element_size[filter->prop.outputType] *
         get_tensor_element_count (filter->prop.outputDimension);
     if (gst_buffer_get_size (outbuf) < outBufSize) {
-      /* @TODO: write a routine to say aloud when this happens */
+      /** @todo: write a routine to say aloud when this happens */
       gst_buffer_set_size (outbuf, outBufSize);
     }
     debug_print (!filter->prop.silent, "outbuf = %lu / expected = %lu\n",
@@ -749,7 +751,7 @@ gst_tensor_filter_transform (GstBaseTransform * trans,
     gst_tensor_filter_call (filter, retoutptr, invoke_NN, inptr, NULL);
     gst_buffer_unmap (inbuf, &inInfo);
 
-    /* @TODO Performance: cache get_tensor_element_count * tensor_element_size */
+    /** @todo Performance: cache get_tensor_element_count * tensor_element_size */
     mem = gst_memory_new_wrapped (0, retoutptr,
         get_tensor_element_count (filter->prop.outputDimension) *
         tensor_element_size[filter->prop.outputType],
@@ -1118,7 +1120,7 @@ gst_tensor_filter_fixate_caps (GstBaseTransform * trans,
   }
 
   /**
-   * @TODO ARCH-Decision required; are we going to (and do we need to)
+   * @todo ARCH-Decision required; are we going to (and do we need to)
    * support setOutputDimention (and get InputDim accordingly?)
    *
    * If not, we have done with it and emit error here if we still don't have
index a326dfc..fb149e5 100644 (file)
@@ -74,7 +74,8 @@ enum
 
 #define silent_debug(...) debug_print (!filter->silent, __VA_ARGS__)
 
-/* the capabilities of the inputs
+/**
+ * the capabilities of the inputs
  *
  * In v0.0.1, this is "bitmap" image stream
  */
@@ -316,7 +317,8 @@ gst_tensor_transform_get_property (GObject * object, guint prop_id,
 static gboolean
 tensor_transform_init (GstPlugin * tensor_transform)
 {
-  /* debug category for fltering log messages
+  /**
+   * debug category for fltering log messages
    *
    * exchange the string 'Template tensor_transform' with your description
    */
@@ -337,7 +339,8 @@ tensor_transform_init (GstPlugin * tensor_transform)
 #define PACKAGE "tensor_transform"
 #endif
 
-/* gstreamer looks for this structure to register tensor_transforms
+/**
+ * gstreamer looks for this structure to register tensor_transforms
  *
  * exchange the string 'Template tensor_transform' with your tensor_transform description
  */
@@ -359,7 +362,7 @@ static GstFlowReturn
 gst_tensor_transform_dimchg (GstTensor_Transform * filter,
     const uint8_t * inptr, uint8_t * outptr)
 {
-  /* @todo NYI */
+  /** @todo NYI */
   uint32_t *fromDim = filter->fromDim;
   uint32_t *toDim = filter->toDim;
   int from = filter->data_dimchg.from;
@@ -373,7 +376,7 @@ gst_tensor_transform_dimchg (GstTensor_Transform * filter,
 
 
   if (from == to) {
-    /* Useless memcpy. Do not call this or @todo do "IP" operation */
+    /** Useless memcpy. Do not call this or @todo do "IP" operation */
     memcpy (outptr, inptr, get_tensor_element_count (filter->fromDim) *
         tensor_element_size[filter->type]);
     g_printerr
@@ -386,10 +389,12 @@ gst_tensor_transform_dimchg (GstTensor_Transform * filter,
   g_assert (fromDim[from] == toDim[to]);
 
   if (from < to) {
-    /* Smaller-loop-ed a to larger-loop-ed b */
-    /* E.g., [N][H][W][c] (c:W:H:N) --> [N][c][H][W] (W:H:c:N) */
-
-    /* @todo CRITICAL-TODO: Optimize the performance! */
+    /**
+     * Smaller-loop-ed a to larger-loop-ed b
+     * E.g., [N][H][W][c] (c:W:H:N) --> [N][c][H][W] (W:H:c:N)
+     *
+     * @todo CRITICAL-TODO: Optimize the performance!
+     */
     for (i = NNS_TENSOR_RANK_LIMIT - 1; i > to; i--)
       loopLimit *= toDim[i];
     for (i = 0; i < to; i++)
@@ -415,9 +420,11 @@ gst_tensor_transform_dimchg (GstTensor_Transform * filter,
       }
     }
   } else {
-    /* Larger-loop-ed a to smaller-loop-ed b */
-    /* E.g., [N][c][H][W] (W:H:c:N) --> [N][H][W][c] (c:W:H:N) */
-    /* @todo NYI */
+    /**
+     * Larger-loop-ed a to smaller-loop-ed b
+     * E.g., [N][c][H][W] (W:H:c:N) --> [N][H][W][c] (c:W:H:N)
+     * @todo NYI
+     */
     g_assert (0);
   }
 
@@ -633,7 +640,7 @@ static GstCaps *
 gst_tensor_transform_transform_caps (GstBaseTransform * trans,
     GstPadDirection direction, GstCaps * caps, GstCaps * filtercap)
 {
-  /* @todo NYI: framerate configuration! */
+  /** @todo NYI: framerate configuration! */
   tensor_dim in, out;
   tensor_type type;
   gboolean ret;
@@ -683,7 +690,7 @@ static GstCaps *
 gst_tensor_transform_fixate_caps (GstBaseTransform * trans,
     GstPadDirection direction, GstCaps * caps, GstCaps * othercaps)
 {
-  /* @todo NYI: framerate configuration! */
+  /** @todo NYI: framerate configuration! */
   GstCaps *othercaps_candidate =
       gst_tensor_transform_transform_caps (trans, direction, caps, NULL);
   GstCaps *filtered_candidate =
@@ -730,5 +737,5 @@ gst_tensor_transform_transform_size (GstBaseTransform * trans,
   *othersize = size;            /* size of input = size of output */
   return TRUE;
 
-  /* @todo add verificastion procedure */
+  /** @todo add verificastion procedure */
 }
index 7540e9c..95e43f3 100644 (file)
@@ -33,7 +33,7 @@
 
 G_BEGIN_DECLS
 
-/* @TODO I'm not sure if the range is to be 1, 65535 or larger */
+/** @todo I'm not sure if the range is to be 1, 65535 or larger */
 #define GST_TENSOR_CAP_DEFAULT \
     "other/tensor, " \
     "rank = (int) [ 1, 4 ], " \
@@ -56,11 +56,14 @@ G_BEGIN_DECLS
     "rank = (int) [ 1, 4 ], " \
     "num_tensors = (int) [1, 65535], "\
     "framerate = (fraction) [ 0/1, 2147483647/1 ]"
-    /* type should be one of { float32, float64, int32, uint32, int16, uint16, int8, uint8 } */
-    /* "types = (string) uint8, uint8, uint8" \ */
-    /* Dimensions of Tensors for negotiation. It's comment out here,
-       but when we call gst_structure_get_string, it actually is working well.*/
-    /* "dimensions = (string) dim1:dim2:dim3:dim4, dim1:dim2:dim3:dim4" \ */
+    /**
+     * type should be one of
+     * { float32, float64, int32, uint32, int16, uint16, int8, uint8 }
+     * "types = (string) uint8, uint8, uint8"
+     * Dimensions of Tensors for negotiation. It's comment out here,
+       but when we call gst_structure_get_string, it actually is working well
+     * "dimensions = (string) dim1:dim2:dim3:dim4, dim1:dim2:dim3:dim4"
+     */
 
 /**
  * @brief Possible input stream types for other/tensor.
index 37af3f3..c6c4b01 100644 (file)
@@ -89,7 +89,7 @@ typedef enum {
 
   _TFC_FRAMERATE = 4,
 
-  /* @TODO Add "consistency checked. don't check it again" and implement .c accordingly. */
+  /** @todo Add "consistency checked. don't check it again" and implement .c accordingly. */
 } GstTensor_Filter_CheckStatus;
 
 typedef uint32_t tensor_dim[NNS_TENSOR_RANK_LIMIT];