[SCM] libav/experimental: VP8: slightly faster DCT coefficient probability update

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:13:32 UTC 2013


The following commit has been merged in the experimental branch:
commit b0d58795138c738c45c5b738418765939021b49f
Author: Jason Garrett-Glaser <darkshikari at gmail.com>
Date:   Tue Aug 3 23:21:47 2010 +0000

    VP8: slightly faster DCT coefficient probability update
    
    Originally committed as revision 24687 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c
index 3863a81..2a0f93b 100644
--- a/libavcodec/vp8.c
+++ b/libavcodec/vp8.c
@@ -494,9 +494,8 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size)
                 for (l = 0; l < NUM_DCT_TOKENS-1; l++)
                     if (vp56_rac_get_prob_branchy(c, vp8_token_update_probs[i][j][k][l])) {
                         int prob = vp8_rac_get_uint(c, 8);
-                        for (m = 0; m < 16; m++)
-                            if (vp8_coeff_band[m] == j)
-                                s->prob->token[i][m][k][l] = prob;
+                        for (m = 0; vp8_coeff_band_indexes[j][m] >= 0; m++)
+                            s->prob->token[i][vp8_coeff_band_indexes[j][m]][k][l] = prob;
                     }
 
     if ((s->mbskip_enabled = vp8_rac_get(c)))
diff --git a/libavcodec/vp8data.h b/libavcodec/vp8data.h
index ce64262..775472e 100644
--- a/libavcodec/vp8data.h
+++ b/libavcodec/vp8data.h
@@ -293,6 +293,20 @@ static const uint8_t vp8_coeff_band[16] =
     0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7
 };
 
+/* Inverse of vp8_coeff_band: mappings of bands to coefficient indexes.
+ * Each list is -1-terminated. */
+static const int8_t vp8_coeff_band_indexes[8][10] =
+{
+    {0, -1},
+    {1, -1},
+    {2, -1},
+    {3, -1},
+    {5, -1},
+    {6, -1},
+    {4, 7, 8, 9, 10, 11, 12, 13, 14, -1},
+    {15, -1}
+};
+
 static const uint8_t vp8_dct_cat1_prob[] = { 159, 0 };
 static const uint8_t vp8_dct_cat2_prob[] = { 165, 145, 0 };
 static const uint8_t vp8_dct_cat3_prob[] = { 173, 148, 140, 0 };

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list