History

avcodec/eamad: Optimize processing escape codes

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.

Andreas Rheinhardt committed 1 year ago

Commit f6366cb1 parent 2e5f01e1 file · +0 −2Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/eamad.c+0−2
@@ -160,10 +160,8 @@ static inline int decode_block_intra(MadContext *s, int16_t * block) · 159 unmodified lines
160 LAST_SKIP_BITS(re, &s->gb, 1);160 LAST_SKIP_BITS(re, &s->gb, 1);
161 } else {161 } else {
162 /* escape */162 /* escape */
163 UPDATE_CACHE(re, &s->gb);
164 level = SHOW_SBITS(re, &s->gb, 10); SKIP_BITS(re, &s->gb, 10);163 level = SHOW_SBITS(re, &s->gb, 10); SKIP_BITS(re, &s->gb, 10);
165 164
166 UPDATE_CACHE(re, &s->gb);
167 run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);165 run = SHOW_UBITS(re, &s->gb, 6)+1; LAST_SKIP_BITS(re, &s->gb, 6);
168 166
169 i += run;167 i += run;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t