10c1bc742181ded4930842b46e9507372f0b1b963James Dong/**
20c1bc742181ded4930842b46e9507372f0b1b963James Dong *
30c1bc742181ded4930842b46e9507372f0b1b963James Dong * File Name:  armVCM4P2_ACDCPredict.c
40c1bc742181ded4930842b46e9507372f0b1b963James Dong * OpenMAX DL: v1.0.2
50c1bc742181ded4930842b46e9507372f0b1b963James Dong * Revision:   9641
60c1bc742181ded4930842b46e9507372f0b1b963James Dong * Date:       Thursday, February 7, 2008
70c1bc742181ded4930842b46e9507372f0b1b963James Dong *
80c1bc742181ded4930842b46e9507372f0b1b963James Dong * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
90c1bc742181ded4930842b46e9507372f0b1b963James Dong *
100c1bc742181ded4930842b46e9507372f0b1b963James Dong *
110c1bc742181ded4930842b46e9507372f0b1b963James Dong *
120c1bc742181ded4930842b46e9507372f0b1b963James Dong * Description:
130c1bc742181ded4930842b46e9507372f0b1b963James Dong * Contains module for DC/AC coefficient prediction
140c1bc742181ded4930842b46e9507372f0b1b963James Dong *
150c1bc742181ded4930842b46e9507372f0b1b963James Dong */
160c1bc742181ded4930842b46e9507372f0b1b963James Dong
170c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "omxtypes.h"
180c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armOMX.h"
190c1bc742181ded4930842b46e9507372f0b1b963James Dong
200c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armVC.h"
210c1bc742181ded4930842b46e9507372f0b1b963James Dong#include "armCOMM.h"
220c1bc742181ded4930842b46e9507372f0b1b963James Dong
230c1bc742181ded4930842b46e9507372f0b1b963James Dong/**
240c1bc742181ded4930842b46e9507372f0b1b963James Dong * Function: armVCM4P2_ACDCPredict
250c1bc742181ded4930842b46e9507372f0b1b963James Dong *
260c1bc742181ded4930842b46e9507372f0b1b963James Dong * Description:
270c1bc742181ded4930842b46e9507372f0b1b963James Dong * Performs adaptive DC/AC coefficient prediction for an intra block. Prior
280c1bc742181ded4930842b46e9507372f0b1b963James Dong * to the function call, prediction direction (predDir) should be selected
290c1bc742181ded4930842b46e9507372f0b1b963James Dong * as specified in subclause 7.4.3.1 of ISO/IEC 14496-2.
300c1bc742181ded4930842b46e9507372f0b1b963James Dong *
310c1bc742181ded4930842b46e9507372f0b1b963James Dong * Remarks:
320c1bc742181ded4930842b46e9507372f0b1b963James Dong *
330c1bc742181ded4930842b46e9507372f0b1b963James Dong * Parameters:
340c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] pSrcDst     pointer to the coefficient buffer which contains
350c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          the quantized coefficient residuals (PQF) of the
360c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          current block
370c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] pPredBufRow pointer to the coefficient row buffer
380c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] pPredBufCol pointer to the coefficient column buffer
390c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] curQP       quantization parameter of the current block. curQP
400c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          may equal to predQP especially when the current
410c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          block and the predictor block are in the same
420c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          macroblock.
430c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] predQP      quantization parameter of the predictor block
440c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] predDir     indicates the prediction direction which takes one
450c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          of the following values:
460c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          OMX_VC_HORIZONTAL    predict horizontally
470c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          OMX_VC_VERTICAL      predict vertically
480c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] ACPredFlag  a flag indicating if AC prediction should be
490c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          performed. It is equal to ac_pred_flag in the bit
500c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          stream syntax of MPEG-4
510c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] videoComp   video component type (luminance, chrominance or
520c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          alpha) of the current block
530c1bc742181ded4930842b46e9507372f0b1b963James Dong * [in] flag        This flag defines the if one wants to use this functions to
540c1bc742181ded4930842b46e9507372f0b1b963James Dong *                  calculate PQF (set 1, prediction) or QF (set 0, reconstruction)
550c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]    pPreACPredict   pointer to the predicted coefficients buffer.
560c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          Filled ONLY if it is not NULL
570c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]    pSrcDst     pointer to the coefficient buffer which contains
580c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          the quantized coefficients (QF) of the current
590c1bc742181ded4930842b46e9507372f0b1b963James Dong *                          block
600c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]    pPredBufRow pointer to the updated coefficient row buffer
610c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]    pPredBufCol pointer to the updated coefficient column buffer
620c1bc742181ded4930842b46e9507372f0b1b963James Dong * [out]    pSumErr     pointer to the updated sum of the difference
630c1bc742181ded4930842b46e9507372f0b1b963James Dong *                      between predicted and unpredicted coefficients
640c1bc742181ded4930842b46e9507372f0b1b963James Dong *                      If this is NULL, do not update
650c1bc742181ded4930842b46e9507372f0b1b963James Dong *
660c1bc742181ded4930842b46e9507372f0b1b963James Dong * Return Value:
670c1bc742181ded4930842b46e9507372f0b1b963James Dong * Standard OMXResult result. See enumeration for possible result codes.
680c1bc742181ded4930842b46e9507372f0b1b963James Dong *
690c1bc742181ded4930842b46e9507372f0b1b963James Dong */
700c1bc742181ded4930842b46e9507372f0b1b963James Dong
710c1bc742181ded4930842b46e9507372f0b1b963James DongOMXResult armVCM4P2_ACDCPredict(
720c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_S16 * pSrcDst,
730c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_S16 * pPreACPredict,
740c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_S16 * pPredBufRow,
750c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_S16 * pPredBufCol,
760c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_INT curQP,
770c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_INT predQP,
780c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_INT predDir,
790c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_INT ACPredFlag,
800c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMXVCM4P2VideoComponent videoComp,
810c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_U8 flag,
820c1bc742181ded4930842b46e9507372f0b1b963James Dong     OMX_INT *pSumErr
830c1bc742181ded4930842b46e9507372f0b1b963James Dong)
840c1bc742181ded4930842b46e9507372f0b1b963James Dong{
850c1bc742181ded4930842b46e9507372f0b1b963James Dong    OMX_INT dcScaler, i;
860c1bc742181ded4930842b46e9507372f0b1b963James Dong    OMX_S16 tempPred;
870c1bc742181ded4930842b46e9507372f0b1b963James Dong
880c1bc742181ded4930842b46e9507372f0b1b963James Dong    /* Argument error checks */
890c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf(pSrcDst == NULL, OMX_Sts_BadArgErr);
900c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf(pPredBufRow == NULL, OMX_Sts_BadArgErr);
910c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf(pPredBufCol == NULL, OMX_Sts_BadArgErr);
920c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf(curQP <= 0, OMX_Sts_BadArgErr);
930c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf(predQP <= 0, OMX_Sts_BadArgErr);
940c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf((predDir != 1) && (predDir != 2), OMX_Sts_BadArgErr);
950c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf(!armIs4ByteAligned(pSrcDst), OMX_Sts_BadArgErr);
960c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf(!armIs4ByteAligned(pPredBufRow), OMX_Sts_BadArgErr);
970c1bc742181ded4930842b46e9507372f0b1b963James Dong    armRetArgErrIf(!armIs4ByteAligned(pPredBufCol), OMX_Sts_BadArgErr);
980c1bc742181ded4930842b46e9507372f0b1b963James Dong
990c1bc742181ded4930842b46e9507372f0b1b963James Dong
1000c1bc742181ded4930842b46e9507372f0b1b963James Dong    /* Set DC scaler value to avoid some compilers giving a warning. */
1010c1bc742181ded4930842b46e9507372f0b1b963James Dong    dcScaler=0;
1020c1bc742181ded4930842b46e9507372f0b1b963James Dong
1030c1bc742181ded4930842b46e9507372f0b1b963James Dong    /* Calculate the DC scaler value */
1040c1bc742181ded4930842b46e9507372f0b1b963James Dong    if (videoComp == OMX_VC_LUMINANCE)
1050c1bc742181ded4930842b46e9507372f0b1b963James Dong    {
1060c1bc742181ded4930842b46e9507372f0b1b963James Dong        if (curQP >= 1 && curQP <= 4)
1070c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
1080c1bc742181ded4930842b46e9507372f0b1b963James Dong            dcScaler = 8;
1090c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
1100c1bc742181ded4930842b46e9507372f0b1b963James Dong        else if (curQP >= 5 && curQP <= 8)
1110c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
1120c1bc742181ded4930842b46e9507372f0b1b963James Dong            dcScaler = 2 * curQP;
1130c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
1140c1bc742181ded4930842b46e9507372f0b1b963James Dong        else if (curQP >= 9 && curQP <= 24)
1150c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
1160c1bc742181ded4930842b46e9507372f0b1b963James Dong            dcScaler = curQP + 8;
1170c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
1180c1bc742181ded4930842b46e9507372f0b1b963James Dong        else
1190c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
1200c1bc742181ded4930842b46e9507372f0b1b963James Dong            dcScaler = (2 * curQP) - 16;
1210c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
1220c1bc742181ded4930842b46e9507372f0b1b963James Dong    }
1230c1bc742181ded4930842b46e9507372f0b1b963James Dong    else if (videoComp == OMX_VC_CHROMINANCE)
1240c1bc742181ded4930842b46e9507372f0b1b963James Dong    {
1250c1bc742181ded4930842b46e9507372f0b1b963James Dong        if (curQP >= 1 && curQP <= 4)
1260c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
1270c1bc742181ded4930842b46e9507372f0b1b963James Dong            dcScaler = 8;
1280c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
1290c1bc742181ded4930842b46e9507372f0b1b963James Dong        else if (curQP >= 5 && curQP <= 24)
1300c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
1310c1bc742181ded4930842b46e9507372f0b1b963James Dong            dcScaler = (curQP + 13)/2;
1320c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
1330c1bc742181ded4930842b46e9507372f0b1b963James Dong        else
1340c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
1350c1bc742181ded4930842b46e9507372f0b1b963James Dong            dcScaler = curQP - 6;
1360c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
1370c1bc742181ded4930842b46e9507372f0b1b963James Dong    }
1380c1bc742181ded4930842b46e9507372f0b1b963James Dong
1390c1bc742181ded4930842b46e9507372f0b1b963James Dong    if (pPreACPredict != NULL)
1400c1bc742181ded4930842b46e9507372f0b1b963James Dong    {
1410c1bc742181ded4930842b46e9507372f0b1b963James Dong        pPreACPredict[0] = predDir;
1420c1bc742181ded4930842b46e9507372f0b1b963James Dong    }
1430c1bc742181ded4930842b46e9507372f0b1b963James Dong
1440c1bc742181ded4930842b46e9507372f0b1b963James Dong    if (predDir == OMX_VC_VERTICAL)
1450c1bc742181ded4930842b46e9507372f0b1b963James Dong    {
1460c1bc742181ded4930842b46e9507372f0b1b963James Dong        /* F[0][0]//dc_scaler */
1470c1bc742181ded4930842b46e9507372f0b1b963James Dong        tempPred = armIntDivAwayFromZero(pPredBufRow[0], dcScaler);
1480c1bc742181ded4930842b46e9507372f0b1b963James Dong    }
1490c1bc742181ded4930842b46e9507372f0b1b963James Dong    else
1500c1bc742181ded4930842b46e9507372f0b1b963James Dong    {
1510c1bc742181ded4930842b46e9507372f0b1b963James Dong        /* F[0][0]//dc_scaler */
1520c1bc742181ded4930842b46e9507372f0b1b963James Dong        tempPred = armIntDivAwayFromZero(pPredBufCol[0], dcScaler);
1530c1bc742181ded4930842b46e9507372f0b1b963James Dong    }
1540c1bc742181ded4930842b46e9507372f0b1b963James Dong
1550c1bc742181ded4930842b46e9507372f0b1b963James Dong    /* Updating the DC value to the row and col buffer */
1560c1bc742181ded4930842b46e9507372f0b1b963James Dong    *(pPredBufRow - 8) = *pPredBufCol;
1570c1bc742181ded4930842b46e9507372f0b1b963James Dong
1580c1bc742181ded4930842b46e9507372f0b1b963James Dong    if (flag)
1590c1bc742181ded4930842b46e9507372f0b1b963James Dong    {
1600c1bc742181ded4930842b46e9507372f0b1b963James Dong        /* Cal and store F[0][0] into the col buffer */
1610c1bc742181ded4930842b46e9507372f0b1b963James Dong        *pPredBufCol = pSrcDst[0] * dcScaler;
1620c1bc742181ded4930842b46e9507372f0b1b963James Dong
1630c1bc742181ded4930842b46e9507372f0b1b963James Dong        /* PQF = QF - F[0][0]//dc_scaler */
1640c1bc742181ded4930842b46e9507372f0b1b963James Dong        pSrcDst[0] -= tempPred;
1650c1bc742181ded4930842b46e9507372f0b1b963James Dong    }
1660c1bc742181ded4930842b46e9507372f0b1b963James Dong    else
1670c1bc742181ded4930842b46e9507372f0b1b963James Dong    {
1680c1bc742181ded4930842b46e9507372f0b1b963James Dong        /* QF = PQF + F[0][0]//dc_scaler */
1690c1bc742181ded4930842b46e9507372f0b1b963James Dong        pSrcDst[0] += tempPred;
1700c1bc742181ded4930842b46e9507372f0b1b963James Dong
1710c1bc742181ded4930842b46e9507372f0b1b963James Dong        /* Saturate */
1720c1bc742181ded4930842b46e9507372f0b1b963James Dong        pSrcDst[0] = armClip (-2048, 2047, pSrcDst[0]);
1730c1bc742181ded4930842b46e9507372f0b1b963James Dong
1740c1bc742181ded4930842b46e9507372f0b1b963James Dong        /* Cal and store F[0][0] into the col buffer */
1750c1bc742181ded4930842b46e9507372f0b1b963James Dong        *pPredBufCol = pSrcDst[0] * dcScaler;
1760c1bc742181ded4930842b46e9507372f0b1b963James Dong    }
1770c1bc742181ded4930842b46e9507372f0b1b963James Dong
1780c1bc742181ded4930842b46e9507372f0b1b963James Dong
1790c1bc742181ded4930842b46e9507372f0b1b963James Dong    if (ACPredFlag == 1)
1800c1bc742181ded4930842b46e9507372f0b1b963James Dong    {
1810c1bc742181ded4930842b46e9507372f0b1b963James Dong        if (predDir == OMX_VC_VERTICAL)
1820c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
1830c1bc742181ded4930842b46e9507372f0b1b963James Dong            for (i = 1; i < 8; i++)
1840c1bc742181ded4930842b46e9507372f0b1b963James Dong            {
1850c1bc742181ded4930842b46e9507372f0b1b963James Dong                tempPred = armIntDivAwayFromZero \
1860c1bc742181ded4930842b46e9507372f0b1b963James Dong                              (pPredBufRow[i] * predQP, curQP);
1870c1bc742181ded4930842b46e9507372f0b1b963James Dong                if (flag)
1880c1bc742181ded4930842b46e9507372f0b1b963James Dong                {
1890c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* Updating QF to the row buff */
1900c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pPredBufRow[i] = pSrcDst[i];
1910c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /*PQFX[v][0] = QFX[v][0] - (QFA[v][0] * QPA) // QPX */
1920c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pSrcDst[i] -= tempPred;
1930c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* Sum of absolute values of AC prediction error, this can
1940c1bc742181ded4930842b46e9507372f0b1b963James Dong                    be used as a reference to choose whether to use
1950c1bc742181ded4930842b46e9507372f0b1b963James Dong                    AC prediction */
1960c1bc742181ded4930842b46e9507372f0b1b963James Dong                    *pSumErr += armAbs(pSrcDst[i]);
1970c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* pPreACPredict[1~7] store the error signal
1980c1bc742181ded4930842b46e9507372f0b1b963James Dong                    after AC prediction */
1990c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pPreACPredict[i] = pSrcDst[i];
2000c1bc742181ded4930842b46e9507372f0b1b963James Dong                }
2010c1bc742181ded4930842b46e9507372f0b1b963James Dong                else
2020c1bc742181ded4930842b46e9507372f0b1b963James Dong                {
2030c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /*QFX[v][0] = PQFX[v][0] + (QFA[v][0] * QPA) // QPX */
2040c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pSrcDst[i] += tempPred;
2050c1bc742181ded4930842b46e9507372f0b1b963James Dong
2060c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* Saturate */
2070c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pSrcDst[i] = armClip (-2048, 2047, pSrcDst[i]);
2080c1bc742181ded4930842b46e9507372f0b1b963James Dong
2090c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* Updating QF to the row buff */
2100c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pPredBufRow[i] = pSrcDst[i];
2110c1bc742181ded4930842b46e9507372f0b1b963James Dong                }
2120c1bc742181ded4930842b46e9507372f0b1b963James Dong            }
2130c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
2140c1bc742181ded4930842b46e9507372f0b1b963James Dong        else
2150c1bc742181ded4930842b46e9507372f0b1b963James Dong        {
2160c1bc742181ded4930842b46e9507372f0b1b963James Dong            for (i = 8; i < 64; i += 8)
2170c1bc742181ded4930842b46e9507372f0b1b963James Dong            {
2180c1bc742181ded4930842b46e9507372f0b1b963James Dong                tempPred = armIntDivAwayFromZero \
2190c1bc742181ded4930842b46e9507372f0b1b963James Dong                              (pPredBufCol[i>>3] * predQP, curQP);
2200c1bc742181ded4930842b46e9507372f0b1b963James Dong                if (flag)
2210c1bc742181ded4930842b46e9507372f0b1b963James Dong                {
2220c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* Updating QF to col buff */
2230c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pPredBufCol[i>>3] = pSrcDst[i];
2240c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /*PQFX[0][u] = QFX[0][u] - (QFA[0][u] * QPA) // QPX */
2250c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pSrcDst[i] -= tempPred;
2260c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* Sum of absolute values of AC prediction error, this can
2270c1bc742181ded4930842b46e9507372f0b1b963James Dong                    be used as a reference to choose whether to use AC
2280c1bc742181ded4930842b46e9507372f0b1b963James Dong                    prediction */
2290c1bc742181ded4930842b46e9507372f0b1b963James Dong                    *pSumErr += armAbs(pSrcDst[i]);
2300c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* pPreACPredict[1~7] store the error signal
2310c1bc742181ded4930842b46e9507372f0b1b963James Dong                    after AC prediction */
2320c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pPreACPredict[i>>3] = pSrcDst[i];
2330c1bc742181ded4930842b46e9507372f0b1b963James Dong                }
2340c1bc742181ded4930842b46e9507372f0b1b963James Dong                else
2350c1bc742181ded4930842b46e9507372f0b1b963James Dong                {
2360c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /*QFX[0][u] = PQFX[0][u] + (QFA[0][u] * QPA) // QPX */
2370c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pSrcDst[i] += tempPred;
2380c1bc742181ded4930842b46e9507372f0b1b963James Dong
2390c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* Saturate */
2400c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pSrcDst[i] = armClip (-2048, 2047, pSrcDst[i]);
2410c1bc742181ded4930842b46e9507372f0b1b963James Dong
2420c1bc742181ded4930842b46e9507372f0b1b963James Dong                    /* Updating QF to col buff */
2430c1bc742181ded4930842b46e9507372f0b1b963James Dong                    pPredBufCol[i>>3] = pSrcDst[i];
2440c1bc742181ded4930842b46e9507372f0b1b963James Dong                }
2450c1bc742181ded4930842b46e9507372f0b1b963James Dong            }
2460c1bc742181ded4930842b46e9507372f0b1b963James Dong        }
2470c1bc742181ded4930842b46e9507372f0b1b963James Dong    }
2480c1bc742181ded4930842b46e9507372f0b1b963James Dong
2490c1bc742181ded4930842b46e9507372f0b1b963James Dong    return OMX_Sts_NoErr;
2500c1bc742181ded4930842b46e9507372f0b1b963James Dong}
2510c1bc742181ded4930842b46e9507372f0b1b963James Dong
2520c1bc742181ded4930842b46e9507372f0b1b963James Dong/*End of File*/
2530c1bc742181ded4930842b46e9507372f0b1b963James Dong
254