Remove unused NEON related code 01/270701/5
authorbackto.kim <backto.kim@samsung.com>
Tue, 8 Feb 2022 02:41:15 +0000 (11:41 +0900)
committerbackto.kim <backto.kim@samsung.com>
Tue, 8 Feb 2022 04:15:03 +0000 (13:15 +0900)
Change-Id: If08477432961b5115d5d6f1ce558a1e54d606792

imgp/include/mm_util_imgp_internal.h
imgp/mm_util_imgp.c
packaging/libmm-utility.spec

index 1f181dc..338ead3 100644 (file)
 #ifndef __MM_UTIL_IMGP_INTERNAL_H__
 #define __MM_UTIL_IMGP_INTERNAL_H__
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
 #include "mm_util_imgp.h"
 #ifdef __cplusplus
        extern "C" {
 #endif
 
-#include <gmodule.h>
-#include <unistd.h>
-
-#define PATH_NEON_LIB                                  LIBPREFIX "/libmmutil_imgp_neon.so"
 #define PATH_GSTCS_LIB                                 LIBPREFIX "/libmmutil_imgp_gstcs.so"
 
 #define IMGP_FUNC_NAME                         "mm_imgp"
@@ -63,12 +55,6 @@ typedef enum {
        IMGP_MAX
 } imgp_type_e;
 
-/* Enumerations */
-typedef enum {
-       IMGP_NEON = 0,
-       IMGP_GSTCS,
-} imgp_plugin_type_e;
-
 #ifdef __cplusplus
 }
 #endif
index 9bb6225..c08b652 100644 (file)
@@ -89,107 +89,6 @@ static gboolean __mm_gst_can_rotate_format(mm_util_color_format_e color_format)
        return _bool;
 }
 
-static gboolean __mm_select_convert_plugin(mm_util_color_format_e src_format, mm_util_color_format_e dst_format)
-{
-       gboolean _bool = FALSE;
-
-       mm_util_debug("src_format: %d, dst_format:%d", src_format, dst_format);
-
-       if (((src_format == MM_UTIL_COLOR_YUV420) && (dst_format == MM_UTIL_COLOR_NV12)) ||
-               ((src_format == MM_UTIL_COLOR_YUV420) && (dst_format == MM_UTIL_COLOR_RGB16)) ||
-               ((src_format == MM_UTIL_COLOR_YUV420) && (dst_format == MM_UTIL_COLOR_RGB24)) ||
-               ((src_format == MM_UTIL_COLOR_YUV420) && (dst_format == MM_UTIL_COLOR_ARGB)) ||
-               ((src_format == MM_UTIL_COLOR_YUV420) && (dst_format == MM_UTIL_COLOR_BGRA)) ||
-               ((src_format == MM_UTIL_COLOR_YUV420) && (dst_format == MM_UTIL_COLOR_RGBA)) ||
-               ((src_format == MM_UTIL_COLOR_YUV420) && (dst_format == MM_UTIL_COLOR_NV12_TILED)) ||
-
-               ((src_format == MM_UTIL_COLOR_I420) && (dst_format == MM_UTIL_COLOR_NV12)) ||
-               ((src_format == MM_UTIL_COLOR_I420) && (dst_format == MM_UTIL_COLOR_RGB16)) ||
-               ((src_format == MM_UTIL_COLOR_I420) && (dst_format == MM_UTIL_COLOR_RGB24)) ||
-               ((src_format == MM_UTIL_COLOR_I420) && (dst_format == MM_UTIL_COLOR_ARGB)) ||
-               ((src_format == MM_UTIL_COLOR_I420) && (dst_format == MM_UTIL_COLOR_BGRA)) ||
-               ((src_format == MM_UTIL_COLOR_I420) && (dst_format == MM_UTIL_COLOR_RGBA)) ||
-               ((src_format == MM_UTIL_COLOR_I420) && (dst_format == MM_UTIL_COLOR_NV12_TILED)) ||
-
-               ((src_format == MM_UTIL_COLOR_NV12) && (dst_format == MM_UTIL_COLOR_YUV420)) ||
-               ((src_format == MM_UTIL_COLOR_NV12) && (dst_format == MM_UTIL_COLOR_I420)) ||
-               ((src_format == MM_UTIL_COLOR_NV12) && (dst_format == MM_UTIL_COLOR_RGB16)) ||
-               ((src_format == MM_UTIL_COLOR_NV12) && (dst_format == MM_UTIL_COLOR_RGB24)) ||
-               ((src_format == MM_UTIL_COLOR_NV12) && (dst_format == MM_UTIL_COLOR_ARGB)) ||
-               ((src_format == MM_UTIL_COLOR_NV12) && (dst_format == MM_UTIL_COLOR_BGRA)) ||
-               ((src_format == MM_UTIL_COLOR_NV12) && (dst_format == MM_UTIL_COLOR_RGBA)) ||
-
-               ((src_format == MM_UTIL_COLOR_UYVY) && (dst_format == MM_UTIL_COLOR_RGB16)) ||
-               ((src_format == MM_UTIL_COLOR_UYVY) && (dst_format == MM_UTIL_COLOR_RGB24)) ||
-
-               ((src_format == MM_UTIL_COLOR_YUYV) && (dst_format == MM_UTIL_COLOR_RGB16)) ||
-               ((src_format == MM_UTIL_COLOR_YUYV) && (dst_format == MM_UTIL_COLOR_RGB24)) ||
-               ((src_format == MM_UTIL_COLOR_YUYV) && (dst_format == MM_UTIL_COLOR_ARGB)) ||
-               ((src_format == MM_UTIL_COLOR_YUYV) && (dst_format == MM_UTIL_COLOR_BGRA)) ||
-               ((src_format == MM_UTIL_COLOR_YUYV) && (dst_format == MM_UTIL_COLOR_RGBA)) ||
-
-               ((src_format == MM_UTIL_COLOR_RGB16) && (dst_format == MM_UTIL_COLOR_YUV420)) ||
-               ((src_format == MM_UTIL_COLOR_RGB16) && (dst_format == MM_UTIL_COLOR_I420)) ||
-               ((src_format == MM_UTIL_COLOR_RGB16) && (dst_format == MM_UTIL_COLOR_NV12)) ||
-
-               ((src_format == MM_UTIL_COLOR_RGB24) && (dst_format == MM_UTIL_COLOR_YUV420)) ||
-               ((src_format == MM_UTIL_COLOR_RGB24) && (dst_format == MM_UTIL_COLOR_I420)) ||
-               ((src_format == MM_UTIL_COLOR_RGB24) && (dst_format == MM_UTIL_COLOR_NV12)) ||
-
-               ((src_format == MM_UTIL_COLOR_ARGB) && (dst_format == MM_UTIL_COLOR_YUV420)) ||
-               ((src_format == MM_UTIL_COLOR_ARGB) && (dst_format == MM_UTIL_COLOR_I420)) ||
-               ((src_format == MM_UTIL_COLOR_ARGB) && (dst_format == MM_UTIL_COLOR_NV12)) ||
-
-               ((src_format == MM_UTIL_COLOR_BGRA) && (dst_format == MM_UTIL_COLOR_YUV420)) ||
-               ((src_format == MM_UTIL_COLOR_BGRA) && (dst_format == MM_UTIL_COLOR_I420)) ||
-               ((src_format == MM_UTIL_COLOR_BGRA) && (dst_format == MM_UTIL_COLOR_NV12)) ||
-               ((src_format == MM_UTIL_COLOR_RGBA) && (dst_format == MM_UTIL_COLOR_YUV420)) ||
-               ((src_format == MM_UTIL_COLOR_RGBA) && (dst_format == MM_UTIL_COLOR_I420)) ||
-               ((src_format == MM_UTIL_COLOR_RGBA) && (dst_format == MM_UTIL_COLOR_NV12)) ||
-               ((src_format == MM_UTIL_COLOR_RGBA) && (dst_format == MM_UTIL_COLOR_RGB16)) ||
-
-               ((src_format == MM_UTIL_COLOR_NV12_TILED) && (dst_format == MM_UTIL_COLOR_YUV420)) ||
-               ((src_format == MM_UTIL_COLOR_NV12_TILED) && (dst_format == MM_UTIL_COLOR_I420)) ||
-               ((src_format == MM_UTIL_COLOR_NV12_TILED) && (dst_format == MM_UTIL_COLOR_NV12)) ||
-               ((src_format == MM_UTIL_COLOR_NV12_TILED) && (dst_format == MM_UTIL_COLOR_RGB16)) ||
-               ((src_format == MM_UTIL_COLOR_NV12_TILED) && (dst_format == MM_UTIL_COLOR_RGB24)) ||
-               ((src_format == MM_UTIL_COLOR_NV12_TILED) && (dst_format == MM_UTIL_COLOR_ARGB)) ||
-               ((src_format == MM_UTIL_COLOR_NV12_TILED) && (dst_format == MM_UTIL_COLOR_BGRA)) ||
-               ((src_format == MM_UTIL_COLOR_NV12_TILED) && (dst_format == MM_UTIL_COLOR_RGBA))) {
-
-               _bool = TRUE;
-       }
-
-       return _bool;
-}
-
-static gboolean __mm_select_resize_plugin(mm_util_color_format_e _format)
-{
-       gboolean _bool = FALSE;
-
-       mm_util_debug("_format: %d", _format);
-
-       if ((_format == MM_UTIL_COLOR_UYVY) || (_format == MM_UTIL_COLOR_YUYV) ||
-               (_format == MM_UTIL_COLOR_RGBA) || (_format == MM_UTIL_COLOR_BGRX))
-               _bool = FALSE;
-       else
-               _bool = TRUE;
-
-       return _bool;
-}
-
-static gboolean __mm_select_rotate_plugin(mm_util_color_format_e _format)
-{
-       mm_util_debug("_format: %d", _format);
-
-       if ((_format == MM_UTIL_COLOR_YUV420) || (_format == MM_UTIL_COLOR_I420) || (_format == MM_UTIL_COLOR_NV12)
-               || (_format == MM_UTIL_COLOR_RGB24  || _format == MM_UTIL_COLOR_RGB16)) {
-               return TRUE;
-       }
-
-       return FALSE;
-}
-
 static int __mm_util_get_crop_image_size(mm_util_color_format_e format, unsigned int width, unsigned int height, size_t *imgsize)
 {
        unsigned char x_chroma_shift = 0;
@@ -295,22 +194,6 @@ static int __mm_set_imgp_info_s(imgp_info_s *_imgp_info_s, mm_util_color_format_
        return ret;
 }
 
-static GModule *__mm_util_imgp_initialize(imgp_plugin_type_e _imgp_plugin_type_e)
-{
-       GModule *module = NULL;
-       mm_util_fenter();
-
-       if (_imgp_plugin_type_e == IMGP_NEON)
-               module = g_module_open(PATH_NEON_LIB, G_MODULE_BIND_LAZY);
-       else if (_imgp_plugin_type_e == IMGP_GSTCS)
-               module = g_module_open(PATH_GSTCS_LIB, G_MODULE_BIND_LAZY);
-
-       mm_util_retvm_if(module == NULL, NULL, "[%d] %s | %s module open failed", _imgp_plugin_type_e, PATH_NEON_LIB, PATH_GSTCS_LIB);
-       mm_util_debug("module: %p, g_module_name: %s", module, g_module_name(module));
-
-       return module;
-}
-
 static void __mm_util_imgp_finalize(GModule *module, imgp_info_s *_imgp_info_s)
 {
        if (module)
@@ -400,48 +283,19 @@ unsigned int crop_start_x, unsigned int crop_start_y, unsigned int crop_dest_wid
        }
 }
 
-static IMGPInfoFunc __mm_util_initialize(imgp_type_e function, mm_util_color_format_e src_format, mm_util_color_format_e dst_format, GModule **module)
+static IMGPInfoFunc __mm_util_initialize(GModule **module)
 {
-       imgp_plugin_type_e _imgp_plugin_type_e = IMGP_GSTCS;
        GModule *_module = NULL;
        IMGPInfoFunc _func = NULL;
 
-       if (function == IMGP_CSC) {
-               if (__mm_select_convert_plugin(src_format, dst_format))
-                       _imgp_plugin_type_e = IMGP_NEON;
-
-       } else if (function == IMGP_RSZ) {
-               if (__mm_select_resize_plugin(src_format))
-                       _imgp_plugin_type_e = IMGP_NEON;
-
-       } else if (function == IMGP_ROT) {
-               if (__mm_select_rotate_plugin(src_format))
-                       _imgp_plugin_type_e = IMGP_NEON;
+       _module = g_module_open(PATH_GSTCS_LIB, G_MODULE_BIND_LAZY);
+       mm_util_retvm_if(!module, NULL, "%s module open failed", PATH_GSTCS_LIB);
 
-       } else {
-               mm_util_error("invalid function : [%d]", function);
-       }
-
-       mm_util_debug("plugin type: %d", _imgp_plugin_type_e);
-
-       _module = __mm_util_imgp_initialize(_imgp_plugin_type_e);
-
-       if (_module == NULL) { /* when IMGP_NEON is NULL */
-               _imgp_plugin_type_e = IMGP_GSTCS;
-               mm_util_debug("You use %s module", PATH_GSTCS_LIB);
-               _module = __mm_util_imgp_initialize(_imgp_plugin_type_e);
-       }
-
-       mm_util_debug("mm_util_imgp_func: %p", _module);
-
-       if (_module == NULL) {
-               mm_util_error("invalid module");
-               return NULL;
-       }
+       mm_util_debug("module: %p, g_module_name: %s", _module, g_module_name(_module));
 
        g_module_symbol(_module, IMGP_FUNC_NAME, (gpointer *)&_func);
 
-       if (_func == NULL) {
+       if (!_func) {
                mm_util_error("invalid function");
                g_module_close(_module);
                return NULL;
@@ -479,11 +333,8 @@ int mm_util_convert_colorspace(mm_util_image_h src, mm_util_color_format_e color
        mm_util_debug("[Input] format[%d]", color);
        mm_image_debug_image(src, "Input");
 
-       _mm_util_imgp_func = __mm_util_initialize(IMGP_CSC, _src->color, color, &_module);
-       if (_mm_util_imgp_func == NULL) {
-               mm_util_error("ERROR - __mm_util_initialize");
-               return MM_UTIL_ERROR_INVALID_OPERATION;
-       }
+       _mm_util_imgp_func = __mm_util_initialize(&_module);
+       mm_util_retvm_if(!_mm_util_imgp_func, MM_UTIL_ERROR_INVALID_OPERATION, "failed to __mm_util_initialize()");
 
        _imgp_info_s = g_new0(imgp_info_s, 1);
 
@@ -554,8 +405,8 @@ int mm_util_resize_image(mm_util_image_h src, unsigned int width, unsigned int h
        mm_util_debug("[Input] width[%u] height[%u]", width, height);
        mm_image_debug_image(src, "Input");
 
-       _mm_util_imgp_func = __mm_util_initialize(IMGP_RSZ, _src->color, 0, &_module);
-       mm_util_retvm_if(_mm_util_imgp_func == NULL, MM_UTIL_ERROR_INVALID_OPERATION, "fail __mm_util_initialize");
+       _mm_util_imgp_func = __mm_util_initialize(&_module);
+       mm_util_retvm_if(!_mm_util_imgp_func, MM_UTIL_ERROR_INVALID_OPERATION, "failed to __mm_util_initialize()");
 
        _imgp_info_s = g_new0(imgp_info_s, 1);
 
@@ -636,11 +487,8 @@ int mm_util_rotate_image(mm_util_image_h src, mm_util_rotate_type_e angle, mm_ut
        mm_util_debug("[Input] angle[%d]", angle);
        mm_image_debug_image(src, "Input");
 
-       _mm_util_imgp_func = __mm_util_initialize(IMGP_ROT, _src->color, 0, &_module);
-       if (_mm_util_imgp_func == NULL) {
-               mm_util_error("ERROR - __mm_util_initialize");
-               return MM_UTIL_ERROR_INVALID_OPERATION;
-       }
+       _mm_util_imgp_func = __mm_util_initialize(&_module);
+       mm_util_retvm_if(!_mm_util_imgp_func, MM_UTIL_ERROR_INVALID_OPERATION, "failed to __mm_util_initialize()");
 
        _imgp_info_s = g_new0(imgp_info_s, 1);
 
index e10d906..a89b667 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-utility
 Summary:    Multimedia Framework Utility Library
-Version:    0.3.3
+Version:    0.3.4
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0