DSPRelated.com
Forums

YCbCr(4:2:0) interpolation

Started by raj deep October 8, 2001
Hi
CAn anyone tell me how YCbCr(4:2:0) interpolation

is done in image processing(source code if exists).My
applicatiion needs to dispaly the YCbCr data thats
being generated after decoding.I have tried with a
certain interpolation filter.I am getting some red
patched on the display.
There isnt any problem with Y .So i guess its problem
with the Cr and Cb interpolation. regards
deep




Hi Deep,
Interpolation for 4:2:0 is done as follows:
in effect there will be 3 planes namely Y Cb and Cr
the reason for interolating is to achieve compression.
the Cb & Cr plane is halved in both horzt & vert directions

Lets take without 4:2:0 the avg bit rate per pixel

Y,Cb&Cr takes 8 bits each
in effect bits/pel will be 24 bits (one pel is 24 bits)
after 4:2:0 Y plane is not reduced onluy Cb & Cr planes are halved in
both directions.

for 4 Y values one Cb & one Cr

x x
o
x x

ie, x - Y
o - cb & cr

lets take 4 Y values named Y1,Y2,Y3,Y4 and corresponding Cb
& Cr are Cb1,Cb2,Cb3,Cb4 and Cr1,Cr2,Cr3,Cr4

as mentioned earlier for 4 Y values, 1 Cb & 1 Cr
this is done as follows
Cb = Cb1+Cb2+Cb3+Cb4/4
Cr = Cr1+Cr2+Cr3+Cr4/4

So effective bits/pel after 4:2:0 is acluclated as follows
Y1+Y2+Y3+Y4+Cb+Cr = 48 bits
Average bits /pel = 48/4
= 12 bits only!
we compressed from 24 to 12 bits/pel !

Rgds,
-biju -- In imagedsp@y..., raj deep <deepbluu76@y...> wrote:
> Hi
> CAn anyone tell me how YCbCr(4:2:0) interpolation
>
> is done in image processing(source code if exists).My
> applicatiion needs to dispaly the YCbCr data thats
> being generated after decoding.I have tried with a
> certain interpolation filter.I am getting some red
> patched on the display.
> There isnt any problem with Y .So i guess its problem
> with the Cr and Cb interpolation. > regards
> deep