FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavcodec/aac/aacdec_fixed.c
Date: 2024-05-03 15:42:48
Exec Total Coverage
Lines: 14 15 93.3%
Functions: 2 2 100.0%
Branches: 1 2 50.0%

Line Branch Exec Source
1 /*
2 * AAC decoder
3 * Copyright (c) 2005-2006 Oded Shimon ( ods15 ods15 dyndns org )
4 * Copyright (c) 2006-2007 Maxim Gavrilov ( maxim.gavrilov gmail com )
5 * Copyright (c) 2008-2013 Alex Converse <alex.converse@gmail.com>
6 *
7 * AAC LATM decoder
8 * Copyright (c) 2008-2010 Paul Kendall <paul@kcbbs.gen.nz>
9 * Copyright (c) 2010 Janne Grunau <janne-libav@jannau.net>
10 *
11 * AAC decoder fixed-point implementation
12 * Copyright (c) 2013
13 * MIPS Technologies, Inc., California.
14 *
15 * This file is part of FFmpeg.
16 *
17 * FFmpeg is free software; you can redistribute it and/or
18 * modify it under the terms of the GNU Lesser General Public
19 * License as published by the Free Software Foundation; either
20 * version 2.1 of the License, or (at your option) any later version.
21 *
22 * FFmpeg is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
25 * Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public
28 * License along with FFmpeg; if not, write to the Free Software
29 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
30 */
31
32 #define USE_FIXED 1
33
34 #include "libavutil/thread.h"
35
36 #include "libavcodec/aac_defines.h"
37
38 #include "libavcodec/avcodec.h"
39 #include "aacdec.h"
40 #include "libavcodec/aactab.h"
41 #include "libavcodec/sinewin_fixed_tablegen.h"
42 #include "libavcodec/kbdwin.h"
43 #include "libavcodec/cbrt_data.h"
44 #include "libavcodec/aacsbr.h"
45
46 DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME2(aac_kbd_long_1024))[1024];
47 DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME2(aac_kbd_short_128))[128];
48 DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_long_960))[960];
49 DECLARE_ALIGNED(32, static INTFLOAT, AAC_RENAME(aac_kbd_short_120))[120];
50
51 18 static void init_tables_fixed_fn(void)
52 {
53 18 AAC_RENAME(ff_cbrt_tableinit)();
54
55 18 AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_long_1024), 4.0, 1024);
56 18 AAC_RENAME(ff_kbd_window_init)(AAC_RENAME2(aac_kbd_short_128), 6.0, 128);
57
58 18 AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_long_960), 4.0, 960);
59 18 AAC_RENAME(ff_kbd_window_init)(AAC_RENAME(aac_kbd_short_120), 6.0, 120);
60
61 18 AAC_RENAME(ff_aac_sbr_init)();
62
63 18 init_sine_windows_fixed();
64 18 }
65
66 23 static int init_fixed(AACDecContext *ac)
67 {
68 static AVOnce init_fixed_once = AV_ONCE_INIT;
69 23 ff_thread_once(&init_fixed_once, init_tables_fixed_fn);
70
71 23 ac->fdsp = avpriv_alloc_fixed_dsp(ac->avctx->flags & AV_CODEC_FLAG_BITEXACT);
72
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 23 times.
23 if (!ac->fdsp)
73 return AVERROR(ENOMEM);
74
75 23 return 0;
76 }
77
78 static const int cce_scale_fixed[8] = {
79 Q30(1.0), //2^(0/8)
80 Q30(1.0905077327), //2^(1/8)
81 Q30(1.1892071150), //2^(2/8)
82 Q30(1.2968395547), //2^(3/8)
83 Q30(1.4142135624), //2^(4/8)
84 Q30(1.5422108254), //2^(5/8)
85 Q30(1.6817928305), //2^(6/8)
86 Q30(1.8340080864), //2^(7/8)
87 };
88
89 /** Dequantization-related */
90 #include "aacdec_fixed_dequant.h"
91
92 #include "aacdec_fixed_coupling.h"
93 #include "aacdec_fixed_prediction.h"
94 #include "aacdec_dsp_template.c"
95 #include "aacdec_proc_template.c"
96