diff options
author | Jason Garrett-Glaser <darkshikari@gmail.com> | 2010-08-04 02:23:25 +0000 |
---|---|---|
committer | Jason Garrett-Glaser <darkshikari@gmail.com> | 2010-08-04 02:23:25 +0000 |
commit | 1e7396795028af9eda3d69ada1402d6ef8996964 (patch) | |
tree | cbcb1cc952647bf922f6fe60257bd5257702971e /libavcodec/vp8.c | |
parent | ffbf0794f9b7ca1b9c3038c5c1aed84fbf1f8529 (diff) | |
download | ffmpeg-1e7396795028af9eda3d69ada1402d6ef8996964.tar.gz |
VP8: partially inline decode_block_coeffs
Avoids a function call in the case of empty DCT blocks (most of the time).
Originally committed as revision 24691 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp8.c')
-rw-r--r-- | libavcodec/vp8.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index ac12ad18e0..66e8c9d554 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -821,18 +821,13 @@ void decode_mb_mode(VP8Context *s, VP8Macroblock *mb, int mb_x, int mb_y, uint8_ * @return 0 if no coeffs were decoded * otherwise, the index of the last coeff decoded plus one */ -static int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16], - uint8_t probs[8][3][NUM_DCT_TOKENS-1], - int i, int zero_nhood, int16_t qmul[2]) +static int decode_block_coeffs_internal(VP56RangeCoder *c, DCTELEM block[16], + uint8_t probs[8][3][NUM_DCT_TOKENS-1], + int i, uint8_t *token_prob, int16_t qmul[2]) { - uint8_t *token_prob = probs[i][zero_nhood]; - int coeff; - - if (!vp56_rac_get_prob_branchy(c, token_prob[0])) - return 0; goto skip_eob; - do { + int coeff; if (!vp56_rac_get_prob_branchy(c, token_prob[0])) // DCT_EOB return i; @@ -880,6 +875,17 @@ skip_eob: } static av_always_inline +int decode_block_coeffs(VP56RangeCoder *c, DCTELEM block[16], + uint8_t probs[8][3][NUM_DCT_TOKENS-1], + int i, int zero_nhood, int16_t qmul[2]) +{ + uint8_t *token_prob = probs[i][zero_nhood]; + if (!vp56_rac_get_prob_branchy(c, token_prob[0])) // DCT_EOB + return 0; + return decode_block_coeffs_internal(c, block, probs, i, token_prob, qmul); +} + +static av_always_inline void decode_mb_coeffs(VP8Context *s, VP56RangeCoder *c, VP8Macroblock *mb, uint8_t t_nnz[9], uint8_t l_nnz[9]) { |