diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-10-20 21:34:02 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-10-20 21:34:02 +0000 |
commit | e08f5806444afec09b169f49b0e3bc1eb94da880 (patch) | |
tree | 5a57f8e2f98d6709f036b0458dd74eadb1ff6a29 /libavcodec/h264.c | |
parent | 94e4c3a333c50170c6645bc5ea43578270249644 (diff) | |
download | ffmpeg-e08f5806444afec09b169f49b0e3bc1eb94da880.tar.gz |
decode_significance_8x8_x86()
8% faster decode_cabac_residual() (8x8 case only) on P3
Originally committed as revision 6750 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r-- | libavcodec/h264.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index f19edd9981..865e80ac39 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -6034,6 +6034,13 @@ static int inline get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) { return ctx + 4 * cat; } +static const __attribute((used)) 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 int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n, const uint8_t *scantable, const uint32_t *qmul, int max_coeff) { const int mb_xy = h->s.mb_x + h->s.mb_y*h->s.mb_stride; static const int significant_coeff_flag_offset[2][6] = { @@ -6057,12 +6064,6 @@ static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n 9, 9,10,10, 8,11,12,11, 9, 9,10,10, 8,13,13, 9, 9,10,10, 8,13,13, 9, 9,10,10,14,14,14,14,14 } }; - static const 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 - }; int index[64]; @@ -6138,11 +6139,13 @@ static int decode_cabac_residual( H264Context *h, DCTELEM *block, int cat, int n index[coeff_count++] = last;\ } const uint8_t *sig_off = significant_coeff_flag_offset_8x8[MB_FIELD]; - DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] ); - } else { #ifdef ARCH_X86 + coeff_count= decode_significance_8x8_x86(CC, significant_coeff_ctx_base, index, sig_off); + } else { coeff_count= decode_significance_x86(CC, max_coeff, significant_coeff_ctx_base, index); #else + DECODE_SIGNIFICANCE( 63, sig_off[last], last_coeff_flag_offset_8x8[last] ); + } else { DECODE_SIGNIFICANCE( max_coeff - 1, last, last ); #endif } |