...
 
Commits (50)
......@@ -30,7 +30,6 @@ endif()
set( EXTENSION_360_VIDEO OFF CACHE BOOL "If EXTENSION_360_VIDEO is on, 360Lib will be added" )
set( SET_ENABLE_TRACING OFF CACHE BOOL "Set ENABLE_TRACING as a compiler flag" )
set( ENABLE_TRACING OFF CACHE BOOL "If SET_ENABLE_TRACING is on, it will be set to this value" )
set( ENABLE_VTM OFF CACHE BOOL "If ENABLE_VTM is on, the software will be compiled as VTM" )
if( CMAKE_COMPILER_IS_GNUCC )
set( BUILD_STATIC OFF CACHE BOOL "Build static executables" )
......
......@@ -63,10 +63,6 @@ ifneq ($(verbose),)
CMAKE_OPTIONS += -DCMAKE_VERBOSE_MAKEFILE=ON
endif
ifneq ($(enable-vtm),)
CMAKE_OPTIONS += -DENABLE_VTM=ON
endif
ifneq ($(enable-tracing),)
CONFIG_OPTIONS += -DSET_ENABLE_TRACING=ON -DENABLE_TRACING=$(enable-tracing)
endif
......
......@@ -127,6 +127,8 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 2
ALF : 1
GBi : 1
GBiFast : 1
# Fast tools
PBIntraFast : 1
......
......@@ -141,6 +141,8 @@ LMChroma : 1 # use CCLM only
DepQuant : 1
IMV : 2
ALF : 1
GBi : 1
GBiFast : 1
# Fast tools
PBIntraFast : 1
......
......@@ -27,10 +27,6 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
target_compile_definitions( ${EXE_NAME} PUBLIC RExt__DECODER_DEBUG_BIT_STATISTICS=1 )
target_compile_definitions( ${EXE_NAME} PUBLIC RExt__DECODER_DEBUG_TOOL_STATISTICS=1 )
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC BMS_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_TRACING=1 )
......
......@@ -25,11 +25,6 @@ endif()
add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC BMS_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_TRACING=1 )
......
......@@ -54,7 +54,7 @@ int main(int argc, char* argv[])
// print information
fprintf( stdout, "\n" );
fprintf( stdout, "VVCSoftware: BMS Decoder Version %s ", NEXT_SOFTWARE_VERSION /*NV_VERSION*/ );
fprintf( stdout, "VVCSoftware: VTM Decoder Version %s ", NEXT_SOFTWARE_VERSION /*NV_VERSION*/ );
fprintf( stdout, NVM_ONOS );
fprintf( stdout, NVM_COMPILEDBY );
fprintf( stdout, NVM_BITS );
......
......@@ -27,10 +27,6 @@ endif()
add_executable( ${EXE_NAME} ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if( ENABLE_VTM )
target_compile_definitions( ${EXE_NAME} PUBLIC BMS_TOOLS=0 )
endif()
if( SET_ENABLE_TRACING )
if( ENABLE_TRACING )
target_compile_definitions( ${EXE_NAME} PUBLIC ENABLE_TRACING=1 )
......
......@@ -213,6 +213,9 @@ void EncApp::xInitLibCfg()
m_cEncLib.setRDpenalty ( m_rdPenalty );
m_cEncLib.setQTBT ( m_QTBT );
m_cEncLib.setCTUSize ( m_uiCTUSize );
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_cEncLib.setUseSplitConsOverride ( m_SplitConsOverrideEnabledFlag );
#endif
m_cEncLib.setMinQTSizes ( m_uiMinQT );
m_cEncLib.setMaxBTDepth ( m_uiMaxBTDepth, m_uiMaxBTDepthI, m_uiMaxBTDepthIChroma );
m_cEncLib.setDualITree ( m_dualTree );
......@@ -239,6 +242,10 @@ void EncApp::xInitLibCfg()
m_cEncLib.setInterEMT ( ( m_EMT >> 1 ) & 1 );
m_cEncLib.setFastInterEMT ( ( m_FastEMT >> 1 ) & ( m_EMT >> 1 ) & 1 );
m_cEncLib.setUseCompositeRef ( m_compositeRefEnabled );
#if JVET_L0646_GBI
m_cEncLib.setUseGBi ( m_GBi );
m_cEncLib.setUseGBiFast ( m_GBiFast );
#endif
// ADD_NEW_TOOL : (encoder app) add setting of tool enabling flags and associated parameters here
m_cEncLib.setMaxCUWidth ( m_QTBT ? m_uiCTUSize : m_uiMaxCUWidth );
......
......@@ -796,6 +796,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
("QTBT", m_QTBT, false, "Enable QTBT (0:off, 1:on) [default: off]")
("MTT", m_MTT, 0u, "Multi type tree type (0: off, 1:QTBT + triple split) [default: 0]")
("CTUSize", m_uiCTUSize, 128u, "CTUSize (specifies the CTU size if QTBT is on) [default: 128]")
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
("EnablePartitionConstraintsOverride", m_SplitConsOverrideEnabledFlag, true, "Enable partition constraints override")
#endif
("MinQTISlice", m_uiMinQT[0], 8u, "MinQTISlice")
("MinQTLumaISlice", m_uiMinQT[0], 8u, "MinQTLumaISlice")
("MinQTChromaISlice", m_uiMinQT[2], 4u, "MinQTChromaISlice")
......@@ -844,6 +847,10 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
"\t2: Enable fast methods only for Inter EMT\n"
"\t3: Enable fast methods for both Intra & Inter EMT\n")
("CompositeLTReference", m_compositeRefEnabled, false, "Enable Composite Long Term Reference Frame")
#if JVET_L0646_GBI
("GBi", m_GBi, false, "Enable Generalized Bi-prediction(GBi)")
("GBiFast", m_GBiFast, false, "Fast methods for Generalized Bi-prediction(GBi)\n")
#endif
// ADD_NEW_TOOL : (encoder app) add parsing parameters here
("LCTUFast", m_useFastLCTU, false, "Fast methods for large CTU")
......@@ -1828,7 +1835,9 @@ bool EncAppCfg::parseCfg( int argc, char* argv[] )
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCodingDepth;
m_uiMaxCUWidth = m_uiMaxCUHeight = m_uiCTUSize;
m_uiMaxCUDepth = m_uiMaxCodingDepth;
#if !JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_uiLog2DiffMaxMinCodingBlockSize = m_uiMaxCUDepth - 1;
#endif
}
// check validity of input parameters
......@@ -1916,7 +1925,11 @@ bool EncAppCfg::xCheckParameter()
xConfirmPara( m_useFastLCTU, "Fast large CTU can only be applied when encoding with NEXT profile" );
xConfirmPara( m_EMT, "EMT only allowed with NEXT profile" );
xConfirmPara( m_FastEMT, "EMT only allowed with NEXT profile" );
xConfirmPara(m_compositeRefEnabled, "Composite Reference Frame is only allowed with NEXT profile");
xConfirmPara( m_compositeRefEnabled, "Composite Reference Frame is only allowed with NEXT profile" );
#if JVET_L0646_GBI
xConfirmPara( m_GBi, "GBi is only allowed with NEXT profile" );
xConfirmPara( m_GBiFast, "GBiFast is only allowed with NEXT profile" );
#endif
// ADD_NEW_TOOL : (parameter check) add a check for next tools here
}
else
......@@ -1979,6 +1992,9 @@ bool EncAppCfg::xCheckParameter()
#endif
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
xConfirmPara( m_useAMaxBT && !m_SplitConsOverrideEnabledFlag, "AMaxBt can only be used with PartitionConstriantsOverride enabled" );
#endif
xConfirmPara( m_useAMaxBT && !m_QTBT, "AMaxBT can only be used with QTBT!" );
......@@ -3111,6 +3127,10 @@ void EncAppCfg::xPrintParameter()
msg( VERBOSE, "LMChroma:%d ", m_LMChroma );
msg( VERBOSE, "EMT: %1d(intra) %1d(inter) ", m_EMT & 1, ( m_EMT >> 1 ) & 1 );
msg(VERBOSE, "CompositeLTReference:%d ", m_compositeRefEnabled);
#if JVET_L0646_GBI
msg( VERBOSE, "GBi:%d ", m_GBi );
msg( VERBOSE, "GBiFast:%d ", m_GBiFast );
#endif
}
// ADD_NEW_TOOL (add some output indicating the usage of tools)
......
......@@ -198,6 +198,9 @@ protected:
// coding unit (CU) definition
bool m_QTBT;
unsigned m_uiCTUSize;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
bool m_SplitConsOverrideEnabledFlag;
#endif
unsigned m_uiMinQT[3]; // 0: I slice luma; 1: P/B slice; 2: I slice chroma
unsigned m_uiMaxBTDepth;
unsigned m_uiMaxBTDepthI;
......@@ -221,6 +224,10 @@ protected:
int m_FastEMT; ///< XZ: Fast Methods of Enhanced Multiple Transform
bool m_compositeRefEnabled;
#if JVET_L0646_GBI
bool m_GBi;
bool m_GBiFast;
#endif
// ADD_NEW_TOOL : (encoder app) add tool enabling flags and associated parameters here
unsigned m_uiMaxCUWidth; ///< max. CU width in pixel
......
......@@ -84,7 +84,7 @@ int main(int argc, char* argv[])
{
// print information
fprintf( stdout, "\n" );
fprintf( stdout, "VVCSoftware: BMS Encoder Version %s ", NEXT_SOFTWARE_VERSION /*NV_VERSION*/ );
fprintf( stdout, "VVCSoftware: VTM Encoder Version %s ", NEXT_SOFTWARE_VERSION /*NV_VERSION*/ );
fprintf( stdout, NVM_ONOS );
fprintf( stdout, NVM_COMPILEDBY );
fprintf( stdout, NVM_BITS );
......
......@@ -54,7 +54,7 @@ int main(int argc, char* argv[])
// print information
fprintf( stdout, "\n" );
fprintf( stdout, "VVCSoftware: BMS Decoder Version %s ", NEXT_SOFTWARE_VERSION /*NV_VERSION*/ );
fprintf( stdout, "VVCSoftware: VTM Decoder Version %s ", NEXT_SOFTWARE_VERSION /*NV_VERSION*/ );
fprintf( stdout, NVM_ONOS );
fprintf( stdout, NVM_COMPILEDBY );
fprintf( stdout, NVM_BITS );
......
......@@ -48,10 +48,6 @@ set( INC_FILES ${BASE_INC_FILES} ${X86_INC_FILES} ${MD5_INC_FILES} )
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
target_compile_definitions( ${LIB_NAME} PUBLIC RExt__DECODER_DEBUG_TOOL_STATISTICS=1 )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC BMS_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
endif()
......
......@@ -337,14 +337,23 @@ void AdaptiveLoopFilter::deriveClassificationBlk( AlfClassifier** classifier, in
const Pel* pYup2 = src3 + pixY;
const Pel y0 = pY[0] << 1;
#if !JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN
const Pel y1 = pY[1] << 1;
const Pel yup0 = pYup[0] << 1;
#endif
const Pel yup1 = pYup[1] << 1;
#if JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN
pYver[j] = abs( y0 - pYdown[0] - pYup[0] ) + abs( yup1 - pY[1] - pYup2[1] );
pYhor[j] = abs( y0 - pY[1] - pY[-1] ) + abs( yup1 - pYup[2] - pYup[0] );
pYdig0[j] = abs( y0 - pYdown[-1] - pYup[1] ) + abs( yup1 - pY[0] - pYup2[2] );
pYdig1[j] = abs( y0 - pYup[-1] - pYdown[1] ) + abs( yup1 - pYup2[0] - pY[2] );
#else
pYver[j] = abs( y0 - pYdown[0] - pYup[0] ) + abs( y1 - pYdown[1] - pYup[1] ) + abs( yup0 - pY[0] - pYup2[0] ) + abs( yup1 - pY[1] - pYup2[1] );
pYhor[j] = abs( y0 - pY[1] - pY[-1] ) + abs( y1 - pY[2] - pY[0] ) + abs( yup0 - pYup[1] - pYup[-1] ) + abs( yup1 - pYup[2] - pYup[0] );
pYdig0[j] = abs( y0 - pYdown[-1] - pYup[1] ) + abs( y1 - pYdown[0] - pYup[2] ) + abs( yup0 - pY[-1] - pYup2[1] ) + abs( yup1 - pY[0] - pYup2[2] );
pYdig1[j] = abs( y0 - pYup[-1] - pYdown[1] ) + abs( y1 - pYup[0] - pYdown[2] ) + abs( yup0 - pYup2[-1] - pY[1] ) + abs( yup1 - pYup2[0] - pY[2] );
#endif
if( j > 4 && ( j - 6 ) % 4 == 0 )
{
......@@ -394,7 +403,11 @@ void AdaptiveLoopFilter::deriveClassificationBlk( AlfClassifier** classifier, in
int sumD1 = pYdig1[j] + pYdig12[j] + pYdig14[j] + pYdig16[j];
int tempAct = sumV + sumH;
#if JVET_L0147_ALF_SUBSAMPLED_LAPLACIAN
int activity = (Pel)Clip3<int>( 0, maxActivity, ( tempAct * 64 ) >> shift );
#else
int activity = (Pel)Clip3<int>( 0, maxActivity, ( tempAct * 32 ) >> shift );
#endif
int classIdx = th[activity];
int hv1, hv0, d1, d0, hvd1, hvd0;
......
......@@ -62,6 +62,40 @@ void addAvgCore( const T* src1, int src1Stride, const T* src2, int src2Stride, T
#undef ADD_AVG_CORE_INC
}
#if ENABLE_SIMD_OPT_GBI && JVET_L0646_GBI
void removeWeightHighFreq(int16_t* dst, int dstStride, const int16_t* src, int srcStride, int width, int height, int shift, int gbiWeight)
{
int normalizer = ((1 << 16) + (gbiWeight > 0 ? (gbiWeight >> 1) : -(gbiWeight >> 1))) / gbiWeight;
int weight0 = normalizer << g_GbiLog2WeightBase;
int weight1 = (g_GbiWeightBase - gbiWeight)*normalizer;
#define REM_HF_INC \
src += srcStride; \
dst += dstStride; \
#define REM_HF_OP( ADDR ) dst[ADDR] = (dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16
SIZE_AWARE_PER_EL_OP(REM_HF_OP, REM_HF_INC);
#undef REM_HF_INC
#undef REM_HF_OP
#undef REM_HF_OP_CLIP
}
void removeHighFreq(int16_t* dst, int dstStride, const int16_t* src, int srcStride, int width, int height)
{
#define REM_HF_INC \
src += srcStride; \
dst += dstStride; \
#define REM_HF_OP( ADDR ) dst[ADDR] = 2 * dst[ADDR] - src[ADDR]
SIZE_AWARE_PER_EL_OP(REM_HF_OP, REM_HF_INC);
#undef REM_HF_INC
#undef REM_HF_OP
#undef REM_HF_OP_CLIP
}
#endif
template<typename T>
void reconstructCore( const T* src1, int src1Stride, const T* src2, int src2Stride, T* dest, int dstStride, int width, int height, const ClpRng& clpRng )
......@@ -103,6 +137,14 @@ PelBufferOps::PelBufferOps()
linTf4 = linTfCore<Pel>;
linTf8 = linTfCore<Pel>;
#if ENABLE_SIMD_OPT_GBI
removeWeightHighFreq8 = removeWeightHighFreq;
removeWeightHighFreq4 = removeWeightHighFreq;
removeHighFreq8 = removeHighFreq;
removeHighFreq4 = removeHighFreq;
#endif
}
PelBufferOps g_pelBufOP = PelBufferOps();
......@@ -110,6 +152,37 @@ PelBufferOps g_pelBufOP = PelBufferOps();
#endif
#endif
#if JVET_L0646_GBI
template<>
void AreaBuf<Pel>::addWeightedAvg(const AreaBuf<const Pel> &other1, const AreaBuf<const Pel> &other2, const ClpRng& clpRng, const int8_t gbiIdx)
{
const int8_t w0 = getGbiWeight(gbiIdx, REF_PIC_LIST_0);
const int8_t w1 = getGbiWeight(gbiIdx, REF_PIC_LIST_1);
const int8_t log2WeightBase = g_GbiLog2WeightBase;
const Pel* src0 = other1.buf;
const Pel* src2 = other2.buf;
Pel* dest = buf;
const unsigned src1Stride = other1.stride;
const unsigned src2Stride = other2.stride;
const unsigned destStride = stride;
const int clipbd = clpRng.bd;
const int shiftNum = std::max<int>(2, (IF_INTERNAL_PREC - clipbd)) + log2WeightBase;
const int offset = (1 << (shiftNum - 1)) + (IF_INTERNAL_OFFS << log2WeightBase);
#define ADD_AVG_OP( ADDR ) dest[ADDR] = ClipPel( rightShift( ( src0[ADDR]*w0 + src2[ADDR]*w1 + offset ), shiftNum ), clpRng )
#define ADD_AVG_INC \
src0 += src1Stride; \
src2 += src2Stride; \
dest += destStride; \
SIZE_AWARE_PER_EL_OP(ADD_AVG_OP, ADD_AVG_INC);
#undef ADD_AVG_OP
#undef ADD_AVG_INC
}
#endif
template<>
void AreaBuf<Pel>::addAvg( const AreaBuf<const Pel> &other1, const AreaBuf<const Pel> &other2, const ClpRng& clpRng)
......
......@@ -68,6 +68,12 @@ struct PelBufferOps
void ( *reco8 ) ( const Pel* src0, int src0Stride, const Pel* src1, int src1Stride, Pel *dst, int dstStride, int width, int height, const ClpRng& clpRng );
void ( *linTf4 ) ( const Pel* src0, int src0Stride, Pel *dst, int dstStride, int width, int height, int scale, int shift, int offset, const ClpRng& clpRng, bool bClip );
void ( *linTf8 ) ( const Pel* src0, int src0Stride, Pel *dst, int dstStride, int width, int height, int scale, int shift, int offset, const ClpRng& clpRng, bool bClip );
#if ENABLE_SIMD_OPT_GBI
void ( *removeWeightHighFreq8) ( Pel* src0, int src0Stride, const Pel* src1, int src1Stride, int width, int height, int shift, int gbiWeight);
void ( *removeWeightHighFreq4) ( Pel* src0, int src0Stride, const Pel* src1, int src1Stride, int width, int height, int shift, int gbiWeight);
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
};
extern PelBufferOps g_pelBufOP;
......@@ -102,6 +108,10 @@ struct AreaBuf : public Size
void subtract ( const AreaBuf<const T> &other );
void extendSingleBorderPel();
void extendBorderPel ( unsigned margin );
#if JVET_L0646_GBI
void addWeightedAvg ( const AreaBuf<const T> &other1, const AreaBuf<const T> &other2, const ClpRng& clpRng, const int8_t gbiIdx);
void removeWeightHighFreq ( const AreaBuf<T>& other, const bool bClip, const ClpRng& clpRng, const int8_t iGbiWeight);
#endif
void addAvg ( const AreaBuf<const T> &other1, const AreaBuf<const T> &other2, const ClpRng& clpRng );
void removeHighFreq ( const AreaBuf<T>& other, const bool bClip, const ClpRng& clpRng);
void updateHistogram ( std::vector<int32_t>& hist ) const;
......@@ -384,6 +394,59 @@ void AreaBuf<T>::toLast( const ClpRng& clpRng )
template<>
void AreaBuf<Pel>::toLast( const ClpRng& clpRng );
#if JVET_L0646_GBI
template<typename T>
void AreaBuf<T>::removeWeightHighFreq(const AreaBuf<T>& other, const bool bClip, const ClpRng& clpRng, const int8_t gbiWeight)
{
const int8_t gbiWeightOther = g_GbiWeightBase - gbiWeight;
const int8_t log2WeightBase = g_GbiLog2WeightBase;
const Pel* src = other.buf;
const int srcStride = other.stride;
Pel* dst = buf;
const int dstStride = stride;
#if ENABLE_SIMD_OPT_GBI
if(!bClip)
{
if(!(width & 7))
g_pelBufOP.removeWeightHighFreq8(dst, dstStride, src, srcStride, width, height, 16, gbiWeight);
else if(!(width & 3))
g_pelBufOP.removeWeightHighFreq4(dst, dstStride, src, srcStride, width, height, 16, gbiWeight);
else
CHECK(true, "Not supported");
}
else
{
#endif
int normalizer = ((1 << 16) + (gbiWeight > 0 ? (gbiWeight >> 1) : -(gbiWeight >> 1))) / gbiWeight;
int weight0 = normalizer << log2WeightBase;
int weight1 = gbiWeightOther * normalizer;
#define REM_HF_INC \
src += srcStride; \
dst += dstStride; \
#define REM_HF_OP_CLIP( ADDR ) dst[ADDR] = ClipPel<T>( (dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16, clpRng )
#define REM_HF_OP( ADDR ) dst[ADDR] = (dst[ADDR]*weight0 - src[ADDR]*weight1 + (1<<15))>>16
if(bClip)
{
SIZE_AWARE_PER_EL_OP(REM_HF_OP_CLIP, REM_HF_INC);
}
else
{
SIZE_AWARE_PER_EL_OP(REM_HF_OP, REM_HF_INC);
}
#undef REM_HF_INC
#undef REM_HF_OP
#undef REM_HF_OP_CLIP
#if ENABLE_SIMD_OPT_GBI
}
#endif
}
#endif
template<typename T>
void AreaBuf<T>::removeHighFreq( const AreaBuf<T>& other, const bool bClip, const ClpRng& clpRng )
......@@ -394,6 +457,20 @@ void AreaBuf<T>::removeHighFreq( const AreaBuf<T>& other, const bool bClip, cons
T* dst = buf;
const int dstStride = stride;
#if ENABLE_SIMD_OPT_GBI && JVET_L0646_GBI
if (!bClip)
{
if(!(width & 7))
g_pelBufOP.removeHighFreq8(dst, dstStride, src, srcStride, width, height);
else if (!(width & 3))
g_pelBufOP.removeHighFreq4(dst, dstStride, src, srcStride, width, height);
else
CHECK(true, "Not supported");
}
else
{
#endif
#define REM_HF_INC \
src += srcStride; \
dst += dstStride; \
......@@ -413,6 +490,10 @@ void AreaBuf<T>::removeHighFreq( const AreaBuf<T>& other, const bool bClip, cons
#undef REM_HF_INC
#undef REM_HF_OP
#undef REM_HF_OP_CLIP
#if ENABLE_SIMD_OPT_GBI && JVET_L0646_GBI
}
#endif
}
......@@ -576,10 +657,16 @@ struct UnitBuf
void reconstruct ( const UnitBuf<const T> &pred, const UnitBuf<const T> &resi, const ClpRngs& clpRngs );
void copyClip ( const UnitBuf<const T> &src, const ClpRngs& clpRngs );
void subtract ( const UnitBuf<const T> &other );
#if JVET_L0646_GBI
void addWeightedAvg ( const UnitBuf<const T> &other1, const UnitBuf<const T> &other2, const ClpRngs& clpRngs, const uint8_t gbiIdx = GBI_DEFAULT, const bool chromaOnly = false, const bool lumaOnly = false);
#endif
void addAvg ( const UnitBuf<const T> &other1, const UnitBuf<const T> &other2, const ClpRngs& clpRngs, const bool chromaOnly = false, const bool lumaOnly = false);
void extendSingleBorderPel();
void extendBorderPel ( unsigned margin );
void removeHighFreq ( const UnitBuf<T>& other, const bool bClip, const ClpRngs& clpRngs
#if JVET_L0646_GBI
, const int8_t gbiWeight = g_GbiWeights[GBI_DEFAULT]
#endif
);
UnitBuf< T> subBuf (const UnitArea& subArea);
......@@ -649,6 +736,21 @@ void UnitBuf<T>::reconstruct(const UnitBuf<const T> &pred, const UnitBuf<const T
}
}
#if JVET_L0646_GBI
template<typename T>
void UnitBuf<T>::addWeightedAvg(const UnitBuf<const T> &other1, const UnitBuf<const T> &other2, const ClpRngs& clpRngs, const uint8_t gbiIdx /* = GBI_DEFAULT */, const bool chromaOnly /* = false */, const bool lumaOnly /* = false */)
{
const size_t istart = chromaOnly ? 1 : 0;
const size_t iend = lumaOnly ? 1 : bufs.size();
CHECK(lumaOnly && chromaOnly, "should not happen");
for(size_t i = istart; i < iend; i++)
{
bufs[i].addWeightedAvg(other1.bufs[i], other2.bufs[i], clpRngs.comp[i], gbiIdx);
}
}
#endif
template<typename T>
void UnitBuf<T>::addAvg(const UnitBuf<const T> &other1, const UnitBuf<const T> &other2, const ClpRngs& clpRngs, const bool chromaOnly /* = false */, const bool lumaOnly /* = false */)
......@@ -684,12 +786,25 @@ void UnitBuf<T>::extendBorderPel( unsigned margin )
template<typename T>
void UnitBuf<T>::removeHighFreq( const UnitBuf<T>& other, const bool bClip, const ClpRngs& clpRngs
#if JVET_L0646_GBI
, const int8_t gbiWeight
#endif
)
{
for( unsigned i = 0; i < bufs.size(); i++ )
#if JVET_L0646_GBI
if(gbiWeight != g_GbiWeights[GBI_DEFAULT])
{
bufs[i].removeHighFreq(other.bufs[i], bClip, clpRngs.comp[i] );
bufs[0].removeWeightHighFreq(other.bufs[0], bClip, clpRngs.comp[0], gbiWeight);
return;
}
bufs[0].removeHighFreq(other.bufs[0], bClip, clpRngs.comp[0]);
#else
for (unsigned i = 0; i <bufs.size(); i++)
{
bufs[i].removeHighFreq(other.bufs[i], bClip, clpRngs.comp[i]);
}
#endif
}
template<typename T>
......
......@@ -47,10 +47,6 @@ set( INC_FILES ${BASE_INC_FILES} ${X86_INC_FILES} ${MD5_INC_FILES} )
# library
add_library( ${LIB_NAME} STATIC ${SRC_FILES} ${INC_FILES} ${NATVIS_FILES} )
if( ENABLE_VTM )
target_compile_definitions( ${LIB_NAME} PUBLIC BMS_TOOLS=0 )
endif()
if( EXTENSION_360_VIDEO )
target_compile_definitions( ${LIB_NAME} PUBLIC EXTENSION_360_VIDEO=1 )
endif()
......
......@@ -100,6 +100,9 @@ enum CodingStatisticsType
STATS__CABAC_BITS__PAR_FLAG,
STATS__CABAC_BITS__ALF,
STATS__CABAC_BITS__IMV_FLAG,
#if JVET_L0646_GBI
STATS__CABAC_BITS__GBI_IDX,
#endif
STATS__CABAC_BITS__EMT_CU_FLAG,
STATS__CABAC_BITS__EMT_TU_INDEX,
STATS__TOOL_EMT,
......@@ -170,6 +173,9 @@ static inline const char* getName(CodingStatisticsType name)
"CABAC_BITS__ALIGNED_SIGN_BIT",
"CABAC_BITS__ALIGNED_ESCAPE_BITS",
"CABAC_BITS__IMV_FLAG",
#if JVET_L0646_GBI
"CABAC_BITS__GBI_IDX",
#endif
"CABAC_BITS__EMT_CU_FLAG",
"CABAC_BITS__EMT_TU_INDX",
"CABAC_BITS__OTHER",
......
......@@ -291,6 +291,17 @@ static const int AFFINE_MAX_NUM_V2 = 2; ///< max
static const int AFFINE_MAX_NUM_COMB = 12; ///< max number of combined motion candidates
static const int AFFINE_MIN_BLOCK_SIZE = 4; ///< Minimum affine MC block size
#if JVET_L0274
static const int MAX_NUM_REG_BINS_4x4SUBBLOCK = 32; ///< max number of context-coded bins (incl. gt2 bins) per 4x4 subblock
static const int MAX_NUM_GT2_BINS_4x4SUBBLOCK = 4; ///< max number of gt2 bins per 4x4 subblock
static const int MAX_NUM_REG_BINS_2x2SUBBLOCK = 8; ///< max number of context-coded bins (incl. gt2 bins) per 2x2 subblock (chroma)
static const int MAX_NUM_GT2_BINS_2x2SUBBLOCK = 2; ///< max number of gt2 bins per 2x2 subblock (chroma)
#endif
#if JVET_L0646_GBI
static const int GBI_NUM = 5; ///< the number of weight options
static const int GBI_DEFAULT = ((uint8_t)(GBI_NUM >> 1)); ///< Default weighting index representing for w=0.5
static const int GBI_SIZE_CONSTRAINT = 256; ///< disabling GBi if cu size is smaller than 256
#endif
#if W0038_DB_OPT
static const int MAX_ENCODER_DEBLOCKING_QUALITY_LAYERS = 8 ;
......
......@@ -198,7 +198,9 @@ unsigned DeriveCtx::CtxCUsplit( const CodingStructure& cs, Partitioner& partitio
#endif
ctxId += ( cuAbove && cuAbove->qtDepth > partitioner.currQtDepth ) ? 1 : 0;
#if JVET_L0361_SPLIT_CTX
ctxId += partitioner.currQtDepth < 2 ? 0 : 3;
#else
if( cs.sps->getSpsNext().getUseLargeCTU() )
{
unsigned minDepth = 0;
......@@ -213,6 +215,7 @@ unsigned DeriveCtx::CtxCUsplit( const CodingStructure& cs, Partitioner& partitio
ctxId = 4;
}
}
#endif
return ctxId;
}
......@@ -319,10 +322,39 @@ unsigned DeriveCtx::CtxBTsplit(const CodingStructure& cs, Partitioner& partition
#endif
{
#if JVET_L0361_SPLIT_CTX
unsigned widthCurr = partitioner.currArea().lwidth();
unsigned heightCurr = partitioner.currArea().lheight();
if( cuLeft )
{
unsigned heightLeft = cuLeft->Y().height;
ctx += ( heightLeft < heightCurr ? 1 : 0 );
}
if( cuAbove )
{
unsigned widthAbove = cuAbove->Y().width;
ctx += ( widthAbove < widthCurr ? 1 : 0 );
}
if( partitioner.chType == CHANNEL_TYPE_CHROMA )
{
ctx += 9;
}
else
{
int maxBTSize = cs.pcv->getMaxBtSize( *cs.slice, partitioner.chType );
int th1 = ( maxBTSize == 128 ) ? 128 : ( ( maxBTSize == 64 ) ? 64 : 64 );
int th2 = ( maxBTSize == 128 ) ? 1024 : ( ( maxBTSize == 64 ) ? 512 : 256 );
unsigned int sizeCurr = widthCurr * heightCurr;
ctx += sizeCurr > th2 ? 0 : ( sizeCurr > th1 ? 3 : 6 );
}
#else
const unsigned currDepth = partitioner.currQtDepth * 2 + partitioner.currBtDepth;
if( cuLeft ) ctx += ( ( 2 * cuLeft->qtDepth + cuLeft->btDepth ) > currDepth ? 1 : 0 );
if( cuAbove ) ctx += ( ( 2 * cuAbove->qtDepth + cuAbove->btDepth ) > currDepth ? 1 : 0 );
#endif
}
return ctx;
}
......@@ -347,5 +379,8 @@ void MergeCtx::setMergeInfo( PredictionUnit& pu, int candIdx )
pu.mvpNum [REF_PIC_LIST_0] = NOT_VALID;
pu.mvpNum [REF_PIC_LIST_1] = NOT_VALID;
#if JVET_L0646_GBI
pu.cu->GBiIdx = ( interDirNeighbours[candIdx] == 3 ) ? GBiIdx[candIdx] : GBI_DEFAULT;
#endif
}
......@@ -107,7 +107,11 @@ public:
const int diag = posX + posY;
int numPos = 0;
int sumAbs = 0;
#if JVET_L0274
#define UPDATE(x) {int a=abs(x);sumAbs+=std::min(2+(a&1),a);numPos+=!!a;}
#else
#define UPDATE(x) {int a=abs(x);sumAbs+=std::min(4-(a&1),a);numPos+=!!a;}
#endif
if( posX < m_width-1 )
{
UPDATE( pData[1] );
......@@ -154,6 +158,36 @@ public:
unsigned greater1CtxIdAbs ( uint8_t offset ) const { return m_gtxFlagCtxSet[1]( offset ); }
unsigned greater2CtxIdAbs ( uint8_t offset ) const { return m_gtxFlagCtxSet[0]( offset ); }
#if JVET_L0274
unsigned templateAbsSum( int scanPos, const TCoeff* coeff )
{
const uint32_t posY = m_scanPosY[scanPos];
const uint32_t posX = m_scanPosX[scanPos];
const TCoeff* pData = coeff + posX + posY * m_width;
int sum = 0;
if (posX < m_width - 1)
{
sum += abs(pData[1]);
if (posX < m_width - 2)
{
sum += abs(pData[2]);
}
if (posY < m_height - 1)
{
sum += abs(pData[m_width + 1]);
}
}
if (posY < m_height - 1)
{
sum += abs(pData[m_width]);
if (posY < m_height - 2)
{
sum += abs(pData[m_width << 1]);
}
}
return std::min(sum, 31);
}
#else
unsigned GoRiceParAbs( int scanPos, const TCoeff* coeff ) const
{
#define UPDATE(x) sum+=abs(x)-!!x
......@@ -185,7 +219,7 @@ public:
int r = g_auiGoRicePars[ std::min( sum, 31 ) ];
return r;
}
#endif
unsigned emtNumSigCoeff() const { return m_emtNumSigCoeff; }
void setEmtNumSigCoeff( unsigned val ) { m_emtNumSigCoeff = val; }
......@@ -265,6 +299,9 @@ public:
~MergeCtx() {}
public:
MvField mvFieldNeighbours [ MRG_MAX_NUM_CANDS << 1 ]; // double length for mv of both lists
#if JVET_L0646_GBI
uint8_t GBiIdx [ MRG_MAX_NUM_CANDS ];
#endif
unsigned char interDirNeighbours[ MRG_MAX_NUM_CANDS ];
MergeType mrgTypeNeighbours [ MRG_MAX_NUM_CANDS ];
int numValidMergeCand;
......
......@@ -262,16 +262,29 @@ std::vector<std::vector<uint8_t>> ContextSetCfg::sm_InitTables( NUMBER_OF_SLICE_
const CtxSet ContextSetCfg::SplitFlag = ContextSetCfg::addCtxSet
({
#if JVET_L0361_SPLIT_CTX
{ 107, 139, 126, 107, 139, 126, },
{ 107, 139, 126, 107, 139, 126, },
{ 139, 141, 157, 139, 141, 157, },
#else
{ 107, 139, 126, 255, 0,},
{ 107, 139, 126, 255, 0,},
{ 139, 141, 157, 255, 0,},
#endif
});
const CtxSet ContextSetCfg::BTSplitFlag = ContextSetCfg::addCtxSet
({
#if JVET_L0361_SPLIT_CTX
// |-------- 1st bin, 9 ctx for luma + 3 ctx for chroma------| |--2nd bin--| |3rd bin|
{ 107, 139, 126, 107, 139, 126, 107, 139, 126, 107, 139, 126, 154, 154, 154, 154,},
{ 107, 139, 126, 107, 139, 126, 107, 139, 126, 107, 139, 126, 154, 154, 154, 154,},
{ 139, 141, 157, 139, 141, 157, 139, 141, 157, 139, 141, 157, 154, 154, 154, 154,},
#else
{ 107, 139, 126, 154, 154, 154, 154, 154, 154, 154, 154, 154,},
{ 107, 139, 126, 154, 154, 154, 154, 154, 154, 154, 154, 154,},
{ 139, 141, 157, 154, 154, 154, 154, 154, 154, 154, 154, 154,},
#endif
});
const CtxSet ContextSetCfg::SkipFlag = ContextSetCfg::addCtxSet
......@@ -373,6 +386,15 @@ const CtxSet ContextSetCfg::AffineType = ContextSetCfg::addCtxSet
{ CNU, },
});
#if JVET_L0646_GBI
const CtxSet ContextSetCfg::GBiIdx = ContextSetCfg::addCtxSet
({
// 4 ctx for 1st bin; 1 ctx for each of rest bins
{ 95, 79, 63, 31, 31, 31, 31, },
{ 95, 79, 63, 31, 31, 31, 31, },
{ CNU, CNU, CNU, CNU, CNU, CNU, CNU, },
});
#endif
const CtxSet ContextSetCfg::Mvd = ContextSetCfg::addCtxSet
({
......@@ -447,6 +469,44 @@ const CtxSet ContextSetCfg::SigCoeffGroup[] =
const CtxSet ContextSetCfg::SigFlag[] =
{
#if JVET_L0274
ContextSetCfg::addCtxSet
({
{ 120, 152, 167, 153, 168, 169, 119, 167, 197, 183, 183, 170, 209, 213, 183, 183, 169, 185, },
{ 149, 152, 167, 168, 183, 140, 149, 182, 168, 183, 169, 170, 195, 213, 183, 198, 184, 156, },
{ 120, 138, 153, 154, 140, 126, 120, 139, 154, 155, 155, 142, 137, 185, 169, 185, 171, 159, },
}),
ContextSetCfg::addCtxSet
({
{ 148, 167, 153, 139, 154, 140, 166, 199, 183, 184, 184, 157, },
{ 134, 168, 168, 139, 169, 155, 166, 229, 198, 229, 185, 157, },
{ 119, 168, 153, 140, 140, 141, 167, 200, 155, 172, 142, 158, },
}),
ContextSetCfg::addCtxSet
({
{ 152, 127, 173, 201, 187, 173, 226, 188, 188, 217, 188, 174, 182, 223, 223, 223, 223, 223, },
{ 123, 142, 202, 172, 157, 203, 138, 173, 218, 188, 173, 175, 168, 223, 223, 223, 223, 223, },
{ 108, 157, 173, 173, 218, 189, 123, 175, 159, 175, 190, 251, 79, 223, 223, 223, 223, 223, },
}),
ContextSetCfg::addCtxSet
({
{ 196, 156, 143, 158, 172, 216, 168, 223, 223, 223, 191, 223, },
{ 182, 141, 158, 186, 142, 173, 183, 223, 223, 223, 222, 223, },
{ 152, 158, 157, 187, 204, 175, 170, 223, 223, 237, 223, 223, },
}),
ContextSetCfg::addCtxSet
({
{ 137, 142, 189, 173, 187, 174, 241, 175, 175, 174, 174, 204, 210, 223, 223, 223, 223, 223, },
{ 123, 172, 175, 158, 158, 233, 138, 175, 190, 175, 188, 175, 196, 223, 223, 223, 223, 223, },
{ 107, 143, 219, 188, 233, 190, 63, 250, 205, 252, 220, 251, 63, 223, 223, 223, 223, 253, },
}),
ContextSetCfg::addCtxSet
({
{ 167, 185, 159, 158, 159, 189, 196, 223, 223, 223, 223, 223, },
{ 167, 141, 175, 143, 172, 159, 182, 223, 223, 223, 223, 223, },
{ 166, 159, 158, 232, 158, 174, 183, 238, 223, 223, 223, 223, },
}),
#else
ContextSetCfg::addCtxSet
({
{ 106, 167, 182, 124, 139, 169, 134, 167, 197, 183, 183, 184, 209, 198, 168, 168, 183, 170, CNU, CNU, },
......@@ -483,9 +543,55 @@ const CtxSet ContextSetCfg::SigFlag[] =
{ 167, 155, 159, 157, 157, 158, 182, 223, 223, 223, 223, 223, },
{ 181, 159, 143, 232, 143, 173, 169, 237, 223, 223, 238, 253, },
}),
#endif
};
#if JVET_L0274
const CtxSet ContextSetCfg::ParFlag[] =
{
ContextSetCfg::addCtxSet
({
{ 105, 119, 151, 152, 153, 153, 135, 152, 182, 153, 168, 136, 182, 153, 168, 139, 166, 168, 139, 168, 154, },
{ 120, 119, 151, 167, 138, 168, 135, 152, 153, 153, 139, 136, 153, 153, 168, 139, 137, 168, 168, 139, 139, },
{ 135, 150, 152, 138, 153, 153, 151, 123, 153, 168, 139, 152, 153, 153, 139, 139, 138, 168, 139, 154, 139, },
}),
ContextSetCfg::addCtxSet
({
{ 105, 135, 152, 167, 153, 124, 151, 168, 169, 153, 124, },
{ 134, 150, 152, 153, 153, 153, 166, 168, 168, 139, 139, },
{ 135, 121, 167, 168, 138, 153, 167, 139, 154, 139, 154, },
}),
};
const CtxSet ContextSetCfg::GtxFlag[] =
{
ContextSetCfg::addCtxSet
({
{ 73, 0, 58, 119, 150, 137, 42, 73, 120, 136, 123, 58, 149, 151, 152, 153, 134, 136, 152, 153, 125, },
{ 88, 0, 102, 104, 150, 122, 101, 89, 150, 151, 138, 88, 120, 122, 152, 153, 105, 107, 123, 153, 154, },
{ 134, 161, 149, 121, 122, 138, 88, 120, 107, 108, 109, 105, 107, 123, 109, 124, 151, 138, 139, 154, 140, },
}),
ContextSetCfg::addCtxSet
({
{ 87, 57, 90, 107, 107, 63, 119, 91, 152, 124, 140, },
{ 101, 0, 105, 121, 107, 93, 118, 106, 108, 124, 154, },
{ 179, 72, 90, 121, 122, 123, 75, 76, 123, 139, 170, },
}),
ContextSetCfg::addCtxSet
({
{ 89, 103, 121, 137, 138, 139, 119, 137, 138, 139, 125, 135, 167, 168, 154, 140, 136, 153, 183, 155, 185, },
{ 118, 0, 136, 152, 153, 154, 134, 152, 153, 139, 140, 150, 138, 139, 154, 155, 151, 153, 169, 140, 200, },
{ 164, 149, 137, 153, 124, 125, 151, 138, 139, 125, 125, 152, 139, 140, 140, 111, 153, 154, 155, 170, 127, },
}),
ContextSetCfg::addCtxSet
({
{ 27, 149, 137, 153, 139, 125, 151, 154, 170, 127, 127, },
{ 132, 135, 152, 139, 139, 125, 151, 154, 155, 141, 142, },
{ 165, 121, 138, 139, 139, 125, 138, 154, 156, 171, 127, },
}),
};
#else
const CtxSet ContextSetCfg::ParFlag[] =
{
ContextSetCfg::addCtxSet
......@@ -529,6 +635,7 @@ const CtxSet ContextSetCfg::GtxFlag[] =
{ 147, 73, 164, 151, 107, 109, 120, 152, 140, 185, 111, },
}),
};
#endif
const CtxSet ContextSetCfg::LastX[] =
{
......
......@@ -191,6 +191,9 @@ public:
static const CtxSet ChromaQpAdjFlag;
static const CtxSet ChromaQpAdjIdc;
static const CtxSet ImvFlag;
#if JVET_L0646_GBI
static const CtxSet GBiIdx;
#endif
static const CtxSet ctbAlfFlag;
static const unsigned NumberOfContexts;
......
This diff is collapsed.
......@@ -620,6 +620,13 @@ void InterPrediction::xWeightedAverage( const PredictionUnit& pu, const CPelUnit
if( iRefIdx0 >= 0 && iRefIdx1 >= 0 )
{
#if JVET_L0646_GBI
if( pu.cu->GBiIdx != GBI_DEFAULT )
{
pcYuvDst.addWeightedAvg(pcYuvSrc0, pcYuvSrc1, clpRngs, pu.cu->GBiIdx);
return;
}
#endif
pcYuvDst.addAvg( pcYuvSrc0, pcYuvSrc1, clpRngs );
}
else if( iRefIdx0 >= 0 && iRefIdx1 < 0 )
......
......@@ -92,6 +92,10 @@ public:
#if JVET_J0090_MEMORY_BANDWITH_MEASURE
void cacheAssign( CacheModel *cache ) { m_cacheModel = cache; }
#endif
#if JVET_L0628_4TAP_INTRA
static TFilterCoeff const * const getChromaFilterTable(const int deltaFract) { return m_chromaFilter[deltaFract]; };
#endif //JVET_L0628_4TAP_INTRA
};
//! \}
......
This diff is collapsed.
......@@ -86,8 +86,12 @@ protected:
void xPredIntraDc ( const CPelBuf &pSrc, PelBuf &pDst, const ChannelType channelType, const bool enableBoundaryFilter = true );
#if HEVC_USE_HOR_VER_PREDFILTERING
void xPredIntraAng ( const CPelBuf &pSrc, PelBuf &pDst, const ChannelType channelType, const uint32_t dirMode, const ClpRng& clpRng, const bool bEnableEdgeFilters, const SPS& sps, const bool enableBoundaryFilter = true );
#else
#if JVET_L0628_4TAP_INTRA
void xPredIntraAng ( const CPelBuf &pSrc, PelBuf &pDst, const ChannelType channelType, const uint32_t dirMode, const ClpRng& clpRng, const SPS& sps, const bool useFilteredPredSamples );
#else
void xPredIntraAng ( const CPelBuf &pSrc, PelBuf &pDst, const ChannelType channelType, const uint32_t dirMode, const ClpRng& clpRng, const SPS& sps, const bool enableBoundaryFilter = true );
#endif //JVET_L0628_4TAP_INTRA
#endif
Pel xGetPredValDc ( const CPelBuf &pSrc, const Size &dstSize );
......
......@@ -250,6 +250,10 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
xSetEdgefilterMultiple( cu, EDGE_HOR, areaTu, m_stLFCUParam.internalEdge );
}
#if L0074_SUBBLOCK_DEBLOCKING
bool mvSubBlocks = false;
int subBlockSize = 8;
#endif
for( auto &currPU : CU::traversePUs( cu ) )
{
const Area& areaPu = cu.Y().valid() ? currPU.block( COMPONENT_Y ) : area;
......@@ -259,8 +263,31 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
xSetEdgefilterMultiple( cu, EDGE_VER, areaPu, (xOff ? m_stLFCUParam.internalEdge : m_stLFCUParam.leftEdge), xOff );
xSetEdgefilterMultiple( cu, EDGE_HOR, areaPu, (yOff ? m_stLFCUParam.internalEdge : m_stLFCUParam.topEdge), yOff );
#if L0074_SUBBLOCK_DEBLOCKING
if ((currPU.mergeFlag && (currPU.mergeType == MRG_TYPE_SUBPU_ATMVP)) || cu.affine)
{
mvSubBlocks = true;
if (edgeDir == EDGE_HOR)
{
for (uint32_t off = subBlockSize; off < areaPu.height; off += subBlockSize)
{
const Area mvBlockH(cu.Y().x, cu.Y().y + off, cu.Y().width, pcv.minCUHeight);
xSetEdgefilterMultiple(cu, EDGE_HOR, mvBlockH, m_stLFCUParam.internalEdge, 1);
}
}
else
{
for (uint32_t off = subBlockSize; off < areaPu.width; off += subBlockSize)
{
const Area mvBlockV(cu.Y().x + off, cu.Y().y, pcv.minCUWidth, cu.Y().height);
xSetEdgefilterMultiple(cu, EDGE_VER, mvBlockV, m_stLFCUParam.internalEdge, 1);
}
}
}
#endif
}
#if !L0074_SUBBLOCK_DEBLOCKING
if ( cu.affine )
{
const int widthInBaseUnits = cu.Y().width >> pcv.minCUWidthLog2;
......@@ -276,6 +303,7 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
xSetEdgefilterMultiple( cu, EDGE_HOR, affiBlockH, m_stLFCUParam.internalEdge, 1 );
}
}
#endif
const unsigned uiPelsInPart = pcv.minCUWidth;
for( int y = 0; y < area.height; y += uiPelsInPart )
......@@ -316,12 +344,27 @@ void LoopFilter::xDeblockCU( CodingUnit& cu, const DeblockEdgeDir edgeDir )
if (cu.blocks[COMPONENT_Y].valid())
{
#if L0074_SUBBLOCK_DEBLOCKING
if (mvSubBlocks)
{
orthogonalIncrement = subBlockSize / 4;
orthogonalLength = (edgeDir == EDGE_HOR) ? cu.blocks[COMPONENT_Y].height / 4 : cu.blocks[COMPONENT_Y].width / 4;
}
#endif
#if L0074_SUBBLOCK_DEBLOCKING
if ((cu.blocks[COMPONENT_Y].height > 64) && (edgeDir == EDGE_HOR) && !mvSubBlocks)
#else
if ((cu.blocks[COMPONENT_Y].height > 64) && (edgeDir == EDGE_HOR))
#endif
{
orthogonalIncrement = 64 / 4;
orthogonalLength = cu.blocks[COMPONENT_Y].height / 4;
}
#if L0074_SUBBLOCK_DEBLOCKING
if ((cu.blocks[COMPONENT_Y].width > 64) && (edgeDir == EDGE_VER) && !mvSubBlocks)
#else
if ((cu.blocks[COMPONENT_Y].width > 64) && (edgeDir == EDGE_VER))
#endif
{
orthogonalIncrement = 64 / 4;
orthogonalLength = cu.blocks[COMPONENT_Y].width / 4;
......
......@@ -140,5 +140,73 @@ struct MotionInfo
}
};
#if JVET_L0646_GBI
class GBiMotionParam
{
bool m_readOnly[2][33]; // 2 RefLists, 33 RefFrams
Mv m_mv[2][33];
Distortion m_dist[2][33];
bool m_readOnlyAffine[2][2][33];
Mv m_mvAffine[2][2][33][3];
Distortion m_distAffine[2][2][33];
public:
void reset()
{
Mv* pMv = &(m_mv[0][0]);
for (int ui = 0; ui < 1 * 2 * 33; ++ui, ++pMv)
{
pMv->set(std::numeric_limits<int16_t>::max(), std::numeric_limits<int16_t>::max());
}
Mv* pAffineMv = &(m_mvAffine[0][0][0][0]);
for (int ui = 0; ui < 2 * 2 * 33 * 3; ++ui, ++pMv)
{
pAffineMv->set(0, 0);
}
memset(m_readOnly, false, 2 * 33 * sizeof(bool));
memset(m_dist, -1, 2 * 33 * sizeof(Distortion));
memset(m_readOnlyAffine, false, 2 * 2 * 33 * sizeof(bool));
memset(m_distAffine, -1, 2 * 2 * 33 * sizeof(Distortion));
}
void setReadMode(bool b, uint32_t uiRefList, uint32_t uiRefIdx) { m_readOnly[uiRefList][uiRefIdx] = b; }
bool isReadMode(uint32_t uiRefList, uint32_t uiRefIdx) { return m_readOnly[uiRefList][uiRefIdx]; }
void setReadModeAffine(bool b, uint32_t uiRefList, uint32_t uiRefIdx, int bP4) { m_readOnlyAffine[bP4][uiRefList][uiRefIdx] = b; }
bool isReadModeAffine(uint32_t uiRefList, uint32_t uiRefIdx, int bP4) { return m_readOnlyAffine[bP4][uiRefList][uiRefIdx]; }
Mv& getMv(uint32_t uiRefList, uint32_t uiRefIdx) { return m_mv[uiRefList][uiRefIdx]; }
void copyFrom(Mv& rcMv, Distortion uiDist, uint32_t uiRefList, uint32_t uiRefIdx)
{
m_mv[uiRefList][uiRefIdx] = rcMv;
m_dist[uiRefList][uiRefIdx] = uiDist;
}
void copyTo(Mv& rcMv, Distortion& ruiDist, uint32_t uiRefList, uint32_t uiRefIdx)
{
rcMv = m_mv[uiRefList][uiRefIdx];
ruiDist = m_dist[uiRefList][uiRefIdx];
}
Mv& getAffineMv(uint32_t uiRefList, uint32_t uiRefIdx, uint32_t uiAffineMvIdx, int bP4) { return m_mvAffine[bP4][uiRefList][uiRefIdx][uiAffineMvIdx]; }
void copyAffineMvFrom(Mv(&racAffineMvs)[3], Distortion uiDist, uint32_t uiRefList, uint32_t uiRefIdx, int bP4)
{
memcpy(m_mvAffine[bP4][uiRefList][uiRefIdx], racAffineMvs, 3 * sizeof(Mv));
m_distAffine[bP4][uiRefList][uiRefIdx] = uiDist;
}
void copyAffineMvTo(Mv acAffineMvs[3], Distortion& ruiDist, uint32_t uiRefList, uint32_t uiRefIdx, int bP4)
{
memcpy(acAffineMvs, m_mvAffine[bP4][uiRefList][uiRefIdx], 3 * sizeof(Mv));
ruiDist = m_distAffine[bP4][uiRefList][uiRefIdx];
}
};
#endif
#endif // __MOTIONINFO__
This diff is collapsed.
......@@ -91,6 +91,11 @@ private:
const BinFracBits& fracBitsPar,
const BinFracBits& fracBitsGt1,
const BinFracBits& fracBitsGt2,
#if JVET_L0274
const int remGt2Bins,
const int remRegBins,
unsigned goRiceZero,
#endif
uint16_t ui16AbsGoRice,
int iQBits,
double errorScale,
......@@ -101,6 +106,11 @@ private:
const BinFracBits& fracBitsPar,
const BinFracBits& fracBitsGt1,
const BinFracBits& fracBitsGt2,
#if JVET_L0274
const int remGt2Bins,
const int remRegBins,
unsigned goRiceZero,
#endif
const uint16_t ui16AbsGoRice,
const bool useLimitedPrefixLength,
const int maxLog2TrDynamicRange ) const;
......
This diff is collapsed.
......@@ -90,7 +90,12 @@ extern const uint32_t ctxIndMap4x4[4*4];
extern const uint32_t g_uiGroupIdx[ MAX_TU_SIZE ];
extern const uint32_t g_uiMinInGroup[ LAST_SIGNIFICANT_GROUPS ];
#if JVET_L0274
extern const uint32_t g_auiGoRiceParsCoeff [ 32 ];
extern const uint32_t g_auiGoRicePosCoeff0[ 3 ][ 32 ];
#else
extern const uint32_t g_auiGoRicePars [ 32 ];
#endif
extern const uint32_t g_auiGoRiceRange[ MAX_GR_ORDER_RESIDUAL ]; //!< maximum value coded with Rice codes
// ====================================================================================================================
......@@ -209,9 +214,27 @@ extern const uint32_t g_scalingListSizeX[SCALING_LIST_SIZE_NUM];
extern MsgLevel g_verbosity;
#if JVET_L0191_LM_WO_LMS
extern int g_aiLMDivTableLow[];
extern int g_aiLMDivTableHigh[];
#endif
extern const int g_aiNonLMPosThrs[];
#if JVET_L0646_GBI
extern const int8_t g_GbiLog2WeightBase;
extern const int8_t g_GbiWeightBase;
extern const int8_t g_GbiWeights[GBI_NUM];
extern const int8_t g_GbiSearchOrder[GBI_NUM];
extern int8_t g_GbiCodingOrder[GBI_NUM];
extern int8_t g_GbiParsingOrder[GBI_NUM];
class CodingStructure;
int8_t getGbiWeight(uint8_t gbiIdx, uint8_t uhRefFrmList);
void resetGbiCodingOrder(bool bRunDecoding, const CodingStructure &cs);
uint32_t deriveWeightIdxBits(uint8_t gbiIdx);
#endif
constexpr uint8_t g_tbMax[257] = { 0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
......
......@@ -124,6 +124,16 @@ Slice::Slice()
, m_encCABACTableIdx (I_SLICE)
, m_iProcessingStartTime ( 0 )
, m_dProcessingTime ( 0 )
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
, m_splitConsOverrideFlag ( false )
, m_uiMinQTSize ( 0 )
, m_uiMaxBTDepth ( 0 )
, m_uiMaxTTSize ( 0 )
, m_uiMinQTSizeIChroma ( 0 )
, m_uiMaxBTDepthIChroma ( 0 )
, m_uiMaxBTSizeIChroma ( 0 )
, m_uiMaxTTSizeIChroma ( 0 )
#endif
, m_uiMaxBTSize ( 0 )
{
for(uint32_t i=0; i<NUM_REF_PIC_LIST_01; i++)
......@@ -815,6 +825,16 @@ void Slice::copySliceInfo(Slice *pSrc, bool cpyAlmostAll)
m_subPuMvpSubBlkLog2Size = pSrc->m_subPuMvpSubBlkLog2Size;
m_maxNumMergeCand = pSrc->m_maxNumMergeCand;
if( cpyAlmostAll ) m_encCABACTableIdx = pSrc->m_encCABACTableIdx;
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT
m_splitConsOverrideFlag = pSrc->m_splitConsOverrideFlag;
m_uiMinQTSize = pSrc->m_uiMinQTSize;
m_uiMaxBTDepth = pSrc->m_uiMaxBTDepth;
m_uiMaxTTSize = pSrc->m_uiMaxTTSize;
m_uiMinQTSizeIChroma = pSrc->m_uiMinQTSizeIChroma;
m_uiMaxBTDepthIChroma = pSrc->m_uiMaxBTDepthIChroma;
m_uiMaxBTSizeIChroma = pSrc->m_uiMaxBTSizeIChroma;
m_uiMaxTTSizeIChroma = pSrc->m_uiMaxTTSizeIChroma;
#endif
m_uiMaxBTSize = pSrc->m_uiMaxBTSize;
}
......@@ -1646,9 +1666,16 @@ SPSNext::SPSNext( SPS& sps )
// default values for additional parameters
, m_CTUSize ( 0 )
#if JVET_L0217_L0678_PARTITION_HIGHLEVEL_CONSTRAINT