#include <stdlib.h>
#include <image_util.h>
#include <image_util_internal.h>
-#include <mm_util_imgp.h>
#include <dcm_image_codec_debug.h>
#include <dcm_image_codec.h>
{
int ret = IMAGE_UTIL_ERROR_NONE;
image_util_colorspace_e colorspace = IMAGE_UTIL_COLORSPACE_RGBA8888;
- mm_util_img_format mm_format = MM_UTIL_IMG_FMT_RGBA8888;
unsigned char *decode_buffer = NULL;
unsigned int decode_width = 0, decode_height = 0;
unsigned char *resize_buffer = NULL;
if (strcmp(mimne_type, MIME_TYPE_JPEG) == 0) {
if (format == DCM_IMAGE_FORMAT_I420) {
colorspace = IMAGE_UTIL_COLORSPACE_I420;
- mm_format = MM_UTIL_IMG_FMT_I420;
} else if (format == DCM_IMAGE_FORMAT_RGB) {
colorspace = IMAGE_UTIL_COLORSPACE_RGB888;
- mm_format = MM_UTIL_IMG_FMT_RGB888;
} else if (format == DCM_IMAGE_FORMAT_RGBA) {
colorspace = IMAGE_UTIL_COLORSPACE_RGBA8888;
- mm_format = MM_UTIL_IMG_FMT_RGBA8888;
} else {
image_util_decode_destroy(handle);
return MS_MEDIA_ERR_UNSUPPORTED_CONTENT;
/* Resize the big size image to enhance performance for big size image */
if ((decode_width != *buff_width) || (decode_height != *buff_height)) {
ret = image_util_calculate_buffer_size(*buff_width, *buff_height, colorspace, &buffer_size);
- if (ret != MS_MEDIA_ERR_NONE) {
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
dcm_error("Failed to calculate image buffer size! err: %d", ret);
return MS_MEDIA_ERR_INTERNAL;
}
*size = buffer_size;
resize_buffer = (unsigned char *)malloc(sizeof(unsigned char) * (buffer_size));
if (resize_buffer != NULL) {
- ret = mm_util_resize_image(decode_buffer, decode_width, decode_height, mm_format, resize_buffer, buff_width, buff_height);
+ ret = image_util_resize(resize_buffer, (int *)buff_width, (int *)buff_height, decode_buffer, decode_width, decode_height, colorspace);
DCM_SAFE_FREE(decode_buffer);
- if (ret != MS_MEDIA_ERR_NONE) {
- dcm_error("Failed to mm_util_resize_image");
+ if (ret != IMAGE_UTIL_ERROR_NONE) {
+ dcm_error("Failed to image_util_resize");
DCM_SAFE_FREE(resize_buffer);
return MS_MEDIA_ERR_INTERNAL;
}