FFmpeg
aacsbr.h
Go to the documentation of this file.
1 /*
2  * AAC Spectral Band Replication function declarations
3  * Copyright (c) 2008-2009 Robert Swain ( rob opendot cl )
4  * Copyright (c) 2010 Alex Converse <alex.converse@gmail.com>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 /**
24  * @file
25  * AAC Spectral Band Replication function declarations
26  * @author Robert Swain ( rob opendot cl )
27  */
28 
29 #ifndef AVCODEC_AACSBR_H
30 #define AVCODEC_AACSBR_H
31 
32 #include "get_bits.h"
33 #include "aac/aacdec.h"
34 #include "aac_defines.h"
35 
37 
38 #define ENVELOPE_ADJUSTMENT_OFFSET 2
39 #define NOISE_FLOOR_OFFSET 6
40 
41 /**
42  * SBR VLC tables
43  */
44 enum {
55 };
56 
57 /**
58  * bs_frame_class - frame class of current SBR frame (14496-3 sp04 p98)
59  */
60 enum {
65 };
66 
67 enum {
69 };
70 
72 /** Initialize SBR. */
73 void ff_aac_sbr_init(void);
74 void ff_aac_sbr_init_fixed(void);
75 /**
76  * Allocate an ExtChannelElement (if necessary) and
77  * initialize the SBR context contained in it.
78  */
79 int ff_aac_sbr_ctx_alloc_init(AACDecContext *ac, ChannelElement **che, int id_aac);
81 
82 /** Close the SBR context implicitly contained in a ChannelElement. */
85 
86 /** Decode one SBR element. */
88  GetBitContext *gb, int crc, int cnt, int id_aac);
90  GetBitContext *gb, int crc, int cnt, int id_aac);
91 
92 /** Apply one SBR element to one AAC element. */
94  int id_aac, INTFLOAT* L, INTFLOAT* R);
96  int id_aac, INTFLOAT* L, INTFLOAT* R);
97 
99 
100 #endif /* AVCODEC_AACSBR_H */
FIXFIX
@ FIXFIX
Definition: aacsbr.h:61
FF_VISIBILITY_PUSH_HIDDEN
#define FF_VISIBILITY_PUSH_HIDDEN
Definition: attributes_internal.h:30
VARFIX
@ VARFIX
Definition: aacsbr.h:63
T_HUFFMAN_ENV_1_5DB
@ T_HUFFMAN_ENV_1_5DB
Definition: aacsbr.h:45
R
#define R
Definition: huffyuv.h:44
ff_aac_sbr_init_fixed
void ff_aac_sbr_init_fixed(void)
T_HUFFMAN_ENV_BAL_3_0DB
@ T_HUFFMAN_ENV_BAL_3_0DB
Definition: aacsbr.h:51
ff_aac_sbr_ctx_close
void ff_aac_sbr_ctx_close(ChannelElement *che)
Close the SBR context implicitly contained in a ChannelElement.
Definition: aacsbr_template.c:114
F_HUFFMAN_ENV_1_5DB
@ F_HUFFMAN_ENV_1_5DB
Definition: aacsbr.h:46
ff_aac_sbr_decode_extension
int ff_aac_sbr_decode_extension(AACDecContext *ac, ChannelElement *che, GetBitContext *gb, int crc, int cnt, int id_aac)
Decode one SBR element.
Definition: aacsbr_template.c:1103
GetBitContext
Definition: get_bits.h:108
F_HUFFMAN_ENV_BAL_3_0DB
@ F_HUFFMAN_ENV_BAL_3_0DB
Definition: aacsbr.h:52
ff_aac_sbr_ctx_alloc_init
int ff_aac_sbr_ctx_alloc_init(AACDecContext *ac, ChannelElement **che, int id_aac)
Allocate an ExtChannelElement (if necessary) and initialize the SBR context contained in it.
Definition: aacsbr_template.c:69
F_HUFFMAN_ENV_3_0DB
@ F_HUFFMAN_ENV_3_0DB
Definition: aacsbr.h:50
T_HUFFMAN_NOISE_3_0DB
@ T_HUFFMAN_NOISE_3_0DB
Definition: aacsbr.h:53
ff_aac_sbr_ctx_close_fixed
void ff_aac_sbr_ctx_close_fixed(ChannelElement *che)
attributes_internal.h
T_HUFFMAN_ENV_3_0DB
@ T_HUFFMAN_ENV_3_0DB
Definition: aacsbr.h:49
get_bits.h
EXTENSION_ID_PS
@ EXTENSION_ID_PS
Definition: aacsbr.h:68
ff_aac_sbr_init
FF_VISIBILITY_PUSH_HIDDEN void ff_aac_sbr_init(void)
Initialize SBR.
Definition: aacsbr_template.c:52
ff_aac_sbr_ctx_alloc_init_fixed
int ff_aac_sbr_ctx_alloc_init_fixed(AACDecContext *ac, ChannelElement **che, int id_aac)
ff_aac_sbr_apply
void ff_aac_sbr_apply(AACDecContext *ac, ChannelElement *che, int id_aac, INTFLOAT *L, INTFLOAT *R)
Apply one SBR element to one AAC element.
Definition: aacsbr_template.c:1471
T_HUFFMAN_ENV_BAL_1_5DB
@ T_HUFFMAN_ENV_BAL_1_5DB
Definition: aacsbr.h:47
FF_VISIBILITY_POP_HIDDEN
#define FF_VISIBILITY_POP_HIDDEN
Definition: attributes_internal.h:31
F_HUFFMAN_ENV_BAL_1_5DB
@ F_HUFFMAN_ENV_BAL_1_5DB
Definition: aacsbr.h:48
ChannelElement
channel element - generic struct for SCE/CPE/CCE/LFE
Definition: aacdec.h:169
ff_aac_sbr_decode_extension_fixed
int ff_aac_sbr_decode_extension_fixed(AACDecContext *ac, ChannelElement *che, GetBitContext *gb, int crc, int cnt, int id_aac)
ff_aac_sbr_apply_fixed
void ff_aac_sbr_apply_fixed(AACDecContext *ac, ChannelElement *che, int id_aac, INTFLOAT *L, INTFLOAT *R)
VARVAR
@ VARVAR
Definition: aacsbr.h:64
aacdec.h
AACDecContext
main AAC decoding context
Definition: aacdec.h:253
FIXVAR
@ FIXVAR
Definition: aacsbr.h:62
L
#define L(x)
Definition: vpx_arith.h:36
aac_defines.h
T_HUFFMAN_NOISE_BAL_3_0DB
@ T_HUFFMAN_NOISE_BAL_3_0DB
Definition: aacsbr.h:54
INTFLOAT
float INTFLOAT
Definition: aac_defines.h:101