[FFmpeg-trac] #3801(undetermined:reopened): SWSCALE: Incorrect Values (+-1) in Full Range Conversion RGB to YCbCr

FFmpeg trac at avcodec.org
Sat May 15 06:29:32 EEST 2021

#3801: SWSCALE: Incorrect Values (+-1) in Full Range Conversion RGB to YCbCr
             Reporter:  troy_s       |                    Owner:  (none)
                 Type:  defect       |                   Status:  reopened
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:
             Keywords:  range        |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
Comment (by Balling):

 Right, so test-full-444-out.png has 1.0 gAMA png chunk. How beautiful. You
 know that Photoshop, Paint and GIMP until my fixes and FFmpeg do not
 support gAMA or cHRM chunks? While Chrome, Mozilla and Windows photo
 viewer do support it? Let me guess, considering your ramp from 0 to 255
 uses 186 as Cb=Cr with applying gAMA, gAMA of 1.0 is actually NOT CORRECT,
 because without applying it (and falling back to sRGB) it will be 128 for
 Cb=Cr??? WTF. Are you serious right now? Okay, whatever. P.S. test-full-
 diff.png​ also has 1.0 gAMA.

 That means you do understand PNG spec or gAMA too. Wow, just wow.
 exiftool test-full-444-out.png

 [Color Type                      : RGB
 Compression                     : Deflate/Inflate
 Filter                          : Adaptive
 Interlace                       : Noninterlaced
 Gamma                           : 1
 Background Color                : 255 255 255
 Pixels Per Unit X               : 72
 Pixels Per Unit Y               : 72
 Pixel Units                     : Unknown]

 So I need to remove gAMA with pngcrush -m 3 -rem gAMA:
Ticket URL: <https://trac.ffmpeg.org/ticket/3801#comment:7>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list