avcodec/mpegaudio_tablegen: more dynamic table creation speedups
authorGanesh Ajjanagadde <gajjanagadde@gmail.com>
Sat, 28 Nov 2015 01:15:42 +0000 (20:15 -0500)
committerGanesh Ajjanagadde <gajjanagadde@gmail.com>
Wed, 2 Dec 2015 00:05:19 +0000 (19:05 -0500)
commit1d0c94ddaef8225c75f72d5d8c54c34270f88d80
tree472c0877fc14120c151de0ff019810dcba1f9f00
parent16d4c28cbb9add358d4e6f30c412860638dc4f90
avcodec/mpegaudio_tablegen: more dynamic table creation speedups

This further speeds up runtime initialization, with identical generated tables.

Sample benchmark (x86-64, Haswell, GNU/Linux):

old:
34441423 decicycles in mpegaudio_tableinit,    8192 runs,      0 skips

new:
10776291 decicycles in mpegaudio_tableinit,    8192 runs,      0 skips

Most low hanging fruit is taken care of here. For some idea, note that
83,064 array elements totalling 233,722 bytes need to be initialized.
Thus, with this patch, we average ~ 12.9 cycles per element or ~ 4.6
cycles per byte.

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
libavcodec/mpegaudio_tablegen.h