⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 omxipcs_ycbcr444tobgr565ls_mcu_s16_u16_p3c3.c

📁 The OpenMAX DL (Development Layer) APIs contain a comprehensive set of audio, video, signal processi
💻 C
字号:
/** * *  * File Name:  omxIPCS_YCbCr444ToBGR565LS_MCU_S16_U16_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 BGR565 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_YCbCr444ToBGR565LS_MCU_S16_U16_P3C3   (4.4.3.8.6) * * Description: * These functions convert sub-sampled YCbCr data to BGR565 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: 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 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 represented using Q8 and are bounded on the  *            interval [-128, 127].  *   dstStep - distance in bytes between the starts of consecutive lines in  *            the destination image; can take negative values to support  *            bottom-up storage format.  * * Output Arguments: *    *   pDst - output image buffer pointer; data are interleaved as follows:   *            [B G R B G R  ], where G is represented using 6 bits, and B and R  *            are represented using 5 bits.  Output components are saturated.  *            The parameter dstStep can take negative values to support  *            bottom-up storage.  * * Return Value: *     *    OMX_Sts_NoErr - no error  *    OMX_Sts_BadArgErr - bad arguments - returned if one or more of the  *              following is true:  *    -   a pointer was NULL  *    -   the absolute value of dstStep was smaller than 16 (for YCbCr444)  *        or 32 (for YCbCr422/YCbCr420)  *    -   a pointer in pSrcMCU[] was not 8-byte aligned  * */ OMXResult omxIPCS_YCbCr444ToBGR565LS_MCU_S16_U16_P3C3(        const OMX_S16 *pSrcMCU[3],        OMX_U16 *pDstRGB,        OMX_INT dstStep       ){       const OMX_S16 *pSrcY, *pSrcCb, *pSrcCr;    OMX_S16 Ydata, Udata, Vdata;    OMX_F32 Rdata, Gdata, Bdata;    OMX_INT i, j;         armRetArgErrIf(!pSrcMCU, OMX_Sts_BadArgErr);    armRetArgErrIf(!pDstRGB, 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 > (-2 * JPEG_MCU_PIX_WIDTH_444)) && ((dstStep < 2 * JPEG_MCU_PIX_WIDTH_444))), OMX_Sts_BadArgErr);    pSrcY   = pSrcMCU[0];    pSrcCb  = pSrcMCU[1];    pSrcCr  = pSrcMCU[2];        for(i = 0; i < 8; i++)    {        for(j = 0; j < 8; j+=1)        {            Ydata       = *pSrcY++;            Udata       = *pSrcCb++;            Vdata       = *pSrcCr++;            armIPCS_ComputeRGBFromYUV_JPEG_F32(Ydata, Udata, Vdata, &Rdata, &Gdata, &Bdata);            pDstRGB[j] = armIPCS_PackToBGR565_F32(Bdata, Gdata, Rdata);        }        pDstRGB += dstStep>>1;    }    return OMX_Sts_NoErr;}/* End of file */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -