summaryrefslogtreecommitdiffstats
path: root/liba52
diff options
context:
space:
mode:
Diffstat (limited to 'liba52')
-rw-r--r--liba52/downmix.c56
-rw-r--r--liba52/imdct.c20
-rw-r--r--liba52/imdct_3dnow.h38
-rw-r--r--liba52/liba52_changes.diff122
-rw-r--r--liba52/resample_mmx.c22
-rw-r--r--liba52/srfftp_3dnow.h10
-rw-r--r--liba52/test.c2
7 files changed, 135 insertions, 135 deletions
diff --git a/liba52/downmix.c b/liba52/downmix.c
index 13220db719..ffb149b760 100644
--- a/liba52/downmix.c
+++ b/liba52/downmix.c
@@ -689,7 +689,7 @@ void upmix_C (sample_t * samples, int acmod, int output)
#if defined(ARCH_X86) || defined(ARCH_X86_64)
static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %2, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -712,7 +712,7 @@ static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
static void mix3to1_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -733,7 +733,7 @@ static void mix3to1_SSE (sample_t * samples, sample_t bias)
static void mix4to1_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -755,7 +755,7 @@ static void mix4to1_SSE (sample_t * samples, sample_t bias)
static void mix5to1_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -778,7 +778,7 @@ static void mix5to1_SSE (sample_t * samples, sample_t bias)
static void mix3to2_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -801,7 +801,7 @@ static void mix3to2_SSE (sample_t * samples, sample_t bias)
static void mix21to2_SSE (sample_t * left, sample_t * right, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %2, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -824,7 +824,7 @@ static void mix21to2_SSE (sample_t * left, sample_t * right, sample_t bias)
static void mix21toS_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -848,7 +848,7 @@ static void mix21toS_SSE (sample_t * samples, sample_t bias)
static void mix31to2_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -872,7 +872,7 @@ static void mix31to2_SSE (sample_t * samples, sample_t bias)
static void mix31toS_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -898,7 +898,7 @@ static void mix31toS_SSE (sample_t * samples, sample_t bias)
static void mix22toS_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -923,7 +923,7 @@ static void mix22toS_SSE (sample_t * samples, sample_t bias)
static void mix32to2_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -947,7 +947,7 @@ static void mix32to2_SSE (sample_t * samples, sample_t bias)
static void mix32toS_SSE (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %1, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -974,7 +974,7 @@ static void mix32toS_SSE (sample_t * samples, sample_t bias)
static void move2to1_SSE (sample_t * src, sample_t * dest, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movlps %2, %%xmm7 \n\t"
"shufps $0x00, %%xmm7, %%xmm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -997,7 +997,7 @@ static void move2to1_SSE (sample_t * src, sample_t * dest, sample_t bias)
static void zero_MMX(sample_t * samples)
{
- asm volatile(
+ __asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"pxor %%mm0, %%mm0 \n\t"
ASMALIGN(4)
@@ -1223,7 +1223,7 @@ static void upmix_MMX (sample_t * samples, int acmod, int output)
static void mix2to1_3dnow (sample_t * dest, sample_t * src, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %2, %%mm7 \n\t"
"punpckldq %2, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1254,7 +1254,7 @@ static void mix2to1_3dnow (sample_t * dest, sample_t * src, sample_t bias)
static void mix3to1_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1281,7 +1281,7 @@ static void mix3to1_3dnow (sample_t * samples, sample_t bias)
static void mix4to1_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1310,7 +1310,7 @@ static void mix4to1_3dnow (sample_t * samples, sample_t bias)
static void mix5to1_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1341,7 +1341,7 @@ static void mix5to1_3dnow (sample_t * samples, sample_t bias)
static void mix3to2_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1372,7 +1372,7 @@ static void mix3to2_3dnow (sample_t * samples, sample_t bias)
static void mix21to2_3dnow (sample_t * left, sample_t * right, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %2, %%mm7 \n\t"
"punpckldq %2, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1403,7 +1403,7 @@ static void mix21to2_3dnow (sample_t * left, sample_t * right, sample_t bias)
static void mix21toS_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1436,7 +1436,7 @@ static void mix21toS_3dnow (sample_t * samples, sample_t bias)
static void mix31to2_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1469,7 +1469,7 @@ static void mix31to2_3dnow (sample_t * samples, sample_t bias)
static void mix31toS_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1506,7 +1506,7 @@ static void mix31toS_3dnow (sample_t * samples, sample_t bias)
static void mix22toS_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1541,7 +1541,7 @@ static void mix22toS_3dnow (sample_t * samples, sample_t bias)
static void mix32to2_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %1, %%mm7 \n\t"
"punpckldq %1, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1575,7 +1575,7 @@ static void mix32to2_3dnow (sample_t * samples, sample_t bias)
/* todo: should be optimized better */
static void mix32toS_3dnow (sample_t * samples, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
ASMALIGN(4)
"1: \n\t"
@@ -1614,7 +1614,7 @@ static void mix32toS_3dnow (sample_t * samples, sample_t bias)
static void move2to1_3dnow (sample_t * src, sample_t * dest, sample_t bias)
{
- asm volatile(
+ __asm__ volatile(
"movd %2, %%mm7 \n\t"
"punpckldq %2, %%mm7 \n\t"
"mov $-1024, %%"REG_S" \n\t"
@@ -1782,7 +1782,7 @@ static void downmix_3dnow (sample_t * samples, int acmod, int output, sample_t b
memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
break;
}
- __asm __volatile("femms":::"memory");
+ __asm__ volatile("femms":::"memory");
}
#endif // ARCH_X86 || ARCH_X86_64
diff --git a/liba52/imdct.c b/liba52/imdct.c
index 49e695a066..325461c6fd 100644
--- a/liba52/imdct.c
+++ b/liba52/imdct.c
@@ -750,7 +750,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
/* Pre IFFT complex multiply plus IFFT cmplx conjugate */
/* Bit reversed shuffling */
- asm volatile(
+ __asm__ volatile(
"xor %%"REG_S", %%"REG_S" \n\t"
"lea "MANGLE(bit_reverse_512)", %%"REG_a"\n\t"
"mov $1008, %%"REG_D" \n\t"
@@ -810,7 +810,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
/* 1. iteration */
// Note w[0][0]={1,0}
- asm volatile(
+ __asm__ volatile(
"xorps %%xmm1, %%xmm1 \n\t"
"xorps %%xmm2, %%xmm2 \n\t"
"mov %0, %%"REG_S" \n\t"
@@ -832,7 +832,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
/* 2. iteration */
// Note w[1]={{1,0}, {0,-1}}
- asm volatile(
+ __asm__ volatile(
"movaps "MANGLE(ps111_1)", %%xmm7\n\t" // 1,1,1,-1
"mov %0, %%"REG_S" \n\t"
ASMALIGN(4)
@@ -860,7 +860,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
Note sseW2+32={0,0,-sqrt(2),-sqrt(2))
Note sseW2+48={1,-1,sqrt(2),-sqrt(2))
*/
- asm volatile(
+ __asm__ volatile(
"movaps 48+"MANGLE(sseW2)", %%xmm6\n\t"
"movaps 16+"MANGLE(sseW2)", %%xmm7\n\t"
"xorps %%xmm5, %%xmm5 \n\t"
@@ -905,7 +905,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
two_m_plus_one = two_m<<1;
two_m_plus_one_shl3 = (two_m_plus_one<<3);
buf_offset = buf+128;
- asm volatile(
+ __asm__ volatile(
"mov %0, %%"REG_S" \n\t"
ASMALIGN(4)
"1: \n\t"
@@ -937,7 +937,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
}
/* Post IFFT complex multiply plus IFFT complex conjugate*/
- asm volatile(
+ __asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
ASMALIGN(4)
"1: \n\t"
@@ -960,7 +960,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
window_ptr = a52_imdct_window;
/* Window and convert to real valued signal */
- asm volatile(
+ __asm__ volatile(
"xor %%"REG_D", %%"REG_D" \n\t" // 0
"xor %%"REG_S", %%"REG_S" \n\t" // 0
"movss %3, %%xmm2 \n\t" // bias
@@ -987,7 +987,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
delay_ptr+=128;
// window_ptr+=128;
- asm volatile(
+ __asm__ volatile(
"mov $1024, %%"REG_D" \n\t" // 512
"xor %%"REG_S", %%"REG_S" \n\t" // 0
"movss %3, %%xmm2 \n\t" // bias
@@ -1016,7 +1016,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
/* The trailing edge of the window goes into the delay line */
delay_ptr = delay;
- asm volatile(
+ __asm__ volatile(
"xor %%"REG_D", %%"REG_D" \n\t" // 0
"xor %%"REG_S", %%"REG_S" \n\t" // 0
ASMALIGN(4)
@@ -1038,7 +1038,7 @@ imdct_do_512_sse(sample_t data[],sample_t delay[], sample_t bias)
delay_ptr+=128;
// window_ptr-=128;
- asm volatile(
+ __asm__ volatile(
"mov $1024, %%"REG_D" \n\t" // 1024
"xor %%"REG_S", %%"REG_S" \n\t" // 0
ASMALIGN(4)
diff --git a/liba52/imdct_3dnow.h b/liba52/imdct_3dnow.h
index c53aeb08fd..2291158950 100644
--- a/liba52/imdct_3dnow.h
+++ b/liba52/imdct_3dnow.h
@@ -45,7 +45,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}
*/
- __asm__ __volatile__(
+ __asm__ volatile(
"movq 24(%1), %%mm3\n\t"
"movq 8(%1), %%mm1\n\t"
"pxor %2, %%mm3\n\t" /* mm3.re | -mm3.im */
@@ -90,7 +90,7 @@ static void FFT_8_3DNOW(complex_t *x)
*/
complex_t wT1, wB1, wB2;
- __asm__ __volatile__(
+ __asm__ volatile(
"movq 8(%2), %%mm0\n\t"
"movq 24(%2), %%mm1\n\t"
"movq %%mm0, %0\n\t" /* wT1 = x[1]; */
@@ -99,7 +99,7 @@ static void FFT_8_3DNOW(complex_t *x)
:"r"(x)
:"memory");
- __asm__ __volatile__(
+ __asm__ volatile(
"movq 16(%0), %%mm2\n\t"
"movq 32(%0), %%mm3\n\t"
"movq %%mm2, 8(%0)\n\t" /* x[1] = x[2]; */
@@ -114,7 +114,7 @@ static void FFT_8_3DNOW(complex_t *x)
/* x[0] x[4] x[2] x[6] */
- __asm__ __volatile__(
+ __asm__ volatile(
"movq 40(%1), %%mm0\n\t"
"movq %%mm0, %%mm3\n\t"
"movq 56(%1), %%mm1\n\t"
@@ -153,7 +153,7 @@ static void FFT_8_3DNOW(complex_t *x)
:"memory");
/* x[1] x[5] */
- __asm__ __volatile__ (
+ __asm__ volatile (
"movq %6, %%mm6\n\t"
"movq %5, %%mm7\n\t"
"movq %1, %%mm0\n\t"
@@ -203,7 +203,7 @@ static void FFT_8_3DNOW(complex_t *x)
/* x[3] x[7] */
- __asm__ __volatile__(
+ __asm__ volatile(
"movq %1, %%mm0\n\t"
#ifdef HAVE_3DNOWEX
"pswapd %3, %%mm1\n\t"
@@ -358,13 +358,13 @@ imdct_do_512_3dnow
/* Pre IFFT complex multiply plus IFFT cmplx conjugate & reordering*/
#if 1
- __asm__ __volatile__ (
+ __asm__ volatile (
"movq %0, %%mm7\n\t"
::"m"(x_plus_minus_3dnow)
:"memory");
for( i=0; i < 128; i++) {
int j = pm128[i];
- __asm__ __volatile__ (
+ __asm__ volatile (
"movd %1, %%mm0\n\t"
"movd %3, %%mm1\n\t"
"punpckldq %2, %%mm0\n\t" /* mm0 = data[256-2*j-1] | data[2*j]*/
@@ -394,7 +394,7 @@ imdct_do_512_3dnow
buf[i].im = (data[256-2*j-1] * xsin1[j] + data[2*j] * xcos1[j])*(-1.0);*/
}
#else
- __asm__ __volatile__ ("femms":::"memory");
+ __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]) ; */
int j= pm128[i];
@@ -431,18 +431,18 @@ imdct_do_512_3dnow
*/
FFT_128P_3DNOW (&buf[0]);
-// asm volatile ("femms \n\t":::"memory");
+// __asm__ volatile ("femms \n\t":::"memory");
/* Post IFFT complex multiply plus IFFT complex conjugate*/
#if 1
- __asm__ __volatile__ (
+ __asm__ volatile (
"movq %0, %%mm7\n\t"
"movq %1, %%mm6\n\t"
::"m"(x_plus_minus_3dnow),
"m"(x_minus_plus_3dnow)
:"eax","memory");
for (i=0; i < 128; i++) {
- __asm__ __volatile__ (
+ __asm__ volatile (
"movq %1, %%mm0\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
"movq %%mm0, %%mm1\n\t" /* ac3_buf[i].re | ac3_buf[i].im */
#ifndef HAVE_3DNOWEX
@@ -473,7 +473,7 @@ imdct_do_512_3dnow
ac3_buf[i].im =(tmp_a_r * ac3_xsin1[i]) - (tmp_a_i * ac3_xcos1[i]);*/
}
#else
- __asm__ __volatile__ ("femms":::"memory");
+ __asm__ volatile ("femms":::"memory");
for( i=0; i < 128; i++) {
/* y[n] = z[n] * (xcos1[n] + j * xsin1[n]) ; */
tmp_a_r = buf[i].real;
@@ -489,14 +489,14 @@ imdct_do_512_3dnow
/* Window and convert to real valued signal */
#if 1
- asm volatile (
+ __asm__ volatile (
"movd (%0), %%mm3 \n\t"
"punpckldq %%mm3, %%mm3 \n\t"
:: "r" (&bias)
);
for (i=0; i< 64; i++) {
/* merge two loops in one to enable working of 2 decoders */
- __asm__ __volatile__ (
+ __asm__ volatile (
"movd 516(%1), %%mm0\n\t"
"movd (%1), %%mm1\n\t" /**data_ptr++=-buf[64+i].im**window_ptr+++*delay_ptr++;*/
"punpckldq (%2), %%mm0\n\t"/*data_ptr[128]=-buf[i].re*window_ptr[128]+delay_ptr[128];*/
@@ -520,7 +520,7 @@ imdct_do_512_3dnow
}
window_ptr += 128;
#else
- __asm__ __volatile__ ("femms":::"memory");
+ __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;
@@ -538,7 +538,7 @@ imdct_do_512_3dnow
for(i=0; i< 64; i++) {
/* merge two loops in one to enable working of 2 decoders */
window_ptr -=2;
- __asm__ __volatile__(
+ __asm__ volatile(
"movd 508(%1), %%mm0\n\t"
"movd (%1), %%mm1\n\t"
"punpckldq (%2), %%mm0\n\t"
@@ -565,9 +565,9 @@ imdct_do_512_3dnow
:"memory");
delay_ptr += 2;
}
- __asm__ __volatile__ ("femms":::"memory");
+ __asm__ volatile ("femms":::"memory");
#else
- __asm__ __volatile__ ("femms":::"memory");
+ __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;
diff --git a/liba52/liba52_changes.diff b/liba52/liba52_changes.diff
index 542424ba83..e5008a77cc 100644
--- a/liba52/liba52_changes.diff
+++ b/liba52/liba52_changes.diff
@@ -1,6 +1,6 @@
--- include/a52.h 2006-06-12 15:04:57.000000000 +0200
+++ liba52/a52.h 2006-06-05 02:23:02.000000000 +0200
-@@ -59,4 +63,9 @@
+@@ -63,4 +63,9 @@
int a52_block (a52_state_t * state);
void a52_free (a52_state_t * state);
@@ -12,7 +12,7 @@
#endif /* A52_H */
--- liba52/a52_internal.h 2006-06-12 15:05:07.000000000 +0200
+++ liba52/a52_internal.h 2006-06-05 02:23:02.000000000 +0200
-@@ -103,18 +107,34 @@
+@@ -107,18 +107,34 @@
#define DELTA_BIT_NONE (2)
#define DELTA_BIT_RESERVED (3)
@@ -52,7 +52,7 @@
+void imdct_do_512 (sample_t * data, sample_t * delay, sample_t bias);
--- 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 @@
+@@ -35,6 +35,10 @@
#define BUFFER_SIZE 4096
@@ -63,7 +63,7 @@
void a52_bitstream_set_ptr (a52_state_t * state, uint8_t * buf)
{
int align;
-@@ -38,6 +46,9 @@
+@@ -42,6 +46,9 @@
align = (long)buf & 3;
state->buffer_start = (uint32_t *) (buf - align);
state->bits_left = 0;
@@ -75,7 +75,7 @@
--- 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 @@
+@@ -25,6 +25,42 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
@@ -118,7 +118,7 @@
/* (stolen from the kernel) */
#ifdef WORDS_BIGENDIAN
-@@ -28,7 +74,7 @@
+@@ -32,7 +74,7 @@
#else
@@ -127,7 +127,7 @@
# define swab32(x) __i386_swab32(x)
static inline const uint32_t __i386_swab32(uint32_t x)
-@@ -39,19 +85,34 @@
+@@ -43,19 +85,34 @@
# else
@@ -166,7 +166,7 @@
uint32_t result;
if (num_bits < state->bits_left) {
-@@ -61,10 +122,29 @@
+@@ -65,10 +122,29 @@
}
return a52_bitstream_get_bh (state, num_bits);
@@ -196,7 +196,7 @@
int32_t result;
if (num_bits < state->bits_left) {
-@@ -74,4 +154,5 @@
+@@ -78,4 +154,5 @@
}
return a52_bitstream_get_bh_2 (state, num_bits);
@@ -204,7 +204,7 @@
}
--- liba52/downmix.c 2006-06-12 15:17:53.000000000 +0200
+++ liba52/downmix.c 2006-06-05 02:23:02.000000000 +0200
-@@ -19,18 +23,46 @@
+@@ -23,18 +23,46 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -251,7 +251,7 @@
int a52_downmix_init (int input, int flags, sample_t * level,
sample_t clev, sample_t slev)
{
-@@ -447,7 +479,7 @@
+@@ -451,7 +479,7 @@
samples[i] = 0;
}
@@ -260,7 +260,7 @@
sample_t clev, sample_t slev)
{
switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
-@@ -559,7 +591,7 @@
+@@ -563,7 +591,7 @@
break;
case CONVERT (A52_3F2R, A52_2F1R):
@@ -269,7 +269,7 @@
move2to1 (samples + 768, samples + 512, bias);
break;
-@@ -583,12 +615,12 @@
+@@ -587,12 +615,12 @@
break;
case CONVERT (A52_3F1R, A52_3F2R):
@@ -284,7 +284,7 @@
{
switch (CONVERT (acmod, output & A52_CHANNEL_MASK)) {
-@@ -653,3 +685,1104 @@
+@@ -657,3 +685,1104 @@
goto mix_31to21;
}
}
@@ -292,7 +292,7 @@
+#if defined(ARCH_X86) || defined(ARCH_X86_64)
+static void mix2to1_SSE (sample_t * dest, sample_t * src, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %2, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -315,7 +315,7 @@
+
+static void mix3to1_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -336,7 +336,7 @@
+
+static void mix4to1_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -358,7 +358,7 @@
+
+static void mix5to1_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -381,7 +381,7 @@
+
+static void mix3to2_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -404,7 +404,7 @@
+
+static void mix21to2_SSE (sample_t * left, sample_t * right, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %2, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -427,7 +427,7 @@
+
+static void mix21toS_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -451,7 +451,7 @@
+
+static void mix31to2_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -475,7 +475,7 @@
+
+static void mix31toS_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -501,7 +501,7 @@
+
+static void mix22toS_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -526,7 +526,7 @@
+
+static void mix32to2_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -550,7 +550,7 @@
+
+static void mix32toS_SSE (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %1, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -577,7 +577,7 @@
+
+static void move2to1_SSE (sample_t * src, sample_t * dest, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movlps %2, %%xmm7 \n\t"
+ "shufps $0x00, %%xmm7, %%xmm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -600,7 +600,7 @@
+
+static void zero_MMX(sample_t * samples)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "mov $-1024, %%"REG_S" \n\t"
+ "pxor %%mm0, %%mm0 \n\t"
+ ASMALIGN(4)
@@ -826,7 +826,7 @@
+
+static void mix2to1_3dnow (sample_t * dest, sample_t * src, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %2, %%mm7 \n\t"
+ "punpckldq %2, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -857,7 +857,7 @@
+
+static void mix3to1_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -884,7 +884,7 @@
+
+static void mix4to1_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -913,7 +913,7 @@
+
+static void mix5to1_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -944,7 +944,7 @@
+
+static void mix3to2_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -975,7 +975,7 @@
+
+static void mix21to2_3dnow (sample_t * left, sample_t * right, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %2, %%mm7 \n\t"
+ "punpckldq %2, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -1006,7 +1006,7 @@
+
+static void mix21toS_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -1039,7 +1039,7 @@
+
+static void mix31to2_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -1072,7 +1072,7 @@
+
+static void mix31toS_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -1109,7 +1109,7 @@
+
+static void mix22toS_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -1144,7 +1144,7 @@
+
+static void mix32to2_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %1, %%mm7 \n\t"
+ "punpckldq %1, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -1178,7 +1178,7 @@
+/* todo: should be optimized better */
+static void mix32toS_3dnow (sample_t * samples, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "mov $-1024, %%"REG_S" \n\t"
+ ASMALIGN(4)
+ "1: \n\t"
@@ -1217,7 +1217,7 @@
+
+static void move2to1_3dnow (sample_t * src, sample_t * dest, sample_t bias)
+{
-+ asm volatile(
++ __asm__ volatile(
+ "movd %2, %%mm7 \n\t"
+ "punpckldq %2, %%mm7 \n\t"
+ "mov $-1024, %%"REG_S" \n\t"
@@ -1385,13 +1385,13 @@
+ memcpy (samples + 1024, samples + 768, 256 * sizeof (sample_t));
+ break;
+ }
-+ __asm __volatile("femms":::"memory");
++ __asm__ volatile("femms":::"memory");
+}
+
+#endif // ARCH_X86 || ARCH_X86_64
--- liba52/imdct.c 2008-02-19 00:18:33.000000000 +0100
+++ liba52/imdct.c 2008-02-19 00:16:40.000000000 +0100
-@@ -22,6 +26,11 @@
+@@ -26,6 +26,11 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
@@ -1403,7 +1403,7 @@
*/
#include "config.h"
-@@ -39,12 +48,49 @@
+@@ -43,12 +48,49 @@
#include "a52.h"
#include "a52_internal.h"
#include "mm_accel.h"
@@ -1453,7 +1453,7 @@
static uint8_t fftorder[] = {
0,128, 64,192, 32,160,224, 96, 16,144, 80,208,240,112, 48,176,
8,136, 72,200, 40,168,232,104,248,120, 56,184, 24,152,216, 88,
-@@ -56,6 +102,40 @@
+@@ -60,6 +102,40 @@
6,134, 70,198, 38,166,230,102,246,118, 54,182, 22,150,214, 86
};
@@ -1494,7 +1494,7 @@
/* Root values for IFFT */
static sample_t roots16[3];
static sample_t roots32[7];
-@@ -241,7 +321,7 @@
+@@ -245,7 +321,7 @@
ifft_pass (buf, roots128 - 32, 32);
}
@@ -1503,7 +1503,7 @@
{
int i, k;
sample_t t_r, t_i, a_r, a_i, b_r, b_i, w_1, w_2;
-@@ -285,6 +365,701 @@
+@@ -289,6 +365,701 @@
}
}
@@ -1892,7 +1892,7 @@
+
+ /* Pre IFFT complex multiply plus IFFT cmplx conjugate */
+ /* Bit reversed shuffling */
-+ asm volatile(
++ __asm__ volatile(
+ "xor %%"REG_S", %%"REG_S" \n\t"
+ "lea "MANGLE(bit_reverse_512)", %%"REG_a"\n\t"
+ "mov $1008, %%"REG_D" \n\t"
@@ -1952,7 +1952,7 @@
+
+ /* 1. iteration */
+ // Note w[0][0]={1,0}
-+ asm volatile(
++ __asm__ volatile(
+ "xorps %%xmm1, %%xmm1 \n\t"
+ "xorps %%xmm2, %%xmm2 \n\t"
+ "mov %0, %%"REG_S" \n\t"
@@ -1974,7 +1974,7 @@
+
+ /* 2. iteration */
+ // Note w[1]={{1,0}, {0,-1}}
-+ asm volatile(
++ __asm__ volatile(
+ "movaps "MANGLE(ps111_1)", %%xmm7\n\t" // 1,1,1,-1
+ "mov %0, %%"REG_S" \n\t"
+ ASMALIGN(4)
@@ -2002,7 +2002,7 @@
+ Note sseW2+32={0,0,-sqrt(2),-sqrt(2))
+ Note sseW2+48={1,-1,sqrt(2),-sqrt(2))
+*/
-+ asm volatile(
++ __asm__ volatile(
+ "movaps 48+"MANGLE(sseW2)", %%xmm6\n\t"
+ "movaps 16+"MANGLE(sseW2)", %%xmm7\n\t"
+ "xorps %%xmm5, %%xmm5 \n\t"
@@ -2047,7 +2047,7 @@
+ two_m_plus_one = two_m<<1;
+ two_m_plus_one_shl3 = (two_m_plus_one<<3);
+ buf_offset = buf+128;
-+ asm volatile(
++ __asm__ volatile(
+ "mov %0, %%"REG_S" \n\t"
+ ASMALIGN(4)
+ "1: \n\t"
@@ -2079,7 +2079,7 @@
+ }
+
+ /* Post IFFT complex multiply plus IFFT complex conjugate*/
-+ asm volatile(
++ __asm__ volatile(
+ "mov $-1024, %%"REG_S" \n\t"
+ ASMALIGN(4)
+ "1: \n\t"
@@ -2102,7 +2102,7 @@
+ window_ptr = a52_imdct_window;
+
+ /* Window and convert to real valued signal */
-+ asm volatile(
++ __asm__ volatile(
+ "xor %%"REG_D", %%"REG_D" \n\t" // 0
+ "xor %%"REG_S", %%"REG_S" \n\t" // 0
+ "movss %3, %%xmm2 \n\t" // bias
@@ -2129,7 +2129,7 @@
+ delay_ptr+=128;
+// window_ptr+=128;
+
-+ asm volatile(
++ __asm__ volatile(
+ "mov $1024, %%"REG_D" \n\t" // 512
+ "xor %%"REG_S", %%"REG_S" \n\t" // 0
+ "movss %3, %%xmm2 \n\t" // bias
@@ -2158,7 +2158,7 @@
+ /* The trailing edge of the window goes into the delay line */
+ delay_ptr = delay;
+
-+ asm volatile(
++ __asm__ volatile(
+ "xor %%"REG_D", %%"REG_D" \n\t" // 0
+ "xor %%"REG_S", %%"REG_S" \n\t" // 0
+ ASMALIGN(4)
@@ -2180,7 +2180,7 @@
+ delay_ptr+=128;
+// window_ptr-=128;
+
-+ asm volatile(
++ __asm__ volatile(
+ "mov $1024, %%"REG_D" \n\t" // 1024
+ "xor %%"REG_S", %%"REG_S" \n\t" // 0
+ ASMALIGN(4)
@@ -2205,7 +2205,7 @@
void a52_imdct_256(sample_t * data, sample_t * delay, sample_t bias)
{
int i, k;
-@@ -364,7 +1145,7 @@
+@@ -368,7 +1145,7 @@
void a52_imdct_init (uint32_t mm_accel)
{
@@ -2214,7 +2214,7 @@
double sum;
/* compute imdct window - kaiser-bessel derived window, alpha = 5.0 */
-@@ -416,6 +1197,99 @@
+@@ -420,6 +1197,99 @@
post2[i].real = cos ((M_PI / 128) * (i + 0.5));
post2[i].imag = sin ((M_PI / 128) * (i + 0.5));
}
@@ -2314,7 +2314,7 @@
#ifdef LIBA52_DJBFFT
if (mm_accel & MM_ACCEL_DJBFFT) {
-@@ -426,7 +1300,5 @@
+@@ -430,7 +1300,5 @@
#endif
{
fprintf (stderr, "No accelerated IMDCT transform found\n");
@@ -2324,7 +2324,7 @@
}
--- include/mm_accel.h 2006-06-12 15:05:00.000000000 +0200
+++ liba52/mm_accel.h 2006-06-05 02:23:04.000000000 +0200
-@@ -30,7 +34,12 @@
+@@ -34,7 +34,12 @@
/* x86 accelerations */
#define MM_ACCEL_X86_MMX 0x80000000
#define MM_ACCEL_X86_3DNOW 0x40000000
diff --git a/liba52/resample_mmx.c b/liba52/resample_mmx.c
index a08a7a8b0c..9a37fd4ad3 100644
--- a/liba52/resample_mmx.c
+++ b/liba52/resample_mmx.c
@@ -38,7 +38,7 @@ static uint64_t attribute_used __attribute__((aligned(8))) wm1100= 0xFFFFFFFF000
static int a52_resample_MONO_to_5_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
- asm volatile(
+ __asm__ volatile(
"mov $-512, %%"REG_S" \n\t"
"movq "MANGLE(magicF2W)", %%mm7 \n\t"
"movq "MANGLE(wm1100)", %%mm3 \n\t"
@@ -77,7 +77,7 @@ static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){
int32_t * f = (int32_t *) _f;
/* benchmark scores are 0.3% better with SSE but we would need to set bias=0 and premultiply it
#ifdef HAVE_SSE
- asm volatile(
+ __asm__ volatile(
"mov $-1024, %%"REG_S" \n\t"
"1: \n\t"
"cvtps2pi (%1, %%"REG_S"), %%mm0\n\t"
@@ -93,7 +93,7 @@ static int a52_resample_STEREO_to_2_MMX(float * _f, int16_t * s16){
<