Commit 5f817f6e authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0285_8BIT_TRANSFORM_CORE

parent 6cc5674c
......@@ -388,11 +388,7 @@ static const double AMAXBT_TH64 = 30.0;
static const int MAX_DELTA_QP = 7; ///< maximum supported delta QP value
static const int MAX_TESTED_QPs = ( 1 + 1 + ( MAX_DELTA_QP << 1 ) ); ///< dqp=0 +- max_delta_qp + lossless mode
#if JVET_L0285_8BIT_TRANSFORM_CORE
static const int COM16_C806_TRANS_PREC = 0;
#else
static const int COM16_C806_TRANS_PREC = 2;
#endif
static const int NUM_MERGE_IDX_EXT_CTX = 5;
static const unsigned E0104_ALF_MAX_TEMPLAYERID = 5; // define to zero to switch of code
......
......@@ -318,11 +318,7 @@ uint32_t deriveWeightIdxBits(uint8_t gbiIdx) // Note: align this with TEncSbac::
// initialize ROM variables
void initROM()
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
int c;
#else
int i, c;
#endif
#if RExt__HIGH_BIT_DEPTH_SUPPORT
{
......@@ -372,51 +368,6 @@ void initROM()
g_aucLog2 [i] = c;
}
#if !JVET_L0285_8BIT_TRANSFORM_CORE
c = 2; //for the 2x2 transforms if QTBT is on
const double PI = 3.14159265358979323846;
for (i = 0; i < g_numTransformMatrixSizes; i++)
{
TMatrixCoeff *iT = NULL;
const double s = sqrt((double)c) * (64 << COM16_C806_TRANS_PREC);
switch (i)
{
case 0: iT = g_aiTr2[0][0]; break;
case 1: iT = g_aiTr4[0][0]; break;
case 2: iT = g_aiTr8[0][0]; break;
case 3: iT = g_aiTr16[0][0]; break;
case 4: iT = g_aiTr32[0][0]; break;
case 5: iT = g_aiTr64[0][0]; break;
default: exit(0); break;
}
for (int k = 0; k < c; k++)
{
for (int n = 0; n < c; n++)
{
double w0, v;
// DCT-II
w0 = k == 0 ? sqrt(0.5) : 1;
v = cos(PI*(n + 0.5)*k / c) * w0 * sqrt(2.0 / c);
iT[DCT2*c*c + k*c + n] = (int16_t)(s * v + (v > 0 ? 0.5 : -0.5));
// DCT-VIII
v = cos(PI*(k + 0.5)*(n + 0.5) / (c + 0.5)) * sqrt(2.0 / (c + 0.5));
iT[DCT8*c*c + k*c + n] = (int16_t)(s * v + (v > 0 ? 0.5 : -0.5));
// DST-VII
v = sin(PI*(k + 0.5)*(n + 1) / (c + 0.5)) * sqrt(2.0 / (c + 0.5));
iT[DST7*c*c + k*c + n] = (int16_t)(s * v + (v > 0 ? 0.5 : -0.5));
}
}
c <<= 1;
}
#endif
gp_sizeIdxInfo = new SizeIndexInfoLog2();
gp_sizeIdxInfo->init(MAX_CU_SIZE);
......@@ -620,15 +571,6 @@ const int g_invQuantScales[SCALING_LIST_REM_NUM] =
//EMT threshold
#if !JVET_L0285_8BIT_TRANSFORM_CORE
//EMT transform coeficient variable
TMatrixCoeff g_aiTr2 [NUM_TRANS_TYPE][ 2][ 2];
TMatrixCoeff g_aiTr4 [NUM_TRANS_TYPE][ 4][ 4];
TMatrixCoeff g_aiTr8 [NUM_TRANS_TYPE][ 8][ 8];
TMatrixCoeff g_aiTr16 [NUM_TRANS_TYPE][ 16][ 16];
TMatrixCoeff g_aiTr32 [NUM_TRANS_TYPE][ 32][ 32];
TMatrixCoeff g_aiTr64 [NUM_TRANS_TYPE][ 64][ 64];
#endif
//--------------------------------------------------------------------------------------------------
//coefficients
......
......@@ -119,7 +119,6 @@ extern const TMatrixCoeff g_as_DST_MAT_4 [TRANSFORM_NUMBER_OF_DIRECTIONS][4][4];
extern const uint32_t g_EmtSigNumThr;
#if JVET_L0285_8BIT_TRANSFORM_CORE
extern const TMatrixCoeff g_trCoreDCT2P2 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 2][ 2];
extern const TMatrixCoeff g_trCoreDCT2P4 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 4][ 4];
extern const TMatrixCoeff g_trCoreDCT2P8 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 8][ 8];
......@@ -136,14 +135,6 @@ extern const TMatrixCoeff g_trCoreDST7P4 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 4][
extern const TMatrixCoeff g_trCoreDST7P8 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 8][ 8];
extern const TMatrixCoeff g_trCoreDST7P16 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 16][ 16];
extern const TMatrixCoeff g_trCoreDST7P32 [TRANSFORM_NUMBER_OF_DIRECTIONS][ 32][ 32];
#else
extern TMatrixCoeff g_aiTr2 [NUM_TRANS_TYPE][ 2][ 2];
extern TMatrixCoeff g_aiTr4 [NUM_TRANS_TYPE][ 4][ 4];
extern TMatrixCoeff g_aiTr8 [NUM_TRANS_TYPE][ 8][ 8];
extern TMatrixCoeff g_aiTr16 [NUM_TRANS_TYPE][ 16][ 16];
extern TMatrixCoeff g_aiTr32 [NUM_TRANS_TYPE][ 32][ 32];
extern TMatrixCoeff g_aiTr64 [NUM_TRANS_TYPE][ 64][ 64];
#endif
// ====================================================================================================================
// Decision tree templates
......
......@@ -37,7 +37,6 @@
#include "Rom.h"
#if JVET_L0285_8BIT_TRANSFORM_CORE
// DCT-2
#define DEFINE_DCT2_P2_MATRIX(a) \
......@@ -427,6 +426,5 @@ const TMatrixCoeff g_trCoreDST7P32[TRANSFORM_NUMBER_OF_DIRECTIONS][32][32] =
DEFINE_DST7_P32_MATRIX(4, 9, 13, 17, 21, 26, 30, 34, 38, 42, 45, 50, 53, 56, 60, 63, 66, 68, 72, 74, 77, 78, 80, 82, 84, 85, 86, 88, 88, 89, 90, 90),
DEFINE_DST7_P32_MATRIX(4, 9, 13, 17, 21, 26, 30, 34, 38, 42, 45, 50, 53, 56, 60, 63, 66, 68, 72, 74, 77, 78, 80, 82, 84, 85, 86, 88, 88, 89, 90, 90)
};
#endif // JVET_L0285_8BIT_TRANSFORM_CORE
//--------------------------------------------------------------------------------------------------
......@@ -54,11 +54,7 @@ void fastForwardDCT2_B2(const TCoeff *src, TCoeff *dst, int shift, int line, int
int E, O;
TCoeff add = (shift > 0) ? (1 << (shift - 1)) : 0;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P2[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr2[DCT2][0];
#endif
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
......@@ -92,11 +88,7 @@ void fastInverseDCT2_B2(const TCoeff *src, TCoeff *dst, int shift, int line, int
int E, O;
int add = 1 << (shift - 1);
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P2[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr2[DCT2][0];
#endif
const int reducedLine = line - iSkipLine;
for (j = 0; j<reducedLine; j++)
......@@ -142,11 +134,7 @@ void fastForwardDCT2_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int
TCoeff E[2], O[2];
TCoeff add = (shift > 0) ? (1 << (shift - 1)) : 0;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P4[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr4[DCT2][0];
#endif
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
......@@ -191,11 +179,7 @@ void fastInverseDCT2_B4( const TCoeff *src, TCoeff *dst, int shift, int line, in
int E[2], O[2];
int add = 1 << ( shift - 1 );
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P4[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr4[DCT2][0];
#endif
const int reducedLine = line - iSkipLine;
for( j = 0; j < reducedLine; j++ )
......@@ -307,11 +291,7 @@ void fastForwardDCT2_B8( const TCoeff *src, TCoeff *dst, int shift, int line, in
TCoeff EE[2], EO[2];
TCoeff add = ( shift > 0 ) ? ( 1 << ( shift - 1 ) ) : 0;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P8[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr8[DCT2][0];
#endif
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
......@@ -368,11 +348,7 @@ void fastInverseDCT2_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int
int EE[2], EO[2];
int add = 1 << (shift - 1);
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P8[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr8[DCT2][0];
#endif
const int reducedLine = line - iSkipLine;
for( j = 0; j < reducedLine; j++ )
......@@ -423,11 +399,7 @@ void fastForwardDCT2_B16(const TCoeff *src, TCoeff *dst, int shift, int line, in
TCoeff EEE[2], EEO[2];
TCoeff add = ( shift > 0 ) ? ( 1 << ( shift - 1 ) ) : 0;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P16[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr16[DCT2][0];
#endif
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
......@@ -498,11 +470,7 @@ void fastInverseDCT2_B16( const TCoeff *src, TCoeff *dst, int shift, int line, i
int EEE[2], EEO[2];
int add = 1 << ( shift - 1 );
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P16[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr16[DCT2][0];
#endif
const int reducedLine = line - iSkipLine;
......@@ -565,11 +533,7 @@ void fastForwardDCT2_B32( const TCoeff *src, TCoeff *dst, int shift, int line, i
TCoeff EEEE[ 2], EEEO[ 2];
TCoeff add = ( shift > 0 ) ? ( 1 << ( shift - 1 ) ) : 0;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P32[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr32[DCT2][0];
#endif
TCoeff *pCoef = dst;
const int reducedLine = line - iSkipLine;
......@@ -651,11 +615,7 @@ void fastInverseDCT2_B32(const TCoeff *src, TCoeff *dst, int shift, int line, in
int EEEE[2], EEEO[2];
int add = 1 << (shift - 1);
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P32[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr32[DCT2][0];
#endif
const int reducedLine = line - iSkipLine;
for (j = 0; j<reducedLine; j++)
......@@ -716,11 +676,7 @@ void fastForwardDCT2_B64(const TCoeff *src, TCoeff *dst, int shift, int line, in
int rnd_factor = 1 << (shift - 1);
const int uiTrSize = 64;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P64[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr64[DCT2][0];
#endif
int j, k;
TCoeff E[32], O[32];
......@@ -825,11 +781,7 @@ void fastInverseDCT2_B64(const TCoeff *src, TCoeff *dst, int shift, int line, in
{
int rnd_factor = 1 << (shift - 1);
const int uiTrSize = 64;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT2P64[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr64[DCT2][0];
#endif
int j, k;
TCoeff E[32], O[32];
......@@ -917,13 +869,7 @@ void fastForwardDST7_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int
int i;
TCoeff rnd_factor = (shift > 0) ? (1 << (shift - 1)) : 0;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDST7P4[TRANSFORM_FORWARD][0];
#elif HEVC_USE_4x4_DSTVII
const TMatrixCoeff *iT = use ? g_aiTr4[DST7][0] : g_as_DST_MAT_4[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr4[DST7][0];
#endif
int c[4];
TCoeff *pCoeff = dst;
......@@ -961,13 +907,7 @@ void fastInverseDST7_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int
TCoeff c[4];
TCoeff rnd_factor = (shift > 0) ? (1 << (shift - 1)) : 0;
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDST7P4[TRANSFORM_INVERSE][0];
#elif HEVC_USE_4x4_DSTVII
const TMatrixCoeff *iT = use ? g_aiTr4[DST7][0] : g_as_DST_MAT_4[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr4[DST7][0];
#endif
const int reducedLine = line - iSkipLine;
for (i = 0; i<reducedLine; i++)
......@@ -996,58 +936,34 @@ void fastInverseDST7_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int
void fastForwardDST7_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastForwardMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_trCoreDST7P8[TRANSFORM_FORWARD][0] );
#else
_fastForwardMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr8[DST7][0] );
#endif
}
void fastInverseDST7_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastInverseMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_trCoreDST7P8[TRANSFORM_INVERSE][0]);
#else
_fastInverseMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr8[DST7][0] );
#endif
}
void fastForwardDST7_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastForwardMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_trCoreDST7P16[TRANSFORM_FORWARD][0] );
#else
_fastForwardMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr16[DST7][0] );
#endif
}
void fastInverseDST7_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastInverseMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_trCoreDST7P16[TRANSFORM_INVERSE][0]);
#else
_fastInverseMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr16[DST7][0] );
#endif
}
void fastForwardDST7_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastForwardMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_trCoreDST7P32[TRANSFORM_FORWARD][0] );
#else
_fastForwardMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr32[DST7][0] );
#endif
}
void fastInverseDST7_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastInverseMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_trCoreDST7P32[TRANSFORM_INVERSE][0] );
#else
_fastInverseMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr32[DST7][0] );
#endif
}
......@@ -1056,11 +972,7 @@ void fastForwardDCT8_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int
{
int i;
int rnd_factor = 1 << (shift - 1);
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT8P4[TRANSFORM_FORWARD][0];
#else
const TMatrixCoeff *iT = g_aiTr4[DCT8][0];
#endif
int c[4];
TCoeff *pCoeff = dst;
......@@ -1097,11 +1009,7 @@ void fastInverseDCT8_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int
int i;
int rnd_factor = 1 << (shift - 1);
#if JVET_L0285_8BIT_TRANSFORM_CORE
const TMatrixCoeff *iT = g_trCoreDCT8P4[TRANSFORM_INVERSE][0];
#else
const TMatrixCoeff *iT = g_aiTr4[DCT8][0];
#endif
int c[4];
const int reducedLine = line - iSkipLine;
......@@ -1130,57 +1038,33 @@ void fastInverseDCT8_B4(const TCoeff *src, TCoeff *dst, int shift, int line, int
void fastForwardDCT8_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastForwardMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_trCoreDCT8P8[TRANSFORM_FORWARD][0] );
#else
_fastForwardMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr8[DCT8][0] );
#endif
}
void fastInverseDCT8_B8(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastInverseMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_trCoreDCT8P8[TRANSFORM_INVERSE][0] );
#else
_fastInverseMM< 8 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr8[DCT8][0] );
#endif
}
void fastForwardDCT8_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastForwardMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_trCoreDCT8P16[TRANSFORM_FORWARD][0] );
#else
_fastForwardMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr16[DCT8][0] );
#endif
}
void fastInverseDCT8_B16(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastInverseMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_trCoreDCT8P16[TRANSFORM_INVERSE][0] );
#else
_fastInverseMM< 16 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr16[DCT8][0] );
#endif
}
void fastForwardDCT8_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastForwardMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_trCoreDCT8P32[TRANSFORM_FORWARD][0] );
#else
_fastForwardMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, g_aiTr32[DCT8][0] );
#endif
}
void fastInverseDCT8_B32(const TCoeff *src, TCoeff *dst, int shift, int line, int iSkipLine, int iSkipLine2, const TCoeff outputMinimum, const TCoeff outputMaximum)
{
#if JVET_L0285_8BIT_TRANSFORM_CORE
_fastInverseMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_trCoreDCT8P32[TRANSFORM_INVERSE][0] );
#else
_fastInverseMM< 32 >( src, dst, shift, line, iSkipLine, iSkipLine2, outputMinimum, outputMaximum, g_aiTr32[DCT8][0] );
#endif
}
......@@ -57,7 +57,6 @@
#define JVET_L0285_8BIT_TRANSFORM_CORE 1 // Primary transform using 8-bit cores
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment