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 /** Due to channel allocation not being known upon SBR parameter transmission,
92  * supply the parameters separately.
93  * Functionally identical to ff_aac_sbr_decode_extension() */
96 
97 /** Decode frame SBR data, USAC. */
100  int sbr_ch, int indep_flag);
101 
102 /** Apply one SBR element to one AAC element. */
104  int id_aac, void /* float */ *L, void /* float */ *R);
106  int id_aac, void /* int */ *L, void /* int */ *R);
107 
109 
110 #endif /* AVCODEC_AACSBR_H */
F_HUFFMAN_ENV_1_5DB
@ F_HUFFMAN_ENV_1_5DB
Definition: aacsbr.h:45
FF_VISIBILITY_PUSH_HIDDEN
#define FF_VISIBILITY_PUSH_HIDDEN
Definition: attributes_internal.h:30
T_HUFFMAN_NOISE_3_0DB
@ T_HUFFMAN_NOISE_3_0DB
Definition: aacsbr.h:52
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)
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:115
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:1133
VARVAR
@ VARVAR
Definition: aacsbr.h:63
GetBitContext
Definition: get_bits.h:108
ue
#define ue(name, range_min, range_max)
Definition: cbs_h2645.c:254
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:70
AACUsacElemConfig
Definition: aacdec.h:297
ff_aac_sbr_ctx_close_fixed
void ff_aac_sbr_ctx_close_fixed(ChannelElement *che)
attributes_internal.h
FIXVAR
@ FIXVAR
Definition: aacsbr.h:61
get_bits.h
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)
EXTENSION_ID_PS
@ EXTENSION_ID_PS
Definition: aacsbr.h:67
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:260
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)
T_HUFFMAN_NOISE_BAL_3_0DB
@ T_HUFFMAN_NOISE_BAL_3_0DB
Definition: aacsbr.h:53
FIXFIX
@ FIXFIX
Definition: aacsbr.h:60
T_HUFFMAN_ENV_BAL_1_5DB
@ T_HUFFMAN_ENV_BAL_1_5DB
Definition: aacsbr.h:46
T_HUFFMAN_ENV_3_0DB
@ T_HUFFMAN_ENV_3_0DB
Definition: aacsbr.h:48
F_HUFFMAN_ENV_BAL_3_0DB
@ F_HUFFMAN_ENV_BAL_3_0DB
Definition: aacsbr.h:51
aacdec.h
AACDecContext
main AAC decoding context
Definition: aacdec.h:448
F_HUFFMAN_ENV_3_0DB
@ F_HUFFMAN_ENV_3_0DB
Definition: aacsbr.h:49
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:1671
VARFIX
@ VARFIX
Definition: aacsbr.h:62
L
#define L(x)
Definition: vpx_arith.h:36
ff_aac_sbr_decode_usac_data
int ff_aac_sbr_decode_usac_data(AACDecContext *ac, ChannelElement *che, AACUsacElemConfig *ue, GetBitContext *gb, int sbr_ch, int indep_flag)
Decode frame SBR data, USAC.
Definition: aacsbr_template.c:1208
ff_aac_sbr_apply_fixed
void ff_aac_sbr_apply_fixed(AACDecContext *ac, ChannelElement *che, int id_aac, void *L, void *R)
T_HUFFMAN_ENV_BAL_3_0DB
@ T_HUFFMAN_ENV_BAL_3_0DB
Definition: aacsbr.h:50
ff_aac_sbr_config_usac
int ff_aac_sbr_config_usac(AACDecContext *ac, ChannelElement *che, AACUsacElemConfig *ue)
Due to channel allocation not being known upon SBR parameter transmission, supply the parameters sepa...
Definition: aacsbr_template.c:1200