]> git.sesse.net Git - ffmpeg/commit
avcodec/sheervideo: Reduce the size of static arrays
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 10 Oct 2020 15:47:54 +0000 (17:47 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 10 Oct 2020 18:54:06 +0000 (20:54 +0200)
commitd3f35224a91e2f32c45a9d09f0867c688e590231
tree8a0c9e5480cab108f87853731c0633f6b05c4ae1
parent8969b9aa061790a5e87694aab17741cc7647d099
avcodec/sheervideo: Reduce the size of static arrays

The SheerVideo decoder uses VLC tables which are currently stored in
large arrays that contain the length of each leaf of the corresponding
tree from left to right, taking 15.5KB of space. But all these arrays
follow a common pattern: First the entries are ascending and then they
are descending with lots of successive entries have the same value.
Therefore it makes sense to use a run-length encoding to store them, as
this commit does. Notice that the length 16 has to be treated specially
because there are arrays with more than 256 consecutive entries with
value 16 and because the length of the entries start to descend from
this length onward.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/sheervideo.c
libavcodec/sheervideodata.h