Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Updated files for r24 + minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
EleonoreMizo committed Aug 16, 2021
1 parent 53a85ab commit a4b3931
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 55 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fmtconv — format conversion tools for Vapoursynth
=================================================
fmtconv — format conversion tools for Vapoursynth and Avisyth+
==============================================================

Fmtconv is a format-conversion plug-in for the Vapoursynth video processing engine.
Fmtconv is a format-conversion plug-in for the Vapoursynth and Avisynth+ video processing engines.
It does:
* Resizing.
* Bitdepth conversion with dithering.
Expand Down
2 changes: 1 addition & 1 deletion build/unix/configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT([fmtconv], [r23], [http://forum.doom9.org/showthread.php?t=166504], [fmtconv], [http://forum.doom9.org/showthread.php?t=166504])
AC_INIT([fmtconv], [r24], [http://forum.doom9.org/showthread.php?t=166504], [fmtconv], [http://forum.doom9.org/showthread.php?t=166504])
AC_CONFIG_MACRO_DIR([m4])

AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz subdir-objects no-define])
Expand Down
104 changes: 60 additions & 44 deletions doc/fmtconv.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>fmtconv&nbsp;&mdash;&nbsp;format conversion tools for Vapoursynth</title>
<title>fmtconv&nbsp;&mdash;&nbsp;format conversion tools for Vapoursynth and Avisynth+</title>
<link rel="stylesheet" type="text/css" href="vapourdoc.css" />
</head>

<body><div class="global">

<h1>fmtconv&nbsp;&mdash;&nbsp;format conversion tools for Vapoursynth</h1>
<h1>fmtconv&nbsp;&mdash;&nbsp;format conversion tools for Vapoursynth and Avisynth+</h1>

<h2>Abstract</h2>

<table class="n">
<tr><td class="n"><b>Authors: </b></td><td class="n">&nbsp;</td><td class="n">Firesledge (aka Cretindesalpes)</td></tr>
<tr><td class="n"><b>Version: </b></td><td class="n">&nbsp;</td><td class="n">r23</td></tr>
<tr><td class="n"><b>Version: </b></td><td class="n">&nbsp;</td><td class="n">r24</td></tr>
<tr><td class="n"><b>Download: </b></td><td class="n">&nbsp;</td><td class="n"><a href="http://ldesoras.free.fr/prod.html#src_fmtconv">http://ldesoras.free.fr/prod.html</a></td></tr>
<tr><td class="n"><b>Category: </b></td><td class="n">&nbsp;</td><td class="n">Format tools</td></tr>
<tr><td class="n"><b>Requirements:</b></td><td class="n">&nbsp;</td><td class="n"><a href="http://www.vapoursynth.com/">Vapoursynth</a></td></tr>
<tr><td class="n"><b>Requirements:</b></td><td class="n">&nbsp;</td><td class="n"><a href="http://www.vapoursynth.com/">Vapoursynth</a> or <a href="https://avs-plus.net/">Avisynth+ 3.7.0</a></td></tr>
<tr><td class="n"><b>License: </b></td><td class="n">&nbsp;</td><td class="n"><a href="http://www.wtfpl.net/">WTFPL</a></td></tr>
</table>

Expand All @@ -31,7 +31,8 @@ <h2>Table of contents</h2>
<li class="tcont"><a href="#usage">Usage</a>
<ol style="list-style-type:armenian; margin-top:0.5em;">
<li><a href="#loading">Loading</a></li>
<li><a href="#examples">Examples</a></li>
<li><a href="#examples">Examples for Vapoursynth</a></li>
<li><a href="#examples">Examples for Avisynth+</a></li>
<li><a href="#compiling">Compiling from the source code</a></li>
</ol>
</li>
Expand All @@ -55,7 +56,8 @@ <h2>Table of contents</h2>

<h2><a id="intro"></a>I) Introduction</h2>

<p>Fmtconv is a format-conversion plug-in for the Vapoursynth video processing engine.
<p>Fmtconv is a format-conversion plug-in for the Vapoursynth and Avisynth+
video processing engines.
It does:</p>
<ul>
<li>Resizing.</li>
Expand All @@ -74,11 +76,13 @@ <h2><a id="intro"></a>I) Introduction</h2>
This does not mean it is slow or unoptimized, but fmtconv is clearly not on par with the fastest equivalent 8-bit filters.</p>



<h2><a id="usage"></a>II) Usage</h2>

<h3><a id="loading"></a>Loading fmtconv</h3>

<p>Using the Python 3.4 interface:</p>
<p>Using the Python 3.8 interface (or a higher version, it depends on your
Vapoursynth version):</p>

<pre class="src">import vapoursynth as vs
core = vs.get_core ()
Expand All @@ -88,7 +92,8 @@ <h3><a id="loading"></a>Loading fmtconv</h3>
plug-in file to the autoloading directory.
Check the Vapoursynth manual for more information.</p>

<h3><a id="examples"></a>Examples</h3>

<h3><a id="examples-vs"></a>Examples for Vapoursynth</h3>

<h4>A basic example</h4>

Expand Down Expand Up @@ -201,6 +206,12 @@ <h4>Colorspace conversions</h4>
c = core.fmtc.transfer (clip=c, transs="linear", transd="srgb")
c = core.fmtc.bitdepth (clip=c, bits=8)</pre>


<h3><a id="examples-avs"></a>Examples for Avisynth+</h3>

<p><em>Soon…</em></p>


<h3><a id="compiling"></a>Compiling from the source code</h3>

<h4>Visual C++</h4>
Expand Down Expand Up @@ -234,6 +245,8 @@ <h4>GNU/Linux and other Unix-like systems</h4>
<li><code>--enable-debug</code> to activate debugging code</li>
<li><code>--enable-clang</code> to use Clang instead of the default compiler which is usually GCC</li>
</ul>
<p>Only the Vapoursynth plug-in can be built in the GNU-based environment.</p>


<h2><a id="description"></a>III) Filters description</h2>

Expand Down Expand Up @@ -1641,45 +1654,47 @@ <h4>Parameters</h4>

<p class="var">transs, transd</p>
<p>Transfer characteristics for input and output, respectively.
The characteristic is direct or inverted according to where it is applied
(output or input).
The curve set is the same as in ISO/IEC 23008-2 (HEVC), with a few
additions.</p>
The characteristic may be an OETF (opto-electronic transfer function), an
EOTF (eletro-optical transfer function), or just remain unspecified.
It is direct or inverted according to where it is applied, output or input.
The intermediate state is assumed linear light.
The curve set is the same as the list in ISO/IEC 23008-2 (HEVC), with a few
additions from various camera manufacturers or NLE systems.</p>
<p>Most curves map their value from the 0–1 range to 0–1, but some are for
high dynamic range or wide gamut signals and locate their value for peak white
much higher.</p>
<table>
<tr><th>Value</th><th>Linear range</th><th>Description</th></tr>
<tr><td><b><code>&quot;709&quot; </code></b></td><td>0&hellip;1</td><td>ITU-R BT.709</td></tr>
<tr><td><b><code>&quot;470m&quot; </code></b></td><td>0&hellip;1</td><td>ITU-R BT.470-6 System M, FCC (assumed display gamma 2.2)<br />Actually uses the same curve as IEC 61966-2-1.</td></tr>
<tr><td><b><code>&quot;470bg&quot; </code></b></td><td>0&hellip;1</td><td>ITU-R BT.470-6 System B, G (assumed display gamma 2.8)</td></tr>
<tr><td><b><code>&quot;601&quot; </code></b></td><td>0&hellip;1</td><td>ITU-R BT.601</td></tr>
<tr><td><b><code>&quot;240&quot; </code></b></td><td>0&hellip;1</td><td>SMPTE 240M</td></tr>
<tr><td><b><code>&quot;linear&quot;<br />&quot;&quot;</code></b></td><td>Unspecified</td><td>Linear (bypass)</td></tr>
<tr><td><b><code>&quot;log100&quot; </code></b></td><td>0&hellip;1</td><td>Logarithmic transfer characteristic (100:1 range)</td></tr>
<tr><td><b><code>&quot;log316&quot; </code></b></td><td>0&hellip;1</td><td>Logarithmic transfer characteristic (100*Sqrt(10):1 range)</td></tr>
<tr><td><b><code>&quot;61966-2-4&quot; </code></b></td><td>Unspecified</td><td>IEC 61966-2-4, xvYCC. Same as BT.709, but with an extended range, inlcuding negative values.</td></tr>
<tr><td><b><code>&quot;1361&quot; </code></b></td><td>&minus;0.25&hellip;1.33</td><td>ITU-R BT.1361 extended colour gamut system</td></tr>
<tr><td><b><code>&quot;61966-2-1&quot;<br />&quot;srgb&quot;<br />&quot;sycc&quot;</code></b></td><td>0&hellip;1</td><td>IEC 61966-2-1, sRGB or sYCC</td></tr>
<tr><td><b><code>&quot;2020_10&quot; </code></b></td><td>0&hellip;1</td><td>ITU-R BT.2020 for 10-bit system</td></tr>
<tr><td><b><code>&quot;2020_12&quot;<br />&quot;2020&quot;</code></b></td><td>0&hellip;1</td><td>ITU-R BT.2020 for 12-bit system</td></tr>
<tr><td><b><code>&quot;2084&quot; </code></b></td><td>0&hellip;1</td><td>SMPTE ST 2084 for 10, 12, 14 and 16-bit systems<br />ITU-R BT.2100-2 PQ (perceptual quantization)<br />Linear 1.0 is peak white and corresponds to a display luminance level of 10&nbsp;000 cd/m<sup>2</sup>.</td></tr>
<tr><td><b><code>&quot;428&quot; </code></b></td><td>0&hellip;1</td><td>SMPTE ST 428-1<br />Linear 1.0 is peak white and corresponds to a display luminance level of 48 cd/m<sup>2</sup>.</td></tr>
<tr><td><b><code>&quot;hlg&quot; </code></b></td><td>0&hellip;1</td><td>ITU-R BT.2100 hybrid log-gamma, ARIB STD-B67</td></tr>
<tr><td><b><code>&quot;1886&quot; </code></b></td><td>0&hellip;1</td><td>ITU-R BT.1886. This is an EOTF for display mimicing CRTs.</td></tr>
<tr><td><b><code>&quot;1886a&quot; </code></b></td><td>0&hellip;1</td><td>ITU-R BT.1886, alternative approximation</td></tr>
<tr><td><b><code>&quot;filmstream&quot;</code></b></td><td>0&hellip;1</td><td>Thomson FilmStream<br />Linear 1.0 is the sensor clipping level, corresponding to 3840 on a linear 12-bit scale.</td></tr>
<tr><td><b><code>&quot;slog&quot; </code></b></td><td>&minus;0.006&hellip;10</td><td>Sony S-Log<br />Linear 1.0 is the reference white, peak white is at 10.0.</td></tr>
<tr><td><b><code>&quot;slog2&quot; </code></b></td><td>&minus;0.0085&hellip;14.13</td><td>Sony S-Log 2<br />Linear 1.0 is the reference white, peak white is at 14.13.</td></tr>
<tr><td><b><code>&quot;slog3&quot; </code></b></td><td>0&hellip;38.421</td><td>Sony S-Log3.</td></tr>
<tr><td><b><code>&quot;logc2&quot; </code></b></td><td>Unspecified</td><td>Arri Log C Alexa 2.x, linear scene exposure<br />Peak white is 57.45 linear. The negative part of the range allows coding sensor noise. <var>logceis</var> and <var>logceid</var> set the Exposure Index (EI).</td></tr>
<tr><td><b><code>&quot;logc3&quot; </code></b></td><td>Unspecified</td><td>Arri Log C Alexa 3.x, linear scene exposure<br />Peak white is 55.08 linear. The negative part of the range allows coding sensor noise. <var>logceis</var> and <var>logceid</var> set the Exposure Index (EI).</td></tr>
<tr><td><b><code>&quot;canonlog&quot; </code></b></td><td>0&hellip;8.00903</td><td>Canon-Log<br />Peak white is 8.00903 in linear scale and 1.08676 in compressed scale.</td></tr>
<tr><td><b><code>&quot;adobergb&quot; </code></b></td><td>0&hellip;1</td><td>Adobe RGB (1998 and Wide Gamut)</td></tr>
<tr><td><b><code>&quot;romm&quot; </code></b></td><td>0&hellip;1</td><td>ProPhoto, ROMM</td></tr>
<tr><td><b><code>&quot;acescc&quot; </code></b></td><td>&minus;65504&hellip;65504</td><td>ACEScc. Values are actually bounded to the ACES 16-bit float range.</td></tr>
<tr><td><b><code>&quot;erimm&quot; </code></b></td><td>0&hellip;316.2</td><td>ERIMM</td></tr>
<tr><td><b><code>&quot;vlog&quot; </code></b></td><td>0&hellip;1</td><td>Panasonic V-Log</td></tr>
<tr><th>Value</th><th>Linear range</th><th>Type</th><th>Description</th></tr>
<tr><td><b><code>&quot;709&quot; </code></b></td><td>0&hellip;1</td><td>OETF</td><td>ITU-R BT.709</td></tr>
<tr><td><b><code>&quot;470m&quot; </code></b></td><td>0&hellip;1</td><td></td><td>ITU-R BT.470-6 System M, FCC (assumed display gamma 2.2)<br />Actually uses the same curve as IEC 61966-2-1.</td></tr>
<tr><td><b><code>&quot;470bg&quot; </code></b></td><td>0&hellip;1</td><td></td><td>ITU-R BT.470-6 System B, G (assumed display gamma 2.8)</td></tr>
<tr><td><b><code>&quot;601&quot; </code></b></td><td>0&hellip;1</td><td>OETF</td><td>ITU-R BT.601</td></tr>
<tr><td><b><code>&quot;240&quot; </code></b></td><td>0&hellip;1</td><td></td><td>SMPTE 240M</td></tr>
<tr><td><b><code>&quot;linear&quot;<br />&quot;&quot;</code></b></td><td>Unspecified</td><td></td><td>Linear (bypass)</td></tr>
<tr><td><b><code>&quot;log100&quot; </code></b></td><td>0&hellip;1</td><td></td><td>Logarithmic transfer characteristic (100:1 range)</td></tr>
<tr><td><b><code>&quot;log316&quot; </code></b></td><td>0&hellip;1</td><td></td><td>Logarithmic transfer characteristic (100*Sqrt(10):1 range)</td></tr>
<tr><td><b><code>&quot;61966-2-4&quot; </code></b></td><td>Unspecified</td><td>OETF</td><td>IEC 61966-2-4, xvYCC. Same as BT.709, but with an extended range, including negative values.</td></tr>
<tr><td><b><code>&quot;1361&quot; </code></b></td><td>&minus;0.25&hellip;1.33</td><td></td><td>ITU-R BT.1361 extended colour gamut system</td></tr>
<tr><td><b><code>&quot;61966-2-1&quot;<br />&quot;srgb&quot;<br />&quot;sycc&quot;</code></b></td><td>0&hellip;1</td><td>EOTF</td><td>IEC 61966-2-1, sRGB or sYCC</td></tr>
<tr><td><b><code>&quot;2020_10&quot; </code></b></td><td>0&hellip;1</td><td></td><td>ITU-R BT.2020 for 10-bit system</td></tr>
<tr><td><b><code>&quot;2020_12&quot;<br />&quot;2020&quot;</code></b></td><td>0&hellip;1</td><td></td><td>ITU-R BT.2020 for 12-bit system</td></tr>
<tr><td><b><code>&quot;2084&quot; </code></b></td><td>0&hellip;1</td><td>EOTF</td><td>SMPTE ST 2084 for 10, 12, 14 and 16-bit systems<br />ITU-R BT.2100-2 PQ (perceptual quantization)<br />Linear 1.0 is peak white and corresponds to a display luminance level of 10&nbsp;000 cd/m<sup>2</sup>.</td></tr>
<tr><td><b><code>&quot;428&quot; </code></b></td><td>0&hellip;1</td><td></td><td>SMPTE ST 428-1<br />Linear 1.0 is peak white and corresponds to a display luminance level of 48 cd/m<sup>2</sup>.</td></tr>
<tr><td><b><code>&quot;hlg&quot; </code></b></td><td>0&hellip;1</td><td>OETF</td><td>ITU-R BT.2100 HLG (hybrid log-gamma), ARIB STD-B67</td></tr>
<tr><td><b><code>&quot;1886&quot; </code></b></td><td>0&hellip;1</td><td>EOTF</td><td>ITU-R BT.1886. Intended to mimicing a CRT display curve.</td></tr>
<tr><td><b><code>&quot;1886a&quot; </code></b></td><td>0&hellip;1</td><td>EOTF</td><td>ITU-R BT.1886, alternative approximation</td></tr>
<tr><td><b><code>&quot;filmstream&quot;</code></b></td><td>0&hellip;1</td><td>OETF?</td><td>Thomson FilmStream<br />Linear 1.0 is the sensor clipping level, corresponding to 3840 on a linear 12-bit scale.</td></tr>
<tr><td><b><code>&quot;slog&quot; </code></b></td><td>&minus;0.006&hellip;10</td><td>OETF?</td><td>Sony S-Log<br />Linear 1.0 is the reference white, peak white is at 10.0.</td></tr>
<tr><td><b><code>&quot;slog2&quot; </code></b></td><td>&minus;0.0085&hellip;14.13</td><td>OETF?</td><td>Sony S-Log 2<br />Linear 1.0 is the reference white, peak white is at 14.13.</td></tr>
<tr><td><b><code>&quot;slog3&quot; </code></b></td><td>0&hellip;38.421</td><td>OETF?</td><td>Sony S-Log3.</td></tr>
<tr><td><b><code>&quot;logc2&quot; </code></b></td><td>Unspecified</td><td>OETF?</td><td>Arri Log C Alexa 2.x, linear scene exposure<br />Peak white is 57.45 linear. The negative part of the range allows coding sensor noise. <var>logceis</var> and <var>logceid</var> set the Exposure Index (EI).</td></tr>
<tr><td><b><code>&quot;logc3&quot; </code></b></td><td>Unspecified</td><td>OETF?</td><td>Arri Log C Alexa 3.x, linear scene exposure<br />Peak white is 55.08 linear. The negative part of the range allows coding sensor noise. <var>logceis</var> and <var>logceid</var> set the Exposure Index (EI).</td></tr>
<tr><td><b><code>&quot;canonlog&quot; </code></b></td><td>0&hellip;8.00903</td><td>OETF</td><td>Canon-Log<br />Peak white is 8.00903 in linear scale and 1.08676 in compressed scale.</td></tr>
<tr><td><b><code>&quot;adobergb&quot; </code></b></td><td>0&hellip;1</td><td></td><td>Adobe RGB (1998 and Wide Gamut)</td></tr>
<tr><td><b><code>&quot;romm&quot; </code></b></td><td>0&hellip;1</td><td></td><td>ProPhoto, ROMM</td></tr>
<tr><td><b><code>&quot;acescc&quot; </code></b></td><td>&minus;65504&hellip;65504</td><td></td><td>ACEScc. Values are actually bounded to the ACES 16-bit float range.</td></tr>
<tr><td><b><code>&quot;erimm&quot; </code></b></td><td>0&hellip;316.2</td><td>OETF</td><td>ERIMM</td></tr>
<tr><td><b><code>&quot;vlog&quot; </code></b></td><td>0&hellip;1</td><td></td><td>Panasonic V-Log</td></tr>
</table>

<p class="var">cont</p>
Expand Down Expand Up @@ -1791,7 +1806,7 @@ <h2><a id="troubleshooting"></a>IV) Troubleshooting</h2>

<h2><a id="changelog"></a>V) Changelog</h2>

<p><b>r24, 202?-??-??</b></p>
<p><b>r24, 2021-08-16</b></p>
<ul>
<li><code>bitdepth</code>: added dithering <var>mode</var> 9: quasirandom sequences.</li>
<li><code>bitdepth</code>: added a triangular probability distribution function (TPDF) for the dithering patterns and noises, along with the associated parameters <var>tpdfo</var> and <var>tpdfn</var>.</li>
Expand All @@ -1804,6 +1819,7 @@ <h2><a id="changelog"></a>V) Changelog</h2>
<li><code>resample</code>: added a <var>planes</var> parameter.</li>
<li><code>transfer</code>: sYCC curve (similar to sRGB) now supports signed values.</li>
<li><code>transfer</code>: added a <var>planes</var> parameter.</li>
<li>Added support for Avisynth+</li>
<li>Added information on functions reading and writing frame properties.</li>
<li>Added support for 14-bit data.</li>
<li>Vapoursynth: still uses API v3.6 but can use Python constants from API v4.0.</li>
Expand Down
2 changes: 1 addition & 1 deletion src/fmtc/version.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#define fmtc_VERSION "r23"
#define fmtc_VERSION "r24"
#define fmtc_PLUGIN_NAME "fmtconv"
#define fmtc_NAMESPACE "fmtc"
4 changes: 1 addition & 3 deletions src/fmtcavs/fnc_fmtcavs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,7 @@ void set_masktools_planes_param (avsutl::PlaneProcessor &pp, ::IScriptEnvironmen
{
const auto plist =
extract_array_f (env, arg, filter_and_arg_0, def_val);
const auto plist_last = plist.size () - 1;
assert (plist_last >= 0);
const auto nbr_planes = size_t (pp.get_nbr_planes ());
const auto nbr_planes = pp.get_nbr_planes ();
for (int p_idx = 0; p_idx < nbr_planes; ++p_idx)
{
const auto mode = fmtcl::get_arr_elt (plist, p_idx, def_val);
Expand Down
2 changes: 1 addition & 1 deletion src/fmtcl/TransUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ std::unique_ptr <TransLut> TransUtil::build_lut (PicFmt dst_fmt, TransCurve curv
{
/*
Black level (brightness) and contrast settings as defined
in ITU-R BT.1886:
in ITU-R BT.1886, and called "b":
L = a' * fi (V + b')
With:
Expand Down
7 changes: 5 additions & 2 deletions zip-release.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@

@mkdir "reltmp"
@mkdir "reltmp\src"
@mkdir "reltmp\build\unix\m4"
@mkdir "reltmp\build\win\common"
@mkdir "reltmp\build\win\fmtcavs"
@mkdir "reltmp\build\win\fmtconv"
@mkdir "reltmp\vapoursynth\win32"
@mkdir "reltmp\vapoursynth\win64"
@xcopy /I "doc" "reltmp\doc"
@xcopy /I "build\unix" "reltmp\build\unix"
@xcopy /I "build\unix\m4" "reltmp\build\unix\m4"
@xcopy /I "src\avs" "reltmp\src\avs"
@xcopy /I "src\avsutl" "reltmp\src\avsutl"
@xcopy /I "src\conc" "reltmp\src\conc"
Expand All @@ -27,6 +26,10 @@
@copy "src\*.cpp" "reltmp\src"
@copy "src\*.h" "reltmp\src"
@copy "src\*.hpp" "reltmp\src"
@copy "build\unix\autogen.sh" "reltmp\build\unix"
@copy "build\unix\configure.ac" "reltmp\build\unix"
@copy "build\unix\Makefile.am" "reltmp\build\unix"
@copy "build\unix\m4\ax_*.m4" "reltmp\build\unix\m4"
@copy "build\win\*.sln" "reltmp\build\win"
@copy "build\win\*.vcxproj" "reltmp\build\win"
@copy "build\win\*.vcxproj.filters" "reltmp\build\win"
Expand Down

0 comments on commit a4b3931

Please sign in to comment.