1bebc99d6fa433c04139294a5057f8439d772dbd9James Dong/**
2bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
3bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * File Name:  armVCM4P2_ACDCPredict.c
4bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * OpenMAX DL: v1.0.2
5bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Revision:   9641
6bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Date:       Thursday, February 7, 2008
7bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
8bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * (c) Copyright 2007-2008 ARM Limited. All Rights Reserved.
9bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
10bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
11bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
12bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Description:
13bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Contains module for DC/AC coefficient prediction
14bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
15bebc99d6fa433c04139294a5057f8439d772dbd9James Dong */
16bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
17bebc99d6fa433c04139294a5057f8439d772dbd9James Dong#include "omxtypes.h"
18bebc99d6fa433c04139294a5057f8439d772dbd9James Dong#include "armOMX.h"
19bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
20bebc99d6fa433c04139294a5057f8439d772dbd9James Dong#include "armVC.h"
21bebc99d6fa433c04139294a5057f8439d772dbd9James Dong#include "armCOMM.h"
22bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
23bebc99d6fa433c04139294a5057f8439d772dbd9James Dong/**
24bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Function: armVCM4P2_ACDCPredict
25bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
26bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Description:
27bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Performs adaptive DC/AC coefficient prediction for an intra block. Prior
28bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * to the function call, prediction direction (predDir) should be selected
29bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * as specified in subclause 7.4.3.1 of ISO/IEC 14496-2.
30bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
31bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Remarks:
32bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
33bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Parameters:
34bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] pSrcDst     pointer to the coefficient buffer which contains
35bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          the quantized coefficient residuals (PQF) of the
36bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          current block
37bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] pPredBufRow pointer to the coefficient row buffer
38bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] pPredBufCol pointer to the coefficient column buffer
39bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] curQP       quantization parameter of the current block. curQP
40bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          may equal to predQP especially when the current
41bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          block and the predictor block are in the same
42bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          macroblock.
43bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] predQP      quantization parameter of the predictor block
44bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] predDir     indicates the prediction direction which takes one
45bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          of the following values:
46bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          OMX_VC_HORIZONTAL    predict horizontally
47bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          OMX_VC_VERTICAL      predict vertically
48bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] ACPredFlag  a flag indicating if AC prediction should be
49bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          performed. It is equal to ac_pred_flag in the bit
50bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          stream syntax of MPEG-4
51bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] videoComp   video component type (luminance, chrominance or
52bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          alpha) of the current block
53bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [in] flag        This flag defines the if one wants to use this functions to
54bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                  calculate PQF (set 1, prediction) or QF (set 0, reconstruction)
55bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [out]    pPreACPredict   pointer to the predicted coefficients buffer.
56bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          Filled ONLY if it is not NULL
57bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [out]    pSrcDst     pointer to the coefficient buffer which contains
58bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          the quantized coefficients (QF) of the current
59bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                          block
60bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [out]    pPredBufRow pointer to the updated coefficient row buffer
61bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [out]    pPredBufCol pointer to the updated coefficient column buffer
62bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * [out]    pSumErr     pointer to the updated sum of the difference
63bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                      between predicted and unpredicted coefficients
64bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *                      If this is NULL, do not update
65bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
66bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Return Value:
67bebc99d6fa433c04139294a5057f8439d772dbd9James Dong * Standard OMXResult result. See enumeration for possible result codes.
68bebc99d6fa433c04139294a5057f8439d772dbd9James Dong *
69bebc99d6fa433c04139294a5057f8439d772dbd9James Dong */
70bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
71bebc99d6fa433c04139294a5057f8439d772dbd9James DongOMXResult armVCM4P2_ACDCPredict(
72bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_S16 * pSrcDst,
73bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_S16 * pPreACPredict,
74bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_S16 * pPredBufRow,
75bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_S16 * pPredBufCol,
76bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_INT curQP,
77bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_INT predQP,
78bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_INT predDir,
79bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_INT ACPredFlag,
80bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMXVCM4P2VideoComponent videoComp,
81bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_U8 flag,
82bebc99d6fa433c04139294a5057f8439d772dbd9James Dong     OMX_INT *pSumErr
83bebc99d6fa433c04139294a5057f8439d772dbd9James Dong)
84bebc99d6fa433c04139294a5057f8439d772dbd9James Dong{
85bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    OMX_INT dcScaler, i;
86bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    OMX_S16 tempPred;
87bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
88bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    /* Argument error checks */
89bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf(pSrcDst == NULL, OMX_Sts_BadArgErr);
90bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf(pPredBufRow == NULL, OMX_Sts_BadArgErr);
91bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf(pPredBufCol == NULL, OMX_Sts_BadArgErr);
92bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf(curQP <= 0, OMX_Sts_BadArgErr);
93bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf(predQP <= 0, OMX_Sts_BadArgErr);
94bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf((predDir != 1) && (predDir != 2), OMX_Sts_BadArgErr);
95bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf(!armIs4ByteAligned(pSrcDst), OMX_Sts_BadArgErr);
96bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf(!armIs4ByteAligned(pPredBufRow), OMX_Sts_BadArgErr);
97bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    armRetArgErrIf(!armIs4ByteAligned(pPredBufCol), OMX_Sts_BadArgErr);
98bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
99bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
100bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    /* Set DC scaler value to avoid some compilers giving a warning. */
101bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    dcScaler=0;
102bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
103bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    /* Calculate the DC scaler value */
104bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    if (videoComp == OMX_VC_LUMINANCE)
105bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    {
106bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        if (curQP >= 1 && curQP <= 4)
107bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
108bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            dcScaler = 8;
109bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
110bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        else if (curQP >= 5 && curQP <= 8)
111bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
112bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            dcScaler = 2 * curQP;
113bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
114bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        else if (curQP >= 9 && curQP <= 24)
115bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
116bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            dcScaler = curQP + 8;
117bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
118bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        else
119bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
120bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            dcScaler = (2 * curQP) - 16;
121bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
122bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    }
123bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    else if (videoComp == OMX_VC_CHROMINANCE)
124bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    {
125bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        if (curQP >= 1 && curQP <= 4)
126bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
127bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            dcScaler = 8;
128bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
129bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        else if (curQP >= 5 && curQP <= 24)
130bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
131bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            dcScaler = (curQP + 13)/2;
132bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
133bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        else
134bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
135bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            dcScaler = curQP - 6;
136bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
137bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    }
138bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
139bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    if (pPreACPredict != NULL)
140bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    {
141bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        pPreACPredict[0] = predDir;
142bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    }
143bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
144bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    if (predDir == OMX_VC_VERTICAL)
145bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    {
146bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        /* F[0][0]//dc_scaler */
147bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        tempPred = armIntDivAwayFromZero(pPredBufRow[0], dcScaler);
148bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    }
149bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    else
150bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    {
151bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        /* F[0][0]//dc_scaler */
152bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        tempPred = armIntDivAwayFromZero(pPredBufCol[0], dcScaler);
153bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    }
154bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
155bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    /* Updating the DC value to the row and col buffer */
156bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    *(pPredBufRow - 8) = *pPredBufCol;
157bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
158bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    if (flag)
159bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    {
160bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        /* Cal and store F[0][0] into the col buffer */
161bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        *pPredBufCol = pSrcDst[0] * dcScaler;
162bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
163bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        /* PQF = QF - F[0][0]//dc_scaler */
164bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        pSrcDst[0] -= tempPred;
165bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    }
166bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    else
167bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    {
168bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        /* QF = PQF + F[0][0]//dc_scaler */
169bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        pSrcDst[0] += tempPred;
170bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
171bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        /* Saturate */
172bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        pSrcDst[0] = armClip (-2048, 2047, pSrcDst[0]);
173bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
174bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        /* Cal and store F[0][0] into the col buffer */
175bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        *pPredBufCol = pSrcDst[0] * dcScaler;
176bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    }
177bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
178bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
179bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    if (ACPredFlag == 1)
180bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    {
181bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        if (predDir == OMX_VC_VERTICAL)
182bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
183bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            for (i = 1; i < 8; i++)
184bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            {
185bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                tempPred = armIntDivAwayFromZero \
186bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                              (pPredBufRow[i] * predQP, curQP);
187bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                if (flag)
188bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                {
189bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* Updating QF to the row buff */
190bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pPredBufRow[i] = pSrcDst[i];
191bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /*PQFX[v][0] = QFX[v][0] - (QFA[v][0] * QPA) // QPX */
192bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pSrcDst[i] -= tempPred;
193bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* Sum of absolute values of AC prediction error, this can
194bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    be used as a reference to choose whether to use
195bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    AC prediction */
196bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    *pSumErr += armAbs(pSrcDst[i]);
197bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* pPreACPredict[1~7] store the error signal
198bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    after AC prediction */
199bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pPreACPredict[i] = pSrcDst[i];
200bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                }
201bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                else
202bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                {
203bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /*QFX[v][0] = PQFX[v][0] + (QFA[v][0] * QPA) // QPX */
204bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pSrcDst[i] += tempPred;
205bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
206bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* Saturate */
207bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pSrcDst[i] = armClip (-2048, 2047, pSrcDst[i]);
208bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
209bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* Updating QF to the row buff */
210bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pPredBufRow[i] = pSrcDst[i];
211bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                }
212bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            }
213bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
214bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        else
215bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        {
216bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            for (i = 8; i < 64; i += 8)
217bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            {
218bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                tempPred = armIntDivAwayFromZero \
219bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                              (pPredBufCol[i>>3] * predQP, curQP);
220bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                if (flag)
221bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                {
222bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* Updating QF to col buff */
223bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pPredBufCol[i>>3] = pSrcDst[i];
224bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /*PQFX[0][u] = QFX[0][u] - (QFA[0][u] * QPA) // QPX */
225bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pSrcDst[i] -= tempPred;
226bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* Sum of absolute values of AC prediction error, this can
227bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    be used as a reference to choose whether to use AC
228bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    prediction */
229bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    *pSumErr += armAbs(pSrcDst[i]);
230bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* pPreACPredict[1~7] store the error signal
231bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    after AC prediction */
232bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pPreACPredict[i>>3] = pSrcDst[i];
233bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                }
234bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                else
235bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                {
236bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /*QFX[0][u] = PQFX[0][u] + (QFA[0][u] * QPA) // QPX */
237bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pSrcDst[i] += tempPred;
238bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
239bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* Saturate */
240bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pSrcDst[i] = armClip (-2048, 2047, pSrcDst[i]);
241bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
242bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    /* Updating QF to col buff */
243bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                    pPredBufCol[i>>3] = pSrcDst[i];
244bebc99d6fa433c04139294a5057f8439d772dbd9James Dong                }
245bebc99d6fa433c04139294a5057f8439d772dbd9James Dong            }
246bebc99d6fa433c04139294a5057f8439d772dbd9James Dong        }
247bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    }
248bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
249bebc99d6fa433c04139294a5057f8439d772dbd9James Dong    return OMX_Sts_NoErr;
250bebc99d6fa433c04139294a5057f8439d772dbd9James Dong}
251bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
252bebc99d6fa433c04139294a5057f8439d772dbd9James Dong/*End of File*/
253bebc99d6fa433c04139294a5057f8439d772dbd9James Dong
254