th_quant_info Struct Reference
A complete set of quantization parameters.
More...
#include <codec.h>
Detailed Description
A complete set of quantization parameters.
The quantizer for each coefficient is calculated as:
Q=MAX(MIN(qmin[qti][ci!=0],scale[ci!=0][qi]*base[qti][pli][qi][ci]/100),
1024).
qti is the quantization type index: 0 for intra, 1 for inter. ci!=0 is 0 for the DC coefficient and 1 for AC coefficients. qi is the quality index, ranging between 0 (low quality) and 63 (high quality). pli is the color plane index: 0 for Y', 1 for Cb, 2 for Cr. ci is the DCT coefficient index. Coefficient indices correspond to the normal 2D DCT block ordering--row-major with low frequencies first--not zig-zag order.
Minimum quantizers are constant, and are given by:
qmin[2][2]={{4,2},{8,4}}.
Parameters that can be stored in the bitstream are as follows:
- The two scale matrices ac_scale and dc_scale.
- The base matrices for each qi, qti and pli (up to 384 in all). In order to avoid storing a full 384 base matrices, only a sparse set of matrices are stored, and the rest are linearly interpolated. This is done as follows. For each qti and pli, a series of n qi ranges is defined. The size of each qi range can vary arbitrarily, but they must sum to 63. Then,
n+1 matrices are specified, one for each endpoint of the ranges. For interpolation purposes, each range's endpoints are the first qi value it contains and one past the last qi value it contains. Fractional values are rounded to the nearest integer, with ties rounded away from zero.
Base matrices are stored by reference, so if the same matrices are used multiple times, they will only appear once in the bitstream. The bitstream is also capable of omitting an entire set of ranges and its associated matrices if they are the same as either the previous set (indexed in row-major order) or if the inter set is the same as the intra set.
- Loop filter limit values. The same limits are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used for the loop filter in all color planes, despite potentially differing levels of quantization in eachBase matrices arts are used f