Public Version
www.ti.com
IVA2.2 Subsystem Basic Programming Model
5.4.7.1
Setting Up Registers for Q/IQ Operation
Before starting to encode or decode a bitstream, the Q/IQ registers and memory in the iVLCD module
must be correctly initialized.
, Q/IQ Matrix Setup - Inverse Quantizer Matrix, through
, Q/IQ Threshold, describe the details.
5.4.7.1.1 Q/IQ Matrix Setup - Inverse Quantizer Matrix
Inverse_quantizer_matrix[0] = (1<<15)/DC_scaler
Inverse_quantizer_matrix[i = 1...63] = (1<<15)/quant_matrix(i = 1...63);
Quantization matrix values are either standard or embedded in the bitstream.
The inverse quantizer and quantizer matrices are selected by registers IVA.
(j = 0 to
5).
5.4.7.1.2 Q/IQ Rounding
[15] MPEGRND bit = 1 implies that a rounding term (114) is added to the coefficients
during quantization. IVA.
[15] MPEGRND bit = 0 implies that quantization of the coefficients
other than DC intra is performed without rounding.
DC intracoefficients are always quantized with a rounding term (1<<14).
5.4.7.1.3 Q/IQ Offset
and IVA.
are used for H.263 and MPEG4 type 0
inverse quantization.
The IVA.
[8:0] MDELIQ field is set as follows:
if ((qp&0x1)==0) delta_q = qp-1;
else delta_q = qp;
where qp is the quantizer scale
The IVA.
[8:0] MDELQ field is set to 0.
For MPEG1/2, the IVA.
[8:0] MDELQ and IVA.
[8:0]
MDELIQ fields are set to 0.
5.4.7.1.4 Q/IQ Threshold
The IVA.
[11:0] MTHRED field is the quantization threshold for intra AC coefficients
and intercoefficients.
There is no register setting for inverse quantization saturation. The inverse quantization function internally
saturates intra AC coefficients and intercoefficients to between -2048 and 2047.
5.4.7.2
Setting Up Registers for VLC Operation
Before starting to encode a bitstream, the iVLCD must be initialized by initializing the coprocessor
registers and setting up the VLC look-up tables. Some of those register initial values remain unchanged
during a frame-encoding process, and others must be updated on a frame basis.
First, the VLC look-up tables must be loaded into the iVLCD table memory.
The VLC module operates on an N macroblocks basis. This means that when VLC is triggered, exactly N
macroblocks of 64 elements are encoded. N must be specified to the encoder by setting the
corresponding bits in the iVLCD control registers.
Programming the VLC involves two steps:
775
SWPU177N – December 2009 – Revised November 2010
IVA2.2 Subsystem
Copyright © 2009–2010, Texas Instruments Incorporated