Changeset 296 in 3DVCSoftware for trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
- Timestamp:
- 20 Feb 2013, 22:07:43 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r210 r296 52 52 Void TEncEntropy::encodeSliceHeader ( TComSlice* pcSlice ) 53 53 { 54 #if SAO_UNIT_INTERLEAVING55 54 if (pcSlice->getSPS()->getUseSAO()) 56 55 { … … 68 67 } 69 68 } 70 #endif71 69 72 70 m_pcEntropyCoderIf->codeSliceHeader( pcSlice ); … … 74 72 } 75 73 76 #if TILES_WPP_ENTRY_POINT_SIGNALLING77 74 Void TEncEntropy::encodeTilesWPPEntryPoint( TComSlice* pSlice ) 78 75 { 79 76 m_pcEntropyCoderIf->codeTilesWPPEntryPoint( pSlice ); 80 77 } 81 #else82 Void TEncEntropy::encodeSliceHeaderSubstreamTable( TComSlice* pcSlice )83 {84 m_pcEntropyCoderIf->codeSliceHeaderSubstreamTable( pcSlice );85 }86 #endif87 78 88 79 Void TEncEntropy::encodeTerminatingBit ( UInt uiIsLast ) … … 98 89 } 99 90 100 #if OL_FLUSH101 91 Void TEncEntropy::encodeFlush() 102 92 { … … 107 97 m_pcEntropyCoderIf->encodeStart(); 108 98 } 109 #endif110 99 111 100 Void TEncEntropy::encodeSEI(const SEI& sei) … … 133 122 #endif 134 123 135 #if HHI_MPI 124 #if HHI_MPI || OL_QTLIMIT_PREDCODING_B0068 136 125 Void TEncEntropy::encodeSPS( TComSPS* pcSPS, Bool bIsDepth ) 137 126 { … … 157 146 uiAbsPartIdx = 0; 158 147 } 159 #if BURST_IPCM160 148 if( !bRD ) 161 149 { … … 165 153 } 166 154 } 167 #endif168 155 m_pcEntropyCoderIf->codeSkipFlag( pcCU, uiAbsPartIdx ); 169 156 } 170 157 171 158 #if LGE_ILLUCOMP_B0045 172 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 173 { 174 if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) || pcCU->getSlice()->getSPS()->isDepth()) 159 Void TEncEntropy::encodeICFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD 160 #if LGE_ILLUCOMP_DEPTH_C0046 161 , UInt uiDepth 162 #endif 163 ) 164 { 165 if (pcCU->isIntra(uiAbsPartIdx) || (pcCU->getSlice()->getViewId() == 0) 166 #if !LGE_ILLUCOMP_DEPTH_C0046 167 || pcCU->getSlice()->getSPS()->isDepth() 168 #endif 169 ) 175 170 { 176 171 return; … … 185 180 } 186 181 187 if(pcCU->isICFlagRequired(uiAbsPartIdx)) 182 if(pcCU->isICFlagRequired(uiAbsPartIdx 183 #if LGE_ILLUCOMP_DEPTH_C0046 184 , uiDepth //This modification is not needed after integrating JCT3V-C0137 185 #endif 186 )) 188 187 m_pcEntropyCoderIf->codeICFlag( pcCU, uiAbsPartIdx ); 189 188 } … … 214 213 // m_pcEntropyCoderIf->codeAlfUvlc(pAlfParam->realfiltNo); 215 214 216 #if !LCU_SYNTAX_ALF217 m_pcEntropyCoderIf->codeAlfFlag(pAlfParam->alf_pcr_region_flag);218 #endif219 #if !ALF_SINGLE_FILTER_SHAPE220 m_pcEntropyCoderIf->codeAlfUvlc(pAlfParam->filter_shape);221 #endif222 215 Int noFilters = min(pAlfParam->filters_per_group-1, 2); 223 216 m_pcEntropyCoderIf->codeAlfUvlc(noFilters); … … 229 222 else if (noFilters == 2) 230 223 { 231 #if LCU_SYNTAX_ALF232 #if ALF_16_BA_GROUPS233 224 Int numMergeFlags = 16; 234 #else235 Int numMergeFlags = 15;236 #endif237 #else238 #if ALF_16_BA_GROUPS239 Int numMergeFlags = 16;240 #else241 Int numMergeFlags = pAlfParam->alf_pcr_region_flag ? 16 : 15;242 #endif243 #endif244 225 for (Int i=1; i<numMergeFlags; i++) 245 226 { … … 273 254 pDepthInt = pDepthIntTabShapes[ALFp->filter_shape]; 274 255 maxScanVal = 0; 275 #if ALF_SINGLE_FILTER_SHAPE276 256 int minScanVal = MIN_SCAN_POS_CROSS; 277 #else278 int minScanVal = ( ALFp->filter_shape==ALF_STAR5x5 ) ? 0 : MIN_SCAN_POS_CROSS;279 #endif280 257 281 258 for(i = 0; i < sqrFiltLength; i++) … … 343 320 // Coding parameters 344 321 ALFp->minKStart = minKStart; 345 #if !LCU_SYNTAX_ALF346 ALFp->maxScanVal = maxScanVal;347 #endif348 322 for(scanPos = minScanVal; scanPos < maxScanVal; scanPos++) 349 323 { … … 351 325 } 352 326 353 #if LCU_SYNTAX_ALF354 327 if (ALFp->filters_per_group == 1) 355 328 { … … 358 331 else 359 332 { 360 #endif361 333 len += writeFilterCodingParams(minKStart, minScanVal, maxScanVal, kMinTab); 362 334 363 335 // Filter coefficients 364 336 len += writeFilterCoeffs(sqrFiltLength, filters_per_group, pDepthInt, ALFp->coeffmulti, kMinTab); 365 #if LCU_SYNTAX_ALF 366 } 367 #endif 337 } 368 338 369 339 return len; … … 403 373 { 404 374 scanPos = pDepthInt[i] - 1; 405 #if LCU_SYNTAX_ALF406 375 Int k = (filters_per_group == 1) ? kMinTab[i] : kMinTab[scanPos]; 407 376 golombEncode(FilterCoeff[ind][i], k); 408 #else409 golombEncode(FilterCoeff[ind][i], kMinTab[scanPos]);410 #endif411 377 } 412 378 } … … 489 455 } 490 456 491 #if H HI_INTER_VIEW_RESIDUAL_PRED457 #if H3D_IVRP && !MTK_MDIVRP_C0138 492 458 Void 493 459 TEncEntropy::encodeResPredFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiPUIdx, Bool bRD ) … … 514 480 #endif 515 481 516 #if LCU_SYNTAX_ALF517 482 /** parse the fixed length code (smaller than one max value) in ALF 518 483 * \param run: coded value … … 781 746 782 747 } 783 #endif784 748 785 749 786 750 Void TEncEntropy::encodeAlfParam(ALFParam* pAlfParam) 787 751 { 788 #if LCU_SYNTAX_ALF789 752 const Int numCoeff = (Int)ALF_MAX_NUM_COEF; 790 753 … … 814 777 } 815 778 } 816 #else817 if (!pAlfParam->alf_flag)818 {819 return;820 }821 Int pos;822 codeAux(pAlfParam);823 codeFilt(pAlfParam);824 825 // filter parameters for chroma826 m_pcEntropyCoderIf->codeAlfUvlc(pAlfParam->chroma_idc);827 if(pAlfParam->chroma_idc)828 {829 #if !ALF_SINGLE_FILTER_SHAPE830 m_pcEntropyCoderIf->codeAlfUvlc(pAlfParam->filter_shape_chroma);831 #endif832 // filter coefficients for chroma833 for(pos=0; pos<pAlfParam->num_coeff_chroma; pos++)834 {835 m_pcEntropyCoderIf->codeAlfSvlc(pAlfParam->coeff_chroma[pos]);836 }837 }838 #endif839 779 } 840 780 … … 895 835 uiAbsPartIdx = 0; 896 836 } 897 #if BURST_IPCM898 837 if( !bRD ) 899 838 { … … 903 842 } 904 843 } 905 #endif906 844 907 845 #if !RWTH_SDC_DLT_B0036 … … 931 869 uiAbsPartIdx = 0; 932 870 } 933 #if BURST_IPCM934 871 if( !bRD ) 935 872 { … … 939 876 } 940 877 } 941 #endif942 878 943 879 m_pcEntropyCoderIf->codeSplitFlag( pcCU, uiAbsPartIdx, uiDepth ); … … 957 893 uiAbsPartIdx = 0; 958 894 } 959 #if BURST_IPCM960 895 if( !bRD ) 961 896 { … … 965 900 } 966 901 } 967 #endif968 902 #if RWTH_SDC_DLT_B0036 969 903 if( !pcCU->getSlice()->isInterB() && pcCU->isIntra(uiAbsPartIdx) && pcCU->getSDCFlag(uiAbsPartIdx) ) … … 1019 953 } 1020 954 1021 #if BURST_IPCM1022 955 Int numIPCM = 0; 1023 956 Bool firstIPCMFlag = false; … … 1035 968 } 1036 969 m_pcEntropyCoderIf->codeIPCMInfo ( pcCU, uiAbsPartIdx, numIPCM, firstIPCMFlag); 1037 #else 1038 m_pcEntropyCoderIf->codeIPCMInfo ( pcCU, uiAbsPartIdx ); 1039 #endif 1040 1041 } 1042 1043 #if UNIFIED_TRANSFORM_TREE 970 971 } 972 1044 973 Void TEncEntropy::xEncodeTransform( TComDataCU* pcCU,UInt offsetLuma, UInt offsetChroma, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt width, UInt height, UInt uiTrIdx, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3, Bool& bCodeDQP ) 1045 #else1046 Void TEncEntropy::xEncodeTransformSubdiv( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt absTUPartIdx, UInt uiDepth, UInt uiInnerQuadIdx, UInt& uiYCbfFront3, UInt& uiUCbfFront3, UInt& uiVCbfFront3 )1047 #endif1048 974 { 1049 975 const UInt uiSubdiv = pcCU->getTransformIdx( uiAbsPartIdx ) + pcCU->getDepth( uiAbsPartIdx ) > uiDepth; 1050 976 const UInt uiLog2TrafoSize = g_aucConvertToBit[pcCU->getSlice()->getSPS()->getMaxCUWidth()]+2 - uiDepth; 1051 #if UNIFIED_TRANSFORM_TREE1052 977 UInt cbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA , uiTrIdx ); 1053 978 UInt cbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ); … … 1072 997 } 1073 998 } 1074 #endif // UNIFIED_TRANSFORM_TREE1075 999 {//CABAC 1076 1000 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) ) … … 1152 1076 if( uiSubdiv ) 1153 1077 { 1154 #if UNIFIED_TRANSFORM_TREE1155 1078 UInt size; 1156 1079 width >>= 1; … … 1158 1081 size = width*height; 1159 1082 uiTrIdx++; 1160 #endif // UNIFIED_TRANSFORM_TREE1161 1083 ++uiDepth; 1162 #if UNIFIED_TRANSFORM_TREE1163 1084 const UInt partNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1); 1164 #else1165 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);1166 #endif1167 1085 1168 1086 UInt uiCurrentCbfY = 0; … … 1170 1088 UInt uiCurrentCbfV = 0; 1171 1089 1172 #if UNIFIED_TRANSFORM_TREE1173 1090 UInt nsAddr = 0; 1174 1091 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 0, uiDepth - pcCU->getDepth( uiAbsPartIdx ) ); … … 1186 1103 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 3, uiDepth - pcCU->getDepth( uiAbsPartIdx ) ); 1187 1104 xEncodeTransform( pcCU, offsetLuma, offsetChroma, uiAbsPartIdx, nsAddr, uiDepth, width, height, uiTrIdx, 3, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV, bCodeDQP ); 1188 #else // UNIFIED_TRANSFORM_TREE1189 UInt nsAddr = 0;1190 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 0, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );1191 xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, 0, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );1192 1193 uiAbsPartIdx += uiQPartNum;1194 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 1, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );1195 xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, 1, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );1196 1197 uiAbsPartIdx += uiQPartNum;1198 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 2, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );1199 xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, 2, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );1200 1201 uiAbsPartIdx += uiQPartNum;1202 nsAddr = pcCU->getNSAbsPartIdx( uiLog2TrafoSize-1, uiAbsPartIdx, absTUPartIdx, 3, uiDepth - pcCU->getDepth( uiAbsPartIdx ) );1203 xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, nsAddr, uiDepth, 3, uiCurrentCbfY, uiCurrentCbfU, uiCurrentCbfV );1204 #endif // UNIFIED_TRANSFORM_TREE1205 1105 1206 1106 uiYCbfFront3 += uiCurrentCbfY; … … 1246 1146 } 1247 1147 1248 #if UNIFIED_TRANSFORM_TREE1249 1148 if ( cbfY || cbfU || cbfV ) 1250 1149 { … … 1298 1197 } 1299 1198 } 1300 #endif // UNIFIED_TRANSFORM_TREE 1301 } 1302 } 1303 } 1304 1305 #if !UNIFIED_TRANSFORM_TREE 1306 // transform index 1307 Void TEncEntropy::encodeTransformIdx( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD ) 1308 { 1309 assert( !bRD ); // parameter bRD can be removed 1310 if( bRD ) 1311 { 1312 uiAbsPartIdx = 0; 1313 } 1314 1315 DTRACE_CABAC_VL( g_nSymbolCounter++ ) 1316 DTRACE_CABAC_T( "\tdecodeTransformIdx()\tCUDepth=" ) 1317 DTRACE_CABAC_V( uiDepth ) 1318 DTRACE_CABAC_T( "\n" ) 1319 UInt temp = 0; 1320 UInt temp1 = 0; 1321 UInt temp2 = 0; 1322 xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 ); 1323 } 1324 #endif // !UNIFIED_TRANSFORM_TREE 1199 } 1200 } 1201 } 1202 1325 1203 1326 1204 // Intra direction for Luma … … 1347 1225 uiAbsPartIdx = 0; 1348 1226 } 1349 1227 1350 1228 #if RWTH_SDC_DLT_B0036 1351 1229 if( pcCU->getSDCFlag(uiAbsPartIdx) ) … … 1355 1233 } 1356 1234 #endif 1357 1235 1358 1236 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); 1359 1237 … … 1496 1374 if ( (pcCU->getInterDir( uiAbsPartIdx ) & ( 1 << eRefList )) && (pcCU->getAMVPMode(uiAbsPartIdx) == AM_EXPL) ) 1497 1375 { 1498 #if H HI_INTER_VIEW_MOTION_PRED1376 #if H3D_IVMP 1499 1377 const Int iNumCands = AMVP_MAX_NUM_CANDS + ( pcCU->getSlice()->getSPS()->getMultiviewMvPredMode() ? 1 : 0 ); 1500 1378 m_pcEntropyCoderIf->codeMVPIdx( pcCU, uiAbsPartIdx, eRefList, iNumCands ); … … 1538 1416 1539 1417 // texture 1540 #if !UNIFIED_TRANSFORM_TREE1541 Void TEncEntropy::xEncodeCoeff( TComDataCU* pcCU, UInt uiLumaOffset, UInt uiChromaOffset, UInt uiAbsPartIdx, UInt uiDepth, UInt uiWidth, UInt uiHeight, UInt uiTrIdx, UInt uiCurrTrIdx, Bool& bCodeDQP )1542 {1543 UInt uiLog2TrSize = g_aucConvertToBit[ pcCU->getSlice()->getSPS()->getMaxCUWidth() >> uiDepth ] + 2;1544 UInt uiCbfY = pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx );1545 UInt uiCbfU = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );1546 UInt uiCbfV = pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );1547 1548 if( uiLog2TrSize == 2 )1549 {1550 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );1551 if( ( uiAbsPartIdx % uiQPDiv ) == 0 )1552 {1553 m_uiBakAbsPartIdx = uiAbsPartIdx;1554 m_uiBakChromaOffset = uiChromaOffset;1555 }1556 else if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) )1557 {1558 uiCbfU = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx );1559 uiCbfV = pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx );1560 }1561 }1562 1563 if ( uiCbfY || uiCbfU || uiCbfV )1564 {1565 // dQP: only for LCU once1566 if ( pcCU->getSlice()->getPPS()->getUseDQP() )1567 {1568 if ( bCodeDQP )1569 {1570 encodeQP( pcCU, uiAbsPartIdx );1571 bCodeDQP = false;1572 }1573 }1574 UInt uiLumaTrMode, uiChromaTrMode;1575 pcCU->convertTransIdx( uiAbsPartIdx, pcCU->getTransformIdx( uiAbsPartIdx ), uiLumaTrMode, uiChromaTrMode );1576 const UInt uiStopTrMode = uiLumaTrMode;1577 1578 assert(1); // as long as quadtrees are not used for residual transform1579 1580 if( uiTrIdx == uiStopTrMode )1581 {1582 if( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, uiTrIdx ) )1583 {1584 Int trWidth = uiWidth;1585 Int trHeight = uiHeight;1586 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );1587 m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffY()+uiLumaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_LUMA );1588 }1589 1590 uiWidth >>= 1;1591 uiHeight >>= 1;1592 1593 if( uiLog2TrSize == 2 )1594 {1595 UInt uiQPDiv = pcCU->getPic()->getNumPartInCU() >> ( ( uiDepth - 1 ) << 1 );1596 if( ( uiAbsPartIdx % uiQPDiv ) == (uiQPDiv - 1) )1597 {1598 uiWidth <<= 1;1599 uiHeight <<= 1;1600 Int trWidth = uiWidth;1601 Int trHeight = uiHeight;1602 pcCU->getNSQTSize( uiTrIdx-1, uiAbsPartIdx, trWidth, trHeight );1603 if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) )1604 {1605 m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffCb()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );1606 }1607 if( pcCU->getCbf( m_uiBakAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) )1608 {1609 m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffCr()+m_uiBakChromaOffset), m_uiBakAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );1610 }1611 }1612 }1613 else1614 {1615 Int trWidth = uiWidth;1616 Int trHeight = uiHeight;1617 pcCU->getNSQTSize( uiTrIdx, uiAbsPartIdx, trWidth, trHeight );1618 if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, uiTrIdx ) )1619 {1620 m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffCb()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_U );1621 }1622 if( pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, uiTrIdx ) )1623 {1624 m_pcEntropyCoderIf->codeCoeffNxN( pcCU, (pcCU->getCoeffCr()+uiChromaOffset), uiAbsPartIdx, trWidth, trHeight, uiDepth, TEXT_CHROMA_V );1625 }1626 }1627 }1628 else1629 {1630 {1631 DTRACE_CABAC_VL( g_nSymbolCounter++ );1632 DTRACE_CABAC_T( "\tgoing down\tdepth=" );1633 DTRACE_CABAC_V( uiDepth );1634 DTRACE_CABAC_T( "\ttridx=" );1635 DTRACE_CABAC_V( uiTrIdx );1636 DTRACE_CABAC_T( "\n" );1637 }1638 if( uiCurrTrIdx <= uiTrIdx )1639 assert(1);1640 1641 UInt uiSize;1642 uiWidth >>= 1;1643 uiHeight >>= 1;1644 uiSize = uiWidth*uiHeight;1645 uiDepth++;1646 uiTrIdx++;1647 1648 UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (uiDepth << 1);1649 UInt uiIdx = uiAbsPartIdx;1650 1651 {1652 xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP );1653 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum;1654 1655 xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP );1656 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum;1657 1658 xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP );1659 uiLumaOffset += uiSize; uiChromaOffset += (uiSize>>2); uiIdx += uiQPartNum;1660 1661 xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiIdx, uiDepth, uiWidth, uiHeight, uiTrIdx, uiCurrTrIdx, bCodeDQP );1662 }1663 {1664 DTRACE_CABAC_VL( g_nSymbolCounter++ );1665 DTRACE_CABAC_T( "\tgoing up\n" );1666 }1667 }1668 }1669 }1670 #endif // !UNIFIED_TRANSFORM_TREE1671 1418 1672 1419 /** encode coefficients … … 1706 1453 DTRACE_CABAC_V( uiDepth ) 1707 1454 DTRACE_CABAC_T( "\n" ) 1708 #if !UNIFIED_TRANSFORM_TREE1709 UInt temp = 0;1710 UInt temp1 = 0;1711 UInt temp2 = 0;1712 xEncodeTransformSubdiv( pcCU, uiAbsPartIdx, uiAbsPartIdx, uiDepth, 0, temp, temp1, temp2 );1713 #endif // !UNIFIED_TRANSFORM_TREE1714 1455 } 1715 1456 else … … 1735 1476 } 1736 1477 } 1737 #if !UNIFIED_TRANSFORM_TREE1738 encodeTransformIdx( pcCU, uiAbsPartIdx, pcCU->getDepth(uiAbsPartIdx) );1739 #endif1740 1478 } 1741 1479 … … 1756 1494 #endif 1757 1495 1758 #if UNIFIED_TRANSFORM_TREE1759 1496 UInt temp = 0; 1760 1497 UInt temp1 = 0; 1761 1498 UInt temp2 = 0; 1762 1499 xEncodeTransform( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, 0, temp, temp1, temp2, bCodeDQP ); 1763 #else // UNIFIED_TRANSFORM_TREE1764 xEncodeCoeff( pcCU, uiLumaOffset, uiChromaOffset, uiAbsPartIdx, uiDepth, uiWidth, uiHeight, 0, uiLumaTrMode, bCodeDQP );1765 #endif // UNIFIED_TRANSFORM_TREE1766 1500 1767 1501 #if FIX_MPI_B0065 … … 1785 1519 } 1786 1520 1787 #if SAO_UNIT_INTERLEAVING1788 1521 /** Encode SAO Offset 1789 1522 * \param saoLcuParam SAO LCU paramters … … 1973 1706 } 1974 1707 } 1975 #else1976 /** Encode SAO for one partition1977 * \param pSaoParam, iPartIdx1978 */1979 Void TEncEntropy::encodeSaoOnePart(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr)1980 {1981 SAOQTPart* pAlfPart = NULL;1982 pAlfPart = &(pSaoParam->psSaoPart[iYCbCr][iPartIdx]);1983 1984 UInt uiSymbol;1985 1986 if(!pAlfPart->bSplit)1987 {1988 if (pAlfPart->bEnableFlag)1989 {1990 uiSymbol = pAlfPart->iBestType + 1;1991 }1992 else1993 {1994 uiSymbol = 0;1995 }1996 1997 m_pcEntropyCoderIf->codeSaoUvlc(uiSymbol);1998 1999 if (pAlfPart->bEnableFlag)2000 {2001 for(Int i=0; i< pAlfPart->iLength; i++)2002 {2003 m_pcEntropyCoderIf->codeSaoSvlc(pAlfPart->iOffset[i]);2004 }2005 }2006 return;2007 }2008 2009 //split2010 if (pAlfPart->PartLevel < pSaoParam->iMaxSplitLevel)2011 {2012 for (Int i=0;i<NUM_DOWN_PART;i++)2013 {2014 encodeSaoOnePart(pSaoParam, pAlfPart->DownPartsIdx[i], iYCbCr);2015 }2016 }2017 }2018 2019 /** Encode quadtree split flag2020 * \param pSaoParam, iPartIdx2021 */2022 Void TEncEntropy::encodeQuadTreeSplitFlag(SAOParam* pSaoParam, Int iPartIdx, Int iYCbCr)2023 {2024 SAOQTPart* pSaoPart = NULL;2025 pSaoPart = &(pSaoParam->psSaoPart[iYCbCr][iPartIdx]);2026 2027 if(pSaoPart->PartLevel < pSaoParam->iMaxSplitLevel)2028 {2029 //send one flag2030 m_pcEntropyCoderIf->codeSaoFlag( (pSaoPart->bSplit)?(1):(0) );2031 2032 if(pSaoPart->bSplit)2033 {2034 for (Int i=0;i<NUM_DOWN_PART;i++)2035 {2036 encodeQuadTreeSplitFlag(pSaoParam, pSaoPart->DownPartsIdx[i], iYCbCr);2037 }2038 }2039 }2040 }2041 /** Encode SAO parameters2042 * \param pSaoParam2043 */2044 Void TEncEntropy::encodeSaoParam(SAOParam* pSaoParam)2045 {2046 if (pSaoParam->bSaoFlag[0])2047 {2048 encodeQuadTreeSplitFlag(pSaoParam, 0, 0);2049 encodeSaoOnePart(pSaoParam, 0, 0);2050 m_pcEntropyCoderIf->codeSaoFlag(pSaoParam->bSaoFlag[1]);2051 if (pSaoParam->bSaoFlag[1])2052 {2053 encodeQuadTreeSplitFlag(pSaoParam, 0, 1);2054 encodeSaoOnePart(pSaoParam, 0, 1);2055 }2056 m_pcEntropyCoderIf->codeSaoFlag(pSaoParam->bSaoFlag[2]);2057 if (pSaoParam->bSaoFlag[2])2058 {2059 encodeQuadTreeSplitFlag(pSaoParam, 0, 2);2060 encodeSaoOnePart(pSaoParam, 0, 2);2061 }2062 }2063 }2064 #endif2065 1708 2066 1709 Int TEncEntropy::countNonZeroCoeffs( TCoeff* pcCoef, UInt uiSize )
Note: See TracChangeset for help on using the changeset viewer.