aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cabac.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-25 10:21:04 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-25 10:25:17 +0200
commit4a89868c5f9de30bb2eb3709befa33b8440264ec (patch)
treef7276b945dd83998846e6ad2d71d15a06bd38e21 /libavcodec/cabac.c
parentb0b66269f422a5c19547102c7d51504505060cc0 (diff)
parentcab8c5f8e140c96ba3725ab709d823abfd1e31a5 (diff)
downloadffmpeg-4a89868c5f9de30bb2eb3709befa33b8440264ec.tar.gz
Merge commit 'cab8c5f8e140c96ba3725ab709d823abfd1e31a5'
* commit 'cab8c5f8e140c96ba3725ab709d823abfd1e31a5': h264: do not reinitialize the global cabac tables at each slice header See: 1e2e2c8095de2d9ea3259305cfeff28f40e4ca12 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/cabac.c')
-rw-r--r--libavcodec/cabac.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/cabac.c b/libavcodec/cabac.c
index 25ddb0377b..0c02d6c168 100644
--- a/libavcodec/cabac.c
+++ b/libavcodec/cabac.c
@@ -139,6 +139,10 @@ void ff_init_cabac_decoder(CABACContext *c, const uint8_t *buf, int buf_size){
void ff_init_cabac_states(void)
{
int i, j;
+ static int initialized = 0;
+
+ if (initialized)
+ return;
for(i=0; i<64; i++){
for(j=0; j<4; j++){ //FIXME check if this is worth the 1 shift we save
@@ -163,6 +167,8 @@ void ff_init_cabac_states(void)
for(i=0; i< 63; i++){
ff_h264_last_coeff_flag_offset_8x8[i] = last_coeff_flag_offset_8x8[i];
}
+
+ initialized = 1;
}
#ifdef TEST