diff options
author | Paul B Mahol <onemda@gmail.com> | 2013-10-01 21:22:22 +0000 |
---|---|---|
committer | Paul B Mahol <onemda@gmail.com> | 2013-10-01 21:22:22 +0000 |
commit | edadda968c249bd10d412704cf305b1565fd3f7c (patch) | |
tree | a61d525eece1db23b3d7e47249e8666bb1f658ad /libavfilter | |
parent | cac9af68a42c1c8519168fdd6c5230745949dc58 (diff) | |
download | ffmpeg-streaming-edadda968c249bd10d412704cf305b1565fd3f7c.zip ffmpeg-streaming-edadda968c249bd10d412704cf305b1565fd3f7c.tar.gz |
avfilter/vf_histogram: change order of histograms for planar rgb
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/vf_histogram.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavfilter/vf_histogram.c b/libavfilter/vf_histogram.c index 8a98bc7..273d03b 100644 --- a/libavfilter/vf_histogram.c +++ b/libavfilter/vf_histogram.c @@ -248,12 +248,13 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) switch (h->mode) { case MODE_LEVELS: for (k = 0; k < h->ncomp; k++) { + const int p = h->desc->comp[k].plane; int start = k * (h->level_height + h->scale_height) * h->display_mode; double max_hval_log; unsigned max_hval = 0; for (i = 0; i < in->height; i++) { - src = in->data[k] + i * in->linesize[k]; + src = in->data[p] + i * in->linesize[p]; for (j = 0; j < in->width; j++) h->histogram[src[j]]++; } @@ -275,11 +276,11 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) for (l = 0; l < h->ncomp; l++) out->data[l][(j + start) * out->linesize[l] + i] = h->fg_color[l]; } else { - out->data[k][(j + start) * out->linesize[k] + i] = 255; + out->data[p][(j + start) * out->linesize[p] + i] = 255; } } for (j = h->level_height + h->scale_height - 1; j >= h->level_height; j--) - out->data[k][(j + start) * out->linesize[k] + i] = i; + out->data[p][(j + start) * out->linesize[p] + i] = i; } memset(h->histogram, 0, 256 * sizeof(unsigned)); |