diff --git a/source/Lib/CommonLib/DepQuant.cpp b/source/Lib/CommonLib/DepQuant.cpp index 051a30fcd2d0d971f07c628c02a7d233230eb86e..b6f0d97c611ae8d5ba5353f0384c812a5eb1e491 100644 --- a/source/Lib/CommonLib/DepQuant.cpp +++ b/source/Lib/CommonLib/DepQuant.cpp @@ -1024,9 +1024,6 @@ namespace DQIntern const int8_t m_stateId; const BinFracBits*const m_sigFracBitsArray; const CoeffFracBits*const m_gtxFracBitsArray; -#if !JVET_P0170_ZERO_POS_SIMPLIFICATION - const uint32_t*const m_goRiceZeroArray; -#endif CommonCtx& m_commonCtx; public: unsigned effWidth; @@ -1039,9 +1036,6 @@ namespace DQIntern , m_stateId ( stateId ) , m_sigFracBitsArray( rateEst.sigFlagBits(stateId) ) , m_gtxFracBitsArray( rateEst.gtxFracBits(stateId) ) -#if !JVET_P0170_ZERO_POS_SIMPLIFICATION - , m_goRiceZeroArray ( g_auiGoRicePosCoeff0[std::max(0,stateId-1)] ) -#endif , m_commonCtx ( commonCtx ) { } @@ -1192,11 +1186,7 @@ namespace DQIntern #undef UPDATE sumAbs = std::min<TCoeff>(31, sumAbs); m_goRicePar = g_auiGoRiceParsCoeff[sumAbs]; -#if JVET_P0170_ZERO_POS_SIMPLIFICATION m_goRiceZero = g_auiGoRicePosCoeff0(m_stateId, m_goRicePar); -#else - m_goRiceZero = m_goRiceZeroArray[sumAbs]; -#endif } } } diff --git a/source/Lib/CommonLib/QuantRDOQ.cpp b/source/Lib/CommonLib/QuantRDOQ.cpp index d111d442fd2515d79151a7985bbdb5cd18e2aebf..19ad8238f42a957f5165303596c47e96e9119448 100644 --- a/source/Lib/CommonLib/QuantRDOQ.cpp +++ b/source/Lib/CommonLib/QuantRDOQ.cpp @@ -763,11 +763,7 @@ void QuantRDOQ::xRateDistOptQuant(TransformUnit &tu, const ComponentID &compID, { unsigned sumAbs = cctx.templateAbsSum( iScanPos, piDstCoeff, 0 ); goRiceParam = g_auiGoRiceParsCoeff [ sumAbs ]; -#if JVET_P0170_ZERO_POS_SIMPLIFICATION goRiceZero = g_auiGoRicePosCoeff0(0, goRiceParam); -#else - goRiceZero = g_auiGoRicePosCoeff0[0][ sumAbs ]; -#endif } const BinFracBits fracBitsPar = fracBits.getFracBitsArray( uiParCtx ); diff --git a/source/Lib/CommonLib/Rom.cpp b/source/Lib/CommonLib/Rom.cpp index 5e6d86207cddddbc2305fe081d9cea22f32cf1ab..25a490a27d6607808e7e657c05df4a5a09a87db0 100644 --- a/source/Lib/CommonLib/Rom.cpp +++ b/source/Lib/CommonLib/Rom.cpp @@ -578,14 +578,6 @@ const uint32_t g_auiGoRiceParsCoeff[32] = { 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3 }; -#if !JVET_P0170_ZERO_POS_SIMPLIFICATION -const uint32_t g_auiGoRicePosCoeff0[3][32] = -{ - {0, 0, 0, 0, 0, 1, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8}, - {1, 1, 1, 1, 2, 3, 4, 4, 4, 6, 6, 6, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 16, 16}, - {1, 1, 2, 2, 2, 3, 4, 4, 4, 6, 6, 6, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12, 12, 12, 12, 16, 16, 16, 16, 16, 16, 16} -}; -#endif const char *MatrixType[SCALING_LIST_SIZE_NUM][SCALING_LIST_NUM] = { { diff --git a/source/Lib/CommonLib/Rom.h b/source/Lib/CommonLib/Rom.h index 8e03ba32d252f8e15bf8feabd00d2c0d659d1696..929a75547ef2cdafdc21e965dea0b93e8d3288e9 100644 --- a/source/Lib/CommonLib/Rom.h +++ b/source/Lib/CommonLib/Rom.h @@ -87,14 +87,10 @@ static const int g_transformMatrixShift[TRANSFORM_NUMBER_OF_DIRECTIONS] = { 6, extern const uint32_t g_uiGroupIdx[ MAX_TB_SIZEY ]; extern const uint32_t g_uiMinInGroup[ LAST_SIGNIFICANT_GROUPS ]; extern const uint32_t g_auiGoRiceParsCoeff [ 32 ]; -#if JVET_P0170_ZERO_POS_SIMPLIFICATION inline uint32_t g_auiGoRicePosCoeff0(int st, uint32_t ricePar) { return (st < 2 ? 1 : 2) << ricePar; } -#else -extern const uint32_t g_auiGoRicePosCoeff0[ 3 ][ 32 ]; -#endif // ==================================================================================================================== // Intra prediction table diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 71dea930ad84a3405f81381b412c584485999bcb..689b059ca354a0698ddaf91879575ee09b139900 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -121,7 +121,6 @@ -#define JVET_P0170_ZERO_POS_SIMPLIFICATION 1 // JVET-P0170: Simplification of deriving ZeroPos #define JVET_P0058_CHROMA_TS 1 // JVET-P0058: Enable Transform skip for chroma #if JVET_AHG14_LOSSLESS && !JVET_P0058_CHROMA_TS diff --git a/source/Lib/DecoderLib/CABACReader.cpp b/source/Lib/DecoderLib/CABACReader.cpp index eb24b163fc41d207229ebe4e3651b6ca061d829f..4f37f7eece54b79fb0477e1c1cb5cd486b6ac627 100644 --- a/source/Lib/DecoderLib/CABACReader.cpp +++ b/source/Lib/DecoderLib/CABACReader.cpp @@ -3593,11 +3593,7 @@ void CABACReader::residual_coding_subblock( CoeffCodingContext& cctx, TCoeff* co { int sumAll = cctx.templateAbsSum(scanPos, coeff, 0); int rice = g_auiGoRiceParsCoeff [sumAll]; -#if JVET_P0170_ZERO_POS_SIMPLIFICATION int pos0 = g_auiGoRicePosCoeff0(state, rice); -#else - int pos0 = g_auiGoRicePosCoeff0[std::max(0, state - 1)][sumAll]; -#endif RExt__DECODER_DEBUG_BIT_STATISTICS_SET(ctype_escs); int rem = m_BinDecoder.decodeRemAbsEP( rice, COEF_REMAIN_BIN_REDUCTION, cctx.maxLog2TrDRange() ); DTRACE( g_trace_ctx, D_SYNTAX_RESI, "rem_val() bin=%d ctx=%d\n", rem, rice ); diff --git a/source/Lib/EncoderLib/CABACWriter.cpp b/source/Lib/EncoderLib/CABACWriter.cpp index 4d995ae7473a231586a97f236ad0199f70bfc39d..b4e0136810da6fa40c6a586a7c079c40d64ce0d7 100644 --- a/source/Lib/EncoderLib/CABACWriter.cpp +++ b/source/Lib/EncoderLib/CABACWriter.cpp @@ -3318,11 +3318,7 @@ void CABACWriter::residual_coding_subblock( CoeffCodingContext& cctx, const TCoe unsigned absLevel = abs( Coeff ); int sumAll = cctx.templateAbsSum(scanPos, coeff, 0); int rice = g_auiGoRiceParsCoeff [sumAll]; -#if JVET_P0170_ZERO_POS_SIMPLIFICATION int pos0 = g_auiGoRicePosCoeff0(state, rice); -#else - int pos0 = g_auiGoRicePosCoeff0[std::max(0, state - 1)][sumAll]; -#endif unsigned rem = ( absLevel == 0 ? pos0 : absLevel <= pos0 ? absLevel-1 : absLevel ); m_BinEncoder.encodeRemAbsEP( rem, rice, COEF_REMAIN_BIN_REDUCTION, cctx.maxLog2TrDRange() ); DTRACE( g_trace_ctx, D_SYNTAX_RESI, "rem_val() bin=%d ctx=%d\n", rem, rice );