Change #286506
| Category | ffmpeg |
| Changed by | Zhao Zhili <zhilizhao@tencent.com> |
| Changed at | Fri 16 Oct 2026 15:13:51 |
| Repository | https://git.ffmpeg.org/ffmpeg.git |
| Project | ffmpeg |
| Branch | master |
| Revision | 6ba18c7b7ecf02032013f09674d1a73106d47e92 |
Comments
avfilter/vf_scale_cuda: add YUV to RGB color space conversion When the input colorspace is unspecified, BT.601 (SMPTE 170M) is used as the default, matching swscale behavior. Both limited and full range inputs are handled, with full range high bit depth input normalized by the code maximum. BT.2020 constant luminance is rejected, as it is not a plain matrix transform. Results are rounded to the nearest value. The conversion kernels use direct texture reads for luma and simple coordinate mapping for chroma upsampling, avoiding unnecessary Subsample_Nearest overhead since color conversion operates at the same resolution. Simultaneous resize and color conversion is rejected with an error directing users to chain separate scale_cuda instances. Hardware cropping is honored, by checking the visible frame size against the output size per frame. As the software format of CUDA frames is unknown during negotiation, the input and output color properties are negotiated independently. RGB output is always negotiated as full range RGB, so that following filters see the properties of the converted frames, while other output follows the input. Plain scaling rejects a matrix or range on the output that differs from the input, as it cannot convert the samples. Co-authored-by: Timo Rothenpieler <timo@rothenpieler.org> Co-authored-by: Reinhard Nißl <rnissl@gmx.de> Assisted-By: Claude Opus 5.5
Changed files
- libavfilter/vf_scale_cuda.c
- libavfilter/vf_scale_cuda.cu
- libavfilter/vf_scale_cuda.h