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