Remove unused function 52/244152/3 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified tizen_6.0 tizen_6.0_hotfix tizen_6.5 accepted/tizen/6.0/unified/20201030.121044 accepted/tizen/6.0/unified/hotfix/20201103.050100 accepted/tizen/6.5/unified/20211028.120323 accepted/tizen/unified/20200917.055756 submit/tizen/20200916.012329 submit/tizen/20200917.004955 submit/tizen_6.0/20201029.205103 submit/tizen_6.0_hotfix/20201102.192503 submit/tizen_6.0_hotfix/20201103.114803 submit/tizen_6.5/20211028.162401 tizen_6.0.m2_release tizen_6.5.m2_release
authorhj kim <backto.kim@samsung.com>
Tue, 15 Sep 2020 08:37:38 +0000 (17:37 +0900)
committerhj kim <backto.kim@samsung.com>
Tue, 15 Sep 2020 08:51:32 +0000 (17:51 +0900)
DCM-service tried resizing to speed up face detection. but it affected to the accuracy.
media-vision improved it's performance, so resizing in dcm-service is not needed.

Change-Id: Id03fc167be270cb848dc0141e3bcd0a461173f68

libdcm-util/dcm_image_codec.c
libdcm-util/include/dcm_image_codec.h
packaging/dcm-service.spec
src/dcm_svc_internal.c

index 9fd7bb8e64bbb593c3e79da9c76edb602a7ff59f..8fc2f1baa99cfd53992ed00306a6d690fee87ace 100755 (executable)
@@ -35,40 +35,11 @@ typedef enum {
        ROT_270 = 8
 } dcm_exif_orientation_e;
 
-static bool __dcm_get_optimized_wh(unsigned int src_width, unsigned int src_height, unsigned int *calc_width, unsigned int *calc_height)
-{
-       *calc_width = 0;
-       *calc_height = 0;
-
-       if (src_width <= OPT_IMAGE_WIDTH && src_height <= OPT_IMAGE_HEIGHT) {
-               dcm_debug("Original image is smaller than target image");
-               *calc_width = src_width;
-               *calc_height = src_height;
-               return FALSE;
-       }
-
-       if (src_width > src_height) {
-               *calc_width = OPT_IMAGE_WIDTH;
-               *calc_height = (int)(src_height * (((double) OPT_IMAGE_WIDTH) / ((double) src_width)));
-       } else {
-               *calc_width = (int)(src_width * (((double) OPT_IMAGE_HEIGHT) / ((double) src_height)));
-               *calc_height = OPT_IMAGE_HEIGHT;
-       }
-
-       return TRUE;
-}
-
-int dcm_decode_image(const char *file_path, const int orientation, const gboolean resize, unsigned char **image_buffer, size_t *size,
+int dcm_decode_image(const char *file_path, const int orientation, unsigned char **image_buffer, size_t *size,
        unsigned int *buff_width, unsigned int *buff_height)
 {
        int ret = MS_MEDIA_ERR_NONE;
-       unsigned int width = 0;
-       unsigned int height = 0;
-       unsigned int resized_width = 0;
-       unsigned int resized_height = 0;
-       mm_util_img_codec_type type = IMG_CODEC_UNKNOWN_TYPE;
        mm_util_rotate_type_e rotation = MM_UTIL_ROTATE_NUM;
-       mm_util_image_h resize_dst_handle = NULL;
        mm_util_image_h dst_handle = NULL;
        mm_util_color_format_e format = MM_UTIL_COLOR_NUM;
 
@@ -101,49 +72,13 @@ int dcm_decode_image(const char *file_path, const int orientation, const gboolea
                return MS_MEDIA_ERR_INTERNAL;
        }
 
-       if (resize) {
-               /* Get the optimized width/height to enhance performance for big size image */
-               ret = mm_util_extract_image_info(file_path, &type, &width, &height);
-               if (ret != MM_UTIL_ERROR_NONE)
-                       dcm_error("Failed to get image info!err: %d", ret);
-
-               if (__dcm_get_optimized_wh(width, height, &resized_width, &resized_height)) {
-                       /* Resize the big size image to enhance performance for big size image */
-                       ret = mm_util_resize_P_B(file_path, resized_width, resized_height, MM_UTIL_COLOR_RGBA, &resize_dst_handle);
-                       if (ret != MM_UTIL_ERROR_NONE) {
-                               dcm_error("Failed to resize image!err: %d", ret);
-                               ret = MS_MEDIA_ERR_INTERNAL;
-                               goto ERROR;
-                       }
-
-                       ret = mm_util_rotate_B_B(resize_dst_handle, rotation, &dst_handle);
-                       if (ret != MM_UTIL_ERROR_NONE) {
-                               dcm_error("Failed to rotate image!err: %d", ret);
-                               ret = MS_MEDIA_ERR_INTERNAL;
-                               goto ERROR;
-                       }
-               } else {
-                       ret = mm_util_rotate_P_B(file_path, rotation, MM_UTIL_COLOR_RGBA, &dst_handle);
-                       if (ret != MM_UTIL_ERROR_NONE) {
-                               dcm_error("Failed to rotate image buffer! err: %d", ret);
-                               ret = MS_MEDIA_ERR_INTERNAL;
-                               goto ERROR;
-                       }
-               }
-       } else {
-               ret = mm_util_rotate_P_B(file_path, rotation, MM_UTIL_COLOR_RGBA, &dst_handle);
-               if (ret != MM_UTIL_ERROR_NONE) {
-                       dcm_error("Failed to rotate image buffer! err: %d", ret);
-                       ret = MS_MEDIA_ERR_INTERNAL;
-                       goto ERROR;
-               }
+       ret = mm_util_rotate_P_B(file_path, rotation, MM_UTIL_COLOR_RGBA, &dst_handle);
+       if (ret != MM_UTIL_ERROR_NONE) {
+               dcm_error("Failed to rotate image buffer! err: %d", ret);
+               return MS_MEDIA_ERR_INTERNAL;
        }
 
        mm_image_get_image(dst_handle, buff_width, buff_height, &format, image_buffer, size);
-
-ERROR:
-
-       mm_image_destroy_image(resize_dst_handle);
        mm_image_destroy_image(dst_handle);
 
        dcm_debug_fleave();
index d40e4dbf1db2dbd4782472a4eed7e9e6ad5f1cc8..037ff19b8e84233906699bc64063d24a470ed9d7 100755 (executable)
@@ -34,7 +34,7 @@ typedef enum {
        DCM_IMAGE_FORMAT_RGBA,
 } dcm_image_format_e;
 
-int dcm_decode_image(const char *file_path, const int orientation, const gboolean resize, unsigned char **image_buffer, size_t *size,
+int dcm_decode_image(const char *file_path, const int orientation, unsigned char **image_buffer, size_t *size,
        unsigned int *buff_width, unsigned int *buff_height);
 
 #ifdef __cplusplus
index 63db162855e8292d2fbaca6e64c860af37c6ba73..137166797a18daf5c14581fe2cef78e301424b8d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dcm-service
 Summary:    A media DCM(Digital Contents Management) Service
-Version:    0.2.4
+Version:    0.2.5
 Release:    0
 Group:      Multimedia/Service
 License:    Apache-2.0
index 730e5a438def24b4cfc4766615d4e2d0d3a2d25d..0cff100f0aa6aeb2852e63684317b4e50c72f304 100755 (executable)
@@ -63,7 +63,7 @@ static int __dcm_scan_process(dcm_svc_item_s *scan_item, uid_t uid)
                        return MS_MEDIA_ERR_INVALID_PARAMETER;
                }
 
-               ret = dcm_decode_image((const char *) (scan_item->file_path), image_info.orientation, FALSE, &(image_info.pixel), &(image_info.size), &(image_info.buffer_width), &(image_info.buffer_height));
+               ret = dcm_decode_image((const char *) (scan_item->file_path), image_info.orientation, &(image_info.pixel), &(image_info.size), &(image_info.buffer_width), &(image_info.buffer_height));
                dcm_retvm_if(ret != MS_MEDIA_ERR_NONE, ret, "Failed dcm_decode_image(%d)", ret);
 
                dcm_info("Image info W[%d] H[%d] Orient[%d] buf_w[%d] buf_h[%d]",