Mercurial > mplayer.hg
changeset 29264:e83eef58b30a
Remove all kind of trailing whitespaces from all MPlayer's files.
This affects all kind of spaces (' ',^I,^M,^L,...): actually
[:space:] regex character set.
line wrap: on
line diff
--- a/LICENSE Wed May 13 02:58:57 2009 +0000 +++ b/LICENSE Wed May 13 15:22:13 2009 +0000 @@ -55,7 +55,7 @@ The precise terms and conditions for copying, distribution and modification follow. - + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -110,7 +110,7 @@ License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) - + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in @@ -168,7 +168,7 @@ access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. - + 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is @@ -225,7 +225,7 @@ This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. - + 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License @@ -278,7 +278,7 @@ POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS - + How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest
--- a/liba52/bitstream.c Wed May 13 02:58:57 2009 +0000 +++ b/liba52/bitstream.c Wed May 13 15:22:13 2009 +0000 @@ -99,7 +99,7 @@ if (num_bits != 0) result = (result << num_bits) | (state->current_word >> (32 - num_bits)); - + state->bits_left = 32 - num_bits; return result;
--- a/liba52/bitstream.h Wed May 13 02:58:57 2009 +0000 +++ b/liba52/bitstream.h Wed May 13 15:22:13 2009 +0000 @@ -104,11 +104,11 @@ result<<= (indx&0x07); result>>= 32 - num_bits; indx+= num_bits; - + return result; #else uint32_t result; - + if (num_bits < state->bits_left) { result = (state->current_word << (32 - state->bits_left)) >> (32 - num_bits); state->bits_left -= num_bits; @@ -136,11 +136,11 @@ result<<= (indx&0x07); result>>= 32 - num_bits; indx+= num_bits; - + return result; #else int32_t result; - + if (num_bits < state->bits_left) { result = (((int32_t)state->current_word) << (32 - state->bits_left)) >> (32 - num_bits); state->bits_left -= num_bits;
--- a/liba52/crc.c Wed May 13 02:58:57 2009 +0000 +++ b/liba52/crc.c Wed May 13 15:22:13 2009 +0000 @@ -1,23 +1,23 @@ -/* +/* * crc.c * * Copyright (C) Aaron Holtzman - May 1999 * * This file is part of ac3dec, a free Dolby AC-3 stream decoder. - * + * * ac3dec is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. - * + * * ac3dec is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Make; see the file COPYING. If not, write to - * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * */ @@ -25,7 +25,7 @@ #include <stdio.h> #include <inttypes.h> -static const uint16_t crc_lut[256] = +static const uint16_t crc_lut[256] = { 0x0000,0x8005,0x800f,0x000a,0x801b,0x001e,0x0014,0x8011, 0x8033,0x0036,0x003c,0x8039,0x0028,0x802d,0x8027,0x0022,
--- a/liba52/downmix.c Wed May 13 02:58:57 2009 +0000 +++ b/liba52/downmix.c Wed May 13 15:22:13 2009 +0000 @@ -62,7 +62,7 @@ if(mm_accel & MM_ACCEL_X86_3DNOW) a52_downmix= downmix_3dnow; #endif } - + int a52_downmix_init (int input, int flags, sample_t * level, sample_t clev, sample_t slev) { @@ -695,10 +695,10 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps (%0, %%"REG_S"), %%xmm0 \n\t" - "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" - "addps (%1, %%"REG_S"), %%xmm0 \n\t" - "addps 16(%1, %%"REG_S"), %%xmm1\n\t" + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" + "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" + "addps (%1, %%"REG_S"), %%xmm0 \n\t" + "addps 16(%1, %%"REG_S"), %%xmm1\n\t" "addps %%xmm7, %%xmm0 \n\t" "addps %%xmm7, %%xmm1 \n\t" "movaps %%xmm0, (%1, %%"REG_S") \n\t" @@ -718,9 +718,9 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps (%0, %%"REG_S"), %%xmm0 \n\t" - "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" - "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" + "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" "addps %%xmm7, %%xmm1 \n\t" "addps %%xmm1, %%xmm0 \n\t" "movaps %%xmm0, (%0, %%"REG_S") \n\t" @@ -739,10 +739,10 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps (%0, %%"REG_S"), %%xmm0 \n\t" - "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" - "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" - "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" + "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" + "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" "addps %%xmm7, %%xmm0 \n\t" "addps %%xmm1, %%xmm0 \n\t" "movaps %%xmm0, (%0, %%"REG_S") \n\t" @@ -761,12 +761,12 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps (%0, %%"REG_S"), %%xmm0 \n\t" - "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" - "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" - "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" + "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" + "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" "addps %%xmm7, %%xmm0 \n\t" - "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" + "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" "addps %%xmm1, %%xmm0 \n\t" "movaps %%xmm0, (%0, %%"REG_S") \n\t" "add $16, %%"REG_S" \n\t" @@ -784,9 +784,9 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" "addps %%xmm7, %%xmm0 \n\t" //common - "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" "addps %%xmm0, %%xmm1 \n\t" "addps %%xmm0, %%xmm2 \n\t" @@ -807,9 +807,9 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps 1024(%1, %%"REG_S"), %%xmm0\n\t" + "movaps 1024(%1, %%"REG_S"), %%xmm0\n\t" "addps %%xmm7, %%xmm0 \n\t" //common - "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" "movaps (%1, %%"REG_S"), %%xmm2 \n\t" "addps %%xmm0, %%xmm1 \n\t" "addps %%xmm0, %%xmm2 \n\t" @@ -831,7 +831,7 @@ ASMALIGN(4) "1: \n\t" "movaps 2048(%0, %%"REG_S"), %%xmm0\n\t" // surround - "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" "movaps 1024(%0, %%"REG_S"), %%xmm2\n\t" "addps %%xmm7, %%xmm1 \n\t" "addps %%xmm7, %%xmm2 \n\t" @@ -854,10 +854,10 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" - "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" "addps %%xmm7, %%xmm0 \n\t" // common - "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" "addps %%xmm0, %%xmm1 \n\t" "addps %%xmm0, %%xmm2 \n\t" @@ -878,10 +878,10 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" "movaps 3072(%0, %%"REG_S"), %%xmm3\n\t" // surround "addps %%xmm7, %%xmm0 \n\t" // common - "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" "addps %%xmm0, %%xmm1 \n\t" "addps %%xmm0, %%xmm2 \n\t" @@ -904,9 +904,9 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps 2048(%0, %%"REG_S"), %%xmm0\n\t" + "movaps 2048(%0, %%"REG_S"), %%xmm0\n\t" "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" // surround - "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" "movaps 1024(%0, %%"REG_S"), %%xmm2\n\t" "addps %%xmm7, %%xmm1 \n\t" "addps %%xmm7, %%xmm2 \n\t" @@ -929,13 +929,13 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" "addps %%xmm7, %%xmm0 \n\t" // common "movaps %%xmm0, %%xmm1 \n\t" // common - "addps (%0, %%"REG_S"), %%xmm0 \n\t" - "addps 2048(%0, %%"REG_S"), %%xmm1\n\t" - "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" - "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" + "addps (%0, %%"REG_S"), %%xmm0 \n\t" + "addps 2048(%0, %%"REG_S"), %%xmm1\n\t" + "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" + "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" "movaps %%xmm0, (%0, %%"REG_S") \n\t" "movaps %%xmm1, 1024(%0, %%"REG_S")\n\t" "add $16, %%"REG_S" \n\t" @@ -953,16 +953,16 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" - "movaps 3072(%0, %%"REG_S"), %%xmm2\n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "movaps 3072(%0, %%"REG_S"), %%xmm2\n\t" "addps %%xmm7, %%xmm0 \n\t" // common - "addps 4096(%0, %%"REG_S"), %%xmm2\n\t" // surround - "movaps (%0, %%"REG_S"), %%xmm1 \n\t" - "movaps 2048(%0, %%"REG_S"), %%xmm3\n\t" - "subps %%xmm2, %%xmm1 \n\t" - "addps %%xmm2, %%xmm3 \n\t" - "addps %%xmm0, %%xmm1 \n\t" - "addps %%xmm0, %%xmm3 \n\t" + "addps 4096(%0, %%"REG_S"), %%xmm2\n\t" // surround + "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps 2048(%0, %%"REG_S"), %%xmm3\n\t" + "subps %%xmm2, %%xmm1 \n\t" + "addps %%xmm2, %%xmm3 \n\t" + "addps %%xmm0, %%xmm1 \n\t" + "addps %%xmm0, %%xmm3 \n\t" "movaps %%xmm1, (%0, %%"REG_S") \n\t" "movaps %%xmm3, 1024(%0, %%"REG_S")\n\t" "add $16, %%"REG_S" \n\t" @@ -980,8 +980,8 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movaps (%0, %%"REG_S"), %%xmm0 \n\t" - "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" + "movaps (%0, %%"REG_S"), %%xmm0 \n\t" + "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" "addps 1024(%0, %%"REG_S"), %%xmm0\n\t" "addps 1040(%0, %%"REG_S"), %%xmm1\n\t" "addps %%xmm7, %%xmm0 \n\t" @@ -1229,13 +1229,13 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq (%0, %%"REG_S"), %%mm0 \n\t" "movq 8(%0, %%"REG_S"), %%mm1 \n\t" - "movq 16(%0, %%"REG_S"), %%mm2 \n\t" + "movq 16(%0, %%"REG_S"), %%mm2 \n\t" "movq 24(%0, %%"REG_S"), %%mm3 \n\t" - "pfadd (%1, %%"REG_S"), %%mm0 \n\t" + "pfadd (%1, %%"REG_S"), %%mm0 \n\t" "pfadd 8(%1, %%"REG_S"), %%mm1 \n\t" - "pfadd 16(%1, %%"REG_S"), %%mm2 \n\t" + "pfadd 16(%1, %%"REG_S"), %%mm2 \n\t" "pfadd 24(%1, %%"REG_S"), %%mm3 \n\t" "pfadd %%mm7, %%mm0 \n\t" "pfadd %%mm7, %%mm1 \n\t" @@ -1260,11 +1260,11 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq (%0, %%"REG_S"), %%mm0 \n\t" "movq 8(%0, %%"REG_S"), %%mm1 \n\t" - "movq 1024(%0, %%"REG_S"), %%mm2\n\t" + "movq 1024(%0, %%"REG_S"), %%mm2\n\t" "movq 1032(%0, %%"REG_S"), %%mm3\n\t" - "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" "pfadd %%mm7, %%mm0 \n\t" "pfadd %%mm7, %%mm1 \n\t" @@ -1287,13 +1287,13 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq (%0, %%"REG_S"), %%mm0 \n\t" "movq 8(%0, %%"REG_S"), %%mm1 \n\t" - "movq 1024(%0, %%"REG_S"), %%mm2\n\t" + "movq 1024(%0, %%"REG_S"), %%mm2\n\t" "movq 1032(%0, %%"REG_S"), %%mm3\n\t" - "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" - "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" "pfadd 3080(%0, %%"REG_S"), %%mm3\n\t" "pfadd %%mm7, %%mm0 \n\t" "pfadd %%mm7, %%mm1 \n\t" @@ -1316,17 +1316,17 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq (%0, %%"REG_S"), %%mm0 \n\t" "movq 8(%0, %%"REG_S"), %%mm1 \n\t" - "movq 1024(%0, %%"REG_S"), %%mm2\n\t" + "movq 1024(%0, %%"REG_S"), %%mm2\n\t" "movq 1032(%0, %%"REG_S"), %%mm3\n\t" - "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" - "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" "pfadd 3080(%0, %%"REG_S"), %%mm3\n\t" "pfadd %%mm7, %%mm0 \n\t" "pfadd %%mm7, %%mm1 \n\t" - "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" "pfadd 4104(%0, %%"REG_S"), %%mm3\n\t" "pfadd %%mm2, %%mm0 \n\t" "pfadd %%mm3, %%mm1 \n\t" @@ -1347,11 +1347,11 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" "movq 1032(%0, %%"REG_S"), %%mm1\n\t" "pfadd %%mm7, %%mm0 \n\t" //common "pfadd %%mm7, %%mm1 \n\t" //common - "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq (%0, %%"REG_S"), %%mm2 \n\t" "movq 8(%0, %%"REG_S"), %%mm3 \n\t" "movq 2048(%0, %%"REG_S"), %%mm4\n\t" "movq 2056(%0, %%"REG_S"), %%mm5\n\t" @@ -1378,11 +1378,11 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq 1024(%1, %%"REG_S"), %%mm0\n\t" + "movq 1024(%1, %%"REG_S"), %%mm0\n\t" "movq 1032(%1, %%"REG_S"), %%mm1\n\t" "pfadd %%mm7, %%mm0 \n\t" //common "pfadd %%mm7, %%mm1 \n\t" //common - "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq (%0, %%"REG_S"), %%mm2 \n\t" "movq 8(%0, %%"REG_S"), %%mm3 \n\t" "movq (%1, %%"REG_S"), %%mm4 \n\t" "movq 8(%1, %%"REG_S"), %%mm5 \n\t" @@ -1411,7 +1411,7 @@ "1: \n\t" "movq 2048(%0, %%"REG_S"), %%mm0\n\t" // surround "movq 2056(%0, %%"REG_S"), %%mm1\n\t" // surround - "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq (%0, %%"REG_S"), %%mm2 \n\t" "movq 8(%0, %%"REG_S"), %%mm3 \n\t" "movq 1024(%0, %%"REG_S"), %%mm4\n\t" "movq 1032(%0, %%"REG_S"), %%mm5\n\t" @@ -1442,13 +1442,13 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" "movq 1032(%0, %%"REG_S"), %%mm1\n\t" - "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" "pfadd %%mm7, %%mm0 \n\t" // common "pfadd %%mm7, %%mm1 \n\t" // common - "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq (%0, %%"REG_S"), %%mm2 \n\t" "movq 8(%0, %%"REG_S"), %%mm3 \n\t" "movq 2048(%0, %%"REG_S"), %%mm4\n\t" "movq 2056(%0, %%"REG_S"), %%mm5\n\t" @@ -1475,11 +1475,11 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" "movq 1032(%0, %%"REG_S"), %%mm1\n\t" "pfadd %%mm7, %%mm0 \n\t" // common "pfadd %%mm7, %%mm1 \n\t" // common - "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq (%0, %%"REG_S"), %%mm2 \n\t" "movq 8(%0, %%"REG_S"), %%mm3 \n\t" "movq 2048(%0, %%"REG_S"), %%mm4\n\t" "movq 2056(%0, %%"REG_S"), %%mm5\n\t" @@ -1512,11 +1512,11 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq 2048(%0, %%"REG_S"), %%mm0\n\t" + "movq 2048(%0, %%"REG_S"), %%mm0\n\t" "movq 2056(%0, %%"REG_S"), %%mm1\n\t" "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" // surround "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" // surround - "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq (%0, %%"REG_S"), %%mm2 \n\t" "movq 8(%0, %%"REG_S"), %%mm3 \n\t" "movq 1024(%0, %%"REG_S"), %%mm4\n\t" "movq 1032(%0, %%"REG_S"), %%mm5\n\t" @@ -1547,19 +1547,19 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" "movq 1032(%0, %%"REG_S"), %%mm1\n\t" "pfadd %%mm7, %%mm0 \n\t" // common "pfadd %%mm7, %%mm1 \n\t" // common "movq %%mm0, %%mm2 \n\t" // common "movq %%mm1, %%mm3 \n\t" // common - "pfadd (%0, %%"REG_S"), %%mm0 \n\t" + "pfadd (%0, %%"REG_S"), %%mm0 \n\t" "pfadd 8(%0, %%"REG_S"), %%mm1 \n\t" - "pfadd 2048(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 2048(%0, %%"REG_S"), %%mm2\n\t" "pfadd 2056(%0, %%"REG_S"), %%mm3\n\t" - "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" - "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" "pfadd 4104(%0, %%"REG_S"), %%mm3\n\t" "movq %%mm0, (%0, %%"REG_S") \n\t" "movq %%mm1, 8(%0, %%"REG_S") \n\t" @@ -1581,25 +1581,25 @@ "1: \n\t" "movd %1, %%mm7 \n\t" "punpckldq %1, %%mm7 \n\t" - "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1024(%0, %%"REG_S"), %%mm0\n\t" "movq 1032(%0, %%"REG_S"), %%mm1\n\t" - "movq 3072(%0, %%"REG_S"), %%mm4\n\t" + "movq 3072(%0, %%"REG_S"), %%mm4\n\t" "movq 3080(%0, %%"REG_S"), %%mm5\n\t" "pfadd %%mm7, %%mm0 \n\t" // common "pfadd %%mm7, %%mm1 \n\t" // common - "pfadd 4096(%0, %%"REG_S"), %%mm4\n\t" // surround + "pfadd 4096(%0, %%"REG_S"), %%mm4\n\t" // surround "pfadd 4104(%0, %%"REG_S"), %%mm5\n\t" // surround - "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq (%0, %%"REG_S"), %%mm2 \n\t" "movq 8(%0, %%"REG_S"), %%mm3 \n\t" - "movq 2048(%0, %%"REG_S"), %%mm6\n\t" + "movq 2048(%0, %%"REG_S"), %%mm6\n\t" "movq 2056(%0, %%"REG_S"), %%mm7\n\t" - "pfsub %%mm4, %%mm2 \n\t" + "pfsub %%mm4, %%mm2 \n\t" "pfsub %%mm5, %%mm3 \n\t" - "pfadd %%mm4, %%mm6 \n\t" + "pfadd %%mm4, %%mm6 \n\t" "pfadd %%mm5, %%mm7 \n\t" - "pfadd %%mm0, %%mm2 \n\t" + "pfadd %%mm0, %%mm2 \n\t" "pfadd %%mm1, %%mm3 \n\t" - "pfadd %%mm0, %%mm6 \n\t" + "pfadd %%mm0, %%mm6 \n\t" "pfadd %%mm1, %%mm7 \n\t" "movq %%mm2, (%0, %%"REG_S") \n\t" "movq %%mm3, 8(%0, %%"REG_S") \n\t" @@ -1620,9 +1620,9 @@ "mov $-1024, %%"REG_S" \n\t" ASMALIGN(4) "1: \n\t" - "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq (%0, %%"REG_S"), %%mm0 \n\t" "movq 8(%0, %%"REG_S"), %%mm1 \n\t" - "movq 16(%0, %%"REG_S"), %%mm2 \n\t" + "movq 16(%0, %%"REG_S"), %%mm2 \n\t" "movq 24(%0, %%"REG_S"), %%mm3 \n\t" "pfadd 1024(%0, %%"REG_S"), %%mm0\n\t" "pfadd 1032(%0, %%"REG_S"), %%mm1\n\t"
--- a/liba52/imdct.c Wed May 13 02:58:57 2009 +0000 +++ b/liba52/imdct.c Wed May 13 15:22:13 2009 +0000 @@ -72,24 +72,24 @@ 5, 21, 37, 53, 69, 85, 101, 117, 13, 29, 45, 61, 77, 93, 109, 125, 3, 19, 35, 51, 67, 83, 99, 115, 11, 43, 75, 107, 27, 59, 91, 123, 7, 23, 39, 55, 71, 87, 103, 119, 15, 31, 47, 63, 79, 95, 111, 127 -}; +}; static uint8_t attribute_used bit_reverse_512[] = { - 0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70, - 0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78, - 0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74, - 0x0c, 0x4c, 0x2c, 0x6c, 0x1c, 0x5c, 0x3c, 0x7c, - 0x02, 0x42, 0x22, 0x62, 0x12, 0x52, 0x32, 0x72, - 0x0a, 0x4a, 0x2a, 0x6a, 0x1a, 0x5a, 0x3a, 0x7a, - 0x06, 0x46, 0x26, 0x66, 0x16, 0x56, 0x36, 0x76, - 0x0e, 0x4e, 0x2e, 0x6e, 0x1e, 0x5e, 0x3e, 0x7e, - 0x01, 0x41, 0x21, 0x61, 0x11, 0x51, 0x31, 0x71, - 0x09, 0x49, 0x29, 0x69, 0x19, 0x59, 0x39, 0x79, - 0x05, 0x45, 0x25, 0x65, 0x15, 0x55, 0x35, 0x75, - 0x0d, 0x4d, 0x2d, 0x6d, 0x1d, 0x5d, 0x3d, 0x7d, - 0x03, 0x43, 0x23, 0x63, 0x13, 0x53, 0x33, 0x73, - 0x0b, 0x4b, 0x2b, 0x6b, 0x1b, 0x5b, 0x3b, 0x7b, - 0x07, 0x47, 0x27, 0x67, 0x17, 0x57, 0x37, 0x77, + 0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70, + 0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78, + 0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74, + 0x0c, 0x4c, 0x2c, 0x6c, 0x1c, 0x5c, 0x3c, 0x7c, + 0x02, 0x42, 0x22, 0x62, 0x12, 0x52, 0x32, 0x72, + 0x0a, 0x4a, 0x2a, 0x6a, 0x1a, 0x5a, 0x3a, 0x7a, + 0x06, 0x46, 0x26, 0x66, 0x16, 0x56, 0x36, 0x76, + 0x0e, 0x4e, 0x2e, 0x6e, 0x1e, 0x5e, 0x3e, 0x7e, + 0x01, 0x41, 0x21, 0x61, 0x11, 0x51, 0x31, 0x71, + 0x09, 0x49, 0x29, 0x69, 0x19, 0x59, 0x39, 0x79, + 0x05, 0x45, 0x25, 0x65, 0x15, 0x55, 0x35, 0x75, + 0x0d, 0x4d, 0x2d, 0x6d, 0x1d, 0x5d, 0x3d, 0x7d, + 0x03, 0x43, 0x23, 0x63, 0x13, 0x53, 0x33, 0x73, + 0x0b, 0x4b, 0x2b, 0x6b, 0x1b, 0x5b, 0x3b, 0x7b, + 0x07, 0x47, 0x27, 0x67, 0x17, 0x57, 0x37, 0x77, 0x0f, 0x4f, 0x2f, 0x6f, 0x1f, 0x5f, 0x3f, 0x7f}; static uint8_t fftorder[] = { @@ -120,8 +120,8 @@ static sample_t __attribute__((aligned(16))) xsin1[128]; #if ARCH_X86 || ARCH_X86_64 -// NOTE: SSE needs 16byte alignment or it will segfault -// +// NOTE: SSE needs 16byte alignment or it will segfault +// static float __attribute__((aligned(16))) sseSinCos1c[256]; static float __attribute__((aligned(16))) sseSinCos1d[256]; static float attribute_used __attribute__((aligned(16))) ps111_1[4]={1,1,1,-1}; @@ -328,7 +328,7 @@ sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2; const sample_t * window = a52_imdct_window; complex_t buf[128]; - + for (i = 0; i < 128; i++) { k = fftorder[i]; t_r = pre1[i].real; @@ -417,17 +417,17 @@ sample_t *data_ptr; sample_t *delay_ptr; sample_t *window_ptr; - + /* 512 IMDCT with source and dest data in 'data' */ - + /* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/ for( i=0; i < 128; i++) { - /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */ + /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */ int j= bit_reverse_512[i]; buf[i].real = (data[256-2*j-1] * xcos1[j]) - (data[2*j] * xsin1[j]); buf[i].imag = -1.0 * ((data[2*j] * xcos1[j]) + (data[256-2*j-1] * xsin1[j])); } - + /* 1. iteration */ for(i = 0; i < 128; i += 2) { #if 0 @@ -440,7 +440,7 @@ buf[i+1].real = tmp_a_r - tmp_b_r; buf[i+1].imag = tmp_a_i - tmp_b_i; #else - vector float temp, bufv; + vector float temp, bufv; bufv = vec_ld(i << 3, (float*)buf); temp = vec_perm(bufv, bufv, vcprm(2,3,0,1)); @@ -448,7 +448,7 @@ vec_st(bufv, i << 3, (float*)buf); #endif } - + /* 2. iteration */ // Note w[1]={{1,0}, {0,-1}} for(i = 0; i < 128; i += 4) { @@ -472,7 +472,7 @@ buf[i+3].imag = tmp_a_i + tmp_b_i; #else vector float buf01, buf23, temp1, temp2; - + buf01 = vec_ld((i + 0) << 3, (float*)buf); buf23 = vec_ld((i + 2) << 3, (float*)buf); buf23 = vec_perm(buf23,buf23,vcprm(0,1,3,2)); @@ -540,14 +540,14 @@ buf45 = vec_ld((i + 4) << 3, (float*)buf); buf67 = vec_ld((i + 6) << 3, (float*)buf); buf67 = vec_perm(buf67, buf67, vcprm(1,0,2,3)); - + vec_st(vec_add(buf01, buf45), (i + 0) << 3, (float*)buf); vec_st(vec_madd(buf67, vcii(p,n,p,p), buf23), (i + 2) << 3, (float*)buf); vec_st(vec_sub(buf01, buf45), (i + 4) << 3, (float*)buf); vec_st(vec_nmsub(buf67, vcii(p,n,p,p), buf23), (i + 6) << 3, (float*)buf); #endif } - + /* 4-7. iterations */ for (m=3; m < 7; m++) { two_m = (1 << m); @@ -600,10 +600,10 @@ vecq = vec_madd(temp4, vcii(n,p,n,p), temp3); // then butterfly with buf[p] and buf[p+1] vecp = vec_ld(p << 3, (float*)buf); - + temp1 = vec_add(vecp, vecq); temp2 = vec_sub(vecp, vecq); - + vec_st(temp1, p << 3, (float*)buf); vec_st(temp2, q << 3, (float*)buf); #endif @@ -660,7 +660,7 @@ tempCS01 = vec_perm(cosv, sinv, vcprm(s0,0,s1,1)); temp2 = vec_madd(temp1133, tempCS01, vczero); bufv_0 = vec_madd(temp2, vcii(p,n,p,n), temp1); - + vec_st(bufv_0, (i + 0) << 3, (float*)buf); /* idem with bufv_2 and high-order cosv/sinv */ @@ -674,36 +674,36 @@ bufv_2 = vec_madd(temp2, vcii(p,n,p,n), temp1); vec_st(bufv_2, (i + 2) << 3, (float*)buf); - + #endif } - + data_ptr = data; delay_ptr = delay; window_ptr = a52_imdct_window; /* Window and convert to real valued signal */ - for(i=0; i< 64; i++) { - *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias; - *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias; + for(i=0; i< 64; i++) { + *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias; + *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias; } - - for(i=0; i< 64; i++) { - *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias; - *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias; + + for(i=0; i< 64; i++) { + *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias; + *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias; } - + /* The trailing edge of the window goes into the delay line */ delay_ptr = delay; - for(i=0; i< 64; i++) { - *delay_ptr++ = -buf[64+i].real * *--window_ptr; - *delay_ptr++ = buf[64-i-1].imag * *--window_ptr; + for(i=0; i< 64; i++) { + *delay_ptr++ = -buf[64+i].real * *--window_ptr; + *delay_ptr++ = buf[64-i-1].imag * *--window_ptr; } - + for(i=0; i<64; i++) { - *delay_ptr++ = buf[i].imag * *--window_ptr; - *delay_ptr++ = -buf[128-i-1].real * *--window_ptr; + *delay_ptr++ = buf[i].imag * *--window_ptr; + *delay_ptr++ = -buf[128-i-1].real * *--window_ptr; } } #endif @@ -716,8 +716,8 @@ #define HAVE_AMD3DNOW 1 #include "srfftp_3dnow.h" -const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }}; -const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }}; +const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }}; +const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }}; const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 }; #undef HAVE_AMD3DNOWEXT @@ -746,9 +746,9 @@ sample_t *data_ptr; sample_t *delay_ptr; sample_t *window_ptr; - + /* 512 IMDCT with source and dest data in 'data' */ - /* see the c version (dct_do_512()), its allmost identical, just in C */ + /* see the c version (dct_do_512()), its allmost identical, just in C */ /* Pre IFFT complex multiply plus IFFT cmplx conjugate */ /* Bit reversed shuffling */ @@ -809,7 +809,7 @@ } } */ - + /* 1. iteration */ // Note w[0][0]={1,0} __asm__ volatile( @@ -831,7 +831,7 @@ :: "g" (buf), "r" (buf + 128) : "%"REG_S ); - + /* 2. iteration */ // Note w[1]={{1,0}, {0,-1}} __asm__ volatile( @@ -863,8 +863,8 @@ Note sseW2+48={1,-1,sqrt(2),-sqrt(2)) */ __asm__ volatile( - "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t" - "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t" + "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t" + "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t" "xorps %%xmm5, %%xmm5 \n\t" "xorps %%xmm2, %%xmm2 \n\t" "mov %0, %%"REG_S" \n\t" @@ -890,10 +890,10 @@ "addps %%xmm1, %%xmm3 \n\t" "subps %%xmm4, %%xmm0 \n\t" "subps %%xmm5, %%xmm1 \n\t" - "movaps %%xmm2, (%%"REG_S") \n\t" - "movaps %%xmm3, 16(%%"REG_S") \n\t" - "movaps %%xmm0, 32(%%"REG_S") \n\t" - "movaps %%xmm1, 48(%%"REG_S") \n\t" + "movaps %%xmm2, (%%"REG_S") \n\t" + "movaps %%xmm3, 16(%%"REG_S") \n\t" + "movaps %%xmm0, 32(%%"REG_S") \n\t" + "movaps %%xmm1, 48(%%"REG_S") \n\t" "add $64, %%"REG_S" \n\t" "cmp %1, %%"REG_S" \n\t" " jb 1b \n\t" @@ -927,7 +927,7 @@ "movaps %%xmm1, (%%"REG_S", %%"REG_D") \n\t" "movaps %%xmm0, (%%"REG_d", %%"REG_D") \n\t" "add $16, %%"REG_D" \n\t" - "cmp %3, %%"REG_D" \n\t" //FIXME (opt) count against 0 + "cmp %3, %%"REG_D" \n\t" //FIXME (opt) count against 0 "jb 2b \n\t" "add %2, %%"REG_S" \n\t" "cmp %1, %%"REG_S" \n\t" @@ -954,9 +954,9 @@ " jnz 1b \n\t" :: "r" (buf+128) : "%"REG_S - ); + ); - + data_ptr = data; delay_ptr = delay; window_ptr = a52_imdct_window; @@ -980,7 +980,7 @@ "movaps %%xmm0, (%1, %%"REG_S") \n\t" "add $16, %%"REG_S" \n\t" "sub $16, %%"REG_D" \n\t" - "cmp $512, %%"REG_S" \n\t" + "cmp $512, %%"REG_S" \n\t" " jb 1b \n\t" :: "r" (buf+64), "r" (data_ptr), "r" (delay_ptr), "m" (bias) : "%"REG_S, "%"REG_D @@ -988,7 +988,7 @@ data_ptr+=128; delay_ptr+=128; // window_ptr+=128; - + __asm__ volatile( "mov $1024, %%"REG_D" \n\t" // 512 "xor %%"REG_S", %%"REG_S" \n\t" // 0 @@ -1007,7 +1007,7 @@ "movaps %%xmm0, (%1, %%"REG_S") \n\t" "add $16, %%"REG_S" \n\t" "sub $16, %%"REG_D" \n\t" - "cmp $512, %%"REG_S" \n\t" + "cmp $512, %%"REG_S" \n\t" " jb 1b \n\t" :: "r" (buf), "r" (data_ptr), "r" (delay_ptr), "m" (bias) : "%"REG_S, "%"REG_D @@ -1025,21 +1025,21 @@ "1: \n\t" "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // ? ? ? A "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // ? ? ? C - "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // D ? ? C - "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // B ? ? A + "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // D ? ? C + "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // B ? ? A "shufps $0xCC, %%xmm1, %%xmm0 \n\t" // D C B A "mulps 1024+"MANGLE(sseWindow)"(%%"REG_S"), %%xmm0\n\t" "movaps %%xmm0, (%1, %%"REG_S") \n\t" "add $16, %%"REG_S" \n\t" "sub $16, %%"REG_D" \n\t" - "cmp $512, %%"REG_S" \n\t" + "cmp $512, %%"REG_S" \n\t" " jb 1b \n\t" :: "r" (buf+64), "r" (delay_ptr) : "%"REG_S, "%"REG_D ); delay_ptr+=128; // window_ptr-=128; - + __asm__ volatile( "mov $1024, %%"REG_D" \n\t" // 1024 "xor %%"REG_S", %%"REG_S" \n\t" // 0 @@ -1047,14 +1047,14 @@ "1: \n\t" "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // ? ? A ? "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // ? ? C ? - "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // ? D C ? - "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // ? B A ? + "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // ? D C ? + "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // ? B A ? "shufps $0x99, %%xmm1, %%xmm0 \n\t" // D C B A "mulps 1536+"MANGLE(sseWindow)"(%%"REG_S"), %%xmm0\n\t" "movaps %%xmm0, (%1, %%"REG_S") \n\t" "add $16, %%"REG_S" \n\t" "sub $16, %%"REG_D" \n\t" - "cmp $512, %%"REG_S" \n\t" + "cmp $512, %%"REG_S" \n\t" " jb 1b \n\t" :: "r" (buf), "r" (delay_ptr) : "%"REG_S, "%"REG_D @@ -1088,7 +1088,7 @@ /* Post IFFT complex multiply */ /* Window and convert to real valued signal */ for (i = 0; i < 32; i++) { - /* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */ + /* y1[n] = z1[n] * (xcos2[n] + j * xs in2[n]) ; */ t_r = post2[i].real; t_i = post2[i].imag; @@ -1209,12 +1209,12 @@ sseSinCos1c[2*i+0]= xcos1[i]; sseSinCos1c[2*i+1]= -xcos1[i]; sseSinCos1d[2*i+0]= xsin1[i]; - sseSinCos1d[2*i+1]= xsin1[i]; + sseSinCos1d[2*i+1]= xsin1[i]; } for (i = 1; i < 7; i++) { j = 1 << i; for (k = 0; k < j; k+=2) { - + sseW[i][4*k + 0] = w[i][k+0].real; sseW[i][4*k + 1] = w[i][k+0].real; sseW[i][4*k + 2] = w[i][k+1].real; @@ -1223,15 +1223,15 @@ sseW[i][4*k + 4] = -w[i][k+0].imag; sseW[i][4*k + 5] = w[i][k+0].imag; sseW[i][4*k + 6] = -w[i][k+1].imag; - sseW[i][4*k + 7] = w[i][k+1].imag; - + sseW[i][4*k + 7] = w[i][k+1].imag; + //we multiply more or less uninitalized numbers so we need to use exactly 0.0 if(k==0) { // sseW[i][4*k + 0]= sseW[i][4*k + 1]= 1.0; sseW[i][4*k + 4]= sseW[i][4*k + 5]= 0.0; } - + if(2*k == j) { sseW[i][4*k + 0]= sseW[i][4*k + 1]= 0.0; @@ -1243,9 +1243,9 @@ for(i=0; i<128; i++) { sseWindow[2*i+0]= -a52_imdct_window[2*i+0]; - sseWindow[2*i+1]= a52_imdct_window[2*i+1]; + sseWindow[2*i+1]= a52_imdct_window[2*i+1]; } - + for(i=0; i<64; i++) { sseWindow[256 + 2*i+0]= -a52_imdct_window[254 - 2*i+1];
--- a/liba52/imdct_3dnow.h Wed May 13 02:58:57 2009 +0000 +++ b/liba52/imdct_3dnow.h Wed May 13 15:22:13 2009 +0000 @@ -43,7 +43,7 @@ static void FFT_4_3DNOW(complex_t *x) { /* delta_p = 1 here */ - /* x[k] = sum_{i=0..3} x[i] * w^{i*k}, w=e^{-2*pi/4} + /* x[k] = sum_{i=0..3} x[i] * w^{i*k}, w=e^{-2*pi/4} */ __asm__ volatile( "movq 24(%1), %%mm3\n\t" @@ -86,10 +86,10 @@ static void FFT_8_3DNOW(complex_t *x) { /* delta_p = diag{1, sqrt(i)} here */ - /* x[k] = sum_{i=0..7} x[i] * w^{i*k}, w=e^{-2*pi/8} + /* x[k] = sum_{i=0..7} x[i] * w^{i*k}, w=e^{-2*pi/8} */ complex_t wT1, wB1, wB2; - + __asm__ volatile( "movq 8(%2), %%mm0\n\t" "movq 24(%2), %%mm1\n\t" @@ -111,9 +111,9 @@ :"memory"); fft_4_3dnow(&x[0]); - + /* x[0] x[4] x[2] x[6] */ - + __asm__ volatile( "movq 40(%1), %%mm0\n\t" "movq %%mm0, %%mm3\n\t" @@ -151,7 +151,7 @@ :"=r"(x) :"0"(x), "r"(&wT1), "r"(&wB1) :"memory"); - + /* x[1] x[5] */ __asm__ volatile ( "movq %6, %%mm6\n\t" @@ -180,7 +180,7 @@ "pxor %%mm6, %%mm1\n\t" "pfacc %%mm1, %%mm0\n\t" "pfmul %4, %%mm0\n\t" - + "movq 40(%3), %%mm5\n\t" #if HAVE_AMD3DNOWEXT "pswapd %%mm5, %%mm5\n\t" @@ -189,7 +189,7 @@ "punpckhdq %%mm1, %%mm5\n\t" #endif "movq %%mm5, %0\n\t" - + "movq 8(%3), %%mm1\n\t" "movq %%mm1, %%mm2\n\t" "pfsub %%mm0, %%mm1\n\t" @@ -197,7 +197,7 @@ "movq %%mm1, 40(%3)\n\t" "movq %%mm2, 8(%3)\n\t" :"=m"(wB2) - :"m"(wT1), "m"(wB1), "r"(x), "m"(HSQRT2_3DNOW), + :"m"(wT1), "m"(wB1), "r"(x), "m"(HSQRT2_3DNOW), "m"(x_plus_minus_3dnow), "m"(x_minus_plus_3dnow) :"memory"); @@ -212,7 +212,7 @@ "punpckldq %%mm1, %%mm2\n\t" "punpckhdq %%mm2, %%mm1\n\t" #endif - "pxor %%mm6, %%mm1\n\t" + "pxor %%mm6, %%mm1\n\t" "pfadd %%mm1, %%mm0\n\t" "movq %2, %%mm2\n\t" "movq 56(%4), %%mm3\n\t" @@ -253,10 +253,10 @@ x3k = x2k + 2 * k; x4k = x3k + 2 * k; wB = wTB + 2 * k; - + TRANSZERO_3DNOW(x[0],x2k[0],x3k[0],x4k[0]); TRANS_3DNOW(x[1],x2k[1],x3k[1],x4k[1],wTB[1],wB[1],d[1],d_3[1]); - + --k; for(;;) { TRANS_3DNOW(x[2],x2k[2],x3k[2],x4k[2],wTB[2],wB[2],d[2],d_3[2]); @@ -271,7 +271,7 @@ wTB += 2; wB += 2; } - + } void FFT_ASMB16_3DNOW(complex_t *x, complex_t *wTB) @@ -291,13 +291,13 @@ /* transform x[3], x[11], x[7], x[15] */ TRANS_3DNOW(x[3],x[7],x[11],x[15],wTB[3],wTB[7],delta16[3],delta16_3[3]); -} +} static void FFT_128P_3DNOW(complex_t *a) { FFT_8_3DNOW(&a[0]); FFT_4_3DNOW(&a[8]); FFT_4_3DNOW(&a[12]); FFT_ASMB16_3DNOW(&a[0], &a[8]); - + FFT_8_3DNOW(&a[16]), FFT_8_3DNOW(&a[24]); FFT_ASMB_3DNOW(4, &a[0], &a[16],&delta32[0], &delta32_3[0]); @@ -314,7 +314,7 @@ FFT_ASMB16_3DNOW(&a[64], &a[72]); FFT_8_3DNOW(&a[80]); FFT_8_3DNOW(&a[88]); - + /* FFT_32(&a[64]); */ FFT_ASMB_3DNOW(4, &a[64], &a[80],&delta32[0], &delta32_3[0]); @@ -325,7 +325,7 @@ FFT_8_3DNOW(&a[112]), FFT_8_3DNOW(&a[120]); /* FFT_32(&a[96]); */ FFT_ASMB_3DNOW(4, &a[96], &a[112], &delta32[0], &delta32_3[0]); - + /* FFT_128(&a[0]); */ FFT_ASMB_3DNOW(16, &a[0], &a[64], &delta128[0], &delta128_3[0]); } @@ -353,9 +353,9 @@ sample_t *data_ptr; sample_t *delay_ptr; sample_t *window_ptr; - + /* 512 IMDCT with source and dest data in 'data' */ - + /* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/ #if 1 __asm__ volatile ( @@ -396,7 +396,7 @@ #else __asm__ volatile ("femms":::"memory"); for( i=0; i < 128; i++) { - /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */ + /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */ int j= pm128[i]; buf[i].real = (data[256-2*j-1] * xcos1[j]) - (data[2*j] * xsin1[j]); buf[i].imag = -1.0 * ((data[2*j] * xcos1[j]) + (data[256-2*j-1] * xsin1[j])); @@ -432,9 +432,9 @@ FFT_128P_3DNOW (&buf[0]); // __asm__ volatile ("femms \n\t":::"memory"); - + /* Post IFFT complex multiply plus IFFT complex conjugate*/ -#if 1 +#if 1 __asm__ volatile ( "movq %0, %%mm7\n\t" "movq %1, %%mm6\n\t" @@ -448,9 +448,9 @@ #if !HAVE_AMD3DNOWEXT "punpckldq %%mm1, %%mm2\n\t" "punpckhdq %%mm2, %%mm1\n\t" -#else +#else "pswapd %%mm1, %%mm1\n\t" /* ac3_buf[i].re | ac3_buf[i].im */ -#endif +#endif "movd %3, %%mm3\n\t" /* ac3_xsin[i] */ "punpckldq %2, %%mm3\n\t" /* ac3_xsin[i] | ac3_xcos[i] */ "pfmul %%mm3, %%mm0\n\t" @@ -472,7 +472,7 @@ /* ac3_buf[i].re =(tmp_a_r * ac3_xcos1[i]) + (tmp_a_i * ac3_xsin1[i]); ac3_buf[i].im =(tmp_a_r * ac3_xsin1[i]) - (tmp_a_i * ac3_xcos1[i]);*/ } -#else +#else __asm__ volatile ("femms":::"memory"); for( i=0; i < 128; i++) { /* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */ @@ -482,7 +482,7 @@ buf[i].imag =(tmp_a_r * xsin1[i]) + (tmp_a_i * xcos1[i]); } #endif - + data_ptr = data; delay_ptr = delay; window_ptr = a52_imdct_window; @@ -519,16 +519,16 @@ delay_ptr += 2; } window_ptr += 128; -#else +#else __asm__ volatile ("femms":::"memory"); - for(i=0; i< 64; i++) { - *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias; - *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias; + for(i=0; i< 64; i++) { + *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias; + *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias; } - - for(i=0; i< 64; i++) { - *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias; - *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias; + + for(i=0; i< 64; i++) { + *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias; + *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias; } #endif @@ -566,16 +566,16 @@ delay_ptr += 2; } __asm__ volatile ("femms":::"memory"); -#else +#else __asm__ volatile ("femms":::"memory"); - for(i=0; i< 64; i++) { - *delay_ptr++ = -buf[64+i].real * *--window_ptr; - *delay_ptr++ = buf[64-i-1].imag * *--window_ptr; + for(i=0; i< 64; i++) { + *delay_ptr++ = -buf[64+i].real * *--window_ptr; + *delay_ptr++ = buf[64-i-1].imag * *--window_ptr; } - + for(i=0; i<64; i++) { - *delay_ptr++ = buf[i].imag * *--window_ptr; - *delay_ptr++ = -buf[128-i-1].real * *--window_ptr; + *delay_ptr++ = buf[i].imag * *--window_ptr; + *delay_ptr++ = -buf[128-i-1].real * *--window_ptr; } -#endif +#endif }
--- a/liba52/liba52_changes.diff Wed May 13 02:58:57 2009 +0000 +++ b/liba52/liba52_changes.diff Wed May 13 15:22:13 2009 +0000 @@ -3,7 +3,7 @@ @@ -59,4 +66,9 @@ int a52_block (a52_state_t * state); void a52_free (a52_state_t * state); - + +void* a52_resample_init(uint32_t mm_accel,int flags,int chans); +extern int (* a52_resample) (float * _f, int16_t * s16); + @@ -15,7 +15,7 @@ @@ -103,18 +107,34 @@ #define DELTA_BIT_NONE (2) #define DELTA_BIT_RESERVED (3) - + +#if ARCH_X86_64 +# define REG_a "rax" +# define REG_d "rdx" @@ -33,7 +33,7 @@ void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart, int start, int end, int fastleak, int slowleak, expbap_t * expbap); - + int a52_downmix_init (int input, int flags, sample_t * level, sample_t clev, sample_t slev); +void downmix_accel_init(uint32_t mm_accel); @@ -44,7 +44,7 @@ sample_t clev, sample_t slev); -void a52_upmix (sample_t * samples, int acmod, int output); +extern void (*a52_upmix) (sample_t * samples, int acmod, int output); - + void a52_imdct_init (uint32_t mm_accel); void a52_imdct_256 (sample_t * data, sample_t * delay, sample_t bias); -void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias); @@ -53,9 +53,9 @@ --- liba52/bitstream.c 2006-06-12 15:05:07.000000000 +0200 +++ liba52/bitstream.c 2006-06-05 02:23:02.000000000 +0200 @@ -31,6 +35,10 @@ - + #define BUFFER_SIZE 4096 - + +#ifdef ALT_BITSTREAM_READER +int indx=0; +#endif @@ -72,13 +72,13 @@ +#endif bitstream_get (state, align * 8); } - + --- liba52/bitstream.h 2006-06-12 15:05:07.000000000 +0200 +++ liba52/bitstream.h 2006-06-05 02:23:02.000000000 +0200 @@ -21,6 +25,42 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + +/* code from ffmpeg/libavcodec */ +#if defined(__sparc__) || defined(hpux) +/* @@ -117,20 +117,20 @@ + /* (stolen from the kernel) */ #ifdef WORDS_BIGENDIAN - + @@ -28,7 +68,7 @@ - + #else - + -# if 0 && defined (__i386__) +# if defined (__i386__) - + # define swab32(x) __i386_swab32(x) static inline const uint32_t __i386_swab32(uint32_t x) @@ -39,19 +79,34 @@ - + # else - + -# define swab32(x)\ -((((uint8_t*)&x)[0] << 24) | (((uint8_t*)&x)[1] << 16) | \ - (((uint8_t*)&x)[2] << 8) | (((uint8_t*)&x)[3])) @@ -143,7 +143,7 @@ + } # endif #endif - + +#ifdef ALT_BITSTREAM_READER +extern int indx; +#endif @@ -151,7 +151,7 @@ void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf); uint32_t a52_bitstream_get_bh (a52_state_t * state, uint32_t num_bits); int32_t a52_bitstream_get_bh_2 (a52_state_t * state, uint32_t num_bits); - + static inline uint32_t bitstream_get (a52_state_t * state, uint32_t num_bits) { +#ifdef ALT_BITSTREAM_READER @@ -160,15 +160,15 @@ + result<<= (indx&0x07); + result>>= 32 - num_bits; + indx+= num_bits; -+ ++ + return result; +#else uint32_t result; - + if (num_bits < state->bits_left) { @@ -61,10 +116,29 @@ } - + return a52_bitstream_get_bh (state, num_bits); +#endif +} @@ -181,7 +181,7 @@ + bitstream_get(state, num_bits); +#endif } - + static inline int32_t bitstream_get_2 (a52_state_t * state, uint32_t num_bits) { +#ifdef ALT_BITSTREAM_READER @@ -190,15 +190,15 @@ + result<<= (indx&0x07); + result>>= 32 - num_bits; + indx+= num_bits; -+ ++ + return result; +#else int32_t result; - + if (num_bits < state->bits_left) { @@ -74,4 +148,5 @@ } - + return a52_bitstream_get_bh_2 (state, num_bits); +#endif } @@ -211,18 +211,18 @@ + * + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at) */ - + #include "config.h" - + #include <string.h> #include <inttypes.h> - + #include "a52.h" #include "a52_internal.h" +#include "mm_accel.h" - + #define CONVERT(acmod,output) (((output) << 3) + (acmod)) - + + +void (*a52_downmix)(sample_t * samples, int acmod, int output, sample_t bias, + sample_t clev, sample_t slev)= NULL; @@ -247,14 +247,14 @@ + if(mm_accel & MM_ACCEL_X86_3DNOW) a52_downmix= downmix_3dnow; +#endif +} -+ ++ int a52_downmix_init (int input, int flags, sample_t * level, sample_t clev, sample_t slev) { @@ -447,7 +479,7 @@ samples[i] = 0; } - + -void a52_downmix (sample_t * samples, int acmod, int output, sample_t bias, +void downmix_C (sample_t * samples, int acmod, int output, sample_t bias, sample_t clev, sample_t slev) @@ -262,28 +262,28 @@ switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { @@ -559,7 +591,7 @@ break; - + case CONVERT (A52_3F2R, A52_2F1R): - mix3to2 (samples, bias); + mix3to2 (samples, bias); //FIXME possible bug? (output doesnt seem to be used) move2to1 (samples + 768, samples + 512, bias); break; - + @@ -583,12 +615,12 @@ break; - + case CONVERT (A52_3F1R, A52_3F2R): - memcpy (samples + 1027, samples + 768, 256 * sizeof (sample_t)); + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); break; } } - + -void a52_upmix (sample_t * samples, int acmod, int output) +void upmix_C (sample_t * samples, int acmod, int output) { switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { - + @@ -653,3 +685,1104 @@ goto mix_31to21; } @@ -298,10 +298,10 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" -+ "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" -+ "addps (%1, %%"REG_S"), %%xmm0 \n\t" -+ "addps 16(%1, %%"REG_S"), %%xmm1\n\t" ++ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" ++ "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" ++ "addps (%1, %%"REG_S"), %%xmm0 \n\t" ++ "addps 16(%1, %%"REG_S"), %%xmm1\n\t" + "addps %%xmm7, %%xmm0 \n\t" + "addps %%xmm7, %%xmm1 \n\t" + "movaps %%xmm0, (%1, %%"REG_S") \n\t" @@ -321,9 +321,9 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" -+ "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" -+ "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" ++ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" ++ "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" ++ "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" + "addps %%xmm7, %%xmm1 \n\t" + "addps %%xmm1, %%xmm0 \n\t" + "movaps %%xmm0, (%0, %%"REG_S") \n\t" @@ -342,10 +342,10 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" -+ "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" -+ "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" -+ "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" ++ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" ++ "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" ++ "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" ++ "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" + "addps %%xmm7, %%xmm0 \n\t" + "addps %%xmm1, %%xmm0 \n\t" + "movaps %%xmm0, (%0, %%"REG_S") \n\t" @@ -364,12 +364,12 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" -+ "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" -+ "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" -+ "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" ++ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" ++ "movaps 1024(%0, %%"REG_S"), %%xmm1\n\t" ++ "addps 2048(%0, %%"REG_S"), %%xmm0\n\t" ++ "addps 3072(%0, %%"REG_S"), %%xmm1\n\t" + "addps %%xmm7, %%xmm0 \n\t" -+ "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" ++ "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" + "addps %%xmm1, %%xmm0 \n\t" + "movaps %%xmm0, (%0, %%"REG_S") \n\t" + "add $16, %%"REG_S" \n\t" @@ -387,9 +387,9 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" ++ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "addps %%xmm7, %%xmm0 \n\t" //common -+ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" ++ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" + "addps %%xmm0, %%xmm1 \n\t" + "addps %%xmm0, %%xmm2 \n\t" @@ -410,9 +410,9 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps 1024(%1, %%"REG_S"), %%xmm0\n\t" ++ "movaps 1024(%1, %%"REG_S"), %%xmm0\n\t" + "addps %%xmm7, %%xmm0 \n\t" //common -+ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" ++ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps (%1, %%"REG_S"), %%xmm2 \n\t" + "addps %%xmm0, %%xmm1 \n\t" + "addps %%xmm0, %%xmm2 \n\t" @@ -434,7 +434,7 @@ + ASMALIGN(4) + "1: \n\t" + "movaps 2048(%0, %%"REG_S"), %%xmm0\n\t" // surround -+ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" ++ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm2\n\t" + "addps %%xmm7, %%xmm1 \n\t" + "addps %%xmm7, %%xmm2 \n\t" @@ -457,10 +457,10 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" -+ "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" ++ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" ++ "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" + "addps %%xmm7, %%xmm0 \n\t" // common -+ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" ++ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" + "addps %%xmm0, %%xmm1 \n\t" + "addps %%xmm0, %%xmm2 \n\t" @@ -481,10 +481,10 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" ++ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "movaps 3072(%0, %%"REG_S"), %%xmm3\n\t" // surround + "addps %%xmm7, %%xmm0 \n\t" // common -+ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" ++ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps 2048(%0, %%"REG_S"), %%xmm2\n\t" + "addps %%xmm0, %%xmm1 \n\t" + "addps %%xmm0, %%xmm2 \n\t" @@ -507,9 +507,9 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps 2048(%0, %%"REG_S"), %%xmm0\n\t" ++ "movaps 2048(%0, %%"REG_S"), %%xmm0\n\t" + "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" // surround -+ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" ++ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" + "movaps 1024(%0, %%"REG_S"), %%xmm2\n\t" + "addps %%xmm7, %%xmm1 \n\t" + "addps %%xmm7, %%xmm2 \n\t" @@ -532,13 +532,13 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" ++ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "addps %%xmm7, %%xmm0 \n\t" // common + "movaps %%xmm0, %%xmm1 \n\t" // common -+ "addps (%0, %%"REG_S"), %%xmm0 \n\t" -+ "addps 2048(%0, %%"REG_S"), %%xmm1\n\t" -+ "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" -+ "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" ++ "addps (%0, %%"REG_S"), %%xmm0 \n\t" ++ "addps 2048(%0, %%"REG_S"), %%xmm1\n\t" ++ "addps 3072(%0, %%"REG_S"), %%xmm0\n\t" ++ "addps 4096(%0, %%"REG_S"), %%xmm1\n\t" + "movaps %%xmm0, (%0, %%"REG_S") \n\t" + "movaps %%xmm1, 1024(%0, %%"REG_S")\n\t" + "add $16, %%"REG_S" \n\t" @@ -556,16 +556,16 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" -+ "movaps 3072(%0, %%"REG_S"), %%xmm2\n\t" ++ "movaps 1024(%0, %%"REG_S"), %%xmm0\n\t" ++ "movaps 3072(%0, %%"REG_S"), %%xmm2\n\t" + "addps %%xmm7, %%xmm0 \n\t" // common -+ "addps 4096(%0, %%"REG_S"), %%xmm2\n\t" // surround -+ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" -+ "movaps 2048(%0, %%"REG_S"), %%xmm3\n\t" -+ "subps %%xmm2, %%xmm1 \n\t" -+ "addps %%xmm2, %%xmm3 \n\t" -+ "addps %%xmm0, %%xmm1 \n\t" -+ "addps %%xmm0, %%xmm3 \n\t" ++ "addps 4096(%0, %%"REG_S"), %%xmm2\n\t" // surround ++ "movaps (%0, %%"REG_S"), %%xmm1 \n\t" ++ "movaps 2048(%0, %%"REG_S"), %%xmm3\n\t" ++ "subps %%xmm2, %%xmm1 \n\t" ++ "addps %%xmm2, %%xmm3 \n\t" ++ "addps %%xmm0, %%xmm1 \n\t" ++ "addps %%xmm0, %%xmm3 \n\t" + "movaps %%xmm1, (%0, %%"REG_S") \n\t" + "movaps %%xmm3, 1024(%0, %%"REG_S")\n\t" + "add $16, %%"REG_S" \n\t" @@ -583,8 +583,8 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" -+ "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" ++ "movaps (%0, %%"REG_S"), %%xmm0 \n\t" ++ "movaps 16(%0, %%"REG_S"), %%xmm1\n\t" + "addps 1024(%0, %%"REG_S"), %%xmm0\n\t" + "addps 1040(%0, %%"REG_S"), %%xmm1\n\t" + "addps %%xmm7, %%xmm0 \n\t" @@ -832,13 +832,13 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq (%0, %%"REG_S"), %%mm0 \n\t" ++ "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" -+ "movq 16(%0, %%"REG_S"), %%mm2 \n\t" ++ "movq 16(%0, %%"REG_S"), %%mm2 \n\t" + "movq 24(%0, %%"REG_S"), %%mm3 \n\t" -+ "pfadd (%1, %%"REG_S"), %%mm0 \n\t" ++ "pfadd (%1, %%"REG_S"), %%mm0 \n\t" + "pfadd 8(%1, %%"REG_S"), %%mm1 \n\t" -+ "pfadd 16(%1, %%"REG_S"), %%mm2 \n\t" ++ "pfadd 16(%1, %%"REG_S"), %%mm2 \n\t" + "pfadd 24(%1, %%"REG_S"), %%mm3 \n\t" + "pfadd %%mm7, %%mm0 \n\t" + "pfadd %%mm7, %%mm1 \n\t" @@ -863,11 +863,11 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq (%0, %%"REG_S"), %%mm0 \n\t" ++ "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" -+ "movq 1024(%0, %%"REG_S"), %%mm2\n\t" ++ "movq 1024(%0, %%"REG_S"), %%mm2\n\t" + "movq 1032(%0, %%"REG_S"), %%mm3\n\t" -+ "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" ++ "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" + "pfadd %%mm7, %%mm0 \n\t" + "pfadd %%mm7, %%mm1 \n\t" @@ -890,13 +890,13 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq (%0, %%"REG_S"), %%mm0 \n\t" ++ "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" -+ "movq 1024(%0, %%"REG_S"), %%mm2\n\t" ++ "movq 1024(%0, %%"REG_S"), %%mm2\n\t" + "movq 1032(%0, %%"REG_S"), %%mm3\n\t" -+ "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" ++ "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" -+ "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" ++ "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 3080(%0, %%"REG_S"), %%mm3\n\t" + "pfadd %%mm7, %%mm0 \n\t" + "pfadd %%mm7, %%mm1 \n\t" @@ -919,17 +919,17 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq (%0, %%"REG_S"), %%mm0 \n\t" ++ "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" -+ "movq 1024(%0, %%"REG_S"), %%mm2\n\t" ++ "movq 1024(%0, %%"REG_S"), %%mm2\n\t" + "movq 1032(%0, %%"REG_S"), %%mm3\n\t" -+ "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" ++ "pfadd 2048(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 2056(%0, %%"REG_S"), %%mm1\n\t" -+ "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" ++ "pfadd 3072(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 3080(%0, %%"REG_S"), %%mm3\n\t" + "pfadd %%mm7, %%mm0 \n\t" + "pfadd %%mm7, %%mm1 \n\t" -+ "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" ++ "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 4104(%0, %%"REG_S"), %%mm3\n\t" + "pfadd %%mm2, %%mm0 \n\t" + "pfadd %%mm3, %%mm1 \n\t" @@ -950,11 +950,11 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" ++ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" + "pfadd %%mm7, %%mm0 \n\t" //common + "pfadd %%mm7, %%mm1 \n\t" //common -+ "movq (%0, %%"REG_S"), %%mm2 \n\t" ++ "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" + "movq 2048(%0, %%"REG_S"), %%mm4\n\t" + "movq 2056(%0, %%"REG_S"), %%mm5\n\t" @@ -981,11 +981,11 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq 1024(%1, %%"REG_S"), %%mm0\n\t" ++ "movq 1024(%1, %%"REG_S"), %%mm0\n\t" + "movq 1032(%1, %%"REG_S"), %%mm1\n\t" + "pfadd %%mm7, %%mm0 \n\t" //common + "pfadd %%mm7, %%mm1 \n\t" //common -+ "movq (%0, %%"REG_S"), %%mm2 \n\t" ++ "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" + "movq (%1, %%"REG_S"), %%mm4 \n\t" + "movq 8(%1, %%"REG_S"), %%mm5 \n\t" @@ -1014,7 +1014,7 @@ + "1: \n\t" + "movq 2048(%0, %%"REG_S"), %%mm0\n\t" // surround + "movq 2056(%0, %%"REG_S"), %%mm1\n\t" // surround -+ "movq (%0, %%"REG_S"), %%mm2 \n\t" ++ "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" + "movq 1024(%0, %%"REG_S"), %%mm4\n\t" + "movq 1032(%0, %%"REG_S"), %%mm5\n\t" @@ -1045,13 +1045,13 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" ++ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" -+ "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" ++ "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" + "pfadd %%mm7, %%mm0 \n\t" // common + "pfadd %%mm7, %%mm1 \n\t" // common -+ "movq (%0, %%"REG_S"), %%mm2 \n\t" ++ "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" + "movq 2048(%0, %%"REG_S"), %%mm4\n\t" + "movq 2056(%0, %%"REG_S"), %%mm5\n\t" @@ -1078,11 +1078,11 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" ++ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" + "pfadd %%mm7, %%mm0 \n\t" // common + "pfadd %%mm7, %%mm1 \n\t" // common -+ "movq (%0, %%"REG_S"), %%mm2 \n\t" ++ "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" + "movq 2048(%0, %%"REG_S"), %%mm4\n\t" + "movq 2056(%0, %%"REG_S"), %%mm5\n\t" @@ -1115,11 +1115,11 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq 2048(%0, %%"REG_S"), %%mm0\n\t" ++ "movq 2048(%0, %%"REG_S"), %%mm0\n\t" + "movq 2056(%0, %%"REG_S"), %%mm1\n\t" + "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" // surround + "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" // surround -+ "movq (%0, %%"REG_S"), %%mm2 \n\t" ++ "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" + "movq 1024(%0, %%"REG_S"), %%mm4\n\t" + "movq 1032(%0, %%"REG_S"), %%mm5\n\t" @@ -1150,19 +1150,19 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" ++ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" + "pfadd %%mm7, %%mm0 \n\t" // common + "pfadd %%mm7, %%mm1 \n\t" // common + "movq %%mm0, %%mm2 \n\t" // common + "movq %%mm1, %%mm3 \n\t" // common -+ "pfadd (%0, %%"REG_S"), %%mm0 \n\t" ++ "pfadd (%0, %%"REG_S"), %%mm0 \n\t" + "pfadd 8(%0, %%"REG_S"), %%mm1 \n\t" -+ "pfadd 2048(%0, %%"REG_S"), %%mm2\n\t" ++ "pfadd 2048(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 2056(%0, %%"REG_S"), %%mm3\n\t" -+ "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" ++ "pfadd 3072(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 3080(%0, %%"REG_S"), %%mm1\n\t" -+ "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" ++ "pfadd 4096(%0, %%"REG_S"), %%mm2\n\t" + "pfadd 4104(%0, %%"REG_S"), %%mm3\n\t" + "movq %%mm0, (%0, %%"REG_S") \n\t" + "movq %%mm1, 8(%0, %%"REG_S") \n\t" @@ -1184,25 +1184,25 @@ + "1: \n\t" + "movd %1, %%mm7 \n\t" + "punpckldq %1, %%mm7 \n\t" -+ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" ++ "movq 1024(%0, %%"REG_S"), %%mm0\n\t" + "movq 1032(%0, %%"REG_S"), %%mm1\n\t" -+ "movq 3072(%0, %%"REG_S"), %%mm4\n\t" ++ "movq 3072(%0, %%"REG_S"), %%mm4\n\t" + "movq 3080(%0, %%"REG_S"), %%mm5\n\t" + "pfadd %%mm7, %%mm0 \n\t" // common + "pfadd %%mm7, %%mm1 \n\t" // common -+ "pfadd 4096(%0, %%"REG_S"), %%mm4\n\t" // surround ++ "pfadd 4096(%0, %%"REG_S"), %%mm4\n\t" // surround + "pfadd 4104(%0, %%"REG_S"), %%mm5\n\t" // surround -+ "movq (%0, %%"REG_S"), %%mm2 \n\t" ++ "movq (%0, %%"REG_S"), %%mm2 \n\t" + "movq 8(%0, %%"REG_S"), %%mm3 \n\t" -+ "movq 2048(%0, %%"REG_S"), %%mm6\n\t" ++ "movq 2048(%0, %%"REG_S"), %%mm6\n\t" + "movq 2056(%0, %%"REG_S"), %%mm7\n\t" -+ "pfsub %%mm4, %%mm2 \n\t" ++ "pfsub %%mm4, %%mm2 \n\t" + "pfsub %%mm5, %%mm3 \n\t" -+ "pfadd %%mm4, %%mm6 \n\t" ++ "pfadd %%mm4, %%mm6 \n\t" + "pfadd %%mm5, %%mm7 \n\t" -+ "pfadd %%mm0, %%mm2 \n\t" ++ "pfadd %%mm0, %%mm2 \n\t" + "pfadd %%mm1, %%mm3 \n\t" -+ "pfadd %%mm0, %%mm6 \n\t" ++ "pfadd %%mm0, %%mm6 \n\t" + "pfadd %%mm1, %%mm7 \n\t" + "movq %%mm2, (%0, %%"REG_S") \n\t" + "movq %%mm3, 8(%0, %%"REG_S") \n\t" @@ -1223,9 +1223,9 @@ + "mov $-1024, %%"REG_S" \n\t" + ASMALIGN(4) + "1: \n\t" -+ "movq (%0, %%"REG_S"), %%mm0 \n\t" ++ "movq (%0, %%"REG_S"), %%mm0 \n\t" + "movq 8(%0, %%"REG_S"), %%mm1 \n\t" -+ "movq 16(%0, %%"REG_S"), %%mm2 \n\t" ++ "movq 16(%0, %%"REG_S"), %%mm2 \n\t" + "movq 24(%0, %%"REG_S"), %%mm3 \n\t" + "pfadd 1024(%0, %%"REG_S"), %%mm0\n\t" + "pfadd 1032(%0, %%"REG_S"), %%mm1\n\t" @@ -1401,7 +1401,7 @@ + * michael did port them from libac3 (untested, perhaps totally broken) + * AltiVec optimizations from Romain Dolbeau (romain@dolbeau.org) */ - + #include "config.h" @@ -39,12 +48,50 @@ #include "a52.h" @@ -1415,12 +1415,12 @@ +#undef HAVE_AMD3DNOWEXT +#define HAVE_AMD3DNOWEXT 0 +#endif - + typedef struct complex_s { sample_t real; sample_t imag; } complex_t; - + +static const int pm128[128] attribute_used __attribute__((aligned(16))) = +{ + 0, 16, 32, 48, 64, 80, 96, 112, 8, 40, 72, 104, 24, 56, 88, 120, @@ -1431,24 +1431,24 @@ + 5, 21, 37, 53, 69, 85, 101, 117, 13, 29, 45, 61, 77, 93, 109, 125, + 3, 19, 35, 51, 67, 83, 99, 115, 11, 43, 75, 107, 27, 59, 91, 123, + 7, 23, 39, 55, 71, 87, 103, 119, 15, 31, 47, 63, 79, 95, 111, 127 -+}; ++}; + +static uint8_t attribute_used bit_reverse_512[] = { -+ 0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70, -+ 0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78, -+ 0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74, -+ 0x0c, 0x4c, 0x2c, 0x6c, 0x1c, 0x5c, 0x3c, 0x7c, -+ 0x02, 0x42, 0x22, 0x62, 0x12, 0x52, 0x32, 0x72, -+ 0x0a, 0x4a, 0x2a, 0x6a, 0x1a, 0x5a, 0x3a, 0x7a, -+ 0x06, 0x46, 0x26, 0x66, 0x16, 0x56, 0x36, 0x76, -+ 0x0e, 0x4e, 0x2e, 0x6e, 0x1e, 0x5e, 0x3e, 0x7e, -+ 0x01, 0x41, 0x21, 0x61, 0x11, 0x51, 0x31, 0x71, -+ 0x09, 0x49, 0x29, 0x69, 0x19, 0x59, 0x39, 0x79, -+ 0x05, 0x45, 0x25, 0x65, 0x15, 0x55, 0x35, 0x75, -+ 0x0d, 0x4d, 0x2d, 0x6d, 0x1d, 0x5d, 0x3d, 0x7d, -+ 0x03, 0x43, 0x23, 0x63, 0x13, 0x53, 0x33, 0x73, -+ 0x0b, 0x4b, 0x2b, 0x6b, 0x1b, 0x5b, 0x3b, 0x7b, -+ 0x07, 0x47, 0x27, 0x67, 0x17, 0x57, 0x37, 0x77, ++ 0x00, 0x40, 0x20, 0x60, 0x10, 0x50, 0x30, 0x70, ++ 0x08, 0x48, 0x28, 0x68, 0x18, 0x58, 0x38, 0x78, ++ 0x04, 0x44, 0x24, 0x64, 0x14, 0x54, 0x34, 0x74, ++ 0x0c, 0x4c, 0x2c, 0x6c, 0x1c, 0x5c, 0x3c, 0x7c, ++ 0x02, 0x42, 0x22, 0x62, 0x12, 0x52, 0x32, 0x72, ++ 0x0a, 0x4a, 0x2a, 0x6a, 0x1a, 0x5a, 0x3a, 0x7a, ++ 0x06, 0x46, 0x26, 0x66, 0x16, 0x56, 0x36, 0x76, ++ 0x0e, 0x4e, 0x2e, 0x6e, 0x1e, 0x5e, 0x3e, 0x7e, ++ 0x01, 0x41, 0x21, 0x61, 0x11, 0x51, 0x31, 0x71, ++ 0x09, 0x49, 0x29, 0x69, 0x19, 0x59, 0x39, 0x79, ++ 0x05, 0x45, 0x25, 0x65, 0x15, 0x55, 0x35, 0x75, ++ 0x0d, 0x4d, 0x2d, 0x6d, 0x1d, 0x5d, 0x3d, 0x7d, ++ 0x03, 0x43, 0x23, 0x63, 0x13, 0x53, 0x33, 0x73, ++ 0x0b, 0x4b, 0x2b, 0x6b, 0x1b, 0x5b, 0x3b, 0x7b, ++ 0x07, 0x47, 0x27, 0x67, 0x17, 0x57, 0x37, 0x77, + 0x0f, 0x4f, 0x2f, 0x6f, 0x1f, 0x5f, 0x3f, 0x7f}; + static uint8_t fftorder[] = { @@ -1457,7 +1457,7 @@ @@ -56,6 +103,40 @@ 6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86 }; - + +static complex_t __attribute__((aligned(16))) buf[128]; + +/* Twiddle factor LUT */ @@ -1475,8 +1475,8 @@ +static sample_t __attribute__((aligned(16))) xsin1[128]; + +#if ARCH_X86 || ARCH_X86_64 -+// NOTE: SSE needs 16byte alignment or it will segfault -+// ++// NOTE: SSE needs 16byte alignment or it will segfault ++// +static float __attribute__((aligned(16))) sseSinCos1c[256]; +static float __attribute__((aligned(16))) sseSinCos1d[256]; +static float attribute_used __attribute__((aligned(16))) ps111_1[4]={1,1,1,-1}; @@ -1498,7 +1498,7 @@ @@ -241,7 +322,7 @@ ifft_pass (buf, roots128 - 32, 32); } - + -void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias) +void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias) { @@ -1507,7 +1507,7 @@ @@ -285,6 +366,702 @@ } } - + +#if HAVE_ALTIVEC + +#ifdef HAVE_ALTIVEC_H @@ -1559,17 +1559,17 @@ + sample_t *data_ptr; + sample_t *delay_ptr; + sample_t *window_ptr; -+ ++ + /* 512 IMDCT with source and dest data in 'data' */ -+ ++ + /* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/ + for( i=0; i < 128; i++) { -+ /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */ ++ /* z[i] = (X[256-2*i-1] + j * X[2*i]) * (xcos1[i] + j * xsin1[i]) ; */ + int j= bit_reverse_512[i]; + buf[i].real = (data[256-2*j-1] * xcos1[j]) - (data[2*j] * xsin1[j]); + buf[i].imag = -1.0 * ((data[2*j] * xcos1[j]) + (data[256-2*j-1] * xsin1[j])); + } -+ ++ + /* 1. iteration */ + for(i = 0; i < 128; i += 2) { +#if 0 @@ -1582,7 +1582,7 @@ + buf[i+1].real = tmp_a_r - tmp_b_r; + buf[i+1].imag = tmp_a_i - tmp_b_i; +#else -+ vector float temp, bufv; ++ vector float temp, bufv; + + bufv = vec_ld(i << 3, (float*)buf); + temp = vec_perm(bufv, bufv, vcprm(2,3,0,1)); @@ -1590,7 +1590,7 @@ + vec_st(bufv, i << 3, (float*)buf); +#endif + } -+ ++ + /* 2. iteration */ + // Note w[1]={{1,0}, {0,-1}} + for(i = 0; i < 128; i += 4) { @@ -1614,7 +1614,7 @@ + buf[i+3].imag = tmp_a_i + tmp_b_i; +#else + vector float buf01, buf23, temp1, temp2; -+ ++ + buf01 = vec_ld((i + 0) << 3, (float*)buf); + buf23 = vec_ld((i + 2) << 3, (float*)buf); + buf23 = vec_perm(buf23,buf23,vcprm(0,1,3,2)); @@ -1682,14 +1682,14 @@ + buf45 = vec_ld((i + 4) << 3, (float*)buf); + buf67 = vec_ld((i + 6) << 3, (float*)buf); + buf67 = vec_perm(buf67, buf67, vcprm(1,0,2,3)); -+ ++ + vec_st(vec_add(buf01, buf45), (i + 0) << 3, (float*)buf); + vec_st(vec_madd(buf67, vcii(p,n,p,p), buf23), (i + 2) << 3, (float*)buf); + vec_st(vec_sub(buf01, buf45), (i + 4) << 3, (float*)buf); + vec_st(vec_nmsub(buf67, vcii(p,n,p,p), buf23), (i + 6) << 3, (float*)buf); +#endif + } -+ ++ + /* 4-7. iterations */ + for (m=3; m < 7; m++) { + two_m = (1 << m); @@ -1742,10 +1742,10 @@ + vecq = vec_madd(temp4, vcii(n,p,n,p), temp3); + // then butterfly with buf[p] and buf[p+1] + vecp = vec_ld(p << 3, (float*)buf); -+ ++ + temp1 = vec_add(vecp, vecq); + temp2 = vec_sub(vecp, vecq); -+ ++ + vec_st(temp1, p << 3, (float*)buf); + vec_st(temp2, q << 3, (float*)buf); +#endif @@ -1802,7 +1802,7 @@ + tempCS01 = vec_perm(cosv, sinv, vcprm(s0,0,s1,1)); + temp2 = vec_madd(temp1133, tempCS01, vczero); + bufv_0 = vec_madd(temp2, vcii(p,n,p,n), temp1); -+ ++ + vec_st(bufv_0, (i + 0) << 3, (float*)buf); + + /* idem with bufv_2 and high-order cosv/sinv */ @@ -1816,36 +1816,36 @@ + bufv_2 = vec_madd(temp2, vcii(p,n,p,n), temp1); + + vec_st(bufv_2, (i + 2) << 3, (float*)buf); -+ ++ +#endif + } -+ ++ + data_ptr = data; + delay_ptr = delay; + window_ptr = a52_imdct_window; + + /* Window and convert to real valued signal */ -+ for(i=0; i< 64; i++) { -+ *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias; -+ *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias; ++ for(i=0; i< 64; i++) { ++ *data_ptr++ = -buf[64+i].imag * *window_ptr++ + *delay_ptr++ + bias; ++ *data_ptr++ = buf[64-i-1].real * *window_ptr++ + *delay_ptr++ + bias; + } -+ -+ for(i=0; i< 64; i++) { -+ *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias; -+ *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias; ++ ++ for(i=0; i< 64; i++) { ++ *data_ptr++ = -buf[i].real * *window_ptr++ + *delay_ptr++ + bias; ++ *data_ptr++ = buf[128-i-1].imag * *window_ptr++ + *delay_ptr++ + bias; + } -+ ++ + /* The trailing edge of the window goes into the delay line */ + delay_ptr = delay; + -+ for(i=0; i< 64; i++) { -+ *delay_ptr++ = -buf[64+i].real * *--window_ptr; -+ *delay_ptr++ = buf[64-i-1].imag * *--window_ptr; ++ for(i=0; i< 64; i++) { ++ *delay_ptr++ = -buf[64+i].real * *--window_ptr; ++ *delay_ptr++ = buf[64-i-1].imag * *--window_ptr; + } -+ ++ + for(i=0; i<64; i++) { -+ *delay_ptr++ = buf[i].imag * *--window_ptr; -+ *delay_ptr++ = -buf[128-i-1].real * *--window_ptr; ++ *delay_ptr++ = buf[i].imag * *--window_ptr; ++ *delay_ptr++ = -buf[128-i-1].real * *--window_ptr; + } +} +#endif @@ -1858,8 +1858,8 @@ +#define HAVE_AMD3DNOW 1 +#include "srfftp_3dnow.h" + -+const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }}; -+const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }}; ++const i_cmplx_t x_plus_minus_3dnow __attribute__ ((aligned (8))) = {{ 0x00000000UL, 0x80000000UL }}; ++const i_cmplx_t x_minus_plus_3dnow __attribute__ ((aligned (8))) = {{ 0x80000000UL, 0x00000000UL }}; +const complex_t HSQRT2_3DNOW __attribute__ ((aligned (8))) = { 0.707106781188, 0.707106781188 }; + +#undef HAVE_AMD3DNOWEXT @@ -1888,9 +1888,9 @@ + sample_t *data_ptr; + sample_t *delay_ptr; + sample_t *window_ptr; -+ ++ + /* 512 IMDCT with source and dest data in 'data' */ -+ /* see the c version (dct_do_512()), its allmost identical, just in C */ ++ /* see the c version (dct_do_512()), its allmost identical, just in C */ + + /* Pre IFFT complex multiply plus IFFT cmplx conjugate */ + /* Bit reversed shuffling */ @@ -1951,7 +1951,7 @@ + } + } +*/ -+ ++ + /* 1. iteration */ + // Note w[0][0]={1,0} + __asm__ volatile( @@ -1973,7 +1973,7 @@ + :: "g" (buf), "r" (buf + 128) + : "%"REG_S + ); -+ ++ + /* 2. iteration */ + // Note w[1]={{1,0}, {0,-1}} + __asm__ volatile( @@ -2005,8 +2005,8 @@ + Note sseW2+48={1,-1,sqrt(2),-sqrt(2)) +*/ + __asm__ volatile( -+ "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t" -+ "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t" ++ "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t" ++ "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t" + "xorps %%xmm5, %%xmm5 \n\t" + "xorps %%xmm2, %%xmm2 \n\t" + "mov %0, %%"REG_S" \n\t" @@ -2032,10 +2032,10 @@ + "addps %%xmm1, %%xmm3 \n\t" + "subps %%xmm4, %%xmm0 \n\t" + "subps %%xmm5, %%xmm1 \n\t" -+ "movaps %%xmm2, (%%"REG_S") \n\t" -+ "movaps %%xmm3, 16(%%"REG_S") \n\t" -+ "movaps %%xmm0, 32(%%"REG_S") \n\t" -+ "movaps %%xmm1, 48(%%"REG_S") \n\t" ++ "movaps %%xmm2, (%%"REG_S") \n\t" ++ "movaps %%xmm3, 16(%%"REG_S") \n\t" ++ "movaps %%xmm0, 32(%%"REG_S") \n\t" ++ "movaps %%xmm1, 48(%%"REG_S") \n\t" + "add $64, %%"REG_S" \n\t" + "cmp %1, %%"REG_S" \n\t" + " jb 1b \n\t" @@ -2069,7 +2069,7 @@ + "movaps %%xmm1, (%%"REG_S", %%"REG_D") \n\t" + "movaps %%xmm0, (%%"REG_d", %%"REG_D") \n\t" + "add $16, %%"REG_D" \n\t" -+ "cmp %3, %%"REG_D" \n\t" //FIXME (opt) count against 0 ++ "cmp %3, %%"REG_D" \n\t" //FIXME (opt) count against 0 + "jb 2b \n\t" + "add %2, %%"REG_S" \n\t" + "cmp %1, %%"REG_S" \n\t" @@ -2096,9 +2096,9 @@ + " jnz 1b \n\t" + :: "r" (buf+128) + : "%"REG_S -+ ); ++ ); + -+ ++ + data_ptr = data; + delay_ptr = delay; + window_ptr = a52_imdct_window; @@ -2122,7 +2122,7 @@ + "movaps %%xmm0, (%1, %%"REG_S") \n\t" + "add $16, %%"REG_S" \n\t" + "sub $16, %%"REG_D" \n\t" -+ "cmp $512, %%"REG_S" \n\t" ++ "cmp $512, %%"REG_S" \n\t" + " jb 1b \n\t" + :: "r" (buf+64), "r" (data_ptr), "r" (delay_ptr), "m" (bias) + : "%"REG_S, "%"REG_D @@ -2130,7 +2130,7 @@ + data_ptr+=128; + delay_ptr+=128; +// window_ptr+=128; -+ ++ + __asm__ volatile( + "mov $1024, %%"REG_D" \n\t" // 512 + "xor %%"REG_S", %%"REG_S" \n\t" // 0 @@ -2149,7 +2149,7 @@ + "movaps %%xmm0, (%1, %%"REG_S") \n\t" + "add $16, %%"REG_S" \n\t" + "sub $16, %%"REG_D" \n\t" -+ "cmp $512, %%"REG_S" \n\t" ++ "cmp $512, %%"REG_S" \n\t" + " jb 1b \n\t" + :: "r" (buf), "r" (data_ptr), "r" (delay_ptr), "m" (bias) + : "%"REG_S, "%"REG_D @@ -2167,21 +2167,21 @@ + "1: \n\t" + "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // ? ? ? A + "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // ? ? ? C -+ "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // D ? ? C -+ "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // B ? ? A ++ "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // D ? ? C ++ "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // B ? ? A + "shufps $0xCC, %%xmm1, %%xmm0 \n\t" // D C B A + "mulps 1024+"MANGLE(sseWindow)"(%%"REG_S"), %%xmm0\n\t" + "movaps %%xmm0, (%1, %%"REG_S") \n\t" + "add $16, %%"REG_S" \n\t" + "sub $16, %%"REG_D" \n\t" -+ "cmp $512, %%"REG_S" \n\t" ++ "cmp $512, %%"REG_S" \n\t" + " jb 1b \n\t" + :: "r" (buf+64), "r" (delay_ptr) + : "%"REG_S, "%"REG_D + ); + delay_ptr+=128; +// window_ptr-=128; -+ ++ + __asm__ volatile( + "mov $1024, %%"REG_D" \n\t" // 1024 + "xor %%"REG_S", %%"REG_S" \n\t" // 0 @@ -2189,14 +2189,14 @@ + "1: \n\t" + "movlps (%0, %%"REG_S"), %%xmm0 \n\t" // ? ? A ? + "movlps 8(%0, %%"REG_S"), %%xmm1 \n\t" // ? ? C ? -+ "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // ? D C ? -+ "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // ? B A ? ++ "movhps -16(%0, %%"REG_D"), %%xmm1 \n\t" // ? D C ? ++ "movhps -8(%0, %%"REG_D"), %%xmm0 \n\t" // ? B A ? + "shufps $0x99, %%xmm1, %%xmm0 \n\t" // D C B A + "mulps 1536+"MANGLE(sseWindow)"(%%"REG_S"), %%xmm0\n\t" + "movaps %%xmm0, (%1, %%"REG_S") \n\t" + "add $16, %%"REG_S" \n\t" + "sub $16, %%"REG_D" \n\t" -+ "cmp $512, %%"REG_S" \n\t" ++ "cmp $512, %%"REG_S" \n\t" + " jb 1b \n\t" + :: "r" (buf), "r" (delay_ptr) + : "%"REG_S, "%"REG_D @@ -2208,13 +2208,13 @@ { int i, k; @@ -364,7 +1141,7 @@ - + void a52_imdct_init (uint32_t mm_accel) { - int i, k; + int i, j, k; double sum; - + /* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */ @@ -416,6 +1193,99 @@ post2[i].real = cos ((M_PI / 128) * (i + 0.5)); @@ -2236,12 +2236,12 @@ + sseSinCos1c[2*i+0]= xcos1[i]; + sseSinCos1c[2*i+1]= -xcos1[i]; + sseSinCos1d[2*i+0]= xsin1[i]; -+ sseSinCos1d[2*i+1]= xsin1[i]; ++ sseSinCos1d[2*i+1]= xsin1[i]; + } + for (i = 1; i < 7; i++) { + j = 1 << i; + for (k = 0; k < j; k+=2) { -+ ++ + sseW[i][4*k + 0] = w[i][k+0].real; + sseW[i][4*k + 1] = w[i][k+0].real; + sseW[i][4*k + 2] = w[i][k+1].real; @@ -2250,15 +2250,15 @@ + sseW[i][4*k + 4] = -w[i][k+0].imag; + sseW[i][4*k + 5] = w[i][k+0].imag; + sseW[i][4*k + 6] = -w[i][k+1].imag; -+ sseW[i][4*k + 7] = w[i][k+1].imag; -+ ++ sseW[i][4*k + 7] = w[i][k+1].imag; ++ + //we multiply more or less uninitalized numbers so we need to use exactly 0.0 + if(k==0) + { +// sseW[i][4*k + 0]= sseW[i][4*k + 1]= 1.0; + sseW[i][4*k + 4]= sseW[i][4*k + 5]= 0.0; + } -+ ++ + if(2*k == j) + { + sseW[i][4*k + 0]= sseW[i][4*k + 1]= 0.0; @@ -2270,9 +2270,9 @@ + for(i=0; i<128; i++) + { + sseWindow[2*i+0]= -a52_imdct_window[2*i+0]; -+ sseWindow[2*i+1]= a52_imdct_window[2*i+1]; ++ sseWindow[2*i+1]= a52_imdct_window[2*i+1]; + } -+ ++ + for(i=0; i<64; i++) + { + sseWindow[256 + 2*i+0]= -a52_imdct_window[254 - 2*i+1]; @@ -2313,7 +2313,7 @@ + } + else +#endif - + #ifdef LIBA52_DJBFFT if (mm_accel & MM_ACCEL_DJBFFT) { @@ -426,7 +1296,5 @@ @@ -2336,26 +2336,26 @@ + +/* PPC accelerations */ +#define MM_ACCEL_PPC_ALTIVEC 0x00010000 - + uint32_t mm_accel (void); - + --- liba52/parse.c 2006-12-05 08:08:01.000000000 +0100 +++ liba52/parse.c 2006-12-05 08:08:44.000000000 +0100 @@ -24,6 +28,7 @@ #include "config.h" - + #include <stdlib.h> +#include <stdio.h> #include <string.h> #include <inttypes.h> - + @@ -31,13 +36,12 @@ #include "a52_internal.h" #include "bitstream.h" #include "tables.h" +#include "mm_accel.h" +#include "libavutil/avutil.h" - + -#ifdef HAVE_MEMALIGN +#if HAVE_MEMALIGN /* some systems have memalign() but no declaration for it */ @@ -2364,13 +2364,13 @@ -/* assume malloc alignment is sufficient */ -#define memalign(align,size) malloc (size) #endif - + typedef struct { @@ -60,7 +64,16 @@ if (state == NULL) return NULL; - -+#if defined(__MINGW32__) && defined(HAVE_SSE) + ++#if defined(__MINGW32__) && defined(HAVE_SSE) + state->samples = av_malloc(256 * 12 * sizeof (sample_t)); +#else state->samples = memalign (16, 256 * 12 * sizeof (sample_t)); @@ -2378,30 +2378,30 @@ + if(((int)state->samples%16) && (mm_accel&MM_ACCEL_X86_SSE)){ + mm_accel &=~MM_ACCEL_X86_SSE; + fprintf(stderr, "liba52: unable to get 16 byte aligned memory disabling usage of SSE instructions\n"); -+ } -+ ++ } ++ if (state->samples == NULL) { free (state); return NULL; @@ -74,6 +87,7 @@ state->lfsr_state = 1; - + a52_imdct_init (mm_accel); + downmix_accel_init(mm_accel); - + return state; } @@ -141,7 +155,7 @@ state->acmod = acmod = buf[6] >> 5; - + a52_bitstream_set_ptr (state, buf + 6); - bitstream_get (state, 3); /* skip acmod we already parsed */ + bitstream_skip (state, 3); /* skip acmod we already parsed */ - + if ((acmod == 2) && (bitstream_get (state, 2) == 2)) /* dsurmod */ acmod = A52_DOLBY; @@ -172,28 +186,28 @@ - + chaninfo = !acmod; do { - bitstream_get (state, 5); /* dialnorm */ @@ -2416,27 +2416,27 @@ - bitstream_get (state, 7); /* mixlevel + roomtyp */ + bitstream_skip (state, 7); /* mixlevel + roomtyp */ } while (chaninfo--); - + - bitstream_get (state, 2); /* copyrightb + origbs */ + bitstream_skip (state, 2); /* copyrightb + origbs */ - + if (bitstream_get (state, 1)) /* timecod1e */ - bitstream_get (state, 14); /* timecod1 */ + bitstream_skip (state, 14); /* timecod1 */ if (bitstream_get (state, 1)) /* timecod2e */ - bitstream_get (state, 14); /* timecod2 */ + bitstream_skip (state, 14); /* timecod2 */ - + if (bitstream_get (state, 1)) { /* addbsie */ int addbsil; - + addbsil = bitstream_get (state, 6); do { - bitstream_get (state, 8); /* addbsi */ + bitstream_skip (state, 8); /* addbsi */ } while (addbsil--); } - + @@ -680,7 +694,7 @@ state->fbw_expbap[i].exp[0], state->fbw_expbap[i].exp + 1)) @@ -2453,10 +2453,10 @@ - bitstream_get (state, 8); + bitstream_skip (state, 8); } - + samples = state->samples; @@ -896,6 +910,10 @@ - + void a52_free (a52_state_t * state) { - free (state->samples);
--- a/liba52/parse.c Wed May 13 02:58:57 2009 +0000 +++ b/liba52/parse.c Wed May 13 15:22:13 2009 +0000 @@ -64,7 +64,7 @@ if (state == NULL) return NULL; -#if defined(__MINGW32__) && defined(HAVE_SSE) +#if defined(__MINGW32__) && defined(HAVE_SSE) state->samples = av_malloc(256 * 12 * sizeof (sample_t)); #else state->samples = memalign (16, 256 * 12 * sizeof (sample_t)); @@ -72,8 +72,8 @@ if(((int)state->samples%16) && (mm_accel&MM_ACCEL_X86_SSE)){ mm_accel &=~MM_ACCEL_X86_SSE; fprintf(stderr, "liba52: unable to get 16 byte aligned memory disabling usage of SSE instructions\n"); - } - + } + if (state->samples == NULL) { free (state); return NULL; @@ -274,7 +274,7 @@ case EXP_D15: *(dest++) = exponent; } - } + } return 0; } @@ -322,7 +322,7 @@ int16_t nstate; nstate = dither_lut[state->lfsr_state >> 8] ^ (state->lfsr_state << 8); - + state->lfsr_state = (uint16_t) nstate; return nstate; @@ -652,7 +652,7 @@ cplexpstr = bitstream_get (state, 2); for (i = 0; i < nfchans; i++) chexpstr[i] = bitstream_get (state, 2); - if (state->lfeon) + if (state->lfeon) lfeexpstr = bitstream_get (state, 1); for (i = 0; i < nfchans; i++) @@ -870,7 +870,7 @@ if (blksw[i]) a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i, bias); - else + else a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i, bias); } else { @@ -899,7 +899,7 @@ for (i = 0; i < nfchans; i++) a52_imdct_256 (samples + 256 * i, samples + 1536 + 256 * i, state->bias); - else + else for (i = 0; i < nfchans; i++) a52_imdct_512 (samples + 256 * i, samples + 1536 + 256 * i, state->bias);
--- a/liba52/srfftp.h Wed May 13 02:58:57 2009 +0000 +++ b/liba52/srfftp.h Wed May 13 15:22:13 2009 +0000 @@ -1,5 +1,5 @@ -/* +/* * srfftp.h * * Copyright (C) Yuqing Deng <Yuqing_Deng@brown.edu> - April 2000 @@ -10,7 +10,7 @@ * "Computational Frameworks of the Fast Fourier Transform". * * The ideas and the the organization of code borrowed from djbfft written by - * D. J. Bernstein <djb@cr.py.to>. djbff can be found at + * D. J. Bernstein <djb@cr.py.to>. djbff can be found at * http://cr.yp.to/djbfft.html. * * srfftp.h is free software; you can redistribute it and/or modify @@ -32,19 +32,19 @@ #ifndef SRFFTP_H__ #define SRFFTP_H__ -static complex_t delta16[4] __attribute__((aligned(16))) = +static complex_t delta16[4] __attribute__((aligned(16))) = { {1.00000000000000, 0.00000000000000}, {0.92387953251129, -0.38268343236509}, {0.70710678118655, -0.70710678118655}, {0.38268343236509, -0.92387953251129}}; -static complex_t delta16_3[4] __attribute__((aligned(16))) = +static complex_t delta16_3[4] __attribute__((aligned(16))) = { {1.00000000000000, 0.00000000000000}, {0.38268343236509, -0.92387953251129}, {-0.70710678118655, -0.70710678118655}, {-0.92387953251129, 0.38268343236509}}; -static complex_t delta32[8] __attribute__((aligned(16))) = +static complex_t delta32[8] __attribute__((aligned(16))) = { {1.00000000000000, 0.00000000000000}, {0.98078528040323, -0.19509032201613}, {0.92387953251129, -0.38268343236509}, @@ -54,7 +54,7 @@ {0.38268343236509, -0.92387953251129}, {0.19509032201613, -0.98078528040323}}; -static complex_t delta32_3[8] __attribute__((aligned(16))) = +static complex_t delta32_3[8] __attribute__((aligned(16))) = { {1.00000000000000, 0.00000000000000}, {0.83146961230255, -0.55557023301960}, {0.38268343236509, -0.92387953251129}, @@ -64,7 +64,7 @@ {-0.92387953251129, 0.38268343236509}, {-0.55557023301960, 0.83146961230255}}; -static complex_t delta64[16] __attribute__((aligned(16))) = +static complex_t delta64[16] __attribute__((aligned(16))) = { {1.00000000000000, 0.00000000000000}, {0.99518472667220, -0.09801714032956}, {0.98078528040323, -0.19509032201613}, @@ -82,7 +82,7 @@ {0.19509032201613, -0.98078528040323}, {0.09801714032956, -0.99518472667220}}; -static complex_t delta64_3[16] __attribute__((aligned(16))) = +static complex_t delta64_3[16] __attribute__((aligned(16))) = { {1.00000000000000, 0.00000000000000}, {0.95694033573221, -0.29028467725446}, {0.83146961230255, -0.55557023301960}, @@ -100,7 +100,7 @@ {-0.55557023301960, 0.83146961230255}, {-0.29028467725446, 0.95694033573221}}; -static complex_t delta128[32] __attribute__((aligned(16))) = +static complex_t delta128[32] __attribute__((aligned(16))) = { {1.00000000000000, 0.00000000000000}, {0.99879545620517, -0.04906767432742}, {0.99518472667220, -0.09801714032956}, @@ -134,7 +134,7 @@ {0.09801714032956, -0.99518472667220}, {0.04906767432742, -0.99879545620517}}; -static complex_t delta128_3[32] __attribute__((aligned(16))) = +static complex_t delta128_3[32] __attribute__((aligned(16))) = { {1.00000000000000, 0.00000000000000}, {0.98917650996478, -0.14673047445536}, {0.95694033573221, -0.29028467725446},
--- a/liba52/srfftp_3dnow.h Wed May 13 02:58:57 2009 +0000 +++ b/liba52/srfftp_3dnow.h Wed May 13 15:22:13 2009 +0000 @@ -1,4 +1,4 @@ -/* +/* * srfftp.h * * Copyright (C) Yuqing Deng <Yuqing_Deng@brown.edu> - April 2000 @@ -9,7 +9,7 @@ * "Computational Frameworks of the Fast Fourier Transform". * * The ideas and the the organization of code borrowed from djbfft written by - * D. J. Bernstein <djb@cr.py.to>. djbff can be found at + * D. J. Bernstein <djb@cr.py.to>. djbff can be found at * http://cr.yp.to/djbfft.html. * * srfftp.h is free software; you can redistribute it and/or modify @@ -26,7 +26,7 @@ * along with GNU Make; see the file COPYING. If not, write to * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. * - * Modified for using AMD's 3DNow! - 3DNowEx(DSP)! SIMD operations + * Modified for using AMD's 3DNow! - 3DNowEx(DSP)! SIMD operations * by Nick Kurshev <nickols_k@mail.ru> */
--- a/liba52/test.c Wed May 13 02:58:57 2009 +0000 +++ b/liba52/test.c Wed May 13 15:22:13 2009 +0000 @@ -21,7 +21,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -//#define TIMING //needs Pentium or newer +//#define TIMING //needs Pentium or newer #include <stdio.h> #include <stdlib.h> @@ -80,7 +80,7 @@ if(gCpuCaps.hasSSE) accel |= MM_ACCEL_X86_SSE; if(gCpuCaps.has3DNow) accel |= MM_ACCEL_X86_3DNOW; // if(gCpuCaps.has3DNowExt) accel |= MM_ACCEL_X86_3DNOWEXT; - + state = a52_init (accel); if (state == NULL) { fprintf (stderr, "A52 init failed\n"); @@ -112,13 +112,13 @@ while(buf_size<length){ buf[buf_size++]=getchar(); } - + buf_size=0; // decode: flags=A52_STEREO; //A52_STEREO; //A52_DOLBY; //A52_STEREO; // A52_DOLBY // A52_2F2R // A52_3F2R | A52_LFE channels=2; - + flags |= A52_ADJUST_LEVEL; STARTTIMING if (a52_frame (state, buf, &flags, &level, bias))
--- a/libfaad2/analysis.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/analysis.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/bits.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/bits.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/cfft.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/cfft.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_1.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_1.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_10.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_10.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_11.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_11.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_2.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_2.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_3.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_3.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_4.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_4.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_5.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_5.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_6.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_6.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_7.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_7.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_8.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_8.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_9.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_9.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/codebook/hcb_sf.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/codebook/hcb_sf.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/decoder.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/decoder.c Wed May 13 15:22:13 2009 +0000 @@ -465,8 +465,8 @@ if ((channels == DRMCH_MONO) || (channels == DRMCH_STEREO)) (*hDecoder)->sbr_present_flag = 0; else - (*hDecoder)->sbr_present_flag = 1; -#endif + (*hDecoder)->sbr_present_flag = 1; +#endif (*hDecoder)->fb = filter_bank_init((*hDecoder)->frameLength);
--- a/libfaad2/decoder.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/decoder.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/drc.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/drc.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/drc.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/drc.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/drm_dec.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/drm_dec.c Wed May 13 15:22:13 2009 +0000 @@ -46,7 +46,7 @@ /* binary search huffman tables */ -static const int8_t f_huffman_sa[][2] = +static const int8_t f_huffman_sa[][2] = { { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ { 2, 3 }, /* index 1: 2 bits: 1x */ @@ -64,7 +64,7 @@ { /*-7*/ -22, /*-6*/ -21 } /* index 13: 7 bits: 111111x */ }; -static const int8_t t_huffman_sa[][2] = +static const int8_t t_huffman_sa[][2] = { { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ { 2, 3 }, /* index 1: 2 bits: 1x */ @@ -82,7 +82,7 @@ { /*6*/ -9, /*7*/ -8 } /* index 13: 9 bits: 11111111x */ }; -static const int8_t f_huffman_pan[][2] = +static const int8_t f_huffman_pan[][2] = { { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */ @@ -114,7 +114,7 @@ { /*12*/ -3, /*14*/ -1 } /* index 27: 16 bits: 111111111111111x */ }; -static const int8_t t_huffman_pan[][2] = +static const int8_t t_huffman_pan[][2] = { { /*0*/ -15, 1 }, /* index 0: 1 bits: x */ { /*-1*/ -16, 2 }, /* index 1: 2 bits: 1x */ @@ -147,7 +147,7 @@ }; /* There are 3 classes in the standard but the last 2 are identical */ -static const real_t sa_quant[8][2] = +static const real_t sa_quant[8][2] = { { FRAC_CONST(0.0000), FRAC_CONST(0.0000) }, { FRAC_CONST(0.0501), FRAC_CONST(0.1778) }, @@ -161,7 +161,7 @@ /* We don't need the actual quantizer values */ #if 0 -static const real_t pan_quant[8][5] = +static const real_t pan_quant[8][5] = { { COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000), COEF_CONST(0.0000) }, { COEF_CONST(0.1661), COEF_CONST(0.1661), COEF_CONST(0.3322), COEF_CONST(0.3322), COEF_CONST(0.3322) }, @@ -200,35 +200,35 @@ /* 2^(pan_quant[x][y]/30) */ static const real_t pan_pow_2_30_pos[8][5] = { - { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, - { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) }, - { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933), COEF_CONST(1.019373909), COEF_CONST(1.019373909) }, - { COEF_CONST(1.011579706), COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) }, + { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, + { COEF_CONST(1.003845098), COEF_CONST(1.003845098), COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.007704982) }, + { COEF_CONST(1.007704982), COEF_CONST(1.007704982), COEF_CONST(1.01546933), COEF_CONST(1.019373909), COEF_CONST(1.019373909) }, + { COEF_CONST(1.011579706), COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.039123167) }, { COEF_CONST(1.01546933), COEF_CONST(1.023293502), COEF_CONST(1.035142941), COEF_CONST(1.051155908), COEF_CONST(1.059252598) }, - { COEF_CONST(1.019373909), COEF_CONST(1.03117796), COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263) }, - { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) }, + { COEF_CONST(1.019373909), COEF_CONST(1.03117796), COEF_CONST(1.051155908), COEF_CONST(1.071518432), COEF_CONST(1.0839263) }, + { COEF_CONST(1.023293502), COEF_CONST(1.043118698), COEF_CONST(1.067414119), COEF_CONST(1.092277933), COEF_CONST(1.113439626) }, { COEF_CONST(1.03117796), COEF_CONST(1.055195268), COEF_CONST(1.0839263), COEF_CONST(1.113439626), COEF_CONST(1.143756546) } }; /* 2^(-pan_quant[x][y]/30) */ static const real_t pan_pow_2_30_neg[8][5] = { { COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1), COEF_CONST(1) }, - { COEF_CONST(0.99616963), COEF_CONST(0.99616963), COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393) }, - { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) }, - { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) }, - { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) }, - { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) }, - { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) }, + { COEF_CONST(0.99616963), COEF_CONST(0.99616963), COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.99235393) }, + { COEF_CONST(0.992353931), COEF_CONST(0.992353931), COEF_CONST(0.984766325), COEF_CONST(0.980994305), COEF_CONST(0.980994305) }, + { COEF_CONST(0.988552848), COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.962349827) }, + { COEF_CONST(0.984766325), COEF_CONST(0.977236734), COEF_CONST(0.966050157), COEF_CONST(0.951333663), COEF_CONST(0.944061881) }, + { COEF_CONST(0.980994305), COEF_CONST(0.969764715), COEF_CONST(0.951333663), COEF_CONST(0.933255062), COEF_CONST(0.922571949) }, + { COEF_CONST(0.977236734), COEF_CONST(0.958663671), COEF_CONST(0.936843519), COEF_CONST(0.915517901), COEF_CONST(0.898117847) }, { COEF_CONST(0.969764715), COEF_CONST(0.947691892), COEF_CONST(0.922571949), COEF_CONST(0.898117847), COEF_CONST(0.874311936) } }; static const real_t g_decayslope[MAX_SA_BAND] = { - 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), - 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), + 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), + 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), 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), - FRAC_CONST(0.05),FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), - FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), - FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), + FRAC_CONST(0.05),FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), + FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), + FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0), FRAC_CONST(0) }; @@ -243,26 +243,26 @@ { FRAC_CONST(0.929071574), FRAC_CONST(0) } }; -static const uint8_t sa_freq_scale[9][2] = +static const uint8_t sa_freq_scale[9][2] = { - { 0, 0}, - { 1, 1}, - { 2, 2}, - { 3, 3}, - { 5, 5}, - { 7, 7}, - {10,10}, - {13,13}, + { 0, 0}, + { 1, 1}, + { 2, 2}, + { 3, 3}, + { 5, 5}, + { 7, 7}, + {10,10}, + {13,13}, {46,23} }; -static const uint8_t pan_freq_scale[21] = +static const uint8_t pan_freq_scale[21] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 18, 22, 26, 32, 64 }; -static const uint8_t pan_quant_class[20] = +static const uint8_t pan_quant_class[20] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4 @@ -270,42 +270,42 @@ /* Inverse mapping lookup */ static const uint8_t pan_inv_freq[64] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19 }; static const uint8_t sa_inv_freq[MAX_SA_BAND] = { 0, 1, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 }; -static const real_t filter_coeff[] = +static const real_t filter_coeff[] = { FRAC_CONST(0.65143905754106), FRAC_CONST(0.56471812200776), FRAC_CONST(0.48954165955695) }; -static const uint8_t delay_length[][2] = +static const uint8_t delay_length[][2] = { { 1, 3 }, { 2, 4 }, { 3, 5 } }; -static const real_t delay_fraction[] = +static const real_t delay_fraction[] = { FRAC_CONST(0.43), FRAC_CONST(0.75), FRAC_CONST(0.347) }; -static const real_t peak_decay[2] = +static const real_t peak_decay[2] = { FRAC_CONST(0.58664621951003), FRAC_CONST(0.76592833836465) }; -static const real_t smooth_coeff[2] = +static const real_t smooth_coeff[2] = { FRAC_CONST(0.6), FRAC_CONST(0.25) }; @@ -545,7 +545,7 @@ } static int8_t pan_delta_clip(drm_ps_info *ps, int8_t i) -{ +{ if (i < -7) { /* printf(" PANminclip %d", i); */ ps->pan_decode_error = 1; @@ -558,34 +558,34 @@ return i; } -static void drm_ps_delta_decode(drm_ps_info *ps) +static void drm_ps_delta_decode(drm_ps_info *ps) { - uint8_t band; + uint8_t band; - if (ps->bs_enable_sa) - { - if (ps->bs_sa_dt_flag && !ps->g_last_had_sa) - { + if (ps->bs_enable_sa) + { + if (ps->bs_sa_dt_flag && !ps->g_last_had_sa) + { for (band = 0; band < DRM_NUM_SA_BANDS; band++) - { + { ps->g_prev_sa_index[band] = 0; - } - } + } + } if (ps->bs_sa_dt_flag) { - ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]); + ps->g_sa_index[0] = sa_delta_clip(ps, ps->g_prev_sa_index[0]+ps->bs_sa_data[0]); } else { - ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]); + ps->g_sa_index[0] = sa_delta_clip(ps,ps->bs_sa_data[0]); } - + for (band = 1; band < DRM_NUM_SA_BANDS; band++) - { + { if (ps->bs_sa_dt_flag) { ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_prev_sa_index[band] + ps->bs_sa_data[band]); } else { - ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]); + ps->g_sa_index[band] = sa_delta_clip(ps, ps->g_sa_index[band-1] + ps->bs_sa_data[band]); } } } @@ -597,45 +597,45 @@ ps->bs_enable_pan = ps->g_last_had_pan; ps->bs_enable_sa = ps->g_last_had_sa; } - - - if (ps->bs_enable_sa) - { + + + if (ps->bs_enable_sa) + { if (ps->sa_decode_error) { for (band = 0; band < DRM_NUM_SA_BANDS; band++) - { + { ps->g_sa_index[band] = ps->g_last_good_sa_index[band]; } } else { for (band = 0; band < DRM_NUM_SA_BANDS; band++) - { + { ps->g_last_good_sa_index[band] = ps->g_sa_index[band]; } } } - - if (ps->bs_enable_pan) + + if (ps->bs_enable_pan) { - if (ps->bs_pan_dt_flag && !ps->g_last_had_pan) + if (ps->bs_pan_dt_flag && !ps->g_last_had_pan) { /* The DRM PS spec doesn't say anything about this case. (deltacoded in time without a previous frame) - AAC PS spec you must tread previous frame as 0, so that's what we try. + AAC PS spec you must tread previous frame as 0, so that's what we try. */ for (band = 0; band < DRM_NUM_PAN_BANDS; band++) - { + { ps->g_prev_pan_index[band] = 0; } - } + } if (ps->bs_pan_dt_flag) - { + { ps->g_pan_index[0] = pan_delta_clip(ps, ps->g_prev_pan_index[0]+ps->bs_pan_data[0]); } else { ps->g_pan_index[0] = pan_delta_clip(ps, ps->bs_pan_data[0]); } - + for (band = 1; band < DRM_NUM_PAN_BANDS; band++) - { + { if (ps->bs_pan_dt_flag) { ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_prev_pan_index[band] + ps->bs_pan_data[band]); @@ -643,23 +643,23 @@ ps->g_pan_index[band] = pan_delta_clip(ps, ps->g_pan_index[band-1] + ps->bs_pan_data[band]); } } - + if (ps->pan_decode_error) { for (band = 0; band < DRM_NUM_PAN_BANDS; band++) - { + { ps->g_pan_index[band] = ps->g_last_good_pan_index[band]; } } else { for (band = 0; band < DRM_NUM_PAN_BANDS; band++) - { + { ps->g_last_good_pan_index[band] = ps->g_pan_index[band]; } } } } -static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t rateselect) -{ +static void drm_calc_sa_side_signal(drm_ps_info *ps, qmf_t X[38][64], uint8_t rateselect) +{ uint8_t s, b, k; complex_t qfrac, tmp0, tmp, in, R0; real_t peakdiff; @@ -675,7 +675,7 @@ for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++) { - /* set delay indices */ + /* set delay indices */ for (k = 0; k < NUM_OF_LINKS; k++) temp_delay_ser[k] = ps->delay_buf_index_ser[k]; @@ -683,7 +683,7 @@ IM(Phi_Fract) = IM(Phi_Fract_Qmf[b]); for (s = 0; s < NUM_OF_SUBSAMPLES; s++) - { + { const real_t gamma = REAL_CONST(1.5); const real_t sigma = REAL_CONST(1.5625); @@ -718,8 +718,8 @@ } else { transratio = MUL_R(DIV_R(nrg, MUL_R(peakdiff, gamma)), sigma); } - - for (k = 0; k < NUM_OF_LINKS; k++) + + for (k = 0; k < NUM_OF_LINKS; k++) { new_delay_slopes[k] = MUL_F(g_decayslope[b], filter_coeff[k]); } @@ -731,14 +731,14 @@ IM(ps->d_buff[0][b]) = IM(ps->d_buff[1][b]); RE(ps->d_buff[1][b]) = RE(in); - IM(ps->d_buff[1][b]) = IM(in); + IM(ps->d_buff[1][b]) = IM(in); ComplexMult(&RE(tmp), &IM(tmp), RE(tmp0), IM(tmp0), RE(Phi_Fract), IM(Phi_Fract)); RE(R0) = RE(tmp); IM(R0) = IM(tmp); - for (k = 0; k < NUM_OF_LINKS; k++) + for (k = 0; k < NUM_OF_LINKS; k++) { RE(qfrac) = RE(Q_Fract_allpass_Qmf[b][k]); IM(qfrac) = IM(Q_Fract_allpass_Qmf[b][k]); @@ -766,19 +766,19 @@ if (++temp_delay_ser[k] >= delay_length[k][rateselect]) temp_delay_ser[k] = 0; } - } + } } for (k = 0; k < NUM_OF_LINKS; k++) ps->delay_buf_index_ser[k] = temp_delay_ser[k]; } -static void drm_add_ambiance(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) +static void drm_add_ambiance(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) { - uint8_t s, b, ifreq, qclass; + uint8_t s, b, ifreq, qclass; 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]; real_t new_dir_map, new_sa_map; - + if (ps->bs_enable_sa) { /* Instead of dequantization and mapping, we use an inverse mapping @@ -793,11 +793,11 @@ sa_map[b] = sa_quant[ps->g_prev_sa_index[ifreq]][qclass]; new_sa_map = sa_quant[ps->g_sa_index[ifreq]][qclass]; - k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b])); - - sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass]; + k_sa_map[b] = MUL_F(inv_f_num_of_subsamples, (new_sa_map - sa_map[b])); + + sa_dir_map[b] = sa_sqrt_1_minus[ps->g_prev_sa_index[ifreq]][qclass]; new_dir_map = sa_sqrt_1_minus[ps->g_sa_index[ifreq]][qclass]; - + k_sa_dir_map[b] = MUL_F(inv_f_num_of_subsamples, (new_dir_map - sa_dir_map[b])); } @@ -805,35 +805,35 @@ for (s = 0; s < NUM_OF_SUBSAMPLES; s++) { for (b = 0; b < sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b++) - { + { 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]); 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]); 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]); 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]); - + sa_map[b] += k_sa_map[b]; sa_dir_map[b] += k_sa_dir_map[b]; } for (b = sa_freq_scale[DRM_NUM_SA_BANDS][rateselect]; b < NUM_OF_QMF_CHANNELS; b++) - { + { QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]); QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); } } - } + } else { for (s = 0; s < NUM_OF_SUBSAMPLES; s++) { for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) { QMF_RE(X_right[s][b]) = QMF_RE(X_left[s][b]); - QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); + QMF_IM(X_right[s][b]) = QMF_IM(X_left[s][b]); } } } } -static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) +static void drm_add_pan(drm_ps_info *ps, uint8_t rateselect, qmf_t X_left[38][64], qmf_t X_right[38][64]) { uint8_t s, b, qclass, ifreq; real_t tmp, coeff1, coeff2; @@ -843,7 +843,7 @@ if (ps->bs_enable_pan) { - for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) + for (b = 0; b < NUM_OF_QMF_CHANNELS; b++) { /* Instead of dequantization, 20->64 mapping and 2^G(x,y) we do an inverse mapping 64->20 and look up the 2^G(x,y) values directly */ @@ -852,7 +852,7 @@ if (ps->g_prev_pan_index[ifreq] >= 0) { - pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass]; + pan_base[b] = pan_pow_2_pos[ps->g_prev_pan_index[ifreq]][qclass]; } else { pan_base[b] = pan_pow_2_neg[-ps->g_prev_pan_index[ifreq]][qclass]; } @@ -861,7 +861,7 @@ /* a en b can be negative so we may need to inverse parts */ if (ps->g_pan_index[ifreq] >= 0) { - if (ps->g_prev_pan_index[ifreq] >= 0) + if (ps->g_prev_pan_index[ifreq] >= 0) { pan_delta[b] = MUL_C(pan_pow_2_30_pos[ps->g_pan_index[ifreq]][qclass], pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]); @@ -870,7 +870,7 @@ pan_pow_2_30_pos[-ps->g_prev_pan_index[ifreq]][qclass]); } } else { - if (ps->g_prev_pan_index[ifreq] >= 0) + if (ps->g_prev_pan_index[ifreq] >= 0) { pan_delta[b] = MUL_C(pan_pow_2_30_neg[-ps->g_pan_index[ifreq]][qclass], pan_pow_2_30_neg[ps->g_prev_pan_index[ifreq]][qclass]); @@ -889,7 +889,7 @@ tmp = pan_base[b]; coeff2 = DIV_R(REAL_CONST(2.0), (REAL_CONST(1.0) + tmp)); - coeff1 = MUL_R(coeff2, tmp); + coeff1 = MUL_R(coeff2, tmp); QMF_RE(temp_l) = QMF_RE(X_left[s][b]); QMF_IM(temp_l) = QMF_IM(X_left[s][b]); @@ -900,20 +900,20 @@ QMF_IM(X_left[s][b]) = MUL_R(QMF_IM(temp_l), coeff1); QMF_RE(X_right[s][b]) = MUL_R(QMF_RE(temp_r), coeff2); QMF_IM(X_right[s][b]) = MUL_R(QMF_IM(temp_r), coeff2); - + /* 2^(a+k*b) = 2^a * 2^b * ... * 2^b */ /* ^^^^^^^^^^^^^^^ k times */ pan_base[b] = MUL_C(pan_base[b], pan_delta[b]); - } - } - } + } + } + } } drm_ps_info *drm_ps_init(void) { drm_ps_info *ps = (drm_ps_info*)faad_malloc(sizeof(drm_ps_info)); - memset(ps, 0, sizeof(drm_ps_info)); + memset(ps, 0, sizeof(drm_ps_info)); return ps; } @@ -927,14 +927,14 @@ uint8_t drm_ps_decode(drm_ps_info *ps, uint8_t guess, uint32_t samplerate, qmf_t X_left[38][64], qmf_t X_right[38][64]) { uint8_t rateselect = (samplerate >= 24000); - - if (ps == NULL) + + if (ps == NULL) { memcpy(X_right, X_left, sizeof(qmf_t)*30*64); - return 0; - } + return 0; + } - if (!ps->drm_ps_data_available && !guess) + if (!ps->drm_ps_data_available && !guess) { memcpy(X_right, X_left, sizeof(qmf_t)*30*64); memset(ps->g_prev_sa_index, 0, sizeof(ps->g_prev_sa_index)); @@ -949,13 +949,13 @@ ps->sa_decode_error = 0; ps->pan_decode_error = 0; drm_ps_delta_decode(ps); - } else + } else { ps->sa_decode_error = 1; ps->pan_decode_error = 1; /* don't even bother decoding */ } - + ps->drm_ps_data_available = 0; drm_calc_sa_side_signal(ps, X_left, rateselect); @@ -963,19 +963,19 @@ if (ps->bs_enable_sa) { - ps->g_last_had_sa = 1; + ps->g_last_had_sa = 1; - memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS); + memcpy(ps->g_prev_sa_index, ps->g_sa_index, sizeof(int8_t) * DRM_NUM_SA_BANDS); } else { ps->g_last_had_sa = 0; } - + if (ps->bs_enable_pan) { drm_add_pan(ps, rateselect, X_left, X_right); - - ps->g_last_had_pan = 1; + + ps->g_last_had_pan = 1; memcpy(ps->g_prev_pan_index, ps->g_pan_index, sizeof(int8_t) * DRM_NUM_PAN_BANDS);
--- a/libfaad2/drm_dec.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/drm_dec.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -45,7 +45,7 @@ #define MAX_DELAY 5 typedef struct -{ +{ uint8_t drm_ps_data_available; uint8_t bs_enable_sa; uint8_t bs_enable_pan; @@ -58,28 +58,28 @@ int8_t bs_sa_data[DRM_NUM_SA_BANDS]; int8_t bs_pan_data[DRM_NUM_PAN_BANDS]; - + int8_t g_sa_index[DRM_NUM_SA_BANDS]; - int8_t g_pan_index[DRM_NUM_PAN_BANDS]; + int8_t g_pan_index[DRM_NUM_PAN_BANDS]; int8_t g_prev_sa_index[DRM_NUM_SA_BANDS]; - int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS]; + int8_t g_prev_pan_index[DRM_NUM_PAN_BANDS]; int8_t sa_decode_error; int8_t pan_decode_error; int8_t g_last_good_sa_index[DRM_NUM_SA_BANDS]; int8_t g_last_good_pan_index[DRM_NUM_PAN_BANDS]; - - qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND]; + + qmf_t SA[NUM_OF_SUBSAMPLES][MAX_SA_BAND]; complex_t d_buff[2][MAX_SA_BAND]; complex_t d2_buff[NUM_OF_LINKS][MAX_DELAY][MAX_SA_BAND]; - uint8_t delay_buf_index_ser[NUM_OF_LINKS]; - + uint8_t delay_buf_index_ser[NUM_OF_LINKS]; + real_t prev_nrg[MAX_SA_BAND]; real_t prev_peakdiff[MAX_SA_BAND]; - real_t peakdecay_fast[MAX_SA_BAND]; + real_t peakdecay_fast[MAX_SA_BAND]; } drm_ps_info;
--- a/libfaad2/error.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/error.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/error.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/error.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/filtbank.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/filtbank.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/filtbank.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/filtbank.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/fixed.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/fixed.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/hcr.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/hcr.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2004 G.C. Pascutto, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -34,15 +34,15 @@ #include "specrec.h" #include "huffman.h" -/* ISO/IEC 14496-3/Amd.1 - * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR) +/* ISO/IEC 14496-3/Amd.1 + * 8.5.3.3: Huffman Codeword Reordering for AAC spectral data (HCR) * - * HCR devides the spectral data in known fixed size segments, and - * sorts it by the importance of the data. The importance is firstly - * the (lower) position in the spectrum, and secondly the largest - * value in the used codebook. + * HCR devides the spectral data in known fixed size segments, and + * sorts it by the importance of the data. The importance is firstly + * the (lower) position in the spectrum, and secondly the largest + * value in the used codebook. * The most important data is written at the start of each segment - * (at known positions), the remaining data is interleaved inbetween, + * (at known positions), the remaining data is interleaved inbetween, * with the writing direction alternating. * Data length is not increased. */ @@ -57,10 +57,10 @@ #define VCB11_FIRST 16 #define VCB11_LAST 31 -static const uint8_t PreSortCB_STD[NUM_CB] = +static const uint8_t PreSortCB_STD[NUM_CB] = { 11, 9, 7, 5, 3, 1}; -static const uint8_t PreSortCB_ER[NUM_CB_ER] = +static const uint8_t PreSortCB_ER[NUM_CB_ER] = { 11, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 9, 7, 5, 3, 1}; /* 8.5.3.3.2 Derivation of segment width */ @@ -71,7 +71,7 @@ #define segmentWidth(cb) min(maxCwLen[cb], ics->length_of_longest_codeword) /* bit-twiddling helpers */ -static const uint8_t S[] = {1, 2, 4, 8, 16}; +static const uint8_t S[] = {1, 2, 4, 8, 16}; static const uint32_t B[] = {0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF, 0x0000FFFF}; typedef struct @@ -85,11 +85,11 @@ /* rewind and reverse */ /* 32 bit version */ static uint32_t rewrev_word(uint32_t v, const uint8_t len) -{ +{ /* 32 bit reverse */ - v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); - v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); - v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); + v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); + v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); + v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]); v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]); @@ -101,7 +101,7 @@ /* 64 bit version */ static void rewrev_lword(uint32_t *hi, uint32_t *lo, const uint8_t len) -{ +{ if (len <= 32) { *hi = 0; *lo = rewrev_word(*lo, len); @@ -110,22 +110,22 @@ uint32_t t = *hi, v = *lo; /* double 32 bit reverse */ - v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); - t = ((t >> S[0]) & B[0]) | ((t << S[0]) & ~B[0]); - v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); - t = ((t >> S[1]) & B[1]) | ((t << S[1]) & ~B[1]); - v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); - t = ((t >> S[2]) & B[2]) | ((t << S[2]) & ~B[2]); + v = ((v >> S[0]) & B[0]) | ((v << S[0]) & ~B[0]); + t = ((t >> S[0]) & B[0]) | ((t << S[0]) & ~B[0]); + v = ((v >> S[1]) & B[1]) | ((v << S[1]) & ~B[1]); + t = ((t >> S[1]) & B[1]) | ((t << S[1]) & ~B[1]); + v = ((v >> S[2]) & B[2]) | ((v << S[2]) & ~B[2]); + t = ((t >> S[2]) & B[2]) | ((t << S[2]) & ~B[2]); v = ((v >> S[3]) & B[3]) | ((v << S[3]) & ~B[3]); t = ((t >> S[3]) & B[3]) | ((t << S[3]) & ~B[3]); - v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]); + v = ((v >> S[4]) & B[4]) | ((v << S[4]) & ~B[4]); t = ((t >> S[4]) & B[4]) | ((t << S[4]) & ~B[4]); /* last 32<>32 bit swap is implicit below */ - + /* shift off low bits (this is really only one 64 bit shift) */ *lo = (t >> (64 - len)) | (v << (len - 32)); - *hi = v >> (64 - len); + *hi = v >> (64 - len); } } @@ -147,7 +147,7 @@ al = a->bufa; ah = a->bufb; - + if (b->len > 32) { /* maskoff superfluous high b bits */ @@ -158,7 +158,7 @@ al = 0; } else { bl = b->bufa & ((1 << (b->len)) - 1); - bh = 0; + bh = 0; ah = (ah << (b->len)) | (al >> (32 - b->len)); al = al << b->len; } @@ -169,7 +169,7 @@ b->len += a->len; } - + uint8_t is_good_cb(uint8_t this_CB, uint8_t this_sec_CB) { /* only want spectral data CB's */ @@ -187,20 +187,20 @@ } return 0; } - + void read_segment(bits_t *segment, uint8_t segwidth, bitfile *ld) { segment->len = segwidth; if (segwidth > 32) { - segment->bufb = faad_getbits(ld, segwidth - 32); - segment->bufa = faad_getbits(ld, 32); + segment->bufb = faad_getbits(ld, segwidth - 32); + segment->bufa = faad_getbits(ld, 32); } else { segment->bufa = faad_getbits(ld, segwidth); - segment->bufb = 0; - } + segment->bufb = 0; + } } void fill_in_codeword(codeword_t *codeword, uint16_t index, uint16_t sp, uint8_t cb) @@ -211,22 +211,22 @@ codeword[index].bits.len = 0; } -uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, +uint8_t reordered_spectral_data(NeAACDecHandle hDecoder, ic_stream *ics, bitfile *ld, int16_t *spectral_data) -{ +{ uint16_t PCWs_done; - uint16_t numberOfSegments, numberOfSets, numberOfCodewords; + uint16_t numberOfSegments, numberOfSets, numberOfCodewords; codeword_t codeword[512]; bits_t segment[512]; uint16_t sp_offset[8]; uint16_t g, i, sortloop, set, bitsread; - uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB; - + uint8_t w_idx, sfb, this_CB, last_CB, this_sec_CB; + const uint16_t nshort = hDecoder->frameLength/8; const uint16_t sp_data_len = ics->length_of_reordered_spectral_data; - + const uint8_t *PreSortCb; /* no data (e.g. silence) */ @@ -236,9 +236,9 @@ /* since there is spectral data, at least one codeword has nonzero length */ if (ics->length_of_longest_codeword == 0) return 10; - + if (sp_data_len < ics->length_of_longest_codeword) - return 10; + return 10; sp_offset[0] = 0; for (g = 1; g < ics->num_window_groups; g++) @@ -261,13 +261,13 @@ PreSortCb = PreSortCB_STD; last_CB = NUM_CB; } - + /* step 1: decode PCW's (set 0), and stuff data in easier-to-use format */ for (sortloop = 0; sortloop < last_CB; sortloop++) { /* select codebook to process this pass */ this_CB = PreSortCb[sortloop]; - + /* loop over sfbs */ for (sfb = 0; sfb < ics->max_sfb; sfb++) { @@ -280,34 +280,34 @@ { /* check whether sfb used here is the one we want to process */ if ((ics->sect_start[g][i] <= sfb) && (ics->sect_end[g][i] > sfb)) - { + { /* check whether codebook used here is the one we want to process */ this_sec_CB = ics->sect_cb[g][i]; - - if (is_good_cb(this_CB, this_sec_CB)) + + if (is_good_cb(this_CB, this_sec_CB)) { /* precalculate some stuff */ uint16_t sect_sfb_size = ics->sect_sfb_offset[g][sfb+1] - ics->sect_sfb_offset[g][sfb]; uint8_t inc = (this_sec_CB < FIRST_PAIR_HCB) ? QUAD_LEN : PAIR_LEN; uint16_t group_cws_count = (4*ics->window_group_length[g])/inc; uint8_t segwidth = segmentWidth(this_sec_CB); - uint16_t cws; + uint16_t cws; - /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */ + /* read codewords until end of sfb or end of window group (shouldn't only 1 trigger?) */ for (cws = 0; (cws < group_cws_count) && ((cws + w_idx*group_cws_count) < sect_sfb_size); cws++) { - uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count); + uint16_t sp = sp_offset[g] + ics->sect_sfb_offset[g][sfb] + inc * (cws + w_idx*group_cws_count); /* read and decode PCW */ if (!PCWs_done) - { + { /* read in normal segments */ if (bitsread + segwidth <= sp_data_len) - { - read_segment(&segment[numberOfSegments], segwidth, ld); + { + read_segment(&segment[numberOfSegments], segwidth, ld); bitsread += segwidth; - - huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]); + + huffman_spectral_data_2(this_sec_CB, &segment[numberOfSegments], &spectral_data[sp]); /* keep leftover bits */ rewrev_bits(&segment[numberOfSegments]); @@ -318,48 +318,48 @@ this in earlier because it might not fit in 64 bits. since we already decoded (and removed) the PCW it is now guaranteed to fit */ if (bitsread < sp_data_len) - { - const uint8_t additional_bits = sp_data_len - bitsread; + { + const uint8_t additional_bits = sp_data_len - bitsread; - read_segment(&segment[numberOfSegments], additional_bits, ld); + read_segment(&segment[numberOfSegments], additional_bits, ld); segment[numberOfSegments].len += segment[numberOfSegments-1].len; - rewrev_bits(&segment[numberOfSegments]); + rewrev_bits(&segment[numberOfSegments]); if (segment[numberOfSegments-1].len > 32) { - segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb + + segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb + showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len - 32); - segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + + segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + showbits_hcr(&segment[numberOfSegments-1], 32); } else { - segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + + segment[numberOfSegments-1].bufa = segment[numberOfSegments].bufa + showbits_hcr(&segment[numberOfSegments-1], segment[numberOfSegments-1].len); segment[numberOfSegments-1].bufb = segment[numberOfSegments].bufb; - } + } segment[numberOfSegments-1].len += additional_bits; } bitsread = sp_data_len; PCWs_done = 1; - fill_in_codeword(codeword, 0, sp, this_sec_CB); + fill_in_codeword(codeword, 0, sp, this_sec_CB); } - } else { - fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB); + } else { + fill_in_codeword(codeword, numberOfCodewords - numberOfSegments, sp, this_sec_CB); } numberOfCodewords++; - } + } } } - } - } + } + } } } } if (numberOfSegments == 0) - return 10; + return 10; - numberOfSets = numberOfCodewords / numberOfSegments; + numberOfSets = numberOfCodewords / numberOfSegments; /* step 2: decode nonPCWs */ for (set = 1; set <= numberOfSets; set++) @@ -382,21 +382,21 @@ { uint8_t tmplen; - if (codeword[codeword_idx].bits.len != 0) - concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits); - + if (codeword[codeword_idx].bits.len != 0) + concat_bits(&segment[segment_idx], &codeword[codeword_idx].bits); + tmplen = segment[segment_idx].len; if (huffman_spectral_data_2(codeword[codeword_idx].cb, &segment[segment_idx], &spectral_data[codeword[codeword_idx].sp_offset]) >= 0) { codeword[codeword_idx].decoded = 1; - } else - { + } else + { codeword[codeword_idx].bits = segment[segment_idx]; - codeword[codeword_idx].bits.len = tmplen; + codeword[codeword_idx].bits.len = tmplen; } - + } } }
--- a/libfaad2/huffman.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/huffman.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -354,7 +354,7 @@ return huffman_2step_pair_sign(cb, ld, sp); case 12: { uint8_t err = huffman_2step_pair(11, ld, sp); - sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1); + sp[0] = huffman_codebook(0); sp[1] = huffman_codebook(1); return err; } case 11: { @@ -443,7 +443,7 @@ vcb11 = cb; cb = 11; } - + cw = showbits_hcr(ld, hcbN[cb]); offset = hcb_table[cb][cw].offset; extra_bits = hcb_table[cb][cw].extra_bits; @@ -466,7 +466,7 @@ while (!hcb3[offset].is_leaf) { uint8_t b; - + if ( get1bit_hcr(ld, &b) ) return -1; offset += hcb3[offset].data[b]; } @@ -485,7 +485,7 @@ while (!hcb_bin_table[cb][offset].is_leaf) { uint8_t b; - + if (get1bit_hcr(ld, &b) ) return -1; offset += hcb_bin_table[cb][offset].data[b]; } @@ -524,7 +524,7 @@ int32_t j; uint32_t off; - neg = (sp[k] < 0) ? 1 : 0; + neg = (sp[k] < 0) ? 1 : 0; for (i = 4; ; i++) { @@ -548,7 +548,7 @@ /* this finds errors in the ESCAPE signal */ vcb11_check_LAV(vcb11, sp); } - } + } return ld->len; }
--- a/libfaad2/huffman.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/huffman.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/ic_predict.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ic_predict.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -51,7 +51,7 @@ tmp |= (uint32_t)0x00010000; /* insert 1 lsb */ tmp2 = tmp; /* add 1 lsb and elided one */ tmp &= (uint32_t)0xff800000; /* extract exponent and sign */ - + *pf = *(float32_t*)&tmp1 + *(float32_t*)&tmp2 - *(float32_t*)&tmp; } else { *pf = *(float32_t*)&tmp;
--- a/libfaad2/ic_predict.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ic_predict.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/iq_table.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/iq_table.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/is.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/is.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/is.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/is.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/kbd_win.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/kbd_win.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/local_changes.diff Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/local_changes.diff Wed May 13 15:22:13 2009 +0000 @@ -9,10 +9,10 @@ +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ +** local_changes.diff contains the exact changes to this file. **/ - + #ifndef __BITS_H__ @@ -58,7 +61,7 @@ - + #if defined (_WIN32) && !defined(_WIN32_WCE) && !defined(__MINGW32__) #define BSWAP(a) __asm mov eax,a __asm bswap eax __asm mov a, eax -#elif defined(LINUX) || defined(DJGPP) || defined(__MINGW32__) @@ -31,10 +31,10 @@ +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ +** local_changes.diff contains the exact changes to this file. **/ - + #ifndef __COMMON_H__ @@ -32,8 +35,13 @@ - + #ifdef HAVE_CONFIG_H # include "../config.h" #endif @@ -43,19 +43,19 @@ +#if defined(__CYGWIN__) +#define __STRICT_ANSI__ +#endif - + #define INLINE __inline #if 0 //defined(_WIN32) && !defined(_WIN32_WCE) #define ALIGN __declspec(align(16)) @@ -61,7 +67,7 @@ /* Use if target platform has address generators with autoincrement */ //#define PREFER_POINTERS - + -#ifdef _WIN32_WCE +#if defined(_WIN32_WCE) || defined(__arm__) || defined(__avr32__) #define FIXED_POINT #endif - + @@ -117,6 +123,9 @@ # ifdef MAIN_DEC # undef MAIN_DEC @@ -64,12 +64,12 @@ +# undef SBR_DEC +# endif #endif // FIXED_POINT - + #ifdef DRM @@ -151,6 +160,7 @@ - + #include <stdlib.h> - + +#if 0 typedef unsigned __int64 uint64_t; typedef unsigned __int32 uint32_t; @@ -83,11 +83,11 @@ +#endif + typedef float float32_t; - + @@ -289,7 +319,7 @@ } - - + + - #if defined(_WIN32) && !defined(__MINGW32__) + #if defined(_WIN32) && !defined(__MINGW32__) && !HAVE_LRINTF #define HAS_LRINTF @@ -103,9 +103,9 @@ // from http://www.stereopsis.com/FPU.html static INLINE int lrintf(float f) @@ -330,7 +360,7 @@ - + #else - + +#include <math.h> + -#ifdef HAVE_LRINTF @@ -115,7 +115,7 @@ @@ -338,8 +370,6 @@ # define __USE_ISOC99 1 #endif - + - #include <math.h> - #ifdef HAVE_SINF @@ -135,12 +135,12 @@ +** $Id: output.c,v 1.11 2005/04/05 05:43:41 rfelker Exp $ +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ **/ - + #include "common.h" @@ -463,7 +462,7 @@ } } - + -void* output_to_PCM(NeAACDecHandle hDecoder, +void* output_to_PCM_sux(NeAACDecHandle hDecoder, real_t **input, void *sample_buffer, uint8_t channels, @@ -149,7 +149,7 @@ @@ -554,4 +553,51 @@ return sample_buffer; } - + +void* output_to_PCM(NeAACDecHandle hDecoder, + real_t **input, void *sample_buffer, uint8_t channels, + uint16_t frame_len, uint8_t format) @@ -209,10 +209,10 @@ +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ +** local_changes.diff contains the exact changes to this file. **/ - + #include "common.h" @@ -159,7 +162,7 @@ - + /* static function declarations */ static void ps_data_decode(ps_info *ps); -static hyb_info *hybrid_init(); @@ -222,13 +222,13 @@ static void INLINE DCT3_4_unscaled(real_t *y, real_t *x); @@ -189,7 +192,7 @@ /* */ - - + + -static hyb_info *hybrid_init() +static hyb_info *hybrid_init(void) { uint8_t i; - + @@ -1935,8 +1938,8 @@ /* main Parametric Stereo decoding function */ uint8_t ps_decode(ps_info *ps, qmf_t X_left[38][64], qmf_t X_right[38][64]) @@ -237,7 +237,7 @@ - qmf_t X_hybrid_right[32][32] = {{0}}; + qmf_t X_hybrid_left[32][32] = {{{0}}}; + qmf_t X_hybrid_right[32][32] = {{{0}}}; - + /* delta decoding of the bitstream data */ ps_data_decode(ps); --- libfaad2.orig/sbr_dec.c 2006-03-16 20:15:04.000000000 +0100 @@ -251,8 +251,8 @@ +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ +** local_changes.diff contains the exact changes to this file. **/ - - + + @@ -526,8 +529,8 @@ uint8_t l, k; uint8_t dont_process = 0; @@ -261,7 +261,7 @@ - ALIGN qmf_t X_right[38][64] = {{0}}; /* must set this to 0 */ + ALIGN qmf_t X_left[38][64] = {{{0}}}; + ALIGN qmf_t X_right[38][64] = {{{0}}}; /* must set this to 0 */ - + if (sbr == NULL) return 20; --- libfaad2.orig/specrec.c 2006-03-16 20:15:04.000000000 +0100 @@ -278,7 +278,7 @@ +** detailed changelog at http://svn.mplayerhq.hu/mplayer/trunk/ +** local_changes.diff contains the exact changes to this file. **/ - + /* @@ -673,29 +673,19 @@ /* MAIN object type prediction */ @@ -293,7 +293,7 @@ - } } #endif - + #ifdef LTP_DEC if (is_ltp_ot(hDecoder->object_type)) { @@ -306,7 +306,7 @@ - } } #endif - + - if (hDecoder->time_out[channel] == NULL) - { mul = 1; @@ -331,14 +331,14 @@ - } } #endif - + - if (hDecoder->fb_intermed[channel] == NULL) - { - hDecoder->fb_intermed[channel] = (real_t*)faad_malloc(hDecoder->frameLength*sizeof(real_t)); + hDecoder->fb_intermed[channel] = (real_t*)realloc(hDecoder->fb_intermed[channel], hDecoder->frameLength*sizeof(real_t)); memset(hDecoder->fb_intermed[channel], 0, hDecoder->frameLength*sizeof(real_t)); - } - + #ifdef SSR_DEC if (hDecoder->object_type == SSR) { @@ -359,9 +359,9 @@ - } } #endif - + @@ -865,22 +842,14 @@ - + /* always allocate 2 channels, PS can always "suddenly" turn up */ #if (defined(PS_DEC) || defined(DRM_PS)) - output_channels = 2; @@ -369,7 +369,7 @@ #else output_channels = 1; #endif - + - if (hDecoder->element_output_channels[hDecoder->fr_ch_ele] == 0) - { - /* element_output_channels not set yet */ @@ -391,7 +391,7 @@ return 23; } -#endif - + /* copy L to R when no PS is used */ #if (defined(PS_DEC) || defined(DRM_PS)) - if ((hDecoder->ps_used[hDecoder->fr_ch_ele] == 0)) @@ -404,6 +404,6 @@ } #endif +#endif - + return 0; }
--- a/libfaad2/lt_predict.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/lt_predict.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/lt_predict.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/lt_predict.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/mdct.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/mdct.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -29,7 +29,7 @@ * Fast (I)MDCT Implementation using (I)FFT ((Inverse) Fast Fourier Transform) * and consists of three steps: pre-(I)FFT complex multiplication, complex * (I)FFT, post-(I)FFT complex multiplication, - * + * * As described in: * P. Duhamel, Y. Mahieux, and J.P. Petit, "A Fast Algorithm for the * Implementation of Filter Banks Based on 'Time Domain Aliasing
--- a/libfaad2/mdct.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/mdct.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/mdct_tab.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/mdct_tab.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/mp4.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/mp4.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/mp4.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/mp4.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/ms.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ms.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -45,7 +45,7 @@ if (ics->ms_mask_present >= 1) { - for (g = 0; g < ics->num_window_groups; g++) + for (g = 0; g < ics->num_window_groups; g++) { for (b = 0; b < ics->window_group_length[g]; b++) {
--- a/libfaad2/ms.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ms.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/output.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/output.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/pns.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/pns.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/pns.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/pns.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/ps_dec.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ps_dec.c Wed May 13 15:22:13 2009 +0000 @@ -1625,7 +1625,7 @@ /* ringbuffer index */ if (i == 0) - { + { i = 2; } i--;
--- a/libfaad2/ps_dec.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ps_dec.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/pulse.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/pulse.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/pulse.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/pulse.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/rvlc.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/rvlc.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -451,7 +451,7 @@ int8_t index; uint32_t cw; rvlc_huff_table *h = book_rvlc; - + i = h->len; if (direction > 0) cw = faad_getbits(ld_sf, i DEBUGVAR(1,0,""));
--- a/libfaad2/rvlc.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/rvlc.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_dct.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_dct.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_dec.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_dec.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -166,7 +166,7 @@ } #ifdef PS_DEC - if (sbr->ps != NULL) + if (sbr->ps != NULL) ps_free(sbr->ps); #endif
--- a/libfaad2/sbr_e_nf.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_e_nf.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_e_nf.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_e_nf.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_fbt.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_fbt.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -77,7 +77,7 @@ { return startMin + offset[offsetIndex][bs_start_freq]; -#if 0 /* replaced by offsetIndexTable */ +#if 0 /* replaced by offsetIndexTable */ switch (sample_rate) { case 16000:
--- a/libfaad2/sbr_fbt.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_fbt.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_hfadj.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_hfadj.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -380,16 +380,16 @@ }; static const real_t log_Qplus1[31] = { - REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), - REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), - REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), - REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), - REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), - REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), - REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), - REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), - REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), - REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), + REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), + REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), + REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), + REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), + REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), + REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), + REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), + REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), + REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), + REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), REAL_CONST(0.000000000000000) }; @@ -846,16 +846,16 @@ }; static const real_t log_Qplus1[31] = { - REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), - REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), - REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), - REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), - REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), - REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), - REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), - REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), - REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), - REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), + REAL_CONST(6.022367813028454), REAL_CONST(5.044394119358453), REAL_CONST(4.087462841250339), + REAL_CONST(3.169925001442313), REAL_CONST(2.321928094887362), REAL_CONST(1.584962500721156), + REAL_CONST(1.000000000000000), REAL_CONST(0.584962500721156), REAL_CONST(0.321928094887362), + REAL_CONST(0.169925001442312), REAL_CONST(0.087462841250339), REAL_CONST(0.044394119358453), + REAL_CONST(0.022367813028455), REAL_CONST(0.011227255423254), REAL_CONST(0.005624549193878), + REAL_CONST(0.002815015607054), REAL_CONST(0.001408194392808), REAL_CONST(0.000704269011247), + REAL_CONST(0.000352177480301), REAL_CONST(0.000176099486443), REAL_CONST(0.000088052430122), + REAL_CONST(0.000044026886827), REAL_CONST(0.000022013611360), REAL_CONST(0.000011006847667), + REAL_CONST(0.000005503434331), REAL_CONST(0.000002751719790), REAL_CONST(0.000001375860551), + REAL_CONST(0.000000687930439), REAL_CONST(0.000000343965261), REAL_CONST(0.000000171982641), REAL_CONST(0.000000000000000) }; @@ -1371,7 +1371,7 @@ i++; } } - } + } if (grouping) { @@ -1393,7 +1393,7 @@ for (k = 0; k < sbr->N_G[l]; k++) { E_total_est = E_total = 0; - + for (m = sbr->f_group[l][k<<1]; m < sbr->f_group[l][(k<<1) + 1]; m++) { /* E_curr: integer */
--- a/libfaad2/sbr_hfadj.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_hfadj.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_hfgen.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_hfgen.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -296,7 +296,7 @@ /* improves accuracy */ if (exp > 0) exp -= 1; - + pow2_to_exp = 1<<(exp-1); temp2_r = (QMF_RE(buffer[offset-2][bd]) + pow2_to_exp) >> exp;
--- a/libfaad2/sbr_hfgen.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_hfgen.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_huff.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_huff.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_huff.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_huff.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_noise.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_noise.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_qmf.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_qmf.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_syntax.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_syntax.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_syntax.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_syntax.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_tf_grid.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_tf_grid.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sbr_tf_grid.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sbr_tf_grid.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/sine_win.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/sine_win.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/specrec.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/specrec.c Wed May 13 15:22:13 2009 +0000 @@ -606,10 +606,10 @@ wb = wa + bin; spec_data[wb+0] = iquant(quant_data[k+0], tab, &error) * scf; - spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf; - spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf; + spec_data[wb+1] = iquant(quant_data[k+1], tab, &error) * scf; + spec_data[wb+2] = iquant(quant_data[k+2], tab, &error) * scf; spec_data[wb+3] = iquant(quant_data[k+3], tab, &error) * scf; - + #else real_t iq0 = iquant(quant_data[k+0], tab, &error); real_t iq1 = iquant(quant_data[k+1], tab, &error);
--- a/libfaad2/specrec.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/specrec.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/ssr.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ssr.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/ssr.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ssr.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/ssr_fb.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ssr_fb.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/ssr_fb.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ssr_fb.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD - Freeware Advanced Audio Decoder ** Copyright (C) 2002 M. Bakker -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: ssr_fb.h,v 1.13 2004/09/04 14:56:29 menno Exp $
--- a/libfaad2/ssr_ipqf.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ssr_ipqf.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -56,7 +56,7 @@ -2.1939551286300665E-02, -2.4533179947088161E-02, -2.2591663337768787E-02, -1.5122066420044672E-02, -1.7971713448186293E-03, 1.6903413428575379E-02, 3.9672315874127042E-02, 6.4487527248102796E-02, 8.8850025474701726E-02, - 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012 + 0.1101132906105560 , 0.1258540205143761 , 0.1342239368467012 }; for (j = 0; j < 48; ++j)
--- a/libfaad2/ssr_ipqf.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ssr_ipqf.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD - Freeware Advanced Audio Decoder ** Copyright (C) 2002 M. Bakker -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: ssr_ipqf.h,v 1.14 2004/09/04 14:56:29 menno Exp $
--- a/libfaad2/ssr_win.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/ssr_win.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD - Freeware Advanced Audio Decoder ** Copyright (C) 2002 M. Bakker -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** $Id: ssr_win.h,v 1.13 2004/09/04 14:56:29 menno Exp $
--- a/libfaad2/syntax.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/syntax.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -1270,7 +1270,7 @@ /* SBR data was corrupted, disable it until the next header */ if (hDecoder->sbr[0]->ret != 0) { - hDecoder->sbr[0]->header_count = 0; + hDecoder->sbr[0]->header_count = 0; } faad_endbits(&ld_sbr); @@ -1515,7 +1515,7 @@ return result; } - if (hDecoder->object_type >= ER_OBJECT_START) + if (hDecoder->object_type >= ER_OBJECT_START) { if (ics->tns_data_present) tns_data(ics, &(ics->tns), ld); @@ -2510,7 +2510,7 @@ endpos = faad_get_processed_bits(ld); if(ret>0) return (len*8)-(endpos-initpos); - //faad_getbits(ld, initpos-endpos); //go back to initpos, but is valid a getbits(-N) ? + //faad_getbits(ld, initpos-endpos); //go back to initpos, but is valid a getbits(-N) ? } return -1U; }
--- a/libfaad2/syntax.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/syntax.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/tns.c Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/tns.c Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly
--- a/libfaad2/tns.h Wed May 13 02:58:57 2009 +0000 +++ b/libfaad2/tns.h Wed May 13 15:22:13 2009 +0000 @@ -1,19 +1,19 @@ /* ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com -** +** ** This program is free software; you can redistribute it and/or modify ** it under the terms of the GNU General Public License as published by ** the Free Software Foundation; either version 2 of the License, or ** (at your option) any later version. -** +** ** This program is distributed in the hope that it will be useful, ** but WITHOUT ANY WARRANTY; without even the implied warranty of ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ** GNU General Public License for more details. -** +** ** You should have received a copy of the GNU General Public License -** along with this program; if not, write to the Free Software +** along with this program; if not, write to the Free Software ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ** ** Any non-GPL usage of this software or parts of this software is strictly @@ -35,7 +35,7 @@ #define TNS_MAX_ORDER 20 - + void tns_decode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index, uint8_t object_type, real_t *spec, uint16_t frame_len); void tns_encode_frame(ic_stream *ics, tns_info *tns, uint8_t sr_index,
--- a/libmpeg2/alpha_asm.h Wed May 13 02:58:57 2009 +0000 +++ b/libmpeg2/alpha_asm.h Wed May 13 15:22:13 2009 +0000 @@ -122,7 +122,7 @@ #define minsw4 __builtin_alpha_minsw4 #define maxub8 __builtin_alpha_maxub8 #define maxsb8 __builtin_alpha_maxsb8 -#define maxuw4 __builtin_alpha_maxuw4 +#define maxuw4 __builtin_alpha_maxuw4 #define maxsw4 __builtin_alpha_maxsw4 #define perr __builtin_alpha_perr #define pklb __builtin_alpha_pklb
--- a/libmpeg2/cpu_accel.c Wed May 13 02:58:57 2009 +0000 +++ b/libmpeg2/cpu_accel.c Wed May 13 15:22:13 2009 +0000 @@ -42,10 +42,10 @@ #if 0 if (accel & (MPEG2_ACCEL_X86_3DNOW | MPEG2_ACCEL_X86_MMXEXT)) accel |= MPEG2_ACCEL_X86_MMX; - + if (accel & (MPEG2_ACCEL_X86_SSE2 | MPEG2_ACCEL_X86_SSE3)) accel |= MPEG2_ACCEL_X86_MMXEXT; - + if (accel & (MPEG2_ACCEL_X86_SSE3)) accel |= MPEG2_ACCEL_X86_SSE2;
--- a/libmpeg2/header.c Wed May 13 02:58:57 2009 +0000 +++ b/libmpeg2/header.c Wed May 13 15:22:13 2009 +0000 @@ -315,8 +315,8 @@ height *= sequence->display_width; } else { - if (sequence->byte_rate == 50 * 0x3ffff) - sequence->byte_rate = 0; /* mpeg-1 VBR */ + if (sequence->byte_rate == 50 * 0x3ffff) + sequence->byte_rate = 0; /* mpeg-1 VBR */ switch (sequence->pixel_width) { case 0: case 15: /* illegal */ @@ -860,7 +860,7 @@ { mpeg2dec->user_data_len += mpeg2dec->chunk_ptr - 1 - mpeg2dec->chunk_start; mpeg2dec->chunk_start = mpeg2dec->chunk_ptr - 1; - + return 0; }
--- a/libmpeg2/idct_alpha.c Wed May 13 02:58:57 2009 +0000 +++ b/libmpeg2/idct_alpha.c Wed May 13 15:22:13 2009 +0000 @@ -221,7 +221,7 @@ shorts0 ^= signs0; /* clamp. */ shorts0 = maxsw4 (shorts0, 0); - shorts0 = minsw4 (shorts0, clampmask); + shorts0 = minsw4 (shorts0, clampmask); /* next 4. */ pix1 = unpkbw (ldl (dest + 4));
--- a/libmpeg2/libmpeg2_changes.diff Wed May 13 02:58:57 2009 +0000 +++ b/libmpeg2/libmpeg2_changes.diff Wed May 13 15:22:13 2009 +0000 @@ -3,7 +3,7 @@ @@ -29,9 +33,13 @@ #include "attributes.h" #include "mpeg2_internal.h" - + +#include "cpudetect.h" + -#if defined(ARCH_X86) || defined(ARCH_X86_64) @@ -14,10 +14,10 @@ +#if 0 if (accel & (MPEG2_ACCEL_X86_3DNOW | MPEG2_ACCEL_X86_MMXEXT)) accel |= MPEG2_ACCEL_X86_MMX; - + @@ -124,6 +132,21 @@ #endif /* ACCEL_DETECT */ - + return accel; + +#else /* 0 */ @@ -36,20 +36,20 @@ +#endif /* 0 */ } #endif /* ARCH_X86 || ARCH_X86_64 */ - + @@ -127,7 +150,7 @@ } #endif /* ARCH_X86 || ARCH_X86_64 */ - + -#if defined(ACCEL_DETECT) && (defined(ARCH_PPC) || defined(ARCH_SPARC)) +#if defined(ACCEL_DETECT) && (ARCH_PPC || ARCH_SPARC) #include <signal.h> #include <setjmp.h> - + @@ -146,7 +169,7 @@ } #endif /* ACCEL_DETECT && (ARCH_PPC || ARCH_SPARC) */ - + -#ifdef ARCH_PPC +#if ARCH_PPC static uint32_t arch_accel (uint32_t accel) @@ -58,7 +58,7 @@ @@ -183,7 +206,7 @@ } #endif /* ARCH_PPC */ - + -#ifdef ARCH_SPARC +#if ARCH_SPARC static uint32_t arch_accel (uint32_t accel) @@ -67,14 +67,14 @@ @@ -229,7 +252,7 @@ } #endif /* ARCH_SPARC */ - + -#ifdef ARCH_ALPHA +#if ARCH_ALPHA static inline uint32_t arch_accel (uint32_t accel) { if (accel & MPEG2_ACCEL_ALPHA_MVI) @@ -253,7 +276,7 @@ - + uint32_t mpeg2_detect_accel (uint32_t accel) { -#if defined (ARCH_X86) || defined (ARCH_X86_64) || defined (ARCH_PPC) || defined (ARCH_ALPHA) || defined (ARCH_SPARC) @@ -94,10 +94,10 @@ +#if ARCH_X86 || ARCH_X86_64 #include "mmx.h" #endif - + void (* mpeg2_cpu_state_save) (cpu_state_t * state) = NULL; void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = NULL; - + -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#if ARCH_X86 || ARCH_X86_64 static void state_restore_mmx (cpu_state_t * state) @@ -105,14 +105,14 @@ emms (); } #endif - + -#ifdef ARCH_PPC +#if ARCH_PPC #if defined(__APPLE_CC__) /* apple */ #define LI(a,b) "li r" #a "," #b "\n\t" #define STVX0(a,b,c) "stvx v" #a ",0,r" #c "\n\t" @@ -115,12 +115,12 @@ - + void mpeg2_cpu_state_init (uint32_t accel) { -#if defined(ARCH_X86) || defined(ARCH_X86_64) @@ -142,7 +142,7 @@ +// printf("libmpeg2: FBUF 0:%p 1:%p 2:%p\n", +// mpeg2dec->fbuf[0]->buf[0],mpeg2dec->fbuf[1]->buf[0],mpeg2dec->fbuf[2]->buf[0]); } - + void mpeg2_custom_fbuf (mpeg2dec_t * mpeg2dec, int custom_fbuf) --- libmpeg2/header.c 2006-06-16 20:12:26.000000000 +0200 +++ libmpeg2/header.c 2006-06-16 20:12:50.000000000 +0200 @@ -167,7 +167,7 @@ --- libmpeg2/idct.c (revision 26652) +++ libmpeg2/idct.c (working copy) @@ -235,34 +239,40 @@ - + void mpeg2_idct_init (uint32_t accel) { -#ifdef ARCH_X86 @@ -211,19 +211,19 @@ +#elif ARCH_ALPHA + if (accel & MPEG2_ACCEL_ALPHA) { int i; - + mpeg2_idct_copy = mpeg2_idct_copy_alpha; Index: libmpeg2/idct_alpha.c =================================================================== --- libmpeg2/idct_alpha.c (revision 28324) +++ libmpeg2/idct_alpha.c (revision 28325) @@ -24,7 +24,7 @@ - + #include "config.h" - + -#ifdef ARCH_ALPHA +#if ARCH_ALPHA - + #include <stdlib.h> #include <inttypes.h> Index: libmpeg2/idct_altivec.c @@ -231,12 +231,12 @@ --- libmpeg2/idct_altivec.c (revision 28324) +++ libmpeg2/idct_altivec.c (revision 28325) @@ -23,7 +23,7 @@ - + #include "config.h" - + -#ifdef ARCH_PPC +#if ARCH_PPC - + #ifdef HAVE_ALTIVEC_H #include <altivec.h> Index: libmpeg2/idct_mmx.c @@ -244,18 +244,18 @@ --- libmpeg2/idct_mmx.c (revision 28324) +++ libmpeg2/idct_mmx.c (revision 28325) @@ -23,7 +23,7 @@ - + #include "config.h" - + -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#if ARCH_X86 || ARCH_X86_64 - + #include <inttypes.h> - + --- libmpeg2/motion_comp.c 2006-06-16 20:12:26.000000000 +0200 +++ libmpeg2/motion_comp.c 2006-06-16 20:12:50.000000000 +0200 @@ -33,34 +37,40 @@ - + void mpeg2_mc_init (uint32_t accel) { -#ifdef ARCH_X86 @@ -309,25 +309,25 @@ --- libmpeg2/motion_comp_alpha.c (revision 28324) +++ libmpeg2/motion_comp_alpha.c (revision 28325) @@ -22,7 +22,7 @@ - + #include "config.h" - + -#ifdef ARCH_ALPHA +#if ARCH_ALPHA - + #include <inttypes.h> - + Index: libmpeg2/motion_comp_altivec.c =================================================================== --- libmpeg2/motion_comp_altivec.c (revision 28324) +++ libmpeg2/motion_comp_altivec.c (revision 28325) @@ -23,7 +23,7 @@ - + #include "config.h" - + -#ifdef ARCH_PPC +#if ARCH_PPC - + #ifdef HAVE_ALTIVEC_H #include <altivec.h> Index: libmpeg2/motion_comp_arm.c @@ -335,44 +335,44 @@ --- libmpeg2/motion_comp_arm.c (revision 28324) +++ libmpeg2/motion_comp_arm.c (revision 28325) @@ -22,7 +22,7 @@ - + #include "config.h" - + -#ifdef ARCH_ARM +#if ARCH_ARM - + #include <inttypes.h> - + Index: libmpeg2/motion_comp_mmx.c =================================================================== --- libmpeg2/motion_comp_mmx.c (revision 28324) +++ libmpeg2/motion_comp_mmx.c (revision 28325) @@ -23,7 +23,7 @@ - + #include "config.h" - + -#if defined(ARCH_X86) || defined(ARCH_X86_64) +#if ARCH_X86 || ARCH_X86_64 - + #include <inttypes.h> - + Index: libmpeg2/motion_comp_vis.c =================================================================== --- libmpeg2/motion_comp_vis.c (revision 28324) +++ libmpeg2/motion_comp_vis.c (revision 28325) @@ -22,7 +22,7 @@ - + #include "config.h" - + -#ifdef ARCH_SPARC +#if ARCH_SPARC - + #include <inttypes.h> - + --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200 @@ -152,6 +156,11 @@ - + /* XXX: stuff due to xine shit */ int8_t q_scale_type; + @@ -381,7 +381,7 @@ + char* quant_store; + int quant_stride; }; - + typedef struct { @@ -223,6 +232,9 @@ //int8_t q_scale_type, scaled[4]; @@ -391,11 +391,11 @@ + unsigned char *pending_buffer; + int pending_length; }; - + typedef struct { @@ -226,7 +238,7 @@ }; - + typedef struct { -#ifdef ARCH_PPC +#if ARCH_PPC @@ -405,15 +405,15 @@ --- libmpeg2/slice.c 2006-06-16 20:12:26.000000000 +0200 +++ libmpeg2/slice.c 2006-06-16 20:12:50.000000000 +0200 @@ -142,6 +146,7 @@ - + quantizer_scale_code = UBITS (bit_buf, 5); DUMPBITS (bit_buf, bits, 5); + decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code]; - + decoder->quantizer_matrix[0] = decoder->quantizer_prescale[0][quantizer_scale_code]; @@ -1564,6 +1569,24 @@ - + #define NEXT_MACROBLOCK \ do { \ + if(decoder->quant_store) { \
--- a/libmpeg2/slice.c Wed May 13 02:58:57 2009 +0000 +++ b/libmpeg2/slice.c Wed May 13 15:22:13 2009 +0000 @@ -1906,7 +1906,7 @@ if ( ((macroblock_modes >> MOTION_TYPE_SHIFT) < 0) || ((macroblock_modes >> MOTION_TYPE_SHIFT) >= - (int)(sizeof(decoder->motion_parser) + (int)(sizeof(decoder->motion_parser) / sizeof(decoder->motion_parser[0]))) ) { break; // Illegal !
--- a/tremor/asm_arm.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/asm_arm.h Wed May 13 15:22:13 2009 +0000 @@ -127,7 +127,7 @@ ogg_int32_t *qexpp, ogg_int32_t *ilsp,ogg_int32_t wi, ogg_int32_t m){ - + ogg_uint32_t qi=*qip,pi=*pip; ogg_int32_t qexp=*qexpp; @@ -135,16 +135,16 @@ "mov r1,%5,asr#1;" "add r0,r0,r1,lsl#3;" "1:" - + "ldmdb r0!,{r1,r3};" "subs r1,r1,%4;" //ilsp[j]-wi "rsbmi r1,r1,#0;" //labs(ilsp[j]-wi) "umull %0,r2,r1,%0;" //qi*=labs(ilsp[j]-wi) - + "subs r1,r3,%4;" //ilsp[j+1]-wi "rsbmi r1,r1,#0;" //labs(ilsp[j+1]-wi) "umull %1,r3,r1,%1;" //pi*=labs(ilsp[j+1]-wi) - + "cmn r2,r3;" // shift down 16? "beq 0f;" "add %2,%2,#16;" @@ -155,20 +155,20 @@ "0:" "cmp r0,%3;\n" "bhi 1b;\n" - + // odd filter assymetry "ands r0,%5,#1;\n" "beq 2f;\n" "add r0,%3,%5,lsl#2;\n" - + "ldr r1,[r0,#-4];\n" "mov r0,#0x4000;\n" - + "subs r1,r1,%4;\n" //ilsp[j]-wi "rsbmi r1,r1,#0;\n" //labs(ilsp[j]-wi) "umull %0,r2,r1,%0;\n" //qi*=labs(ilsp[j]-wi) "umull %1,r3,r0,%1;\n" //pi*=labs(ilsp[j+1]-wi) - + "cmn r2,r3;\n" // shift down 16? "beq 2f;\n" "add %2,%2,#16;\n" @@ -176,13 +176,13 @@ "orr %0,%0,r2,lsl #16;\n" "mov %1,%1,lsr #16;\n" "orr %1,%1,r3,lsl #16;\n" - + //qi=(pi>>shift)*labs(ilsp[j]-wi); //pi=(qi>>shift)*labs(ilsp[j+1]-wi); //qexp+=shift; - + //} - + /* normalize to max 16 sig figs */ "2:" "mov r2,#0;" @@ -204,11 +204,11 @@ "mov %0,%0,lsr r2;" "mov %1,%1,lsr r2;" "add %2,%2,r2;" - + : "+r"(qi),"+r"(pi),"+r"(qexp) : "r"(ilsp),"r"(wi),"r"(m) : "r0","r1","r2","r3","cc"); - + *qip=qi; *pip=pi; *qexpp=qexp;
--- a/tremor/backends.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/backends.h Wed May 13 15:22:13 2009 +0000 @@ -68,8 +68,8 @@ int class_subbook[VIF_CLASS][8]; /* [VIF_CLASS][subs] */ - int mult; /* 1 2 3 or 4 */ - int postlist[VIF_POSIT+2]; /* first two implicit */ + int mult; /* 1 2 3 or 4 */ + int postlist[VIF_POSIT+2]; /* first two implicit */ } vorbis_info_floor1; @@ -110,7 +110,7 @@ typedef struct vorbis_info_mapping0{ int submaps; /* <= 16 */ int chmuxlist[256]; /* up to 256 channels in a Vorbis stream */ - + int floorsubmap[16]; /* [mux] submap to floors */ int residuesubmap[16]; /* [mux] submap to residue */
--- a/tremor/bitwise.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/bitwise.c Wed May 13 15:22:13 2009 +0000 @@ -73,11 +73,11 @@ b->ptr=b->buffer+b->endbyte; } - value&=mask[bits]; + value&=mask[bits]; bits+=b->endbit; - b->ptr[0]|=value<<b->endbit; - + b->ptr[0]|=value<<b->endbit; + if(bits>=8){ b->ptr[1]=(unsigned char)(value>>(8-b->endbit)); if(bits>=16){ @@ -107,11 +107,11 @@ b->ptr=b->buffer+b->endbyte; } - value=(value&mask[bits])<<(32-bits); + value=(value&mask[bits])<<(32-bits); bits+=b->endbit; - b->ptr[0]|=value>>(24+b->endbit); - + b->ptr[0]|=value>>(24+b->endbit); + if(bits>=8){ b->ptr[1]=(unsigned char)(value>>(16+b->endbit)); if(bits>=16){ @@ -161,7 +161,7 @@ int i; /* unaligned copy. Do it the hard way. */ for(i=0;i<bytes;i++) - w(b,(unsigned long)(ptr[i]),8); + w(b,(unsigned long)(ptr[i]),8); }else{ /* aligned block copy */ if(b->endbyte+bytes+1>=b->storage){ @@ -178,9 +178,9 @@ } if(bits){ if(msb) - w(b,(unsigned long)(ptr[bytes]>>(8-bits)),bits); + w(b,(unsigned long)(ptr[bytes]>>(8-bits)),bits); else - w(b,(unsigned long)(ptr[bytes]),bits); + w(b,(unsigned long)(ptr[bytes]),bits); } } @@ -232,14 +232,14 @@ /* not the main path */ if(b->endbyte*8+bits>b->storage*8)return(-1); } - + ret=b->ptr[0]>>b->endbit; if(bits>8){ - ret|=b->ptr[1]<<(8-b->endbit); + ret|=b->ptr[1]<<(8-b->endbit); if(bits>16){ - ret|=b->ptr[2]<<(16-b->endbit); + ret|=b->ptr[2]<<(16-b->endbit); if(bits>24){ - ret|=b->ptr[3]<<(24-b->endbit); + ret|=b->ptr[3]<<(24-b->endbit); if(bits>32 && b->endbit) ret|=b->ptr[4]<<(32-b->endbit); } @@ -259,14 +259,14 @@ /* not the main path */ if(b->endbyte*8+bits>b->storage*8)return(-1); } - + ret=b->ptr[0]<<(24+b->endbit); if(bits>8){ - ret|=b->ptr[1]<<(16+b->endbit); + ret|=b->ptr[1]<<(16+b->endbit); if(bits>16){ - ret|=b->ptr[2]<<(8+b->endbit); + ret|=b->ptr[2]<<(8+b->endbit); if(bits>24){ - ret|=b->ptr[3]<<(b->endbit); + ret|=b->ptr[3]<<(b->endbit); if(bits>32 && b->endbit) ret|=b->ptr[4]>>(8-b->endbit); } @@ -320,14 +320,14 @@ ret=-1L; if(b->endbyte*8+bits>b->storage*8)goto overflow; } - + ret=b->ptr[0]>>b->endbit; if(bits>8){ - ret|=b->ptr[1]<<(8-b->endbit); + ret|=b->ptr[1]<<(8-b->endbit); if(bits>16){ - ret|=b->ptr[2]<<(16-b->endbit); + ret|=b->ptr[2]<<(16-b->endbit); if(bits>24){ - ret|=b->ptr[3]<<(24-b->endbit); + ret|=b->ptr[3]<<(24-b->endbit); if(bits>32 && b->endbit){ ret|=b->ptr[4]<<(32-b->endbit); } @@ -335,7 +335,7 @@ } } ret&=m; - + overflow: b->ptr+=bits/8; @@ -348,7 +348,7 @@ long oggpackB_read(oggpack_buffer *b,int bits){ long ret; long m=32-bits; - + bits+=b->endbit; if(b->endbyte+4>=b->storage){ @@ -356,21 +356,21 @@ ret=-1L; if(b->endbyte*8+bits>b->storage*8)goto overflow; } - + ret=b->ptr[0]<<(24+b->endbit); if(bits>8){ - ret|=b->ptr[1]<<(16+b->endbit); + ret|=b->ptr[1]<<(16+b->endbit); if(bits>16){ - ret|=b->ptr[2]<<(8+b->endbit); + ret|=b->ptr[2]<<(8+b->endbit); if(bits>24){ - ret|=b->ptr[3]<<(b->endbit); + ret|=b->ptr[3]<<(b->endbit); if(bits>32 && b->endbit) ret|=b->ptr[4]>>(8-b->endbit); } } } ret=((ret&0xffffffffUL)>>(m>>1))>>((m+1)>>1); - + overflow: b->ptr+=bits/8; @@ -381,7 +381,7 @@ long oggpack_read1(oggpack_buffer *b){ long ret; - + if(b->endbyte>=b->storage){ /* not the main path */ ret=-1L; @@ -389,7 +389,7 @@ } ret=(b->ptr[0]>>b->endbit)&1; - + overflow: b->endbit++; @@ -403,7 +403,7 @@ long oggpackB_read1(oggpack_buffer *b){ long ret; - + if(b->endbyte>=b->storage){ /* not the main path */ ret=-1L; @@ -411,7 +411,7 @@ } ret=(b->ptr[0]>>(7-b->endbit))&1; - + overflow: b->endbit++; @@ -438,7 +438,7 @@ long oggpackB_bits(oggpack_buffer *b){ return oggpack_bits(b); } - + unsigned char *oggpack_get_buffer(oggpack_buffer *b){ return(b->buffer); }
--- a/tremor/block.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/block.c Wed May 13 15:22:13 2009 +0000 @@ -46,28 +46,28 @@ :.....''' |_____--- '''......| | \_______| :.................|__________________|_______|__|______| |<------ Sl ------>| > Sr < |endW - |beginSl |endSl | |endSr + |beginSl |endSl | |endSr |beginW |endlW |beginSr - |< lW >| + |< lW >| <--------------- W ----------------> | | .. ______________ | | | ' `/ | ---_ | - |___.'___/`. | ---_____| + |___.'___/`. | ---_____| |_______|__|_______|_________________| | >|Sl|< |<------ Sr ----->|endW | | |endSl |beginSr |endSr - |beginW | |endlW + |beginW | |endlW mult[0] |beginSl mult[n] <-------------- lW -----------------> - |<--W-->| -: .............. ___ | | -: .''' |`/ \ | | -:.....''' |/`....\|...| -:.........................|___|___|___| - |Sl |Sr |endW + |<--W-->| +: .............. ___ | | +: .''' |`/ \ | | +:.....''' |/`....\|...| +:.........................|___|___|___| + |Sl |Sr |endW | | |endSr | |beginSr | |endSl @@ -86,7 +86,7 @@ vb->vd=v; vb->localalloc=0; vb->localstore=NULL; - + return(0); } @@ -226,10 +226,10 @@ } if(b){ - if(b->mode)_ogg_free(b->mode); + if(b->mode)_ogg_free(b->mode); _ogg_free(b); } - + memset(v,0,sizeof(*v)); } } @@ -253,15 +253,15 @@ lose count */ v->sequence=vb->sequence; - + { int n=ci->blocksizes[v->W]/2; int n0=ci->blocksizes[0]/2; int n1=ci->blocksizes[1]/2; - + int thisCenter; int prevCenter; - + if(v->centerW){ thisCenter=n1; prevCenter=0; @@ -269,13 +269,13 @@ thisCenter=0; prevCenter=n1; } - + /* v->pcm is now used like a two-stage double buffer. We don't want to have to constantly shift *or* adjust memory usage. Don't accept a new block until the old is shifted out */ - + /* overlap/add PCM */ - + for(j=0;j<vi->channels;j++){ /* the overlap/add section */ if(v->lW){ @@ -309,7 +309,7 @@ pcm[i]+=p[i]; } } - + /* the copy section */ { ogg_int32_t *pcm=v->pcm[j]+thisCenter; @@ -318,12 +318,12 @@ pcm[i]=p[i]; } } - + if(v->centerW) v->centerW=0; else v->centerW=n1; - + /* deal with initial packet state; we do this using the explicit pcm_returned==-1 flag otherwise we're sensitive to first block being short or long */ @@ -342,7 +342,7 @@ making sure our last packet doesn't end with added padding. If the last packet is partial, the number of samples we'll have to return will be past the vb->granulepos. - + This is not foolproof! It will be confused if we begin decoding at the last page after a seek or hole. In that case, we don't have a starting point to judge where the last frame @@ -373,20 +373,20 @@ v->pcm_returned+=extra; if(v->pcm_returned>v->pcm_current) v->pcm_returned=v->pcm_current; - + } - + }/* else{ Shouldn't happen *unless* the bitstream is out of spec. Either way, believe the bitstream } */ v->granulepos=vb->granulepos; } } - + /* Update, cleanup */ - + if(vb->eofflag)v->eofflag=1; } - + return(0); }
--- a/tremor/codebook.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/codebook.c Wed May 13 15:22:13 2009 +0000 @@ -64,7 +64,7 @@ s->lengthlist[i]=num+1; } } - + break; case 1: /* ordered */ @@ -85,7 +85,7 @@ /* EOF */ return(-1); } - + /* Do we have a mapping to unpack? */ switch((s->maptype=oggpack_read(opb,4))){ case 0: @@ -110,12 +110,12 @@ quantvals=s->entries*s->dim; break; } - + /* quantized values */ s->quantlist=(long *)_ogg_malloc(sizeof(*s->quantlist)*quantvals); for(i=0;i<quantvals;i++) s->quantlist[i]=oggpack_read(opb,s->q_quant); - + if(quantvals&&s->quantlist[quantvals-1]==-1)goto _eofout; } break; @@ -125,11 +125,11 @@ /* all set */ return(0); - + _errout: _eofout: vorbis_staticbook_clear(s); - return(-1); + return(-1); } /* the 'eliminate the decode tree' optimization actually requires the @@ -148,12 +148,12 @@ return((x>> 1)&0x55555555) | ((x<< 1)&0xaaaaaaaa); } -static inline long decode_packed_entry_number(codebook *book, +static inline long decode_packed_entry_number(codebook *book, oggpack_buffer *b){ int read=book->dec_maxlength; long lo,hi; long lok = oggpack_look(b,book->dec_firsttablen); - + if (lok >= 0) { long entry = book->dec_firsttable[lok]; if(entry&0x80000000UL){ @@ -180,7 +180,7 @@ while(hi-lo>1){ long p=(hi-lo)>>1; - long test=book->codelist[lo+p]>testword; + long test=book->codelist[lo+p]>testword; lo+=p&(test-1); hi-=p&(-test); } @@ -190,7 +190,7 @@ return(lo); } } - + oggpack_adv(b, read); return(-1); } @@ -198,13 +198,13 @@ /* Decode side is specced and easier, because we don't need to find matches using different criteria; we simply read and map. There are two things we need to do 'depending': - + We may need to support interleave. We don't really, but it's convenient to do it here rather than rebuild the vector later. Cascades may be additive or multiplicitive; this is not inherent in the codebook, but set in the code using the codebook. Like - interleaving, it's easiest to do it here. + interleaving, it's easiest to do it here. addmul==0 -> declarative (set the value) addmul==1 -> additive addmul==2 -> multiplicitive */ @@ -214,7 +214,7 @@ long packed_entry=decode_packed_entry_number(book,b); if(packed_entry>=0) return(book->dec_index[packed_entry]); - + /* if there's no dec_index, the codebook unpacking isn't collapsed */ return(packed_entry); } @@ -255,7 +255,7 @@ int i,j,entry; ogg_int32_t *t; int shift=point-book->binarypoint; - + if(shift>=0){ for(i=0;i<n;){ entry = decode_packed_entry_number(book,b); @@ -281,7 +281,7 @@ int i,j,entry; ogg_int32_t *t; int shift=point-book->binarypoint; - + if(shift>=0){ for(i=0;i<n;){ @@ -312,9 +312,9 @@ long i,j,entry; int chptr=0; int shift=point-book->binarypoint; - + if(shift>=0){ - + for(i=offset;i<offset+n;){ entry = decode_packed_entry_number(book,b); if(entry==-1)return(-1);
--- a/tremor/codebook.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/codebook.h Wed May 13 15:22:13 2009 +0000 @@ -40,7 +40,7 @@ /* mapping ***************************************************************/ int maptype; /* 0=none - 1=implicitly populated values from map column + 1=implicitly populated values from map column 2=listed arbitrary values */ /* The below does a linear, single monotonic sequence mapping. */ @@ -62,10 +62,10 @@ /* the below are ordered by bitreversed codeword and only used entries are populated */ int binarypoint; - ogg_int32_t *valuelist; /* list of dim*entries actual entry values */ + ogg_int32_t *valuelist; /* list of dim*entries actual entry values */ ogg_uint32_t *codelist; /* list of bitstream codewords for each entry */ - int *dec_index; + int *dec_index; char *dec_codelengths; ogg_uint32_t *dec_firsttable; int dec_firsttablen; @@ -86,14 +86,14 @@ extern int vorbis_staticbook_unpack(oggpack_buffer *b,static_codebook *c); extern long vorbis_book_decode(codebook *book, oggpack_buffer *b); -extern long vorbis_book_decodevs_add(codebook *book, ogg_int32_t *a, +extern long vorbis_book_decodevs_add(codebook *book, ogg_int32_t *a, oggpack_buffer *b,int n,int point); -extern long vorbis_book_decodev_set(codebook *book, ogg_int32_t *a, +extern long vorbis_book_decodev_set(codebook *book, ogg_int32_t *a, oggpack_buffer *b,int n,int point); -extern long vorbis_book_decodev_add(codebook *book, ogg_int32_t *a, +extern long vorbis_book_decodev_add(codebook *book, ogg_int32_t *a, oggpack_buffer *b,int n,int point); extern long vorbis_book_decodevv_add(codebook *book, ogg_int32_t **a, - long off,int ch, + long off,int ch, oggpack_buffer *b,int n,int point); extern int _ilog(unsigned int v);
--- a/tremor/codec_internal.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/codec_internal.h Wed May 13 15:22:13 2009 +0000 @@ -50,7 +50,7 @@ /* codec_setup_info contains all the setup information specific to the specific compression/decompression mode in progress (eg, psychoacoustic settings, channel setup, options, codebook - etc). + etc). *********************************************************************/ typedef struct codec_setup_info {
--- a/tremor/floor0.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/floor0.c Wed May 13 15:22:13 2009 +0000 @@ -45,12 +45,12 @@ #include "lsp_lookup.h" /* interpolated 1./sqrt(p) where .5 <= a < 1. (.100000... to .111111...) in - 16.16 format + 16.16 format returns in m.8 format */ static long ADJUST_SQRT2[2]={8192,5792}; static inline ogg_int32_t vorbis_invsqlook_i(long a,long e){ - long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1); + long i=(a&0x7fff)>>(INVSQ_LOOKUP_I_SHIFT-1); long d=a&INVSQ_LOOKUP_I_MASK; /* 0.10 */ long val=INVSQ_LOOKUP_I[i]- /* 1.16 */ ((INVSQ_LOOKUP_IDel[i]*d)>>INVSQ_LOOKUP_I_SHIFT); /* result 1.16 */ @@ -65,7 +65,7 @@ int i=(-a)>>(12-FROMdB2_SHIFT); if(i<0) return 0x7fffffff; if(i>=(FROMdB_LOOKUP_SZ<<FROMdB_SHIFT))return 0; - + return FROMdB_LOOKUP[i>>FROMdB_SHIFT] * FROMdB2_LOOKUP[i&FROMdB2_MASK]; } @@ -84,14 +84,14 @@ a=a&0x1ffff; if(a>0x10000)a=0x20000-a; - { + { int i=a>>COS_LOOKUP_I_SHIFT; int d=a&COS_LOOKUP_I_MASK; a=((COS_LOOKUP_I[i]<<COS_LOOKUP_I_SHIFT)- d*(COS_LOOKUP_I[i]-COS_LOOKUP_I[i+1]))>> (COS_LOOKUP_I_SHIFT-LSP_FRACBITS+14); } - + return(a); } @@ -105,9 +105,9 @@ /* used in init only; interpolate the long way */ static inline ogg_int32_t toBARK(int n){ int i; - for(i=0;i<27;i++) + for(i=0;i<27;i++) if(n>=barklook[i] && n<barklook[i+1])break; - + if(i==27){ return 27<<15; }else{ @@ -177,22 +177,22 @@ pi=((pi*pi)>>16); qi=((qi*qi)>>16); - + if(m&1){ - qexp= qexp*2-28*((m+1)>>1)+m; + qexp= qexp*2-28*((m+1)>>1)+m; pi*=(1<<14)-((wi*wi)>>14); - qi+=pi>>14; + qi+=pi>>14; }else{ qexp= qexp*2-13*m; - + pi*=(1<<14)-wi; qi*=(1<<14)+wi; - + qi=(qi+pi)>>14; } - + if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */ - qi>>=1; qexp++; + qi>>=1; qexp++; }else lsp_norm_asm(&qi,&qexp); @@ -225,7 +225,7 @@ if(!(shift=MLOOP_1[(pi|qi)>>25])) if(!(shift=MLOOP_2[(pi|qi)>>19])) shift=MLOOP_3[(pi|qi)>>16]; - + pi>>=shift; qi>>=shift; qexp+=shift-14*((m+1)>>1); @@ -242,7 +242,7 @@ /* p*=p(1-w), q*=q(1+w), let normalization drift because it isn't worth tracking step by step */ - + pi>>=shift; qi>>=shift; qexp+=shift-7*m; @@ -250,32 +250,32 @@ pi=((pi*pi)>>16); qi=((qi*qi)>>16); qexp=qexp*2+m; - + pi*=(1<<14)-wi; qi*=(1<<14)+wi; qi=(qi+pi)>>14; - + } - + /* we've let the normalization drift because it wasn't important; however, for the lookup, things must be normalized again. We need at most one right shift or a number of left shifts */ if(qi&0xffff0000){ /* checks for 1.xxxxxxxxxxxxxxxx */ - qi>>=1; qexp++; + qi>>=1; qexp++; }else while(qi && !(qi&0x8000)){ /* checks for 0.0xxxxxxxxxxxxxxx or less*/ - qi<<=1; qexp--; + qi<<=1; qexp--; } #endif amp=vorbis_fromdBlook_i(ampi* /* n.4 */ - vorbis_invsqlook_i(qi,qexp)- + vorbis_invsqlook_i(qi,qexp)- /* m.8, m+n<=8 */ ampoffseti); /* 8.12[0] */ - + #ifdef _LOW_ACCURACY_ amp>>=9; #endif @@ -316,12 +316,12 @@ info->ampbits=oggpack_read(opb,6); info->ampdB=oggpack_read(opb,8); info->numbooks=oggpack_read(opb,4)+1; - + if(info->order<1)goto err_out; if(info->rate<1)goto err_out; if(info->barkmap<1)goto err_out; if(info->numbooks<1)goto err_out; - + for(j=0;j<info->numbooks;j++){ info->books[j]=oggpack_read(opb,8); if(info->books[j]<0 || info->books[j]>=ci->books)goto err_out; @@ -344,7 +344,7 @@ static vorbis_look_floor *floor0_look (vorbis_dsp_state *vd,vorbis_info_mode *mi, vorbis_info_floor *i){ int j; - ogg_int32_t scale; + ogg_int32_t scale; vorbis_info *vi=vd->vi; codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; vorbis_info_floor0 *info=(vorbis_info_floor0 *)i; @@ -382,26 +382,26 @@ vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; vorbis_info_floor0 *info=look->vi; int j,k; - + int ampraw=oggpack_read(&vb->opb,info->ampbits); if(ampraw>0){ /* also handles the -1 out of data case */ long maxval=(1<<info->ampbits)-1; int amp=((ampraw*info->ampdB)<<4)/maxval; int booknum=oggpack_read(&vb->opb,_ilog(info->numbooks)); - + if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */ codec_setup_info *ci=(codec_setup_info *)vb->vd->vi->codec_setup; codebook *b=ci->fullbooks+info->books[booknum]; ogg_int32_t last=0; ogg_int32_t *lsp=(ogg_int32_t *)_vorbis_block_alloc(vb,sizeof(*lsp)*(look->m+1)); - + for(j=0;j<look->m;j+=b->dim) if(vorbis_book_decodev_set(b,lsp+j,&vb->opb,b->dim,-24)==-1)goto eop; for(j=0;j<look->m;){ for(k=0;k<b->dim;k++,j++)lsp[j]+=last; last=lsp[j-1]; } - + lsp[look->m]=amp; return(lsp); } @@ -414,7 +414,7 @@ void *memo,ogg_int32_t *out){ vorbis_look_floor0 *look=(vorbis_look_floor0 *)i; vorbis_info_floor0 *info=look->vi; - + if(memo){ ogg_int32_t *lsp=(ogg_int32_t *)memo; ogg_int32_t amp=lsp[look->m];
--- a/tremor/floor1.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/floor1.c Wed May 13 15:22:13 2009 +0000 @@ -30,7 +30,7 @@ typedef struct { int forward_index[VIF_POSIT+2]; - + int hineighbor[VIF_POSIT]; int loneighbor[VIF_POSIT]; int posts; @@ -42,7 +42,7 @@ } vorbis_look_floor1; /***********************************************/ - + static void floor1_free_info(vorbis_info_floor *i){ vorbis_info_floor1 *info=(vorbis_info_floor1 *)i; if(info){ @@ -97,11 +97,11 @@ } /* read the post list */ - info->mult=oggpack_read(opb,2)+1; /* only 1,2,3,4 legal now */ + info->mult=oggpack_read(opb,2)+1; /* only 1,2,3,4 legal now */ rangebits=oggpack_read(opb,4); for(j=0,k=0;j<info->partitions;j++){ - count+=info->class_dim[info->partitionclass[j]]; + count+=info->class_dim[info->partitionclass[j]]; for(;k<count;k++){ int t=info->postlist[k+2]=oggpack_read(opb,rangebits); if(t<0 || t>=(1<<rangebits)) @@ -112,7 +112,7 @@ info->postlist[1]=1<<rangebits; return(info); - + err_out: floor1_free_info(info); return(NULL); @@ -132,7 +132,7 @@ look->vi=info; look->n=info->postlist[1]; - + /* we drop each position value in-between already decoded values, and use linear interpolation to predict each new value past the edges. The positions are read in the order of the position @@ -150,7 +150,7 @@ /* points from sort order back to range number */ for(i=0;i<n;i++)look->forward_index[i]=sortpointer[i]-info->postlist; - + /* quantize values to multiplier spec */ switch(info->mult){ case 1: /* 1024 -> 256 */ @@ -196,13 +196,13 @@ static int render_point(int x0,int x1,int y0,int y1,int x){ y0&=0x7fff; /* mask off flag */ y1&=0x7fff; - + { int dy=y1-y0; int adx=x1-x0; int ady=abs(dy); int err=ady*(x-x0); - + int off=err/adx; if(dy<0)return(y0-off); return(y0+off); @@ -281,7 +281,7 @@ XdB(0x52606733), XdB(0x57bad899), XdB(0x5d6e593a), XdB(0x6380b298), XdB(0x69f80e9a), XdB(0x70dafda8), XdB(0x78307d76), XdB(0x7fffffff), }; - + static void render_line(int x0,int x1,int y0,int y1,ogg_int32_t *d){ int dy=y1-y0; int adx=x1-x0; @@ -312,17 +312,17 @@ vorbis_look_floor1 *look=(vorbis_look_floor1 *)in; vorbis_info_floor1 *info=look->vi; codec_setup_info *ci=(codec_setup_info *)vb->vd->vi->codec_setup; - + int i,j,k; - codebook *books=ci->fullbooks; - + codebook *books=ci->fullbooks; + /* unpack wrapped/predicted values from stream */ if(oggpack_read(&vb->opb,1)==1){ int *fit_value=(int *)_vorbis_block_alloc(vb,(look->posts)*sizeof(*fit_value)); - + fit_value[0]=oggpack_read(&vb->opb,ilog(look->quant_q-1)); fit_value[1]=oggpack_read(&vb->opb,ilog(look->quant_q-1)); - + /* partition by partition */ /* partition by partition */ for(i=0,j=2;i<info->partitions;i++){ @@ -386,7 +386,7 @@ }else{ fit_value[i]=predicted|0x8000; } - + } return(fit_value); @@ -414,17 +414,17 @@ int current=look->forward_index[j]; int hy=fit_value[current]&0x7fff; if(hy==fit_value[current]){ - + hy*=info->mult; hx=info->postlist[current]; - + render_line(lx,hx,ly,hy,out); - + lx=hx; ly=hy; } } - for(j=hx;j<n;j++)out[j]*=ly; /* be certain */ + for(j=hx;j<n;j++)out[j]*=ly; /* be certain */ return(1); } memset(out,0,sizeof(*out)*n);
--- a/tremor/framing.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/framing.c Wed May 13 15:22:13 2009 +0000 @@ -61,7 +61,7 @@ (og->header[16]<<16) | (og->header[17]<<24)); } - + long ogg_page_pageno(ogg_page *og){ return(og->header[18] | (og->header[19]<<8) | @@ -78,13 +78,13 @@ /* NOTE: If a page consists of a packet begun on a previous page, and a new packet begun (but not completed) on this page, the return will be: - ogg_page_packets(page) ==1, + ogg_page_packets(page) ==1, ogg_page_continued(page) !=0 If a page happens to be a single packet that was begun on a previous page, and spans to the next page (in the case of a three or -more page packet), the return will be: - ogg_page_packets(page) ==0, +more page packet), the return will be: + ogg_page_packets(page) ==0, ogg_page_continued(page) !=0 */ @@ -200,7 +200,7 @@ return(0); } return(-1); -} +} /* _clear does not free os, only the non-flat storage within */ int ogg_stream_clear(ogg_stream_state *os){ @@ -209,10 +209,10 @@ if(os->lacing_vals)_ogg_free(os->lacing_vals); if(os->granule_vals)_ogg_free(os->granule_vals); - memset(os,0,sizeof(*os)); + memset(os,0,sizeof(*os)); } return(0); -} +} int ogg_stream_destroy(ogg_stream_state *os){ if(os){ @@ -220,7 +220,7 @@ _ogg_free(os); } return(0); -} +} /* Helpers for ogg_stream_encode; this keeps the structure and what's happening fairly clear */ @@ -254,12 +254,12 @@ og->header[23]=0; og->header[24]=0; og->header[25]=0; - + for(i=0;i<og->header_len;i++) crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->header[i]]; for(i=0;i<og->body_len;i++) crc_reg=(crc_reg<<8)^crc_lookup[((crc_reg >> 24)&0xff)^og->body[i]]; - + og->header[22]=(unsigned char)(crc_reg&0xff); og->header[23]=(unsigned char)((crc_reg>>8)&0xff); og->header[24]=(unsigned char)((crc_reg>>16)&0xff); @@ -275,14 +275,14 @@ /* advance packet data according to the body_returned pointer. We had to keep it around to return a pointer into the buffer last call */ - + os->body_fill-=os->body_returned; if(os->body_fill) memmove(os->body_data,os->body_data+os->body_returned, os->body_fill); os->body_returned=0; } - + /* make sure we have the buffer storage */ _os_body_expand(os,op->bytes); _os_lacing_expand(os,lacing_vals); @@ -327,7 +327,7 @@ since ogg_stream_flush will flush the last page in a stream even if it's undersized, you almost certainly want to use ogg_stream_pageout - (and *not* ogg_stream_flush) unless you specifically need to flush + (and *not* ogg_stream_flush) unless you specifically need to flush an page regardless of size in the middle of a stream. */ int ogg_stream_flush(ogg_stream_state *os,ogg_page *og){ @@ -339,10 +339,10 @@ ogg_int64_t granule_pos=os->granule_vals[0]; if(maxvals==0)return(0); - + /* construct a page */ /* decide how many segments to include */ - + /* If this is the initial header case, the first page must only include the initial header packet */ if(os->b_o_s==0){ /* 'initial header page' case */ @@ -360,13 +360,13 @@ granule_pos=os->granule_vals[vals]; } } - + /* construct the header in temp storage */ memcpy(os->header,"OggS",4); - + /* stream structure version */ os->header[4]=0x00; - + /* continued packet flag? */ os->header[5]=0x00; if((os->lacing_vals[0]&0x100)==0)os->header[5]|=0x01; @@ -405,33 +405,33 @@ pageno>>=8; } } - + /* zero for computation; filled in later */ os->header[22]=0; os->header[23]=0; os->header[24]=0; os->header[25]=0; - + /* segment table */ os->header[26]=(unsigned char)(vals&0xff); for(i=0;i<vals;i++) bytes+=os->header[i+27]=(unsigned char)(os->lacing_vals[i]&0xff); - + /* set pointers in the ogg_page struct */ og->header=os->header; og->header_len=os->header_fill=vals+27; og->body=os->body_data+os->body_returned; og->body_len=bytes; - + /* advance the lacing data and set the body_returned pointer */ - + os->lacing_fill-=vals; memmove(os->lacing_vals,os->lacing_vals+vals,os->lacing_fill*sizeof(*os->lacing_vals)); memmove(os->granule_vals,os->granule_vals+vals,os->lacing_fill*sizeof(*os->granule_vals)); os->body_returned+=bytes; - + /* calculate the checksum */ - + ogg_page_checksum_set(og); /* done */ @@ -449,10 +449,10 @@ os->body_fill-os->body_returned > 4096 ||/* 'page nominal size' case */ os->lacing_fill>=255 || /* 'segment table full' case */ (os->lacing_fill&&!os->b_o_s)){ /* 'initial header page' case */ - + return(ogg_stream_flush(os,og)); } - + /* not enough data to construct a page and not end of stream */ return(0); } @@ -540,61 +540,61 @@ -n) skipped n bytes 0) page not ready; more data (no bytes skipped) n) page synced at current location; page length n bytes - + */ long ogg_sync_pageseek(ogg_sync_state *oy,ogg_page *og){ unsigned char *page=oy->data+oy->returned; unsigned char *next; long bytes=oy->fill-oy->returned; - + if(oy->headerbytes==0){ int headerbytes,i; if(bytes<27)return(0); /* not enough for a header */ - + /* verify capture pattern */ if(memcmp(page,"OggS",4))goto sync_fail; - + headerbytes=page[26]+27; if(bytes<headerbytes)return(0); /* not enough for header + seg table */ - + /* count up body length in the segment table */ - + for(i=0;i<page[26];i++) oy->bodybytes+=page[27+i]; oy->headerbytes=headerbytes; } - + if(oy->bodybytes+oy->headerbytes>bytes)return(0); - + /* The whole test page is buffered. Verify the checksum */ { /* Grab the checksum bytes, set the header field to zero */ char chksum[4]; ogg_page log; - + memcpy(chksum,page+22,4); memset(page+22,0,4); - + /* set up a temp page struct and recompute the checksum */ log.header=page; log.header_len=oy->headerbytes; log.body=page+oy->headerbytes; log.body_len=oy->bodybytes; ogg_page_checksum_set(&log); - + /* Compare */ if(memcmp(chksum,page+22,4)){ /* D'oh. Mismatch! Corrupt page (or miscapture and not a page at all) */ /* replace the computed checksum with the one actually read in */ memcpy(page+22,chksum,4); - + /* Bad checksum. Lose sync */ goto sync_fail; } } - + /* yes, have a whole page all ready to go */ { unsigned char *page=oy->data+oy->returned; @@ -613,12 +613,12 @@ oy->bodybytes=0; return(bytes); } - + sync_fail: - + oy->headerbytes=0; oy->bodybytes=0; - + /* search for possible capture */ next=memchr(page+1,'O',bytes-1); if(!next) @@ -655,7 +655,7 @@ /* need more data */ return(0); } - + /* head did not start a synced page... skipped some bytes */ if(!oy->unsynced){ oy->unsynced=1; @@ -684,7 +684,7 @@ int serialno=ogg_page_serialno(og); long pageno=ogg_page_pageno(og); int segments=header[26]; - + /* clean up 'returned data' */ { long lr=os->lacing_returned; @@ -737,7 +737,7 @@ /* are we a 'continued packet' page? If so, we may need to skip some segments */ if(continued){ - if(os->lacing_fill<1 || + if(os->lacing_fill<1 || os->lacing_vals[os->lacing_fill-1]==0x400){ bos=0; for(;segptr<segments;segptr++){ @@ -751,7 +751,7 @@ } } } - + if(bodysize){ _os_body_expand(os,bodysize); memcpy(os->body_data+os->body_fill,body,bodysize); @@ -764,20 +764,20 @@ int val=header[27+segptr]; os->lacing_vals[os->lacing_fill]=val; os->granule_vals[os->lacing_fill]=-1; - + if(bos){ os->lacing_vals[os->lacing_fill]|=0x100; bos=0; } - + if(val<255)saved=os->lacing_fill; - + os->lacing_fill++; segptr++; - + if(val<255)os->lacing_packet=os->lacing_fill; } - + /* set the granulepos on the last granuleval of the last full packet */ if(saved!=-1){ os->granule_vals[saved]=granulepos;
--- a/tremor/info.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/info.c Wed May 13 15:22:13 2009 +0000 @@ -61,7 +61,7 @@ strcpy(fulltag, tag); strcat(fulltag, "="); - + for(i=0;i<vc->comments;i++){ if(!tagcompare(vc->user_comments[i], fulltag, taglen)){ if(count == found) @@ -128,7 +128,7 @@ for(i=0;i<ci->floors;i++) /* unpack does the range checking */ _floor_P[ci->floor_type[i]]->free_info(ci->floor_param[i]); - + for(i=0;i<ci->residues;i++) /* unpack does the range checking */ _residue_P[ci->residue_type[i]]->free_info(ci->residue_param[i]); @@ -142,7 +142,7 @@ } if(ci->fullbooks) _ogg_free(ci->fullbooks); - + _ogg_free(ci); } @@ -167,13 +167,13 @@ ci->blocksizes[0]=1<<oggpack_read(opb,4); ci->blocksizes[1]=1<<oggpack_read(opb,4); - + if(vi->rate<1)goto err_out; if(vi->channels<1)goto err_out; - if(ci->blocksizes[0]<64)goto err_out; + if(ci->blocksizes[0]<64)goto err_out; if(ci->blocksizes[1]<ci->blocksizes[0])goto err_out; if(ci->blocksizes[1]>8192)goto err_out; - + if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */ return(0); @@ -192,14 +192,14 @@ if(vc->comments<0)goto err_out; vc->user_comments=(char **)_ogg_calloc(vc->comments+1,sizeof(*vc->user_comments)); vc->comment_lengths=(int *)_ogg_calloc(vc->comments+1, sizeof(*vc->comment_lengths)); - + for(i=0;i<vc->comments;i++){ int len=oggpack_read(opb,32); if(len<0)goto err_out; vc->comment_lengths[i]=len; vc->user_comments[i]=(char *)_ogg_calloc(len+1,1); _v_readstring(opb,vc->user_comments[i],len); - } + } if(oggpack_read(opb,1)!=1)goto err_out; /* EOP check */ return(0); @@ -267,7 +267,7 @@ ci->map_param[i]=_mapping_P[ci->map_type[i]]->unpack(vi,opb); if(!ci->map_param[i])goto err_out; } - + /* mode settings */ ci->modes=oggpack_read(opb,6)+1; /*vi->mode_param=_ogg_calloc(vi->modes,sizeof(void *));*/ @@ -282,7 +282,7 @@ if(ci->mode_param[i]->transformtype>=VI_WINDOWB)goto err_out; if(ci->mode_param[i]->mapping>=ci->maps)goto err_out; } - + if(oggpack_read(opb,1)!=1)goto err_out; /* top level EOP check */ return(0); @@ -298,7 +298,7 @@ int vorbis_synthesis_headerin(vorbis_info *vi,vorbis_comment *vc,ogg_packet *op){ oggpack_buffer opb; - + if(op){ oggpack_readinit(&opb,op->packet,op->bytes);
--- a/tremor/ivorbiscodec.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/ivorbiscodec.h Wed May 13 15:22:13 2009 +0000 @@ -32,14 +32,14 @@ /* The below bitrate declarations are *hints*. Combinations of the three values carry the following implications: - - all three set to the same value: + + all three set to the same value: implies a fixed rate bitstream - only nominal set: - implies a VBR stream that averages the nominal bitrate. No hard + only nominal set: + implies a VBR stream that averages the nominal bitrate. No hard upper/lower limit - upper and or lower set: - implies a VBR bitstream that obeys the bitrate limits. nominal + upper and or lower set: + implies a VBR bitstream that obeys the bitrate limits. nominal may also be set to give a nominal rate. none set: the coder does not care to speculate. @@ -82,9 +82,9 @@ typedef struct vorbis_block{ /* necessary stream state for linking to the framing abstraction */ - ogg_int32_t **pcm; /* this is a pointer into local storage */ + ogg_int32_t **pcm; /* this is a pointer into local storage */ oggpack_buffer opb; - + long lW; long W; long nW; @@ -153,8 +153,8 @@ extern void vorbis_info_clear(vorbis_info *vi); extern int vorbis_info_blocksize(vorbis_info *vi,int zo); extern void vorbis_comment_init(vorbis_comment *vc); -extern void vorbis_comment_add(vorbis_comment *vc, char *comment); -extern void vorbis_comment_add_tag(vorbis_comment *vc, +extern void vorbis_comment_add(vorbis_comment *vc, char *comment); +extern void vorbis_comment_add_tag(vorbis_comment *vc, char *tag, char *contents); extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count); extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag); @@ -177,7 +177,7 @@ /* Vorbis ERRORS and return codes ***********************************/ -#define OV_FALSE -1 +#define OV_FALSE -1 #define OV_EOF -2 #define OV_HOLE -3
--- a/tremor/mapping0.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/mapping0.c Wed May 13 15:22:13 2009 +0000 @@ -50,7 +50,7 @@ vorbis_func_residue **residue_func; int ch; - long lastframe; /* if a different mode is called, we need to + long lastframe; /* if a different mode is called, we need to invalidate decay */ } vorbis_look_mapping0; @@ -89,14 +89,14 @@ vorbis_look_mapping0 *look=(vorbis_look_mapping0 *)_ogg_calloc(1,sizeof(*look)); vorbis_info_mapping0 *info=look->map=(vorbis_info_mapping0 *)m; look->mode=vm; - + look->floor_look=(vorbis_look_floor **)_ogg_calloc(info->submaps,sizeof(*look->floor_look)); look->residue_look=(vorbis_look_residue **)_ogg_calloc(info->submaps,sizeof(*look->residue_look)); look->floor_func=(vorbis_func_floor **)_ogg_calloc(info->submaps,sizeof(*look->floor_func)); look->residue_func=(vorbis_func_residue **)_ogg_calloc(info->submaps,sizeof(*look->residue_func)); - + for(i=0;i<info->submaps;i++){ int floornum=info->floorsubmap[i]; int resnum=info->residuesubmap[i]; @@ -107,7 +107,7 @@ look->residue_func[i]=_residue_P[ci->residue_type[resnum]]; look->residue_look[i]=look->residue_func[i]-> look(vd,vm,ci->residue_param[resnum]); - + } look->ch=vi->channels; @@ -144,9 +144,9 @@ int testM=info->coupling_mag[i]=oggpack_read(opb,ilog(vi->channels)); int testA=info->coupling_ang[i]=oggpack_read(opb,ilog(vi->channels)); - if(testM<0 || - testA<0 || - testM==testA || + if(testM<0 || + testA<0 || + testM==testA || testM>=vi->channels || testA>=vi->channels) goto err_out; } @@ -154,7 +154,7 @@ } if(oggpack_read(opb,2)>0)goto err_out; /* 2,3:reserved */ - + if(info->submaps>1){ for(i=0;i<vi->channels;i++){ info->chmuxlist[i]=oggpack_read(opb,4); @@ -191,10 +191,10 @@ ogg_int32_t **pcmbundle=(ogg_int32_t **)alloca(sizeof(*pcmbundle)*vi->channels); int *zerobundle=(int *)alloca(sizeof(*zerobundle)*vi->channels); - + int *nonzero =(int *)alloca(sizeof(*nonzero)*vi->channels); void **floormemo=(void **)alloca(sizeof(*floormemo)*vi->channels); - + /* time domain information decode (note that applying the information would have to happen later; we'll probably add a function entry to the harness for that later */ @@ -208,7 +208,7 @@ if(floormemo[i]) nonzero[i]=1; else - nonzero[i]=0; + nonzero[i]=0; memset(vb->pcm[i],0,sizeof(*vb->pcm[i])*n/2); } @@ -216,8 +216,8 @@ for(i=0;i<info->coupling_steps;i++){ if(nonzero[info->coupling_mag[i]] || nonzero[info->coupling_ang[i]]){ - nonzero[info->coupling_mag[i]]=1; - nonzero[info->coupling_ang[i]]=1; + nonzero[info->coupling_mag[i]]=1; + nonzero[info->coupling_ang[i]]=1; } } @@ -233,7 +233,7 @@ pcmbundle[ch_in_bundle++]=vb->pcm[j]; } } - + look->residue_func[i]->inverse(vb,look->residue_look[i], pcmbundle,zerobundle,ch_in_bundle); } @@ -246,11 +246,11 @@ for(i=info->coupling_steps-1;i>=0;i--){ ogg_int32_t *pcmM=vb->pcm[info->coupling_mag[i]]; ogg_int32_t *pcmA=vb->pcm[info->coupling_ang[i]]; - + for(j=0;j<n/2;j++){ ogg_int32_t mag=pcmM[j]; ogg_int32_t ang=pcmA[j]; - + if(mag>0) if(ang>0){ pcmM[j]=mag; @@ -302,7 +302,7 @@ else for(j=0;j<n;j++) pcm[j]=0; - + } //for(j=0;j<vi->channels;j++)
--- a/tremor/mdct.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/mdct.c Wed May 13 15:22:13 2009 +0000 @@ -98,12 +98,12 @@ REG_TYPE r0, r1; - r0 = x[30] - x[14]; x[30] += x[14]; + r0 = x[30] - x[14]; x[30] += x[14]; r1 = x[31] - x[15]; x[31] += x[15]; x[14] = r0; x[15] = r1; MB(); - r0 = x[28] - x[12]; x[28] += x[12]; + r0 = x[28] - x[12]; x[28] += x[12]; r1 = x[29] - x[13]; x[29] += x[13]; XNPROD31( r0, r1, cPI1_8, cPI3_8, &x[12], &x[13] ); MB(); @@ -235,7 +235,7 @@ int stages=8-shift; int i,j; - + for(i=0;--stages>0;i++){ for(j=0;j<(1<<i);j++) mdct_butterfly_generic(x+(points>>i)*j,points>>i,4<<(i+shift)); @@ -350,7 +350,7 @@ for (shift=6;!(n&(1<<shift));shift++); shift=13-shift; step=2<<shift; - + /* rotate */ iX = in+n2-7;
--- a/tremor/mdct_lookup.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/mdct_lookup.h Wed May 13 15:22:13 2009 +0000 @@ -14,7 +14,7 @@ function: sin,cos lookup tables ********************************************************************/ - + #include "os_types.h" /* {sin(2*i*PI/4096), cos(2*i*PI/4096)}, with i = 0 to 512 */ @@ -277,7 +277,7 @@ X(0x5a3b47ab), X(0x5ac973b5), X(0x5a5ee79a), X(0x5aa5fda5), X(0x5a82799a), X(0x5a82799a) }; - + /* {sin((2*i+1)*PI/4096), cos((2*i+1)*PI/4096)}, with i = 0 to 511 */ static LOOKUP_T sincos_lookup1[1024] = { X(0x001921fb), X(0x7ffffd88), X(0x004b65ee), X(0x7fffe9cb), @@ -537,4 +537,4 @@ X(0x5a05bdae), X(0x5afe8a8b), X(0x5a29727b), X(0x5adb297d), X(0x5a4d1960), X(0x5ab7ba6c), X(0x5a70b258), X(0x5a943d5e), }; - +
--- a/tremor/misc.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/misc.h Wed May 13 15:22:13 2009 +0000 @@ -21,10 +21,10 @@ #include "os_types.h" #include "asm_arm.h" - + #ifndef _V_WIDE_MATH #define _V_WIDE_MATH - + #ifndef _LOW_ACCURACY_ /* 64 bit multiply */ @@ -76,7 +76,7 @@ /* * For MULT32 and MULT31: The second argument is always a lookup table - * value already preshifted from 31 to 8 bits. We therefore take the + * value already preshifted from 31 to 8 bits. We therefore take the * opportunity to save on text space and use unsigned char for those * tables in this case. */ @@ -175,7 +175,7 @@ return MULT32(a,b); #else *p=ap+bp+31; - return (a>>15)*(b>>16); + return (a>>15)*(b>>16); #endif }else return 0; @@ -223,7 +223,7 @@ } a+=b; - if((a&0xc0000000)==0xc0000000 || + if((a&0xc0000000)==0xc0000000 || (a&0xc0000000)==0){ a<<=1; (*p)--;
--- a/tremor/ogg.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/ogg.h Wed May 13 15:22:13 2009 +0000 @@ -88,7 +88,7 @@ long e_o_s; ogg_int64_t granulepos; - + ogg_int64_t packetno; /* sequence number for decode; the framing knows where there's a hole in the data, but we need coupling so that the codec
--- a/tremor/os.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/os.h Wed May 13 15:22:13 2009 +0000 @@ -28,7 +28,7 @@ #ifdef _WIN32 # include <malloc.h> -# define rint(x) (floor((x)+0.5f)) +# define rint(x) (floor((x)+0.5f)) # define NO_FLOAT_MATH_LIB # define FAST_HYPOT(a, b) sqrt((a)*(a) + (b)*(b)) #endif
--- a/tremor/os_types.h Wed May 13 02:58:57 2009 +0000 +++ b/tremor/os_types.h Wed May 13 15:22:13 2009 +0000 @@ -41,7 +41,7 @@ #if 0 -#ifdef _WIN32 +#ifdef _WIN32 # ifndef __GNUC__ /* MSVC/Borland */
--- a/tremor/res012.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/res012.c Wed May 13 15:22:13 2009 +0000 @@ -30,7 +30,7 @@ typedef struct { vorbis_info_residue0 *info; int map; - + int parts; int stages; codebook *fullbooks; @@ -177,7 +177,7 @@ /* a truncated packet here just means 'stop working'; it's not an error */ static int _01inverse(vorbis_block *vb,vorbis_look_residue *vl, ogg_int32_t **in,int ch, - long (*decodepart)(codebook *, ogg_int32_t *, + long (*decodepart)(codebook *, ogg_int32_t *, oggpack_buffer *,int,int)){ long i,j,k,l,s; @@ -188,7 +188,7 @@ int samples_per_partition=info->grouping; int partitions_per_word=look->phrasebook->dim; int n=info->end-info->begin; - + int partvals=n/samples_per_partition; int partwords=(partvals+partitions_per_word-1)/partitions_per_word; int ***partword=(int ***)alloca(ch*sizeof(*partword)); @@ -198,7 +198,7 @@ for(s=0;s<look->stages;s++){ - /* each loop decodes on partition codeword containing + /* each loop decodes on partition codeword containing partitions_pre_word partitions */ for(i=0,l=0;i<partvals;l++){ if(s==0){ @@ -210,7 +210,7 @@ if(partword[j][l]==NULL)goto errout; } } - + /* now we decode residual values for the partitions */ for(k=0;k<partitions_per_word && i<partvals;k++,i++) for(j=0;j<ch;j++){ @@ -223,9 +223,9 @@ } } } - } + } } - + errout: eopbreak: return(0); @@ -292,7 +292,7 @@ for(k=0;k<partitions_per_word && i<partvals;k++,i++) if(info->secondstages[partword[l][k]]&(1<<s)){ codebook *stagebook=look->partbooks[partword[l][k]][s]; - + if(stagebook){ if(vorbis_book_decodevv_add(stagebook,in, i*samples_per_partition+beginoff,ch, @@ -301,9 +301,9 @@ goto eopbreak; } } - } + } } - + errout: eopbreak: return(0);
--- a/tremor/sharedbook.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/sharedbook.c Wed May 13 15:22:13 2009 +0000 @@ -35,7 +35,7 @@ } /* 32 bit float (not IEEE; nonnormalized mantissa + - biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm + biased exponent) : neeeeeee eeemmmmm mmmmmmmm mmmmmmmm Why not IEEE? It's just not that important here. */ #define VQ_FEXP 10 @@ -78,12 +78,12 @@ long length=l[i]; if(length>0){ ogg_uint32_t entry=marker[length]; - + /* when we claim a node for an entry, we also claim the nodes below it (pruning off the imagined tree that may have dangled from it) as well as blocking the use of any nodes directly above for leaves */ - + /* update ourself */ if(length<32 && (entry>>length)){ /* error condition; the lengths must specify an overpopulated tree */ @@ -91,12 +91,12 @@ return(NULL); } r[count++]=entry; - + /* Look to see if the next shorter marker points to the node above. if so, update it and repeat. */ { for(j=length;j>0;j--){ - + if(marker[j]&1){ /* have to jump branches */ if(j==1) @@ -109,7 +109,7 @@ marker[j]++; } } - + /* prune the tree; the implicit invariant says all the longer markers were dangling from our just-taken node. Dangle them from our *new* node. */ @@ -122,7 +122,7 @@ }else if(sparsecount==0)count++; } - + /* bitreverse the words because our bitwise packer/unpacker is LSb endian */ for(i=0,count=0;i<n;i++){ @@ -217,12 +217,12 @@ val=VFLOAT_ADD(mindel,minpoint,val,point,&point); val=VFLOAT_ADD(last,lastpoint,val,point,&point); - + if(b->q_sequencep){ - last=val; + last=val; lastpoint=point; } - + if(sparsemap){ r[sparsemap[count]*b->dim+k]=val; rp[sparsemap[count]*b->dim+k]=point; @@ -251,9 +251,9 @@ val=VFLOAT_ADD(mindel,minpoint,val,point,&point); val=VFLOAT_ADD(last,lastpoint,val,point,&point); - + if(b->q_sequencep){ - last=val; + last=val; lastpoint=point; } @@ -275,7 +275,7 @@ for(j=0;j<n*b->dim;j++) if(rp[j]<*maxpoint) r[j]>>=*maxpoint-rp[j]; - + _ogg_free(rp); return(r); } @@ -325,7 +325,7 @@ int i,j,n=0,tabn; int *sortindex; memset(c,0,sizeof(*c)); - + /* count actually used entries */ for(i=0;i<s->entries;i++) if(s->lengthlist[i]>0) @@ -338,7 +338,7 @@ c->q_min=s->q_min; c->q_delta=s->q_delta; - /* two different remappings go on here. + /* two different remappings go on here. First, we collapse the likely sparse codebook down only to actually represented values/words. This collapsing needs to be @@ -352,7 +352,7 @@ /* perform sort */ ogg_uint32_t *codes=_make_words(s->lengthlist,s->entries,c->used_entries); ogg_uint32_t **codep=(ogg_uint32_t **)alloca(sizeof(*codep)*n); - + if(codes==NULL)goto err_out; for(i=0;i<n;i++){ @@ -375,14 +375,14 @@ _ogg_free(codes); } - + c->valuelist=_book_unquantize(s,n,sortindex,&c->binarypoint); c->dec_index=(int *)_ogg_malloc(n*sizeof(*c->dec_index)); - + for(n=0,i=0;i<s->entries;i++) if(s->lengthlist[i]>0) c->dec_index[sortindex[n++]]=i; - + c->dec_codelengths=(char *)_ogg_malloc(n*sizeof(*c->dec_codelengths)); for(n=0,i=0;i<s->entries;i++) if(s->lengthlist[i]>0) @@ -417,7 +417,7 @@ if(c->dec_firsttable[bitreverse(word)]==0){ while((lo+1)<n && c->codelist[lo+1]<=word)lo++; while( hi<n && word>=(c->codelist[hi]&mask))hi++; - + /* we only actually have 15 bits per hint to play with here. In order to overflow gracefully (nothing breaks, efficiency just drops), encode as the difference from the extremes. */ @@ -433,7 +433,7 @@ } } } - + return(0); err_out:
--- a/tremor/synthesis.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/synthesis.c Wed May 13 15:22:13 2009 +0000 @@ -32,7 +32,7 @@ codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; oggpack_buffer *opb=&vb->opb; int type,mode,i; - + /* first things first. Make sure decode is ready */ _vorbis_block_ripcord(vb); oggpack_readinit(opb,op->packet,op->bytes); @@ -46,7 +46,7 @@ /* read our mode and pre/post windowsize */ mode=oggpack_read(opb,b->modebits); if(mode==-1)return(OV_EBADPACKET); - + vb->mode=mode; vb->W=ci->mode_param[mode]->blockflag; if(vb->W){ @@ -57,7 +57,7 @@ vb->lW=0; vb->nW=0; } - + /* more setup */ vb->granulepos=op->granulepos; vb->sequence=op->packetno-3; /* first block is third packet */ @@ -79,7 +79,7 @@ codec_setup_info *ci=(codec_setup_info *)vi->codec_setup; oggpack_buffer opb; int mode; - + oggpack_readinit(&opb,op->packet,op->bytes); /* Check the packet type */
--- a/tremor/tremor.diff Wed May 13 02:58:57 2009 +0000 +++ b/tremor/tremor.diff Wed May 13 15:22:13 2009 +0000 @@ -2,10 +2,10 @@ +++ misc.h 2004-12-30 13:09:20.000000000 +0100 @@ -29,8 +29,9 @@ /* 64 bit multiply */ - + #include <sys/types.h> +#include "config.h" - + -#if BYTE_ORDER==LITTLE_ENDIAN +#ifndef WORDS_BIGENDIAN union magic { @@ -15,7 +15,7 @@ } halves; ogg_int64_t whole; }; --#endif +-#endif - -#if BYTE_ORDER==BIG_ENDIAN +#else @@ -32,16 +32,16 @@ + ogg_int32_t point; int val=VFLOAT_MULTI(delta,delpoint, abs(b->quantlist[index]),&point); - + @@ -242,7 +245,7 @@ int lastpoint=0; - + for(k=0;k<b->dim;k++){ - int point; + ogg_int32_t point; int val=VFLOAT_MULTI(delta,delpoint, abs(b->quantlist[j*b->dim+k]),&point); - + --- block.h (revision 0) +++ block.h (revision 0) @@ -0,0 +1,24 @@ @@ -76,9 +76,9 @@ #include "misc.h" #include "os.h" +#include "block.h" - + #define LSP_FRACBITS 14 - + --- floor1.c (revision 24821) +++ floor1.c (working copy) @@ -24,6 +24,7 @@ @@ -86,9 +86,9 @@ #include "codebook.h" #include "misc.h" +#include "block.h" - + #define floor1_rangedB 140 /* floor 1 fixed at -140dB to 0dB range */ - + --- synthesis.c (revision 24821) +++ synthesis.c (working copy) @@ -23,6 +23,7 @@ @@ -96,7 +96,7 @@ #include "misc.h" #include "os.h" +#include "block.h" - + int vorbis_synthesis(vorbis_block *vb,ogg_packet *op){ vorbis_dsp_state *vd=vb->vd; --- res012.c (revision 24821) @@ -106,7 +106,7 @@ #include "misc.h" #include "os.h" +#include "block.h" - + typedef struct { vorbis_info_residue0 *info; --- block.c (revision 24821) @@ -116,7 +116,7 @@ #include "registry.h" #include "misc.h" +#include "block.h" - + static int ilog(unsigned int v){ int ret=0; --- os.h (revision 25873) @@ -124,11 +124,11 @@ @@ -20,18 +20,8 @@ #include <math.h> #include "os_types.h" - + -#ifndef _V_IFDEFJAIL_H_ -# define _V_IFDEFJAIL_H_ +#define STIN static inline - + -# ifdef __GNUC__ -# define STIN static __inline__ -# elif _WIN32 @@ -146,7 +146,7 @@ @@ -32,6 +32,15 @@ #define _ogg_realloc realloc #define _ogg_free free - + +#include <inttypes.h> +typedef int64_t ogg_int64_t; +typedef int32_t ogg_int32_t; @@ -156,13 +156,13 @@ + +#if 0 + - #ifdef _WIN32 - + #ifdef _WIN32 + # ifndef __GNUC__ @@ -85,4 +94,6 @@ - + #endif - + +#endif /* 0 */ + #endif /* _OS_TYPES_H */
--- a/tremor/window.c Wed May 13 02:58:57 2009 +0000 +++ b/tremor/window.c Wed May 13 15:22:13 2009 +0000 @@ -56,7 +56,7 @@ void _vorbis_apply_window(ogg_int32_t *d,const void *window_p[2], long *blocksizes, int lW,int W,int nW){ - + LOOKUP_T *window[2]={window_p[0],window_p[1]}; long n=blocksizes[W]; long ln=blocksizes[lW]; @@ -67,7 +67,7 @@ long rightbegin=n/2+n/4-rn/4; long rightend=rightbegin+rn/2; - + int i,p; for(i=0;i<leftbegin;i++)
--- a/vidix/dhahelperwin/common.ver Wed May 13 02:58:57 2009 +0000 +++ b/vidix/dhahelperwin/common.ver Wed May 13 15:22:13 2009 +0000 @@ -1,207 +1,207 @@ -/* - * PROJECT: ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: include/psdk/common.ver - * PURPOSE: Common Version File. - * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) - */ - -// -// Copyright Year -// -#ifndef VER_LEGALCOPYRIGHT_YEARS -#define VER_LEGALCOPYRIGHT_YEARS "2007" -#endif - -// -// Copyright String -// -#ifndef VER_LEGALCOPYRIGHT_STR -#if defined(RC_INVOKED) && !defined(WIN16) -#define VER_LEGALCOPYRIGHT_STR L"\251 ReactOS Foundation. All rights reserved." -#else -#define VER_LEGALCOPYRIGHT_STR "Copyright (c) ReactOS Foundation. All rights reserved." -#endif -#endif - -// -// Product Name String -// -#ifndef VER_PRODUCTNAME_STR -#ifdef RC_INVOKED -#define VER_PRODUCTNAME_STR L"ReactOS\256 Operating System" -#else -#define VER_PRODUCTNAME_STR "ReactOS (R) Operating System" -#endif -#endif - -// -// The File Version is the same as the Product Version -// -#ifndef VER_FILEVERSION -#define VER_FILEVERSION VER_PRODUCTVERSION -#endif -#ifndef VER_FILEVERSION_STR -#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR -#endif - -// -// If no Original Name was given, use the Internal NAme -// -#ifndef VER_ORIGINALFILENAME_STR -#define VER_ORIGINALFILENAME_STR VER_INTERNALNAME_STR -#endif - -// -// Allow tagging a Build by Machine/Date -// -#if defined(__BUILDMACHINE__) -#if defined(__BUILDDATE__) -#define B2(x,y) " (" #x "." #y ")" -#define B1(x,y) B2(x, y) -#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__, __BUILDDATE__) -#else -#define B2(x) " built by: " #x -#define B1(x) B2(x) -#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__) -#endif -#if defined(__BUILDMACHINE_LEN__) -#if __BUILDMACHINE_LEN__ >= 25 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#elif __BUILDMACHINE_LEN__ == 24 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 23 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 22 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 21 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 20 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 19 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 18 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 17 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 16 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 15 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 14 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 13 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 12 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 11 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 10 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 9 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 8 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 7 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 6 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 5 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 4 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 3 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 2 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#elif __BUILDMACHINE_LEN__ == 1 -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " -#else -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#endif -#else -#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG -#endif -#else -#define BUILD_MACHINE_TAG -#define BUILD_MACHINE_TAG_PADDED -#endif - -// -// Set default neutral Unicode Language ID -// -#ifndef VER_VERSION_UNICODE_LANG -#define VER_VERSION_UNICODE_LANG "000004B0" -#endif - -// -// Set default netural ANSI Language ID -// -#ifndef VER_VERSION_ANSI_LANG -#define VER_VERSION_ANSI_LANG "000004E4" -#endif - -// -// Set default netural translation ID -// -#ifndef VER_VERSION_TRANSLATION -#define VER_VERSION_TRANSLATION 0x0000, 0x04B0 -#endif - -// -// Make sure the Resource Compiler called us. -// If so, then build the actual version resource. -// -#ifdef RC_INVOKED - -VS_VERSION_INFO VERSIONINFO -FILEVERSION VER_FILEVERSION -PRODUCTVERSION VER_PRODUCTVERSION -FILEFLAGSMASK VER_FILEFLAGSMASK -FILEFLAGS VER_FILEFLAGS -FILEOS VER_FILEOS -FILETYPE VER_FILETYPE -FILESUBTYPE VER_FILESUBTYPE -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK VER_VERSION_UNICODE_LANG - BEGIN - VALUE "CompanyName", VER_COMPANYNAME_STR - VALUE "FileDescription", VER_FILEDESCRIPTION_STR - VALUE "FileVersion", VER_FILEVERSION_STR BUILD_MACHINE_TAG_PADDED - VALUE "InternalName", VER_INTERNALNAME_STR - VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR - VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR - VALUE "ProductName", VER_PRODUCTNAME_STR - VALUE "ProductVersion", VER_PRODUCTVERSION_STR -#ifdef VER_OLESELFREGISTER - VALUE "OleSelfRegister", "\0" -#endif - END - -#ifdef VER_ANSICP - BLOCK VER_VERSION_ANSI_LANG - BEGIN - VALUE "CompanyName", VER_COMPANYNAME_STR - VALUE "FileDescription", VER_FILEDESCRIPTION_STR EXPORT_TAG - VALUE "FileVersion", VER_FILEVERSION_STR - VALUE "InternalName", VER_INTERNALNAME_STR - VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR - VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR - VALUE "ProductName", VER_PRODUCTNAME_STR - VALUE "ProductVersion", VER_PRODUCTVERSION_STR -#ifdef VER_OLESELFREGISTER - VALUE "OleSelfRegister", "\0" -#endif - END -#endif - END - - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", VER_VERSION_TRANSLATION - END -END - -#endif +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: include/psdk/common.ver + * PURPOSE: Common Version File. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +// +// Copyright Year +// +#ifndef VER_LEGALCOPYRIGHT_YEARS +#define VER_LEGALCOPYRIGHT_YEARS "2007" +#endif + +// +// Copyright String +// +#ifndef VER_LEGALCOPYRIGHT_STR +#if defined(RC_INVOKED) && !defined(WIN16) +#define VER_LEGALCOPYRIGHT_STR L"\251 ReactOS Foundation. All rights reserved." +#else +#define VER_LEGALCOPYRIGHT_STR "Copyright (c) ReactOS Foundation. All rights reserved." +#endif +#endif + +// +// Product Name String +// +#ifndef VER_PRODUCTNAME_STR +#ifdef RC_INVOKED +#define VER_PRODUCTNAME_STR L"ReactOS\256 Operating System" +#else +#define VER_PRODUCTNAME_STR "ReactOS (R) Operating System" +#endif +#endif + +// +// The File Version is the same as the Product Version +// +#ifndef VER_FILEVERSION +#define VER_FILEVERSION VER_PRODUCTVERSION +#endif +#ifndef VER_FILEVERSION_STR +#define VER_FILEVERSION_STR VER_PRODUCTVERSION_STR +#endif + +// +// If no Original Name was given, use the Internal NAme +// +#ifndef VER_ORIGINALFILENAME_STR +#define VER_ORIGINALFILENAME_STR VER_INTERNALNAME_STR +#endif + +// +// Allow tagging a Build by Machine/Date +// +#if defined(__BUILDMACHINE__) +#if defined(__BUILDDATE__) +#define B2(x,y) " (" #x "." #y ")" +#define B1(x,y) B2(x, y) +#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__, __BUILDDATE__) +#else +#define B2(x) " built by: " #x +#define B1(x) B2(x) +#define BUILD_MACHINE_TAG B1(__BUILDMACHINE__) +#endif +#if defined(__BUILDMACHINE_LEN__) +#if __BUILDMACHINE_LEN__ >= 25 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG +#elif __BUILDMACHINE_LEN__ == 24 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 23 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 22 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 21 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 20 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 19 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 18 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 17 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 16 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 15 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 14 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 13 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 12 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 11 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 10 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 9 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 8 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 7 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 6 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 5 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 4 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 3 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 2 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#elif __BUILDMACHINE_LEN__ == 1 +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG " " +#else +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG +#endif +#else +#define BUILD_MACHINE_TAG_PADDED BUILD_MACHINE_TAG +#endif +#else +#define BUILD_MACHINE_TAG +#define BUILD_MACHINE_TAG_PADDED +#endif + +// +// Set default neutral Unicode Language ID +// +#ifndef VER_VERSION_UNICODE_LANG +#define VER_VERSION_UNICODE_LANG "000004B0" +#endif + +// +// Set default netural ANSI Language ID +// +#ifndef VER_VERSION_ANSI_LANG +#define VER_VERSION_ANSI_LANG "000004E4" +#endif + +// +// Set default netural translation ID +// +#ifndef VER_VERSION_TRANSLATION +#define VER_VERSION_TRANSLATION 0x0000, 0x04B0 +#endif + +// +// Make sure the Resource Compiler called us. +// If so, then build the actual version resource. +// +#ifdef RC_INVOKED + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_PRODUCTVERSION +FILEFLAGSMASK VER_FILEFLAGSMASK +FILEFLAGS VER_FILEFLAGS +FILEOS VER_FILEOS +FILETYPE VER_FILETYPE +FILESUBTYPE VER_FILESUBTYPE +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK VER_VERSION_UNICODE_LANG + BEGIN + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR + VALUE "FileVersion", VER_FILEVERSION_STR BUILD_MACHINE_TAG_PADDED + VALUE "InternalName", VER_INTERNALNAME_STR + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_PRODUCTVERSION_STR +#ifdef VER_OLESELFREGISTER + VALUE "OleSelfRegister", "\0" +#endif + END + +#ifdef VER_ANSICP + BLOCK VER_VERSION_ANSI_LANG + BEGIN + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR EXPORT_TAG + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "InternalName", VER_INTERNALNAME_STR + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "OriginalFilename",VER_ORIGINALFILENAME_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_PRODUCTVERSION_STR +#ifdef VER_OLESELFREGISTER + VALUE "OleSelfRegister", "\0" +#endif + END +#endif + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", VER_VERSION_TRANSLATION + END +END + +#endif
--- a/vidix/dhahelperwin/dhahelper.rc Wed May 13 02:58:57 2009 +0000 +++ b/vidix/dhahelperwin/dhahelper.rc Wed May 13 15:22:13 2009 +0000 @@ -1,17 +1,17 @@ -#include <windows.h> - -#include <ntverp.h> - -#undef VER_COMPANYNAME_STR -#undef VER_PRODUCTNAME_STR - -#define VER_FILETYPE VFT_DRV -#define VER_FILESUBTYPE VFT2_DRV_SYSTEM -#define VER_FILEDESCRIPTION_STR "DhaHelper - Direct HardWare Access Driver" -#define VER_INTERNALNAME_STR "DhaHelper.sys" -#define VER_ORIGINALFILENAME_STR "DhaHelper.sys" -#define VER_LEGALCOPYRIGHT_STR "Sascha Sommer" -#define VER_COMPANYNAME_STR "MPlayer <http://svn.mplayerhq.hu/mplayer/trunk/vidix/dhahelperwin/>" -#define VER_PRODUCTNAME_STR "DhaHelper Driver V1.0" - -#include "common.ver" +#include <windows.h> + +#include <ntverp.h> + +#undef VER_COMPANYNAME_STR +#undef VER_PRODUCTNAME_STR + +#define VER_FILETYPE VFT_DRV +#define VER_FILESUBTYPE VFT2_DRV_SYSTEM +#define VER_FILEDESCRIPTION_STR "DhaHelper - Direct HardWare Access Driver" +#define VER_INTERNALNAME_STR "DhaHelper.sys" +#define VER_ORIGINALFILENAME_STR "DhaHelper.sys" +#define VER_LEGALCOPYRIGHT_STR "Sascha Sommer" +#define VER_COMPANYNAME_STR "MPlayer <http://svn.mplayerhq.hu/mplayer/trunk/vidix/dhahelperwin/>" +#define VER_PRODUCTNAME_STR "DhaHelper Driver V1.0" + +#include "common.ver"
--- a/vidix/dhahelperwin/ntverp.h Wed May 13 02:58:57 2009 +0000 +++ b/vidix/dhahelperwin/ntverp.h Wed May 13 15:22:13 2009 +0000 @@ -1,156 +1,156 @@ -/* - * PROJECT: ReactOS - * LICENSE: GPL - See COPYING in the top level directory - * FILE: include/psdk/ntverp.h - * PURPOSE: Master Version File. - * This file should be modified only by the official builder - * to update VERSION, VER_PRODUCTVERSION, VER_PRODUCTVERSION_ - * STR and VER_PRODUCTBETA_STR values. - * The VER_PRODUCTBUILD lines must contain the product - * comments and end with the build#<CR><LF>. - * The VER_PRODUCTBETA_STR lines must contain the product - * comments and end with "somestring"<CR><LF. - * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) - */ - -#ifndef MPLAYER_NTVERP_H -#define MPLAYER_NTVERP_H - -// -// Windows NT Build 3790.1830 -// -#define VER_PRODUCTBUILD 3790 -#define VER_PRODUCTBUILD_QFE 1830 - -// -// Windows NT Version 5.2 -// -#define VER_PRODUCTMAJORVERSION 5 -#define VER_PRODUCTMINORVERSION 2 -#define VER_PRODUCTVERSION_W (0x0502) -#define VER_PRODUCTVERSION_DW (0x05020000 | VER_PRODUCTBUILD) - -// -// Not a beta -// -#define VER_PRODUCTBETA_STR "" - -// -// ANSI String Generating Macros -// -#define VER_PRODUCTVERSION_MAJORMINOR2(x,y) \ - #x "." #y -#define VER_PRODUCTVERSION_MAJORMINOR1(x,y) \ - VER_PRODUCTVERSION_MAJORMINOR2(x, y) -#define VER_PRODUCTVERSION_STRING \ - VER_PRODUCTVERSION_MAJORMINOR1(VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION) - -// -// Unicode String Generating Macros -// -#define LVER_PRODUCTVERSION_MAJORMINOR2(x,y)\ - L#x L"." L#y -#define LVER_PRODUCTVERSION_MAJORMINOR1(x,y)\ - LVER_PRODUCTVERSION_MAJORMINOR2(x, y) -#define LVER_PRODUCTVERSION_STRING \ - LVER_PRODUCTVERSION_MAJORMINOR1(VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION) - -// -// Full Product Version -// -#define VER_PRODUCTVERSION \ - VER_PRODUCTMAJORVERSION,VER_PRODUCTMINORVERSION,VER_PRODUCTBUILD,VER_PRODUCTBUILD_QFE - -// -// Padding for ANSI Version String -// -#if (VER_PRODUCTBUILD < 10) -#define VER_BPAD "000" -#elif (VER_PRODUCTBUILD < 100) -#define VER_BPAD "00" -#elif (VER_PRODUCTBUILD < 1000) -#define VER_BPAD "0" -#else -#define VER_BPAD -#endif - -// -// Padding for Unicode Version String -// -#if (VER_PRODUCTBUILD < 10) -#define LVER_BPAD L"000" -#elif (VER_PRODUCTBUILD < 100) -#define LVER_BPAD L"00" -#elif (VER_PRODUCTBUILD < 1000) -#define LVER_BPAD L"0" -#else -#define LVER_BPAD -#endif - -// -// ANSI Product Version String -// -#define VER_PRODUCTVERSION_STR2(x,y) \ - VER_PRODUCTVERSION_STRING "." VER_BPAD #x "." #y -#define VER_PRODUCTVERSION_STR1(x,y) \ - VER_PRODUCTVERSION_STR2(x, y) -#define VER_PRODUCTVERSION_STR \ - VER_PRODUCTVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) - -// -// Unicode Product Version String -// -#define LVER_PRODUCTVERSION_STR2(x,y) \ - LVER_PRODUCTVERSION_STRING L"." LVER_BPAD L#x L"." L#y -#define LVER_PRODUCTVERSION_STR1(x,y) \ - LVER_PRODUCTVERSION_STR2(x, y) -#define LVER_PRODUCTVERSION_STR \ - LVER_PRODUCTVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) - -// -// Debug Flag -// -#if DBG -#define VER_DEBUG VS_FF_DEBUG -#else -#define VER_DEBUG 0 -#endif - -// -// Beta Flag -// -#if BETA -#define VER_PRERELEASE VS_FF_PRERELEASE -#else -#define VER_PRERELEASE 0 -#endif - -// -// Internal Flag -// -#if OFFICIAL_BUILD -#define VER_PRIVATE 0 -#else -#define VER_PRIVATE VS_FF_PRIVATEBUILD -#endif - -// -// Other Flags -// -#define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#define VER_FILEOS VOS_NT_WINDOWS32 -#define VER_FILEFLAGS (VER_PRERELEASE | \ - VER_DEBUG | \ - VER_PRIVATE) - -// -// Company and Trademarks -// -#define VER_COMPANYNAME_STR \ - "ReactOS(R) Foundation" -#define VER_PRODUCTNAME_STR \ - "ReactOS(R) Operating System" -#define VER_LEGALTRADEMARKS_STR \ - "ReactOS(R) is a registered trademark of the ReactOS Foundation." - -#endif /* MPLAYER_NTVERP_H */ +/* + * PROJECT: ReactOS + * LICENSE: GPL - See COPYING in the top level directory + * FILE: include/psdk/ntverp.h + * PURPOSE: Master Version File. + * This file should be modified only by the official builder + * to update VERSION, VER_PRODUCTVERSION, VER_PRODUCTVERSION_ + * STR and VER_PRODUCTBETA_STR values. + * The VER_PRODUCTBUILD lines must contain the product + * comments and end with the build#<CR><LF>. + * The VER_PRODUCTBETA_STR lines must contain the product + * comments and end with "somestring"<CR><LF. + * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) + */ + +#ifndef MPLAYER_NTVERP_H +#define MPLAYER_NTVERP_H + +// +// Windows NT Build 3790.1830 +// +#define VER_PRODUCTBUILD 3790 +#define VER_PRODUCTBUILD_QFE 1830 + +// +// Windows NT Version 5.2 +// +#define VER_PRODUCTMAJORVERSION 5 +#define VER_PRODUCTMINORVERSION 2 +#define VER_PRODUCTVERSION_W (0x0502) +#define VER_PRODUCTVERSION_DW (0x05020000 | VER_PRODUCTBUILD) + +// +// Not a beta +// +#define VER_PRODUCTBETA_STR "" + +// +// ANSI String Generating Macros +// +#define VER_PRODUCTVERSION_MAJORMINOR2(x,y) \ + #x "." #y +#define VER_PRODUCTVERSION_MAJORMINOR1(x,y) \ + VER_PRODUCTVERSION_MAJORMINOR2(x, y) +#define VER_PRODUCTVERSION_STRING \ + VER_PRODUCTVERSION_MAJORMINOR1(VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION) + +// +// Unicode String Generating Macros +// +#define LVER_PRODUCTVERSION_MAJORMINOR2(x,y)\ + L#x L"." L#y +#define LVER_PRODUCTVERSION_MAJORMINOR1(x,y)\ + LVER_PRODUCTVERSION_MAJORMINOR2(x, y) +#define LVER_PRODUCTVERSION_STRING \ + LVER_PRODUCTVERSION_MAJORMINOR1(VER_PRODUCTMAJORVERSION, VER_PRODUCTMINORVERSION) + +// +// Full Product Version +// +#define VER_PRODUCTVERSION \ + VER_PRODUCTMAJORVERSION,VER_PRODUCTMINORVERSION,VER_PRODUCTBUILD,VER_PRODUCTBUILD_QFE + +// +// Padding for ANSI Version String +// +#if (VER_PRODUCTBUILD < 10) +#define VER_BPAD "000" +#elif (VER_PRODUCTBUILD < 100) +#define VER_BPAD "00" +#elif (VER_PRODUCTBUILD < 1000) +#define VER_BPAD "0" +#else +#define VER_BPAD +#endif + +// +// Padding for Unicode Version String +// +#if (VER_PRODUCTBUILD < 10) +#define LVER_BPAD L"000" +#elif (VER_PRODUCTBUILD < 100) +#define LVER_BPAD L"00" +#elif (VER_PRODUCTBUILD < 1000) +#define LVER_BPAD L"0" +#else +#define LVER_BPAD +#endif + +// +// ANSI Product Version String +// +#define VER_PRODUCTVERSION_STR2(x,y) \ + VER_PRODUCTVERSION_STRING "." VER_BPAD #x "." #y +#define VER_PRODUCTVERSION_STR1(x,y) \ + VER_PRODUCTVERSION_STR2(x, y) +#define VER_PRODUCTVERSION_STR \ + VER_PRODUCTVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) + +// +// Unicode Product Version String +// +#define LVER_PRODUCTVERSION_STR2(x,y) \ + LVER_PRODUCTVERSION_STRING L"." LVER_BPAD L#x L"." L#y +#define LVER_PRODUCTVERSION_STR1(x,y) \ + LVER_PRODUCTVERSION_STR2(x, y) +#define LVER_PRODUCTVERSION_STR \ + LVER_PRODUCTVERSION_STR1(VER_PRODUCTBUILD, VER_PRODUCTBUILD_QFE) + +// +// Debug Flag +// +#if DBG +#define VER_DEBUG VS_FF_DEBUG +#else +#define VER_DEBUG 0 +#endif + +// +// Beta Flag +// +#if BETA +#define VER_PRERELEASE VS_FF_PRERELEASE +#else +#define VER_PRERELEASE 0 +#endif + +// +// Internal Flag +// +#if OFFICIAL_BUILD +#define VER_PRIVATE 0 +#else +#define VER_PRIVATE VS_FF_PRIVATEBUILD +#endif + +// +// Other Flags +// +#define VER_FILEFLAGSMASK VS_FFI_FILEFLAGSMASK +#define VER_FILEOS VOS_NT_WINDOWS32 +#define VER_FILEFLAGS (VER_PRERELEASE | \ + VER_DEBUG | \ + VER_PRIVATE) + +// +// Company and Trademarks +// +#define VER_COMPANYNAME_STR \ + "ReactOS(R) Foundation" +#define VER_PRODUCTNAME_STR \ + "ReactOS(R) Operating System" +#define VER_LEGALTRADEMARKS_STR \ + "ReactOS(R) is a registered trademark of the ReactOS Foundation." + +#endif /* MPLAYER_NTVERP_H */