From 7380cbb8bcc718f8defd363e22471a3075de014a Mon Sep 17 00:00:00 2001 From: hj kim Date: Wed, 14 Feb 2018 14:10:29 +0900 Subject: [PATCH] Fix test code and update some debug msg Change-Id: I89a04243847ca46a645bba1474263e96df6511e6 --- imgp/mm_util_imgp.c | 8 ++++---- imgp/test/mm_util_imgp_testsuite.c | 7 +++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/imgp/mm_util_imgp.c b/imgp/mm_util_imgp.c index f68fc5d..6cb650f 100755 --- a/imgp/mm_util_imgp.c +++ b/imgp/mm_util_imgp.c @@ -471,7 +471,7 @@ static int __mm_set_imgp_info_s(imgp_info_s *_imgp_info_s, mm_util_color_format_ _imgp_info_s->buffer_size = 0; _imgp_info_s->angle = angle; - mm_util_debug("width: %d height: %d width: %d height: %d rotation_value: %d", _imgp_info_s->src_width, _imgp_info_s->src_height, _imgp_info_s->dst_width, _imgp_info_s->dst_height, _imgp_info_s->angle); + mm_util_debug("src_width[%u] src_height[%u] dst_width[%u] dst_height[%u] rotation_value[%d]", _imgp_info_s->src_width, _imgp_info_s->src_height, _imgp_info_s->dst_width, _imgp_info_s->dst_height, _imgp_info_s->angle); return ret; } @@ -1153,7 +1153,7 @@ int mm_util_convert_colorspace(const unsigned char *src, unsigned int src_width, mm_util_retvm_if((__mm_util_check_format(src_format) == FALSE), MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT, "not supported src_format [%d]", src_format); mm_util_retvm_if((__mm_util_check_format(dst_format) == FALSE), MM_UTIL_ERROR_NOT_SUPPORTED_FORMAT, "not supported dst_format [%d]", dst_format); - mm_util_debug("src_width [%d] src_height [%d] src_format[%d]", src_width, src_height, src_format); + mm_util_debug("src_width [%d] src_height [%d] src_format[%d] dst_format[%d]", src_width, src_height, src_format, dst_format); _mm_util_imgp_func = __mm_util_initialize(IMGP_CSC, src_format, dst_format, &_module); if (_mm_util_imgp_func == NULL) { @@ -1201,7 +1201,7 @@ int mm_util_convert_colorspace(const unsigned char *src, unsigned int src_width, } /* Output result*/ - mm_util_debug("dst: %p dst_width: %d, dst_height: %d, output_stride: %d, output_elevation: %d", + mm_util_debug("dst[%p] dst_width[%u] dst_height[%u] output_stride[%u] output_elevation[%u]", dst, _imgp_info_s->dst_width, _imgp_info_s->dst_height, _imgp_info_s->output_stride, _imgp_info_s->output_elevation); ERROR: @@ -1424,7 +1424,7 @@ unsigned int crop_start_x, unsigned int crop_start_y, unsigned int *crop_dest_wi mm_util_retvm_if((crop_start_x + *crop_dest_width > src_width), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid position [%d]]", crop_start_x); mm_util_retvm_if((crop_start_y + *crop_dest_height > src_height), MM_UTIL_ERROR_INVALID_PARAMETER, "invalid position [%d]", crop_start_y); - mm_util_debug("[Input] src: [%p] src_width: [%ui] src_height: [%ui] src_format: [%d] crop_start_x: [%ui] crop_start_y: [%ui] crop_dest_width: [%ui] crop_dest_height: [%ui]", + mm_util_debug("[Input] src[%p] src_width[%u] src_height[%u] src_format[%d] crop_start_x[%u] crop_start_y[%u] crop_dest_width[%u] crop_dest_height[%u]", src, src_width, src_height, src_format, crop_start_x, crop_start_y, *crop_dest_width, *crop_dest_height); switch (src_format) { diff --git a/imgp/test/mm_util_imgp_testsuite.c b/imgp/test/mm_util_imgp_testsuite.c index 04d2698..059a34b 100755 --- a/imgp/test/mm_util_imgp_testsuite.c +++ b/imgp/test/mm_util_imgp_testsuite.c @@ -132,6 +132,13 @@ int main(int argc, char *argv[]) fprintf(stderr, "command: %s src_width: %d, src_height: %d, src_format: %d, dst_width: %d, dst_height: %d, dst_format:%d, rotation:%d\n", command, src_width, src_height, src_format, dst_width, dst_height, dst_format, rotation); + if (strcmp(command, "convert") == 0) { + if ((src_width != dst_width) || (src_width != dst_width)) { + fprintf(stderr, "Wrong input. dst w/h should be same as src w/h\n"); + return 0; + } + } + /* mem allocation for src dst buffer */ mm_util_get_image_size(src_format, src_width, src_height, &size); src_size = (size_t)size; -- 2.34.1