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

📄 llc_previewer.c

📁 the preview code includes auto focus, auto whitebalance. it is on TI DM6437 platform
💻 C
📖 第 1 页 / 共 5 页
字号:
#endif /* PREVIEWER_DEBUG */

        CSL_FINS(prevRegs->RGB_OFF2, PREV_RGB_OFF2_MTX_OFFB,
            (Uint32)prevConfigParams->rgbBlendingParam.offset[2]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->RGB_OFF2, PREV_RGB_OFF2_MTX_OFFB);
        if ((Uint32)prevConfigParams->rgbBlendingParam.offset[2] != x)
        {
            llcPrevDebugErrorStatus = 77;
        }
#endif /* PREVIEWER_DEBUG */

        /* Set gamma correction Coefficients if it is enabled in
         * configuration */
        if ((Uint32)0 != (prevConfigParams->features
                & PSP_PREVIEWER_GAMMA))
        {
            CSL_FINS(prevRegs->PCR, PREV_PCR_GAMMA_BYPASS,
                (Uint32)CSL_PREV_PCR_GAMMA_BYPASS_NO_BYPASS);
#ifdef PREVIEWER_DEBUG
            x = CSL_FEXT(prevRegs->PCR, PREV_PCR_GAMMA_BYPASS);
            if ((Uint32)CSL_PREV_PCR_GAMMA_BYPASS_NO_BYPASS != x)
            {
                llcPrevDebugErrorStatus = 78;
            }
#endif /* PREVIEWER_DEBUG */
            /* Set coefficients of Gamma correction */
            /* Set table address for red gamma */
            CSL_FINS(prevRegs->SET_TBL_ADDRESS, PREV_SET_TBL_ADDRESS_ADDR,
                (Uint32)LLC_PREVIEWER_RED_GAMMA_START_ADDR);
#ifdef PREVIEWER_DEBUG
            x = CSL_FEXT(prevRegs->SET_TBL_ADDRESS,
                PREV_SET_TBL_ADDRESS_ADDR);
            if ((Uint32)LLC_PREVIEWER_RED_GAMMA_START_ADDR != x)
            {
                llcPrevDebugErrorStatus = 79;
            }
#endif /* PREVIEWER_DEBUG */
            /* set data */
            for(i=0; i <= (LLC_PREVIEWER_RED_GAMMA_END_ADDR
                    - LLC_PREVIEWER_RED_GAMMA_START_ADDR); i++)
            {
                prevRegs->SET_TBL_DATA
                    = (Uint32)prevConfigParams->gammaCoeffsParam.red[i];
                /* Address is auto incremented */
            }
#ifdef PREVIEWER_DEBUG
            CSL_FINS(prevRegs->SET_TBL_ADDRESS, PREV_SET_TBL_ADDRESS_ADDR,
                (Uint32)LLC_PREVIEWER_RED_GAMMA_START_ADDR);
            /* get data */
            for(i=0; i <= (LLC_PREVIEWER_RED_GAMMA_END_ADDR
                    - LLC_PREVIEWER_RED_GAMMA_START_ADDR); i++)
            {
                x = prevRegs->SET_TBL_DATA;
                if ((Uint8)prevConfigParams->gammaCoeffsParam.red[i] != x)
                {
                    llcPrevDebugErrorStatus = 80;
                }
                /* Address is auto incremented */
            }
#endif /* PREVIEWER_DEBUG */

            /* Set table start address for green gamma */
            CSL_FINS(prevRegs->SET_TBL_ADDRESS, PREV_SET_TBL_ADDRESS_ADDR,
                (Uint32)LLC_PREVIEWER_GREEN_GAMMA_START_ADDR);
#ifdef PREVIEWER_DEBUG
            x = CSL_FEXT(prevRegs->SET_TBL_ADDRESS,
                PREV_SET_TBL_ADDRESS_ADDR);
            if ((Uint32)LLC_PREVIEWER_GREEN_GAMMA_START_ADDR != x)
            {
                llcPrevDebugErrorStatus = 81;
            }
#endif /* PREVIEWER_DEBUG */
            /* set data */
            for(i=0; i <= (LLC_PREVIEWER_GREEN_GAMMA_END_ADDR
                    - LLC_PREVIEWER_GREEN_GAMMA_START_ADDR); i++)
            {
                prevRegs->SET_TBL_DATA
                    = (Uint32)prevConfigParams->gammaCoeffsParam.green[i];
                /* Address is auto incremented */
            }
#ifdef PREVIEWER_DEBUG
            CSL_FINS(prevRegs->SET_TBL_ADDRESS, PREV_SET_TBL_ADDRESS_ADDR,
                (Uint32)LLC_PREVIEWER_GREEN_GAMMA_START_ADDR);
            /* get data */
            for(i=0; i <= (LLC_PREVIEWER_GREEN_GAMMA_END_ADDR
                    - LLC_PREVIEWER_GREEN_GAMMA_START_ADDR); i++)
            {
                x = prevRegs->SET_TBL_DATA;
                if ((Uint8)prevConfigParams->gammaCoeffsParam.green[i] != x)
                {
                    llcPrevDebugErrorStatus = 82;
                }
                /* Address is auto incremented */
            }
#endif /* PREVIEWER_DEBUG */

            /* Set table address for blue gamma */
            CSL_FINS(prevRegs->SET_TBL_ADDRESS, PREV_SET_TBL_ADDRESS_ADDR,
                (Uint32)LLC_PREVIEWER_BLUE_GAMMA_START_ADDR);
#ifdef PREVIEWER_DEBUG
            x = CSL_FEXT(prevRegs->SET_TBL_ADDRESS,
                PREV_SET_TBL_ADDRESS_ADDR);
            if ((Uint32)LLC_PREVIEWER_BLUE_GAMMA_START_ADDR != x)
            {
                llcPrevDebugErrorStatus = 83;
            }
#endif /* PREVIEWER_DEBUG */
            /* set data */
            for(i=0; i <= (LLC_PREVIEWER_BLUE_GAMMA_END_ADDR
                    - LLC_PREVIEWER_BLUE_GAMMA_START_ADDR); i++)
            {
                prevRegs->SET_TBL_DATA
                    = (Uint32)prevConfigParams->gammaCoeffsParam.blue[i];
                /* Address is auto incremented */
            }
#ifdef PREVIEWER_DEBUG
            CSL_FINS(prevRegs->SET_TBL_ADDRESS, PREV_SET_TBL_ADDRESS_ADDR,
                (Uint32)LLC_PREVIEWER_BLUE_GAMMA_START_ADDR);
            /* get data */
            for(i=0; i <= (LLC_PREVIEWER_BLUE_GAMMA_END_ADDR
                    - LLC_PREVIEWER_BLUE_GAMMA_START_ADDR); i++)
            {
                x = prevRegs->SET_TBL_DATA;
                if ((Uint8)prevConfigParams->gammaCoeffsParam.blue[i] != x)
                {
                    llcPrevDebugErrorStatus = 84;
                }
                /* Address is auto incremented */
            }
#endif /* PREVIEWER_DEBUG */
        }
        else
        {
            /* else enable gamma bypassing */
            CSL_FINS(prevRegs->PCR, PREV_PCR_GAMMA_BYPASS,
                (Uint32)CSL_PREV_PCR_GAMMA_BYPASS_BYPASS);
#ifdef PREVIEWER_DEBUG
            x = CSL_FEXT(prevRegs->PCR, PREV_PCR_GAMMA_BYPASS);
            if ((Uint32)CSL_PREV_PCR_GAMMA_BYPASS_BYPASS != x)
            {
                llcPrevDebugErrorStatus = 85;
            }
#endif /* PREVIEWER_DEBUG */
        }

        /* Setting RGB 2 YCbCr matrix gains and offsets */
        CSL_FINS(prevRegs->CSC0, PREV_CSC0_CSCRY,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[0][0]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC0, PREV_CSC0_CSCRY);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[0][0] != x)
        {
            llcPrevDebugErrorStatus = 86;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC0, PREV_CSC0_CSCGY,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[0][1]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC0, PREV_CSC0_CSCGY);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[0][1] != x)
        {
            llcPrevDebugErrorStatus = 87;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC0, PREV_CSC0_CSCBY,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[0][2]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC0, PREV_CSC0_CSCBY);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[0][2] != x)
        {
            llcPrevDebugErrorStatus = 88;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC1, PREV_CSC1_CSCRCB,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[1][0]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC1, PREV_CSC1_CSCRCB);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[1][0] != x)
        {
            llcPrevDebugErrorStatus = 89;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC1, PREV_CSC1_CSCGCB,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[1][1]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC1, PREV_CSC1_CSCGCB);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[1][1] != x)
        {
            llcPrevDebugErrorStatus = 90;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC1, PREV_CSC1_CSCBCB,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[1][2]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC1, PREV_CSC1_CSCBCB);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[1][2] != x)
        {
            llcPrevDebugErrorStatus = 91;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC2, PREV_CSC2_CSCRCR,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[2][0]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC2, PREV_CSC2_CSCRCR);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[2][0] != x)
        {
            llcPrevDebugErrorStatus = 92;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC2, PREV_CSC2_CSCGCR,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[2][1]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC2, PREV_CSC2_CSCGCR);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[2][1] != x)
        {
            llcPrevDebugErrorStatus = 93;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC2, PREV_CSC2_CSCBCR,
            (Uint32)prevConfigParams->rgb2ycbcrParam.coeff[2][2]);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC2, PREV_CSC2_CSCBCR);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.coeff[2][2] != x)
        {
            llcPrevDebugErrorStatus = 94;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC_OFFSET, PREV_CSC_OFFSET_OFSTCR,
            (Uint32)prevConfigParams->rgb2ycbcrParam.crOffset);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC_OFFSET, PREV_CSC_OFFSET_OFSTCR);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.crOffset != x)
        {
            llcPrevDebugErrorStatus = 95;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC_OFFSET, PREV_CSC_OFFSET_OFSTCB,
            (Uint32)prevConfigParams->rgb2ycbcrParam.cbOffset);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC_OFFSET, PREV_CSC_OFFSET_OFSTCB);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.cbOffset != x)
        {
            llcPrevDebugErrorStatus = 96;
        }
#endif /* PREVIEWER_DEBUG */
        CSL_FINS(prevRegs->CSC_OFFSET, PREV_CSC_OFFSET_YOFST,
            (Uint32)prevConfigParams->rgb2ycbcrParam.yOffset);
#ifdef PREVIEWER_DEBUG
        x = CSL_FEXT(prevRegs->CSC_OFFSET, PREV_CSC_OFFSET_YOFST);
        if ((Uint32)prevConfigParams->rgb2ycbcrParam.yOffset != x)
        {
            llcPrevDebugErrorStatus = 97;
        }
#endif /* PREVIEWER_DEBUG */

        /* Set luma enhancement Coefficients if it is enabled in
         * configuration */
        {
            if ((Uint32)0x0
                != (prevConfigParams->features
                    & PSP_PREVIEWER_LUMA_ENHANCE))
            {
                /* enable Luma enhancement in PCR */
                CSL_FINS(prevRegs->PCR, PREV_PCR_YNENHEN,
                    (Uint32)CSL_PREV_PCR_YNENHEN_ENABLE);
#ifdef PREVIEWER_DEBUG
                x = CSL_FEXT(prevRegs->PCR, PREV_PCR_YNENHEN);
                if ((Uint32)CSL_PREV_PCR_YNENHEN_ENABLE != x)
                {
                    llcPrevDebugErrorStatus = 98;
                }
#endif /* PREVIEWER_DEBUG */
                /* Set the start address for luma enhancement */
                CSL_FINS(prevRegs->SET_TBL_ADDRESS,
                    PREV_SET_TBL_ADDRESS_ADDR,
                    (Uint32)LLC_PREVIEWER_LUMA_ENHANCE_START_ADDR);
#ifdef PREVIEWER_DEBUG
                x = CSL_FEXT(prevRegs->SET_TBL_ADDRESS,
                    PREV_SET_TBL_ADDRESS_ADDR);
                if ((Uint32)LLC_PREVIEWER_LUMA_ENHANCE_START_ADDR != x)
                {
                    llcPrevDebugErrorStatus = 99;
                }
#endif /* PREVIEWER_DEBUG */
                /* set data */
                for(i=0; i <= (LLC_PREVIEWER_LUMA_ENHANCE_END_ADDR
                        - LLC_PREVIEWER_LUMA_ENHANCE_START_ADDR); i++)
                {
                    prevRegs->SET_TBL_DATA
                        =     (Uint32)prevConfigParams->lumaEnhance[i];
                    /* Address is auto incremented */
                }
            }
        }

        /* Set chroma suppress feature if it is enabled in
         * configuration */
        if ((Uint32)0
            != (prevConfigParams->features
                & PSP_PREVIEWER_CHROMA_SUPPRESS))
        {
            /* enable Luma enhancement in PCR */
            CSL_FINS(prevRegs->PCR, PREV_PCR_SUPEN,
                (Uint32)CSL_PREV_PCR_SUPEN_ENABLE);
#ifdef PREVIEWER_DEBUG
            x = CSL_FEXT(prevRegs->PCR, PREV_PCR_SUPEN);
            if ((Uint32)CSL_PREV_PCR_SUPEN_ENABLE != x)
            {
                llcPrevDebugErrorStatus = 100;
            }
#endif /* PREVIEWER_DEBUG */
            if ((Uint32)0
                != (prevConfigParams->chromaSuppressionParam.hpfy))
            {
                CSL_FINS(prevRegs->CSUP, PREV_CSUP_HPFY,
                    (Uint32)CSL_PREV_CSUP_HPFY_ENABLE);
#ifdef PREVIEWER_DEBUG
                x = CSL_FEXT(prevRegs->CSUP, PREV_CSUP_HPFY);
                if ((Uint32)CSL_PREV_CSUP_HPFY_ENABLE != x)
                {
                    llcPrevDebugErrorStatus = 101;
                }
#endif /* PREVIEWER_DEBUG */
            }
            else
            {
                CSL_FINS(prevRegs->CSUP, PREV_CSUP_HPFY,
                    (Uint32)CSL_PREV_CSUP_HPFY_DISABLE);
#ifdef PREVIEWER_DEBUG
                x = CSL_FEXT(prevRegs->CSUP, PREV_CSUP_HPFY);
                if ((Uint32)CSL_PREV_CSUP_HPFY_DISABLE != x)
                {
                    llcPrevDebugErrorStatus = 102;
                }
#endif /* PREVIEWER_DEBUG */

⌨️ 快捷键说明

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