aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/qrencode.c
diff options
context:
space:
mode:
authorNiklas Haas <git@haasn.dev>2024-01-31 11:47:30 +0100
committerNiklas Haas <git@haasn.dev>2024-02-06 11:30:10 +0100
commitce81237d638214dd3fd64579805f67028f5bf144 (patch)
treeb1c295366c1290f7759358e30b54cb93c07b8c5c /libavfilter/qrencode.c
parent8264f3612c2c6dfff05587175854b62650ac917c (diff)
downloadffmpeg-ce81237d638214dd3fd64579805f67028f5bf144.tar.gz
avfilter: pass link YUV colorspace to ff_draw_init2
This makes all ff_draw_* based filters aware of YUV colorspaces and ranges. Needed for YUVJ removal. Also fixes a bug where e.g. vf_pad would generate a limited range background even after conversion to full-scale grayscale. The FATE changes were a consequence of the aforementioned bugfix - the gray scale files are output as full range (due to conversion by libswscale, which hard-codes gray = full), and appropriately tagged as such, but before this change the padded version incorrectly used a limited range (16) black background for these formats.
Diffstat (limited to 'libavfilter/qrencode.c')
-rw-r--r--libavfilter/qrencode.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavfilter/qrencode.c b/libavfilter/qrencode.c
index 09af8dfb4e..6b86e01f57 100644
--- a/libavfilter/qrencode.c
+++ b/libavfilter/qrencode.c
@@ -638,7 +638,7 @@ static int qrencodesrc_config_props(AVFilterLink *outlink)
ff_draw_color(&qr->draw, &qr->draw_foreground_color, (const uint8_t *)&qr->foreground_color);
ff_draw_color(&qr->draw, &qr->draw_background_color, (const uint8_t *)&qr->background_color);
- ff_draw_init(&qr->draw0, outlink->format, FF_DRAW_PROCESS_ALPHA);
+ ff_draw_init2(&qr->draw0, outlink->format, outlink->colorspace, outlink->color_range, FF_DRAW_PROCESS_ALPHA);
ff_draw_color(&qr->draw0, &qr->draw0_background_color, (const uint8_t *)&qr->background_color);
outlink->w = qr->rendered_padded_qrcode_width;
@@ -730,7 +730,8 @@ static int qrencode_config_input(AVFilterLink *inlink)
qr->is_source = 0;
- ff_draw_init(&qr->draw, inlink->format, FF_DRAW_PROCESS_ALPHA);
+ ff_draw_init2(&qr->draw, inlink->format, inlink->colorspace, inlink->color_range,
+ FF_DRAW_PROCESS_ALPHA);
V(W) = V(main_w) = inlink->w;
V(H) = V(main_h) = inlink->h;
@@ -759,7 +760,8 @@ static int qrencode_config_input(AVFilterLink *inlink)
PARSE_EXPR(rendered_qrcode_width);
PARSE_EXPR(rendered_padded_qrcode_width);
- ff_draw_init(&qr->draw, inlink->format, FF_DRAW_PROCESS_ALPHA);
+ ff_draw_init2(&qr->draw, inlink->format, inlink->colorspace, inlink->color_range,
+ FF_DRAW_PROCESS_ALPHA);
ff_draw_color(&qr->draw, &qr->draw_foreground_color, (const uint8_t *)&qr->foreground_color);
ff_draw_color(&qr->draw, &qr->draw_background_color, (const uint8_t *)&qr->background_color);