**ISO/IEC 10918-1 : 1993(E)**

**K.8.2**

**Quantized AC prediction**

The prediction equations can be mapped to a form which uses quantized values of the DC coefficients and which

computes quantized AC coefficients using integer arithmetic. The quantized DC coefficients need to be scaled, however,

such that the predicted coefficients have fractional bit precision.

First, the prediction equation coefficients are scaled by 32 and rounded to the nearest integer. Thus,

1,13885

×

32

=

36

0,27881

×

32

=

3

9

0,16213

×

32

=

3

5

The multiplicative factors are then scaled by the ratio of the DC and AC quantization factors and rounded appropriately.

The normalization defined for the DCT introduces another factor of 8 in the unquantized DC values. Therefore, in terms

of the quantized DC values, the predicted quantized AC coefficients are given by the equations below. Note that if (for

example) the DC values are scaled by a factor of 4, the AC predictions will have 2 fractional bits of precision relative to

the quantized DCT coefficients.

QAC

01

=

( (R

d

×

Q

01

)

+

(36

×

Q

00

×

(QDC

4

QDC

6

)))/(256

×

Q

01

)

QAC

10

=

( (R

d

×

Q

10

)

+

(36

×

Q

00

×

(QDC

2

QDC

8

)))/(256

×

Q

10

)

QAC

20

=

( (R

d

×

Q

20

)

+

( 9

×

Q

00

×

(QDC

2

+

QDC

8

2

×

QDC

5

)))/(256

×

Q

20

)

QAC

11

=

( (R

d

×

Q

11

)

+

( 5

×

Q

00

×

((QDC

1

QDC

3

) (QDC

7

QDC

9

))))/(256

×

Q

11

)

QAC

02

=

( (R

d

×

Q

02

)

+

( 9

×

Q

00

×

(QDC

4

+

QDC

6

2

×

QDC

5

)))/(256

×

Q

02

)

where QDC

x

and QAC

xy

are the quantized and scaled DC and AC coefficient values. The constant Rd is added to get a

correct rounding in the division. Rd is 128 for positive numerators, and 128 for negative numerators.

Predicted values should not override coded values. Therefore, predicted values for coefficients which are already non-zero

should be set to zero. Predictions should be clamped if they exceed a value which would be quantized to a non-zero value

for the current precision in the successive approximation.

**K.9**

**Modification of dequantization to improve displayed image quality**

For a progression where the first stage successive approximation bit, Al, is set to 3, uniform quantization of the DCT gives

the following quantization and dequantization levels for a sequence of successive approximation scans, as shown in

Figure K.8:

8

r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t

_ r _ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r ¯ t ¯ r

7

6

5

4

3

2

1

0

+1

+2

+3

+4

+5

+6

+7

+8

0

r ¯ t

r ¯ t

t ¯ r ¯ x

1

2

r ¯ t

r

t ¯ r

3

x ¯

r ¯ t

x ¯

r ¯ t

x ¯

r

t ¯ r

t ¯ r ¯ x

t ¯ r ¯ x

r ¯ t

x

r ¯ t

r

t ¯ r

t ¯ r

x

T0812990-93/d118

Al

F i gu r e K .8 I l l u st r at i on of t w o r econ st r u ct i on st r at egi es

Quantized DCT coefficient value

Figure K.8 [D118] = 6 cm = 234 %

The column to the left labelled "Al" gives the bit position specified in the scan header. The quantized DCT coefficient

magnitudes are therefore divided by 2

Al

during that scan.

**CCITT Rec. T.81 (1992 E)**

**177**