]> git.sesse.net Git - vlc/commitdiff
* all: moved Get(D/Q)WLE and Get(D/Q)WBE to include/vlc_common.h.
authorLaurent Aimar <fenrir@videolan.org>
Sun, 17 Aug 2003 23:02:52 +0000 (23:02 +0000)
committerLaurent Aimar <fenrir@videolan.org>
Sun, 17 Aug 2003 23:02:52 +0000 (23:02 +0000)
 (Well, Get(D/Q)WBE are just #define to U16/32/64_AT.

22 files changed:
include/vlc_common.h
modules/access/mms/mms.h
modules/access/mms/mmsh.c
modules/access/mms/mmsh.h
modules/access/v4l/v4l.c
modules/codec/adpcm.c
modules/codec/araw.c
modules/codec/cinepak/cinepak.c
modules/codec/faad/decoder.c
modules/codec/ffmpeg/ffmpeg.h
modules/codec/quicktime.c
modules/demux/asf/asf.c
modules/demux/asf/libasf.c
modules/demux/au.c
modules/demux/avi/avi.c
modules/demux/avi/libavi.c
modules/demux/mkv.cpp
modules/demux/mp4/libmp4.c
modules/demux/mpeg/mpga.c
modules/demux/ogg.c
modules/demux/rawdv.c
modules/demux/wav.c

index 9e9ce14f9e19ec4b0df33474dd97d2cfc5eff029..7949e5888756b79877dfa989ed60faad572c065f 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: vlc_common.h,v 1.73 2003/08/14 20:02:55 zorglub Exp $
+ * $Id: vlc_common.h,v 1.74 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -457,6 +457,32 @@ static inline uint64_t U64_AT( void * _p )
               | ((uint64_t)p[4] << 24) | ((uint64_t)p[5] << 16)
               | ((uint64_t)p[6] << 8) | p[7] );
 }
+
+static inline uint16_t GetWLE( void * _p )
+{
+    uint8_t * p = (uint8_t *)_p;
+    return ( ((uint16_t)p[1] << 8) | p[0] );
+}
+static inline uint32_t GetDWLE( void * _p )
+{
+    uint8_t * p = (uint8_t *)_p;
+    return ( ((uint32_t)p[3] << 24) | ((uint32_t)p[2] << 16)
+              | ((uint32_t)p[1] << 8) | p[0] );
+}
+static inline uint64_t GetQWLE( void * _p )
+{
+    uint8_t * p = (uint8_t *)_p;
+    return ( ((uint64_t)p[7] << 56) | ((uint64_t)p[6] << 48)
+              | ((uint64_t)p[5] << 40) | ((uint64_t)p[4] << 32)
+              | ((uint64_t)p[3] << 24) | ((uint64_t)p[2] << 16)
+              | ((uint64_t)p[1] << 8) | p[0] );
+}
+
+#define GetWBE( p )     U16_AT( p )
+#define GetDWBE( p )    U32_AT( p )
+#define GetQWBE( p )    U64_AT( p )
+
+
 #if WORDS_BIGENDIAN
 #   define hton16(i)   ( i )
 #   define hton32(i)   ( i )
index aa77f32ce9a5d0991fb28032aeb4fd17b28301c1..c0ddf8ef2b143f2b6a6fcc96392358dc7f925de9 100644 (file)
@@ -2,7 +2,7 @@
  * mms.h: MMS access plug-in
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: mms.h,v 1.9 2003/04/20 19:29:43 fenrir Exp $
+ * $Id: mms.h,v 1.10 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -35,17 +35,6 @@ void E_( MMSTUClose ) ( input_thread_t * );
 int  E_( MMSHOpen )  ( input_thread_t * );
 void E_( MMSHClose ) ( input_thread_t * );
 
-static inline uint16_t GetWLE( uint8_t *p_buff )
-{
-    return( (p_buff[0]) + ( p_buff[1] <<8 ) );
-}
-
-static inline uint32_t GetDWLE( uint8_t *p_buff )
-{
-    return( p_buff[0] + ( p_buff[1] <<8 ) +
-            ( p_buff[2] <<16 ) + ( p_buff[3] <<24 ) );
-}
-
 #define FREE( p ) if( p ) { free( p ); (p) = NULL; }
 
 /* url: [/]host[:port][/path][@username[:password]] */
index a4c4dafdefac384b1959a048046de97fad796fd6..9bec4f536d0ccabbbcecb62866f91d33e9744d3f 100644 (file)
@@ -2,7 +2,7 @@
  * mmsh.c:
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: mmsh.c,v 1.4 2003/07/31 23:44:49 fenrir Exp $
+ * $Id: mmsh.c,v 1.5 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -974,6 +974,7 @@ static http_field_t *http_field_find( http_field_t *p_field, char *psz_name )
 
     return NULL;
 }
+#if 0
 static char *http_field_get_value( http_answer_t *ans, char *psz_name )
 {
     http_field_t  *p_field = ans->p_fields;
@@ -990,7 +991,7 @@ static char *http_field_get_value( http_answer_t *ans, char *psz_name )
 
     return NULL;
 }
-
+#endif
 
 
 static int chunk_parse( chunk_t *ck, uint8_t *p_data, int i_data )
index 452d3aa6b245b9e732e0749a6487897b54f11e1e..dd1e0b0047c0842f255ff043ad36b62fad673ff9 100644 (file)
@@ -2,7 +2,7 @@
  * mmsh.h:
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: mmsh.h,v 1.2 2003/05/06 02:01:35 fenrir Exp $
+ * $Id: mmsh.h,v 1.3 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -100,7 +100,7 @@ typedef struct
 
 static http_answer_t    *http_answer_parse  ( uint8_t *, int );
 static void              http_answer_free   ( http_answer_t * );
-static char             *http_field_get_value   ( http_answer_t *, char * );
+/* static char             *http_field_get_value   ( http_answer_t *, char * ); */
 static http_field_t     *http_field_find    ( http_field_t *, char * );
 
 static int  mmsh_start( input_thread_t *, access_sys_t *, off_t );
index 2d1a462fa45c57bf0f7963e2a7943824f94049e8..16c95d90bd8fcc7172178267f1792e7fc2767698 100644 (file)
@@ -2,7 +2,7 @@
  * v4l.c : Video4Linux input module for vlc
  *****************************************************************************
  * Copyright (C) 2002 VideoLAN
- * $Id: v4l.c,v 1.19 2003/07/24 22:05:16 sam Exp $
+ * $Id: v4l.c,v 1.20 2003/08/17 23:02:51 fenrir Exp $
  *
  * Author: Laurent Aimar <fenrir@via.ecp.fr>
  *         Paul Forgey <paulf at aphrodite dot com>
@@ -197,16 +197,6 @@ static void    SetQWBE( uint8_t *p, uint64_t qw )
     SetDWBE( &p[4], qw&0xffffffff);
 }
 
-static uint32_t GetDWBE( uint8_t *p_buff )
-{
-    return( ( p_buff[0] << 24 ) + ( p_buff[1] << 16 ) +
-            ( p_buff[2] <<  8 ) + p_buff[3] );
-}
-static uint64_t GetQWBE( uint8_t *p )
-{
-    return( ( (uint64_t)GetDWBE( p ) << 32) | (uint64_t)GetDWBE( &p[4] ) );
-}
-
 /*****************************************************************************
  * Open: open device:
  *****************************************************************************
index 63e905259a1253cc7fb24af3b231d07c4d69d13b..16e092b089c644eab205842d1464487002d1b06e 100644 (file)
@@ -2,7 +2,7 @@
  * adpcm.c : adpcm variant audio decoder
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: adpcm.c,v 1.11 2003/05/22 20:56:07 hartman Exp $
+ * $Id: adpcm.c,v 1.12 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -216,12 +216,6 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
 
 
 #define FREE( p ) if( p ) free( p ); p = NULL
-#define GetWLE( p ) \
-    ( *(uint8_t*)(p) + ( *((uint8_t*)(p)+1) << 8 ) )
-
-#define GetDWLE( p ) \
-    (  *(uint8_t*)(p) + ( *((uint8_t*)(p)+1) << 8 ) + \
-        ( *((uint8_t*)(p)+2) << 16 ) + ( *((uint8_t*)(p)+3) << 24 ) )
 
 /*****************************************************************************
  * InitThread: initialize data before entering main loop
index 0150effe286f02baf870c5cb821dab3a585dd4b0..d6a3d7227e05e01543cce4977bd07b1341c7c0ff 100644 (file)
@@ -2,7 +2,7 @@
  * araw.c: Pseudo audio decoder; for raw pcm data
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: araw.c,v 1.15 2003/05/17 20:30:31 gbazin Exp $
+ * $Id: araw.c,v 1.16 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -228,13 +228,6 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
 
 
 #define FREE( p ) if( p ) free( p ); p = NULL
-#define GetWLE( p ) \
-    ( *(u8*)(p) + ( *((u8*)(p)+1) << 8 ) )
-
-#define GetDWLE( p ) \
-    (  *(u8*)(p) + ( *((u8*)(p)+1) << 8 ) + \
-        ( *((u8*)(p)+2) << 16 ) + ( *((u8*)(p)+3) << 24 ) )
-
 
 /*****************************************************************************
  * InitThread: initialize data before entering main loop
index b3c711818776d43298219e6824aa2ac0832ae7ea..6fb5a8cc4ff8803606ec8acddbe962398e42470b 100644 (file)
@@ -2,7 +2,7 @@
  * cinepak.c: cinepak video decoder 
  *****************************************************************************
  * Copyright (C) 1999-2001 VideoLAN
- * $Id: cinepak.c,v 1.10 2003/02/27 13:19:44 gbazin Exp $
+ * $Id: cinepak.c,v 1.11 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -132,17 +132,6 @@ static int RunDecoder( decoder_fifo_t *p_fifo )
  * locales Functions
  *****************************************************************************/
 
-static inline u16 GetWBE( u8 *p_buff )
-{
-    return( (p_buff[0]<<8) + p_buff[1] );
-}
-
-static inline u32 GetDWBE( u8 *p_buff )
-{
-    return( (p_buff[0] << 24) + ( p_buff[1] <<16 ) +
-            ( p_buff[2] <<8 ) + p_buff[3] );
-}
-
 #define GET2BYTES( p ) \
     GetWBE( p ); p+= 2;
 /* FIXME */
index 81716739cb0316960c96fd7e3de9877202042e92..249a1f6478bd5c12a7c3e97f4b2d2270607828bc 100644 (file)
@@ -2,7 +2,7 @@
  * decoder.c: AAC decoder using libfaad2
  *****************************************************************************
  * Copyright (C) 2001, 2002 VideoLAN
- * $Id: decoder.c,v 1.25 2003/06/22 08:49:11 fenrir Exp $
+ * $Id: decoder.c,v 1.26 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -134,13 +134,6 @@ static unsigned int pi_channels_maps[7] =
 };
 
 #define FREE( p ) if( p != NULL ) free( p ); p = NULL
-#define GetWLE( p ) \
-    ( *(uint8_t*)(p) + ( *((uint8_t*)(p)+1) << 8 ) )
-
-#define GetDWLE( p ) \
-    (  *(uint8_t*)(p) + ( *((uint8_t*)(p)+1) << 8 ) + \
-        ( *((uint8_t*)(p)+2) << 16 ) + ( *((uint8_t*)(p)+3) << 24 ) )
-
 
 static void GetPESData( uint8_t *p_buf, int i_max, pes_packet_t *p_pes )
 {
index 570addb9702415eabfb2c892824bcb02bd5088b9..da1a9de22f444d4bfc993384263463b405f78a23 100644 (file)
@@ -2,7 +2,7 @@
  * ffmpeg_vdec.h: video decoder using ffmpeg library
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ffmpeg.h,v 1.23 2003/08/15 13:16:38 fenrir Exp $
+ * $Id: ffmpeg.h,v 1.24 2003/08/17 23:02:52 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  * 
@@ -55,13 +55,6 @@ typedef struct generic_thread_s
 #   undef  LIBAVCODEC_PP
 #endif
 
-#define GetWLE( p ) \
-    ( *(u8*)(p) + ( *((u8*)(p)+1) << 8 ) )
-
-#define GetDWLE( p ) \
-    (  *(u8*)(p) + ( *((u8*)(p)+1) << 8 ) + \
-     ( *((u8*)(p)+2) << 16 ) + ( *((u8*)(p)+3) << 24 ) )
-
 #define FREE( p ) if( p ) free( p ); p = NULL
 
 int E_( GetPESData )( u8 *p_buf, int i_max, pes_packet_t *p_pes );
index 33ab11da2fad362387f9ce5eab6ec02591c4f441..d1d6d52e4b7278848661117225ccaed58c9b43e9 100644 (file)
@@ -2,7 +2,7 @@
  * quicktime.c: a quicktime decoder that uses the QT library/dll
  *****************************************************************************
  * Copyright (C) 2003 VideoLAN
- * $Id: quicktime.c,v 1.10 2003/08/01 20:06:43 gbazin Exp $
+ * $Id: quicktime.c,v 1.11 2003/08/17 23:02:51 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir at via.ecp.fr>
  *          Derk-Jan Hartman <thedj at users.sf.net>
@@ -231,18 +231,6 @@ static int pi_channels_maps[6] =
 };
 
 
-static uint16_t GetWBE( uint8_t *p_buff )
-{
-    return( (p_buff[0]<<8) + p_buff[1] );
-}
-
-static uint32_t GetDWBE( uint8_t *p_buff )
-{
-    return( (p_buff[0] << 24) + ( p_buff[1] <<16 ) +
-            ( p_buff[2] <<8 ) + p_buff[3] );
-}
-
-
 static int GetPESData( uint8_t *p_buf, int i_max, pes_packet_t *p_pes )
 {
     int i_copy;
index f9a554e7186a09af8e9649c84f826611df86d77f..f62a18d09107aa172d1f744a88530e9dae39c0ae 100644 (file)
@@ -2,7 +2,7 @@
  * asf.c : ASFv01 file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: asf.c,v 1.30 2003/08/01 00:16:37 fenrir Exp $
+ * $Id: asf.c,v 1.31 2003/08/17 23:02:52 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -51,16 +51,6 @@ vlc_module_begin();
     add_shortcut( "asf" );
 vlc_module_end();
 
-static uint16_t GetWLE( uint8_t *p_buff )
-{
-    return( (p_buff[0]) + ( p_buff[1] <<8 ) );
-}
-static uint32_t GetDWLE( uint8_t *p_buff )
-{
-    return( p_buff[0] + ( p_buff[1] <<8 ) +
-            ( p_buff[2] <<16 ) + ( p_buff[3] <<24 ) );
-}
-
 /*****************************************************************************
  * Activate: check file and initializes ASF structures
  *****************************************************************************/
index 84b0de16e42d06a2cba5753634b2e024dfc03b59..59528d680217ab0c9a1863dd22d60ca0d2f46486 100644 (file)
@@ -2,7 +2,7 @@
  * libasf.c :
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libasf.c,v 1.12 2003/03/14 00:24:08 sigmunau Exp $
+ * $Id: libasf.c,v 1.13 2003/08/17 23:02:52 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
     (guid).v4[0],(guid).v4[1],(guid).v4[2],(guid).v4[3],    \
     (guid).v4[4],(guid).v4[5],(guid).v4[6],(guid).v4[7]
 
-/* Some functions to manipulate memory */
-static uint16_t GetWLE( uint8_t *p_buff )
-{
-    return( (p_buff[0]) + ( p_buff[1] <<8 ) );
-}
-
-static uint32_t GetDWLE( uint8_t *p_buff )
-{
-    return( p_buff[0] + ( p_buff[1] <<8 ) +
-            ( p_buff[2] <<16 ) + ( p_buff[3] <<24 ) );
-}
-
-static uint64_t GetQWLE( uint8_t *p_buff )
-{
-    return( ( (uint64_t)GetDWLE( p_buff ) )|
-            ( (uint64_t)GetDWLE( p_buff + 4 ) << 32) );
-}
-
 void GetGUID( guid_t *p_guid, uint8_t *p_data )
 {
     p_guid->v1 = GetDWLE( p_data );
index 0e749b9ca389070f4ea87235296e20eec3ece7fd..483b0faa5b715721bc9747c78474db0da493df85 100644 (file)
@@ -2,7 +2,7 @@
  * au.c : au file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001-2003 VideoLAN
- * $Id: au.c,v 1.3 2003/08/01 00:05:57 fenrir Exp $
+ * $Id: au.c,v 1.4 2003/08/17 23:02:52 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -55,12 +55,6 @@ vlc_module_end();
 static int    DemuxPCM   ( input_thread_t * );
 /* TODO static int    DemuxADPCM   ( input_thread_t * ); */
 
-#define GetDWBE( p ) __GetDWBE( (uint8_t*)(p) )
-static inline uint32_t __GetDWBE( uint8_t *p )
-{
-    return( ( p[0] << 24 ) + ( p[1] << 16 ) + ( p[2] << 8 ) + p[3] );
-}
-
 enum AuType_e
 {
     AU_UNKNOWN      =  0,
index e13f696732eac280ad504dd13947e079ce67450a..e6f0d5d54b9b11a207134e372e29136dbe13ac83 100644 (file)
@@ -2,7 +2,7 @@
  * avi.c : AVI file Stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: avi.c,v 1.53 2003/07/20 12:34:36 sigmunau Exp $
+ * $Id: avi.c,v 1.54 2003/08/17 23:02:52 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -70,26 +70,6 @@ vlc_module_begin();
     set_callbacks( AVIInit, __AVIEnd );
 vlc_module_end();
 
-/*****************************************************************************
- * Some useful functions to manipulate memory
- *****************************************************************************/
-
-static uint16_t GetWLE( uint8_t *p_buff )
-{
-    return (uint16_t)p_buff[0] | ( ((uint16_t)p_buff[1]) << 8 );
-}
-
-static uint32_t GetDWLE( uint8_t *p_buff )
-{
-    return (uint32_t)p_buff[0] | ( ((uint32_t)p_buff[1]) << 8 ) |
-            ( ((uint32_t)p_buff[2]) << 16 ) | ( ((uint32_t)p_buff[3]) << 24 );
-}
-
-static uint32_t GetDWBE( uint8_t *p_buff )
-{
-    return (uint32_t)p_buff[3] | ( ((uint32_t)p_buff[2]) << 8 ) |
-            ( ((uint32_t)p_buff[1]) << 16 ) | ( ((uint32_t)p_buff[0]) << 24 );
-}
 static vlc_fourcc_t GetFOURCC( byte_t *p_buff )
 {
     return VLC_FOURCC( p_buff[0], p_buff[1], p_buff[2], p_buff[3] );
index 8d4392961a5f13c432fc04ee6d38ddf85f6a1890..2cb0a2aefbef260a72d6b40fd1f6a64b49d5028d 100644 (file)
@@ -2,7 +2,7 @@
  * libavi.c :
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libavi.c,v 1.21 2003/08/01 00:05:07 gbazin Exp $
+ * $Id: libavi.c,v 1.22 2003/08/17 23:02:52 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
 
 #define __EVEN( x ) ( (x)&0x01 ? (x)+1 : (x) )
 
-/* Some functions to manipulate memory */
-static uint16_t GetWLE( uint8_t *p_buff )
-{
-    return (uint16_t)p_buff[0] | ( ((uint16_t)p_buff[1]) << 8 );
-}
-
-static uint32_t GetDWLE( uint8_t *p_buff )
-{
-    return (uint32_t)p_buff[0] | ( ((uint32_t)p_buff[1]) << 8 ) |
-            ( ((uint32_t)p_buff[2]) << 16 ) | ( ((uint32_t)p_buff[3]) << 24 );
-}
-
-static uint64_t GetQWLE( uint8_t *p )
-{
-    return    (uint64_t)p[0]          | ( ((uint64_t)p[1]) << 8  ) |
-           ( ((uint64_t)p[2]) << 16 ) | ( ((uint64_t)p[3]) << 24 ) |
-           ( ((uint64_t)p[4]) << 32 ) | ( ((uint64_t)p[5]) << 40 ) |
-           ( ((uint64_t)p[6]) << 48 ) | ( ((uint64_t)p[7]) << 56 );
-}
-
 static vlc_fourcc_t GetFOURCC( byte_t *p_buff )
 {
     return VLC_FOURCC( p_buff[0], p_buff[1], p_buff[2], p_buff[3] );
index 6e287974334ed93d659551b8377185b7bfe68cf9..6f70c77061686acb296f4eae3677ca49f24f2ec0 100644 (file)
@@ -2,7 +2,7 @@
  * mkv.cpp : matroska demuxer
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mkv.cpp,v 1.20 2003/08/12 08:19:20 sam Exp $
+ * $Id: mkv.cpp,v 1.21 2003/08/17 23:02:52 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -158,18 +158,7 @@ class EbmlParser
 /*****************************************************************************
  * Some functions to manipulate memory
  *****************************************************************************/
-#define GetWLE( p )     __GetWLE( (uint8_t*)p )
-#define GetDWLE( p )    __GetDWLE( (uint8_t*)p )
 #define GetFOURCC( p )  __GetFOURCC( (uint8_t*)p )
-static uint16_t __GetWLE( uint8_t *p )
-{
-    return (uint16_t)p[0] | ( ((uint16_t)p[1]) << 8 );
-}
-static uint32_t __GetDWLE( uint8_t *p )
-{
-    return (uint32_t)p[0] | ( ((uint32_t)p[1]) << 8 ) |
-            ( ((uint32_t)p[2]) << 16 ) | ( ((uint32_t)p[3]) << 24 );
-}
 static vlc_fourcc_t __GetFOURCC( uint8_t *p )
 {
     return VLC_FOURCC( p[0], p[1], p[2], p[3] );
index 0dee89ea341cf0544c2b5bd68c824ae249d89b89..ef27fc289de6305273955d5e8c67d696edb3f7b2 100644 (file)
@@ -2,7 +2,7 @@
  * libmp4.c : LibMP4 library for mp4 module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: libmp4.c,v 1.30 2003/08/17 20:45:50 fenrir Exp $
+ * $Id: libmp4.c,v 1.31 2003/08/17 23:02:52 fenrir Exp $
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
 
 */
 
-/* Some functions to manipulate memory */
-static uint16_t GetWLE( uint8_t *p_buff )
-{
-    return( (p_buff[0]) + ( p_buff[1] <<8 ) );
-}
-
-static uint32_t GetDWLE( uint8_t *p_buff )
-{
-    return( p_buff[0] + ( p_buff[1] <<8 ) +
-            ( p_buff[2] <<16 ) + ( p_buff[3] <<24 ) );
-}
-
-static uint16_t GetWBE( uint8_t *p_buff )
-{
-    return( (p_buff[0]<<8) + p_buff[1] );
-}
-
 static uint32_t Get24bBE( uint8_t *p_buff )
 {
     return( ( p_buff[0] <<16 ) + ( p_buff[1] <<8 ) + p_buff[2] );
 }
 
-
-static uint32_t GetDWBE( uint8_t *p_buff )
-{
-    return( (p_buff[0] << 24) + ( p_buff[1] <<16 ) +
-            ( p_buff[2] <<8 ) + p_buff[3] );
-}
-
-static uint64_t GetQWBE( uint8_t *p_buff )
-{
-    return( ( (uint64_t)GetDWBE( p_buff ) << 32 )|( (uint64_t)GetDWBE( p_buff + 4 ) ) );
-}
-
-
 static void GetUUID( UUID_t *p_uuid, uint8_t *p_buff )
 {
     memcpy( p_uuid,
index 6e47fa059a2344b0b4f5a05c4be8b4506773f680..a0f1577defcbb3641261cf70f9f40d710da4f74f 100644 (file)
@@ -2,7 +2,7 @@
  * mpga.c : MPEG-I/II Audio input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: mpga.c,v 1.1 2003/08/01 00:37:06 fenrir Exp $
+ * $Id: mpga.c,v 1.2 2003/08/17 23:02:52 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -64,12 +64,6 @@ struct demux_sys_t
     es_descriptor_t *p_es;
 };
 
-
-static inline uint32_t GetDWBE( uint8_t *p )
-{
-    return( ( p[0] << 24 )|( p[1] << 16 )|( p[2] <<  8 )|( p[3] ) );
-}
-
 static int HeaderCheck( uint32_t h )
 {
     if( ((( h >> 20 )&0x0FFF) != 0x0FFF )  /* header sync */
index f798316fa5c58abf19219e627442391d1a0c0d89..dcfbf662f2fd0061c893d191f14c5df61b47da7f 100644 (file)
@@ -2,7 +2,7 @@
  * ogg.c : ogg stream input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: ogg.c,v 1.30 2003/08/09 19:49:13 gbazin Exp $
+ * $Id: ogg.c,v 1.31 2003/08/17 23:02:52 fenrir Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  * 
@@ -145,22 +145,6 @@ typedef struct stream_header
 #define PACKET_LEN_BITS2     0x02
 #define PACKET_IS_SYNCPOINT  0x08
 
-/* Some functions to manipulate memory */
-static uint16_t GetWLE( uint8_t *p_buff )
-{
-    return( (p_buff[0]) + ( p_buff[1] <<8 ) );
-}
-
-static uint32_t GetDWLE( uint8_t *p_buff )
-{
-    return( p_buff[0] + ( p_buff[1] <<8 ) +
-            ( p_buff[2] <<16 ) + ( p_buff[3] <<24 ) );
-}
-
-static uint64_t GetQWLE( uint8_t *p_buff )
-{
-    return( GetDWLE( p_buff ) + ( ((uint64_t)GetDWLE( p_buff + 4 )) << 32 ) );
-}
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
@@ -883,13 +867,13 @@ static int Ogg_FindLogicalStreams( input_thread_t *p_input, demux_sys_t *p_ogg)
                                  (char *)&p_stream->i_fourcc );
 
                         p_stream->f_rate = 10000000.0 /
-                            GetQWLE((uint8_t *)&st->time_unit);
+                            GetQWLE(&st->time_unit);
                         p_stream->p_bih->biBitCount =
-                            GetWLE((uint8_t *)&st->bits_per_sample);
+                            GetWLE(&st->bits_per_sample);
                         p_stream->p_bih->biWidth =
-                            GetDWLE((uint8_t *)&st->sh.video.width);
+                            GetDWLE(&st->sh.video.width);
                         p_stream->p_bih->biHeight =
-                            GetDWLE((uint8_t *)&st->sh.video.height);
+                            GetDWLE(&st->sh.video.height);
                         p_stream->p_bih->biPlanes= 1 ;
                         p_stream->p_bih->biSizeImage =
                             (p_stream->p_bih->biBitCount >> 3) *
@@ -945,16 +929,16 @@ static int Ogg_FindLogicalStreams( input_thread_t *p_input, demux_sys_t *p_ogg)
                         p_buffer[4] = '\0';
                         p_stream->p_wf->wFormatTag = strtol(p_buffer,NULL,16);
                         p_stream->p_wf->nChannels =
-                            GetWLE((uint8_t *)&st->sh.audio.channels);
+                            GetWLE(&st->sh.audio.channels);
                         p_stream->f_rate = p_stream->p_wf->nSamplesPerSec =
-                            GetQWLE((uint8_t *)&st->samples_per_unit);
+                            GetQWLE(&st->samples_per_unit);
                         p_stream->i_bitrate = p_stream->p_wf->nAvgBytesPerSec =
-                            GetDWLE((uint8_t *)&st->sh.audio.avgbytespersec);
+                            GetDWLE(&st->sh.audio.avgbytespersec);
                         p_stream->i_bitrate *= 8;
                         p_stream->p_wf->nBlockAlign =
-                            GetWLE((uint8_t *)&st->sh.audio.blockalign);
+                            GetWLE(&st->sh.audio.blockalign);
                         p_stream->p_wf->wBitsPerSample =
-                            GetWLE((uint8_t *)&st->bits_per_sample);
+                            GetWLE(&st->bits_per_sample);
                         p_stream->p_wf->cbSize = 0;
 
                         switch( p_stream->p_wf->wFormatTag )
index f8350e1cf82bcae0b65bbdf7f4a006152eb39c66..b4e122e9c8fbfffd7bbb1bb8a955272b802428f3 100644 (file)
@@ -2,7 +2,7 @@
  * rawdv.c : raw dv input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: rawdv.c,v 1.8 2003/05/05 22:23:34 gbazin Exp $
+ * $Id: rawdv.c,v 1.9 2003/08/17 23:02:52 fenrir Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -102,12 +102,6 @@ static int  Activate  ( vlc_object_t * );
 static void Deactivate( vlc_object_t * );
 static int  Demux     ( input_thread_t * );
 
-static uint32_t GetDWBE( uint8_t *p_buff )
-{
-    return (uint32_t)p_buff[3] | ( ((uint32_t)p_buff[2]) << 8 ) |
-            ( ((uint32_t)p_buff[1]) << 16 ) | ( ((uint32_t)p_buff[0]) << 24 );
-}
-
 /*****************************************************************************
  * Module descriptor
  *****************************************************************************/
index 3f5a931235d3706e06b5227a8f4487b4e0cd789f..421f12227614e2b1ff3f3e98d28299a924d64d12 100644 (file)
@@ -2,7 +2,7 @@
  * wav.c : wav file input module for vlc
  *****************************************************************************
  * Copyright (C) 2001 VideoLAN
- * $Id: wav.c,v 1.2 2003/08/01 00:40:05 fenrir Exp $
+ * $Id: wav.c,v 1.3 2003/08/17 23:02:52 fenrir Exp $
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
  *
@@ -72,17 +72,6 @@ struct demux_sys_t
  *****************************************************************************/
 #define __EVEN( x ) ( ( (x)%2 != 0 ) ? ((x)+1) : (x) )
 
-#define GetWLE( p ) __GetWLE( (uint8_t*)(p) )
-static inline uint32_t __GetWLE( uint8_t *p )
-{
-    return( p[0] + ( p[1] << 8 ) );
-}
-#define GetDWLE( p ) __GetDWLE( (uint8_t*)(p) )
-static inline uint32_t __GetDWLE( uint8_t *p )
-{
-    return( p[0] + ( p[1] << 8 ) + ( p[2] << 16 ) + ( p[3] << 24 ) );
-}
-
 static int ChunkFind( input_thread_t *, char *, unsigned int * );
 
 static void FrameInfo_IMA_ADPCM( input_thread_t *, unsigned int *, mtime_t * );