[FFmpeg-cvslog] vf_lut: optimize planar case

Michael Niedermayer git at videolan.org
Tue Apr 3 18:44:24 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Apr  3 17:49:04 2012 +0200| [79a1d98676d3284ba5cbed90e63e326fa4764a11] | committer: Michael Niedermayer

vf_lut: optimize planar case

2500 -> 1900 cpu cycles

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=79a1d98676d3284ba5cbed90e63e326fa4764a11
---

 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 4119916..2dcd0a1 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];
             }



More information about the ffmpeg-cvslog mailing list