116 "Size and width/height expressions cannot be set at the same time.\n");
127 "Invalid size '%s'\n", scale->
size_str);
130 snprintf(buf,
sizeof(buf)-1,
"%d", scale->
w);
132 snprintf(buf,
sizeof(buf)-1,
"%d", scale->
h);
206 if (s && strstr(s,
"bt709")) {
208 }
else if (s && strstr(s,
"fcc")) {
210 }
else if (s && strstr(s,
"smpte240m")) {
212 }
else if (s && (strstr(s,
"bt601") || strstr(s,
"bt470") || strstr(s,
"smpte170m"))) {
216 if (colorspace < 1 || colorspace > 7) {
239 var_values[
VAR_A] = (double) inlink->
w / inlink->
h;
249 NULL, NULL, NULL, NULL, NULL, 0, ctx);
253 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
259 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
267 if (w < -1 || h < -1) {
271 if (w == -1 && h == -1)
272 scale->
w = scale->
h = 0;
296 if (w > INT_MAX || h > INT_MAX ||
297 (h * inlink->
w) > INT_MAX ||
298 (w * inlink->
h) > INT_MAX)
318 scale->
isws[0] = scale->
isws[1] = scale->
sws = NULL;
319 if (inlink->
w == outlink->
w && inlink->
h == outlink->
h &&
326 for (i = 0; i < 3; i++) {
366 av_log(ctx,
AV_LOG_VERBOSE,
"w:%d h:%d fmt:%s sar:%d/%d -> w:%d h:%d fmt:%s sar:%d/%d flags:0x%0x\n",
376 "Error when evaluating the expression '%s'.\n"
377 "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
387 int in_stride[4],out_stride[4];
391 int vsub= ((i+1)&2) ? scale->
vsub : 0;
392 in_stride[i] = cur_pic->
linesize[i] * mul;
393 out_stride[i] = out_buf->
linesize[i] * mul;
394 in[i] = cur_pic->
data[i] + ((y>>vsub)+field) * cur_pic->
linesize[i];
395 out[i] = out_buf->
data[i] + field * out_buf->
linesize[i];
398 in[1] = cur_pic->
data[1];
400 out[1] = out_buf->
data[1];
402 return sws_scale(sws, in, in_stride, y/mul, h,
419 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
w);
421 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
h);
459 const int *inv_table, *
table;
462 (
int **)&table, &out_full,
463 &brightness, &contrast, &saturation);
479 brightness, contrast, saturation);
483 brightness, contrast, saturation);
487 brightness, contrast, saturation);
511 #define OFFSET(x) offsetof(ScaleContext, x)
512 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
533 {
"in_v_chr_pos",
"input vertical chroma position in luma grid/256" ,
OFFSET(in_v_chr_pos),
AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512,
FLAGS },
534 {
"in_h_chr_pos",
"input horizontal chroma position in luma grid/256",
OFFSET(in_h_chr_pos),
AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512,
FLAGS },
535 {
"out_v_chr_pos",
"output vertical chroma position in luma grid/256" ,
OFFSET(out_v_chr_pos),
AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512,
FLAGS },
536 {
"out_h_chr_pos",
"output horizontal chroma position in luma grid/256",
OFFSET(out_h_chr_pos),
AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512,
FLAGS },
537 {
"force_original_aspect_ratio",
"decrease or increase w/h if necessary to keep the original AR",
OFFSET(force_original_aspect_ratio),
AV_OPT_TYPE_INT, { .i64 = 0}, 0, 2,
FLAGS,
"force_oar" },
572 .description =
NULL_IF_CONFIG_SMALL(
"Scale the input video size and/or convert the image format."),
577 .priv_class = &scale_class,
578 .
inputs = avfilter_vf_scale_inputs,
579 .
outputs = avfilter_vf_scale_outputs,