Nnedi3ocl/nnedi3ocl

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
m (format back-link to match other sub-page)
m (formatting (again))
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
 +
{{FilterCat4|External_filters|Plugin_functions|Restoration_filters|Deinterlacers}}
 
'''Back to [[nnedi3ocl#Filters|nnedi3ocl]] ←'''
 
'''Back to [[nnedi3ocl#Filters|nnedi3ocl]] ←'''
 
+
--------------------------------------------------
 +
<br>
 +
== Description ==
 +
nnedi3ocl is an intra-field only deinterlacer. It takes in a frame, throws away one field, and then interpolates the missing pixels using only information from the kept field. It has same rate and double rate modes, and works with [[Y8]], [[YV12]], [[YV16]], and [[YV24]] input.
 +
<br>
 +
<br>
 
== [[Script variables|Syntax and Parameters]] ==
 
== [[Script variables|Syntax and Parameters]] ==
 
:{{Template:FuncDef|nnedi3ocl (''clip'', ''int'' "field", ''bool'' "dh", ''bool'' "Y", ''bool'' "U", ''bool'' "V", ''int'' "nsize", ''int'' "nns", ''int'' "qual", ''int'' "etype", ''int'' "dw")}}
 
:{{Template:FuncDef|nnedi3ocl (''clip'', ''int'' "field", ''bool'' "dh", ''bool'' "Y", ''bool'' "U", ''bool'' "V", ''int'' "nsize", ''int'' "nns", ''int'' "qual", ''int'' "etype", ''int'' "dw")}}
 
<br>
 
<br>
 
::{{Par2| |clip| }}
 
::{{Par2| |clip| }}
::<blockquote style="width: 27%;">Input clip must be [[planar]].</blockquote>
+
:::Input clip must be [[planar]].
 
<br>
 
<br>
 
::{{Par2|field|int|-1}}
 
::{{Par2|field|int|-1}}
::<blockquote style="width: 27%;">Controls the mode of operation (double vs same rate) and which field is kept. Possible settings:</blockquote>
+
:::Controls the mode of operation (double vs same rate) and which field is kept.  
 +
:::Possible settings:<br>
  
 
::::*-2 = double rate (alternates each frame), uses avisynth's internal parity value to start
 
::::*-2 = double rate (alternates each frame), uses avisynth's internal parity value to start
Line 17: Line 24:
 
::::*3 = double rate (alternates each frame), starts with top
 
::::*3 = double rate (alternates each frame), starts with top
  
::<blockquote style="width: 54.5%;">If {{Template:FuncDef|field}} is set to -1, then nnedi3ocl calls child->GetParity(0) during initialization. If it returns true, then {{Template:FuncDef|field}} is set to 1. If it returns false, then {{Template:FuncDef|field}} is set to 0. If {{Template:FuncDef|field}} is set to -2, then the same thing happens, but instead of setting {{Template:FuncDef|field}} to 1 or 0 it is set to 3 or 2.</blockquote>
+
:::If {{Template:FuncDef|field}} is set to -1, then nnedi3ocl calls child->GetParity(0) during initialization. If it returns true, then {{Template:FuncDef|field}} is set to 1. If it returns false, then {{Template:FuncDef|field}} is set to 0.
 +
:::If {{Template:FuncDef|field}} is set to -2, then the same thing happens, but instead of setting {{Template:FuncDef|field}} to 1 or 0 it is set to 3 or 2.
  
::<blockquote style="width: 100%;">&bull; Default for {{Template:FuncDef|field}} is the value of {{Template:FuncDef|dw}}.</blockquote>
+
:::* Default for {{Template:FuncDef|field}} is the value of {{Template:FuncDef|dw}}.
 
<br>
 
<br>
 
::{{Par2|dh|bool|false}}
 
::{{Par2|dh|bool|false}}
::<blockquote style="width: 55%;">Doubles the height of the input. Each line of the input is copied to every other line of the output and the missing lines are interpolated. If {{Template:FuncDef|field}}=0, the input is copied to the odd lines of the output. If {{Template:FuncDef|field}}=1, the input is copied to the even lines of the output.</blockquote>
+
:::Doubles the height of the input. Each line of the input is copied to every other line of the output and the missing lines are interpolated.  
 +
:::If {{Template:FuncDef|field}}=0, the input is copied to the odd lines of the output. If {{Template:FuncDef|field}}=1, the input is copied to the even lines of the output.  
  
::<blockquote style="width: 21%;"> &bull; {{Template:FuncDef|field}} must be set to either -1, 0, or 1 when using {{Template:FuncDef|dh}}=true. &bull; Default for {{Template:FuncDef|dh}} is false when {{Template:FuncDef|dw}}=-1 and true otherwise.</blockquote>
+
:::* {{Template:FuncDef|field}} must be set to either -1, 0, or 1 when using {{Template:FuncDef|dh}}=true.
 +
:::* Default for {{Template:FuncDef|dh}} is false when {{Template:FuncDef|dw}}=-1 and true otherwise.
 
<br>
 
<br>
 
::{{Par2|Y|bool|true}}
 
::{{Par2|Y|bool|true}}
 
::{{Par2|U|bool|true}}
 
::{{Par2|U|bool|true}}
 
::{{Par2|V|bool|true}}
 
::{{Par2|V|bool|true}}
::<blockquote style="width: 55%;">These control whether or not the specified plane is processed. Set to true to process or false to ignore. Ignored planes are not copied, zero'd, or even considered. So what the ignored planes happen to contain on output is unpredictable.</blockquote>
+
:::These control whether or not the specified plane is processed. Set to true to process or false to ignore.  
 +
:::Ignored planes are not copied, zero'd, or even considered. So what the ignored planes happen to contain on output is unpredictable.
 
<br>
 
<br>
 
::{{Par2|nsize|int|0}}
 
::{{Par2|nsize|int|0}}
::<blockquote style="width: 100%;">Sets the size of the local neighborhood around each pixel that is used by the predictor neural network.</blockquote>
+
:::Sets the size of the local neighborhood around each pixel that is used by the predictor neural network.
  
 
::::*0 -  8x6
 
::::*0 -  8x6
  
::<blockquote style="width: 100%;">Only {{Template:FuncDef|nsize}} 0 is implemented, other values are simply ignored.</blockquote>
+
:::Only {{Template:FuncDef|nsize}} 0 is implemented, other values are simply ignored.  
 
<br>
 
<br>
 
::{{Par2|nns|int|1}}
 
::{{Par2|nns|int|1}}
::<blockquote style="width: 55%;">Sets the number of neurons in the predictor neural network. Possible settings are 0, 1, 2, 3, and 4. 0 is fastest. 4 is slowest, but should give the best quality. This is a quality vs speed option; however, differences are usually small. The difference in speed will become larger as '{{Template:FuncDef|qual}}' is increased.</blockquote>
+
:::Sets the number of neurons in the predictor neural network. Possible settings are 0, 1, 2, 3, and 4. 0 is fastest. 4 is slowest, but should give the best quality.  
 +
:::This is a quality vs speed option; however, differences are usually small. The difference in speed will become larger as '{{Template:FuncDef|qual}}' is increased.
  
 
::::*0 - 16
 
::::*0 - 16
Line 48: Line 60:
 
<br>
 
<br>
 
::{{Par2|qual|int|1}}
 
::{{Par2|qual|int|1}}
::<blockquote style="width: 55%;">Controls the number of different neural network predictions that are blended together to compute the final output value. Each neural network was trained on a different set of training data. Blending the results of these different networks improves generalization to unseen data. Possible values are 1 or 2. Essentially this is a quality vs speed option. Larger values will result in more processing time, but should give better results. However, the difference is usually pretty small. I would recommend using {{Template:FuncDef|qual}}>1 for things like single image enlargement.</blockquote>
+
:::Controls the number of different neural network predictions that are blended together to compute the final output value.  
 +
:::Each neural network was trained on a different set of training data. Blending the results of these different networks improves generalization to unseen data.  
 +
:::Possible values are 1 or 2. Essentially this is a quality vs speed option. Larger values will result in more processing time, but should give better results.
 +
:::However, the difference is usually pretty small. I would recommend using {{Template:FuncDef|qual}}>1 for things like single image enlargement.
 
<br>
 
<br>
 
::{{Par2|etype|int|0}}
 
::{{Par2|etype|int|0}}
::<blockquote style="width: 1000%;">Controls which set of weights to use in the predictor nn. Possible settings:</blockquote>
+
:::Controls which set of weights to use in the predictor nn. Possible settings:
  
 
::::*0 - weights trained to minimize absolute error
 
::::*0 - weights trained to minimize absolute error
Line 57: Line 72:
 
<br>
 
<br>
 
::{{Par2|dw|int|-1}}
 
::{{Par2|dw|int|-1}}
::<blockquote style="width: 100%;">Controls scaling in horizontal direction:</blockquote>
+
:::Controls scaling in horizontal direction:  
  
 
::::*-1 - no scaling.
 
::::*-1 - no scaling.
Line 63: Line 78:
 
::::*1 - scales like {{Template:FuncDef|field}} 1 with {{Template:FuncDef|dh}}=true, but horizontally.
 
::::*1 - scales like {{Template:FuncDef|field}} 1 with {{Template:FuncDef|dh}}=true, but horizontally.
 
<br>
 
<br>
 +
 +
== Examples ==
 +
nnedi3ocl with default settings:
 +
[[AviSource]]("Blah.avi")
 +
nnedi3ocl(field=-1, dh=false, Y=true, U=true, V=true, nsize=6, nns=1, qual=1, etype=0, dw=-1)
 +
<br>
 +
<br>
 +
--------------------------------------------------------
 +
'''Back to [[nnedi3ocl#Filters|nnedi3ocl]] &larr;'''

Latest revision as of 19:14, 27 September 2014

Back to nnedi3ocl



[edit] Description

nnedi3ocl is an intra-field only deinterlacer. It takes in a frame, throws away one field, and then interpolates the missing pixels using only information from the kept field. It has same rate and double rate modes, and works with Y8, YV12, YV16, and YV24 input.

[edit] Syntax and Parameters

nnedi3ocl (clip, int "field", bool "dh", bool "Y", bool "U", bool "V", int "nsize", int "nns", int "qual", int "etype", int "dw")


clip   =
Input clip must be planar.


int  field = -1
Controls the mode of operation (double vs same rate) and which field is kept.
Possible settings:
  • -2 = double rate (alternates each frame), uses avisynth's internal parity value to start
  • -1 = same rate, uses avisynth's internal parity value
  • 0 = same rate, keep bottom field
  • 1 = same rate, keep top field
  • 2 = double rate (alternates each frame), starts with bottom
  • 3 = double rate (alternates each frame), starts with top
If field is set to -1, then nnedi3ocl calls child->GetParity(0) during initialization. If it returns true, then field is set to 1. If it returns false, then field is set to 0.
If field is set to -2, then the same thing happens, but instead of setting field to 1 or 0 it is set to 3 or 2.
  • Default for field is the value of dw.


bool  dh = false
Doubles the height of the input. Each line of the input is copied to every other line of the output and the missing lines are interpolated.
If field=0, the input is copied to the odd lines of the output. If field=1, the input is copied to the even lines of the output.
  • field must be set to either -1, 0, or 1 when using dh=true.
  • Default for dh is false when dw=-1 and true otherwise.


bool  Y = true
bool  U = true
bool  V = true
These control whether or not the specified plane is processed. Set to true to process or false to ignore.
Ignored planes are not copied, zero'd, or even considered. So what the ignored planes happen to contain on output is unpredictable.


int  nsize = 0
Sets the size of the local neighborhood around each pixel that is used by the predictor neural network.
  • 0 - 8x6
Only nsize 0 is implemented, other values are simply ignored.


int  nns = 1
Sets the number of neurons in the predictor neural network. Possible settings are 0, 1, 2, 3, and 4. 0 is fastest. 4 is slowest, but should give the best quality.
This is a quality vs speed option; however, differences are usually small. The difference in speed will become larger as 'qual' is increased.
  • 0 - 16
  • 1 - 32
  • 2 - 64
  • 3 - 128
  • 4 - 256


int  qual = 1
Controls the number of different neural network predictions that are blended together to compute the final output value.
Each neural network was trained on a different set of training data. Blending the results of these different networks improves generalization to unseen data.
Possible values are 1 or 2. Essentially this is a quality vs speed option. Larger values will result in more processing time, but should give better results.
However, the difference is usually pretty small. I would recommend using qual>1 for things like single image enlargement.


int  etype = 0
Controls which set of weights to use in the predictor nn. Possible settings:
  • 0 - weights trained to minimize absolute error
  • 1 - weights trained to minimize squared error


int  dw = -1
Controls scaling in horizontal direction:
  • -1 - no scaling.
  • 0 - scales like field 0 with dh=true, but horizontally.
  • 1 - scales like field 1 with dh=true, but horizontally.


[edit] Examples

nnedi3ocl with default settings:

AviSource("Blah.avi")
nnedi3ocl(field=-1, dh=false, Y=true, U=true, V=true, nsize=6, nns=1, qual=1, etype=0, dw=-1)




Back to nnedi3ocl

Personal tools