comparison liba52/liba52_changes.diff @ 21491:212cf6625a47

update local diff after r20779
author gpoirier
date Tue, 05 Dec 2006 07:14:05 +0000
parents 87dddfc314fd
children 49a433e2e78f
comparison
equal deleted inserted replaced
21490:033d3244e4fd 21491:212cf6625a47
2387 +/* PPC accelerations */ 2387 +/* PPC accelerations */
2388 +#define MM_ACCEL_PPC_ALTIVEC 0x00010000 2388 +#define MM_ACCEL_PPC_ALTIVEC 0x00010000
2389 2389
2390 uint32_t mm_accel (void); 2390 uint32_t mm_accel (void);
2391 2391
2392 --- liba52/parse.c 2006-06-12 15:05:07.000000000 +0200 2392 --- liba52/parse.c 2006-12-05 08:08:01.000000000 +0100
2393 +++ liba52/parse.c 2006-06-12 14:51:33.000000000 +0200 2393 +++ liba52/parse.c 2006-12-05 08:08:44.000000000 +0100
2394 @@ -24,6 +28,7 @@ 2394 @@ -28,6 +28,7 @@
2395 #include "config.h" 2395 #include "config.h"
2396 2396
2397 #include <stdlib.h> 2397 #include <stdlib.h>
2398 +#include <stdio.h> 2398 +#include <stdio.h>
2399 #include <string.h> 2399 #include <string.h>
2400 #include <inttypes.h> 2400 #include <inttypes.h>
2401 2401
2402 @@ -31,13 +36,11 @@ 2402 @@ -35,13 +36,12 @@
2403 #include "a52_internal.h" 2403 #include "a52_internal.h"
2404 #include "bitstream.h" 2404 #include "bitstream.h"
2405 #include "tables.h" 2405 #include "tables.h"
2406 +#include "mm_accel.h" 2406 +#include "mm_accel.h"
2407 +#include "libavutil/avutil.h"
2407 2408
2408 #ifdef HAVE_MEMALIGN 2409 #ifdef HAVE_MEMALIGN
2409 /* some systems have memalign() but no declaration for it */ 2410 /* some systems have memalign() but no declaration for it */
2410 void * memalign (size_t align, size_t size); 2411 void * memalign (size_t align, size_t size);
2411 -#else 2412 -#else
2412 -/* assume malloc alignment is sufficient */ 2413 -/* assume malloc alignment is sufficient */
2413 -#define memalign(align,size) malloc (size) 2414 -#define memalign(align,size) malloc (size)
2414 #endif 2415 #endif
2415 2416
2416 typedef struct { 2417 typedef struct {
2417 @@ -61,6 +64,21 @@ 2418 @@ -64,7 +64,16 @@
2419 if (state == NULL)
2418 return NULL; 2420 return NULL;
2419 2421
2422 +#if defined(__MINGW32__) && defined(HAVE_SSE)
2423 + state->samples = av_malloc(256 * 12 * sizeof (sample_t));
2424 +#else
2420 state->samples = memalign (16, 256 * 12 * sizeof (sample_t)); 2425 state->samples = memalign (16, 256 * 12 * sizeof (sample_t));
2421 +#if defined(__MINGW32__) && defined(HAVE_SSE)
2422 + for(i=0;i<10;i++){
2423 + if((int)state->samples%16){
2424 + sample_t* samplestmp=malloc(256 * 12 * sizeof (sample_t));
2425 + free(state->samples);
2426 + state->samples = samplestmp;
2427 + }
2428 + else break;
2429 + }
2430 +#endif 2426 +#endif
2431 + if(((int)state->samples%16) && (mm_accel&MM_ACCEL_X86_SSE)){ 2427 + if(((int)state->samples%16) && (mm_accel&MM_ACCEL_X86_SSE)){
2432 + mm_accel &=~MM_ACCEL_X86_SSE; 2428 + mm_accel &=~MM_ACCEL_X86_SSE;
2433 + fprintf(stderr, "liba52: unable to get 16 byte aligned memory disabling usage of SSE instructions\n"); 2429 + fprintf(stderr, "liba52: unable to get 16 byte aligned memory disabling usage of SSE instructions\n");
2434 + } 2430 + }
2435 + 2431 +
2436 if (state->samples == NULL) { 2432 if (state->samples == NULL) {
2437 free (state); 2433 free (state);
2438 return NULL; 2434 return NULL;
2439 @@ -74,6 +92,7 @@ 2435 @@ -78,6 +87,7 @@
2440 state->lfsr_state = 1; 2436 state->lfsr_state = 1;
2441 2437
2442 a52_imdct_init (mm_accel); 2438 a52_imdct_init (mm_accel);
2443 + downmix_accel_init(mm_accel); 2439 + downmix_accel_init(mm_accel);
2444 2440
2445 return state; 2441 return state;
2446 } 2442 }
2447 @@ -141,7 +160,7 @@ 2443 @@ -145,7 +155,7 @@
2448 state->acmod = acmod = buf[6] >> 5; 2444 state->acmod = acmod = buf[6] >> 5;
2449 2445
2450 a52_bitstream_set_ptr (state, buf + 6); 2446 a52_bitstream_set_ptr (state, buf + 6);
2451 - bitstream_get (state, 3); /* skip acmod we already parsed */ 2447 - bitstream_get (state, 3); /* skip acmod we already parsed */
2452 + bitstream_skip (state, 3); /* skip acmod we already parsed */ 2448 + bitstream_skip (state, 3); /* skip acmod we already parsed */
2453 2449
2454 if ((acmod == 2) && (bitstream_get (state, 2) == 2)) /* dsurmod */ 2450 if ((acmod == 2) && (bitstream_get (state, 2) == 2)) /* dsurmod */
2455 acmod = A52_DOLBY; 2451 acmod = A52_DOLBY;
2456 @@ -172,28 +191,28 @@ 2452 @@ -176,28 +186,28 @@
2457 2453
2458 chaninfo = !acmod; 2454 chaninfo = !acmod;
2459 do { 2455 do {
2460 - bitstream_get (state, 5); /* dialnorm */ 2456 - bitstream_get (state, 5); /* dialnorm */
2461 + bitstream_skip (state, 5); /* dialnorm */ 2457 + bitstream_skip (state, 5); /* dialnorm */
2488 - bitstream_get (state, 8); /* addbsi */ 2484 - bitstream_get (state, 8); /* addbsi */
2489 + bitstream_skip (state, 8); /* addbsi */ 2485 + bitstream_skip (state, 8); /* addbsi */
2490 } while (addbsil--); 2486 } while (addbsil--);
2491 } 2487 }
2492 2488
2493 @@ -680,7 +699,7 @@ 2489 @@ -684,7 +694,7 @@
2494 state->fbw_expbap[i].exp[0], 2490 state->fbw_expbap[i].exp[0],
2495 state->fbw_expbap[i].exp + 1)) 2491 state->fbw_expbap[i].exp + 1))
2496 return 1; 2492 return 1;
2497 - bitstream_get (state, 2); /* gainrng */ 2493 - bitstream_get (state, 2); /* gainrng */
2498 + bitstream_skip (state, 2); /* gainrng */ 2494 + bitstream_skip (state, 2); /* gainrng */
2499 } 2495 }
2500 if (lfeexpstr != EXP_REUSE) { 2496 if (lfeexpstr != EXP_REUSE) {
2501 do_bit_alloc |= 32; 2497 do_bit_alloc |= 32;
2502 @@ -755,7 +774,7 @@ 2498 @@ -759,7 +769,7 @@
2503 if (bitstream_get (state, 1)) { /* skiple */ 2499 if (bitstream_get (state, 1)) { /* skiple */
2504 i = bitstream_get (state, 9); /* skipl */ 2500 i = bitstream_get (state, 9); /* skipl */
2505 while (i--) 2501 while (i--)
2506 - bitstream_get (state, 8); 2502 - bitstream_get (state, 8);
2507 + bitstream_skip (state, 8); 2503 + bitstream_skip (state, 8);
2508 } 2504 }
2509 2505
2510 samples = state->samples; 2506 samples = state->samples;
2507 @@ -900,6 +910,10 @@
2508
2509 void a52_free (a52_state_t * state)
2510 {
2511 - free (state->samples);
2512 +#if defined(__MINGW32__) && defined(HAVE_SSE)
2513 + av_free (state->samples);
2514 +#else
2515 + free (state->samples);
2516 +#endif
2517 free (state);
2518 }