Skip to content
Snippets Groups Projects
Commit 21c2e201 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

vf_lut: correct color/comp permutation


Fixes Ticket2225

Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent c87c2d0d
No related branches found
No related tags found
No related merge requests found
...@@ -178,7 +178,7 @@ static int config_props(AVFilterLink *inlink) ...@@ -178,7 +178,7 @@ static int config_props(AVFilterLink *inlink)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
uint8_t rgba_map[4]; /* component index -> RGBA color index map */ uint8_t rgba_map[4]; /* component index -> RGBA color index map */
int min[4], max[4]; int min[4], max[4];
int val, comp, ret; int val, color, ret;
lut->hsub = desc->log2_chroma_w; lut->hsub = desc->log2_chroma_w;
lut->vsub = desc->log2_chroma_h; lut->vsub = desc->log2_chroma_h;
...@@ -213,9 +213,9 @@ static int config_props(AVFilterLink *inlink) ...@@ -213,9 +213,9 @@ static int config_props(AVFilterLink *inlink)
lut->step = av_get_bits_per_pixel(desc) >> 3; lut->step = av_get_bits_per_pixel(desc) >> 3;
} }
for (comp = 0; comp < desc->nb_components; comp++) { for (color = 0; color < desc->nb_components; color++) {
double res; double res;
int color = lut->is_rgb ? rgba_map[comp] : comp; int comp = lut->is_rgb ? rgba_map[color] : color;
/* create the parsed expression */ /* create the parsed expression */
ret = av_expr_parse(&lut->comp_expr[color], lut->comp_expr_str[color], ret = av_expr_parse(&lut->comp_expr[color], lut->comp_expr_str[color],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment