aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2016-08-14 10:00:35 +0200
committerPaul B Mahol <onemda@gmail.com>2016-08-14 10:00:35 +0200
commitec4ed2f69c240b901ef1491c752ed425cd7e9618 (patch)
tree95b70056f32e09413b34870cfdfa60605f5c1f58
parent6612d0493356e3cddad4a55e3c3467c52a9427c4 (diff)
downloadffmpeg-ec4ed2f69c240b901ef1491c752ed425cd7e9618.tar.gz
avfilter/vf_signalstats: fix saturation calculation for >8 bit
-rw-r--r--libavfilter/vf_signalstats.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavfilter/vf_signalstats.c b/libavfilter/vf_signalstats.c
index 00051f2cab..6796af8079 100644
--- a/libavfilter/vf_signalstats.c
+++ b/libavfilter/vf_signalstats.c
@@ -190,7 +190,7 @@ static int config_props(AVFilterLink *outlink)
if (!s->jobs_rets)
return AVERROR(ENOMEM);
- s->frame_sat = alloc_frame(AV_PIX_FMT_GRAY8, inlink->w, inlink->h);
+ s->frame_sat = alloc_frame(s->depth > 8 ? AV_PIX_FMT_GRAY16 : AV_PIX_FMT_GRAY8, inlink->w, inlink->h);
s->frame_hue = alloc_frame(AV_PIX_FMT_GRAY16, inlink->w, inlink->h);
if (!s->frame_sat || !s->frame_hue)
return AVERROR(ENOMEM);
@@ -799,10 +799,10 @@ static int filter_frame16(AVFilterLink *link, AVFrame *in)
AVFrame *sat = s->frame_sat;
AVFrame *hue = s->frame_hue;
- const uint8_t *p_sat = sat->data[0];
- const uint8_t *p_hue = hue->data[0];
- const int lsz_sat = sat->linesize[0];
- const int lsz_hue = hue->linesize[0];
+ const uint16_t *p_sat = (uint16_t *)sat->data[0];
+ const uint16_t *p_hue = (uint16_t *)hue->data[0];
+ const int lsz_sat = sat->linesize[0] / 2;
+ const int lsz_hue = hue->linesize[0] / 2;
ThreadDataHueSatMetrics td_huesat = {
.src = in,
.dst_sat = sat,