[FFmpeg-cvslog] huffyuvdec: remove superfluous check in BGR code

Christophe Gisquet git at videolan.org
Thu Jun 5 02:49:04 CEST 2014


ffmpeg | branch: master | Christophe Gisquet <christophe.gisquet at gmail.com> | Wed Jun  4 20:48:59 2014 +0000| [0d632b35a04f4a54e7cd228c85cbad82549182ec] | committer: Michael Niedermayer

huffyuvdec: remove superfluous check in BGR code

Before: 154861 decicycles
After:  152912 decicycles

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

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

 libavcodec/huffyuvdec.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index dc803cd..6c925d3 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -729,10 +729,10 @@ static av_always_inline void decode_bgr_1(HYuvContext *s, int count,
 
         UPDATE_CACHE(re, &s->gb);
         index = SHOW_UBITS(re, &s->gb, VLC_BITS);
-        code  = s->vlc[4].table[index][0];
         n     = s->vlc[4].table[index][1];
 
-        if (code != -1) {
+        if (n>0) {
+            code  = s->vlc[4].table[index][0];
             *(uint32_t*)&s->temp[0][4 * i] = s->pix_bgr_map[code];
             LAST_SKIP_BITS(re, &s->gb, n);
         } else {



More information about the ffmpeg-cvslog mailing list