Browse code

vf_scale: add input h/v_chr_pos parameters

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2013/07/25 01:33:58
Showing 2 changed files
... ...
@@ -31,7 +31,7 @@
31 31
 
32 32
 #define LIBAVFILTER_VERSION_MAJOR  3
33 33
 #define LIBAVFILTER_VERSION_MINOR  81
34
-#define LIBAVFILTER_VERSION_MICRO 102
34
+#define LIBAVFILTER_VERSION_MICRO 103
35 35
 
36 36
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
37 37
                                                LIBAVFILTER_VERSION_MINOR, \
... ...
@@ -99,6 +99,8 @@ typedef struct {
99 99
 
100 100
     int out_h_chr_pos;
101 101
     int out_v_chr_pos;
102
+    int in_h_chr_pos;
103
+    int in_v_chr_pos;
102 104
 } ScaleContext;
103 105
 
104 106
 static av_cold int init(AVFilterContext *ctx)
... ...
@@ -326,6 +328,8 @@ static int config_props(AVFilterLink *outlink)
326 326
             av_opt_set_int(*s, "dst_format", outfmt, 0);
327 327
             av_opt_set_int(*s, "sws_flags", scale->flags, 0);
328 328
 
329
+            av_opt_set_int(*s, "src_h_chr_pos", scale->in_h_chr_pos, 0);
330
+            av_opt_set_int(*s, "src_v_chr_pos", scale->in_v_chr_pos, 0);
329 331
             av_opt_set_int(*s, "dst_h_chr_pos", scale->out_h_chr_pos, 0);
330 332
             av_opt_set_int(*s, "dst_v_chr_pos", scale->out_v_chr_pos, 0);
331 333
 
... ...
@@ -497,6 +501,8 @@ static const AVOption scale_options[] = {
497 497
     { "mpeg",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
498 498
     { "tv",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG}, 0, 0, FLAGS, "range" },
499 499
     { "pc",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
500
+    { "in_v_chr_pos",   "input vertical chroma position in luma grid/256"  , OFFSET(in_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
501
+    { "in_h_chr_pos",   "input horizontal chroma position in luma grid/256", OFFSET(in_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
500 502
     { "out_v_chr_pos",   "output vertical chroma position in luma grid/256"  , OFFSET(out_v_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
501 503
     { "out_h_chr_pos",   "output horizontal chroma position in luma grid/256", OFFSET(out_h_chr_pos), AV_OPT_TYPE_INT, { .i64 = -1}, -1, 512, FLAGS },
502 504
     { NULL },