[FFmpeg-trac] #10839(swscale:new): incorrect YCoCg to RGB conversion in swscale

FFmpeg trac at avcodec.org
Wed Jan 31 21:56:01 EET 2024


#10839: incorrect YCoCg to RGB conversion in swscale
-------------------------------------+-------------------------------------
             Reporter:  Connor       |                     Type:  defect
  Worley                             |
               Status:  new          |                 Priority:  wish
            Component:  swscale      |                  Version:
                                     |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Per https://trac.ffmpeg.org/wiki/colorspace

 >The term "YUV" is ambiguous and often used wrongly, including the
 definition of pixel formats in FFmpeg. A more accurate term for how color
 is stored in digital video would be ​YCbCr.

 When converting AV_PIX_FMT_YUV* to RGB in swscale, a YCbCr matrix is
 selected for AVCOL_SPC_YCOCG, and incorrect color is produced.

 This happens here:
 https://git.videolan.org/?p=ffmpeg.git;a=blob;f=libswscale/yuv2rgb.c;h=0a84b662f9c15a3ee3b4e482ed91212e3f99ff43;hb=HEAD#l64

 To fix this, AVCOL_SPC_YCOCG should not use a YCbCr conversion matrix. The
 YCoCg conversion matrix can be found at
 https://en.wikipedia.org/wiki/YCoCg
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10839>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list