Changeset 294 in 3DVCSoftware for branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
- Timestamp:
- 19 Feb 2013, 20:33:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HTM-5.1-dev0/source/Lib/TLibDecoder/TDecSbac.cpp
r292 r294 87 87 , m_cALFUvlcSCModel ( 1, 1, NUM_ALF_UVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 88 88 , m_cALFSvlcSCModel ( 1, 1, NUM_ALF_SVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 89 #if AMP_CTX90 89 , m_cCUAMPSCModel ( 1, 1, NUM_CU_AMP_CTX , m_contextModels + m_numContextModels, m_numContextModels) 91 #else92 , m_cCUXPosiSCModel ( 1, 1, NUM_CU_X_POS_CTX , m_contextModels + m_numContextModels, m_numContextModels)93 , m_cCUYPosiSCModel ( 1, 1, NUM_CU_Y_POS_CTX , m_contextModels + m_numContextModels, m_numContextModels)94 #endif95 90 , m_cSaoFlagSCModel ( 1, 1, NUM_SAO_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 96 91 , m_cSaoUvlcSCModel ( 1, 1, NUM_SAO_UVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 97 92 , m_cSaoSvlcSCModel ( 1, 1, NUM_SAO_SVLC_CTX , m_contextModels + m_numContextModels, m_numContextModels) 98 #if SAO_UNIT_INTERLEAVING99 93 , m_cSaoMergeLeftSCModel ( 1, 1, NUM_SAO_MERGE_LEFT_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 100 94 , m_cSaoMergeUpSCModel ( 1, 1, NUM_SAO_MERGE_UP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 101 95 , m_cSaoTypeIdxSCModel ( 1, 1, NUM_SAO_TYPE_IDX_CTX , m_contextModels + m_numContextModels, m_numContextModels) 102 #endif103 96 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX 104 97 , m_cDmmFlagSCModel ( 1, 1, NUM_DMM_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) … … 171 164 m_cCUAlfCtrlFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_ALF_CTRL_FLAG ); 172 165 m_cCUPartSizeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PART_SIZE ); 173 #if AMP_CTX174 166 m_cCUAMPSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_AMP_POS ); 175 #else176 m_cCUXPosiSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_X_POS );177 m_cCUYPosiSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_CU_Y_POS );178 #endif179 167 m_cCUPredModeSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_PRED_MODE ); 180 168 m_cCUIntraPredSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_INTRA_PRED_MODE ); … … 199 187 m_cSaoUvlcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_UVLC ); 200 188 m_cSaoSvlcSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_SVLC ); 201 #if SAO_UNIT_INTERLEAVING202 189 m_cSaoMergeLeftSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_MERGE_LEFT_FLAG ); 203 190 m_cSaoMergeUpSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_MERGE_UP_FLAG ); 204 191 m_cSaoTypeIdxSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_SAO_TYPE_IDX ); 205 #endif206 192 207 193 m_cCUTransSubdivFlagSCModel.initBuffer ( sliceType, qp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); … … 265 251 m_cCUAlfCtrlFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_ALF_CTRL_FLAG ); 266 252 m_cCUPartSizeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PART_SIZE ); 267 #if AMP_CTX268 253 m_cCUAMPSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_AMP_POS ); 269 #else270 m_cCUXPosiSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_X_POS );271 m_cCUYPosiSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_CU_Y_POS );272 #endif273 254 m_cCUPredModeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_PRED_MODE ); 274 255 m_cCUIntraPredSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRA_PRED_MODE ); … … 293 274 m_cSaoUvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_UVLC ); 294 275 m_cSaoSvlcSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_SVLC ); 295 #if SAO_UNIT_INTERLEAVING296 276 m_cSaoMergeLeftSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_LEFT_FLAG ); 297 277 m_cSaoMergeUpSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_UP_FLAG ); 298 278 m_cSaoTypeIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX ); 299 #endif300 279 m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 301 280 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX … … 449 428 } 450 429 451 #if EIGHT_BITS_RICE_CODE452 430 ruiGoRiceParam = g_aauiGoRiceUpdate[ ruiGoRiceParam ][ min<UInt>( ruiSymbol, 23 ) ]; 453 #else454 ruiGoRiceParam = g_aauiGoRiceUpdate[ ruiGoRiceParam ][ min<UInt>( ruiSymbol, 15 ) ];455 #endif456 431 457 432 return; … … 470 445 { 471 446 UInt uiSymbol; 472 #if BURST_IPCM473 447 Int numSubseqIPCM = 0; 474 448 Bool readPCMSampleFlag = false; … … 490 464 } 491 465 } 492 #else 493 m_pcTDecBinIf->decodeBinTrm(uiSymbol); 494 #endif 495 496 #if BURST_IPCM 466 497 467 if (readPCMSampleFlag == true) 498 #else499 if (uiSymbol)500 #endif501 468 { 502 469 Bool bIpcmFlag = true; 503 470 504 #if !BURST_IPCM505 m_pcTDecBinIf->decodePCMAlignBits();506 #endif507 471 508 472 pcCU->setPartSizeSubParts ( SIZE_2Nx2N, uiAbsPartIdx, uiDepth ); … … 568 532 } 569 533 570 #if BURST_IPCM571 534 pcCU->setNumSucIPCM( pcCU->getNumSucIPCM() - 1); 572 535 if(pcCU->getNumSucIPCM() == 0) … … 574 537 m_pcTDecBinIf->resetBac(); 575 538 } 576 #else577 m_pcTDecBinIf->resetBac();578 #endif579 539 } 580 540 } … … 664 624 { 665 625 UInt uiNumCand = MRG_MAX_NUM_CANDS; 666 #if !MRG_IDX_CTX_RED667 UInt auiCtx[4] = { 0, 1, 2, 3 };668 #endif669 626 UInt uiUnaryIdx = 0; 670 627 uiNumCand = pcCU->getSlice()->getMaxNumMergeCand(); … … 678 635 { 679 636 UInt uiSymbol = 0; 680 #if MRG_IDX_CTX_RED681 637 if ( uiUnaryIdx==0 ) 682 638 { … … 687 643 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 688 644 } 689 #else690 m_pcTDecBinIf->decodeBin( uiSymbol, m_cCUMergeIdxExtSCModel.get( 0, 0, auiCtx[uiUnaryIdx] ) );691 #endif692 645 if( uiSymbol == 0 ) 693 646 { … … 879 832 if (eMode == SIZE_2NxN) 880 833 { 881 #if AMP_CTX882 834 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 )); 883 #else884 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 0 ));885 #endif886 835 if (uiSymbol == 0) 887 836 { 888 #if AMP_CTX889 837 m_pcTDecBinIf->decodeBinEP(uiSymbol); 890 #else891 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUYPosiSCModel.get( 0, 0, 1 ));892 #endif893 838 eMode = (uiSymbol == 0? SIZE_2NxnU : SIZE_2NxnD); 894 839 } … … 896 841 else if (eMode == SIZE_Nx2N) 897 842 { 898 #if AMP_CTX899 843 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUAMPSCModel.get( 0, 0, 0 )); 900 #else901 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 0 ));902 #endif903 844 if (uiSymbol == 0) 904 845 { 905 #if AMP_CTX906 846 m_pcTDecBinIf->decodeBinEP(uiSymbol); 907 #else908 m_pcTDecBinIf->decodeBin(uiSymbol, m_cCUXPosiSCModel.get( 0, 0, 1 ));909 #endif910 847 eMode = (uiSymbol == 0? SIZE_nLx2N : SIZE_nRx2N); 911 848 } … … 989 926 { 990 927 #endif 991 #if !LOGI_INTRA_NAME_3MPM992 Int iIntraIdx = pcCU->getIntraSizeIdx(uiAbsPartIdx);993 #endif994 928 995 929 #if LGE_EDGE_INTRA_A0070 … … 1003 937 #endif 1004 938 1005 #if LOGI_INTRA_NAME_3MPM1006 939 Int uiPreds[3] = {-1, -1, -1}; 1007 #else1008 Int uiPreds[2] = {-1, -1};1009 #endif1010 940 Int uiPredNum = pcCU->getIntraDirLumaPredictor(uiAbsPartIdx, uiPreds); 1011 941 #if LGE_EDGE_INTRA_A0070 … … 1018 948 { 1019 949 m_pcTDecBinIf->decodeBinEP( uiSymbol ); 1020 #if LOGI_INTRA_NAME_3MPM1021 950 if (uiSymbol) 1022 951 { … … 1024 953 uiSymbol++; 1025 954 } 1026 #endif1027 955 intraPredMode = uiPreds[uiSymbol]; 1028 956 } … … 1031 959 intraPredMode = 0; 1032 960 1033 #if LOGI_INTRA_NAME_3MPM1034 961 1035 962 m_pcTDecBinIf->decodeBinsEP( uiSymbol, 5 ); … … 1060 987 std::swap(uiPreds[1], uiPreds[2]); 1061 988 } 1062 #else1063 m_pcTDecBinIf->decodeBinsEP( uiSymbol, g_aucIntraModeBitsAng[iIntraIdx] - 1 );1064 intraPredMode = uiSymbol;1065 1066 if ( intraPredMode == 31 )1067 {1068 m_pcTDecBinIf->decodeBinEP( uiSymbol );1069 intraPredMode += uiSymbol;1070 }1071 #endif1072 989 #if LGE_EDGE_INTRA_A0070 1073 990 if ( intraPredMode != EDGE_INTRA_IDX) … … 1158 1075 { 1159 1076 UInt uiIPredMode; 1160 #if CHROMA_MODE_CODING1161 1077 m_pcTDecBinIf->decodeBinsEP( uiIPredMode, 2 ); 1162 #else1163 xReadUnaryMaxSymbol( uiIPredMode, m_cCUChromaPredSCModel.get( 0, 0 ) + 1, 0, 3 );1164 #endif1165 1078 UInt uiAllowedChromaDir[ NUM_CHROMA_MODE ]; 1166 1079 pcCU->getAllowedChromaDir( uiAbsPartIdx, uiAllowedChromaDir ); … … 1230 1143 ContextModel *pCtx = m_cCUMvdSCModel.get( 0 ); 1231 1144 1232 #if H0111_MVD_L1_ZERO1233 1145 if(pcCU->getSlice()->getMvdL1ZeroFlag() && eRefList == REF_PIC_LIST_1 && pcCU->getInterDir(uiAbsPartIdx)==3) 1234 1146 { … … 1238 1150 else 1239 1151 { 1240 #endif1241 1152 1242 1153 m_pcTDecBinIf->decodeBin( uiHorAbs, *pCtx ); … … 1281 1192 } 1282 1193 1283 #if H0111_MVD_L1_ZERO 1284 } 1285 #endif 1194 } 1286 1195 1287 1196 const TComMv cMv( uiHorSign ? -Int( uiHorAbs ): uiHorAbs, uiVerSign ? -Int( uiVerAbs ) : uiVerAbs ); … … 1323 1232 Void TDecSbac::parseDeltaQP( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) 1324 1233 { 1325 #if H0736_AVC_STYLE_QP_RANGE1326 1234 Int qp; 1327 #endif1328 1235 UInt uiDQp; 1329 1236 Int iDQp; … … 1333 1240 if ( uiDQp == 0 ) 1334 1241 { 1335 #if H0736_AVC_STYLE_QP_RANGE1336 1242 qp = pcCU->getRefQP(uiAbsPartIdx); 1337 #else1338 uiDQp = pcCU->getRefQP(uiAbsPartIdx);1339 #endif1340 1243 } 1341 1244 else 1342 1245 { 1343 1246 UInt uiSign; 1344 #if H0736_AVC_STYLE_QP_RANGE1345 1247 Int qpBdOffsetY = pcCU->getSlice()->getSPS()->getQpBDOffsetY(); 1346 #else1347 UInt uiQpBdOffsetY = 6*(g_uiBitIncrement + g_uiBitDepth - 8);1348 #endif1349 1248 m_pcTDecBinIf->decodeBinEP(uiSign); 1350 1249 1351 #if H0736_AVC_STYLE_QP_RANGE1352 1250 UInt uiMaxAbsDQpMinus1 = 24 + (qpBdOffsetY/2) + (uiSign); 1353 #else1354 UInt uiMaxAbsDQpMinus1 = 24 + (uiQpBdOffsetY/2) + (uiSign);1355 #endif1356 1251 UInt uiAbsDQpMinus1; 1357 1252 xReadUnaryMaxSymbol (uiAbsDQpMinus1, &m_cCUDeltaQpSCModel.get( 0, 0, 1 ), 1, uiMaxAbsDQpMinus1); … … 1364 1259 } 1365 1260 1366 #if H0736_AVC_STYLE_QP_RANGE1367 1261 qp = (((Int) pcCU->getRefQP( uiAbsPartIdx ) + iDQp + 52 + 2*qpBdOffsetY )%(52+qpBdOffsetY)) - qpBdOffsetY; 1368 #else1369 #if LOSSLESS_CODING1370 uiDQp = (pcCU->getRefQP(uiAbsPartIdx) + iDQp + 52) % 52;1371 #else1372 uiDQp = pcCU->getRefQP(uiAbsPartIdx) + iDQp;1373 #endif1374 #endif1375 1262 } 1376 1263 1377 1264 UInt uiAbsQpCUPartIdx = (uiAbsPartIdx>>(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)))<<(8-(pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()<<1)) ; 1378 1265 UInt uiQpCUDepth = min(uiDepth,pcCU->getSlice()->getPPS()->getMaxCuDQPDepth()) ; 1379 #if H0736_AVC_STYLE_QP_RANGE1380 1266 pcCU->setQPSubParts( qp, uiAbsQpCUPartIdx, uiQpCUDepth ); 1381 #else1382 pcCU->setQPSubParts( uiDQp, uiAbsQpCUPartIdx, uiQpCUDepth );1383 #endif1384 1267 } 1385 1268 … … 1422 1305 1423 1306 // posX 1424 #if LAST_CTX_REDUCTION1425 1307 Int widthCtx = eTType ? 4 : width; 1426 1308 const UInt *puiCtxIdxX = g_uiLastCtx + ( g_aucConvertToBit[ widthCtx ] * ( g_aucConvertToBit[ widthCtx ] + 3 ) ); 1427 #else1428 const UInt *puiCtxIdxX = g_uiLastCtx + ( g_aucConvertToBit[ width ] * ( g_aucConvertToBit[ width ] + 3 ) );1429 #endif1430 1309 for( uiPosLastX = 0; uiPosLastX < g_uiGroupIdx[ width - 1 ]; uiPosLastX++ ) 1431 1310 { 1432 #if LAST_CTX_REDUCTION1433 1311 if ( eTType ) 1434 1312 { … … 1437 1315 else 1438 1316 { 1439 #endif1440 1317 m_pcTDecBinIf->decodeBin( uiLast, *( pCtxX + puiCtxIdxX[ uiPosLastX ] ) ); 1441 #if LAST_CTX_REDUCTION 1442 } 1443 #endif 1318 } 1444 1319 if( !uiLast ) 1445 1320 { … … 1449 1324 1450 1325 // posY 1451 #if LAST_CTX_REDUCTION1452 1326 Int heightCtx = eTType? 4 : height; 1453 1327 const UInt *puiCtxIdxY = g_uiLastCtx + ( g_aucConvertToBit[ heightCtx ] * ( g_aucConvertToBit[ heightCtx ] + 3 ) ); 1454 #else1455 const UInt *puiCtxIdxY = g_uiLastCtx + ( g_aucConvertToBit[ height ] * ( g_aucConvertToBit[ height ] + 3 ) );1456 #endif1457 1328 for( uiPosLastY = 0; uiPosLastY < g_uiGroupIdx[ height - 1 ]; uiPosLastY++ ) 1458 1329 { 1459 #if LAST_CTX_REDUCTION1460 1330 if (eTType) 1461 1331 { … … 1464 1334 else 1465 1335 { 1466 #endif1467 1336 m_pcTDecBinIf->decodeBin( uiLast, *( pCtxY + puiCtxIdxY[ uiPosLastY ] ) ); 1468 #if LAST_CTX_REDUCTION 1469 } 1470 #endif 1337 } 1471 1338 if( !uiLast ) 1472 1339 { … … 1588 1455 UInt uiGoRiceParam = 0; 1589 1456 1590 #if MULTIBITS_DATA_HIDING1591 1457 UInt const tsig = pcCU->getSlice()->getPPS()->getTSIG(); 1592 1458 #if LOSSLESS_CODING … … 1604 1470 #endif 1605 1471 UInt absSum = 0; 1606 #endif // MULTIBITS_DATA_HIDING1607 1472 1608 1473 UInt uiSigCoeffGroupFlag[ MLS_GRP_NUM ]; … … 1613 1478 { 1614 1479 scanCG = g_auiSigLastScan[ uiScanIdx ][ uiLog2BlockSize > 3 ? uiLog2BlockSize-2-1 : 0 ]; 1615 #if MULTILEVEL_SIGMAP_EXT1616 1480 if( uiLog2BlockSize == 3 ) 1617 1481 { … … 1622 1486 scanCG = g_sigLastScanCG32x32; 1623 1487 } 1624 #endif1625 1488 } 1626 1489 else … … 1635 1498 Int numNonZero = 0; 1636 1499 1637 #if MULTIBITS_DATA_HIDING1638 1500 Int lastNZPosInCG = -1, firstNZPosInCG = SCAN_SET_SIZE; 1639 #endif1640 1501 1641 1502 Int pos[SCAN_SET_SIZE]; 1642 1503 if( iScanPosSig == (Int) uiScanPosLast ) 1643 1504 { 1644 #if MULTIBITS_DATA_HIDING1645 1505 lastNZPosInCG = iScanPosSig; 1646 1506 firstNZPosInCG = iScanPosSig; 1647 #endif1648 1507 iScanPosSig--; 1649 1508 pos[ numNonZero ] = uiBlkPosLast; … … 1651 1510 } 1652 1511 1653 #if !MULTILEVEL_SIGMAP_EXT1654 if( blockType > 3 )1655 {1656 #endif1657 1512 // decode significant_coeffgroup_flag 1658 1513 Int iCGBlkPos = scanCG[ iSubSet ]; 1659 1514 Int iCGPosY = iCGBlkPos / uiNumBlkSide; 1660 1515 Int iCGPosX = iCGBlkPos - (iCGPosY * uiNumBlkSide); 1661 #if MULTILEVEL_SIGMAP_EXT1662 1516 if( uiWidth == 8 && uiHeight == 8 && (uiScanIdx == SCAN_HOR || uiScanIdx == SCAN_VER) ) 1663 1517 { … … 1665 1519 iCGPosX = (uiScanIdx == SCAN_VER ? iCGBlkPos : 0); 1666 1520 } 1667 #endif1668 #if !REMOVE_INFER_SIGGRP1669 Bool bInferredCGFlag = false;1670 #endif1671 #if REMOVE_INFER_SIGGRP1672 1521 if( iSubSet == iLastScanSet || iSubSet == 0) 1673 #else1674 if( iSubSet == iLastScanSet )1675 #endif1676 1522 { 1677 1523 uiSigCoeffGroupFlag[ iCGBlkPos ] = 1; … … 1679 1525 else 1680 1526 { 1681 #if !REMOVE_INFER_SIGGRP1682 #if MULTILEVEL_SIGMAP_EXT1683 if( !TComTrQuant::bothCGNeighboursOne( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiScanIdx, uiWidth, uiHeight) && ( iSubSet ) )1684 #else1685 if( !TComTrQuant::bothCGNeighboursOne( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiWidth, uiHeight) && ( iSubSet ) )1686 #endif1687 {1688 #endif1689 1527 UInt uiSigCoeffGroup; 1690 #if MULTILEVEL_SIGMAP_EXT1691 1528 UInt uiCtxSig = TComTrQuant::getSigCoeffGroupCtxInc( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiScanIdx, uiWidth, uiHeight ); 1692 #else1693 UInt uiCtxSig = TComTrQuant::getSigCoeffGroupCtxInc( uiSigCoeffGroupFlag, iCGPosX, iCGPosY, uiWidth, uiHeight );1694 #endif1695 1529 m_pcTDecBinIf->decodeBin( uiSigCoeffGroup, baseCoeffGroupCtx[ uiCtxSig ] ); 1696 1530 uiSigCoeffGroupFlag[ iCGBlkPos ] = uiSigCoeffGroup; 1697 #if !REMOVE_INFER_SIGGRP1698 }1699 else1700 {1701 uiSigCoeffGroupFlag[ iCGBlkPos ] = 1;1702 bInferredCGFlag = true;1703 }1704 #endif1705 1531 } 1706 1532 … … 1716 1542 if( uiSigCoeffGroupFlag[ iCGBlkPos ] ) 1717 1543 { 1718 #if REMOVE_INFER_SIGGRP1719 1544 if( iScanPosSig > iSubPos || iSubSet == 0 || numNonZero ) 1720 #else1721 if( iScanPosSig > iSubPos || bInferredCGFlag || numNonZero )1722 #endif1723 1545 { 1724 1546 uiCtxSig = TComTrQuant::getSigCtxInc( pcCoef, uiPosX, uiPosY, blockType, uiWidth, uiHeight, eTType ); … … 1735 1557 pos[ numNonZero ] = uiBlkPos; 1736 1558 numNonZero ++; 1737 #if MULTIBITS_DATA_HIDING1738 1559 if( lastNZPosInCG == -1 ) 1739 1560 { … … 1741 1562 } 1742 1563 firstNZPosInCG = iScanPosSig; 1743 #endif1744 1564 } 1745 1565 } 1746 #if !MULTILEVEL_SIGMAP_EXT1747 }1748 else1749 {1750 for( ; iScanPosSig >= iSubPos; iScanPosSig-- )1751 {1752 UInt uiBlkPos = scan[ iScanPosSig ];1753 UInt uiPosY = uiBlkPos >> uiLog2BlockSize;1754 UInt uiPosX = uiBlkPos - ( uiPosY << uiLog2BlockSize );1755 UInt uiSig = 0;1756 UInt uiCtxSig = TComTrQuant::getSigCtxInc( pcCoef, uiPosX, uiPosY, blockType, uiWidth, uiHeight, eTType );1757 m_pcTDecBinIf->decodeBin( uiSig, baseCtx[ uiCtxSig ] );1758 pcCoef[ uiBlkPos ] = uiSig;1759 if( uiSig )1760 {1761 pos[ numNonZero ] = uiBlkPos;1762 numNonZero ++;1763 #if MULTIBITS_DATA_HIDING1764 if( lastNZPosInCG == -1 )1765 {1766 lastNZPosInCG = iScanPosSig;1767 }1768 firstNZPosInCG = iScanPosSig;1769 #endif1770 }1771 }1772 }1773 #endif1774 1566 1775 1567 1776 1568 if( numNonZero ) 1777 1569 { 1778 #if MULTIBITS_DATA_HIDING1779 1570 Bool signHidden = ( lastNZPosInCG - firstNZPosInCG >= (Int)tsig ); 1780 1571 absSum = 0; 1781 #endif // MULTIBITS_DATA_HIDING1782 1572 1783 1573 UInt c1 = 1; 1784 #if !RESTRICT_GR1GR2FLAG_NUMBER1785 UInt c2 = 0;1786 #endif1787 #if LEVEL_CTX_LUMA_RED1788 1574 UInt uiCtxSet = (iSubSet > 0 && eTType==TEXT_LUMA) ? 2 : 0; 1789 #else1790 UInt uiCtxSet = (iSubSet > 0 && eTType==TEXT_LUMA) ? 3 : 0;1791 #endif1792 1575 UInt uiBin; 1793 1576 … … 1795 1578 { 1796 1579 uiCtxSet++; 1797 #if !LEVEL_CTX_LUMA_RED1798 if(eTType==TEXT_LUMA && uiNumOne > 3)1799 {1800 uiCtxSet++;1801 }1802 #endif1803 1580 } 1804 1581 … … 1807 1584 Int absCoeff[SCAN_SET_SIZE]; 1808 1585 1809 #if RESTRICT_GR1GR2FLAG_NUMBER1810 1586 for ( Int i = 0; i < numNonZero; i++) absCoeff[i] = 1; 1811 1587 Int numC1Flag = min(numNonZero, C1FLAG_NUMBER); … … 1813 1589 1814 1590 for( Int idx = 0; idx < numC1Flag; idx++ ) 1815 #else1816 for( Int idx = 0; idx < numNonZero; idx++ )1817 #endif1818 1591 { 1819 1592 m_pcTDecBinIf->decodeBin( uiBin, baseCtxMod[c1] ); … … 1821 1594 { 1822 1595 c1 = 0; 1823 #if RESTRICT_GR1GR2FLAG_NUMBER1824 1596 if (firstC2FlagIdx == -1) 1825 1597 { 1826 1598 firstC2FlagIdx = idx; 1827 1599 } 1828 #endif1829 1600 } 1830 1601 else if( (c1 < 3) && (c1 > 0) ) … … 1837 1608 if (c1 == 0) 1838 1609 { 1839 #if RESTRICT_GR1GR2FLAG_NUMBER1840 1610 baseCtxMod = ( eTType==TEXT_LUMA ) ? m_cCUAbsSCModel.get( 0, 0 ) + uiCtxSet : m_cCUAbsSCModel.get( 0, 0 ) + NUM_ABS_FLAG_CTX_LUMA + uiCtxSet; 1841 1611 if ( firstC2FlagIdx != -1) … … 1844 1614 absCoeff[ firstC2FlagIdx ] = uiBin + 2; 1845 1615 } 1846 #else 1847 baseCtxMod = ( eTType==TEXT_LUMA ) ? m_cCUAbsSCModel.get( 0, 0 ) + 3 * uiCtxSet : m_cCUAbsSCModel.get( 0, 0 ) + NUM_ABS_FLAG_CTX_LUMA + 3 * uiCtxSet; 1616 } 1617 1618 UInt coeffSigns; 1619 if ( signHidden && beValid ) 1620 { 1621 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero-1 ); 1622 coeffSigns <<= 32 - (numNonZero-1); 1623 } 1624 else 1625 { 1626 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero ); 1627 coeffSigns <<= 32 - numNonZero; 1628 } 1629 1630 Int iFirstCoeff2 = 1; 1631 if (c1 == 0 || numNonZero > C1FLAG_NUMBER) 1632 { 1848 1633 for( Int idx = 0; idx < numNonZero; idx++ ) 1849 1634 { 1850 if( absCoeff[ idx ] == 2 )1851 {1852 m_pcTDecBinIf->decodeBin( uiBin, baseCtxMod[c2] );1853 absCoeff[ idx ] = uiBin + 2;1854 c2 += (c2 < 2);1855 uiNumOne++;1856 }1857 }1858 #endif1859 }1860 1861 #if MULTIBITS_DATA_HIDING1862 UInt coeffSigns;1863 if ( signHidden && beValid )1864 {1865 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero-1 );1866 coeffSigns <<= 32 - (numNonZero-1);1867 }1868 else1869 {1870 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero );1871 coeffSigns <<= 32 - numNonZero;1872 }1873 #else1874 UInt coeffSigns;1875 m_pcTDecBinIf->decodeBinsEP( coeffSigns, numNonZero );1876 coeffSigns <<= 32 - numNonZero;1877 #endif1878 1879 #if RESTRICT_GR1GR2FLAG_NUMBER1880 Int iFirstCoeff2 = 1;1881 if (c1 == 0 || numNonZero > C1FLAG_NUMBER)1882 #else1883 if (c1 == 0)1884 #endif1885 {1886 for( Int idx = 0; idx < numNonZero; idx++ )1887 {1888 #if RESTRICT_GR1GR2FLAG_NUMBER1889 1635 UInt baseLevel = (idx < C1FLAG_NUMBER)? (2 + iFirstCoeff2) : 1; 1890 1636 … … 1901 1647 uiNumOne++; 1902 1648 } 1903 #else1904 if( absCoeff[ idx ] == 3 )1905 {1906 UInt uiLevel;1907 xReadGoRiceExGolomb( uiLevel, uiGoRiceParam );1908 absCoeff[ idx ] = uiLevel + 3;1909 }1910 #endif1911 1649 } 1912 1650 } … … 1915 1653 { 1916 1654 Int blkPos = pos[ idx ]; 1917 #if MULTIBITS_DATA_HIDING1918 1655 // Signs applied later. 1919 1656 pcCoef[ blkPos ] = absCoeff[ idx ]; … … 1932 1669 coeffSigns <<= 1; 1933 1670 } 1934 #else1935 Int sign = static_cast<Int>( coeffSigns ) >> 31;1936 pcCoef[ blkPos ] = ( absCoeff[ idx ] ^ sign ) - sign;1937 coeffSigns <<= 1;1938 #endif1939 1671 } 1940 1672 } … … 1949 1681 1950 1682 1951 #if SAO_UNIT_INTERLEAVING1952 1683 Void TDecSbac::parseSaoUvlc (UInt& ruiVal) 1953 1684 { … … 2186 1917 } 2187 1918 } 2188 #endif2189 1919 2190 1920 /** … … 2217 1947 } 2218 1948 2219 #if OL_FLUSH2220 1949 Void TDecSbac::decodeFlush ( ) 2221 1950 { … … 2225 1954 2226 1955 } 2227 #endif2228 1956 2229 1957 #if HHI_DMM_WEDGE_INTRA || HHI_DMM_PRED_TEX || (LGE_EDGE_INTRA_A0070 && LGE_EDGE_INTRA_DELTA_DC)
Note: See TracChangeset for help on using the changeset viewer.