Apply tizen coding rule 21/147521/1 accepted/tizen/unified/20170906.060721 submit/tizen/20170905.045152
authorHaejeong Kim <backto.kim@samsung.com>
Mon, 4 Sep 2017 23:56:25 +0000 (08:56 +0900)
committerHaejeong Kim <backto.kim@samsung.com>
Mon, 4 Sep 2017 23:56:25 +0000 (08:56 +0900)
Change-Id: Iab66ccac21b03e0d84eb4a928c204e34ff2e43c1

bmp/mm_util_bmp.c
gif/include/mm_util_gif.h
gif/mm_util_gif.c
gif/test/mm_util_gif_testsuite.c
imgcv/include/mm_util_imgcv_internal.h
imgp/include/mm_util_debug.h
imgp/include/mm_util_imgp.h
imgp/include/mm_util_imgp_internal.h
jpeg/include/mm_util_jpeg.h
png/mm_util_png.c

index 77997d6..cd9d9a8 100755 (executable)
@@ -38,7 +38,7 @@
 
 #define BYTES_PER_PIXEL 4
 
-#define BMP_SAFE_FREE(src) { if(src != NULL) {free(src); src = NULL;} }
+#define BMP_SAFE_FREE(src) { if (src != NULL) {free(src); src = NULL; } }
 
 void *__bitmap_create(int width, int height, unsigned int state);
 unsigned char *__bitmap_get_buffer(void *bitmap);
index 45420b4..e534215 100755 (executable)
@@ -57,16 +57,14 @@ typedef struct {
 /**
  * format for gif
  */
-typedef enum
-{
+typedef enum {
        MM_UTIL_GIF_FMT_RGBA8888,     /**< RGBA8888 format */
 } mm_util_gif_format;
 
 /**
  * Disposal mode for gif encoding
  */
-typedef enum
-{
+typedef enum {
        MM_UTIL_GIF_DISPOSAL_UNSPECIFIED = 0,     /**< No disposal specified. */
        MM_UTIL_GIF_DISPOSAL_DO_NOT      = 1,     /**< Leave image in place. */
        MM_UTIL_GIF_DISPOSAL_BACKGROUND  = 2,     /**< Set area too background color. */
@@ -75,14 +73,14 @@ typedef enum
 
 typedef struct {
        unsigned long long delay_time;          /**< Pre-display delay in 0.01sec units */
-       unsigned long width;                    /**< Width */
-       unsigned long height;                   /**< Height */
-       unsigned long x;                        /**< X position */
-       unsigned long y;                        /**< Y position */
+       unsigned long width;                    /**< Width */
+       unsigned long height;                   /**< Height */
+       unsigned long x;                        /**< X position */
+       unsigned long y;                        /**< Y position */
        bool is_transparent;                    /**< Is frame transparency set */
-       GifColorType transparent_color;         /**< Transparency color */
+       GifColorType transparent_color;         /**< Transparency color */
        mm_util_gif_disposal disposal_mode;     /**< Disposal mode */
-       void *data;                             /**< Data */
+       void *data;                             /**< Data */
 } mm_util_gif_frame_data;
 
 #ifdef GIF_ENCODER_V2
index 90133cc..d4de911 100755 (executable)
@@ -346,7 +346,7 @@ static int __save_buffer_to_gif(GifFileType *GifFile, GifByteType *OutputBuffer,
        }
 
        extension[0] = frame->disposal_mode << 2;
-       if(frame->is_transparent) {
+       if (frame->is_transparent) {
                extension[0] |= 1;
                extension[3] = transparent_index;
        } else {
@@ -568,7 +568,7 @@ int __gif_make_color_map(gif_image_s *gif_image)
 
        mm_util_retvm_if(gif_image == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
 
-       unsigned long num_of_pixels = gif_image->image_desc.Width* gif_image->image_desc.Height;
+       unsigned long num_of_pixels = gif_image->image_desc.Width * gif_image->image_desc.Height;
 
        /* make colormap and quantization for the color table of gif */
        ret = __gif_extract_rgb(gif_image, num_of_pixels, &red, &green, &blue);
@@ -622,7 +622,7 @@ int __gif_get_index_in_colormap(gif_image_s *gif_image)
        gif_image->graphic_control_block.TransparentColor =  -1;
 
        for (i = 0; i < gif_image->image_desc.ColorMap->ColorCount; i++) {
-               if(gif_image->image_desc.ColorMap->Colors[i].Red == gif_image->transparent_color.Red &&
+               if (gif_image->image_desc.ColorMap->Colors[i].Red == gif_image->transparent_color.Red &&
                        gif_image->image_desc.ColorMap->Colors[i].Green == gif_image->transparent_color.Green &&
                        gif_image->image_desc.ColorMap->Colors[i].Blue == gif_image->transparent_color.Blue) {
                        gif_image->graphic_control_block.TransparentColor =  i;
@@ -746,7 +746,7 @@ int _gif_encode_move_to_file(const char *dst)
 int _gif_encode_move_to_mem(const unsigned char *src, unsigned long src_size, void **dst, unsigned long *dst_size)
 {
        unsigned char *buffer = NULL;
-       mm_util_retvm_if(src == NULL || dst == NULL || dst_size == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
+       mm_util_retvm_if(src == NULL || dst == NULL || dst_size == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
        mm_util_retvm_if(src_size == 0, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
 
        mm_util_debug("src_size: %lu", src_size);
@@ -754,7 +754,7 @@ int _gif_encode_move_to_mem(const unsigned char *src, unsigned long src_size, vo
        buffer = (unsigned char *)calloc(1, src_size);
        mm_util_retvm_if(buffer == NULL, MM_UTIL_ERROR_OUT_OF_MEMORY, "memory allocation failed");
 
-       memcpy(buffer, src, src_size);
+       memcpy(buffer, src, src_size);
 
        *dst = buffer;
        *dst_size = src_size;
@@ -1231,7 +1231,7 @@ int mm_util_gif_encode_set_repeat(mm_gif_file_h gif_file_h, gboolean repeat_mode
        mm_util_info("repeat = %d, count = %d", repeat_mode, repeat_count);
 
        gif_file->is_repeat = repeat_mode;
-       gif_file->repeat_count = repeat_count;
+       gif_file->repeat_count = repeat_count;
 
        return MM_UTIL_ERROR_NONE;
 }
@@ -1341,7 +1341,7 @@ int mm_util_gif_encode_save(mm_gif_file_h gif_file_h)
        mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "_gif_encode_close_file failed");
 
        if (gif_file->filename != NULL) {
-               ret= _gif_encode_move_to_file(gif_file->filename);
+               ret = _gif_encode_move_to_file(gif_file->filename);
                mm_util_retvm_if(ret != MM_UTIL_ERROR_NONE, ret, "__move_tmp_to_origin failed");
        } else if (gif_file->write_data_ptr.mem != NULL) {
                ret = _gif_encode_move_to_mem(gif_file->buffer, gif_file->write_data_ptr.size,
@@ -1391,11 +1391,10 @@ int mm_util_gif_enocde_get_image_handle(mm_gif_file_h gif_file_h, const int inde
        mm_util_retvm_if(gif_image_h == NULL, MM_UTIL_ERROR_INVALID_PARAMETER, "Invalid parameter");
        mm_util_retvm_if(gif_file->is_started, MM_UTIL_ERROR_INVALID_OPERATION, "Encoding has already started");
 
-       if (index < gif_file->saved_image_count) {
+       if (index < gif_file->saved_image_count)
                *gif_image_h = (mm_gif_image_h)gif_file->saved_image[index];
-       } else {
+       else
                *gif_image_h = NULL;
-       }
 
        return MM_UTIL_ERROR_NONE;
 }
index 92cd78a..2ef3f76 100755 (executable)
@@ -101,9 +101,9 @@ int main(int argc, char *argv[])
        }
 #ifdef GIF_ENCODER_V2
        else if (!strcmp("encode-agif", argv[1]) || !strcmp("encode-mem-agif", argv[1])) {
-               if (!strcmp("encode-mem-agif", argv[1])) {
+               if (!strcmp("encode-mem-agif", argv[1]))
                        g_encode_mem = TRUE;
-               }
+
                fprintf(stderr, "\tencode-agif %s\n", argv[1]);
                struct dirent *dp = NULL;
                DIR *fd = opendir(argv[2]);
@@ -167,8 +167,7 @@ int main(int argc, char *argv[])
        if (g_encode_mem) {
                ret = mm_util_gif_encode_set_mem(gif_file, (void **)&encoded_gif_mem, &encoded_gif_size);
                fprintf(stderr, "\t mm_util_gif_encode_set_mem [%d]\n", ret);
-       }
-       else {
+       } else {
                ret = mm_util_gif_encode_set_file(gif_file, ENCODED_FILEPATH);
                fprintf(stderr, "\t mm_util_gif_enc_set_file [%d]\n", ret);
        }
@@ -187,7 +186,7 @@ int main(int argc, char *argv[])
                        fprintf(stderr, "\t mm_util_gif_image_set_image [%d]\n", ret);
                        ret = mm_util_gif_image_set_delay_time(gif_image, 20);
                        fprintf(stderr, "\t mm_util_gif_image_set_delay_time [%d]\n", ret);
-                       ret = mm_util_gif_image_set_position(gif_image,0, 0,files[i].decoded.width, files[i].decoded.height);
+                       ret = mm_util_gif_image_set_position(gif_image, 0, 0, files[i].decoded.width, files[i].decoded.height);
                        fprintf(stderr, "\t mm_util_gif_image_set_position [%d]\n", ret);
                        ret = mm_util_gif_image_set_disposal_mode(gif_image, MM_UTIL_GIF_DISPOSAL_UNSPECIFIED);
                        fprintf(stderr, "\t mm_util_gif_image_set_disposal_mode [%d]\n", ret);
index b3e2cbb..b1c8dc1 100755 (executable)
@@ -30,8 +30,7 @@
 #include <opencv/cv.h>
 #include <opencv2/imgproc/imgproc_c.h>
 
-typedef struct _mm_util_imgcv_s
-{
+typedef struct _mm_util_imgcv_s {
        IplImage *inImg;
 
        int hBins; /**< Number of bins of Hue channle */
index ce8afe9..ca9e747 100755 (executable)
@@ -1,87 +1,87 @@
-/*\r
- * libmm-utility\r
- *\r
- * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.\r
- *\r
- * Contact: YoungHun Kim <yh8004.kim@samsung.com>\r
- *\r
- * Licensed under the Apache License, Version 2.0 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- * http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- *\r
- */\r
-#ifndef __MM_UTILITY_DEBUG_H__\r
-#define __MM_UTILITY_DEBUG_H__\r
-\r
-#include <dlog.h>\r
-\r
-#ifdef __cplusplus\r
-extern "C"\r
-{\r
-#endif\r
-\r
-#ifdef LOG_TAG\r
-#undef LOG_TAG\r
-#endif\r
-\r
-#define LOG_TAG "MM_UTIL"\r
-\r
-#define FONT_COLOR_RESET    "\033[0m"\r
-#define FONT_COLOR_RED      "\033[31m"\r
-\r
-#define mm_util_debug(fmt, arg...) do { \\r
-               LOGD(FONT_COLOR_RESET""fmt"", ##arg);     \\r
-       } while (0)\r
-\r
-#define mm_util_info(fmt, arg...) do { \\r
-               LOGI(FONT_COLOR_RESET""fmt"", ##arg);     \\r
-       } while (0)\r
-\r
-#define mm_util_warn(fmt, arg...) do { \\r
-               LOGW(FONT_COLOR_RESET""fmt"", ##arg);     \\r
-       } while (0)\r
-\r
-#define mm_util_error(fmt, arg...) do { \\r
-               LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \\r
-       } while (0)\r
-\r
-#define mm_util_fenter() do { \\r
-               LOGD(FONT_COLOR_RESET"<Enter>");     \\r
-       } while (0)\r
-\r
-#define mm_util_fleave() do { \\r
-               LOGD(FONT_COLOR_RESET"<Leave>");     \\r
-       } while (0)\r
-\r
-#define mm_util_retm_if(expr, fmt, arg...) do { \\r
-               if(expr) { \\r
-                       LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \\r
-                       return; \\r
-               } \\r
-       } while (0)\r
-\r
-#define mm_util_retvm_if(expr, val, fmt, arg...) do { \\r
-               if(expr) { \\r
-                       LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \\r
-                       return (val); \\r
-               } \\r
-       } while (0)\r
-\r
-#define MMUTIL_SAFE_FREE(x)                            { if (x) { free(x); x = NULL; } }\r
-/**\r
-* @}\r
-*/\r
-\r
-#ifdef __cplusplus\r
-}\r
-#endif\r
-\r
-#endif /*__MM_UTILITY_DEBUG_H__*/\r
+/*
+ * libmm-utility
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: YoungHun Kim <yh8004.kim@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+#ifndef __MM_UTILITY_DEBUG_H__
+#define __MM_UTILITY_DEBUG_H__
+
+#include <dlog.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+
+#define LOG_TAG "MM_UTIL"
+
+#define FONT_COLOR_RESET    "\033[0m"
+#define FONT_COLOR_RED      "\033[31m"
+
+#define mm_util_debug(fmt, arg...) do { \
+               LOGD(FONT_COLOR_RESET""fmt"", ##arg);     \
+       } while (0)
+
+#define mm_util_info(fmt, arg...) do { \
+               LOGI(FONT_COLOR_RESET""fmt"", ##arg);     \
+       } while (0)
+
+#define mm_util_warn(fmt, arg...) do { \
+               LOGW(FONT_COLOR_RESET""fmt"", ##arg);     \
+       } while (0)
+
+#define mm_util_error(fmt, arg...) do { \
+               LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \
+       } while (0)
+
+#define mm_util_fenter() do { \
+               LOGD(FONT_COLOR_RESET"<Enter>");     \
+       } while (0)
+
+#define mm_util_fleave() do { \
+               LOGD(FONT_COLOR_RESET"<Leave>");     \
+       } while (0)
+
+#define mm_util_retm_if(expr, fmt, arg...) do { \
+               if (expr) { \
+                       LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \
+                       return; \
+               } \
+       } while (0)
+
+#define mm_util_retvm_if(expr, val, fmt, arg...) do { \
+               if (expr) { \
+                       LOGE(FONT_COLOR_RED""fmt""FONT_COLOR_RESET, ##arg);     \
+                       return (val); \
+               } \
+       } while (0)
+
+#define MMUTIL_SAFE_FREE(x)                            { if (x) { free(x); x = NULL; } }
+/**
+* @}
+*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__MM_UTILITY_DEBUG_H__*/
index d303b46..f8e70be 100755 (executable)
@@ -42,8 +42,7 @@ typedef bool (*mm_util_completed_callback)(media_packet_h *dst, int error, void
 /**
  * error type
  */
-typedef enum
-{
+typedef enum {
        MM_UTIL_ERROR_NONE =              0,       /**< Successful */
        MM_UTIL_ERROR_INVALID_PARAMETER = -1,      /**< Invalid parameter */
        MM_UTIL_ERROR_OUT_OF_MEMORY = -2,          /**< Out of memory */
@@ -55,8 +54,7 @@ typedef enum
 /**
  * Image formats
  */
-typedef enum
-{
+typedef enum {
        /* YUV planar format */
        MM_UTIL_IMG_FMT_YUV420 = 0x00,  /**< YUV420 format - planer YV12*/
        MM_UTIL_IMG_FMT_YUV422,         /**< YUV422 format - planer */
@@ -86,8 +84,7 @@ typedef enum
 /**
  * Image rotation types
  */
-typedef enum
-{
+typedef enum {
        MM_UTIL_ROTATE_0,               /**< Rotation 0 degree - no effect */
        MM_UTIL_ROTATE_90,              /**< Rotation 90 degree */
        MM_UTIL_ROTATE_180,             /**< Rotation 180 degree */
@@ -114,10 +111,10 @@ int mm_util_get_image_size(mm_util_img_format format, unsigned int width, unsign
 
 /**
  *
- * @remark     Transform Handle Creation
+ * @remark     Transform Handle Creation
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then handle creation succeed
  *             else if the result is -1, then handle creation failed
  */
@@ -125,12 +122,12 @@ int mm_util_create(mm_util_imgp_h *imgp_handle);
 
 /**
  *
- * @remark     Transform Handle Creation
+ * @remark     Transform Handle Creation
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
  * @param      mode                    [in]                    User can use the accelerated image processing
 
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then handle creation succeed
  *             else if the result is -1, then handle creation failed
  */
@@ -138,12 +135,12 @@ int mm_util_set_hardware_acceleration(mm_util_imgp_h imgp_handle, bool mode);
 
 /**
  *
- * @remark     Transform Handle Creation
+ * @remark     Transform Handle Creation
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
  * @param      colorspace      [in]                    colorspace The colorspace of the destination image buffer
 
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then handle creation succeed
  *             else if the result is -1, then handle creation failed
  */
@@ -151,13 +148,13 @@ int mm_util_set_colorspace_convert(mm_util_imgp_h imgp_handle, mm_util_img_forma
 
 /**
  *
- * @remark     Transform Handle Creation
+ * @remark     Transform Handle Creation
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
  * @param      width           [in]                    width The width of destination image buffer
  * @param      height          [in]                    height The height of destination image buffer
 
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then handle creation succeed
  *             else if the result is -1, then handle creation failed
  */
@@ -165,12 +162,12 @@ int mm_util_set_resolution(mm_util_imgp_h imgp_handle, unsigned int width, unsig
 
 /**
  *
- * @remark     Transform Handle Creation
+ * @remark     Transform Handle Creation
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
  * @param      rotation                [in]                    dest_rotation The rotation value of destination image buffer
 
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then handle creation succeed
  *             else if the result is -1, then handle creation failed
  */
@@ -178,7 +175,7 @@ int mm_util_set_rotation(mm_util_imgp_h imgp_handle, mm_util_img_rotate_type rot
 
 /**
  *
- * @remark     Transform Handle Creation
+ * @remark     Transform Handle Creation
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
  * @param      start_x                 [in]                    The start x position of cropped image buffer
@@ -186,7 +183,7 @@ int mm_util_set_rotation(mm_util_imgp_h imgp_handle, mm_util_img_rotate_type rot
  * @param      end_x                   [in]                    The start x position of cropped image buffer
  * @param      end_y                   [in]                    The start y position of cropped image buffer
 
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then handle creation succeed
  *             else if the result is -1, then handle creation failed
  */
@@ -194,12 +191,12 @@ int mm_util_set_crop_area(mm_util_imgp_h imgp_handle, unsigned int start_x, unsi
 
 /**
  *
- * @remark     Transform Handle Creation
+ * @remark     Transform Handle Creation
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
  * @param      is_completed            [in/out]                Users can obtain the value of the conversion about whether to complete
 
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then handle creation succeed
  *             else if the result is -1, then handle creation failed
  */
@@ -208,13 +205,13 @@ int mm_util_transform_is_completed(mm_util_imgp_h imgp_handle, bool *is_complete
 
 /**
  *
- * @remark     Image Transform Pipeline
+ * @remark     Image Transform Pipeline
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
  * @param      completed_callback                                      [in]                    Completed_callback
  * @param      user_param                                              [in]                    User parameter which is received from user when callback function was set
 
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then you can use output_Filename pointer(char** value)
  *             else if the result is -1, then do not execute when the colopsapce converter is not supported
  */
@@ -222,10 +219,10 @@ int mm_util_transform(mm_util_imgp_h imgp_handle, media_packet_h src, mm_util_co
 
 /**
  *
- * @remark     Transform Handle Destory
+ * @remark     Transform Handle Destory
  *
  * @param      imgp_handle             [in]                    image_util_imgp_h
- * @return     This function returns transform processor result value
+ * @return     This function returns transform processor result value
  *             if the result is 0, then handle destory succeed
  *             else if the result is -1, then handle destory failed
  */
@@ -246,8 +243,7 @@ int mm_util_destroy(mm_util_imgp_h imgp_handle);
  * @see         mm_util_img_format
  * @since       R1, 1.0
  */
-int mm_util_convert_colorspace(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format,
-                           unsigned char *dst, mm_util_img_format dst_format);
+int mm_util_convert_colorspace(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format, unsigned char *dst, mm_util_img_format dst_format);
 
 /**
  * This function resizes the source image.
@@ -265,8 +261,7 @@ int mm_util_convert_colorspace(const unsigned char *src, unsigned int src_width,
  * @see         mm_util_img_format
  * @since       R1, 1.0
  */
-int mm_util_resize_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format,
-                     unsigned char *dst, unsigned int *dst_width, unsigned int *dst_height);
+int mm_util_resize_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format, unsigned char *dst, unsigned int *dst_width, unsigned int *dst_height);
 
 /**
  * This function rotates the source image.
@@ -285,8 +280,7 @@ int mm_util_resize_image(const unsigned char *src, unsigned int src_width, unsig
  * @see         mm_util_img_format, mm_util_img_rotate_type
  * @since       R1, 1.0
  */
-int mm_util_rotate_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format,
-                     unsigned char *dst, unsigned int *dst_width, unsigned int *dst_height, mm_util_img_rotate_type angle);
+int mm_util_rotate_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format, unsigned char *dst, unsigned int *dst_width, unsigned int *dst_height, mm_util_img_rotate_type angle);
 
 /**
  * This function crop the source image.
@@ -308,7 +302,7 @@ int mm_util_rotate_image(const unsigned char *src, unsigned int src_width, unsig
  * @since       R1, 1.0
  */
 int mm_util_crop_image(const unsigned char *src, unsigned int src_width, unsigned int src_height, mm_util_img_format src_format,
-                     unsigned int crop_start_x, unsigned int crop_start_y, unsigned int *crop_dest_width, unsigned int *crop_dest_height, unsigned char *dst);
+                       unsigned int crop_start_x, unsigned int crop_start_y, unsigned int *crop_dest_width, unsigned int *crop_dest_height, unsigned char *dst);
 
 #ifdef __cplusplus
 }
index 63b12ee..f10eaaa 100755 (executable)
@@ -43,8 +43,8 @@
 #define PATH_NEON_LIB                                  LIBPREFIX  "/libmmutil_imgp_neon.so"
 #define PATH_GSTCS_LIB                                 LIBPREFIX "/libmmutil_imgp_gstcs.so"
 
-#define IMGP_FUNC_NAME                                 "mm_imgp"
-#define IMGP_FREE(src) { if(src != NULL) {g_free(src); src = NULL;} }
+#define IMGP_FUNC_NAME                         "mm_imgp"
+#define IMGP_FREE(src) { if (src != NULL) {g_free(src); src = NULL; } }
 #define SCMN_IMGB_MAX_PLANE         (4)
 #define MAX_SRC_BUF_NUM          12    /* Max number of upstream src plugins's buffer */
 #define MAX_DST_BUF_NUM          12
@@ -78,8 +78,7 @@
 /**
  * Image Process Info for dlopen
  */
-typedef struct _imgp_info_s
-{
+typedef struct _imgp_info_s {
        char *input_format_label;
        mm_util_img_format src_format;
        unsigned int src_width;
@@ -95,32 +94,28 @@ typedef struct _imgp_info_s
 } imgp_info_s;
 
 /* Enumerations */
-typedef enum
-{
+typedef enum {
        IMGP_CSC = 0,
        IMGP_RSZ,
        IMGP_ROT,
 } imgp_type_e;
 
 /* Enumerations */
-typedef enum
-{
+typedef enum {
        IMGP_NEON = 0,
        IMGP_GSTCS,
 } imgp_plugin_type_e;
 
-typedef enum
-{
-    MM_UTIL_ROTATION_NONE = 0,  /**< None */
-    MM_UTIL_ROTATION_90 = 1,    /**< Rotation 90 degree */
-    MM_UTIL_ROTATION_180,       /**< Rotation 180 degree */
-    MM_UTIL_ROTATION_270,       /**< Rotation 270 degree */
-    MM_UTIL_ROTATION_FLIP_HORZ, /**< Flip horizontal */
-    MM_UTIL_ROTATION_FLIP_VERT, /**< Flip vertical */
+typedef enum {
+       MM_UTIL_ROTATION_NONE = 0,  /**< None */
+       MM_UTIL_ROTATION_90 = 1,    /**< Rotation 90 degree */
+       MM_UTIL_ROTATION_180,       /**< Rotation 180 degree */
+       MM_UTIL_ROTATION_270,       /**< Rotation 270 degree */
+       MM_UTIL_ROTATION_FLIP_HORZ, /**< Flip horizontal */
+       MM_UTIL_ROTATION_FLIP_VERT, /**< Flip vertical */
 } mm_util_rotation_e;
 
-typedef struct
-{
+typedef struct {
        void *user_data;
        mm_util_completed_callback completed_cb;
 } mm_util_cb_s;
@@ -135,8 +130,7 @@ typedef enum {
        MM_UTIL_IPP_CTRL_START = 1,
 } ConvertIppCtrl;
 
-typedef struct
-{
+typedef struct {
        gint drm_fd;
        media_packet_h src_packet;
        void *src;
@@ -189,4 +183,4 @@ typedef struct
 
 #ifdef __cplusplus
 }
-#endif
\ No newline at end of file
+#endif
index 7943d66..bc1549a 100755 (executable)
@@ -37,8 +37,7 @@ extern "C" {
 /**
  * YUV format for jpeg
  */
-typedef enum
-{
+typedef enum {
        /* YUV planar format */
        MM_UTIL_JPEG_FMT_YUV420 = 0x00,  /**< YUV420 format - planer I420 */
        MM_UTIL_JPEG_FMT_YUV422,         /**< YUV422 format - planer */
@@ -63,8 +62,7 @@ typedef enum
 /**
  * downscale decoding for jpeg
  */
-typedef enum
-{
+typedef enum {
        MM_UTIL_JPEG_DECODE_DOWNSCALE_1_1 = 1,  /** 1/1 downscale decode */
        MM_UTIL_JPEG_DECODE_DOWNSCALE_1_2 = 2,  /** 1/2 downscale decode */
        MM_UTIL_JPEG_DECODE_DOWNSCALE_1_4 = 4,  /** 1/4 downscale decode */
@@ -74,8 +72,7 @@ typedef enum
 /**
  * YUV data
  */
-typedef struct
-{
+typedef struct {
        mm_util_jpeg_yuv_format format;     /**< pixel format*/
        int width;                          /**< width */
        int height;                         /**< heigt */
@@ -98,14 +95,13 @@ typedef struct
  * @see         mm_util_jpeg_yuv_format
  * @since       R1, 1.0
  */
-int mm_util_jpeg_encode_to_file (const char *filename, void *src, int width, int height, mm_util_jpeg_yuv_format fmt, int quality);
+int mm_util_jpeg_encode_to_file(const char *filename, void *src, int width, int height, mm_util_jpeg_yuv_format fmt, int quality);
 
 
 /**
  * This function encodes raw file to jpeg into memory.
  *
- * @param mem [out]         pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
-                            After using it, please free the allocated memory.
+ * @param mem [out]         pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
  * @param size [in]         output stream size, that is, encoded stream size
  * @param src [in]          pointer of input stream pointer (raw data)
  * @param width [in]        width of src data
@@ -117,14 +113,13 @@ int mm_util_jpeg_encode_to_file (const char *filename, void *src, int width, int
  * @see         mm_util_jpeg_yuv_format
  * @since       R1, 1.0
  */
-int mm_util_jpeg_encode_to_memory (void **mem, unsigned int *size, void *src, int width, int height, mm_util_jpeg_yuv_format fmt, int quality);
+int mm_util_jpeg_encode_to_memory(void **mem, unsigned int *size, void *src, int width, int height, mm_util_jpeg_yuv_format fmt, int quality);
 
 
 /**
  * This function extracts yuv data from jpeg file
  *
- * @param decoded [out]     pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
-                            After using it, please free the allocated memory.
+ * @param decoded [out]     pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
  * @param filename [in]     input file name, encoded stream file
  * @param fmt [in]          color format
  * @return This function returns zero on success, or negative value with error code.
@@ -138,8 +133,7 @@ int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, const char *fi
 /**
  * This function extracts yuv data from jpeg buffer
  *
- * @param decoded [out]     pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
-                            After using it, please free the allocated memory.
+ * @param decoded [out]     pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
  * @param src [in]          input stream pointer(pointer of encoded jpeg stream data)
  * @param size [in]         size of input stream(size of pointer of encoded jpeg stream data)
  * @param fmt [in]          color format
@@ -148,13 +142,12 @@ int mm_util_decode_from_jpeg_file(mm_util_jpeg_yuv_data *decoded, const char *fi
  * @see         mm_util_jpeg_yuv_data, mm_util_jpeg_yuv_format
  * @since       R1, 1.0
  */
-int mm_util_decode_from_jpeg_memory (mm_util_jpeg_yuv_data *decoded, void *src, unsigned int size, mm_util_jpeg_yuv_format fmt);
+int mm_util_decode_from_jpeg_memory(mm_util_jpeg_yuv_data *decoded, void *src, unsigned int size, mm_util_jpeg_yuv_format fmt);
 
 /**
  * This function extracts yuv data from jpeg file with downscale decode option
  *
- * @param decoded [out]     pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
-                            After using it, please free the allocated memory.
+ * @param decoded [out]     pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
  * @param filename [in]     input file name, encoded stream file
  * @param fmt [in]          color format
  * @param downscale [in]       downscale value
@@ -168,8 +161,7 @@ int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_data *decoded,
 /**
  * This function extracts yuv data from jpeg buffer with downscale decode option
  *
- * @param decoded [out]     pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer.
-                            After using it, please free the allocated memory.
+ * @param decoded [out]     pointer of output stream pointer, that is, pointer of encoded jpeg stream pointer. After using it, please free the allocated memory.
  * @param src [in]          input stream pointer(pointer of encoded jpeg stream data)
  * @param size [in]         size of input stream(size of pointer of encoded jpeg stream data)
  * @param fmt [in]          color format
@@ -179,7 +171,7 @@ int mm_util_decode_from_jpeg_file_with_downscale(mm_util_jpeg_yuv_data *decoded,
  * @see         mm_util_jpeg_yuv_data, mm_util_jpeg_yuv_format
  * @since       R1, 1.0
  */
-int mm_util_decode_from_jpeg_memory_with_downscale (mm_util_jpeg_yuv_data *decoded, void *src, unsigned int size, mm_util_jpeg_yuv_format fmt, mm_util_jpeg_decode_downscale downscale);
+int mm_util_decode_from_jpeg_memory_with_downscale(mm_util_jpeg_yuv_data *decoded, void *src, unsigned int size, mm_util_jpeg_yuv_format fmt, mm_util_jpeg_decode_downscale downscale);
 
 
 #ifdef __cplusplus
index c1b1b1b..01c6f39 100755 (executable)
@@ -468,9 +468,8 @@ int write_png(void **data, mm_util_png_data *encoded, FILE *fp)
 
        row_pointers = png_malloc(png_ptr, sizeof(png_bytep) * encoded->height);
 
-       for (row_index = 0; row_index < encoded->height; row_index++) {
+       for (row_index = 0; row_index < encoded->height; row_index++)
                row_pointers[row_index] = (*data) + (row_index * encoded->png.rowbytes);
-       }
 
        png_write_info(png_ptr, info_ptr);
        png_write_image(png_ptr, row_pointers);