strPredQuantDec.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. //*@@@+++@@@@******************************************************************
  2. //
  3. // Copyright © Microsoft Corp.
  4. // All rights reserved.
  5. //
  6. // Redistribution and use in source and binary forms, with or without
  7. // modification, are permitted provided that the following conditions are met:
  8. //
  9. // • Redistributions of source code must retain the above copyright notice,
  10. // this list of conditions and the following disclaimer.
  11. // • Redistributions in binary form must reproduce the above copyright notice,
  12. // this list of conditions and the following disclaimer in the documentation
  13. // and/or other materials provided with the distribution.
  14. //
  15. // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  16. // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  17. // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  18. // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
  19. // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  20. // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  21. // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  22. // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  23. // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  24. // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  25. // POSSIBILITY OF SUCH DAMAGE.
  26. //
  27. //*@@@---@@@@******************************************************************
  28. #include "strcodec.h"
  29. #define DEQUANT(iRaw, iQP) ((iRaw) * (iQP))
  30. Void dequantizeBlock4x4(PixelI * pRec, Int * pOrg, const Int * pIndex, Int iQPLP)
  31. {
  32. Int i;
  33. for(i = 1; i < 16; i ++)
  34. pRec[pIndex[i]] = DEQUANT(pOrg[i], iQPLP);
  35. }
  36. Void dequantizeBlock2x2(PixelI * pRec, Int * pOrg, Int iQPLP)
  37. {
  38. pRec[32] = DEQUANT(pOrg[1], iQPLP);
  39. pRec[16] = DEQUANT(pOrg[2], iQPLP);
  40. pRec[48] = DEQUANT(pOrg[3], iQPLP);
  41. }
  42. Void dequantizeBlock4x2(PixelI * pRec, Int * pOrg, Int iQPLP)
  43. {
  44. pRec[ 64] = DEQUANT(pOrg[1], iQPLP);
  45. pRec[ 16] = DEQUANT(pOrg[2], iQPLP);
  46. pRec[ 80] = DEQUANT(pOrg[3], iQPLP);
  47. pRec[ 32] = DEQUANT(pOrg[4], iQPLP);
  48. pRec[ 96] = DEQUANT(pOrg[5], iQPLP);
  49. pRec[ 48] = DEQUANT(pOrg[6], iQPLP);
  50. pRec[112] = DEQUANT(pOrg[7], iQPLP);
  51. }
  52. Int dequantizeMacroblock(CWMImageStrCodec * pSC)
  53. {
  54. const COLORFORMAT cf = pSC->m_param.cfColorFormat;
  55. CWMIMBInfo *pMBInfo = &pSC->MBInfo;
  56. CWMITile * pTile = pSC->pTile + pSC->cTileColumn;
  57. const size_t iChannels = pSC->m_param.cNumChannels;
  58. size_t i;
  59. for(i = 0; i < iChannels; i ++){
  60. //dequantize DC
  61. pSC->p1MBbuffer[i][0] = DEQUANT(pMBInfo->iBlockDC[i][0], pTile->pQuantizerDC[i]->iQP);
  62. // dequantize LP
  63. if(pSC->WMISCP.sbSubband != SB_DC_ONLY)
  64. if(i == 0 || (cf != YUV_422 && cf != YUV_420))
  65. dequantizeBlock4x4(pSC->p1MBbuffer[i] , pMBInfo->iBlockDC[i], dctIndex[2], pTile->pQuantizerLP[i][pMBInfo->iQIndexLP].iQP);
  66. else if(cf == YUV_422)
  67. dequantizeBlock4x2(pSC->p1MBbuffer[i], pMBInfo->iBlockDC[i], pTile->pQuantizerLP[i][pMBInfo->iQIndexLP].iQP);
  68. else // 420
  69. dequantizeBlock2x2(pSC->p1MBbuffer[i], pMBInfo->iBlockDC[i], pTile->pQuantizerLP[i][pMBInfo->iQIndexLP].iQP);
  70. }
  71. return ICERR_OK;
  72. }
  73. /* frequency domain inverse DCAC prediction */
  74. Void predDCACDec(CWMImageStrCodec * pSC)
  75. {
  76. const COLORFORMAT cf = pSC->m_param.cfColorFormat;
  77. const Int iChannels = (cf == YUV_420 || cf == YUV_422) ? 1 : (Int) pSC->m_param.cNumChannels;
  78. CWMIMBInfo *pMBInfo = &(pSC->MBInfo);
  79. size_t mbX = pSC->cColumn;// mbY = pSC->cRow;
  80. Int iDCACPredMode = getDCACPredMode(pSC, mbX);
  81. Int iDCPredMode = (iDCACPredMode & 0x3);
  82. Int iADPredMode = (iDCACPredMode & 0xC);
  83. PixelI * pOrg, * pRef;
  84. Int ii;
  85. for(ii = 0; ii < iChannels; ii ++){
  86. pOrg = pMBInfo->iBlockDC[ii];//[dcBlkIdx + (i >> 4)]; // current DC block
  87. /* DC prediction */
  88. if(iDCPredMode == 1){ // predict DC from top
  89. pOrg[0] += pSC->PredInfoPrevRow[ii][mbX].iDC;
  90. }
  91. else if(iDCPredMode == 0){ // predict DC from left
  92. pOrg[0] += (pSC->PredInfo[ii] + mbX - 1)->iDC;
  93. }
  94. else if(iDCPredMode == 2){// predict DC from top&left
  95. pOrg[0] += ((pSC->PredInfo[ii] + mbX - 1)->iDC + (pSC->PredInfoPrevRow[ii] + mbX)->iDC) >> 1;
  96. }
  97. /* AD prediction */
  98. if(iADPredMode == 4){// predict AD from top
  99. pRef = (pSC->PredInfoPrevRow[ii] + mbX)->piAD;
  100. pOrg[4] += pRef[3], pOrg[8] += pRef[4], pOrg[12] += pRef[5];
  101. }
  102. else if(iADPredMode == 0){// predict AD from left
  103. pRef = (pSC->PredInfo[ii] + mbX - 1)->piAD;
  104. pOrg[1] += pRef[0], pOrg[2] += pRef[1], pOrg[3] += pRef[2];
  105. }
  106. }
  107. if(cf == YUV_420){
  108. for(ii = 1; ii < 3; ii ++){
  109. pOrg = pMBInfo->iBlockDC[ii];//dcBlkIdx + ii]; // current DC block
  110. /* DC prediction */
  111. if(iDCPredMode == 1){ // predict DC from top
  112. pOrg[0] += (pSC->PredInfoPrevRow[ii] + mbX)->iDC;
  113. }
  114. else if(iDCPredMode == 0){ // predict DC from left
  115. pOrg[0] += (pSC->PredInfo[ii] + mbX - 1)->iDC;
  116. }
  117. else if(iDCPredMode == 2){ // predict DC from top&left
  118. pOrg[0] += (((pSC->PredInfo[ii] + mbX - 1)->iDC + (pSC->PredInfoPrevRow[ii] + mbX)->iDC + 1) >> 1);
  119. }
  120. /* AD prediciton */
  121. if(iADPredMode == 4){// predict AD from top
  122. pOrg[2] += (pSC->PredInfoPrevRow[ii] + mbX)->piAD[1];
  123. }
  124. else if(iADPredMode == 0){// predict AD from left
  125. pOrg[1] += (pSC->PredInfo[ii] + mbX - 1)->piAD[0];
  126. }
  127. }
  128. }
  129. else if(cf == YUV_422){
  130. for(ii = 1; ii < 3; ii ++){
  131. pOrg = pMBInfo->iBlockDC[ii];//[dcBlkIdx + ii]; // current DC block
  132. /* DC prediciton */
  133. if(iDCPredMode == 1){ // predict DC from top
  134. pOrg[0] += (pSC->PredInfoPrevRow[ii] + mbX)->iDC;
  135. }
  136. else if(iDCPredMode == 0){ // predict DC from left
  137. pOrg[0] += (pSC->PredInfo[ii] + mbX - 1)->iDC;
  138. }
  139. else if(iDCPredMode == 2){ // predict DC from top&left
  140. pOrg[0] += (((pSC->PredInfo[ii] + mbX - 1)->iDC + (pSC->PredInfoPrevRow[ii] + mbX)->iDC + 1) >> 1);
  141. }
  142. /* AD prediction */
  143. if(iADPredMode == 4){// predict AD from top
  144. pOrg[4] += (pSC->PredInfoPrevRow[ii] + mbX)->piAD[4]; // AC of HT !!!
  145. pOrg[2] += (pSC->PredInfoPrevRow[ii] + mbX)->piAD[3];
  146. pOrg[6] += pOrg[2];
  147. }
  148. else if(iADPredMode == 0){// predict AD from left
  149. pOrg[4] += (pSC->PredInfo[ii] + mbX - 1)->piAD[4]; // AC of HT !!!
  150. pOrg[1] += (pSC->PredInfo[ii] + mbX - 1)->piAD[0];
  151. pOrg[5] += (pSC->PredInfo[ii] + mbX - 1)->piAD[2];
  152. }
  153. else if(iDCPredMode == 1){
  154. pOrg[6] += pOrg[2];
  155. }
  156. }
  157. }
  158. pMBInfo->iOrientation = 2 - getACPredMode(pMBInfo, cf);
  159. }
  160. /*************************************************************************
  161. Frequency domain inverse AC prediction
  162. *************************************************************************/
  163. Void predACDec(CWMImageStrCodec * pSC)
  164. {
  165. const COLORFORMAT cf = pSC->m_param.cfColorFormat;
  166. const Int iChannels = (cf == YUV_420 || cf == YUV_422) ? 1 : (Int) pSC->m_param.cNumChannels;
  167. // size_t mbX = pSC->cColumn, mbY = pSC->cRow;
  168. CWMIMBInfo *pMBInfo = &pSC->MBInfo;
  169. Int iACPredMode = 2 - pMBInfo->iOrientation;
  170. PixelI * pOrg, * pRef;
  171. Int i, j;
  172. /* AC prediction */
  173. for(i = 0; i < iChannels; i++){
  174. // prediction only happens inside MB
  175. PixelI* pSrc = pSC->p1MBbuffer[i];//0 == i ? pSC->pY1 : (1 == i ? pSC->pU1 : pSC->pV1);
  176. switch (iACPredMode)
  177. {
  178. case 1:
  179. {
  180. // predict from top
  181. static U8 blkIdx[] = {1, 2, 3, 5, 6, 7, 9, 10, 11, 13, 14, 15};
  182. for (j = 0; j < sizeof(blkIdx) / sizeof(*blkIdx); ++j)
  183. {
  184. pOrg = pSrc + 16 * blkIdx[j];
  185. pRef = pOrg - 16;
  186. pOrg[ 2] += pRef[ 2];
  187. pOrg[10] += pRef[10];
  188. pOrg[ 9] += pRef[ 9];
  189. }
  190. break;
  191. }
  192. case 0:
  193. // predict from left
  194. for (j = 64; j < 256; j += 16)
  195. {
  196. pOrg = pSrc + j;
  197. pRef = pOrg - 64;
  198. pOrg[1] += pRef[1];
  199. pOrg[5] += pRef[5];
  200. pOrg[6] += pRef[6];
  201. }
  202. break;
  203. default:
  204. // no prediction
  205. break;
  206. }
  207. }
  208. if(cf == YUV_420){
  209. for(i = 16; i <= 20; i += 4){
  210. PixelI* pSrc = pSC->p1MBbuffer[(i >> 2) - 3];//16 == i ? pSC->pU1 : pSC->pV1;
  211. switch (iACPredMode)
  212. {
  213. case 1:
  214. {
  215. // predict from top
  216. for (j = 1; j <= 3; j += 2)
  217. {
  218. pOrg = pSrc + 16 * j;
  219. pRef = pOrg - 16;
  220. pOrg[ 2] += pRef[ 2];
  221. pOrg[10] += pRef[10];
  222. pOrg[ 9] += pRef[ 9];
  223. }
  224. break;
  225. }
  226. case 0:
  227. // predict from left
  228. for (j = 2; j <= 3; ++j)
  229. {
  230. pOrg = pSrc + 16 * j;
  231. pRef = pOrg - 32;
  232. pOrg[1] += pRef[1];
  233. pOrg[5] += pRef[5];
  234. pOrg[6] += pRef[6];
  235. }
  236. break;
  237. default:
  238. // no prediction
  239. break;
  240. }
  241. }
  242. }
  243. else if(cf == YUV_422){
  244. for(i = 16; i < 32; i += 8){
  245. PixelI* pSrc = pSC->p1MBbuffer[(i >> 3) - 1];//16 == i ? pSC->pU1 : pSC->pV1;
  246. switch (iACPredMode)
  247. {
  248. case 1:
  249. {
  250. // predict from top
  251. for (j = 2; j < 8; j ++)
  252. {
  253. pOrg = pSrc + blkOffsetUV_422[j];
  254. pRef = pOrg - 16;
  255. pOrg[10] += pRef[10];
  256. pOrg[ 2] += pRef[ 2];
  257. pOrg[ 9] += pRef[ 9];
  258. }
  259. break;
  260. }
  261. case 0:
  262. // predict from left
  263. for (j = 1; j < 8; j += 2)
  264. {
  265. pOrg = pSrc + blkOffsetUV_422[j];
  266. pRef = pOrg - 64;
  267. pOrg[1] += pRef[1];
  268. pOrg[5] += pRef[5];
  269. pOrg[6] += pRef[6];
  270. }
  271. break;
  272. default:
  273. // no prediction
  274. break;
  275. }
  276. }
  277. }
  278. }
  279. /*************************************************************************
  280. CBP
  281. *************************************************************************/
  282. static int NumOnes(int i)
  283. {
  284. int retval = 0;
  285. static const int g_Count[] = { 0,1,1,2, 1,2,2,3, 1,2,2,3, 2,3,3,4 };
  286. i = i & 0xffff;
  287. while (i) {
  288. retval += g_Count[i & 0xf];
  289. i >>= 4;
  290. }
  291. return retval;
  292. }
  293. #define SATURATE32(x) if((unsigned int)(x + 16) >= 32) { if (x < 0) x = -16; else x = 15; }
  294. /* CBP prediction for 16 x 16 MB */
  295. /* block index */
  296. /* 0 1 4 5 */
  297. /* 2 3 6 7 */
  298. /* 8 9 12 13 */
  299. /* 10 11 14 15 */
  300. static Int predCBPCDec(CWMImageStrCodec * pSC, Int iCBP, size_t mbX, size_t mbY, size_t c, CCBPModel *pModel)
  301. {
  302. Int iNOrig;
  303. const int iNDiff = AVG_NDIFF;
  304. size_t c1 = c ? 1 : 0;
  305. UNREFERENCED_PARAMETER( mbY );
  306. if (pModel->m_iState[c1] == 0) {
  307. if(pSC->m_bCtxLeft) {
  308. if (pSC->m_bCtxTop) {
  309. iCBP ^= 1;
  310. }
  311. else {
  312. Int iTopCBP = (pSC->PredInfoPrevRow[c] + mbX)->iCBP;
  313. iCBP ^= (iTopCBP >> 10) & 1; // left: top(10) => 0
  314. }
  315. }
  316. else {
  317. Int iLeftCBP = (pSC->PredInfo[c] + mbX - 1)->iCBP;
  318. iCBP ^= ((iLeftCBP >> 5) & 1); // left(5) => 0
  319. }
  320. iCBP ^= (0x02 & (iCBP << 1)); // 0 => 1
  321. iCBP ^= (0x10 & (iCBP << 3)); // 1 => 4
  322. iCBP ^= (0x20 & (iCBP << 1)); // 4 => 5
  323. iCBP ^= ((iCBP & 0x33) << 2);
  324. iCBP ^= ((iCBP & 0xcc) << 6);
  325. iCBP ^= ((iCBP & 0x3300) << 2);
  326. }
  327. else if (pModel->m_iState[c1] == 2) {
  328. iCBP ^= 0xffff;
  329. }
  330. iNOrig = NumOnes(iCBP);
  331. pModel->m_iCount0[c1] += iNOrig - iNDiff;
  332. SATURATE32(pModel->m_iCount0[c1]);
  333. pModel->m_iCount1[c1] += 16 - iNOrig - iNDiff;
  334. SATURATE32(pModel->m_iCount1[c1]);
  335. if (pModel->m_iCount0[c1] < 0) {
  336. if (pModel->m_iCount0[c1] < pModel->m_iCount1[c1]) {
  337. pModel->m_iState[c1] = 1;
  338. }
  339. else {
  340. pModel->m_iState[c1] = 2;
  341. }
  342. }
  343. else if (pModel->m_iCount1[c1] < 0) {
  344. pModel->m_iState[c1] = 2;
  345. }
  346. else {
  347. pModel->m_iState[c1] = 0;
  348. }
  349. return iCBP;
  350. }
  351. static Int predCBPC420Dec(CWMImageStrCodec * pSC, Int iCBP, size_t mbX, size_t mbY, size_t c, CCBPModel *pModel)
  352. {
  353. Int iNOrig;
  354. const int iNDiff = AVG_NDIFF;
  355. UNREFERENCED_PARAMETER( mbY );
  356. if (pModel->m_iState[1] == 0) {
  357. if(pSC->m_bCtxLeft) {
  358. if (pSC->m_bCtxTop) {
  359. iCBP ^= 1;
  360. }
  361. else {
  362. Int iTopCBP = (pSC->PredInfoPrevRow[c] + mbX)->iCBP;
  363. iCBP ^= (iTopCBP >> 2) & 1; // left: top(2) => 0
  364. }
  365. }
  366. else {
  367. Int iLeftCBP = (pSC->PredInfo[c] + mbX - 1)->iCBP;
  368. iCBP ^= ((iLeftCBP >> 1) & 1); // left(1) => 0
  369. }
  370. iCBP ^= (0x02 & (iCBP << 1)); // 0 => 1
  371. iCBP ^= ((iCBP & 0x3) << 2); // [0 1] -> [2 3]
  372. }
  373. else if (pModel->m_iState[1] == 2) {
  374. iCBP ^= 0xf;
  375. }
  376. iNOrig = NumOnes(iCBP) * 4;
  377. pModel->m_iCount0[1] += iNOrig - iNDiff;
  378. SATURATE32(pModel->m_iCount0[1]);
  379. pModel->m_iCount1[1] += 16 - iNOrig - iNDiff;
  380. SATURATE32(pModel->m_iCount1[1]);
  381. if (pModel->m_iCount0[1] < 0) {
  382. if (pModel->m_iCount0[1] < pModel->m_iCount1[1]) {
  383. pModel->m_iState[1] = 1;
  384. }
  385. else {
  386. pModel->m_iState[1] = 2;
  387. }
  388. }
  389. else if (pModel->m_iCount1[1] < 0) {
  390. pModel->m_iState[1] = 2;
  391. }
  392. else {
  393. pModel->m_iState[1] = 0;
  394. }
  395. return iCBP;
  396. }
  397. static Int predCBPC422Dec(CWMImageStrCodec * pSC, Int iCBP, size_t mbX, size_t mbY, size_t c, CCBPModel *pModel)
  398. {
  399. Int iNOrig;
  400. const int iNDiff = AVG_NDIFF;
  401. UNREFERENCED_PARAMETER( mbY );
  402. if (pModel->m_iState[1] == 0) {
  403. if(pSC->m_bCtxLeft) {
  404. if (pSC->m_bCtxTop) {
  405. iCBP ^= 1;
  406. }
  407. else {
  408. Int iTopCBP = (pSC->PredInfoPrevRow[c] + mbX)->iCBP;
  409. iCBP ^= (iTopCBP >> 6) & 1; // left: top(6) => 0
  410. }
  411. }
  412. else {
  413. Int iLeftCBP = (pSC->PredInfo[c] + mbX - 1)->iCBP;
  414. iCBP ^= ((iLeftCBP >> 1) & 1); // left(1) => 0
  415. }
  416. iCBP ^= (iCBP & 0x1) << 1; // [0]->[1]
  417. iCBP ^= (iCBP & 0x3) << 2; // [0 1]->[2 3]
  418. iCBP ^= (iCBP & 0xc) << 2; // [2 3]->[4 5]
  419. iCBP ^= (iCBP & 0x30) << 2; // [4 5]->[6 7]
  420. }
  421. else if (pModel->m_iState[1] == 2) {
  422. iCBP ^= 0xff;
  423. }
  424. iNOrig = NumOnes(iCBP) * 2;
  425. pModel->m_iCount0[1] += iNOrig - iNDiff;
  426. SATURATE32(pModel->m_iCount0[1]);
  427. pModel->m_iCount1[1] += 16 - iNOrig - iNDiff;
  428. SATURATE32(pModel->m_iCount1[1]);
  429. if (pModel->m_iCount0[1] < 0) {
  430. if (pModel->m_iCount0[1] < pModel->m_iCount1[1]) {
  431. pModel->m_iState[1] = 1;
  432. }
  433. else {
  434. pModel->m_iState[1] = 2;
  435. }
  436. }
  437. else if (pModel->m_iCount1[1] < 0) {
  438. pModel->m_iState[1] = 2;
  439. }
  440. else {
  441. pModel->m_iState[1] = 0;
  442. }
  443. return iCBP;
  444. }
  445. /* Coded Block Pattern (CBP) prediction */
  446. Void predCBPDec(CWMImageStrCodec *pSC, CCodingContext *pContext)
  447. {
  448. const COLORFORMAT cf = pSC->m_param.cfColorFormat;
  449. const size_t iChannels = (cf == YUV_420 || cf == YUV_422) ? 1 : pSC->m_param.cNumChannels;
  450. size_t i, mbX = pSC->cColumn, mbY = pSC->cRow;
  451. CWMIMBInfo *pMBInfo = &(pSC->MBInfo);
  452. for (i = 0; i < iChannels; i++) {
  453. (pSC->PredInfo[i] + mbX)->iCBP = pMBInfo->iCBP[i] = predCBPCDec(pSC, pMBInfo->iDiffCBP[i], mbX, mbY, i, &pContext->m_aCBPModel); // Y Channel
  454. }
  455. if (cf == YUV_422){
  456. (pSC->PredInfo[1] + mbX)->iCBP = pMBInfo->iCBP[1] = predCBPC422Dec(pSC, pMBInfo->iDiffCBP[1], mbX, mbY, 1, &pContext->m_aCBPModel);
  457. (pSC->PredInfo[2] + mbX)->iCBP = pMBInfo->iCBP[2] = predCBPC422Dec(pSC, pMBInfo->iDiffCBP[2], mbX, mbY, 2, &pContext->m_aCBPModel);
  458. }
  459. else if (cf == YUV_420) {
  460. (pSC->PredInfo[1] + mbX)->iCBP = pMBInfo->iCBP[1] = predCBPC420Dec(pSC, pMBInfo->iDiffCBP[1], mbX, mbY, 1, &pContext->m_aCBPModel);
  461. (pSC->PredInfo[2] + mbX)->iCBP = pMBInfo->iCBP[2] = predCBPC420Dec(pSC, pMBInfo->iDiffCBP[2], mbX, mbY, 2, &pContext->m_aCBPModel);
  462. }
  463. //}
  464. }