Skip to content

Commit c2afcd3

Browse files
committed
rstdoc: update ConvertToPlanarRGB, change log.
1 parent c19ac3e commit c2afcd3

3 files changed

Lines changed: 68 additions & 20 deletions

File tree

distrib/Readme/readme_history.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ https://avisynthplus.readthedocs.io/en/latest/avisynthdoc/changelist376.html
1313
--------------------------------
1414
* Fix: inaccurate ColorBarsHD 10+ bit values. Now they are derived from the 32-bit float
1515
RGB definitions instead of upscaling a 8 bit precalculated YUV value.
16-
Corrected the lower parts for 32-bit as well.
16+
Add Ramp section the lead-in-lead-out.
1717
* Fix: GreyScale + SSE2 + RGB32 + matrix="RGB" overflow.
1818
Rare usage; "RGB" matrix (Identity) uses a 1.0 coefficient which exceeds the signed 16-bit
1919
SIMD limit of 32767 at 15-bit precision. Added bounds checking to fallback to C-code for any
2020
coefficients >= 1.0 or < −1.0.
2121
* Fix: YUV->RGB limited range matrix accuracy for 10-16 bits.
2222
* Use a different rounding in matrix coefficient's integer approximation.
23-
* ConvertToPlanarRGB: add the rest of fused bit conversions to YUV->RGB conevrsion.
23+
* "ConvertToPlanarRGB": ``bits`` parameter: on-the-fly bit-depth conversions to YUV->RGB conversion.
2424
- Full range target: 8-16 bits internal calculation is in 32-bit float.
2525
- Limited range target: a quicker, bit accuracy optimized integer calculation path.
2626
* Fix: Speed degradation when in-constructor GetFrame(0) (e.g. frame-property getter)
2727
is used. Disable internal Cache object creation.
2828
* Avoid MTGuard and CacheGuard creation if filter returns one of its clip parameter unaltered.
2929
* Add some avx2 stuff to Layer and Invert
30-
* Optmization: Overlay "Blend": aarch64 NEON optimization
30+
* Optimization: Overlay "Blend": aarch64 NEON optimization
3131

3232
20260203 3.7.5.r4483 (pre 3.7.6)
3333
--------------------------------

distrib/docs/english/source/avisynthdoc/changelist376.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ Additions, changes
2323
On Windows, only up-to DOTPROD can be detected due to OS limitations.
2424
* New CPU flags in ``cpuid.h`` and ``avisynth_c.h``: CPUF_ARM_NEON, CPUF_ARM_DOTPROD, CPUF_ARM_SVE2
2525
* "SetMaxCPU": add "neon", "dotprod", "sve2" options to enable/disable ARM64 (aarch64) features.
26+
- "ConvertToPlanarRGB": ``bits`` parameter: on-the-fly bit-depth conversions to YUV->RGB conversion.
27+
See :doc:`ConvertToPlanarRGB <./corefilters/convert>`
2628

2729

2830
Build environment, Interface
@@ -82,6 +84,15 @@ Build environment, Interface
8284

8385
Bugfixes
8486
~~~~~~~~
87+
- Fix: Speed degradation when in-constructor GetFrame(0) (e.g. frame-property getter) is used: disable internal Cache object creation.
88+
- Fix: YUV->RGB limited range matrix accuracy for 10-16 bits, plus use a symmetric rounding in matrix
89+
coefficient's integer approximation.
90+
- Fix: inaccurate ColorBarsHD 10+ bit values. Now they are derived from the 32-bit float
91+
RGB definitions instead of upscaling a 8 bit precalculated YUV value. Add Ramp section the lead-in-lead-out.
92+
- Fix: GreyScale + SSE2 + RGB32 + matrix="RGB" overflow.
93+
Rare usage; "RGB" matrix (Identity) uses a 1.0 coefficient which exceeds the signed 16-bit
94+
SIMD limit of 32767 at 15-bit precision. Added bounds checking to fallback to C-code for any
95+
coefficients >= 1.0 or < −1.0.
8596
- Fix #448: Resolved an issue where MT_MULTI_INSTANCE filters using relative paths
8697
(e.g. "video.mp4" or "../image.png") failed under Prefetch() when used in imported
8798
scripts from different directories. The problem occurred because new thread instances did
@@ -133,6 +144,9 @@ Optimizations
133144

134145
- add NEON optimizations for ARM64 (aarch64) for TurnLeft/TurnRight/Turn180.
135146
(First aarch64 code in Avisynth)
147+
- add NEON optimizatons for Overlay blend
148+
- (filter graph) avoid MTGuard and CacheGuard creation if a filter returns one of its clip parameter unaltered.
149+
- Add some avx2 stuff to Invert (no really gain, filter is too simple) and some Layer subfilter.
136150

137151
Documentation
138152
~~~~~~~~~~~~~
@@ -149,14 +163,15 @@ Documentation
149163
- Update :ref:`SetMaxCPU <setmaxcpu>` with AVX512 and ARM64 features
150164
- Update :ref:`AvsEnvProperty<cplusplus_getenvproperty>` with L2 cache size entry
151165
- Update Russian GPL notice in UTF-8 format
166+
- Update :doc:`ConvertToPlanarRGB <./corefilters/convert>` with `"bits"` and "matrix" syntax `":same"`
152167
- Add another Ubuntu->Windows DLL cross-compilation guide:
153168
See :ref:`Ubuntu->Windows mingw crosscompilation<compiling_avsplus_crosscompiling2>`
154169

155170

156171
Please report bugs at `github AviSynthPlus page`_ - or - `Doom9's AviSynth+
157172
forum`_
158173

159-
$Date: 2026/01/17 21:50:00 $
174+
$Date: 2026/02/12 10:59:00 $
160175

161176
.. _github AviSynthPlus page:
162177
https://github.com/AviSynth/AviSynthPlus

distrib/docs/english/source/avisynthdoc/corefilters/convert.rst

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ ConvertToXXXX function
3737
ConvertToPlanarRGB(clip, [ string matrix, bool interlaced,
3838
string ChromaInPlacement,
3939
string chromaresample,
40-
float param1, float param2, float param3 ] )
40+
float param1, float param2, float param3,
41+
int bits] )
4142
ConvertToPlanarRGBA(clip, [ string matrix, bool interlaced,
4243
string ChromaInPlacement,
4344
string chromaresample,
44-
float param1, float param2, float param3 ] )
45+
float param1, float param2, float param3,
46+
int bits] )
4547

4648

4749
*YUV444, YUVA444*
@@ -221,8 +223,8 @@ How conversion detects whether full or limited (narrow range for RGB) conversion
221223
- ``limited`` for YUV or Y (greyscale) sources
222224

223225
is assumed.
224-
- Along with frame properties, the matrix string can contain additional "hints", such as ``:f`` or ``:l``.
225-
- When no other hint is given, some old-style Avisynth matrix name can specify limited/full: e.g. Rec.709 implies limited range.
226+
- Along with frame properties, the matrix string can contain additional "hints", such as ``:f``, ``:l``, , ``:auto``, ``:same``.
227+
- When no other hint is given, some old-style Avisynth matrix name can specify limited/full: e.g. ``"Rec.709"`` implies limited range.
226228
Note: unlike ``PC.709`` or ``PC.601``: these matrix names do not force the clip being full or limited.
227229

228230
See also: :doc:`ConvertBits <convertbits>` to convert between bit depths and/or between full-limited range.
@@ -249,7 +251,7 @@ Syntax and parameters
249251
Additional matrix constants:
250252

251253
New syntax: more matrix string constants with separate full/limited range markers.
252-
``"matrixname:full_or_limited"`` where
254+
``"matrixname:full_or_limited_or_auto_or_same"`` where
253255
``"matrixname"`` can be set as (for developers, internal _Matrix integer constant are given in parenthesys)
254256

255257
- "rgb" (0 - AVS_MATRIX_RGB)
@@ -269,21 +271,32 @@ Syntax and parameters
269271
- "chromancl" (12 - AVS_MATRIX_CHROMATICITY_DERIVED_NCL not supported)
270272
- "ictcp" (14 - AVS_MATRIX_ICTCP not supported)
271273

272-
The above "matrix" parameters can be followed by a ``"full"`` or ``"f"`` and ``"limited"`` or ``"l"`` or
273-
``"auto"`` marker after a ``":"``
274+
The above "matrix" parameters can be followed by a
275+
276+
- ``"full"`` or ``"f"``
277+
- ``"limited"`` or ``"l"``
278+
- ``"auto"``
279+
- ``"same"``
280+
281+
marker after a ``":"``.
274282

275-
e.g. ``"709:l"`` means the same as the old "Rec709"
283+
e.g. ``"709:l"`` means the same as the old "Rec709", since it defaults to limited to full conversion.
276284

277-
When there is no limited-ness marker, or is set to "auto" then value of _ColorRange frame property is used
285+
When there is no limited-ness marker, or is set to "auto" then value of _ColorRange frame property is used.
286+
Using "same" will assume the input range for the output's range.
278287

279-
Note: old-style "matrix" parameters are kept, their name indicate the full/limited except ``"PC.601"`` and ``"PC.709"``
288+
Note: Avisynth+ defines a new matrix syntax, but old-style "matrix" parameter names are still valid.
289+
Using old-style matrix names imply the full/limited range, except ``"PC.601"`` and ``"PC.709"`` which
290+
do not alter the input's range.
280291

281292
For memo and the similar new string
282293

283-
- "rec601" same as "470bg:l"
284-
- "rec709" "709:l"
285-
- "pc.601" and "pc601" "470bg:f" - but only if source has _ColorRange = 0 (full)
286-
- "pc.709" and "pc709" "709:f" - but only if source has _ColorRange = 0 (full)
294+
- "rec601" same as "470bg:l" (limited to full)
295+
- "rec709" "709:l" (limited to full)
296+
- "pc.601" and "pc601" same as "470bg:f" - but only if source has _ColorRange = 0 (full)
297+
- "pc.709" and "pc709" same as "709:f" - but only if source has _ColorRange = 0 (full)
298+
- "pc.601" and "pc601" same as "470bg:same" (keep input range)
299+
- "pc.709" and "pc709" same as "709:same" (keep input range)
287300
- "average" - kept for compatibility, really it has no standard _Matrix equivalent
288301
- "rec2020" "2020cl:l"
289302
- "pc.2020" and "pc2020" "2020cl:f" - but only if source has _ColorRange = 0 (full)
@@ -354,7 +367,24 @@ Syntax and parameters
354367
resamplers. Some resizer algorithms would need and can be fine tuned with up to 3 parameters.
355368
Their default values depend on the selected chromaresample resizer kernel,
356369

357-
370+
.. describe:: bits
371+
372+
Used by ConvertToPlanarRGB(A) to perform on-the-fly output bit-depth conversion.
373+
374+
**Internal calculation methods:** (when conversion is needed)
375+
376+
======================== =================== ================================
377+
Target Range Internal Math Output Handling
378+
======================== =================== ================================
379+
Full-range 32-bit float Direct output
380+
Limited-range → integer S18.13 fixed-point Truncated to target bit depth
381+
Limited-range → float S18.13 fixed-point Converted to float (no truncation)
382+
======================== =================== ================================
383+
384+
Note: Limited-range to float conversion preserves the full precision of the
385+
S18.13 fixed-point calculation by converting directly to 32-bit float without
386+
the truncation that occurs with integer targets.
387+
358388
Frame properties
359389
----------------
360390

@@ -434,6 +464,9 @@ Color conversions
434464
+----------+------------------------------------------------------------+
435465
| Changes: | |
436466
+==========+============================================================+
467+
| v3.7.6 || Add "bits" parameter to ConvertToPlanarRGB() |
468+
| || Document ":same" in matrix specifier |
469+
+----------+------------------------------------------------------------+
437470
| v3.7.3 || Added "sinpow", "sinclin2" and "userdefined2" to |
438471
| | chromaresampler options |
439472
| || Add "param1", "param2" and "param3" to ConvertToXXXX where|
@@ -454,4 +487,4 @@ Color conversions
454487
| v2.50 | ConvertToYV12 |
455488
+----------+------------------------------------------------------------+
456489

457-
$Date: 2024/12/18 13:23:00 $
490+
$Date: 2026/02/12 10:44:00 $

0 commit comments

Comments
 (0)