1 /** ==================================================================
4 * @path $(codecs_dev)\WMA_Decoder\AlgSource\GoldenC\Include\configurable\WMA_specific
6 * @desc This File contains macros for loading bitstream data.
8 * =====================================================================
9 * Copyright (c) Texas Instruments Inc 2007
11 * Use of this software is controlled by the terms and conditions found
12 * in the license agreement under which this software has been supplied
13 =====================================================================*/
16 //*@@@+++@@@@******************************************************************
18 // Microsoft Windows Media
19 // Copyright (C) Microsoft Corporation. All rights reserved.
21 //*@@@---@@@@******************************************************************
22 //+-------------------------------------------------------------------------
24 // Microsoft Windows Media
26 // Copyright (C) Microsoft Corporation, 1999 - 1999
30 //--------------------------------------------------------------------------
35 /**** Robustness: START OF BLOCK ****/
42 /****************************************************************************/
46 #endif /* _BOOL_DEFINED */
50 typedef unsigned char U8;
51 #endif /* _U8_DEFINED */
55 typedef unsigned short WORD;
56 #endif /* _WORD_DEFINED */
58 #ifndef _DWORD_DEFINED
59 #define _DWORD_DEFINED
60 typedef unsigned int DWORD;
61 #endif /* _DWORD_DEFINED */
63 #ifndef _QWORD_DEFINED
64 #define _QWORD_DEFINED
65 typedef PACKED struct tQWORD
71 #endif /* _QWORD_DEFINED */
75 typedef struct { // size is 16
82 #endif // !GUID_DEFINED
83 #define WAVE_FORMAT_WMAUDIO3 0x0162
84 #define WAVE_FORMAT_WMAUDIO2 0x0161
85 #define WAVE_FORMAT_MSAUDIO1 0x0160
86 #define WAVE_FORMAT_WMAUDIO_LOSSLESS 0x0163
94 #define GetUnalignedWord( pb, w ) (w) = (WORD)(*pb) + ((WORD) *(pb+1) << 8);
96 #define GetUnalignedWord( pb, w ) (w) = *(UNALIGNED WORD*)(pb);
100 #define GetUnalignedDword( pb, dw ) (dw) = (DWORD) *pb + ((DWORD) *(pb+1) <<8) \
101 + ((DWORD) *(pb+2) <<16) \
102 + ((DWORD) *(pb+3) <<24);
104 #define GetUnalignedDword( pb, dw ) (dw) = *(UNALIGNED DWORD*)(pb);
108 #define GetUnalignedQword( pb, qw ) \
109 GetUnalignedDword( pb, (qw).dwLo ); \
110 GetUnalignedDword( (pb + 4), (qw).dwHi );
112 #define GetUnalignedQword( pb, qw ) (qw) = *(UNALIGNED QWORD*)(pb);
115 #define GetUnalignedDouble( pb, d ) (d) = *(UNALIGNED Double*)(pb);
119 #define GetUnalignedWord( pb, w ) \
120 (w) = ((WORD) *(pb + 1) << 8) + *pb;
122 #define GetUnalignedDword( pb, dw ) \
123 (dw) = ((DWORD) *(pb + 3) << 24) + \
124 ((DWORD) *(pb + 2) << 16) + \
125 ((DWORD) *(pb + 1) << 8) + *pb;
127 #define GetUnalignedQword( pb, qw ) \
128 GetUnalignedDword( pb, (qw).dwLo ); \
129 GetUnalignedDword( (pb + 4), (qw).dwHi );
131 #define GetUnalignedDouble( pb, d ) (d) = *(UNALIGNED Double*)(pb);
135 #define GetUnalignedWordEx( pb, w ) GetUnalignedWord( pb, w ); (pb) += sizeof(WORD);
136 #define GetUnalignedDwordEx( pb, dw ) GetUnalignedDword( pb, dw ); (pb) += sizeof(DWORD);
137 #define GetUnalignedQwordEx( pb, qw ) GetUnalignedQword( pb, qw ); (pb) += sizeof(QWORD);
138 #define GetUnalignedDoubleEx( pb, d ) GetUnalignedDouble( pb, d ); (pb) += sizeof(Double);
140 #define LoadBYTE( b, p ) b = *(U8 *)(p); (p) += sizeof( U8 )
142 #define LoadWORD( w, p ) GetUnalignedWordEx( p, w )
143 #define LoadDWORD( dw, p ) GetUnalignedDwordEx( p, dw )
144 #define LoadQWORD( qw, p ) GetUnalignedQwordEx( p, qw )
146 #define LoadGUID( g, p ) \
148 LoadDWORD( (g).Data1, p ); \
149 LoadWORD( (g).Data2, p ); \
150 LoadWORD( (g).Data3, p ); \
151 LoadBYTE( (g).Data4[0], p ); \
152 LoadBYTE( (g).Data4[1], p ); \
153 LoadBYTE( (g).Data4[2], p ); \
154 LoadBYTE( (g).Data4[3], p ); \
155 LoadBYTE( (g).Data4[4], p ); \
156 LoadBYTE( (g).Data4[5], p ); \
157 LoadBYTE( (g).Data4[6], p ); \
158 LoadBYTE( (g).Data4[7], p ); \
161 #endif // LOADSTUFF_H