Coverage Report

Created: 2026-10-28 06:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/work/vvenc/source/Lib/CommonLib/Quant.cpp
Line
Count
Source
1
/* -----------------------------------------------------------------------------
2
The copyright in this software is being made available under the Clear BSD
3
License, included below. No patent rights, trademark rights and/or 
4
other Intellectual Property Rights other than the copyrights concerning 
5
the Software are granted under this license.
6
7
The Clear BSD License
8
9
Copyright (c) 2019-2026, Fraunhofer-Gesellschaft zur Förderung der angewandten Forschung e.V. & The VVenC Authors.
10
All rights reserved.
11
12
Redistribution and use in source and binary forms, with or without modification,
13
are permitted (subject to the limitations in the disclaimer below) provided that
14
the following conditions are met:
15
16
     * Redistributions of source code must retain the above copyright notice,
17
     this list of conditions and the following disclaimer.
18
19
     * Redistributions in binary form must reproduce the above copyright
20
     notice, this list of conditions and the following disclaimer in the
21
     documentation and/or other materials provided with the distribution.
22
23
     * Neither the name of the copyright holder nor the names of its
24
     contributors may be used to endorse or promote products derived from this
25
     software without specific prior written permission.
26
27
NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY
28
THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
29
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
31
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
32
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
33
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
34
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
35
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
36
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38
POSSIBILITY OF SUCH DAMAGE.
39
40
41
------------------------------------------------------------------------------------------- */
42
43
44
/** \file     Quant.cpp
45
    \brief    transform and quantization class
46
*/
47
48
#include "Quant.h"
49
#include "UnitTools.h"
50
#include "ContextModelling.h"
51
#include "CodingStructure.h"
52
#include "dtrace_buffer.h"
53
54
#include <stdlib.h>
55
#include <memory.h>
56
57
//! \ingroup CommonLib
58
//! \{
59
60
namespace vvenc {
61
62
// ====================================================================================================================
63
// Constants
64
// ====================================================================================================================
65
66
67
// ====================================================================================================================
68
// QpParam constructor
69
// ====================================================================================================================
70
 
71
QpParam::QpParam(const TransformUnit& tu, const ComponentID &compID, const bool allowACTQpoffset)
72
8.28M
{
73
8.28M
  const ChannelType chType = toChannelType( compID );
74
8.28M
  const SPS        &sps    = *tu.cu->cs->sps;
75
8.28M
  const int     qpBdOffset = sps.qpBDOffset[chType];
76
8.28M
  const bool useJQP        = isChroma( compID ) && abs( TU::getICTMode( tu ) ) == 2;
77
8.28M
  const ComponentID jCbCr  = useJQP ? COMP_JOINT_CbCr : compID;
78
  
79
8.28M
        int chromaQpOffset = 0;
80
81
8.28M
  if( isChroma( compID ) )
82
8.00M
  {
83
8.00M
    const PPS &pps  = *tu.cu->slice->pps;
84
8.00M
    chromaQpOffset  = pps.chromaQpOffset              [jCbCr];
85
8.00M
    chromaQpOffset += tu.cu->slice->sliceChromaQpDelta[jCbCr];
86
8.00M
    chromaQpOffset += pps.getChromaQpOffsetListEntry( tu.cu->chromaQpAdj ).u.offset[int( jCbCr ) - 1];
87
8.00M
  }
88
  
89
8.28M
  int baseQp;
90
8.28M
  int qpy        = tu.cu->qp;
91
  //bool skip      = tu.mtsIdx[compID] == MTS_SKIP;
92
93
8.28M
  if( isLuma( compID ) )
94
277k
  {
95
277k
    baseQp = tu.cu->qp + qpBdOffset;
96
277k
  }
97
8.00M
  else
98
8.00M
  {
99
8.00M
    int qpi = Clip3( -qpBdOffset, MAX_QP, qpy );
100
8.00M
    baseQp  = sps.chromaQpMappingTable.getMappedChromaQpValue( jCbCr, qpi );
101
8.00M
    baseQp  = Clip3( -qpBdOffset, MAX_QP, baseQp + chromaQpOffset ) + qpBdOffset;
102
8.00M
  }
103
104
8.28M
  if( allowACTQpoffset && tu.cu->colorTransform )
105
0
  {
106
0
    baseQp += DELTA_QP_ACT[jCbCr];
107
0
  }
108
109
8.28M
  baseQp = Clip3( 0, MAX_QP + qpBdOffset, baseQp );
110
111
  //if( !skip )
112
8.28M
  {
113
8.28M
    Qps [0] = baseQp;
114
8.28M
    pers[0] = baseQp / 6;
115
8.28M
    rems[0] = baseQp % 6;
116
8.28M
  }
117
  //else
118
8.28M
  {
119
8.28M
    int internalMinusInputBitDepth = sps.internalMinusInputBitDepth[chType];
120
8.28M
    int baseQpTS           = std::max( baseQp, 4 + 6 * internalMinusInputBitDepth );
121
122
8.28M
    Qps [1] = baseQpTS;
123
8.28M
    pers[1] = baseQpTS / 6;
124
8.28M
    rems[1] = baseQpTS % 6;
125
8.28M
  }
126
8.28M
}
127
128
129
// ====================================================================================================================
130
// Quant class member functions
131
// ====================================================================================================================
132
static void QuantCore(const TransformUnit tu, const ComponentID compID, const CCoeffBuf& piCoef,CoeffSigBuf piQCoef,TCoeff &uiAbsSum, int &lastScanPos,TCoeff *deltaU,const int defaultQuantisationCoefficient,const int iQBits,const int64_t iAdd,const TCoeff entropyCodingMinimum,const TCoeff entropyCodingMaximum,const bool signHiding, const TCoeff m_thrVal)
133
6.97k
{
134
6.97k
  CoeffCodingContext cctx( tu, compID, signHiding );
135
136
6.97k
  const CompArea &rect      = tu.blocks[compID];
137
6.97k
  const uint32_t uiWidth    = rect.width;
138
6.97k
  const uint32_t uiHeight   = rect.height;
139
140
  /* for 422 chroma blocks, the effective scaling applied during transformation is not a power of 2, hence it cannot be
141
  * implemented as a bit-shift (the quantised result will be sqrt(2) * larger than required). Alternatively, adjust the
142
  * uiLog2TrSize applied in iTransformShift, such that the result is 1/sqrt(2) the required result (i.e. smaller)
143
  * Then a QP+3 (sqrt(2)) or QP-3 (1/sqrt(2)) method could be used to get the required result
144
  */
145
146
6.97k
  const uint32_t log2CGSize         = cctx.log2CGSize();
147
148
6.97k
  uiAbsSum = 0;
149
150
6.97k
  const int iCGSize   = 1 << log2CGSize;
151
152
6.97k
  const uint32_t lfnstIdx = tu.cu->lfnstIdx;
153
6.97k
  const int iCGNum   = lfnstIdx > 0 ? 1 : std::min<int>(JVET_C0024_ZERO_OUT_TH, uiWidth) * std::min<int>(JVET_C0024_ZERO_OUT_TH, uiHeight) >> cctx.log2CGSize();
154
6.97k
  int       iScanPos = ( iCGNum << log2CGSize ) - 1;
155
156
6.97k
  if( lfnstIdx > 0 && ( ( uiWidth == 4 && uiHeight == 4 ) || ( uiWidth == 8 && uiHeight == 8 ) ) )
157
0
  {
158
0
    iScanPos = 7;
159
0
  }
160
161
  // Find first non-zero coeff
162
38.3k
  for( ; iScanPos > 0; iScanPos-- )
163
36.6k
  {
164
36.6k
    uint32_t uiBlkPos = cctx.blockPos( iScanPos );
165
36.6k
    if( piCoef.buf[uiBlkPos] )
166
5.27k
      break;
167
36.6k
  }
168
169
  //////////////////////////////////////////////////////////////////////////
170
  //  Loop over sub-sets (coefficient groups)
171
  //////////////////////////////////////////////////////////////////////////
172
  
173
6.97k
  TCoeff thres = 0, useThres = 0;
174
  
175
6.97k
  if( iQBits )
176
6.97k
    thres = TCoeff( ( int64_t( m_thrVal ) << ( iQBits - 1 ) ) );
177
0
  else
178
0
    thres = TCoeff( ( int64_t( m_thrVal >> 1 ) << iQBits ) );
179
180
6.97k
  useThres = thres / ( defaultQuantisationCoefficient << 2 );
181
182
6.97k
  const bool is4x4sbb = log2CGSize == 4 && cctx.log2CGWidth() == 2;
183
184
6.97k
  int subSetId = iScanPos >> log2CGSize;
185
8.00k
  for( ; subSetId >= 1; subSetId-- )
186
1.03k
  {
187
1.03k
    if( is4x4sbb && iScanPos >= 16 )
188
0
    {
189
0
      int  iScanPosinCG = iScanPos & ( iCGSize - 1 );
190
0
      bool allSmaller   = true;
191
192
0
      for( int xScanPosinCG = iScanPosinCG, xScanPos = iScanPos; allSmaller && xScanPosinCG >= 0; xScanPosinCG--, xScanPos-- )
193
0
      {
194
0
        const uint32_t uiBlkPos = cctx.blockPos( xScanPos );
195
0
        allSmaller &= abs( piCoef.buf[uiBlkPos] ) <= useThres;
196
0
      }
197
198
0
      if( allSmaller )
199
0
      {
200
0
        iScanPos    -= iScanPosinCG + 1;
201
0
        continue;
202
0
      }
203
0
      else
204
0
      {
205
0
        break;
206
0
      }
207
0
    }
208
1.03k
  }
209
210
6.97k
  const int qBits8 = iQBits - 8;
211
6.97k
  piQCoef.memset( 0 );
212
213
109k
  for( int currPos = 0; currPos <= iScanPos; currPos++ )
214
102k
  {
215
102k
    const int uiBlockPos  = cctx.blockPos( currPos );
216
102k
    const TCoeff iLevel   = piCoef.buf[uiBlockPos];
217
102k
    const TCoeff iSign    = (iLevel < 0 ? -1: 1);
218
219
102k
    const int64_t  tmpLevel = (int64_t)abs(iLevel) * defaultQuantisationCoefficient;
220
102k
    const TCoeff quantisedMagnitude = TCoeff((tmpLevel + iAdd ) >> iQBits);
221
102k
    deltaU[uiBlockPos] = (TCoeff)((tmpLevel - ((int64_t)quantisedMagnitude<<iQBits) )>> qBits8);
222
223
102k
    uiAbsSum += quantisedMagnitude;
224
102k
    const TCoeff quantisedCoefficient = quantisedMagnitude * iSign;
225
226
102k
    piQCoef.buf[uiBlockPos] = Clip3<TCoeff>( entropyCodingMinimum, entropyCodingMaximum, quantisedCoefficient );
227
102k
  } // for n
228
229
6.97k
  lastScanPos = iScanPos;
230
6.97k
}
231
232
static void DeQuantCore(const int maxX,const int maxY,const int scale,const TCoeffSig* const piQCoef,const size_t piQCfStride,TCoeff   *const piCoef,const int rightShift,const int inputMaximum,const TCoeff transformMaximum)
233
59.7k
{
234
59.7k
  const int inputMinimum = -(inputMaximum+1);
235
59.7k
  const TCoeff transformMinimum = -(transformMaximum+1);
236
59.7k
  if (rightShift>0)
237
47.6k
  {
238
47.6k
    const Intermediate_Int iAdd = (Intermediate_Int) 1 << (rightShift - 1);
239
460k
    for( int y = 0, n = 0; y <= maxY; y++)
240
412k
    {
241
4.49M
      for( int x = 0; x <= maxX; x++, n++ )
242
4.07M
      {
243
4.07M
        const TCoeff           clipQCoef = TCoeff(Clip3<Intermediate_Int>(inputMinimum, inputMaximum, piQCoef[x + y * piQCfStride]));
244
4.07M
        Intermediate_Int iCoeffQ   = (Intermediate_Int(clipQCoef) * scale + iAdd) >> rightShift;
245
4.07M
        piCoef[n] = TCoeff(Clip3<Intermediate_Int>(transformMinimum,transformMaximum,iCoeffQ));
246
4.07M
      }
247
412k
    }
248
47.6k
  }
249
12.0k
  else  // rightshift <0
250
12.0k
  {
251
12.0k
    int leftShift = -rightShift;
252
143k
    for( int y = 0, n = 0; y <= maxY; y++)
253
131k
    {
254
1.59M
      for( int x = 0; x <= maxX; x++, n++ )
255
1.46M
      {
256
1.46M
        const TCoeff           clipQCoef = TCoeff(Clip3<Intermediate_Int>(inputMinimum, inputMaximum, piQCoef[x + y * piQCfStride]));
257
1.46M
        const Intermediate_Int iCoeffQ   = (Intermediate_Int(clipQCoef) * scale) * (1 << leftShift);
258
1.46M
        piCoef[n] = TCoeff(Clip3<Intermediate_Int>(transformMinimum,transformMaximum,iCoeffQ));
259
1.46M
      }
260
131k
    }
261
12.0k
  }
262
59.7k
}
263
264
static bool needRdoqCore( const TCoeff* pCoeff, size_t numCoeff, int quantCoeff, int64_t offset, int shift )
265
0
{
266
0
  for( int uiBlockPos = 0; uiBlockPos < numCoeff; uiBlockPos++ )
267
0
  {
268
0
    const TCoeff   iLevel = pCoeff[uiBlockPos];
269
0
    const int64_t  tmpLevel = ( int64_t ) std::abs( iLevel ) * quantCoeff;
270
0
    const TCoeff quantisedMagnitude = TCoeff( ( tmpLevel + offset ) >> shift );
271
272
0
    if( quantisedMagnitude != 0 )
273
0
    {
274
0
      return true;
275
0
    }
276
0
  } // for n
277
0
  return false;
278
0
}
279
280
281
void Quant::fwdResDPCMCore( TCoeffSig* coef, const ptrdiff_t stride, const int width, const int height, const bool vertical )
282
6.97k
{
283
6.97k
  if( !vertical )
284
0
  {
285
0
    for( int y = 0; y < height; y++ )
286
0
    {
287
0
      for( int x = width - 1; x > 0; x-- )
288
0
      {
289
0
        coef[x] -= coef[x - 1];
290
0
      }
291
0
      coef += stride;
292
0
    }
293
0
  }
294
6.97k
  else
295
6.97k
  {
296
6.97k
    coef += stride * (height - 1);
297
13.9k
    for( int y = 0; y < height - 1; y++ )
298
6.97k
    {
299
73.9k
      for ( int x = 0; x < width; x++ )
300
67.0k
      {
301
67.0k
        coef[x] -= coef[x - stride];
302
67.0k
      }
303
6.97k
      coef -= stride;
304
6.97k
    }
305
6.97k
  }
306
6.97k
}
307
308
void Quant::invResDPCMVerCore( const TCoeffSig* coef, const ptrdiff_t coefStride, TCoeffSig* dst, const ptrdiff_t dstStride, const int width, const int height )
309
59.1k
{
310
59.1k
  const TCoeff inputMinimum = std::numeric_limits<TCoeffSig>::min();
311
59.1k
  const TCoeff inputMaximum = std::numeric_limits<TCoeffSig>::max();
312
313
629k
  for( int x = 0; x < width; x++ )
314
570k
  {
315
570k
    dst[x] = coef[x];
316
570k
  }
317
536k
  for( int y = 0; y < height - 1; y++ )
318
477k
  {
319
5.32M
    for( int x = 0; x < width; x++ )
320
4.84M
    {
321
4.84M
      dst[dstStride + x] = Clip3(inputMinimum, inputMaximum, TCoeff( dst[x] ) + TCoeff( coef[coefStride + x] ));
322
4.84M
    }
323
477k
    coef += coefStride;
324
477k
    dst += dstStride;
325
477k
  }
326
59.1k
}
327
328
5.97k
Quant::Quant( const Quant* other, bool useScalingLists, bool enableOpt ) : m_RDOQ( 0 ), m_useRDOQTS( false ), m_dLambda( 0.0 )
329
5.97k
{
330
5.97k
  xInitScalingList( other, useScalingLists );
331
5.97k
  xDeQuant       = DeQuantCore;
332
5.97k
  xQuant         = QuantCore;
333
5.97k
  xNeedRdoq      = needRdoqCore;
334
5.97k
  xFwdResDPCM    = fwdResDPCMCore;
335
5.97k
  xInvResDPCMVer = invResDPCMVerCore;
336
5.97k
  if( enableOpt )
337
5.97k
  {
338
#if defined( TARGET_SIMD_X86 ) && ENABLE_SIMD_OPT_QUANT
339
    initQuantX86();
340
#endif
341
#if defined( TARGET_SIMD_ARM ) && ENABLE_SIMD_OPT_QUANT
342
    initQuantARM();
343
#endif
344
5.97k
  }
345
5.97k
}
346
347
Quant::~Quant()
348
5.97k
{
349
5.97k
  xDestroyScalingList();
350
5.97k
}
351
352
void Quant::xInvResDPCM( const TransformUnit& tu, const ComponentID compID, CoeffSigBuf& dstBuf ) const
353
59.7k
{
354
59.7k
  const CompArea&    rect   = tu.blocks[compID];
355
59.7k
  const int          wdt    = rect.width;
356
59.7k
  const int          hgt    = rect.height;
357
59.7k
  const CCoeffSigBuf coeffs = tu.getCoeffs(compID);
358
359
59.7k
  const int      maxLog2TrDynamicRange = tu.cs->sps->getMaxLog2TrDynamicRange();
360
59.7k
  const TCoeff   inputMinimum          = -(1 << maxLog2TrDynamicRange);
361
59.7k
  const TCoeff   inputMaximum          =  (1 << maxLog2TrDynamicRange) - 1;
362
363
59.7k
  const TCoeffSig* coef = &coeffs.buf[0];
364
59.7k
        TCoeffSig* dst  = &dstBuf.buf[0];
365
366
59.7k
  if ( tu.cu->bdpcmM[toChannelType(compID)] == 1)
367
564
  {
368
    // a running sum along each row, clipped at every step: sequential
369
8.15k
    for( int y = 0; y < hgt; y++ )
370
7.58k
    {
371
7.58k
      dst[0] = coef[0];
372
121k
      for( int x = 1; x < wdt; x++ )
373
113k
      {
374
113k
        dst[x] = Clip3(inputMinimum, inputMaximum, TCoeff( dst[x - 1] ) + TCoeff( coef[x] ));
375
113k
      }
376
7.58k
      coef += coeffs.stride;
377
7.58k
      dst += dstBuf.stride;
378
7.58k
    }
379
564
  }
380
59.1k
  else
381
59.1k
  {
382
59.1k
    CHECKD( maxLog2TrDynamicRange != 15, "the vertical inverse clips to the 16-bit range" );
383
59.1k
    xInvResDPCMVer( coef, coeffs.stride, dst, dstBuf.stride, wdt, hgt );
384
59.1k
  }
385
59.7k
}
386
387
// To minimize the distortion only. No rate is considered.
388
void Quant::xSignBitHidingHDQ( TCoeffSig* pQCoef, const TCoeff* pCoef, TCoeff* deltaU, const CoeffCodingContext& cctx, int& lastScanPos, const int maxLog2TrDynamicRange )
389
0
{
390
0
  const uint32_t groupSize = 1 << cctx.log2CGSize();
391
392
0
  const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange);
393
0
  const TCoeff entropyCodingMaximum =  (1 << maxLog2TrDynamicRange) - 1;
394
395
0
  int lastCG = -1;
396
0
  int absSum = 0 ;
397
0
  int n ;
398
399
0
  for( int subSet = lastScanPos >> cctx.log2CGSize(); subSet >= 0; subSet-- )
400
0
  {
401
0
    int  subPos = subSet << cctx.log2CGSize();
402
0
    int  firstNZPosInCG=groupSize , lastNZPosInCG=-1 ;
403
0
    absSum = 0 ;
404
405
0
    for(n = groupSize-1; n >= 0; --n )
406
0
    {
407
0
      if( pQCoef[ cctx.blockPos( n + subPos ) ] )
408
0
      {
409
0
        lastNZPosInCG = n;
410
0
        break;
411
0
      }
412
0
    }
413
414
0
    for(n = 0; n <groupSize; n++ )
415
0
    {
416
0
      if( pQCoef[ cctx.blockPos( n + subPos ) ] )
417
0
      {
418
0
        firstNZPosInCG = n;
419
0
        break;
420
0
      }
421
0
    }
422
423
0
    for(n = firstNZPosInCG; n <=lastNZPosInCG; n++ )
424
0
    {
425
0
      absSum += int(pQCoef[ cctx.blockPos( n + subPos ) ]);
426
0
    }
427
428
0
    if(lastNZPosInCG>=0 && lastCG==-1)
429
0
    {
430
0
      lastCG = 1 ;
431
0
    }
432
433
0
    if( lastNZPosInCG-firstNZPosInCG>=SBH_THRESHOLD )
434
0
    {
435
0
      uint32_t signbit = (pQCoef[cctx.blockPos(subPos+firstNZPosInCG)]>0?0:1) ;
436
0
      if( signbit!=(absSum&0x1) )  //compare signbit with sum_parity
437
0
      {
438
0
        TCoeff curCost    = std::numeric_limits<TCoeff>::max();
439
0
        TCoeff minCostInc = std::numeric_limits<TCoeff>::max();
440
0
        int minPos =-1, finalChange=0, curChange=0, minScanPos = -1;
441
442
0
        for( n = (lastCG==1?lastNZPosInCG:groupSize-1) ; n >= 0; --n )
443
0
        {
444
0
          uint32_t blkPos   = cctx.blockPos( n+subPos );
445
0
          if(pQCoef[ blkPos ] != 0 )
446
0
          {
447
0
            if(deltaU[blkPos]>0)
448
0
            {
449
0
              curCost = - deltaU[blkPos];
450
0
              curChange=1 ;
451
0
            }
452
0
            else
453
0
            {
454
              //curChange =-1;
455
0
              if(n==firstNZPosInCG && abs(pQCoef[blkPos])==1)
456
0
              {
457
0
                curCost = std::numeric_limits<TCoeff>::max();
458
0
              }
459
0
              else
460
0
              {
461
0
                curCost = deltaU[blkPos];
462
0
                curChange =-1;
463
0
              }
464
0
            }
465
0
          }
466
0
          else
467
0
          {
468
0
            if(n<firstNZPosInCG)
469
0
            {
470
0
              uint32_t thisSignBit = (pCoef[blkPos]>=0?0:1);
471
0
              if(thisSignBit != signbit )
472
0
              {
473
0
                curCost = std::numeric_limits<TCoeff>::max();
474
0
              }
475
0
              else
476
0
              {
477
0
                curCost = - (deltaU[blkPos])  ;
478
0
                curChange = 1 ;
479
0
              }
480
0
            }
481
0
            else
482
0
            {
483
0
              curCost = - (deltaU[blkPos])  ;
484
0
              curChange = 1 ;
485
0
            }
486
0
          }
487
488
0
          if( curCost<minCostInc)
489
0
          {
490
0
            minCostInc = curCost ;
491
0
            finalChange = curChange ;
492
0
            minPos = blkPos;
493
0
            minScanPos = n + subPos;
494
0
          }
495
0
        } //CG loop
496
497
0
        if(pQCoef[minPos] == entropyCodingMaximum || pQCoef[minPos] == entropyCodingMinimum)
498
0
        {
499
0
          finalChange = -1;
500
0
        }
501
502
0
        if(pCoef[minPos]>=0)
503
0
        {
504
0
          pQCoef[minPos] += finalChange ;
505
0
        }
506
0
        else
507
0
        {
508
0
          pQCoef[minPos] -= finalChange ;
509
0
        }
510
511
        // if changing lastScanPos element to 0, move the pointer to the new lastScanPos element
512
0
        if( minScanPos == lastScanPos && pQCoef[minPos] == 0 )
513
0
        {
514
0
          for( ; lastScanPos >= 0 && pQCoef[cctx.blockPos( lastScanPos )] == 0; lastScanPos-- );
515
0
        }
516
0
        else if( minScanPos > lastScanPos && pQCoef[minPos] != 0 )
517
0
        {
518
0
          lastScanPos = minPos;
519
0
        }
520
0
      } // Hide
521
0
    }
522
0
    if(lastCG==1)
523
0
    {
524
0
      lastCG=0 ;
525
0
    }
526
0
  } // TU loop
527
528
0
  return;
529
0
}
530
531
void Quant::dequant(const TransformUnit& tu,
532
                          CoeffBuf&      dstCoeff,
533
                    const ComponentID    compID,
534
                    const QpParam&       cQP)
535
59.7k
{
536
59.7k
  const SPS       *sps                  = tu.cs->sps;
537
59.7k
  const CompArea  &area                 = tu.blocks[compID];
538
59.7k
  const uint32_t  uiWidth               = area.width;
539
59.7k
  const uint32_t  uiHeight              = area.height;
540
59.7k
  TCoeff *const   piCoef                = dstCoeff.buf;
541
59.7k
  const uint32_t  numSamplesInBlock     = uiWidth * uiHeight;
542
59.7k
  const int       maxLog2TrDynamicRange = sps->getMaxLog2TrDynamicRange();
543
59.7k
  const TCoeff    transformMinimum      = -(1 << maxLog2TrDynamicRange);
544
59.7k
  const TCoeff    transformMaximum      =  (1 << maxLog2TrDynamicRange) - 1;
545
59.7k
  const bool      isTransformSkip       = tu.mtsIdx[compID] == MTS_SKIP;
546
59.7k
  const bool      isLfnstApplied        = tu.cu->lfnstIdx > 0 && (CU::isSepTree(*tu.cu) ? true : isLuma(compID));
547
59.7k
  const bool      enableScalingLists    = getUseScalingList(uiWidth, uiHeight, isTransformSkip, isLfnstApplied);
548
59.7k
  const int       scalingListType       = getScalingListType(tu.cu->predMode, compID);
549
59.7k
  const int       channelBitDepth       = sps->bitDepths[toChannelType(compID)];
550
551
59.7k
  const TCoeffSig *coef     = tu.getCoeffs( compID ).buf;
552
59.7k
  const ptrdiff_t  piStride = tu.getCoeffs( compID ).stride;
553
554
59.7k
  if( tu.cu->bdpcmM[toChannelType( compID )] )
555
59.7k
  {
556
59.7k
    CoeffSigBuf coefBuf( m_tmpBdpcm, uiWidth, uiHeight );
557
59.7k
    xInvResDPCM( tu, compID, coefBuf );
558
59.7k
    coef      = m_tmpBdpcm;
559
59.7k
  }
560
561
59.7k
  const TCoeffSig  *const piQCoef = coef;
562
59.7k
  CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
563
564
  // Represents scaling through forward transform
565
59.7k
  const int  originalTransformShift = getTransformShift(channelBitDepth, area.size(), maxLog2TrDynamicRange);
566
59.7k
  const bool needSqrtAdjustment     = TU::needsSqrt2Scale( tu, compID );
567
59.7k
  const int  iTransformShift        = originalTransformShift + (needSqrtAdjustment?-1:0);
568
569
59.7k
  const int QP_per = cQP.per(isTransformSkip);
570
59.7k
  const int QP_rem = cQP.rem(isTransformSkip);
571
572
59.7k
  const int  rightShift = (IQUANT_SHIFT - ((isTransformSkip ? 0 : iTransformShift) + QP_per)) + (enableScalingLists ? LOG2_SCALING_LIST_NEUTRAL_VALUE : 0);
573
574
59.7k
  if(enableScalingLists)
575
0
  {
576
    //from the dequantization equation:
577
    //iCoeffQ                         = ((Intermediate_Int(clipQCoef) * piDequantCoef[deQuantIdx]) + iAdd ) >> rightShift
578
    //(sizeof(Intermediate_Int) * 8)  =              inputBitDepth    +    dequantCoefBits                   - rightShift
579
0
    const uint32_t             dequantCoefBits     = 1 + IQUANT_SHIFT + SCALING_LIST_BITS;
580
0
    const uint32_t             targetInputBitDepth = std::min<uint32_t>((maxLog2TrDynamicRange + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - dequantCoefBits));
581
582
0
    const Intermediate_Int inputMinimum        = -(1 << (targetInputBitDepth - 1));
583
0
    const Intermediate_Int inputMaximum        =  (1 << (targetInputBitDepth - 1)) - 1;
584
585
0
    const uint32_t uiLog2TrWidth  = Log2(uiWidth);
586
0
    const uint32_t uiLog2TrHeight = Log2(uiHeight);
587
0
    int* piDequantCoef            = getDequantCoeff(scalingListType, QP_rem, uiLog2TrWidth, uiLog2TrHeight);
588
589
0
    if(rightShift > 0)
590
0
    {
591
0
      const Intermediate_Int iAdd = (Intermediate_Int) 1 << (rightShift - 1);
592
0
      for( int n = 0; n < numSamplesInBlock; n++ )
593
0
      {
594
0
        const TCoeff           clipQCoef = TCoeff(Clip3<Intermediate_Int>(inputMinimum, inputMaximum, piQCoef[n]));
595
0
        const Intermediate_Int iCoeffQ   = ((Intermediate_Int(clipQCoef) * piDequantCoef[n]) + iAdd ) >> rightShift;
596
0
        piCoef[n] = TCoeff(Clip3<Intermediate_Int>(transformMinimum,transformMaximum,iCoeffQ));
597
0
      }
598
0
    }
599
0
    else
600
0
    {
601
0
      const int leftShift = -rightShift;
602
0
      for( int n = 0; n < numSamplesInBlock; n++ )
603
0
      {
604
0
        const TCoeff           clipQCoef = TCoeff(Clip3<Intermediate_Int>(inputMinimum, inputMaximum, piQCoef[n]));
605
0
        const Intermediate_Int iCoeffQ   = (Intermediate_Int(clipQCoef) * piDequantCoef[n]) << leftShift;
606
0
        piCoef[n] = TCoeff(Clip3<Intermediate_Int>(transformMinimum,transformMaximum,iCoeffQ));
607
0
      }
608
0
    }
609
0
  }
610
59.7k
  else
611
59.7k
  {
612
59.7k
    const int scale     = g_invQuantScales[needSqrtAdjustment?1:0][QP_rem];
613
59.7k
    const int scaleBits = ( IQUANT_SHIFT + 1 );
614
    //from the dequantisation equation:
615
    //iCoeffQ                         = Intermediate_Int((int64_t(clipQCoef) * scale + iAdd) >> rightShift);
616
    //(sizeof(Intermediate_Int) * 8)  =                    inputBitDepth   + scaleBits      - rightShift
617
59.7k
    const uint32_t             targetInputBitDepth = std::min<uint32_t>((maxLog2TrDynamicRange + 1), (((sizeof(Intermediate_Int) * 8) + rightShift) - scaleBits));
618
59.7k
    const Intermediate_Int inputMaximum        =  (1 << (targetInputBitDepth - 1)) - 1;
619
59.7k
    xDeQuant(uiWidth-1,uiHeight-1,scale,piQCoef,piStride,piCoef,rightShift,inputMaximum,transformMaximum);
620
59.7k
  }
621
59.7k
}
622
623
void Quant::init( int rdoq, bool bUseRDOQTS, int thrVal )
624
5.97k
{
625
626
  // TODO: pass to init() a single variable containing (quantization) flags,
627
  //       instead of variables that don't have to do with this class
628
629
5.97k
  m_RDOQ             = rdoq;
630
5.97k
  m_useRDOQTS        = bUseRDOQTS;
631
5.97k
  m_thrVal           = thrVal;
632
5.97k
}
633
634
/** set flat matrix value to quantized coefficient
635
 */
636
void Quant::setFlatScalingList(const int maxLog2TrDynamicRange[MAX_NUM_CH], const BitDepths &bitDepths )
637
5.97k
{
638
5.97k
  if( !m_scalingListEnabled ) return;
639
640
0
  const int minimumQp = 0;
641
0
  const int maximumQp = SCALING_LIST_REM_NUM;
642
643
0
  for(uint32_t sizeX = 0; sizeX < SCALING_LIST_SIZE_NUM; sizeX++)
644
0
  {
645
0
    for(uint32_t sizeY = 0; sizeY < SCALING_LIST_SIZE_NUM; sizeY++)
646
0
    {
647
0
      for(uint32_t list = 0; list < SCALING_LIST_NUM; list++)
648
0
      {
649
0
        for(int qp = minimumQp; qp < maximumQp; qp++)
650
0
        {
651
0
          xSetFlatScalingList( list, sizeX, sizeY, qp );
652
0
        }
653
0
      }
654
0
    }
655
0
  }
656
0
}
657
658
/** set flat matrix value to quantized coefficient
659
 * \param list List ID
660
 * \param size size index
661
 * \param qp Quantization parameter
662
 * \param format chroma format
663
 */
664
void Quant::xSetFlatScalingList(uint32_t list, uint32_t sizeX, uint32_t sizeY, int qp )
665
0
{
666
0
  uint32_t i,num = g_scalingListSizeX[sizeX]*g_scalingListSizeX[sizeY];
667
0
  int *quantcoeff;
668
0
  int *dequantcoeff;
669
670
0
  const bool blockIsNotPowerOf4 = ((Log2(g_scalingListSizeX[sizeX] * g_scalingListSizeX[sizeY])) & 1) == 1;
671
0
  int quantScales    = g_quantScales   [blockIsNotPowerOf4?1:0][qp];
672
0
  int invQuantScales = g_invQuantScales[blockIsNotPowerOf4?1:0][qp] << 4;
673
674
0
  quantcoeff   = getQuantCoeff(list, qp, sizeX, sizeY);
675
0
  dequantcoeff = getDequantCoeff(list, qp, sizeX, sizeY);
676
677
0
  for(i=0;i<num;i++)
678
0
  {
679
0
    *quantcoeff++ = quantScales;
680
0
    *dequantcoeff++ = invQuantScales;
681
0
  }
682
0
}
683
684
685
/** initialization process of scaling list array
686
 */
687
void Quant::xInitScalingList( const Quant* other, bool useScalingLists )
688
5.97k
{
689
5.97k
  m_isScalingListOwner = other == nullptr;
690
5.97k
  m_scalingListEnabled = useScalingLists;
691
692
47.7k
  for(uint32_t sizeIdX = 0; sizeIdX < SCALING_LIST_SIZE_NUM; sizeIdX++)
693
41.8k
  {
694
334k
    for(uint32_t sizeIdY = 0; sizeIdY < SCALING_LIST_SIZE_NUM; sizeIdY++)
695
292k
    {
696
2.04M
      for(uint32_t qp = 0; qp < SCALING_LIST_REM_NUM; qp++)
697
1.75M
      {
698
12.2M
        for(uint32_t listId = 0; listId < SCALING_LIST_NUM; listId++)
699
10.5M
        {
700
10.5M
          if( m_isScalingListOwner )
701
2.63M
          {
702
2.63M
            const size_t scalingListSize = g_scalingListSizeX[sizeIdX] * g_scalingListSizeX[sizeIdY];
703
704
2.63M
            m_quantCoef   [sizeIdX][sizeIdY][listId][qp] = useScalingLists ? new int[scalingListSize] : nullptr;
705
2.63M
            m_dequantCoef [sizeIdX][sizeIdY][listId][qp] = useScalingLists ? new int[scalingListSize] : nullptr;
706
2.63M
          }
707
7.90M
          else
708
7.90M
          {
709
7.90M
            m_quantCoef   [sizeIdX][sizeIdY][listId][qp] = other->m_quantCoef   [sizeIdX][sizeIdY][listId][qp];
710
7.90M
            m_dequantCoef [sizeIdX][sizeIdY][listId][qp] = other->m_dequantCoef [sizeIdX][sizeIdY][listId][qp];
711
7.90M
          }
712
10.5M
        } // listID loop
713
1.75M
      }
714
292k
    }
715
41.8k
  }
716
5.97k
}
717
718
/** destroy quantization matrix array
719
 */
720
void Quant::xDestroyScalingList()
721
5.97k
{
722
5.97k
  if( !m_isScalingListOwner ) return;
723
724
11.9k
  for(uint32_t sizeIdX = 0; sizeIdX < SCALING_LIST_SIZE_NUM; sizeIdX++)
725
10.4k
  {
726
83.6k
    for(uint32_t sizeIdY = 0; sizeIdY < SCALING_LIST_SIZE_NUM; sizeIdY++)
727
73.1k
    {
728
512k
      for(uint32_t listId = 0; listId < SCALING_LIST_NUM; listId++)
729
438k
      {
730
3.07M
        for(uint32_t qp = 0; qp < SCALING_LIST_REM_NUM; qp++)
731
2.63M
        {
732
2.63M
          if(m_quantCoef[sizeIdX][sizeIdY][listId][qp])
733
0
          {
734
0
            delete [] m_quantCoef[sizeIdX][sizeIdY][listId][qp];
735
0
          }
736
2.63M
          if(m_dequantCoef[sizeIdX][sizeIdY][listId][qp])
737
0
          {
738
0
            delete [] m_dequantCoef[sizeIdX][sizeIdY][listId][qp];
739
0
          }
740
2.63M
        }
741
438k
      }
742
73.1k
    }
743
10.4k
  }
744
1.49k
}
745
746
void Quant::quant(TransformUnit& tu, const ComponentID compID, const CCoeffBuf& pSrc, TCoeff &uiAbsSum, const QpParam& cQP, const Ctx& ctx)
747
6.97k
{
748
6.97k
  const SPS &sps            = *tu.cs->sps;
749
6.97k
  const CompArea& rect      = tu.blocks[compID];
750
6.97k
  const uint32_t uiWidth    = rect.width;
751
6.97k
  const uint32_t uiHeight   = rect.height;
752
6.97k
  const int channelBitDepth = sps.bitDepths[toChannelType(compID)];
753
754
6.97k
  const CCoeffBuf&  piCoef  = pSrc;
755
6.97k
        CoeffSigBuf piQCoef = tu.getCoeffs(compID);
756
757
6.97k
  const bool useTransformSkip = tu.mtsIdx[compID] == MTS_SKIP;
758
6.97k
  const int  maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange();
759
760
6.97k
  {
761
6.97k
    CoeffCodingContext cctx(tu, compID, tu.cs->slice->signDataHidingEnabled);
762
763
6.97k
    const TCoeff entropyCodingMinimum = -(1 << maxLog2TrDynamicRange);
764
6.97k
    const TCoeff entropyCodingMaximum =  (1 << maxLog2TrDynamicRange) - 1;
765
766
6.97k
    TCoeff deltaU[MAX_TB_SIZEY * MAX_TB_SIZEY];
767
6.97k
    int scalingListType           = getScalingListType(tu.cu->predMode, compID);
768
6.97k
    CHECK(scalingListType >= SCALING_LIST_NUM, "Invalid scaling list");
769
6.97k
    const uint32_t uiLog2TrWidth  = Log2(uiWidth);
770
6.97k
    const uint32_t uiLog2TrHeight = Log2(uiHeight);
771
6.97k
    int *piQuantCoeff             = getQuantCoeff(scalingListType, cQP.rem(useTransformSkip), uiLog2TrWidth, uiLog2TrHeight);
772
773
6.97k
    const bool isLfnstApplied     = tu.cu->lfnstIdx > 0 && (CU::isSepTree(*tu.cu) ? true : isLuma(compID));
774
6.97k
    const bool enableScalingLists = getUseScalingList(uiWidth, uiHeight, useTransformSkip, isLfnstApplied);
775
776
    // for blocks that where width*height != 4^N, the effective scaling applied during transformation cannot be
777
    // compensated by a bit-shift (the quantised result will be sqrt(2) * larger than required).
778
    // The quantScale table and shift is used to compensate for this.
779
6.97k
    const bool needSqrtAdjustment= TU::needsSqrt2Scale( tu, compID );
780
6.97k
    const int defaultQuantisationCoefficient    = g_quantScales[needSqrtAdjustment?1:0][cQP.rem(useTransformSkip)];
781
6.97k
    const int iTransformShift = getTransformShift(channelBitDepth, rect.size(), maxLog2TrDynamicRange) + ( needSqrtAdjustment?-1:0);
782
783
6.97k
    const int iQBits = QUANT_SHIFT + cQP.per(useTransformSkip) + (useTransformSkip ? 0 : iTransformShift);
784
    // QBits will be OK for any internal bit depth as the reduction in transform shift is balanced by an increase in Qp_per due to QpBDOffset
785
786
6.97k
    const int64_t iAdd = int64_t(tu.cs->slice->isIRAP() ? 171 : 85) << int64_t(iQBits - 9);
787
6.97k
    const int qBits8 = iQBits - 8;
788
789
6.97k
    int lastScanPos = -1;
790
791
6.97k
    if (!enableScalingLists)
792
6.97k
      xQuant(tu,compID,piCoef,piQCoef,uiAbsSum,lastScanPos,deltaU,defaultQuantisationCoefficient,iQBits,iAdd,entropyCodingMinimum,entropyCodingMaximum,cctx.signHiding(),m_thrVal);
793
0
    else
794
0
    {
795
0
      const uint32_t lfnstIdx = tu.cu->lfnstIdx;
796
0
      const int maxNumberOfCoeffs = lfnstIdx > 0 ? ( ( ( uiWidth == 4 && uiHeight == 4 ) || ( uiWidth == 8 && uiHeight == 8 ) ) ? 8 : 16 ) : piQCoef.area();
797
798
0
      piQCoef.memset( 0 );
799
0
      for (int uiScanPos = 0; uiScanPos < maxNumberOfCoeffs; uiScanPos++ )
800
0
      {
801
0
        const int uiBlockPos  = cctx.blockPos( uiScanPos );
802
0
        const TCoeff iLevel   = piCoef.buf[uiBlockPos];
803
0
        const TCoeff iSign    = (iLevel < 0 ? -1: 1);
804
805
0
        const int64_t  tmpLevel = (int64_t)abs(iLevel) * (enableScalingLists ? piQuantCoeff[uiBlockPos] : defaultQuantisationCoefficient);
806
0
        const TCoeff quantisedMagnitude = TCoeff((tmpLevel + iAdd ) >> iQBits);
807
0
        deltaU[uiBlockPos] = (TCoeff)((tmpLevel - ((int64_t)quantisedMagnitude<<iQBits) )>> qBits8);
808
809
0
        uiAbsSum += quantisedMagnitude;
810
0
        const TCoeff quantisedCoefficient = quantisedMagnitude * iSign;
811
812
0
        piQCoef.buf[uiBlockPos] = Clip3<TCoeff>( entropyCodingMinimum, entropyCodingMaximum, quantisedCoefficient );
813
0
      } // for n
814
0
    }
815
6.97k
    if (tu.cu->bdpcmM[toChannelType(compID)])
816
6.97k
    {
817
6.97k
      CoeffSigBuf coeffs = tu.getCoeffs( compID );
818
6.97k
      xFwdResDPCM( coeffs.buf, coeffs.stride, uiWidth, uiHeight, tu.cu->bdpcmM[toChannelType( compID )] != 1 );
819
6.97k
    }
820
821
6.97k
    if( uiAbsSum )
822
4.18k
    {
823
8.36k
      for( int scanPos = lastScanPos; scanPos >= 0; scanPos-- )
824
8.36k
      {
825
8.36k
        unsigned blkPos = cctx.blockPos( scanPos );
826
8.36k
        if( piQCoef.buf[blkPos] )
827
4.18k
        {
828
4.18k
          lastScanPos = scanPos;
829
4.18k
          break;
830
4.18k
        }
831
8.36k
      }
832
833
4.18k
      if( cctx.signHiding() )
834
0
      {
835
0
        if( uiAbsSum >= 2 ) //this prevents TUs with only one coefficient of value 1 from being tested
836
0
        {
837
0
          xSignBitHidingHDQ( piQCoef.buf, piCoef.buf, deltaU, cctx, lastScanPos, maxLog2TrDynamicRange );
838
0
        }
839
0
      }
840
4.18k
    }
841
842
6.97k
    tu.lastPos[compID] = lastScanPos;
843
6.97k
  } //if RDOQ
844
  //return;
845
6.97k
}
846
847
bool Quant::xNeedRDOQ(TransformUnit& tu, const ComponentID compID, const CCoeffBuf& pSrc, const QpParam& cQP)
848
0
{
849
0
  const SPS &sps            = *tu.cs->sps;
850
0
  const CompArea& rect      = tu.blocks[compID];
851
0
  const uint32_t uiWidth    = rect.width;
852
0
  const uint32_t uiHeight   = rect.height;
853
0
  const uint32_t efHeight   = std::min<unsigned>( uiHeight, JVET_C0024_ZERO_OUT_TH );
854
0
  const uint32_t efArea     = uiWidth * efHeight;
855
0
  const int channelBitDepth = sps.bitDepths[toChannelType(compID)];
856
0
  const CCoeffBuf piCoef    = pSrc;
857
858
0
  const bool useTransformSkip      = tu.mtsIdx[compID] == MTS_SKIP;
859
0
  const int  maxLog2TrDynamicRange = sps.getMaxLog2TrDynamicRange();
860
861
0
  const int scalingListType     = getScalingListType( tu.cu->predMode, compID );
862
0
  CHECK( scalingListType >= SCALING_LIST_NUM, "Invalid scaling list" );
863
864
0
  const bool        isDq        = tu.cs->slice->depQuantEnabled && !useTransformSkip;
865
0
  const int         qpDQ        = isDq ? cQP.Qp( false ) + 1 : cQP.Qp( useTransformSkip );
866
0
  const int         qpPer       = isDq ? qpDQ / 6 : cQP.per( useTransformSkip );
867
0
  const int         qpRem       = isDq ? qpDQ - 6 * qpPer : cQP.rem( useTransformSkip );
868
869
0
  const uint32_t uiLog2TrWidth  = Log2( uiWidth );
870
0
  const uint32_t uiLog2TrHeight = Log2( uiHeight );
871
0
  int *piQuantCoeff             = getQuantCoeff( scalingListType, qpRem, uiLog2TrWidth, uiLog2TrHeight );
872
873
0
  const bool isLfnstApplied     = tu.cu->lfnstIdx > 0 && ( CU::isSepTree( *tu.cu ) ? true : isLuma( compID ) );
874
0
  const bool enableScalingLists = getUseScalingList( uiWidth, uiHeight, ( useTransformSkip != 0 ), isLfnstApplied );
875
876
0
  const bool needSqrtAdjustment = TU::needsSqrt2Scale( tu, compID );
877
0
  const int defaultQuantisationCoefficient
878
0
                                = g_quantScales[needSqrtAdjustment?1:0][qpRem];
879
0
  const int iTransformShift     = getTransformShift( channelBitDepth, rect.size(), maxLog2TrDynamicRange ) + ( needSqrtAdjustment ? -1 : 0 );
880
881
882
0
  const int iQBits              = QUANT_SHIFT + qpPer + iTransformShift;
883
884
  // QBits will be OK for any internal bit depth as the reduction in transform shift is balanced by an increase in Qp_per due to QpBDOffset
885
  // iAdd is different from the iAdd used in normal quantization
886
0
  const int64_t iAdd = int64_t( compID == COMP_Y ? 171 : 256 ) << ( iQBits - 9 );
887
888
0
  if( !enableScalingLists )
889
0
    return xNeedRdoq( piCoef.buf, efArea, defaultQuantisationCoefficient, iAdd, iQBits );
890
891
0
  for( int uiBlockPos = 0; uiBlockPos < efArea; uiBlockPos++ )
892
0
  {
893
0
    const TCoeff   iLevel           = piCoef.buf[uiBlockPos];
894
0
    const int64_t  tmpLevel         = ( int64_t ) std::abs( iLevel ) * piQuantCoeff[uiBlockPos];
895
0
    const TCoeff quantisedMagnitude = TCoeff( ( tmpLevel + iAdd ) >> iQBits );
896
897
0
    if( quantisedMagnitude != 0 )
898
0
    {
899
0
      return true;
900
0
    }
901
0
  } // for n
902
0
  return false;
903
0
}
904
905
} // namespace vvenc
906
907
//! \}
908