]> git.sesse.net Git - ffmpeg/commit
avcodec/truemotion2: Simplify creating VLC table
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 1 Nov 2020 13:23:33 +0000 (14:23 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 8 Dec 2020 16:51:46 +0000 (17:51 +0100)
commit7a7295a8ce87e8b8d9f3dade5f7e05342ffba881
treebbe76fcea04146d1fd60d7836f76e7753ec1c592
parentf1ba4d479e4c785a8a4f85fb576ee166100a8cda
avcodec/truemotion2: Simplify creating VLC table

ff_init_vlc_from_lengths() can be used to offload the computation
of the codes; it also allows to omit the check whether the codes
are already properly ordered (they are). In this case, this also allows
to avoid the allocation of the buffer for the codes.

This improves performance: The amount of decicycles for one call to
tm2_build_huff_tables() when decoding tm20.avi from the FATE-suite
decreased from 46239 to 40035. This test consisted of looping 50 times
over the file and iterating the test ten times.

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