comparison common.h @ 1398:d413f9a20214 libavcodec

endian-conscious fix, courtesy of Sebastian Jedruszkiewicz <elf -at- frogger.rules.pl>
author tmmm
date Fri, 08 Aug 2003 00:12:18 +0000
parents 018ebc066952
children f5a107782a66
comparison
equal deleted inserted replaced
1397:2e43c9bdc982 1398:d413f9a20214
1043 /** 1043 /**
1044 * converts fourcc string to int 1044 * converts fourcc string to int
1045 */ 1045 */
1046 static inline int ff_get_fourcc(const char *s){ 1046 static inline int ff_get_fourcc(const char *s){
1047 assert( strlen(s)==4 ); 1047 assert( strlen(s)==4 );
1048 1048 #ifndef WORDS_BIGENDIAN
1049 return (s[0]) + (s[1]<<8) + (s[2]<<16) + (s[3]<<24); 1049 return (s[0]) + (s[1]<<8) + (s[2]<<16) + (s[3]<<24);
1050 #else
1051 return (s[3]) + (s[2]<<8) + (s[1]<<16) + (s[0]<<24);
1052 #endif
1050 } 1053 }
1051 1054
1052 #define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24)) 1055 #define MKTAG(a,b,c,d) (a | (b << 8) | (c << 16) | (d << 24))
1053 #define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24)) 1056 #define MKBETAG(a,b,c,d) (d | (c << 8) | (b << 16) | (a << 24))
1054 1057