Nope. Didn't get it right this time either with the byteswapping.
However we've at least reduced the customness.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: common_interface.c,v 1.10 2005/01/23 00:20:43 rocky Exp $
|
$Id: common_interface.c,v 1.11 2005/01/23 00:27:11 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 1998, 2002 Monty monty@xiph.org
|
Copyright (C) 1998, 2002 Monty monty@xiph.org
|
||||||
@@ -111,9 +111,9 @@ data_bigendianp(cdrom_drive_t *d)
|
|||||||
int j;
|
int j;
|
||||||
|
|
||||||
for(j=0;j<128;j++)
|
for(j=0;j<128;j++)
|
||||||
a[j] = UINT16_TO_LE(buff[j*2+beginsec+460]);
|
a[j] = le16_to_cpu(buff[j*2+beginsec+460]);
|
||||||
for(j=0;j<128;j++)
|
for(j=0;j<128;j++)
|
||||||
b[j] = UINT16_TO_LE(buff[j*2+beginsec+461]);
|
b[j] = le16_to_cpu(buff[j*2+beginsec+461]);
|
||||||
|
|
||||||
fft_forward(128,a,NULL,NULL);
|
fft_forward(128,a,NULL,NULL);
|
||||||
fft_forward(128,b,NULL,NULL);
|
fft_forward(128,b,NULL,NULL);
|
||||||
@@ -122,10 +122,10 @@ data_bigendianp(cdrom_drive_t *d)
|
|||||||
lsb_energy+=fabs(a[j])+fabs(b[j]);
|
lsb_energy+=fabs(a[j])+fabs(b[j]);
|
||||||
|
|
||||||
for(j=0;j<128;j++)
|
for(j=0;j<128;j++)
|
||||||
a[j] = UINT16_TO_BE(buff[j*2+beginsec+460]);
|
a[j] = be16_to_cpu(buff[j*2+beginsec+460]);
|
||||||
|
|
||||||
for(j=0;j<128;j++)
|
for(j=0;j<128;j++)
|
||||||
b[j] = UINT16_TO_BE(buff[j*2+beginsec+461]);
|
b[j] = be16_to_cpu(buff[j*2+beginsec+461]);
|
||||||
|
|
||||||
fft_forward(128,a,NULL,NULL);
|
fft_forward(128,a,NULL,NULL);
|
||||||
fft_forward(128,b,NULL,NULL);
|
fft_forward(128,b,NULL,NULL);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
$Id: utils.h,v 1.6 2005/01/23 00:20:43 rocky Exp $
|
$Id: utils.h,v 1.7 2005/01/23 00:27:11 rocky Exp $
|
||||||
|
|
||||||
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
Copyright (C) 2004, 2005 Rocky Bernstein <rocky@panix.com>
|
||||||
Copyright (C) 1998 Monty xiphmont@mit.edu
|
Copyright (C) 1998 Monty xiphmont@mit.edu
|
||||||
@@ -36,6 +36,40 @@ bigendianp(void)
|
|||||||
|
|
||||||
extern char *catstring(char *buff, const char *s);
|
extern char *catstring(char *buff, const char *s);
|
||||||
|
|
||||||
|
|
||||||
|
/*#if BYTE_ORDER == LITTLE_ENDIAN*/
|
||||||
|
|
||||||
|
#ifndef WORDS_BIGENDIAN
|
||||||
|
|
||||||
|
static inline int16_t be16_to_cpu(int16_t x){
|
||||||
|
return(UINT16_SWAP_LE_BE_C(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int16_t le16_to_cpu(int16_t x){
|
||||||
|
return(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
static inline int16_t be16_to_cpu(int16_t x){
|
||||||
|
return(x);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int16_t le16_to_cpu(int16_t x){
|
||||||
|
return(UINT16_SWAP_LE_BE_C(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static inline int16_t cpu_to_be16(int16_t x){
|
||||||
|
return(be16_to_cpu(x));
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline int16_t cpu_to_le16(int16_t x){
|
||||||
|
return(le16_to_cpu(x));
|
||||||
|
}
|
||||||
|
|
||||||
void cderror(cdrom_drive_t *d, const char *s);
|
void cderror(cdrom_drive_t *d, const char *s);
|
||||||
|
|
||||||
void cdmessage(cdrom_drive_t *d,const char *s);
|
void cdmessage(cdrom_drive_t *d,const char *s);
|
||||||
|
|||||||
Reference in New Issue
Block a user