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. |
16th November 2012, 21:33 | #1 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 713
|
fmtconv: resize, bitdepth and colorspace conversions
Here is another plug-in for Vapoursynth.
>>> fmtconv-r30.zip <<< Fmtconv is a format-conversion plug-in for the Vapoursynth and Avisynth+ video processing engines. It does:
Supports:
Fmtconv is focussed primarily on quality and exactness rather than execution speed. This does not mean it is slow or unoptimized, but fmtconv is clearly not on par with the fastest equivalent 8-bit filters. The full documentation is included in the zip file. New requirement from r29: Vapoursynth r55 or above (support for API v4 only). If you’re curious, you’ll see undocumented functions in this plug-in. However they are temporary and will be removed later or moved to another plug-in, so please don’t use them. Source code is also available as Git repository. Last edited by cretindesalpes; 2nd August 2024 at 11:17. Reason: URL update |
16th November 2012, 22:32 | #3 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 713
|
The stacked stuff is only meant to offer interoperability with Avisynth plug-ins, before they all get ported.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
16th November 2012, 23:26 | #5 | Link |
契約者
Join Date: Jun 2008
Posts: 1,576
|
Here it comes first question from someone who have no clue about this plugin.
With it can I convert lets say 320x2 (or 2x320) YV12 clip into 320x2 YV24 and without rising bitdepth? For example 8bit in - 8 bit calculation - 8 bit out, not 8-16-8 Edit: i'm not an expert on YCgCo, does current implementation offers lossless conversion to and from RGB? Last edited by Keiyakusha; 16th November 2012 at 23:38. |
16th November 2012, 23:36 | #7 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 713
|
Keiyakusha: no it's not possible. All the resizing calculations are done in float anyway so in the end a bitdepth conversion has to be done (if you don't want a float clip).
I haven't tested if the YCgCo can restore lossless RGB. It would need at least 9 bits in theory.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
16th November 2012, 23:47 | #8 | Link | |
契約者
Join Date: Jun 2008
Posts: 1,576
|
Quote:
This rises another question. Is it possible to estimate how big is speed difference between similar colorspace (or some other) conversions (8bit in - 8bit out) using this plugin compared to avisynth? (assuming everything is done in 1 thread) Last edited by Keiyakusha; 16th November 2012 at 23:54. |
|
17th November 2012, 00:02 | #9 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 713
|
Therefore this plug-in is most likely not for you. It’s much slower than the Avisynth resizers. You can check the speed difference by setting only one thread in vapoursynth (use core = vs.Core (threads=1) ) and do a benchmark with a simple blankclip as input. Or you can do everything in Avisynth, using Dither_resize16 which uses the same algorithms and should give a comparable speed, making sure that avstp is disabled (call avstp_set_threads(1) at the end of the script).
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
17th November 2012, 00:04 | #10 | Link | |
Professional Code Monkey
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,595
|
Quote:
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet |
|
17th November 2012, 00:11 | #11 | Link |
契約者
Join Date: Jun 2008
Posts: 1,576
|
Thanks for your answers. I kind of expected this answer but had to make sure. I mainly asked because right now using vapoursynth's internal resizer it seem to be impossible to do 320x2 YV12 -> 320x2 YV24 (and back) at all. (or Yv12->rgb, or whatever). And color conversion seems to be not included in separate plugin with internal avisynth functions. Thus right now I have to use ffms2 in avisynth, do conversions there and only then pass this to vapoursynth... (using awesome plugin by Chikuzen). Unless I missed something.
Last edited by Keiyakusha; 17th November 2012 at 03:39. |
17th November 2012, 00:24 | #12 | Link | |
Registered User
Join Date: Nov 2004
Location: Poland
Posts: 2,854
|
Quote:
a= take 10bit HD file and scale at 8bit to SD. b= take 10bit HD file, dither it and scale to SD (at 8bit). c= take same file scale at 10bit to SD and than dither. There is actually quite visible difference in all of them, but I was surprised that even b and c show visible difference. I though that there will be no real difference, but there is. Just a not- we're talking about proper 10bit source- eg shot on RED, Alexa etc cmera. |
|
17th November 2012, 00:48 | #13 | Link | |
契約者
Join Date: Jun 2008
Posts: 1,576
|
Quote:
Last edited by Keiyakusha; 17th November 2012 at 01:26. |
|
17th November 2012, 12:28 | #14 | Link |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
A few questions:
1.) Does resample output 16 bit int or 32 bit float by default? 2.) "Bitdepth conversion with optional dithering." How do I know if dithering is on or off? 3.) Is "MPEG2" the default chroma placement? |
17th November 2012, 13:14 | #15 | Link | |||
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 713
|
Quote:
Quote:
- Reducing the bitdepth of integer data, or converting from float to integer - Doing a full-range ↔ TV-range conversion between integer formats, because the resulting values haven't an exact representation. Quote:
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding |
|||
17th November 2012, 13:26 | #16 | Link | |
Registered User
Join Date: Dec 2002
Posts: 5,565
|
Quote:
Where can we find info on the dithering algos? Is there any good comparison that keeps video encoding in mind? Or is "Filter Lite" generally a good idea? Last edited by sneaker_ger; 17th November 2012 at 13:30. |
|
17th November 2012, 14:09 | #17 | Link |
Registered User
Join Date: Aug 2006
Location: Stockholm/Helsinki
Posts: 807
|
Isn't YCgCo just YUV with different coefficients than 601 and 709? Because you're mentioning it as if it's an alternative to YUV.
And how do you use it? =) Thread title is wrong BTW, "ftmconv". |
17th November 2012, 14:39 | #18 | Link |
͡҉҉ ̵̡̢̛̗̘̙̜̝̞̟̠͇̊̋̌̍̎̏̿̿
Join Date: Feb 2009
Location: No support in PM
Posts: 713
|
sneaker_ger:
I’d say that keeping everything in 16 bit is sufficient, there is no need to use float. Float could be useful when working with linear light, because dark areas need more precision. Or when working with non-perceptually uniform colorspaces like CIE XYZ. Keeping a pipeline in float also avoids the conversion overhead, but the gain has to be balanced with the memory bandwidth doubling and related cache issues. For the dithering algorithms, you’ll find relevant information here: http://caca.zoy.org/wiki/libcaca/study/2 http://caca.zoy.org/wiki/libcaca/study/3 http://caca.zoy.org/wiki/libcaca/study/4 Filter Lite (Sierra 2-4A) is OK as a general purpose dither algorithm and is very similar to Floyd-Steinberg. Anyway if you want to dither to 8 bits before encoding to avoid colorbanding, you’ll probably prefer using ordered dithering. ajp_anton: Technically, YCgCo just is another linear combination of the RGB values into signals approximating perceptual luminance and chrominance. But the result is different enough to create another category. I think it’s suited more for encoding than for processing, as it is reported to compress a bit better than YUV. It is specified by MPEG-4 part 10 (H.264) but I think players and encoders supporting it are still rare. Thank you for the typo report, I’ll fix it.
__________________
dither 1.28.1 for AviSynth | avstp 1.0.4 for AviSynth development | fmtconv r30 for Vapoursynth & Avs+ | trimx264opt segmented encoding Last edited by cretindesalpes; 17th November 2012 at 20:50. Reason: Made links clickable |
Thread Tools | Search this Thread |
Display Modes | |
|
|