Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ endif()
# project name
project( vvdec VERSION 3.2.0 )
# set alternative version numbering for release candidates
set( PROJECT_VERSION_RC rc1 )
set( PROJECT_VERSION_RC rc2 )
if( PROJECT_VERSION_RC )
set( PROJECT_VERSION "${PROJECT_VERSION}-${PROJECT_VERSION_RC}" )
endif()
Expand Down Expand Up @@ -264,6 +264,8 @@ set( VVDEC_ENABLE_WERROR ON CACHE BOOL "Treat warnings as

set( VVDEC_USE_ADDRESS_SANITIZER OFF CACHE BOOL "Enable or disable address sanitizer" )

set( VVDEC_FUZZING_BUILD OFF CACHE BOOL "Build fuzz-testing binaries using clang -fsanitize=fuzzer" )

if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )

Expand Down Expand Up @@ -387,6 +389,19 @@ if( VVDEC_USE_THREAD_SANITIZER )
add_link_options( "-fsanitize=thread" )
endif()

if( VVDEC_FUZZING_BUILD )
add_compile_definitions( FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION=1 )

if( CMAKE_CXX_COMPILER_ID STREQUAL "Clang" )
message( STATUS "enabled GNU/Clang fuzzing sanitizer" )

add_compile_options( -fsanitize=fuzzer -fno-omit-frame-pointer )
add_link_options( "-fsanitize=fuzzer-no-link" )
else()
message( WARNING "You probably want to build with clang, when enabling VVDEC_FUZZING_BUILD" )
endif()
endif()

if( VVDEC_ENABLE_WERROR )
add_compile_options( "$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:-Werror>" )
add_compile_options( "$<$<CXX_COMPILER_ID:MSVC>:/WX>" )
Expand Down Expand Up @@ -486,6 +501,9 @@ enable_testing()
if( NOT BUILD_SHARED_LIBS )
add_subdirectory( "tests/vvdec_unit_test" )
endif()
if( VVDEC_FUZZING_BUILD )
add_subdirectory( "tests/fuzzing" )
endif()

# create a list of all test bitstreams in variable BITSTREAM_FILES
# also defines BITSTREAM_URL_BASE
Expand Down
3 changes: 2 additions & 1 deletion source/Lib/CommonLib/CodingStructure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,10 @@ void CodingStructure::initVIbcBuf( int numCtuLines, ChromaFormat chromaFormatIDC
m_virtualIBCbuf.resize( numCtuLines );
for( auto& buf: m_virtualIBCbuf )
{
if( buf.bufs.empty() )
if( buf.bufs.empty() || m_IBCBufferWidth != g_IBCBufferSize / ctuSize )
{
m_IBCBufferWidth = g_IBCBufferSize / ctuSize;
buf.destroy();
buf.create( UnitArea( chromaFormatIDC, Area( 0, 0, m_IBCBufferWidth, ctuSize ) ) );
}
}
Expand Down
4 changes: 4 additions & 0 deletions source/Lib/CommonLib/ContextModelling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,10 @@ void MergeCtx::setMmvdMergeCandiInfo( CodingUnit& cu, int candIdx )
cu.mv [REF_PIC_LIST_1][0] = mmvdBaseMv[fPosBaseIdx][1].mv + tempMv[1];
cu.refIdx[REF_PIC_LIST_1] = refList1;
}
else
{
CHECK( refList0 < 0 && refList1 < 0, "MMVD base merge candidate for the signalled base index is not available" );
}

//cu.setMmvdFlag ( true );
cu.mmvdIdx = candIdx;
Expand Down
33 changes: 13 additions & 20 deletions source/Lib/CommonLib/ContextModelling.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,40 +461,33 @@ class CUCtx

class MergeCtx
{
public:
MergeCtx() : numValidMergeCand( 0 ) { memset( mrgTypeNeighbours, 0, sizeof( mrgTypeNeighbours ) ); }
~MergeCtx() {}
public:
MvField mvFieldNeighbours [ MRG_MAX_NUM_CANDS << 1 ]; // double length for mv of both lists
uint8_t BcwIdx [ MRG_MAX_NUM_CANDS ];
unsigned char interDirNeighbours[ MRG_MAX_NUM_CANDS ];
MergeType mrgTypeNeighbours [ MRG_MAX_NUM_CANDS ];
int numValidMergeCand;
uint8_t BcwIdx [ MRG_MAX_NUM_CANDS ] = { 0 };
unsigned char interDirNeighbours[ MRG_MAX_NUM_CANDS ] = { 0 };
MergeType mrgTypeNeighbours [ MRG_MAX_NUM_CANDS ] = { MergeType(0) };
int numValidMergeCand = 0;

MvField mmvdBaseMv [MMVD_BASE_MV_NUM ][2];
MvField mmvdBaseMv [ MMVD_BASE_MV_NUM ][2];
bool mmvdUseAltHpelIf [ MMVD_BASE_MV_NUM ] = { false };
bool useAltHpelIf [ MRG_MAX_NUM_CANDS ] = { false };

void setMmvdMergeCandiInfo( CodingUnit& cu, int candIdx );
bool mmvdUseAltHpelIf [ MMVD_BASE_MV_NUM ];
bool useAltHpelIf [ MRG_MAX_NUM_CANDS ];
void setMergeInfo ( CodingUnit& cu, int candIdx );
void init() { numValidMergeCand = 0; memset( mrgTypeNeighbours, 0, sizeof( mrgTypeNeighbours ) ); }
};

class AffineMergeCtx
{
public:
AffineMergeCtx() : numValidMergeCand( 0 ) { for ( unsigned i = 0; i < AFFINE_MRG_MAX_NUM_CANDS; i++ ) affineType[i] = AFFINEMODEL_4PARAM; }
~AffineMergeCtx() {}
public:
MvField mvFieldNeighbours [AFFINE_MRG_MAX_NUM_CANDS << 1][3]; // double length for mv of both lists
unsigned char interDirNeighbours[AFFINE_MRG_MAX_NUM_CANDS ];
AffineModel affineType [AFFINE_MRG_MAX_NUM_CANDS ];
uint8_t BcwIdx [AFFINE_MRG_MAX_NUM_CANDS ];
int numValidMergeCand;
int maxNumMergeCand;
unsigned char interDirNeighbours[AFFINE_MRG_MAX_NUM_CANDS ] = { 0 };
AffineModel affineType [AFFINE_MRG_MAX_NUM_CANDS ] = { AffineModel( 0 ) }; // AFFINEMODEL_4PARAM
uint8_t BcwIdx [AFFINE_MRG_MAX_NUM_CANDS ] = { 0 };
int numValidMergeCand = 0;
int maxNumMergeCand = 0;

MotionBuf subPuMvpMiBuf;
MergeType mergeType [AFFINE_MRG_MAX_NUM_CANDS ];
MergeType mergeType [AFFINE_MRG_MAX_NUM_CANDS ] = { MergeType(0) };
};


Expand Down
46 changes: 27 additions & 19 deletions source/Lib/CommonLib/InterPrediction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ void gradFilterCore(Pel* pSrc, ptrdiff_t srcStride, int width, int height, ptrdi

void PaddBIOCore(const Pel* refPel,Pel* dstPel,unsigned width,const int shift)
{
#define LFTSHFT(y,shift) y<<shift // simplification because shift is never < 0
#define LFTSHFT( y, shift ) y * ( 1 << shift ) // simplification because shift is never < 0

for( int w = 0; w < width + 2 * BIO_EXTEND_SIZE; w++ )
{
Expand Down Expand Up @@ -328,6 +328,19 @@ InterPrediction::InterPrediction()
clipMv = clipMvInPic;

m_currChromaFormat = NUM_CHROMA_FORMAT;

memset( m_gradX0, 0x00, sizeof( m_gradX0 ) );
memset( m_gradY0, 0x00, sizeof( m_gradY0 ) );
memset( m_gradX1, 0x00, sizeof( m_gradX1 ) );
memset( m_gradY1, 0x00, sizeof( m_gradY1 ) );
memset( m_bdofBlock, 0x00, sizeof( m_bdofBlock ) );
memset( m_acYuvPred, 0x00, sizeof( m_acYuvPred ) );
memset( m_tmpBlock, 0x00, sizeof( m_tmpBlock ) );
memset( m_cRefSamplesDMVRL0, 0x00, sizeof( m_cRefSamplesDMVRL0 ) );
memset( m_cRefSamplesDMVRL1, 0x00, sizeof( m_cRefSamplesDMVRL1 ) );
memset( m_cYuvPredTempDMVRL0, 0x00, sizeof( m_cYuvPredTempDMVRL0 ) );
memset( m_cYuvPredTempDMVRL1, 0x00, sizeof( m_cYuvPredTempDMVRL1 ) );
memset( m_SADsArray, 0x00, sizeof( m_SADsArray ) );
}

InterPrediction::~InterPrediction()
Expand All @@ -337,7 +350,6 @@ InterPrediction::~InterPrediction()

void InterPrediction::destroy()
{
m_IBCBuffer.destroy();
}

void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC, const int ctuSize, bool enableOpt )
Expand Down Expand Up @@ -382,11 +394,6 @@ void InterPrediction::init( RdCost* pcRdCost, ChromaFormat chromaFormatIDC, cons
}
}

if( m_IBCBuffer.bufs.empty() )
{
m_IBCBufferWidth = g_IBCBufferSize / ctuSize;
m_IBCBuffer.create( UnitArea( chromaFormatIDC, Area( 0, 0, m_IBCBufferWidth, ctuSize ) ) );
}
m_currChromaFormat = chromaFormatIDC;
}

Expand Down Expand Up @@ -863,8 +870,8 @@ void InterPrediction::xPredInterBlk( const ComponentID& compID,

for( int h = 0; h < height; h++ )
{
dstPel[0] = ( refPel[0 ] << shift ) - ( Pel ) IF_INTERNAL_OFFS;
dstPel[width + 1] = ( refPel[width + 1] << shift ) - ( Pel ) IF_INTERNAL_OFFS;
dstPel[0] = refPel[0 ] * ( 1 << shift ) - ( Pel ) IF_INTERNAL_OFFS;
dstPel[width + 1] = refPel[width + 1] * ( 1 << shift ) - ( Pel ) IF_INTERNAL_OFFS;

refPel += refStride;
dstPel += dstStride;
Expand Down Expand Up @@ -1257,8 +1264,8 @@ void InterPrediction::xPredAffineBlk( const ComponentID& compID,
dstPel = dst;
for( int ph = 0; ph < 4; ph++, refPel += refStride, dstPel += dstStride )
{
dstPel[ -1] = ( refPel[ -1] << shift ) - Pel( IF_INTERNAL_OFFS );
dstPel[blockWidth] = ( refPel[blockWidth] << shift ) - Pel( IF_INTERNAL_OFFS );
dstPel[ -1] = refPel[ -1] * ( 1 << shift ) - Pel( IF_INTERNAL_OFFS );
dstPel[blockWidth] = refPel[blockWidth] * ( 1 << shift ) - Pel( IF_INTERNAL_OFFS );
}

profGradFilter( dst, dstStride, blockWidth, blockHeight, AFFINE_MIN_BLOCK_SIZE, gradX, gradY, clpRng.bd );
Expand Down Expand Up @@ -1643,7 +1650,7 @@ void xSubPelErrorSrfc(uint64_t *sadBuffer, int32_t *deltaMv)
int32_t mvDeltaSubPel;
int32_t mvSubPelLvl = 4;/*1: half pel, 2: Qpel, 3:1/8, 4: 1/16*/
/*horizontal*/
numerator = (int64_t)((sadBuffer[1] - sadBuffer[3]) << mvSubPelLvl);
numerator = (int64_t)(sadBuffer[1] - sadBuffer[3]) * (int64_t(1) << mvSubPelLvl);
denominator = (int64_t)((sadBuffer[1] + sadBuffer[3] - (sadBuffer[0] << 1)));

if (0 != denominator)
Expand Down Expand Up @@ -2004,31 +2011,32 @@ void InterPrediction::xIntraBlockCopy( CodingUnit &cu, PelUnitBuf &predBuf, cons
refx = cu.Cb().x + (bv.hor >> shiftSampleHor);
refy = cu.Cb().y + (bv.ver >> shiftSampleVer);
}
refx &= ((m_IBCBufferWidth >> shiftSampleHor) - 1);
const int ibcBufferWidth = cu.cs->m_IBCBufferWidth >> shiftSampleHor;
refx &= ( ibcBufferWidth - 1 );
refy &= ((1 << ctuSizeVerLog2) - 1);

const int lineIdx = cu.lumaPos().y / cu.slice->getSPS()->getMaxCUHeight();

CHECK( refy + predBuf.bufs[compID].height > ( 1 << ctuSizeVerLog2 ), "IBC access out of bounds." );
if (refx + (int)predBuf.bufs[compID].width <= (m_IBCBufferWidth >> shiftSampleHor))
if (refx + (int)predBuf.bufs[compID].width <= ibcBufferWidth)
{
const CompArea srcArea = CompArea( compID, Position( refx, refy ), Size( predBuf.bufs[compID] ) );
const CPelBuf refBuf = cu.cs->m_virtualIBCbuf[lineIdx].getBuf( srcArea ); //m_IBCBuffer.getBuf(srcArea);
const CPelBuf refBuf = cu.cs->m_virtualIBCbuf[lineIdx].getBuf( srcArea );
predBuf.bufs[compID].copyFrom( refBuf );
}
else
{ // wrap around
CHECK( (int) predBuf.bufs[compID].width > ( m_IBCBufferWidth >> shiftSampleHor ), "IBC access out of bounds." );
CHECK( (int) predBuf.bufs[compID].width > ibcBufferWidth, "IBC access out of bounds." );

const int width = ( m_IBCBufferWidth >> shiftSampleHor ) - refx;
const int width = ibcBufferWidth - refx;
CompArea srcArea = CompArea( compID, Position( refx, refy ), Size( width, predBuf.bufs[compID].height ) );
CPelBuf srcBuf = cu.cs->m_virtualIBCbuf[lineIdx].getBuf( srcArea ); // m_IBCBuffer.getBuf(srcArea);
CPelBuf srcBuf = cu.cs->m_virtualIBCbuf[lineIdx].getBuf( srcArea );
PelBuf dstBuf = predBuf.bufs[compID].subBuf( 0, 0, width, predBuf.bufs[compID].height );
dstBuf.copyFrom( srcBuf );

const int remWidth = predBuf.bufs[compID].width - width;
srcArea = CompArea( compID, Position( 0, refy ), Size( remWidth, predBuf.bufs[compID].height ) );
srcBuf = cu.cs->m_virtualIBCbuf[lineIdx].getBuf( srcArea ); // m_IBCBuffer.getBuf(srcArea);
srcBuf = cu.cs->m_virtualIBCbuf[lineIdx].getBuf( srcArea );
dstBuf = predBuf.bufs[compID].subBuf( width, 0, remWidth, predBuf.bufs[compID].height );
dstBuf.copyFrom( srcBuf );
}
Expand Down
2 changes: 0 additions & 2 deletions source/Lib/CommonLib/InterPrediction.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ class InterPrediction : public WeightPrediction
bool m_subPuMC = false;

UnitArea m_currCuArea;
int m_IBCBufferWidth;
PelStorage m_IBCBuffer;

void xIntraBlockCopy (CodingUnit &cu, PelUnitBuf &predBuf, const ComponentID compID);

Expand Down
4 changes: 2 additions & 2 deletions source/Lib/CommonLib/InterpolationFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ void InterpolationFilter::filterCopy( const ClpRng& clpRng, const Pel* src, cons
{
for( col = 0; col < width; col++ )
{
dst[col] = src[col] << shift10BitOut;
dst[col] = src[col] * ( 1 << shift10BitOut );
}
INCY( src, srcStride );
INCY( dst, dstStride );
Expand All @@ -482,7 +482,7 @@ void InterpolationFilter::filterCopy( const ClpRng& clpRng, const Pel* src, cons
{
for( col = 0; col < width; col++ )
{
Pel val = src[col] << shift;
Pel val = src[col] * ( 1 << shift );
dst[col] = val - ( Pel ) IF_INTERNAL_OFFS;
}

Expand Down
26 changes: 17 additions & 9 deletions source/Lib/CommonLib/Picture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ POSSIBILITY OF SUCH DAMAGE.
namespace vvdec
{

void paddPicBorderTopCore(Pel *pi, ptrdiff_t stride,int width,int xmargin,int ymargin)
static void paddPicBorderTopCore(Pel *pi, ptrdiff_t stride,int width,int xmargin,int ymargin)
{
for( int x = 0; x < xmargin; x++ )
{
Expand All @@ -69,7 +69,7 @@ void paddPicBorderTopCore(Pel *pi, ptrdiff_t stride,int width,int xmargin,int ym
}
}

void paddPicBorderBotCore(Pel *pi, ptrdiff_t stride,int width,int xmargin,int ymargin)
static void paddPicBorderBotCore(Pel *pi, ptrdiff_t stride,int width,int xmargin,int ymargin)
{
for( int x = 0; x < xmargin; x++ )
{
Expand All @@ -84,7 +84,7 @@ void paddPicBorderBotCore(Pel *pi, ptrdiff_t stride,int width,int xmargin,int ym
}
}

void paddPicBorderLeftRightCore(Pel *pi, ptrdiff_t stride,int width,int xmargin,int height)
static void paddPicBorderLeftRightCore(Pel *pi, ptrdiff_t stride,int width,int xmargin,int height)
{
for( int y = 1; y < ( height - 1 ); y++ )
{
Expand Down Expand Up @@ -263,8 +263,9 @@ void Picture::finalInit( CUChunkCache* cuChunkCache, TUChunkCache* tuChunkCache,
parseDone . lock();
cs->picture = this;
cs->picHeader = ph;
cs->pps = pps ? pps->getSharedPtr() : nullptr;
cs->sps = sps ? sps->getSharedPtr() : nullptr;
cs->pps = pps->getSharedPtr();
cs->sps = sps->getSharedPtr();
cs->pcv = pps->pcv.get();

if( phPSupdate )
{
Expand All @@ -284,10 +285,14 @@ void Picture::finalInit( CUChunkCache* cuChunkCache, TUChunkCache* tuChunkCache,
cs->lmcsAps = lmcsAps ? lmcsAps->getSharedPtr() : nullptr;
}

cs->pcv = pps->pcv.get();
cs->allocTempInternals();
cs->rebindPicBufs();

if( sps->getIBCFlag() )
{
cs->initVIbcBuf( cs->pcv->heightInCtus, sps->getChromaFormatIdc(), sps->getMaxCUHeight() );
}

resetProcessingTime();
}

Expand Down Expand Up @@ -373,11 +378,14 @@ void Picture::ensureUsableAsRef()
CHECK_FATAL( reconDone.hasException(), "to be usable as reference the picture should not have an Exception reconDone barrier" );
}

void Picture::fillGrey( const SPS* sps )
void Picture::fillGrey( const SPS* fallbackSPS )
{
CHECK( !cs && !cs->sps && !fallbackSPS, "No SPS accessible" );

const int bitDepth = cs && cs->sps ? cs->sps->getBitDepth() : fallbackSPS->getBitDepth();
// fill in grey buffer for missing reference pictures (GDR or broken bitstream)
const uint32_t yFill = 1 << ( sps->getBitDepth() - 1 );
const uint32_t cFill = 1 << ( sps->getBitDepth() - 1 );
const uint32_t yFill = 1 << ( bitDepth - 1 );
const uint32_t cFill = 1 << ( bitDepth - 1 );
getRecoBuf().Y().fill( yFill );
getRecoBuf().Cb().fill( cFill );
getRecoBuf().Cr().fill( cFill );
Expand Down
2 changes: 1 addition & 1 deletion source/Lib/CommonLib/Picture.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ struct Picture : public UnitArea

void waitForAllTasks();
void ensureUsableAsRef();
void fillGrey( const SPS* sps );
void fillGrey( const SPS* fallbackSPS = nullptr );

#if TRACE_ENABLE_ITT
__itt_domain* m_itt_decLibInst;
Expand Down
3 changes: 2 additions & 1 deletion source/Lib/CommonLib/Quant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ void Quant::dequant( const TransformUnit& tu, CoeffBuf& dstCoeff, const Componen
// from the dequantisation equation:
// iCoeffQ = Intermediate_Int((int64_t(clipQCoef) * scale + iAdd) >> rightShift);
//(sizeof(Intermediate_Int) * 8) = inputBitDepth + scaleBits - rightShift
const uint32_t targetInputBitDepth = std::min<uint32_t>( maxLog2TrDynamicRange + 1, sizeof( Intermediate_Int ) * 8 + rightShift - scaleBits );
const uint32_t targetInputBitDepth = std::min<uint32_t>( maxLog2TrDynamicRange + 1, (int) sizeof( Intermediate_Int ) * 8 + rightShift - scaleBits );
CHECK( targetInputBitDepth < 8, "Invalid bit depth" );
const Intermediate_Int inputMaximum = ( 1 << ( targetInputBitDepth - 1 ) ) - 1;

if( !enableScalingLists )
Expand Down
22 changes: 22 additions & 0 deletions source/Lib/CommonLib/Reshape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,18 @@ void Reshape::constructReshaper()
for (int i = m_sliceReshapeInfo.reshaperModelMinBinIdx; i <= m_sliceReshapeInfo.reshaperModelMaxBinIdx; i++)
m_binCW[i] = (uint16_t)(m_sliceReshapeInfo.reshaperModelBinCWDelta[i] + (int)m_initCW);

unsigned int sumCW = 0;
for (int i = m_sliceReshapeInfo.reshaperModelMinBinIdx; i <= m_sliceReshapeInfo.reshaperModelMaxBinIdx; i++)
{
CHECK_READ_RANGE( m_binCW[i], m_initCW >> 3, ( m_initCW << 3 ) - 1, //
"The value of lmcsCW[ i ] shall be in the range of OrgCW >> 3 to ( OrgCW << 3 ) - 1, inclusive." );
CHECK_READ_RANGE( m_binCW[i] + m_sliceReshapeInfo.chrResScalingOffset, ( m_initCW >> 3 ), ( m_initCW << 3 ) - 1,
"lmcsCW[ i ] + lmcsDeltaCrs shall be in the range of OrgCW >> 3 to ( OrgCW << 3 ) - 1, inclusive." );
sumCW += m_binCW[i];
}
CHECK( sumCW > ( 1 << m_lumaBD ) - 1,
"It is a requirement of bitstream conformance that the following condition is true: sum( lmcsCW[0..15] ) <= ( 1 << BitDepth ) − 1" );

for (int i = 0; i < pwlFwdLUTsize; i++)
{
m_reshapePivot[i + 1] = m_reshapePivot[i] + m_binCW[i];
Expand All @@ -344,6 +356,16 @@ void Reshape::constructReshaper()
m_chromaAdjHelpLUT[i] = (int32_t)(m_initCW * (1 << FP_PREC) / ( m_binCW[i] + m_sliceReshapeInfo.chrResScalingOffset ) );
}
}
for (int i = m_sliceReshapeInfo.reshaperModelMinBinIdx; i <= m_sliceReshapeInfo.reshaperModelMaxBinIdx; i++)
{
if( m_reshapePivot[i] % ( 1 << ( m_lumaBD - 5 ) ) != 0 )
{
CHECK( ( m_reshapePivot[i] >> ( m_lumaBD - 5 ) ) == ( m_reshapePivot[i + 1] >> ( m_lumaBD - 5 ) ),
"When the value of LmcsPivot[i] is not a multiple of 1 << ( BitDepth - 5 ), "
"the value of( LmcsPivot[i] >> ( BitDepth - 5 ) ) shall not be equal to the value of( LmcsPivot[i + 1] >> ( BitDepth - 5 ) )." );
}
}

for (int lumaSample = 0; lumaSample < m_reshapeLUTSize; lumaSample++)
{
int idxYInv = getPWLIdxInv(lumaSample);
Expand Down
Loading
Loading