Skip to content

Commit

Permalink
avfilter/vf_lut2: also export video input bit depth
Browse files Browse the repository at this point in the history
Signed-off-by: Paul B Mahol <[email protected]>
  • Loading branch information
richardpl committed Sep 16, 2016
1 parent 51000b9 commit 5b509fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/filters.texi
Original file line number Diff line number Diff line change
Expand Up @@ -9352,6 +9352,12 @@ The first input value for the pixel component.

@item y
The second input value for the pixel component.

@item bdx
The first input video bit depth.

@item bdy
The second input video bit depth.
@end table

All expressions default to "x".
Expand Down
6 changes: 6 additions & 0 deletions libavfilter/vf_lut2.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ static const char *const var_names[] = {
"h", ///< height of the input video
"x", ///< input value for the pixel from input #1
"y", ///< input value for the pixel from input #2
"bdx", ///< input #1 video bitdepth
"bdy", ///< input #2 video bitdepth
NULL
};

Expand All @@ -43,6 +45,8 @@ enum var_name {
VAR_H,
VAR_X,
VAR_Y,
VAR_BITDEPTHX,
VAR_BITDEPTHY,
VAR_VARS_NB
};

Expand Down Expand Up @@ -127,6 +131,7 @@ static int config_inputx(AVFilterLink *inlink)
s->var_values[VAR_W] = inlink->w;
s->var_values[VAR_H] = inlink->h;
s->depthx = desc->comp[0].depth;
s->var_values[VAR_BITDEPTHX] = s->depthx;

return 0;
}
Expand All @@ -138,6 +143,7 @@ static int config_inputy(AVFilterLink *inlink)
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);

s->depthy = desc->comp[0].depth;
s->var_values[VAR_BITDEPTHY] = s->depthy;

return 0;
}
Expand Down

0 comments on commit 5b509fa

Please sign in to comment.