Browse code

avfilter/vf_lut2: also export video input bit depth

Signed-off-by: Paul B Mahol <onemda@gmail.com>

Paul B Mahol authored on 2016/09/16 19:35:55
Showing 2 changed files
... ...
@@ -9352,6 +9352,12 @@ The first input value for the pixel component.
9352 9352
 
9353 9353
 @item y
9354 9354
 The second input value for the pixel component.
9355
+
9356
+@item bdx
9357
+The first input video bit depth.
9358
+
9359
+@item bdy
9360
+The second input video bit depth.
9355 9361
 @end table
9356 9362
 
9357 9363
 All expressions default to "x".
... ...
@@ -35,6 +35,8 @@ static const char *const var_names[] = {
35 35
     "h",        ///< height of the input video
36 36
     "x",        ///< input value for the pixel from input #1
37 37
     "y",        ///< input value for the pixel from input #2
38
+    "bdx",      ///< input #1 video bitdepth
39
+    "bdy",      ///< input #2 video bitdepth
38 40
     NULL
39 41
 };
40 42
 
... ...
@@ -43,6 +45,8 @@ enum var_name {
43 43
     VAR_H,
44 44
     VAR_X,
45 45
     VAR_Y,
46
+    VAR_BITDEPTHX,
47
+    VAR_BITDEPTHY,
46 48
     VAR_VARS_NB
47 49
 };
48 50
 
... ...
@@ -127,6 +131,7 @@ static int config_inputx(AVFilterLink *inlink)
127 127
     s->var_values[VAR_W] = inlink->w;
128 128
     s->var_values[VAR_H] = inlink->h;
129 129
     s->depthx = desc->comp[0].depth;
130
+    s->var_values[VAR_BITDEPTHX] = s->depthx;
130 131
 
131 132
     return 0;
132 133
 }
... ...
@@ -138,6 +143,7 @@ static int config_inputy(AVFilterLink *inlink)
138 138
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
139 139
 
140 140
     s->depthy = desc->comp[0].depth;
141
+    s->var_values[VAR_BITDEPTHY] = s->depthy;
141 142
 
142 143
     return 0;
143 144
 }