📄 omxipcs_ycbcr444tobgr888ls_mcu_s16_u8_p3c3.c
字号:
/** * * * File Name: omxIPCS_YCbCr444ToBGR888LS_MCU_S16_U8_P3C3.c * OpenMAX DL: v1.0.2 * Revision: 10586 * Date: Wednesday, March 5, 2008 * * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved. * * * * Description : Colour Conversion Routine - Converts YUV444 to BGR888 in floating point. * Source data is stored as a JPEG MCU in three channel, planar domain and * the destination would be in three-channel pixel format. * */#include "omxtypes.h"#include "armOMX.h"#include "omxIP.h"#include "armCOMM.h"#include "armIP.h"/** * Function: omxIPCS_YCbCr444ToBGR888LS_MCU_S16_U8_P3C3 (4.4.3.8.3) * * Description: * These functions convert sub-sampled YCbCr data to BGR888 data with * level-shift. The parameter pSrcMCU[0] must point to the start of a * sufficient number of contiguously stored 8x8 Y blocks to constitute a * complete MCU given the source chroma sub-sampling scheme, i.e., 1, 2, or 4 * blocks for YCbCr 4:4:4, 4:2:2, or YCbCr 4:2:0, respectively. * * Input Arguments: * * pSrcMCU - buffer containing input MCU pointers: The parameter * pSrcMCU[0] points to the first Y block, pSrcMCU[1] points to Cb * the block, and pSrcMCU[2] points to the Cr block; all three * pointers must be aligned on 8-byte boundaries. The parameter * pSrcMCU[0] must point to the start of a sufficient number of * contiguously stored 8x8 Y blocks to constitute a complete MCU * given the source chroma sub-sampling scheme, i.e., 1, 2, or 4 * blocks for YCbCr 4:4:4, 4:2:2, or YCbCr 4:2:0, respectively. * Only top-down storage format is supported. Input components are * expressed using a Q8 representation and are bounded on the * interval [-128, 127]. * dstStep - distance in bytes between the starts of consecutive lines in * the destination image; values less than 0 are allowed to support * bottom-up storage format. * * Output Arguments: * * pDst - points to the output image buffer in which the output data (C3 * representation) are interleaved as follows: BGRBGRBGR... * Bottom-up storage format is supported. Outputs are saturated to * the OMX_U8 range [0, 255]. The parameter dstStep can take * negative values to support bottom-up storage format. * * Return Value: * * OMX_Sts_NoErr - no error * OMX_Sts_BadArgErr - bad arguments. Returned if one or more of the * following was true: * - a pointer was NULL * - the absolute value of dstStep was smaller than 24 (for YCbCr444) * or 48 (for YCbCr422/YCbCr420) * - a pointer in pSrcMCU[] was not 8-byte aligned * */ OMXResult omxIPCS_YCbCr444ToBGR888LS_MCU_S16_U8_P3C3( const OMX_S16 *pSrcMCU[3], OMX_U8 * pDst, OMX_INT dstStep){ const OMX_S16 *pSrcY, *pSrcCb, *pSrcCr; OMX_S16 Ydata, Udata, Vdata; OMX_INT i, j; OMX_U8 *pRGB; ARM_JpegPixelYUV2RGBConversionFunctionType pixCCfn = armIPCS_ComputeRGBFromYUV_JPEG_F32_U8; armRetArgErrIf(!pSrcMCU, OMX_Sts_BadArgErr); armRetArgErrIf(!pDst, OMX_Sts_BadArgErr); armRetArgErrIf(!pSrcMCU[0], OMX_Sts_BadArgErr); armRetArgErrIf(!pSrcMCU[1], OMX_Sts_BadArgErr); armRetArgErrIf(!pSrcMCU[2], OMX_Sts_BadArgErr); armRetArgErrIf(!armIs8ByteAligned(pSrcMCU[0]), OMX_Sts_BadArgErr); armRetArgErrIf(!armIs8ByteAligned(pSrcMCU[1]), OMX_Sts_BadArgErr); armRetArgErrIf(!armIs8ByteAligned(pSrcMCU[2]), OMX_Sts_BadArgErr); armRetArgErrIf(((dstStep > (-3 * JPEG_MCU_PIX_WIDTH_444)) && ((dstStep < 3 * JPEG_MCU_PIX_WIDTH_444))), OMX_Sts_BadArgErr); pSrcY = pSrcMCU[0]; pSrcCb = pSrcMCU[1]; pSrcCr = pSrcMCU[2]; pRGB = pDst; for(i = 0; i < 8; i++) { for(j = 0; j < 8*3; j+=3) { Ydata = *pSrcY++; Udata = *pSrcCb++; Vdata = *pSrcCr++; pixCCfn(Ydata, Udata, Vdata, &pRGB[j+2], &pRGB[j+1], &pRGB[j]); } pRGB += dstStep; } return OMX_Sts_NoErr;}/* End of file */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -