diff options
author | Roland Scheidegger <rscheidegger_lists@hispeed.ch> | 2012-04-27 22:12:19 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-28 20:02:27 +0200 |
commit | 7f668cd2b5f13afa0de9f593948ce2f703ab5aaa (patch) | |
tree | 4755bc3a5668cf24d7c83db139ebab1baa529e64 /libavcodec/h264_cabac.c | |
parent | e52b96187b5451d44ec9bbbb4b6151aebac8b559 (diff) | |
download | ffmpeg-7f668cd2b5f13afa0de9f593948ce2f703ab5aaa.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: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264_cabac.c')
-rw-r--r-- | libavcodec/h264_cabac.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c index 65f2cb4dc8..29dbd7aa6e 100644 --- a/libavcodec/h264_cabac.c +++ b/libavcodec/h264_cabac.c @@ -1561,13 +1561,6 @@ static av_always_inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx, return base_ctx[cat] + ctx; } -DECLARE_ASM_CONST(1, uint8_t, last_coeff_flag_offset_8x8)[63] = { - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, - 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8 -}; - static av_always_inline void decode_cabac_residual_internal(H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, @@ -1670,7 +1663,7 @@ decode_cabac_residual_internal(H264Context *h, DCTELEM *block, last_coeff_ctx_base-significant_coeff_ctx_base); } #else - DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] ); + DECODE_SIGNIFICANCE( 63, sig_off[last], ff_h264_last_coeff_flag_offset_8x8[last] ); } else { if (is_dc && chroma422) { // dc 422 DECODE_SIGNIFICANCE(7, sig_coeff_offset_dc[last], sig_coeff_offset_dc[last]); |