View Single Post
Old 23rd September 2002, 13:44   #16  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Fast response (I'll do a more detailed later)

- YV12 is easier and faster to process than YUY2, since it's planar and is source of MPEG2 decoding, and destination format of MPEG4 anyway. And it's faster because it has half the UV-information of YUY2.

- Pitch/Stride is mostly (by default) 8-byte-aligned , but that's easy to change. AVI always delivered in 4-byte-aligned frames. Perhaps the default alignment should be autodetected, and set to 16 if a P4 is detected. It seems like most apps use UV-pitch=Ypitch/2, which makes sense. but all frames are BitBlitted on output anyway, so output wouldn't mind if we have two different pitches.
Both pros and cons.
Two pitches = A little faster, less compatible (when converting filters from other apps).
One pitch = A little slower, easier integration of existing filters (ffdshow for instance).


- Seperate YUV pointers. Not IMO! They are easy to calculate, and seperate pointers, where they point to different memory-locations would involve copying the data when YV12 is delivered, and general confusion. Seperate pointers would also make YV12 too much a special case.
We could make helper functions that return the UV-pointers, but they should always be placed after Y with the correct pitch.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote