Mercurial > mplayer.hg
comparison liba52/liba52_changes.diff @ 19249:9960f9ef96fd
cosmetics: Make patch apply cleanly.
| author | diego |
|---|---|
| date | Sat, 29 Jul 2006 23:26:30 +0000 |
| parents | 722ac20fac5f |
| children | 87dddfc314fd |
comparison
equal
deleted
inserted
replaced
| 19248:dd30cb46819d | 19249:9960f9ef96fd |
|---|---|
| 1 --- liba52-0.7.4/a52.h 2006-06-12 15:04:57.000000000 +0200 | 1 --- include/a52.h 2006-06-12 15:04:57.000000000 +0200 |
| 2 +++ liba52/a52.h 2006-06-05 02:23:02.000000000 +0200 | 2 +++ liba52/a52.h 2006-06-05 02:23:02.000000000 +0200 |
| 3 @@ -59,4 +63,9 @@ | 3 @@ -59,4 +63,9 @@ |
| 4 int a52_block (a52_state_t * state); | 4 int a52_block (a52_state_t * state); |
| 5 void a52_free (a52_state_t * state); | 5 void a52_free (a52_state_t * state); |
| 6 | 6 |
| 8 +extern int (* a52_resample) (float * _f, int16_t * s16); | 8 +extern int (* a52_resample) (float * _f, int16_t * s16); |
| 9 + | 9 + |
| 10 +uint16_t crc16_block(uint8_t *data,uint32_t num_bytes); | 10 +uint16_t crc16_block(uint8_t *data,uint32_t num_bytes); |
| 11 + | 11 + |
| 12 #endif /* A52_H */ | 12 #endif /* A52_H */ |
| 13 --- liba52-0.7.4/a52_internal.h 2006-06-12 15:05:07.000000000 +0200 | 13 --- liba52/a52_internal.h 2006-06-12 15:05:07.000000000 +0200 |
| 14 +++ liba52/a52_internal.h 2006-06-05 02:23:02.000000000 +0200 | 14 +++ liba52/a52_internal.h 2006-06-05 02:23:02.000000000 +0200 |
| 15 @@ -103,18 +107,34 @@ | 15 @@ -103,18 +107,34 @@ |
| 16 #define DELTA_BIT_NONE (2) | 16 #define DELTA_BIT_NONE (2) |
| 17 #define DELTA_BIT_RESERVED (3) | 17 #define DELTA_BIT_RESERVED (3) |
| 18 | 18 |
| 48 void a52_imdct_init (uint32_t mm_accel); | 48 void a52_imdct_init (uint32_t mm_accel); |
| 49 void a52_imdct_256 (sample_t * data, sample_t * delay, sample_t bias); | 49 void a52_imdct_256 (sample_t * data, sample_t * delay, sample_t bias); |
| 50 -void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias); | 50 -void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias); |
| 51 +extern void (*a52_imdct_512) (sample_t * data, sample_t * delay, sample_t bias); | 51 +extern void (*a52_imdct_512) (sample_t * data, sample_t * delay, sample_t bias); |
| 52 +void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias); | 52 +void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias); |
| 53 --- liba52-0.7.4/bitstream.c 2006-06-12 15:05:07.000000000 +0200 | 53 --- liba52/bitstream.c 2006-06-12 15:05:07.000000000 +0200 |
| 54 +++ liba52/bitstream.c 2006-06-05 02:23:02.000000000 +0200 | 54 +++ liba52/bitstream.c 2006-06-05 02:23:02.000000000 +0200 |
| 55 @@ -31,6 +35,10 @@ | 55 @@ -31,6 +35,10 @@ |
| 56 | 56 |
| 57 #define BUFFER_SIZE 4096 | 57 #define BUFFER_SIZE 4096 |
| 58 | 58 |
| 71 + indx=0; | 71 + indx=0; |
| 72 +#endif | 72 +#endif |
| 73 bitstream_get (state, align * 8); | 73 bitstream_get (state, align * 8); |
| 74 } | 74 } |
| 75 | 75 |
| 76 --- liba52-0.7.4/bitstream.h 2006-06-12 15:05:07.000000000 +0200 | 76 --- liba52/bitstream.h 2006-06-12 15:05:07.000000000 +0200 |
| 77 +++ liba52/bitstream.h 2006-06-05 02:23:02.000000000 +0200 | 77 +++ liba52/bitstream.h 2006-06-05 02:23:02.000000000 +0200 |
| 78 @@ -21,6 +25,48 @@ | 78 @@ -21,6 +25,48 @@ |
| 79 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 79 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 80 */ | 80 */ |
| 81 | 81 |
| 206 } | 206 } |
| 207 | 207 |
| 208 return a52_bitstream_get_bh_2 (state, num_bits); | 208 return a52_bitstream_get_bh_2 (state, num_bits); |
| 209 +#endif | 209 +#endif |
| 210 } | 210 } |
| 211 --- liba52-0.7.4/downmix.c 2006-06-12 15:17:53.000000000 +0200 | 211 --- liba52/downmix.c 2006-06-12 15:17:53.000000000 +0200 |
| 212 +++ liba52/downmix.c 2006-06-05 02:23:02.000000000 +0200 | 212 +++ liba52/downmix.c 2006-06-05 02:23:02.000000000 +0200 |
| 213 @@ -23,18 +23,47 @@ | 213 @@ -19,18 +23,47 @@ |
| 214 * You should have received a copy of the GNU General Public License | 214 * You should have received a copy of the GNU General Public License |
| 215 * along with this program; if not, write to the Free Software | 215 * along with this program; if not, write to the Free Software |
| 216 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 216 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 217 + * | 217 + * |
| 218 + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at) | 218 + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at) |
| 256 +} | 256 +} |
| 257 + | 257 + |
| 258 int a52_downmix_init (int input, int flags, sample_t * level, | 258 int a52_downmix_init (int input, int flags, sample_t * level, |
| 259 sample_t clev, sample_t slev) | 259 sample_t clev, sample_t slev) |
| 260 { | 260 { |
| 261 @@ -451,7 +480,7 @@ | 261 @@ -447,7 +480,7 @@ |
| 262 samples[i] = 0; | 262 samples[i] = 0; |
| 263 } | 263 } |
| 264 | 264 |
| 265 -void a52_downmix (sample_t * samples, int acmod, int output, sample_t bias, | 265 -void a52_downmix (sample_t * samples, int acmod, int output, sample_t bias, |
| 266 +void downmix_C (sample_t * samples, int acmod, int output, sample_t bias, | 266 +void downmix_C (sample_t * samples, int acmod, int output, sample_t bias, |
| 267 sample_t clev, sample_t slev) | 267 sample_t clev, sample_t slev) |
| 268 { | 268 { |
| 269 switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { | 269 switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { |
| 270 @@ -563,7 +592,7 @@ | 270 @@ -559,7 +592,7 @@ |
| 271 break; | 271 break; |
| 272 | 272 |
| 273 case CONVERT (A52_3F2R, A52_2F1R): | 273 case CONVERT (A52_3F2R, A52_2F1R): |
| 274 - mix3to2 (samples, bias); | 274 - mix3to2 (samples, bias); |
| 275 + mix3to2 (samples, bias); //FIXME possible bug? (output doesnt seem to be used) | 275 + mix3to2 (samples, bias); //FIXME possible bug? (output doesnt seem to be used) |
| 276 move2to1 (samples + 768, samples + 512, bias); | 276 move2to1 (samples + 768, samples + 512, bias); |
| 277 break; | 277 break; |
| 278 | 278 |
| 279 @@ -587,12 +616,12 @@ | 279 @@ -583,12 +616,12 @@ |
| 280 break; | 280 break; |
| 281 | 281 |
| 282 case CONVERT (A52_3F1R, A52_3F2R): | 282 case CONVERT (A52_3F1R, A52_3F2R): |
| 283 - memcpy (samples + 1027, samples + 768, 256 * sizeof (sample_t)); | 283 - memcpy (samples + 1027, samples + 768, 256 * sizeof (sample_t)); |
| 284 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); | 284 + memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t)); |
| 289 -void a52_upmix (sample_t * samples, int acmod, int output) | 289 -void a52_upmix (sample_t * samples, int acmod, int output) |
| 290 +void upmix_C (sample_t * samples, int acmod, int output) | 290 +void upmix_C (sample_t * samples, int acmod, int output) |
| 291 { | 291 { |
| 292 switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { | 292 switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) { |
| 293 | 293 |
| 294 @@ -657,3 +686,1137 @@ | 294 @@ -653,3 +686,1137 @@ |
| 295 goto mix_31to21; | 295 goto mix_31to21; |
| 296 } | 296 } |
| 297 } | 297 } |
| 298 + | 298 + |
| 299 +#if defined(ARCH_X86) || defined(ARCH_X86_64) | 299 +#if defined(ARCH_X86) || defined(ARCH_X86_64) |
| 1427 + } | 1427 + } |
| 1428 + __asm __volatile("femms":::"memory"); | 1428 + __asm __volatile("femms":::"memory"); |
| 1429 +} | 1429 +} |
| 1430 + | 1430 + |
| 1431 +#endif // ARCH_X86 || ARCH_X86_64 | 1431 +#endif // ARCH_X86 || ARCH_X86_64 |
| 1432 --- liba52-0.7.4/imdct.c 2006-06-12 15:18:27.000000000 +0200 | 1432 --- liba52/imdct.c 2006-06-12 15:18:27.000000000 +0200 |
| 1433 +++ liba52/imdct.c 2006-06-12 19:18:39.000000000 +0200 | 1433 +++ liba52/imdct.c 2006-06-12 19:18:39.000000000 +0200 |
| 1434 @@ -26,9 +26,15 @@ | 1434 @@ -22,9 +26,15 @@ |
| 1435 * You should have received a copy of the GNU General Public License | 1435 * You should have received a copy of the GNU General Public License |
| 1436 * along with this program; if not, write to the Free Software | 1436 * along with this program; if not, write to the Free Software |
| 1437 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 1437 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 1438 + * | 1438 + * |
| 1439 + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at) | 1439 + * SSE optimizations from Michael Niedermayer (michaelni@gmx.at) |
| 1445 #include "config.h" | 1445 #include "config.h" |
| 1446 +#include "asmalign.h" | 1446 +#include "asmalign.h" |
| 1447 | 1447 |
| 1448 #include <math.h> | 1448 #include <math.h> |
| 1449 #include <stdio.h> | 1449 #include <stdio.h> |
| 1450 @@ -43,12 +49,49 @@ | 1450 @@ -39,12 +49,49 @@ |
| 1451 #include "a52.h" | 1451 #include "a52.h" |
| 1452 #include "a52_internal.h" | 1452 #include "a52_internal.h" |
| 1453 #include "mm_accel.h" | 1453 #include "mm_accel.h" |
| 1454 +#include "mangle.h" | 1454 +#include "mangle.h" |
| 1455 + | 1455 + |
| 1495 + 0x0f, 0x4f, 0x2f, 0x6f, 0x1f, 0x5f, 0x3f, 0x7f}; | 1495 + 0x0f, 0x4f, 0x2f, 0x6f, 0x1f, 0x5f, 0x3f, 0x7f}; |
| 1496 + | 1496 + |
| 1497 static uint8_t fftorder[] = { | 1497 static uint8_t fftorder[] = { |
| 1498 0,128, 64,192, 32,160,224, 96, 16,144, 80,208,240,112, 48,176, | 1498 0,128, 64,192, 32,160,224, 96, 16,144, 80,208,240,112, 48,176, |
| 1499 8,136, 72,200, 40,168,232,104,248,120, 56,184, 24,152,216, 88, | 1499 8,136, 72,200, 40,168,232,104,248,120, 56,184, 24,152,216, 88, |
| 1500 @@ -60,6 +103,40 @@ | 1500 @@ -56,6 +103,40 @@ |
| 1501 6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86 | 1501 6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86 |
| 1502 }; | 1502 }; |
| 1503 | 1503 |
| 1504 +static complex_t __attribute__((aligned(16))) buf[128]; | 1504 +static complex_t __attribute__((aligned(16))) buf[128]; |
| 1505 + | 1505 + |
| 1536 +#endif | 1536 +#endif |
| 1537 + | 1537 + |
| 1538 /* Root values for IFFT */ | 1538 /* Root values for IFFT */ |
| 1539 static sample_t roots16[3]; | 1539 static sample_t roots16[3]; |
| 1540 static sample_t roots32[7]; | 1540 static sample_t roots32[7]; |
| 1541 @@ -245,7 +322,7 @@ | 1541 @@ -241,7 +322,7 @@ |
| 1542 ifft_pass (buf, roots128 - 32, 32); | 1542 ifft_pass (buf, roots128 - 32, 32); |
| 1543 } | 1543 } |
| 1544 | 1544 |
| 1545 -void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias) | 1545 -void a52_imdct_512 (sample_t * data, sample_t * delay, sample_t bias) |
| 1546 +void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias) | 1546 +void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias) |
| 1547 { | 1547 { |
| 1548 int i, k; | 1548 int i, k; |
| 1549 sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2; | 1549 sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2; |
| 1550 @@ -289,6 +366,714 @@ | 1550 @@ -285,6 +366,714 @@ |
| 1551 } | 1551 } |
| 1552 } | 1552 } |
| 1553 | 1553 |
| 1554 +#ifdef HAVE_ALTIVEC | 1554 +#ifdef HAVE_ALTIVEC |
| 1555 + | 1555 + |
| 2260 +#endif // ARCH_X86 || ARCH_X86_64 | 2260 +#endif // ARCH_X86 || ARCH_X86_64 |
| 2261 + | 2261 + |
| 2262 void a52_imdct_256(sample_t * data, sample_t * delay, sample_t bias) | 2262 void a52_imdct_256(sample_t * data, sample_t * delay, sample_t bias) |
| 2263 { | 2263 { |
| 2264 int i, k; | 2264 int i, k; |
| 2265 @@ -368,7 +1153,7 @@ | 2265 @@ -364,7 +1153,7 @@ |
| 2266 | 2266 |
| 2267 void a52_imdct_init (uint32_t mm_accel) | 2267 void a52_imdct_init (uint32_t mm_accel) |
| 2268 { | 2268 { |
| 2269 - int i, k; | 2269 - int i, k; |
| 2270 + int i, j, k; | 2270 + int i, j, k; |
| 2271 double sum; | 2271 double sum; |
| 2272 | 2272 |
| 2273 /* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */ | 2273 /* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */ |
| 2274 @@ -420,6 +1205,99 @@ | 2274 @@ -416,6 +1205,99 @@ |
| 2275 post2[i].real = cos ((M_PI / 128) * (i + 0.5)); | 2275 post2[i].real = cos ((M_PI / 128) * (i + 0.5)); |
| 2276 post2[i].imag = sin ((M_PI / 128) * (i + 0.5)); | 2276 post2[i].imag = sin ((M_PI / 128) * (i + 0.5)); |
| 2277 } | 2277 } |
| 2278 + for (i = 0; i < 128; i++) { | 2278 + for (i = 0; i < 128; i++) { |
| 2279 + xcos1[i] = -cos ((M_PI / 2048) * (8 * i + 1)); | 2279 + xcos1[i] = -cos ((M_PI / 2048) * (8 * i + 1)); |
| 2369 + else | 2369 + else |
| 2370 +#endif | 2370 +#endif |
| 2371 | 2371 |
| 2372 #ifdef LIBA52_DJBFFT | 2372 #ifdef LIBA52_DJBFFT |
| 2373 if (mm_accel & MM_ACCEL_DJBFFT) { | 2373 if (mm_accel & MM_ACCEL_DJBFFT) { |
| 2374 @@ -430,7 +1308,5 @@ | 2374 @@ -426,7 +1308,5 @@ |
| 2375 #endif | 2375 #endif |
| 2376 { | 2376 { |
| 2377 fprintf (stderr, "No accelerated IMDCT transform found\n"); | 2377 fprintf (stderr, "No accelerated IMDCT transform found\n"); |
| 2378 - ifft128 = ifft128_c; | 2378 - ifft128 = ifft128_c; |
| 2379 - ifft64 = ifft64_c; | 2379 - ifft64 = ifft64_c; |
| 2380 } | 2380 } |
| 2381 } | 2381 } |
| 2382 --- liba52-0.7.4/mm_accel.h 2006-06-12 15:05:00.000000000 +0200 | 2382 --- include/mm_accel.h 2006-06-12 15:05:00.000000000 +0200 |
| 2383 +++ liba52/mm_accel.h 2006-06-05 02:23:04.000000000 +0200 | 2383 +++ liba52/mm_accel.h 2006-06-05 02:23:04.000000000 +0200 |
| 2384 @@ -30,7 +34,12 @@ | 2384 @@ -30,7 +34,12 @@ |
| 2385 /* x86 accelerations */ | 2385 /* x86 accelerations */ |
| 2386 #define MM_ACCEL_X86_MMX 0x80000000 | 2386 #define MM_ACCEL_X86_MMX 0x80000000 |
| 2387 #define MM_ACCEL_X86_3DNOW 0x40000000 | 2387 #define MM_ACCEL_X86_3DNOW 0x40000000 |
| 2392 +/* PPC accelerations */ | 2392 +/* PPC accelerations */ |
| 2393 +#define MM_ACCEL_PPC_ALTIVEC 0x00010000 | 2393 +#define MM_ACCEL_PPC_ALTIVEC 0x00010000 |
| 2394 | 2394 |
| 2395 uint32_t mm_accel (void); | 2395 uint32_t mm_accel (void); |
| 2396 | 2396 |
| 2397 --- liba52-0.7.4/parse.c 2006-06-12 15:05:07.000000000 +0200 | 2397 --- liba52/parse.c 2006-06-12 15:05:07.000000000 +0200 |
| 2398 +++ liba52/parse.c 2006-06-12 14:51:33.000000000 +0200 | 2398 +++ liba52/parse.c 2006-06-12 14:51:33.000000000 +0200 |
| 2399 @@ -24,6 +28,7 @@ | 2399 @@ -24,6 +28,7 @@ |
| 2400 #include "config.h" | 2400 #include "config.h" |
| 2401 | 2401 |
| 2402 #include <stdlib.h> | 2402 #include <stdlib.h> |
