Commit c706f951 authored by Karsten Suehring's avatar Karsten Suehring

remove macro JVET_L0165_6MPM

parent 958c49b4
......@@ -225,11 +225,7 @@ static const uint8_t INTER_MODE_IDX = 255; ///< in
static const uint32_t EMT_INTRA_MAX_CU_WITH_QTBT = 32; ///< Max Intra CU size applying EMT, supported values: 8, 16, 32, 64, 128
static const uint32_t EMT_INTER_MAX_CU_WITH_QTBT = 32; ///< Max Inter CU size applying EMT, supported values: 8, 16, 32, 64, 128
#if JVET_L0165_6MPM
static const int NUM_MOST_PROBABLE_MODES = 6;
#else
static const int NUM_MOST_PROBABLE_MODES = 3;
#endif
static const int LM_SYMBOL_NUM = (1 + NUM_LMC_MODE);
static const int FAST_UDI_MAX_RDMODE_NUM = NUM_LUMA_MODE; ///< maximum number of RD comparison in fast-UDI estimation loop
......
......@@ -54,7 +54,6 @@
#define TRAINED_CABAC_INIT_TABLES 1 // Trained values for VTM3
#define JVET_L0165_6MPM 1 // Use 6 MPM for 67 intra prediction modes
#define JVET_L0279_WAIP_CLEANUP 1 // WAIP cleanup
#define JVET_L0118_ALIGN_MTS_INDEX 1 // Align mts_index on intra and inter
......
......@@ -299,7 +299,6 @@ int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType
#endif
{
int numCand = -1;
#if JVET_L0165_6MPM
int leftIntraDir = PLANAR_IDX, aboveIntraDir = PLANAR_IDX;
const CompArea &area = pu.block(getFirstComponentOfChannel(channelType));
......@@ -448,145 +447,6 @@ int PU::getIntraMPMs( const PredictionUnit &pu, unsigned* mpm, const ChannelType
}
#if JVET_L0283_MULTI_REF_LINE
}
#endif
#else
int leftIntraDir = DC_IDX, aboveIntraDir = DC_IDX;
const CompArea &area = pu.block(getFirstComponentOfChannel(channelType));
const Position &pos = area.pos();
// Get intra direction of left PU
const PredictionUnit *puLeft = pu.cs->getPURestricted(pos.offset(-1, 0), pu, channelType);
if (puLeft && (CU::isIntra(*puLeft->cu) || (channelType == CHANNEL_TYPE_LUMA && puLeft->mhIntraFlag)))
{
leftIntraDir = puLeft->intraDir[channelType];
if (isChroma(channelType) && leftIntraDir == DM_CHROMA_IDX)
{
leftIntraDir = puLeft->intraDir[0];
}
}
// Get intra direction of above PU
const PredictionUnit *puAbove = pu.cs->getPURestricted(pos.offset(0, -1), pu, channelType);
if (puAbove && (CU::isIntra(*puAbove->cu) || (channelType == CHANNEL_TYPE_LUMA && puAbove->mhIntraFlag)) && CU::isSameCtu(*pu.cu, *puAbove->cu))
{
aboveIntraDir = puAbove->intraDir[channelType];
if (isChroma(channelType) && aboveIntraDir == DM_CHROMA_IDX)
{
aboveIntraDir = puAbove->intraDir[0];
}
}
CHECK(2 >= numMPMs, "Invalid number of most probable modes");
const int offset = 61;
const int mod = 64;
#if JVET_L0283_MULTI_REF_LINE
if (extendRefLine)
{
if (leftIntraDir == aboveIntraDir)
{
numCand = 1;
if (leftIntraDir > DC_IDX) // angular modes
{
mpm[0] = leftIntraDir;
mpm[1] = ((leftIntraDir + offset) % mod) + 2;
mpm[2] = ((leftIntraDir - 1) % mod) + 2;
}
else // non-angular
{
mpm[0] = 2;
mpm[1] = HOR_IDX;
mpm[2] = VER_IDX;
}
}
else
{
numCand = 2;
if (leftIntraDir <= DC_IDX && aboveIntraDir <= DC_IDX) // both non-angular
{
mpm[0] = 2;
mpm[1] = HOR_IDX;
mpm[2] = VER_IDX;
}
else if (leftIntraDir <= DC_IDX) // left non-angular
{
mpm[0] = aboveIntraDir;
mpm[1] = ((aboveIntraDir + offset) % mod) + 2;
mpm[2] = ((aboveIntraDir - 1) % mod) + 2;
}
else if (aboveIntraDir <= DC_IDX) // above non-angular
{
mpm[0] = leftIntraDir;
mpm[1] = ((leftIntraDir + offset) % mod) + 2;
mpm[2] = ((leftIntraDir - 1) % mod) + 2;
}
else // both angular
{
mpm[0] = leftIntraDir;
mpm[1] = aboveIntraDir;
if (leftIntraDir == VER_IDX)
{
mpm[2] = aboveIntraDir == HOR_IDX ? 2 : HOR_IDX;
}
else if (leftIntraDir == HOR_IDX)
{
mpm[2] = aboveIntraDir == VER_IDX ? 2 : VER_IDX;
}
else
{
mpm[2] = aboveIntraDir == VER_IDX ? HOR_IDX : VER_IDX;
}
}
}
}
else
{
#endif
if (leftIntraDir == aboveIntraDir)
{
numCand = 1;
if (leftIntraDir > DC_IDX) // angular modes
{
mpm[0] = leftIntraDir;
mpm[1] = ((leftIntraDir + offset) % mod) + 2;
mpm[2] = ((leftIntraDir - 1) % mod) + 2;
}
else // non-angular
{
mpm[0] = PLANAR_IDX;
mpm[1] = DC_IDX;
mpm[2] = VER_IDX;
}
}
else
{
numCand = 2;
mpm[0] = leftIntraDir;
mpm[1] = aboveIntraDir;
if (leftIntraDir && aboveIntraDir) // both modes are non-planar
{
mpm[2] = PLANAR_IDX;
}
else
{
mpm[2] = (leftIntraDir + aboveIntraDir) < 2 ? VER_IDX : DC_IDX;
}
}
#if JVET_L0283_MULTI_REF_LINE
}
#endif
#endif
for (int i = 0; i < numMPMs; i++)
{
......
......@@ -952,7 +952,6 @@ void CABACReader::cu_gbi_flag(CodingUnit& cu)
}
#endif
#if JVET_L0165_6MPM
void CABACReader::xReadTruncBinCode(uint32_t& symbol, uint32_t maxSymbol)
{
int thresh;
......@@ -984,7 +983,6 @@ void CABACReader::xReadTruncBinCode(uint32_t& symbol, uint32_t maxSymbol)
symbol -= (val - b);
}
}
#endif
#if JVET_L0283_MULTI_REF_LINE
void CABACReader::extend_ref_line(CodingUnit& cu)
{
......@@ -1068,7 +1066,6 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
{
ipred_idx += m_BinDecoder.decodeBinEP();
}
#if JVET_L0165_6MPM
if (ipred_idx > 1)
{
ipred_idx += m_BinDecoder.decodeBinEP();
......@@ -1081,7 +1078,6 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
{
ipred_idx += m_BinDecoder.decodeBinEP();
}
#endif
}
pu->intraDir[0] = mpm_pred[ipred_idx];
}
......@@ -1090,11 +1086,7 @@ void CABACReader::intra_luma_pred_modes( CodingUnit &cu )
unsigned ipred_mode = 0;
{
#if JVET_L0165_6MPM
xReadTruncBinCode(ipred_mode, NUM_LUMA_MODE - NUM_MOST_PROBABLE_MODES);
#else
ipred_mode = m_BinDecoder.decodeBinsEP(6);
#endif
}
//postponed sorting of MPMs (only in remaining branch)
std::sort( mpm_pred, mpm_pred + NUM_MOST_PROBABLE_MODES );
......
......@@ -152,9 +152,7 @@ private:
unsigned decode_sparse_dt ( DecisionTree& dt );
unsigned get_num_bits_read () { return m_BinDecoder.getNumBitsRead(); }
#if JVET_L0165_6MPM
void xReadTruncBinCode(uint32_t& symbol, uint32_t maxSymbol);
#endif
private:
BinDecoderBase& m_BinDecoder;
......
......@@ -822,7 +822,6 @@ void CABACWriter::cu_gbi_flag(const CodingUnit& cu)
}
#endif
#if JVET_L0165_6MPM
void CABACWriter::xWriteTruncBinCode(uint32_t symbol, uint32_t maxSymbol)
{
int thresh;
......@@ -860,7 +859,6 @@ void CABACWriter::xWriteTruncBinCode(uint32_t symbol, uint32_t maxSymbol)
m_BinEncoder.encodeBinsEP(symbol, thresh + 1);
}
}
#endif
#if JVET_L0283_MULTI_REF_LINE
void CABACWriter::extend_ref_line(const PredictionUnit& pu)
......@@ -986,7 +984,6 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
{
m_BinEncoder.encodeBinEP( mpm_idx > 1 );
}
#if JVET_L0165_6MPM
if (mpm_idx > 1)
{
m_BinEncoder.encodeBinEP(mpm_idx > 2);
......@@ -999,7 +996,6 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
{
m_BinEncoder.encodeBinEP(mpm_idx > 4);
}
#endif
}
}
else
......@@ -1019,11 +1015,7 @@ void CABACWriter::intra_luma_pred_modes( const CodingUnit& cu )
}
}
CHECK(ipred_mode >= 64, "Incorrect mode");
#if JVET_L0165_6MPM
xWriteTruncBinCode(ipred_mode, NUM_LUMA_MODE - NUM_MOST_PROBABLE_MODES); // Remaining mode is truncated binary coded
#else
m_BinEncoder.encodeBinsEP(ipred_mode, 6);
#endif
}
}
......@@ -1071,7 +1063,6 @@ void CABACWriter::intra_luma_pred_mode( const PredictionUnit& pu )
{
m_BinEncoder.encodeBinEP( mpm_idx > 1 );
}
#if JVET_L0165_6MPM
if (mpm_idx > 1)
{
m_BinEncoder.encodeBinEP(mpm_idx > 2);
......@@ -1084,7 +1075,6 @@ void CABACWriter::intra_luma_pred_mode( const PredictionUnit& pu )
{
m_BinEncoder.encodeBinEP(mpm_idx > 4);
}
#endif
}
}
else
......@@ -1098,11 +1088,7 @@ void CABACWriter::intra_luma_pred_mode( const PredictionUnit& pu )
ipred_mode--;
}
}
#if JVET_L0165_6MPM
xWriteTruncBinCode(ipred_mode, NUM_LUMA_MODE - NUM_MOST_PROBABLE_MODES); // Remaining mode is truncated binary coded
#else
m_BinEncoder.encodeBinsEP(ipred_mode, 6);
#endif
}
}
}
......
......@@ -174,9 +174,7 @@ private:
// statistic
unsigned get_num_written_bits() { return m_BinEncoder.getNumWrittenBits(); }
#if JVET_L0165_6MPM
void xWriteTruncBinCode(uint32_t uiSymbol, uint32_t uiMaxSymbol);
#endif
private:
BinEncIf& m_BinEncoder;
......
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