[XviD-devel] chroma down-sampling

peter ross xvid-devel@xvid.org
Tue, 22 Oct 2002 00:48:57 +1000


>? you mean chroma=(c1+c2)>>1, right ?

yes. but, in the positive domain, /2 is the same as >>1.

>i vote for pavgb (pavgusb -> you want to do a 3dnow version ??)

its already done... my k6 only has the pavgusb instruction

> > note: this doesnt have much todo with interlace down sampling.
> > the docs ive recommend chroma=0.75*c1 + 0.25*c3.
>
>that's the real pain.
>so the UV data is intelaced AFTER downsampling, right ??
>that's very important. how do you do interlaced upsampling ?

yep, downsampling is easy.
for unsampling, i assume we just duplicate the values

e.g.

progressive yuyv
    encoding:  chroma = (c1+c2+1)/2
    decoding:  c1 = chroma,  c2 = chroma

interlaced yuyv
    encoding:  chroma1 = 0.75*c1 + 0.25*c3, chroma2 = 0.75*c2 + 0.25*c4
    decoding:  c1 = chroma1,  c2=chroma2, c3 = chroma1, c4=chroma2

>i can help you to do the YV12->YUY2 interlaced upsampling code, because
>i need it for MPEG2Dec3 YV12->YUY2 interlaced convertion

hmm, i take it mpeg2dec-avisynth does not perform interlaced chroma
upsampling.

the plainc YUYVi<->YV12 functions are already complete.
i'll send you some code, and you can have a stab at mmx yuyvi.

-- pete

_________________________________________________________________
Broadband? Dial-up? Get reliable MSN Internet Access. 
http://resourcecenter.msn.com/access/plans/default.asp