121 "Size and width/height expressions cannot be set at the same time.\n");
132 "Invalid size '%s'\n", scale->
size_str);
135 snprintf(buf,
sizeof(buf)-1,
"%d", scale->
w);
137 snprintf(buf,
sizeof(buf)-1,
"%d", scale->
h);
211 if (s && strstr(s,
"bt709")) {
213 }
else if (s && strstr(s,
"fcc")) {
215 }
else if (s && strstr(s,
"smpte240m")) {
217 }
else if (s && (strstr(s,
"bt601") || strstr(s,
"bt470") || strstr(s,
"smpte170m"))) {
221 if (colorspace < 1 || colorspace > 7) {
240 int factor_w, factor_h;
246 var_values[
VAR_A] = (double) inlink->
w / inlink->
h;
258 NULL, NULL, NULL, NULL, NULL, 0, ctx);
262 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
268 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
287 scale->
w = scale->
h = 0;
298 w =
av_rescale(h, inlink->
w, inlink->
h * factor_w) * factor_w;
300 h =
av_rescale(w, inlink->
h, inlink->
w * factor_h) * factor_h;
317 if (w > INT_MAX || h > INT_MAX ||
318 (h * inlink->
w) > INT_MAX ||
319 (w * inlink->
h) > INT_MAX)
339 scale->
isws[0] = scale->
isws[1] = scale->
sws = NULL;
340 if (inlink->
w == outlink->
w && inlink->
h == outlink->
h &&
347 for (i = 0; i < 3; i++) {
387 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",
397 "Error when evaluating the expression '%s'.\n"
398 "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
408 int in_stride[4],out_stride[4];
412 int vsub= ((i+1)&2) ? scale->
vsub : 0;
413 in_stride[i] = cur_pic->
linesize[i] * mul;
414 out_stride[i] = out_buf->
linesize[i] * mul;
415 in[i] = cur_pic->
data[i] + ((y>>vsub)+field) * cur_pic->
linesize[i];
416 out[i] = out_buf->
data[i] + field * out_buf->
linesize[i];
419 in[1] = cur_pic->
data[1];
421 out[1] = out_buf->
data[1];
423 return sws_scale(sws, in, in_stride, y/mul, h,
440 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
w);
442 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
h);
480 const int *inv_table, *
table;
483 (
int **)&table, &out_full,
484 &brightness, &contrast, &saturation);
500 brightness, contrast, saturation);
504 brightness, contrast, saturation);
508 brightness, contrast, saturation);
532 #define OFFSET(x) offsetof(ScaleContext, x)
533 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
554 {
"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 },
555 {
"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 },
556 {
"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 },
557 {
"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 },
558 {
"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" },
593 .description =
NULL_IF_CONFIG_SMALL(
"Scale the input video size and/or convert the image format."),
598 .priv_class = &scale_class,
599 .
inputs = avfilter_vf_scale_inputs,
600 .
outputs = avfilter_vf_scale_outputs,