[libav-commits] cabac: Mark ff_h264_mps_state array as static, it is only used within cabac .c.

Diego Biurrun git at libav.org
Fri Jan 13 01:12:14 CET 2012


Module: libav
Branch: master
Commit: 0a60780c7fe72e2f9cc41efc152b3807954b7820

Author:    Diego Biurrun <diego at biurrun.de>
Committer: Diego Biurrun <diego at biurrun.de>
Date:      Thu Jan 12 21:35:34 2012 +0100

cabac: Mark ff_h264_mps_state array as static, it is only used within cabac.c.

---

 libavcodec/cabac.c |    8 ++++----
 libavcodec/cabac.h |    1 -
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c
index 1de4584..11971f5 100644
--- a/libavcodec/cabac.c
+++ b/libavcodec/cabac.c
@@ -51,7 +51,7 @@ static const uint8_t lps_range[64][4]= {
 
 uint8_t ff_h264_mlps_state[4*64];
 uint8_t ff_h264_lps_range[4*2*64];
-uint8_t ff_h264_mps_state[2*64];
+static uint8_t h264_mps_state[2 * 64];
 
 static const uint8_t mps_state[64]= {
   1, 2, 3, 4, 5, 6, 7, 8,
@@ -140,9 +140,9 @@ void ff_init_cabac_states(CABACContext *c){
         }
 
         ff_h264_mlps_state[128+2*i+0]=
-        ff_h264_mps_state[2*i+0]= 2*mps_state[i]+0;
+        h264_mps_state[2 * i + 0] = 2 * mps_state[i] + 0;
         ff_h264_mlps_state[128+2*i+1]=
-        ff_h264_mps_state[2*i+1]= 2*mps_state[i]+1;
+        h264_mps_state[2 * i + 1] = 2 * mps_state[i] + 1;
 
         if( i ){
             ff_h264_mlps_state[128-2*i-1]= 2*lps_state[i]+0;
@@ -191,7 +191,7 @@ static void put_cabac(CABACContext *c, uint8_t * const state, int bit){
 
     if(bit == ((*state)&1)){
         c->range -= RangeLPS;
-        *state= ff_h264_mps_state[*state];
+        *state    = h264_mps_state[*state];
     }else{
         c->low += c->range - RangeLPS;
         c->range = RangeLPS;
diff --git a/libavcodec/cabac.h b/libavcodec/cabac.h
index f7d169a..ab835f9 100644
--- a/libavcodec/cabac.h
+++ b/libavcodec/cabac.h
@@ -49,7 +49,6 @@ typedef struct CABACContext{
 
 extern uint8_t ff_h264_mlps_state[4*64];
 extern uint8_t ff_h264_lps_range[4*2*64];  ///< rangeTabLPS
-extern uint8_t ff_h264_mps_state[2*64];     ///< transIdxMPS
 extern const uint8_t ff_h264_norm_shift[512];
 
 #if ARCH_X86



More information about the libav-commits mailing list