changeset 4804:39975b6c49bb libavcodec

table[index][ch] -> table[ch][index] (might be faster ...)
author michael
date Sat, 07 Apr 2007 21:15:52 +0000
parents 35e47a6e01e2
children a591ce5aaa04
files adpcm.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/adpcm.c	Sat Apr 07 20:51:58 2007 +0000
+++ b/adpcm.c	Sat Apr 07 21:15:52 2007 +0000
@@ -1312,7 +1312,7 @@
     case CODEC_ID_ADPCM_THP:
       {
         GetBitContext gb;
-        int table[16][2];
+        int table[2][16];
         unsigned int samplecnt;
         int prev1[2], prev2[2];
         int ch;
@@ -1330,7 +1330,7 @@
 
         for (ch = 0; ch < 2; ch++)
             for (i = 0; i < 16; i++)
-                table[i][ch] = get_sbits(&gb, 16);
+                table[ch][i] = get_sbits(&gb, 16);
 
         /* Initialize the previous sample.  */
         for (ch = 0; ch < 2; ch++) {
@@ -1350,8 +1350,8 @@
             for (i = 0; i < samplecnt / 14; i++) {
                 uint8_t index = get_bits (&gb, 4) & 7;
                 unsigned int exp = get_bits (&gb, 4);
-                int factor1 = table[index * 2][ch];
-                int factor2 = table[index * 2 + 1][ch];
+                int factor1 = table[ch][index * 2];
+                int factor2 = table[ch][index * 2 + 1];
 
                 /* Decode 14 samples.  */
                 for (n = 0; n < 14; n++) {