[FFmpeg-devel] [PATCH] swscale: more accurate DITHER_COPY macro for full and limited range

Mateusz mateuszb at poczta.onet.pl
Mon Oct 23 11:39:35 EEST 2017


W dniu 2017-10-20 o 20:07, Jan Ekstrom pisze:
> On Fri, Oct 20, 2017 at 10:26 AM, Mateusz <mateuszb at poczta.onet.pl> wrote:
>> W dniu 2017-10-06 o 17:33, Mateusz pisze:
>>> Fixed DITHER_COPY macro (only C code), updated FATE tests.
>>>
>>> PSNR in tests that needed update goes from 50 to 999.99 -- the quality is there.
>>
>> Ping.
> 
> Hi,
> 
> The updated PSNR values look really good (and the max difference going
> from 1 to 0), but unfortunately I lack the capacity to verify that the
> code is doing the same thing as the original thing.
> 
> Can we please have someone's eyes on this? If a patchwork URL makes it
> simpler, it's https://patchwork.ffmpeg.org/patch/5440/ .
> 
> 
> Jan

There was discussion about this code in thread "swscale_unscaled: fix DITHER_COPY macro, use it only for dst_depth == 8". Conclusion was that it should be the same code for dst_depth from 8 to 15 bit (in all possible cases).

The worse quality scenario for this DITHER_COPY macro is when dst_depth is 8. It is hard to see differences from normal 8 bit to dithered 8 bit (too good quality).

I've prepared example movies with new DITHER_COPY macro versus downshift only with dst_depth == 5 (impossible in normal code, only for testing).

Movie Sintel in resolution 2K with bit depth 5 (original 5 most significant bits):
www.msystem.waw.pl/x265/sintel-org5.mkv

The same movie with bit depth 5, but dithered 5 bit instead of original:
www.msystem.waw.pl/x265/sintel-dit5.mkv

Mateusz



More information about the ffmpeg-devel mailing list