• Niklas Haas's avatar
    swscale: fix sws_setColorspaceDetails after sws_init_context · cedf589c
    Niklas Haas authored
    More commonly, this fixes the case of sws_setColorspaceDetails after
    sws_getContext, since the latter implies sws_init_context.
    
    The problem here is that sws_init_context sets up the range conversion
    and fast path tables based on the values of srcRange/dstRange at init
    time. This may result in locking in a "wrong" path (either using
    unscaled fast path when range conversion later required, or using
    scaled slow path when range conversion becomes no longer required).
    
    There are two way outs:
    
    1. Always initialize range conversion and unscaled converters, even if
       they will be unused, and extend the runtime check.
    2. Re-do initialization if the values change after
       sws_setColorspaceDetails.
    
    I opted for approach 1 because it was simpler and easier to reason
    about.
    
    Reword the av_log message to make it clear that this special converter
    is not necessarily used, depending on whether or not there is range
    conversion or YUV matrix conversion going on.
    cedf589c
Name
Last commit
Last update
..
aarch64 Loading commit data...
arm Loading commit data...
loongarch Loading commit data...
ppc Loading commit data...
riscv Loading commit data...
tests Loading commit data...
x86 Loading commit data...
Makefile Loading commit data...
alphablend.c Loading commit data...
bayer_template.c Loading commit data...
gamma.c Loading commit data...
half2float.c Loading commit data...
hscale.c Loading commit data...
hscale_fast_bilinear.c Loading commit data...
input.c Loading commit data...
libswscale.v Loading commit data...
log2_tab.c Loading commit data...
options.c Loading commit data...
output.c Loading commit data...
rgb2rgb.c Loading commit data...
rgb2rgb.h Loading commit data...
rgb2rgb_template.c Loading commit data...
slice.c Loading commit data...
swscale.c Loading commit data...
swscale.h Loading commit data...
swscale_internal.h Loading commit data...
swscale_unscaled.c Loading commit data...
swscaleres.rc Loading commit data...
utils.c Loading commit data...
version.c Loading commit data...
version.h Loading commit data...
version_major.h Loading commit data...
vscale.c Loading commit data...
yuv2rgb.c Loading commit data...