[FFmpeg-devel] [PATCH v2] swscale: Take the destination range into account for yuv->rgb->yuv conversions

Martin Storsjö martin at martin.st
Fri Feb 25 11:13:28 EET 2022


On Thu, 24 Feb 2022, Michael Niedermayer wrote:

> On Wed, Feb 23, 2022 at 09:45:53PM +0200, Martin Storsjö wrote:
>> The range parameters need to be set up before calling
>> sws_init_context (which selects which fastpaths can be used;
>> this gets called by sws_getContext); solely passing them via
>> sws_setColorspaceDetails isn't enough.
>>
>> This fixes producing full range YUV range output when doing
>> YUV->YUV conversions between different YUV color spaces.
>>
>> Signed-off-by: Martin Storsjö <martin at martin.st>
>> ---
>>  libswscale/utils.c                | 11 ++++++++---
>>  tests/fate/libswscale.mak         | 16 ++++++++++++++++
>>  tests/ref/fate/sws-yuv-colorspace |  6 ++++++
>>  tests/ref/fate/sws-yuv-range      |  6 ++++++
>>  4 files changed, 36 insertions(+), 3 deletions(-)
>>  create mode 100644 tests/ref/fate/sws-yuv-colorspace
>>  create mode 100644 tests/ref/fate/sws-yuv-range
>
> LGTM
>
> tested on mingw32/64 + wine / linux x86 32/64bit, arm/mips qemu

Thanks, pushed!

// Martin


More information about the ffmpeg-devel mailing list