From: hj kim Date: Tue, 15 Sep 2020 08:37:38 +0000 (+0900) Subject: Remove unused function X-Git-Tag: submit/tizen/20200916.012329^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=46c929d3042bfd5284de57c5fc6876119b75f6c5;p=platform%2Fcore%2Fmultimedia%2Fdcm-service.git Remove unused function 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 --- diff --git a/libdcm-util/dcm_image_codec.c b/libdcm-util/dcm_image_codec.c index 9fd7bb8..8fc2f1b 100755 --- a/libdcm-util/dcm_image_codec.c +++ b/libdcm-util/dcm_image_codec.c @@ -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(); diff --git a/libdcm-util/include/dcm_image_codec.h b/libdcm-util/include/dcm_image_codec.h index d40e4db..037ff19 100755 --- a/libdcm-util/include/dcm_image_codec.h +++ b/libdcm-util/include/dcm_image_codec.h @@ -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 diff --git a/packaging/dcm-service.spec b/packaging/dcm-service.spec index 63db162..1371667 100644 --- a/packaging/dcm-service.spec +++ b/packaging/dcm-service.spec @@ -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 diff --git a/src/dcm_svc_internal.c b/src/dcm_svc_internal.c index 730e5a4..0cff100 100755 --- a/src/dcm_svc_internal.c +++ b/src/dcm_svc_internal.c @@ -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]",