History

Support setting flags for sws.

Originally committed as revision 23041 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer committed 16 years ago

Commit 8155bbc1 parent cb0061d1 file · +6 −2Browse files

Unified · Split

libavfilter/vf_scale.c+6−2
@@ -36,6 +36,7 @@ typedef struct { · 35 unmodified lines
3636 * -1 = keep original aspect
3737 */
3838 int w, h;
39+ unsigned int flags; ///sws flags
3940
4041 int hsub, vsub; ///< chroma subsampling
4142 int slice_y; ///< top of current output slice
@@ -46,8 +47,11 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) · 4 unmodified lines
4647 {
4748 ScaleContext *scale = ctx->priv;
4849
49− if (args)
50+ scale->flags = SWS_BILINEAR;
51+ if (args){
5052 sscanf(args, "%d:%d", &scale->w, &scale->h);
53+ sscanf(strstr(args,"flags="), "flags=%i", &scale->flags);
54+ }
5155
5256 /* sanity check params */
5357 if (scale->w < -1 || scale->h < -1) {
@@ -124,7 +128,7 @@ static int config_props(AVFilterLink *outlink) · 70 unmodified lines
124128 /* TODO: make algorithm configurable */
125129 scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format,
126130 outlink->w, outlink->h, outlink->format,
127− SWS_BILINEAR, NULL, NULL, NULL);
131+ scale->flags, NULL, NULL, NULL);
128132
129133 av_log(ctx, AV_LOG_INFO, "w:%d h:%d fmt:%s\n",
130134 outlink->w, outlink->h, av_pix_fmt_descriptors[outlink->format].name);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t