Said escape code is only six bits long, so that one has at least 25 - 6 bits in the bitstream reader's cache after reading it; therefore the whole following 16 bits (containing the actual code) are already in the bitstream reader's cache, making it unnecessary to reload the cache. This is the eamad analogue of fe9bc1cc45e2bebba1efa7b9a20b0d66679bf2d5.
Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -160,10 +160,8 @@ static inline int decode_block_intra(MadContext *s, int16_t * block) · 159 unmodified lines | ||
| 160 | 160 | LAST_SKIP_BITS(re, &s->gb, 1); |
| 161 | 161 | } else { |
| 162 | 162 | /* escape */ |
| 163 | − UPDATE_CACHE(re, &s->gb); | |
| 164 | 163 | level = SHOW_SBITS(re, &s->gb, 10); SKIP_BITS(re, &s->gb, 10); |
| 165 | 164 | |
| 166 | − UPDATE_CACHE(re, &s->gb); | |
| 167 | 165 | run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6); |
| 168 | 166 | |
| 169 | 167 | i += run; |