OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / frameworks / base / media / libstagefright / codecs / aacdec / sbr_get_dir_control_data.cpp
1 /* ------------------------------------------------------------------
2  * Copyright (C) 1998-2009 PacketVideo
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied.
14  * See the License for the specific language governing permissions
15  * and limitations under the License.
16  * -------------------------------------------------------------------
17  */
18 /*
19
20  Filename: sbr_get_dir_control_data.c
21
22 ------------------------------------------------------------------------------
23  REVISION HISTORY
24
25
26  Who:                                   Date: MM/DD/YYYY
27  Description:
28
29 ------------------------------------------------------------------------------
30  INPUT AND OUTPUT DEFINITIONS
31
32  Arguments:     h_frame_data - handle to struct SBR_FRAME_DATA
33                 hBitBuf      - handle to struct BIT_BUF
34
35  Return:        void
36
37
38 ------------------------------------------------------------------------------
39  FUNCTION DESCRIPTION
40
41   Reads direction control data from bitstream
42
43 ------------------------------------------------------------------------------
44  REQUIREMENTS
45
46
47 ------------------------------------------------------------------------------
48  REFERENCES
49
50 SC 29 Software Copyright Licencing Disclaimer:
51
52 This software module was originally developed by
53   Coding Technologies
54
55 and edited by
56   -
57
58 in the course of development of the ISO/IEC 13818-7 and ISO/IEC 14496-3
59 standards for reference purposes and its performance may not have been
60 optimized. This software module is an implementation of one or more tools as
61 specified by the ISO/IEC 13818-7 and ISO/IEC 14496-3 standards.
62 ISO/IEC gives users free license to this software module or modifications
63 thereof for use in products claiming conformance to audiovisual and
64 image-coding related ITU Recommendations and/or ISO/IEC International
65 Standards. ISO/IEC gives users the same free license to this software module or
66 modifications thereof for research purposes and further ISO/IEC standardisation.
67 Those intending to use this software module in products are advised that its
68 use may infringe existing patents. ISO/IEC have no liability for use of this
69 software module or modifications thereof. Copyright is not released for
70 products that do not conform to audiovisual and image-coding related ITU
71 Recommendations and/or ISO/IEC International Standards.
72 The original developer retains full right to modify and use the code for its
73 own purpose, assign or donate the code to a third party and to inhibit third
74 parties from using the code for products that do not conform to audiovisual and
75 image-coding related ITU Recommendations and/or ISO/IEC International Standards.
76 This copyright notice must be included in all copies or derivative works.
77 Copyright (c) ISO/IEC 2002.
78
79 ------------------------------------------------------------------------------
80  PSEUDO-CODE
81
82 ------------------------------------------------------------------------------
83 */
84
85
86 /*----------------------------------------------------------------------------
87 ; INCLUDES
88 ----------------------------------------------------------------------------*/
89
90 #ifdef AAC_PLUS
91
92
93 #include    "sbr_get_dir_control_data.h"
94 #include    "buf_getbits.h"
95
96 /*----------------------------------------------------------------------------
97 ; MACROS
98 ; Define module specific macros here
99 ----------------------------------------------------------------------------*/
100
101
102 /*----------------------------------------------------------------------------
103 ; DEFINES
104 ; Include all pre-processor statements here. Include conditional
105 ; compile variables also.
106 ----------------------------------------------------------------------------*/
107
108 /*----------------------------------------------------------------------------
109 ; LOCAL FUNCTION DEFINITIONS
110 ; Function Prototype declaration
111 ----------------------------------------------------------------------------*/
112
113 /*----------------------------------------------------------------------------
114 ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
115 ; Variable declaration - defined here and used outside this module
116 ----------------------------------------------------------------------------*/
117
118 /*----------------------------------------------------------------------------
119 ; EXTERNAL FUNCTION REFERENCES
120 ; Declare functions defined elsewhere and referenced in this module
121 ----------------------------------------------------------------------------*/
122
123 /*----------------------------------------------------------------------------
124 ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
125 ; Declare variables used in this module but defined elsewhere
126 ----------------------------------------------------------------------------*/
127
128 /*----------------------------------------------------------------------------
129 ; FUNCTION CODE
130 ----------------------------------------------------------------------------*/
131
132 void sbr_get_dir_control_data(SBR_FRAME_DATA * h_frame_data,
133                               BIT_BUFFER     * hBitBuf)
134 {
135     Int32 i;
136
137     h_frame_data->nNoiseFloorEnvelopes = h_frame_data->frameInfo[0] > 1 ? 2 : 1;
138
139
140     for (i = 0; i < h_frame_data->frameInfo[0]; i++)
141     {
142         h_frame_data->domain_vec1[i] = buf_getbits(hBitBuf, SI_SBR_DOMAIN_BITS);
143     }
144
145     for (i = 0; i < h_frame_data->nNoiseFloorEnvelopes; i++)
146     {
147         h_frame_data->domain_vec2[i] = buf_getbits(hBitBuf, SI_SBR_DOMAIN_BITS);
148     }
149 }
150
151 #endif
152
153