Mercurial > libavcodec.hg
comparison ra288.c @ 7365:031d4866b192 libavcodec
Rename co() function to the much more descriptive name of
do_hybrid_window(). Also change a misleading and wrong comment.
author | vitor |
---|---|
date | Thu, 24 Jul 2008 03:23:51 +0000 |
parents | 907d3376da93 |
children | d74804a3a18b |
comparison
equal
deleted
inserted
replaced
7364:907d3376da93 | 7365:031d4866b192 |
---|---|
135 for (; n >= 0; n--) | 135 for (; n >= 0; n--) |
136 tgt[n] = scalar_product_float(src, src - n, len); | 136 tgt[n] = scalar_product_float(src, src - n, len); |
137 | 137 |
138 } | 138 } |
139 | 139 |
140 static void co(int n, int i, int j, const float *in, float *out, float *st1, | 140 static void do_hybrid_window(int n, int i, int j, const float *in, float *out, float *st1, |
141 float *st2, const float *table) | 141 float *st2, const float *table) |
142 { | 142 { |
143 unsigned int x; | 143 unsigned int x; |
144 float buffer1[37]; | 144 float buffer1[37]; |
145 float buffer2[37]; | 145 float buffer2[37]; |
156 | 156 |
157 for (x=0; x <= n; x++) { | 157 for (x=0; x <= n; x++) { |
158 st2[x] = st2[x] * 0.5625 + buffer1[x]; | 158 st2[x] = st2[x] * 0.5625 + buffer1[x]; |
159 out[x] = st2[x] + buffer2[x]; | 159 out[x] = st2[x] + buffer2[x]; |
160 } | 160 } |
161 *out *= 257./256.; /* to prevent clipping */ | 161 |
162 /* Multiply by the white noise correcting factor (WNCF) */ | |
163 *out *= 257./256.; | |
162 } | 164 } |
163 | 165 |
164 static void update(Real288_internal *glob) | 166 static void update(Real288_internal *glob) |
165 { | 167 { |
166 float buffer1[40], temp1[37]; | 168 float buffer1[40], temp1[37]; |
167 float buffer2[8], temp2[11]; | 169 float buffer2[8], temp2[11]; |
168 | 170 |
169 memcpy(buffer1 , glob->output + 20, 20*sizeof(*buffer1)); | 171 memcpy(buffer1 , glob->output + 20, 20*sizeof(*buffer1)); |
170 memcpy(buffer1 + 20, glob->output , 20*sizeof(*buffer1)); | 172 memcpy(buffer1 + 20, glob->output , 20*sizeof(*buffer1)); |
171 | 173 |
172 co(36, 40, 35, buffer1, temp1, glob->st1a, glob->st1b, table1); | 174 do_hybrid_window(36, 40, 35, buffer1, temp1, glob->st1a, glob->st1b, table1); |
173 | 175 |
174 if (pred(temp1, glob->st1, 36)) | 176 if (pred(temp1, glob->st1, 36)) |
175 colmult(glob->pr1, glob->st1, table1a, 36); | 177 colmult(glob->pr1, glob->st1, table1a, 36); |
176 | 178 |
177 memcpy(buffer2 , glob->history + 4, 4*sizeof(*buffer2)); | 179 memcpy(buffer2 , glob->history + 4, 4*sizeof(*buffer2)); |
178 memcpy(buffer2 + 4, glob->history , 4*sizeof(*buffer2)); | 180 memcpy(buffer2 + 4, glob->history , 4*sizeof(*buffer2)); |
179 | 181 |
180 co(10, 8, 20, buffer2, temp2, glob->st2a, glob->st2b, table2); | 182 do_hybrid_window(10, 8, 20, buffer2, temp2, glob->st2a, glob->st2b, table2); |
181 | 183 |
182 if (pred(temp2, glob->st2, 10)) | 184 if (pred(temp2, glob->st2, 10)) |
183 colmult(glob->pr2, glob->st2, table2a, 10); | 185 colmult(glob->pr2, glob->st2, table2a, 10); |
184 } | 186 } |
185 | 187 |