comparison libfaad2/bits.h @ 14729:b4378a6f87a6

Sync missing cosmetics from the 2004-07-12 CVS snapshot.
author diego
date Sat, 19 Feb 2005 01:21:19 +0000
parents d81145997036
children 0cf5722252f8
comparison
equal deleted inserted replaced
14728:e59f6e015975 14729:b4378a6f87a6
1 /* 1 /*
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR 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-2004 M. Bakker, Ahead Software 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.
9 ** 9 **
10 ** This program is distributed in the hope that it will be useful, 10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 **
317 typedef struct 317 typedef struct
318 { 318 {
319 /* bit input */ 319 /* bit input */
320 uint32_t bufa; 320 uint32_t bufa;
321 uint32_t bufb; 321 uint32_t bufb;
322 int8_t len; 322 int8_t len;
323 } bits_t; 323 } bits_t;
324 324
325 325
326 static INLINE uint32_t showbits_hcr(bits_t *ld, uint8_t bits) 326 static INLINE uint32_t showbits_hcr(bits_t *ld, uint8_t bits)
327 { 327 {
331 /* huffman_spectral_data_2 needs to read more than may be available, bits maybe 331 /* huffman_spectral_data_2 needs to read more than may be available, bits maybe
332 > ld->len, deliver 0 than */ 332 > ld->len, deliver 0 than */
333 if (ld->len >= bits) 333 if (ld->len >= bits)
334 return ((ld->bufa >> (ld->len - bits)) & (0xFFFFFFFF >> (32 - bits))); 334 return ((ld->bufa >> (ld->len - bits)) & (0xFFFFFFFF >> (32 - bits)));
335 else 335 else
336 return ((ld->bufa << (bits - ld->len)) & (0xFFFFFFFF >> (32 - bits))); 336 return ((ld->bufa << (bits - ld->len)) & (0xFFFFFFFF >> (32 - bits)));
337 } else { 337 } else {
338 if ((ld->len - bits) < 32) 338 if ((ld->len - bits) < 32)
339 { 339 {
340 return ( (ld->bufb & (0xFFFFFFFF >> (64 - ld->len))) << (bits - ld->len + 32)) | 340 return ( (ld->bufb & (0xFFFFFFFF >> (64 - ld->len))) << (bits - ld->len + 32)) |
341 (ld->bufa >> (ld->len - bits)); 341 (ld->bufa >> (ld->len - bits));