summaryrefslogtreecommitdiff
path: root/libavcodec/snow.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-12-02 03:52:40 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2021-05-02 05:14:42 +0200
commita7f4abbc62cb6b768c9bcb927ba2485ba6e61913 (patch)
tree2995d2f17dd43fcede383b8f8ecf0804389cdbf2 /libavcodec/snow.c
parent56df06dd8346687d6d9b7321f2af41e4fd614ee3 (diff)
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 <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/snow.c')
-rw-r--r--libavcodec/snow.c10
1 files changed, 0 insertions, 10 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<QROOT; i++){
- ff_qexp[i]= lrintf(v);
- v *= pow(2, 1.0 / QROOT);
- }
-}
static void mc_block(Plane *p, uint8_t *dst, const uint8_t *src, int stride, int b_w, int b_h, int dx, int dy){
static const uint8_t weight[64]={
8,7,6,5,4,3,2,1,
@@ -433,7 +424,6 @@ static av_cold void snow_static_init(void)
for (int i = 0; i < MAX_REF_FRAMES; i++)
for (int j = 0; j < MAX_REF_FRAMES; j++)
ff_scale_mv_ref[i][j] = 256 * (i + 1) / (j + 1);
- init_qexp();
}
av_cold int ff_snow_common_init(AVCodecContext *avctx){