diff --git a/source/Lib/CommonLib/IntraPrediction.cpp b/source/Lib/CommonLib/IntraPrediction.cpp index 1b148e41e9a2fab085284a5bf5ebf042ca27a8af..10742839ae5a586cedc738e5fd463880424facfd 100644 --- a/source/Lib/CommonLib/IntraPrediction.cpp +++ b/source/Lib/CommonLib/IntraPrediction.cpp @@ -181,8 +181,12 @@ Pel IntraPrediction::xGetPredValDc( const CPelBuf &pSrc, const Size &dstSize ) return dcVal; } -int IntraPrediction::getWideAngle( int width, int height, int predMode ) +int IntraPrediction::getModifiedWideAngle( int width, int height, int predMode ) { + //The function returns a 'modified' wide angle index, given that it is not necessary + //in this software implementation to reserve the values 0 and 1 for Planar and DC to generate the prediction signal. + //It should only be used to obtain the intraPredAngle parameter. + //To simply obtain the wide angle index, the function PU::getWideAngle should be used instead. if ( predMode > DC_IDX && predMode <= VDIA_IDX ) { int modeShift[] = { 0, 6, 10, 12, 14, 15 }; @@ -193,7 +197,7 @@ int IntraPrediction::getWideAngle( int width, int height, int predMode ) } else if (height > width && predMode > VDIA_IDX - modeShift[deltaSize]) { - predMode -= (VDIA_IDX - 1); + predMode -= (VDIA_IDX - 1); } } return predMode; @@ -362,7 +366,7 @@ void IntraPrediction::initPredIntraParams(const PredictionUnit & pu, const CompA const Size puSize = Size( area.width, area.height ); const Size& blockSize = useISP ? cuSize : puSize; const int dirMode = PU::getFinalIntraMode(pu, chType); - const int predMode = getWideAngle( blockSize.width, blockSize.height, dirMode ); + const int predMode = getModifiedWideAngle( blockSize.width, blockSize.height, dirMode ); m_ipaParam.isModeVer = predMode >= DIA_IDX; m_ipaParam.multiRefIndex = isLuma (chType) ? pu.multiRefIdx : 0 ; diff --git a/source/Lib/CommonLib/IntraPrediction.h b/source/Lib/CommonLib/IntraPrediction.h index d8a8f4a232ffe07dcb85d3512efa62d6b4c85f93..d5f0acb01a2ced959f915f67d94993b3efcb66a3 100644 --- a/source/Lib/CommonLib/IntraPrediction.h +++ b/source/Lib/CommonLib/IntraPrediction.h @@ -134,7 +134,7 @@ protected: int multiRefIdx ); - static int getWideAngle ( int width, int height, int predMode ); + static int getModifiedWideAngle ( int width, int height, int predMode ); void setReferenceArrayLengths ( const CompArea &area ); void destroy (); diff --git a/source/Lib/CommonLib/TrQuant.cpp b/source/Lib/CommonLib/TrQuant.cpp index 3bb4af85d2e1eb3f4356c46213b518c0bcc49b73..7532aea6f4e5201761abaa0ef0a0cbaa3bff26f3 100644 --- a/source/Lib/CommonLib/TrQuant.cpp +++ b/source/Lib/CommonLib/TrQuant.cpp @@ -331,7 +331,7 @@ void TrQuant::xInvLfnst( const TransformUnit &tu, const ComponentID compID ) if( lfnstIdx < 3 ) { - intraMode = getLFNSTIntraMode( PU::getWideAngIntraMode( tu, intraMode, compID ) ); + intraMode = getLFNSTIntraMode( PU::getWideAngle( tu, intraMode, compID ) ); #if RExt__DECODER_DEBUG_TOOL_STATISTICS CodingStatistics::IncrementStatisticTool( CodingStatisticsClassType { STATS__TOOL_LFNST, width, height, compID } ); #endif @@ -422,7 +422,7 @@ void TrQuant::xFwdLfnst( const TransformUnit &tu, const ComponentID compID, cons if( lfnstIdx < 3 ) { - intraMode = getLFNSTIntraMode( PU::getWideAngIntraMode( tu, intraMode, compID ) ); + intraMode = getLFNSTIntraMode( PU::getWideAngle( tu, intraMode, compID ) ); bool transposeFlag = getTransposeFlag( intraMode ); const int sbSize = whge3 ? 8 : 4; diff --git a/source/Lib/CommonLib/UnitTools.cpp b/source/Lib/CommonLib/UnitTools.cpp index 6a7075879b34ac91a1e461c9464a44af40e018c6..062a91f300d46d2b4173797171e9c12a90e74000 100644 --- a/source/Lib/CommonLib/UnitTools.cpp +++ b/source/Lib/CommonLib/UnitTools.cpp @@ -753,8 +753,10 @@ uint32_t PU::getCoLocatedIntraLumaMode( const PredictionUnit &pu ) } #endif -int PU::getWideAngIntraMode( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID ) +int PU::getWideAngle( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID ) { + //This function returns a wide angle index taking into account that the values 0 and 1 are reserved + //for Planar and DC respectively, as defined in the Spec. Text. if( dirMode < 2 ) { return ( int ) dirMode; diff --git a/source/Lib/CommonLib/UnitTools.h b/source/Lib/CommonLib/UnitTools.h index 5dfbfaad5b0391686e82c20e57b11e2b15f1a102..833fd6cb22eb75becc9e1fbf9de080c8a7190a95 100644 --- a/source/Lib/CommonLib/UnitTools.h +++ b/source/Lib/CommonLib/UnitTools.h @@ -142,7 +142,7 @@ namespace PU #endif uint32_t getFinalIntraMode (const PredictionUnit &pu, const ChannelType &chType); uint32_t getCoLocatedIntraLumaMode (const PredictionUnit &pu); - int getWideAngIntraMode ( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID ); + int getWideAngle ( const TransformUnit &tu, const uint32_t dirMode, const ComponentID compID ); void getInterMergeCandidates (const PredictionUnit &pu, MergeCtx& mrgCtx, int mmvdList, const int& mrgCandIdx = -1 );