diff msmpeg4.c @ 4668:1f1a0e67b961 libavcodec

kill av_mallocz_static() calls in init_rl()
author michael
date Wed, 14 Mar 2007 13:19:19 +0000
parents 8535fcac43c1
children 9fb6d2125500
line wrap: on
line diff
--- a/msmpeg4.c	Wed Mar 14 12:29:32 2007 +0000
+++ b/msmpeg4.c	Wed Mar 14 13:19:19 2007 +0000
@@ -91,6 +91,8 @@
 static uint8_t rl_length[NB_RL_TABLES][MAX_LEVEL+1][MAX_RUN+1][2];
 #endif //CONFIG_ENCODERS
 
+static uint8_t static_rl_table_store[NB_RL_TABLES][2][2*MAX_RUN + MAX_LEVEL + 3];
+
 static void common_init(MpegEncContext * s)
 {
     static int inited=0;
@@ -186,7 +188,7 @@
         init_mv_table(&mv_tables[0]);
         init_mv_table(&mv_tables[1]);
         for(i=0;i<NB_RL_TABLES;i++)
-            init_rl(&rl_table[i], 1);
+            init_rl(&rl_table[i], static_rl_table_store[i]);
 
         for(i=0; i<NB_RL_TABLES; i++){
             int level;
@@ -1051,7 +1053,7 @@
         done = 1;
 
         for(i=0;i<NB_RL_TABLES;i++) {
-            init_rl(&rl_table[i], 1);
+            init_rl(&rl_table[i], static_rl_table_store[i]);
             init_vlc_rl(&rl_table[i], 1);
         }
         for(i=0;i<2;i++) {