- Timestamp:
- 22 Mar 2016, 23:52:56 (9 years ago)
- Location:
- branches/SHM-dev/source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.cpp
r1544 r1545 196 196 in>>entry.m_POC; 197 197 in>>entry.m_QPOffset; 198 #if W0038_CQP_ADJ 199 in>>entry.m_CbQPoffset; 200 in>>entry.m_CrQPoffset; 201 #endif 198 202 in>>entry.m_QPFactor; 199 203 in>>entry.m_tcOffsetDiv2; … … 1303 1307 ("CbQpOffset,-cbqpofs", m_cbQpOffset, 0, "Chroma Cb QP Offset") 1304 1308 ("CrQpOffset,-crqpofs", m_crQpOffset, 0, "Chroma Cr QP Offset") 1305 1309 #if W0038_CQP_ADJ 1310 ("SliceChromaQPOffsetPeriodicity", m_sliceChromaQpOffsetPeriodicity, 0u, "Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature.") 1311 ("SliceCbQpOffsetIntraOrPeriodic", m_sliceChromaQpOffsetIntraOrPeriodic[0], 0, "Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table.") 1312 ("SliceCrQpOffsetIntraOrPeriodic", m_sliceChromaQpOffsetIntraOrPeriodic[1], 0, "Chroma Cr QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table.") 1313 #endif 1306 1314 #if ADAPTIVE_QP_SELECTION 1307 1315 ("AdaptiveQpSelection,-aqps", m_bUseAdaptQpSelect, false, "AdaptiveQpSelection") … … 1327 1335 ("LoopFilterBetaOffset_div2", m_loopFilterBetaOffsetDiv2, 0) 1328 1336 ("LoopFilterTcOffset_div2", m_loopFilterTcOffsetDiv2, 0) 1337 #if W0038_DB_OPT 1338 ("DeblockingFilterMetric", m_deblockingFilterMetric, 0) 1339 #else 1329 1340 ("DeblockingFilterMetric", m_DeblockingFilterMetric, false) 1330 1341 #endif 1331 1342 // Coding tools 1332 1343 ("AMP", m_enableAMP, true, "Enable asymmetric motion partitions") … … 3430 3441 3431 3442 xConfirmPara( m_iQP < -6 * (m_internalBitDepth[CHANNEL_TYPE_LUMA] - 8) || m_iQP > 51, "QP exceeds supported range (-QpBDOffsety to 51)" ); 3443 #if W0038_DB_OPT 3444 xConfirmPara( m_deblockingFilterMetric!=0 && (m_bLoopFilterDisable || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is non-zero then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0"); 3445 #else 3432 3446 xConfirmPara( m_DeblockingFilterMetric && (m_bLoopFilterDisable || m_loopFilterOffsetInPPS), "If DeblockingFilterMetric is true then both LoopFilterDisable and LoopFilterOffsetInPPS must be 0"); 3447 #endif 3433 3448 xConfirmPara( m_loopFilterBetaOffsetDiv2 < -6 || m_loopFilterBetaOffsetDiv2 > 6, "Loop Filter Beta Offset div. 2 exceeds supported range (-6 to 6)"); 3434 3449 xConfirmPara( m_loopFilterTcOffsetDiv2 < -6 || m_loopFilterTcOffsetDiv2 > 6, "Loop Filter Tc Offset div. 2 exceeds supported range (-6 to 6)"); … … 3611 3626 } 3612 3627 } 3628 3629 #if W0038_CQP_ADJ 3630 for(Int i=0; i<m_iGOPSize; i++) 3631 { 3632 xConfirmPara( abs(m_GOPList[i].m_CbQPoffset ) > 12, "Cb QP Offset for one of the GOP entries exceeds supported range (-12 to 12)" ); 3633 xConfirmPara( abs(m_GOPList[i].m_CbQPoffset + m_cbQpOffset) > 12, "Cb QP Offset for one of the GOP entries, when combined with the PPS Cb offset, exceeds supported range (-12 to 12)" ); 3634 xConfirmPara( abs(m_GOPList[i].m_CrQPoffset ) > 12, "Cr QP Offset for one of the GOP entries exceeds supported range (-12 to 12)" ); 3635 xConfirmPara( abs(m_GOPList[i].m_CrQPoffset + m_crQpOffset) > 12, "Cr QP Offset for one of the GOP entries, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" ); 3636 } 3637 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] > 12), "Intra/periodic Cb QP Offset exceeds supported range (-12 to 12)" ); 3638 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[0] + m_cbQpOffset > 12), "Intra/periodic Cb QP Offset, when combined with the PPS Cb offset, exceeds supported range (-12 to 12)" ); 3639 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] > 12), "Intra/periodic Cr QP Offset exceeds supported range (-12 to 12)" ); 3640 xConfirmPara( abs(m_sliceChromaQpOffsetIntraOrPeriodic[1] + m_crQpOffset > 12), "Intra/periodic Cr QP Offset, when combined with the PPS Cr offset, exceeds supported range (-12 to 12)" ); 3641 #endif 3613 3642 3614 3643 m_extraRPSs=0; -
branches/SHM-dev/source/App/TAppEncoder/TAppEncCfg.h
r1544 r1545 262 262 Int m_cbQpOffset; ///< Chroma Cb QP Offset (0:default) 263 263 Int m_crQpOffset; ///< Chroma Cr QP Offset (0:default) 264 264 #if W0038_CQP_ADJ 265 UInt m_sliceChromaQpOffsetPeriodicity; ///< Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature. 266 Int m_sliceChromaQpOffsetIntraOrPeriodic[2/*Cb,Cr*/]; ///< Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table. 267 #endif 265 268 #if ADAPTIVE_QP_SELECTION 266 269 Bool m_bUseAdaptQpSelect; … … 324 327 Int m_loopFilterBetaOffsetDiv2; ///< beta offset for deblocking filter 325 328 Int m_loopFilterTcOffsetDiv2; ///< tc offset for deblocking filter 329 #if W0038_DB_OPT 330 Int m_deblockingFilterMetric; ///< blockiness metric in encoder 331 #else 326 332 Bool m_DeblockingFilterMetric; ///< blockiness metric in encoder 327 333 #endif 328 334 // coding tools (PCM) 329 335 Bool m_usePCM; ///< flag for using IPCM -
branches/SHM-dev/source/App/TAppEncoder/TAppEncTop.cpp
r1544 r1545 603 603 m_cTEncTop.setLoopFilterBetaOffset ( m_loopFilterBetaOffsetDiv2 ); 604 604 m_cTEncTop.setLoopFilterTcOffset ( m_loopFilterTcOffsetDiv2 ); 605 #if W0038_DB_OPT 606 m_cTEncTop.setDeblockingFilterMetric ( m_deblockingFilterMetric ); 607 #else 605 608 m_cTEncTop.setDeblockingFilterMetric ( m_DeblockingFilterMetric ); 609 #endif 606 610 607 611 //====== Motion search ======== … … 621 625 m_cTEncTop.setChromaCbQpOffset ( m_cbQpOffset ); 622 626 m_cTEncTop.setChromaCrQpOffset ( m_crQpOffset ); 623 627 #if W0038_CQP_ADJ 628 m_cTEncTop.setSliceChromaOffsetQpIntraOrPeriodic ( m_sliceChromaQpOffsetPeriodicity, m_sliceChromaQpOffsetIntraOrPeriodic ); 629 #endif 624 630 m_cTEncTop.setChromaFormatIdc ( m_chromaFormatIDC ); 625 631 -
branches/SHM-dev/source/Lib/TLibCommon/CommonDef.h
r1543 r1545 257 257 static const Int LAST_SIGNIFICANT_GROUPS = 10 ; 258 258 259 #if W0038_DB_OPT 260 static const Int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS = 8 ; 261 #endif 262 259 263 #if SVC_EXTENSION 260 264 static const Int CGS_FILTER_LENGTH = 13; -
branches/SHM-dev/source/Lib/TLibCommon/TypeDef.h
r1538 r1545 209 209 #define V0078_ADAPTIVE_LOWER_BOUND 1 ///< Target bits saturation with adaptive lower bound 210 210 #endif 211 #define W0038_DB_OPT 1 ///< adaptive DB parameter selection, LoopFilterOffsetInPPS and LoopFilterDisable are set to 0 and DeblockingFilterMetric=2; 212 #define W0038_CQP_ADJ 1 ///< chroma QP adjustment based on TL, CQPTLAdjustEnabled is set to 1; 211 213 212 214 // ==================================================================================================================== -
branches/SHM-dev/source/Lib/TLibEncoder/TEncCfg.h
r1544 r1545 51 51 Int m_POC; 52 52 Int m_QPOffset; 53 #if W0038_CQP_ADJ 54 Int m_CbQPoffset; 55 Int m_CrQPoffset; 56 #endif 53 57 Double m_QPFactor; 54 58 Int m_tcOffsetDiv2; … … 69 73 : m_POC(-1) 70 74 , m_QPOffset(0) 75 #if W0038_CQP_ADJ 76 , m_CbQPoffset(0) 77 , m_CrQPoffset(0) 78 #endif 71 79 , m_QPFactor(0) 72 80 , m_tcOffsetDiv2(0) … … 132 140 133 141 //====== Coding Structure ======== 134 UInt m_uiIntraPeriod; 142 UInt m_uiIntraPeriod; // TODO: make this an Int - it can be -1! 135 143 UInt m_uiDecodingRefreshType; ///< the type of decoding refresh employed for the random access. 136 144 Int m_iGOPSize; … … 167 175 Int m_loopFilterBetaOffsetDiv2; 168 176 Int m_loopFilterTcOffsetDiv2; 177 #if W0038_DB_OPT 178 Int m_deblockingFilterMetric; 179 #else 169 180 Bool m_DeblockingFilterMetric; 181 #endif 170 182 Bool m_bUseSAO; 171 183 Bool m_bTestSAODisableAtPictureLevel; … … 192 204 Int m_chromaCbQpOffset; // Chroma Cb QP Offset (0:default) 193 205 Int m_chromaCrQpOffset; // Chroma Cr Qp Offset (0:default) 206 #if W0038_CQP_ADJ 207 UInt m_sliceChromaQpOffsetPeriodicity; ///< Used in conjunction with Slice Cb/Cr QpOffsetIntraOrPeriodic. Use 0 (default) to disable periodic nature. 208 Int m_sliceChromaQpOffsetIntraOrPeriodic[2/*Cb,Cr*/]; ///< Chroma Cb QP Offset at slice level for I slice or for periodic inter slices as defined by SliceChromaQPOffsetPeriodicity. Replaces offset in the GOP table. 209 #endif 210 194 211 ChromaFormat m_chromaFormatIDC; 195 212 … … 570 587 Void setLoopFilterBetaOffset ( Int i ) { m_loopFilterBetaOffsetDiv2 = i; } 571 588 Void setLoopFilterTcOffset ( Int i ) { m_loopFilterTcOffsetDiv2 = i; } 589 #if W0038_DB_OPT 590 Void setDeblockingFilterMetric ( Int i ) { m_deblockingFilterMetric = i; } 591 #else 572 592 Void setDeblockingFilterMetric ( Bool b ) { m_DeblockingFilterMetric = b; } 573 593 #endif 574 594 //====== Motion search ======== 575 595 Void setDisableIntraPUsInInterSlices ( Bool b ) { m_bDisableIntraPUsInInterSlices = b; } … … 591 611 Void setChromaCbQpOffset ( Int i ) { m_chromaCbQpOffset = i; } 592 612 Void setChromaCrQpOffset ( Int i ) { m_chromaCrQpOffset = i; } 613 #if W0038_CQP_ADJ 614 Void setSliceChromaOffsetQpIntraOrPeriodic( UInt periodicity, Int sliceChromaQpOffsetIntraOrPeriodic[2]) { m_sliceChromaQpOffsetPeriodicity = periodicity; memcpy(m_sliceChromaQpOffsetIntraOrPeriodic, sliceChromaQpOffsetIntraOrPeriodic, sizeof(m_sliceChromaQpOffsetIntraOrPeriodic)); } 615 Int getSliceChromaOffsetQpIntraOrPeriodic( Bool bIsCr) const { return m_sliceChromaQpOffsetIntraOrPeriodic[bIsCr?1:0]; } 616 UInt getSliceChromaOffsetQpPeriodicity() const { return m_sliceChromaQpOffsetPeriodicity; } 617 #endif 593 618 594 619 Void setChromaFormatIdc ( ChromaFormat cf ) { m_chromaFormatIDC = cf; } … … 649 674 Int getLoopFilterBetaOffset () { return m_loopFilterBetaOffsetDiv2; } 650 675 Int getLoopFilterTcOffset () { return m_loopFilterTcOffsetDiv2; } 676 #if W0038_DB_OPT 677 Int getDeblockingFilterMetric () { return m_deblockingFilterMetric; } 678 #else 651 679 Bool getDeblockingFilterMetric () { return m_DeblockingFilterMetric; } 680 #endif 652 681 653 682 //==== Motion search ======== -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.cpp
r1544 r1545 105 105 m_associatedIRAPType = NAL_UNIT_CODED_SLICE_IDR_N_LP; 106 106 m_associatedIRAPPOC = 0; 107 #if W0038_DB_OPT 108 m_pcDeblockingTempPicYuv = NULL; 109 #endif 107 110 #if SVC_EXTENSION 108 111 m_pocCraWithoutReset = 0; … … 156 159 Void TEncGOP::destroy() 157 160 { 161 #if W0038_DB_OPT 162 if (m_pcDeblockingTempPicYuv) 163 { 164 m_pcDeblockingTempPicYuv->destroy(); 165 delete m_pcDeblockingTempPicYuv; 166 m_pcDeblockingTempPicYuv = NULL; 167 } 168 #endif 158 169 } 159 170 … … 2491 2502 if ( m_pcCfg->getDeblockingFilterMetric() ) 2492 2503 { 2493 applyDeblockingFilterMetric(pcPic, uiNumSliceSegments); 2504 #if W0038_DB_OPT 2505 if ( m_pcCfg->getDeblockingFilterMetric()==2 ) 2506 { 2507 applyDeblockingFilterParameterSelection(pcPic, uiNumSliceSegments, iGOPid); 2508 } 2509 else 2510 { 2511 #endif 2512 applyDeblockingFilterMetric(pcPic, uiNumSliceSegments); 2513 #if W0038_DB_OPT 2514 } 2515 #endif 2494 2516 } 2495 2517 m_pcLoopFilter->loopFilterPic( pcPic ); … … 3691 3713 } 3692 3714 3715 #if W0038_DB_OPT 3716 Void TEncGOP::applyDeblockingFilterParameterSelection( TComPic* pcPic, const UInt numSlices, const Int gopID ) 3717 { 3718 enum DBFltParam 3719 { 3720 DBFLT_PARAM_AVAILABLE = 0, 3721 DBFLT_DISABLE_FLAG, 3722 DBFLT_BETA_OFFSETD2, 3723 DBFLT_TC_OFFSETD2, 3724 //NUM_DBFLT_PARAMS 3725 }; 3726 const Int MAX_BETA_OFFSET = 3; 3727 const Int MIN_BETA_OFFSET = -3; 3728 const Int MAX_TC_OFFSET = 3; 3729 const Int MIN_TC_OFFSET = -3; 3730 3731 TComPicYuv* pcPicYuvRec = pcPic->getPicYuvRec(); 3732 TComPicYuv* pcPicYuvOrg = pcPic ->getPicYuvOrg(); 3733 3734 const Int currQualityLayer = (pcPic->getSlice(0)->getSliceType() != I_SLICE) ? m_pcCfg->getGOPEntry(gopID).m_temporalId+1 : 0; 3735 assert(currQualityLayer <MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS); 3736 3737 if(!m_pcDeblockingTempPicYuv) 3738 { 3739 m_pcDeblockingTempPicYuv = new TComPicYuv; 3740 m_pcDeblockingTempPicYuv->create( m_pcEncTop->getSourceWidth(), m_pcEncTop->getSourceHeight(), m_pcEncTop->getChromaFormatIdc(), pcPic->getSlice(0)->getSPS()->getMaxCUWidth(), pcPic->getSlice(0)->getSPS()->getMaxCUHeight(), pcPic->getSlice(0)->getSPS()->getMaxTotalCUDepth(),true ); 3741 memset(m_DBParam, 0, sizeof(m_DBParam)); 3742 } 3743 3744 //preserve current reconstruction 3745 pcPicYuvRec->copyToPic(m_pcDeblockingTempPicYuv); 3746 3747 const Bool bNoFiltering = m_DBParam[currQualityLayer][DBFLT_PARAM_AVAILABLE] && m_DBParam[currQualityLayer][DBFLT_DISABLE_FLAG]==false /*&& pcPic->getTLayer()==0*/; 3748 const Int maxBetaOffsetDiv2 = bNoFiltering? Clip3(MIN_BETA_OFFSET, MAX_BETA_OFFSET, m_DBParam[currQualityLayer][DBFLT_BETA_OFFSETD2]+1) : MAX_BETA_OFFSET; 3749 const Int minBetaOffsetDiv2 = bNoFiltering? Clip3(MIN_BETA_OFFSET, MAX_BETA_OFFSET, m_DBParam[currQualityLayer][DBFLT_BETA_OFFSETD2]-1) : MIN_BETA_OFFSET; 3750 const Int maxTcOffsetDiv2 = bNoFiltering? Clip3(MIN_TC_OFFSET, MAX_TC_OFFSET, m_DBParam[currQualityLayer][DBFLT_TC_OFFSETD2]+2) : MAX_TC_OFFSET; 3751 const Int minTcOffsetDiv2 = bNoFiltering? Clip3(MIN_TC_OFFSET, MAX_TC_OFFSET, m_DBParam[currQualityLayer][DBFLT_TC_OFFSETD2]-2) : MIN_TC_OFFSET; 3752 3753 UInt64 distBetaPrevious = std::numeric_limits<UInt64>::max(); 3754 UInt64 distMin = std::numeric_limits<UInt64>::max(); 3755 Bool bDBFilterDisabledBest = true; 3756 Int betaOffsetDiv2Best = 0; 3757 Int tcOffsetDiv2Best = 0; 3758 3759 for(Int betaOffsetDiv2=maxBetaOffsetDiv2; betaOffsetDiv2>=minBetaOffsetDiv2; betaOffsetDiv2--) 3760 { 3761 UInt64 distTcMin = std::numeric_limits<UInt64>::max(); 3762 for(Int tcOffsetDiv2=maxTcOffsetDiv2; tcOffsetDiv2 >= minTcOffsetDiv2; tcOffsetDiv2--) 3763 { 3764 for (Int i=0; i<numSlices; i++) 3765 { 3766 pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(true); 3767 pcPic->getSlice(i)->setDeblockingFilterDisable(false); 3768 pcPic->getSlice(i)->setDeblockingFilterBetaOffsetDiv2( betaOffsetDiv2 ); 3769 pcPic->getSlice(i)->setDeblockingFilterTcOffsetDiv2( tcOffsetDiv2 ); 3770 } 3771 m_pcDeblockingTempPicYuv->copyToPic(pcPicYuvRec); // restore reconstruction 3772 m_pcLoopFilter->loopFilterPic( pcPic ); 3773 const UInt64 dist = xFindDistortionFrame(pcPicYuvOrg, pcPicYuvRec, pcPic->getPicSym()->getSPS().getBitDepths()); 3774 if(dist < distMin) 3775 { 3776 distMin = dist; 3777 bDBFilterDisabledBest = false; 3778 betaOffsetDiv2Best = betaOffsetDiv2; 3779 tcOffsetDiv2Best = tcOffsetDiv2; 3780 } 3781 if(dist < distTcMin) 3782 { 3783 distTcMin = dist; 3784 } 3785 else if(tcOffsetDiv2 <-2) 3786 { 3787 break; 3788 } 3789 } 3790 if(betaOffsetDiv2<-1 && distTcMin >= distBetaPrevious) 3791 { 3792 break; 3793 } 3794 distBetaPrevious = distTcMin; 3795 } 3796 3797 //update: 3798 m_DBParam[currQualityLayer][DBFLT_PARAM_AVAILABLE] = 1; 3799 m_DBParam[currQualityLayer][DBFLT_DISABLE_FLAG] = bDBFilterDisabledBest; 3800 m_DBParam[currQualityLayer][DBFLT_BETA_OFFSETD2] = betaOffsetDiv2Best; 3801 m_DBParam[currQualityLayer][DBFLT_TC_OFFSETD2] = tcOffsetDiv2Best; 3802 3803 m_pcDeblockingTempPicYuv->copyToPic(pcPicYuvRec); //restore reconstruction 3804 3805 if(bDBFilterDisabledBest) 3806 { 3807 for (Int i=0; i<numSlices; i++) 3808 { 3809 pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(true); 3810 pcPic->getSlice(i)->setDeblockingFilterDisable(true); 3811 } 3812 } 3813 else if(betaOffsetDiv2Best ==pcPic->getSlice(0)->getPPS()->getDeblockingFilterBetaOffsetDiv2() && tcOffsetDiv2Best==pcPic->getSlice(0)->getPPS()->getDeblockingFilterTcOffsetDiv2()) 3814 { 3815 for (Int i=0; i<numSlices; i++) 3816 { 3817 pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(false); 3818 pcPic->getSlice(i)->setDeblockingFilterDisable( pcPic->getSlice(i)->getPPS()->getPicDisableDeblockingFilterFlag() ); 3819 pcPic->getSlice(i)->setDeblockingFilterBetaOffsetDiv2( pcPic->getSlice(i)->getPPS()->getDeblockingFilterBetaOffsetDiv2() ); 3820 pcPic->getSlice(i)->setDeblockingFilterTcOffsetDiv2( pcPic->getSlice(i)->getPPS()->getDeblockingFilterTcOffsetDiv2() ); 3821 } 3822 } 3823 else 3824 { 3825 for (Int i=0; i<numSlices; i++) 3826 { 3827 pcPic->getSlice(i)->setDeblockingFilterOverrideFlag(true); 3828 pcPic->getSlice(i)->setDeblockingFilterDisable( false ); 3829 pcPic->getSlice(i)->setDeblockingFilterBetaOffsetDiv2(betaOffsetDiv2Best); 3830 pcPic->getSlice(i)->setDeblockingFilterTcOffsetDiv2(tcOffsetDiv2Best); 3831 } 3832 } 3833 } 3834 #endif 3835 3693 3836 #if SVC_EXTENSION 3694 3837 #if N0383_IL_CONSTRAINED_TILE_SETS_SEI -
branches/SHM-dev/source/Lib/TLibEncoder/TEncGOP.h
r1502 r1545 137 137 Bool m_bufferingPeriodSEIPresentInAU; 138 138 SEIEncoder m_seiEncoder; 139 #if W0038_DB_OPT 140 TComPicYuv* m_pcDeblockingTempPicYuv; 141 Int m_DBParam[MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS][4]; //[layer_id][0: available; 1: bDBDisabled; 2: Beta Offset Div2; 3: Tc Offset Div2;] 142 #endif 139 143 140 144 #if SVC_EXTENSION … … 270 274 271 275 Void applyDeblockingFilterMetric( TComPic* pcPic, UInt uiNumSlices ); 276 #if W0038_DB_OPT 277 Void applyDeblockingFilterParameterSelection( TComPic* pcPic, const UInt numSlices, const Int gopID ); 278 #endif 272 279 273 280 #if SVC_EXTENSION -
branches/SHM-dev/source/Lib/TLibEncoder/TEncSlice.cpp
r1540 r1545 391 391 const std::vector<Double> &intraLambdaModifiers=m_pcCfg->getIntraLambdaModifier(); 392 392 393 #if W0038_CQP_ADJ 394 if(rpcSlice->getPPS()->getSliceChromaQpFlag()) 395 { 396 const Bool bUseIntraOrPeriodicOffset = rpcSlice->getSliceType()==I_SLICE || (m_pcCfg->getSliceChromaOffsetQpPeriodicity()!=0 && (rpcSlice->getPOC()%m_pcCfg->getSliceChromaOffsetQpPeriodicity())==0); 397 Int cbQP = bUseIntraOrPeriodicOffset? m_pcCfg->getSliceChromaOffsetQpIntraOrPeriodic(false) : m_pcCfg->getGOPEntry(iGOPid).m_CbQPoffset; 398 Int crQP = bUseIntraOrPeriodicOffset? m_pcCfg->getSliceChromaOffsetQpIntraOrPeriodic(true) : m_pcCfg->getGOPEntry(iGOPid).m_CrQPoffset; 399 400 cbQP = Clip3( -12, 12, cbQP + rpcSlice->getPPS()->getQpOffset(COMPONENT_Cb) ) - rpcSlice->getPPS()->getQpOffset(COMPONENT_Cb); 401 crQP = Clip3( -12, 12, crQP + rpcSlice->getPPS()->getQpOffset(COMPONENT_Cr) ) - rpcSlice->getPPS()->getQpOffset(COMPONENT_Cr); 402 rpcSlice->setSliceChromaQpDelta(COMPONENT_Cb, Clip3( -12, 12, cbQP)); 403 assert(rpcSlice->getSliceChromaQpDelta(COMPONENT_Cb)+rpcSlice->getPPS()->getQpOffset(COMPONENT_Cb)<=12 && rpcSlice->getSliceChromaQpDelta(COMPONENT_Cb)+rpcSlice->getPPS()->getQpOffset(COMPONENT_Cb)>=-12); 404 rpcSlice->setSliceChromaQpDelta(COMPONENT_Cr, Clip3( -12, 12, crQP)); 405 assert(rpcSlice->getSliceChromaQpDelta(COMPONENT_Cr)+rpcSlice->getPPS()->getQpOffset(COMPONENT_Cr)<=12 && rpcSlice->getSliceChromaQpDelta(COMPONENT_Cr)+rpcSlice->getPPS()->getQpOffset(COMPONENT_Cr)>=-12); 406 } 407 else 408 { 409 rpcSlice->setSliceChromaQpDelta( COMPONENT_Cb, 0 ); 410 rpcSlice->setSliceChromaQpDelta( COMPONENT_Cr, 0 ); 411 } 412 #endif 413 393 414 Double lambdaModifier; 394 415 if( rpcSlice->getSliceType( ) != I_SLICE || intraLambdaModifiers.empty()) … … 446 467 #endif 447 468 rpcSlice->setSliceQpDelta ( 0 ); 469 #if !W0038_CQP_ADJ 448 470 rpcSlice->setSliceChromaQpDelta( COMPONENT_Cb, 0 ); 449 471 rpcSlice->setSliceChromaQpDelta( COMPONENT_Cr, 0 ); 472 #endif 450 473 rpcSlice->setUseChromaQpAdj( rpcSlice->getPPS()->getPpsRangeExtension().getChromaQpOffsetListEnabledFlag() ); 451 474 rpcSlice->setNumRefIdx(REF_PIC_LIST_0,m_pcCfg->getGOPEntry(iGOPid).m_numRefPicsActive); -
branches/SHM-dev/source/Lib/TLibEncoder/TEncTop.cpp
r1544 r1545 1269 1269 m_cPPS.setQpOffset(COMPONENT_Cb, m_chromaCbQpOffset ); 1270 1270 m_cPPS.setQpOffset(COMPONENT_Cr, m_chromaCrQpOffset ); 1271 #if W0038_CQP_ADJ 1272 Bool bChromaDeltaQPEnabled = false; 1273 { 1274 bChromaDeltaQPEnabled = ( m_sliceChromaQpOffsetIntraOrPeriodic[0] || m_sliceChromaQpOffsetIntraOrPeriodic[1] ); 1275 if( !bChromaDeltaQPEnabled ) 1276 { 1277 for( Int i=0; i<m_iGOPSize; i++ ) 1278 { 1279 if( m_GOPList[i].m_CbQPoffset || m_GOPList[i].m_CrQPoffset ) 1280 { 1281 bChromaDeltaQPEnabled = true; 1282 break; 1283 } 1284 } 1285 } 1286 } 1287 m_cPPS.setSliceChromaQpFlag(bChromaDeltaQPEnabled); 1288 #endif 1271 1289 1272 1290 m_cPPS.setEntropyCodingSyncEnabledFlag( m_entropyCodingSyncEnabledFlag );
Note: See TracChangeset for help on using the changeset viewer.