]> git.sesse.net Git - vlc/blob - plugins/avi/libLE.c
4eccfdfe53cb46aecdcf7c4f66acc297d42e5d6b
[vlc] / plugins / avi / libLE.c
1 /*****************************************************************************
2  * avi_file.c : AVI file Stream input module for vlc
3  *****************************************************************************
4  * Copyright (C) 2001 VideoLAN
5  * $Id: libLE.c,v 1.1 2002/04/23 23:44:36 fenrir Exp $
6  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
7  * 
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  * 
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
21  *****************************************************************************/
22
23 /*
24  * Data reading functions
25  */
26
27 static u16 __GetWordLittleEndianFromBuff( byte_t *p_buff )
28 {
29     u16 i;
30     i = (*p_buff) + ( *(p_buff + 1) <<8 );
31     return ( i );
32 }
33
34 static u32 __GetDoubleWordLittleEndianFromBuff( byte_t *p_buff )
35 {
36     u32 i;
37     i = (*p_buff) + ( *(p_buff + 1) <<8 ) + ( *(p_buff + 2) <<16 ) + ( *(p_buff + 3) <<24 );
38     return ( i );
39 }
40
41 static void __SetWordLittleEndianToBuff( byte_t *p_buff, u16 i)
42 {
43     *(p_buff)     = (i & 0xFF);
44     *(p_buff + 1) = ( ( i >>8 ) & 0xFF);
45     return;
46 }
47
48 static void __SetDoubleWordLittleEndianToBuff( byte_t *p_buff, u32 i)
49 {
50     *(p_buff)     = ( i & 0xFF );
51     *(p_buff + 1) = (( i >>8 ) & 0xFF);
52     *(p_buff + 2) = (( i >>16 ) & 0xFF);
53     *(p_buff + 3) = (( i >>24 ) & 0xFF);
54     return;
55 }
56
57