FFmpeg
Loading...
Searching...
No Matches
aacdec_fixed.c
Go to the documentation of this file.
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
37
38#include "libavcodec/avcodec.h"
39#include "aacdec.h"
40#include "libavcodec/aactab.h"
42#include "libavcodec/kbdwin.h"
44#include "libavcodec/aacsbr.h"
45
52
67
68static const int cce_scale_fixed[8] = {
69 Q30(1.0), //2^(0/8)
70 Q30(1.0905077327), //2^(1/8)
71 Q30(1.1892071150), //2^(2/8)
72 Q30(1.2968395547), //2^(3/8)
73 Q30(1.4142135624), //2^(4/8)
74 Q30(1.5422108254), //2^(5/8)
75 Q30(1.6817928305), //2^(6/8)
76 Q30(1.8340080864), //2^(7/8)
77};
78
79/** Dequantization-related */
81
84#include "aacdec_dsp_template.c"
86
88{
89 static AVOnce init_fixed_once = AV_ONCE_INIT;
90 AACDecContext *ac = avctx->priv_data;
91
92 ac->is_fixed = 1;
94
95 aac_dsp_init_fixed(&ac->dsp);
96 aac_proc_init_fixed(&ac->proc);
97
99 if (!ac->fdsp)
100 return AVERROR(ENOMEM);
101
102 ff_thread_once(&init_fixed_once, init_tables_fixed_fn);
103
104 return ff_aac_decode_init(avctx);
105}
#define Q30(x)
AAC decoder definitions and structures.
static int aac_kbd_short_128_fixed[128]
static int aac_kbd_long_1024_fixed[1024]
av_cold int ff_aac_decode_init_fixed(AVCodecContext *avctx)
Dequantization-related.
static const int cce_scale_fixed[8]
static void init_tables_fixed_fn(void)
static int aac_kbd_short_96_fixed[96]
static int aac_kbd_short_120_fixed[120]
static int aac_kbd_long_960_fixed[960]
static int aac_kbd_long_768_fixed[768]
AAC Spectral Band Replication function declarations.
void ff_aac_sbr_init_fixed(void)
AAC data declarations.
Libavcodec external API header.
#define ff_cbrt_tableinit_fixed()
Definition cbrt_data.h:34
#define AV_CODEC_FLAG_BITEXACT
Use only bitexact stuff (except (I)DCT).
Definition avcodec.h:322
#define AVERROR(e)
Definition error.h:45
@ AV_SAMPLE_FMT_S32P
signed 32 bits, planar
Definition samplefmt.h:65
av_cold void ff_kbd_window_init_fixed(int32_t *window, float alpha, int n)
Definition kbdwin.c:59
av_cold int ff_aac_decode_init(AVCodecContext *avctx)
Definition aacdec.c:1298
#define av_cold
Definition attributes.h:117
AVFixedDSPContext * avpriv_alloc_fixed_dsp(int bit_exact)
Allocate and initialize a fixed DSP context.
Definition fixed_dsp.c:151
#define AVOnce
Definition thread.h:202
static int ff_thread_once(char *control, void(*routine)(void))
Definition thread.h:205
#define AV_ONCE_INIT
Definition thread.h:203
#define DECLARE_ALIGNED(n, t, v)
Declare a variable that is aligned in memory.
static av_cold void init_sine_windows_fixed(void)
main AAC decoding context
Definition aacdec.h:500
AACDecProc proc
Definition aacdec.h:505
AACDecDSP dsp
Definition aacdec.h:504
AVFloatDSPContext * fdsp
Definition aacdec.h:556
main external API structure.
Definition avcodec.h:443
enum AVSampleFormat sample_fmt
audio sample format
Definition avcodec.h:1047
int flags
AV_CODEC_FLAG_*.
Definition avcodec.h:500
void * priv_data
Definition avcodec.h:470