diff --git a/source/Lib/DecoderLib/DecCu.cpp b/source/Lib/DecoderLib/DecCu.cpp index 5ae1d31d1cf367047c219a18196c530ee65e3b06..1488f760df1c30f5643ed5a06256b8c02418eb64 100644 --- a/source/Lib/DecoderLib/DecCu.cpp +++ b/source/Lib/DecoderLib/DecCu.cpp @@ -324,7 +324,8 @@ void DecCu::xIntraRecBlk( TransformUnit& tu, const ComponentID compID ) } else { - m_pcTrQuant->invTransformNxN( tu, COMPONENT_Cr, resiCr, cQP ); + const QpParam qpCr( tu, COMPONENT_Cr ); + m_pcTrQuant->invTransformNxN( tu, COMPONENT_Cr, resiCr, qpCr ); } m_pcTrQuant->invTransformICT( tu, piResi, resiCr ); } @@ -779,7 +780,8 @@ void DecCu::xDecodeInterTU( TransformUnit & currTU, const ComponentID compID ) } else { - m_pcTrQuant->invTransformNxN( currTU, COMPONENT_Cr, resiCr, cQP ); + const QpParam qpCr( currTU, COMPONENT_Cr ); + m_pcTrQuant->invTransformNxN( currTU, COMPONENT_Cr, resiCr, qpCr ); } m_pcTrQuant->invTransformICT( currTU, resiBuf, resiCr ); } diff --git a/source/Lib/DecoderLib/VLCReader.cpp b/source/Lib/DecoderLib/VLCReader.cpp index b1a146be8aa848ad1fc026871890b7facdc6eba7..7fc332a817644aae438706f07f6b8b682102c5b4 100644 --- a/source/Lib/DecoderLib/VLCReader.cpp +++ b/source/Lib/DecoderLib/VLCReader.cpp @@ -408,7 +408,7 @@ void HLSyntaxReader::parsePPS( PPS* pcPPS, ParameterSetManager *parameterSetMana CHECK( pcPPS->getQpOffset(COMPONENT_Cr) < -12, "Invalid Cr QP offset" ); CHECK( pcPPS->getQpOffset(COMPONENT_Cr) > 12, "Invalid Cr QP offset" ); - READ_SVLC( iCode, "pps_cb_cr_qp_offset"); + READ_SVLC( iCode, "pps_joint_cbcr_qp_offset"); pcPPS->setQpOffset(JOINT_CbCr, iCode); CHECK( pcPPS->getQpOffset(JOINT_CbCr) < -12, "Invalid CbCr QP offset" ); CHECK( pcPPS->getQpOffset(JOINT_CbCr) > 12, "Invalid CbCr QP offset" ); diff --git a/source/Lib/EncoderLib/InterSearch.cpp b/source/Lib/EncoderLib/InterSearch.cpp index c95bce6643f1a34ef114a6020d06881121a109cb..89f15581bc13e0801824209a5e1f2edb645efe19 100644 --- a/source/Lib/EncoderLib/InterSearch.cpp +++ b/source/Lib/EncoderLib/InterSearch.cpp @@ -7217,15 +7217,17 @@ void InterSearch::xEstimateInterResidualQT(CodingStructure &cs, Partitioner &par int codedCbfMask = 0; ComponentID codeCompId = (tu.jointCbCr >> 1 ? COMPONENT_Cb : COMPONENT_Cr); ComponentID otherCompId = (codeCompId == COMPONENT_Cr ? COMPONENT_Cb : COMPONENT_Cr); + const QpParam qpCbCr(tu, codeCompId); + tu.getCoeffs(otherCompId).fill(0); // do we need that? TU::setCbfAtDepth(tu, otherCompId, tu.depth, false); PelBuf &codeResi = (codeCompId == COMPONENT_Cr ? crResi : cbResi); TCoeff compAbsSum = 0; - m_pcTrQuant->transformNxN(tu, codeCompId, cQP, compAbsSum, m_CABACEstimator->getCtx()); + m_pcTrQuant->transformNxN(tu, codeCompId, qpCbCr, compAbsSum, m_CABACEstimator->getCtx()); if (compAbsSum > 0) { - m_pcTrQuant->invTransformNxN(tu, codeCompId, codeResi, cQP); + m_pcTrQuant->invTransformNxN(tu, codeCompId, codeResi, qpCbCr); codedCbfMask += (codeCompId == COMPONENT_Cb ? 2 : 1); } else diff --git a/source/Lib/EncoderLib/IntraSearch.cpp b/source/Lib/EncoderLib/IntraSearch.cpp index e60f99e2b3050c66157ca45e2ae68b48bd6410e6..d2ef38fb988cd2af308dc86298efe1295b8da969 100644 --- a/source/Lib/EncoderLib/IntraSearch.cpp +++ b/source/Lib/EncoderLib/IntraSearch.cpp @@ -2915,7 +2915,9 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp else // chroma { int codedCbfMask = 0; - ComponentID codeCompId = ( tu.jointCbCr ? ( tu.jointCbCr>>1 ? COMPONENT_Cb : COMPONENT_Cr ) : compID ); + ComponentID codeCompId = (tu.jointCbCr ? (tu.jointCbCr >> 1 ? COMPONENT_Cb : COMPONENT_Cr) : compID); + const QpParam qpCbCr(tu, codeCompId); + if( tu.jointCbCr ) { ComponentID otherCompId = ( codeCompId==COMPONENT_Cr ? COMPONENT_Cb : COMPONENT_Cr ); @@ -2924,11 +2926,11 @@ void IntraSearch::xIntraCodingTUBlock(TransformUnit &tu, const ComponentID &comp } PelBuf& codeResi = ( codeCompId == COMPONENT_Cr ? crResi : piResi ); uiAbsSum = 0; - m_pcTrQuant->transformNxN( tu, codeCompId, cQP, uiAbsSum, m_CABACEstimator->getCtx() ); + m_pcTrQuant->transformNxN(tu, codeCompId, qpCbCr, uiAbsSum, m_CABACEstimator->getCtx()); DTRACE( g_trace_ctx, D_TU_ABS_SUM, "%d: comp=%d, abssum=%d\n", DTRACE_GET_COUNTER( g_trace_ctx, D_TU_ABS_SUM ), codeCompId, uiAbsSum ); if( uiAbsSum > 0 ) { - m_pcTrQuant->invTransformNxN(tu, codeCompId, codeResi, cQP); + m_pcTrQuant->invTransformNxN(tu, codeCompId, codeResi, qpCbCr); codedCbfMask += ( codeCompId == COMPONENT_Cb ? 2 : 1 ); } else diff --git a/source/Lib/EncoderLib/VLCWriter.cpp b/source/Lib/EncoderLib/VLCWriter.cpp index ce6cc0e51b1116929cbe277a0f10d7fa341f32a2..f2273536aceb322d301b078c8840bc292fc4bc53 100644 --- a/source/Lib/EncoderLib/VLCWriter.cpp +++ b/source/Lib/EncoderLib/VLCWriter.cpp @@ -236,7 +236,7 @@ void HLSWriter::codePPS( const PPS* pcPPS ) WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cb), "pps_cb_qp_offset" ); WRITE_SVLC( pcPPS->getQpOffset(COMPONENT_Cr), "pps_cr_qp_offset" ); - WRITE_SVLC( pcPPS->getQpOffset(JOINT_CbCr), "pps_cb_cr_qp_offset" ); + WRITE_SVLC( pcPPS->getQpOffset(JOINT_CbCr), "pps_joint_cbcr_qp_offset" ); WRITE_FLAG( pcPPS->getSliceChromaQpFlag() ? 1 : 0, "pps_slice_chroma_qp_offsets_present_flag" );