08.01.2013 Views

DigitalVideoAndHDTVAlgorithmsAndInterfaces.pdf

DigitalVideoAndHDTVAlgorithmsAndInterfaces.pdf

DigitalVideoAndHDTVAlgorithmsAndInterfaces.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Eq 38.1<br />

Owing to the eight-line-high vertical transform, eight<br />

lines of image memory are required in the DCT<br />

subsystem of the encoder, and in the IDCT (DCT -1 )<br />

subsystem of the decoder. When the DCT is implemented<br />

in separable form, as is almost always the case,<br />

this is called transpose memory.<br />

Level-shifting<br />

The DCT formulation in JPEG is intended for signed<br />

sample values. In ordinary hardware or firmware, the<br />

DCT is implemented in fixed-point, two’s complement<br />

arithmetic. Standard video interfaces use offset binary<br />

representation, so each luma or color difference sample<br />

is level shifted prior to DCT by subtracting 2k-1 , where k<br />

is the number of bits in use.<br />

Discrete cosine transform (DCT)<br />

The 8×8 forward DCT (FDCT) takes an 8×8 array of 64<br />

sample values (denoted f, whose elements are fi,j ), and<br />

produces an 8×8 array of 64 transform coefficients<br />

(denoted F, whose elements are Fu,v ). The FDCT is<br />

expressed by this equation:<br />

( )<br />

( )<br />

7 7<br />

1<br />

⎡ 2i+ 1uπ⎤⎡2j<br />

+ 1vπ⎤<br />

Fuv , = C( u) C( v) fi,<br />

jcos<br />

⎢ ⎥cos<br />

⎢ ⎥;<br />

4 Σ Σ ⎢ 16 ⎥ ⎢ 16 ⎥<br />

i=<br />

0 j=<br />

0 ⎣ ⎦ ⎣ ⎦<br />

⎧ 1<br />

⎪ ; w = 0<br />

C( w)<br />

= ⎨ 2<br />

⎪<br />

⎩1;<br />

w = 1, 2, …,<br />

7<br />

The cosine terms need not be computed on-the-fly;<br />

they can be precomputed and stored in tables.<br />

The inverse transform – the IDCT, or DCT -1 – is this:<br />

7 7<br />

1<br />

( 2i+ 1)<br />

uπ ( 2j + 1)<br />

vπ<br />

Eq 38.2 fij , = Σ Σ C u C v Fuv<br />

, cos cos<br />

4<br />

16<br />

16<br />

u=<br />

0 v=<br />

0<br />

The forward and inverse transforms involve nearly identical<br />

arithmetic: The complexity of encoding and<br />

decoding is very similar. The DCT is its own inverse<br />

(within a scale factor), so performing the DCT on the<br />

transform coefficients would perfectly reconstruct the<br />

original samples, subject only to the roundoff error in<br />

the DCT and IDCT.<br />

CHAPTER 38 JPEG AND MOTION-JPEG (M-JPEG) COMPRESSION 451

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!