[UTC][capi-media-image-util][Non-ACR][Seperate the number of type into decode and... 52/256152/4
authorjiyong.min <jiyong.min@samsung.com>
Tue, 30 Mar 2021 06:36:49 +0000 (15:36 +0900)
committerJiyong Min <jiyong.min@samsung.com>
Mon, 5 Apr 2021 23:56:15 +0000 (23:56 +0000)
Change-Id: Ifdf0a5a695298e13387def1563a7cca70537d3dc

src/utc/image-util/utc-image-util-decode-encode.c

index 50e205bef604c88321d1c8bd05e1e932e6234744..fb4aab5849bc1300f003a34f5560150f7d8dafbb 100755 (executable)
 
 #define WRONG_PATH ""
 
-#define INVALID_IMAGE_TYPE             sizeof(image_util_type_e) + 1   /* +1 margin due to new type */
-#define LAST_IMAGE_TYPE                        IMAGE_UTIL_WEBP
+#define DECODE_IMAGE_TYPE_N            IMAGE_UTIL_WEBP
+#define ENCODE_IMAGE_TYPE_N            IMAGE_UTIL_WEBP
+#define INVALID_IMAGE_TYPE             ((DECODE_IMAGE_TYPE_N > ENCODE_IMAGE_TYPE_N) ? DECODE_IMAGE_TYPE_N * 2 : ENCODE_IMAGE_TYPE_N * 2)
 
 typedef struct {
+       bool support_decode;
        char *source;
+       bool support_encode;
        char *output;
-} utc_filename_t;
-
-static const utc_filename_t FILENAME[] = {
-       [IMAGE_UTIL_JPEG] = { "sample.jpg", "test_output.jpg" },
-       [IMAGE_UTIL_PNG] = { "sample.png", "test_output.png" },
-       [IMAGE_UTIL_GIF] = { "sample.gif", "test_output.gif" },
-       [IMAGE_UTIL_BMP] = { "sample.bmp", "test_output.bmp" },
-       [IMAGE_UTIL_WEBP] = { "sample.webp", "test_output.webp" },
+} utc_config_t;
+
+static const utc_config_t UTC_CONFIG[] = {
+       [IMAGE_UTIL_JPEG] = { true, "sample.jpg", true, "test_output.jpg" },
+       [IMAGE_UTIL_PNG] = { true, "sample.png", true, "test_output.png" },
+       [IMAGE_UTIL_GIF] = { true, "sample.gif", true, "test_output.gif" },
+       [IMAGE_UTIL_BMP] = { true, "sample.bmp", true, "test_output.bmp" },
+       [IMAGE_UTIL_WEBP] = { true, "sample.webp", true, "test_output.webp" },
 };
 
 typedef struct {
@@ -201,7 +204,7 @@ static void __utc_decode_free()
 {
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                IMAGEUTIL_SAFE_G_FREE(utc_decode[type].result.buffer);
                utc_decode[type].result.size = 0;
                IMAGEUTIL_SAFE_G_FREE(utc_decode[type].source);
@@ -214,7 +217,7 @@ static void __utc_encode_free()
 {
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                IMAGEUTIL_SAFE_G_FREE(utc_encode[type].result.buffer);
                utc_encode[type].result.size = 0;
                utc_encode[type].result.buffer_size = 0;
@@ -240,13 +243,29 @@ void utc_image_util_decode_startup(void)
        {
                PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE,  pszValue);
 
-               for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
-                       utc_decode[type].source = _utc_get_test_path(pszValue, FILENAME[type].source);
-                       utc_encode[type].output = _utc_get_test_path(pszValue, FILENAME[type].output);
-                       FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type,
-                                       utc_decode[type].source, utc_encode[type].output);
+               for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
+                       if (!UTC_CONFIG[type].support_decode) {
+                               FPRINTF("[%d:%s] PATH [Type: %d] [Decode: not support] \\n", __LINE__, __FUNCTION__, type);
+                               continue;
+                       }
 
-                       if (!utc_decode[type].source || !utc_encode[type].output)
+                       utc_decode[type].source = _utc_get_test_path(pszValue, UTC_CONFIG[type].source);
+                       FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s] \\n", __LINE__, __FUNCTION__, type, utc_decode[type].source);
+
+                       if (!utc_decode[type].source)
+                               FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
+               }
+
+               for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
+                       if (!UTC_CONFIG[type].support_encode) {
+                               FPRINTF("[%d:%s] PATH [Type: %d] [Encode: not support] \\n", __LINE__, __FUNCTION__, type);
+                               continue;
+                       }
+
+                       utc_encode[type].output = _utc_get_test_path(pszValue, UTC_CONFIG[type].output);
+                       FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type, utc_encode[type].output);
+
+                       if (!utc_encode[type].output)
                                FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
                }
        }
@@ -255,7 +274,7 @@ void utc_image_util_decode_startup(void)
                PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
        }
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_create(&utc_decode[type].handle);
                if (IMAGE_UTIL_ERROR_NONE != ret)
                        PRINT_UTC_LOG("[Line : %d][%s] image_util_decode_create is failed(%d).\n", __LINE__, API_NAMESPACE, ret);
@@ -345,7 +364,7 @@ int utc_image_util_decode_create_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_destroy(utc_decode[type].handle);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
                utc_decode[type].handle = NULL;
@@ -367,7 +386,7 @@ int utc_image_util_decode_set_input_path_n1(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(NULL, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -385,7 +404,7 @@ int utc_image_util_decode_set_input_path_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_encode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -403,7 +422,7 @@ int utc_image_util_decode_set_input_path_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, WRONG_PATH);
                assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
        }
@@ -421,7 +440,7 @@ int utc_image_util_decode_set_input_path_n4(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
        }
@@ -439,7 +458,7 @@ int utc_image_util_decode_set_input_path_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
        }
@@ -457,7 +476,7 @@ int utc_image_util_decode_set_input_buffer_n1(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -478,7 +497,7 @@ int utc_image_util_decode_set_input_buffer_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -499,7 +518,7 @@ int utc_image_util_decode_set_input_buffer_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -520,7 +539,7 @@ int utc_image_util_decode_set_input_buffer_n4(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -541,7 +560,7 @@ int utc_image_util_decode_set_input_buffer_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -579,7 +598,7 @@ int utc_image_util_decode_set_output_buffer_n2(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_output_buffer(utc_encode[type].handle, &data);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -597,7 +616,7 @@ int utc_image_util_decode_set_output_buffer_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_output_buffer(utc_decode[type].handle, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -616,7 +635,7 @@ int utc_image_util_decode_set_output_buffer_p(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
        }
@@ -721,7 +740,7 @@ int utc_image_util_decode_set_colorspace_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_colorspace(utc_decode[type].handle, IMAGE_UTIL_COLORSPACE_RGBA8888);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -739,7 +758,7 @@ int utc_image_util_decode_set_colorspace_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1059,7 +1078,7 @@ int utc_image_util_decode_run_n2(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_run(utc_encode[type].handle, &image_width, &image_height, &image_size);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -1080,7 +1099,7 @@ int utc_image_util_decode_run_n3(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1103,7 +1122,7 @@ int utc_image_util_decode_run_n4(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1126,7 +1145,7 @@ int utc_image_util_decode_run_n5(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1153,7 +1172,7 @@ int utc_image_util_decode_run_p1(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1181,7 +1200,7 @@ int utc_image_util_decode_run_p2(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1210,7 +1229,7 @@ int utc_image_util_decode_run2_n(void)
        image_util_image_h decoded_image = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_run2(utc_decode[type].handle, &decoded_image);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1235,7 +1254,7 @@ int utc_image_util_decode_run2_p1(void)
        image_util_image_h decoded_image = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1260,7 +1279,7 @@ int utc_image_util_decode_run2_p2(void)
        image_util_image_h decoded_image = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1302,7 +1321,7 @@ int utc_image_util_decode_run_async_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_run_async(utc_encode[type].handle, (image_util_decode_completed_cb) utc_decode_completed_cb, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -1321,7 +1340,7 @@ int utc_image_util_decode_run_async_n3(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_output_buffer(utc_decode[type].handle, &data);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1342,7 +1361,7 @@ int utc_image_util_decode_run_async_n4(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1363,7 +1382,7 @@ int utc_image_util_decode_run_async_n5(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1388,7 +1407,7 @@ int utc_image_util_decode_run_async_n6(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1413,7 +1432,7 @@ int utc_image_util_decode_run_async_p1(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1442,7 +1461,7 @@ int utc_image_util_decode_run_async_p2(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -1473,7 +1492,7 @@ int utc_image_util_decode_run_async2_n(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_run_async2(utc_decode[type].handle, utc_decode_completed2_cb, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1497,7 +1516,7 @@ int utc_image_util_decode_run_async2_p1(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                callback_error = -1;
                ret = image_util_decode_set_input_path(utc_decode[type].handle, utc_decode[type].source);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
@@ -1522,7 +1541,7 @@ int utc_image_util_decode_run_async2_p2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                callback_error = -1;
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
@@ -1565,7 +1584,7 @@ int utc_image_util_decode_destroy_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_destroy(utc_encode[type].handle);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -1583,7 +1602,7 @@ int utc_image_util_decode_destroy_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
                ret = image_util_decode_destroy(utc_decode[type].handle);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
                utc_decode[type].handle = NULL;
@@ -1608,13 +1627,29 @@ void utc_image_util_encode_startup(void)
        {
                PRINT_UTC_LOG("[Line : %d][%s] 'DEVICE_SUITE_TARGET_30' Values Received = %s\\n", __LINE__, API_NAMESPACE,  pszValue);
 
-               for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
-                       utc_decode[type].source = _utc_get_test_path(pszValue, FILENAME[type].source);
-                       utc_encode[type].output = _utc_get_test_path(pszValue, FILENAME[type].output);
-                       FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type,
-                                       utc_decode[type].source, utc_encode[type].output);
+               for (type = 0; type <= DECODE_IMAGE_TYPE_N; type++) {
+                       if (!UTC_CONFIG[type].support_decode) {
+                               FPRINTF("[%d:%s] PATH [Type: %d] [Decode: not support] \\n", __LINE__, __FUNCTION__, type);
+                               continue;
+                       }
+
+                       utc_decode[type].source = _utc_get_test_path(pszValue, UTC_CONFIG[type].source);
+                       FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s] \\n", __LINE__, __FUNCTION__, type, utc_decode[type].source);
+
+                       if (!utc_decode[type].source)
+                               FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
+               }
+
+               for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
+                       if (!UTC_CONFIG[type].support_encode) {
+                               FPRINTF("[%d:%s] PATH [Type: %d] [Encode: not support] \\n", __LINE__, __FUNCTION__, type);
+                               continue;
+                       }
+
+                       utc_encode[type].output = _utc_get_test_path(pszValue, UTC_CONFIG[type].output);
+                       FPRINTF("[%d:%s] PATH [Type: %d] [Decode: %s], [Encode: %s] \\n", __LINE__, __FUNCTION__, type, utc_encode[type].output);
 
-                       if (!utc_decode[type].source || !utc_encode[type].output)
+                       if (!utc_encode[type].output)
                                FPRINTF("[%d:%s] Get UTC Path error! \\n", __LINE__, __FUNCTION__);
                }
        }
@@ -1623,7 +1658,7 @@ void utc_image_util_encode_startup(void)
                PRINT_UTC_LOG("[Line : %d][%s] GetValueForTCTSetting returned error for 'DEVICE_SUITE_TARGET_30'\\n", __LINE__, API_NAMESPACE);
        }
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_create(type, &utc_encode[type].handle);
                if (IMAGE_UTIL_ERROR_NONE != ret)
                        PRINT_UTC_LOG("[Line : %d][%s] image_util_encode_create is failed(%d).\n", __LINE__, API_NAMESPACE, ret);
@@ -1668,7 +1703,7 @@ int utc_image_util_encode_create_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_destroy(utc_encode[type].handle);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
                utc_encode[type].handle = NULL;
@@ -1693,7 +1728,7 @@ int utc_image_util_encode_create_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_destroy(utc_encode[type].handle);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
                utc_encode[type].handle = NULL;
@@ -1730,7 +1765,7 @@ int utc_image_util_encode_set_resolution_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_resolution(utc_decode[type].handle, 320, 240);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -1748,7 +1783,7 @@ int utc_image_util_encode_set_resolution_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_resolution(utc_encode[type].handle, 0, 240);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
 
@@ -1787,7 +1822,7 @@ int utc_image_util_encode_set_resolution_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_resolution(utc_encode[type].handle, 320, 240);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
        }
@@ -1934,7 +1969,7 @@ int utc_image_util_encode_set_quality_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_quality(utc_encode[type].handle, 1);
                if (type != IMAGE_UTIL_JPEG)
                        assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
@@ -2016,7 +2051,7 @@ int utc_image_util_encode_set_png_compression_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_png_compression(utc_encode[type].handle, IMAGE_UTIL_PNG_COMPRESSION_0);
                if (type != IMAGE_UTIL_PNG)
                        assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
@@ -2098,7 +2133,7 @@ int utc_image_util_encode_set_gif_frame_delay_time_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_gif_frame_delay_time(utc_encode[type].handle, 100);
                if (type != IMAGE_UTIL_GIF)
                        assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
@@ -2148,7 +2183,7 @@ int utc_image_util_encode_set_webp_lossless_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_webp_lossless(utc_encode[type].handle, true);
                if (type != IMAGE_UTIL_WEBP)
                        assert_eq(ret, IMAGE_UTIL_ERROR_NOT_SUPPORTED_FORMAT);
@@ -2185,7 +2220,7 @@ int utc_image_util_encode_set_input_buffer_n1(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2206,7 +2241,7 @@ int utc_image_util_encode_set_input_buffer_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2227,7 +2262,7 @@ int utc_image_util_encode_set_input_buffer_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_input_buffer(utc_encode[type].handle, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2245,7 +2280,7 @@ int utc_image_util_encode_set_input_buffer_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2266,7 +2301,7 @@ int utc_image_util_encode_set_output_path_n1(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_path(NULL, utc_encode[type].output);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2284,7 +2319,7 @@ int utc_image_util_encode_set_output_path_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_path(utc_decode[type].handle, utc_encode[type].output);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2302,7 +2337,7 @@ int utc_image_util_encode_set_output_path_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_path(utc_encode[type].handle, WRONG_PATH);
                assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
        }
@@ -2320,7 +2355,7 @@ int utc_image_util_encode_set_output_path_n4(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_path(utc_encode[type].handle, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_NO_SUCH_FILE);
        }
@@ -2338,7 +2373,7 @@ int utc_image_util_encode_set_output_path_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
        }
@@ -2373,7 +2408,7 @@ int utc_image_util_encode_set_output_buffer_n2(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_buffer(utc_decode[type].handle, &data);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2391,7 +2426,7 @@ int utc_image_util_encode_set_output_buffer_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_buffer(utc_encode[type].handle, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2410,7 +2445,7 @@ int utc_image_util_encode_set_output_buffer_p(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
        }
@@ -2445,7 +2480,7 @@ int utc_image_util_encode_run_n2(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_run(utc_decode[type].handle, &image_size);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2464,7 +2499,7 @@ int utc_image_util_encode_run_n3(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_run(utc_encode[type].handle, &image_size);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2483,7 +2518,7 @@ int utc_image_util_encode_run_n4(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2508,7 +2543,7 @@ int utc_image_util_encode_run_n5(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2531,7 +2566,7 @@ int utc_image_util_encode_run_n6(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2553,7 +2588,7 @@ int utc_image_util_encode_run_n7(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2612,7 +2647,7 @@ int utc_image_util_encode_run_p1(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2644,7 +2679,7 @@ int utc_image_util_encode_run_p2(void)
        unsigned long long image_size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2676,7 +2711,7 @@ int utc_image_util_encode_run_p3(void)
        unsigned long long size = 0;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2761,7 +2796,7 @@ int utc_image_util_encode_run_async_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_run_async(utc_decode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2779,7 +2814,7 @@ int utc_image_util_encode_run_async_n3(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_run_async(utc_encode[type].handle, (image_util_encode_completed_cb) utc_encode_completed_cb, NULL);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -2797,7 +2832,7 @@ int utc_image_util_encode_run_async_n4(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2821,7 +2856,7 @@ int utc_image_util_encode_run_async_n5(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_path(utc_encode[type].handle, utc_encode[type].output);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2843,7 +2878,7 @@ int utc_image_util_encode_run_async_n6(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_set_output_buffer(utc_encode[type].handle, &data);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2864,7 +2899,7 @@ int utc_image_util_encode_run_async_n7(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2891,7 +2926,7 @@ int utc_image_util_encode_run_async_n8(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2948,7 +2983,7 @@ int utc_image_util_encode_run_async_p1(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -2981,7 +3016,7 @@ int utc_image_util_encode_run_async_p2(void)
        unsigned char *data = NULL;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = __fill_test_buffer(type);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3014,7 +3049,7 @@ int utc_image_util_encode_run_to_file_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3035,7 +3070,7 @@ int utc_image_util_encode_run_to_file_n(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3062,7 +3097,7 @@ int utc_image_util_encode_run_to_buffer_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3085,7 +3120,7 @@ int utc_image_util_encode_run_to_buffer_n(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3115,7 +3150,7 @@ int utc_image_util_encode_run_async_to_file_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3140,7 +3175,7 @@ int utc_image_util_encode_run_async_to_file_n(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3170,7 +3205,7 @@ int utc_image_util_encode_run_async_to_buffer_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3197,7 +3232,7 @@ int utc_image_util_encode_run_async_to_buffer_n(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = _utc_decode_from_file(utc_decode[type].source, &utc_decode[type].decoded);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
 
@@ -3239,7 +3274,7 @@ int utc_image_util_encode_destroy_n2(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_destroy(utc_decode[type].handle);
                assert_eq(ret, IMAGE_UTIL_ERROR_INVALID_PARAMETER);
        }
@@ -3257,7 +3292,7 @@ int utc_image_util_encode_destroy_p(void)
        int ret = IMAGE_UTIL_ERROR_NONE;
        image_util_type_e type = 0;
 
-       for (type = 0; type <= LAST_IMAGE_TYPE; type++) {
+       for (type = 0; type <= ENCODE_IMAGE_TYPE_N; type++) {
                ret = image_util_encode_destroy(utc_encode[type].handle);
                assert_eq(ret, IMAGE_UTIL_ERROR_NONE);
                utc_encode[type].handle = NULL;