changeset 7284:a40ae5adf74c libavcodec

unroll another common case in vorbis_residue_decode
author lorenm
date Tue, 15 Jul 2008 23:01:15 +0000
parents 39e81fdd8d23
children 1fe3ae6a9491
files vorbis_dec.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/vorbis_dec.c	Tue Jul 15 21:30:04 2008 +0000
+++ b/vorbis_dec.c	Tue Jul 15 23:01:15 2008 +0000
@@ -1330,6 +1330,14 @@
                                         vec[voffs+k     ]+=codebook.codevectors[coffs  ];  // FPMATH
                                         vec[voffs+k+vlen]+=codebook.codevectors[coffs+1];  // FPMATH
                                     }
+                                } else if(dim==4) {
+                                    for(k=0;k<step;++k, voffs+=2) {
+                                        coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * 4;
+                                        vec[voffs       ]+=codebook.codevectors[coffs  ];  // FPMATH
+                                        vec[voffs+1     ]+=codebook.codevectors[coffs+2];  // FPMATH
+                                        vec[voffs+vlen  ]+=codebook.codevectors[coffs+1];  // FPMATH
+                                        vec[voffs+vlen+1]+=codebook.codevectors[coffs+3];  // FPMATH
+                                    }
                                 } else
                                 for(k=0;k<step;++k) {
                                     coffs=get_vlc2(gb, codebook.vlc.table, codebook.nb_bits, 3) * dim;