Skip to content

Commit 9d0ae3a

Browse files
committed
rstdoc: Convert: add bits/quality to ConvertToY
1 parent 5346b7b commit 9d0ae3a

1 file changed

Lines changed: 28 additions & 12 deletions

File tree

  • distrib/docs/english/source/avisynthdoc/corefilters

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

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ ConvertToXXXX function
8686

8787
*YUY2*
8888
::
89+
8990
ConvertToYUY2(clip [, bool interlaced, string matrix,
9091
string ChromaInPlacement,
9192
string chromaresample,
@@ -136,8 +137,8 @@ ConvertToXXXX function
136137
*Y-only*
137138
::
138139

139-
ConvertToY8(clip [, string matrix] )
140-
ConvertToY(clip, [ string matrix ] )
140+
ConvertToY8(clip [, string matrix, int bits, bool quality] )] )
141+
ConvertToY(clip [, string matrix, int bits, bool quality] ) ] )
141142

142143

143144
Color formats
@@ -208,7 +209,7 @@ Such functions are ``ConvertToYV12``/``ConvertToYUV420``/``ConvertToYUVA420`` or
208209
``ConvertToRGB64`` or ``ConvertToPlanarRGB`` explicitly, or reduce
209210
bit depth with ``ConvertBits(8)`` / ``ConvertBits(16)`` first.
210211

211-
The ``bits`` parameter (8 or 16) overrides the adaptive target bit depth,
212+
The ``bits`` parameter (8 or 16) overrides ConvertToRGB's adaptive target bit depth,
212213
allowing for example a 16-bit source to be converted to an 8-bit packed
213214
RGB output. Values other than 8 or 16 are not accepted.
214215

@@ -518,7 +519,9 @@ Syntax and parameters
518519

519520
.. describe:: bits
520521

521-
Used by ConvertToPlanarRGB(A) to perform on-the-fly output bit-depth conversion.
522+
Used to perform output bit-depth conversion. Between Planar RGB and YUV/Y formats the conversion
523+
is single-pass. When intermediate format conversion is needed (e.g. RGB64->YUV444P8 is RGB64->PlanarRGB16->YUV444P8,
524+
the bit-depth conversion occurs in the RGBP->YUV part.
522525

523526
**Internal calculation methods of 8-16 bit sources** (when conversion is needed)
524527

@@ -542,7 +545,7 @@ Syntax and parameters
542545

543546
``bool quality = false``
544547

545-
Available in ConvertToPlanarRGB(A) only.
548+
Only affects YUV (Y) - RGB conversions, where matrix operation is involved.
546549

547550
When ``false`` (default), the internal calculation method is chosen automatically
548551
based on the target range and bit depth, as described in the ``bits`` table above:
@@ -607,10 +610,23 @@ Conversion paths
607610

608611
The following conversion paths occur
609612

610-
- YUV planar -> RGB via YV24
611-
- YUV planar -> YUY2 via YV16
612-
- RGB -> YUV planar via YV24
613-
- YUY2 -> YUV planar via YV16
613+
- 411/420/422 YUV planar -> RGB via YUV444
614+
- YUV planar -> YUY2 via YV16 (8 bit YUV422)
615+
- YUV planar -> Y: direct
616+
- Planar RGB -> 444: direct
617+
- Planar RGB -> Y planar: direct
618+
- Packed RGB -> Y/YUV planar: via Planar RGB(A) (A: depending on the target YUV's alpha-needs)
619+
- Any RGB -> 411/420/422 YUV planar via YUV444
620+
- YUY2 -> Y: direct
621+
- YUY2 -> Any: via YV16
622+
- Any -> YUY2: via YV16
623+
- YV24 -> packed RGB24/32: (quality=false): direct conversion.
624+
- YV24 -> packed RGB24/32: (quality=true): via planar RGB.
625+
- YUV planar -> packed RGB48/64: via planar RGB
626+
627+
When bit depth change needed, and the transformation does not integrate bit-depth conversion
628+
(E.g. clipYUV.ConvertToPlanarRGB(bits=xxx) does include, but clipY8bit.ConvertToY(bits=yyy) does not).
629+
then an extra ConvertBits() is called internally.
614630

615631
Suppose you have a YUY2 clip for example and you convert it to YV24.
616632

@@ -667,8 +683,8 @@ Color conversions
667683
+----------+------------------------------------------------------------+
668684
| Changes: | |
669685
+==========+============================================================+
670-
| v3.7.6 || Add "quality" parameter to ConvertToPlanarRGB(A) |
671-
| || Add "bits" parameter to ConvertToPlanarRGB(A) |
686+
| v3.7.6 || Add "quality" parameter to ConvertToXXXX |
687+
| || Add "bits" parameter to ConvertToXXXX |
672688
| || Document ":same" in matrix specifier |
673689
+----------+------------------------------------------------------------+
674690
| v3.7.3 || Added "sinpow", "sinclin2" and "userdefined2" to |
@@ -691,4 +707,4 @@ Color conversions
691707
| v2.50 | ConvertToYV12 |
692708
+----------+------------------------------------------------------------+
693709

694-
$Date: 2026/02/24 20:25:00 $
710+
$Date: 2026/03/06 20:20:00 $

0 commit comments

Comments
 (0)