00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00047
00048 #if !defined MPEGDATA_H
00049 #define MPEGDATA_H
00050
00051 #include "datatype.h"
00052
00053
00054
00055 const BYTE MAX_STREAM_NUM=51;
00056 const BYTE MAX_VIDEOCH_NUM=16;
00057 const BYTE MAX_AUDIOCH_NUM=32;
00058 const BYTE MAX_PADCH_NUM=1;
00059 const BYTE MAX_PRIVATECH_NUM=2;
00060 const BYTE MAX_RESERVECH_NUM=17;
00061
00062 const BYTE MAX_LAYER_NUM=2;
00063 enum LAYERTYPE {BASELAYER, ENHANLAYER};
00064
00065 enum VIDEOCHNUM {VIDEOCH0,VIDEOCH1,VIDEOCH2,VIDEOCH3,VIDEOCH4,VIDEOCH5,VIDEOCH6,
00066 VIDEOCH7,VIDEOCH8,VIDEOCH9,VIDEOCH10,VIDEOCH11,VIDEOCH12,
00067 VIDEOCH13,VIDEOCH14,VIDEOCH15};
00068 const BYTE VIDEO_STREAM_ID[16]= {0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
00069 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed,
00070 0xee, 0xef};
00071 enum AUDIOCHNUM {AUDIOCH0,AUDIOCH1,AUDIOCH2,AUDIOCH3,AUDIOCH4,AUDIOCH5,AUDIOCH6,
00072 AUDIOCH7,AUDIOCH8,AUDIOCH9,AUDIOCH10,AUDIOCH11,AUDIOCH12,AUDIOCH13,
00073 AUDIOCH14,AUDIOCH15,AUDIOCH16,AUDIOCH17,AUDIOCH18,AUDIOCH19,AUDIOCH20,
00074 AUDIOCH21,AUDIOCH22,AUDIOCH23,AUDIOCH24,AUDIOCH25,AUDIOCH26,AUDIOCH27,
00075 AUDIOCH28,AUDIOCH29,AUDIOCH30,AUDIOCH31};
00076 const BYTE AUDIO_STREAM_ID[32]= {0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6,
00077 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd,
00078 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4,
00079 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb,
00080 0xdc, 0xdd, 0xde, 0xdf};
00081 enum PRIVATECHNUM {PRIVATECH1,PRIVATECH2};
00082 enum PADCHNUM {PADCH0};
00083 enum RESERVECHNUM {RESERVESTR,RESERVECH0,RESERVECH1,RESERVECH2,RESERVECH3,RESERVECH4,
00084 RESERVECH5,RESERVECH6,RESERVECH7,RESERVECH8,RESERVECH9,RESERVECH10,
00085 RESERVECH11,RESERVECH12,RESERVECH13,RESERVECH14,RESERVECH15};
00086
00087 typedef struct pack_header_tag
00088 {
00089 BYTE nHighSystemClockReference;
00090 DWORD dwLowSystemClockReference;
00091 DWORD dwMuxRate;
00092 } PACKHEADER;
00093
00094 typedef struct packet_header_tag
00095 {
00096 BYTE nStreamID;
00097 WORD wPacketLength;
00098 DWORD dwSTDBufferSize;
00099 DWORD dwPresentationTimeStampH;
00100 DWORD dwPresentationTimeStampL;
00101 DWORD dwDecodingTimeStampH;
00102 DWORD dwDecodingTimeStampL;
00103 WORD wPacketHeaderLength;
00104 } PACKETHEADER;
00105
00106 typedef struct system_header_tag
00107 {
00108 WORD wHeaderLength;
00109 DWORD dwRateBound;
00110 BYTE nAudioBound;
00111 bool bFixedFlag;
00112 bool bCSPCFlag;
00113 bool bSystemAudioLockFlag;
00114 bool bSystemVideoLockFlag;
00115 BYTE nVideoBound;
00116 BYTE nStreamID[MAX_STREAM_NUM];
00117 bool bSTDBufferBoundScale[MAX_STREAM_NUM+2];
00118 WORD wSTDBufferSizeBound[MAX_STREAM_NUM+2];
00119 BYTE nUsedIDNum;
00120 } SYSTEMHEADER;
00121
00122
00123
00124 const DWORD PICTURE_START_CODE=0x100;
00125 const DWORD SLICE_START_CODE_MIN=0x101;
00126 const DWORD SLICE_START_CODE_MAX=0x1AF;
00127 const DWORD USER_DATA_START_CODE=0x1B2;
00128 const DWORD SEQUENCE_HEADER_CODE=0x1B3;
00129 const DWORD SEQUENCE_ERROR_CODE=0x1B4;
00130 const DWORD EXTENSION_START_CODE=0x1B5;
00131 const DWORD SEQUENCE_END_CODE=0x1B7;
00132 const DWORD GROUP_START_CODE=0x1B8;
00133
00134 const DWORD SYSTEM_START_CODE_MIN=0x1B9;
00135 const DWORD SYSTEM_START_CODE_MAX=0x1FF;
00136 const DWORD ISO_END_CODE=0x1B9;
00137 const DWORD PACK_START_CODE=0x1BA;
00138 const DWORD SYSTEM_START_CODE=0x1BB;
00139
00140 const BYTE SEQUENCE_EXTENSION_ID=1;
00141 const BYTE SEQUENCE_DISPLAY_EXTENSION_ID=2;
00142 const BYTE QUANT_MATRIX_EXTENSION_ID=3;
00143 const BYTE COPYRIGHT_EXTENSION_ID=4;
00144 const BYTE SEQUENCE_SCALABLE_EXTENSION_ID=5;
00145 const BYTE PICTURE_DISPLAY_EXTENSION_ID=7;
00146 const BYTE PICTURE_CODING_EXTENSION_ID=8;
00147 const BYTE PICTURE_SPATIAL_SCALABLE_EXTENSION_ID=9;
00148 const BYTE PICTURE_TEMPORAL_SCALABLE_EXTENSION_ID=10;
00149
00150 const DWORD VIDEO_ELEMENTARY_STREAMID=0x1e0;
00151
00152 #endif //MPEGDATA_H