Commit 08841363 authored by Frederic Barbier's avatar Frederic Barbier

Keep align syntax-element variable with trace

parent 2d67528b
......@@ -1587,7 +1587,7 @@ struct AlfSliceParam
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 coeffDeltaFlag; // alf_coefficients_delta_flag
bool alfLumaCoeffDeltaFlag; // alf_luma_coeff_delta_flag
bool alfLumaCoeffDeltaPredictionFlag; // alf_luma_coeff_delta_prediction_flag
std::vector<AlfFilterShape>* filterShapes;
......@@ -1599,7 +1599,7 @@ struct AlfSliceParam
std::memset( filterCoeffDeltaIdx, 0, sizeof( filterCoeffDeltaIdx ) );
std::memset( alfLumaCoeffFlag, true, sizeof( alfLumaCoeffFlag ) );
numLumaFilters = 1;
coeffDeltaFlag = false;
alfLumaCoeffDeltaFlag = false;
alfLumaCoeffDeltaPredictionFlag = false;
}
......@@ -1611,7 +1611,7 @@ struct AlfSliceParam
std::memcpy( filterCoeffDeltaIdx, src.filterCoeffDeltaIdx, sizeof( filterCoeffDeltaIdx ) );
std::memcpy( alfLumaCoeffFlag, src.alfLumaCoeffFlag, sizeof( alfLumaCoeffFlag ) );
numLumaFilters = src.numLumaFilters;
coeffDeltaFlag = src.coeffDeltaFlag;
alfLumaCoeffDeltaFlag = src.alfLumaCoeffDeltaFlag;
alfLumaCoeffDeltaPredictionFlag = src.alfLumaCoeffDeltaPredictionFlag;
filterShapes = src.filterShapes;
return *this;
......
......@@ -2516,9 +2516,9 @@ void HLSyntaxReader::alfFilter( AlfSliceParam& alfSliceParam, const bool isChrom
if( !isChroma )
{
READ_FLAG( code, "alf_luma_coeff_delta_flag" );
alfSliceParam.coeffDeltaFlag = code;
alfSliceParam.alfLumaCoeffDeltaFlag = code;
if( !alfSliceParam.coeffDeltaFlag )
if( !alfSliceParam.alfLumaCoeffDeltaFlag )
{
std::memset( alfSliceParam.alfLumaCoeffFlag, true, sizeof( alfSliceParam.alfLumaCoeffFlag ) );
......@@ -2558,7 +2558,7 @@ void HLSyntaxReader::alfFilter( AlfSliceParam& alfSliceParam, const bool isChrom
if( !isChroma )
{
if( alfSliceParam.coeffDeltaFlag )
if( alfSliceParam.alfLumaCoeffDeltaFlag )
{
for( int ind = 0; ind < alfSliceParam.numLumaFilters; ++ind )
{
......@@ -2571,7 +2571,7 @@ void HLSyntaxReader::alfFilter( AlfSliceParam& alfSliceParam, const bool isChrom
// Filter coefficients
for( int ind = 0; ind < numFilters; ++ind )
{
if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.coeffDeltaFlag )
if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.alfLumaCoeffDeltaFlag )
{
memset( coeff + ind * MAX_NUM_ALF_LUMA_COEFF, 0, sizeof( *coeff ) * alfShape.numCoeff );
continue;
......
......@@ -535,7 +535,7 @@ int EncAdaptiveLoopFilter::getCoeffRate( AlfSliceParam& alfSliceParam, bool isCh
if( !isChroma )
{
iBits++; // alf_coefficients_delta_flag
if( !alfSliceParam.coeffDeltaFlag )
if( !alfSliceParam.alfLumaCoeffDeltaFlag )
{
if( alfSliceParam.numLumaFilters > 1 )
{
......@@ -553,7 +553,7 @@ int EncAdaptiveLoopFilter::getCoeffRate( AlfSliceParam& alfSliceParam, bool isCh
// vlc for all
for( int ind = 0; ind < numFilters; ++ind )
{
if( isChroma || !alfSliceParam.coeffDeltaFlag || alfSliceParam.alfLumaCoeffFlag[ind] )
if( isChroma || !alfSliceParam.alfLumaCoeffDeltaFlag || alfSliceParam.alfLumaCoeffFlag[ind] )
{
for( int i = 0; i < alfShape.numCoeff - 1; i++ )
{
......@@ -583,7 +583,7 @@ int EncAdaptiveLoopFilter::getCoeffRate( AlfSliceParam& alfSliceParam, bool isCh
if( !isChroma )
{
if( alfSliceParam.coeffDeltaFlag )
if( alfSliceParam.alfLumaCoeffDeltaFlag )
{
iBits += numFilters; //filter_coefficient_flag[i]
}
......@@ -592,7 +592,7 @@ int EncAdaptiveLoopFilter::getCoeffRate( AlfSliceParam& alfSliceParam, bool isCh
// Filter coefficients
for( int ind = 0; ind < numFilters; ++ind )
{
if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.coeffDeltaFlag )
if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.alfLumaCoeffDeltaFlag )
{
continue;
}
......@@ -692,14 +692,14 @@ double EncAdaptiveLoopFilter::mergeFiltersAndCost( AlfSliceParam& alfSliceParam,
if (cost <= cost0)
{
distReturn = dist;
alfSliceParam.coeffDeltaFlag = 0;
alfSliceParam.alfLumaCoeffDeltaFlag = 0;
uiCoeffBits = coeffBits;
alfSliceParam.alfLumaCoeffDeltaPredictionFlag = bestPredMode;
}
else
{
distReturn = distForce0;
alfSliceParam.coeffDeltaFlag = 1;
alfSliceParam.alfLumaCoeffDeltaFlag = 1;
uiCoeffBits = coeffBitsForce0;
memcpy( alfSliceParam.alfLumaCoeffFlag, codedVarBins, sizeof( codedVarBins ) );
alfSliceParam.alfLumaCoeffDeltaPredictionFlag = 0;
......
......@@ -1788,8 +1788,8 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
{
if( !isChroma )
{
WRITE_FLAG( alfSliceParam.coeffDeltaFlag, "alf_luma_coeff_delta_flag" );
if( !alfSliceParam.coeffDeltaFlag )
WRITE_FLAG( alfSliceParam.alfLumaCoeffDeltaFlag, "alf_luma_coeff_delta_flag" );
if( !alfSliceParam.alfLumaCoeffDeltaFlag )
{
if( alfSliceParam.numLumaFilters > 1 )
{
......@@ -1808,7 +1808,7 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
// vlc for all
for( int ind = 0; ind < numFilters; ++ind )
{
if( isChroma || !alfSliceParam.coeffDeltaFlag || alfSliceParam.alfLumaCoeffFlag[ind] )
if( isChroma || !alfSliceParam.alfLumaCoeffDeltaFlag || alfSliceParam.alfLumaCoeffFlag[ind] )
{
for( int i = 0; i < alfShape.numCoeff - 1; i++ )
{
......@@ -1838,7 +1838,7 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
if( !isChroma )
{
if( alfSliceParam.coeffDeltaFlag )
if( alfSliceParam.alfLumaCoeffDeltaFlag )
{
for( int ind = 0; ind < numFilters; ++ind )
{
......@@ -1850,7 +1850,7 @@ void HLSWriter::alfFilter( const AlfSliceParam& alfSliceParam, const bool isChro
// Filter coefficients
for( int ind = 0; ind < numFilters; ++ind )
{
if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.coeffDeltaFlag )
if( !isChroma && !alfSliceParam.alfLumaCoeffFlag[ind] && alfSliceParam.alfLumaCoeffDeltaFlag )
{
continue;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment