View Single Post
Old 11th December 2004, 22:50   #57  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
I found out, that U and V of DV-YV12 seems to be stored as normal YV12 ?!?
The storage is the same (Y plane, V plane followed by U plane), but the sampling is different. You posted a link in the first thread, so you should know

YUY2 layout:

frame:
YC Y YC Y line 1
YC Y YC Y line 2
YC Y YC Y line 3
YC Y YC Y line 4

MPEG-2
YUY2 -> YV12 (interlaced subsampling)

frame:
Y_Y_Y_Y line 1t
C___C__ chroma of YUY2_lines (0.75)*1t + (0.25)*3t
Y_Y_Y_Y line 2b

Y_Y_Y_Y line 3t
C___C__ chroma of YUY2_lines (0.25)*2b + (0.75)*4b
Y_Y_Y_Y line 4b

DV-PAL
YUY2 -> YV12 (interlaced subsampling)

It think it's just point-sampled (ie chroma removed):

frame:
YV1_Y_YV1_Y line 1t; V of YUY2_line 1t
YV2_Y_YV2_Y line 2b; V of YUY2_line 2b
YU3_Y_YU3_Y line 3t; U of YUY2_line 3t
YU4_Y_YU4_Y line 4b; U of YUY2_line 4b
YV5_Y_YV5_Y line 5t; V of YUY2_line 5t
YV6_Y_YV6_Y line 6b; V of YUY2_line 6b

I'm not sure, if have to look that up.

Suppose you upsample that using ConvertToYUY2(interlaced=true) (thus MPEG-2) sampling. What happens?

Consider line 5t. The chroma will be recreated as
Code:
 chroma of YV12_lines (0.25)*1t + (0.75)*5t[*]
Thus V5 = (0.25)*V1 + (0.75)*V5 and U5 = (0.25)*U3 + (0.75)*U7.

While it should be

Thus V5 = V5 and U5 = (0.5)*U3 + (0.5)*U7. I think ...
[*] see http://www.avisynth.org/Sampling

Last edited by Wilbert; 12th December 2004 at 20:48.
Wilbert is offline   Reply With Quote