[FFmpeg-devel] [PATCH 26/30] avcodec/mpc7, mpc7data: Avoid gaps in array

Paul B Mahol onemda at gmail.com
Tue Sep 15 19:49:09 EEST 2020


On Tue, Sep 15, 2020 at 09:39:56AM +0200, Andreas Rheinhardt wrote:
> The Musepack decoder uses static VLC tables to parse the bitstream.
> There are 14 different quant tables VLCs and each of them has a varying
> number of codes. The maximum number is 63, the average number is 25.3.
> Up until now, the array containing the raw data was of type
> uint16_t [7][2][64 * 2] (the 14 tables come in pairs of two, hence [7][2]
> instead of [14]) and from this it follows that there were large gaps in
> said array. This commit changes this by making it a continuous array
> instead. Doing so saves about 2KB.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>
> ---
>  libavcodec/mpc7.c     | 17 ++++++----
>  libavcodec/mpc7data.h | 76 +++++++++++++------------------------------
>  2 files changed, 32 insertions(+), 61 deletions(-)

Should be fine if there is full coverage of code with samples covering those vlcs.


More information about the ffmpeg-devel mailing list