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 
36 
37 #define ENVELOPE_ADJUSTMENT_OFFSET 2
38 #define NOISE_FLOOR_OFFSET 6
39 
40 /**
41  * SBR VLC tables
42  */
43 enum {
54 };
55 
56 /**
57  * bs_frame_class - frame class of current SBR frame (14496-3 sp04 p98)
58  */
59 enum {
64 };
65 
66 enum {
68 };
69 
71 /** Initialize SBR. */
72 void ff_aac_sbr_init(void);
73 void ff_aac_sbr_init_fixed(void);
74 /**
75  * Allocate an ExtChannelElement (if necessary) and
76  * initialize the SBR context contained in it.
77  */
78 int ff_aac_sbr_ctx_alloc_init(AACDecContext *ac, ChannelElement **che, int id_aac);
80 
81 /** Close the SBR context implicitly contained in a ChannelElement. */
84 
85 /** Decode one SBR element. */
87  GetBitContext *gb, int crc, int cnt, int id_aac);
89  GetBitContext *gb, int crc, int cnt, int id_aac);
90 
91 /** Apply one SBR element to one AAC element. */
93  int id_aac, void /* float */ *L, void /* float */ *R);
95  int id_aac, void /* int */ *L, void /* int */ *R);
96 
98 
99 #endif /* AVCODEC_AACSBR_H */
FIXFIX
@ FIXFIX
Definition: aacsbr.h:60
FF_VISIBILITY_PUSH_HIDDEN
#define FF_VISIBILITY_PUSH_HIDDEN
Definition: attributes_internal.h:30
VARFIX
@ VARFIX
Definition: aacsbr.h:62
T_HUFFMAN_ENV_1_5DB
@ T_HUFFMAN_ENV_1_5DB
Definition: aacsbr.h:44
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:50
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:45
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:51
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:49
T_HUFFMAN_NOISE_3_0DB
@ T_HUFFMAN_NOISE_3_0DB
Definition: aacsbr.h:52
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:48
get_bits.h
EXTENSION_ID_PS
@ EXTENSION_ID_PS
Definition: aacsbr.h:67
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)
T_HUFFMAN_ENV_BAL_1_5DB
@ T_HUFFMAN_ENV_BAL_1_5DB
Definition: aacsbr.h:46
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:47
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)
VARVAR
@ VARVAR
Definition: aacsbr.h:63
aacdec.h
AACDecContext
main AAC decoding context
Definition: aacdec.h:258
FIXVAR
@ FIXVAR
Definition: aacsbr.h:61
ff_aac_sbr_apply
void ff_aac_sbr_apply(AACDecContext *ac, ChannelElement *che, int id_aac, void *L, void *R)
Apply one SBR element to one AAC element.
Definition: aacsbr_template.c:1471
L
#define L(x)
Definition: vpx_arith.h:36
ff_aac_sbr_apply_fixed
void ff_aac_sbr_apply_fixed(AACDecContext *ac, ChannelElement *che, int id_aac, void *L, void *R)
T_HUFFMAN_NOISE_BAL_3_0DB
@ T_HUFFMAN_NOISE_BAL_3_0DB
Definition: aacsbr.h:53