]> git.sesse.net Git - ffmpeg/commit
avcodec/vp3: Use symbols table for VP3 motion vectors
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 6 Nov 2020 09:48:55 +0000 (10:48 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 8 Dec 2020 16:51:47 +0000 (17:51 +0100)
commit802fc678b262ea5d3523169184a9ec9503bf7807
tree2444a0e4deb047af9fcad17be9dac12a4021d76b
parent4cb4345f7895d1a169941df087152bf18f78a2f6
avcodec/vp3: Use symbols table for VP3 motion vectors

Expressions like array[get_vlc2()] can be optimized by using a symbols
table if the array is always the same for a given VLC. This requirement
is fulfilled for the VLC used for VP3 motion vectors. The reason it
hasn't been done before is probably that the array in this case
contained entries in the range -31..31; but this is no problem with
ff_init_vlc_from_lengths(): Just apply an offset of 31 to the symbols
before storing them in the table used to initialize VP3 motion vectors
and apply an offset of -31 when initializing the actual VLC.

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