Skip to content
Snippets Groups Projects
Commit 14a70bbb authored by Karsten Suehring's avatar Karsten Suehring
Browse files

Merge branch 'mts_cleanup' into 'master'

Cleanup MTS related functionality

See merge request !125
parents 6848c2c0 205d6763
No related branches found
No related tags found
No related merge requests found
...@@ -619,30 +619,6 @@ const int g_invQuantScales[SCALING_LIST_REM_NUM] = ...@@ -619,30 +619,6 @@ const int g_invQuantScales[SCALING_LIST_REM_NUM] =
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
//structures //structures
//EMT transform sets
const int g_aiTrSubsetIntra[3][2] = { { DST7, DCT8 }, { DST7, DCT8 }, { DST7, DCT8 } };
#if JVET_L0118_ALIGN_MTS_INDEX
const int g_aiTrSubsetInter[2] = { DST7, DCT8 };
#else
const int g_aiTrSubsetInter[4] = { DCT8, DST7 };
#endif
const uint8_t g_aucTrSetVert[NUM_INTRA_MODE - 1] =
{//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
};
const uint8_t g_aucTrSetVert35[35] =
{//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
2, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 2, 2, 2, 2, 1, 0, 1, 0, 1, 0
};
const uint8_t g_aucTrSetHorz[NUM_INTRA_MODE - 1] =
{//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0
};
const uint8_t g_aucTrSetHorz35[35] =
{//0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
2, 1, 0, 1, 0, 1, 0, 1, 2, 2, 2, 2, 2, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0
};
//EMT threshold //EMT threshold
#if !JVET_L0059_MTS_SIMP #if !JVET_L0059_MTS_SIMP
......
...@@ -117,19 +117,6 @@ extern const uint8_t g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE]; ...@@ -117,19 +117,6 @@ extern const uint8_t g_chroma422IntraAngleMappingTable[NUM_INTRA_MODE];
extern const TMatrixCoeff g_as_DST_MAT_4 [TRANSFORM_NUMBER_OF_DIRECTIONS][4][4]; extern const TMatrixCoeff g_as_DST_MAT_4 [TRANSFORM_NUMBER_OF_DIRECTIONS][4][4];
#endif #endif
extern const int g_aiTrSubsetIntra[3][2];
#if JVET_L0118_ALIGN_MTS_INDEX
extern const int g_aiTrSubsetInter[2];
#else
extern const int g_aiTrSubsetInter[4];
#endif
extern const uint8_t g_aucTrSetVert[NUM_INTRA_MODE - 1];
extern const uint8_t g_aucTrSetHorz[NUM_INTRA_MODE - 1];
extern const uint8_t g_aucTrSetVert35[35];
extern const uint8_t g_aucTrSetHorz35[35];
extern const uint32_t g_EmtSigNumThr; extern const uint32_t g_EmtSigNumThr;
#if JVET_L0285_8BIT_TRANSFORM_CORE #if JVET_L0285_8BIT_TRANSFORM_CORE
......
...@@ -87,15 +87,6 @@ InvTrans *fastInvTrans[NUM_TRANS_TYPE][g_numTransformMatrixSizes] = ...@@ -87,15 +87,6 @@ InvTrans *fastInvTrans[NUM_TRANS_TYPE][g_numTransformMatrixSizes] =
// ==================================================================================================================== // ====================================================================================================================
// TrQuant class member functions // TrQuant class member functions
// ==================================================================================================================== // ====================================================================================================================
#if HEVC_USE_4x4_DSTVII
void xTrMxN ( const int bitDepth, const Pel *residual, size_t stride, TCoeff *coeff, size_t width, size_t height, bool useDST, const int maxLog2TrDynamicRange );
void xITrMxN( const int bitDepth, const TCoeff *coeff, Pel *residual, size_t stride, size_t width, size_t height, bool useDST, const int maxLog2TrDynamicRange );
#else
void xTrMxN ( const int bitDepth, const Pel *residual, size_t stride, TCoeff *coeff, size_t width, size_t height, const int maxLog2TrDynamicRange );
void xITrMxN( const int bitDepth, const TCoeff *coeff, Pel *residual, size_t stride, size_t width, size_t height, const int maxLog2TrDynamicRange );
#endif
TrQuant::TrQuant() : m_quant( nullptr ) TrQuant::TrQuant() : m_quant( nullptr )
{ {
// allocate temporary buffers // allocate temporary buffers
...@@ -120,130 +111,12 @@ TrQuant::~TrQuant() ...@@ -120,130 +111,12 @@ TrQuant::~TrQuant()
} }
#if ENABLE_SPLIT_PARALLELISM #if ENABLE_SPLIT_PARALLELISM
void TrQuant::copyState( const TrQuant& other ) void TrQuant::copyState( const TrQuant& other )
{ {
m_quant->copyState( *other.m_quant ); m_quant->copyState( *other.m_quant );
} }
#endif #endif
#if HEVC_USE_4x4_DSTVII
void xTrMxN_EMT( const int bitDepth, const Pel *residual, size_t stride, TCoeff *coeff, int iWidth, int iHeight, bool useDST, const int maxLog2TrDynamicRange,
#else
void xTrMxN_EMT( const int bitDepth, const Pel *residual, size_t stride, TCoeff *coeff, int iWidth, int iHeight, const int maxLog2TrDynamicRange,
#endif
const uint8_t ucMode, const uint8_t ucTrIdx)
{
const int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
const int shift_1st = ((g_aucLog2[iWidth ]) + bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange + COM16_C806_TRANS_PREC;
const int shift_2nd = (g_aucLog2[iHeight]) + TRANSFORM_MATRIX_SHIFT + COM16_C806_TRANS_PREC;
const uint32_t transformWidthIndex = g_aucLog2[iWidth ] - 1; //nLog2WidthMinus1, since transform start from 2-point
const uint32_t transformHeightIndex = g_aucLog2[iHeight] - 1; //nLog2HeightMinus1, since transform start from 2-point
const int iZeroOutThresh = JVET_C0024_ZERO_OUT_TH;
int iSkipWidth = 0, iSkipHeight = 0;
iSkipWidth = (iWidth > iZeroOutThresh ? iWidth - iZeroOutThresh : 0);
iSkipHeight = (iHeight > iZeroOutThresh ? iHeight - iZeroOutThresh : 0);
CHECK( shift_1st < 0, "Negative shift" );
CHECK( shift_2nd < 0, "Negative shift" );
ALIGN_DATA( MEMORY_ALIGN_DEF_SIZE, TCoeff block[MAX_TU_SIZE * MAX_TU_SIZE] );
for( int y = 0; y < iHeight; y++ )
{
for( int x = 0; x < iWidth; x++ )
{
block[( y * iWidth ) + x] = residual[( y * stride ) + x];
}
}
TCoeff *tmp = ( TCoeff * ) alloca( iWidth * iHeight * sizeof( TCoeff ) );
uint32_t nTrIdxHor = DCT2, nTrIdxVer = DCT2;
if( ucMode != INTER_MODE_IDX && ucTrIdx != DCT2_EMT )
{
uint32_t nTrSubsetHor, nTrSubsetVer;
nTrSubsetHor = g_aucTrSetHorz[ucMode];
nTrSubsetVer = g_aucTrSetVert[ucMode];
nTrIdxHor = g_aiTrSubsetIntra[nTrSubsetHor][ucTrIdx & 1];
nTrIdxVer = g_aiTrSubsetIntra[nTrSubsetVer][ucTrIdx >> 1];
}
if( ucMode == INTER_MODE_IDX && ucTrIdx != DCT2_EMT )
{
nTrIdxHor = g_aiTrSubsetInter[ucTrIdx & 1];
nTrIdxVer = g_aiTrSubsetInter[ucTrIdx >> 1];
}
fastFwdTrans[nTrIdxHor][transformWidthIndex](block, tmp, shift_1st, iHeight, 0, iSkipWidth);
fastFwdTrans[nTrIdxVer][transformHeightIndex](tmp, coeff, shift_2nd, iWidth, iSkipWidth, iSkipHeight);
}
/** MxN inverse transform (2D)
* \param bitDepth [in] bit depth
* \param coeff [in] transform coefficients
* \param residual [out] residual block
* \param stride [in] stride of the residual block
* \param iWidth [in] width of transform
* \param iHeight [in] height of transform
* \param uiSkipWidth [in]
* \param uiSkipHeight [in]
* \param useDST [in]
* \param maxLog2TrDynamicRange [in]
* \param ucMode [in]
* \param ucTrIdx [in]
* \param use65intraModes [in]
*/
#if HEVC_USE_4x4_DSTVII
void xITrMxN_EMT(const int bitDepth, const TCoeff *coeff, Pel *residual, size_t stride, int iWidth, int iHeight, uint32_t uiSkipWidth, uint32_t uiSkipHeight, bool useDST, const int maxLog2TrDynamicRange, uint8_t ucMode, uint8_t ucTrIdx )
#else
void xITrMxN_EMT(const int bitDepth, const TCoeff *coeff, Pel *residual, size_t stride, int iWidth, int iHeight, uint32_t uiSkipWidth, uint32_t uiSkipHeight, const int maxLog2TrDynamicRange, uint8_t ucMode, uint8_t ucTrIdx )
#endif
{
const int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_INVERSE];
const TCoeff clipMinimum = -( 1 << maxLog2TrDynamicRange );
const TCoeff clipMaximum = ( 1 << maxLog2TrDynamicRange ) - 1;
const int shift_1st = TRANSFORM_MATRIX_SHIFT + 1 + COM16_C806_TRANS_PREC; //1 has been added to shift_1st at the expense of shift_2nd
const int shift_2nd = ( TRANSFORM_MATRIX_SHIFT + maxLog2TrDynamicRange - 1 ) - bitDepth + COM16_C806_TRANS_PREC;
const uint32_t transformWidthIndex = g_aucLog2[iWidth ] - 1; //nLog2WidthMinus1, since transform start from 2-point
const uint32_t transformHeightIndex = g_aucLog2[iHeight] - 1; //nLog2HeightMinus1, since transform start from 2-point
CHECK( shift_1st < 0, "Negative shift" );
CHECK( shift_2nd < 0, "Negative shift" );
TCoeff *tmp = ( TCoeff * ) alloca( iWidth * iHeight * sizeof( TCoeff ) );
TCoeff *block = ( TCoeff * ) alloca( iWidth * iHeight * sizeof( TCoeff ) );
uint32_t nTrIdxHor = DCT2, nTrIdxVer = DCT2;
if( ucMode != INTER_MODE_IDX && ucTrIdx != DCT2_EMT )
{
uint32_t nTrSubsetHor, nTrSubsetVer;
nTrSubsetHor = g_aucTrSetHorz[ucMode];
nTrSubsetVer = g_aucTrSetVert[ucMode];
nTrIdxHor = g_aiTrSubsetIntra[nTrSubsetHor][ucTrIdx & 1];
nTrIdxVer = g_aiTrSubsetIntra[nTrSubsetVer][ucTrIdx >> 1];
}
if( ucMode == INTER_MODE_IDX && ucTrIdx != DCT2_EMT )
{
nTrIdxHor = g_aiTrSubsetInter[ucTrIdx & 1];
nTrIdxVer = g_aiTrSubsetInter[ucTrIdx >> 1];
}
fastInvTrans[nTrIdxVer][transformHeightIndex](coeff, tmp, shift_1st, iWidth, uiSkipWidth, uiSkipHeight, clipMinimum, clipMaximum);
fastInvTrans[nTrIdxHor][transformWidthIndex](tmp, block, shift_2nd, iHeight, 0, uiSkipWidth, clipMinimum, clipMaximum);
for( int y = 0; y < iHeight; y++ )
{
for( int x = 0; x < iWidth; x++ )
{
residual[( y * stride ) + x] = Pel( block[( y * iWidth ) + x] );
}
}
}
void TrQuant::xDeQuant(const TransformUnit &tu, void TrQuant::xDeQuant(const TransformUnit &tu,
CoeffBuf &dstCoeff, CoeffBuf &dstCoeff,
const ComponentID &compID, const ComponentID &compID,
...@@ -392,64 +265,128 @@ void TrQuant::invRdpcmNxN(TransformUnit& tu, const ComponentID &compID, PelBuf & ...@@ -392,64 +265,128 @@ void TrQuant::invRdpcmNxN(TransformUnit& tu, const ComponentID &compID, PelBuf &
// Logical transform // Logical transform
// ------------------------------------------------------------------------------------------------ // ------------------------------------------------------------------------------------------------
void TrQuant::xT( const TransformUnit &tu, const ComponentID &compID, const CPelBuf &resi, CoeffBuf &dstCoeff, const int iWidth, const int iHeight ) void TrQuant::getTrTypes ( TransformUnit tu, const ComponentID compID, int &trTypeHor, int &trTypeVer )
{ {
const unsigned maxLog2TrDynamicRange = tu.cs->sps->getMaxLog2TrDynamicRange( toChannelType( compID ) ); bool emtActivated = CU::isIntra( *tu.cu ) ? tu.cs->sps->getSpsNext().getUseIntraEMT() : tu.cs->sps->getSpsNext().getUseInterEMT();
const unsigned channelBitDepth = tu.cs->sps->getBitDepth( toChannelType( compID ) );
#if HEVC_USE_4x4_DSTVII trTypeHor = DCT2;
const bool useDST = TU::useDST( tu, compID ); trTypeVer = DCT2;
#endif
if ( emtActivated )
const unsigned ucMode = getEmtMode ( tu, compID ); {
const unsigned ucTrIdx = getEmtTrIdx( tu, compID ); if( compID == COMPONENT_Y )
{
if( ucTrIdx != DCT2 ) if ( tu.cu->emtFlag )
{ {
#if RExt__DECODER_DEBUG_TOOL_STATISTICS int indHor = tu.emtIdx & 1;
CodingStatistics::IncrementStatisticTool( CodingStatisticsClassType{ STATS__TOOL_EMT, uint32_t( iWidth ), uint32_t( iHeight ), compID } ); int indVer = tu.emtIdx >> 1;
#endif
} #if JVET_L0118_ALIGN_MTS_INDEX
trTypeHor = indHor ? DCT8 : DST7;
#if HEVC_USE_4x4_DSTVII trTypeVer = indVer ? DCT8 : DST7;
xTrMxN_EMT(channelBitDepth, resi.buf, resi.stride, dstCoeff.buf, iWidth, iHeight, useDST, maxLog2TrDynamicRange, ucMode, ucTrIdx
#else #else
xTrMxN_EMT(channelBitDepth, resi.buf, resi.stride, dstCoeff.buf, iWidth, iHeight, maxLog2TrDynamicRange, ucMode, ucTrIdx if ( CU::isIntra( *tu.cu ) )
{
trTypeHor = indHor ? DCT8 : DST7;
trTypeVer = indVer ? DCT8 : DST7;
}
else
{
trTypeHor = indHor ? DST7 : DCT8;
trTypeVer = indVer ? DST7 : DCT8;
}
#endif #endif
); }
}
}
} }
/** Wrapper function between HM interface and core NxN inverse transform (2D) void TrQuant::xT( const TransformUnit &tu, const ComponentID &compID, const CPelBuf &resi, CoeffBuf &dstCoeff, const int width, const int height )
*/
void TrQuant::xIT( const TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pCoeff, PelBuf &pResidual )
{ {
const unsigned maxLog2TrDynamicRange = tu.cs->sps->getMaxLog2TrDynamicRange( toChannelType( compID ) ); const unsigned maxLog2TrDynamicRange = tu.cs->sps->getMaxLog2TrDynamicRange( toChannelType( compID ) );
const unsigned channelBitDepth = tu.cs->sps->getBitDepth( toChannelType( compID ) ); const unsigned bitDepth = tu.cs->sps->getBitDepth( toChannelType( compID ) );
#if HEVC_USE_4x4_DSTVII const int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_FORWARD];
const bool useDST = TU::useDST( tu, compID ); const int shift_1st = ((g_aucLog2[width ]) + bitDepth + TRANSFORM_MATRIX_SHIFT) - maxLog2TrDynamicRange + COM16_C806_TRANS_PREC;
#endif const int shift_2nd = (g_aucLog2[height]) + TRANSFORM_MATRIX_SHIFT + COM16_C806_TRANS_PREC;
const uint32_t transformWidthIndex = g_aucLog2[width ] - 1; // nLog2WidthMinus1, since transform start from 2-point
const unsigned ucMode = getEmtMode ( tu, compID ); const uint32_t transformHeightIndex = g_aucLog2[height] - 1; // nLog2HeightMinus1, since transform start from 2-point
const unsigned ucTrIdx = getEmtTrIdx( tu, compID ); const int skipWidth = width > JVET_C0024_ZERO_OUT_TH ? width - JVET_C0024_ZERO_OUT_TH : 0;
const int skipHeight = height > JVET_C0024_ZERO_OUT_TH ? height - JVET_C0024_ZERO_OUT_TH : 0;
int iSkipWidth = 0, iSkipHeight = 0;
CHECK( shift_1st < 0, "Negative shift" );
if( m_rectTUs ) CHECK( shift_2nd < 0, "Negative shift" );
int trTypeHor = DCT2;
int trTypeVer = DCT2;
getTrTypes ( tu, compID, trTypeHor, trTypeVer );
#if RExt__DECODER_DEBUG_TOOL_STATISTICS
if ( trTypeHor != DCT2 )
{ {
iSkipWidth = ( pCoeff.width > JVET_C0024_ZERO_OUT_TH ? pCoeff.width - JVET_C0024_ZERO_OUT_TH : 0 ); CodingStatistics::IncrementStatisticTool( CodingStatisticsClassType{ STATS__TOOL_EMT, uint32_t( width ), uint32_t( height ), compID } );
iSkipHeight = ( pCoeff.height > JVET_C0024_ZERO_OUT_TH ? pCoeff.height - JVET_C0024_ZERO_OUT_TH : 0 );
} }
else if( ( ( ucMode == INTER_MODE_IDX || pCoeff.width == 64 ) && ucTrIdx != DCT2_EMT && pCoeff.width >= JVET_C0024_ZERO_OUT_TH ) || ( ucTrIdx == DCT2_EMT && pCoeff.width == 64 ) ) #endif
ALIGN_DATA( MEMORY_ALIGN_DEF_SIZE, TCoeff block[MAX_TU_SIZE * MAX_TU_SIZE] );
const Pel *resiBuf = resi.buf;
const int resiStride = resi.stride;
for( int y = 0; y < height; y++ )
{ {
iSkipWidth = pCoeff.width >> 1; for( int x = 0; x < width; x++ )
iSkipHeight = pCoeff.height >> 1; {
block[( y * width ) + x] = resiBuf[( y * resiStride ) + x];
}
} }
#if HEVC_USE_4x4_DSTVII
xITrMxN_EMT(channelBitDepth, pCoeff.buf, pResidual.buf, pResidual.stride, pCoeff.width, pCoeff.height, iSkipWidth, iSkipHeight, useDST, maxLog2TrDynamicRange, ucMode, ucTrIdx ); TCoeff *tmp = ( TCoeff * ) alloca( width * height * sizeof( TCoeff ) );
#else
xITrMxN_EMT(channelBitDepth, pCoeff.buf, pResidual.buf, pResidual.stride, pCoeff.width, pCoeff.height, iSkipWidth, iSkipHeight, maxLog2TrDynamicRange, ucMode, ucTrIdx ); fastFwdTrans[trTypeHor][transformWidthIndex ](block, tmp, shift_1st, height, 0, skipWidth);
#endif fastFwdTrans[trTypeVer][transformHeightIndex](tmp, dstCoeff.buf, shift_2nd, width, skipWidth, skipHeight);
}
void TrQuant::xIT( const TransformUnit &tu, const ComponentID &compID, const CCoeffBuf &pCoeff, PelBuf &pResidual )
{
const int width = pCoeff.width;
const int height = pCoeff.height;
const unsigned maxLog2TrDynamicRange = tu.cs->sps->getMaxLog2TrDynamicRange( toChannelType( compID ) );
const unsigned bitDepth = tu.cs->sps->getBitDepth( toChannelType( compID ) );
const int TRANSFORM_MATRIX_SHIFT = g_transformMatrixShift[TRANSFORM_INVERSE];
const TCoeff clipMinimum = -( 1 << maxLog2TrDynamicRange );
const TCoeff clipMaximum = ( 1 << maxLog2TrDynamicRange ) - 1;
const int shift_1st = TRANSFORM_MATRIX_SHIFT + 1 + COM16_C806_TRANS_PREC; // 1 has been added to shift_1st at the expense of shift_2nd
const int shift_2nd = ( TRANSFORM_MATRIX_SHIFT + maxLog2TrDynamicRange - 1 ) - bitDepth + COM16_C806_TRANS_PREC;
const uint32_t transformWidthIndex = g_aucLog2[width ] - 1; // nLog2WidthMinus1, since transform start from 2-point
const uint32_t transformHeightIndex = g_aucLog2[height] - 1; // nLog2HeightMinus1, since transform start from 2-point
const int skipWidth = width > JVET_C0024_ZERO_OUT_TH ? width - JVET_C0024_ZERO_OUT_TH : 0;
const int skipHeight = height > JVET_C0024_ZERO_OUT_TH ? height - JVET_C0024_ZERO_OUT_TH : 0;
CHECK( shift_1st < 0, "Negative shift" );
CHECK( shift_2nd < 0, "Negative shift" );
int trTypeHor = DCT2;
int trTypeVer = DCT2;
getTrTypes ( tu, compID, trTypeHor, trTypeVer );
TCoeff *tmp = ( TCoeff * ) alloca( width * height * sizeof( TCoeff ) );
TCoeff *block = ( TCoeff * ) alloca( width * height * sizeof( TCoeff ) );
fastInvTrans[trTypeVer][transformHeightIndex](pCoeff.buf, tmp, shift_1st, width, skipWidth, skipHeight, clipMinimum, clipMaximum);
fastInvTrans[trTypeHor][transformWidthIndex] (tmp, block, shift_2nd, height, 0, skipWidth, clipMinimum, clipMaximum);
Pel *resiBuf = pResidual.buf;
int resiStride = pResidual.stride;
for( int y = 0; y < height; y++ )
{
for( int x = 0; x < width; x++ )
{
resiBuf[( y * resiStride ) + x] = Pel( block[( y * width ) + x] );
}
}
} }
/** Wrapper function between HM interface and core NxN transform skipping /** Wrapper function between HM interface and core NxN transform skipping
...@@ -513,58 +450,6 @@ void TrQuant::xQuant(TransformUnit &tu, const ComponentID &compID, const CCoeffB ...@@ -513,58 +450,6 @@ void TrQuant::xQuant(TransformUnit &tu, const ComponentID &compID, const CCoeffB
m_quant->quant( tu, compID, pSrc, uiAbsSum, cQP, ctx ); m_quant->quant( tu, compID, pSrc, uiAbsSum, cQP, ctx );
} }
uint8_t TrQuant::getEmtTrIdx(TransformUnit tu, const ComponentID compID)
{
uint8_t ucTrIdx = DCT2_EMT;
if( compID == COMPONENT_Y )
{
if( CU::isIntra( *tu.cu ) && tu.cs->sps->getSpsNext().getUseIntraEMT() )
{
ucTrIdx = tu.cu->emtFlag ? tu.emtIdx : DCT2_EMT;
}
if( !CU::isIntra( *tu.cu ) && tu.cs->sps->getSpsNext().getUseInterEMT() )
{
ucTrIdx = tu.cu->emtFlag ? tu.emtIdx : DCT2_EMT;
}
}
else
{
if( CU::isIntra( *tu.cu ) && tu.cs->sps->getSpsNext().getUseIntraEMT() )
{
ucTrIdx = DCT2_EMT;
}
if( !CU::isIntra( *tu.cu ) && tu.cs->sps->getSpsNext().getUseInterEMT() )
{
ucTrIdx = DCT2_EMT;
}
}
return ucTrIdx;
}
uint8_t TrQuant::getEmtMode( TransformUnit tu, const ComponentID compID )
{
uint8_t ucMode = 0;
if( isLuma( compID ) )
{
if( CU::isIntra( *tu.cu ) )
{
CodingStructure &cs = *tu.cs;
const PredictionUnit &pu = *cs.getPU( tu.blocks[compID].pos(), toChannelType( compID ) );
const uint32_t uiChFinalMode = PU::getFinalIntraMode( pu, toChannelType( compID ) );
ucMode = uiChFinalMode;
}
else
{
ucMode = INTER_MODE_IDX;
}
}
return ucMode;
}
void TrQuant::transformNxN(TransformUnit &tu, const ComponentID &compID, const QpParam &cQP, TCoeff &uiAbsSum, const Ctx &ctx) void TrQuant::transformNxN(TransformUnit &tu, const ComponentID &compID, const QpParam &cQP, TCoeff &uiAbsSum, const Ctx &ctx)
{ {
CodingStructure &cs = *tu.cs; CodingStructure &cs = *tu.cs;
......
...@@ -78,8 +78,7 @@ public: ...@@ -78,8 +78,7 @@ public:
const bool useTransformSkipFast = false const bool useTransformSkipFast = false
); );
uint8_t getEmtTrIdx( TransformUnit tu, const ComponentID compID ); void getTrTypes( TransformUnit tu, const ComponentID compID, int &trTypeHor, int &trTypeVer );
uint8_t getEmtMode ( TransformUnit tu, const ComponentID compID );
protected: protected:
...@@ -126,8 +125,7 @@ private: ...@@ -126,8 +125,7 @@ private:
// forward Transform // forward Transform
void xT ( const TransformUnit &tu, const ComponentID &compID, const CPelBuf &resi, CoeffBuf &dstCoeff, const int iWidth, const int iHeight ); void xT (const TransformUnit &tu, const ComponentID &compID, const CPelBuf &resi, CoeffBuf &dstCoeff, const int width, const int height);
// skipping Transform // skipping Transform
void xTransformSkip (const TransformUnit &tu, const ComponentID &compID, const CPelBuf &resi, TCoeff* psCoeff); void xTransformSkip (const TransformUnit &tu, const ComponentID &compID, const CPelBuf &resi, TCoeff* psCoeff);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment