Michael Niedermayer: > On Thu, Oct 08, 2020 at 09:53:13PM +0200, Andreas Rheinhardt wrote: >> 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 18 bits (containing the actual code) are already in the >> bitstream reader's cache, making it unnecessary to reload the cache. >> >> Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com> >> --- >> libavcodec/mpeg12dec.c | 10 ++++------ >> 1 file changed, 4 insertions(+), 6 deletions(-) > > Interresting that this was not noticed before but > LGTM > > thx > There is actually more like this: The GET_VLC macro (which is used internally by get_vlc2() unless one uses the cached bitstream reader) currently always reloads the cache after every read, although one can omit the first reload if one only reads at most 12 bits at a time as is done in most usages of get_vlc2() in the codebase. For the cached bitstream reader one could even ensure that >= 32 bits are initially in the cache and then only read from the cache; currently the code for refilling the code (quite big in terms of size) exists multiple times in the binaries. Will take care of it.
- Andreas _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".