Quantization Parameters File Format - Quantization Parameters File Format - 3.0 English - PG447

H.264/H.265/JPEG Video Codec Unit 2 (VCU2) Solutions LogiCORE IP Product Guide (PG447)

Document ID
PG447
Release Date
2026-03-06
Version
3.0 English

When QPCtrlMode is set to LOAD_QP, the parameter specifies the location of the files containing the QP tables to use for each frame.

[SETTINGS]
QPCtrlMode = LOAD_QP
# or QPCtrlMode = LOAD_QP | RELATIVE_QP

[INPUT]
QpTablesFolder = <path>

QP table files must be in the current working directory, or in the directory given by the QPTablesFolder parameter if specified. QP table files must be named QPs.hex, in case the same QP table must be applied to all frames. For different QP tables for each frame, QP table files must be named QP_<frame_number>.hex.

QP table file must contains six lines per LCU, each line containing one 32-bit hexadecimal value.

Figure 1. QP File Values

For AVC, and for HEVC 32x32, QP/delta QPs are stored as 8 bits signed, and must be in range [-51; 51]. For HEVC, 16x16 delta QPs are stored on 6 bits signed, in range [-32; 31].

Lambda Factor
With LOAD_LDA a customized lambda can be provided to replace the ones used in RDO choices. This is a table with 2 lambdas per QP values. The Lambda Factor in the QP table is used to modify locally the lambda of the corresponding CTB. The Lambda Factor is an 8-bit value with 3 bits for integer part and 5 bits for fractional part (that is,value is using a 1/32th precision. The default value is 0x20 which corresponds to 1.0, for example, Lambda Factor = 0x1C correspond 0.875) The default Lambda table (or the provided lambda table using LOAD_LDA) is multiplied by this Lambda Factor before being used in the RDO.
Force DC Only
This flag, only the DC coefficient is kept after the Transform/Quantization. All ACs coefficients are removed. The flag does NOT force intra_DC prediction mode.
Force MVO
This flag forces Motion Vector = (0,0) and removes all coefficients after Transform/Quantization (all DC and ACs coefficients are removed). The block will be encoded as skip if the predicted Motion Vector is already (0,0), and if the number of bits needed to encode in skip is lower than the number of bits needed to encode it as MVP.
Force Intra
This flag forces intra-prediction. Force-MV0 flag forces inter-prediction with 0,0) motion vector and no residual. Both flags are propagated to sub-blocks, and mutually exclusive.
Table 1. QP File Settings

MinBlkSize/

MaxBlkSize

NxN block

RELATIVE_QP enabled disabled

MxM block (HEVC only)

RELATIVE_QP enabled disabled

AVC HEVC32x32 HEVC64x64
0: no constraint SliceQP + dQP_NxN QP_NxN SliceQP + dQP_NxN + dQP_MxM QP_NxN + dQP_MxM x x x
1: 4x4 x x x
2: 8x8 x x x
3: 16x16 x x x
4: 32x32 x x
5: 64x64 (for MaxBlkSize only) x

AVC example for one LCU:

10420020 
00000000
00000000
00000000
00000000
00000000

In this and following example:

  • QPxdQP = 32
  • Force Intra = 0
  • ForceMv0 = 0
  • DC only = 0
  • MinBlkSize = 2
  • MaxBlkSize = 4
  • LambdaFactor = 16 (must contain 6 lines per LCU, therefore the 0s padding)

HEVC Example:

10420020
7E02813F
00000000
00000000
00000000
00000000

The 2nd line: (note block 0 is stored in least significant bits)

dQP[0] = -1, Force Intra = 0, Force MV0 = 0,

dQP[1] = 1, Force Intra = 0, Force MV0 = 1,

dQP[2] = 2, Force Intra = 0, Force MV0 = 0,

dQP[3] = -2, Force Intra = 1, Force MV0 = 0