MPEG2DecPlus
m (→Description) |
m (Update the version) |
||
(7 intermediate revisions by one user not shown) | |||
Line 2: | Line 2: | ||
{{Filter3 | {{Filter3 | ||
|{{Author/Chikuzen}}, [https://github.com/Asd-g/MPEG2DecPlus asd-g] | |{{Author/Chikuzen}}, [https://github.com/Asd-g/MPEG2DecPlus asd-g] | ||
− | | | + | |1.3.0 |
− | |[https://github.com/Asd-g/MPEG2DecPlus/releases | + | |[https://github.com/Asd-g/MPEG2DecPlus/releases D2VSource-1.3.0.7z] |
|Source filters | |Source filters | ||
|[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | |[http://www.gnu.org/licenses/gpl-2.0.txt GPLv2] | ||
Line 10: | Line 10: | ||
== Description == | == Description == | ||
− | MPEG2DecPlus is a MPEG-1/2 decoder plug-in. | + | DV2Source (previously named as MPEG2DecPlus) is a MPEG-1/2 decoder plug-in. DV2Source is a project to modernize "[[DGDecode]].dll" for AviSynth+. |
<br> | <br> | ||
<br> | <br> | ||
Changes include: | Changes include: | ||
+ | * Function renamed to DV2Source | ||
* Code clean up and refactoring | * Code clean up and refactoring | ||
* Elimination of code that is not currently required, such as VFAPI code and YUY2 code. | * Elimination of code that is not currently required, such as VFAPI code and YUY2 code. | ||
* Support 64bit by removing assembly code, and optimization by intrinsic in SSE2 / AVX2. etc. | * Support 64bit by removing assembly code, and optimization by intrinsic in SSE2 / AVX2. etc. | ||
− | * LumaYUV: | + | * LumaYUV: function removed |
− | * DeBlock: function | + | * BlindPP: function removed |
− | * | + | * DeBlock: function removed, see standalone [[DeBlock]] plugin for up-to-date version. |
− | + | * DV2Source: <code>iPP, moderate_h, moderate_v, fastMC, and cpu2</code> parameters are removed. | |
+ | * Support for [[MPEG2DecPlus#Frame_properties | frame properties]] and [[MPEG2DecPlus#Exported variables|variables]]. | ||
<br> | <br> | ||
Line 28: | Line 30: | ||
* Supported color formats: [[YV12]], [[YV16]] | * Supported color formats: [[YV12]], [[YV16]] | ||
<br> | <br> | ||
+ | * [https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads Microsoft Visual C++ 2022 Redistributable Package (x86 / x64)] | ||
+ | :<span style="color:red">***</span> <tt>vcredist_x86.exe</tt> is required for <tt>DV2Source-x86</tt> | ||
+ | :<span style="color:red">***</span> <tt>vcredist_x64.exe</tt> is required for <tt>DV2Source-x64</tt> | ||
<br> | <br> | ||
− | |||
− | == | + | == [[Script variables|Syntax and Parameters]] == |
− | :{{Template:FuncDef| | + | :{{Template:FuncDef|D2VSource (string "d2v", int "idct", bool "showQ", int "info", int "upConv", bool "i420", bool "iCC", bool "nocrop", int "rff")}} |
<br> | <br> | ||
::{{Par2|d2v|string|""}} | ::{{Par2|d2v|string|""}} | ||
:::d2v file path [required]. Note: you can you DGIndex to create the d2v file. | :::d2v file path [required]. Note: you can you DGIndex to create the d2v file. | ||
:::'''Note:''' PATH can be ignored if the d2v file is in the same directory as your AviSynth (*.avs) script. | :::'''Note:''' PATH can be ignored if the d2v file is in the same directory as your AviSynth (*.avs) script. | ||
− | |||
− | |||
− | |||
<br> | <br> | ||
::{{Par2|idct|int|0}} | ::{{Par2|idct|int|0}} | ||
:::iDCT algorithm to use: | :::iDCT algorithm to use: | ||
− | + | :::*0 : as specified by the d2v file | |
− | + | :::*1,2,3,6,7 : AP922 integer (same as SSE2MMX). | |
− | + | :::*4 : SSE2 / AVX2 LLM (single precision floating point, SSE2 / AVX2 judgment is automatic). | |
− | + | :::*5 : IEEE 1180 reference (double precision floating point). | |
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2|showQ|bool|false}} |
− | ::: | + | :::Show Macroblock Quantizers. |
+ | :::*true : Show quantizers | ||
+ | :::*false : Do not show quantizers | ||
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2|info|int|0}} |
− | :: | + | :::Debug Information |
− | ::: | + | :::*0 : Do not generate debug information |
− | + | :::*1 : Overlay debug information on the video | |
− | :: | + | :::*2 : Output debug information via OutputDebugString() (check the contents with DebugView.exe) |
− | ::: | + | :::*3 : Output hints in the video (embed hints in 64 bytes in the upper left corner of the frame) |
<br> | <br> | ||
::{{Par2|upConv|int|0}} | ::{{Par2|upConv|int|0}} | ||
Line 63: | Line 66: | ||
:::*1 : up convert to YV16. | :::*1 : up convert to YV16. | ||
:::*2 : up convert to YV24. | :::*2 : up convert to YV24. | ||
+ | <br> | ||
+ | ::{{Par2|i420|bool|false}} | ||
+ | :::Output I420 Colorspace. Possibly required by some legacy applications. | ||
+ | :::Ignored if the input is not YV12 (4:2:0), or if upsampling with '''upConv'''=1 or 2. | ||
+ | :::*true : output [[I420]] | ||
+ | :::*false : output [[YV12]] | ||
<br> | <br> | ||
::{{Par2|iCC|bool|auto}} | ::{{Par2|iCC|bool|auto}} | ||
Line 68: | Line 77: | ||
:::MPEG2Source automatically uses the PROGRESSIVE_FRAME flag to switch between field/frame based upsampling on a per-frame-basis. | :::MPEG2Source automatically uses the PROGRESSIVE_FRAME flag to switch between field/frame based upsampling on a per-frame-basis. | ||
:::You should '''''only''''' specify the iCC parameter if you want to force DGDecode to use a particular upsampling mode. | :::You should '''''only''''' specify the iCC parameter if you want to force DGDecode to use a particular upsampling mode. | ||
− | + | :::*[unspecified] : follow the PROGRESSIVE_FRAME flag | |
− | + | :::*true : force field-based (interlaced) upsampling | |
− | + | :::*false : force frame-based (progressive) upsampling | |
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2|nocrop|bool|false}} |
− | ::: | + | :::Use direct-rendered buffer, which may need cropping. |
− | ::: | + | :::It could provide a speedup when you know you need to crop your image anyway, by avoiding extra memcpy calls. |
− | :::: | + | :::Default: False. |
− | + | ||
<br> | <br> | ||
− | ::{{Par2| | + | ::{{Par2|rff|int|-1}} |
− | ::: | + | :::Changes Field_Operation without the need of editing d2v or rescanning with different Field Operation. |
− | + | :::*0: Honor Pulldowns Flags. | |
− | + | :::*1: Forced Film. | |
− | + | :::*2: Ignored Pulldowns Flags. | |
− | :::: | + | :::Default: -1 - read the value from d2v. |
<br> | <br> | ||
− | + | ===Exported variables=== | |
− | + | ||
− | + | <code>FFSAR_NUM, FFSAR_DEN, FFSAR (these indicate Generic PAR)</code> | |
− | + | ||
<br> | <br> | ||
− | + | ===Frame properties=== | |
− | + | ||
− | + | ||
− | + | ||
− | === | + | |
− | + | ||
+ | <code>_AbsoluteTime [float]</code> | ||
+ | :The frame’s absolute timestamp in seconds. | ||
− | : | + | <code>_AspectRatio [int]</code> |
− | < | + | :An array giving the display aspect ratio. |
− | :: | + | |
− | ::: | + | <code>_ChromaLocation [int]</code> |
− | < | + | :Chroma sample position in YUV formats: 0=left, 1=center, 2=topleft, 3=top, 4=bottomleft, 5=bottom. |
− | :: | + | |
− | ::: | + | <code>_DurationNum [int], _DurationDen [int]</code> |
− | :: | + | :The frame’s duration in seconds as a rational number. |
− | < | + | |
− | :: | + | <code>_EncodedFrameTop [int], _EncodedFrameBottom [int]</code> |
− | ::: | + | :Frame number (before pulldown) used to generate this frame's top/bottom field. |
− | ::: | + | |
+ | <code>_FieldBased [int]</code> | ||
+ | :Describes the composition of the frame: | ||
+ | :*0=frame based (progressive), 1=bottom field first, 2=top field first. | ||
+ | :Note that the GOP progressive flag is used to determine whether the frame is progressive. | ||
+ | |||
+ | <code>v_FieldOperation [int]</code> | ||
+ | :Describes the field operation option in effect: | ||
+ | :*0=honor pulldown, 1=force film, 2=ignore pulldown. | ||
+ | |||
+ | <code>_FieldOrder [int]</code> | ||
+ | :Display field order of the frame: | ||
+ | :*0=bottom field first, 1=top field first. | ||
+ | |||
+ | <code>_Film [int]</code> | ||
+ | :Set if the frame is part of a 3:2 soft pulldown section. | ||
+ | :Note that this uses the RFF history of several preceding frames, and so is valid only when doing linear access. | ||
+ | |||
+ | <code>_GOPClosed [int]</code> | ||
+ | :Set if the current GOP is closed. | ||
+ | |||
+ | <code>_GOPNumber [int]</code> | ||
+ | :The 0-based GOP number that contains the frame. | ||
+ | :Note that if this is set as the value x, then propShow displays it as [x, y] where y is the 0-based frame number of the first frame in the GOP. | ||
+ | |||
+ | <code>_GOPPosition [int]</code> | ||
+ | :The GOP position field from the D2V file for the GOP containing the frame. | ||
+ | |||
+ | <code>_Matrix [int]</code> | ||
+ | :The matrix number field from the D2V file for the GOP containing the frame. | ||
+ | |||
+ | <code>_PictType [data]</code> | ||
+ | :A single character describing the frame type. | ||
+ | :It uses the common IPB characters but others may also be used for formats with additional frame types. | ||
+ | |||
+ | <code>_ProgressiveFrame [int]</code> | ||
+ | :Set if the progress_frame flag is set for this frame. | ||
+ | |||
+ | <code>_QuantsAverage [int]</code> | ||
+ | :The average quantizer value for the frame. | ||
+ | |||
+ | <code>_QuantsMax [int]</code> | ||
+ | :The maximum quantizer value for the frame. | ||
+ | |||
+ | <code>_QuantsMin [int]</code> | ||
+ | :The minimum quantizer value for the frame. | ||
+ | |||
+ | <code>_RFF [int]</code> | ||
+ | :If _FieldOperation is 2 (ignore pulldown) then _RFF describes whether the stream specifies that a repeat field operation is to be performed on this frame. | ||
+ | :If _FieldOperation is 0 (honor pulldown) or 1 (force film) then _RFF describes whether the frame was composed with field repetition. | ||
+ | |||
+ | <code>_SARDen [int]</code> | ||
+ | :The denominator of the "pixel size" (MPEG-4 PAR), also called the Sample Aspect Ratio (SAR). | ||
+ | |||
+ | <code>_SARNum [int]</code> | ||
+ | :The numerator of the "pixel size" (MPEG-4 PAR), also called the the Sample Aspect Ratio (SAR). | ||
+ | |||
+ | <code>_TFF [int]</code> | ||
+ | :If _FieldOperation is 2 (ignore pulldown) and _RFF is set, then _TFF describes whether the stream specifies that the top field is to be repeated, otherwise the bottom field is to be repeated. | ||
+ | :If _FieldOperation is 0 (honor pulldown) or 1 (force film) then _TFF is inapplicable and is set to -1. | ||
<br> | <br> | ||
==Examples== | ==Examples== | ||
− | + | DV2Source() should be used only with MPEG-1 and MPEG-2 video sources. To do plain YV12 decoding: | |
− | + | DV2Source("[PATH\]project.d2v") | |
Note: PATH can be ignored if "project.d2v" is in the same directory as your AviSynth (*.avs) script. | Note: PATH can be ignored if "project.d2v" is in the same directory as your AviSynth (*.avs) script. | ||
<br> | <br> | ||
+ | <br> | ||
+ | == Changelog == | ||
+ | See the [https://github.com/Asd-g/MPEG2DecPlus/releases GitHub releases] page for full changelog history. | ||
+ | Version Date Changes<br> | ||
+ | v0.1.2 2020/05/13 - Changes by asd-g | ||
+ | - Update to AviSynth+'s v8 interface | ||
+ | v0.1.1 2016/08/31 - Last release by Chikuzen | ||
+ | - [http://kuroko.fushizen.eu/bin/mpeg2decplus-0.1.1.zip mpeg2decplus-0.1.1.zip] /// [https://web.archive.org/web/20161102003551/https://kuroko.fushizen.eu/bin/mpeg2decplus-0.1.1.zip mirror] | ||
<br> | <br> | ||
==External Links== | ==External Links== |
Latest revision as of 02:26, 16 May 2022
Abstract | |
---|---|
Author | Chikuzen, asd-g |
Version | 1.3.0 |
Download | D2VSource-1.3.0.7z |
Category | Source filters |
License | GPLv2 |
Discussion |
Contents |
[edit] Description
DV2Source (previously named as MPEG2DecPlus) is a MPEG-1/2 decoder plug-in. DV2Source is a project to modernize "DGDecode.dll" for AviSynth+.
Changes include:
- Function renamed to DV2Source
- Code clean up and refactoring
- Elimination of code that is not currently required, such as VFAPI code and YUY2 code.
- Support 64bit by removing assembly code, and optimization by intrinsic in SSE2 / AVX2. etc.
- LumaYUV: function removed
- BlindPP: function removed
- DeBlock: function removed, see standalone DeBlock plugin for up-to-date version.
- DV2Source:
iPP, moderate_h, moderate_v, fastMC, and cpu2
parameters are removed. - Support for frame properties and variables.
[edit] Requirements
- [x86]: AviSynth+ or AviSynth 2.6.0
- [x64]: AviSynth+
- Supported color formats: YV12, YV16
- *** vcredist_x86.exe is required for DV2Source-x86
- *** vcredist_x64.exe is required for DV2Source-x64
[edit] Syntax and Parameters
- D2VSource (string "d2v", int "idct", bool "showQ", int "info", int "upConv", bool "i420", bool "iCC", bool "nocrop", int "rff")
- string d2v = ""
- d2v file path [required]. Note: you can you DGIndex to create the d2v file.
- Note: PATH can be ignored if the d2v file is in the same directory as your AviSynth (*.avs) script.
- string d2v = ""
- int idct = 0
- iDCT algorithm to use:
- 0 : as specified by the d2v file
- 1,2,3,6,7 : AP922 integer (same as SSE2MMX).
- 4 : SSE2 / AVX2 LLM (single precision floating point, SSE2 / AVX2 judgment is automatic).
- 5 : IEEE 1180 reference (double precision floating point).
- iDCT algorithm to use:
- int idct = 0
- bool showQ = false
- Show Macroblock Quantizers.
- true : Show quantizers
- false : Do not show quantizers
- Show Macroblock Quantizers.
- bool showQ = false
- int info = 0
- Debug Information
- 0 : Do not generate debug information
- 1 : Overlay debug information on the video
- 2 : Output debug information via OutputDebugString() (check the contents with DebugView.exe)
- 3 : Output hints in the video (embed hints in 64 bytes in the upper left corner of the frame)
- Debug Information
- int info = 0
- int upConv = 0
- Output colorspace:
- 0 : No conversion, YUV420 source is YV12 output, YUV422 source is YV16 output.
- 1 : up convert to YV16.
- 2 : up convert to YV24.
- Output colorspace:
- int upConv = 0
- bool iCC = auto
- Settings for handling YUV420 in
upConv
. - MPEG2Source automatically uses the PROGRESSIVE_FRAME flag to switch between field/frame based upsampling on a per-frame-basis.
- You should only specify the iCC parameter if you want to force DGDecode to use a particular upsampling mode.
- [unspecified] : follow the PROGRESSIVE_FRAME flag
- true : force field-based (interlaced) upsampling
- false : force frame-based (progressive) upsampling
- Settings for handling YUV420 in
- bool iCC = auto
- bool nocrop = false
- Use direct-rendered buffer, which may need cropping.
- It could provide a speedup when you know you need to crop your image anyway, by avoiding extra memcpy calls.
- Default: False.
- bool nocrop = false
- int rff = -1
- Changes Field_Operation without the need of editing d2v or rescanning with different Field Operation.
- 0: Honor Pulldowns Flags.
- 1: Forced Film.
- 2: Ignored Pulldowns Flags.
- Default: -1 - read the value from d2v.
- Changes Field_Operation without the need of editing d2v or rescanning with different Field Operation.
- int rff = -1
[edit] Exported variables
FFSAR_NUM, FFSAR_DEN, FFSAR (these indicate Generic PAR)
[edit] Frame properties
_AbsoluteTime [float]
- The frame’s absolute timestamp in seconds.
_AspectRatio [int]
- An array giving the display aspect ratio.
_ChromaLocation [int]
- Chroma sample position in YUV formats: 0=left, 1=center, 2=topleft, 3=top, 4=bottomleft, 5=bottom.
_DurationNum [int], _DurationDen [int]
- The frame’s duration in seconds as a rational number.
_EncodedFrameTop [int], _EncodedFrameBottom [int]
- Frame number (before pulldown) used to generate this frame's top/bottom field.
_FieldBased [int]
- Describes the composition of the frame:
- 0=frame based (progressive), 1=bottom field first, 2=top field first.
- Note that the GOP progressive flag is used to determine whether the frame is progressive.
v_FieldOperation [int]
- Describes the field operation option in effect:
- 0=honor pulldown, 1=force film, 2=ignore pulldown.
_FieldOrder [int]
- Display field order of the frame:
- 0=bottom field first, 1=top field first.
_Film [int]
- Set if the frame is part of a 3:2 soft pulldown section.
- Note that this uses the RFF history of several preceding frames, and so is valid only when doing linear access.
_GOPClosed [int]
- Set if the current GOP is closed.
_GOPNumber [int]
- The 0-based GOP number that contains the frame.
- Note that if this is set as the value x, then propShow displays it as [x, y] where y is the 0-based frame number of the first frame in the GOP.
_GOPPosition [int]
- The GOP position field from the D2V file for the GOP containing the frame.
_Matrix [int]
- The matrix number field from the D2V file for the GOP containing the frame.
_PictType [data]
- A single character describing the frame type.
- It uses the common IPB characters but others may also be used for formats with additional frame types.
_ProgressiveFrame [int]
- Set if the progress_frame flag is set for this frame.
_QuantsAverage [int]
- The average quantizer value for the frame.
_QuantsMax [int]
- The maximum quantizer value for the frame.
_QuantsMin [int]
- The minimum quantizer value for the frame.
_RFF [int]
- If _FieldOperation is 2 (ignore pulldown) then _RFF describes whether the stream specifies that a repeat field operation is to be performed on this frame.
- If _FieldOperation is 0 (honor pulldown) or 1 (force film) then _RFF describes whether the frame was composed with field repetition.
_SARDen [int]
- The denominator of the "pixel size" (MPEG-4 PAR), also called the Sample Aspect Ratio (SAR).
_SARNum [int]
- The numerator of the "pixel size" (MPEG-4 PAR), also called the the Sample Aspect Ratio (SAR).
_TFF [int]
- If _FieldOperation is 2 (ignore pulldown) and _RFF is set, then _TFF describes whether the stream specifies that the top field is to be repeated, otherwise the bottom field is to be repeated.
- If _FieldOperation is 0 (honor pulldown) or 1 (force film) then _TFF is inapplicable and is set to -1.
[edit] Examples
DV2Source() should be used only with MPEG-1 and MPEG-2 video sources. To do plain YV12 decoding:
DV2Source("[PATH\]project.d2v")
Note: PATH can be ignored if "project.d2v" is in the same directory as your AviSynth (*.avs) script.
[edit] Changelog
See the GitHub releases page for full changelog history.
Version Date Changes
v0.1.2 2020/05/13 - Changes by asd-g - Update to AviSynth+'s v8 interface v0.1.1 2016/08/31 - Last release by Chikuzen - mpeg2decplus-0.1.1.zip /// mirror
[edit] External Links
- GitHub - Source code repository.
Back to External Filters ←