Codebase list faad2 / 1d3b94e
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
139 changed file(s) with 1314 addition(s) and 922 deletion(s). Raw diff Collapse all Expand all
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
025 2.9.2:
126 [ MichaƂ Janiszewski ]
227 * Only use x86-assembly when explicitly on x86
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
182182 numfiles = 0;
183183
184184 Sleep(500);
185 }
185 }
186186
187187 DeleteCriticalSection(&mutex);
188188
2727 #define CREATEFONT(sz) \
2828 CreateFont((sz), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
2929 VARIABLE_PITCH | FF_SWISS, "")
30
30
3131 HANDLE event = NULL;
3232 int width = 130, height = 130;
3333 RECT bar1, bar2, vbrBR;
231231 set_outputFormat(iniSettings.outputFormat);
232232 set_fileType(iniSettings.fileType);
233233 set_object_type(iniSettings.object_type);
234
234
235235 for (frame = 0; frame < 8; frame++)
236236 hbm[frame] = LoadImage(hinst, MAKEINTRESOURCE(IDB_TF01 + frame), IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
237237 frame = 0;
242242 DispatchMessage(&msg);
243243 }
244244
245 for (frame = 0; frame < 8; frame++)
245 for (frame = 0; frame < 8; frame++)
246246 DeleteObject(hbm[frame]);
247247
248248 return msg.wParam;
372372 if (animate || frame)
373373 {
374374 frame++;
375 if (frame > 7)
375 if (frame > 7)
376376 frame -= 8;
377377 }
378378 else
436436 return 0;
437437
438438 case WM_COMMAND:
439 switch (LOWORD(wParam))
439 switch (LOWORD(wParam))
440440 {
441441 case IDM_QUIT:
442442 WriteIniFile(INI_FILE);
445445 break;
446446 case IDM_ONTOP:
447447 set_always_on_top(hwnd, ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED);
448 break;
448 break;
449449 case IDM_LOGERR:
450450 set_logerr(hwnd, ~GetMenuState(menu, LOWORD(wParam), MF_BYCOMMAND) & MF_CHECKED);
451451 break;
458458 }
459459 case IDM_VOLUME:
460460 {
461 int value =
461 int value =
462462 DialogBox(
463 hinst,
464 MAKEINTRESOURCE(IDD_VOLUME),
463 hinst,
464 MAKEINTRESOURCE(IDD_VOLUME),
465465 hwnd, QCProc);
466466
467467 if (value == -2)
483483 hdrop = (HANDLE)wParam;
484484 HandleDrag(hwnd, hdrop);
485485 return 0;
486
486
487487 case WM_DESTROY:
488488 decoding_done = 1;
489489 PostQuitMessage(0);
497497 * Encode parameters dialog procedures.
498498 */
499499
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
507507 if(iniSettings.decode_mode == 0)
508508 {
509509 CheckDlgButton(hwndDlg,IDC_PLAYBACK,TRUE);
578578 EndDialog(hwndDlg, -1);
579579 break;
580580
581 case WM_COMMAND:
582 switch (LOWORD(wParam))
581 case WM_COMMAND:
582 switch (LOWORD(wParam))
583583 {
584584 case IDC_BUTTON1:
585585 {
669669 break;
670670 }
671671 }
672 return FALSE;
672 return FALSE;
673673 }
674674
675675
3838 if (strlen(fmt) > 750)
3939 {
4040 sprintf(msgbuf, "%s %s", "<buffer overflow> ", fmt);
41 }
42 else
41 }
42 else
4343 {
4444 if (_filename != NULL && strlen(_filename) < 255)
4545 {
4848 }
4949
5050 va_start(ap, fmt);
51
51
5252 vsprintf(bufp, fmt, ap);
5353
5454 va_end(ap);
4141 #define IDM_QUIT 40019
4242
4343 // Next default values for new objects
44 //
44 //
4545 #ifdef APSTUDIO_INVOKED
4646 #ifndef APSTUDIO_READONLY_SYMBOLS
4747 #define _APS_NO_MFC 1
77 dnl - mpeg4ip plugin (requires mpeg4ip's libmp4v2 to be installed)
88
99 AC_PREREQ(2.50)
10 AC_INIT(faad2, 2.9.2)
10 AC_INIT(faad2, 2.10.0)
1111 AC_CONFIG_AUX_DIR(.)
1212 AM_INIT_AUTOMAKE([subdir-objects])
1313
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
203203 }
204204
205205 #endif /* GNU C library. */
206
206
207207 /* Handle permutation of arguments. */
208208
209209 /* Describe the part of ARGV that contains non-options that have
264264 temp = *first; *first = *last; *last = temp; first++; last--;
265265 }
266266 }
267
267
268268 /* Scan elements of ARGV (whose length is ARGC) for option characters
269269 given in OPTSTRING.
270270
679679 }
680680
681681 #endif /* _LIBC or not __GNU_LIBRARY__. */
682
682
683683 #ifdef TEST
684684
685685 /* Compile with -DTEST to make an executable for use in testing
153153 while ((b->bytes_into_buffer > 0) && (bytes > 0))
154154 {
155155 int chunk = min(bytes, b->bytes_into_buffer);
156
156
157157 bytes -= chunk;
158158 b->file_offset += chunk;
159159 b->bytes_consumed = chunk;
216216
217217 frame_length = ((((unsigned int)b->buffer[3] & 0x3)) << 11)
218218 | (((unsigned int)b->buffer[4]) << 3) | (b->buffer[5] >> 5);
219 if (frame_length == 0)
220 break;
219221
220222 t_framelength += frame_length;
221223
696698 /* update buffer indices */
697699 advance_buffer(&b, frameInfo.bytesconsumed);
698700
701 /* check if the inconsistent number of channels */
702 if (aufile != NULL && frameInfo.channels != aufile->channels)
703 frameInfo.error = 12;
704
699705 if (frameInfo.error > 0)
700706 {
701707 faad_fprintf(stderr, "Error: %s\n",
871877 if (NeAACDecAudioSpecificConfig(mp4config.asc.buf, mp4config.asc.size, &mp4ASC) >= 0)
872878 {
873879 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;
875881 }
876882 }
877883
9494 if (!txt[size])
9595 break;
9696 }
97 txt[sizemax-1] = '\0';
9798
9899 return size;
99100 }
342343 u32in();
343344 // Number of entries
344345 mp4config.frame.ents = u32in();
345 // fixme: check atom size
346
347 if (!(mp4config.frame.ents + 1))
348 return ERR_FAIL;
349
346350 mp4config.frame.data = malloc(sizeof(*mp4config.frame.data)
347351 * (mp4config.frame.ents + 1));
348352
101101 fprintf(stderr, "\nFATAL: Malloc failed\n\n");
102102 exit(-1);
103103 }
104
104
105105 for(i = 0; i < nArgs; i++)
106106 {
107107 (*argv)[i] = utf16_to_utf8(szArglist[i]);
118118 void free_commandline_arguments_utf8(int *argc, char ***argv)
119119 {
120120 int i = 0;
121
121
122122 if(*argv != NULL)
123123 {
124124 for(i = 0; i < *argc; i++)
139139 FILE *ret = NULL;
140140 wchar_t *filename_utf16 = utf8_to_utf16(filename_utf8);
141141 wchar_t *mode_utf16 = utf8_to_utf16(mode_utf8);
142
142
143143 if(filename_utf16 && mode_utf16)
144144 {
145145 ret = _wfopen(filename_utf16, mode_utf16);
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
152152
153153 for (i = 0; i < MAX_CHANNELS; i++)
154154 {
155 hDecoder->element_id[i] = INVALID_ELEMENT_ID;
155156 hDecoder->window_shape_prev[i] = 0;
156157 hDecoder->time_out[i] = NULL;
157158 hDecoder->fb_intermed[i] = NULL;
285286 #endif
286287
287288 faad_initbits(&ld, buffer, buffer_size);
288
289
289290 #if 0
290291 memset(l, 0, sizeof(latm_header));
291292 is_latm = latmCheck(l, &ld);
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
4848
4949
5050 /* binary search huffman tables */
51 static const int8_t f_huffman_sa[][2] =
51 static const int8_t f_huffman_sa[][2] =
5252 {
5353 { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
5454 { 2, 3 }, /* index 1: 2 bits: 1x */
6666 { /*-7*/ -22, /*-6*/ -21 } /* index 13: 7 bits: 111111x */
6767 };
6868
69 static const int8_t t_huffman_sa[][2] =
69 static const int8_t t_huffman_sa[][2] =
7070 {
7171 { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
7272 { 2, 3 }, /* index 1: 2 bits: 1x */
8484 { /*6*/ -9, /*7*/ -8 } /* index 13: 9 bits: 11111111x */
8585 };
8686
87 static const int8_t f_huffman_pan[][2] =
87 static const int8_t f_huffman_pan[][2] =
8888 {
8989 { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
9090 { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */
116116 { /*12*/ -3, /*14*/ -1 } /* index 27: 16 bits: 111111111111111x */
117117 };
118118
119 static const int8_t t_huffman_pan[][2] =
119 static const int8_t t_huffman_pan[][2] =
120120 {
121121 { /*0*/ -15, 1 }, /* index 0: 1 bits: x */
122122 { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */
149149 };
150150
151151 /* 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] =
153153 {
154154 { FRAC_CONST(0.0000), FRAC_CONST(0.0000) },
155155 { FRAC_CONST(0.0501), FRAC_CONST(0.1778) },
163163
164164 /* We don't need the actual quantizer values */
165165 #if 0
166 static const real_t pan_quant[8][5] =
166 static const real_t pan_quant[8][5] =
167167 {
168168 { COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000) },
169169 { COEF_CONST(0.1661), COEF_CONST(0.1661), COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.3322) },
202202
203203 /* 2^(pan_quant[x][y]/30) */
204204 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) },
209209 { 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) },
212212 { COEF_CONST(1.03117796), COEF_CONST(1.055195268), COEF_CONST(1.0839263), COEF_CONST(1.113439626), COEF_CONST(1.143756546) }
213213 };
214214
215215 /* 2^(-pan_quant[x][y]/30) */
216216 static const real_t pan_pow_2_30_neg[8][5] = {
217217 { 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) },
224224 { COEF_CONST(0.969764715), COEF_CONST(0.947691892), COEF_CONST(0.922571949), COEF_CONST(0.898117847), COEF_CONST(0.874311936) }
225225 };
226226
227227 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),
230230 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),
234234 FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0)
235235 };
236236
245245 { FRAC_CONST(0.929071574), FRAC_CONST(0) }
246246 };
247247
248 static const uint8_t sa_freq_scale[9] =
248 static const uint8_t sa_freq_scale[9] =
249249 {
250250 0, 1, 2, 3, 5, 7, 10, 13, 23
251251 };
252252
253 static const uint8_t pan_freq_scale[21] =
253 static const uint8_t pan_freq_scale[21] =
254254 {
255255 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
256256 11, 12, 13, 14, 15, 18, 22, 26, 32, 64
257257 };
258258
259 static const uint8_t pan_quant_class[20] =
259 static const uint8_t pan_quant_class[20] =
260260 {
261261 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
262262 2, 2, 2, 2, 3, 3, 3, 4, 4, 4
264264
265265 /* Inverse mapping lookup */
266266 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,
269269 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
270270 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19
271271 };
272272
273273 static const uint8_t sa_inv_freq[MAX_SA_BAND] = {
274274 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,
277277 7, 7, 7, 7, 7, 7, 7
278278 };
279279
280 static const real_t filter_coeff[] =
280 static const real_t filter_coeff[] =
281281 {
282282 FRAC_CONST(0.65143905754106),
283283 FRAC_CONST(0.56471812200776),
284284 FRAC_CONST(0.48954165955695)
285285 };
286286
287 static const uint8_t delay_length[3] =
287 static const uint8_t delay_length[3] =
288288 {
289289 3, 4, 5
290290 };
291291
292 static const real_t delay_fraction[] =
292 static const real_t delay_fraction[] =
293293 {
294294 FRAC_CONST(0.43), FRAC_CONST(0.75), FRAC_CONST(0.347)
295295 };
533533 }
534534
535535 static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i)
536 {
536 {
537537 if (i < -7) {
538538 /* printf(" PANminclip %d", i); */
539539 ps->pan_decode_error = 1;
546546 return i;
547547 }
548548
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 {
557557 /* wait until we get a DT frame */
558558 ps->bs_enable_sa = 0;
559559 } else if (ps->bs_sa_dt_flag) {
560560 /* 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]);
562562 } else {
563563 /* 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
567567 for (band = 1; band < DRM_NUM_SA_BANDS; band++)
568 {
568 {
569569 if (ps->bs_sa_dt_flag && ps->g_last_had_sa)
570570 {
571571 ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]);
572572 } 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]);
574574 }
575575 }
576576 }
582582 ps->bs_enable_pan = ps->g_last_had_pan;
583583 ps->bs_enable_sa = ps->g_last_had_sa;
584584 }
585
586
587 if (ps->bs_enable_sa)
588 {
585
586
587 if (ps->bs_enable_sa)
588 {
589589 if (ps->sa_decode_error) {
590590 for (band = 0; band < DRM_NUM_SA_BANDS; band++)
591 {
591 {
592592 ps->g_sa_index[band] = ps->g_last_good_sa_index[band];
593593 }
594594 } else {
595595 for (band = 0; band < DRM_NUM_SA_BANDS; band++)
596 {
596 {
597597 ps->g_last_good_sa_index[band] = ps->g_sa_index[band];
598598 }
599599 }
600600 }
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)
605605 {
606606 ps->bs_enable_pan = 0;
607 } else if (ps->bs_pan_dt_flag) {
607 } else if (ps->bs_pan_dt_flag) {
608608 ps->g_pan_index[0] = pan_delta_clip(ps, ps->g_prev_pan_index[0]+ps->bs_pan_data[0]);
609609 } else {
610610 ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]);
611611 }
612
612
613613 for (band = 1; band < DRM_NUM_PAN_BANDS; band++)
614 {
614 {
615615 if (ps->bs_pan_dt_flag && ps->g_last_had_pan)
616616 {
617617 ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]);
619619 ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]);
620620 }
621621 }
622
622
623623 if (ps->pan_decode_error) {
624624 for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
625 {
625 {
626626 ps->g_pan_index[band] = ps->g_last_good_pan_index[band];
627627 }
628628 } else {
629629 for (band = 0; band < DRM_NUM_PAN_BANDS; band++)
630 {
630 {
631631 ps->g_last_good_pan_index[band] = ps->g_pan_index[band];
632632 }
633633 }
634634 }
635635 }
636636
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 {
639639 uint8_t s, b, k;
640640 complex_t qfrac, tmp0, tmp, in, R0;
641641 real_t peakdiff;
651651
652652 for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
653653 {
654 /* set delay indices */
654 /* set delay indices */
655655 for (k = 0; k < NUM_OF_LINKS; k++)
656656 temp_delay_ser[k] = ps->delay_buf_index_ser[k];
657657
659659 IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]);
660660
661661 for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
662 {
662 {
663663 const real_t gamma = REAL_CONST(1.5);
664664 const real_t sigma = REAL_CONST(1.5625);
665665
694694 } else {
695695 transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma);
696696 }
697
698 for (k = 0; k < NUM_OF_LINKS; k++)
697
698 for (k = 0; k < NUM_OF_LINKS; k++)
699699 {
700700 new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]);
701701 }
707707 IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]);
708708
709709 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);
711711
712712 ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract));
713713
714714 RE(R0) = RE(tmp);
715715 IM(R0) = IM(tmp);
716716
717 for (k = 0; k < NUM_OF_LINKS; k++)
717 for (k = 0; k < NUM_OF_LINKS; k++)
718718 {
719719 RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]);
720720 IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]);
742742 if (++temp_delay_ser[k] >= delay_length[k])
743743 temp_delay_ser[k] = 0;
744744 }
745 }
745 }
746746 }
747747
748748 for (k = 0; k < NUM_OF_LINKS; k++)
749749 ps->delay_buf_index_ser[k] = temp_delay_ser[k];
750750 }
751751
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;
755755 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];
756756 real_t new_dir_map, new_sa_map;
757
757
758758 if (ps->bs_enable_sa)
759759 {
760760 /* Instead of dequantization and mapping, we use an inverse mapping
769769 sa_map[b] = sa_quant[ps->g_prev_sa_index[ifreq]][qclass];
770770 new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass];
771771
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];
775775 new_dir_map = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass];
776
776
777777 k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b]));
778778
779779 }
781781 for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
782782 {
783783 for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS]; b++)
784 {
784 {
785785 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]);
786786 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]);
787787 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]);
788788 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
790790 sa_map[b] += k_sa_map[b];
791791 sa_dir_map[b] += k_sa_dir_map[b];
792792 }
793793 for (b = sa_freq_scale[DRM_NUM_SA_BANDS]; b < NUM_OF_QMF_CHANNELS; b++)
794 {
794 {
795795 QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]);
796796 QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]);
797797 }
798798 }
799 }
799 }
800800 else {
801801 for (s = 0; s < NUM_OF_SUBSAMPLES; s++)
802802 {
803803 for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
804804 {
805805 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])
813813 {
814814 uint8_t s, b, qclass, ifreq;
815815 real_t tmp, coeff1, coeff2;
819819
820820 if (ps->bs_enable_pan)
821821 {
822 for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
822 for (b = 0; b < NUM_OF_QMF_CHANNELS; b++)
823823 {
824824 /* Instead of dequantization, 20->64 mapping and 2^G(x,y) we do an
825825 inverse mapping 64->20 and look up the 2^G(x,y) values directly */
828828
829829 if (ps->g_prev_pan_index[ifreq] >= 0)
830830 {
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];
832832 } else {
833833 pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass];
834834 }
837837 /* a en b can be negative so we may need to inverse parts */
838838 if (ps->g_pan_index[ifreq] >= 0)
839839 {
840 if (ps->g_prev_pan_index[ifreq] >= 0)
840 if (ps->g_prev_pan_index[ifreq] >= 0)
841841 {
842842 pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass],
843843 pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
846846 pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]);
847847 }
848848 } else {
849 if (ps->g_prev_pan_index[ifreq] >= 0)
849 if (ps->g_prev_pan_index[ifreq] >= 0)
850850 {
851851 pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass],
852852 pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]);
865865 tmp = pan_base[b];
866866
867867 coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp));
868 coeff1 = MUL_R(coeff2, tmp);
868 coeff1 = MUL_R(coeff2, tmp);
869869
870870 QMF_RE(temp_l) = QMF_RE(X_left[s][b]);
871871 QMF_IM(temp_l) = QMF_IM(X_left[s][b]);
876876 QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1);
877877 QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2);
878878 QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2);
879
879
880880 /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */
881881 /* ^^^^^^^^^^^^^^^ k times */
882882 pan_base[b] = MUL_C(pan_base[b], pan_delta[b]);
883 }
884 }
885 }
883 }
884 }
885 }
886886 }
887887
888888 drm_ps_info *drm_ps_init(void)
889889 {
890890 drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info));
891891
892 memset(ps, 0, sizeof(drm_ps_info));
892 memset(ps, 0, sizeof(drm_ps_info));
893893
894894 return ps;
895895 }
901901
902902 /* main DRM PS decoding function */
903903 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)
906906 {
907907 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)
912912 {
913913 memcpy(X_right, X_left, sizeof(qmf_t)*30*64);
914914 memset(ps->g_prev_sa_index, 0, sizeof(ps->g_prev_sa_index));
923923 ps->sa_decode_error = 0;
924924 ps->pan_decode_error = 0;
925925 drm_ps_delta_decode(ps);
926 } else
926 } else
927927 {
928928 ps->sa_decode_error = 1;
929929 ps->pan_decode_error = 1;
930930 /* don't even bother decoding */
931931 }
932
932
933933 ps->drm_ps_data_available = 0;
934934
935935 drm_calc_sa_side_signal(ps, X_left);
937937
938938 if (ps->bs_enable_sa)
939939 {
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);
943943
944944 } else {
945945 ps->g_last_had_sa = 0;
946946 }
947
947
948948 if (ps->bs_enable_pan)
949949 {
950950 drm_add_pan(ps, X_left, X_right);
951
952 ps->g_last_had_pan = 1;
951
952 ps->g_last_had_pan = 1;
953953
954954 memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS);
955955
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
4747 #define MAX_DELAY 5
4848
4949 typedef struct
50 {
50 {
5151 uint8_t drm_ps_data_available;
5252 uint8_t bs_enable_sa;
5353 uint8_t bs_enable_pan;
6060
6161 int8_t bs_sa_data[DRM_NUM_SA_BANDS];
6262 int8_t bs_pan_data[DRM_NUM_PAN_BANDS];
63
63
6464 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];
6666 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];
6868
6969 int8_t sa_decode_error;
7070 int8_t pan_decode_error;
7171
7272 int8_t g_last_good_sa_index[DRM_NUM_SA_BANDS];
7373 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];
7676
7777 complex_t d_buff[2][MAX_SA_BAND];
7878 complex_t d2_buff[NUM_OF_LINKS][MAX_DELAY][MAX_SA_BAND];
7979
80 uint8_t delay_buf_index_ser[NUM_OF_LINKS];
81
80 uint8_t delay_buf_index_ser[NUM_OF_LINKS];
81
8282 real_t prev_nrg[MAX_SA_BAND];
8383 real_t prev_peakdiff[MAX_SA_BAND];
84 real_t peakdecay_fast[MAX_SA_BAND];
84 real_t peakdecay_fast[MAX_SA_BAND];
8585 } drm_ps_info;
8686
8787
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
3636 #include "specrec.h"
3737 #include "huffman.h"
3838
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)
4141 *
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.
4646 * 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,
4848 * with the writing direction alternating.
4949 * Data length is not increased.
5050 */
5959 #define VCB11_FIRST 16
6060 #define VCB11_LAST 31
6161
62 static const uint8_t PreSortCB_STD[NUM_CB] =
62 static const uint8_t PreSortCB_STD[NUM_CB] =
6363 { 11, 9, 7, 5, 3, 1};
6464
65 static const uint8_t PreSortCB_ER[NUM_CB_ER] =
65 static const uint8_t PreSortCB_ER[NUM_CB_ER] =
6666 { 11, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 9, 7, 5, 3, 1};
6767
6868 /* 8.5.3.3.2 Derivation of segment width */
7373 #define segmentWidth(cb) min(maxCwLen[cb], ics->length_of_longest_codeword)
7474
7575 /* 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};
7777 static const uint32_t B[] = {0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF};
7878
7979 typedef struct
8787 /* rewind and reverse */
8888 /* 32 bit version */
8989 static uint32_t rewrev_word(uint32_t v, const uint8_t len)
90 {
90 {
9191 /* 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]);
9595 v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
9696 v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]);
9797
103103
104104 /* 64 bit version */
105105 static void rewrev_lword(uint32_t *hi, uint32_t *lo, const uint8_t len)
106 {
106 {
107107 if (len <= 32) {
108108 *hi = 0;
109109 *lo = rewrev_word(*lo, len);
112112 uint32_t t = *hi, v = *lo;
113113
114114 /* 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]);
121121 v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]);
122122 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]);
124124 t = ((t >> S[4]) & B[4]) | ((t << S[4]) & ~B[4]);
125125
126126 /* last 32<>32 bit swap is implicit below */
127
127
128128 /* shift off low bits (this is really only one 64 bit shift) */
129129 *lo = (t >> (64 - len)) | (v << (len - 32));
130 *hi = v >> (64 - len);
130 *hi = v >> (64 - len);
131131 }
132132 }
133133
149149
150150 al = a->bufa;
151151 ah = a->bufb;
152
152
153153 if (b->len > 32)
154154 {
155155 /* maskoff superfluous high b bits */
160160 al = 0;
161161 } else {
162162 bl = b->bufa & ((1 << (b->len)) - 1);
163 bh = 0;
163 bh = 0;
164164 ah = (ah << (b->len)) | (al >> (32 - b->len));
165165 al = al << b->len;
166166 }
171171
172172 b->len += a->len;
173173 }
174
174
175175 static uint8_t is_good_cb(uint8_t this_CB, uint8_t this_sec_CB)
176176 {
177177 /* only want spectral data CB's */
189189 }
190190 return 0;
191191 }
192
192
193193 static void read_segment(bits_t *segment, uint8_t segwidth, bitfile *ld)
194194 {
195195 segment->len = segwidth;
196196
197197 if (segwidth > 32)
198198 {
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);
201201
202202 } else {
203203 segment->bufa = faad_getbits(ld, segwidth);
204 segment->bufb = 0;
205 }
204 segment->bufb = 0;
205 }
206206 }
207207
208208 static void fill_in_codeword(codeword_t *codeword, uint16_t index, uint16_t sp, uint8_t cb)
213213 codeword[index].bits.len = 0;
214214 }
215215
216 uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
216 uint8_t reordered_spectral_data(NeAACDecStruct *hDecoder, ic_stream *ics,
217217 bitfile *ld, int16_t *spectral_data)
218 {
218 {
219219 uint16_t PCWs_done;
220 uint16_t numberOfSegments, numberOfSets, numberOfCodewords;
220 uint16_t numberOfSegments, numberOfSets, numberOfCodewords;
221221
222222 codeword_t codeword[512];
223223 bits_t segment[512];
225225 uint16_t sp_offset[8];
226226 uint16_t g, i, sortloop, set, bitsread;
227227 /*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
230230 const uint16_t nshort = hDecoder->frameLength/8;
231231 const uint16_t sp_data_len = ics->length_of_reordered_spectral_data;
232
232
233233 const uint8_t *PreSortCb;
234234
235235 /* no data (e.g. silence) */
241241 return 10;
242242
243243 if (sp_data_len < ics->length_of_longest_codeword)
244 return 10;
244 return 10;
245245
246246 sp_offset[0] = 0;
247247 for (g = 1; g < ics->num_window_groups; g++)
264264 PreSortCb = PreSortCB_STD;
265265 last_CB = NUM_CB;
266266 }
267
267
268268 /* step 1: decode PCW's (set 0), and stuff data in easier-to-use format */
269269 for (sortloop = 0; sortloop < last_CB; sortloop++)
270270 {
271271 /* select codebook to process this pass */
272272 this_CB = PreSortCb[sortloop];
273
273
274274 /* loop over sfbs */
275275 for (sfb = 0; sfb < ics->max_sfb; sfb++)
276276 {
283283 {
284284 /* check whether sfb used here is the one we want to process */
285285 if ((ics->sect_start[g][i] <= sfb) && (ics->sect_end[g][i] > sfb))
286 {
286 {
287287 /* check whether codebook used here is the one we want to process */
288288 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))
291291 {
292292 /* precalculate some stuff */
293293 uint16_t sect_sfb_size = ics->sect_sfb_offset[g][sfb+1] - ics->sect_sfb_offset[g][sfb];
294294 uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN;
295295 uint16_t group_cws_count = (4*ics->window_group_length[g])/inc;
296296 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?) */
300300 for (cws = 0; (cws < group_cws_count) && ((cws + w_idx*group_cws_count) < sect_sfb_size); cws++)
301301 {
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);
303303
304304 /* read and decode PCW */
305305 if (!PCWs_done)
306 {
306 {
307307 /* read in normal segments */
308308 if (bitsread + segwidth <= sp_data_len)
309 {
310 read_segment(&segment[numberOfSegments], segwidth, ld);
309 {
310 read_segment(&segment[numberOfSegments], segwidth, ld);
311311 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]);
314314
315315 /* keep leftover bits */
316316 rewrev_bits(&segment[numberOfSegments]);
321321 this in earlier because it might not fit in 64 bits. since we already
322322 decoded (and removed) the PCW it is now guaranteed to fit */
323323 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);
328328 segment[numberOfSegments].len += segment[numberOfSegments-1].len;
329 rewrev_bits(&segment[numberOfSegments]);
329 rewrev_bits(&segment[numberOfSegments]);
330330
331331 if (segment[numberOfSegments-1].len > 32)
332332 {
333 segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb +
333 segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb +
334334 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 +
336336 showbits_hcr(&segment[numberOfSegments-1], 32);
337337 } else {
338 segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
338 segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa +
339339 showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len);
340340 segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb;
341 }
341 }
342342 segment[numberOfSegments-1].len += additional_bits;
343343 }
344344 bitsread = sp_data_len;
345345 PCWs_done = 1;
346346
347 fill_in_codeword(codeword, 0, sp, this_sec_CB);
347 fill_in_codeword(codeword, 0, sp, this_sec_CB);
348348 }
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);
351351 }
352352 numberOfCodewords++;
353 }
353 }
354354 }
355355 }
356 }
357 }
356 }
357 }
358358 }
359359 }
360360 }
361361
362362 if (numberOfSegments == 0)
363 return 10;
364
365 numberOfSets = numberOfCodewords / numberOfSegments;
363 return 10;
364
365 numberOfSets = numberOfCodewords / numberOfSegments;
366366
367367 /* step 2: decode nonPCWs */
368368 for (set = 1; set <= numberOfSets; set++)
385385 {
386386 uint8_t tmplen;
387387
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
391391 tmplen = segment[segment_idx].len;
392392
393393 if (huffman_spectral_data_2(codeword[codeword_idx].cb, &segment[segment_idx],
394394 &spectral_data[codeword[codeword_idx].sp_offset]) >= 0)
395395 {
396396 codeword[codeword_idx].decoded = 1;
397 } else
398 {
397 } else
398 {
399399 codeword[codeword_idx].bits = segment[segment_idx];
400 codeword[codeword_idx].bits.len = tmplen;
400 codeword[codeword_idx].bits.len = tmplen;
401401 }
402
402
403403 }
404404 }
405405 }
408408 }
409409
410410 #if 0 // Seems to give false errors
411 bitsleft = 0;
412
411 bitsleft = 0;
412
413413 for (i = 0; i < numberOfSegments && !bitsleft; i++)
414414 bitsleft += segment[i].len;
415415
417417
418418 codewordsleft = 0;
419419
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++;
423423
424424 if (codewordsleft) return 10;
425425 #endif
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
4242
4343 /* static function declarations */
4444 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);
4646 static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp);
4747 static uint8_t huffman_2step_quad_sign(uint8_t cb, bitfile *ld, int16_t *sp);
4848 static uint8_t huffman_2step_pair(uint8_t cb, bitfile *ld, int16_t *sp);
120120 }
121121 }
122122
123 static INLINE int16_t huffman_getescape(bitfile *ld, int16_t sp)
123 static INLINE uint8_t huffman_getescape(bitfile *ld, int16_t *sp)
124124 {
125125 uint8_t neg, i;
126126 int16_t j;
127127 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;
133134 neg = 1;
134135 } else {
135 if (sp != 16)
136 return sp;
136 if (x != 16)
137 return 0;
137138 neg = 0;
138139 }
139140
140 for (i = 4; ; i++)
141 for (i = 4; i < 16; i++)
141142 {
142143 if (faad_get1bit(ld
143144 DEBUGVAR(1,6,"huffman_getescape(): escape size")) == 0)
145146 break;
146147 }
147148 }
149 if (i >= 16)
150 return 10;
148151
149152 off = (int16_t)faad_getbits(ld, i
150153 DEBUGVAR(1,9,"huffman_getescape(): escape"));
153156 if (neg)
154157 j = -j;
155158
156 return j;
159 *sp = j;
160 return 0;
157161 }
158162
159163 static uint8_t huffman_2step_quad(uint8_t cb, bitfile *ld, int16_t *sp)
356360 return huffman_2step_pair_sign(cb, ld, sp);
357361 case 12: {
358362 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);
360364 return err; }
361365 case 11:
362366 {
363367 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]);
366372 return err;
367373 }
368374 #ifdef ERROR_RESILIENCE
371377 case 24: case 25: case 26: case 27: case 28: case 29: case 30: case 31:
372378 {
373379 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]);
376384
377385 /* check LAV (Largest Absolute Value) */
378386 /* this finds errors in the ESCAPE signal */
445453 vcb11 = cb;
446454 cb = 11;
447455 }
448
456
449457 cw = showbits_hcr(ld, hcbN[cb]);
450458 offset = hcb_table[cb][cw].offset;
451459 extra_bits = hcb_table[cb][cw].extra_bits;
468476 while (!hcb3[offset].is_leaf)
469477 {
470478 uint8_t b;
471
479
472480 if ( get1bit_hcr(ld, &b) ) return -1;
473481 offset += hcb3[offset].data[b];
474482 }
487495 while (!hcb_bin_table[cb][offset].is_leaf)
488496 {
489497 uint8_t b;
490
498
491499 if (get1bit_hcr(ld, &b) ) return -1;
492500 offset += hcb_bin_table[cb][offset].data[b];
493501 }
526534 int32_t j;
527535 uint32_t off;
528536
529 neg = (sp[k] < 0) ? 1 : 0;
537 neg = (sp[k] < 0) ? 1 : 0;
530538
531539 for (i = 4; ; i++)
532540 {
550558 /* this finds errors in the ESCAPE signal */
551559 vcb11_check_LAV(vcb11, sp);
552560 }
553 }
561 }
554562 return ld->len;
555563 }
556564
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
5353 tmp |= (uint32_t)0x00010000; /* insert 1 lsb */
5454 tmp2 = tmp; /* add 1 lsb and elided one */
5555 tmp &= (uint32_t)0xff800000; /* extract exponent and sign */
56
56
5757 *pf = *(float32_t*)&tmp1 + *(float32_t*)&tmp2 - *(float32_t*)&tmp;
5858 } else {
5959 *pf = *(float32_t*)&tmp;
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
3131 * Fast (I)MDCT Implementation using (I)FFT ((Inverse) Fast Fourier Transform)
3232 * and consists of three steps: pre-(I)FFT complex multiplication, complex
3333 * (I)FFT, post-(I)FFT complex multiplication,
34 *
34 *
3535 * As described in:
3636 * P. Duhamel, Y. Mahieux, and J.P. Petit, "A Fast Algorithm for the
3737 * 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.
3939 *
4040 *
4141 * As of April 6th 2002 completely rewritten.
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
106106 0, /* 27 ER Parametric */
107107 #endif
108108 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
110114 0, /* 30 (Reserved) */
111115 0 /* 31 (Reserved) */
112116 };
173177
174178 #ifdef SBR_DEC
175179 mp4ASC->sbr_present_flag = -1;
176 if (mp4ASC->objectTypeIndex == 5)
180 if (mp4ASC->objectTypeIndex == 5 || mp4ASC->objectTypeIndex == 29)
177181 {
178182 uint8_t tmp;
179183
230234 else
231235 bits_to_decode = (int8_t)(buffer_size*8 - (startpos-faad_get_processed_bits(ld)));
232236
233 if ((mp4ASC->objectTypeIndex != 5) && (bits_to_decode >= 16))
237 if ((mp4ASC->objectTypeIndex != 5 && mp4ASC->objectTypeIndex != 29) && (bits_to_decode >= 16))
234238 {
235239 int16_t syncExtensionType = (int16_t)faad_getbits(ld, 11
236240 DEBUGVAR(1,9,"parse_audio_decoder_specific_info(): syncExtensionType"));
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
4141 uint32_t buffer_size,
4242 mp4AudioSpecificConfig *mp4ASC,
4343 program_config *pce, uint8_t short_form);
44
44
4545 int8_t AudioSpecificConfigFromBitfile(bitfile *ld,
4646 mp4AudioSpecificConfig *mp4ASC,
4747 program_config *pce, uint32_t bsize, uint8_t short_form);
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
4747
4848 if (ics->ms_mask_present >= 1)
4949 {
50 for (g = 0; g < ics->num_window_groups; g++)
50 for (g = 0; g < ics->num_window_groups; g++)
5151 {
5252 for (b = 0; b < ics->window_group_length[g]; b++)
5353 {
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
235235 if ((ics_right != NULL)
236236 && is_noise(ics_right, g, sfb))
237237 {
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) &&
239249 (((ics_left->ms_mask_present == 1) &&
240250 (ics_left->ms_used[g][sfb])) ||
241251 (ics_left->ms_mask_present == 2)))
250260 ics_right->scale_factors[g][sfb], size, sub, &r1_dep, &r2_dep);
251261
252262 } 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
261263
262264 offs = ics_right->swb_offset[sfb];
263265 size = min(ics_right->swb_offset[sfb+1], ics_right->swb_offset_max) - offs;
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
453453 int8_t index;
454454 uint32_t cw;
455455 rvlc_huff_table *h = book_rvlc;
456
456
457457 i = h->len;
458458 if (direction > 0)
459459 cw = faad_getbits(ld_sf, i DEBUGVAR(1,0,""));
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
9696 {
9797 sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS_960;
9898 sbr->numTimeSlots = NO_TIME_SLOTS_960;
99 } else {
99 }
100 else if (framelength == 1024)
101 {
100102 sbr->numTimeSlotsRate = RATE * NO_TIME_SLOTS;
101103 sbr->numTimeSlots = NO_TIME_SLOTS;
104 }
105 else
106 {
107 faad_free(sbr);
108 return NULL;
102109 }
103110
104111 sbr->GQ_ringbuf_index[0] = 0;
165172 }
166173
167174 #ifdef PS_DEC
168 if (sbr->ps != NULL)
175 if (sbr->ps != NULL)
169176 ps_free(sbr->ps);
170177 #endif
171178
204211
205212 memset(sbr->Xsbr[0], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
206213 memset(sbr->Xsbr[1], 0, (sbr->numTimeSlotsRate+sbr->tHFGen)*64 * sizeof(qmf_t));
207
214
208215 sbr->GQ_ringbuf_index[0] = 0;
209216 sbr->GQ_ringbuf_index[1] = 0;
210217 sbr->header_count = 0;
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
7979 {
8080 return startMin + offset[offsetIndex][bs_start_freq];
8181
82 #if 0 /* replaced by offsetIndexTable */
82 #if 0 /* replaced by offsetIndexTable */
8383 switch (sample_rate)
8484 {
8585 case 16000:
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
395395 };
396396
397397 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),
408408 REAL_CONST(0.000000000000000)
409409 };
410410
867867 };
868868
869869 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),
880880 REAL_CONST(0.000000000000000)
881881 };
882882
14161416 i++;
14171417 }
14181418 }
1419 }
1419 }
14201420
14211421 if (grouping)
14221422 {
14381438 for (k = 0; k < sbr->N_G[l]; k++)
14391439 {
14401440 E_total_est = E_total = 0;
1441
1441
14421442 for (m = sbr->f_group[l][k<<1]; m < sbr->f_group[l][(k<<1) + 1]; m++)
14431443 {
14441444 /* E_curr: integer */
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
297297 /* improves accuracy */
298298 if (exp > 0)
299299 exp -= 1;
300
300
301301 pow2_to_exp = 1<<(exp-1);
302302
303303 temp2_r = (QMF_RE(buffer[offset-2][bd]) + pow2_to_exp) >> exp;
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
216216 {
217217 result += calc_sbr_tables(sbr, saved_start_freq, saved_stop_freq,
218218 saved_samplerate_mode, saved_freq_scale,
219 saved_alter_scale, saved_xover_band);
219 saved_alter_scale, saved_xover_band);
220220 }
221221
222222 /* we should be able to safely set result to 0 now, */
247247 #ifdef DRM
248248 if (!sbr->Is_DRM_SBR)
249249 #endif
250 {
250 {
251251 /* -4 does not apply, bs_extension_type is re-read in this function */
252252 num_align_bits = 8*cnt /*- 4*/ - num_sbr_bits2;
253253
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
621621 wb = wa + bin;
622622
623623 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;
626626 spec_data[wb+3] = iquant(quant_data[k+3], tab, &error) * scf;
627
627
628628 #else
629629 real_t iq0 = iquant(quant_data[k+0], tab, &error);
630630 real_t iq1 = iquant(quant_data[k+1], tab, &error);
940940 /* sanity check, CVE-2018-20199, CVE-2018-20360 */
941941 if(!hDecoder->time_out[sce->channel])
942942 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;
943947
944948 /* dequantisation and scaling */
945949 retval = quant_to_spec(hDecoder, ics, spec_data, spec_coef, hDecoder->frameLength);
10551059 #endif
10561060 );
10571061 }
1062 if (!hDecoder->sbr[ele])
1063 return 19;
10581064
10591065 if (sce->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
10601066 hDecoder->sbr[ele]->maxAACLine = 8*min(sce->ics1.swb_offset[max(sce->ics1.max_sfb-1, 0)], sce->ics1.swb_offset_max);
11211127 }
11221128
11231129 /* 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])
11251133 return 15;
11261134
11271135 /* dequantisation and scaling */
13111319 #endif
13121320 );
13131321 }
1322 if (!hDecoder->sbr[ele])
1323 return 19;
13141324
13151325 if (cpe->ics1.window_sequence == EIGHT_SHORT_SEQUENCE)
13161326 hDecoder->sbr[ele]->maxAACLine = 8*min(cpe->ics1.swb_offset[max(cpe->ics1.max_sfb-1, 0)], cpe->ics1.swb_offset_max);
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
5858 -2.1939551286300665E-02, -2.4533179947088161E-02, -2.2591663337768787E-02,
5959 -1.5122066420044672E-02, -1.7971713448186293E-03, 1.6903413428575379E-02,
6060 3.9672315874127042E-02, 6.4487527248102796E-02, 8.8850025474701726E-02,
61 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012
61 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012
6262 };
6363
6464 for (j = 0; j < 48; ++j)
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
343343 can become 2 when some form of Parametric Stereo coding is used
344344 */
345345
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 {
347349 /* element inconsistency */
348350 hInfo->error = 21;
349351 return;
400402 return;
401403 }
402404
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 {
404408 /* element inconsistency */
405409 hInfo->error = 21;
406410 return;
534538 break;
535539 case 3:
536540 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
541 if (hInfo->error > 0)
542 return;
537543 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
538544 if (hInfo->error > 0)
539545 return;
540546 break;
541547 case 4:
542548 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
549 if (hInfo->error > 0)
550 return;
543551 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
552 if (hInfo->error > 0)
553 return;
544554 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
545555 if (hInfo->error > 0)
546556 return;
547557 break;
548558 case 5:
549559 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
560 if (hInfo->error > 0)
561 return;
550562 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
563 if (hInfo->error > 0)
564 return;
551565 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
552566 if (hInfo->error > 0)
553567 return;
554568 break;
555569 case 6:
556570 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
571 if (hInfo->error > 0)
572 return;
557573 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
574 if (hInfo->error > 0)
575 return;
558576 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
577 if (hInfo->error > 0)
578 return;
559579 decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
560580 if (hInfo->error > 0)
561581 return;
562582 break;
563583 case 7: /* 8 channels */
564584 decode_sce_lfe(hDecoder, hInfo, ld, ID_SCE);
585 if (hInfo->error > 0)
586 return;
565587 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
588 if (hInfo->error > 0)
589 return;
566590 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
591 if (hInfo->error > 0)
592 return;
567593 decode_cpe(hDecoder, hInfo, ld, ID_CPE);
594 if (hInfo->error > 0)
595 return;
568596 decode_sce_lfe(hDecoder, hInfo, ld, ID_LFE);
569597 if (hInfo->error > 0)
570598 return;
883911 if ((ics->ltp.data_present = faad_get1bit(ld
884912 DEBUGVAR(1,50,"ics_info(): ltp.data_present"))) & 1)
885913 {
886 ltp_data(hDecoder, ics, &(ics->ltp), ld);
914 if ((retval = ltp_data(hDecoder, ics, &(ics->ltp), ld)) > 0)
915 {
916 return retval;
917 }
887918 }
888919 }
889920 #endif
10901121 #endif
10911122 );
10921123 }
1124 if (!hDecoder->sbr[sbr_ele])
1125 return 19;
10931126
10941127 hDecoder->sbr_present_flag = 1;
10951128
12781311 }
12791312 #else
12801313 faad_get1bit(ld);
1281 #endif
1314 #endif
12821315
12831316 hInfo->error = side_info(hDecoder, &cpe, ld, ics1, 1);
12841317 if (hInfo->error > 0)
13581391 {
13591392 hDecoder->sbr[0] = sbrDecodeInit(hDecoder->frameLength, hDecoder->element_id[0],
13601393 2*get_sample_rate(hDecoder->sf_index), 0 /* ds SBR */, 1);
1394 }
1395 if (!hDecoder->sbr[0])
1396 {
1397 hInfo->error = 19;
1398 return;
13611399 }
13621400
13631401 /* Reverse bit reading of SBR data in DRM audio frame */
16101648 if (result > 0)
16111649 return result;
16121650
1613 if (hDecoder->object_type >= ER_OBJECT_START)
1651 if (hDecoder->object_type >= ER_OBJECT_START)
16141652 {
16151653 if (ics->tns_data_present)
16161654 tns_data(ics, &(ics->tns), ld);
21782216 return n;
21792217 case EXT_FILL_DATA:
21802218 /* 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' */
21822220 for (i = 0; i < count-1; i++)
21832221 {
21842222 /* 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' */
21862224 }
21872225 return count;
21882226 case EXT_DATA_ELEMENT:
26412679 endpos = faad_get_processed_bits(ld);
26422680 if(ret>0)
26432681 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) ?
26452683 }
26462684 return 0xFFFFFFFF;
26472685 }
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
9090 #define ID_PCE 0x5
9191 #define ID_FIL 0x6
9292 #define ID_END 0x7
93 #define INVALID_ELEMENT_ID 255
9394
9495 #define ONLY_LONG_SEQUENCE 0x0
9596 #define LONG_START_SEQUENCE 0x1
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
3737
3838 #define TNS_MAX_ORDER 20
3939
40
40
4141 void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
4242 uint8_t object_type, real_t *spec, uint16_t frame_len);
4343 void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
00 /*
11 ** FAAD - Freeware Advanced Audio Decoder
22 ** Copyright (C) 2002 M. Bakker
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** $Id: QCDFAAD.c,v 1.2 2003/04/28 19:04:35 menno Exp $
239239 {
240240 case WM_INITDIALOG:
241241 /* 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));
243243 SendMessage(GetDlgItem(hwndDlg, THREAD_PRIORITY_SLIDER), TBM_SETPOS, TRUE, m_priority);
244244 SetDlgItemText(hwndDlg, IDC_STATIC2, priority_text[m_priority]);
245
245
246246 /* Put a limit to the amount of characters allowed in the buffer boxes */
247247 SendMessage(GetDlgItem(hwndDlg, LOCAL_BUFFER_TXT), EM_LIMITTEXT, 4, 0);
248248 SendMessage(GetDlgItem(hwndDlg, STREAM_BUFFER_TXT), EM_LIMITTEXT, 4, 0);
288288 if(GetDlgItem(hwndDlg, VARBITRATE_CHK) == (HWND) lParam)
289289 {
290290 /* 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);
292292 }
293293 if(GetDlgItem(hwndDlg, IDC_MEMMAP) == (HWND) lParam)
294294 {
295295 /* 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);
297297 }
298298 }
299299
362362
363363 SetDlgItemText(hwndDlg, IDC_PLUGINVER, szPluginVer);
364364 SetDlgItemText(hwndDlg, IDC_FAADVER, szFLACVer);
365
365
366366 return TRUE;
367367 case WM_MOUSEMOVE:
368368 ptMouse.x = LOWORD(lParam);
369369 ptMouse.y = HIWORD(lParam);
370370 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)
373373 ||
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)
376376 ||
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)
379379 /* ||
380 (ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right &&
380 (ptMouse.x >= rcMail3.left && ptMouse.x <= rcMail3.right &&
381381 ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom)*/ )
382382 SetCursor(LoadCursor(NULL, MAKEINTRESOURCE(32649)));
383383 else
388388 ptMouse.x = LOWORD(lParam);
389389 ptMouse.y = HIWORD(lParam);
390390 ClientToScreen(hwndDlg, &ptMouse);
391 if(ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right &&
391 if(ptMouse.x >= rcLOGO.left && ptMouse.x <= rcLOGO.right &&
392392 ptMouse.y >= rcLOGO.top && ptMouse.y<= rcLOGO.bottom)
393393 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 &&
395395 ptMouse.y >= rcMail1.top && ptMouse.y<= rcMail1.bottom)
396396 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 &&
398398 ptMouse.y >= rcMail2.top && ptMouse.y<= rcMail2.bottom)
399399 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 &&
401401 ptMouse.y >= rcMail3.top && ptMouse.y<= rcMail3.bottom)
402402 ShellExecute(0, NULL, "I don't know", NULL,NULL, SW_NORMAL);
403403 */
417417 void About(int flags)
418418 {
419419 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);
421421 ShowWindow(hwndAbout, SW_SHOW);
422422 }
423423
482482 if(StringComp(ch, ".aac", 4) == 0)
483483 {
484484 in = open_filestream((char *)medianame);
485
485
486486 if(in != NULL && mediaInfo)
487487 {
488488 if(in->http)
500500 else
501501 mediaInfo->op_canSeek = FALSE; /* ADIF or Headerless - not seekable */
502502 }
503
503
504504 close_filestream(in);
505505 return TRUE;
506506 }
511511 }
512512 }
513513 else
514 return FALSE;
514 return FALSE;
515515 }
516516
517517 unsigned long samplerate, channels;
521521 int tagsize = 0;
522522
523523 infile = open_filestream(fn);
524
524
525525 if (infile == NULL)
526526 return 1;
527527
560560 ZeroMemory(buffer, 768*2);
561561
562562 infile = open_filestream(fn);
563
563
564564 if (infile == NULL)
565565 return 1;
566566
653653 buffer = (unsigned char*)LocalAlloc(LPTR, 768*2);
654654
655655 current_file_mode = m_memmap_file;
656
656
657657 if(current_file_mode)
658658 {
659659 if(play_memmap((char *)medianame))
664664 if(play_file((char *)medianame))
665665 return FALSE;
666666 }
667
667
668668 if(seek_table)
669669 {
670670 free(seek_table);
671671 seek_table = NULL;
672672 seek_table_length = 0;
673673 }
674
674
675675 get_AAC_format((char *)medianame, &file_info, &seek_table, &seek_table_length, 0);
676
676
677677 seek_needed = playfrom > 0 ? playfrom : -1;
678678 killPlayThread = 0;
679679 strcpy(lastfn,medianame);
688688 play_thread_handle = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) PlayThread, (void *) &killPlayThread, 0, &thread_id);
689689 if(!play_thread_handle)
690690 return FALSE;
691
691
692692 // Note: This line seriously slows down start up time
693693 if(m_priority != 3) // if the priority in config window is set to normal, there is nothing to reset!
694694 SetThreadPriority(play_thread_handle, priority_table[m_priority]);
695
695
696696 }
697697
698698 return TRUE;
719719 if(medianame && *medianame && stricmp(lastfn, medianame) == 0)
720720 {
721721 sQCDCallbacks.toPlayer.OutputStop(flags);
722
722
723723 killPlayThread = 1;
724724 if(play_thread_handle != INVALID_HANDLE_VALUE)
725725 {
734734
735735 if (oldAPIs)
736736 QCDCallbacks->toPlayer.PlayStopped(lastfn);
737
737
738738 lastfn[0] = 0;
739739 }
740740
905905 QCDCallbacks->toPlayer.PositionUpdate(decode_pos_ms);
906906 updatePos = 0;
907907 }
908
908
909909 {
910910 WriteDataStruct wd;
911911
912912 l = frameInfo.samples * sizeof(short);
913913
914914 decode_pos_ms += (1024*1000)/file_info.sampling_rate;
915
915
916916 wd.bytelen = l;
917917 wd.data = sample_buffer;
918918 wd.markerend = 0;
921921 wd.nch = frameInfo.channels;
922922 wd.numsamples =l/file_info.channels/(16/8);
923923 wd.srate = file_info.sampling_rate;
924
924
925925 if (!QCDCallbacks->toPlayer.OutputWrite(&wd))
926926 done = TRUE;
927927 }
00 //-----------------------------------------------------------------------------
1 //
1 //
22 // File: QCDInputDLL.h
33 //
44 // About: QCD Player Input module DLL interface. For more documentation, see
1010 //
1111 // Copyright (C) 1997-2002 Quinnware
1212 //
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
1414 // here.
1515 //
1616 // This program is distributed in the hope that it will be useful,
1212 //
1313 // Copyright (C) 1997-2002 Quinnware
1414 //
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
1616 // here.
1717 //
1818 // This program is distributed in the hope that it will be useful,
4646 //-----------------------------------------------------------------------------
4747 // Services (ops) provided by the Player
4848 //-----------------------------------------------------------------------------
49 typedef enum
49 typedef enum
5050 { //*** below returns numeric info (*buffer not used)
5151
5252 opGetPlayerVersion = 0, // high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1)
6464 opGetTrackLength = 14, // get track length, param1 = index of track in playlist, -1 for current
6565 // param2 = 0 for seconds, 1 for milliseconds
6666 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
6868 opGetTrackState = 16, // get whether track is marked, param1 = index of track, -1 for current
6969 opGetPlaylistNum = 17, // get playlist number of index, param1 = index of track in playlist, -1 for current
7070 opGetMediaType = 18, // get media type of track, param1 = index if track in playlist, -1 for current
8787
8888 opGetIndexFromPLNum = 28, // get index from playlist number, param1 = playlist number
8989
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)
9191 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
9999
100100 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
102102
103103 opGetQueriesComplete = 60, // get status on whether all tracks in playlist have been queryied for their info
104104
132132 opGetSkinFolder = 112, // get current skin folder
133133 opGetCDDBCacheFolder = 113, // get current folder for CDDB cached info
134134
135 opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded
135 opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded
136136
137137 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
139139
140140 opGetSupportedExtensions = 116, // get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions
141141 // - returned extensions will be colon delimited
220220 UINT nch; // number of channels
221221 UINT srate; // sample rate
222222
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)
224224 // (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins)
225225 UINT markerend; // Marker position at end of data (not currently used, set to 0)
226226 } WriteDataStruct;
229229 typedef struct // for GetTrackExtents Input Plugin callback
230230 {
231231 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
233233 // of the file, set to start position. Otherwise set to 0.
234234 UINT end; // set to end position of media.
235235 UINT unitpersec; // whatever units are being used for this media, how many
236 // of them per second.
236 // of them per second.
237237 // (Note: ((end - start) / unitpersecond) = file length
238238 UINT bytesize; // size of file in bytes (if applicable, otherwise 0).
239239 } TrackExtents;
240240
241241 //-----------------------------------------------------------------------------
242242 typedef struct // for opSetAudioInfo service
243 {
243 {
244244 long struct_size; // sizeof(AudioInfo)
245245 long level; // MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro)
246246 long layer; // and layer (1, 2 or 3)
255255 typedef struct // for coming QCD version
256256 {
257257 long struct_size; // sizeof(EQInfo)
258 char enabled;
258 char enabled;
259259 char preamp; // -128 to 127, 0 is even
260260 char bands[10]; // -128 to 127, 0 is even
261261 } EQInfo;
272272
273273 //-----------------------------------------------------------------------------
274274 typedef enum // for MediaInfo.mediaType
275 {
275 {
276276 UNKNOWN_MEDIA = 0,
277277 CD_AUDIO_MEDIA = 1,
278278 DIGITAL_FILE_MEDIA = 2,
11 //
22 // File: QCDModInput.h
33 //
4 // About: Input plugin module interface. This file is published with the
4 // About: Input plugin module interface. This file is published with the
55 // Input plugin SDK.
66 //
77 // Authors: Written by Paul Quinn and Richard Carlson.
1212 //
1313 // Copyright (C) 1997-2002 Quinnware
1414 //
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
1616 // here.
1717 //
1818 // This program is distributed in the hope that it will be useful,
4545 #define PLAYFLAG_SEEKING 0x2
4646
4747 // 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
4949 // and not to output plugin
5050 // pause flags
5151 #define PAUSE_DISABLED 0 // Pause() call is to unpause playback
5454 //-----------------------------------------------------------------------------
5555 // Input Module
5656 //-----------------------------------------------------------------------------
57 typedef struct
57 typedef struct
5858 {
5959 unsigned int size; // size of init structure
6060 unsigned int version; // plugin structure version (set to PLUGIN_API_VERSION)
7373
7474 // output plugin calls
7575 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
7878 // block until unpaused)
7979 int (*OutputDrain)(int flags); // wait for all output to complete (blocking)
8080 int (*OutputDrainCancel)(int flags); // break a drain in progress
8888 void *Reserved[10];
8989 } toPlayer;
9090
91 struct
91 struct
9292 {
9393 int (*Initialize)(QCDModInfo *modInfo, int flags); // initialize plugin
9494 void (*ShutDown)(int flags); // shutdown plugin
2121 #define IDC_MAIL3 1054
2222
2323 // Next default values for new objects
24 //
24 //
2525 #ifdef APSTUDIO_INVOKED
2626 #ifndef APSTUDIO_READONLY_SYMBOLS
2727 #define _APS_NEXT_RESOURCE_VALUE 109
00 //-----------------------------------------------------------------------------
1 //
1 //
22 // File: QCDInputDLL.h
33 //
44 // About: QCD Player Input module DLL interface. For more documentation, see
1010 //
1111 // Copyright (C) 1997-2002 Quinnware
1212 //
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
1414 // here.
1515 //
1616 // This program is distributed in the hope that it will be useful,
1212 //
1313 // Copyright (C) 1997-2002 Quinnware
1414 //
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
1616 // here.
1717 //
1818 // This program is distributed in the hope that it will be useful,
3636 // Current plugin version
3737
3838 // 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
4040
4141 // use this version for new style API calls (all returned text in UTF8 encoding on WinNT/2K/XP (native encoding on Win9x))
4242 #define PLUGIN_API_VERSION_WANTUTF8 ((PLUGIN_API_WANTUTF8<<16)|PLUGIN_API_VERSION)
4444
4545 //-----------------------------------------------------------------------------
4646
47 typedef struct
47 typedef struct
4848 {
4949 char *moduleString;
5050 char *moduleExtensions;
5353 //-----------------------------------------------------------------------------
5454 // Services (ops) provided by the Player
5555 //-----------------------------------------------------------------------------
56 typedef enum
56 typedef enum
5757 { //*** below returns numeric info (*buffer not used)
5858
5959 opGetPlayerVersion = 0, // high-order word = major version (eg 3.01 is 3), low-order word = minor (eg 3.01 = 1)
7171 opGetTrackLength = 14, // get track length, param1 = index of track in playlist, -1 for current
7272 // param2 = 0 for seconds, 1 for milliseconds
7373 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
7575 opGetTrackState = 16, // get whether track is marked, param1 = index of track, -1 for current
7676 opGetPlaylistNum = 17, // get playlist number of index, param1 = index of track in playlist, -1 for current
7777 opGetMediaType = 18, // get media type of track, param1 = index if track in playlist, -1 for current
9696
9797 opGetExtensionWnd = 30, // handle to the draggable window extension (only available on some skins), param1 = extension number (0 - 9)
9898 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
107107
108108 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
110110
111111 opShowVideoWindow = 55, // Show or Close video window (param1 = 1 for create, 2 for create and show, 0 for close)
112112
142142 opGetSkinFolder = 112, // get current skin folder
143143 opGetCDDBCacheFolder = 113, // get current folder for CDDB cached info
144144
145 opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded
145 opGetCurrentPlaylist = 114, // get full pathname of playlist currently loaded
146146
147147 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
149149
150150 opGetSupportedExtensions = 116, // get file extensions supported by the player, param2 = 0 - get all extensions, 1 - get registered extensions
151151 // - returned extensions will be colon delimited
195195 opSetPlayNext = 1009, // set the next index to be played (buffer = NULL, param1 = index, index = -1 unsets playnext)
196196 opSetIndexFilename = 1010, // updates the filename (or stream) that an index in the current playlist refers to, buffer = new filename, param1 = index
197197
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
199199 // 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)
201201 // param2 = 1 - clear playlist flag, 2 - enqueue to top
202202
203 opInsertPlaylist = 1011, // insert tracks into playlist
203 opInsertPlaylist = 1011, // insert tracks into playlist
204204 // 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)
206206 // param2 = index location to insert tracks (-1 to insert at end)
207207
208208 opMovePlaylistTrack = 1012, // param1 = index of track to move, param2 = destination index (move shifts tracks between param1 and param2)
266266 UINT nch; // number of channels
267267 UINT srate; // sample rate
268268
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)
270270 // (set to WAVE_VIS_DATA_ONLY to not have data sent to output plugins)
271271 UINT markerend; // Marker position at end of data (not currently used, set to 0)
272272 } WriteDataStruct;
275275 typedef struct // for GetTrackExtents Input Plugin callback
276276 {
277277 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
279279 // of the file, set to start position. Otherwise set to 0.
280280 UINT end; // set to end position of media.
281281 UINT unitpersec; // whatever units are being used for this media, how many
282 // of them per second.
282 // of them per second.
283283 // (Note: ((end - start) / unitpersecond) = file length
284284 UINT bytesize; // size of file in bytes (if applicable, otherwise 0).
285285 } TrackExtents;
286286
287287 //-----------------------------------------------------------------------------
288288 typedef struct // for opSetAudioInfo service
289 {
289 {
290290 long struct_size; // sizeof(AudioInfo)
291291 long level; // MPEG level (1 for MPEG1, 2 for MPEG2, 3 for MPEG2.5, 7 for MPEGpro)
292292 long layer; // and layer (1, 2 or 3)
302302 typedef struct // for coming QCD version
303303 {
304304 long struct_size; // sizeof(EQInfo)
305 char enabled;
305 char enabled;
306306 char preamp; // -128 to 127, 0 is even
307307 char bands[10]; // -128 to 127, 0 is even
308308 } EQInfo;
319319
320320 //-----------------------------------------------------------------------------
321321 typedef enum // for MediaInfo.mediaType
322 {
322 {
323323 UNKNOWN_MEDIA = 0,
324324 CD_AUDIO_MEDIA = 1,
325325 DIGITAL_FILE_MEDIA = 2,
11 //
22 // File: QCDModInput.h
33 //
4 // About: Input plugin module interface. This file is published with the
4 // About: Input plugin module interface. This file is published with the
55 // Input plugin SDK.
66 //
77 // Authors: Written by Paul Quinn and Richard Carlson.
1212 //
1313 // Copyright (C) 1997-2002 Quinnware
1414 //
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
1616 // here.
1717 //
1818 // This program is distributed in the hope that it will be useful,
4545 #define PLAYFLAG_SEEKING 0x2
4646
4747 // 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
4949 // and not to output plugin
5050 // pause flags
5151 #define PAUSE_DISABLED 0 // Pause() call is to unpause playback
5454 //-----------------------------------------------------------------------------
5555 // Input Module
5656 //-----------------------------------------------------------------------------
57 typedef struct
57 typedef struct
5858 {
5959 unsigned int size; // size of init structure
6060 unsigned int version; // plugin structure version (set to PLUGIN_API_VERSION)
7373
7474 // output plugin calls
7575 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
7878 // block until unpaused)
7979 int (*OutputDrain)(int flags); // wait for all output to complete (blocking)
8080 int (*OutputDrainCancel)(int flags); // break a drain in progress
8888 void *Reserved[10];
8989 } toPlayer;
9090
91 struct
91 struct
9292 {
9393 int (*Initialize)(QCDModInfo *modInfo, int flags); // initialize plugin
9494 void (*ShutDown)(int flags); // shutdown plugin
11 //
22 // File: QCDModTagEditor
33 //
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
55 // QCD plugin SDK.
66 //
77 // Authors: Written by Paul Quinn
1212 //
1313 // Copyright (C) 2002 Quinnware
1414 //
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
1616 // here.
1717 //
1818 // This program is distributed in the hope that it will be useful,
3636
3737 TAGFIELD_TITLE = 0,
3838 TAGFIELD_ARTIST,
39 TAGFIELD_ALBUM,
39 TAGFIELD_ALBUM,
4040 TAGFIELD_GENRE,
41 TAGFIELD_YEAR,
42 TAGFIELD_TRACK,
41 TAGFIELD_YEAR,
42 TAGFIELD_TRACK,
4343 TAGFIELD_COMMENT,
4444
4545 TAGFIELD_COMPOSER,
4848 TAGFIELD_YEARCOMPOSED,
4949
5050 TAGFIELD_ORIGARTIST,
51 TAGFIELD_LABEL,
51 TAGFIELD_LABEL,
5252 TAGFIELD_COPYRIGHT,
5353 TAGFIELD_ENCODER,
5454 TAGFIELD_CDDBTAGID,
5858
5959 //-----------------------------------------------------------------------------
6060
61 typedef struct
61 typedef struct
6262 {
6363 UINT size; // size of init structure
6464 UINT version; // plugin structure version (set to PLUGIN_API_VERSION)
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
543543
544544 //----------------------------------------------------------------------------
545545
546 void ShutDown(int flags)
546 void ShutDown(int flags)
547547 {
548548 Stop(mp4state.filename, STOPFLAG_FORCESTOP);
549549 }
14421442 return tagsize;
14431443 }
14441444
1445 int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo)
1445 int GetMediaSupported(const char* medianame, MediaInfo *mediaInfo)
14461446 {
14471447 int tagsize = 0, init;
14481448
24502450 }
24512451 }
24522452 }
2453
2453
24542454 Sleep(10);
24552455
24562456 // catch pause
27092709 if (frameInfo.channels > 0 && mp4state.samplerate > 0)
27102710 mp4state.cur_pos_sec += ((double)(frameInfo.samples/frameInfo.channels))/(double)mp4state.samplerate;
27112711 }
2712
2712
27132713 Sleep(10);
27142714
27152715 // catch pause
27472747 module.QCDCallbacks.toModule.Pause = Pause;
27482748 module.QCDCallbacks.toModule.Stop = Stop;
27492749 module.QCDCallbacks.toModule.About = About;
2750 module.QCDCallbacks.toModule.Configure = Configure;
2750 module.QCDCallbacks.toModule.Configure = Configure;
27512751 module.QCDCallbacks.toModule.SetEQ = NULL;
27522752 module.QCDCallbacks.toModule.SetVolume = SetVolume;
27532753
29632963 // free(temp);
29642964 //
29652965 // return ret;
2966 //}
2966 //}
29672967 //
29682968 //__declspec(dllexport) int winampWriteExtendedFileInfo()
29692969 //{
303303 //------------------------------------------------------------------------------
304304
305305 PLUGIN_API QCDModInitTag* TAGEDITORDLL_ENTRY_POINT()
306 {
306 {
307307 ModInitTag.size = sizeof(QCDModInitTag);
308308 ModInitTag.version = PLUGIN_API_VERSION;
309309 ModInitTag.ShutDown = ShutDown_Tag;
606606 file = MP4Modify(filename, 0, 0);
607607 if (file == MP4_INVALID_FILE_HANDLE)
608608 return false;
609
609
610610 MP4MetadataDelete(file);
611611
612612 MP4Close(file);
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
8888
8989 static u_int8_t firstHeader[ADTS_HEADER_MAX_SIZE];
9090
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
9393 */
9494 static bool LoadNextAdtsHeader(FILE* inFile, u_int8_t* hdr)
9595 {
135135 hdr[state] = b;
136136 state = 1;
137137 } else {
138 /* else drop it */
138 /* else drop it */
139139 dropped++;
140140 }
141141 }
159159 if (!LoadNextAdtsHeader(inFile, hdrBuf)) {
160160 return false;
161161 }
162
162
163163 /* get frame size from header */
164164 frameSize = MP4AV_AdtsGetFrameSize(hdrBuf);
165165
166166 /* get header size in bits and bytes from header */
167167 hdrBitSize = MP4AV_AdtsGetHeaderBitSize(hdrBuf);
168168 hdrByteSize = MP4AV_AdtsGetHeaderByteSize(hdrBuf);
169
169
170170 /* adjust the frame size to what remains to be read */
171171 frameSize -= hdrByteSize;
172172
218218
219219 /* remember where we are */
220220 fgetpos(inFile, &curPos);
221
221
222222 /* go back to start of file */
223223 rewind(inFile);
224224
272272 }
273273
274274 // add the new audio track
275 MP4TrackId trackId =
276 MP4AddAudioTrack(mp4File,
275 MP4TrackId trackId =
276 MP4AddAudioTrack(mp4File,
277277 samplesPerSecond, 1024, audioType);
278278
279279 if (trackId == MP4_INVALID_TRACK_ID) {
294294 samplesPerSecond,
295295 channelConfig);
296296
297 if (!MP4SetTrackESConfiguration(mp4File, trackId,
297 if (!MP4SetTrackESConfiguration(mp4File, trackId,
298298 pConfig, configLength)) {
299299 MP4DeleteTrack(mp4File, trackId);
300300 return MP4_INVALID_TRACK_ID;
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
22 * License Version 1.1 (the "License"); you may not use this file
33 * except in compliance with the License. You may obtain a copy of
44 * the License at http://www.mozilla.org/MPL/
5 *
5 *
66 * Software distributed under the License is distributed on an "AS
77 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
88 * implied. See the License for the specific language governing
99 * rights and limitations under the License.
10 *
10 *
1111 * The Original Code is MPEG4IP.
12 *
12 *
1313 * The Initial Developer of the Original Code is Cisco Systems Inc.
1414 * Portions created by Cisco Systems Inc. are
1515 * Copyright (C) Cisco Systems Inc. 2001-2002. All Rights Reserved.
16 *
17 * Contributor(s):
16 *
17 * Contributor(s):
1818 * Dave Mackie dmackie@cisco.com
1919 */
2020
2121 #ifndef __MBS_INCLUDED__
22 #define __MBS_INCLUDED__
22 #define __MBS_INCLUDED__
2323
2424 class CMemoryBitstream {
2525 public:
7676 u_int32_t m_numBits;
7777 };
7878
79 #endif /* __MBS_INCLUDED__ */
79 #endif /* __MBS_INCLUDED__ */
8080
5555 #define IDC_TITLEFORMAT 1040
5656
5757 // Next default values for new objects
58 //
58 //
5959 #ifdef APSTUDIO_INVOKED
6060 #ifndef APSTUDIO_READONLY_SYMBOLS
6161 #define _APS_NEXT_RESOURCE_VALUE 103
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
00 /*
11 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
22 ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com
3 **
3 **
44 ** This program is free software; you can redistribute it and/or modify
55 ** it under the terms of the GNU General Public License as published by
66 ** the Free Software Foundation; either version 2 of the License, or
77 ** (at your option) any later version.
8 **
8 **
99 ** This program is distributed in the hope that it will be useful,
1010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
1111 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1212 ** GNU General Public License for more details.
13 **
13 **
1414 ** 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
1616 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1717 **
1818 ** Any non-GPL usage of this software or parts of this software is strictly
44 <Configuration>Debug</Configuration>
55 <Platform>Win32</Platform>
66 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|x64">
8 <Configuration>Debug</Configuration>
9 <Platform>x64</Platform>
10 </ProjectConfiguration>
711 <ProjectConfiguration Include="Release|Win32">
812 <Configuration>Release</Configuration>
913 <Platform>Win32</Platform>
1014 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|x64">
16 <Configuration>Release</Configuration>
17 <Platform>x64</Platform>
18 </ProjectConfiguration>
1119 </ItemGroup>
1220 <PropertyGroup Label="Globals">
1321 <ProjectGuid>{2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}</ProjectGuid>
14 <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
22 <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1523 </PropertyGroup>
1624 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1725 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
1826 <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>
2032 </PropertyGroup>
2133 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2234 <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>
2440 </PropertyGroup>
2541 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
2642 <ImportGroup Label="ExtensionSettings">
2844 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
2945 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
3046 </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>
3150 <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">
3254 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
3355 </ImportGroup>
3456 <PropertyGroup Label="UserMacros" />
4365 <CodeAnalysisRules />
4466 <CodeAnalysisRuleAssemblies />
4567 </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>
4676 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
4777 <OutDir>.\bin\$(Configuration)\</OutDir>
4878 <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
5181 <CodeAnalysisRules />
5282 <CodeAnalysisRuleAssemblies />
5383 </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>
5492 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
5593 <Midl>
5694 <TypeLibraryName>.\Debug/faad.tlb</TypeLibraryName>
5795 </Midl>
5896 <ClCompile>
5997 <Optimization>Disabled</Optimization>
60 <AdditionalIncludeDirectories>../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
98 <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
6199 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
62100 <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
63101 <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
74112 <SubSystem>Console</SubSystem>
75113 </Link>
76114 </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>
77139 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
78140 <Midl>
79141 <TypeLibraryName>.\Release/faad.tlb</TypeLibraryName>
83145 <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
84146 <IntrinsicFunctions>true</IntrinsicFunctions>
85147 <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
86 <AdditionalIncludeDirectories>../../include;../../common/mp4ff;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
148 <AdditionalIncludeDirectories>../../include;../../frontend;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
87149 <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
88150 <StringPooling>true</StringPooling>
89151 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
99161 <SubSystem>Console</SubSystem>
100162 </Link>
101163 </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>
102190 <ItemGroup>
103191 <ClCompile Include="..\..\frontend\audio.c" />
104192 <ClCompile Include="..\..\frontend\main.c" />
107195 </ItemGroup>
108196 <ItemGroup>
109197 <ClInclude Include="..\..\frontend\getopt.h" />
110 <ClInclude Include="..\..\common\mp4v2\win32_ver.h" />
111198 <ClInclude Include="..\..\frontend\mp4read.h" />
112199 <ClInclude Include="..\..\frontend\unicode_support.h" />
113200 <ClInclude Include="..\..\include\neaacdec.h" />
3333 <ClInclude Include="..\..\include\neaacdec.h">
3434 <Filter>Header Files</Filter>
3535 </ClInclude>
36 <ClInclude Include="..\..\common\mp4v2\win32_ver.h">
37 <Filter>Header Files</Filter>
38 </ClInclude>
3936 <ClInclude Include="..\..\frontend\mp4read.h">
4037 <Filter>Header Files</Filter>
4138 </ClInclude>
00 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
33 MinimumVisualStudioVersion = 10.0.40219.1
44 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libfaad", "libfaad.vcxproj", "{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}"
55 EndProject
1010 Global
1111 GlobalSection(SolutionConfigurationPlatforms) = preSolution
1212 Debug|Win32 = Debug|Win32
13 Debug|x64 = Debug|x64
1314 Release|Win32 = Release|Win32
15 Release|x64 = Release|x64
1416 EndGlobalSection
1517 GlobalSection(ProjectConfigurationPlatforms) = postSolution
1618 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Debug|Win32.ActiveCfg = Debug|Win32
1719 {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
1822 {BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}.Release|Win32.ActiveCfg = Release|Win32
1923 {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
2026 {482DA264-EE88-4575-B208-87C4CB80CD08}.Debug|Win32.ActiveCfg = Debug|Win32
2127 {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
2230 {482DA264-EE88-4575-B208-87C4CB80CD08}.Release|Win32.ActiveCfg = Release|Win32
2331 {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
2434 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Debug|Win32.ActiveCfg = Debug|Win32
2535 {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
2638 {2BD8CBB3-DFC9-4A6A-9B7A-07ED749BED58}.Release|Win32.ActiveCfg = Release|Win32
2739 {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
2842 EndGlobalSection
2943 GlobalSection(SolutionProperties) = preSolution
3044 HideSolutionNode = FALSE
44 <Configuration>Debug</Configuration>
55 <Platform>Win32</Platform>
66 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|x64">
8 <Configuration>Debug</Configuration>
9 <Platform>x64</Platform>
10 </ProjectConfiguration>
711 <ProjectConfiguration Include="Release|Win32">
812 <Configuration>Release</Configuration>
913 <Platform>Win32</Platform>
1014 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|x64">
16 <Configuration>Release</Configuration>
17 <Platform>x64</Platform>
18 </ProjectConfiguration>
1119 </ItemGroup>
1220 <PropertyGroup Label="Globals">
1321 <ProjectGuid>{BC3EFE27-9015-4C9C-AD3C-72B3B7ED2114}</ProjectGuid>
14 <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
22 <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1523 </PropertyGroup>
1624 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1725 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
1826 <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>
2032 </PropertyGroup>
2133 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2234 <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>
2440 </PropertyGroup>
2541 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
2642 <ImportGroup Label="ExtensionSettings">
2844 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
2945 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
3046 </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>
3150 <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">
3254 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
3355 </ImportGroup>
3456 <PropertyGroup Label="UserMacros" />
4264 <CodeAnalysisRules />
4365 <CodeAnalysisRuleAssemblies />
4466 </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>
4574 <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'">
4682 <OutDir>.\bin\$(Configuration)\</OutDir>
4783 <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
4884 <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
73109 <Message>Retrieving package version...</Message>
74110 </PreBuildEvent>
75111 </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" &gt; "$(SolutionDir)..\..\libfaad\win32_ver.h"</Command>
132 </PreBuildEvent>
133 <PreBuildEvent>
134 <Message>Retrieving package version...</Message>
135 </PreBuildEvent>
136 </ItemDefinitionGroup>
76137 <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
77138 <ClCompile>
78139 <Optimization>Disabled</Optimization>
83144 <PrecompiledHeader />
84145 <WarningLevel>Level3</WarningLevel>
85146 <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" &gt; "$(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>
86171 </ClCompile>
87172 <ResourceCompile>
88173 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
44 <Configuration>Debug</Configuration>
55 <Platform>Win32</Platform>
66 </ProjectConfiguration>
7 <ProjectConfiguration Include="Debug|x64">
8 <Configuration>Debug</Configuration>
9 <Platform>x64</Platform>
10 </ProjectConfiguration>
711 <ProjectConfiguration Include="Release|Win32">
812 <Configuration>Release</Configuration>
913 <Platform>Win32</Platform>
1014 </ProjectConfiguration>
15 <ProjectConfiguration Include="Release|x64">
16 <Configuration>Release</Configuration>
17 <Platform>x64</Platform>
18 </ProjectConfiguration>
1119 </ItemGroup>
1220 <PropertyGroup Label="Globals">
1321 <ProjectGuid>{482DA264-EE88-4575-B208-87C4CB80CD08}</ProjectGuid>
14 <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
22 <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1523 </PropertyGroup>
1624 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1725 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
1826 <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>
2032 </PropertyGroup>
2133 <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2234 <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>
2440 </PropertyGroup>
2541 <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
2642 <ImportGroup Label="ExtensionSettings">
2844 <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
2945 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
3046 </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>
3150 <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">
3254 <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
3355 </ImportGroup>
3456 <PropertyGroup Label="UserMacros" />
4365 <CodeAnalysisRules />
4466 <CodeAnalysisRuleAssemblies />
4567 </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>
4676 <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'">
4785 <OutDir>.\bin\$(Configuration)\</OutDir>
4886 <IntDir>.\intermediate\$(Configuration)\$(ProjectName)\</IntDir>
4987 <LinkIncremental>false</LinkIncremental>
69107 <WarningLevel>Level3</WarningLevel>
70108 <SuppressStartupBanner>true</SuppressStartupBanner>
71109 <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" &gt; "$(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>
72142 </ClCompile>
73143 <ResourceCompile>
74144 <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
100170 <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
101171 <FunctionLevelLinking>true</FunctionLevelLinking>
102172 <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" &gt; "$(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>
103206 <WarningLevel>Level3</WarningLevel>
104207 <SuppressStartupBanner>true</SuppressStartupBanner>
105208 <AdditionalIncludeDirectories>../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
00 /*
11 ** AC2VER - extract version number from AC_INIT macro (configure.ac)
22 ** Copyright (C) 2017 LoRd_MuldeR <mulder2@GMX.de>
3 **
3 **
44 ** This software is released under the CC0 1.0 Universal [CC0 1.0] licence!
55 ** https://creativecommons.org/publicdomain/zero/1.0/legalcode
66 **/