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);
217 if (s && strstr(s,
"bt709")) {
219 }
else if (s && strstr(s,
"fcc")) {
221 }
else if (s && strstr(s,
"smpte240m")) {
223 }
else if (s && (strstr(s,
"bt601") || strstr(s,
"bt470") || strstr(s,
"smpte170m"))) {
227 if (colorspace < 1 || colorspace > 7) {
243 double var_values[
VARS_NB], res;
246 int factor_w, factor_h;
252 var_values[
VAR_A] = (double) inlink->
w / inlink->
h;
264 NULL, NULL, NULL, NULL, NULL, 0, ctx);
268 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
274 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
293 scale->
w = scale->
h = 0;
304 w =
av_rescale(h, inlink->
w, inlink->
h * factor_w) * factor_w;
306 h =
av_rescale(w, inlink->
h, inlink->
w * factor_h) * factor_h;
323 if (w > INT_MAX || h > INT_MAX ||
324 (h * inlink->
w) > INT_MAX ||
325 (w * inlink->
h) > INT_MAX)
345 scale->
isws[0] = scale->
isws[1] = scale->
sws = NULL;
346 if (inlink->
w == outlink->
w && inlink->
h == outlink->
h &&
353 for (i = 0; i < 3; i++) {
393 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",
403 "Error when evaluating the expression '%s'.\n"
404 "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
414 int in_stride[4],out_stride[4];
418 int vsub= ((i+1)&2) ? scale->
vsub : 0;
419 in_stride[i] = cur_pic->
linesize[i] * mul;
420 out_stride[i] = out_buf->
linesize[i] * mul;
421 in[i] = cur_pic->
data[i] + ((y>>vsub)+field) * cur_pic->
linesize[i];
422 out[i] = out_buf->
data[i] + field * out_buf->
linesize[i];
425 in[1] = cur_pic->
data[1];
427 out[1] = out_buf->
data[1];
429 return sws_scale(sws, in, in_stride, y/mul, h,
446 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
w);
448 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
h);
486 const int *inv_table, *
table;
489 (
int **)&table, &out_full,
490 &brightness, &contrast, &saturation);
506 brightness, contrast, saturation);
510 brightness, contrast, saturation);
514 brightness, contrast, saturation);
538 #define OFFSET(x) offsetof(ScaleContext, x)
539 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
560 {
"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 },
561 {
"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 },
562 {
"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 },
563 {
"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 },
564 {
"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" },
599 .description =
NULL_IF_CONFIG_SMALL(
"Scale the input video size and/or convert the image format."),
604 .priv_class = &scale_class,
605 .
inputs = avfilter_vf_scale_inputs,
606 .
outputs = avfilter_vf_scale_outputs,