ConvertStacked

From Avisynth wiki
(Difference between revisions)
Jump to: navigation, search
Line 13: Line 13:
 
<div style="max-width:42em" >
 
<div style="max-width:42em" >
 
*In '''[[Stack16]]''', the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.
 
*In '''[[Stack16]]''', the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in [[Dither tools]] and many others.
*the '''Double-Width''' is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&nbsp;verify]].
+
*the '''Double-Width''' is similar to Stack16, but the MSBs and LSBs are horizontally ''interleaved'' which is like Native HBD, and it's faster than lsb. the known examples of it existing in [[flash3kyuu_deband]]\F3kdb\f3kdb_dither with input/output_Mode=2, [[LSMASHSource]] (not in the last updates since it support HBD) and some dither package functions like [[Dither_out()]], [[TODO|TODO:&nbsp;verify]].
 
</div>
 
</div>
  
Line 20: Line 20:
 
<div style="max-width:62em" >
 
<div style="max-width:62em" >
  
Accepts a 16-bit clip and returns a stacked 8-bit clip.<br>
+
Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.<br>
 
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}}<br>
 
{{FuncDef|ConvertToStacked(clip ''clip'' ] )}}<br>
 +
same as above but returns a Double-Width 8-bit clip.<br>
 
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}}
 
{{FuncDef|ConvertToDoubleWidth(clip ''clip'' ] )}}
  
Line 28: Line 29:
  
  
Accepts a stacked 8-bit clip and returns a HBD clip.<br>
+
Accepts a stacked/Double-Width clip and returns a HBD clip.<br>
 
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}}<br>
 
{{FuncDef|ConvertFromStacked(clip ''clip'', int ''bits'' ] )}}<br>
 
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}}
 
{{FuncDef|ConvertFromDoubleWidth(clip ''clip'', int ''bits'' ] )}}
Line 39: Line 40:
 
<div {{BoxWidthIndent|46|4}} >
 
<div {{BoxWidthIndent|46|4}} >
 
  ## Decoding 10bit, YUV 4:2:0 source
 
  ## Decoding 10bit, YUV 4:2:0 source
  [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](<''path''>, stacked=true, format="YUV420P10")
+
  [[LSMASHSource/LWLibavVideoSource|LWLibavVideoSource]](<''path''>, stacked=true, format="YUV420P10") #this is not needed nowadays since LSMASHSource add HBD support
 
  '''ConvertFromStacked'''(bits=10)
 
  '''ConvertFromStacked'''(bits=10)
 
  [[ConvertBits]](8, dither=0) ## '0' means on, '-1' means off
 
  [[ConvertBits]](8, dither=0) ## '0' means on, '-1' means off

Revision as of 07:11, 13 September 2019

AVS+
This feature is specific to AviSynthPlus.

It is not supported in other AviSynth versions.

Contents


These conversion filters are to allow filters that use 16-bit video in a pseudo-8-bit colorspace to interact with AviSyth+ high bit depth formats. They are intended to serve as a stopgap until more plugins appear supporting true high bit depth.


Notes

  • In Stack16, the picture is made of two parts: one containing the highest 8 bits (MSB) for each pixel, stacked on top of another containing the lowest 8 bits (LSB). it's used in Dither tools and many others.
  • the Double-Width is similar to Stack16, but the MSBs and LSBs are horizontally interleaved which is like Native HBD, and it's faster than lsb. the known examples of it existing in flash3kyuu_deband\F3kdb\f3kdb_dither with input/output_Mode=2, LSMASHSource (not in the last updates since it support HBD) and some dither package functions like Dither_out(), TODO: verify.


Syntax and Parameters

Accepts a 16-bit (HBD) clip and returns a stacked 8-bit clip.
ConvertToStacked(clip clip ] )
same as above but returns a Double-Width 8-bit clip.
ConvertToDoubleWidth(clip clip ] )

clip  clip =
Source clip. Must be native 16 bit: YUV420P16, YUV422P16, YUV444P16, Y16.


Accepts a stacked/Double-Width clip and returns a HBD clip.
ConvertFromStacked(clip clip, int bits ] )
ConvertFromDoubleWidth(clip clip, int bits ] )

clip  clip =
Source clip. Must be YV12, YV16, YV24 or Y8.
int  bits = 16
Bit depth of returned clip. Must match the original bit depth. For example,
## Decoding 10bit, YUV 4:2:0 source
LWLibavVideoSource(<path>, stacked=true, format="YUV420P10") #this is not needed nowadays since LSMASHSource add HBD support
ConvertFromStacked(bits=10)
ConvertBits(8, dither=0) ## '0' means on, '-1' means off
another example of Stack16/lsb,
## some 16bit HBD clip here
ConvertToStacked()
Dfttest(lsb_in=true, lsb=true)
ConvertFromStacked()
## Continue filtering with 16bit HBD


Double-Width example,
## 10bit clip here
ConvertBits(16, truerange=false)
ConvertToDoubleWidth()
F3KDB(Input_Mode=2,Input_Depth=10,Output_Mode=2,Output_Depth=10)
ConvertFromDoubleWidth(bits=10)


Changes

20170310 r2440 first added
Personal tools