Browse code

vf_scale: add output h/v_chr_pos parameterss

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

Michael Niedermayer authored on 2013/07/14 12:03:06
Showing 1 changed files
... ...
@@ -96,6 +96,9 @@ typedef struct {
96 96
 
97 97
     int in_range;
98 98
     int out_range;
99
+
100
+    int out_h_chr_pos;
101
+    int out_v_chr_pos;
99 102
 } ScaleContext;
100 103
 
101 104
 static av_cold int init(AVFilterContext *ctx)
... ...
@@ -323,6 +326,9 @@ static int config_props(AVFilterLink *outlink)
323 323
             av_opt_set_int(*s, "dst_format", outfmt, 0);
324 324
             av_opt_set_int(*s, "sws_flags", scale->flags, 0);
325 325
 
326
+            av_opt_set_int(*s, "dst_h_chr_pos", scale->out_h_chr_pos, 0);
327
+            av_opt_set_int(*s, "dst_v_chr_pos", scale->out_v_chr_pos, 0);
328
+
326 329
             if ((ret = sws_init_context(*s, NULL, NULL)) < 0)
327 330
                 return ret;
328 331
             if (!scale->interlaced)
... ...
@@ -491,6 +497,8 @@ static const AVOption scale_options[] = {
491 491
     { "mpeg",   NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
492 492
     { "tv",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_JPEG}, 0, 0, FLAGS, "range" },
493 493
     { "pc",     NULL, 0, AV_OPT_TYPE_CONST, {.i64 = AVCOL_RANGE_MPEG}, 0, 0, FLAGS, "range" },
494
+    { "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 },
495
+    { "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 },
494 496
     { NULL },
495 497
 };
496 498