• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 Portions of this file are derived from the following 3GPP standard:
20 
21     3GPP TS 26.173
22     ANSI-C code for the Adaptive Multi-Rate - Wideband (AMR-WB) speech codec
23     Available from http://www.3gpp.org
24 
25 (C) 2007, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC)
26 Permission to distribute, modify and use this file under the standard license
27 terms listed above has been obtained from the copyright holder.
28 ****************************************************************************************/
29 /*
30 ------------------------------------------------------------------------------
31 
32 
33 
34  Filename: noise_gen_amrwb.cpp
35 
36      Date: 05/08/2007
37 
38 ------------------------------------------------------------------------------
39  REVISION HISTORY
40 
41 
42  Description:
43 
44 ------------------------------------------------------------------------------
45  INPUT AND OUTPUT DEFINITIONS
46 
47     int16 * seed          seed for the random ng
48 
49 ------------------------------------------------------------------------------
50  FUNCTION DESCRIPTION
51 
52     Signed 16 bits random generator
53 
54 ------------------------------------------------------------------------------
55  REQUIREMENTS
56 
57 
58 ------------------------------------------------------------------------------
59  REFERENCES
60 
61 ------------------------------------------------------------------------------
62  PSEUDO-CODE
63 
64 ------------------------------------------------------------------------------
65 */
66 
67 
68 /*----------------------------------------------------------------------------
69 ; INCLUDES
70 ----------------------------------------------------------------------------*/
71 
72 #include "pv_amr_wb_type_defs.h"
73 #include "pvamrwbdecoder_basic_op.h"
74 #include "pvamrwbdecoder_acelp.h"
75 
76 /*----------------------------------------------------------------------------
77 ; MACROS
78 ; Define module specific macros here
79 ----------------------------------------------------------------------------*/
80 
81 
82 /*----------------------------------------------------------------------------
83 ; DEFINES
84 ; Include all pre-processor statements here. Include conditional
85 ; compile variables also.
86 ----------------------------------------------------------------------------*/
87 
88 /*----------------------------------------------------------------------------
89 ; LOCAL FUNCTION DEFINITIONS
90 ; Function Prototype declaration
91 ----------------------------------------------------------------------------*/
92 
93 /*----------------------------------------------------------------------------
94 ; LOCAL STORE/BUFFER/POINTER DEFINITIONS
95 ; Variable declaration - defined here and used outside this module
96 ----------------------------------------------------------------------------*/
97 
98 /*----------------------------------------------------------------------------
99 ; EXTERNAL FUNCTION REFERENCES
100 ; Declare functions defined elsewhere and referenced in this module
101 ----------------------------------------------------------------------------*/
102 
103 /*----------------------------------------------------------------------------
104 ; EXTERNAL GLOBAL STORE/BUFFER/POINTER REFERENCES
105 ; Declare variables used in this module but defined elsewhere
106 ----------------------------------------------------------------------------*/
107 
108 /*----------------------------------------------------------------------------
109 ; FUNCTION CODE
110 ----------------------------------------------------------------------------*/
111 
noise_gen_amrwb(int16 * seed)112 int16 noise_gen_amrwb(int16 * seed)
113 {
114     /*  int16 seed = 21845; */
115     *seed = (int16)fxp_mac_16by16(*seed, 31821, 13849L);
116 
117     return (*seed);
118 }
119