# HG changeset patch # User darkshikari # Date 1280888605 0 # Node ID 4dc177e736f67e55345788324be45216321aef36 # Parent a66d6456df90afe172ba1e687b228cff6e75e56a VP8: partially inline decode_block_coeffs Avoids a function call in the case of empty DCT blocks (most of the time). diff -r a66d6456df90 -r 4dc177e736f6 vp8.c --- a/vp8.c Wed Aug 04 01:40:58 2010 +0000 +++ b/vp8.c Wed Aug 04 02:23:25 2010 +0000 @@ -821,18 +821,13 @@ * @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 @@ } 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]) {