[FFmpeg-cvslog] avfilter/vf_vectorscope: change intensity to float
Paul B Mahol
git at videolan.org
Fri Sep 4 20:50:03 CEST 2015
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Fri Sep 4 18:47:46 2015 +0000| [f011e98cb17b123c18babf49b48e4878e37399a3] | committer: Paul B Mahol
avfilter/vf_vectorscope: change intensity to float
Signed-off-by: Paul B Mahol <onemda at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f011e98cb17b123c18babf49b48e4878e37399a3
---
libavfilter/vf_vectorscope.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/libavfilter/vf_vectorscope.c b/libavfilter/vf_vectorscope.c
index 60a75ef..42052e6 100644
--- a/libavfilter/vf_vectorscope.c
+++ b/libavfilter/vf_vectorscope.c
@@ -40,6 +40,7 @@ typedef struct VectorscopeContext {
const AVClass *class;
int mode;
int intensity;
+ float fintensity;
const uint8_t *bg_color;
int planewidth[4];
int planeheight[4];
@@ -63,8 +64,8 @@ static const AVOption vectorscope_options[] = {
{ "color4", 0, 0, AV_OPT_TYPE_CONST, {.i64=COLOR4}, 0, 0, FLAGS, "mode" },
{ "x", "set color component on X axis", OFFSET(x), AV_OPT_TYPE_INT, {.i64=1}, 0, 2, FLAGS},
{ "y", "set color component on Y axis", OFFSET(y), AV_OPT_TYPE_INT, {.i64=2}, 0, 2, FLAGS},
- { "intensity", "set intensity", OFFSET(intensity), AV_OPT_TYPE_INT, {.i64=1}, 1, 255, FLAGS},
- { "i", "set intensity", OFFSET(intensity), AV_OPT_TYPE_INT, {.i64=1}, 1, 255, FLAGS},
+ { "intensity", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.004}, 0, 1, FLAGS},
+ { "i", "set intensity", OFFSET(fintensity), AV_OPT_TYPE_FLOAT, {.dbl=0.004}, 0, 1, FLAGS},
{ "envelope", "set envelope", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope"},
{ "e", "set envelope", OFFSET(envelope), AV_OPT_TYPE_INT, {.i64=0}, 0, 3, FLAGS, "envelope"},
{ "none", 0, 0, AV_OPT_TYPE_CONST, {.i64=0}, 0, 0, FLAGS, "envelope" },
@@ -187,7 +188,9 @@ static int config_output(AVFilterLink *outlink)
{
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(outlink->format);
const int depth = desc->comp[0].depth_minus1 + 1;
+ VectorscopeContext *s = outlink->src->priv;
+ s->intensity = s->fintensity * ((1 << depth) - 1);
outlink->h = outlink->w = 1 << depth;
outlink->sample_aspect_ratio = (AVRational){1,1};
return 0;
More information about the ffmpeg-cvslog
mailing list