Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 30th October 2002, 10:23   #1  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
YV12: mpeg2dec, mpeg2dec2 and mpeg3dec developers

@Dividee, tbarry and MarcFD,

Could anyone of you make a mpeg2dec version which outputs to YV12 by default (or by option)? (I understood that MarcFD stopped developing for a while ...) So that we can make some speed tests (YV12 versus YV12->YUY2->YV12), for dvd to DivX/Xvid. That would be really great ...
Wilbert is offline   Reply With Quote
Old 30th October 2002, 10:43   #2  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Though a YV12 decoder would be a good thing for testing, there is no real speed increase to be expected yet, since VDub doesn't support YV12 data yet.

So instead of:

YV12 (MPEG2) -> YUY2 (decoder) -> YUY2 (avisynth) -> YUY2 (vdub) -> YV12 (Xvid).

we still have:

YV12 (MPEG2) -> YV12 (avisynth) -> YUY2 (vdub) -> YV12 (Xvid).

Until this is resolved, you cannot expect a speed increase. Furthermore many YV12 filters still need optimizations to perform at their best.

I tried to find Marc FD's sources, but haven't been succesful yet.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 30th October 2002, 10:51   #3  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Sh0dan, haven't you seen the modified version of pulco-citron (see for example in the thread in the development section). You responded to his message this morning, in which he says:
Quote:
VirtualDubMod already passes YV12 unaltered to the decompressor if both the source and the output report to support this format (is this what you mean ?)
His version can be found in the second url of his first post in that thread.
Wilbert is offline   Reply With Quote
Old 30th October 2002, 11:21   #4  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
I get a lot of crashes in DivX, when using YV12, but it does work (Xvid DOES recieve data as YV12 - I tested this on a debug build).
Maybe AviSynth is giving DivX wrong information, or DivX is simply buggy.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 30th October 2002, 13:35   #5  |  Link
trbarry
Registered User
 
trbarry's Avatar
 
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
The sources to my version of DVD2AVI and MPEG2DEC are in the Sourceforge save-oe project, and also at:

www.trbarry.com/DVD2AVIT3.zip and
www.trbarry.com/MPEG2DEC2.zip

I think Store.cpp converts from YV12 to YUY2.

Also, I'm working on a version of TomsMoComp for ffdshow (if I can ever build the darn thing) that works in YV12. After that I'll probably make a YV12 SimpleResize version which I expect to go a bit faster than YUY2. I'm not sure after that.

- Tom
trbarry is offline   Reply With Quote
Old 30th October 2002, 14:24   #6  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
Yes, it seems like the conversion in store.cpp should be altered. I'll see if I get the time for it.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 31st October 2002, 01:56   #7  |  Link
Marc FD
XviD fan
 
Marc FD's Avatar
 
Join Date: Jun 2002
Location: France
Posts: 907
Argh XD i thought you'ld need more time to get to serious YV12 stuff

Hey, no pb, i'm pretty familiar with the source now, i'll do it.
just wait for 10 hours (to sleep) + 2 to 6 hours (to eat & code), okay

I have not started to test YV12 in Avisynth, because i thought VDub couldn't handle it before a while, but you're so fast.

You know, developpement is like a drug. you've tasted it, and after you can't stop it ^^

who would refuse a more than 20% faster MPEG-2 decoder ?
not me.

back in 12 to 16 hours,
MarcFD

PS : maybe less, but i need to test it, and my beta 7 version introduce some new features, like custom PP... so it would be a testing version first.

Last edited by Marc FD; 31st October 2002 at 02:01.
Marc FD is offline   Reply With Quote
Old 31st October 2002, 11:55   #8  |  Link
Marc FD
XviD fan
 
Marc FD's Avatar
 
Join Date: Jun 2002
Location: France
Posts: 907
10 hours ^^

okay i've done it. here you have MPEG2Dec3 pre-beta 7 with YV12 support.
everything should work, but i've only tested PP.

Crop works ! (croping is a very good test to check a filter)
Avisynth's resampler works ! (great job sh0dan)

Frameserving tests : (script is LoadPlug()/MPEG2Source() only)

Vdub decode using the DivX 5.02 codec (as expected)
WMP 8 crash.
BSPlayer crash.
Zoomplayer works.

VDub with "Direct Stream Copy" Preview :
YUY2 version : ~60 fps
YV12 version : ~75 fps
(Athlon XP 1600+, 256 Mo DDR)

so it's about 25% faster, as expected.
but the DivX decoder is slow and/or is converting in RGB32, because it's slower than MPEG2Dec3 internal convertions :

VDub with "Fast Recompress" Preview :
YUY2 version : ~50 fps (raw YUY2)
YV12 version : ~40 fps (decoded by DivX5.02)

that's what i've noticed so far.

BTW, ConvertToYUY2/ConvertToRGB doesn't work. i guess there's no implemented YV12 support in colorspace convertions yet. what about using XviD's ones ??

I hope the VDub Mod will have YV12 ultrafast-compress soon, i'd really like to see that working ^^

(attached : "MPEG2Dec3 YV12.zip")
Marc FD is offline   Reply With Quote
Old 31st October 2002, 12:14   #9  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
MarcFD, try this modified version: alpha0.31. Some info.

There's one thing I forgot. Dvd2avi outputs to YUY2 or RGB only, isn't it (there's no option in dvd2avi for saving in YV12)? So the last thing we need is a modified version of dvd2avi?

Last edited by Wilbert; 31st October 2002 at 12:17.
Wilbert is offline   Reply With Quote
Old 31st October 2002, 12:49   #10  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
@Wilbert:

DVD2AVI shouldn't matter, if you import the d2v file into AviSynth. The decoder should be the only thing that should be modified. DVD2AVI doesn't touch the video material when the d2v is created.

(unless I'm mistaking?)
__________________
Regards, sh0dan // VoxPod

Last edited by sh0dan; 31st October 2002 at 12:54.
sh0dan is offline   Reply With Quote
Old 31st October 2002, 13:02   #11  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
@MarcFD: Great work man!!! Hope it gets approved soon!

When using Avery's Vdub, the image information is converted to YUY2 before it is sent to the DivX (or Xvid) compressor, when using "Fast recompress".
The VdubMod attampts to pass YV12, which only works partially. At least on my machine, I'm getting crashes in DIVX.DLL, when I use YV12 passing. I don't know if I'm passing the wrong data to DivX or if DivX is buggy. Both are equally possible.

ConvertToYUY2 _should_ work, when the source is YV12. I've been using it a lot for tests.
ConvertToYV12 _should_ work with all colorspaces. It is not optimized by any means though (and RGB sources are converted to YUY2 first).
Yes, the XVID routines seem very obvious to use - fast, very well tested. Only problem is that they have to be converted from NASM -> MASM.

Oh - and the current ConvertToYV12 has broken interlaced chroma conversion, so you don't have to mention that - I'm aware of it!
__________________
Regards, sh0dan // VoxPod

Last edited by sh0dan; 31st October 2002 at 13:04.
sh0dan is offline   Reply With Quote
Old 31st October 2002, 13:15   #12  |  Link
Nic
Moderator
 
Join Date: Oct 2001
Location: England
Posts: 3,285
sh0dan is correct about d2a. YV12 support is great for MPEGDecoder.dll (at present I have to split the YV12 frame into its y,u&v components and then convert it to YUY2. Going straight out with YV12 makes things lots easier & v.quick.

The modification to VDub should only be tiny (?) Ill check out the source & have a look.

-Nic
Nic is offline   Reply With Quote
Old 31st October 2002, 14:26   #13  |  Link
sh0dan
Retired AviSynth Dev ;)
 
sh0dan's Avatar
 
Join Date: Nov 2001
Location: Dark Side of the Moon
Posts: 3,480
The Vdub mod does it now, but the real issue is to make Vdub(mod) open YV12 without asking for a decompressor. That way there is no need for DivX anymore.
Vdub will not be able to preview or apply filters, but I think that would be an ok solution until it can properly decompress YV12.
__________________
Regards, sh0dan // VoxPod
sh0dan is offline   Reply With Quote
Old 31st October 2002, 14:26   #14  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
sh0dan is correct about d2a.
Can I ask something about this ... What is the purpose of that colorspace setting in d2a? What is the difference if you set it to YUY2 or RGB? What happens if you leave it at YUY2 and try to open the d2v file in VFAPI for example?
Wilbert is offline   Reply With Quote
Old 31st October 2002, 16:48   #15  |  Link
trbarry
Registered User
 
trbarry's Avatar
 
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
Quote:
10 hours ^^

okay i've done it. here you have MPEG2Dec3 pre-beta 7 with YV12 support.
everything should work, but i've only tested PP.
Excellent!

Let me see if I know where we stand then on YV12 support. Currently we can:

- Pass YV12 directly to Avisynth with no conversion using MPEG2DEC3

- Do ConvertToxxx in Avisynth as needed (except ConvertToRGB).

- Use Avisynth Crop and various resize (except my SimpleResize)

- Pass YV21 to vdub only if we are using fast recompress and going to Divx 5, not Xvid.

Is that pretty much correct and current?


Wilbert -

The RGB/YUY2 setting is honored by VFAPI but ignored by MPEG2DECx.

- Tom

trbarry is offline   Reply With Quote
Old 31st October 2002, 16:59   #16  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Quote:
The RGB/YUY2 setting is honored by VFAPI but ignored by MPEG2DECx.
Ok, thanks.
Quote:
Currently we can: (...)
Yes, except the last one:
Quote:
Pass YV12 to vdub only if we are using fast recompress and going to Divx 5, not Xvid.
As I understand it, this is also true when encoding to Xvid or DivX3/4. But DivX5 is needed to decompress the avi when opening it in Virtual Dub modified (DivX4 and Xvid are not capable of doing this).

@MarcFD,

Did you actually attach the file?
Wilbert is offline   Reply With Quote
Old 31st October 2002, 18:01   #17  |  Link
trbarry
Registered User
 
trbarry's Avatar
 
Join Date: Oct 2001
Location: Gainesville FL USA
Posts: 2,092
Quote:
As I understand it, this is also true when encoding to Xvid or DivX3/4. But DivX5 is needed to decompress the avi when opening it in Virtual Dub modified (DivX4 and Xvid are not capable of doing this).
Not sure I understood this. Are you saying I could already set vdub to fast recompress and pass the YV12 clip to Xvid? (without any colorspace conversion?)

- Tom

Last edited by trbarry; 31st October 2002 at 18:04.
trbarry is offline   Reply With Quote
Old 31st October 2002, 18:06   #18  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
Yes, but you need to install DivX5 for that. Maybe Sh0dan can explain it better
Wilbert is offline   Reply With Quote
Old 31st October 2002, 18:24   #19  |  Link
Alestrix
XviDVorbisOgmXcd-believer
 
Join Date: Jun 2002
Location: Germany
Posts: 77
Now that everyone is hot on YV12 it's time we somehow can get our hands on Marc's mpeg2dec3b7.... Is the Mod busy or did the upload not work?
@Marc: Can you upload the file to your web page?

Can't wait trying it,
Alex

Last edited by Alestrix; 31st October 2002 at 18:27.
Alestrix is offline   Reply With Quote
Old 31st October 2002, 19:49   #20  |  Link
Guest
Guest
 
Join Date: Jan 2002
Posts: 21,901
Mod was out of town and when he got home found out about a death in the family. Attachments have now been approved.
Guest is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:11.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.