diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-11-04 14:18:09 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-11-04 15:23:26 +0100 |
commit | d0ac60730d26f1d59817c675806ed199abbef906 (patch) | |
tree | f5e7362ed534a65eb1a9bda25ae97f20ab004e23 /libavfilter/vf_scale.c | |
parent | fb10b43fc42b278c856eb98df524048500648ea4 (diff) | |
download | ffmpeg-streaming-d0ac60730d26f1d59817c675806ed199abbef906.zip ffmpeg-streaming-d0ac60730d26f1d59817c675806ed199abbef906.tar.gz |
avfilter/vf_scale: add ov/hsub
Suggested-by: divVerent
Reviewed-by: Stefano
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_scale.c')
-rw-r--r-- | libavfilter/vf_scale.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 283c0b7..2e692cf 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -51,6 +51,8 @@ static const char *const var_names[] = { "dar", "hsub", "vsub", + "ohsub", + "ovsub", NULL }; @@ -64,6 +66,8 @@ enum var_name { VAR_DAR, VAR_HSUB, VAR_VSUB, + VAR_OHSUB, + VAR_OVSUB, VARS_NB }; @@ -227,6 +231,7 @@ static int config_props(AVFilterLink *outlink) enum AVPixelFormat outfmt = outlink->format; ScaleContext *scale = ctx->priv; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format); + const AVPixFmtDescriptor *out_desc = av_pix_fmt_desc_get(outlink->format); int64_t w, h; double var_values[VARS_NB], res; char *expr; @@ -242,6 +247,8 @@ static int config_props(AVFilterLink *outlink) var_values[VAR_DAR] = var_values[VAR_A] * var_values[VAR_SAR]; var_values[VAR_HSUB] = 1 << desc->log2_chroma_w; var_values[VAR_VSUB] = 1 << desc->log2_chroma_h; + var_values[VAR_OHSUB] = 1 << out_desc->log2_chroma_w; + var_values[VAR_OVSUB] = 1 << out_desc->log2_chroma_h; /* evaluate width and height */ av_expr_parse_and_eval(&res, (expr = scale->w_expr), |