YV12To422: Difference between revisions
From Avisynth wiki
Jump to navigationJump to search
Raffriff42 (talk | contribs) redirect for convenient searching |
mNo edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{FilterCat5|External_filters|Plugins|Plugins_x64|Adjustment_filters|Colourspace_Conversion}} | |||
{{ | {{Filter3 | ||
|{{Author/Chikuzen}} | |||
|v1.0.2 | |||
|[https://github.com/chikuzen/YV12To422/releases YV12To422-1.0.2.zip] | |||
|Colourspace Conversion | |||
|[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | |||
|6=}} | |||
== Description == | |||
YV12To422 is an AviSynth filter plugin which based on YV12ToYUY2(ddcc.dll) written by Kevin Stone(a.k.a tritical) and was written from scratch. | |||
<br> | |||
<br> | |||
== Requirements == | |||
* [x86]: [[AviSynth+]] or [https://sourceforge.net/projects/avisynth2/ AviSynth 2.6] | |||
* [x64]: [[AviSynth+]] | |||
* Supported color formats: [[YUY2]], [[YV12]], [[YV16]] | |||
* SSE2 Capable CPU | |||
<br> | |||
* [https://www.microsoft.com/en-us/download/details.aspx?id=53587 Microsoft Visual C++ 2013 Redistributable Package (x86 / x64)] | |||
:<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>YV12To422-x86</tt> | |||
:<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>YV12To422-x64</tt> | |||
<br> | |||
== [[Script variables|Syntax and Parameters]] == | |||
:{{Template:FuncDef|YV12To422 (clip, bool "interlaced", int "itype", int "cplace", bool "lshift", bool "yuy2", bool "avx2", bool "threads", float "b", float "c")}} | |||
<br> | |||
::{{Par2| |clip| }} | |||
:::Input clip must be YV12. Output format is YUY2(default) or YV16. | |||
<br> | |||
::{{Par2|interlaced|bool|false}} | |||
:::Sets whether or not the input video is interlaced or progressive. | |||
:::Default: false | |||
<br> | |||
::{{Par2|itype|int|2}} | |||
:::Sets interpolation method. Possible settings: | |||
:::*0 : duplicate (nearest neighbor) | |||
:::*1 : linear interpolation | |||
:::*2 : Mitchell-Netravali two-part cubic interpolation (adjustable b/c parameters to adjust blurring/ringing) | |||
:::Default: 2 | |||
<br> | |||
::{{Par2|cplace|int| }} | |||
:::Specifies vertical chroma placement. Possible settings: | |||
<div style="margin-left: 6em; max-width: 67em"> | |||
<pre> | |||
progressive input (interlaced=false, progressive upsampling): | |||
0 - chroma is aligned with top line of each two line pair within the frame | |||
This would be the case if during 4:2:2 -> 4:2:0 conversion the chroma values of | |||
odd lines were simply dropped. | |||
1 - chroma is centered between lines of each two line pair within the frame | |||
(*** h261, h263, mpeg1, mpeg2, mpeg4, h264 standard progressive conversion) | |||
This would be the case if during 4:2:2 -> 4:2:0 conversion the chroma from every | |||
two line pair was averaged, or if an interlaced 4:2:2 -> 4:2:0 conversion was performed | |||
by using 75/25 averaging of top field pairs and 25/75 averaging of bottom field pairs. | |||
2 - chroma is aligned with top line of each two line pair within each field | |||
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by | |||
separating the fields, and then doing a 4:2:2 -> 4:2:0 conversion on each field | |||
by dropping odd line chroma values. | |||
3 - chroma is centered between lines of each two line pair within each field | |||
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by | |||
separating the fields, and then doing a 4:2:2 -> 4:2:0 conversion on each field | |||
by averaging chroma from every two line pair. | |||
interlaced input (interlaced=true, interlaced upsampling): | |||
0 - chroma is aligned with top line of each two line pair within each field | |||
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by | |||
separating the fields, and then doing a 4:2:2 -> 4:2:0 conversion on each field | |||
by dropping odd line chroma values. | |||
1 - chroma is centered between lines of each two line pair within each field | |||
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by | |||
separating the fields, and then doing a 4:2:2 -> 4:2:0 conversion on each field | |||
by averaging chroma from every two line pair. | |||
2 - top field chroma is 1/4 pixel below even lines in the top field, and | |||
bottom field chroma is 1/4 pixel above odd lines in the bottom field. | |||
(*** mpeg2, mpeg4, h264 standard interlaced conversion) | |||
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by | |||
averaging top field pairs using 75/25 weighting, and averaging bottom field | |||
pairs using 25/75 weighting. This results in the same chroma placement as | |||
progressive cplace option 1. | |||
3 - U is aligned with top line of each two line pair within each field, and | |||
V is aligned with bottom line of each pair within each field. | |||
(*** DV-PAL standerd interlaced conversion) | |||
** Progressive option 1 and interlaced option 2 are actually the same in terms of | |||
chroma placement. If a progressive frame was converted to yv12 using interlaced | |||
method 2, then it is safe (actually better) to convert it to yuy2 using progressive | |||
method 1. However, if a progressive frame was converted to yv12 using a different | |||
type of interlaced sampling, resulting in different chroma placement (such as those | |||
described by interlaced options 0 or 1), then it is best to convert it to yv16/yuy2 | |||
using progressive upsampling, but with the cplace option that correctly specifies | |||
the positioning of the chroma. | |||
default: 1 (if interlaced = false) | |||
2 (if interlaced = true) | |||
</pre> | |||
</div> | |||
<br> | |||
::{{Par2|lshift|bool|false}} | |||
:::If set this to true, chroma placement will shift to 1/4 sample to the left. | |||
:::*Default: false | |||
<br> | |||
::{{Par2|yuy2|bool|true}} | |||
:::Sets whether or not the output video format is packed(YUY2) or planar(YV16). | |||
:::Default: true (YUY2 output) | |||
<br> | |||
::{{Par2|avx2|bool|false}} | |||
:::Sets whether AVX2 is used or not. | |||
:::Default: false (use SSE2) | |||
<div style="margin-left: 6em; max-width: 67em"> | |||
<pre> | |||
** Currentry, AviSynth 2.60 can't make memory alignment anything but 16bytes. | |||
Thus, if you use AviSynth 2.60, you shouldn't to set this true. | |||
AviSynth+ has no problem. | |||
see https://github.com/AviSynth/AviSynthPlus/commit/ab4ea303b4ca78620c2ef90fdaad184bc18b7708 | |||
</pre> | |||
</div> | |||
<br> | |||
::{{Par2|threads|bool|false}} | |||
:::When sets this to true, V-plain is processed with a different thread at the same time with U-plain. However, processing doesn't always become speedy by this. | |||
:::Default: false (use single thread) | |||
<br> | |||
::{{Par2|b|float|0.0}} | |||
::{{Par2|C|float|0.75}} | |||
:::Adjusts properties of cubic interpolation (itype=2). Same as AviSynth's BicubicResize filter. | |||
:::default: 0.0,0.75 | |||
<br> | |||
== Examples == | |||
[[TODO]] | |||
<br> | |||
<br> | |||
==External Links == | |||
*[https://github.com/chikuzen/YV12To422 GitHub] - Source code repository. | |||
<br> | |||
<br> | |||
----------------------------------------------- | |||
'''Back to [[External_filters#Colourspace_Conversion|External Filters]] ←''' | |||
Latest revision as of 15:37, 25 May 2020
| Abstract | |
|---|---|
| Author | Chikuzen |
| Version | v1.0.2 |
| Download | YV12To422-1.0.2.zip |
| Category | Colourspace Conversion |
| License | GPLv2 |
| Discussion | |
Description
YV12To422 is an AviSynth filter plugin which based on YV12ToYUY2(ddcc.dll) written by Kevin Stone(a.k.a tritical) and was written from scratch.
Requirements
- [x86]: AviSynth+ or AviSynth 2.6
- [x64]: AviSynth+
- Supported color formats: YUY2, YV12, YV16
- SSE2 Capable CPU
- *** vcredist_x86.exe is required for YV12To422-x86
- *** vcredist_x64.exe is required for YV12To422-x64
- YV12To422 (clip, bool "interlaced", int "itype", int "cplace", bool "lshift", bool "yuy2", bool "avx2", bool "threads", float "b", float "c")
- clip =
- Input clip must be YV12. Output format is YUY2(default) or YV16.
- clip =
- bool interlaced = false
- Sets whether or not the input video is interlaced or progressive.
- Default: false
- bool interlaced = false
- int itype = 2
- Sets interpolation method. Possible settings:
- 0 : duplicate (nearest neighbor)
- 1 : linear interpolation
- 2 : Mitchell-Netravali two-part cubic interpolation (adjustable b/c parameters to adjust blurring/ringing)
- Default: 2
- Sets interpolation method. Possible settings:
- int itype = 2
- int cplace =
- Specifies vertical chroma placement. Possible settings:
- int cplace =
progressive input (interlaced=false, progressive upsampling):
0 - chroma is aligned with top line of each two line pair within the frame
This would be the case if during 4:2:2 -> 4:2:0 conversion the chroma values of
odd lines were simply dropped.
1 - chroma is centered between lines of each two line pair within the frame
(*** h261, h263, mpeg1, mpeg2, mpeg4, h264 standard progressive conversion)
This would be the case if during 4:2:2 -> 4:2:0 conversion the chroma from every
two line pair was averaged, or if an interlaced 4:2:2 -> 4:2:0 conversion was performed
by using 75/25 averaging of top field pairs and 25/75 averaging of bottom field pairs.
2 - chroma is aligned with top line of each two line pair within each field
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by
separating the fields, and then doing a 4:2:2 -> 4:2:0 conversion on each field
by dropping odd line chroma values.
3 - chroma is centered between lines of each two line pair within each field
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by
separating the fields, and then doing a 4:2:2 -> 4:2:0 conversion on each field
by averaging chroma from every two line pair.
interlaced input (interlaced=true, interlaced upsampling):
0 - chroma is aligned with top line of each two line pair within each field
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by
separating the fields, and then doing a 4:2:2 -> 4:2:0 conversion on each field
by dropping odd line chroma values.
1 - chroma is centered between lines of each two line pair within each field
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by
separating the fields, and then doing a 4:2:2 -> 4:2:0 conversion on each field
by averaging chroma from every two line pair.
2 - top field chroma is 1/4 pixel below even lines in the top field, and
bottom field chroma is 1/4 pixel above odd lines in the bottom field.
(*** mpeg2, mpeg4, h264 standard interlaced conversion)
This would be the case if the 4:2:2 -> 4:2:0 conversion was performed by
averaging top field pairs using 75/25 weighting, and averaging bottom field
pairs using 25/75 weighting. This results in the same chroma placement as
progressive cplace option 1.
3 - U is aligned with top line of each two line pair within each field, and
V is aligned with bottom line of each pair within each field.
(*** DV-PAL standerd interlaced conversion)
** Progressive option 1 and interlaced option 2 are actually the same in terms of
chroma placement. If a progressive frame was converted to yv12 using interlaced
method 2, then it is safe (actually better) to convert it to yuy2 using progressive
method 1. However, if a progressive frame was converted to yv12 using a different
type of interlaced sampling, resulting in different chroma placement (such as those
described by interlaced options 0 or 1), then it is best to convert it to yv16/yuy2
using progressive upsampling, but with the cplace option that correctly specifies
the positioning of the chroma.
default: 1 (if interlaced = false)
2 (if interlaced = true)
- bool lshift = false
- If set this to true, chroma placement will shift to 1/4 sample to the left.
- Default: false
- If set this to true, chroma placement will shift to 1/4 sample to the left.
- bool lshift = false
- bool yuy2 = true
- Sets whether or not the output video format is packed(YUY2) or planar(YV16).
- Default: true (YUY2 output)
- bool yuy2 = true
- bool avx2 = false
- Sets whether AVX2 is used or not.
- Default: false (use SSE2)
- bool avx2 = false
** Currentry, AviSynth 2.60 can't make memory alignment anything but 16bytes.
Thus, if you use AviSynth 2.60, you shouldn't to set this true.
AviSynth+ has no problem.
see https://github.com/AviSynth/AviSynthPlus/commit/ab4ea303b4ca78620c2ef90fdaad184bc18b7708
- bool threads = false
- When sets this to true, V-plain is processed with a different thread at the same time with U-plain. However, processing doesn't always become speedy by this.
- Default: false (use single thread)
- bool threads = false
- float b = 0.0
- float C = 0.75
- Adjusts properties of cubic interpolation (itype=2). Same as AviSynth's BicubicResize filter.
- default: 0.0,0.75
- float b = 0.0
Examples
External Links
- GitHub - Source code repository.
Back to External Filters ←