aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/cabac_functions.h
diff options
context:
space:
mode:
authorRoland Scheidegger <rscheidegger_lists@hispeed.ch>2012-04-27 22:19:38 +0200
committerRonald S. Bultje <rsbultje@gmail.com>2012-04-28 08:26:12 -0700
commit14e9ffc1e41424a530c83310611979c0d246417b (patch)
tree040221d31e034879cbd748926f1c53c8e1b259e9 /libavcodec/cabac_functions.h
parent444f47b55c17f8e1207caeb67f3c529a23e3ae61 (diff)
downloadffmpeg-14e9ffc1e41424a530c83310611979c0d246417b.tar.gz
h264: use one table instead of several for cabac functions
The reason is this is easier for PIC code (in particular on darwin...). Keep the old names as pointers (static in cabac_functions.h so gcc knows these are just immediate offsets) so the c code can nicely stay the same (alternatively could use offsets directly in the functions needing the tables). This should produce the same code as before with non-pic and better code (confirmed) with pic. The assembly uses the new table but still won't work for PIC case. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'libavcodec/cabac_functions.h')
-rw-r--r--libavcodec/cabac_functions.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavcodec/cabac_functions.h b/libavcodec/cabac_functions.h
index 4c74cf7b23..484ba85db6 100644
--- a/libavcodec/cabac_functions.h
+++ b/libavcodec/cabac_functions.h
@@ -36,9 +36,11 @@
# include "x86/cabac.h"
#endif
-extern const uint8_t ff_h264_norm_shift[512];
-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_cabac_tables[512 + 4*2*64 + 4*64 + 63];
+static uint8_t * const ff_h264_norm_shift = ff_h264_cabac_tables + H264_NORM_SHIFT_OFFSET;
+static uint8_t * const ff_h264_lps_range = ff_h264_cabac_tables + H264_LPS_RANGE_OFFSET;
+static uint8_t * const ff_h264_mlps_state = ff_h264_cabac_tables + H264_MLPS_STATE_OFFSET;
+static uint8_t * const ff_h264_last_coeff_flag_offset_8x8 = ff_h264_cabac_tables + H264_LAST_COEFF_FLAG_OFFSET_8x8_OFFSET;
static void refill(CABACContext *c){
#if CABAC_BITS == 16