aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClément Bœsch <u@pkh.me>2022-12-27 18:08:21 +0100
committerClément Bœsch <u@pkh.me>2023-01-03 17:18:55 +0100
commit1340fe7caf6e3396ba412b0883859135d2602151 (patch)
treeff3da39e765c5780db66924f84b88839535c6b97
parent1ae1b707e257150b02c9d64f94d72c8cf7f09de8 (diff)
downloadffmpeg-1340fe7caf6e3396ba412b0883859135d2602151.tar.gz
avfilter/paletteuse: move r,g,b computation in a more local scope
-rw-r--r--libavfilter/vf_paletteuse.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c
index b60234e995..549e42ee0d 100644
--- a/libavfilter/vf_paletteuse.c
+++ b/libavfilter/vf_paletteuse.c
@@ -262,9 +262,6 @@ static av_always_inline int color_get(PaletteUseContext *s, uint32_t color)
static av_always_inline int get_dst_color_err(PaletteUseContext *s,
uint32_t c, int *er, int *eg, int *eb)
{
- const uint8_t r = c >> 16 & 0xff;
- const uint8_t g = c >> 8 & 0xff;
- const uint8_t b = c & 0xff;
uint32_t dstc;
const int dstx = color_get(s, c);
if (dstx < 0)
@@ -273,6 +270,9 @@ static av_always_inline int get_dst_color_err(PaletteUseContext *s,
if (dstx == s->transparency_index) {
*er = *eg = *eb = 0;
} else {
+ const uint8_t r = c >> 16 & 0xff;
+ const uint8_t g = c >> 8 & 0xff;
+ const uint8_t b = c & 0xff;
*er = (int)r - (int)(dstc >> 16 & 0xff);
*eg = (int)g - (int)(dstc >> 8 & 0xff);
*eb = (int)b - (int)(dstc & 0xff);