|
|
| sh0dan |
| Posted: Oct 25 2002, 05:07 PM |
 |
|
Avisynth Developer
  
Group: Vdubmod Alpha Testing Team
Posts: 41
Member No.: 327
Joined: 20-September 02

|
I'm an AviSynth developer, and we've been working on internal support of the YV12 planar colorspace.
There are two main issues. First of all, Vdub needs a codec that is capable of decompressing the frames, for preview and RGB filters. This is understandable, and until we find a better solution DivX5 actually does the job.
The more important issue is recompression. I can see from the Vdub source, that it doesn't attempt to hand over YV12 compressed data. I've tried modding Dup.cpp, so it would attempt to do YV12 fast recompress, but with no luck.
So I have two questions:
1) Would it be possible/a good idea to pass YV12 data in fast recompress. 2) Would it be possible to disable a request for a decompressor, so DivX5 wouldn't be needed?
ad. 2) I know this would disable the possibility for preview or processing, but for fast recompress it would make sense in my ears. |
 |
| ChristianHJW |
| Posted: Oct 25 2002, 06:17 PM |
 |
|
Advanced Member
  
Group: Moderators
Posts: 1768
Member No.: 2
Joined: 7-July 02

|
welcome here sh0dan.
I guess the only one to answer these questions is Avery himself. I dont know when he will show up next time, but i hope he will have a look here ...
-------------------- Visit the unofficial Virtualdub support forum on http://forums.virtualdub.org - help to reduce the big number of emails Avery Lee is getting every day !! Support matroska as container and Gstreamer as the only truely open, x-platform multimedia platform .... |
 |
| fccHandler |
| Posted: Oct 25 2002, 09:15 PM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
| QUOTE (sh0dan @ Oct 25 2002, 01:07 PM) | I'm an AviSynth developer, and we've been working on internal support of the YV12 planar colorspace.
|
Wonderful idea! In fact, I recently had a similar idea (using YUY2), but I never had the time or patience to implement it. I'm not a tenth as knowledgeable about VirtualDub as Avery Lee, but I'll attempt to answer your questions.
| QUOTE (sh0dan @ Oct 25 2002, 01:07 PM) | | 1) Would it be possible/a good idea to pass YV12 data in fast recompress. |
I'm pretty sure it's possible. I haven't studied it yet, but I think you're right that the code to modify is in Dub.cpp.
| QUOTE (sh0dan @ Oct 25 2002, 01:07 PM) | | 2) Would it be possible to disable a request for a decompressor, so DivX5 wouldn't be needed? |
For preview, you can probably use a DirectDraw overlay to avoid decompressing to RGB. But for the RGB filter chain, a decompressor is needed unless you can rewrite all of the internal filters to accept YV12 data. Even if you do that, external filters won't work without decompressing to RGB. Here's an idea: create a new flag FILTERPARAM_SUPPORTS_YV12 that external filters can return in their paramProc if they support YV12.
-------------------- May the FOURCC be with you... |
 |
| phaeron |
| Posted: Oct 26 2002, 02:28 AM |
 |
|

Virtualdub Developer
  
Group: Administrator
Posts: 7773
Member No.: 61
Joined: 30-July 02

|
Adding YV12 to fast recompress support should be relatively simple -- assuming, of course, that you can find a codec that accepts it. Back when I wrote that code, nothing would produce that format, so I disabled the code to do it. Another problem was that no one knew whether YV12 was supposed to correspond to MPEG-1 chroma positioning (centered) or MPEG-2 chroma positioning (coaligned). Gimme details and a test case, and maybe I can turn it on for 1.4.11.
As for YV12 support in the filter chain, sorry -- that's a nastier problem because the bitmap addressing can't handle three coupled planes of different sizes. Adding a flag won't cut it.
|
 |
| fccHandler |
| Posted: Oct 26 2002, 02:48 AM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
Thanks, phaeron, for your input! You're right, of course. Maybe sh0dan could interleave the data as YYYYUV, but then odd pixels won't be DWORD-aligned. (That's partly why I wanted to use YUY2 in my original idea.)
-------------------- May the FOURCC be with you... |
 |
| sh0dan |
| Posted: Oct 28 2002, 07:37 AM |
 |
|
Avisynth Developer
  
Group: Vdubmod Alpha Testing Team
Posts: 41
Member No.: 327
Joined: 20-September 02

|
Thanks for the info!
As for the chroma positioning, we are going for the MPEG-2 scheme (chroma below left pixel). Most of out sources are MPEG 2, so this would make the most sense. This is also the most sensible, as we're also dealing with YUY2 data.
Xvid accepts YV12, for both compression and decompression. Futhermore, many directshow filters are very happy to deliver in YV12. Also the MPEG2 decoders decode to YV12 or I420, which is now converted to YUY2. So we have many sources, and both Xvid and DivX5 accepts YV12. Two very often used destination formats.
I'm not thinking about YV12 in the filter chain. I know it wouldn't make any sense. I have had the "pleasure" of changing internal structures to support planar images, so I know this isn't something you do overnight  What I'm thinking about is an internal YV12 to RGB32 conversion, so that Vdub would be able to preview (without directdraw) and even using the full processing mode. This would enable users to open YV12 files in Vdub without a decompressor inbetween (DivX 5 acts as a YV12 decompressor now, but having DivX5 as a requirement is not that good IMO).
I know Xvid has a fast "yv12_to_rgb32" converter. Would it make sense to put this into VDub?
|
 |
| fccHandler |
| Posted: Oct 28 2002, 03:29 PM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
Peek into VirtualDub's own mpeg_decode.cpp for some (very fast) functions that convert MPEG 4:2:0 to RGB32. This may be all you need.
-------------------- May the FOURCC be with you... |
 |
| Morsa |
| Posted: Oct 29 2002, 02:18 AM |
 |
|
Moderator of the Vdub support board
  
Group: Moderators
Posts: 640
Member No.: 246
Joined: 9-September 02

|
By the way, could someone with programming skills release Deblock and Dering capabilities of ffdshow and Add noise from ffdshow as two Vdub filters? Not trying to annoy you guys, just I don´t know enough C++. |
 |
| fccHandler |
| Posted: Oct 29 2002, 04:00 AM |
 |
|
Administrator n00b
  
Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02

|
Deconvolution, Lanczos Interpolation, Deblock, Dering, Add Noise... ...anything else you need?
(just kidding)
Man, you really should learn C++. Your ideas are really good, and I think you could be one of the supreme VDub filter writers! Keep those ideas coming. I learn something new almost every time you post!
-------------------- May the FOURCC be with you... |
 |
| sh0dan |
| Posted: Oct 29 2002, 04:38 PM |
 |
|
Avisynth Developer
  
Group: Vdubmod Alpha Testing Team
Posts: 41
Member No.: 327
Joined: 20-September 02

|
@Morsa: Dering/Deblock is still linked to some part of an MPEG decoder, since it needs the quantizers to know how much it should dering/deblock the current macroblock. Use Marc FD's MPEG2DEC PP. is you're using an Mpeg2 source - it has postprocessing.
Noise is very easy to do, but why would you use that in Vdub (whatever you do, it isn't a good idea to add noise before compressing your source).
Lanczos is a part of AviSynth 2.06. There should also be a Vdub filter, but I haven't tested it. I seem to remember it being posted in this forum. You'd have to search for it though.
@All: Back to YV12! I'm not interested in beginning coding for yet another project, or maintaining a Vdub clone. I'm just interested in how people experienced with vdub sees this, and if it is something that is realistic to get into Vdub? |
 |
| Morsa |
| Posted: Oct 29 2002, 11:27 PM |
 |
|
Moderator of the Vdub support board
  
Group: Moderators
Posts: 640
Member No.: 246
Joined: 9-September 02

|
"Add noise" Cause many people asked about a film look filter. I mainly use Vdub for Video filtering, not for compressing it. So, we've got deinterlacing, we've got gamma, the only thing we lack of is Add noise.
Usefull link:
http://restoreinpaint.sourceforge.net/example.htm
Last post about this topic.Return to YU12.
|
 |
| Hypatian |
| Posted: Oct 30 2002, 02:48 AM |
 |
|
Unregistered

|
I've actually considered using some sort of "add noise" filter to "bury" artifacts when re-encoding from one lossy item to another. I don't know if this would work, because at the moment DirectShowSource isn't working for me in avisynth, so I can't pump ffdshow's noised video into anything.
Other than that possible use (which I have not tested), it does seem silly to introduce noise in anything other than playback. |
 |
| Morsa |
| Posted: Oct 30 2002, 06:51 AM |
 |
|
Moderator of the Vdub support board
  
Group: Moderators
Posts: 640
Member No.: 246
Joined: 9-September 02

|
Hypathian: I 'm gonna say it again: Add noise not to recompress, add noise to give a filmlook. A noise pattern as if it were film grain, of course. I know very well that lossy compression doesn't like noise. If it were such a silly thing, there wouldn't be shitty Premiere plugins for that task (FilmFX,etc). Virtualdub isn't only meant to compress video, it is a powerfull filter and processing video tool. Regards.
shOdan: I've tested Lanczos filter for Vdub and is really good, that's why I want it inside Smartresize filter.
|
 |