diff options
-rw-r--r-- | src/demuxers/demux_aiff.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_film.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_fli.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_idcin.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_mpeg.c | 4 | ||||
-rw-r--r-- | src/demuxers/demux_mpgaudio.c | 6 | ||||
-rw-r--r-- | src/demuxers/demux_qt.c | 7 | ||||
-rw-r--r-- | src/demuxers/demux_real.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_roq.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_smjpeg.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_snd.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_voc.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_vqa.c | 7 | ||||
-rw-r--r-- | src/demuxers/demux_wav.c | 5 | ||||
-rw-r--r-- | src/demuxers/demux_wc3movie.c | 7 | ||||
-rw-r--r-- | src/libxineadec/adpcm.c | 7 | ||||
-rw-r--r-- | src/libxineadec/roqaudio.c | 5 | ||||
-rw-r--r-- | src/libxinevdec/fli.c | 5 | ||||
-rw-r--r-- | src/libxinevdec/qtrle.c | 5 | ||||
-rw-r--r-- | src/libxinevdec/qtrpza.c | 5 | ||||
-rw-r--r-- | src/libxinevdec/qtsmc.c | 5 | ||||
-rw-r--r-- | src/libxinevdec/rgb.c | 5 | ||||
-rw-r--r-- | src/libxinevdec/wc3video.c | 7 | ||||
-rw-r--r-- | src/xine-engine/bswap.h | 34 |
24 files changed, 60 insertions, 99 deletions
diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index f5b0e6112..593f4cae0 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -19,7 +19,7 @@ * * AIFF File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_aiff.c,v 1.9 2002/10/05 21:09:18 komadori Exp $ + * $Id: demux_aiff.c,v 1.10 2002/10/06 03:48:13 komadori Exp $ * */ @@ -41,9 +41,6 @@ #include "buffer.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | \ ( (long)(unsigned char)(ch2) << 8 ) | \ diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 6ee537650..c90af8828 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -21,7 +21,7 @@ * For more information on the FILM file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_film.c,v 1.31 2002/10/05 21:09:18 komadori Exp $ + * $Id: demux_film.c,v 1.32 2002/10/06 03:48:13 komadori Exp $ */ #ifdef HAVE_CONFIG_H @@ -41,9 +41,6 @@ #include "demux.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | ( (long)(unsigned char)(ch2) << 8 ) | \ ( (long)(unsigned char)(ch1) << 16 ) | ( (long)(unsigned char)(ch0) << 24 ) ) diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c index 946e88d2b..48e5c32a0 100644 --- a/src/demuxers/demux_fli.c +++ b/src/demuxers/demux_fli.c @@ -22,7 +22,7 @@ * avoid while programming a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_fli.c,v 1.14 2002/10/06 02:35:08 tmmm Exp $ + * $Id: demux_fli.c,v 1.15 2002/10/06 03:48:13 komadori Exp $ */ #ifdef HAVE_CONFIG_H @@ -42,9 +42,6 @@ #include "demux.h" #include "bswap.h" -#define LE_16(x) (le2me_16(*(unsigned short *)(x))) -#define LE_32(x) (le2me_32(*(unsigned int *)(x))) - #define VALID_ENDS "fli,flc" #define FLI_HEADER_SIZE 128 diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c index 309073b75..217c5faba 100644 --- a/src/demuxers/demux_idcin.c +++ b/src/demuxers/demux_idcin.c @@ -63,7 +63,7 @@ * - if any bytes exceed 63, do not shift the bytes at all before * transmitting them to the video decoder * - * $Id: demux_idcin.c,v 1.14 2002/10/06 02:35:08 tmmm Exp $ + * $Id: demux_idcin.c,v 1.15 2002/10/06 03:48:13 komadori Exp $ */ #ifdef HAVE_CONFIG_H @@ -83,9 +83,6 @@ #include "demux.h" #include "bswap.h" -#define LE_16(x) (le2me_16(*(unsigned short *)(x))) -#define LE_32(x) (le2me_32(*(unsigned int *)(x))) - #define VALID_ENDS "cin" #define IDCIN_HEADER_SIZE 20 #define HUFFMAN_TABLE_SIZE 65536 diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 35ab025c1..fd392b80c 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpeg.c,v 1.79 2002/10/06 01:37:27 tmmm Exp $ + * $Id: demux_mpeg.c,v 1.80 2002/10/06 03:48:13 komadori Exp $ * * demultiplexer for mpeg 1/2 program streams * reads streams of variable blocksizes @@ -89,8 +89,6 @@ typedef struct demux_mpeg_s { */ #include "bswap.h" -#define BE_16(x) (be2me_16(*(uint16_t *)(x))) -#define BE_32(x) (be2me_32(*(uint32_t *)(x))) #define QT_ATOM( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | ( (long)(unsigned char)(ch2) << 8 ) | \ ( (long)(unsigned char)(ch1) << 16 ) | ( (long)(unsigned char)(ch0) << 24 ) ) diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index 7a490518c..246aae632 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_mpgaudio.c,v 1.65 2002/10/05 21:09:18 komadori Exp $ + * $Id: demux_mpgaudio.c,v 1.66 2002/10/06 03:48:13 komadori Exp $ * * demultiplexer for mpeg audio (i.e. mp3) streams * @@ -556,7 +556,7 @@ static int demux_mpgaudio_open(demux_plugin_t *this_gen, if (input->read(input, riff_check, 4) != 4) return DEMUX_CANNOT_HANDLE; /* head gets to be a generic variable in this case */ - head = le2me_32(*(unsigned int *)&riff_check[0]); + head = LE_32(&riff_check[0]); /* skip over the chunk and the 'data' tag and length */ input->seek(input, head + 8, SEEK_CUR); @@ -567,7 +567,7 @@ static int demux_mpgaudio_open(demux_plugin_t *this_gen, return DEMUX_CANNOT_HANDLE; for (i = 0; i < RIFF_CHECK_BYTES - 4; i++) { - head = be2me_32(*(unsigned int *)&riff_check[i]); + head = BE_32(&riff_check[i]); #ifdef LOG printf ("demux_mpgaudio: **** mpg123: checking %08X\n", head); #endif diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index b557c9959..edb4f8b36 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -30,7 +30,7 @@ * build_frame_table * free_qt_info * - * $Id: demux_qt.c,v 1.93 2002/10/06 02:27:53 tmmm Exp $ + * $Id: demux_qt.c,v 1.94 2002/10/06 03:48:13 komadori Exp $ * */ @@ -57,9 +57,6 @@ typedef unsigned int qt_atom; -#define BE_16(x) (be2me_16(*(uint16_t *)(x))) -#define BE_32(x) (be2me_32(*(uint32_t *)(x))) - #define QT_ATOM( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | ( (long)(unsigned char)(ch2) << 8 ) | \ ( (long)(unsigned char)(ch1) << 16 ) | ( (long)(unsigned char)(ch0) << 24 ) ) @@ -572,7 +569,7 @@ static qt_error parse_trak_atom(qt_sample_table *sample_table, BE_16(&trak_atom[i + 0x2E]); } sample_table->media_description.video.codec_format = - *(uint32_t *)&trak_atom[i + 0x10]; + ME_32(&trak_atom[i + 0x10]); /* figure out the palette situation */ color_depth = trak_atom[i + 0x5F]; diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 9d76dc783..53392314d 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -21,7 +21,7 @@ * For more information regarding the Real file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_real.c,v 1.2 2002/10/06 02:35:08 tmmm Exp $ + * $Id: demux_real.c,v 1.3 2002/10/06 03:48:13 komadori Exp $ */ #ifdef HAVE_CONFIG_H @@ -41,9 +41,6 @@ #include "demux.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(uint16_t *)(x))) -#define BE_32(x) (be2me_32(*(uint32_t *)(x))) - #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | \ ( (long)(unsigned char)(ch2) << 8 ) | \ diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index f3cdf6b82..ebebc17de 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: demux_roq.c,v 1.18 2002/10/06 02:35:08 tmmm Exp $ + * $Id: demux_roq.c,v 1.19 2002/10/06 03:48:13 komadori Exp $ */ #ifdef HAVE_CONFIG_H @@ -41,9 +41,6 @@ #include "demux.h" #include "bswap.h" -#define LE_16(x) (le2me_16(*(unsigned short *)(x))) -#define LE_32(x) (le2me_32(*(unsigned int *)(x))) - #define RoQ_MAGIC_NUMBER 0x1084 #define RoQ_CHUNK_PREAMBLE_SIZE 8 #define RoQ_AUDIO_SAMPLE_RATE 22050 diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index 547222b1b..1619d36a3 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -21,7 +21,7 @@ * For more information on the SMJPEG file format, visit: * http://www.lokigames.com/development/smjpeg.php3 * - * $Id: demux_smjpeg.c,v 1.17 2002/10/05 21:09:18 komadori Exp $ + * $Id: demux_smjpeg.c,v 1.18 2002/10/06 03:48:13 komadori Exp $ */ #ifdef HAVE_CONFIG_H @@ -41,9 +41,6 @@ #include "demux.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | ( (long)(unsigned char)(ch2) << 8 ) | \ ( (long)(unsigned char)(ch1) << 16 ) | ( (long)(unsigned char)(ch0) << 24 ) ) diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index 4336cda8e..d90099463 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -19,7 +19,7 @@ * * SND/AU File Demuxer by Mike Melanson (melanson@pcisys.net) * - * $Id: demux_snd.c,v 1.10 2002/10/05 21:09:18 komadori Exp $ + * $Id: demux_snd.c,v 1.11 2002/10/06 03:48:13 komadori Exp $ * */ @@ -41,9 +41,6 @@ #include "buffer.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - #define SND_HEADER_SIZE 24 #define PCM_BLOCK_ALIGN 1024 /* this is the big-endian hex value '.snd' */ diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c index 099a64524..0d9e19c68 100644 --- a/src/demuxers/demux_voc.c +++ b/src/demuxers/demux_voc.c @@ -23,7 +23,7 @@ * It will only play that block if it is PCM data. More variations will be * supported as they are encountered. * - * $Id: demux_voc.c,v 1.10 2002/10/05 21:09:18 komadori Exp $ + * $Id: demux_voc.c,v 1.11 2002/10/06 03:48:13 komadori Exp $ * */ @@ -45,9 +45,6 @@ #include "buffer.h" #include "bswap.h" -#define LE_16(x) (le2me_16(*(uint16_t *)(x))) -#define LE_32(x) (le2me_32(*(uint32_t *)(x))) - #define VALID_ENDS "voc" #define PCM_BLOCK_ALIGN 1024 #define VOC_HEADER_SIZE 0x1A diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index 563cfba20..5af16b6f0 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -27,7 +27,7 @@ * block needs information from the previous audio block in order to be * decoded, thus making random seeking difficult. * - * $Id: demux_vqa.c,v 1.11 2002/10/06 02:35:08 tmmm Exp $ + * $Id: demux_vqa.c,v 1.12 2002/10/06 03:48:13 komadori Exp $ */ #ifdef HAVE_CONFIG_H @@ -47,11 +47,6 @@ #include "demux.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) -#define LE_16(x) (le2me_16(*(unsigned short *)(x))) -#define LE_32(x) (le2me_32(*(unsigned int *)(x))) - #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | \ ( (long)(unsigned char)(ch2) << 8 ) | \ diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index 4a6b379f2..836a0562b 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -20,7 +20,7 @@ * MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net) * based on WAV specs that are available far and wide * - * $Id: demux_wav.c,v 1.16 2002/10/05 21:09:18 komadori Exp $ + * $Id: demux_wav.c,v 1.17 2002/10/06 03:48:13 komadori Exp $ * */ @@ -42,9 +42,6 @@ #include "buffer.h" #include "bswap.h" -#define LE_16(x) (le2me_16(*(uint16_t *)(x))) -#define LE_32(x) (le2me_32(*(uint32_t *)(x))) - #define VALID_ENDS "wav" #define WAV_SIGNATURE_SIZE 16 /* this is the hex value for 'data' */ diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index 71fe1cf70..5b19de52d 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -22,7 +22,7 @@ * For more information on the MVE file format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: demux_wc3movie.c,v 1.15 2002/10/05 21:09:18 komadori Exp $ + * $Id: demux_wc3movie.c,v 1.16 2002/10/06 03:48:13 komadori Exp $ */ #ifdef HAVE_CONFIG_H @@ -42,11 +42,6 @@ #include "demux.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) -#define LE_16(x) (le2me_16(*(unsigned short *)(x))) -#define LE_32(x) (le2me_32(*(unsigned int *)(x))) - #define FOURCC_TAG( ch0, ch1, ch2, ch3 ) \ ( (long)(unsigned char)(ch3) | \ ( (long)(unsigned char)(ch2) << 8 ) | \ diff --git a/src/libxineadec/adpcm.c b/src/libxineadec/adpcm.c index 1269f19ed..c72cc1f03 100644 --- a/src/libxineadec/adpcm.c +++ b/src/libxineadec/adpcm.c @@ -24,7 +24,7 @@ * formats can be found here: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: adpcm.c,v 1.16 2002/09/13 03:03:42 tmmm Exp $ + * $Id: adpcm.c,v 1.17 2002/10/06 03:48:13 komadori Exp $ */ #include <stdio.h> @@ -40,11 +40,6 @@ #include "xineutils.h" #include "bswap.h" -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) -#define LE_16(x) (le2me_16(*(unsigned short *)(x))) -#define LE_32(x) (le2me_32(*(unsigned int *)(x))) - /* pertinent tables */ static int ima_adpcm_step[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, diff --git a/src/libxineadec/roqaudio.c b/src/libxineadec/roqaudio.c index 59da90eb4..56c48ed95 100644 --- a/src/libxineadec/roqaudio.c +++ b/src/libxineadec/roqaudio.c @@ -21,7 +21,7 @@ * For more information regarding the RoQ file format, visit: * http://www.csse.monash.edu.au/~timf/ * - * $Id: roqaudio.c,v 1.7 2002/09/05 22:19:01 mroi Exp $ + * $Id: roqaudio.c,v 1.8 2002/10/06 03:48:13 komadori Exp $ * */ @@ -43,9 +43,6 @@ #define AUDIOBUFSIZE 128*1024 -#define LE_16(x) (le2me_16(*(unsigned short *)(x))) -#define LE_32(x) (le2me_32(*(unsigned int *)(x))) - #define CLAMP_S16(x) if (x < -32768) x = -32768; \ else if (x > 32767) x = 32767; #define SE_16BIT(x) if (x & 0x8000) x -= 0x10000; diff --git a/src/libxinevdec/fli.c b/src/libxinevdec/fli.c index 238bc09ef..9cf7a9142 100644 --- a/src/libxinevdec/fli.c +++ b/src/libxinevdec/fli.c @@ -23,7 +23,7 @@ * avoid when implementing a FLI decoder, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: fli.c,v 1.6 2002/09/05 22:19:02 mroi Exp $ + * $Id: fli.c,v 1.7 2002/10/06 03:48:13 komadori Exp $ */ #include <stdio.h> @@ -42,9 +42,6 @@ #define PALETTE_SIZE (256 * 4) -#define LE_16(x) (le2me_16(*(uint16_t *)(x))) -#define LE_32(x) (le2me_32(*(uint32_t *)(x))) - #define FLI_256_COLOR 4 #define FLI_DELTA 7 #define FLI_COLOR 11 diff --git a/src/libxinevdec/qtrle.c b/src/libxinevdec/qtrle.c index ddc7b4081..7ffe310ab 100644 --- a/src/libxinevdec/qtrle.c +++ b/src/libxinevdec/qtrle.c @@ -21,7 +21,7 @@ * For more information on the QT RLE format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrle.c,v 1.2 2002/10/04 01:16:04 tmmm Exp $ + * $Id: qtrle.c,v 1.3 2002/10/06 03:48:13 komadori Exp $ */ #include <stdio.h> @@ -38,9 +38,6 @@ #define VIDEOBUFSIZE 128*1024 -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - typedef struct qtrle_decoder_s { video_decoder_t video_decoder; /* parent video decoder structure */ diff --git a/src/libxinevdec/qtrpza.c b/src/libxinevdec/qtrpza.c index 4ccdd2c94..293b381d4 100644 --- a/src/libxinevdec/qtrpza.c +++ b/src/libxinevdec/qtrpza.c @@ -21,7 +21,7 @@ * For more information about the RPZA format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtrpza.c,v 1.4 2002/09/05 22:19:03 mroi Exp $ + * $Id: qtrpza.c,v 1.5 2002/10/06 03:48:13 komadori Exp $ */ #include <stdio.h> @@ -38,9 +38,6 @@ #define VIDEOBUFSIZE 128*1024 -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - typedef struct qtrpza_decoder_s { video_decoder_t video_decoder; /* parent video decoder structure */ diff --git a/src/libxinevdec/qtsmc.c b/src/libxinevdec/qtsmc.c index f145642e7..0218f8013 100644 --- a/src/libxinevdec/qtsmc.c +++ b/src/libxinevdec/qtsmc.c @@ -23,7 +23,7 @@ * For more information on the SMC format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: qtsmc.c,v 1.4 2002/09/05 22:19:03 mroi Exp $ + * $Id: qtsmc.c,v 1.5 2002/10/06 03:48:13 komadori Exp $ */ #include <stdio.h> @@ -40,9 +40,6 @@ #define VIDEOBUFSIZE 128*1024 -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - #define COLORS_PER_TABLE 256 #define BYTES_PER_COLOR 4 diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index 0bb905f19..53fb638f3 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -21,7 +21,7 @@ * Actually, this decoder just converts a raw RGB image to a YUY2 map * suitable for display under xine. * - * $Id: rgb.c,v 1.7 2002/09/05 22:19:03 mroi Exp $ + * $Id: rgb.c,v 1.8 2002/10/06 03:48:13 komadori Exp $ */ #include <stdio.h> @@ -38,9 +38,6 @@ #define VIDEOBUFSIZE 128*1024 -#define LE_16(x) (le2me_16(*(uint16_t *)(x))) -#define LE_32(x) (le2me_32(*(uint32_t *)(x))) - typedef struct rgb_decoder_s { video_decoder_t video_decoder; /* parent video decoder structure */ diff --git a/src/libxinevdec/wc3video.c b/src/libxinevdec/wc3video.c index 9c943581e..413c3b7de 100644 --- a/src/libxinevdec/wc3video.c +++ b/src/libxinevdec/wc3video.c @@ -22,7 +22,7 @@ * For more information on the WC3 Movie format, visit: * http://www.pcisys.net/~melanson/codecs/ * - * $Id: wc3video.c,v 1.5 2002/09/13 03:02:18 tmmm Exp $ + * $Id: wc3video.c,v 1.6 2002/10/06 03:48:13 komadori Exp $ */ #include <stdio.h> @@ -42,11 +42,6 @@ #define WC3_WIDTH 320 #define WC3_HEIGHT 165 -#define LE_16(x) (le2me_16(*(uint16_t *)(x))) -#define LE_32(x) (le2me_32(*(uint32_t *)(x))) -#define BE_16(x) (be2me_16(*(unsigned short *)(x))) -#define BE_32(x) (be2me_32(*(unsigned int *)(x))) - typedef struct wc3video_decoder_s { video_decoder_t video_decoder; /* parent video decoder structure */ diff --git a/src/xine-engine/bswap.h b/src/xine-engine/bswap.h index 1351d0456..276dfcbf7 100644 --- a/src/xine-engine/bswap.h +++ b/src/xine-engine/bswap.h @@ -90,4 +90,38 @@ inline static unsigned long long int ByteSwap64(unsigned long long int x) #define le2me_64(x) (x) #endif +#ifdef FPM_SPARC + +/* + * Workaround for code generation bug in gcc on SPARC + */ + +#define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1]) +#define BE_32(x) ((((uint8_t*)(x))[0] << 24) | \ + (((uint8_t*)(x))[1] << 16) | \ + (((uint8_t*)(x))[2] << 8) | \ + ((uint8_t*)(x))[3]) +#define LE_16(x) ((((uint8_t*)(x))[1] << 8) | ((uint8_t*)(x))[0]) +#define LE_32(x) ((((uint8_t*)(x))[3] << 24) | \ + (((uint8_t*)(x))[2] << 16) | \ + (((uint8_t*)(x))[1] << 8) | \ + ((uint8_t*)(x))[0]) + +#else + +#define BE_16(x) (be2me_16(*(uint16_t*)(x))) +#define BE_32(x) (be2me_32(*(uint32_t*)(x))) +#define LE_16(x) (le2me_16(*(uint16_t*)(x))) +#define LE_32(x) (le2me_32(*(uint32_t*)(x))) + +#endif /* !FPM_SPARC */ + +#ifdef WORDS_BIGENDIAN +#define ME_16(x) BE_16(x) +#define ME_32(x) BE_32(x) +#else +#define ME_16(x) LE_16(x) +#define ME_32(x) LE_32(x) +#endif + #endif |