Mercurial > audlegacy-plugins
comparison src/aac/libfaad2/ps_syntax.c @ 681:1d8b08df98c3 trunk
[svn] - synchronise with FAAD 2.5
author | nenolod |
---|---|
date | Tue, 20 Feb 2007 04:37:37 -0800 |
parents | 3da1b8942b8b |
children | e6c5fdae6e88 |
comparison
equal
deleted
inserted
replaced
680:3a06665a810e | 681:1d8b08df98c3 |
---|---|
1 /* | 1 /* |
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR and PS decoding | 2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding |
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com | 3 ** Copyright (C) 2003-2005 M. Bakker, Nero AG, http://www.nero.com |
4 ** | 4 ** |
5 ** This program is free software; you can redistribute it and/or modify | 5 ** This program is free software; you can redistribute it and/or modify |
6 ** it under the terms of the GNU General Public License as published by | 6 ** it under the terms of the GNU General Public License as published by |
7 ** the Free Software Foundation; either version 2 of the License, or | 7 ** the Free Software Foundation; either version 2 of the License, or |
8 ** (at your option) any later version. | 8 ** (at your option) any later version. |
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 ** GNU General Public License for more details. | 13 ** GNU General Public License for more details. |
14 ** | 14 ** |
15 ** You should have received a copy of the GNU General Public License | 15 ** You should have received a copy of the GNU General Public License |
16 ** along with this program; if not, write to the Free Software | 16 ** along with this program; if not, write to the Free Software |
17 ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 ** | 18 ** |
19 ** Any non-GPL usage of this software or parts of this software is strictly | 19 ** Any non-GPL usage of this software or parts of this software is strictly |
20 ** forbidden. | 20 ** forbidden. |
21 ** | 21 ** |
22 ** Software using this code must display the following message visibly in or | |
23 ** on each copy of the software: | |
24 ** "FAAD2 AAC/HE-AAC/HE-AACv2/DRM decoder (c) Nero AG, www.nero.com" | |
25 ** in, for example, the about-box or help/startup screen. | |
26 ** | |
22 ** Commercial non-GPL licensing of this software is possible. | 27 ** Commercial non-GPL licensing of this software is possible. |
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com. | 28 ** For more info contact Nero AG through Mpeg4AAClicense@nero.com. |
24 ** | 29 ** |
25 ** $Id: ps_syntax.c,v 1.6 2004/09/04 14:56:28 menno Exp $ | 30 ** $Id: ps_syntax.c,v 1.9 2006/08/15 19:05:11 menno Exp $ |
26 **/ | 31 **/ |
27 | 32 |
28 #include "common.h" | 33 #include "common.h" |
29 | 34 |
30 #ifdef PS_DEC | 35 #ifdef PS_DEC |
306 static const int8_t t_huff_opd[][2] = { | 311 static const int8_t t_huff_opd[][2] = { |
307 { 1, /*0*/ -31 }, /* index 0: 1 bits: x */ | 312 { 1, /*0*/ -31 }, /* index 0: 1 bits: x */ |
308 { 2, 3 }, /* index 1: 2 bits: 0x */ | 313 { 2, 3 }, /* index 1: 2 bits: 0x */ |
309 { 4, 5 }, /* index 2: 3 bits: 00x */ | 314 { 4, 5 }, /* index 2: 3 bits: 00x */ |
310 { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */ | 315 { /*1*/ -30, /*7*/ -24 }, /* index 3: 3 bits: 01x */ |
311 { /*5*/ -26, 6 }, /* index 4: 4 bits: 000x */ | 316 { /*5*/ -26, /*2*/ -29 }, /* index 4: 4 bits: 000x */ |
312 { /*2*/ -29, /*6*/ -25 }, /* index 5: 4 bits: 001x */ | 317 { /*6*/ -25, 6 }, /* index 5: 4 bits: 001x */ |
313 { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0001x */ | 318 { /*4*/ -27, /*3*/ -28 } /* index 6: 5 bits: 0011x */ |
314 }; | 319 }; |
315 | 320 |
316 /* static function declarations */ | 321 /* static function declarations */ |
317 static uint16_t ps_extension(ps_info *ps, bitfile *ld, | 322 static uint16_t ps_extension(ps_info *ps, bitfile *ld, |
318 const uint8_t ps_extension_id, | 323 const uint8_t ps_extension_id, |
378 DEBUGVAR(1,1005,"ps_data(): enable_ext")); | 383 DEBUGVAR(1,1005,"ps_data(): enable_ext")); |
379 } | 384 } |
380 | 385 |
381 /* we are here, but no header has been read yet */ | 386 /* we are here, but no header has been read yet */ |
382 if (ps->header_read == 0) | 387 if (ps->header_read == 0) |
388 { | |
389 ps->ps_data_available = 0; | |
383 return 1; | 390 return 1; |
391 } | |
384 | 392 |
385 ps->frame_class = (uint8_t)faad_get1bit(ld | 393 ps->frame_class = (uint8_t)faad_get1bit(ld |
386 DEBUGVAR(1,1006,"ps_data(): frame_class")); | 394 DEBUGVAR(1,1006,"ps_data(): frame_class")); |
387 tmp = (uint8_t)faad_getbits(ld, 2 | 395 tmp = (uint8_t)faad_getbits(ld, 2 |
388 DEBUGVAR(1,1007,"ps_data(): num_env_idx")); | 396 DEBUGVAR(1,1007,"ps_data(): num_env_idx")); |
392 if (ps->frame_class) | 400 if (ps->frame_class) |
393 { | 401 { |
394 for (n = 1; n < ps->num_env+1; n++) | 402 for (n = 1; n < ps->num_env+1; n++) |
395 { | 403 { |
396 ps->border_position[n] = (uint8_t)faad_getbits(ld, 5 | 404 ps->border_position[n] = (uint8_t)faad_getbits(ld, 5 |
397 DEBUGVAR(1,1008,"ps_data(): border_position")); | 405 DEBUGVAR(1,1008,"ps_data(): border_position")) + 1; |
398 } | 406 } |
399 } | 407 } |
400 | 408 |
401 if (ps->enable_iid) | 409 if (ps->enable_iid) |
402 { | 410 { |