[FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces

This commit is contained in:
Victor Perevertkin 2021-06-11 15:29:21 +03:00
parent 4b4ffa92f5
commit 34593d933b
No known key found for this signature in database
GPG key ID: C750B7222E9C7830
952 changed files with 12942 additions and 12942 deletions

View file

@ -14,7 +14,7 @@
*
*
* TODO: write an optimized version for the down-sampling modes
* (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero
* (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero
*/
#include "mpg123lib_intern.h"
@ -33,7 +33,7 @@ void dct64(real *out0,real *out1,real *samples)
b2 = b1 + 32;
for(i=15;i>=0;i--)
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
for(i=15;i>=0;i--)
*bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
@ -43,13 +43,13 @@ void dct64(real *out0,real *out1,real *samples)
{
for(i=7;i>=0;i--)
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
for(i=7;i>=0;i--)
*bs++ = REAL_MUL((*--b2 - *b1++), *--costab);
b2 += 32;
costab += 8;
for(i=7;i>=0;i--)
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
for(i=7;i>=0;i--)
*bs++ = REAL_MUL((*b1++ - *--b2), *--costab);
b2 += 32;
@ -62,12 +62,12 @@ void dct64(real *out0,real *out1,real *samples)
for(j=2;j;j--)
{
for(i=3;i>=0;i--)
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
for(i=3;i>=0;i--)
*bs++ = REAL_MUL((*--b2 - *b1++), costab[i]);
b2 += 16;
for(i=3;i>=0;i--)
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
for(i=3;i>=0;i--)
*bs++ = REAL_MUL((*b1++ - *--b2), costab[i]);
b2 += 16;
@ -79,12 +79,12 @@ void dct64(real *out0,real *out1,real *samples)
for(j=4;j;j--)
{
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
*bs++ = REAL_MUL((*--b2 - *b1++), costab[1]);
*bs++ = REAL_MUL((*--b2 - *b1++), costab[0]);
b2 += 8;
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
*bs++ = (*b1++ + *--b2);
*bs++ = REAL_MUL((*b1++ - *--b2), costab[1]);
*bs++ = REAL_MUL((*b1++ - *--b2), costab[0]);

View file

@ -15,7 +15,7 @@
*
*
* TODO: write an optimized version for the down-sampling modes
* (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero
* (in these modes the bands 16-31 (2:1) or 8-31 (4:1) are zero
*/
#include "mpg123lib_intern.h"
@ -30,7 +30,7 @@ void dct64_altivec(real *out0,real *out1,real *samples)
{
register real *b1,*costab;
vector unsigned char vinvert,vperm1,vperm2,vperm3,vperm4;
vector float v1,v2,v3,v4,v5,v6,v7,v8;
vector float vbs1,vbs2,vbs3,vbs4,vbs5,vbs6,vbs7,vbs8;
@ -38,7 +38,7 @@ void dct64_altivec(real *out0,real *out1,real *samples)
vector float vzero;
b1 = samples;
costab = pnts[0];
vzero = vec_xor(vzero,vzero);
#ifdef __APPLE__
vinvert = (vector unsigned char)(12,13,14,15,8,9,10,11,4,5,6,7,0,1,2,3);
@ -47,40 +47,40 @@ void dct64_altivec(real *out0,real *out1,real *samples)
#endif
vperm1 = vec_lvsl(0,b1);
vperm2 = vec_perm(vperm1,vperm1,vinvert);
v1 = vec_ld(0,b1);
v2 = vec_ld(16,b1);
v3 = vec_ld(112,b1);
v4 = vec_ld(127,b1);
v5 = vec_perm(v1,v2,vperm1); /* b1[0,1,2,3] */
v6 = vec_perm(v3,v4,vperm2); /* b1[31,30,29,28] */
vbs1 = vec_add(v5,v6);
vbs8 = vec_sub(v5,v6);
v1 = vec_ld(32,b1);
v4 = vec_ld(96,b1);
v5 = vec_perm(v2,v1,vperm1); /* b1[4,5,6,7] */
v6 = vec_perm(v4,v3,vperm2); /* b1[27,26,25,24] */
vbs2 = vec_add(v5,v6);
vbs7 = vec_sub(v5,v6);
v2 = vec_ld(48,b1);
v3 = vec_ld(80,b1);
v5 = vec_perm(v1,v2,vperm1); /* b1[8,9,10,11] */
v6 = vec_perm(v3,v4,vperm2); /* b1[23,22,21,20] */
vbs3 = vec_add(v5,v6);
vbs6 = vec_sub(v5,v6);
v1 = vec_ld(64,b1);
v5 = vec_perm(v2,v1,vperm1); /* b1[12,13,14,15] */
v6 = vec_perm(v1,v3,vperm2); /* b1[19,18,17,16] */
vbs4 = vec_add(v5,v6);
vbs5 = vec_sub(v5,v6);
v1 = vec_ld(0,costab);
vbs8 = vec_madd(vbs8,v1,vzero);
v2 = vec_ld(16,costab);
@ -91,10 +91,10 @@ void dct64_altivec(real *out0,real *out1,real *samples)
vbs5 = vec_madd(vbs5,v4,vzero);
vbs6 = vec_perm(vbs6,vbs6,vinvert);
vbs5 = vec_perm(vbs5,vbs5,vinvert);
costab = pnts[1];
v1 = vec_perm(vbs4,vbs4,vinvert);
vbs9 = vec_add(vbs1,v1);
v3 = vec_sub(vbs1,v1);
@ -105,17 +105,17 @@ void dct64_altivec(real *out0,real *out1,real *samples)
v6 = vec_ld(16,costab);
vbs12 = vec_madd(v3,v5,vzero);
vbs11 = vec_madd(v4,v6,vzero);
v7 = vec_sub(vbs7,vbs6);
v8 = vec_sub(vbs8,vbs5);
vbs13 = vec_add(vbs5,vbs8);
vbs14 = vec_add(vbs6,vbs7);
vbs15 = vec_madd(v7,v6,vzero);
vbs16 = vec_madd(v8,v5,vzero);
costab = pnts[2];
v1 = vec_perm(vbs10,vbs10,vinvert);
v5 = vec_perm(vbs14,vbs14,vinvert);
vbs1 = vec_add(v1,vbs9);
@ -133,15 +133,15 @@ void dct64_altivec(real *out0,real *out1,real *samples)
vbs4 = vec_madd(v4,v3,vzero);
vbs6 = vec_madd(v6,v3,vzero);
vbs8 = vec_madd(v7,v3,vzero);
vbs2 = vec_perm(vbs2,vbs2,vinvert);
vbs4 = vec_perm(vbs4,vbs4,vinvert);
vbs6 = vec_perm(vbs6,vbs6,vinvert);
vbs8 = vec_perm(vbs8,vbs8,vinvert);
costab = pnts[3];
#ifdef __APPLE__
vperm1 = (vector unsigned char)(0,1,2,3,4,5,6,7,16,17,18,19,20,21,22,23);
vperm2 = (vector unsigned char)(12,13,14,15,8,9,10,11,28,29,30,31,24,25,26,27);
@ -152,12 +152,12 @@ void dct64_altivec(real *out0,real *out1,real *samples)
vperm3 = (vector unsigned char){0,1,2,3,4,5,6,7,20,21,22,23,16,17,18,19};
#endif
vperm4 = vec_add(vperm3,vec_splat_u8(8));
v1 = vec_ld(0,costab);
v2 = vec_splat(v1,0);
v3 = vec_splat(v1,1);
v1 = vec_mergeh(v2,v3);
v2 = vec_perm(vbs1,vbs3,vperm1);
v3 = vec_perm(vbs2,vbs4,vperm1);
v4 = vec_perm(vbs1,vbs3,vperm2);
@ -172,7 +172,7 @@ void dct64_altivec(real *out0,real *out1,real *samples)
vbs11 = vec_perm(v2,v4,vperm4);
vbs10 = vec_perm(v3,v5,vperm3);
vbs12 = vec_perm(v3,v5,vperm4);
v2 = vec_perm(vbs5,vbs7,vperm1);
v3 = vec_perm(vbs6,vbs8,vperm1);
v4 = vec_perm(vbs5,vbs7,vperm2);
@ -187,10 +187,10 @@ void dct64_altivec(real *out0,real *out1,real *samples)
vbs15 = vec_perm(v2,v4,vperm4);
vbs14 = vec_perm(v3,v5,vperm3);
vbs16 = vec_perm(v3,v5,vperm4);
costab = pnts[4];
v1 = vec_lde(0,costab);
#ifdef __APPLE__
v2 = (vector float)(1.0f,-1.0f,1.0f,-1.0f);
@ -199,7 +199,7 @@ void dct64_altivec(real *out0,real *out1,real *samples)
#endif
v3 = vec_splat(v1,0);
v1 = vec_madd(v2,v3,vzero);
v2 = vec_mergeh(vbs9,vbs10);
v3 = vec_mergel(vbs9,vbs10);
v4 = vec_mergeh(vbs11,vbs12);
@ -207,7 +207,7 @@ void dct64_altivec(real *out0,real *out1,real *samples)
v6 = vec_mergeh(v2,v3);
v7 = vec_mergel(v2,v3);
v2 = vec_mergeh(v4,v5);
v3 = vec_mergel(v4,v5);
v3 = vec_mergel(v4,v5);
v4 = vec_sub(v6,v7);
v5 = vec_sub(v2,v3);
v6 = vec_add(v6,v7);
@ -218,7 +218,7 @@ void dct64_altivec(real *out0,real *out1,real *samples)
vbs2 = vec_mergel(v6,v2);
vbs3 = vec_mergeh(v7,v3);
vbs4 = vec_mergel(v7,v3);
v2 = vec_mergeh(vbs13,vbs14);
v3 = vec_mergel(vbs13,vbs14);
v4 = vec_mergeh(vbs15,vbs16);
@ -226,7 +226,7 @@ void dct64_altivec(real *out0,real *out1,real *samples)
v6 = vec_mergeh(v2,v3);
v7 = vec_mergel(v2,v3);
v2 = vec_mergeh(v4,v5);
v3 = vec_mergel(v4,v5);
v3 = vec_mergel(v4,v5);
v4 = vec_sub(v6,v7);
v5 = vec_sub(v2,v3);
v6 = vec_add(v6,v7);
@ -237,7 +237,7 @@ void dct64_altivec(real *out0,real *out1,real *samples)
vbs6 = vec_mergel(v6,v2);
vbs7 = vec_mergeh(v7,v3);
vbs8 = vec_mergel(v7,v3);
vec_st(vbs1,0,bufs);
vec_st(vbs2,16,bufs);
vec_st(vbs3,32,bufs);

View file

@ -8,7 +8,7 @@
/*
* Discrete Cosine Tansform (DCT) for subband synthesis
* optimized for machines with no auto-increment.
* optimized for machines with no auto-increment.
* The performance is highly compiler dependend. Maybe
* the dct64.c version for 'normal' processor may be faster
* even for Intel processors.
@ -67,23 +67,23 @@ static void dct64_1(real *out0,real *out1,real *b1,real *b2,real *samples)
{
register real *costab = pnts[1];
b2[0x00] = b1[0x00] + b1[0x0F];
b2[0x01] = b1[0x01] + b1[0x0E];
b2[0x00] = b1[0x00] + b1[0x0F];
b2[0x01] = b1[0x01] + b1[0x0E];
b2[0x0F] = REAL_MUL(b1[0x00] - b1[0x0F], costab[0]);
b2[0x0E] = REAL_MUL(b1[0x01] - b1[0x0E], costab[1]);
b2[0x02] = b1[0x02] + b1[0x0D];
b2[0x03] = b1[0x03] + b1[0x0C];
b2[0x02] = b1[0x02] + b1[0x0D];
b2[0x03] = b1[0x03] + b1[0x0C];
b2[0x0D] = REAL_MUL(b1[0x02] - b1[0x0D], costab[2]);
b2[0x0C] = REAL_MUL(b1[0x03] - b1[0x0C], costab[3]);
b2[0x04] = b1[0x04] + b1[0x0B];
b2[0x05] = b1[0x05] + b1[0x0A];
b2[0x04] = b1[0x04] + b1[0x0B];
b2[0x05] = b1[0x05] + b1[0x0A];
b2[0x0B] = REAL_MUL(b1[0x04] - b1[0x0B], costab[4]);
b2[0x0A] = REAL_MUL(b1[0x05] - b1[0x0A], costab[5]);
b2[0x06] = b1[0x06] + b1[0x09];
b2[0x07] = b1[0x07] + b1[0x08];
b2[0x06] = b1[0x06] + b1[0x09];
b2[0x07] = b1[0x07] + b1[0x08];
b2[0x09] = REAL_MUL(b1[0x06] - b1[0x09], costab[6]);
b2[0x08] = REAL_MUL(b1[0x07] - b1[0x08], costab[7]);
@ -168,7 +168,7 @@ static void dct64_1(real *out0,real *out1,real *b1,real *b2,real *samples)
b2[0x0B] = REAL_MUL(b1[0x08] - b1[0x0B], cos0);
b2[0x09] = b1[0x09] + b1[0x0A];
b2[0x0A] = REAL_MUL(b1[0x09] - b1[0x0A], cos1);
b2[0x0C] = b1[0x0C] + b1[0x0F];
b2[0x0F] = REAL_MUL(b1[0x0F] - b1[0x0C], cos0);
b2[0x0D] = b1[0x0D] + b1[0x0E];
@ -296,7 +296,7 @@ static void dct64_1(real *out0,real *out1,real *b1,real *b2,real *samples)
out1[0x10*14] = REAL_SCALE_DCT64(b1[0x0F]);
#endif
{
{
real tmp;
tmp = b1[0x18] + b1[0x1C];
out0[0x10*15] = REAL_SCALE_DCT64(tmp + b1[0x10]);
@ -312,7 +312,7 @@ static void dct64_1(real *out0,real *out1,real *b1,real *b2,real *samples)
out0[0x10* 1] = REAL_SCALE_DCT64(tmp + b1[0x11]);
tmp = b1[0x19] + b1[0x1D];
out1[0x10* 1] = REAL_SCALE_DCT64(tmp + b1[0x11]);
out1[0x10* 3] = REAL_SCALE_DCT64(tmp + b1[0x15]);
out1[0x10* 3] = REAL_SCALE_DCT64(tmp + b1[0x15]);
tmp = b1[0x1D] + b1[0x1B];
out1[0x10* 5] = REAL_SCALE_DCT64(tmp + b1[0x15]);
out1[0x10* 7] = REAL_SCALE_DCT64(tmp + b1[0x13]);

View file

@ -14,7 +14,7 @@
* Note: This code does not give the necessary accuracy. Moreover, no
* overflow test are done.
*
* (c) 1998 Fabrice Bellard.
* (c) 1998 Fabrice Bellard.
*/
#include "mpg123lib_intern.h"
@ -49,7 +49,7 @@
#define COS_2_3 83981
#define COS_3_0 17733
#define COS_3_1 42813
#define COS_4_0 23170
#define COS_4_0 23170
#define SETOUT(out,n,expr) out[FIR_BUFFER_SIZE*(n)]=(expr)
#define MULL(a,b) (((long long)(a)*(long long)(b)) >> 15)
@ -115,21 +115,21 @@ void dct64_1_486(int *out0,int *out1,int *b1,int *b2)
b1[0x10] = MULL((b2[0x0F] - b2[0x10]),COS_0_15);
b2[0x00] = b1[0x00] + b1[0x0F];
b2[0x00] = b1[0x00] + b1[0x0F];
b2[0x0F] = MUL((b1[0x00] - b1[0x0F]),COS_1_0);
b2[0x01] = b1[0x01] + b1[0x0E];
b2[0x01] = b1[0x01] + b1[0x0E];
b2[0x0E] = MUL((b1[0x01] - b1[0x0E]),COS_1_1);
b2[0x02] = b1[0x02] + b1[0x0D];
b2[0x02] = b1[0x02] + b1[0x0D];
b2[0x0D] = MUL((b1[0x02] - b1[0x0D]),COS_1_2);
b2[0x03] = b1[0x03] + b1[0x0C];
b2[0x03] = b1[0x03] + b1[0x0C];
b2[0x0C] = MUL((b1[0x03] - b1[0x0C]),COS_1_3);
b2[0x04] = b1[0x04] + b1[0x0B];
b2[0x04] = b1[0x04] + b1[0x0B];
b2[0x0B] = MUL((b1[0x04] - b1[0x0B]),COS_1_4);
b2[0x05] = b1[0x05] + b1[0x0A];
b2[0x05] = b1[0x05] + b1[0x0A];
b2[0x0A] = MUL((b1[0x05] - b1[0x0A]),COS_1_5);
b2[0x06] = b1[0x06] + b1[0x09];
b2[0x06] = b1[0x06] + b1[0x09];
b2[0x09] = MUL((b1[0x06] - b1[0x09]),COS_1_6);
b2[0x07] = b1[0x07] + b1[0x08];
b2[0x07] = b1[0x07] + b1[0x08];
b2[0x08] = MULL((b1[0x07] - b1[0x08]),COS_1_7);
b2[0x10] = b1[0x10] + b1[0x1F];
@ -201,7 +201,7 @@ void dct64_1_486(int *out0,int *out1,int *b1,int *b2)
b2[0x0B] = MUL((b1[0x08] - b1[0x0B]),COS_3_0);
b2[0x09] = b1[0x09] + b1[0x0A];
b2[0x0A] = MUL((b1[0x09] - b1[0x0A]),COS_3_1);
b2[0x0C] = b1[0x0C] + b1[0x0F];
b2[0x0F] = MUL((b1[0x0F] - b1[0x0C]),COS_3_0);
b2[0x0D] = b1[0x0D] + b1[0x0E];
@ -322,21 +322,21 @@ void dct64_i486(int *a,int *b,real *samples)
int bufs[64];
int i;
#ifdef REAL_IS_FIXED
#ifdef REAL_IS_FIXED
#define TOINT(a) ((a) * 32768 / (int)REAL_FACTOR)
for(i=0;i<32;i++) {
bufs[i]=TOINT(samples[i]);
}
#else
#else
int *p = bufs;
register double const scale = ((65536.0 * 32) + 1) * 65536.0;
for(i=0;i<32;i++) {
*((double *) (p++)) = scale + *samples++; /* beware on bufs overrun: 8B store from x87 */
}
#endif
dct64_1_486(a,b,bufs+32,bufs);
}

View file

@ -9,7 +9,7 @@
#include "mpg123lib_intern.h"
void do_equalizer(real *bandPtr,int channel, real equalizer[2][32])
void do_equalizer(real *bandPtr,int channel, real equalizer[2][32])
{
int i;
for(i=0;i<32;i++)

View file

@ -32,7 +32,7 @@
/* static int chans[NUM_CHANNELS] = { 1 , 2 }; */
static const long my_rates[MPG123_RATES] = /* only the standard rates */
{
8000, 11025, 12000,
8000, 11025, 12000,
16000, 22050, 24000,
32000, 44100, 48000,
};
@ -270,7 +270,7 @@ int frame_output_format(mpg123_handle *fr)
if(enc_chan_fit(p, p->force_rate, &nf, f0, f2, try_float))
goto end;
// Keep the order consistent if float is considered fallback only.
if(!try_float &&
if(!try_float &&
enc_chan_fit(p, p->force_rate, &nf, f0, f2, TRUE))
goto end;
@ -503,7 +503,7 @@ int attribute_align_arg mpg123_fmt2(mpg123_pars *mp, long rate, int channels, in
r1 = 0;
r2 = MPG123_RATES+1; /* including forced rate */
}
if(r1 < 0) return MPG123_BAD_RATE;
/* now match the encodings */

View file

@ -61,7 +61,7 @@ static void frame_default_pars(mpg123_pars *mp)
mpg123_fmt_all(mp);
/* Default of keeping some 4K buffers at hand, should cover the "usual" use case (using 16K pipe buffers as role model). */
#ifndef NO_FEEDER
mp->feedpool = 5;
mp->feedpool = 5;
mp->feedbuffer = 4096;
#endif
mp->freeformat_framesize = -1;
@ -350,7 +350,7 @@ int frame_buffers(mpg123_handle *fr)
}
#endif
#endif
#if defined(OPT_ALTIVEC) || defined(OPT_ARM)
#if defined(OPT_ALTIVEC) || defined(OPT_ARM)
/* sizeof(real) >= 4 ... yes, it could be 8, for example.
We got it intialized to at least (512+32)*sizeof(real).*/
decwin_size += 512*sizeof(real);
@ -526,7 +526,7 @@ static void frame_fixed_reset(mpg123_handle *fr)
fr->abr_rate = 0;
fr->track_frames = 0;
fr->track_samples = -1;
fr->framesize=0;
fr->framesize=0;
fr->mean_frames = 0;
fr->mean_framesize = 0;
fr->freesize = 0;
@ -699,7 +699,7 @@ static off_t frame_fuzzy_find(mpg123_handle *fr, off_t want_frame, off_t* get_fr
then step to just before wanted one with read_frame
do not care tabout the stuff that was in buffer but not played back
everything that left the decoder is counted as played
Decide if you want low latency reaction and accurate timing info or stable long-time playback with buffer!
*/
@ -749,7 +749,7 @@ off_t frame_index_find(mpg123_handle *fr, off_t want_frame, off_t* get_frame)
}
off_t frame_ins2outs(mpg123_handle *fr, off_t ins)
{
{
off_t outs = 0;
switch(fr->down_sample)
{

View file

@ -45,19 +45,19 @@
prepend/append combination. When deciding upon where an unembedded
tag should be located, the following order of preference SHOULD be
considered.
1. Prepend the tag.
2. Prepend a tag with all vital information and add a second tag at
2. Prepend a tag with all vital information and add a second tag at
the end of the file, before tags from other tagging systems. The
first tag is required to have a SEEK frame.
3. Add a tag at the end of the file, before tags from other tagging
systems.
In case 2 and 3 the tag can simply be appended if no other known tags
are present. The suggested method to find ID3v2 tags are:
1. Look for a prepended tag using the pattern found in section 3.1.
2. If a SEEK frame was found, use its values to guide further

View file

@ -85,7 +85,7 @@ void fi_add(struct frame_index *fi, off_t pos)
{ /* Index is full, we need to shrink... or grow. */
/* Store the current frame number to check later if we still want it. */
off_t framenum = fi->fill*fi->step;
/* If we want not / cannot grow, we shrink. */
/* If we want not / cannot grow, we shrink. */
if( !(fi->grow_size && fi_resize(fi, fi->size+fi->grow_size)==0) )
fi_shrink(fi);

View file

@ -5,7 +5,7 @@
see COPYING and AUTHORS files in distribution or http://mpg123.org
initially written by Michael Hipp
may have a few bugs after last optimization ...
may have a few bugs after last optimization ...
*/
#include "mpg123lib_intern.h"
@ -15,7 +15,7 @@
/*
Allocation value is not allowed to be 15. Initially, libmad showed me the
error that mpg123 used to ignore. Then, I found a quote on that in
Shlien, S. (1994): Guide to MPEG-1 Audio Standard.
Shlien, S. (1994): Guide to MPEG-1 Audio Standard.
IEEE Transactions on Broadcasting 40, 4
"To avoid conflicts with the synchronization code, code '1111' is defined
@ -138,7 +138,7 @@ static int I_step_two(real fraction[2][SBLIMIT],unsigned int balloc[2*SBLIMIT],
if((n=*ba++))
needbits += n+1;
}
for(i=jsbound;i<SBLIMIT;i++)
for(i=jsbound;i<SBLIMIT;i++)
if((n = *ba++))
needbits += n+1;
NEED_BITS(fr, needbits)
@ -150,7 +150,7 @@ static int I_step_two(real fraction[2][SBLIMIT],unsigned int balloc[2*SBLIMIT],
if((n = *ba++)) *sample++ = getbits(fr, n+1);
}
for(i=jsbound;i<SBLIMIT;i++)
for(i=jsbound;i<SBLIMIT;i++)
if((n = *ba++))
*sample++ = getbits(fr, n+1);

View file

@ -94,7 +94,7 @@ real* init_layer12_table(mpg123_handle *fr, real *table, int m)
real* init_layer12_table_mmx(mpg123_handle *fr, real *table, int m)
{
int i,j;
if(!fr->p.down_sample)
if(!fr->p.down_sample)
{
for(j=3,i=0;i<63;i++,j--)
*table++ = DOUBLE_TO_REAL(16384 * mulmul[m] * pow(2.0,(double) j / 3.0));
@ -201,17 +201,17 @@ static int II_step_one(unsigned int *bit_alloc,int *scale,mpg123_handle *fr)
if(*bita++)
switch(*scfsi++)
{
case 0:
case 0:
*scale++ = getbits_fast(fr, 6);
*scale++ = getbits_fast(fr, 6);
*scale++ = getbits_fast(fr, 6);
break;
case 1 :
case 1 :
*scale++ = sc = getbits_fast(fr, 6);
*scale++ = sc;
*scale++ = getbits_fast(fr, 6);
break;
case 2:
case 2:
*scale++ = sc = getbits_fast(fr, 6);
*scale++ = sc;
*scale++ = sc;
@ -242,17 +242,17 @@ static void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int
step = alloc1->bits;
for(j=0;j<stereo;j++)
{
if( (ba=*bita++) )
if( (ba=*bita++) )
{
k=(alloc2 = alloc1+ba)->bits;
if( (d1=alloc2->d) < 0)
if( (d1=alloc2->d) < 0)
{
real cm=fr->muls[k][scale[x1]];
fraction[j][0][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
fraction[j][1][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
fraction[j][2][i] = REAL_MUL_SCALE_LAYER12(DOUBLE_TO_REAL_15((int)getbits(fr, k) + d1), cm);
}
else
}
else
{
const int *table[] = { 0,0,0,grp_3tab,0,grp_5tab,0,0,0,grp_9tab };
unsigned int idx,*tab,m=scale[x1];
@ -260,7 +260,7 @@ static void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int
tab = (unsigned int *) (table[d1] + idx + idx + idx);
fraction[j][0][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]);
fraction[j][1][i] = REAL_SCALE_LAYER12(fr->muls[*tab++][m]);
fraction[j][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m]);
fraction[j][2][i] = REAL_SCALE_LAYER12(fr->muls[*tab][m]);
}
scale+=3;
}
@ -317,10 +317,10 @@ static void II_step_two(unsigned int *bit_alloc,real fraction[2][4][SBLIMIT],int
Historic comment...
should we use individual scalefac for channel 2 or
is the current way the right one , where we just copy channel 1 to
channel 2 ??
channel 2 ??
The current 'strange' thing is, that we throw away the scalefac
values for the second channel ...!!
-> changed .. now we use the scalefac values of channel one !!
-> changed .. now we use the scalefac values of channel one !!
*/
}
@ -407,7 +407,7 @@ int do_layer2(mpg123_handle *fr)
error("missing bits in layer II step two");
return clip;
}
for(j=0;j<3;j++)
for(j=0;j<3;j++)
{
if(single != SINGLE_STEREO)
clip += (fr->synth_mono)(fraction[single][j], fr);

View file

@ -462,7 +462,7 @@ static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si,int ster
if (stereo == 1)
si->private_bits = getbits(fr, tab[2]);
else
else
si->private_bits = getbits(fr, tab[3]);
if(!fr->lsf) for(ch=0; ch<stereo; ch++)
@ -529,7 +529,7 @@ static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si,int ster
return 1;
}
/* region_count/start parameters are implicit in this case. */
/* region_count/start parameters are implicit in this case. */
if( (!fr->lsf || (gr_info->block_type == 2)) && !fr->mpeg25)
{
gr_info->region1start = 36>>1;
@ -538,7 +538,7 @@ static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si,int ster
else
{
if(fr->mpeg25)
{
{
int r0c,r1c;
if((gr_info->block_type == 2) && (!gr_info->mixed_block_flag) ) r0c = 5;
else r0c = 7;
@ -546,13 +546,13 @@ static int III_get_side_info(mpg123_handle *fr, struct III_sideinfo *si,int ster
/* r0c+1+r1c+1 == 22, always. */
r1c = 20 - r0c;
gr_info->region1start = bandInfo[sfreq].longIdx[r0c+1] >> 1 ;
gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1;
gr_info->region2start = bandInfo[sfreq].longIdx[r0c+1+r1c+1] >> 1;
}
else
{
gr_info->region1start = 54>>1;
gr_info->region2start = 576>>1;
}
gr_info->region2start = 576>>1;
}
}
}
else
@ -653,7 +653,7 @@ static int III_get_scale_factors_1(mpg123_handle *fr, int *scf,struct gr_info_s
{
for (i=0;i<6;i++) *scf++ = getbits_fast(fr, num0);
}
else scf += 6;
else scf += 6;
if(!(scfsi & 0x4))
{
@ -701,7 +701,7 @@ static int III_get_scale_factors_2(mpg123_handle *fr, int *scf,struct gr_info_s
{ 6, 9, 9,9 } , { 6, 9,12,6 } , { 15,18,0,0},
{ 6,15,12,0 } , { 6,12, 9,6 } , { 6,18,9,0}
}
};
};
if(i_stereo) /* i_stereo AND second channel -> do_layer3() checks this */
slen = i_slen2[gr_info->scalefac_compress>>1];
@ -710,7 +710,7 @@ static int III_get_scale_factors_2(mpg123_handle *fr, int *scf,struct gr_info_s
gr_info->preflag = (slen>>15) & 0x1;
n = 0;
n = 0;
if( gr_info->block_type == 2 )
{
n++;
@ -823,7 +823,7 @@ static int III_dequantize_sample(mpg123_handle *fr, real xr[SBLIMIT][SSLIMIT],in
int bv = gr_info->big_values;
int region1 = gr_info->region1start;
int region2 = gr_info->region2start;
l3 = ((576>>1)-bv)>>1;
l3 = ((576>>1)-bv)>>1;
/* we may lose the 'odd' bit here !! check this later again */
if(bv <= region1)
@ -1287,7 +1287,7 @@ static int III_dequantize_sample(mpg123_handle *fr, real xr[SBLIMIT][SSLIMIT],in
gr_info->maxb = 1;
}
while(xrpnt < &xr[SBLIMIT][0])
while(xrpnt < &xr[SBLIMIT][0])
*xrpnt++ = DOUBLE_TO_REAL(0.0);
while( part2remain > 16 )
@ -1318,7 +1318,7 @@ static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac, struct
int tab;
/* TODO: optimize as static */
const real *tabs[3][2][2] =
{
{
{ { tan1_1,tan2_1 } , { tan1_2,tan2_2 } },
{ { pow1_1[0],pow2_1[0] } , { pow1_2[0],pow2_2[0] } },
{ { pow1_1[1],pow2_1[1] } , { pow1_2[1],pow2_2[1] } }
@ -1370,7 +1370,7 @@ static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac, struct
for(;sfb<12;sfb++)
{
is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */
is_p = scalefac[sfb*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */
if(is_p != 7)
{
real t1,t2;
@ -1387,7 +1387,7 @@ static void III_i_stereo(real xr_buf[2][SBLIMIT][SSLIMIT],int *scalefac, struct
}
#if 1
/* in the original: copy 10 to 11 , here: copy 11 to 12
/* in the original: copy 10 to 11 , here: copy 11 to 12
maybe still wrong??? (copy 12 to 13?) */
is_p = scalefac[11*3+lwin-gr_info->mixed_block_flag]; /* scale: 0-15 */
sb = bi->shortDiff[12];
@ -1402,7 +1402,7 @@ maybe still wrong??? (copy 12 to 13?) */
real t1,t2;
t1 = tab1[is_p]; t2 = tab2[is_p];
for( ; sb > 0; sb--,idx+=3 )
{
{
real v = xr[0][idx];
xr[0][idx] = REAL_MUL_15(v, t1);
xr[1][idx] = REAL_MUL_15(v, t2);
@ -1435,8 +1435,8 @@ maybe still wrong??? (copy 12 to 13?) */
}
else idx += sb;
}
}
}
}
}
else
{ /* ((gr_info->block_type != 2)) */
int sfb = gr_info->maxbandl;
@ -1466,7 +1466,7 @@ maybe still wrong??? (copy 12 to 13?) */
if(is_p != 7)
{ /* copy l-band 20 to l-band 21 */
int sb;
real t1 = tab1[is_p],t2 = tab2[is_p];
real t1 = tab1[is_p],t2 = tab2[is_p];
for( sb = bi->longDiff[21]; sb > 0; sb--,idx++ )
{
@ -1487,7 +1487,7 @@ static void III_antialias(real xr[SBLIMIT][SSLIMIT],struct gr_info_s *gr_info)
{
if(!gr_info->mixed_block_flag) return;
sblim = 1;
sblim = 1;
}
else sblim = gr_info->maxb-1;
@ -1514,7 +1514,7 @@ static void III_antialias(real xr[SBLIMIT][SSLIMIT],struct gr_info_s *gr_info)
}
}
/*
/*
This is an optimized DCT from Jeff Tsay's maplay 1.2+ package.
Saved one multiplication by doing the 'twiddle factor' stuff
together with the window mul. (MH)
@ -1777,7 +1777,7 @@ void dct36(real *inbuf,real *o1,real *o2,real *wintab,real *tsbuf)
tb33 = REAL_MUL(in[2*3+1], c[3]);
tb66 = REAL_MUL(in[2*6+1], c[6]);
{
{
real tmp1a,tmp2a,tmp1b,tmp2b;
tmp1a = REAL_MUL(in[2*1+0], c[1]) + ta33 + REAL_MUL(in[2*5+0], c[5]) + REAL_MUL(in[2*7+0], c[7]);
tmp1b = REAL_MUL(in[2*1+1], c[1]) + tb33 + REAL_MUL(in[2*5+1], c[5]) + REAL_MUL(in[2*7+1], c[7]);
@ -1872,7 +1872,7 @@ static void dct12(real *in,real *rawout1,real *rawout2,register real *wi,registe
register real *out1 = rawout1;
ts[SBLIMIT*0] = out1[0]; ts[SBLIMIT*1] = out1[1]; ts[SBLIMIT*2] = out1[2];
ts[SBLIMIT*3] = out1[3]; ts[SBLIMIT*4] = out1[4]; ts[SBLIMIT*5] = out1[5];
DCT12_PART1
{
@ -1906,7 +1906,7 @@ static void dct12(real *in,real *rawout1,real *rawout2,register real *wi,registe
{
real in0,in1,in2,in3,in4,in5;
register real *out2 = rawout2;
DCT12_PART1
{
@ -1935,7 +1935,7 @@ static void dct12(real *in,real *rawout1,real *rawout2,register real *wi,registe
ts[(17-2)*SBLIMIT] += REAL_MUL(in4, wi[5-2]);
}
in++;
in++;
{
real in0,in1,in2,in3,in4,in5;
@ -1989,7 +1989,7 @@ static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT], real tsOut[SSLIMIT][SBLIMIT]
rawout2=block[b][ch];
blc[ch] = b;
}
if(gr_info->mixed_block_flag)
{
sb = 2;
@ -1997,7 +1997,7 @@ static void III_hybrid(real fsIn[SBLIMIT][SSLIMIT], real tsOut[SSLIMIT][SBLIMIT]
opt_dct36(fr)(fsIn[1],rawout1+18,rawout2+18,win1[0],tspnt+1);
rawout1 += 36; rawout2 += 36; tspnt += 2;
}
bt = gr_info->block_type;
if(bt == 2)
{
@ -2059,7 +2059,7 @@ static void fill_pinfo_side(mpg123_handle *fr, struct III_sideinfo *si, int gr,
{
int j = 3 * sb + i;
/*
is_p = scalefac[sfb*3+lwin-gr_infos->mixed_block_flag];
is_p = scalefac[sfb*3+lwin-gr_infos->mixed_block_flag];
*/
/* scalefac was copied into pinfo->sfb_s[] before */
fr->pinfo->sfb_s[gr][ch][j] = -ifqstep *
@ -2200,7 +2200,7 @@ int do_layer3(mpg123_handle *fr)
{
struct gr_info_s *gr_info = &(sideinfo.ch[1].gr[gr]);
long part2bits;
if(fr->lsf)
if(fr->lsf)
part2bits = III_get_scale_factors_2(fr, scalefacs[1],gr_info,i_stereo);
else
part2bits = III_get_scale_factors_1(fr, scalefacs[1],gr_info,1,gr);
@ -2254,7 +2254,7 @@ int do_layer3(mpg123_handle *fr)
if(ms_stereo || i_stereo || (single == SINGLE_MIX) )
{
if(gr_info->maxb > sideinfo.ch[0].gr[gr].maxb)
if(gr_info->maxb > sideinfo.ch[0].gr[gr].maxb)
sideinfo.ch[0].gr[gr].maxb = gr_info->maxb;
else
gr_info->maxb = sideinfo.ch[0].gr[gr].maxb;
@ -2267,7 +2267,7 @@ int do_layer3(mpg123_handle *fr)
register int i;
register real *in0 = (real *) hybridIn[0],*in1 = (real *) hybridIn[1];
for(i=0;i<SSLIMIT*(int)gr_info->maxb;i++,in0++)
*in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */
*in0 = (*in0 + *in1++); /* *0.5 done by pow-scale */
}
break;
case SINGLE_RIGHT:
@ -2325,6 +2325,6 @@ int do_layer3(mpg123_handle *fr)
}
#endif
}
return clip;
}

View file

@ -16,7 +16,7 @@
Depending on use case, the aliases map to 32 (small) or 64 bit (large) offset
functions, to the ones from libmpg123 or the ones from lfs_wrap.
So, two basic cases:
1. mpg123_bla_32 alias for mpg123_bla (native)
2. mpg123_bla alias for mpg123_bla_32 (wrapper)

View file

@ -40,7 +40,7 @@ if(/^\s*MPG123_EXPORT\s+(\S+)\s+(mpg123_\S+)\((.*)\);\s*$/)
$name = $2;
$args = $3;
next unless ($type =~ /off_t/ or $args =~ /off_t/);
print "$name\n" unless grep {$_ eq $name}
print "$name\n" unless grep {$_ eq $name}
("mpg123_open", "mpg123_open_fd", "mpg123_open_handle", "mpg123_replace_reader", "mpg123_replace_reader_handle");
}' < mpg123.h.in

View file

@ -258,7 +258,7 @@ int attribute_align_arg mpg123_par(mpg123_pars *mp, enum mpg123_parms key, long
break;
case MPG123_FREEFORMAT_SIZE:
mp->freeformat_framesize = val;
break;
break;
default:
ret = MPG123_BAD_PARAM;
}
@ -290,7 +290,7 @@ int attribute_align_arg mpg123_getpar(mpg123_pars *mp, enum mpg123_parms key, lo
if(val) *val = mp->flags;
break;
case MPG123_FORCE_RATE:
if(val)
if(val)
#ifdef NO_NTOM
*val = 0;
#else
@ -350,7 +350,7 @@ int attribute_align_arg mpg123_getpar(mpg123_pars *mp, enum mpg123_parms key, lo
break;
case MPG123_FREEFORMAT_SIZE:
*val = mp->freeformat_framesize;
break;
break;
default:
ret = MPG123_BAD_PARAM;
}

View file

@ -68,7 +68,7 @@ void ntom_set_ntom(mpg123_handle *fr, off_t num)
fr->ntom_val[1] = fr->ntom_val[0] = ntom_val(fr, num);
}
/* Carry out the ntom sample count operation for this one frame.
/* Carry out the ntom sample count operation for this one frame.
No fear of integer overflow here. */
off_t ntom_frame_outsamples(mpg123_handle *fr)
{

View file

@ -190,7 +190,7 @@ static int check_lame_tag(mpg123_handle *fr)
/* we have one of these headers... */
if(VERBOSE2) fprintf(stderr, "Note: Xing/Lame/Info header detected\n");
lame_offset += 4;
lame_offset += 4;
xing_flags = bit_read_long(fr->bsbuf, &lame_offset);
debug1("Xing: flags 0x%08lx", xing_flags);
@ -231,7 +231,7 @@ static int check_lame_tag(mpg123_handle *fr)
{
/* The Xing bitstream length, at least as interpreted by the Lame
encoder, encompasses all data from the Xing header frame on,
ignoring leading ID3v2 data. Trailing tags (ID3v1) seem to be
ignoring leading ID3v2 data. Trailing tags (ID3v1) seem to be
included, though. */
if(fr->rdat.filelen < 1)
fr->rdat.filelen = (off_t) long_tmp + fr->audio_start; /* Overflow? */
@ -274,7 +274,7 @@ static int check_lame_tag(mpg123_handle *fr)
10: lowpass
11-18: ReplayGain
19: encoder flags
20: ABR
20: ABR
21-23: encoder delays
*/
check_bytes_left(24); /* I'm interested in 24 B of extra info. */
@ -315,7 +315,7 @@ static int check_lame_tag(mpg123_handle *fr)
else if(VERBOSE3) fprintf(stderr
, "Note: Info: Cannot determine LAME version.\n");
}
lame_offset += 9; /* 9 in */
lame_offset += 9; /* 9 in */
/* The 4 big bits are tag revision, the small bits vbr method. */
lame_vbr = fr->bsbuf[lame_offset] & 15;
@ -377,7 +377,7 @@ static int check_lame_tag(mpg123_handle *fr)
/* Apply gain offset for automatic origin. */
if(origin == 3) replay_gain[gt] += gain_offset;
}
if(VERBOSE3)
if(VERBOSE3)
{
fprintf(stderr, "Note: Info: Radio Gain = %03.1fdB\n"
, replay_gain[0]);
@ -404,7 +404,7 @@ static int check_lame_tag(mpg123_handle *fr)
, fr->abr_rate);
}
lame_offset += 1; /* 21 in */
/* Encoder delay and padding, two 12 bit values
... lame does write them from int. */
pad_in = ( (((int) fr->bsbuf[lame_offset]) << 4)
@ -460,7 +460,7 @@ static void halfspeed_prepare(mpg123_handle *fr)
static int halfspeed_do(mpg123_handle *fr)
{
/* Speed-down hack: Play it again, Sam (the frame, I mean). */
if (fr->p.halfspeed)
if (fr->p.halfspeed)
{
if(fr->halfphase) /* repeat last frame */
{
@ -480,9 +480,9 @@ static int halfspeed_do(mpg123_handle *fr)
return 0;
}
/*
/*
Temporary macro until we got this worked out.
Idea is to filter out special return values that shall trigger direct jumps to end / resync / read again.
Idea is to filter out special return values that shall trigger direct jumps to end / resync / read again.
Particularily, the generic ret==PARSE_BAD==0 and ret==PARSE_GOOD==1 are not affected.
*/
#define JUMP_CONCLUSION(ret) \
@ -637,7 +637,7 @@ init_resync:
fr->mean_framesize = ((fr->mean_frames-1)*fr->mean_framesize+compute_bpf(fr)) / fr->mean_frames ;
}
++fr->num; /* 0 for first frame! */
debug4("Frame %"OFF_P" %08lx %i, next filepos=%"OFF_P,
debug4("Frame %"OFF_P" %08lx %i, next filepos=%"OFF_P,
(off_p)fr->num, newhead, fr->framesize, (off_p)fr->rd->tell(fr));
if(!(fr->state_flags & FRAME_FRANKENSTEIN) && (
(fr->track_frames > 0 && fr->num >= fr->track_frames)
@ -647,9 +647,9 @@ init_resync:
))
{
fr->state_flags |= FRAME_FRANKENSTEIN;
if(NOQUIET) fprintf(stderr, "\nWarning: Encountered more data after announced end of track (frame %"OFF_P"/%"OFF_P"). Frankenstein!\n", (off_p)fr->num,
if(NOQUIET) fprintf(stderr, "\nWarning: Encountered more data after announced end of track (frame %"OFF_P"/%"OFF_P"). Frankenstein!\n", (off_p)fr->num,
#ifdef GAPLESS
fr->gapless_frames > 0 ? (off_p)fr->gapless_frames :
fr->gapless_frames > 0 ? (off_p)fr->gapless_frames :
#endif
(off_p)fr->track_frames);
}
@ -914,9 +914,9 @@ static int decode_header(mpg123_handle *fr,unsigned long newhead, int *freeforma
return PARSE_BAD;
}
break;
#endif
#endif
default:
if(NOQUIET) error1("Layer type %i not supported in this build!", fr->lay);
if(NOQUIET) error1("Layer type %i not supported in this build!", fr->lay);
return PARSE_BAD;
}
@ -935,7 +935,7 @@ static int decode_header(mpg123_handle *fr,unsigned long newhead, int *freeforma
This overwrites side info needed for stage 0.
Continuing to read bits after layer 3 side info shall fail unless
set_pointer() is called to refresh things.
set_pointer() is called to refresh things.
*/
void set_pointer(mpg123_handle *fr, int part2, long backstep)
{
@ -1053,10 +1053,10 @@ int attribute_align_arg mpg123_position(mpg123_handle *fr, off_t no, off_t buffs
int get_songlen(mpg123_handle *fr,int no)
{
double tpf;
if(!fr)
return 0;
if(no < 0) {
if(!fr->rd || fr->rdat.filelen < 0)
return 0;
@ -1153,7 +1153,7 @@ static int handle_apetag(mpg123_handle *fr, unsigned long newhead)
back_bytes += ret;
if(ret < 28)
goto apetag_bad;
debug1("trying to parse APE header at %"OFF_P, (off_p)fr->rd->tell(fr));
/* Apetags start with "APETAGEX", "APET" is already tested. */
if(strncmp((char *)apebuf,"AGEX",4) != 0)
@ -1185,7 +1185,7 @@ static int handle_apetag(mpg123_handle *fr, unsigned long newhead)
return PARSE_AGAIN;
apetag_bad:
apetag_bad:
debug("no proper APE tag found, seeking back");
if(fr->rd->back_bytes(fr,back_bytes) < 0 && NOQUIET)
error1("Cannot seek %d bytes back!", back_bytes);
@ -1193,7 +1193,7 @@ apetag_bad:
return PARSE_AGAIN; /* Give the resync code a chance to fix things */
}
/* Advance a byte in stream to get next possible header and forget
/* Advance a byte in stream to get next possible header and forget
buffered data if possible (for feed reader). */
#define FORGET_INTERVAL 1024 /* Used by callers to set forget flag each <n> bytes. */
static int forget_head_shift(mpg123_handle *fr, unsigned long *newheadp, int forget)
@ -1268,7 +1268,7 @@ static int skip_junk(mpg123_handle *fr, unsigned long *newheadp, long *headcount
do
{
++(*headcount);
if(limit >= 0 && *headcount >= limit) break;
if(limit >= 0 && *headcount >= limit) break;
if(++forgetcount > FORGET_INTERVAL) forgetcount = 0;
if((ret=forget_head_shift(fr, &newhead, !forgetcount))<=0) return ret;
@ -1348,7 +1348,7 @@ static int wetwork(mpg123_handle *fr, unsigned long *newheadp)
do /* ... shift the header with additional single bytes until be found something that could be a header. */
{
++try;
if(limit >= 0 && try >= limit) break;
if(limit >= 0 && try >= limit) break;
if(++forgetcount > FORGET_INTERVAL) forgetcount = 0;
if((ret=forget_head_shift(fr,&newhead,!forgetcount)) <= 0)

View file

@ -141,7 +141,7 @@ static ssize_t icy_fullread(mpg123_handle *fr, unsigned char *buf, ssize_t count
/* now off to read icy data */
/* one byte icy-meta size (must be multiplied by 16 to get icy-meta length) */
ret = fr->rdat.fdread(fr,&temp_buff,1); /* Getting one single byte hast to suceed. */
if(ret < 0){ if(NOQUIET) error("reading icy size"); return READER_ERROR; }
if(ret == 0) break;

View file

@ -72,7 +72,7 @@ int attribute_align_arg mpg123_resize_string(mpg123_string* sb, size_t new)
char* t;
debug("really!");
t = (char*) safe_realloc(sb->p, new*sizeof(char));
debug1("safe_realloc returned %p", (void*) t);
debug1("safe_realloc returned %p", (void*) t);
if(t != NULL)
{
sb->p = t;

View file

@ -122,7 +122,7 @@ int synth_1to1_3dnow(real *bandPtr, int channel, mpg123_handle *fr, int final)
if(fr->have_eq_settings) do_equalizer_3dnow(bandPtr,channel,fr->equalizer);
#endif
/* this is in asm, can be dither or not */
/* uh, is this return from pointer correct? */
/* uh, is this return from pointer correct? */
ret = (int) synth_1to1_3dnow_asm(bandPtr, channel, fr->buffer.data+fr->buffer.fill, fr->rawbuffs, &fr->bo, fr->decwin);
if(final) fr->buffer.fill += 128;
return ret;
@ -154,9 +154,9 @@ void dct64_real_sse(real *out0, real *out1, real *samples);
/* This is just a hull to use the mpg123 handle. */
int synth_1to1_sse(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
@ -173,7 +173,7 @@ int synth_1to1_sse(real *bandPtr,int channel, mpg123_handle *fr, int final)
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
@ -365,9 +365,9 @@ void dct64_x86_64(short *out0, short *out1, real *samples);
/* This is just a hull to use the mpg123 handle. */
int synth_1to1_x86_64(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *b0, **buf;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
@ -384,7 +384,7 @@ int synth_1to1_x86_64(real *bandPtr,int channel, mpg123_handle *fr, int final)
buf = fr->short_buffs[1];
}
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
@ -408,7 +408,7 @@ int synth_1to1_stereo_x86_64(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *b0l, *b0r, **bufl, **bufr;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings)
@ -422,7 +422,7 @@ int synth_1to1_stereo_x86_64(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
bufl = fr->short_buffs[0];
bufr = fr->short_buffs[1];
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
@ -551,9 +551,9 @@ void dct64_avx(short *out0, short *out1, real *samples);
/* This is just a hull to use the mpg123 handle. */
int synth_1to1_avx(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *b0, **buf;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
@ -570,7 +570,7 @@ int synth_1to1_avx(real *bandPtr,int channel, mpg123_handle *fr, int final)
buf = fr->short_buffs[1];
}
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
@ -594,7 +594,7 @@ int synth_1to1_stereo_avx(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *b0l, *b0r, **bufl, **bufr;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings)
@ -608,7 +608,7 @@ int synth_1to1_stereo_avx(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
bufl = fr->short_buffs[0];
bufr = fr->short_buffs[1];
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
@ -827,9 +827,9 @@ void dct64_neon(short *out0, short *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_neon(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *b0, **buf;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
@ -846,7 +846,7 @@ int synth_1to1_neon(real *bandPtr,int channel, mpg123_handle *fr, int final)
buf = fr->short_buffs[1];
}
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
@ -870,7 +870,7 @@ int synth_1to1_stereo_neon(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *b0l, *b0r, **bufl, **bufr;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings)
@ -884,7 +884,7 @@ int synth_1to1_stereo_neon(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
bufl = fr->short_buffs[0];
bufr = fr->short_buffs[1];
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];
@ -1009,9 +1009,9 @@ void dct64_neon64(short *out0, short *out1, real *samples);
/* Hull for C mpg123 API */
int synth_1to1_neon64(real *bandPtr,int channel, mpg123_handle *fr, int final)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *b0, **buf;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
@ -1028,7 +1028,7 @@ int synth_1to1_neon64(real *bandPtr,int channel, mpg123_handle *fr, int final)
buf = fr->short_buffs[1];
}
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0 = buf[0];
bo1 = fr->bo;
@ -1052,7 +1052,7 @@ int synth_1to1_stereo_neon64(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
short *b0l, *b0r, **bufl, **bufr;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings)
@ -1066,7 +1066,7 @@ int synth_1to1_stereo_neon64(real *bandPtr_l,real *bandPtr_r, mpg123_handle *fr)
bufl = fr->short_buffs[0];
bufr = fr->short_buffs[1];
if(fr->bo & 0x1)
if(fr->bo & 0x1)
{
b0l = bufl[0];
b0r = bufr[0];

View file

@ -10,7 +10,7 @@
#include "sample.h"
#include "debug.h"
/*
/*
Part 2: All synth functions that produce 8bit output.
What we need is just a special WRITE_SAMPLE. For the generic and i386 functions, that is.
For the rather optimized synth_1to1, we will need the postprocessing 8bit converters from synth_8bit.h .

View file

@ -258,9 +258,9 @@
int synth_1to1_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings) do_equalizer(bandPtr,channel,fr->equalizer);
@ -276,7 +276,7 @@ int synth_1to1_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
@ -289,12 +289,12 @@ int synth_1to1_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
bo1 = fr->bo+1;
dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
{
register int j;
real *window = fr->decwin + 16 - bo1;
ALIGNED(16) int clip_tmp[4];
vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
vector unsigned char vperm1,vperm2,vperm3,vperm4;
@ -314,18 +314,18 @@ int synth_1to1_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
vperm4 = (vector unsigned char){0,1,18,19,2,3,22,23,4,5,26,27,6,7,30,31};
#endif
vperm1 = vec_lvsl(0,window);
vperm2 = vec_lvsl(0,samples);
vperm3 = vec_lvsr(0,samples);
for (j=4;j;j--)
{
SYNTH_ALTIVEC(16);
vsum = vec_sub(v5,v6);
v9 = vec_sub(v7,v8);
vsum = vec_add(vsum,v9);
v3 = vec_round(vsum);
v3 = (vector float)vec_cts(v3,0);
v1 = (vector float)vec_cmpgt(vsum,vmax);
@ -341,21 +341,21 @@ int synth_1to1_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
vec_st((vector signed short)v7,15,samples);
vec_st((vector signed short)v8,0,samples);
samples += 8;
v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
vclip = vec_sums((vector signed int)v1,vclip);
}
for (j=4;j;j--)
{
SYNTH_ALTIVEC(-16);
vsum = vec_add(v5,v6);
v9 = vec_add(v7,v8);
vsum = vec_add(vsum,v9);
v3 = vec_round(vsum);
v3 = (vector float)vec_cts(v3,0);
v1 = (vector float)vec_cmpgt(vsum,vmax);
@ -371,7 +371,7 @@ int synth_1to1_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
vec_st((vector signed short)v7,15,samples);
vec_st((vector signed short)v8,0,samples);
samples += 8;
v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
@ -382,16 +382,16 @@ int synth_1to1_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
clip = clip_tmp[3];
}
if(final) fr->buffer.fill += 128;
return clip;
}
int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int clip;
int clip;
int bo1;
#ifndef NO_EQUALIZER
if(fr->have_eq_settings)
@ -404,7 +404,7 @@ int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *f
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
@ -421,12 +421,12 @@ int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *f
dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
{
register int j;
real *window = fr->decwin + 16 - bo1;
ALIGNED(16) int clip_tmp[4];
vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
vector unsigned char vperm1,vperm2;
@ -444,21 +444,21 @@ int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *f
vmax = (vector float){32767.0f,32767.0f,32767.0f,32767.0f};
vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
#endif
vperm1 = vec_lvsl(0,window);
vperm2 = vec_lvsr(0,samples);
vprev = vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
for (j=4;j;j--)
{
SYNTH_STEREO_ALTIVEC(16);
vsum = vec_sub(vsum,vsum2);
vsum2 = vec_sub(vsum5,vsum6);
vsum3 = vec_sub(vsum3,vsum4);
vsum4 = vec_sub(vsum7,vsum8);
vsum = vec_add(vsum,vsum3);
vsum2 = vec_add(vsum2,vsum4);
v1 = vec_round(vsum);
v2 = vec_round(vsum2);
v1 = (vector float)vec_cts(v1,0);
@ -474,7 +474,7 @@ int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *f
v4 = (vector float)vec_cmplt(vsum2,vmin);
vec_st((vector signed short)v6,0,samples);
samples += 8;
v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
v3 = (vector float)vec_sr((vector unsigned int)v3, vshift);
@ -484,18 +484,18 @@ int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *f
vclip = vec_sums((vector signed int)v1,vclip);
vclip = vec_sums((vector signed int)v2,vclip);
}
for (j=4;j;j--)
{
SYNTH_STEREO_ALTIVEC(-16);
vsum = vec_add(vsum,vsum2);
vsum2 = vec_add(vsum5,vsum6);
vsum3 = vec_add(vsum3,vsum4);
vsum4 = vec_add(vsum7,vsum8);
vsum = vec_add(vsum,vsum3);
vsum2 = vec_add(vsum2,vsum4);
v1 = vec_round(vsum);
v2 = vec_round(vsum2);
v1 = (vector float)vec_cts(v1,0);
@ -511,7 +511,7 @@ int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *f
v4 = (vector float)vec_cmplt(vsum2,vmin);
vec_st((vector signed short)v6,0,samples);
samples += 8;
v1 = (vector float)vec_sr((vector unsigned int)v1, vshift);
v2 = (vector float)vec_sr((vector unsigned int)v2, vshift);
v3 = (vector float)vec_sr((vector unsigned int)v3, vshift);
@ -521,7 +521,7 @@ int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *f
vclip = vec_sums((vector signed int)v1,vclip);
vclip = vec_sums((vector signed int)v2,vclip);
}
if((size_t)samples & 0xf)
{
v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
@ -533,14 +533,14 @@ int synth_1to1_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *f
clip = clip_tmp[3];
}
fr->buffer.fill += 128;
return clip;
}
int synth_1to1_real_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int bo1;
#ifndef NO_EQUALIZER
@ -557,7 +557,7 @@ int synth_1to1_real_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fin
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
@ -570,12 +570,12 @@ int synth_1to1_real_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fin
bo1 = fr->bo+1;
dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
{
register int j;
real *window = fr->decwin + 16 - bo1;
vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
vector unsigned char vperm1,vperm2,vperm3,vperm4, vperm5;
vector float vsum,vsum2,vsum3,vsum4,vscale,vzero;
@ -590,19 +590,19 @@ int synth_1to1_real_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fin
vperm4 = (vector unsigned char){0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31};
vperm5 = (vector unsigned char){8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31};
#endif
vperm1 = vec_lvsl(0,window);
vperm2 = vec_lvsl(0,samples);
vperm3 = vec_lvsr(0,samples);
for (j=4;j;j--)
{
SYNTH_ALTIVEC(16);
vsum = vec_sub(v5,v6);
v9 = vec_sub(v7,v8);
vsum = vec_add(vsum,v9);
vsum = vec_madd(vsum, vscale, vzero);
vsample1 = vec_ld(0,samples);
vsample2 = vec_ld(16,samples);
vsample3 = vec_ld(31,samples);
@ -620,16 +620,16 @@ int synth_1to1_real_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fin
vec_st(v7,0,samples);
samples += 8;
}
for (j=4;j;j--)
{
SYNTH_ALTIVEC(-16);
vsum = vec_add(v5,v6);
v9 = vec_add(v7,v8);
vsum = vec_add(vsum,v9);
vsum = vec_madd(vsum, vscale, vzero);
vsample1 = vec_ld(0,samples);
vsample2 = vec_ld(16,samples);
vsample3 = vec_ld(31,samples);
@ -649,14 +649,14 @@ int synth_1to1_real_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fin
}
}
if(final) fr->buffer.fill += 256;
return 0;
}
int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
real *samples = (real *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int bo1;
#ifndef NO_EQUALIZER
@ -670,7 +670,7 @@ int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
@ -687,12 +687,12 @@ int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr
dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
{
register int j;
real *window = fr->decwin + 16 - bo1;
vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
vector unsigned char vperm1,vperm2;
vector float vsum,vsum2,vsum3,vsum4,vsum5,vsum6,vsum7,vsum8,vscale,vzero;
@ -703,14 +703,14 @@ int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr
#else
vscale = (vector float){1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f,1.0f/32768.0f};
#endif
vperm1 = vec_lvsl(0,window);
vperm2 = vec_lvsr(0,samples);
vprev = vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
for (j=4;j;j--)
{
SYNTH_STEREO_ALTIVEC(16);
vsum = vec_sub(vsum,vsum2);
vsum2 = vec_sub(vsum5,vsum6);
vsum3 = vec_sub(vsum3,vsum4);
@ -719,7 +719,7 @@ int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr
vsum2 = vec_add(vsum2,vsum4);
vsum = vec_madd(vsum, vscale, vzero);
vsum2 = vec_madd(vsum2, vscale, vzero);
v1 = vec_mergeh(vsum, vsum2);
v2 = vec_mergel(vsum, vsum2);
v3 = vec_perm(vprev,v1,vperm2);
@ -729,11 +729,11 @@ int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr
vec_st(v4,16,samples);
samples += 8;
}
for (j=4;j;j--)
{
SYNTH_STEREO_ALTIVEC(-16);
vsum = vec_add(vsum,vsum2);
vsum2 = vec_add(vsum5,vsum6);
vsum3 = vec_add(vsum3,vsum4);
@ -742,7 +742,7 @@ int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr
vsum2 = vec_add(vsum2,vsum4);
vsum = vec_madd(vsum, vscale, vzero);
vsum2 = vec_madd(vsum2, vscale, vzero);
v1 = vec_mergeh(vsum, vsum2);
v2 = vec_mergel(vsum, vsum2);
v3 = vec_perm(vprev,v1,vperm2);
@ -752,7 +752,7 @@ int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr
vec_st(v4,16,samples);
samples += 8;
}
if((size_t)samples & 0xf)
{
v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
@ -761,14 +761,14 @@ int synth_1to1_fltst_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr
}
}
fr->buffer.fill += 256;
return 0;
}
int synth_1to1_s32_altivec(real *bandPtr,int channel,mpg123_handle *fr, int final)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0, **buf;
int clip;
int bo1;
@ -786,7 +786,7 @@ int synth_1to1_s32_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fina
samples++;
buf = fr->real_buffs[1];
}
if(fr->bo & 0x1)
{
b0 = buf[0];
@ -799,12 +799,12 @@ int synth_1to1_s32_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fina
bo1 = fr->bo+1;
dct64_altivec(buf[0]+fr->bo,buf[1]+fr->bo+1,bandPtr);
}
{
register int j;
real *window = fr->decwin + 16 - bo1;
ALIGNED(16) int clip_tmp[4];
vector float v1,v2,v3,v4,v5,v6,v7,v8,v9;
vector unsigned char vperm1,vperm2,vperm3,vperm4,vperm5;
@ -826,21 +826,21 @@ int synth_1to1_s32_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fina
vperm4 = (vector unsigned char){0,1,2,3,20,21,22,23,4,5,6,7,28,29,30,31};
vperm5 = (vector unsigned char){8,9,10,11,20,21,22,23,12,13,14,15,28,29,30,31};
#endif
vperm1 = vec_lvsl(0,window);
vperm2 = vec_lvsl(0,samples);
vperm3 = vec_lvsr(0,samples);
for (j=4;j;j--)
{
SYNTH_ALTIVEC(16);
vsum = vec_sub(v5,v6);
v9 = vec_sub(v7,v8);
v1 = vec_add(vsum,v9);
vsum = (vector float)vec_cts(v1,16);
v8 = (vector float)vec_cmpgt(v1,vmax);
v9 = (vector float)vec_cmplt(v1,vmin);
vsample1 = vec_ld(0,samples);
vsample2 = vec_ld(16,samples);
vsample3 = vec_ld(31,samples);
@ -857,24 +857,24 @@ int synth_1to1_s32_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fina
vec_st((vector signed int)v6,16,samples);
vec_st((vector signed int)v7,0,samples);
samples += 8;
v1 = (vector float)vec_sr((vector unsigned int)v8, vshift);
v2 = (vector float)vec_sr((vector unsigned int)v9, vshift);
v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
vclip = vec_sums((vector signed int)v1,vclip);
}
for (j=4;j;j--)
{
SYNTH_ALTIVEC(-16);
vsum = vec_add(v5,v6);
v9 = vec_add(v7,v8);
v1 = vec_add(vsum,v9);
vsum = (vector float)vec_cts(v1,16);
v8 = (vector float)vec_cmpgt(v1,vmax);
v9 = (vector float)vec_cmplt(v1,vmin);
vsample1 = vec_ld(0,samples);
vsample2 = vec_ld(16,samples);
vsample3 = vec_ld(31,samples);
@ -891,18 +891,18 @@ int synth_1to1_s32_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fina
vec_st((vector signed int)v6,16,samples);
vec_st((vector signed int)v7,0,samples);
samples += 8;
v1 = (vector float)vec_sr((vector unsigned int)v8, vshift);
v2 = (vector float)vec_sr((vector unsigned int)v9, vshift);
v1 = (vector float)vec_add((vector unsigned int)v1,(vector unsigned int)v2);
vclip = vec_sums((vector signed int)v1,vclip);
}
vec_st(vclip,0,clip_tmp);
clip = clip_tmp[3];
}
if(final) fr->buffer.fill += 256;
return clip;
}
@ -910,7 +910,7 @@ int synth_1to1_s32_altivec(real *bandPtr,int channel,mpg123_handle *fr, int fina
int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handle *fr)
{
int32_t *samples = (int32_t *) (fr->buffer.data+fr->buffer.fill);
real *b0l, *b0r, **bufl, **bufr;
int clip;
int bo1;
@ -925,7 +925,7 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
fr->bo &= 0xf;
bufl = fr->real_buffs[0];
bufr = fr->real_buffs[1];
if(fr->bo & 0x1)
{
b0l = bufl[0];
@ -942,12 +942,12 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
dct64_altivec(bufl[0]+fr->bo,bufl[1]+fr->bo+1,bandPtr_l);
dct64_altivec(bufr[0]+fr->bo,bufr[1]+fr->bo+1,bandPtr_r);
}
{
register int j;
real *window = fr->decwin + 16 - bo1;
ALIGNED(16) int clip_tmp[4];
vector float v1,v2,v3,v4,v5,v6,v7,v8,v9,v10,v11,v12,v13;
vector unsigned char vperm1,vperm2;
@ -965,14 +965,14 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
vmax = (vector float){32767.999f,32767.999f,32767.999f,32767.999f};
vmin = (vector float){-32768.0f,-32768.0f,-32768.0f,-32768.0f};
#endif
vperm1 = vec_lvsl(0,window);
vperm2 = vec_lvsr(0,samples);
vprev = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
for (j=4;j;j--)
{
SYNTH_STEREO_ALTIVEC(16);
vsum = vec_sub(vsum,vsum2);
vsum2 = vec_sub(vsum5,vsum6);
vsum3 = vec_sub(vsum3,vsum4);
@ -985,7 +985,7 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
v6 = (vector float)vec_cmplt(v1,vmin);
v7 = (vector float)vec_cmpgt(v2,vmax);
v8 = (vector float)vec_cmplt(v2,vmin);
v1 = vec_mergeh(vsum, vsum2);
v2 = vec_mergel(vsum, vsum2);
v3 = vec_perm(vprev,v1,vperm2);
@ -994,7 +994,7 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
vec_st((vector signed int)v3,0,samples);
vec_st((vector signed int)v4,16,samples);
samples += 8;
v1 = (vector float)vec_sr((vector unsigned int)v5, vshift);
v2 = (vector float)vec_sr((vector unsigned int)v6, vshift);
v3 = (vector float)vec_sr((vector unsigned int)v7, vshift);
@ -1004,11 +1004,11 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
vclip = vec_sums((vector signed int)v1,vclip);
vclip = vec_sums((vector signed int)v2,vclip);
}
for (j=4;j;j--)
{
SYNTH_STEREO_ALTIVEC(-16);
vsum = vec_add(vsum,vsum2);
vsum2 = vec_add(vsum5,vsum6);
vsum3 = vec_add(vsum3,vsum4);
@ -1021,7 +1021,7 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
v6 = (vector float)vec_cmplt(v1,vmin);
v7 = (vector float)vec_cmpgt(v2,vmax);
v8 = (vector float)vec_cmplt(v2,vmin);
v1 = vec_mergeh(vsum, vsum2);
v2 = vec_mergel(vsum, vsum2);
v3 = vec_perm(vprev,v1,vperm2);
@ -1030,7 +1030,7 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
vec_st((vector signed int)v3,0,samples);
vec_st((vector signed int)v4,16,samples);
samples += 8;
v1 = (vector float)vec_sr((vector unsigned int)v5, vshift);
v2 = (vector float)vec_sr((vector unsigned int)v6, vshift);
v3 = (vector float)vec_sr((vector unsigned int)v7, vshift);
@ -1040,18 +1040,18 @@ int synth_1to1_s32_stereo_altivec(real *bandPtr_l, real *bandPtr_r, mpg123_handl
vclip = vec_sums((vector signed int)v1,vclip);
vclip = vec_sums((vector signed int)v2,vclip);
}
if((size_t)samples & 0xf)
{
v1 = (vector float)vec_perm(vec_ld(0,samples),vec_ld(0,samples),vec_lvsl(0,samples));
v2 = (vector float)vec_perm(vprev,v1,vperm2);
vec_st((vector signed int)v2,0,samples);
}
vec_st(vclip,0,clip_tmp);
clip = clip_tmp[3];
}
fr->buffer.fill += 256;
return clip;
}

View file

@ -8,8 +8,8 @@
One has to see if the modification for non-static memory kills this optimization (cache locality?).
*/
/*
* Subband Synthesis for MPEG Audio.
/*
* Subband Synthesis for MPEG Audio.
*
* Version optimized for 80486 by using integer arithmetic,
* multiplications by shift and add, and by increasing locality in
@ -19,7 +19,7 @@
* Note: this version does not guaranty a good accuracy. The filter
* coefficients are quantified on 14 bits.
*
* (c) 1998 Fabrice Bellard
* (c) 1998 Fabrice Bellard
*/
#include "mpg123lib_intern.h"
@ -109,7 +109,7 @@ int absynth_1to1_i486(real *bandPtr, int channel, mpg123_handle *fr, int nb_bloc
{
short *samples = (short *) (fr->buffer.data+fr->buffer.fill);
int *b0,**buf;
int clip = 0;
int clip = 0;
int block,b,bo_start;
/* samples address */
@ -126,7 +126,7 @@ int absynth_1to1_i486(real *bandPtr, int channel, mpg123_handle *fr, int nb_bloc
if (b >= FIR_BUFFER_SIZE) {
int *p,*q;
int c,i,j;
/* we shift the buffers */
for(c=0;c<2;c++) {
p=&buf[c][0]+1;
@ -140,7 +140,7 @@ int absynth_1to1_i486(real *bandPtr, int channel, mpg123_handle *fr, int nb_bloc
/* we update 'bo' accordingly */
b=fr->i486bo[channel]=FIR_SIZE;
}
if(b & 1) {
dct64_i486(buf[1]+b,buf[0]+b,bandPtr);
} else {
@ -167,11 +167,11 @@ int absynth_1to1_i486(real *bandPtr, int channel, mpg123_handle *fr, int nb_bloc
FIR16_2(2,-6,50,-86,520,-1106,1910,-8447,18714,10294,1322,1469,488,145,55,8,0,
30,0,-8,55,-145,488,-1469,1322,-10294,18714,8447,1910,1106,520,86,50,6);
FIR16_2(3,-5,49,-73,521,-1015,2023,-7986,18657,10751,1140,1559,473,161,56,9,0,
29,0,-9,56,-161,473,-1559,1140,-10751,18657,7986,2023,1015,521,73,49,5);
29,0,-9,56,-161,473,-1559,1140,-10751,18657,7986,2023,1015,521,73,49,5);
samples+=64;
}
samples-=64*nb_blocks;
/* filter bank: part 2 */
b=bo_start;
@ -191,7 +191,7 @@ int absynth_1to1_i486(real *bandPtr, int channel, mpg123_handle *fr, int nb_bloc
FIR16_2(6,-4,44,-38,514,-751,2284,-6620,18353,12097,509,1817,411,212,57,12,0,
26,0,-12,57,-212,411,-1817,509,-12097,18353,6620,2284,751,514,38,44,4);
FIR16_2(7,-3,42,-27,508,-665,2347,-6173,18208,12534,270,1899,383,229,56,13,0,
25,0,-13,56,-229,383,-1899,270,-12534,18208,6173,2347,665,508,27,42,3);
25,0,-13,56,-229,383,-1899,270,-12534,18208,6173,2347,665,508,27,42,3);
samples+=64;
}
@ -216,7 +216,7 @@ int absynth_1to1_i486(real *bandPtr, int channel, mpg123_handle *fr, int nb_bloc
FIR16_2(10,-2,36,0,479,-423,2465,-4869,17647,13794,-530,2122,282,284,53,17,0,
22,0,-17,53,-284,282,-2122,-530,-13794,17647,4869,2465,423,479,0,36,2);
FIR16_2(11,-2,34,7,467,-347,2483,-4449,17419,14194,-825,2188,242,302,52,18,0,
21,0,-18,52,-302,242,-2188,-825,-14194,17419,4449,2483,347,467,-7,34,2);
21,0,-18,52,-302,242,-2188,-825,-14194,17419,4449,2483,347,467,-7,34,2);
samples+=64;
}
@ -242,7 +242,7 @@ int absynth_1to1_i486(real *bandPtr, int channel, mpg123_handle *fr, int nb_bloc
18,-1,-22,44,-357,100,-2354,-1788,-15322,16623,3245,2479,136,424,-26,29,1);
FIR16_2(15,-1,27,31,408,-72,2459,-2863,16322,15671,-2135,2396,46,374,40,24,-1,
17,-1,-24,40,-374,46,-2396,-2135,-15671,16322,2863,2459,72,408,-31,27,1);
FIR16_1(16,-1,0,36,0,-11,0,-2493,0,16004,0,2431,0,391,0,26,0);
FIR16_1(16,-1,0,36,0,-11,0,-2493,0,16004,0,2431,0,391,0,26,0);
samples+=64;
}

View file

@ -13,7 +13,7 @@
#ifdef REAL_IS_FIXED
#error "Do not build this file with fixed point math!"
#else
/*
/*
Part 3: All synth functions that produce float output.
What we need is just a special WRITE_SAMPLE. For the generic and i386 functions, that is.
The optimized synths would need to be changed internally to support float output.

View file

@ -13,7 +13,7 @@
#ifdef REAL_IS_FIXED
#error "Do not build this file with fixed point math!"
#else
/*
/*
Part 4: All synth functions that produce signed 32 bit output.
What we need is just a special WRITE_SAMPLE.
*/

View file

@ -17,7 +17,7 @@ static ALIGNED(16) real cos16[4];
static ALIGNED(16) real cos8[2];
static ALIGNED(16) real cos4[1];
#elif defined(REAL_IS_FIXED) && defined(PRECALC_TABLES)
static real cos64[16] =
static real cos64[16] =
{
8398725,8480395,8647771,8909416,9279544,9780026,10443886,11321405,
12491246,14081950,16316987,19619946,24900150,34523836,57170182,170959967
@ -120,24 +120,24 @@ void make_decode_tables_mmx(mpg123_handle *fr)
{
if(idx < 512+16)
fr->decwin_mmx[idx+16] = fr->decwin_mmx[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
if(i % 32 == 31)
idx -= 1023;
if(i % 64 == 63)
scaleval = - scaleval;
}
for( /* i=256 */ ;i<512;i++,j--,idx+=32)
{
if(idx < 512+16)
fr->decwin_mmx[idx+16] = fr->decwin_mmx[idx] = DOUBLE_TO_REAL((double) intwinbase[j] * scaleval);
if(i % 32 == 31)
idx -= 1023;
if(i % 64 == 63)
scaleval = - scaleval;
}
for(i=0; i<512; i++) {
if(i&1) val = rounded(fr->decwin_mmx[i]*0.5);
else val = rounded(fr->decwin_mmx[i]*-0.5);