[FFmpeg-devel] [PATCH] swscale_unscaled: fix DITHER_COPY macro, use it only for dst_depth == 8

Hendrik Leppkes h.leppkes at gmail.com
Fri Sep 22 09:15:27 EEST 2017


On Fri, Sep 22, 2017 at 2:10 AM, Mateusz <mateuszb at poczta.onet.pl> wrote:
> To reduce bit depth in planar YUV or gray pixel formats ffmpeg uses DITHER_COPY macro.
> Now it makes images greener and with visible dither pattern.
>
> In my opinion there is no point to use dither tables for destination bit depth >= 9,
> we can use simple down-shift which is neutral in full and limited range -- result images
> are with the same brightness and with the same colors.
>
> For destination bit depth == 8 we could use new bit exact precise DITHER_COPY macro
> (which is slower).
>

Why would the target bitdepth matter? Both 8 and 9 bit (and any other)
should follow the same rules for a result, there is full and limited
range minimum and maximum in all of them.
In my mind, the logic should be independent of the target bitdepth,
perhaps minus optimizations for speed for the more common cases.

- Hendrik


More information about the ffmpeg-devel mailing list