[FFmpeg-devel] [PATCH] avutil/crc: always use precalculated CRC tables for known polynomials

Derek Buitenhuis derek.buitenhuis at gmail.com
Sun Oct 22 16:08:27 EEST 2017


On 10/22/2017 2:03 PM, James Almer wrote:
> This prevents data races in av_crc_get_table()
> 
> Signed-off-by: James Almer <jamrial at gmail.com>
> ---
>  libavutil/Makefile     |    1 +
>  libavutil/crc.c        |  295 +-------------
>  libavutil/crc_tables.c | 1030 ++++++++++++++++++++++++++++++++++++++++++++++++
>  libavutil/crc_tables.h |   33 ++
>  4 files changed, 1066 insertions(+), 293 deletions(-)
>  create mode 100644 libavutil/crc_tables.c
>  create mode 100644 libavutil/crc_tables.h

Can this be generated at init, or lazily, using ff_thread_once instead of
hardcoding huge tables?

- Derek


More information about the ffmpeg-devel mailing list