Originally committed as revision 23041 to svn://svn.ffmpeg.org/ffmpeg/trunk
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -36,6 +36,7 @@ typedef struct { · 35 unmodified lines | ||
| 36 | 36 | * -1 = keep original aspect |
| 37 | 37 | */ |
| 38 | 38 | int w, h; |
| 39 | + unsigned int flags; ///sws flags | |
| 39 | 40 | |
| 40 | 41 | int hsub, vsub; ///< chroma subsampling |
| 41 | 42 | 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 | ||
| 46 | 47 | { |
| 47 | 48 | ScaleContext *scale = ctx->priv; |
| 48 | 49 | |
| 49 | − if (args) | |
| 50 | + scale->flags = SWS_BILINEAR; | |
| 51 | + if (args){ | |
| 50 | 52 | sscanf(args, "%d:%d", &scale->w, &scale->h); |
| 53 | + sscanf(strstr(args,"flags="), "flags=%i", &scale->flags); | |
| 54 | + } | |
| 51 | 55 | |
| 52 | 56 | /* sanity check params */ |
| 53 | 57 | if (scale->w < -1 || scale->h < -1) { |
| @@ -124,7 +128,7 @@ static int config_props(AVFilterLink *outlink) · 70 unmodified lines | ||
| 124 | 128 | /* TODO: make algorithm configurable */ |
| 125 | 129 | scale->sws = sws_getContext(inlink ->w, inlink ->h, inlink ->format, |
| 126 | 130 | outlink->w, outlink->h, outlink->format, |
| 127 | − SWS_BILINEAR, NULL, NULL, NULL); | |
| 131 | + scale->flags, NULL, NULL, NULL); | |
| 128 | 132 | |
| 129 | 133 | av_log(ctx, AV_LOG_INFO, "w:%d h:%d fmt:%s\n", |
| 130 | 134 | outlink->w, outlink->h, av_pix_fmt_descriptors[outlink->format].name); |