[FFmpeg-devel] [PATCH 4/4] vf_scale: add h/v_chr_pos
Michael Niedermayer
michaelni at gmx.at
Sun Jul 14 05:19:47 CEST 2013
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
libavfilter/vf_scale.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c
index 6bd9548..cc4d575 100644
--- a/libavfilter/vf_scale.c
+++ b/libavfilter/vf_scale.c
@@ -90,6 +90,9 @@ typedef struct {
char *w_expr; ///< width expression string
char *h_expr; ///< height expression string
char *flags_str;
+
+ int dst_h_chr_pos;
+ int dst_v_chr_pos;
} ScaleContext;
static av_cold int init(AVFilterContext *ctx)
@@ -286,6 +289,9 @@ static int config_props(AVFilterLink *outlink)
av_opt_set_int(*s, "dst_format", outfmt, 0);
av_opt_set_int(*s, "sws_flags", scale->flags, 0);
+ av_opt_set_int(*s, "dst_h_chr_pos", scale->dst_h_chr_pos, 0);
+ av_opt_set_int(*s, "dst_v_chr_pos", scale->dst_v_chr_pos, 0);
+
if ((ret = sws_init_context(*s, NULL, NULL)) < 0)
return ret;
}
@@ -408,6 +414,8 @@ static const AVOption scale_options[] = {
{ "interl", "set interlacing", OFFSET(interlaced), AV_OPT_TYPE_INT, {.i64 = 0 }, -1, 1, FLAGS },
{ "size", "set video size", OFFSET(size_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, FLAGS },
{ "s", "set video size", OFFSET(size_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, FLAGS },
+ { "v_chr_pos", "output vertical chroma position in luma grid/256" , OFFSET(dst_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
+ { "h_chr_pos", "output horizontal chroma position in luma grid/256", OFFSET(dst_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
{ NULL },
};
--
1.7.9.5
More information about the ffmpeg-devel
mailing list