aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Ekström <jeebjp@gmail.com>2020-10-10 01:29:18 +0300
committerJan Ekström <jeebjp@gmail.com>2020-10-11 12:58:13 +0300
commit3fe24fe23219d28edc12c5b78a19a075d948f997 (patch)
tree349bc653d5ea40860c3046f6b76d46d1c7d2eb25
parent0c73c2909e8bedc4b034216a2a00139790523a14 (diff)
downloadffmpeg-3fe24fe23219d28edc12c5b78a19a075d948f997.tar.gz
swscale/utils: split range override check into its own function
-rw-r--r--libswscale/utils.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 9ca378bd3b..832c9f873c 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -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 ||