mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
swscale/utils: split range override check into its own function
This commit is contained in:
parent
0c73c2909e
commit
3fe24fe232
@ -864,6 +864,11 @@ static void fill_xyztables(struct SwsContext *c)
|
||||
}
|
||||
}
|
||||
|
||||
static int range_override_needed(enum AVPixelFormat format)
|
||||
{
|
||||
return !isYUV(format) && !isGray(format);
|
||||
}
|
||||
|
||||
int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
|
||||
int srcRange, const int table[4], int dstRange,
|
||||
int brightness, int contrast, int saturation)
|
||||
@ -876,9 +881,9 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
|
||||
desc_dst = av_pix_fmt_desc_get(c->dstFormat);
|
||||
desc_src = av_pix_fmt_desc_get(c->srcFormat);
|
||||
|
||||
if(!isYUV(c->dstFormat) && !isGray(c->dstFormat))
|
||||
if(range_override_needed(c->dstFormat))
|
||||
dstRange = 0;
|
||||
if(!isYUV(c->srcFormat) && !isGray(c->srcFormat))
|
||||
if(range_override_needed(c->srcFormat))
|
||||
srcRange = 0;
|
||||
|
||||
if (c->srcRange != srcRange ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user