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;
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)
346 if (inlink->
w == outlink->
w && inlink->
h == outlink->
h &&
353 for (i = 0; i < 3; i++) {
380 scale->
in_v_chr_pos = (i == 0) ? 128 : (i == 1) ? 64 : 192;
404 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",
414 "Error when evaluating the expression '%s'.\n"
415 "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
425 int in_stride[4],out_stride[4];
429 int vsub= ((i+1)&2) ? scale->
vsub : 0;
430 in_stride[i] = cur_pic->
linesize[i] * mul;
431 out_stride[i] = out_buf->
linesize[i] * mul;
432 in[i] = cur_pic->
data[i] + ((y>>vsub)+field) * cur_pic->
linesize[i];
433 out[i] = out_buf->
data[i] + field * out_buf->
linesize[i];
436 in[1] = cur_pic->
data[1];
438 out[1] = out_buf->
data[1];
440 return sws_scale(sws, in, in_stride, y/mul, h,
457 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
w);
459 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
h);
497 const int *inv_table, *
table;
500 (
int **)&table, &out_full,
501 &brightness, &contrast, &saturation);
517 brightness, contrast, saturation);
521 brightness, contrast, saturation);
525 brightness, contrast, saturation);
549 #define OFFSET(x) offsetof(ScaleContext, x)
550 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
571 {
"in_v_chr_pos",
"input vertical chroma position in luma grid/256" ,
OFFSET(in_v_chr_pos),
AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512,
FLAGS },
572 {
"in_h_chr_pos",
"input horizontal chroma position in luma grid/256",
OFFSET(in_h_chr_pos),
AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512,
FLAGS },
573 {
"out_v_chr_pos",
"output vertical chroma position in luma grid/256" ,
OFFSET(out_v_chr_pos),
AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512,
FLAGS },
574 {
"out_h_chr_pos",
"output horizontal chroma position in luma grid/256",
OFFSET(out_h_chr_pos),
AV_OPT_TYPE_INT, { .i64 = -513}, -513, 512,
FLAGS },
575 {
"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" },
611 .description =
NULL_IF_CONFIG_SMALL(
"Scale the input video size and/or convert the image format."),
616 .priv_class = &scale_class,
617 .
inputs = avfilter_vf_scale_inputs,
618 .
outputs = avfilter_vf_scale_outputs,