Update upstream source from tag 'upstream/2.10.0'
Update to upstream version '2.10.0'
with Debian dir 9db1d6b1b57c33956d04cb258118ab29239b7541
Fabian Greffrath
3 years ago
0 | 2.10.0: | |
1 | [ tatsuz ] | |
2 | * updated Visual Studio projects to VS 2019 (#54) | |
3 | ||
4 | [ Fabian Greffrath ] | |
5 | * mp4read.c: fix stack-buffer-overflow in stringin()/ftypin() | |
6 | * fix heap-buffer-overflow in mp4read.c | |
7 | ||
8 | [ Clayton Smith ] | |
9 | * Remove non-ASCII characters | |
10 | * Remove trailing whitespace | |
11 | ||
12 | [ Andrew Wesie ] | |
13 | * Check return value of ltp_data. | |
14 | * Restrict SBR frame length to 960 and 1024 samples. | |
15 | * Support object type 29. | |
16 | * Support implicit SBR signaling in frontend. | |
17 | * Fix PNS decoding when only right channel is noise. | |
18 | * Initialize element_id array with an invalid id. | |
19 | * Fix NULL pointer dereferences. | |
20 | * Fix infinite loop in adts_parse. | |
21 | * Fix infinite loop in huffman_getescape. | |
22 | * Check for error after each channel decode. | |
23 | * Check for inconsistent number of channels. | |
24 | ||
0 | 25 | 2.9.2: |
1 | 26 | [ MichaĆ Janiszewski ] |
2 | 27 | * Only use x86-assembly when explicitly on x86 |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
182 | 182 | numfiles = 0; |
183 | 183 | |
184 | 184 | Sleep(500); |
185 | } | |
185 | } | |
186 | 186 | |
187 | 187 | DeleteCriticalSection(&mutex); |
188 | 188 |
27 | 27 | #define CREATEFONT(sz) \ |
28 | 28 | CreateFont((sz), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \ |
29 | 29 | VARIABLE_PITCH | FF_SWISS, "") |
30 | ||
30 | ||
31 | 31 | HANDLE event = NULL; |
32 | 32 | int width = 130, height = 130; |
33 | 33 | RECT bar1, bar2, vbrBR; |
231 | 231 | set_outputFormat(iniSettings.outputFormat); |
232 | 232 | set_fileType(iniSettings.fileType); |
233 | 233 | set_object_type(iniSettings.object_type); |
234 | ||
234 | ||
235 | 235 | for (frame = 0; frame < 8; frame++) |
236 | 236 | hbm[frame] = LoadImage(hinst, MAKEINTRESOURCE(IDB_TF01 + frame), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION); |
237 | 237 | frame = 0; |
242 | 242 | DispatchMessage(&msg); |
243 | 243 | } |
244 | 244 | |
245 | for (frame = 0; frame < 8; frame++) | |
245 | for (frame = 0; frame < 8; frame++) | |
246 | 246 | DeleteObject(hbm[frame]); |
247 | 247 | |
248 | 248 | return msg.wParam; |
372 | 372 | if (animate || frame) |
373 | 373 | { |
374 | 374 | frame++; |
375 | if (frame > 7) | |
375 | if (frame > 7) | |
376 | 376 | frame -= 8; |
377 | 377 | } |
378 | 378 | else |
436 | 436 | return 0; |
437 | 437 | |
438 | 438 | case WM_COMMAND: |
439 | switch (LOWORD(wParam)) | |
439 | switch (LOWORD(wParam)) | |
440 | 440 | { |
441 | 441 | case IDM_QUIT: |
442 | 442 | WriteIniFile(INI_FILE); |
445 | 445 | break; |
446 | 446 | case IDM_ONTOP: |
447 | 447 | set_always_on_top(hwnd, ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED); |
448 | break; | |
448 | break; | |
449 | 449 | case IDM_LOGERR: |
450 | 450 | set_logerr(hwnd, ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED); |
451 | 451 | break; |
458 | 458 | } |
459 | 459 | case IDM_VOLUME: |
460 | 460 | { |
461 | int value = | |
461 | int value = | |
462 | 462 | DialogBox( |
463 | hinst, | |
464 | MAKEINTRESOURCE(IDD_VOLUME), | |
463 | hinst, | |
464 | MAKEINTRESOURCE(IDD_VOLUME), | |
465 | 465 | hwnd, QCProc); |
466 | 466 | |
467 | 467 | if (value == -2) |
483 | 483 | hdrop = (HANDLE)wParam; |
484 | 484 | HandleDrag(hwnd, hdrop); |
485 | 485 | return 0; |
486 | ||
486 | ||
487 | 487 | case WM_DESTROY: |
488 | 488 | decoding_done = 1; |
489 | 489 | PostQuitMessage(0); |
497 | 497 | * Encode parameters dialog procedures. |
498 | 498 | */ |
499 | 499 | |
500 | BOOL CALLBACK QCProc(HWND hwndDlg, UINT message, | |
501 | WPARAM wParam, LPARAM lParam) | |
502 | { | |
503 | switch (message) | |
504 | { | |
505 | case WM_INITDIALOG: | |
506 | ||
500 | BOOL CALLBACK QCProc(HWND hwndDlg, UINT message, | |
501 | WPARAM wParam, LPARAM lParam) | |
502 | { | |
503 | switch (message) | |
504 | { | |
505 | case WM_INITDIALOG: | |
506 | ||
507 | 507 | if(iniSettings.decode_mode == 0) |
508 | 508 | { |
509 | 509 | CheckDlgButton(hwndDlg,IDC_PLAYBACK,TRUE); |
578 | 578 | EndDialog(hwndDlg, -1); |
579 | 579 | break; |
580 | 580 | |
581 | case WM_COMMAND: | |
582 | switch (LOWORD(wParam)) | |
581 | case WM_COMMAND: | |
582 | switch (LOWORD(wParam)) | |
583 | 583 | { |
584 | 584 | case IDC_BUTTON1: |
585 | 585 | { |
669 | 669 | break; |
670 | 670 | } |
671 | 671 | } |
672 | return FALSE; | |
672 | return FALSE; | |
673 | 673 | } |
674 | 674 | |
675 | 675 |
38 | 38 | if (strlen(fmt) > 750) |
39 | 39 | { |
40 | 40 | sprintf(msgbuf, "%s %s", "<buffer overflow> ", fmt); |
41 | } | |
42 | else | |
41 | } | |
42 | else | |
43 | 43 | { |
44 | 44 | if (_filename != NULL && strlen(_filename) < 255) |
45 | 45 | { |
48 | 48 | } |
49 | 49 | |
50 | 50 | va_start(ap, fmt); |
51 | ||
51 | ||
52 | 52 | vsprintf(bufp, fmt, ap); |
53 | 53 | |
54 | 54 | va_end(ap); |
41 | 41 | #define IDM_QUIT 40019 |
42 | 42 | |
43 | 43 | // Next default values for new objects |
44 | // | |
44 | // | |
45 | 45 | #ifdef APSTUDIO_INVOKED |
46 | 46 | #ifndef APSTUDIO_READONLY_SYMBOLS |
47 | 47 | #define _APS_NO_MFC 1 |
7 | 7 | dnl - mpeg4ip plugin (requires mpeg4ip's libmp4v2 to be installed) |
8 | 8 | |
9 | 9 | AC_PREREQ(2.50) |
10 | AC_INIT(faad2, 2.9.2) | |
10 | AC_INIT(faad2, 2.10.0) | |
11 | 11 | AC_CONFIG_AUX_DIR(.) |
12 | 12 | AM_INIT_AUTOMAKE([subdir-objects]) |
13 | 13 |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
203 | 203 | } |
204 | 204 | |
205 | 205 | #endif /* GNU C library. */ |
206 | ||
206 | ||
207 | 207 | /* Handle permutation of arguments. */ |
208 | 208 | |
209 | 209 | /* Describe the part of ARGV that contains non-options that have |
264 | 264 | temp = *first; *first = *last; *last = temp; first++; last--; |
265 | 265 | } |
266 | 266 | } |
267 | ||
267 | ||
268 | 268 | /* Scan elements of ARGV (whose length is ARGC) for option characters |
269 | 269 | given in OPTSTRING. |
270 | 270 | |
679 | 679 | } |
680 | 680 | |
681 | 681 | #endif /* _LIBC or not __GNU_LIBRARY__. */ |
682 | ||
682 | ||
683 | 683 | #ifdef TEST |
684 | 684 | |
685 | 685 | /* Compile with -DTEST to make an executable for use in testing |
153 | 153 | while ((b->bytes_into_buffer > 0) && (bytes > 0)) |
154 | 154 | { |
155 | 155 | int chunk = min(bytes, b->bytes_into_buffer); |
156 | ||
156 | ||
157 | 157 | bytes -= chunk; |
158 | 158 | b->file_offset += chunk; |
159 | 159 | b->bytes_consumed = chunk; |
216 | 216 | |
217 | 217 | frame_length = ((((unsigned int)b->buffer[3] & 0x3)) << 11) |
218 | 218 | | (((unsigned int)b->buffer[4]) << 3) | (b->buffer[5] >> 5); |
219 | if (frame_length == 0) | |
220 | break; | |
219 | 221 | |
220 | 222 | t_framelength += frame_length; |
221 | 223 | |
696 | 698 | /* update buffer indices */ |
697 | 699 | advance_buffer(&b, frameInfo.bytesconsumed); |
698 | 700 | |
701 | /* check if the inconsistent number of channels */ | |
702 | if (aufile != NULL && frameInfo.channels != aufile->channels) | |
703 | frameInfo.error = 12; | |
704 | ||
699 | 705 | if (frameInfo.error > 0) |
700 | 706 | { |
701 | 707 | faad_fprintf(stderr, "Error: %s\n", |
871 | 877 | if (NeAACDecAudioSpecificConfig(mp4config.asc.buf, mp4config.asc.size, &mp4ASC) >= 0) |
872 | 878 | { |
873 | 879 | if (mp4ASC.frameLengthFlag == 1) framesize = 960; |
874 | if (mp4ASC.sbr_present_flag == 1) framesize *= 2; | |
880 | if (mp4ASC.sbr_present_flag == 1 || mp4ASC.forceUpSampling) framesize *= 2; | |
875 | 881 | } |
876 | 882 | } |
877 | 883 |
94 | 94 | if (!txt[size]) |
95 | 95 | break; |
96 | 96 | } |
97 | txt[sizemax-1] = '\0'; | |
97 | 98 | |
98 | 99 | return size; |
99 | 100 | } |
342 | 343 | u32in(); |
343 | 344 | // Number of entries |
344 | 345 | mp4config.frame.ents = u32in(); |
345 | // fixme: check atom size | |
346 | ||
347 | if (!(mp4config.frame.ents + 1)) | |
348 | return ERR_FAIL; | |
349 | ||
346 | 350 | mp4config.frame.data = malloc(sizeof(*mp4config.frame.data) |
347 | 351 | * (mp4config.frame.ents + 1)); |
348 | 352 |
101 | 101 | fprintf(stderr, "\nFATAL: Malloc failed\n\n"); |
102 | 102 | exit(-1); |
103 | 103 | } |
104 | ||
104 | ||
105 | 105 | for(i = 0; i < nArgs; i++) |
106 | 106 | { |
107 | 107 | (*argv)[i] = utf16_to_utf8(szArglist[i]); |
118 | 118 | void free_commandline_arguments_utf8(int *argc, char ***argv) |
119 | 119 | { |
120 | 120 | int i = 0; |
121 | ||
121 | ||
122 | 122 | if(*argv != NULL) |
123 | 123 | { |
124 | 124 | for(i = 0; i < *argc; i++) |
139 | 139 | FILE *ret = NULL; |
140 | 140 | wchar_t *filename_utf16 = utf8_to_utf16(filename_utf8); |
141 | 141 | wchar_t *mode_utf16 = utf8_to_utf16(mode_utf8); |
142 | ||
142 | ||
143 | 143 | if(filename_utf16 && mode_utf16) |
144 | 144 | { |
145 | 145 | ret = _wfopen(filename_utf16, mode_utf16); |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
152 | 152 | |
153 | 153 | for (i = 0; i < MAX_CHANNELS; i++) |
154 | 154 | { |
155 | hDecoder->element_id[i] = INVALID_ELEMENT_ID; | |
155 | 156 | hDecoder->window_shape_prev[i] = 0; |
156 | 157 | hDecoder->time_out[i] = NULL; |
157 | 158 | hDecoder->fb_intermed[i] = NULL; |
285 | 286 | #endif |
286 | 287 | |
287 | 288 | faad_initbits(&ld, buffer, buffer_size); |
288 | ||
289 | ||
289 | 290 | #if 0 |
290 | 291 | memset(l, 0, sizeof(latm_header)); |
291 | 292 | is_latm = latmCheck(l, &ld); |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
48 | 48 | |
49 | 49 | |
50 | 50 | /* binary search huffman tables */ |
51 | static const int8_t f_huffman_sa[][2] = | |
51 | static const int8_t f_huffman_sa[][2] = | |
52 | 52 | { |
53 | 53 | { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ |
54 | 54 | { 2, 3 }, /* index 1: 2 bits: 1x */ |
66 | 66 | { /*-7*/ -22, /*-6*/ -21 } /* index 13: 7 bits: 111111x */ |
67 | 67 | }; |
68 | 68 | |
69 | static const int8_t t_huffman_sa[][2] = | |
69 | static const int8_t t_huffman_sa[][2] = | |
70 | 70 | { |
71 | 71 | { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ |
72 | 72 | { 2, 3 }, /* index 1: 2 bits: 1x */ |
84 | 84 | { /*6*/ -9, /*7*/ -8 } /* index 13: 9 bits: 11111111x */ |
85 | 85 | }; |
86 | 86 | |
87 | static const int8_t f_huffman_pan[][2] = | |
87 | static const int8_t f_huffman_pan[][2] = | |
88 | 88 | { |
89 | 89 | { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ |
90 | 90 | { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */ |
116 | 116 | { /*12*/ -3, /*14*/ -1 } /* index 27: 16 bits: 111111111111111x */ |
117 | 117 | }; |
118 | 118 | |
119 | static const int8_t t_huffman_pan[][2] = | |
119 | static const int8_t t_huffman_pan[][2] = | |
120 | 120 | { |
121 | 121 | { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ |
122 | 122 | { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */ |
149 | 149 | }; |
150 | 150 | |
151 | 151 | /* There are 3 classes in the standard but the last 2 are identical */ |
152 | static const real_t sa_quant[8][2] = | |
152 | static const real_t sa_quant[8][2] = | |
153 | 153 | { |
154 | 154 | { FRAC_CONST(0.0000), FRAC_CONST(0.0000) }, |
155 | 155 | { FRAC_CONST(0.0501), FRAC_CONST(0.1778) }, |
163 | 163 | |
164 | 164 | /* We don't need the actual quantizer values */ |
165 | 165 | #if 0 |
166 | static const real_t pan_quant[8][5] = | |
166 | static const real_t pan_quant[8][5] = | |
167 | 167 | { |
168 | 168 | { COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000) }, |
169 | 169 | { COEF_CONST(0.1661), COEF_CONST(0.1661), COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.3322) }, |
202 | 202 | |
203 | 203 | /* 2^(pan_quant[x][y]/30) */ |
204 | 204 | static const real_t pan_pow_2_30_pos[8][5] = { |
205 | { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, | |
206 | { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) }, | |
207 | { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933), COEF_CONST(1.019373909), COEF_CONST(1.019373909) }, | |
208 | { COEF_CONST(1.011579706), COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) }, | |
205 | { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, | |
206 | { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) }, | |
207 | { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933), COEF_CONST(1.019373909), COEF_CONST(1.019373909) }, | |
208 | { COEF_CONST(1.011579706), COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) }, | |
209 | 209 | { COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.051155908), COEF_CONST(1.059252598) }, |
210 | { COEF_CONST(1.019373909), COEF_CONST(1.03117796), COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263) }, | |
211 | { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) }, | |
210 | { COEF_CONST(1.019373909), COEF_CONST(1.03117796), COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263) }, | |
211 | { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) }, | |
212 | 212 | { COEF_CONST(1.03117796), COEF_CONST(1.055195268), COEF_CONST(1.0839263), COEF_CONST(1.113439626), COEF_CONST(1.143756546) } |
213 | 213 | }; |
214 | 214 | |
215 | 215 | /* 2^(-pan_quant[x][y]/30) */ |
216 | 216 | static const real_t pan_pow_2_30_neg[8][5] = { |
217 | 217 | { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, |
218 | { COEF_CONST(0.99616963), COEF_CONST(0.99616963), COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393) }, | |
219 | { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) }, | |
220 | { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) }, | |
221 | { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) }, | |
222 | { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) }, | |
223 | { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) }, | |
218 | { COEF_CONST(0.99616963), COEF_CONST(0.99616963), COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393) }, | |
219 | { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) }, | |
220 | { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) }, | |
221 | { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) }, | |
222 | { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) }, | |
223 | { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) }, | |
224 | 224 | { COEF_CONST(0.969764715), COEF_CONST(0.947691892), COEF_CONST(0.922571949), COEF_CONST(0.898117847), COEF_CONST(0.874311936) } |
225 | 225 | }; |
226 | 226 | |
227 | 227 | static const real_t g_decayslope[MAX_SA_BAND] = { |
228 | FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.95),FRAC_CONST(0.9), FRAC_CONST(0.85), FRAC_CONST(0.8), | |
229 | FRAC_CONST(0.75),FRAC_CONST(0.7), FRAC_CONST(0.65),FRAC_CONST(0.6), FRAC_CONST(0.55),FRAC_CONST(0.5), FRAC_CONST(0.45), | |
228 | FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(1), FRAC_CONST(0.95),FRAC_CONST(0.9), FRAC_CONST(0.85), FRAC_CONST(0.8), | |
229 | FRAC_CONST(0.75),FRAC_CONST(0.7), FRAC_CONST(0.65),FRAC_CONST(0.6), FRAC_CONST(0.55),FRAC_CONST(0.5), FRAC_CONST(0.45), | |
230 | 230 | FRAC_CONST(0.4), FRAC_CONST(0.35),FRAC_CONST(0.3), FRAC_CONST(0.25),FRAC_CONST(0.2), FRAC_CONST(0.15), FRAC_CONST(0.1), |
231 | FRAC_CONST(0.05),FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), | |
232 | FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), | |
233 | FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), | |
231 | FRAC_CONST(0.05),FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), | |
232 | FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), | |
233 | FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), | |
234 | 234 | FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0) |
235 | 235 | }; |
236 | 236 | |
245 | 245 | { FRAC_CONST(0.929071574), FRAC_CONST(0) } |
246 | 246 | }; |
247 | 247 | |
248 | static const uint8_t sa_freq_scale[9] = | |
248 | static const uint8_t sa_freq_scale[9] = | |
249 | 249 | { |
250 | 250 | 0, 1, 2, 3, 5, 7, 10, 13, 23 |
251 | 251 | }; |
252 | 252 | |
253 | static const uint8_t pan_freq_scale[21] = | |
253 | static const uint8_t pan_freq_scale[21] = | |
254 | 254 | { |
255 | 255 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, |
256 | 256 | 11, 12, 13, 14, 15, 18, 22, 26, 32, 64 |
257 | 257 | }; |
258 | 258 | |
259 | static const uint8_t pan_quant_class[20] = | |
259 | static const uint8_t pan_quant_class[20] = | |
260 | 260 | { |
261 | 261 | 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
262 | 262 | 2, 2, 2, 2, 3, 3, 3, 4, 4, 4 |
264 | 264 | |
265 | 265 | /* Inverse mapping lookup */ |
266 | 266 | static const uint8_t pan_inv_freq[64] = { |
267 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | |
268 | 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, | |
267 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, | |
268 | 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, | |
269 | 269 | 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, |
270 | 270 | 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 |
271 | 271 | }; |
272 | 272 | |
273 | 273 | static const uint8_t sa_inv_freq[MAX_SA_BAND] = { |
274 | 274 | 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, |
275 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, | |
276 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, | |
275 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, | |
276 | 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, | |
277 | 277 | 7, 7, 7, 7, 7, 7, 7 |
278 | 278 | }; |
279 | 279 | |
280 | static const real_t filter_coeff[] = | |
280 | static const real_t filter_coeff[] = | |
281 | 281 | { |
282 | 282 | FRAC_CONST(0.65143905754106), |
283 | 283 | FRAC_CONST(0.56471812200776), |
284 | 284 | FRAC_CONST(0.48954165955695) |
285 | 285 | }; |
286 | 286 | |
287 | static const uint8_t delay_length[3] = | |
287 | static const uint8_t delay_length[3] = | |
288 | 288 | { |
289 | 289 | 3, 4, 5 |
290 | 290 | }; |
291 | 291 | |
292 | static const real_t delay_fraction[] = | |
292 | static const real_t delay_fraction[] = | |
293 | 293 | { |
294 | 294 | FRAC_CONST(0.43), FRAC_CONST(0.75), FRAC_CONST(0.347) |
295 | 295 | }; |
533 | 533 | } |
534 | 534 | |
535 | 535 | static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i) |
536 | { | |
536 | { | |
537 | 537 | if (i < -7) { |
538 | 538 | /* printf(" PANminclip %d", i); */ |
539 | 539 | ps->pan_decode_error = 1; |
546 | 546 | return i; |
547 | 547 | } |
548 | 548 | |
549 | static void drm_ps_delta_decode(drm_ps_info *ps) | |
550 | { | |
551 | uint8_t band; | |
552 | ||
553 | if (ps->bs_enable_sa) | |
554 | { | |
555 | if (ps->bs_sa_dt_flag && !ps->g_last_had_sa) | |
556 | { | |
549 | static void drm_ps_delta_decode(drm_ps_info *ps) | |
550 | { | |
551 | uint8_t band; | |
552 | ||
553 | if (ps->bs_enable_sa) | |
554 | { | |
555 | if (ps->bs_sa_dt_flag && !ps->g_last_had_sa) | |
556 | { | |
557 | 557 | /* wait until we get a DT frame */ |
558 | 558 | ps->bs_enable_sa = 0; |
559 | 559 | } else if (ps->bs_sa_dt_flag) { |
560 | 560 | /* DT frame, we have a last frame, so we can decode */ |
561 | ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]); | |
561 | ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]); | |
562 | 562 | } else { |
563 | 563 | /* DF always decodable */ |
564 | ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]); | |
565 | } | |
566 | ||
564 | ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]); | |
565 | } | |
566 | ||
567 | 567 | for (band = 1; band < DRM_NUM_SA_BANDS; band++) |
568 | { | |
568 | { | |
569 | 569 | if (ps->bs_sa_dt_flag && ps->g_last_had_sa) |
570 | 570 | { |
571 | 571 | ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]); |
572 | 572 | } else if (!ps->bs_sa_dt_flag) { |
573 | ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]); | |
573 | ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]); | |
574 | 574 | } |
575 | 575 | } |
576 | 576 | } |
582 | 582 | ps->bs_enable_pan = ps->g_last_had_pan; |
583 | 583 | ps->bs_enable_sa = ps->g_last_had_sa; |
584 | 584 | } |
585 | ||
586 | ||
587 | if (ps->bs_enable_sa) | |
588 | { | |
585 | ||
586 | ||
587 | if (ps->bs_enable_sa) | |
588 | { | |
589 | 589 | if (ps->sa_decode_error) { |
590 | 590 | for (band = 0; band < DRM_NUM_SA_BANDS; band++) |
591 | { | |
591 | { | |
592 | 592 | ps->g_sa_index[band] = ps->g_last_good_sa_index[band]; |
593 | 593 | } |
594 | 594 | } else { |
595 | 595 | for (band = 0; band < DRM_NUM_SA_BANDS; band++) |
596 | { | |
596 | { | |
597 | 597 | ps->g_last_good_sa_index[band] = ps->g_sa_index[band]; |
598 | 598 | } |
599 | 599 | } |
600 | 600 | } |
601 | ||
602 | if (ps->bs_enable_pan) | |
603 | { | |
604 | if (ps->bs_pan_dt_flag && !ps->g_last_had_pan) | |
601 | ||
602 | if (ps->bs_enable_pan) | |
603 | { | |
604 | if (ps->bs_pan_dt_flag && !ps->g_last_had_pan) | |
605 | 605 | { |
606 | 606 | ps->bs_enable_pan = 0; |
607 | } else if (ps->bs_pan_dt_flag) { | |
607 | } else if (ps->bs_pan_dt_flag) { | |
608 | 608 | ps->g_pan_index[0] = pan_delta_clip(ps, ps->g_prev_pan_index[0]+ps->bs_pan_data[0]); |
609 | 609 | } else { |
610 | 610 | ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]); |
611 | 611 | } |
612 | ||
612 | ||
613 | 613 | for (band = 1; band < DRM_NUM_PAN_BANDS; band++) |
614 | { | |
614 | { | |
615 | 615 | if (ps->bs_pan_dt_flag && ps->g_last_had_pan) |
616 | 616 | { |
617 | 617 | ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]); |
619 | 619 | ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]); |
620 | 620 | } |
621 | 621 | } |
622 | ||
622 | ||
623 | 623 | if (ps->pan_decode_error) { |
624 | 624 | for (band = 0; band < DRM_NUM_PAN_BANDS; band++) |
625 | { | |
625 | { | |
626 | 626 | ps->g_pan_index[band] = ps->g_last_good_pan_index[band]; |
627 | 627 | } |
628 | 628 | } else { |
629 | 629 | for (band = 0; band < DRM_NUM_PAN_BANDS; band++) |
630 | { | |
630 | { | |
631 | 631 | ps->g_last_good_pan_index[band] = ps->g_pan_index[band]; |
632 | 632 | } |
633 | 633 | } |
634 | 634 | } |
635 | 635 | } |
636 | 636 | |
637 | static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64]) | |
638 | { | |
637 | static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64]) | |
638 | { | |
639 | 639 | uint8_t s, b, k; |
640 | 640 | complex_t qfrac, tmp0, tmp, in, R0; |
641 | 641 | real_t peakdiff; |
651 | 651 | |
652 | 652 | for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++) |
653 | 653 | { |
654 | /* set delay indices */ | |
654 | /* set delay indices */ | |
655 | 655 | for (k = 0; k < NUM_OF_LINKS; k++) |
656 | 656 | temp_delay_ser[k] = ps->delay_buf_index_ser[k]; |
657 | 657 | |
659 | 659 | IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]); |
660 | 660 | |
661 | 661 | for (s = 0; s < NUM_OF_SUBSAMPLES; s++) |
662 | { | |
662 | { | |
663 | 663 | const real_t gamma = REAL_CONST(1.5); |
664 | 664 | const real_t sigma = REAL_CONST(1.5625); |
665 | 665 | |
694 | 694 | } else { |
695 | 695 | transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma); |
696 | 696 | } |
697 | ||
698 | for (k = 0; k < NUM_OF_LINKS; k++) | |
697 | ||
698 | for (k = 0; k < NUM_OF_LINKS; k++) | |
699 | 699 | { |
700 | 700 | new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]); |
701 | 701 | } |
707 | 707 | IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]); |
708 | 708 | |
709 | 709 | RE(ps->d_buff[1][b]) = RE(in); |
710 | IM(ps->d_buff[1][b]) = IM(in); | |
710 | IM(ps->d_buff[1][b]) = IM(in); | |
711 | 711 | |
712 | 712 | ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract)); |
713 | 713 | |
714 | 714 | RE(R0) = RE(tmp); |
715 | 715 | IM(R0) = IM(tmp); |
716 | 716 | |
717 | for (k = 0; k < NUM_OF_LINKS; k++) | |
717 | for (k = 0; k < NUM_OF_LINKS; k++) | |
718 | 718 | { |
719 | 719 | RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]); |
720 | 720 | IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]); |
742 | 742 | if (++temp_delay_ser[k] >= delay_length[k]) |
743 | 743 | temp_delay_ser[k] = 0; |
744 | 744 | } |
745 | } | |
745 | } | |
746 | 746 | } |
747 | 747 | |
748 | 748 | for (k = 0; k < NUM_OF_LINKS; k++) |
749 | 749 | ps->delay_buf_index_ser[k] = temp_delay_ser[k]; |
750 | 750 | } |
751 | 751 | |
752 | static void drm_add_ambiance(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) | |
753 | { | |
754 | uint8_t s, b, ifreq, qclass; | |
752 | static void drm_add_ambiance(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) | |
753 | { | |
754 | uint8_t s, b, ifreq, qclass; | |
755 | 755 | real_t sa_map[MAX_SA_BAND], sa_dir_map[MAX_SA_BAND], k_sa_map[MAX_SA_BAND], k_sa_dir_map[MAX_SA_BAND]; |
756 | 756 | real_t new_dir_map, new_sa_map; |
757 | ||
757 | ||
758 | 758 | if (ps->bs_enable_sa) |
759 | 759 | { |
760 | 760 | /* Instead of dequantization and mapping, we use an inverse mapping |
769 | 769 | sa_map[b] = sa_quant[ps->g_prev_sa_index[ifreq]][qclass]; |
770 | 770 | new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass]; |
771 | 771 | |
772 | k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b])); | |
773 | ||
774 | sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass]; | |
772 | k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b])); | |
773 | ||
774 | sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass]; | |
775 | 775 | new_dir_map = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass]; |
776 | ||
776 | ||
777 | 777 | k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b])); |
778 | 778 | |
779 | 779 | } |
781 | 781 | for (s = 0; s < NUM_OF_SUBSAMPLES; s++) |
782 | 782 | { |
783 | 783 | for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++) |
784 | { | |
784 | { | |
785 | 785 | QMF_RE(X_right[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]); |
786 | 786 | QMF_IM(X_right[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) - MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]); |
787 | 787 | QMF_RE(X_left[s][b]) = MUL_F(QMF_RE(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_RE(ps->SA[s][b]), sa_map[b]); |
788 | 788 | QMF_IM(X_left[s][b]) = MUL_F(QMF_IM(X_left[s][b]), sa_dir_map[b]) + MUL_F(QMF_IM(ps->SA[s][b]), sa_map[b]); |
789 | ||
789 | ||
790 | 790 | sa_map[b] += k_sa_map[b]; |
791 | 791 | sa_dir_map[b] += k_sa_dir_map[b]; |
792 | 792 | } |
793 | 793 | for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++) |
794 | { | |
794 | { | |
795 | 795 | QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]); |
796 | 796 | QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); |
797 | 797 | } |
798 | 798 | } |
799 | } | |
799 | } | |
800 | 800 | else { |
801 | 801 | for (s = 0; s < NUM_OF_SUBSAMPLES; s++) |
802 | 802 | { |
803 | 803 | for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) |
804 | 804 | { |
805 | 805 | QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]); |
806 | QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); | |
807 | } | |
808 | } | |
809 | } | |
810 | } | |
811 | ||
812 | static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) | |
806 | QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); | |
807 | } | |
808 | } | |
809 | } | |
810 | } | |
811 | ||
812 | static void drm_add_pan(drm_ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) | |
813 | 813 | { |
814 | 814 | uint8_t s, b, qclass, ifreq; |
815 | 815 | real_t tmp, coeff1, coeff2; |
819 | 819 | |
820 | 820 | if (ps->bs_enable_pan) |
821 | 821 | { |
822 | for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) | |
822 | for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) | |
823 | 823 | { |
824 | 824 | /* Instead of dequantization, 20->64 mapping and 2^G(x,y) we do an |
825 | 825 | inverse mapping 64->20 and look up the 2^G(x,y) values directly */ |
828 | 828 | |
829 | 829 | if (ps->g_prev_pan_index[ifreq] >= 0) |
830 | 830 | { |
831 | pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass]; | |
831 | pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass]; | |
832 | 832 | } else { |
833 | 833 | pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass]; |
834 | 834 | } |
837 | 837 | /* a en b can be negative so we may need to inverse parts */ |
838 | 838 | if (ps->g_pan_index[ifreq] >= 0) |
839 | 839 | { |
840 | if (ps->g_prev_pan_index[ifreq] >= 0) | |
840 | if (ps->g_prev_pan_index[ifreq] >= 0) | |
841 | 841 | { |
842 | 842 | pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass], |
843 | 843 | pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]); |
846 | 846 | pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]); |
847 | 847 | } |
848 | 848 | } else { |
849 | if (ps->g_prev_pan_index[ifreq] >= 0) | |
849 | if (ps->g_prev_pan_index[ifreq] >= 0) | |
850 | 850 | { |
851 | 851 | pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass], |
852 | 852 | pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]); |
865 | 865 | tmp = pan_base[b]; |
866 | 866 | |
867 | 867 | coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp)); |
868 | coeff1 = MUL_R(coeff2, tmp); | |
868 | coeff1 = MUL_R(coeff2, tmp); | |
869 | 869 | |
870 | 870 | QMF_RE(temp_l) = QMF_RE(X_left[s][b]); |
871 | 871 | QMF_IM(temp_l) = QMF_IM(X_left[s][b]); |
876 | 876 | QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1); |
877 | 877 | QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2); |
878 | 878 | QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2); |
879 | ||
879 | ||
880 | 880 | /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */ |
881 | 881 | /* ^^^^^^^^^^^^^^^ k times */ |
882 | 882 | pan_base[b] = MUL_C(pan_base[b], pan_delta[b]); |
883 | } | |
884 | } | |
885 | } | |
883 | } | |
884 | } | |
885 | } | |
886 | 886 | } |
887 | 887 | |
888 | 888 | drm_ps_info *drm_ps_init(void) |
889 | 889 | { |
890 | 890 | drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info)); |
891 | 891 | |
892 | memset(ps, 0, sizeof(drm_ps_info)); | |
892 | memset(ps, 0, sizeof(drm_ps_info)); | |
893 | 893 | |
894 | 894 | return ps; |
895 | 895 | } |
901 | 901 | |
902 | 902 | /* main DRM PS decoding function */ |
903 | 903 | uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, qmf_t X_left[38][64], qmf_t X_right[38][64]) |
904 | { | |
905 | if (ps == NULL) | |
904 | { | |
905 | if (ps == NULL) | |
906 | 906 | { |
907 | 907 | memcpy(X_right, X_left, sizeof(qmf_t)*30*64); |
908 | return 0; | |
909 | } | |
910 | ||
911 | if (!ps->drm_ps_data_available && !guess) | |
908 | return 0; | |
909 | } | |
910 | ||
911 | if (!ps->drm_ps_data_available && !guess) | |
912 | 912 | { |
913 | 913 | memcpy(X_right, X_left, sizeof(qmf_t)*30*64); |
914 | 914 | memset(ps->g_prev_sa_index, 0, sizeof(ps->g_prev_sa_index)); |
923 | 923 | ps->sa_decode_error = 0; |
924 | 924 | ps->pan_decode_error = 0; |
925 | 925 | drm_ps_delta_decode(ps); |
926 | } else | |
926 | } else | |
927 | 927 | { |
928 | 928 | ps->sa_decode_error = 1; |
929 | 929 | ps->pan_decode_error = 1; |
930 | 930 | /* don't even bother decoding */ |
931 | 931 | } |
932 | ||
932 | ||
933 | 933 | ps->drm_ps_data_available = 0; |
934 | 934 | |
935 | 935 | drm_calc_sa_side_signal(ps, X_left); |
937 | 937 | |
938 | 938 | if (ps->bs_enable_sa) |
939 | 939 | { |
940 | ps->g_last_had_sa = 1; | |
941 | ||
942 | memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS); | |
940 | ps->g_last_had_sa = 1; | |
941 | ||
942 | memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS); | |
943 | 943 | |
944 | 944 | } else { |
945 | 945 | ps->g_last_had_sa = 0; |
946 | 946 | } |
947 | ||
947 | ||
948 | 948 | if (ps->bs_enable_pan) |
949 | 949 | { |
950 | 950 | drm_add_pan(ps, X_left, X_right); |
951 | ||
952 | ps->g_last_had_pan = 1; | |
951 | ||
952 | ps->g_last_had_pan = 1; | |
953 | 953 | |
954 | 954 | memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS); |
955 | 955 |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
47 | 47 | #define MAX_DELAY 5 |
48 | 48 | |
49 | 49 | typedef struct |
50 | { | |
50 | { | |
51 | 51 | uint8_t drm_ps_data_available; |
52 | 52 | uint8_t bs_enable_sa; |
53 | 53 | uint8_t bs_enable_pan; |
60 | 60 | |
61 | 61 | int8_t bs_sa_data[DRM_NUM_SA_BANDS]; |
62 | 62 | int8_t bs_pan_data[DRM_NUM_PAN_BANDS]; |
63 | ||
63 | ||
64 | 64 | int8_t g_sa_index[DRM_NUM_SA_BANDS]; |
65 | int8_t g_pan_index[DRM_NUM_PAN_BANDS]; | |
65 | int8_t g_pan_index[DRM_NUM_PAN_BANDS]; | |
66 | 66 | int8_t g_prev_sa_index[DRM_NUM_SA_BANDS]; |
67 | int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS]; | |
67 | int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS]; | |
68 | 68 | |
69 | 69 | int8_t sa_decode_error; |
70 | 70 | int8_t pan_decode_error; |
71 | 71 | |
72 | 72 | int8_t g_last_good_sa_index[DRM_NUM_SA_BANDS]; |
73 | 73 | int8_t g_last_good_pan_index[DRM_NUM_PAN_BANDS]; |
74 | ||
75 | qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND]; | |
74 | ||
75 | qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND]; | |
76 | 76 | |
77 | 77 | complex_t d_buff[2][MAX_SA_BAND]; |
78 | 78 | complex_t d2_buff[NUM_OF_LINKS][MAX_DELAY][MAX_SA_BAND]; |
79 | 79 | |
80 | uint8_t delay_buf_index_ser[NUM_OF_LINKS]; | |
81 | ||
80 | uint8_t delay_buf_index_ser[NUM_OF_LINKS]; | |
81 | ||
82 | 82 | real_t prev_nrg[MAX_SA_BAND]; |
83 | 83 | real_t prev_peakdiff[MAX_SA_BAND]; |
84 | real_t peakdecay_fast[MAX_SA_BAND]; | |
84 | real_t peakdecay_fast[MAX_SA_BAND]; | |
85 | 85 | } drm_ps_info; |
86 | 86 | |
87 | 87 |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
36 | 36 | #include "specrec.h" |
37 | 37 | #include "huffman.h" |
38 | 38 | |
39 | /* ISO/IEC 14496-3/Amd.1 | |
40 | * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR) | |
39 | /* ISO/IEC 14496-3/Amd.1 | |
40 | * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR) | |
41 | 41 | * |
42 | * HCR devides the spectral data in known fixed size segments, and | |
43 | * sorts it by the importance of the data. The importance is firstly | |
44 | * the (lower) position in the spectrum, and secondly the largest | |
45 | * value in the used codebook. | |
42 | * HCR devides the spectral data in known fixed size segments, and | |
43 | * sorts it by the importance of the data. The importance is firstly | |
44 | * the (lower) position in the spectrum, and secondly the largest | |
45 | * value in the used codebook. | |
46 | 46 | * The most important data is written at the start of each segment |
47 | * (at known positions), the remaining data is interleaved inbetween, | |
47 | * (at known positions), the remaining data is interleaved inbetween, | |
48 | 48 | * with the writing direction alternating. |
49 | 49 | * Data length is not increased. |
50 | 50 | */ |
59 | 59 | #define VCB11_FIRST 16 |
60 | 60 | #define VCB11_LAST 31 |
61 | 61 | |
62 | static const uint8_t PreSortCB_STD[NUM_CB] = | |
62 | static const uint8_t PreSortCB_STD[NUM_CB] = | |
63 | 63 | { 11, 9, 7, 5, 3, 1}; |
64 | 64 | |
65 | static const uint8_t PreSortCB_ER[NUM_CB_ER] = | |
65 | static const uint8_t PreSortCB_ER[NUM_CB_ER] = | |
66 | 66 | { 11, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 9, 7, 5, 3, 1}; |
67 | 67 | |
68 | 68 | /* 8.5.3.3.2 Derivation of segment width */ |
73 | 73 | #define segmentWidth(cb) min(maxCwLen[cb], ics->length_of_longest_codeword) |
74 | 74 | |
75 | 75 | /* bit-twiddling helpers */ |
76 | static const uint8_t S[] = {1, 2, 4, 8, 16}; | |
76 | static const uint8_t S[] = {1, 2, 4, 8, 16}; | |
77 | 77 | static const uint32_t B[] = {0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF}; |
78 | 78 | |
79 | 79 | typedef struct |
87 | 87 | /* rewind and reverse */ |
88 | 88 | /* 32 bit version */ |
89 | 89 | static uint32_t rewrev_word(uint32_t v, const uint8_t len) |
90 | { | |
90 | { | |
91 | 91 | /* 32 bit reverse */ |
92 | v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); | |
93 | v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); | |
94 | v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); | |
92 | v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); | |
93 | v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); | |
94 | v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); | |
95 | 95 | v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]); |
96 | 96 | v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]); |
97 | 97 | |
103 | 103 | |
104 | 104 | /* 64 bit version */ |
105 | 105 | static void rewrev_lword(uint32_t *hi, uint32_t *lo, const uint8_t len) |
106 | { | |
106 | { | |
107 | 107 | if (len <= 32) { |
108 | 108 | *hi = 0; |
109 | 109 | *lo = rewrev_word(*lo, len); |
112 | 112 | uint32_t t = *hi, v = *lo; |
113 | 113 | |
114 | 114 | /* double 32 bit reverse */ |
115 | v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); | |
116 | t = ((t >> S[0]) & B[0]) | ((t << S[0]) & ~B[0]); | |
117 | v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); | |
118 | t = ((t >> S[1]) & B[1]) | ((t << S[1]) & ~B[1]); | |
119 | v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); | |
120 | t = ((t >> S[2]) & B[2]) | ((t << S[2]) & ~B[2]); | |
115 | v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); | |
116 | t = ((t >> S[0]) & B[0]) | ((t << S[0]) & ~B[0]); | |
117 | v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); | |
118 | t = ((t >> S[1]) & B[1]) | ((t << S[1]) & ~B[1]); | |
119 | v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); | |
120 | t = ((t >> S[2]) & B[2]) | ((t << S[2]) & ~B[2]); | |
121 | 121 | v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]); |
122 | 122 | t = ((t >> S[3]) & B[3]) | ((t << S[3]) & ~B[3]); |
123 | v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]); | |
123 | v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]); | |
124 | 124 | t = ((t >> S[4]) & B[4]) | ((t << S[4]) & ~B[4]); |
125 | 125 | |
126 | 126 | /* last 32<>32 bit swap is implicit below */ |
127 | ||
127 | ||
128 | 128 | /* shift off low bits (this is really only one 64 bit shift) */ |
129 | 129 | *lo = (t >> (64 - len)) | (v << (len - 32)); |
130 | *hi = v >> (64 - len); | |
130 | *hi = v >> (64 - len); | |
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
149 | 149 | |
150 | 150 | al = a->bufa; |
151 | 151 | ah = a->bufb; |
152 | ||
152 | ||
153 | 153 | if (b->len > 32) |
154 | 154 | { |
155 | 155 | /* maskoff superfluous high b bits */ |
160 | 160 | al = 0; |
161 | 161 | } else { |
162 | 162 | bl = b->bufa & ((1 << (b->len)) - 1); |
163 | bh = 0; | |
163 | bh = 0; | |
164 | 164 | ah = (ah << (b->len)) | (al >> (32 - b->len)); |
165 | 165 | al = al << b->len; |
166 | 166 | } |
171 | 171 | |
172 | 172 | b->len += a->len; |
173 | 173 | } |
174 | ||
174 | ||
175 | 175 | static uint8_t is_good_cb(uint8_t this_CB, uint8_t this_sec_CB) |
176 | 176 | { |
177 | 177 | /* only want spectral data CB's */ |
189 | 189 | } |
190 | 190 | return 0; |
191 | 191 | } |
192 | ||
192 | ||
193 | 193 | static void read_segment(bits_t *segment, uint8_t segwidth, bitfile *ld) |
194 | 194 | { |
195 | 195 | segment->len = segwidth; |
196 | 196 | |
197 | 197 | if (segwidth > 32) |
198 | 198 | { |
199 | segment->bufb = faad_getbits(ld, segwidth - 32); | |
200 | segment->bufa = faad_getbits(ld, 32); | |
199 | segment->bufb = faad_getbits(ld, segwidth - 32); | |
200 | segment->bufa = faad_getbits(ld, 32); | |
201 | 201 | |
202 | 202 | } else { |
203 | 203 | segment->bufa = faad_getbits(ld, segwidth); |
204 | segment->bufb = 0; | |
205 | } | |
204 | segment->bufb = 0; | |
205 | } | |
206 | 206 | } |
207 | 207 | |
208 | 208 | static void fill_in_codeword(codeword_t *codeword, uint16_t index, uint16_t sp, uint8_t cb) |
213 | 213 | codeword[index].bits.len = 0; |
214 | 214 | } |
215 | 215 | |
216 | uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics, | |
216 | uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics, | |
217 | 217 | bitfile *ld, int16_t *spectral_data) |
218 | { | |
218 | { | |
219 | 219 | uint16_t PCWs_done; |
220 | uint16_t numberOfSegments, numberOfSets, numberOfCodewords; | |
220 | uint16_t numberOfSegments, numberOfSets, numberOfCodewords; | |
221 | 221 | |
222 | 222 | codeword_t codeword[512]; |
223 | 223 | bits_t segment[512]; |
225 | 225 | uint16_t sp_offset[8]; |
226 | 226 | uint16_t g, i, sortloop, set, bitsread; |
227 | 227 | /*uint16_t bitsleft, codewordsleft*/; |
228 | uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB; | |
229 | ||
228 | uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB; | |
229 | ||
230 | 230 | const uint16_t nshort = hDecoder->frameLength/8; |
231 | 231 | const uint16_t sp_data_len = ics->length_of_reordered_spectral_data; |
232 | ||
232 | ||
233 | 233 | const uint8_t *PreSortCb; |
234 | 234 | |
235 | 235 | /* no data (e.g. silence) */ |
241 | 241 | return 10; |
242 | 242 | |
243 | 243 | if (sp_data_len < ics->length_of_longest_codeword) |
244 | return 10; | |
244 | return 10; | |
245 | 245 | |
246 | 246 | sp_offset[0] = 0; |
247 | 247 | for (g = 1; g < ics->num_window_groups; g++) |
264 | 264 | PreSortCb = PreSortCB_STD; |
265 | 265 | last_CB = NUM_CB; |
266 | 266 | } |
267 | ||
267 | ||
268 | 268 | /* step 1: decode PCW's (set 0), and stuff data in easier-to-use format */ |
269 | 269 | for (sortloop = 0; sortloop < last_CB; sortloop++) |
270 | 270 | { |
271 | 271 | /* select codebook to process this pass */ |
272 | 272 | this_CB = PreSortCb[sortloop]; |
273 | ||
273 | ||
274 | 274 | /* loop over sfbs */ |
275 | 275 | for (sfb = 0; sfb < ics->max_sfb; sfb++) |
276 | 276 | { |
283 | 283 | { |
284 | 284 | /* check whether sfb used here is the one we want to process */ |
285 | 285 | if ((ics->sect_start[g][i] <= sfb) && (ics->sect_end[g][i] > sfb)) |
286 | { | |
286 | { | |
287 | 287 | /* check whether codebook used here is the one we want to process */ |
288 | 288 | this_sec_CB = ics->sect_cb[g][i]; |
289 | ||
290 | if (is_good_cb(this_CB, this_sec_CB)) | |
289 | ||
290 | if (is_good_cb(this_CB, this_sec_CB)) | |
291 | 291 | { |
292 | 292 | /* precalculate some stuff */ |
293 | 293 | uint16_t sect_sfb_size = ics->sect_sfb_offset[g][sfb+1] - ics->sect_sfb_offset[g][sfb]; |
294 | 294 | uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN; |
295 | 295 | uint16_t group_cws_count = (4*ics->window_group_length[g])/inc; |
296 | 296 | uint8_t segwidth = segmentWidth(this_sec_CB); |
297 | uint16_t cws; | |
298 | ||
299 | /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */ | |
297 | uint16_t cws; | |
298 | ||
299 | /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */ | |
300 | 300 | for (cws = 0; (cws < group_cws_count) && ((cws + w_idx*group_cws_count) < sect_sfb_size); cws++) |
301 | 301 | { |
302 | uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count); | |
302 | uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count); | |
303 | 303 | |
304 | 304 | /* read and decode PCW */ |
305 | 305 | if (!PCWs_done) |
306 | { | |
306 | { | |
307 | 307 | /* read in normal segments */ |
308 | 308 | if (bitsread + segwidth <= sp_data_len) |
309 | { | |
310 | read_segment(&segment[numberOfSegments], segwidth, ld); | |
309 | { | |
310 | read_segment(&segment[numberOfSegments], segwidth, ld); | |
311 | 311 | bitsread += segwidth; |
312 | ||
313 | huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]); | |
312 | ||
313 | huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]); | |
314 | 314 | |
315 | 315 | /* keep leftover bits */ |
316 | 316 | rewrev_bits(&segment[numberOfSegments]); |
321 | 321 | this in earlier because it might not fit in 64 bits. since we already |
322 | 322 | decoded (and removed) the PCW it is now guaranteed to fit */ |
323 | 323 | if (bitsread < sp_data_len) |
324 | { | |
325 | const uint8_t additional_bits = sp_data_len - bitsread; | |
326 | ||
327 | read_segment(&segment[numberOfSegments], additional_bits, ld); | |
324 | { | |
325 | const uint8_t additional_bits = sp_data_len - bitsread; | |
326 | ||
327 | read_segment(&segment[numberOfSegments], additional_bits, ld); | |
328 | 328 | segment[numberOfSegments].len += segment[numberOfSegments-1].len; |
329 | rewrev_bits(&segment[numberOfSegments]); | |
329 | rewrev_bits(&segment[numberOfSegments]); | |
330 | 330 | |
331 | 331 | if (segment[numberOfSegments-1].len > 32) |
332 | 332 | { |
333 | segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb + | |
333 | segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb + | |
334 | 334 | showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len - 32); |
335 | segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + | |
335 | segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + | |
336 | 336 | showbits_hcr(&segment[numberOfSegments-1], 32); |
337 | 337 | } else { |
338 | segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + | |
338 | segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + | |
339 | 339 | showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len); |
340 | 340 | segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb; |
341 | } | |
341 | } | |
342 | 342 | segment[numberOfSegments-1].len += additional_bits; |
343 | 343 | } |
344 | 344 | bitsread = sp_data_len; |
345 | 345 | PCWs_done = 1; |
346 | 346 | |
347 | fill_in_codeword(codeword, 0, sp, this_sec_CB); | |
347 | fill_in_codeword(codeword, 0, sp, this_sec_CB); | |
348 | 348 | } |
349 | } else { | |
350 | fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB); | |
349 | } else { | |
350 | fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB); | |
351 | 351 | } |
352 | 352 | numberOfCodewords++; |
353 | } | |
353 | } | |
354 | 354 | } |
355 | 355 | } |
356 | } | |
357 | } | |
356 | } | |
357 | } | |
358 | 358 | } |
359 | 359 | } |
360 | 360 | } |
361 | 361 | |
362 | 362 | if (numberOfSegments == 0) |
363 | return 10; | |
364 | ||
365 | numberOfSets = numberOfCodewords / numberOfSegments; | |
363 | return 10; | |
364 | ||
365 | numberOfSets = numberOfCodewords / numberOfSegments; | |
366 | 366 | |
367 | 367 | /* step 2: decode nonPCWs */ |
368 | 368 | for (set = 1; set <= numberOfSets; set++) |
385 | 385 | { |
386 | 386 | uint8_t tmplen; |
387 | 387 | |
388 | if (codeword[codeword_idx].bits.len != 0) | |
389 | concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits); | |
390 | ||
388 | if (codeword[codeword_idx].bits.len != 0) | |
389 | concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits); | |
390 | ||
391 | 391 | tmplen = segment[segment_idx].len; |
392 | 392 | |
393 | 393 | if (huffman_spectral_data_2(codeword[codeword_idx].cb, &segment[segment_idx], |
394 | 394 | &spectral_data[codeword[codeword_idx].sp_offset]) >= 0) |
395 | 395 | { |
396 | 396 | codeword[codeword_idx].decoded = 1; |
397 | } else | |
398 | { | |
397 | } else | |
398 | { | |
399 | 399 | codeword[codeword_idx].bits = segment[segment_idx]; |
400 | codeword[codeword_idx].bits.len = tmplen; | |
400 | codeword[codeword_idx].bits.len = tmplen; | |
401 | 401 | } |
402 | ||
402 | ||
403 | 403 | } |
404 | 404 | } |
405 | 405 | } |
408 | 408 | } |
409 | 409 | |
410 | 410 | #if 0 // Seems to give false errors |
411 | bitsleft = 0; | |
412 | ||
411 | bitsleft = 0; | |
412 | ||
413 | 413 | for (i = 0; i < numberOfSegments && !bitsleft; i++) |
414 | 414 | bitsleft += segment[i].len; |
415 | 415 | |
417 | 417 | |
418 | 418 | codewordsleft = 0; |
419 | 419 | |
420 | for (i = 0; (i < numberOfCodewords - numberOfSegments) && (!codewordsleft); i++) | |
421 | if (!codeword[i].decoded) | |
422 | codewordsleft++; | |
420 | for (i = 0; (i < numberOfCodewords - numberOfSegments) && (!codewordsleft); i++) | |
421 | if (!codeword[i].decoded) | |
422 | codewordsleft++; | |
423 | 423 | |
424 | 424 | if (codewordsleft) return 10; |
425 | 425 | #endif |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
42 | 42 | |
43 | 43 | /* static function declarations */ |
44 | 44 | static INLINE void huffman_sign_bits(bitfile *ld, int16_t *sp, uint8_t len); |
45 | static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp); | |
45 | static INLINE uint8_t huffman_getescape(bitfile *ld, int16_t *sp); | |
46 | 46 | static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp); |
47 | 47 | static uint8_t huffman_2step_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp); |
48 | 48 | static uint8_t huffman_2step_pair(uint8_t cb, bitfile *ld, int16_t *sp); |
120 | 120 | } |
121 | 121 | } |
122 | 122 | |
123 | static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp) | |
123 | static INLINE uint8_t huffman_getescape(bitfile *ld, int16_t *sp) | |
124 | 124 | { |
125 | 125 | uint8_t neg, i; |
126 | 126 | int16_t j; |
127 | 127 | int16_t off; |
128 | ||
129 | if (sp < 0) | |
130 | { | |
131 | if (sp != -16) | |
132 | return sp; | |
128 | int16_t x = *sp; | |
129 | ||
130 | if (x < 0) | |
131 | { | |
132 | if (x != -16) | |
133 | return 0; | |
133 | 134 | neg = 1; |
134 | 135 | } else { |
135 | if (sp != 16) | |
136 | return sp; | |
136 | if (x != 16) | |
137 | return 0; | |
137 | 138 | neg = 0; |
138 | 139 | } |
139 | 140 | |
140 | for (i = 4; ; i++) | |
141 | for (i = 4; i < 16; i++) | |
141 | 142 | { |
142 | 143 | if (faad_get1bit(ld |
143 | 144 | DEBUGVAR(1,6,"huffman_getescape(): escape size")) == 0) |
145 | 146 | break; |
146 | 147 | } |
147 | 148 | } |
149 | if (i >= 16) | |
150 | return 10; | |
148 | 151 | |
149 | 152 | off = (int16_t)faad_getbits(ld, i |
150 | 153 | DEBUGVAR(1,9,"huffman_getescape(): escape")); |
153 | 156 | if (neg) |
154 | 157 | j = -j; |
155 | 158 | |
156 | return j; | |
159 | *sp = j; | |
160 | return 0; | |
157 | 161 | } |
158 | 162 | |
159 | 163 | static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp) |
356 | 360 | return huffman_2step_pair_sign(cb, ld, sp); |
357 | 361 | case 12: { |
358 | 362 | uint8_t err = huffman_2step_pair(11, ld, sp); |
359 | sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1); | |
363 | sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1); | |
360 | 364 | return err; } |
361 | 365 | case 11: |
362 | 366 | { |
363 | 367 | uint8_t err = huffman_2step_pair_sign(11, ld, sp); |
364 | sp[0] = huffman_getescape(ld, sp[0]); | |
365 | sp[1] = huffman_getescape(ld, sp[1]); | |
368 | if (!err) | |
369 | err = huffman_getescape(ld, &sp[0]); | |
370 | if (!err) | |
371 | err = huffman_getescape(ld, &sp[1]); | |
366 | 372 | return err; |
367 | 373 | } |
368 | 374 | #ifdef ERROR_RESILIENCE |
371 | 377 | case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31: |
372 | 378 | { |
373 | 379 | uint8_t err = huffman_2step_pair_sign(11, ld, sp); |
374 | sp[0] = huffman_getescape(ld, sp[0]); | |
375 | sp[1] = huffman_getescape(ld, sp[1]); | |
380 | if (!err) | |
381 | err = huffman_getescape(ld, &sp[0]); | |
382 | if (!err) | |
383 | err = huffman_getescape(ld, &sp[1]); | |
376 | 384 | |
377 | 385 | /* check LAV (Largest Absolute Value) */ |
378 | 386 | /* this finds errors in the ESCAPE signal */ |
445 | 453 | vcb11 = cb; |
446 | 454 | cb = 11; |
447 | 455 | } |
448 | ||
456 | ||
449 | 457 | cw = showbits_hcr(ld, hcbN[cb]); |
450 | 458 | offset = hcb_table[cb][cw].offset; |
451 | 459 | extra_bits = hcb_table[cb][cw].extra_bits; |
468 | 476 | while (!hcb3[offset].is_leaf) |
469 | 477 | { |
470 | 478 | uint8_t b; |
471 | ||
479 | ||
472 | 480 | if ( get1bit_hcr(ld, &b) ) return -1; |
473 | 481 | offset += hcb3[offset].data[b]; |
474 | 482 | } |
487 | 495 | while (!hcb_bin_table[cb][offset].is_leaf) |
488 | 496 | { |
489 | 497 | uint8_t b; |
490 | ||
498 | ||
491 | 499 | if (get1bit_hcr(ld, &b) ) return -1; |
492 | 500 | offset += hcb_bin_table[cb][offset].data[b]; |
493 | 501 | } |
526 | 534 | int32_t j; |
527 | 535 | uint32_t off; |
528 | 536 | |
529 | neg = (sp[k] < 0) ? 1 : 0; | |
537 | neg = (sp[k] < 0) ? 1 : 0; | |
530 | 538 | |
531 | 539 | for (i = 4; ; i++) |
532 | 540 | { |
550 | 558 | /* this finds errors in the ESCAPE signal */ |
551 | 559 | vcb11_check_LAV(vcb11, sp); |
552 | 560 | } |
553 | } | |
561 | } | |
554 | 562 | return ld->len; |
555 | 563 | } |
556 | 564 |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
53 | 53 | tmp |= (uint32_t)0x00010000; /* insert 1 lsb */ |
54 | 54 | tmp2 = tmp; /* add 1 lsb and elided one */ |
55 | 55 | tmp &= (uint32_t)0xff800000; /* extract exponent and sign */ |
56 | ||
56 | ||
57 | 57 | *pf = *(float32_t*)&tmp1 + *(float32_t*)&tmp2 - *(float32_t*)&tmp; |
58 | 58 | } else { |
59 | 59 | *pf = *(float32_t*)&tmp; |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
31 | 31 | * Fast (I)MDCT Implementation using (I)FFT ((Inverse) Fast Fourier Transform) |
32 | 32 | * and consists of three steps: pre-(I)FFT complex multiplication, complex |
33 | 33 | * (I)FFT, post-(I)FFT complex multiplication, |
34 | * | |
34 | * | |
35 | 35 | * As described in: |
36 | 36 | * P. Duhamel, Y. Mahieux, and J.P. Petit, "A Fast Algorithm for the |
37 | 37 | * Implementation of Filter Banks Based on 'Time Domain Aliasing |
38 | * Cancellationâ," IEEE Proc. on ICASSPâ91, 1991, pp. 2209-2212. | |
38 | * Cancellation'," IEEE Proc. on ICASSP'91, 1991, pp. 2209-2212. | |
39 | 39 | * |
40 | 40 | * |
41 | 41 | * As of April 6th 2002 completely rewritten. |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
106 | 106 | 0, /* 27 ER Parametric */ |
107 | 107 | #endif |
108 | 108 | 0, /* 28 (Reserved) */ |
109 | 0, /* 29 (Reserved) */ | |
109 | #ifdef PS_DEC | |
110 | 1, /* 29 AAC LC + SBR + PS */ | |
111 | #else | |
112 | 0, /* 29 AAC LC + SBR + PS */ | |
113 | #endif | |
110 | 114 | 0, /* 30 (Reserved) */ |
111 | 115 | 0 /* 31 (Reserved) */ |
112 | 116 | }; |
173 | 177 | |
174 | 178 | #ifdef SBR_DEC |
175 | 179 | mp4ASC->sbr_present_flag = -1; |
176 | if (mp4ASC->objectTypeIndex == 5) | |
180 | if (mp4ASC->objectTypeIndex == 5 || mp4ASC->objectTypeIndex == 29) | |
177 | 181 | { |
178 | 182 | uint8_t tmp; |
179 | 183 | |
230 | 234 | else |
231 | 235 | bits_to_decode = (int8_t)(buffer_size*8 - (startpos-faad_get_processed_bits(ld))); |
232 | 236 | |
233 | if ((mp4ASC->objectTypeIndex != 5) && (bits_to_decode >= 16)) | |
237 | if ((mp4ASC->objectTypeIndex != 5 && mp4ASC->objectTypeIndex != 29) && (bits_to_decode >= 16)) | |
234 | 238 | { |
235 | 239 | int16_t syncExtensionType = (int16_t)faad_getbits(ld, 11 |
236 | 240 | DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType")); |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
41 | 41 | uint32_t buffer_size, |
42 | 42 | mp4AudioSpecificConfig *mp4ASC, |
43 | 43 | program_config *pce, uint8_t short_form); |
44 | ||
44 | ||
45 | 45 | int8_t AudioSpecificConfigFromBitfile(bitfile *ld, |
46 | 46 | mp4AudioSpecificConfig *mp4ASC, |
47 | 47 | program_config *pce, uint32_t bsize, uint8_t short_form); |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
47 | 47 | |
48 | 48 | if (ics->ms_mask_present >= 1) |
49 | 49 | { |
50 | for (g = 0; g < ics->num_window_groups; g++) | |
50 | for (g = 0; g < ics->num_window_groups; g++) | |
51 | 51 | { |
52 | 52 | for (b = 0; b < ics->window_group_length[g]; b++) |
53 | 53 | { |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
235 | 235 | if ((ics_right != NULL) |
236 | 236 | && is_noise(ics_right, g, sfb)) |
237 | 237 | { |
238 | if (channel_pair && | |
238 | #ifdef LTP_DEC | |
239 | /* See comment above. */ | |
240 | ics_right->ltp.long_used[sfb] = 0; | |
241 | ics_right->ltp2.long_used[sfb] = 0; | |
242 | #endif | |
243 | #ifdef MAIN_DEC | |
244 | /* See comment above. */ | |
245 | ics_right->pred.prediction_used[sfb] = 0; | |
246 | #endif | |
247 | ||
248 | if (channel_pair && is_noise(ics_left, g, sfb) && | |
239 | 249 | (((ics_left->ms_mask_present == 1) && |
240 | 250 | (ics_left->ms_used[g][sfb])) || |
241 | 251 | (ics_left->ms_mask_present == 2))) |
250 | 260 | ics_right->scale_factors[g][sfb], size, sub, &r1_dep, &r2_dep); |
251 | 261 | |
252 | 262 | } else /*if (ics_left->ms_mask_present == 0)*/ { |
253 | ||
254 | #ifdef LTP_DEC | |
255 | ics_right->ltp.long_used[sfb] = 0; | |
256 | ics_right->ltp2.long_used[sfb] = 0; | |
257 | #endif | |
258 | #ifdef MAIN_DEC | |
259 | ics_right->pred.prediction_used[sfb] = 0; | |
260 | #endif | |
261 | 263 | |
262 | 264 | offs = ics_right->swb_offset[sfb]; |
263 | 265 | size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs; |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
453 | 453 | int8_t index; |
454 | 454 | uint32_t cw; |
455 | 455 | rvlc_huff_table *h = book_rvlc; |
456 | ||
456 | ||
457 | 457 | i = h->len; |
458 | 458 | if (direction > 0) |
459 | 459 | cw = faad_getbits(ld_sf, i DEBUGVAR(1,0,"")); |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
96 | 96 | { |
97 | 97 | sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960; |
98 | 98 | sbr->numTimeSlots = NO_TIME_SLOTS_960; |
99 | } else { | |
99 | } | |
100 | else if (framelength == 1024) | |
101 | { | |
100 | 102 | sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS; |
101 | 103 | sbr->numTimeSlots = NO_TIME_SLOTS; |
104 | } | |
105 | else | |
106 | { | |
107 | faad_free(sbr); | |
108 | return NULL; | |
102 | 109 | } |
103 | 110 | |
104 | 111 | sbr->GQ_ringbuf_index[0] = 0; |
165 | 172 | } |
166 | 173 | |
167 | 174 | #ifdef PS_DEC |
168 | if (sbr->ps != NULL) | |
175 | if (sbr->ps != NULL) | |
169 | 176 | ps_free(sbr->ps); |
170 | 177 | #endif |
171 | 178 | |
204 | 211 | |
205 | 212 | memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t)); |
206 | 213 | memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t)); |
207 | ||
214 | ||
208 | 215 | sbr->GQ_ringbuf_index[0] = 0; |
209 | 216 | sbr->GQ_ringbuf_index[1] = 0; |
210 | 217 | sbr->header_count = 0; |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
79 | 79 | { |
80 | 80 | return startMin + offset[offsetIndex][bs_start_freq]; |
81 | 81 | |
82 | #if 0 /* replaced by offsetIndexTable */ | |
82 | #if 0 /* replaced by offsetIndexTable */ | |
83 | 83 | switch (sample_rate) |
84 | 84 | { |
85 | 85 | case 16000: |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
395 | 395 | }; |
396 | 396 | |
397 | 397 | static const real_t log_Qplus1[31] = { |
398 | REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), | |
399 | REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), | |
400 | REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), | |
401 | REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), | |
402 | REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), | |
403 | REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), | |
404 | REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), | |
405 | REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), | |
406 | REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), | |
407 | REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), | |
398 | REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), | |
399 | REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), | |
400 | REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), | |
401 | REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), | |
402 | REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), | |
403 | REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), | |
404 | REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), | |
405 | REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), | |
406 | REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), | |
407 | REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), | |
408 | 408 | REAL_CONST(0.000000000000000) |
409 | 409 | }; |
410 | 410 | |
867 | 867 | }; |
868 | 868 | |
869 | 869 | static const real_t log_Qplus1[31] = { |
870 | REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), | |
871 | REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), | |
872 | REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), | |
873 | REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), | |
874 | REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), | |
875 | REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), | |
876 | REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), | |
877 | REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), | |
878 | REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), | |
879 | REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), | |
870 | REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), | |
871 | REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), | |
872 | REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), | |
873 | REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), | |
874 | REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), | |
875 | REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), | |
876 | REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), | |
877 | REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), | |
878 | REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), | |
879 | REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), | |
880 | 880 | REAL_CONST(0.000000000000000) |
881 | 881 | }; |
882 | 882 | |
1416 | 1416 | i++; |
1417 | 1417 | } |
1418 | 1418 | } |
1419 | } | |
1419 | } | |
1420 | 1420 | |
1421 | 1421 | if (grouping) |
1422 | 1422 | { |
1438 | 1438 | for (k = 0; k < sbr->N_G[l]; k++) |
1439 | 1439 | { |
1440 | 1440 | E_total_est = E_total = 0; |
1441 | ||
1441 | ||
1442 | 1442 | for (m = sbr->f_group[l][k<<1]; m < sbr->f_group[l][(k<<1) + 1]; m++) |
1443 | 1443 | { |
1444 | 1444 | /* E_curr: integer */ |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
297 | 297 | /* improves accuracy */ |
298 | 298 | if (exp > 0) |
299 | 299 | exp -= 1; |
300 | ||
300 | ||
301 | 301 | pow2_to_exp = 1<<(exp-1); |
302 | 302 | |
303 | 303 | temp2_r = (QMF_RE(buffer[offset-2][bd]) + pow2_to_exp) >> exp; |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
216 | 216 | { |
217 | 217 | result += calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq, |
218 | 218 | saved_samplerate_mode, saved_freq_scale, |
219 | saved_alter_scale, saved_xover_band); | |
219 | saved_alter_scale, saved_xover_band); | |
220 | 220 | } |
221 | 221 | |
222 | 222 | /* we should be able to safely set result to 0 now, */ |
247 | 247 | #ifdef DRM |
248 | 248 | if (!sbr->Is_DRM_SBR) |
249 | 249 | #endif |
250 | { | |
250 | { | |
251 | 251 | /* -4 does not apply, bs_extension_type is re-read in this function */ |
252 | 252 | num_align_bits = 8*cnt /*- 4*/ - num_sbr_bits2; |
253 | 253 |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
621 | 621 | wb = wa + bin; |
622 | 622 | |
623 | 623 | spec_data[wb+0] = iquant(quant_data[k+0], tab, &error) * scf; |
624 | spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf; | |
625 | spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf; | |
624 | spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf; | |
625 | spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf; | |
626 | 626 | spec_data[wb+3] = iquant(quant_data[k+3], tab, &error) * scf; |
627 | ||
627 | ||
628 | 628 | #else |
629 | 629 | real_t iq0 = iquant(quant_data[k+0], tab, &error); |
630 | 630 | real_t iq1 = iquant(quant_data[k+1], tab, &error); |
940 | 940 | /* sanity check, CVE-2018-20199, CVE-2018-20360 */ |
941 | 941 | if(!hDecoder->time_out[sce->channel]) |
942 | 942 | return 15; |
943 | if(output_channels > 1 && !hDecoder->time_out[sce->channel+1]) | |
944 | return 15; | |
945 | if(!hDecoder->fb_intermed[sce->channel]) | |
946 | return 15; | |
943 | 947 | |
944 | 948 | /* dequantisation and scaling */ |
945 | 949 | retval = quant_to_spec(hDecoder, ics, spec_data, spec_coef, hDecoder->frameLength); |
1055 | 1059 | #endif |
1056 | 1060 | ); |
1057 | 1061 | } |
1062 | if (!hDecoder->sbr[ele]) | |
1063 | return 19; | |
1058 | 1064 | |
1059 | 1065 | if (sce->ics1.window_sequence == EIGHT_SHORT_SEQUENCE) |
1060 | 1066 | hDecoder->sbr[ele]->maxAACLine = 8*min(sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)], sce->ics1.swb_offset_max); |
1121 | 1127 | } |
1122 | 1128 | |
1123 | 1129 | /* sanity check, CVE-2018-20199, CVE-2018-20360 */ |
1124 | if(!hDecoder->time_out[cpe->channel]) | |
1130 | if(!hDecoder->time_out[cpe->channel] || !hDecoder->time_out[cpe->paired_channel]) | |
1131 | return 15; | |
1132 | if(!hDecoder->fb_intermed[cpe->channel] || !hDecoder->fb_intermed[cpe->paired_channel]) | |
1125 | 1133 | return 15; |
1126 | 1134 | |
1127 | 1135 | /* dequantisation and scaling */ |
1311 | 1319 | #endif |
1312 | 1320 | ); |
1313 | 1321 | } |
1322 | if (!hDecoder->sbr[ele]) | |
1323 | return 19; | |
1314 | 1324 | |
1315 | 1325 | if (cpe->ics1.window_sequence == EIGHT_SHORT_SEQUENCE) |
1316 | 1326 | hDecoder->sbr[ele]->maxAACLine = 8*min(cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)], cpe->ics1.swb_offset_max); |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
58 | 58 | -2.1939551286300665E-02, -2.4533179947088161E-02, -2.2591663337768787E-02, |
59 | 59 | -1.5122066420044672E-02, -1.7971713448186293E-03, 1.6903413428575379E-02, |
60 | 60 | 3.9672315874127042E-02, 6.4487527248102796E-02, 8.8850025474701726E-02, |
61 | 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012 | |
61 | 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012 | |
62 | 62 | }; |
63 | 63 | |
64 | 64 | for (j = 0; j < 48; ++j) |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
343 | 343 | can become 2 when some form of Parametric Stereo coding is used |
344 | 344 | */ |
345 | 345 | |
346 | if (hDecoder->frame && hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele) { | |
346 | if (hDecoder->element_id[hDecoder->fr_ch_ele] != INVALID_ELEMENT_ID && | |
347 | hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele) | |
348 | { | |
347 | 349 | /* element inconsistency */ |
348 | 350 | hInfo->error = 21; |
349 | 351 | return; |
400 | 402 | return; |
401 | 403 | } |
402 | 404 | |
403 | if (hDecoder->frame && hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele) { | |
405 | if (hDecoder->element_id[hDecoder->fr_ch_ele] != INVALID_ELEMENT_ID && | |
406 | hDecoder->element_id[hDecoder->fr_ch_ele] != id_syn_ele) | |
407 | { | |
404 | 408 | /* element inconsistency */ |
405 | 409 | hInfo->error = 21; |
406 | 410 | return; |
534 | 538 | break; |
535 | 539 | case 3: |
536 | 540 | decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE); |
541 | if (hInfo->error > 0) | |
542 | return; | |
537 | 543 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
538 | 544 | if (hInfo->error > 0) |
539 | 545 | return; |
540 | 546 | break; |
541 | 547 | case 4: |
542 | 548 | decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE); |
549 | if (hInfo->error > 0) | |
550 | return; | |
543 | 551 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
552 | if (hInfo->error > 0) | |
553 | return; | |
544 | 554 | decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE); |
545 | 555 | if (hInfo->error > 0) |
546 | 556 | return; |
547 | 557 | break; |
548 | 558 | case 5: |
549 | 559 | decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE); |
560 | if (hInfo->error > 0) | |
561 | return; | |
550 | 562 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
563 | if (hInfo->error > 0) | |
564 | return; | |
551 | 565 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
552 | 566 | if (hInfo->error > 0) |
553 | 567 | return; |
554 | 568 | break; |
555 | 569 | case 6: |
556 | 570 | decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE); |
571 | if (hInfo->error > 0) | |
572 | return; | |
557 | 573 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
574 | if (hInfo->error > 0) | |
575 | return; | |
558 | 576 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
577 | if (hInfo->error > 0) | |
578 | return; | |
559 | 579 | decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE); |
560 | 580 | if (hInfo->error > 0) |
561 | 581 | return; |
562 | 582 | break; |
563 | 583 | case 7: /* 8 channels */ |
564 | 584 | decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE); |
585 | if (hInfo->error > 0) | |
586 | return; | |
565 | 587 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
588 | if (hInfo->error > 0) | |
589 | return; | |
566 | 590 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
591 | if (hInfo->error > 0) | |
592 | return; | |
567 | 593 | decode_cpe(hDecoder, hInfo, ld, ID_CPE); |
594 | if (hInfo->error > 0) | |
595 | return; | |
568 | 596 | decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE); |
569 | 597 | if (hInfo->error > 0) |
570 | 598 | return; |
883 | 911 | if ((ics->ltp.data_present = faad_get1bit(ld |
884 | 912 | DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1) |
885 | 913 | { |
886 | ltp_data(hDecoder, ics, &(ics->ltp), ld); | |
914 | if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0) | |
915 | { | |
916 | return retval; | |
917 | } | |
887 | 918 | } |
888 | 919 | } |
889 | 920 | #endif |
1090 | 1121 | #endif |
1091 | 1122 | ); |
1092 | 1123 | } |
1124 | if (!hDecoder->sbr[sbr_ele]) | |
1125 | return 19; | |
1093 | 1126 | |
1094 | 1127 | hDecoder->sbr_present_flag = 1; |
1095 | 1128 | |
1278 | 1311 | } |
1279 | 1312 | #else |
1280 | 1313 | faad_get1bit(ld); |
1281 | #endif | |
1314 | #endif | |
1282 | 1315 | |
1283 | 1316 | hInfo->error = side_info(hDecoder, &cpe, ld, ics1, 1); |
1284 | 1317 | if (hInfo->error > 0) |
1358 | 1391 | { |
1359 | 1392 | hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0], |
1360 | 1393 | 2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1); |
1394 | } | |
1395 | if (!hDecoder->sbr[0]) | |
1396 | { | |
1397 | hInfo->error = 19; | |
1398 | return; | |
1361 | 1399 | } |
1362 | 1400 | |
1363 | 1401 | /* Reverse bit reading of SBR data in DRM audio frame */ |
1610 | 1648 | if (result > 0) |
1611 | 1649 | return result; |
1612 | 1650 | |
1613 | if (hDecoder->object_type >= ER_OBJECT_START) | |
1651 | if (hDecoder->object_type >= ER_OBJECT_START) | |
1614 | 1652 | { |
1615 | 1653 | if (ics->tns_data_present) |
1616 | 1654 | tns_data(ics, &(ics->tns), ld); |
2178 | 2216 | return n; |
2179 | 2217 | case EXT_FILL_DATA: |
2180 | 2218 | /* fill_nibble = */ faad_getbits(ld, 4 |
2181 | DEBUGVAR(1,136,"extension_payload(): fill_nibble")); /* must be â0000â */ | |
2219 | DEBUGVAR(1,136,"extension_payload(): fill_nibble")); /* must be '0000' */ | |
2182 | 2220 | for (i = 0; i < count-1; i++) |
2183 | 2221 | { |
2184 | 2222 | /* fill_byte[i] = */ faad_getbits(ld, 8 |
2185 | DEBUGVAR(1,88,"extension_payload(): fill_byte")); /* must be â10100101â */ | |
2223 | DEBUGVAR(1,88,"extension_payload(): fill_byte")); /* must be '10100101' */ | |
2186 | 2224 | } |
2187 | 2225 | return count; |
2188 | 2226 | case EXT_DATA_ELEMENT: |
2641 | 2679 | endpos = faad_get_processed_bits(ld); |
2642 | 2680 | if(ret>0) |
2643 | 2681 | return (len*8)-(endpos-initpos); |
2644 | //faad_getbits(ld, initpos-endpos); //go back to initpos, but is valid a getbits(-N) ? | |
2682 | //faad_getbits(ld, initpos-endpos); //go back to initpos, but is valid a getbits(-N) ? | |
2645 | 2683 | } |
2646 | 2684 | return 0xFFFFFFFF; |
2647 | 2685 | } |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
90 | 90 | #define ID_PCE 0x5 |
91 | 91 | #define ID_FIL 0x6 |
92 | 92 | #define ID_END 0x7 |
93 | #define INVALID_ELEMENT_ID 255 | |
93 | 94 | |
94 | 95 | #define ONLY_LONG_SEQUENCE 0x0 |
95 | 96 | #define LONG_START_SEQUENCE 0x1 |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
37 | 37 | |
38 | 38 | #define TNS_MAX_ORDER 20 |
39 | 39 | |
40 | ||
40 | ||
41 | 41 | void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index, |
42 | 42 | uint8_t object_type, real_t *spec, uint16_t frame_len); |
43 | 43 | void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index, |
0 | 0 | /* |
1 | 1 | ** FAAD - Freeware Advanced Audio Decoder |
2 | 2 | ** Copyright (C) 2002 M. Bakker |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** $Id: QCDFAAD.c,v 1.2 2003/04/28 19:04:35 menno Exp $ |
239 | 239 | { |
240 | 240 | case WM_INITDIALOG: |
241 | 241 | /* Set priority slider range and previous position */ |
242 | SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(1, 5)); | |
242 | SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETRANGE, TRUE, MAKELONG(1, 5)); | |
243 | 243 | SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETPOS, TRUE, m_priority); |
244 | 244 | SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[m_priority]); |
245 | ||
245 | ||
246 | 246 | /* Put a limit to the amount of characters allowed in the buffer boxes */ |
247 | 247 | SendMessage(GetDlgItem(hwndDlg, LOCAL_BUFFER_TXT), EM_LIMITTEXT, 4, 0); |
248 | 248 | SendMessage(GetDlgItem(hwndDlg, STREAM_BUFFER_TXT), EM_LIMITTEXT, 4, 0); |
288 | 288 | if(GetDlgItem(hwndDlg, VARBITRATE_CHK) == (HWND) lParam) |
289 | 289 | { |
290 | 290 | /* Variable Bitrate checkbox hit */ |
291 | m_variable_bitrate_display = SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_GETCHECK, 0, 0); | |
291 | m_variable_bitrate_display = SendMessage(GetDlgItem(hwndDlg, VARBITRATE_CHK), BM_GETCHECK, 0, 0); | |
292 | 292 | } |
293 | 293 | if(GetDlgItem(hwndDlg, IDC_MEMMAP) == (HWND) lParam) |
294 | 294 | { |
295 | 295 | /* Variable Bitrate checkbox hit */ |
296 | m_memmap_file = SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_GETCHECK, 0, 0); | |
296 | m_memmap_file = SendMessage(GetDlgItem(hwndDlg, IDC_MEMMAP), BM_GETCHECK, 0, 0); | |
297 | 297 | } |
298 | 298 | } |
299 | 299 | |
362 | 362 | |
363 | 363 | SetDlgItemText(hwndDlg, IDC_PLUGINVER, szPluginVer); |
364 | 364 | SetDlgItemText(hwndDlg, IDC_FAADVER, szFLACVer); |
365 | ||
365 | ||
366 | 366 | return TRUE; |
367 | 367 | case WM_MOUSEMOVE: |
368 | 368 | ptMouse.x = LOWORD(lParam); |
369 | 369 | ptMouse.y = HIWORD(lParam); |
370 | 370 | ClientToScreen(hwndDlg, &ptMouse); |
371 | if( (ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right && | |
372 | ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom) | |
371 | if( (ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right && | |
372 | ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom) | |
373 | 373 | || |
374 | (ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right && | |
375 | ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom) | |
374 | (ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right && | |
375 | ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom) | |
376 | 376 | || |
377 | (ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right && | |
378 | ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom) | |
377 | (ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right && | |
378 | ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom) | |
379 | 379 | /* || |
380 | (ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right && | |
380 | (ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right && | |
381 | 381 | ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom)*/ ) |
382 | 382 | SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(32649))); |
383 | 383 | else |
388 | 388 | ptMouse.x = LOWORD(lParam); |
389 | 389 | ptMouse.y = HIWORD(lParam); |
390 | 390 | ClientToScreen(hwndDlg, &ptMouse); |
391 | if(ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right && | |
391 | if(ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right && | |
392 | 392 | ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom) |
393 | 393 | ShellExecute(0, NULL, "http://www.audiocoding.com", NULL,NULL, SW_NORMAL); |
394 | else if(ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right && | |
394 | else if(ptMouse.x >= rcMail1.left && ptMouse.x <= rcMail1.right && | |
395 | 395 | ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom) |
396 | 396 | ShellExecute(0, NULL, "mailto:shaohao@elong.com", NULL,NULL, SW_NORMAL); |
397 | else if(ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right && | |
397 | else if(ptMouse.x >= rcMail2.left && ptMouse.x <= rcMail2.right && | |
398 | 398 | ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom) |
399 | 399 | ShellExecute(0, NULL, "mailto:menno@audiocoding.com", NULL,NULL, SW_NORMAL); |
400 | /* else if(ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right && | |
400 | /* else if(ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right && | |
401 | 401 | ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom) |
402 | 402 | ShellExecute(0, NULL, "I don't know", NULL,NULL, SW_NORMAL); |
403 | 403 | */ |
417 | 417 | void About(int flags) |
418 | 418 | { |
419 | 419 | if(!IsWindow(hwndAbout)) |
420 | hwndAbout = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ABOUT), hwndPlayer, about_dialog_proc); | |
420 | hwndAbout = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_ABOUT), hwndPlayer, about_dialog_proc); | |
421 | 421 | ShowWindow(hwndAbout, SW_SHOW); |
422 | 422 | } |
423 | 423 | |
482 | 482 | if(StringComp(ch, ".aac", 4) == 0) |
483 | 483 | { |
484 | 484 | in = open_filestream((char *)medianame); |
485 | ||
485 | ||
486 | 486 | if(in != NULL && mediaInfo) |
487 | 487 | { |
488 | 488 | if(in->http) |
500 | 500 | else |
501 | 501 | mediaInfo->op_canSeek = FALSE; /* ADIF or Headerless - not seekable */ |
502 | 502 | } |
503 | ||
503 | ||
504 | 504 | close_filestream(in); |
505 | 505 | return TRUE; |
506 | 506 | } |
511 | 511 | } |
512 | 512 | } |
513 | 513 | else |
514 | return FALSE; | |
514 | return FALSE; | |
515 | 515 | } |
516 | 516 | |
517 | 517 | unsigned long samplerate, channels; |
521 | 521 | int tagsize = 0; |
522 | 522 | |
523 | 523 | infile = open_filestream(fn); |
524 | ||
524 | ||
525 | 525 | if (infile == NULL) |
526 | 526 | return 1; |
527 | 527 | |
560 | 560 | ZeroMemory(buffer, 768*2); |
561 | 561 | |
562 | 562 | infile = open_filestream(fn); |
563 | ||
563 | ||
564 | 564 | if (infile == NULL) |
565 | 565 | return 1; |
566 | 566 | |
653 | 653 | buffer = (unsigned char*)LocalAlloc(LPTR, 768*2); |
654 | 654 | |
655 | 655 | current_file_mode = m_memmap_file; |
656 | ||
656 | ||
657 | 657 | if(current_file_mode) |
658 | 658 | { |
659 | 659 | if(play_memmap((char *)medianame)) |
664 | 664 | if(play_file((char *)medianame)) |
665 | 665 | return FALSE; |
666 | 666 | } |
667 | ||
667 | ||
668 | 668 | if(seek_table) |
669 | 669 | { |
670 | 670 | free(seek_table); |
671 | 671 | seek_table = NULL; |
672 | 672 | seek_table_length = 0; |
673 | 673 | } |
674 | ||
674 | ||
675 | 675 | get_AAC_format((char *)medianame, &file_info, &seek_table, &seek_table_length, 0); |
676 | ||
676 | ||
677 | 677 | seek_needed = playfrom > 0 ? playfrom : -1; |
678 | 678 | killPlayThread = 0; |
679 | 679 | strcpy(lastfn,medianame); |
688 | 688 | play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) PlayThread, (void *) &killPlayThread, 0, &thread_id); |
689 | 689 | if(!play_thread_handle) |
690 | 690 | return FALSE; |
691 | ||
691 | ||
692 | 692 | // Note: This line seriously slows down start up time |
693 | 693 | if(m_priority != 3) // if the priority in config window is set to normal, there is nothing to reset! |
694 | 694 | SetThreadPriority(play_thread_handle, priority_table[m_priority]); |
695 | ||
695 | ||
696 | 696 | } |
697 | 697 | |
698 | 698 | return TRUE; |
719 | 719 | if(medianame && *medianame && stricmp(lastfn, medianame) == 0) |
720 | 720 | { |
721 | 721 | sQCDCallbacks.toPlayer.OutputStop(flags); |
722 | ||
722 | ||
723 | 723 | killPlayThread = 1; |
724 | 724 | if(play_thread_handle != INVALID_HANDLE_VALUE) |
725 | 725 | { |
734 | 734 | |
735 | 735 | if (oldAPIs) |
736 | 736 | QCDCallbacks->toPlayer.PlayStopped(lastfn); |
737 | ||
737 | ||
738 | 738 | lastfn[0] = 0; |
739 | 739 | } |
740 | 740 | |
905 | 905 | QCDCallbacks->toPlayer.PositionUpdate(decode_pos_ms); |
906 | 906 | updatePos = 0; |
907 | 907 | } |
908 | ||
908 | ||
909 | 909 | { |
910 | 910 | WriteDataStruct wd; |
911 | 911 | |
912 | 912 | l = frameInfo.samples * sizeof(short); |
913 | 913 | |
914 | 914 | decode_pos_ms += (1024*1000)/file_info.sampling_rate; |
915 | ||
915 | ||
916 | 916 | wd.bytelen = l; |
917 | 917 | wd.data = sample_buffer; |
918 | 918 | wd.markerend = 0; |
921 | 921 | wd.nch = frameInfo.channels; |
922 | 922 | wd.numsamples =l/file_info.channels/(16/8); |
923 | 923 | wd.srate = file_info.sampling_rate; |
924 | ||
924 | ||
925 | 925 | if (!QCDCallbacks->toPlayer.OutputWrite(&wd)) |
926 | 926 | done = TRUE; |
927 | 927 | } |
0 | 0 | //----------------------------------------------------------------------------- |
1 | // | |
1 | // | |
2 | 2 | // File: QCDInputDLL.h |
3 | 3 | // |
4 | 4 | // About: QCD Player Input module DLL interface. For more documentation, see |
10 | 10 | // |
11 | 11 | // Copyright (C) 1997-2002 Quinnware |
12 | 12 | // |
13 | // This code is free. If you redistribute it in any form, leave this notice | |
13 | // This code is free. If you redistribute it in any form, leave this notice | |
14 | 14 | // here. |
15 | 15 | // |
16 | 16 | // This program is distributed in the hope that it will be useful, |
12 | 12 | // |
13 | 13 | // Copyright (C) 1997-2002 Quinnware |
14 | 14 | // |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
16 | 16 | // here. |
17 | 17 | // |
18 | 18 | // This program is distributed in the hope that it will be useful, |
46 | 46 | //----------------------------------------------------------------------------- |
47 | 47 | // Services (ops) provided by the Player |
48 | 48 | //----------------------------------------------------------------------------- |
49 | typedef enum | |
49 | typedef enum | |
50 | 50 | { //*** below returns numeric info (*buffer not used) |
51 | 51 | |
52 | 52 | opGetPlayerVersion = 0, // high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1) |
64 | 64 | opGetTrackLength = 14, // get track length, param1 = index of track in playlist, -1 for current |
65 | 65 | // param2 = 0 for seconds, 1 for milliseconds |
66 | 66 | opGetTime = 15, // get time on player, param1 = 0 for time displayed, 1 for track time, 2 for playlist time |
67 | // param2 = 0 for elapsed, 1 for remaining | |
67 | // param2 = 0 for elapsed, 1 for remaining | |
68 | 68 | opGetTrackState = 16, // get whether track is marked, param1 = index of track, -1 for current |
69 | 69 | opGetPlaylistNum = 17, // get playlist number of index, param1 = index of track in playlist, -1 for current |
70 | 70 | opGetMediaType = 18, // get media type of track, param1 = index if track in playlist, -1 for current |
87 | 87 | |
88 | 88 | opGetIndexFromPLNum = 28, // get index from playlist number, param1 = playlist number |
89 | 89 | |
90 | opGetChildWnd = 30, // handle to the draggable window extension (only available on some skins) | |
90 | opGetChildWnd = 30, // handle to the draggable window extension (only available on some skins) | |
91 | 91 | opGetExtVisWnd = 31, // handle to the external visual window |
92 | opGetMusicBrowserWnd = 32, // handle to the music browser window | |
93 | opGetSkinPreviewWnd = 33, // handle to the skin preview window | |
94 | opGetPropertiesWnd = 34, // handle to the player properties window | |
95 | opGetExtInfoWnd = 35, // handle to the extended information window | |
96 | opGetAboutWnd = 36, // handle to the about window | |
97 | opGetSegmentsWnd = 37, // handle to the segments window | |
98 | opGetEQPresetsWnd = 38, // handle to the EQ presets window | |
92 | opGetMusicBrowserWnd = 32, // handle to the music browser window | |
93 | opGetSkinPreviewWnd = 33, // handle to the skin preview window | |
94 | opGetPropertiesWnd = 34, // handle to the player properties window | |
95 | opGetExtInfoWnd = 35, // handle to the extended information window | |
96 | opGetAboutWnd = 36, // handle to the about window | |
97 | opGetSegmentsWnd = 37, // handle to the segments window | |
98 | opGetEQPresetsWnd = 38, // handle to the EQ presets window | |
99 | 99 | |
100 | 100 | opGetVisDimensions = 50, // gets the width and height of visual window (param1 = -1 current vis window, 0 internal vis, 1 external vis, 2 full screen) |
101 | // returns: HEIGHT in high word, WIDTH in low word | |
101 | // returns: HEIGHT in high word, WIDTH in low word | |
102 | 102 | |
103 | 103 | opGetQueriesComplete = 60, // get status on whether all tracks in playlist have been queryied for their info |
104 | 104 | |
132 | 132 | opGetSkinFolder = 112, // get current skin folder |
133 | 133 | opGetCDDBCacheFolder = 113, // get current folder for CDDB cached info |
134 | 134 | |
135 | opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded | |
135 | opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded | |
136 | 136 | |
137 | 137 | opGetMediaID = 115, // get media identifier, param2 = index of track in playlist, -1 for current |
138 | // - for CD's it's the TOC - for anything else, right now it's 0 | |
138 | // - for CD's it's the TOC - for anything else, right now it's 0 | |
139 | 139 | |
140 | 140 | opGetSupportedExtensions = 116, // get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions |
141 | 141 | // - returned extensions will be colon delimited |
220 | 220 | UINT nch; // number of channels |
221 | 221 | UINT srate; // sample rate |
222 | 222 | |
223 | UINT markerstart; // Marker position at start of data (marker is time value of data) | |
223 | UINT markerstart; // Marker position at start of data (marker is time value of data) | |
224 | 224 | // (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins) |
225 | 225 | UINT markerend; // Marker position at end of data (not currently used, set to 0) |
226 | 226 | } WriteDataStruct; |
229 | 229 | typedef struct // for GetTrackExtents Input Plugin callback |
230 | 230 | { |
231 | 231 | UINT track; // for CD's, set the track number. Otherwise set to 1. |
232 | UINT start; // for CD's or media that doesn't start at the beginning | |
232 | UINT start; // for CD's or media that doesn't start at the beginning | |
233 | 233 | // of the file, set to start position. Otherwise set to 0. |
234 | 234 | UINT end; // set to end position of media. |
235 | 235 | UINT unitpersec; // whatever units are being used for this media, how many |
236 | // of them per second. | |
236 | // of them per second. | |
237 | 237 | // (Note: ((end - start) / unitpersecond) = file length |
238 | 238 | UINT bytesize; // size of file in bytes (if applicable, otherwise 0). |
239 | 239 | } TrackExtents; |
240 | 240 | |
241 | 241 | //----------------------------------------------------------------------------- |
242 | 242 | typedef struct // for opSetAudioInfo service |
243 | { | |
243 | { | |
244 | 244 | long struct_size; // sizeof(AudioInfo) |
245 | 245 | long level; // MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro) |
246 | 246 | long layer; // and layer (1, 2 or 3) |
255 | 255 | typedef struct // for coming QCD version |
256 | 256 | { |
257 | 257 | long struct_size; // sizeof(EQInfo) |
258 | char enabled; | |
258 | char enabled; | |
259 | 259 | char preamp; // -128 to 127, 0 is even |
260 | 260 | char bands[10]; // -128 to 127, 0 is even |
261 | 261 | } EQInfo; |
272 | 272 | |
273 | 273 | //----------------------------------------------------------------------------- |
274 | 274 | typedef enum // for MediaInfo.mediaType |
275 | { | |
275 | { | |
276 | 276 | UNKNOWN_MEDIA = 0, |
277 | 277 | CD_AUDIO_MEDIA = 1, |
278 | 278 | DIGITAL_FILE_MEDIA = 2, |
1 | 1 | // |
2 | 2 | // File: QCDModInput.h |
3 | 3 | // |
4 | // About: Input plugin module interface. This file is published with the | |
4 | // About: Input plugin module interface. This file is published with the | |
5 | 5 | // Input plugin SDK. |
6 | 6 | // |
7 | 7 | // Authors: Written by Paul Quinn and Richard Carlson. |
12 | 12 | // |
13 | 13 | // Copyright (C) 1997-2002 Quinnware |
14 | 14 | // |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
16 | 16 | // here. |
17 | 17 | // |
18 | 18 | // This program is distributed in the hope that it will be useful, |
45 | 45 | #define PLAYFLAG_SEEKING 0x2 |
46 | 46 | |
47 | 47 | // Wave Marker flags |
48 | #define WAVE_VIS_DATA_ONLY -1 // set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis | |
48 | #define WAVE_VIS_DATA_ONLY -1 // set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis | |
49 | 49 | // and not to output plugin |
50 | 50 | // pause flags |
51 | 51 | #define PAUSE_DISABLED 0 // Pause() call is to unpause playback |
54 | 54 | //----------------------------------------------------------------------------- |
55 | 55 | // Input Module |
56 | 56 | //----------------------------------------------------------------------------- |
57 | typedef struct | |
57 | typedef struct | |
58 | 58 | { |
59 | 59 | unsigned int size; // size of init structure |
60 | 60 | unsigned int version; // plugin structure version (set to PLUGIN_API_VERSION) |
73 | 73 | |
74 | 74 | // output plugin calls |
75 | 75 | int (*OutputOpen)(const char* medianame, WAVEFORMATEX*); // open output for wave data |
76 | int (*OutputWrite)(WriteDataStruct*); // send PCM audio data to output | |
77 | // (blocks until write completes, thus if output is paused can | |
76 | int (*OutputWrite)(WriteDataStruct*); // send PCM audio data to output | |
77 | // (blocks until write completes, thus if output is paused can | |
78 | 78 | // block until unpaused) |
79 | 79 | int (*OutputDrain)(int flags); // wait for all output to complete (blocking) |
80 | 80 | int (*OutputDrainCancel)(int flags); // break a drain in progress |
88 | 88 | void *Reserved[10]; |
89 | 89 | } toPlayer; |
90 | 90 | |
91 | struct | |
91 | struct | |
92 | 92 | { |
93 | 93 | int (*Initialize)(QCDModInfo *modInfo, int flags); // initialize plugin |
94 | 94 | void (*ShutDown)(int flags); // shutdown plugin |
21 | 21 | #define IDC_MAIL3 1054 |
22 | 22 | |
23 | 23 | // Next default values for new objects |
24 | // | |
24 | // | |
25 | 25 | #ifdef APSTUDIO_INVOKED |
26 | 26 | #ifndef APSTUDIO_READONLY_SYMBOLS |
27 | 27 | #define _APS_NEXT_RESOURCE_VALUE 109 |
0 | 0 | //----------------------------------------------------------------------------- |
1 | // | |
1 | // | |
2 | 2 | // File: QCDInputDLL.h |
3 | 3 | // |
4 | 4 | // About: QCD Player Input module DLL interface. For more documentation, see |
10 | 10 | // |
11 | 11 | // Copyright (C) 1997-2002 Quinnware |
12 | 12 | // |
13 | // This code is free. If you redistribute it in any form, leave this notice | |
13 | // This code is free. If you redistribute it in any form, leave this notice | |
14 | 14 | // here. |
15 | 15 | // |
16 | 16 | // This program is distributed in the hope that it will be useful, |
12 | 12 | // |
13 | 13 | // Copyright (C) 1997-2002 Quinnware |
14 | 14 | // |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
16 | 16 | // here. |
17 | 17 | // |
18 | 18 | // This program is distributed in the hope that it will be useful, |
36 | 36 | // Current plugin version |
37 | 37 | |
38 | 38 | // use this version for old style API calls (all returned text in native encoding) |
39 | #define PLUGIN_API_VERSION 250 | |
39 | #define PLUGIN_API_VERSION 250 | |
40 | 40 | |
41 | 41 | // use this version for new style API calls (all returned text in UTF8 encoding on WinNT/2K/XP (native encoding on Win9x)) |
42 | 42 | #define PLUGIN_API_VERSION_WANTUTF8 ((PLUGIN_API_WANTUTF8<<16)|PLUGIN_API_VERSION) |
44 | 44 | |
45 | 45 | //----------------------------------------------------------------------------- |
46 | 46 | |
47 | typedef struct | |
47 | typedef struct | |
48 | 48 | { |
49 | 49 | char *moduleString; |
50 | 50 | char *moduleExtensions; |
53 | 53 | //----------------------------------------------------------------------------- |
54 | 54 | // Services (ops) provided by the Player |
55 | 55 | //----------------------------------------------------------------------------- |
56 | typedef enum | |
56 | typedef enum | |
57 | 57 | { //*** below returns numeric info (*buffer not used) |
58 | 58 | |
59 | 59 | opGetPlayerVersion = 0, // high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1) |
71 | 71 | opGetTrackLength = 14, // get track length, param1 = index of track in playlist, -1 for current |
72 | 72 | // param2 = 0 for seconds, 1 for milliseconds |
73 | 73 | opGetTime = 15, // get time on player, param1 = 0 for time displayed, 1 for track time, 2 for playlist time |
74 | // param2 = 0 for elapsed, 1 for remaining | |
74 | // param2 = 0 for elapsed, 1 for remaining | |
75 | 75 | opGetTrackState = 16, // get whether track is marked, param1 = index of track, -1 for current |
76 | 76 | opGetPlaylistNum = 17, // get playlist number of index, param1 = index of track in playlist, -1 for current |
77 | 77 | opGetMediaType = 18, // get media type of track, param1 = index if track in playlist, -1 for current |
96 | 96 | |
97 | 97 | opGetExtensionWnd = 30, // handle to the draggable window extension (only available on some skins), param1 = extension number (0 - 9) |
98 | 98 | opGetExtVisWnd = 31, // handle to the external visual window |
99 | opGetMusicBrowserWnd = 32, // handle to the music browser window | |
100 | opGetSkinPreviewWnd = 33, // handle to the skin preview window | |
101 | opGetPropertiesWnd = 34, // handle to the player properties window | |
102 | opGetExtInfoWnd = 35, // handle to the extended information window | |
103 | opGetAboutWnd = 36, // handle to the about window | |
104 | opGetSegmentsWnd = 37, // handle to the segments window | |
105 | opGetEQPresetsWnd = 38, // handle to the EQ presets window | |
106 | opGetVideoWnd = 39, // handle to the video window | |
99 | opGetMusicBrowserWnd = 32, // handle to the music browser window | |
100 | opGetSkinPreviewWnd = 33, // handle to the skin preview window | |
101 | opGetPropertiesWnd = 34, // handle to the player properties window | |
102 | opGetExtInfoWnd = 35, // handle to the extended information window | |
103 | opGetAboutWnd = 36, // handle to the about window | |
104 | opGetSegmentsWnd = 37, // handle to the segments window | |
105 | opGetEQPresetsWnd = 38, // handle to the EQ presets window | |
106 | opGetVideoWnd = 39, // handle to the video window | |
107 | 107 | |
108 | 108 | opGetVisDimensions = 50, // gets the width and height of visual window (param1 = -1 current vis window, 0 internal vis, 1 external vis, 2 full screen) |
109 | // returns: HEIGHT in high word, WIDTH in low word | |
109 | // returns: HEIGHT in high word, WIDTH in low word | |
110 | 110 | |
111 | 111 | opShowVideoWindow = 55, // Show or Close video window (param1 = 1 for create, 2 for create and show, 0 for close) |
112 | 112 | |
142 | 142 | opGetSkinFolder = 112, // get current skin folder |
143 | 143 | opGetCDDBCacheFolder = 113, // get current folder for CDDB cached info |
144 | 144 | |
145 | opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded | |
145 | opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded | |
146 | 146 | |
147 | 147 | opGetMediaID = 115, // get media identifier, param2 = index of track in playlist, -1 for current |
148 | // - for CD's it's the TOC - for anything else, right now it's 0 | |
148 | // - for CD's it's the TOC - for anything else, right now it's 0 | |
149 | 149 | |
150 | 150 | opGetSupportedExtensions = 116, // get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions |
151 | 151 | // - returned extensions will be colon delimited |
195 | 195 | opSetPlayNext = 1009, // set the next index to be played (buffer = NULL, param1 = index, index = -1 unsets playnext) |
196 | 196 | opSetIndexFilename = 1010, // updates the filename (or stream) that an index in the current playlist refers to, buffer = new filename, param1 = index |
197 | 197 | |
198 | opSetPlaylist = 1006, // clear playlist, add files to playlist or reset playlist with new files | |
198 | opSetPlaylist = 1006, // clear playlist, add files to playlist or reset playlist with new files | |
199 | 199 | // buffer = file list (each file in quotes, string null terminated) Eg; buffer="\"file1.mp3\" \"file2.mp3\"\0" - NULL to clear playlist |
200 | // param1 = (string ptr)originating path (can be NULL if paths included with files) | |
200 | // param1 = (string ptr)originating path (can be NULL if paths included with files) | |
201 | 201 | // param2 = 1 - clear playlist flag, 2 - enqueue to top |
202 | 202 | |
203 | opInsertPlaylist = 1011, // insert tracks into playlist | |
203 | opInsertPlaylist = 1011, // insert tracks into playlist | |
204 | 204 | // buffer = file list (each file in quotes, string null terminated) Eg; buffer="\"file1.mp3\" \"file2.mp3\"\0" |
205 | // param1 = (string ptr)originating path (can be NULL if paths included with files) | |
205 | // param1 = (string ptr)originating path (can be NULL if paths included with files) | |
206 | 206 | // param2 = index location to insert tracks (-1 to insert at end) |
207 | 207 | |
208 | 208 | opMovePlaylistTrack = 1012, // param1 = index of track to move, param2 = destination index (move shifts tracks between param1 and param2) |
266 | 266 | UINT nch; // number of channels |
267 | 267 | UINT srate; // sample rate |
268 | 268 | |
269 | UINT markerstart; // Marker position at start of data (marker is time value of data) | |
269 | UINT markerstart; // Marker position at start of data (marker is time value of data) | |
270 | 270 | // (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins) |
271 | 271 | UINT markerend; // Marker position at end of data (not currently used, set to 0) |
272 | 272 | } WriteDataStruct; |
275 | 275 | typedef struct // for GetTrackExtents Input Plugin callback |
276 | 276 | { |
277 | 277 | UINT track; // for CD's, set the track number. Otherwise set to 1. |
278 | UINT start; // for CD's or media that doesn't start at the beginning | |
278 | UINT start; // for CD's or media that doesn't start at the beginning | |
279 | 279 | // of the file, set to start position. Otherwise set to 0. |
280 | 280 | UINT end; // set to end position of media. |
281 | 281 | UINT unitpersec; // whatever units are being used for this media, how many |
282 | // of them per second. | |
282 | // of them per second. | |
283 | 283 | // (Note: ((end - start) / unitpersecond) = file length |
284 | 284 | UINT bytesize; // size of file in bytes (if applicable, otherwise 0). |
285 | 285 | } TrackExtents; |
286 | 286 | |
287 | 287 | //----------------------------------------------------------------------------- |
288 | 288 | typedef struct // for opSetAudioInfo service |
289 | { | |
289 | { | |
290 | 290 | long struct_size; // sizeof(AudioInfo) |
291 | 291 | long level; // MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro) |
292 | 292 | long layer; // and layer (1, 2 or 3) |
302 | 302 | typedef struct // for coming QCD version |
303 | 303 | { |
304 | 304 | long struct_size; // sizeof(EQInfo) |
305 | char enabled; | |
305 | char enabled; | |
306 | 306 | char preamp; // -128 to 127, 0 is even |
307 | 307 | char bands[10]; // -128 to 127, 0 is even |
308 | 308 | } EQInfo; |
319 | 319 | |
320 | 320 | //----------------------------------------------------------------------------- |
321 | 321 | typedef enum // for MediaInfo.mediaType |
322 | { | |
322 | { | |
323 | 323 | UNKNOWN_MEDIA = 0, |
324 | 324 | CD_AUDIO_MEDIA = 1, |
325 | 325 | DIGITAL_FILE_MEDIA = 2, |
1 | 1 | // |
2 | 2 | // File: QCDModInput.h |
3 | 3 | // |
4 | // About: Input plugin module interface. This file is published with the | |
4 | // About: Input plugin module interface. This file is published with the | |
5 | 5 | // Input plugin SDK. |
6 | 6 | // |
7 | 7 | // Authors: Written by Paul Quinn and Richard Carlson. |
12 | 12 | // |
13 | 13 | // Copyright (C) 1997-2002 Quinnware |
14 | 14 | // |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
16 | 16 | // here. |
17 | 17 | // |
18 | 18 | // This program is distributed in the hope that it will be useful, |
45 | 45 | #define PLAYFLAG_SEEKING 0x2 |
46 | 46 | |
47 | 47 | // Wave Marker flags |
48 | #define WAVE_VIS_DATA_ONLY -1 // set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis | |
48 | #define WAVE_VIS_DATA_ONLY -1 // set to WaveDataStruct.markerstart in OutputWrite() call have data only go to vis | |
49 | 49 | // and not to output plugin |
50 | 50 | // pause flags |
51 | 51 | #define PAUSE_DISABLED 0 // Pause() call is to unpause playback |
54 | 54 | //----------------------------------------------------------------------------- |
55 | 55 | // Input Module |
56 | 56 | //----------------------------------------------------------------------------- |
57 | typedef struct | |
57 | typedef struct | |
58 | 58 | { |
59 | 59 | unsigned int size; // size of init structure |
60 | 60 | unsigned int version; // plugin structure version (set to PLUGIN_API_VERSION) |
73 | 73 | |
74 | 74 | // output plugin calls |
75 | 75 | int (*OutputOpen)(const char* medianame, WAVEFORMATEX*); // open output for wave data |
76 | int (*OutputWrite)(WriteDataStruct*); // send PCM audio data to output | |
77 | // (blocks until write completes, thus if output is paused can | |
76 | int (*OutputWrite)(WriteDataStruct*); // send PCM audio data to output | |
77 | // (blocks until write completes, thus if output is paused can | |
78 | 78 | // block until unpaused) |
79 | 79 | int (*OutputDrain)(int flags); // wait for all output to complete (blocking) |
80 | 80 | int (*OutputDrainCancel)(int flags); // break a drain in progress |
88 | 88 | void *Reserved[10]; |
89 | 89 | } toPlayer; |
90 | 90 | |
91 | struct | |
91 | struct | |
92 | 92 | { |
93 | 93 | int (*Initialize)(QCDModInfo *modInfo, int flags); // initialize plugin |
94 | 94 | void (*ShutDown)(int flags); // shutdown plugin |
1 | 1 | // |
2 | 2 | // File: QCDModTagEditor |
3 | 3 | // |
4 | // About: Tag Editing plugin module interface. This file is published with the | |
4 | // About: Tag Editing plugin module interface. This file is published with the | |
5 | 5 | // QCD plugin SDK. |
6 | 6 | // |
7 | 7 | // Authors: Written by Paul Quinn |
12 | 12 | // |
13 | 13 | // Copyright (C) 2002 Quinnware |
14 | 14 | // |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
15 | // This code is free. If you redistribute it in any form, leave this notice | |
16 | 16 | // here. |
17 | 17 | // |
18 | 18 | // This program is distributed in the hope that it will be useful, |
36 | 36 | |
37 | 37 | TAGFIELD_TITLE = 0, |
38 | 38 | TAGFIELD_ARTIST, |
39 | TAGFIELD_ALBUM, | |
39 | TAGFIELD_ALBUM, | |
40 | 40 | TAGFIELD_GENRE, |
41 | TAGFIELD_YEAR, | |
42 | TAGFIELD_TRACK, | |
41 | TAGFIELD_YEAR, | |
42 | TAGFIELD_TRACK, | |
43 | 43 | TAGFIELD_COMMENT, |
44 | 44 | |
45 | 45 | TAGFIELD_COMPOSER, |
48 | 48 | TAGFIELD_YEARCOMPOSED, |
49 | 49 | |
50 | 50 | TAGFIELD_ORIGARTIST, |
51 | TAGFIELD_LABEL, | |
51 | TAGFIELD_LABEL, | |
52 | 52 | TAGFIELD_COPYRIGHT, |
53 | 53 | TAGFIELD_ENCODER, |
54 | 54 | TAGFIELD_CDDBTAGID, |
58 | 58 | |
59 | 59 | //----------------------------------------------------------------------------- |
60 | 60 | |
61 | typedef struct | |
61 | typedef struct | |
62 | 62 | { |
63 | 63 | UINT size; // size of init structure |
64 | 64 | UINT version; // plugin structure version (set to PLUGIN_API_VERSION) |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
543 | 543 | |
544 | 544 | //---------------------------------------------------------------------------- |
545 | 545 | |
546 | void ShutDown(int flags) | |
546 | void ShutDown(int flags) | |
547 | 547 | { |
548 | 548 | Stop(mp4state.filename, STOPFLAG_FORCESTOP); |
549 | 549 | } |
1442 | 1442 | return tagsize; |
1443 | 1443 | } |
1444 | 1444 | |
1445 | int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo) | |
1445 | int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo) | |
1446 | 1446 | { |
1447 | 1447 | int tagsize = 0, init; |
1448 | 1448 | |
2450 | 2450 | } |
2451 | 2451 | } |
2452 | 2452 | } |
2453 | ||
2453 | ||
2454 | 2454 | Sleep(10); |
2455 | 2455 | |
2456 | 2456 | // catch pause |
2709 | 2709 | if (frameInfo.channels > 0 && mp4state.samplerate > 0) |
2710 | 2710 | mp4state.cur_pos_sec += ((double)(frameInfo.samples/frameInfo.channels))/(double)mp4state.samplerate; |
2711 | 2711 | } |
2712 | ||
2712 | ||
2713 | 2713 | Sleep(10); |
2714 | 2714 | |
2715 | 2715 | // catch pause |
2747 | 2747 | module.QCDCallbacks.toModule.Pause = Pause; |
2748 | 2748 | module.QCDCallbacks.toModule.Stop = Stop; |
2749 | 2749 | module.QCDCallbacks.toModule.About = About; |
2750 | module.QCDCallbacks.toModule.Configure = Configure; | |
2750 | module.QCDCallbacks.toModule.Configure = Configure; | |
2751 | 2751 | module.QCDCallbacks.toModule.SetEQ = NULL; |
2752 | 2752 | module.QCDCallbacks.toModule.SetVolume = SetVolume; |
2753 | 2753 | |
2963 | 2963 | // free(temp); |
2964 | 2964 | // |
2965 | 2965 | // return ret; |
2966 | //} | |
2966 | //} | |
2967 | 2967 | // |
2968 | 2968 | //__declspec(dllexport) int winampWriteExtendedFileInfo() |
2969 | 2969 | //{ |
303 | 303 | //------------------------------------------------------------------------------ |
304 | 304 | |
305 | 305 | PLUGIN_API QCDModInitTag* TAGEDITORDLL_ENTRY_POINT() |
306 | { | |
306 | { | |
307 | 307 | ModInitTag.size = sizeof(QCDModInitTag); |
308 | 308 | ModInitTag.version = PLUGIN_API_VERSION; |
309 | 309 | ModInitTag.ShutDown = ShutDown_Tag; |
606 | 606 | file = MP4Modify(filename, 0, 0); |
607 | 607 | if (file == MP4_INVALID_FILE_HANDLE) |
608 | 608 | return false; |
609 | ||
609 | ||
610 | 610 | MP4MetadataDelete(file); |
611 | 611 | |
612 | 612 | MP4Close(file); |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
88 | 88 | |
89 | 89 | static u_int8_t firstHeader[ADTS_HEADER_MAX_SIZE]; |
90 | 90 | |
91 | /* | |
92 | * hdr must point to at least ADTS_HEADER_MAX_SIZE bytes of memory | |
91 | /* | |
92 | * hdr must point to at least ADTS_HEADER_MAX_SIZE bytes of memory | |
93 | 93 | */ |
94 | 94 | static bool LoadNextAdtsHeader(FILE* inFile, u_int8_t* hdr) |
95 | 95 | { |
135 | 135 | hdr[state] = b; |
136 | 136 | state = 1; |
137 | 137 | } else { |
138 | /* else drop it */ | |
138 | /* else drop it */ | |
139 | 139 | dropped++; |
140 | 140 | } |
141 | 141 | } |
159 | 159 | if (!LoadNextAdtsHeader(inFile, hdrBuf)) { |
160 | 160 | return false; |
161 | 161 | } |
162 | ||
162 | ||
163 | 163 | /* get frame size from header */ |
164 | 164 | frameSize = MP4AV_AdtsGetFrameSize(hdrBuf); |
165 | 165 | |
166 | 166 | /* get header size in bits and bytes from header */ |
167 | 167 | hdrBitSize = MP4AV_AdtsGetHeaderBitSize(hdrBuf); |
168 | 168 | hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdrBuf); |
169 | ||
169 | ||
170 | 170 | /* adjust the frame size to what remains to be read */ |
171 | 171 | frameSize -= hdrByteSize; |
172 | 172 | |
218 | 218 | |
219 | 219 | /* remember where we are */ |
220 | 220 | fgetpos(inFile, &curPos); |
221 | ||
221 | ||
222 | 222 | /* go back to start of file */ |
223 | 223 | rewind(inFile); |
224 | 224 | |
272 | 272 | } |
273 | 273 | |
274 | 274 | // add the new audio track |
275 | MP4TrackId trackId = | |
276 | MP4AddAudioTrack(mp4File, | |
275 | MP4TrackId trackId = | |
276 | MP4AddAudioTrack(mp4File, | |
277 | 277 | samplesPerSecond, 1024, audioType); |
278 | 278 | |
279 | 279 | if (trackId == MP4_INVALID_TRACK_ID) { |
294 | 294 | samplesPerSecond, |
295 | 295 | channelConfig); |
296 | 296 | |
297 | if (!MP4SetTrackESConfiguration(mp4File, trackId, | |
297 | if (!MP4SetTrackESConfiguration(mp4File, trackId, | |
298 | 298 | pConfig, configLength)) { |
299 | 299 | MP4DeleteTrack(mp4File, trackId); |
300 | 300 | return MP4_INVALID_TRACK_ID; |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
2 | 2 | * License Version 1.1 (the "License"); you may not use this file |
3 | 3 | * except in compliance with the License. You may obtain a copy of |
4 | 4 | * the License at http://www.mozilla.org/MPL/ |
5 | * | |
5 | * | |
6 | 6 | * Software distributed under the License is distributed on an "AS |
7 | 7 | * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
8 | 8 | * implied. See the License for the specific language governing |
9 | 9 | * rights and limitations under the License. |
10 | * | |
10 | * | |
11 | 11 | * The Original Code is MPEG4IP. |
12 | * | |
12 | * | |
13 | 13 | * The Initial Developer of the Original Code is Cisco Systems Inc. |
14 | 14 | * Portions created by Cisco Systems Inc. are |
15 | 15 | * Copyright (C) Cisco Systems Inc. 2001-2002. All Rights Reserved. |
16 | * | |
17 | * Contributor(s): | |
16 | * | |
17 | * Contributor(s): | |
18 | 18 | * Dave Mackie dmackie@cisco.com |
19 | 19 | */ |
20 | 20 | |
21 | 21 | #ifndef __MBS_INCLUDED__ |
22 | #define __MBS_INCLUDED__ | |
22 | #define __MBS_INCLUDED__ | |
23 | 23 | |
24 | 24 | class CMemoryBitstream { |
25 | 25 | public: |
76 | 76 | u_int32_t m_numBits; |
77 | 77 | }; |
78 | 78 | |
79 | #endif /* __MBS_INCLUDED__ */ | |
79 | #endif /* __MBS_INCLUDED__ */ | |
80 | 80 |
55 | 55 | #define IDC_TITLEFORMAT 1040 |
56 | 56 | |
57 | 57 | // Next default values for new objects |
58 | // | |
58 | // | |
59 | 59 | #ifdef APSTUDIO_INVOKED |
60 | 60 | #ifndef APSTUDIO_READONLY_SYMBOLS |
61 | 61 | #define _APS_NEXT_RESOURCE_VALUE 103 |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
0 | 0 | /* |
1 | 1 | ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
2 | 2 | ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com |
3 | ** | |
3 | ** | |
4 | 4 | ** This program is free software; you can redistribute it and/or modify |
5 | 5 | ** it under the terms of the GNU General Public License as published by |
6 | 6 | ** the Free Software Foundation; either version 2 of the License, or |
7 | 7 | ** (at your option) any later version. |
8 | ** | |
8 | ** | |
9 | 9 | ** This program is distributed in the hope that it will be useful, |
10 | 10 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | 11 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 | 12 | ** GNU General Public License for more details. |
13 | ** | |
13 | ** | |
14 | 14 | ** You should have received a copy of the GNU General Public License |
15 | ** along with this program; if not, write to the Free Software | |
15 | ** along with this program; if not, write to the Free Software | |
16 | 16 | ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
17 | 17 | ** |
18 | 18 | ** Any non-GPL usage of this software or parts of this software is strictly |
4 | 4 | <Configuration>Debug</Configuration> |
5 | 5 | <Platform>Win32</Platform> |
6 | 6 | </ProjectConfiguration> |
7 | <ProjectConfiguration Include="Debug|x64"> | |
8 | <Configuration>Debug</Configuration> | |
9 | <Platform>x64</Platform> | |
10 | </ProjectConfiguration> | |
7 | 11 | <ProjectConfiguration Include="Release|Win32"> |
8 | 12 | <Configuration>Release</Configuration> |
9 | 13 | <Platform>Win32</Platform> |
10 | 14 | </ProjectConfiguration> |
15 | <ProjectConfiguration Include="Release|x64"> | |
16 | <Configuration>Release</Configuration> | |
17 | <Platform>x64</Platform> | |
18 | </ProjectConfiguration> | |
11 | 19 | </ItemGroup> |
12 | 20 | <PropertyGroup Label="Globals"> |
13 | 21 | <ProjectGuid>{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}</ProjectGuid> |
14 | <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> | |
22 | <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | |
15 | 23 | </PropertyGroup> |
16 | 24 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
17 | 25 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
18 | 26 | <ConfigurationType>Application</ConfigurationType> |
19 | <PlatformToolset>v141</PlatformToolset> | |
27 | <PlatformToolset>v142</PlatformToolset> | |
28 | </PropertyGroup> | |
29 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | |
30 | <ConfigurationType>Application</ConfigurationType> | |
31 | <PlatformToolset>v142</PlatformToolset> | |
20 | 32 | </PropertyGroup> |
21 | 33 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
22 | 34 | <ConfigurationType>Application</ConfigurationType> |
23 | <PlatformToolset>v141</PlatformToolset> | |
35 | <PlatformToolset>v142</PlatformToolset> | |
36 | </PropertyGroup> | |
37 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | |
38 | <ConfigurationType>Application</ConfigurationType> | |
39 | <PlatformToolset>v142</PlatformToolset> | |
24 | 40 | </PropertyGroup> |
25 | 41 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
26 | 42 | <ImportGroup Label="ExtensionSettings"> |
28 | 44 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
29 | 45 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
30 | 46 | </ImportGroup> |
47 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | |
48 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
49 | </ImportGroup> | |
31 | 50 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
51 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
52 | </ImportGroup> | |
53 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | |
32 | 54 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
33 | 55 | </ImportGroup> |
34 | 56 | <PropertyGroup Label="UserMacros" /> |
43 | 65 | <CodeAnalysisRules /> |
44 | 66 | <CodeAnalysisRuleAssemblies /> |
45 | 67 | </PropertyGroup> |
68 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
69 | <OutDir>.\bin\$(Configuration)\</OutDir> | |
70 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> | |
71 | <LinkIncremental>true</LinkIncremental> | |
72 | <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | |
73 | <CodeAnalysisRules /> | |
74 | <CodeAnalysisRuleAssemblies /> | |
75 | </PropertyGroup> | |
46 | 76 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
47 | 77 | <OutDir>.\bin\$(Configuration)\</OutDir> |
48 | 78 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> |
51 | 81 | <CodeAnalysisRules /> |
52 | 82 | <CodeAnalysisRuleAssemblies /> |
53 | 83 | </PropertyGroup> |
84 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
85 | <OutDir>.\bin\$(Configuration)\</OutDir> | |
86 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> | |
87 | <LinkIncremental>false</LinkIncremental> | |
88 | <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | |
89 | <CodeAnalysisRules /> | |
90 | <CodeAnalysisRuleAssemblies /> | |
91 | </PropertyGroup> | |
54 | 92 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
55 | 93 | <Midl> |
56 | 94 | <TypeLibraryName>.\Debug/faad.tlb</TypeLibraryName> |
57 | 95 | </Midl> |
58 | 96 | <ClCompile> |
59 | 97 | <Optimization>Disabled</Optimization> |
60 | <AdditionalIncludeDirectories>../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
98 | <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
61 | 99 | <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
62 | 100 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> |
63 | 101 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> |
74 | 112 | <SubSystem>Console</SubSystem> |
75 | 113 | </Link> |
76 | 114 | </ItemDefinitionGroup> |
115 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
116 | <Midl> | |
117 | <TypeLibraryName>.\Debug/faad.tlb</TypeLibraryName> | |
118 | </Midl> | |
119 | <ClCompile> | |
120 | <Optimization>Disabled</Optimization> | |
121 | <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
122 | <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
123 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
124 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> | |
125 | <PrecompiledHeader> | |
126 | </PrecompiledHeader> | |
127 | <WarningLevel>Level3</WarningLevel> | |
128 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | |
129 | </ClCompile> | |
130 | <ResourceCompile> | |
131 | <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
132 | <Culture>0x0413</Culture> | |
133 | </ResourceCompile> | |
134 | <Link> | |
135 | <GenerateDebugInformation>true</GenerateDebugInformation> | |
136 | <SubSystem>Console</SubSystem> | |
137 | </Link> | |
138 | </ItemDefinitionGroup> | |
77 | 139 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
78 | 140 | <Midl> |
79 | 141 | <TypeLibraryName>.\Release/faad.tlb</TypeLibraryName> |
83 | 145 | <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> |
84 | 146 | <IntrinsicFunctions>true</IntrinsicFunctions> |
85 | 147 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> |
86 | <AdditionalIncludeDirectories>../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
148 | <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
87 | 149 | <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
88 | 150 | <StringPooling>true</StringPooling> |
89 | 151 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> |
99 | 161 | <SubSystem>Console</SubSystem> |
100 | 162 | </Link> |
101 | 163 | </ItemDefinitionGroup> |
164 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
165 | <Midl> | |
166 | <TypeLibraryName>.\Release/faad.tlb</TypeLibraryName> | |
167 | </Midl> | |
168 | <ClCompile> | |
169 | <Optimization>MinSpace</Optimization> | |
170 | <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
171 | <IntrinsicFunctions>true</IntrinsicFunctions> | |
172 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | |
173 | <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
174 | <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
175 | <StringPooling>true</StringPooling> | |
176 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
177 | <FunctionLevelLinking>true</FunctionLevelLinking> | |
178 | <PrecompiledHeader> | |
179 | </PrecompiledHeader> | |
180 | <WarningLevel>Level3</WarningLevel> | |
181 | </ClCompile> | |
182 | <ResourceCompile> | |
183 | <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
184 | <Culture>0x0413</Culture> | |
185 | </ResourceCompile> | |
186 | <Link> | |
187 | <SubSystem>Console</SubSystem> | |
188 | </Link> | |
189 | </ItemDefinitionGroup> | |
102 | 190 | <ItemGroup> |
103 | 191 | <ClCompile Include="..\..\frontend\audio.c" /> |
104 | 192 | <ClCompile Include="..\..\frontend\main.c" /> |
107 | 195 | </ItemGroup> |
108 | 196 | <ItemGroup> |
109 | 197 | <ClInclude Include="..\..\frontend\getopt.h" /> |
110 | <ClInclude Include="..\..\common\mp4v2\win32_ver.h" /> | |
111 | 198 | <ClInclude Include="..\..\frontend\mp4read.h" /> |
112 | 199 | <ClInclude Include="..\..\frontend\unicode_support.h" /> |
113 | 200 | <ClInclude Include="..\..\include\neaacdec.h" /> |
33 | 33 | <ClInclude Include="..\..\include\neaacdec.h"> |
34 | 34 | <Filter>Header Files</Filter> |
35 | 35 | </ClInclude> |
36 | <ClInclude Include="..\..\common\mp4v2\win32_ver.h"> | |
37 | <Filter>Header Files</Filter> | |
38 | </ClInclude> | |
39 | 36 | <ClInclude Include="..\..\frontend\mp4read.h"> |
40 | 37 | <Filter>Header Files</Filter> |
41 | 38 | </ClInclude> |
0 | 0 | Microsoft Visual Studio Solution File, Format Version 12.00 |
1 | # Visual Studio 15 | |
2 | VisualStudioVersion = 15.0.27130.2010 | |
1 | # Visual Studio Version 16 | |
2 | VisualStudioVersion = 16.0.30114.105 | |
3 | 3 | MinimumVisualStudioVersion = 10.0.40219.1 |
4 | 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "libfaad.vcxproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}" |
5 | 5 | EndProject |
10 | 10 | Global |
11 | 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution |
12 | 12 | Debug|Win32 = Debug|Win32 |
13 | Debug|x64 = Debug|x64 | |
13 | 14 | Release|Win32 = Release|Win32 |
15 | Release|x64 = Release|x64 | |
14 | 16 | EndGlobalSection |
15 | 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution |
16 | 18 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32 |
17 | 19 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.Build.0 = Debug|Win32 |
20 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|x64.ActiveCfg = Debug|x64 | |
21 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|x64.Build.0 = Debug|x64 | |
18 | 22 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32 |
19 | 23 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.Build.0 = Release|Win32 |
24 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|x64.ActiveCfg = Release|x64 | |
25 | {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|x64.Build.0 = Release|x64 | |
20 | 26 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.ActiveCfg = Debug|Win32 |
21 | 27 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.Build.0 = Debug|Win32 |
28 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|x64.ActiveCfg = Debug|x64 | |
29 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|x64.Build.0 = Debug|x64 | |
22 | 30 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.ActiveCfg = Release|Win32 |
23 | 31 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.Build.0 = Release|Win32 |
32 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|x64.ActiveCfg = Release|x64 | |
33 | {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|x64.Build.0 = Release|x64 | |
24 | 34 | {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.ActiveCfg = Debug|Win32 |
25 | 35 | {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.Build.0 = Debug|Win32 |
36 | {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|x64.ActiveCfg = Debug|x64 | |
37 | {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|x64.Build.0 = Debug|x64 | |
26 | 38 | {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.ActiveCfg = Release|Win32 |
27 | 39 | {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.Build.0 = Release|Win32 |
40 | {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|x64.ActiveCfg = Release|x64 | |
41 | {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|x64.Build.0 = Release|x64 | |
28 | 42 | EndGlobalSection |
29 | 43 | GlobalSection(SolutionProperties) = preSolution |
30 | 44 | HideSolutionNode = FALSE |
4 | 4 | <Configuration>Debug</Configuration> |
5 | 5 | <Platform>Win32</Platform> |
6 | 6 | </ProjectConfiguration> |
7 | <ProjectConfiguration Include="Debug|x64"> | |
8 | <Configuration>Debug</Configuration> | |
9 | <Platform>x64</Platform> | |
10 | </ProjectConfiguration> | |
7 | 11 | <ProjectConfiguration Include="Release|Win32"> |
8 | 12 | <Configuration>Release</Configuration> |
9 | 13 | <Platform>Win32</Platform> |
10 | 14 | </ProjectConfiguration> |
15 | <ProjectConfiguration Include="Release|x64"> | |
16 | <Configuration>Release</Configuration> | |
17 | <Platform>x64</Platform> | |
18 | </ProjectConfiguration> | |
11 | 19 | </ItemGroup> |
12 | 20 | <PropertyGroup Label="Globals"> |
13 | 21 | <ProjectGuid>{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}</ProjectGuid> |
14 | <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> | |
22 | <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | |
15 | 23 | </PropertyGroup> |
16 | 24 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
17 | 25 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
18 | 26 | <ConfigurationType>StaticLibrary</ConfigurationType> |
19 | <PlatformToolset>v141</PlatformToolset> | |
27 | <PlatformToolset>v142</PlatformToolset> | |
28 | </PropertyGroup> | |
29 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | |
30 | <ConfigurationType>StaticLibrary</ConfigurationType> | |
31 | <PlatformToolset>v142</PlatformToolset> | |
20 | 32 | </PropertyGroup> |
21 | 33 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
22 | 34 | <ConfigurationType>StaticLibrary</ConfigurationType> |
23 | <PlatformToolset>v141</PlatformToolset> | |
35 | <PlatformToolset>v142</PlatformToolset> | |
36 | </PropertyGroup> | |
37 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | |
38 | <ConfigurationType>StaticLibrary</ConfigurationType> | |
39 | <PlatformToolset>v142</PlatformToolset> | |
24 | 40 | </PropertyGroup> |
25 | 41 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
26 | 42 | <ImportGroup Label="ExtensionSettings"> |
28 | 44 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
29 | 45 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
30 | 46 | </ImportGroup> |
47 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | |
48 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
49 | </ImportGroup> | |
31 | 50 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
51 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
52 | </ImportGroup> | |
53 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | |
32 | 54 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
33 | 55 | </ImportGroup> |
34 | 56 | <PropertyGroup Label="UserMacros" /> |
42 | 64 | <CodeAnalysisRules /> |
43 | 65 | <CodeAnalysisRuleAssemblies /> |
44 | 66 | </PropertyGroup> |
67 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
68 | <OutDir>.\bin\$(Configuration)\</OutDir> | |
69 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> | |
70 | <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | |
71 | <CodeAnalysisRules /> | |
72 | <CodeAnalysisRuleAssemblies /> | |
73 | </PropertyGroup> | |
45 | 74 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
75 | <OutDir>.\bin\$(Configuration)\</OutDir> | |
76 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> | |
77 | <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | |
78 | <CodeAnalysisRules /> | |
79 | <CodeAnalysisRuleAssemblies /> | |
80 | </PropertyGroup> | |
81 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
46 | 82 | <OutDir>.\bin\$(Configuration)\</OutDir> |
47 | 83 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> |
48 | 84 | <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> |
73 | 109 | <Message>Retrieving package version...</Message> |
74 | 110 | </PreBuildEvent> |
75 | 111 | </ItemDefinitionGroup> |
112 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
113 | <ClCompile> | |
114 | <Optimization>MaxSpeed</Optimization> | |
115 | <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
116 | <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
117 | <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;WIN32;_LIB;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
118 | <StringPooling>true</StringPooling> | |
119 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
120 | <FunctionLevelLinking>true</FunctionLevelLinking> | |
121 | <PrecompiledHeader> | |
122 | </PrecompiledHeader> | |
123 | <WarningLevel>Level3</WarningLevel> | |
124 | </ClCompile> | |
125 | <ResourceCompile> | |
126 | <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
127 | <Culture>0x0413</Culture> | |
128 | </ResourceCompile> | |
129 | <Lib /> | |
130 | <PreBuildEvent> | |
131 | <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" > "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> | |
132 | </PreBuildEvent> | |
133 | <PreBuildEvent> | |
134 | <Message>Retrieving package version...</Message> | |
135 | </PreBuildEvent> | |
136 | </ItemDefinitionGroup> | |
76 | 137 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> |
77 | 138 | <ClCompile> |
78 | 139 | <Optimization>Disabled</Optimization> |
83 | 144 | <PrecompiledHeader /> |
84 | 145 | <WarningLevel>Level3</WarningLevel> |
85 | 146 | <DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
147 | </ClCompile> | |
148 | <ResourceCompile> | |
149 | <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
150 | <Culture>0x0413</Culture> | |
151 | </ResourceCompile> | |
152 | <Lib /> | |
153 | <PreBuildEvent> | |
154 | <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" > "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> | |
155 | </PreBuildEvent> | |
156 | <PreBuildEvent> | |
157 | <Message>Retrieving package version...</Message> | |
158 | </PreBuildEvent> | |
159 | </ItemDefinitionGroup> | |
160 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
161 | <ClCompile> | |
162 | <Optimization>Disabled</Optimization> | |
163 | <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
164 | <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;WIN32;_LIB;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
165 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
166 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> | |
167 | <PrecompiledHeader> | |
168 | </PrecompiledHeader> | |
169 | <WarningLevel>Level3</WarningLevel> | |
170 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | |
86 | 171 | </ClCompile> |
87 | 172 | <ResourceCompile> |
88 | 173 | <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
4 | 4 | <Configuration>Debug</Configuration> |
5 | 5 | <Platform>Win32</Platform> |
6 | 6 | </ProjectConfiguration> |
7 | <ProjectConfiguration Include="Debug|x64"> | |
8 | <Configuration>Debug</Configuration> | |
9 | <Platform>x64</Platform> | |
10 | </ProjectConfiguration> | |
7 | 11 | <ProjectConfiguration Include="Release|Win32"> |
8 | 12 | <Configuration>Release</Configuration> |
9 | 13 | <Platform>Win32</Platform> |
10 | 14 | </ProjectConfiguration> |
15 | <ProjectConfiguration Include="Release|x64"> | |
16 | <Configuration>Release</Configuration> | |
17 | <Platform>x64</Platform> | |
18 | </ProjectConfiguration> | |
11 | 19 | </ItemGroup> |
12 | 20 | <PropertyGroup Label="Globals"> |
13 | 21 | <ProjectGuid>{482DA264-EE88-4575-B208-87C4CB80CD08}</ProjectGuid> |
14 | <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> | |
22 | <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> | |
15 | 23 | </PropertyGroup> |
16 | 24 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> |
17 | 25 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> |
18 | 26 | <ConfigurationType>DynamicLibrary</ConfigurationType> |
19 | <PlatformToolset>v141</PlatformToolset> | |
27 | <PlatformToolset>v142</PlatformToolset> | |
28 | </PropertyGroup> | |
29 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> | |
30 | <ConfigurationType>DynamicLibrary</ConfigurationType> | |
31 | <PlatformToolset>v142</PlatformToolset> | |
20 | 32 | </PropertyGroup> |
21 | 33 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> |
22 | 34 | <ConfigurationType>DynamicLibrary</ConfigurationType> |
23 | <PlatformToolset>v141</PlatformToolset> | |
35 | <PlatformToolset>v142</PlatformToolset> | |
36 | </PropertyGroup> | |
37 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> | |
38 | <ConfigurationType>DynamicLibrary</ConfigurationType> | |
39 | <PlatformToolset>v142</PlatformToolset> | |
24 | 40 | </PropertyGroup> |
25 | 41 | <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> |
26 | 42 | <ImportGroup Label="ExtensionSettings"> |
28 | 44 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> |
29 | 45 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
30 | 46 | </ImportGroup> |
47 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> | |
48 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
49 | </ImportGroup> | |
31 | 50 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> |
51 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | |
52 | </ImportGroup> | |
53 | <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> | |
32 | 54 | <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> |
33 | 55 | </ImportGroup> |
34 | 56 | <PropertyGroup Label="UserMacros" /> |
43 | 65 | <CodeAnalysisRules /> |
44 | 66 | <CodeAnalysisRuleAssemblies /> |
45 | 67 | </PropertyGroup> |
68 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
69 | <OutDir>.\bin\$(Configuration)\</OutDir> | |
70 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> | |
71 | <LinkIncremental>true</LinkIncremental> | |
72 | <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | |
73 | <CodeAnalysisRules /> | |
74 | <CodeAnalysisRuleAssemblies /> | |
75 | </PropertyGroup> | |
46 | 76 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> |
77 | <OutDir>.\bin\$(Configuration)\</OutDir> | |
78 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> | |
79 | <LinkIncremental>false</LinkIncremental> | |
80 | <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | |
81 | <CodeAnalysisRules /> | |
82 | <CodeAnalysisRuleAssemblies /> | |
83 | </PropertyGroup> | |
84 | <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
47 | 85 | <OutDir>.\bin\$(Configuration)\</OutDir> |
48 | 86 | <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir> |
49 | 87 | <LinkIncremental>false</LinkIncremental> |
69 | 107 | <WarningLevel>Level3</WarningLevel> |
70 | 108 | <SuppressStartupBanner>true</SuppressStartupBanner> |
71 | 109 | <DebugInformationFormat>EditAndContinue</DebugInformationFormat> |
110 | </ClCompile> | |
111 | <ResourceCompile> | |
112 | <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
113 | <Culture>0x0407</Culture> | |
114 | </ResourceCompile> | |
115 | <Link> | |
116 | <ModuleDefinitionFile>.\libfaad2.def</ModuleDefinitionFile> | |
117 | <GenerateDebugInformation>true</GenerateDebugInformation> | |
118 | </Link> | |
119 | <PreBuildEvent> | |
120 | <Message>Retrieving package version...</Message> | |
121 | <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" > "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> | |
122 | </PreBuildEvent> | |
123 | </ItemDefinitionGroup> | |
124 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> | |
125 | <Midl> | |
126 | <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
127 | <MkTypLibCompatible>true</MkTypLibCompatible> | |
128 | <SuppressStartupBanner>true</SuppressStartupBanner> | |
129 | <TypeLibraryName>.\DebugDLL/libfaad2_dll.tlb</TypeLibraryName> | |
130 | </Midl> | |
131 | <ClCompile> | |
132 | <Optimization>Disabled</Optimization> | |
133 | <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
134 | <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
135 | <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> | |
136 | <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> | |
137 | <PrecompiledHeader> | |
138 | </PrecompiledHeader> | |
139 | <WarningLevel>Level3</WarningLevel> | |
140 | <SuppressStartupBanner>true</SuppressStartupBanner> | |
141 | <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> | |
72 | 142 | </ClCompile> |
73 | 143 | <ResourceCompile> |
74 | 144 | <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> |
100 | 170 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> |
101 | 171 | <FunctionLevelLinking>true</FunctionLevelLinking> |
102 | 172 | <PrecompiledHeader /> |
173 | <WarningLevel>Level3</WarningLevel> | |
174 | <SuppressStartupBanner>true</SuppressStartupBanner> | |
175 | <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> | |
176 | </ClCompile> | |
177 | <ResourceCompile> | |
178 | <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
179 | <Culture>0x0407</Culture> | |
180 | </ResourceCompile> | |
181 | <Link> | |
182 | <ModuleDefinitionFile>.\libfaad2.def</ModuleDefinitionFile> | |
183 | </Link> | |
184 | <PreBuildEvent> | |
185 | <Message>Retrieving package version...</Message> | |
186 | <Command>"$(SolutionDir)..\..\utils\win32\ac2ver.exe" "faad2" "$(SolutionDir)..\..\configure.ac" > "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command> | |
187 | </PreBuildEvent> | |
188 | </ItemDefinitionGroup> | |
189 | <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> | |
190 | <Midl> | |
191 | <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
192 | <MkTypLibCompatible>true</MkTypLibCompatible> | |
193 | <SuppressStartupBanner>true</SuppressStartupBanner> | |
194 | <TypeLibraryName>.\ReleaseDLL/libfaad2_dll.tlb</TypeLibraryName> | |
195 | </Midl> | |
196 | <ClCompile> | |
197 | <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion> | |
198 | <IntrinsicFunctions>true</IntrinsicFunctions> | |
199 | <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> | |
200 | <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;HAVE_LRINTF;%(PreprocessorDefinitions)</PreprocessorDefinitions> | |
201 | <StringPooling>true</StringPooling> | |
202 | <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> | |
203 | <FunctionLevelLinking>true</FunctionLevelLinking> | |
204 | <PrecompiledHeader> | |
205 | </PrecompiledHeader> | |
103 | 206 | <WarningLevel>Level3</WarningLevel> |
104 | 207 | <SuppressStartupBanner>true</SuppressStartupBanner> |
105 | 208 | <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |