From a7f4abbc62cb6b768c9bcb927ba2485ba6e61913 Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Wed, 2 Dec 2020 03:52:40 +0100 Subject: [PATCH] avcodec/snow: Hardcode table to save space The size of ff_qexp is only 32 bytes, but the code to generate it at runtime takes 47 bytes (GCC 9.3, x64, -O3 in an av_cold function); so just hardcode it. Signed-off-by: Andreas Rheinhardt --- libavcodec/snow.c | 10 ---------- libavcodec/snow.h | 2 +- libavcodec/snowdata.h | 10 ++++++++-- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/libavcodec/snow.c b/libavcodec/snow.c index bb65a6f43f..a037e36873 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -123,15 +123,6 @@ int ff_snow_alloc_blocks(SnowContext *s){ return 0; } -static av_cold void init_qexp(void){ - int i; - double v=128; - - for(i=0; i