video: added USE_CSC_HW macro
authorTaehwan Kim <t_h.kim@samsung.com>
Fri, 28 Dec 2012 02:26:22 +0000 (02:26 +0000)
committerTaehwan Kim <t_h.kim@samsung.com>
Thu, 3 Jan 2013 23:55:22 +0000 (23:55 +0000)
Change-Id: I64609678de85d69b108c2c32158901f7ca00c327
Signed-off-by: Taehwan Kim <t_h.kim@samsung.com>
16 files changed:
component/video/dec/Exynos_OMX_Vdec.c
component/video/dec/h264/Android.mk
component/video/dec/h264/Exynos_OMX_H264dec.c
component/video/dec/mpeg2/Android.mk
component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c
component/video/dec/mpeg4/Android.mk
component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
component/video/dec/vc1/Android.mk
component/video/dec/vc1/Exynos_OMX_Wmvdec.c
component/video/dec/vp8/Android.mk
component/video/dec/vp8/Exynos_OMX_Vp8dec.c
component/video/enc/Exynos_OMX_Venc.c
component/video/enc/h264/Android.mk
component/video/enc/h264/Exynos_OMX_H264enc.c
component/video/enc/mpeg4/Android.mk
component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c

index 3ff4df88166b0c4983773470abc18c59e119d212..145c210abe60546993ee89ad093e64d77fc30544 100644 (file)
@@ -327,7 +327,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
 
     CSC_ERRORCODE cscRet = CSC_ErrorNone;
     CSC_METHOD csc_method = CSC_METHOD_SW;
-    unsigned int cacheable = 1;
+    unsigned int srcCacheable = 1, dstCacheable = 1;
 
     pBufferInfo = (DECODE_CODEC_EXTRA_BUFFERINFO *)dstOutputData->extInfo;
 
@@ -344,8 +344,11 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
     pYUVBuf[1]  = (unsigned char *)pOutputBuf + imageSize;
     pYUVBuf[2]  = (unsigned char *)pOutputBuf + imageSize + imageSize / 4;
 
-#ifdef USE_DMA_BUF
     csc_get_method(pVideoDec->csc_handle, &csc_method);
+    if (csc_method == CSC_METHOD_HW)
+        srcCacheable = 0;
+
+#ifdef USE_DMA_BUF
     if (csc_method == CSC_METHOD_HW) {
         pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.fd[0];
         pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.fd[1];
@@ -392,7 +395,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
             width,            /* crop_width */
             height,           /* crop_height */
             omx_2_hal_pixel_format(colorFormat), /* color_format */
-            cacheable);             /* cacheable */
+            srcCacheable);             /* cacheable */
         csc_set_dst_format(
             pVideoDec->csc_handle,  /* handle */
             width,           /* width */
@@ -402,7 +405,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
             width,           /* crop_width */
             height,           /* crop_height */
             omx_2_hal_pixel_format(exynosOutputPort->portDefinition.format.video.eColorFormat), /* color_format */
-            cacheable);             /* cacheable */
+            dstCacheable);             /* cacheable */
         pVideoDec->csc_set_format = OMX_TRUE;
     }
     csc_set_src_buffer(
index f07f477ef57e6d912a18dbd2d5423cb1fc40143f..7b25889f5d41ccba22030cd04f18c97e93c04a10 100644 (file)
@@ -25,6 +25,10 @@ ifeq ($(BOARD_USE_S3D_SUPPORT), true)
 LOCAL_CFLAGS += -DUSE_S3D_SUPPORT
 endif
 
+ifeq ($(BOARD_USE_CSC_HW), true)
+LOCAL_CFLAGS += -DUSE_CSC_HW
+endif
+
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basecomponent \
index 371d0b55c2de4699529d4ad3a6b1d678350bc4fd..5253f74adffaeb47ba18fd396e60b802cbd17676 100644 (file)
@@ -1694,8 +1694,8 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
 
     pExynosComponent->getAllDelayBuffer = OMX_FALSE;
 
-#if 0//defined(USE_CSC_GSCALER)
-    csc_method = CSC_METHOD_HW; //in case of Use ION buffer.
+#ifdef USE_CSC_HW
+    csc_method = CSC_METHOD_HW;
 #endif
     if (pVideoDec->bDRMPlayerMode == OMX_TRUE) {
         pVideoDec->csc_handle = csc_init(CSC_METHOD_HW);
index 2b8002a0fb8e0845620a0577d7ca8960ade26012..d378baa20091f3cd6a18e3938dfee83e64a49d12 100644 (file)
@@ -21,6 +21,10 @@ ifeq ($(BOARD_USE_DMA_BUF), true)
 LOCAL_CFLAGS += -DUSE_DMA_BUF
 endif
 
+ifeq ($(BOARD_USE_CSC_HW), true)
+LOCAL_CFLAGS += -DUSE_CSC_HW
+endif
+
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basecomponent \
index 5f7cab289a3d7b3f8ad13effac7695975ff4082f..377d0e8872cb2328174648ad631bde9a3b8203b7 100644 (file)
@@ -1324,8 +1324,8 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
 
     pExynosComponent->getAllDelayBuffer = OMX_FALSE;
 
-#if 0//defined(USE_CSC_GSCALER)
-    csc_method = CSC_METHOD_HW; //in case of Use ION buffer.
+#ifdef USE_CSC_HW
+    csc_method = CSC_METHOD_HW;
 #endif
     pVideoDec->csc_handle = csc_init(csc_method);
     if (pVideoDec->csc_handle == NULL) {
index bd231f2f219232ff85d43e514fda1c168c7243ba..26ab1706bbfe5f3aba59ecf2282879c264559ebc 100644 (file)
@@ -21,6 +21,10 @@ ifeq ($(BOARD_USE_DMA_BUF), true)
 LOCAL_CFLAGS += -DUSE_DMA_BUF
 endif
 
+ifeq ($(BOARD_USE_CSC_HW), true)
+LOCAL_CFLAGS += -DUSE_CSC_HW
+endif
+
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basecomponent \
index b57900be048e88f47a549b1e996c04bf272cdfcb..b7226b661d49b52c992e260e436e8cf8fb3b6509 100644 (file)
@@ -1676,8 +1676,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
 
     pExynosComponent->getAllDelayBuffer = OMX_FALSE;
 
-#if 0//defined(USE_CSC_GSCALER)
-    csc_method = CSC_METHOD_HW; //in case of Use ION buffer.
+#ifdef USE_CSC_HW
+    csc_method = CSC_METHOD_HW;
 #endif
     pVideoDec->csc_handle = csc_init(csc_method);
     if (pVideoDec->csc_handle == NULL) {
index 06715789aa503f5f2a30d3adff6e08a8794be6a3..d347c68554b0f1294078d61d7bf7a9cd3c771493 100644 (file)
@@ -21,6 +21,10 @@ ifeq ($(BOARD_USE_DMA_BUF), true)
 LOCAL_CFLAGS += -DUSE_DMA_BUF
 endif
 
+ifeq ($(BOARD_USE_CSC_HW), true)
+LOCAL_CFLAGS += -DUSE_CSC_HW
+endif
+
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basecomponent \
index d46917533d88e631ae3dd2d0d6ee6f6d1a633fa0..4a22d9369a4e0f55b242f247f28d8309e4583e39 100644 (file)
@@ -1544,8 +1544,8 @@ OMX_ERRORTYPE Exynos_WmvDec_Init(OMX_COMPONENTTYPE *pOMXComponent)
 
     pExynosComponent->getAllDelayBuffer = OMX_FALSE;
 
-#if 0//defined(USE_CSC_GSCALER)
-    csc_method = CSC_METHOD_HW; //in case of Use ION buffer.
+#ifdef USE_CSC_HW
+    csc_method = CSC_METHOD_HW;
 #endif
     pVideoDec->csc_handle = csc_init(csc_method);
     if (pVideoDec->csc_handle == NULL) {
index 124b13a982bd37127332eaf0c1575fc04d03e5c1..94baa5a8579443e70e6eb00ecd8f4dbb13573eaf 100644 (file)
@@ -21,6 +21,10 @@ ifeq ($(BOARD_USE_DMA_BUF), true)
 LOCAL_CFLAGS += -DUSE_DMA_BUF
 endif
 
+ifeq ($(BOARD_USE_CSC_HW), true)
+LOCAL_CFLAGS += -DUSE_CSC_HW
+endif
+
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := libExynosOMX_Vdec libExynosOMX_OSAL libExynosOMX_Basecomponent \
index 55e8dbbbeb9d62c69177f847d5db41405e15e2f4..b3de613148dfacc10377ca867e5dbfa08779ec57 100644 (file)
@@ -1268,8 +1268,8 @@ OMX_ERRORTYPE Exynos_VP8Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
 
     pExynosComponent->getAllDelayBuffer = OMX_FALSE;
 
-#if 0//defined(USE_CSC_GSCALER)
-    csc_method = CSC_METHOD_HW; //in case of Use ION buffer.
+#ifdef USE_CSC_HW
+    csc_method = CSC_METHOD_HW;
 #endif
     pVideoDec->csc_handle = csc_init(csc_method);
     if (pVideoDec->csc_handle == NULL) {
index 919c3a16700b842f4431efdda643fd690f41c89e..95689c6f053ab0874da130553787d2de0f4222ec 100644 (file)
@@ -290,7 +290,7 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
     unsigned int csc_src_color_format = omx_2_hal_pixel_format((unsigned int)OMX_COLOR_FormatYUV420SemiPlanar);
     unsigned int csc_dst_color_format = omx_2_hal_pixel_format((unsigned int)OMX_COLOR_FormatYUV420SemiPlanar);
     CSC_METHOD csc_method = CSC_METHOD_SW;
-    unsigned int cacheable = 1;
+    unsigned int srcCacheable = 1, dstCacheable = 1;
 
     unsigned char *pSrcBuf[3] = {NULL, };
     unsigned char *pDstBuf[3] = {NULL, };
@@ -305,6 +305,10 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
     pDstBuf[1] = srcInputData->buffer.multiPlaneBuffer.dataBuffer[1];
     pDstBuf[2] = srcInputData->buffer.multiPlaneBuffer.dataBuffer[2];
 
+    csc_get_method(pVideoEnc->csc_handle, &csc_method);
+    if (csc_method == CSC_METHOD_HW)
+        dstCacheable = 0;
+
 #ifdef USE_METADATABUFFERTYPE
     OMX_PTR ppBuf[MAX_BUFFER_PLANE];
 
@@ -340,7 +344,6 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
 #endif
 
 #ifdef USE_DMA_BUF
-            csc_get_method(pVideoEnc->csc_handle, &csc_method);
             if (csc_method == CSC_METHOD_HW)
                 pSrcBuf[0]  = (unsigned char *)planes[0].fd;
             else
@@ -353,7 +356,6 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
 #endif
     {
 #ifdef USE_DMA_BUF
-        csc_get_method(pVideoEnc->csc_handle, &csc_method);
         if (csc_method == CSC_METHOD_HW) {
             pSrcBuf[0]  = Exynos_OSAL_SharedMemory_VirtToION(pVideoEnc->hSharedMemory, checkInputStream);
             pSrcBuf[1]  = NULL;
@@ -396,7 +398,7 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
         nFrameWidth,                  /* crop_width */
         nFrameHeight,                 /* crop_height */
         csc_src_color_format,   /* color_format */
-        cacheable);             /* cacheable */
+        srcCacheable);             /* cacheable */
     csc_set_dst_format(
         pVideoEnc->csc_handle,  /* handle */
         nFrameWidth,                  /* width */
@@ -406,7 +408,7 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
         nFrameWidth,                  /* crop_width */
         nFrameHeight,                 /* crop_height */
         csc_dst_color_format,   /* color_format */
-        cacheable);             /* cacheable */
+        dstCacheable);             /* cacheable */
     csc_set_src_buffer(
         pVideoEnc->csc_handle,  /* handle */
         pSrcBuf,
index 11c6b7ff491fd6b9cf35ad242724882e8824ffe0..aeef1a560d94a5dd0d1eb56182593b5fc7299083 100644 (file)
@@ -21,6 +21,10 @@ ifeq ($(BOARD_USE_DMA_BUF), true)
 LOCAL_CFLAGS += -DUSE_DMA_BUF
 endif
 
+ifeq ($(BOARD_USE_CSC_HW), true)
+LOCAL_CFLAGS += -DUSE_CSC_HW
+endif
+
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := libExynosOMX_Venc libExynosOMX_OSAL libExynosOMX_Basecomponent \
index 8b6433efc5656d998d886afcee6cc2cbab6f75c4..85dbd894c03a908ea7cadc360081d2e37d0a14da 100644 (file)
@@ -1644,8 +1644,8 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
 
     pExynosComponent->getAllDelayBuffer = OMX_FALSE;
 
-#if 0//defined(USE_CSC_GSCALER)
-    csc_method = CSC_METHOD_HW; //in case of Use ION buffer.
+#ifdef USE_CSC_HW
+    csc_method = CSC_METHOD_HW;
 #endif
     pVideoEnc->csc_handle = csc_init(csc_method);
     if (pVideoEnc->csc_handle == NULL) {
index a5c0fa420d2a3a4082e244a7cd634122a8548022..1ea4920815b77af0766ed530aa6f1cec0662d585 100644 (file)
@@ -21,6 +21,10 @@ ifeq ($(BOARD_USE_DMA_BUF), true)
 LOCAL_CFLAGS += -DUSE_DMA_BUF
 endif
 
+ifeq ($(BOARD_USE_CSC_HW), true)
+LOCAL_CFLAGS += -DUSE_CSC_HW
+endif
+
 LOCAL_ARM_MODE := arm
 
 LOCAL_STATIC_LIBRARIES := libExynosOMX_Venc libExynosOMX_OSAL libExynosOMX_Basecomponent \
index 2344c43fdbb971f3ee9d6a5eb7c9f7aa1b56de53..1a1c4f45885da79b17c850d9b0439424fa97abc5 100644 (file)
@@ -1854,8 +1854,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
 
     pExynosComponent->getAllDelayBuffer = OMX_FALSE;
 
-#if 0//defined(USE_CSC_GSCALER)
-    csc_method = CSC_METHOD_HW; //in case of Use ION buffer.
+#ifdef USE_CSC_HW
+    csc_method = CSC_METHOD_HW;
 #endif
     pVideoEnc->csc_handle = csc_init(csc_method);
     if (pVideoEnc->csc_handle == NULL) {