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. |
26th March 2012, 18:36 | #1 | Link |
Registered User
Join Date: Feb 2012
Posts: 13
|
Avisynth and YV12/NV12
Hey everyone, my issue is kinda wierd, but I'll try to explain it clearly. I like to use the avisynth based frameinterpolation software called "SVP".
My chain goes like this: LAV filters --> ffdshow raw filter --> madVR Now, it seems that avisynth only accepts YV12 input, does this mean, that if LAV filters outputs NV12 to ffdshow, that ffdshow automaticly changes it to YV12 for avisynth, and then back again to NV12 for madVR? Since NV12 input is reported from madVR. Does this mean that I should force YV12 output from LAV to get max performance? What are the differences between the two color spaces? Also completely unrelated: When LAV filters used CUVID for decoding, does it only get back NV12 color space, which it has to change to YV12 for avisynth? Or does CUVID also supply YV12? |
26th March 2012, 18:59 | #2 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
|
The difference between NV12 and YV12 is just how the bytes are arranged in memory, the image information is otherwise 100% the same.
CUVID always outputs NV12.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders |
26th March 2012, 20:40 | #4 | Link |
Registered User
Join Date: Apr 2002
Location: Germany
Posts: 4,926
|
it costs a fraction of it though NV12 highers throughput on the GPU side and their the major differences take place
__________________
all my compares are riddles so please try to decipher them yourselves :) It is about Time Join the Revolution NOW before it is to Late ! http://forum.doom9.org/showthread.php?t=168004 |
15th May 2012, 11:15 | #5 | Link |
Registered User
Join Date: Nov 2010
Posts: 80
|
Thanks for this information! I have the same setup and the same question[s]. So to clarify: when using aviSynth, I should use YV12 throughout since aviSynth cannot work with NV12? This avoids the unnecessary conversion between that and madVR.
Conversely, if I am not using aviSynth in a particular preset, I should use NV12? I have a fast computer, so I noticed no problems with computer processing resources. Therefore, is it even worth changing this every-time I decide to use aviSynth or not? (I read that NV12 is more compatible with GPU HW (such as madVR HW deinterlacing) but it also appears that However, most of the time I do not do this ( and handle the de-interlacing farther up the filter graph.) Since performance is not a problem, my main concern is this: Do these conversions work like "evil" trans-codes on pre-decoded [audio] material such as switching around from mp3/aac and back again? (In that case data is most likely lost.) From what I gather, the answer is "no" with YV12 <> NV12 uncompressed color-spaces. However, IMHO it just "feels" right to make as few unnecessary colorspace changes. To summarize: With aviSynth: Lav Decoder outputs YV12 ->ffdShow running aviSynth in YV12 -> madVR rendering YV12 Without aviSynth: LAV Decoder outputs NV12 -> ffdshow optional (no change bc not using the aviSynth filter module) -> madVR rendering NV12 Is this correct, or are my tweaks/assumptions incorrect? Any advice wouild be greatly appreciated! ...thanks in advance! MikeY |
15th May 2012, 11:27 | #6 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
|
NV12 and YV12 are the same colorspace, its just different memory layout. There is absolutely zero loss of information when you convert between them. If done right (say with some SSE2), its also plenty fast.
Hardware decoders output NV12, Software decoders typically YV12. Hardware deinterlacing requires NV12 on most cards. All of the components in your setup above should be capable to convert between YV12 and NV12 with the proper speed and without losing information. I don't know how ffdshow works, maybe you can just let LAV always output NV12 and if avisynth is on, ffdshow converts it to YV12 for you?
__________________
LAV Filters - open source ffmpeg based media splitter and decoders |
16th May 2012, 00:45 | #7 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Avisynth accepts both YV12 and I420 interchangeably. Internally the U and V data pointers are simply swapped to accommodate the chroma data order difference.
:edit: Wrong! "NV12 is Nvidia's proprietary name for Intel's I420 format. Apart from the name they are the same." Last edited by IanB; 17th May 2012 at 00:03. Reason: Retract delusional statement |
16th May 2012, 07:05 | #9 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,348
|
The "NV" does not mean NVIDIA.....
Not to mention that both AMD and Intel also require NV12 when doing hardware processing
__________________
LAV Filters - open source ffmpeg based media splitter and decoders |
17th May 2012, 00:01 | #10 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Oops, I am remembering very badly. In March and April 1999 Nvidia registered a number of NV* fourcc's but not NV12.
and Oops, yes NV12 is indeed a 2 plane format with the Y channel in the 1st plane and interleaved U and V channels in the 2nd plane. There is apparently a related format NV21 which has the U and V channels swapped. The information content is the same as for YV12 just the in memory layout is different. |
|
|