author | mickeyl <mickeyl> | 2003-04-18 00:37:32 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-04-18 00:37:32 (UTC) |
commit | 81776eb70dcad6748b8494ff13fbd048c60c1fae (patch) (unidiff) | |
tree | 9bb13dc582ccfd79e934ee30f6b647046b7a35c3 /noncore/multimedia/camera/jpegtoavi/byteswap.h | |
parent | 39c72eb2d35aecb3a057b347df5231d1dbfdd37c (diff) | |
download | opie-81776eb70dcad6748b8494ff13fbd048c60c1fae.zip opie-81776eb70dcad6748b8494ff13fbd048c60c1fae.tar.gz opie-81776eb70dcad6748b8494ff13fbd048c60c1fae.tar.bz2 |
add jpeg2avi for postprocessing a series of jpeg frames into an avi
Diffstat (limited to 'noncore/multimedia/camera/jpegtoavi/byteswap.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/camera/jpegtoavi/byteswap.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/noncore/multimedia/camera/jpegtoavi/byteswap.h b/noncore/multimedia/camera/jpegtoavi/byteswap.h new file mode 100644 index 0000000..17ab6cc --- a/dev/null +++ b/noncore/multimedia/camera/jpegtoavi/byteswap.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef _BYTESWAP_H_ | ||
2 | #define _BYTESWAP_H_ | ||
3 | |||
4 | #include <endian.h> | ||
5 | #include <sys/types.h> | ||
6 | |||
7 | #ifndef BYTE_ORDER | ||
8 | # error "Aiee: BYTE_ORDER not defined\n"; | ||
9 | #endif | ||
10 | |||
11 | #define SWAP2(x) (((x>>8) & 0x00ff) |\ | ||
12 | ((x<<8) & 0xff00)) | ||
13 | |||
14 | #define SWAP4(x) (((x>>24) & 0x000000ff) |\ | ||
15 | ((x>>8) & 0x0000ff00) |\ | ||
16 | ((x<<8) & 0x00ff0000) |\ | ||
17 | ((x<<24) & 0xff000000)) | ||
18 | |||
19 | #if BYTE_ORDER==BIG_ENDIAN | ||
20 | # define LILEND2(a) SWAP2((a)) | ||
21 | # define LILEND4(a) SWAP4((a)) | ||
22 | # define BIGEND2(a) (a) | ||
23 | # define BIGEND4(a) (a) | ||
24 | #else | ||
25 | # define LILEND2(a) (a) | ||
26 | # define LILEND4(a) (a) | ||
27 | # define BIGEND2(a) SWAP2((a)) | ||
28 | # define BIGEND4(a) SWAP4((a)) | ||
29 | #endif | ||
30 | |||
31 | #endif | ||