Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(187)

Side by Side Diff: celt/dump_modes/dump_modes.c

Issue 882843002: Update to opus-HEAD-66611f1. (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/opus.git@master
Patch Set: Add the contents of Makefile.mips back. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « celt/dump_modes/Makefile ('k') | celt/entcode.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Copyright (c) 2008 CSIRO 1 /* Copyright (c) 2008 CSIRO
2 Copyright (c) 2008-2009 Xiph.Org Foundation 2 Copyright (c) 2008-2009 Xiph.Org Foundation
3 Written by Jean-Marc Valin */ 3 Written by Jean-Marc Valin */
4 /* 4 /*
5 Redistribution and use in source and binary forms, with or without 5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions 6 modification, are permitted provided that the following conditions
7 are met: 7 are met:
8 8
9 - Redistributions of source code must retain the above copyright 9 - Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer. 10 notice, this list of conditions and the following disclaimer.
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #define WORD16 INT16 44 #define WORD16 INT16
45 #define WORD32 INT32 45 #define WORD32 INT32
46 #else 46 #else
47 #define WORD16 FLOAT 47 #define WORD16 FLOAT
48 #define WORD32 FLOAT 48 #define WORD32 FLOAT
49 #endif 49 #endif
50 50
51 void dump_modes(FILE *file, CELTMode **modes, int nb_modes) 51 void dump_modes(FILE *file, CELTMode **modes, int nb_modes)
52 { 52 {
53 int i, j, k; 53 int i, j, k;
54 int mdct_twiddles_size;
54 fprintf(file, "/* The contents of this file was automatically generated by du mp_modes.c\n"); 55 fprintf(file, "/* The contents of this file was automatically generated by du mp_modes.c\n");
55 fprintf(file, " with arguments:"); 56 fprintf(file, " with arguments:");
56 for (i=0;i<nb_modes;i++) 57 for (i=0;i<nb_modes;i++)
57 { 58 {
58 CELTMode *mode = modes[i]; 59 CELTMode *mode = modes[i];
59 fprintf(file, " %d %d",mode->Fs,mode->shortMdctSize*mode->nbShortMdcts); 60 fprintf(file, " %d %d",mode->Fs,mode->shortMdctSize*mode->nbShortMdcts);
60 } 61 }
61 fprintf(file, "\n It contains static definitions for some pre-defined modes . */\n"); 62 fprintf(file, "\n It contains static definitions for some pre-defined modes . */\n");
62 fprintf(file, "#include \"modes.h\"\n"); 63 fprintf(file, "#include \"modes.h\"\n");
63 fprintf(file, "#include \"rate.h\"\n"); 64 fprintf(file, "#include \"rate.h\"\n");
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 fprintf(file, "\n"); 164 fprintf(file, "\n");
164 } 165 }
165 166
166 /* FFT States */ 167 /* FFT States */
167 for (k=0;k<=mode->mdct.maxshift;k++) 168 for (k=0;k<=mode->mdct.maxshift;k++)
168 { 169 {
169 fprintf(file, "#ifndef FFT_STATE%d_%d_%d\n", mode->Fs, mdctSize, k); 170 fprintf(file, "#ifndef FFT_STATE%d_%d_%d\n", mode->Fs, mdctSize, k);
170 fprintf(file, "#define FFT_STATE%d_%d_%d\n", mode->Fs, mdctSize, k); 171 fprintf(file, "#define FFT_STATE%d_%d_%d\n", mode->Fs, mdctSize, k);
171 fprintf (file, "static const kiss_fft_state fft_state%d_%d_%d = {\n", 172 fprintf (file, "static const kiss_fft_state fft_state%d_%d_%d = {\n",
172 mode->Fs, mdctSize, k); 173 mode->Fs, mdctSize, k);
173 fprintf (file, "%d,\t/* nfft */\n", mode->mdct.kfft[k]->nfft); 174 fprintf (file, "%d, /* nfft */\n", mode->mdct.kfft[k]->nfft);
174 #ifndef FIXED_POINT 175 fprintf (file, WORD16 ", /* scale */\n", mode->mdct.kfft[k]->scale);
175 fprintf (file, "%0.9ff,\t/* scale */\n", mode->mdct.kfft[k]->scale); 176 #ifdef FIXED_POINT
177 fprintf (file, "%d, /* scale_shift */\n", mode->mdct.kfft[k]->scale_ shift);
176 #endif 178 #endif
177 fprintf (file, "%d,\t/* shift */\n", mode->mdct.kfft[k]->shift); 179 fprintf (file, "%d, /* shift */\n", mode->mdct.kfft[k]->shift);
178 fprintf (file, "{"); 180 fprintf (file, "{");
179 for (j=0;j<2*MAXFACTORS;j++) 181 for (j=0;j<2*MAXFACTORS;j++)
180 fprintf (file, "%d, ", mode->mdct.kfft[k]->factors[j]); 182 fprintf (file, "%d, ", mode->mdct.kfft[k]->factors[j]);
181 fprintf (file, "},\t/* factors */\n"); 183 fprintf (file, "}, /* factors */\n");
182 fprintf (file, "fft_bitrev%d,\t/* bitrev */\n", mode->mdct.kfft[k]->nff t); 184 fprintf (file, "fft_bitrev%d, /* bitrev */\n", mode->mdct.kfft[k]->n fft);
183 fprintf (file, "fft_twiddles%d_%d,\t/* bitrev */\n", mode->Fs, mdctSize ); 185 fprintf (file, "fft_twiddles%d_%d, /* bitrev */\n", mode->Fs, mdctSi ze);
184 fprintf (file, "};\n"); 186 fprintf (file, "};\n");
185 187
186 fprintf(file, "#endif\n"); 188 fprintf(file, "#endif\n");
187 fprintf(file, "\n"); 189 fprintf(file, "\n");
188 } 190 }
189 191
190 fprintf(file, "#endif\n"); 192 fprintf(file, "#endif\n");
191 fprintf(file, "\n"); 193 fprintf(file, "\n");
192 194
193 /* MDCT twiddles */ 195 /* MDCT twiddles */
196 mdct_twiddles_size = mode->mdct.n-(mode->mdct.n/2>>mode->mdct.maxshift);
194 fprintf(file, "#ifndef MDCT_TWIDDLES%d\n", mdctSize); 197 fprintf(file, "#ifndef MDCT_TWIDDLES%d\n", mdctSize);
195 fprintf(file, "#define MDCT_TWIDDLES%d\n", mdctSize); 198 fprintf(file, "#define MDCT_TWIDDLES%d\n", mdctSize);
196 fprintf (file, "static const opus_val16 mdct_twiddles%d[%d] = {\n", 199 fprintf (file, "static const opus_val16 mdct_twiddles%d[%d] = {\n",
197 mdctSize, mode->mdct.n/4+1); 200 mdctSize, mdct_twiddles_size);
198 for (j=0;j<=mode->mdct.n/4;j++) 201 for (j=0;j<mdct_twiddles_size;j++)
199 fprintf (file, WORD16 ",%c", mode->mdct.trig[j],(j+6)%5==0?'\n':' '); 202 fprintf (file, WORD16 ",%c", mode->mdct.trig[j],(j+6)%5==0?'\n':' ');
200 fprintf (file, "};\n"); 203 fprintf (file, "};\n");
201 204
202 fprintf(file, "#endif\n"); 205 fprintf(file, "#endif\n");
203 fprintf(file, "\n"); 206 fprintf(file, "\n");
204 207
205 208
206 /* Print the actual mode data */ 209 /* Print the actual mode data */
207 fprintf(file, "static const CELTMode mode%d_%d_%d = {\n", mode->Fs, mdctSi ze, mode->overlap); 210 fprintf(file, "static const CELTMode mode%d_%d_%d = {\n", mode->Fs, mdctSi ze, mode->overlap);
208 fprintf(file, INT32 ",\t/* Fs */\n", mode->Fs); 211 fprintf(file, INT32 ", /* Fs */\n", mode->Fs);
209 fprintf(file, "%d,\t/* overlap */\n", mode->overlap); 212 fprintf(file, "%d, /* overlap */\n", mode->overlap);
210 fprintf(file, "%d,\t/* nbEBands */\n", mode->nbEBands); 213 fprintf(file, "%d, /* nbEBands */\n", mode->nbEBands);
211 fprintf(file, "%d,\t/* effEBands */\n", mode->effEBands); 214 fprintf(file, "%d, /* effEBands */\n", mode->effEBands);
212 fprintf(file, "{"); 215 fprintf(file, "{");
213 for (j=0;j<4;j++) 216 for (j=0;j<4;j++)
214 fprintf(file, WORD16 ", ", mode->preemph[j]); 217 fprintf(file, WORD16 ", ", mode->preemph[j]);
215 fprintf(file, "},\t/* preemph */\n"); 218 fprintf(file, "}, /* preemph */\n");
216 if (standard) 219 if (standard)
217 fprintf(file, "eband5ms,\t/* eBands */\n"); 220 fprintf(file, "eband5ms, /* eBands */\n");
218 else 221 else
219 fprintf(file, "eBands%d_%d,\t/* eBands */\n", mode->Fs, mdctSize); 222 fprintf(file, "eBands%d_%d, /* eBands */\n", mode->Fs, mdctSize);
220 223
221 fprintf(file, "%d,\t/* maxLM */\n", mode->maxLM); 224 fprintf(file, "%d, /* maxLM */\n", mode->maxLM);
222 fprintf(file, "%d,\t/* nbShortMdcts */\n", mode->nbShortMdcts); 225 fprintf(file, "%d, /* nbShortMdcts */\n", mode->nbShortMdcts);
223 fprintf(file, "%d,\t/* shortMdctSize */\n", mode->shortMdctSize); 226 fprintf(file, "%d, /* shortMdctSize */\n", mode->shortMdctSize);
224 227
225 fprintf(file, "%d,\t/* nbAllocVectors */\n", mode->nbAllocVectors); 228 fprintf(file, "%d, /* nbAllocVectors */\n", mode->nbAllocVectors);
226 if (standard) 229 if (standard)
227 fprintf(file, "band_allocation,\t/* allocVectors */\n"); 230 fprintf(file, "band_allocation, /* allocVectors */\n");
228 else 231 else
229 fprintf(file, "allocVectors%d_%d,\t/* allocVectors */\n", mode->Fs, mdc tSize); 232 fprintf(file, "allocVectors%d_%d, /* allocVectors */\n", mode->Fs, m dctSize);
230 233
231 fprintf(file, "logN%d,\t/* logN */\n", framerate); 234 fprintf(file, "logN%d, /* logN */\n", framerate);
232 fprintf(file, "window%d,\t/* window */\n", mode->overlap); 235 fprintf(file, "window%d, /* window */\n", mode->overlap);
233 fprintf(file, "{%d, %d, {", mode->mdct.n, mode->mdct.maxshift); 236 fprintf(file, "{%d, %d, {", mode->mdct.n, mode->mdct.maxshift);
234 for (k=0;k<=mode->mdct.maxshift;k++) 237 for (k=0;k<=mode->mdct.maxshift;k++)
235 fprintf(file, "&fft_state%d_%d_%d, ", mode->Fs, mdctSize, k); 238 fprintf(file, "&fft_state%d_%d_%d, ", mode->Fs, mdctSize, k);
236 fprintf (file, "}, mdct_twiddles%d},\t/* mdct */\n", mdctSize); 239 fprintf (file, "}, mdct_twiddles%d}, /* mdct */\n", mdctSize);
237 240
238 fprintf(file, "{%d, cache_index%d, cache_bits%d, cache_caps%d},\t/* cache */\n", 241 fprintf(file, "{%d, cache_index%d, cache_bits%d, cache_caps%d}, /* cach e */\n",
239 mode->cache.size, mode->Fs/mdctSize, mode->Fs/mdctSize, mode->Fs/mdc tSize); 242 mode->cache.size, mode->Fs/mdctSize, mode->Fs/mdctSize, mode->Fs/mdc tSize);
240 fprintf(file, "};\n"); 243 fprintf(file, "};\n");
241 } 244 }
242 fprintf(file, "\n"); 245 fprintf(file, "\n");
243 fprintf(file, "/* List of all the available modes */\n"); 246 fprintf(file, "/* List of all the available modes */\n");
244 fprintf(file, "#define TOTAL_MODES %d\n", nb_modes); 247 fprintf(file, "#define TOTAL_MODES %d\n", nb_modes);
245 fprintf(file, "static const CELTMode * const static_mode_list[TOTAL_MODES] = {\n"); 248 fprintf(file, "static const CELTMode * const static_mode_list[TOTAL_MODES] = {\n");
246 for (i=0;i<nb_modes;i++) 249 for (i=0;i<nb_modes;i++)
247 { 250 {
248 CELTMode *mode = modes[i]; 251 CELTMode *mode = modes[i];
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 } 323 }
321 } 324 }
322 file = fopen(BASENAME ".h", "w"); 325 file = fopen(BASENAME ".h", "w");
323 dump_modes(file, m, nb); 326 dump_modes(file, m, nb);
324 fclose(file); 327 fclose(file);
325 for (i=0;i<nb;i++) 328 for (i=0;i<nb;i++)
326 opus_custom_mode_destroy(m[i]); 329 opus_custom_mode_destroy(m[i]);
327 free(m); 330 free(m);
328 return 0; 331 return 0;
329 } 332 }
OLDNEW
« no previous file with comments | « celt/dump_modes/Makefile ('k') | celt/entcode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698