102 "Size and width/height expressions cannot be set at the same time.\n");
113 "Invalid size '%s'\n", scale->
size_str);
116 snprintf(buf,
sizeof(buf)-1,
"%d", scale->
w);
118 snprintf(buf,
sizeof(buf)-1,
"%d", scale->
h);
201 var_values[
VAR_A] = (double) inlink->
w / inlink->
h;
211 NULL, NULL, NULL, NULL, NULL, 0, ctx);
215 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
221 NULL, NULL, NULL, NULL, NULL, 0, ctx)) < 0)
229 if (w < -1 || h < -1) {
233 if (w == -1 && h == -1)
234 scale->
w = scale->
h = 0;
245 if (w > INT_MAX || h > INT_MAX ||
246 (h * inlink->
w) > INT_MAX ||
247 (w * inlink->
h) > INT_MAX)
263 if (inlink->
w == outlink->
w && inlink->
h == outlink->
h &&
268 outlink->
w, outlink->
h, outfmt,
269 scale->
flags, NULL, NULL, NULL);
273 outlink->
w, outlink->
h/2, outfmt,
274 scale->
flags, NULL, NULL, NULL);
278 outlink->
w, outlink->
h/2, outfmt,
279 scale->
flags, NULL, NULL, NULL);
280 if (!scale->
sws || !scale->
isws[0] || !scale->
isws[1])
289 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",
299 "Error when evaluating the expression '%s'.\n"
300 "Maybe the expression for out_w:'%s' or for out_h:'%s' is self-referencing.\n",
310 int in_stride[4],out_stride[4];
314 int vsub= ((i+1)&2) ? scale->
vsub : 0;
315 in_stride[i] = cur_pic->
linesize[i] * mul;
316 out_stride[i] = out_buf->
linesize[i] * mul;
317 in[i] = cur_pic->
data[i] + ((y>>vsub)+field) * cur_pic->
linesize[i];
318 out[i] = out_buf->
data[i] + field * out_buf->
linesize[i];
321 in[1] = cur_pic->
data[1];
323 out[1] = out_buf->
data[1];
325 return sws_scale(sws, in, in_stride, y/mul, h,
341 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
w);
343 snprintf(buf,
sizeof(buf)-1,
"%d", outlink->
h);
389 #define OFFSET(x) offsetof(ScaleContext, x)
390 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
426 .description =
NULL_IF_CONFIG_SMALL(
"Scale the input video to width:height size and/or convert the image format."),
434 .priv_class = &scale_class,
436 .
inputs = avfilter_vf_scale_inputs,
437 .
outputs = avfilter_vf_scale_outputs,