diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-03 19:49:04 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-03 19:49:04 +0400 |
commit | 79a1d98676d3284ba5cbed90e63e326fa4764a11 (patch) | |
tree | 05c4508a2ad06ef48b75c01c945847b9a73648bd /libavfilter/vf_lut.c | |
parent | 24e90d0c05194ed92c35babf674cb219f5e1377a (diff) |
vf_lut: optimize planar case
2500 -> 1900 cpu cycles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_lut.c')
-rw-r--r-- | libavfilter/vf_lut.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index 41199165c0..2dcd0a153c 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -318,8 +318,10 @@ static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir) outrow = outpic->data[plane] + (y>>vsub) * outpic->linesize[plane]; for (i = 0; i < h>>vsub; i ++) { - for (j = 0; j < inlink->w>>hsub; j++) - outrow[j] = lut->lut[plane][inrow[j]]; + const uint8_t *tab = lut->lut[plane]; + int w = inlink->w>>hsub; + for (j = 0; j < w; j++) + outrow[j] = tab[inrow[j]]; inrow += inpic ->linesize[plane]; outrow += outpic->linesize[plane]; } |