Changeset 345 in SHVCSoftware for trunk/source/Lib/TLibEncoder
- Timestamp:
- 17 Aug 2013, 06:27:19 (12 years ago)
- Location:
- trunk
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev (added) merged: 315-344 /trunk (added) merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source
- Property svn:mergeinfo changed
/branches/SHM-3.0-dev/source (added) merged: 316-340 /trunk/source (added) merged: 312-314
- Property svn:mergeinfo changed
-
trunk/source/Lib/TLibEncoder/TEncCavlc.cpp
r313 r345 708 708 } 709 709 710 #if SPL_FLG_CHK 711 if(vps->getSplittingFlag()) 712 { 713 UInt splDimSum=0; 714 for(j = 0; j < vps->getNumScalabilityTypes(); j++) 715 { 716 splDimSum+=(vps->getDimensionIdLen(j)); 717 } 718 assert(splDimSum<=6); 719 } 720 #endif 721 710 722 WRITE_FLAG( vps->getNuhLayerIdPresentFlag(), "vps_nuh_layer_id_present_flag" ); 711 723 for(i = 1; i < vps->getMaxLayers(); i++) … … 737 749 #endif 738 750 #if JCTVC_M0203_INTERLAYER_PRED_IDC 751 #if N0120_MAX_TID_REF_PRESENT_FLAG 752 WRITE_FLAG( vps->getMaxTidIlRefPicsPlus1PresentFlag(), "max_tid_il_ref_pics_plus1_present_flag"); 753 if (vps->getMaxTidIlRefPicsPlus1PresentFlag()) 754 { 755 for( i = 0; i < vps->getMaxLayers() - 1; i++) 756 { 757 WRITE_CODE(vps->getMaxSublayerForIlpPlus1(i), 3, "max_sublayer_for_ilp_plus1[i]" ); 758 } 759 } 760 #else 739 761 for( i = 0; i < vps->getMaxLayers() - 1; i++) 740 762 { 741 763 WRITE_CODE(vps->getMaxSublayerForIlpPlus1(i), 3, "max_sublayer_for_ilp_plus1[i]" ); 742 764 } 765 #endif 766 #endif 767 #if ILP_SSH_SIG 768 WRITE_FLAG( vps->getIlpSshSignalingEnabledFlag(), "all_ref_layers_active_flag" ); 743 769 #endif 744 770 #if VPS_EXTN_PROFILE_INFO … … 1052 1078 } 1053 1079 1054 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1055 if((pcSlice->getSPS()->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) ) 1080 #if JCTVC_M0458_INTERLAYER_RPS_SIG 1081 #if ILP_SSH_SIG 1082 if((pcSlice->getSPS()->getLayerId() > 0) && pcSlice->getVPS()->getIlpSshSignalingEnabledFlag() && (pcSlice->getNumILRRefIdx() > 0) ) 1083 #else 1084 if((pcSlice->getSPS()->getLayerId() > 0) && (pcSlice->getNumILRRefIdx() > 0) ) 1085 #endif 1056 1086 { 1057 1087 WRITE_FLAG(pcSlice->getInterLayerPredEnabledFlag(),"inter_layer_pred_enabled_flag"); … … 1069 1099 WRITE_CODE(pcSlice->getActiveNumILRRefIdx() - 1, numBits,"num_inter_layer_ref_pics_minus1"); 1070 1100 } 1101 #if ILP_NUM_REF_CHK 1102 if( pcSlice->getNumILRRefIdx() != pcSlice->getActiveNumILRRefIdx() ) 1103 { 1104 #endif 1071 1105 for(Int i = 0; i < pcSlice->getActiveNumILRRefIdx(); i++ ) 1072 1106 { 1073 1107 WRITE_CODE(pcSlice->getInterLayerPredLayerIdc(i),numBits,"inter_layer_pred_layer_idc[i]"); 1074 1108 } 1109 #if ILP_NUM_REF_CHK 1110 } 1111 #endif 1075 1112 } 1076 1113 } … … 1187 1224 if ( pcSlice->getEnableTMVPFlag() ) 1188 1225 { 1189 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING 1226 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 1190 1227 if ( !pcSlice->getIdrPicFlag() && pcSlice->getLayerId() > 0 && pcSlice->getActiveNumILRRefIdx() > 0 && pcSlice->getNumMotionPredRefLayers() > 0 ) 1191 1228 { … … 1210 1247 WRITE_UVLC( pcSlice->getColRefIdx(), "collocated_ref_idx" ); 1211 1248 } 1212 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING 1249 #if REF_IDX_FRAMEWORK && M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 1213 1250 } 1214 1251 #endif … … 1726 1763 return true; 1727 1764 } 1728 1729 #if INTRA_BL1730 Void TEncCavlc::codeIntraBLFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )1731 {1732 assert(0);1733 }1734 1735 #endif1736 1765 //! \} -
trunk/source/Lib/TLibEncoder/TEncCavlc.h
r313 r345 112 112 Void codeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 113 113 Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 114 #if INTRA_BL115 Void codeIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx );116 #endif117 114 118 115 Void codeInterModeFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, UInt uiEncMode ); -
trunk/source/Lib/TLibEncoder/TEncCu.cpp
r313 r345 763 763 } 764 764 } 765 #if INTRA_BL766 if(m_pcPicYuvRecBase)767 {768 xCheckRDCostIntraBL( rpcBestCU, rpcTempCU );769 rpcTempCU->initEstData( uiDepth, iQP );770 }771 #endif772 765 #if (ENCODER_FAST_MODE) 773 766 if(pcPic->getLayerId() > 0) … … 1215 1208 return; 1216 1209 } 1217 #if INTRA_BL1218 m_pcEntropyCoder->encodeIntraBLFlag( pcCU, uiAbsPartIdx );1219 if ( !pcCU->isIntraBL( uiAbsPartIdx ) )1220 {1221 #endif1222 1210 m_pcEntropyCoder->encodePredMode( pcCU, uiAbsPartIdx ); 1223 1211 … … 1238 1226 // prediction Info ( Intra : direction mode, Inter : Mv, reference idx ) 1239 1227 m_pcEntropyCoder->encodePredInfo( pcCU, uiAbsPartIdx ); 1240 #if INTRA_BL1241 }1242 #endif1243 1228 1244 1229 // Encode Coefficients … … 1568 1553 1569 1554 m_pcEntropyCoder->resetBits(); 1570 #if INTRA_BL 1571 m_pcEntropyCoder->encodeIntraBLFlag ( rpcTempCU, 0, true ); 1572 #endif 1555 1573 1556 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 1574 1557 { … … 1624 1607 1625 1608 m_pcEntropyCoder->resetBits(); 1626 #if INTRA_BL 1627 m_pcEntropyCoder->encodeIntraBLFlag ( rpcTempCU, 0, true ); 1628 #endif 1609 1629 1610 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag()) 1630 1611 { … … 1879 1860 #endif 1880 1861 1881 #if INTRA_BL1882 Void TEncCu::xCheckRDCostIntraBL( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU )1883 {1884 UInt uiDepth = rpcTempCU->getDepth( 0 );1885 rpcTempCU->setSkipFlagSubParts( false, 0, uiDepth );1886 rpcTempCU->setPartSizeSubParts( SIZE_2Nx2N, 0, uiDepth );1887 rpcTempCU->setPredModeSubParts( MODE_INTRA_BL, 0, uiDepth );1888 rpcTempCU->setCUTransquantBypassSubParts( m_pcEncCfg->getCUTransquantBypassFlagValue(), 0, uiDepth );1889 1890 m_pcPredSearch->setBaseRecPic( m_pcPicYuvRecBase );1891 #if NO_RESIDUAL_FLAG_FOR_BLPRED1892 rpcTempCU->setDepthSubParts( uiDepth, 0 );1893 // rpcTempCU->setLumaIntraDirSubParts( DC_IDX, 0, uiDepth );1894 // rpcTempCU->setChromIntraDirSubParts( DC_IDX, 0, uiDepth );1895 m_ppcPredYuvTemp[uiDepth]->copyFromPicLuma ( rpcTempCU->getSlice()->getFullPelBaseRec(rpcTempCU->getLayerId() - 1), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, rpcTempCU->getWidth(0), rpcTempCU->getHeight(0));1896 m_ppcPredYuvTemp[uiDepth]->copyFromPicChroma( rpcTempCU->getSlice()->getFullPelBaseRec(rpcTempCU->getLayerId() - 1), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, (rpcTempCU->getWidth(0)>>1), (rpcTempCU->getHeight(0)>>1), 0);1897 m_ppcPredYuvTemp[uiDepth]->copyFromPicChroma( rpcTempCU->getSlice()->getFullPelBaseRec(rpcTempCU->getLayerId() - 1), rpcTempCU->getAddr(), rpcTempCU->getZorderIdxInCU(), 0, (rpcTempCU->getWidth(0)>>1), (rpcTempCU->getHeight(0)>>1), 1);1898 m_pcPredSearch->encodeResAndCalcRdInterCU( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcResiYuvBest[uiDepth], m_ppcRecoYuvTemp[uiDepth], false );1899 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );1900 #else1901 1902 m_pcPredSearch->estIntraBLPredQT( rpcTempCU, m_ppcOrigYuv[uiDepth], m_ppcPredYuvTemp[uiDepth], m_ppcResiYuvTemp[uiDepth], m_ppcRecoYuvTemp[uiDepth] );1903 1904 m_pcEntropyCoder->resetBits();1905 m_pcEntropyCoder->encodeIntraBLFlag ( rpcTempCU, 0, true );1906 m_pcEntropyCoder->encodeSkipFlag( rpcTempCU, 0, true );1907 if ( rpcTempCU->getSlice()->getPPS()->getTransquantBypassEnableFlag())1908 {1909 m_pcEntropyCoder->encodeCUTransquantBypassFlag( rpcTempCU, 0, true );1910 }1911 1912 // Encode Coefficients1913 Bool bCodeDQP = getdQPFlag();1914 m_pcEntropyCoder->encodeCoeff( rpcTempCU, 0, uiDepth, rpcTempCU->getWidth (0), rpcTempCU->getHeight(0), bCodeDQP );1915 setdQPFlag( bCodeDQP );1916 1917 if( m_bUseSBACRD ) m_pcRDGoOnSbacCoder->store(m_pppcRDSbacCoder[uiDepth][CI_TEMP_BEST]);1918 1919 rpcTempCU->getTotalBits() = m_pcEntropyCoder->getNumberOfWrittenBits();1920 if(m_pcEncCfg->getUseSBACRD())1921 {1922 rpcTempCU->getTotalBins() = ((TEncBinCABAC *)((TEncSbac*)m_pcEntropyCoder->m_pcEntropyCoderIf)->getEncBinIf())->getBinsCoded();1923 }1924 rpcTempCU->getTotalCost() = m_pcRdCost->calcRdCost( rpcTempCU->getTotalBits(), rpcTempCU->getTotalDistortion() );1925 #endif1926 1927 xCheckDQP( rpcTempCU );1928 xCheckBestMode(rpcBestCU, rpcTempCU, uiDepth);1929 }1930 #endif1931 1862 #if (ENCODER_FAST_MODE) 1932 1863 Void TEncCu::xCheckRDCostILRUni(TComDataCU *&rpcBestCU, TComDataCU *&rpcTempCU, UInt refLayerId) -
trunk/source/Lib/TLibEncoder/TEncCu.h
r313 r345 84 84 // Access channel 85 85 TEncCfg* m_pcEncCfg; 86 #if INTRA_BL87 TComPicYuv* m_pcPicYuvRecBase; ///< reconstructed base layer88 #endif89 86 TEncSearch* m_pcPredSearch; 90 87 TComTrQuant* m_pcTrQuant; … … 134 131 Int updateLCUDataISlice ( TComDataCU* pcCU, Int LCUIdx, Int width, Int height ); 135 132 #endif 136 #if INTRA_BL 137 Void setBaseRecPic ( TComPicYuv* p ) { m_pcPicYuvRecBase = p; } 138 #endif 133 139 134 protected: 140 135 Void finishCU ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); … … 157 152 #endif 158 153 Void xCheckRDCostIntra ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, PartSize ePartSize ); 159 #if INTRA_BL160 Void xCheckRDCostIntraBL ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU );161 #endif162 154 #if ENCODER_FAST_MODE 163 155 Void xCheckRDCostILRUni ( TComDataCU*& rpcBestCU, TComDataCU*& rpcTempCU, UInt refLayerId); -
trunk/source/Lib/TLibEncoder/TEncEntropy.cpp
r313 r345 166 166 } 167 167 168 #if INTRA_BL169 if( pcCU->isIntraBL( uiAbsPartIdx ) )170 {171 return;172 }173 #endif174 175 168 m_pcEntropyCoderIf->codePredMode( pcCU, uiAbsPartIdx ); 176 169 } … … 251 244 } 252 245 } 253 #if INTRA_BL254 if( pcCU->isIntra(uiAbsPartIdx) && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) )255 #else256 246 257 247 if( pcCU->getPredictionMode(uiAbsPartIdx) == MODE_INTRA && pcCU->getPartitionSize(uiAbsPartIdx) == SIZE_NxN && uiDepth == pcCU->getDepth(uiAbsPartIdx) ) 258 #endif259 248 { 260 249 assert( uiSubdiv ); … … 342 331 } 343 332 344 #if INTRA_BL345 #if NO_RESIDUAL_FLAG_FOR_BLPRED346 if( ( !pcCU->isIntra( uiAbsPartIdx ) || pcCU->isIntraBL(uiAbsPartIdx)) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )347 #else348 if( ( !pcCU->isIntra( uiAbsPartIdx ) ) && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) )349 #endif350 #else351 333 if( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA && uiDepth == pcCU->getDepth( uiAbsPartIdx ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_U, 0 ) && !pcCU->getCbf( uiAbsPartIdx, TEXT_CHROMA_V, 0 ) ) 352 #endif353 334 { 354 335 assert( pcCU->getCbf( uiAbsPartIdx, TEXT_LUMA, 0 ) ); … … 431 412 Void TEncEntropy::encodePredInfo( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD ) 432 413 { 433 #if INTRA_BL434 assert ( !pcCU->isIntraBL( uiAbsPartIdx ) );435 #endif436 414 if( bRD ) 437 415 { … … 607 585 UInt uiChromaOffset = uiLumaOffset>>2; 608 586 609 #if NO_RESIDUAL_FLAG_FOR_BLPRED610 if( pcCU->isIntra(uiAbsPartIdx) && !pcCU->isIntraBL(uiAbsPartIdx) )611 #else612 587 if( pcCU->isIntra(uiAbsPartIdx) ) 613 #endif614 588 { 615 589 DTRACE_CABAC_VL( g_nSymbolCounter++ ) … … 759 733 } 760 734 761 #if INTRA_BL762 Void TEncEntropy::encodeIntraBLFlag( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD )763 {764 if( pcCU->getLayerId() == 0 )765 {766 return;767 }768 769 if( bRD )770 {771 uiAbsPartIdx = 0;772 }773 m_pcEntropyCoderIf->codeIntraBLFlag( pcCU, uiAbsPartIdx );774 }775 #endif776 735 //! \} -
trunk/source/Lib/TLibEncoder/TEncEntropy.h
r313 r345 85 85 virtual Void codeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 86 86 virtual Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 87 88 #if INTRA_BL 89 virtual Void codeIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; 90 #endif 87 91 88 virtual Void codePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ) = 0; 92 89 virtual Void codePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ) = 0; … … 164 161 Void encodeMergeFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 165 162 Void encodeMergeIndex ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 166 #if INTRA_BL167 Void encodeIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false );168 #endif169 163 Void encodePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx, Bool bRD = false ); 170 164 Void encodePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth, Bool bRD = false ); -
trunk/source/Lib/TLibEncoder/TEncGOP.cpp
r313 r345 511 511 #if M0457_COL_PICTURE_SIGNALING 512 512 pcSlice->setMFMEnabledFlag(false); 513 #if !REMOVE_COL_PICTURE_SIGNALING 513 514 pcSlice->setAltColIndicationFlag(false); 515 #endif 514 516 #endif 515 517 } … … 645 647 pcSlice->setNalUnitType(NAL_UNIT_CODED_SLICE_CRA); 646 648 } 647 #if ZERO_NUM_DIRECT_LAYERS 649 648 650 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() == 0 && pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP && pcSlice->getNalUnitType() <= NAL_UNIT_CODED_SLICE_CRA ) 649 651 { 650 652 pcSlice->setSliceType(I_SLICE); 651 653 } 652 else 653 #endif 654 if( m_layerId > 0 && !m_pcEncTop->getElRapSliceTypeB() ) 654 else if( m_layerId > 0 && !m_pcEncTop->getElRapSliceTypeB() ) 655 655 { 656 656 if( (pcSlice->getNalUnitType() >= NAL_UNIT_CODED_SLICE_BLA_W_LP) && … … 760 760 761 761 #if REF_IDX_FRAMEWORK 762 #if ZERO_NUM_DIRECT_LAYERS763 762 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 764 #else765 if(m_layerId > 0)766 #endif767 763 { 768 764 #if RESTR_CHK … … 820 816 // Set reference list 821 817 #if REF_IDX_FRAMEWORK 822 #if ZERO_NUM_DIRECT_LAYERS823 818 if(m_layerId == 0 || ( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() == 0 ) ) 824 #else825 if(m_layerId == 0)826 #endif827 819 { 828 820 pcSlice->setRefPicList( rcListPic); … … 832 824 #endif 833 825 #if REF_IDX_FRAMEWORK 834 #if ZERO_NUM_DIRECT_LAYERS835 826 if( m_layerId > 0 && pcSlice->getActiveNumILRRefIdx() ) 836 #else837 if(m_layerId > 0)838 #endif839 827 { 840 828 m_pcEncTop->setILRPic(pcPic); … … 848 836 { 849 837 pcSlice->setRefPOCListILP(m_pcEncTop->getIlpList(), pcSlice->getBaseColPic()); 850 #if M0457_COL_PICTURE_SIGNALING 838 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 851 839 pcSlice->setMotionPredIlp(getMotionPredIlp(pcSlice)); 852 840 #endif … … 858 846 #if REF_IDX_MFM 859 847 #if M0457_COL_PICTURE_SIGNALING 848 #if REMOVE_COL_PICTURE_SIGNALING 849 if( pcSlice->getMFMEnabledFlag() && pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0 ) 850 #else 860 851 if( pcSlice->getMFMEnabledFlag() && !(pcSlice->getActiveNumILRRefIdx() > 0 && m_pcEncTop->getNumMotionPredRefLayers() > 0) ) 852 #endif 861 853 #else 862 854 if( pcSlice->getSPS()->getMFMEnabledFlag() ) … … 3005 2997 } 3006 2998 3007 #if M0457_COL_PICTURE_SIGNALING 2999 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 3008 3000 TComPic* TEncGOP::getMotionPredIlp(TComSlice* pcSlice) 3009 3001 { -
trunk/source/Lib/TLibEncoder/TEncGOP.h
r313 r345 198 198 } 199 199 Void dblMetric( TComPic* pcPic, UInt uiNumSlices ); 200 #if M0457_COL_PICTURE_SIGNALING 200 #if M0457_COL_PICTURE_SIGNALING && !REMOVE_COL_PICTURE_SIGNALING 201 201 TComPic* getMotionPredIlp(TComSlice* pcSlice); 202 202 #endif -
trunk/source/Lib/TLibEncoder/TEncSbac.cpp
r313 r345 83 83 , m_cTransformSkipSCModel ( 1, 2, NUM_TRANSFORMSKIP_FLAG_CTX , m_contextModels + m_numContextModels, m_numContextModels) 84 84 , m_CUTransquantBypassFlagSCModel( 1, 1, NUM_CU_TRANSQUANT_BYPASS_FLAG_CTX, m_contextModels + m_numContextModels, m_numContextModels) 85 #if INTRA_BL86 , m_cIntraBLPredFlagSCModel (1, 1, NUM_INTRA_BL_PRED_CTX , m_contextModels + m_numContextModels, m_numContextModels)87 #endif88 85 { 89 86 assert( m_numContextModels <= MAX_NUM_CTX_MOD ); … … 134 131 m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 135 132 m_cSaoMergeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_FLAG ); 136 #if INTRA_BL137 m_cIntraBLPredFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRA_BL_PRED_FLAG );138 #endif139 133 m_cSaoTypeIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX ); 140 134 m_cTransformSkipSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANSFORMSKIP_FLAG ); … … 169 163 curCost = m_cCUSplitFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SPLIT_FLAG ); 170 164 curCost += m_cCUSkipFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_SKIP_FLAG ); 171 #if INTRA_BL172 curCost += m_cIntraBLPredFlagSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_INTRA_BL_PRED_FLAG );173 #endif174 165 curCost += m_cCUMergeFlagExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_FLAG_EXT); 175 166 curCost += m_cCUMergeIdxExtSCModel.calcCost ( curSliceType, qp, (UChar*)INIT_MERGE_IDX_EXT); … … 243 234 m_cCUTransSubdivFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANS_SUBDIV_FLAG ); 244 235 m_cSaoMergeSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_MERGE_FLAG ); 245 #if INTRA_BL246 m_cIntraBLPredFlagSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_INTRA_BL_PRED_FLAG );247 #endif248 236 m_cSaoTypeIdxSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_SAO_TYPE_IDX ); 249 237 m_cTransformSkipSCModel.initBuffer ( eSliceType, iQp, (UChar*)INIT_TRANSFORMSKIP_FLAG ); … … 428 416 { 429 417 PartSize eSize = pcCU->getPartitionSize( uiAbsPartIdx ); 430 #if INTRA_BL 431 assert( !pcCU->isIntraBL( uiAbsPartIdx ) ); 432 #endif 418 433 419 if ( pcCU->isIntra( uiAbsPartIdx ) ) 434 420 { … … 1600 1586 } 1601 1587 1602 #if INTRA_BL1603 /** code intra_bl flag1604 * \param pcCU1605 * \param uiAbsPartIdx1606 * \returns Void1607 */1608 Void TEncSbac::codeIntraBLFlag( TComDataCU* pcCU, UInt uiAbsPartIdx )1609 {1610 // get context function is here1611 UInt uiSymbol = pcCU->isIntraBL( uiAbsPartIdx ) ? 1 : 0;1612 1613 UInt uiCtxIntraBL = pcCU->getCtxIntraBLFlag( uiAbsPartIdx ) ;1614 m_pcBinIf->encodeBin(uiSymbol, m_cIntraBLPredFlagSCModel.get( 0, 0, uiCtxIntraBL ));1615 1616 DTRACE_CABAC_VL( g_nSymbolCounter++ );1617 DTRACE_CABAC_T( "\tuiSymbol: ");1618 DTRACE_CABAC_V( uiSymbol );1619 DTRACE_CABAC_T( "\n");1620 }1621 #endif1622 1588 //! \} -
trunk/source/Lib/TLibEncoder/TEncSbac.h
r313 r345 132 132 Void codeSplitFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 133 133 Void codeMVPIdx ( TComDataCU* pcCU, UInt uiAbsPartIdx, RefPicList eRefList ); 134 135 #if INTRA_BL 136 Void codeIntraBLFlag ( TComDataCU* pcCU, UInt uiAbsPartIdx ); 137 #endif 134 138 135 Void codePartSize ( TComDataCU* pcCU, UInt uiAbsPartIdx, UInt uiDepth ); 139 136 Void codePredMode ( TComDataCU* pcCU, UInt uiAbsPartIdx ); … … 206 203 ContextModel3DBuffer m_cTransformSkipSCModel; 207 204 ContextModel3DBuffer m_CUTransquantBypassFlagSCModel; 208 #if INTRA_BL209 ContextModel3DBuffer m_cIntraBLPredFlagSCModel;210 #endif211 205 }; 212 206 -
trunk/source/Lib/TLibEncoder/TEncSearch.cpp
r313 r345 906 906 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 907 907 } 908 #if INTRA_BL 909 m_pcEntropyCoder->encodeIntraBLFlag ( pcCU, 0, true ); 910 if( pcCU->isIntraBL( 0 ) ) 911 { 912 return; 913 } 914 #endif 908 915 909 m_pcEntropyCoder ->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 916 910 … … 950 944 } 951 945 } 952 #if INTRA_BL 953 if( pcCU->isIntraBL( 0 ) ) 954 { 955 return; 956 } 957 #endif 946 958 947 if( bChroma ) 959 948 { … … 1055 1044 pcCU->getPattern()->initAdiPattern( pcCU, uiAbsPartIdx, uiTrDepth, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail ); 1056 1045 //===== get prediction signal ===== 1057 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED1058 if(pcCU->isIntraBL ( uiAbsPartIdx ) )1059 {1060 pcCU->getBaseLumaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride );1061 }1062 else1063 #endif1064 1046 predIntraLumaAng( pcCU->getPattern(), uiLumaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1065 1047 // save prediction … … 1247 1229 1248 1230 //===== get prediction signal ===== 1249 #if INTRA_BL && !NO_RESIDUAL_FLAG_FOR_BLPRED 1250 if(pcCU->isIntraBL ( uiAbsPartIdx ) ) 1251 { 1252 pcCU->getBaseChromaBlk( uiWidth, uiHeight, uiAbsPartIdx, piPred, uiStride, uiChromaId ); 1253 } 1254 else 1255 #endif 1256 { 1257 predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1258 } 1231 predIntraChromaAng( pPatChroma, uiChromaPredMode, piPred, uiStride, uiWidth, uiHeight, bAboveAvail, bLeftAvail ); 1232 1259 1233 // save prediction 1260 1234 if( default0Save1Load2 == 1 ) … … 4567 4541 Void TEncSearch::encodeResAndCalcRdInterCU( TComDataCU* pcCU, TComYuv* pcYuvOrg, TComYuv* pcYuvPred, TComYuv*& rpcYuvResi, TComYuv*& rpcYuvResiBest, TComYuv*& rpcYuvRec, Bool bSkipRes ) 4568 4542 { 4569 #if NO_RESIDUAL_FLAG_FOR_BLPRED4570 if ( pcCU->isIntra(0) && !pcCU->isIntraBL(0))4571 #else4572 4543 if ( pcCU->isIntra(0) ) 4573 #endif4574 4544 { 4575 4545 return; … … 4682 4652 pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) ); 4683 4653 } 4684 #if NO_RESIDUAL_FLAG_FOR_BLPRED4685 else if(pcCU->getLayerId() > 0 && pcCU->isIntraBL(0) && uiZeroDistortion == uiDistortion) // all zeros4686 {4687 const UInt uiQPartNum = pcCU->getPic()->getNumPartInCU() >> (pcCU->getDepth(0) << 1);4688 ::memset( pcCU->getTransformIdx() , 0, uiQPartNum * sizeof(UChar) );4689 ::memset( pcCU->getCbf( TEXT_LUMA ) , 0, uiQPartNum * sizeof(UChar) );4690 ::memset( pcCU->getCbf( TEXT_CHROMA_U ), 0, uiQPartNum * sizeof(UChar) );4691 ::memset( pcCU->getCbf( TEXT_CHROMA_V ), 0, uiQPartNum * sizeof(UChar) );4692 ::memset( pcCU->getCoeffY() , 0, uiWidth * uiHeight * sizeof( TCoeff ) );4693 ::memset( pcCU->getCoeffCb() , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );4694 ::memset( pcCU->getCoeffCr() , 0, uiWidth * uiHeight * sizeof( TCoeff ) >> 2 );4695 pcCU->setTransformSkipSubParts ( 0, 0, 0, 0, pcCU->getDepth(0) );4696 }4697 #endif4698 4654 else 4699 4655 { … … 4994 4950 Int scalingListType = 3 + g_eTTable[(Int)TEXT_LUMA]; 4995 4951 assert(scalingListType < 6); 4996 #if NO_RESIDUAL_FLAG_FOR_BLPRED4997 if(pcCU->isIntraBL(uiAbsPartIdx) )4998 {4999 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only5000 }5001 else5002 {5003 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only5004 }5005 #else5006 4952 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType );//this is for inter mode only 5007 #endif5008 5009 4953 const UInt uiNonzeroDistY = m_pcRdCost->getDistPart(g_bitDepthY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), 5010 4954 pcResi->getLumaAddr( absTUPartIdx ), pcResi->getStride(), trWidth,trHeight ); … … 5275 5219 assert(scalingListType < 6); 5276 5220 5277 #if NO_RESIDUAL_FLAG_FOR_BLPRED5278 if(pcCU->isIntraBL(uiAbsPartIdx) )5279 {5280 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,DC_IDX, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType, true );5281 }5282 else5283 {5284 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType, true );5285 }5286 #else5287 5221 m_pcTrQuant->invtransformNxN( pcCU->getCUTransquantBypass(uiAbsPartIdx), TEXT_LUMA,REG_DCT, pcResiCurrY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), pcCoeffCurrY, trWidth, trHeight, scalingListType, true ); 5288 #endif5289 5222 5290 5223 uiNonzeroDistY = m_pcRdCost->getDistPart(g_bitDepthY, m_pcQTTempTComYuv[uiQTTempAccessLayer].getLumaAddr( absTUPartIdx ), m_pcQTTempTComYuv[uiQTTempAccessLayer].getStride(), … … 5617 5550 5618 5551 { 5619 #if INTRA_BL5620 #if NO_RESIDUAL_FLAG_FOR_BLPRED5621 assert( !pcCU->isIntra(uiAbsPartIdx) || pcCU->isIntraBL(uiAbsPartIdx));5622 #else5623 assert( !pcCU->isIntra(uiAbsPartIdx) );5624 #endif5625 #else5626 5552 assert( pcCU->getPredictionMode(uiAbsPartIdx) != MODE_INTRA ); 5627 #endif5628 5553 if( bSubdivAndCbf ) 5629 5554 { … … 5859 5784 } 5860 5785 m_pcEntropyCoder->encodeSkipFlag ( pcCU, 0, true ); 5861 #if INTRA_BL5862 if(m_pcEncCfg->getLayerId())5863 {5864 m_pcEntropyCoder->encodeIntraBLFlag(pcCU, 0, true);5865 #if !NO_RESIDUAL_FLAG_FOR_BLPRED5866 assert( pcCU->isIntraBL( 0 ) == false );5867 #endif5868 }5869 #endif5870 #if NO_RESIDUAL_FLAG_FOR_BLPRED5871 if( !pcCU->isIntraBL(0))5872 {5873 #endif5874 5786 m_pcEntropyCoder->encodePredMode( pcCU, 0, true ); 5875 5787 m_pcEntropyCoder->encodePartSize( pcCU, 0, pcCU->getDepth(0), true ); 5876 5788 m_pcEntropyCoder->encodePredInfo( pcCU, 0, true ); 5877 #if NO_RESIDUAL_FLAG_FOR_BLPRED 5878 } 5879 #endif 5789 5880 5790 Bool bDummy = false; 5881 5791 m_pcEntropyCoder->encodeCoeff ( pcCU, 0, pcCU->getDepth(0), pcCU->getWidth(0), pcCU->getHeight(0), bDummy ); … … 6295 6205 #endif 6296 6206 6297 #if INTRA_BL6298 Void6299 TEncSearch::estIntraBLPredQT( TComDataCU* pcCU,6300 TComYuv* pcOrgYuv,6301 TComYuv* pcPredYuv,6302 TComYuv* pcResiYuv,6303 TComYuv* pcRecoYuv )6304 {6305 UInt uiDepth = pcCU->getDepth(0);6306 UInt uiOverallDistY = 0;6307 UInt uiOverallDistC = 0;6308 6309 //===== set QP and clear Cbf =====6310 if ( pcCU->getSlice()->getPPS()->getUseDQP() == true)6311 {6312 pcCU->setQPSubParts( pcCU->getQP(0), 0, uiDepth );6313 }6314 else6315 {6316 pcCU->setQPSubParts( pcCU->getSlice()->getSliceQp(), 0, uiDepth );6317 }6318 6319 //===== init pattern for luma prediction =====6320 Bool bAboveAvail = false;6321 Bool bLeftAvail = false;6322 pcCU->getPattern()->initPattern ( pcCU, 0, 0 );6323 pcCU->getPattern()->initAdiPattern( pcCU, 0, 0, m_piYuvExt, m_iYuvExtStride, m_iYuvExtHeight, bAboveAvail, bLeftAvail );6324 6325 pcCU->setLumaIntraDirSubParts ( DC_IDX, 0, uiDepth );6326 6327 // set context models6328 if( m_bUseSBACRD )6329 {6330 m_pcRDGoOnSbacCoder->load( m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST] );6331 }6332 6333 // determine residual for partition6334 Double dPUCost = 0.0;6335 xRecurIntraCodingQT( pcCU, 0, 0, false, pcOrgYuv, pcPredYuv, pcResiYuv, uiOverallDistY, uiOverallDistC, false, dPUCost );6336 xSetIntraResultQT( pcCU, 0, 0, false, pcRecoYuv );6337 6338 //=== update PU data ====6339 pcCU->copyToPic( uiDepth, 0, 0 );6340 6341 //===== reset context models =====6342 if(m_bUseSBACRD)6343 {6344 m_pcRDGoOnSbacCoder->load(m_pppcRDSbacCoder[uiDepth][CI_CURR_BEST]);6345 }6346 6347 //===== set distortion (rate and r-d costs are determined later) =====6348 pcCU->getTotalDistortion() = uiOverallDistY + uiOverallDistC;6349 }6350 6351 #endif6352 6207 //! \} -
trunk/source/Lib/TLibEncoder/TEncSearch.h
r313 r345 99 99 #if SVC_EXTENSION 100 100 TEncTop** m_ppcTEncTop; 101 #if INTRA_BL102 TComPicYuv* m_pcPicYuvRecBase; ///< reconstructed base layer103 #endif104 101 #endif 105 102 … … 192 189 TComYuv* pcRecoYuv, 193 190 UInt uiPreCalcDistC ); 194 195 #if INTRA_BL196 Void setBaseRecPic ( TComPicYuv* pcPicYuvRecBase ) { m_pcPicYuvRecBase = pcPicYuvRecBase; }197 TComPicYuv* getBaseRecPic () { return m_pcPicYuvRecBase; }198 Void estIntraBLPredQT ( TComDataCU* pcCU,199 TComYuv* pcOrgYuv,200 TComYuv* pcPredYuv,201 TComYuv* pcResiYuv,202 TComYuv* pcRecoYuv );203 #endif204 191 205 192 /// encoder estimation - inter prediction (non-skip) -
trunk/source/Lib/TLibEncoder/TEncSlice.cpp
r314 r345 345 345 346 346 #if JCTVC_M0259_LAMBDAREFINEMENT 347 if( rpcSlice->getLayerId() > 0 && rpcSlice->getActiveNumILRRefIdx() && depth >= 3 && m_pcCfg->getGOPSize() == ( 1 << depth ) )347 if( rpcSlice->getLayerId() > 0 && m_ppcTEncTop[layerId]->getNumActiveRefLayers() && depth >= 3 && m_pcCfg->getGOPSize() == ( 1 << depth ) ) 348 348 { 349 349 Int nCurLayer = rpcSlice->getLayerId(); … … 373 373 weight = pow( 2.0, (iQP-g_aucChromaScale[qpc])/3.0 ); // takes into account of the chroma qp mapping and chroma qp Offset 374 374 #if JCTVC_M0259_LAMBDAREFINEMENT 375 if( rpcSlice->getLayerId() > 0 && rpcSlice->getActiveNumILRRefIdx() && m_pcCfg->getGOPSize() >= 8 && rpcSlice->isIntra() == false && depth == 0 )375 if( rpcSlice->getLayerId() > 0 && m_ppcTEncTop[layerId]->getNumActiveRefLayers() && m_pcCfg->getGOPSize() >= 8 && rpcSlice->isIntra() == false && depth == 0 ) 376 376 { 377 377 dLambda *= 1.1; … … 503 503 #if M0457_COL_PICTURE_SIGNALING 504 504 rpcSlice->setMFMEnabledFlag(m_ppcTEncTop[layerId]->getMFMEnabledFlag()); 505 #if !REMOVE_COL_PICTURE_SIGNALING 505 506 rpcSlice->setAltColIndicationFlag(rpcSlice->getMFMEnabledFlag()); 507 #endif 506 508 #endif 507 509 } … … 979 981 UInt uiTileStartLCU = 0; 980 982 UInt uiTileLCUX = 0; 981 982 #if INTRA_BL983 m_pcCuEncoder->setBaseRecPic( rpcPic->getLayerId() > 0 ? rpcPic->getFullPelBaseRec(rpcPic->getLayerId()-1) : NULL);984 #endif985 983 986 984 Bool depSliceSegmentsEnabled = pcSlice->getPPS()->getDependentSliceSegmentsEnabledFlag(); -
trunk/source/Lib/TLibEncoder/TEncTop.cpp
r313 r345 886 886 for( Int i = 0; i < getGOPSize()+m_extraRPSs; i++) 887 887 { 888 #if FINAL_RPL_CHANGE_N0082 889 GOPEntry ge = m_ppcTEncTop[m_cSPS.getLayerId()]->getGOPEntry(i); 890 #else 888 891 GOPEntry ge = getGOPEntry(i); 892 #endif 889 893 rps = rpsList->getReferencePictureSet(i); 890 894 rps->setNumberOfPictures(ge.m_numRefPics); … … 1204 1208 if( m_ppcTEncTop[m_layerId]->getNumDirectRefLayers() <= 0 ) 1205 1209 { 1206 #if ZERO_NUM_DIRECT_LAYERS1207 1210 return (TEncTop *)getLayerEnc( 0 ); 1208 #else1209 return NULL;1210 #endif1211 1211 } 1212 1212
Note: See TracChangeset for help on using the changeset viewer.