...
 
Commits (199)
......@@ -71,8 +71,8 @@ SEIDecodedPictureHash : 0
CbQpOffset : 0
CrQpOffset : 0
SameCQPTablesForAllChroma : 1
QpInValCb : 2 31 43
QpOutValCb : 2 32 41
QpInValCb : 1 31 43
QpOutValCb : 1 32 41
TemporalSubsampleRatio : 8
ReWriteParamSets : 1
......@@ -91,7 +91,7 @@ MaxMTTHierarchyDepthISliceL : 3
MaxMTTHierarchyDepthISliceC : 3
MTS : 1
MTSIntraMaxCand : 3
MTSIntraMaxCand : 4
MTSInterMaxCand : 4
SBT : 1
LFNST : 1
......
......@@ -120,7 +120,7 @@ MaxMTTHierarchyDepthISliceL : 3
MaxMTTHierarchyDepthISliceC : 3
MTS : 1
MTSIntraMaxCand : 3
MTSIntraMaxCand : 4
MTSInterMaxCand : 4
SBT : 1
LFNST : 1
......
......@@ -86,6 +86,9 @@ LFCrossSliceBoundaryFlag : 1 # In-loop filtering, including ALF a
#============ Tiles ================
TileUniformSpacing : 0 # 0: the column boundaries are indicated by TileColumnWidth array, the row boundaries are indicated by TileRowHeight array
# 1: the column and row boundaries are distributed uniformly
UniformTileColsWidthMinus1 : 0 # Width to use if TileUniformSpacing is equal to 1
UniformTileRowHeightMinus1 : 0 # Height to use if TileUniformSpacing is equal to 1
NumTileColumnsMinus1 : 1 # Number of tile columns in a picture minus 1
TileColumnWidthArray : 2 # Array containing tile column width values in units of CTU (from left to right in picture)
NumTileRowsMinus1 : 1 # Number of tile rows in a picture minus 1
......
......@@ -86,6 +86,8 @@ LFCrossSliceBoundaryFlag : 1 # In-loop filtering, including ALF a
#============ Tiles ================
TileUniformSpacing : 0 # 0: the column boundaries are indicated by TileColumnWidth array, the row boundaries are indicated by TileRowHeight array
# 1: the column and row boundaries are distributed uniformly
UniformTileColsWidthMinus1 : 0 # Width to use if TileUniformSpacing is equal to 1
UniformTileRowHeightMinus1 : 0 # Height to use if TileUniformSpacing is equal to 1
NumTileColumnsMinus1 : 3 # Number of tile columns in a picture minus 1
TileColumnWidthArray : 1 1 1 # Array containing tile column width values in units of CTU (from left to right in picture)
NumTileRowsMinus1 : 1 # Number of tile rows in a picture minus 1
......
......@@ -84,8 +84,11 @@ LFCrossSliceBoundaryFlag : 1 # In-loop filtering, including ALF a
# 0:not across, 1: across
#============ Tiles ================
TileUniformSpacing : 0 # 0: the column boundaries are indicated by TileColumnWidth array, the row boundaries are indicated by TileRowHeight array
TileUniformSpacing : 1 # 0: the column boundaries are indicated by TileColumnWidth array, the row boundaries are indicated by TileRowHeight array
# 1: the column and row boundaries are distributed uniformly
UniformTileColsWidthMinus1 : 1 # Width to use if TileUniformSpacing is equal to 1
UniformTileRowHeightMinus1 : 0 # Height to use if TileUniformSpacing is equal to 1
NumTileColumnsMinus1 : 1 # Number of tile columns in a picture minus 1
TileColumnWidthArray : 2 # Array containing tile column width values in units of CTU (from left to right in picture)
NumTileRowsMinus1 : 1 # Number of tile rows in a picture minus 1
......
......@@ -16,8 +16,8 @@ WCGPPSCrQpScale : 1.79 # Scale factor depending on capture
CbQpOffset : 0
CrQpOffset : 0
SameCQPTablesForAllChroma : 1
QpInValCb : 10 23 32 42
QpOutValCb : 10 24 32 37
QpInValCb : 9 23 33 42
QpOutValCb : 9 24 33 37
CclmCollocatedChroma : 1
......
......@@ -11,5 +11,5 @@ WCGPPSEnable : 0 # enable WCG Chroma scale
CbQpOffset : 0
CrQpOffset : 0
SameCQPTablesForAllChroma : 1
QpInValCb : 10 23 32 42
QpOutValCb : 10 24 32 37
QpInValCb : 9 23 33 42
QpOutValCb : 9 24 33 37
No preview for this file type
......@@ -1761,6 +1761,13 @@ Controls the mode used to determine per row and column tile sizes.
\end{tabular}
\\
\Option{UniformTileColsWidthMinus1}%
\Option{UniformTileRowHeightMinus1} &
%\ShortOption{\None} &
\Default{-1} &
Specifies the tile width and height to use if TileUniformSpacing is set to 1.
\\
\Option{NumTileColumnsMinus1}%
\Option{NumTileRowsMinus1} &
%\ShortOption{\None} &
......
This diff is collapsed.
......@@ -114,9 +114,7 @@ bool DecAppCfg::parseCfg( int argc, char* argv[] )
"\t3: enable bit and tool statistic\n")
#endif
("MCTSCheck", m_mctsCheck, false, "If enabled, the decoder checks for violations of mc_exact_sample_value_match_flag in Temporal MCTS ")
#if JVET_O1164_RPR
( "UpscaledOutput", m_upscaledOutput, 0, "Upscaled output for RPR" )
#endif
;
po::setDefaults(opts);
......
......@@ -76,9 +76,7 @@ protected:
int m_statMode; ///< Config statistic mode (0 - bit stat, 1 - tool stat, 3 - both)
bool m_mctsCheck;
#if JVET_O1164_RPR
int m_upscaledOutput; ////< Output upscaled (2), decoded but in full resolution buffer (1) or decoded cropped (0, default) picture for RPR.
#endif
public:
DecAppCfg();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -59,12 +59,6 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
SPS* sps = NULL;
uint32_t firstSliceSegmentInPic;
#if !JVET_N0865_SYNTAX
if (isRapPic)
{
READ_FLAG(uiCode, "no_output_of_prior_pics_flag"); // ignored -- updated already
}
#endif
READ_UVLC(uiCode, "slice_pic_parameter_set_id");
pps = parameterSetManager->getPPS(uiCode);
//!KS: need to add error handling code here, if PPS is not available
......@@ -112,6 +106,9 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
{
READ_UVLC(uiCode, "num_bricks_in_slice_minus1");
}
READ_FLAG(uiCode, "non_reference_picture_flag");
//set uiCode to equal slice start address (or dependent slice start address)
for (int i = 0; i < pps->getNumExtraSliceHeaderBits(); i++)
{
......@@ -119,12 +116,6 @@ bool ParcatHLSyntaxReader::parseSliceHeaderUpToPoc ( ParameterSetManager *parame
}
READ_UVLC ( uiCode, "slice_type" );
#if !JVET_N0865_SYNTAX
if( pps->getOutputFlagPresentFlag() )
{
READ_FLAG( uiCode, "pic_output_flag" );
}
#endif
return firstSliceSegmentInPic;
......@@ -191,9 +182,8 @@ const bool verbose = false;
const char * NALU_TYPE[] =
{
#if JVET_O0179
"NAL_UNIT_CODED_SLICE_TRAIL",
"NAL_UNIT_CODED_SLICE_STSA",
"NAL_UNIT_CODED_SLICE_STSA",
"NAL_UNIT_CODED_SLICE_RASL",
"NAL_UNIT_CODED_SLICE_RADL",
"NAL_UNIT_RESERVED_VCL_4",
......@@ -203,16 +193,12 @@ const char * NALU_TYPE[] =
"NAL_UNIT_CODED_SLICE_IDR_W_RADL",
"NAL_UNIT_CODED_SLICE_IDR_N_LP",
"NAL_UNIT_CODED_SLICE_CRA",
#if JVET_N0865_GRA2GDR
"NAL_UNIT_CODED_SLICE_GDR",
#else
"NAL_UNIT_CODED_SLICE_GRA",
#endif
"NAL_UNIT_RESERVED_IRAP_VCL12",
"NAL_UNIT_RESERVED_IRAP_VCL13",
"NAL_UNIT_RESERVED_VCL14",
"NAL_UNIT_RESERVED_VCL15",
"NAL_UNIT_SPS",
"NAL_UNIT_SPS",
"NAL_UNIT_PPS",
"NAL_UNIT_APS",
"NAL_UNIT_ACCESS_UNIT_DELIMITER",
......@@ -228,44 +214,6 @@ const char * NALU_TYPE[] =
"NAL_UNIT_UNSPECIFIED_29",
"NAL_UNIT_UNSPECIFIED_30",
"NAL_UNIT_UNSPECIFIED_31"
#else
"NAL_UNIT_PPS",
"NAL_UNIT_ACCESS_UNIT_DELIMITER",
"NAL_UNIT_PREFIX_SEI",
"NAL_UNIT_SUFFIX_SEI",
"NAL_UNIT_APS",
"NAL_UNIT_RESERVED_NVCL_5",
"NAL_UNIT_RESERVED_NVCL_6",
"NAL_UNIT_RESERVED_NVCL_7",
"NAL_UNIT_CODED_SLICE_TRAIL",
"NAL_UNIT_CODED_SLICE_STSA",
"NAL_UNIT_CODED_SLICE_RADL",
"NAL_UNIT_CODED_SLICE_RASL",
"NAL_UNIT_RESERVED_VCL_12",
"NAL_UNIT_RESERVED_VCL_13",
"NAL_UNIT_RESERVED_VCL_14",
"NAL_UNIT_RESERVED_VCL_15",
"NAL_UNIT_DPS",
"NAL_UNIT_SPS",
"NAL_UNIT_EOS",
"NAL_UNIT_EOB",
"NAL_UNIT_VPS",
"NAL_UNIT_RESERVED_NVCL_21",
"NAL_UNIT_RESERVED_NVCL_22",
"NAL_UNIT_RESERVED_NVCL_23",
"NAL_UNIT_CODED_SLICE_IDR_W_RADL",
"NAL_UNIT_CODED_SLICE_IDR_N_LP",
"NAL_UNIT_CODED_SLICE_CRA",
#if JVET_N0865_GRA2GDR
"NAL_UNIT_CODED_SLICE_GDR",
#else
"NAL_UNIT_CODED_SLICE_GRA",
#endif
"NAL_UNIT_UNSPECIFIED_28",
"NAL_UNIT_UNSPECIFIED_29",
"NAL_UNIT_UNSPECIFIED_30",
"NAL_UNIT_UNSPECIFIED_31"
#endif
};
int calc_poc(int iPOClsb, int prevTid0POC, int getBitsForPOC, int nalu_type)
......@@ -321,10 +269,10 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
p += nal_start;
std::vector<uint8_t> nalu(p, p + nal_end - nal_start);
int nalu_header = nalu[0];
bool zeroTidRequiredFlag = (nalu_header & ( 1 << 7 )) >> 7;
int nalUnitTypeLsb = (((1 << 4) - 1) & nalu_header);
int nalu_type = ((zeroTidRequiredFlag << 4) + nalUnitTypeLsb);
int nalu_type = nalu[1] >> 3;
#if ENABLE_TRACING
printf ("NALU Type: %d (%s)\n", nalu_type, NALU_TYPE[nalu_type]);
#endif
int poc = -1;
int poc_lsb = -1;
int new_poc = -1;
......@@ -358,7 +306,7 @@ std::vector<uint8_t> filter_segment(const std::vector<uint8_t> & v, int idx, int
poc = 0;
new_poc = *poc_base + poc;
}
if((nalu_type > 7 && nalu_type < 15) || nalu_type == NAL_UNIT_CODED_SLICE_CRA)
if((nalu_type < 7) || (nalu_type > 9 && nalu_type < 15) )
{
parcatHLSReader.setBitstream( &inp_nalu.getBitstream() );
bool isRapPic =
......
......@@ -72,28 +72,11 @@ void read2(InputNALUnit& nalu)
{
InputBitstream& bs = nalu.getBitstream();
#if JVET_O0179
nalu.m_forbiddenZeroBit = bs.read(1); // forbidden zero bit
nalu.m_nuhReservedZeroBit = bs.read(1); // nuh_reserved_zero_bit
nalu.m_nuhLayerId = bs.read(6); // nuh_layer_id
nalu.m_nalUnitType = (NalUnitType) bs.read(5); // nal_unit_type
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
#else
bool zeroTidRequiredFlag = bs.read(1); // zero_tid_required_flag
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
CHECK(nalu.m_temporalId < 0, "Temporal ID is negative.");
//When zero_tid_required_flag is equal to 1, the value of nuh_temporal_id_plus1 shall be equal to 1.
CHECK((zeroTidRequiredFlag == 1) && (nalu.m_temporalId != 0), "Temporal ID is not '0' when zero tid is required.");
uint32_t nalUnitTypeLsb = bs.read(4); // nal_unit_type_lsb
nalu.m_nalUnitType = (NalUnitType) ((zeroTidRequiredFlag << 4) + nalUnitTypeLsb);
nalu.m_nuhLayerId = bs.read(7); // nuh_layer_id
CHECK(nalu.m_nuhLayerId == 0, "nuh_layer_id_plus1 must be greater than zero");
nalu.m_nuhLayerId--;
CHECK(nalu.m_nuhLayerId > 125, "Layer ID out of range");
CHECK((nalu.m_nuhLayerId < 0) || (nalu.m_nuhLayerId > 126), "Layer ID out of range");
uint32_t nuh_reserved_zero_bit = bs.read(1); // nuh_reserved_zero_bit
CHECK(nuh_reserved_zero_bit != 0, "Reserved zero bit is not '0'");
#endif
}
uint32_t SEIRemovalApp::decode()
......
......@@ -76,28 +76,11 @@ void read2(InputNALUnit& nalu)
{
InputBitstream& bs = nalu.getBitstream();
#if JVET_O0179
nalu.m_forbiddenZeroBit = bs.read(1); // forbidden zero bit
nalu.m_nuhReservedZeroBit = bs.read(1); // nuh_reserved_zero_bit
nalu.m_nuhLayerId = bs.read(6); // nuh_layer_id
nalu.m_nalUnitType = (NalUnitType) bs.read(5); // nal_unit_type
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
#else
bool zeroTidRequiredFlag = bs.read(1); // zero_tid_required_flag
nalu.m_temporalId = bs.read(3) - 1; // nuh_temporal_id_plus1
CHECK(nalu.m_temporalId < 0, "Temporal ID is negative.");
//When zero_tid_required_flag is equal to 1, the value of nuh_temporal_id_plus1 shall be equal to 1.
CHECK((zeroTidRequiredFlag == 1) && (nalu.m_temporalId != 0), "Temporal ID is not '0' when zero tid is required.");
uint32_t nalUnitTypeLsb = bs.read(4); // nal_unit_type_lsb
nalu.m_nalUnitType = (NalUnitType)((zeroTidRequiredFlag << 4) + nalUnitTypeLsb);
nalu.m_nuhLayerId = bs.read(7); // nuh_layer_id
CHECK(nalu.m_nuhLayerId == 0, "nuh_layer_id_plus1 must be greater than zero");
nalu.m_nuhLayerId--;
CHECK(nalu.m_nuhLayerId > 125, "Layer ID out of range");
CHECK((nalu.m_nuhLayerId < 0) || (nalu.m_nuhLayerId > 126), "Layer ID out of range");
uint32_t nuh_reserved_zero_bit = bs.read(1); // nuh_reserved_zero_bit
CHECK(nuh_reserved_zero_bit != 0, "Reserved zero bit is not '0'");
#endif
}
static void
......@@ -247,7 +230,6 @@ void StreamMergeApp::writeNewVPS(ostream& out, int nLayerId, int nTemporalId)
OutputBitstream bsNALUHeader;
static const uint8_t start_code_prefix[] = { 0,0,0,1 };
#if JVET_O0179
int forbiddenZero = 0;
bsNALUHeader.write(forbiddenZero, 1); // forbidden_zero_bit
int nuhReservedZeroBit = 0;
......@@ -255,14 +237,6 @@ void StreamMergeApp::writeNewVPS(ostream& out, int nLayerId, int nTemporalId)
bsNALUHeader.write(nLayerId, 6); // nuh_layer_id
bsNALUHeader.write(NAL_UNIT_VPS, 5); // nal_unit_type
bsNALUHeader.write(nTemporalId + 1, 3); // nuh_temporal_id_plus1
#else
bsNALUHeader.write(1, 1); // zero_tid_required_flag
bsNALUHeader.write(nTemporalId + 1, 3); // nuh_temporal_id_plus1
uint32_t nalUnitTypeLsb = NAL_UNIT_VPS - (1 << 4);
bsNALUHeader.write(nalUnitTypeLsb, 4); // nal_unit_type_lsb
bsNALUHeader.write(nLayerId + 1, 7); // nuh_layer_id
bsNALUHeader.write(0, 1); // nuh_reserved_zero_bit
#endif
out.write(reinterpret_cast<const char*>(start_code_prefix), 4);
out.write(reinterpret_cast<const char*>(bsNALUHeader.getByteStream()), bsNALUHeader.getByteStreamLength());
......
This diff is collapsed.
......@@ -87,25 +87,43 @@ public:
void ALFProcess(CodingStructure& cs);
void create( const int picWidth, const int picHeight, const ChromaFormat format, const int maxCUWidth, const int maxCUHeight, const int maxCUDepth, const int inputBitDepth[MAX_NUM_CHANNEL_TYPE] );
void destroy();
#if JVET_O0625_ALF_PADDING
static void deriveClassificationBlk( AlfClassifier **classifier, int **laplacian[NUM_DIRECTIONS],
const CPelBuf &srcLuma, const Area &blkDst, const Area &blk, const int shift,
const int vbCTUHeight, int vbPos, const int alfBryList[4] );
void deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blkDst, const Area& blk, const int alfBryList[4] );
#else
static void deriveClassificationBlk(AlfClassifier **classifier, int **laplacian[NUM_DIRECTIONS],
const CPelBuf &srcLuma, const Area &blkDst, const Area &blk, const int shift,
const int vbCTUHeight, int vbPos);
void deriveClassification( AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blkDst, const Area& blk );
#if !JVET_O0525_REMOVE_PCM
void resetPCMBlkClassInfo(CodingStructure & cs, AlfClassifier** classifier, const CPelBuf& srcLuma, const Area& blk);
#endif
template<AlfFilterType filtType>
#if JVET_O0625_ALF_PADDING
static void filterBlk( AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
int vbPos, const int alfBryList[4] );
#else
static void filterBlk(AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
int vbPos);
#if !JVET_O0216_ALF_COEFF_EG3 || !JVET_O0064_SIMP_ALF_CLIP_CODING
inline static int getMaxGolombIdx( AlfFilterType filterType )
{
return filterType == ALF_FILTER_5 ? 2 : 3;
}
#endif
#if JVET_O0625_ALF_PADDING
void getAlfBoundary( const CodingStructure& cs, int posX, int posY, int &topBry, int &botBry, int &leftBry, int &rightBry );
void (*m_deriveClassificationBlk)( AlfClassifier **classifier, int **laplacian[NUM_DIRECTIONS], const CPelBuf &srcLuma,
const Area &blkDst, const Area &blk, const int shift, const int vbCTUHeight,
int vbPos, const int alfBryList[4] );
void (*m_filter5x5Blk)( AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
int vbPos, const int alfBryList[4] );
void (*m_filter7x7Blk)( AlfClassifier **classifier, const PelUnitBuf &recDst, const CPelUnitBuf &recSrc,
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
int vbPos, const int alfBryList[4] );
#else
void (*m_deriveClassificationBlk)(AlfClassifier **classifier, int **laplacian[NUM_DIRECTIONS], const CPelBuf &srcLuma,
const Area &blkDst, const Area &blk, const int shift, const int vbCTUHeight,
int vbPos);
......@@ -118,6 +136,7 @@ public:
const Area &blkDst, const Area &blk, const ComponentID compId, const short *filterSet,
const short *fClipSet, const ClpRng &clpRng, CodingStructure &cs, const int vbCTUHeight,
int vbPos);
#endif
#ifdef TARGET_SIMD_X86
void initAdaptiveLoopFilterX86();
......@@ -126,42 +145,31 @@ public:
#endif
protected:
#if JVET_O0625_ALF_PADDING
bool isCrossedByVirtualBoundaries( const CodingStructure& cs, const int xPos, const int yPos, const int width, const int height, int &topBry, int &botBry, int &leftBry, int &rightBry, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], const PPS* pps );
#else
bool isCrossedByVirtualBoundaries( const int xPos, const int yPos, const int width, const int height, bool& clipTop, bool& clipBottom, bool& clipLeft, bool& clipRight, int& numHorVirBndry, int& numVerVirBndry, int horVirBndryPos[], int verVirBndryPos[], const PPS* pps );
#endif
static const int m_classToFilterMapping[NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES];
static const int m_fixedFilterSetCoeff[ALF_FIXED_FILTER_NUM][MAX_NUM_ALF_LUMA_COEFF];
short m_fixedFilterSetCoeffDec[NUM_FIXED_FILTER_SETS][MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
#if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB || JVET_O_MAX_NUM_ALF_APS_8
short m_coeffApsLuma[ALF_CTB_MAX_NUM_APS][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
short m_clippApsLuma[ALF_CTB_MAX_NUM_APS][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
#else
short m_coeffApsLuma[6][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
short m_clippApsLuma[6][MAX_NUM_ALF_LUMA_COEFF * MAX_NUM_ALF_CLASSES];
#endif
short m_clipDefault[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
bool m_created = false;
#if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB
short m_chromaCoeffFinal[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF];
AlfParam* m_alfParamChroma;
#else
short m_chromaCoeffFinal[MAX_NUM_ALF_LUMA_COEFF];
#endif
Pel m_alfClippingValues[MAX_NUM_CHANNEL_TYPE][MaxAlfNumClippingValues];
std::vector<AlfFilterShape> m_filterShapes[MAX_NUM_CHANNEL_TYPE];
AlfClassifier** m_classifier;
short m_coeffFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
short m_clippFinal[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF];
#if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB
short m_chromaClippFinal[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF];
#else
short m_chromaClippFinal[MAX_NUM_ALF_LUMA_COEFF];
#endif
int** m_laplacian[NUM_DIRECTIONS];
int * m_laplacianPtr[NUM_DIRECTIONS][m_CLASSIFICATION_BLK_SIZE + 5];
int m_laplacianData[NUM_DIRECTIONS][m_CLASSIFICATION_BLK_SIZE + 5][m_CLASSIFICATION_BLK_SIZE + 5];
uint8_t* m_ctuEnableFlag[MAX_NUM_COMPONENT];
#if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB
uint8_t* m_ctuAlternative[MAX_NUM_COMPONENT];
#endif
PelStorage m_tempBuf;
PelStorage m_tempBuf2;
int m_inputBitDepth[MAX_NUM_CHANNEL_TYPE];
......
......@@ -73,13 +73,6 @@ struct AlfFilterShape
2, 2, 2,
2, 2, 1, 1
};
#if !JVET_O0216_ALF_COEFF_EG3 || !JVET_O0064_SIMP_ALF_CLIP_CODING
golombIdx = {
0,
0, 1, 0,
0, 1, 2, 2
};
#endif
filterType = ALF_FILTER_5;
}
......@@ -101,14 +94,6 @@ struct AlfFilterShape
2, 2, 2, 2, 2,
2, 2, 2, 1, 1
};
#if !JVET_O0216_ALF_COEFF_EG3 || !JVET_O0064_SIMP_ALF_CLIP_CODING
golombIdx = {
0,
0, 1, 0,
0, 1, 2, 1, 0,
0, 1, 2, 3, 3
};
#endif
filterType = ALF_FILTER_7;
}
......@@ -125,44 +110,23 @@ struct AlfFilterShape
int filterSize;
std::vector<int> pattern;
std::vector<int> weights;
#if !JVET_O0216_ALF_COEFF_EG3 || !JVET_O0064_SIMP_ALF_CLIP_CODING
std::vector<int> golombIdx;
#endif
};
struct AlfParam
{
bool enabledFlag[MAX_NUM_COMPONENT]; // alf_slice_enable_flag, alf_chroma_idc
#if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB
bool nonLinearFlag[MAX_NUM_CHANNEL_TYPE][MAX_NUM_ALF_ALTERNATIVES_CHROMA]; // alf_[luma/chroma]_clip_flag
#else
bool nonLinearFlag[MAX_NUM_CHANNEL_TYPE]; // alf_nonlinear_enable_flag[Luma/Chroma]
#endif
short lumaCoeff[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_coeff_luma_delta[i][j]
short lumaClipp[MAX_NUM_ALF_CLASSES * MAX_NUM_ALF_LUMA_COEFF]; // alf_clipp_luma_[i][j]
#if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB
int numAlternativesChroma; // alf_chroma_num_alts_minus_one + 1
short chromaCoeff[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF]; // alf_coeff_chroma[i]
short chromaClipp[MAX_NUM_ALF_ALTERNATIVES_CHROMA][MAX_NUM_ALF_CHROMA_COEFF]; // alf_clipp_chroma[i]
#else
short chromaCoeff[MAX_NUM_ALF_CHROMA_COEFF]; // alf_coeff_chroma[i]
short chromaClipp[MAX_NUM_ALF_CHROMA_COEFF]; // alf_clipp_chroma[i]
#endif
short filterCoeffDeltaIdx[MAX_NUM_ALF_CLASSES]; // filter_coeff_delta[i]
bool alfLumaCoeffFlag[MAX_NUM_ALF_CLASSES]; // alf_luma_coeff_flag[i]
int numLumaFilters; // number_of_filters_minus1 + 1
bool alfLumaCoeffDeltaFlag; // alf_luma_coeff_delta_flag
#if !JVET_O0669_REMOVE_ALF_COEFF_PRED
bool alfLumaCoeffDeltaPredictionFlag; // alf_luma_coeff_delta_prediction_flag
#endif
std::vector<AlfFilterShape>* filterShapes;
int tLayer;
bool newFilterFlag[MAX_NUM_CHANNEL_TYPE];
#if !JVET_O0669_REMOVE_ALF_COEFF_PRED
int fixedFilterPattern;
int fixedFilterIdx[MAX_NUM_ALF_CLASSES];
int fixedFilterSetIndex;
#endif
AlfParam()
{
......@@ -175,25 +139,14 @@ struct AlfParam
std::memset( nonLinearFlag, false, sizeof( nonLinearFlag ) );
std::memset( lumaCoeff, 0, sizeof( lumaCoeff ) );
std::memset( lumaClipp, 0, sizeof( lumaClipp ) );
#if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB
numAlternativesChroma = 1;
#endif
std::memset( chromaCoeff, 0, sizeof( chromaCoeff ) );
std::memset( chromaClipp, 0, sizeof( chromaClipp ) );
std::memset( filterCoeffDeltaIdx, 0, sizeof( filterCoeffDeltaIdx ) );
std::memset( alfLumaCoeffFlag, true, sizeof( alfLumaCoeffFlag ) );
numLumaFilters = 1;
alfLumaCoeffDeltaFlag = false;
#if !JVET_O0669_REMOVE_ALF_COEFF_PRED
alfLumaCoeffDeltaPredictionFlag = false;
#endif
tLayer = 0;
memset(newFilterFlag, 0, sizeof(newFilterFlag));
#if !JVET_O0669_REMOVE_ALF_COEFF_PRED
fixedFilterPattern = 0;
std::memset(fixedFilterIdx, 0, sizeof(fixedFilterIdx));
fixedFilterSetIndex = 0;
#endif
}
const AlfParam& operator = ( const AlfParam& src )
......@@ -202,28 +155,76 @@ struct AlfParam
std::memcpy( nonLinearFlag, src.nonLinearFlag, sizeof( nonLinearFlag ) );
std::memcpy( lumaCoeff, src.lumaCoeff, sizeof( lumaCoeff ) );
std::memcpy( lumaClipp, src.lumaClipp, sizeof( lumaClipp ) );
#if JVET_O0090_ALF_CHROMA_FILTER_ALTERNATIVES_CTB
numAlternativesChroma = src.numAlternativesChroma;
#endif
std::memcpy( chromaCoeff, src.chromaCoeff, sizeof( chromaCoeff ) );
std::memcpy( chromaClipp, src.chromaClipp, sizeof( chromaClipp ) );
std::memcpy( filterCoeffDeltaIdx, src.filterCoeffDeltaIdx, sizeof( filterCoeffDeltaIdx ) );
std::memcpy( alfLumaCoeffFlag, src.alfLumaCoeffFlag, sizeof( alfLumaCoeffFlag ) );
numLumaFilters = src.numLumaFilters;
alfLumaCoeffDeltaFlag = src.alfLumaCoeffDeltaFlag;
#if !JVET_O0669_REMOVE_ALF_COEFF_PRED
alfLumaCoeffDeltaPredictionFlag = src.alfLumaCoeffDeltaPredictionFlag;
#endif
filterShapes = src.filterShapes;
tLayer = src.tLayer;
std::memcpy(newFilterFlag, src.newFilterFlag, sizeof(newFilterFlag));
#if !JVET_O0669_REMOVE_ALF_COEFF_PRED
fixedFilterPattern = src.fixedFilterPattern;
std::memcpy(fixedFilterIdx, src.fixedFilterIdx, sizeof(fixedFilterIdx));
fixedFilterSetIndex = src.fixedFilterSetIndex;
#endif
return *this;
}
bool operator==( const AlfParam& other )
{
if( memcmp( enabledFlag, other.enabledFlag, sizeof( enabledFlag ) ) )
{
return false;
}
if( memcmp( nonLinearFlag, other.nonLinearFlag, sizeof( nonLinearFlag ) ) )
{
return false;
}
if( memcmp( lumaCoeff, other.lumaCoeff, sizeof( lumaCoeff ) ) )
{
return false;
}
if( memcmp( lumaClipp, other.lumaClipp, sizeof( lumaClipp ) ) )
{
return false;
}
if( memcmp( chromaCoeff, other.chromaCoeff, sizeof( chromaCoeff ) ) )
{
return false;
}
if( memcmp( chromaClipp, other.chromaClipp, sizeof( chromaClipp ) ) )
{
return false;
}
if( memcmp( filterCoeffDeltaIdx, other.filterCoeffDeltaIdx, sizeof( filterCoeffDeltaIdx ) ) )
{
return false;
}
if( memcmp( alfLumaCoeffFlag, other.alfLumaCoeffFlag, sizeof( alfLumaCoeffFlag ) ) )
{
return false;
}
if( memcmp( newFilterFlag, other.newFilterFlag, sizeof( newFilterFlag ) ) )
{
return false;
}
if( numAlternativesChroma != other.numAlternativesChroma )
{
return false;
}
if( numLumaFilters != other.numLumaFilters )
{
return false;
}
if( alfLumaCoeffDeltaFlag != other.alfLumaCoeffDeltaFlag )
{
return false;
}
return true;
}
bool operator!=( const AlfParam& other )
{
return !( *this == other );
}
};
//! \}
......
......@@ -42,19 +42,28 @@
#include "Buffer.h"
#include "InterpolationFilter.h"
#if JVET_O0070_PROF
void applyPROFCore(Pel* dst, int dstStride, const Pel* src, int srcStride, int width, int height, const Pel* gradX, const Pel* gradY, int gradStride, const int* dMvX, const int* dMvY, int dMvStride, int shiftNum, Pel offset, const ClpRng& clpRng)
{
int idx = 0;
#if !JVET_P0057_BDOF_PROF_HARMONIZATION
const int dIshift = 1;
const int dIoffset = 1 << (dIshift - 1);
#endif
#if JVET_P0154_PROF_SAMPLE_OFFSET_CLIPPING
const int dILimit = 1 << std::max<int>(clpRng.bd + 1, 13);
#endif
for (int h = 0; h < height; h++)
{
for (int w = 0; w < width; w++)
{
int32_t dI = dMvX[idx] * gradX[w] + dMvY[idx] * gradY[w];
#if !JVET_P0057_BDOF_PROF_HARMONIZATION
dI = (dI + dIoffset) >> dIshift;
#endif
#if JVET_P0154_PROF_SAMPLE_OFFSET_CLIPPING
dI = Clip3(-dILimit, dILimit - 1, dI);
#endif
dI = (src[w] + dI + offset) >> shiftNum;
dst[w] = (Pel)ClipPel(dI, clpRng);
......@@ -74,13 +83,19 @@ void applyBiPROFCore (Pel* dst, int dstStride, const Pel* src0, const Pel* src1,
int idx = 16;
int32_t dI0 = 0;
int32_t dI1 = 0;
#if !JVET_P0057_BDOF_PROF_HARMONIZATION
const int dIshift = 1;
const int dIoffset = 1 << (dIshift - 1);
#endif
const int clipbd = clpRng.bd;
const int shiftNum = std::max<int>(2, (IF_INTERNAL_PREC - clipbd)) + g_GbiLog2WeightBase;
const int offset = (1 << (shiftNum - 1)) + (IF_INTERNAL_OFFS << g_GbiLog2WeightBase);
#if JVET_P0154_PROF_SAMPLE_OFFSET_CLIPPING
const int dILimit = 1 << std::max<int>(clpRng.bd + 1, 13);
#endif
const int8_t w1 = g_GbiWeightBase - w0;
for (int h = 0; h < height; h++)
......@@ -92,11 +107,21 @@ void applyBiPROFCore (Pel* dst, int dstStride, const Pel* src0, const Pel* src1,
{
if (!(w & 3)) idx -= 4;
dI0 = dMvX0[idx] * gradX0[w] + dMvY0[idx] * gradY0[w];
#if !JVET_P0057_BDOF_PROF_HARMONIZATION
dI0 = (dI0 + dIoffset) >> dIshift;
#endif
#if JVET_P0154_PROF_SAMPLE_OFFSET_CLIPPING
dI0 = Clip3(-dILimit, dILimit - 1, dI0);
#endif
if (l1PROFEnabled)
{
dI1 = dMvX1[idx] * gradX1[w] + dMvY1[idx] * gradY1[w];
#if !JVET_P0057_BDOF_PROF_HARMONIZATION
dI1 = (dI1 + dIoffset) >> dIshift;
#endif
#if JVET_P0154_PROF_SAMPLE_OFFSET_CLIPPING
dI1 = Clip3(-dILimit, dILimit - 1, dI1);
#endif
dst[w] = (Pel)ClipPel(rightShift(((src0[w] + dI0) * w0 + (src1[w] + dI1) * w1 + offset), shiftNum), clpRng);
}
else
......@@ -117,7 +142,6 @@ void applyBiPROFCore (Pel* dst, int dstStride, const Pel* src0, const Pel* src1,
src1 += srcStride;
}
}
#endif
template< typename T >
void addAvgCore( const T* src1, int src1Stride, const T* src2, int src2Stride, T* dest, int dstStride, int width, int height, int rshift, int offset, const ClpRng& clpRng )
......@@ -143,19 +167,27 @@ void addBIOAvgCore(const Pel* src0, int src0Stride, const Pel* src1, int src1Str
for (int x = 0; x < width; x += 4)
{
b = tmpx * (gradX0[x] - gradX1[x]) + tmpy * (gradY0[x] - gradY1[x]);
#if !JVET_P0091_REMOVE_BDOF_OFFSET_SHIFT
b = ((b + 1) >> 1);
#endif
dst[x] = ClipPel((int16_t)rightShift((src0[x] + src1[x] + b + offset), shift), clpRng);
b = tmpx * (gradX0[x + 1] - gradX1[x + 1]) + tmpy * (gradY0[x + 1] - gradY1[x + 1]);
#if !JVET_P0091_REMOVE_BDOF_OFFSET_SHIFT
b = ((b + 1) >> 1);
#endif
dst[x + 1] = ClipPel((int16_t)rightShift((src0[x + 1] + src1[x + 1] + b + offset), shift), clpRng);
b = tmpx * (gradX0[x + 2] - gradX1[x + 2]) + tmpy * (gradY0[x + 2] - gradY1[x + 2]);
#if !JVET_P0091_REMOVE_BDOF_OFFSET_SHIFT
b = ((b + 1) >> 1);
#endif
dst[x + 2] = ClipPel((int16_t)rightShift((src0[x + 2] + src1[x + 2] + b + offset), shift), clpRng);
b = tmpx * (gradX0[x + 3] - gradX1[x + 3]) + tmpy * (gradY0[x + 3] - gradY1[x + 3]);
#if !JVET_P0091_REMOVE_BDOF_OFFSET_SHIFT
b = ((b + 1) >> 1);
#endif
dst[x + 3] = ClipPel((int16_t)rightShift((src0[x + 3] + src1[x + 3] + b + offset), shift), clpRng);
}
dst += dstStride; src0 += src0Stride; src1 += src1Stride;
......@@ -163,37 +195,32 @@ void addBIOAvgCore(const Pel* src0, int src0Stride, const Pel* src1, int src1Str
}
}
#if JVET_O0070_PROF
template<bool PAD = true>
#endif
void gradFilterCore(Pel* pSrc, int srcStride, int width, int height, int gradStride, Pel* gradX, Pel* gradY, const int bitDepth)
{
Pel* srcTmp = pSrc + srcStride + 1;
Pel* gradXTmp = gradX + gradStride + 1;
Pel* gradYTmp = gradY + gradStride + 1;
#if JVET_P0653_BDOF_PROF_PARA_DEV
int shift1 = 6;
#else
int shift1 = std::max<int>(6, (bitDepth - 6));
#endif
for (int y = 0; y < (height - 2 * BIO_EXTEND_SIZE); y++)
{
for (int x = 0; x < (width - 2 * BIO_EXTEND_SIZE); x++)
{
#if JVET_O0570_GRAD_SIMP
gradYTmp[x] = ( srcTmp[x + srcStride] >> shift1 ) - ( srcTmp[x - srcStride] >> shift1 );
gradXTmp[x] = ( srcTmp[x + 1] >> shift1 ) - ( srcTmp[x - 1] >> shift1 );
#else
gradYTmp[x] = (srcTmp[x + srcStride] - srcTmp[x - srcStride]) >> shift1;
gradXTmp[x] = (srcTmp[x + 1] - srcTmp[x - 1]) >> shift1;
#endif
}
gradXTmp += gradStride;
gradYTmp += gradStride;
srcTmp += srcStride;
}
#if JVET_O0070_PROF
if (PAD)
{
#endif
gradXTmp = gradX + gradStride + 1;
gradYTmp = gradY + gradStride + 1;
for (int y = 0; y < (height - 2 * BIO_EXTEND_SIZE); y++)
......@@ -213,16 +240,18 @@ void gradFilterCore(Pel* pSrc, int srcStride, int width, int height, int gradStr
::memcpy(gradXTmp + (height - 2 * BIO_EXTEND_SIZE)*gradStride, gradXTmp + (height - 2 * BIO_EXTEND_SIZE - 1)*gradStride, sizeof(Pel)*(width));
::memcpy(gradYTmp - gradStride, gradYTmp, sizeof(Pel)*(width));
::memcpy(gradYTmp + (height - 2 * BIO_EXTEND_SIZE)*gradStride, gradYTmp + (height - 2 * BIO_EXTEND_SIZE - 1)*gradStride, sizeof(Pel)*(width));
#if JVET_O0070_PROF
}
#endif
}
#if JVET_O0304_SIMPLIFIED_BDOF
void calcBIOSumsCore(const Pel* srcY0Tmp, const Pel* srcY1Tmp, Pel* gradX0, Pel* gradX1, Pel* gradY0, Pel* gradY1, int xu, int yu, const int src0Stride, const int src1Stride, const int widthG, const int bitDepth, int* sumAbsGX, int* sumAbsGY, int* sumDIX, int* sumDIY, int* sumSignGY_GX)
{
#if JVET_P0653_BDOF_PROF_PARA_DEV
int shift4 = 4;
int shift5 = 1;
#else
int shift4 = std::max<int>(4, (bitDepth - 8));
int shift5 = std::max<int>(1, (bitDepth - 11));
#endif
for (int y = 0; y < 6; y++)
{
......@@ -246,8 +275,8 @@ void calcBIOSumsCore(const Pel* srcY0Tmp, const Pel* srcY1Tmp, Pel* gradX0, Pel*
gradY1 += widthG;
}
}
#endif
#if !JVET_P0653_BDOF_PROF_PARA_DEV
void calcBIOParCore(const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG, const int bitDepth)
{
int shift4 = std::max<int>(4, (bitDepth - 8));
......@@ -278,6 +307,7 @@ void calcBIOParCore(const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX
dotProductTemp6 += widthG;
}
}
#endif
void calcBlkGradientCore(int sx, int sy, int *arraysGx2, int *arraysGxGy, int *arraysGxdI, int *arraysGy2, int *arraysGydI, int &sGx2, int &sGy2, int &sGxGy, int &sGxdI, int &sGydI, int width, int height, int unitSize)
{
......@@ -390,12 +420,7 @@ PelBufferOps::PelBufferOps()
addBIOAvg4 = addBIOAvgCore;
bioGradFilter = gradFilterCore;
#if !JVET_O0304_SIMPLIFIED_BDOF
calcBIOPar = calcBIOParCore;
calcBlkGradient = calcBlkGradientCore;
#else
calcBIOSums = calcBIOSumsCore;
#endif
copyBuffer = copyBufferCore;
padding = paddingCore;
......@@ -406,13 +431,11 @@ PelBufferOps::PelBufferOps()
removeHighFreq4 = removeHighFreq;
#endif
#if JVET_O0070_PROF
profGradFilter = gradFilterCore <false>;
applyPROF = applyPROFCore;
applyBiPROF[1] = applyBiPROFCore;
applyBiPROF[0] = applyBiPROFCore <false>;
roundIntVector = nullptr;
#endif
}
PelBufferOps g_pelBufOP = PelBufferOps();
......
......@@ -70,9 +70,7 @@ struct PelBufferOps
void(*addBIOAvg4) (const Pel* src0, int src0Stride, const Pel* src1, int src1Stride, Pel *dst, int dstStride, const Pel *gradX0, const Pel *gradX1, const Pel *gradY0, const Pel*gradY1, int gradStride, int width, int height, int tmpx, int tmpy, int shift, int offset, const ClpRng& clpRng);
void(*bioGradFilter) (Pel* pSrc, int srcStride, int width, int height, int gradStride, Pel* gradX, Pel* gradY, const int bitDepth);
void(*calcBIOPar) (const Pel* srcY0Temp, const Pel* srcY1Temp, const Pel* gradX0, const Pel* gradX1, const Pel* gradY0, const Pel* gradY1, int* dotProductTemp1, int* dotProductTemp2, int* dotProductTemp3, int* dotProductTemp5, int* dotProductTemp6, const int src0Stride, const int src1Stride, const int gradStride, const int widthG, const int heightG, const int bitDepth);
#if JVET_O0304_SIMPLIFIED_BDOF
void(*calcBIOSums) (const Pel* srcY0Tmp, const Pel* srcY1Tmp, Pel* gradX0, Pel* gradX1, Pel* gradY0, Pel* gradY1, int xu, int yu, const int src0Stride, const int src1Stride, const int widthG, const int bitDepth, int* sumAbsGX, int* sumAbsGY, int* sumDIX, int* sumDIY, int* sumSignGY_GX);
#endif
void(*calcBlkGradient)(int sx, int sy, int *arraysGx2, int *arraysGxGy, int *arraysGxdI, int *arraysGy2, int *arraysGydI, int &sGx2, int &sGy2, int &sGxGy, int &sGxdI, int &sGydI, int width, int height, int unitSize);
void(*copyBuffer)(Pel *src, int srcStride, Pel *dst, int dstStride, int width, int height);
void(*padding)(Pel *dst, int stride, int width, int height, int padSize);
......@@ -82,12 +80,10 @@ struct PelBufferOps
void ( *removeHighFreq8) ( Pel* src0, int src0Stride, const Pel* src1, int src1Stride, int width, int height);
void ( *removeHighFreq4) ( Pel* src0, int src0Stride, const Pel* src1, int src1Stride, int width, int height);
#endif
#if JVET_O0070_PROF
void (*profGradFilter) (Pel* pSrc, int srcStride, int width, int height, int gradStride, Pel* gradX, Pel* gradY, const int bitDepth);
void (*applyPROF) (Pel* dst, int dstStride, const Pel* src, int srcStride, int width, int height, const Pel* gradX, const Pel* gradY, int gradStride, const int* dMvX, const int* dMvY, int dMvStride, int shiftNum, Pel offset, const ClpRng& clpRng);
void (*applyBiPROF[2]) (Pel* dst, int dstStride, const Pel* src0, const Pel* src1, int srcStride, int width, int height, const Pel* gradX0, const Pel* gradY0, const Pel* gradX1, const Pel* gradY1, int gradStride, const int* dMvX0, const int* dMvY0, const int* dMvX1, const int* dMvY1, int dMvStride, const int8_t gbiWeightL0, const ClpRng& clpRng);
void (*roundIntVector) (int* v, int size, unsigned int nShift, const int dmvLimit);
#endif
};
extern PelBufferOps g_pelBufOP;
......@@ -120,10 +116,6 @@ struct AreaBuf : public Size
void copyClip ( const AreaBuf<const T> &src, const ClpRng& clpRng);
void subtract ( const AreaBuf<const T> &other );
#if !JVET_O0105_ICT
void copyAndNegate ( const AreaBuf<const T> &other );
void subtractAndHalve ( const AreaBuf<const T> &other );
#endif
void extendSingleBorderPel();
void extendBorderPel ( unsigned margin );
void addWeightedAvg ( const AreaBuf<const T> &other1, const AreaBuf<const T> &other2, const ClpRng& clpRng, const int8_t gbiIdx);
......@@ -173,13 +165,11 @@ typedef AreaBuf<const TCoeff> CCoeffBuf;
typedef AreaBuf< MotionInfo> MotionBuf;
typedef AreaBuf<const MotionInfo> CMotionBuf;
#if JVET_O0119_BASE_PALETTE_444
typedef AreaBuf< TCoeff> PLTescapeBuf;
typedef AreaBuf<const TCoeff> CPLTescapeBuf;
typedef AreaBuf< bool> PLTtypeBuf;
typedef AreaBuf<const bool> CPLTtypeBuf;
#endif
#define SIZE_AWARE_PER_EL_OP( OP, INC ) \
if( ( width & 7 ) == 0 ) \
......@@ -375,49 +365,6 @@ void AreaBuf<T>::subtract( const AreaBuf<const T> &other )
#undef SUBS_INC
}
#if !JVET_O0105_ICT
template<typename T>
void AreaBuf<T>::copyAndNegate( const AreaBuf<const T> &other )
{
CHECK( width != other.width, "Incompatible size" );
CHECK( height != other.height, "Incompatible size" );
T* dest = buf;
const T* subs = other.buf;
#define SUBS_INC \
dest += stride; \
subs += other.stride; \
#define SUBS_OP( ADDR ) dest[ADDR] = -subs[ADDR]
SIZE_AWARE_PER_EL_OP( SUBS_OP, SUBS_INC );
#undef SUBS_OP
#undef SUBS_INC
}
template<typename T>
void AreaBuf<T>::subtractAndHalve( const AreaBuf<const T> &other )
{
CHECK( width != other.width, "Incompatible size" );
CHECK( height != other.height, "Incompatible size" );
T* dest = buf;
const T* subs = other.buf;
#define SUBS_INC \
dest += stride; \
subs += other.stride; \
#define SUBS_OP( ADDR ) dest[ADDR] = ( dest[ADDR] - subs[ADDR] ) / 2
SIZE_AWARE_PER_EL_OP( SUBS_OP, SUBS_INC );
#undef SUBS_OP
#undef SUBS_INC
}
#endif
template<typename T>
void AreaBuf<T>::copyClip( const AreaBuf<const T> &src, const ClpRng& clpRng )
......@@ -944,7 +891,6 @@ private:
Pel *m_origin[MAX_NUM_COMPONENT];
};
#if JVET_O0105_ICT
struct CompStorage : public PelBuf
{
CompStorage () { m_memory = nullptr; }
......@@ -965,6 +911,5 @@ struct CompStorage : public PelBuf
private:
Pel* m_memory;
};
#endif
#endif
......@@ -115,12 +115,6 @@ static inline int getTransformShift(const int channelBitDepth, const Size size,
//------------------------------------------------
#if !JVET_O0650_SIGNAL_CHROMAQP_MAPPING_TABLE
static inline int getScaledChromaQP(int unscaledChromaQP, const ChromaFormat chFmt)
{
return g_aucChromaScale[chFmt][Clip3(0, (chromaQPMappingTableSize - 1), unscaledChromaQP)];
}
#endif
//======================================================================================================================
//Scaling lists =======================================================================================================
......@@ -128,11 +122,7 @@ static inline int getScaledChromaQP(int unscaledChromaQP, const ChromaFormat chF
static inline int getScalingListType(const PredMode predMode, const ComponentID compID)
{
#if JVET_O0267_IBC_SCALING_LIST
return ((predMode == MODE_INTRA) ? 0 : MAX_NUM_COMPONENT) + MAP_CHROMA(compID);
#else
return ((predMode != MODE_INTER) ? 0 : MAX_NUM_COMPONENT) + MAP_CHROMA(compID);
#endif
}
#endif
......@@ -58,9 +58,7 @@ enum CodingStatisticsType
STATS__CABAC_BITS__MERGE_INDEX,
STATS__CABAC_BITS__MVP_IDX,
STATS__CABAC_BITS__SPLIT_FLAG,
#if JVET_O0050_LOCAL_DUAL_TREE
STATS__CABAC_BITS__MODE_CONSTRAINT_FLAG,
#endif
STATS__CABAC_BITS__PART_SIZE,
STATS__CABAC_BITS__PRED_MODE,
STATS__CABAC_BITS__INTRA_DIR_ANG,
......@@ -102,10 +100,6 @@ enum CodingStatisticsType
STATS__CABAC_BITS__ALF,
STATS__CABAC_TRM_BITS,
STATS__CABAC_FIXED_BITS,
#if !JVET_O0525_REMOVE_PCM
STATS__CABAC_PCM_ALIGN_BITS,
STATS__CABAC_PCM_CODE_BITS,
#endif
STATS__BYTE_ALIGNMENT_BITS,
STATS__TRAILING_BITS,
STATS__EXPLICIT_RDPCM_BITS,
......@@ -156,9 +150,7 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_BITS__MERGE_INDEX",
"CABAC_BITS__MVP_IDX",
"CABAC_BITS__SPLIT_FLAG",
#if JVET_O0050_LOCAL_DUAL_TREE
"CABAC_BITS__MODE_CONSTRAINT_FLAG",
#endif
"CABAC_BITS__PART_SIZE",
"CABAC_BITS__PRED_MODE",
"CABAC_BITS__INTRA_DIR_ANG",
......@@ -200,10 +192,6 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_BITS__ALF",
"CABAC_TRM_BITS",
"CABAC_FIXED_BITS",
#if !JVET_O0525_REMOVE_PCM
"CABAC_PCM_ALIGN_BITS",
"CABAC_PCM_CODE_BITS",
#endif
"BYTE_ALIGNMENT_BITS",
"TRAILING_BITS",
"EXPLICIT_RDPCM_BITS",
......
This diff is collapsed.
......@@ -58,21 +58,10 @@ enum PictureType
PIC_RESIDUAL,
PIC_ORG_RESI,
PIC_RECON_WRAP,
#if RPR_CTC_PRINT
PIC_ORIGINAL_INPUT,
PIC_TRUE_ORIGINAL_INPUT,
#endif
NUM_PIC_TYPES
};
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
enum IbcLumaCoverage
{
IBC_LUMA_COVERAGE_FULL = 0,
IBC_LUMA_COVERAGE_PARTIAL,
IBC_LUMA_COVERAGE_NONE,
NUM_IBC_LUMA_COVERAGE,
};
#endif
extern XUCache g_globalUnitCache;
// ---------------------------------------------------------------------------
......@@ -96,20 +85,16 @@ public:
int prevQP[MAX_NUM_CHANNEL_TYPE];
int currQP[MAX_NUM_CHANNEL_TYPE];
int chromaQpAdj;
#if !JVET_P0400_REMOVE_SHARED_MERGE_LIST
Position sharedBndPos;
Size sharedBndSize;
#endif
bool isLossless;
const SPS *sps;
const PPS *pps;
#if JVET_O_MAX_NUM_ALF_APS_8
APS* alfApss[ALF_CTB_MAX_NUM_APS];
#else
APS* alfApss[MAX_NUM_APS];
#endif
APS * lmcsAps;
#if JVET_O0299_APS_SCALINGLIST
APS * scalinglistAps;
#endif
const VPS *vps;
const PreCalcValues* pcv;
......@@ -139,9 +124,7 @@ public:
const TransformUnit *getTU(const Position &pos, const ChannelType _chType, const int subTuIdx = -1) const;
CodingUnit *getCU(const Position &pos, const ChannelType _chType);
#if JVET_O0050_LOCAL_DUAL_TREE
CodingUnit *getLumaCU( const Position &pos );
#endif
PredictionUnit *getPU(const Position &pos, const ChannelType _chType);
TransformUnit *getTU(const Position &pos, const ChannelType _chType, const int subTuIdx = -1);
......@@ -169,9 +152,6 @@ public:
cCUTraverser traverseCUs(const UnitArea& _unit, const ChannelType _chType) const;
cPUTraverser traversePUs(const UnitArea& _unit, const ChannelType _chType) const;
cTUTraverser traverseTUs(const UnitArea& _unit, const ChannelType _chType) const;
#if !JVET_O0258_REMOVE_CHROMA_IBC_FOR_DUALTREE
IbcLumaCoverage getIbcLumaCoverage(const CompArea& chromaArea) const;
#endif
// ---------------------------------------------------------------------------
// encoding search utilities
// ---------------------------------------------------------------------------
......@@ -185,10 +165,8 @@ public:
uint64_t fracBits;
Distortion dist;
Distortion interHad;
#if JVET_O0050_LOCAL_DUAL_TREE
TreeType treeType; //because partitioner can not go deep to tu and cu coding (e.g., addCU()), need another variable for indicating treeType
ModeType modeType;
#endif
void initStructData (const int &QP = MAX_INT, const bool &_isLosses = false, const bool &skipMotBuf = false);
void initSubStructure( CodingStructure& cs, const ChannelType chType, const UnitArea &subArea, const bool &isTuEnc);
......@@ -200,7 +178,6 @@ public:
void clearTUs();
void clearPUs();
void clearCUs();
#if JVET_O0050_LOCAL_DUAL_TREE
const int signalModeCons( const PartSplit split, Partitioner &partitioner, const ModeType modeTypeParent ) const;
void clearCuPuTuIdxMap ( const UnitArea &_area, uint32_t numCu, uint32_t numPu, uint32_t numTu, uint32_t* pOffset );
void getNumCuPuTuOffset ( uint32_t* pArray )
......@@ -208,7 +185,6 @@ public:
pArray[0] = m_numCUs; pArray[1] = m_numPUs; pArray[2] = m_numTUs;
pArray[3] = m_offsets[0]; pArray[4] = m_offsets[1]; pArray[5] = m_offsets[2];
}
#endif
private:
......@@ -224,11 +200,9 @@ public:
void addMiToLut(static_vector<MotionInfo, MAX_NUM_HMVP_CANDS>& lut, const MotionInfo &mi);
#if JVET_O0119_BASE_PALETTE_444
PLTBuf prevPLT;
void resetPrevPLT(PLTBuf& prevPLT);
void reorderPrevPLT(PLTBuf& prevPLT, uint32_t curPLTSize[MAX_NUM_COMPONENT], Pel curPLT[MAX_NUM_COMPONENT][MAXPLTSIZE], bool reuseflag[MAX_NUM_COMPONENT][MAXPLTPREDSIZE], uint32_t compBegin, uint32_t numComp, bool jointPLT);
#endif
private:
// needed for TU encoding
......@@ -256,21 +230,15 @@ private:
TCoeff *m_coeffs [ MAX_NUM_COMPONENT ];
Pel *m_pcmbuf [ MAX_NUM_COMPONENT ];
#if JVET_O0119_BASE_PALETTE_444
bool *m_runType [MAX_NUM_COMPONENT];
Pel *m_runLength[MAX_NUM_COMPONENT];
#endif
int m_offsets[ MAX_NUM_COMPONENT ];
MotionInfo *m_motionBuf;
public:
#if JVET_O0070_PROF
CodingStructure *bestParent;
#endif
#if JVET_O1170_CHECK_BV_AT_DECODER
bool resetIBCBuffer;
#endif
MotionBuf getMotionBuf( const Area& _area );
MotionBuf getMotionBuf( const UnitArea& _area ) { return getMotionBuf( _area.Y() ); }
......
......@@ -259,16 +259,6 @@ public:
}
};
#if !JVET_O0925_MIP_SIMPLIFICATIONS
struct AvailableInfo
{
int maxPosTop;
int maxPosLeft;
AvailableInfo() : maxPosTop(0), maxPosLeft(0) {}
AvailableInfo(const int top, const int left) : maxPosTop(top), maxPosLeft(left) {}
};
#endif
#endif
This diff is collapsed.
......@@ -86,10 +86,8 @@ CoeffCodingContext::CoeffCodingContext( const TransformUnit& tu, ComponentID com
, m_tsSigFlagCtxSet ( Ctx::TsSigFlag )
, m_tsParFlagCtxSet ( Ctx::TsParFlag )
, m_tsGtxFlagCtxSet ( Ctx::TsGtxFlag )
#if JVET_O0122_TS_SIGN_LEVEL
, m_tsLrg1FlagCtxSet (Ctx::TsLrg1Flag)
, m_tsSignFlagCtxSet (Ctx::TsResidualSign)
#endif
, m_sigCoeffGroupFlag ()
, m_bdpcm (bdpcm)
{
......@@ -134,7 +132,6 @@ void CoeffCodingContext::initSubblock( int SubsetId, bool sigGroupFlag )
}
#if JVET_O0050_LOCAL_DUAL_TREE
unsigned DeriveCtx::CtxModeConsFlag( const CodingStructure& cs, Partitioner& partitioner )
{
assert( partitioner.chType == CHANNEL_TYPE_LUMA );
......@@ -148,7 +145,6 @@ unsigned DeriveCtx::CtxModeConsFlag( const CodingStructure& cs, Partitioner& par
unsigned ctxId = ((cuAbove && cuAbove->predMode == MODE_INTRA) || (cuLeft && cuLeft->predMode == MODE_INTRA)) ? 1 : 0;
return ctxId;
}
#endif
void DeriveCtx::CtxSplit( const CodingStructure& cs, Partitioner& partitioner, unsigned& ctxSpl, unsigned& ctxQt, unsigned& ctxHv, unsigned& ctxHorBt, unsigned& ctxVerBt, bool* _canSplit /*= nullptr */ )
......@@ -249,11 +245,7 @@ void DeriveCtx::CtxSplit( const CodingStructure& cs, Partitioner& partitioner, u
ctxVerBt = ( partitioner.currMtDepth <= 1 ? 3 : 2 );
}
#if JVET_O0193_REMOVE_TR_DEPTH_IN_CBF_CTX
unsigned DeriveCtx::CtxQtCbf( const ComponentID compID, const bool prevCbf, const int ispIdx )
#else
unsigned DeriveCtx::CtxQtCbf( const ComponentID compID, const unsigned trDepth, const bool prevCbf, const int ispIdx )
#endif
{
if( ispIdx && isLuma( compID ) )
{
......@@ -263,18 +255,7 @@ unsigned DeriveCtx::CtxQtCbf( const ComponentID compID, const unsigned trDepth,
{
return ( prevCbf ? 1 : 0 );
}
#if JVET_O0193_REMOVE_TR_DEPTH_IN_CBF_CTX
return 0;
#else
if( isChroma( compID ) )
{
return ( trDepth == 0 ? 0 : 1 );
}
else
{
return ( trDepth == 0 ? 1 : 0 );
}
#endif
}
unsigned DeriveCtx::CtxInterDir( const PredictionUnit& pu )
......@@ -343,9 +324,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
pu.mergeFlag = true;
pu.mmvdMergeFlag = false;
pu.interDir = interDirNeighbours[candIdx];
#if JVET_O0057_ALTHPELIF
pu.cu->imv = (!pu.cu->triangle && useAltHpelIf[candIdx]) ? IMV_HPEL : 0;
#endif
pu.mergeIdx = candIdx;
pu.mergeType = mrgTypeNeighbours[candIdx];
pu.mv [REF_PIC_LIST_0] = mvFieldNeighbours[(candIdx << 1) + 0].mv;
......@@ -362,9 +341,7 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
{
pu.bv = pu.mv[REF_PIC_LIST_0];