mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-06-16 04:32:47 +02:00
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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user