vorbis: Use a local codebook variable
authorLuca Barbato <lu_zero@gentoo.org>
Tue, 3 Mar 2015 09:32:26 +0000 (10:32 +0100)
committerLuca Barbato <lu_zero@gentoo.org>
Sun, 8 Mar 2015 13:33:02 +0000 (14:33 +0100)
Makes the code a little simpler.

libavcodec/vorbisdec.c

index 59c582b..e156c08 100644 (file)
@@ -1307,14 +1307,15 @@ static av_always_inline int setup_classifs(vorbis_context *vc,
                                            unsigned ch_used,
                                            int partition_count)
 {
+    vorbis_codebook *codebook = vc->codebooks + vr->classbook;
     int p, j, i;
-    unsigned c_p_c         = vc->codebooks[vr->classbook].dimensions;
+    unsigned c_p_c         = codebook->dimensions;
     unsigned inverse_class = ff_inverse[vr->classifications];
     unsigned temp, temp2;
     for (p = 0, j = 0; j < ch_used; ++j) {
         if (!do_not_decode[j]) {
-            temp = get_vlc2(&vc->gb, vc->codebooks[vr->classbook].vlc.table,
-                                     vc->codebooks[vr->classbook].nb_bits, 3);
+            temp = get_vlc2(&vc->gb, codebook->vlc.table,
+                                     codebook->nb_bits, 3);
 
             av_dlog(NULL, "Classword: %u\n", temp);