Mpeg4ClipsCommon.h
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:17k
源码类别:

DVD

开发平台:

Others

  1. /****************************************************************************************
  2.  *  Copyright (c) 2004 ZORAN Corporation, All Rights Reserved
  3.  *  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
  4.  *
  5.  *  File: $Workfile: Mpeg4ClipsCommon.h $             
  6.  *
  7.  * Description: 
  8.  * ============
  9.  *  MPEG4 Clips Common
  10.  * 
  11.  * Log:
  12.  * ====
  13.  * $Revision: #1 $
  14.  * $Change: 24403 $ 
  15.  * Last Modified by $Author: robin.jiang $ at $DateTime: 2004/08/02 15:02:11 $ 
  16.  ****************************************************************************************
  17.  * Updates:
  18.  ****************************************************************************************
  19.  * $Log: /I76/I76_Common/I76_Reference/Playcore/Nav_Clips/Mpeg4ClipsCommon.h $
  20.  *
  21.  * 1 8/2/2004 RobinJ
  22.  * Created
  23.  *
  24.  ****************************************************************************************/
  25. #include "Config.h" // Global Configuration - do not remove!
  26. #ifndef __MPEG4CLIPSCOMMON_H_
  27. #define __MPEG4CLIPSCOMMON_H_
  28. #include "IncludeSysDefs.h"
  29. #include "Decoderdecoder.h"
  30. //#include "PlaycoreNav_ClipsAVI.h"
  31. //#include "PlaycoreNav_ClipsMP4.h"
  32. //#include "PlaycoreNav_ClipsAVI_private.h"
  33. #include "PlaycoreScPadSCMGR.h"
  34. /////////////////////////////////////////////////////////////////////////////
  35. // Constants and Enumerations
  36. /* MPEG4 clips header info */
  37. #define _mpeg4Globals gns.clips.globals.mpeg4Globals
  38. #define _uiMPEG4TotalDVPIdleTime _mpeg4Globals.uiTotalDVPIdleTime
  39. #define _bMPEG4IsIndexProcessed _mpeg4Globals.bIsIndexProcessed
  40. #define _uiMPEG4ProcessedFileAddr _mpeg4Globals.uiProcessedFileAddr
  41. #define _iMPEG4CurrentScanningMode _mpeg4Globals.iCurrentScanningMode
  42. #define _uiMPEG4NumOfDecodedChunksMemory _mpeg4Globals.uiNumOfDecodedChunksMemory
  43. #define _uiMPEG4StartTime _mpeg4Globals.uiStartTime
  44. #define _bMPEG4TrickModeOn _mpeg4Globals.bTrickModeOn
  45. #define _bMPEG4WasClockEnabled _mpeg4Globals.bWasClockEnabled
  46. #define _uiMPEG4NextIndexEntry _mpeg4Globals.NextIndexEntry
  47. #define _ulMPEG4RequestedFrameIndex _mpeg4Globals.ulRequestedFrameIndex
  48. //#define _bMPEG4AutoPlay _mpeg4Globals.bAutoPlay
  49. #define _bMPEG4PauseToSlow _mpeg4Globals.bPauseToSlow
  50. #ifdef PATCH_VIDEO_NOT_B
  51. #define _bMPEG4IsBVopExist _mpeg4Globals.bIsBVopExist
  52. #endif
  53. #define _dwMPEG4ProcessingEndAddr _mpeg4Globals.dwProcessingEndAddr
  54. #define _mpeg4ExternalSubtitleAddr _mpeg4Globals.dwExternalSubtitleAddr
  55. #define _mpeg4TotalSubtitleNum _mpeg4Globals.wTotalSubtitleNum
  56. #define _mpeg4InternalSubtitleBufferStartAddr _mpeg4Globals.wInternalSubtitleBufferStartAddr
  57. #define _dwMPEG4FileLocation _mpeg4Globals.dwFileLocation
  58. #define _dwMPEG4ClipStartLBA _mpeg4Globals.dwClipStartLBA
  59. #define _wMPEG4ClipStartOffset _mpeg4Globals.wClipStartOffset
  60. #define _wMPEG4ClipEndOffset _mpeg4Globals.wClipEndOffset
  61. #define _ulMPEG4TotalBlocksCnt _mpeg4Globals.ulTotalBlocksCnt
  62. #define _mpeg4AudioAvailableNum _mpeg4Globals.audio_available_num
  63. #define _mpeg4AudioCurrentDispIdx _mpeg4Globals.audio_current_display
  64. #define _mpeg4SubtitleAvailableNum _mpeg4Globals.subtitle_available_num
  65. #define _mpeg4SubtitleInternalAvailableNum _mpeg4Globals.subtitle_internal_available_num
  66. #define _mpeg4SubtitleCurrentDispIdx _mpeg4Globals.subtitle_current_display
  67. #define _mpeg4ChapterAvailableNum _mpeg4Globals.chapter_available_num
  68. #define _mpeg4ChapterCurrentDispIdx _mpeg4Globals.chapter_current_display
  69. #define _mpeg4VideoStreamInfo _mpeg4Globals.VideoStreamInfo
  70. #define _mpeg4AudioStreamInfo _mpeg4Globals.CurrAudioStreamInfo
  71. #define _mpeg4VideoStreamID _mpeg4VideoStreamInfo.streamID
  72. #define _mpeg4VideoHeaderDataLength _mpeg4VideoStreamInfo.headerDateLength
  73. #define _mpeg4VideoWidth _mpeg4VideoStreamInfo.wWidth
  74. #define _mpeg4VideoHeight _mpeg4VideoStreamInfo.wHeight
  75. #define _mpeg4VideoCodec _mpeg4VideoStreamInfo.videoCodec
  76. #define _mpeg4VideoLength _mpeg4VideoStreamInfo.dwLength
  77. #define _mpeg4VideoScale _mpeg4VideoStreamInfo.dwScale
  78. #define _mpeg4VideoRate _mpeg4VideoStreamInfo.dwRate
  79. #define _mpeg4AudioStreamID _mpeg4AudioStreamInfo.streamID
  80. //#define _mpeg4AudioHeaderDataLength _mpeg4AudioStreamInfo.headerDateLength
  81. #define _mpeg4AudioCodec _mpeg4AudioStreamInfo.audioCodec
  82. #define _mpeg4AudioSamplesPerSec _mpeg4AudioStreamInfo.dwSamplesPerSec
  83. #define _mpeg4AudioAvgBytesPerSec _mpeg4AudioStreamInfo.dwAvgBytesPerSec
  84. #define _mpeg4AudioChannels _mpeg4AudioStreamInfo.channels
  85. #define _mpeg4AudioLength _mpeg4AudioStreamInfo.dwLength
  86. #define _mpeg4AudioScale _mpeg4AudioStreamInfo.dwScale
  87. #define _mpeg4AudioRate _mpeg4AudioStreamInfo.dwRate
  88. #ifdef D_ENABLE_ADPCM_SUPPORT
  89. #define _mpeg4AudioBitsPerSample_ADPCM _mpeg4AudioStreamInfo._audioInfoEX._adpcmInfoAddition.bitsPerSample
  90. //#define _mpeg4AudioChannels_ADPCM _mpeg4AudioStreamInfo._audioInfoEX._adpcmInfoAddition.channels
  91. #define _mpeg4AudioSamplesPerBlock_ADPCM _mpeg4AudioStreamInfo._audioInfoEX._adpcmInfoAddition.wSamplesPerBlock
  92. #define _mpeg4AudioBlockAlign_ADPCM _mpeg4AudioStreamInfo._audioInfoEX._adpcmInfoAddition.wBlockAlign
  93. #endif
  94. #ifdef D_ENABLE_DIVX_WMA_SUPPORT
  95. //#define _mpeg4AudioChannels_WMA _mpeg4AudioStreamInfo._audioInfoEX._wmaInfoAddition.channels
  96. #define _mpeg4AudioBlockAlign_WMA _mpeg4AudioStreamInfo._audioInfoEX._wmaInfoAddition.wBlockAlign
  97. #define _mpeg4AudioEncoderOptions_WMA _mpeg4AudioStreamInfo._audioInfoEX._wmaInfoAddition.encoderOptions
  98. #endif
  99. #ifdef D_ENABLE_AAC_SUPPORT
  100. #define _mpeg4AudioInfo_AAC _mpeg4AudioStreamInfo._audioInfoEX._aacInfoAddition
  101. #endif //D_ENABLE_AAC_SUPPORT
  102. #define _mpeg4AudioLanguageCode _mpeg4AudioStreamInfo.languageCode.language
  103. #define _mpeg4SubtitleStreamInfo _mpeg4Globals.CurrSubtitleStreamInfo
  104. #define _mpeg4SubtitleStreamID _mpeg4SubtitleStreamInfo.streamID
  105. #define _mpeg4SubtitleType _mpeg4SubtitleStreamInfo.type
  106. //#define _mpeg4ExternalSubtitleAddr _mpeg4SubtitleStreamInfo.dwExternalSubtitleAddr
  107. #define _mpeg4ClassName _mpeg4SubtitleStreamInfo.className
  108. #define _mpeg4SubtitleTimeScale _mpeg4SubtitleStreamInfo.dwTimeScale // use mp4 subtitle
  109. #define _mpeg4SubtitleLanguageCode _mpeg4SubtitleStreamInfo.languageCode.language
  110. #define _mpeg4SubtitleOffsetInAvi _mpeg4SubtitleStreamInfo.dwOffsetInAvi
  111. #define _aviGlobalsEx _mpeg4Globals.globalsEx.aviGlobals
  112. #define _bAVIHasIndex _aviGlobalsEx.bHasIndex
  113. #define _bAVIDrmOn _aviGlobalsEx.bDrmOn
  114. #define _lAVIPreviousFrameNumber _aviGlobalsEx.lPreviousFrameNumber
  115. #define _uiAVICurrCachedIdxEntry _aviGlobalsEx.uiCurrCachedIdxEntry
  116. //#define _m_AVIKeyInstance _aviGlobalsEx.m_KeyInstance
  117. #define _bAVIVideoBeforeAudio _aviGlobalsEx.bVideoBeforeAudio
  118. #ifdef IS_ASF_CAPABLE
  119. #define _asfGlobalsEx _mpeg4Globals.globalsEx.asfGlobals
  120. #define _asfProperties  _asfGlobalsEx.asfProperties
  121. #define _uiAsfResumePacketNumber _asfGlobalsEx.uiAsfResumePacketNumber
  122. #endif
  123. #ifdef IS_MP4_CAPABLE
  124. #define _mp4GlobalsEx _mpeg4Globals.globalsEx.mp4Globals
  125. #define _bMP4IsNeroDigital _mp4GlobalsEx.bNeroDigital
  126. #define _dwMP4ChunkSizeStartAddr _mp4GlobalsEx.dwChunkSizeStartAddr
  127. //#define _dwMP4ChunkSizeEndAddr _mp4GlobalsEx.dwChunkSizeEndAddr
  128. #define _dwMP4ChunkSizeEntryTotal _mp4GlobalsEx.dwChunkSizeEntryTotal // RB_TBD
  129. #define _dwMP4ChunkSizeEntryIndex _mp4GlobalsEx.dwChunkSizeEntryIndex
  130. //#define _dwMP4AudioSyncEntryAddr _mp4GlobalsEx.dwAudioSyncEntryAddr
  131. #define _dwMP4FirstChunkOffset _mp4GlobalsEx.dwFirstChunkOffset
  132. #define _dwMP4LastChunkEndOffset _mp4GlobalsEx.dwLastChunkEndOffset
  133. #define _dwMP4ChunkSizeBuff _mp4GlobalsEx.dwChunkSizeBuff
  134. #define _dwMP4ChunkOffset _mp4GlobalsEx.dwChunkOffset
  135. #define _dwMP4VideoSyncOffset _mp4GlobalsEx.dwVideoSyncOffset
  136. #define _dwMP4AudioSyncOffset _mp4GlobalsEx.dwAudioSyncOffset
  137. #define _dwMP4SampleTableAddr _mp4GlobalsEx.dwSampleTableAddr
  138. #define _MP4SharedBuff _mp4GlobalsEx.sharedBuff
  139. #define _dwMP4SubtitleSampleAddr _mp4GlobalsEx.dwSubtitleSampleAddr
  140. #define _dwMP4SubtitleSampleCount _mp4GlobalsEx.dwSubtitleSampleCount
  141. #define _dwMP4SubtitleSampleStartTime _mp4GlobalsEx.dwSubtitleSampleStartTime
  142. #define _dwMP4SubtitleSampleAddr _mp4GlobalsEx.dwSubtitleSampleAddr
  143. #define _dwMP4SubtitleSampleCount _mp4GlobalsEx.dwSubtitleSampleCount
  144. #define _dwMP4SubtitleSampleStartTime _mp4GlobalsEx.dwSubtitleSampleStartTime
  145. #define _dwMP4SubtitleWriteDRAMAddr _mp4GlobalsEx.dwSubtitleWriteDRAMAddr
  146. #define _dwMP4SubtitleReadDRAMAddr _mp4GlobalsEx.dwSubtitleReadDRAMAddr
  147. #define _dwMP4ChapterOffset _mp4GlobalsEx.dwChapterOffset
  148. #define _dwMP4ChapterDRAMStartAddr _mp4GlobalsEx.dwChapterDRAMStartAddr
  149. #define _uiMP4ChapterStartTime _mp4GlobalsEx.uiChapterStartTime
  150. #define _uiMP4ChapterEndTime _mp4GlobalsEx.uiChapterEndTime
  151. #define _bMP4InternalSubtitle ((_mpeg4SubtitleStreamID != NO_STREAM) && (_mpeg4SubtitleType == INTERNAL_SUBT))
  152. #endif
  153. #define AVI_VBR_AUD_STREAM_SCALE 1152
  154. #define FOURCC_FIELD_LENGTH 4
  155. #define MAX_AUDS_PER_CLIP        8
  156. #define MAX_SUB_PER_CLIP 16
  157. #define MAX_RESERVED_PER_CLIP 8
  158. #define NO_STREAM 0xFF
  159. #define AC3_SID 0x80
  160. //#define SIZE_OF_AUDIO_STREAM_INFO ((sizeof(MPEG4AudioStreamInfo)+1)<<1) // in word, 8
  161. //#define MPEG4_CURRENT_AUDIO_STREAM_INFOEX_BUFF (MPEG4_STREAM_INFO_BUFF +  ((_mpeg4AudioAvailableNum-1)* SIZE_OF_AUDIO_STREAM_INFOEX))
  162. //#define CALC_AUDIO_STREAM_INFO_ADDR(num) (MPEG4_CURRENT_AUDIO_STREAM_INFOEX_BUFF+ (num * SIZE_OF_AUDIO_STREAM_INFO))
  163. #define SIZE_OF_AUDIO_STREAM_INFO (sizeof(MPEG4AudioStreamInfo))
  164. #define SIZE_OF_SUBTITLE_STREAM_INFO (sizeof(MPEG4SubtitleStreamInfo))
  165. #define MPEG4_VIDEO_HEADER_CACHE_SIZE 16 // in byte
  166. #define MPEG4_VIDEO_HEADER_BUFFER_SIZE 1024 // in byte
  167. //#define SIZE_OF_SUBTITLESTREAMINFO ((sizeof(MPEG4SubtitleStreamInfo)+1)<<1) // in word
  168. //#define MPEG4_CURRENT_SUBTITLE_STREAM_INFO_BUFF (MPEG4_STREAM_INFO_BUFF +    MPEG4_CURRENT_AUDIO_STREAM_INFOEX_BUFF +  ((_mpeg4SubtitleAvailableNum-1)* SIZE_OF_SUBTITLESTREAMINFO))
  169. #define MKTAG(a,b,c,d) ((DWORD)a | ((DWORD)b << 8) | ((DWORD)c << 16) | ((DWORD)d << 24))
  170. // Note: Any change in the following calculation might affect the accuracy of GoTo time
  171. //#define CALC_FRAME_OF_TIME(time , rate, scale)  (DWORD)( (10000UL * time) / ((10000UL*scale)/rate) )
  172. //#define CALC_TIME_OF_FRAME(frame, rate, scale) (DWORD)( (1000UL * frame) / (1000UL*rate/scale) )
  173. #define MPEG4_PROCESSING_BUFF_ADDR  COLOCATED_INFO_AVI // descend
  174. #define DVP_VIDEO_TASK_WATCHDOG_TIME 2000 /* in msec */
  175. #define DVP_UPDATED_SCLK_MASK 0x2
  176. typedef DWORD QWORD[2];
  177. typedef enum
  178. {
  179. SCAN_SPEED_2X = 2,
  180. SCAN_SPEED_4X = 4,
  181. SCAN_SPEED_8X = 8,
  182. SCAN_SPEED_20X = 20,
  183. SCAN_SPEED_40X=40
  184. } SCAN_SPEED;
  185. typedef enum
  186. {
  187. I_P_INCREMENT = 0,
  188. ONE_I_INCREMENT = 1,
  189. TOW_I_INCREMENT = 2,
  190. FOUR_I_INCREMENT = 4,
  191. EIGHT_I_INCREMENT = 10
  192. } I_INCREMENT_VAL;
  193. /////////////////////////////////////////////////////////////////////////////
  194. // Common Structures
  195. typedef UINT32 FOURCC;
  196. typedef enum
  197. {
  198. MP3_AUDIO_SID  = 0x55,
  199. MPEG_AUDIO_SID = 0x50,
  200. AC3_AUDIO_SID  = 0x2000,
  201. ADPCM_MS_AUDIO_SID = 0x02,
  202. ADPCM_IMA_WAV_AUDIO_SID = 0x11,
  203. ADPCM_IMA_DK4_AUDIO_SID = 0x61,
  204. ADPCM_IMA_DK3_AUDIO_SID = 0x62,
  205. WMAV1_AUDIO_SID = 0x160,
  206. WMAV2_AUDIO_SID = 0x161,
  207. PCM_ALAW_AUDIO_SID = 0x06,
  208. PCM_MULAW_AUDIO_SID = 0x07,
  209. PCM_AUDIO_SID  = 0x0001
  210. } AVI_AUDIO_SID;
  211. typedef enum
  212. {
  213. MP2 = 1,
  214. MP3 = 2,
  215. PCM = 3,
  216. ADPCM = 4,
  217. WMA = 5,
  218. AC3  = 6,
  219. AAC = 7,
  220. AUDIO_UNKNOWN    = 0
  221. } AudioCodec;
  222. typedef enum
  223. {
  224. INTERNAL_SUBP = 0,
  225. INTERNAL_SUBT,
  226. EXTERNAL_SUBP,
  227. MICRODVD,
  228. SUBRIP,
  229. SAMI,
  230. POWERDIVX,
  231. SUBSTATIONALPHA,
  232. SUBVIEWER,
  233. TMPLAYER,
  234. SUBVIEWERVER1,
  235. AVI_INTERNAL_TEXT,
  236. } SubtitleType;
  237. typedef struct
  238. {
  239. char language[3];
  240. }LanguageCode;
  241. typedef struct
  242. {
  243. DWORD  dwScale;
  244.     DWORD  dwRate;
  245. DWORD  dwLength;
  246. } MPEG4StreamHeadInfo; // avi only, ?
  247. /*
  248. typedef struct
  249. {
  250. DWORD  dwWidth;
  251.     DWORD  dwHeight;
  252.     FOURCC dwCompression;
  253. } MPEG4VideoStreamInfoTemp;
  254. */
  255. typedef struct
  256. {
  257. BYTE   streamID;
  258. DivXVesrion videoCodec;
  259. WORD  wWidth;
  260. WORD  wHeight;
  261. BYTE  headerDateLength;
  262. DWORD  dwLength; // mp4 -sample count 
  263. DWORD dwScale; // mp4 -sampe delta
  264. DWORD dwRate; // mp4 -time scale
  265. } MPEG4VideoStreamInfo;
  266. /*
  267. typedef struct
  268. {
  269. BYTE  audioStreamID;
  270. union {
  271. WORD wFormatTag; // avi, asf
  272. FOURCC dwFormatTag; // mp4
  273. } _formatTag;
  274.     DWORD dwSamplesPerSec; 
  275. #ifdef D_ENABLE_ADPCM_SUPPORT
  276. WORD  wSamplesPerBlock;
  277. WORD   wBitsPerSample;
  278. #endif
  279. #if (defined(D_ENABLE_DIVX_WMA_SUPPORT) || defined(D_ENABLE_ADPCM_SUPPORT))
  280. WORD  wChannels; 
  281. WORD  wBlockAlign;
  282. #endif
  283.     DWORD dwAvgBytesPerSec;
  284. #ifdef D_ENABLE_DIVX_WMA_SUPPORT
  285.     WORD wEncoderOptions;
  286. #endif
  287. } MPEG4AudioStreamInfoTemp;
  288. */
  289. #ifdef D_ENABLE_ADPCM_SUPPORT
  290. typedef struct
  291. {
  292. // BYTE  channels; 
  293. WORD  wBlockAlign;
  294. WORD wSamplesPerBlock;
  295. BYTE  bitsPerSample;
  296. } ADPCMInfoAddition;
  297. #endif
  298. #ifdef D_ENABLE_DIVX_WMA_SUPPORT
  299. typedef struct
  300. {
  301. // BYTE   channels; 
  302. WORD   wBlockAlign;
  303.     BYTE  encoderOptions;
  304. } WMAInfoAddition;   
  305. #endif
  306. #ifdef D_ENABLE_AAC_SUPPORT
  307. #define MAIN_CHANNEL_ELEMENTS_LEN 16
  308. #define LFE_CHANNEL_ELEMENTS_LEN 4
  309. typedef struct
  310. {
  311. UINT front_element_is_cpe:1;
  312. UINT front_element_tag_select:4;
  313. UINT side_element_is_cpe:1;
  314. UINT side_element_tag_select:4;
  315. UINT back_element_is_cpe:1;
  316. UINT back_element_tag_select:4;
  317. } MAIN_CHANNEL_ELEMENTS;
  318. typedef struct
  319. UINT lfe_element_tag_select:4;
  320. } LFE_CHANNEL_ELEMENTS;
  321. typedef struct
  322. {
  323. UINT samplingFrequencyIndex:4;
  324. UINT channelConfiguration:4;
  325. UINT num_front_channel_elements:4;
  326. UINT num_side_channel_elements:4;
  327. UINT num_back_channel_elements:4;
  328. UINT num_lfe_channel_elements:2;
  329. MAIN_CHANNEL_ELEMENTS main_channel_elements[MAIN_CHANNEL_ELEMENTS_LEN];
  330. LFE_CHANNEL_ELEMENTS lfe_channel_elements[LFE_CHANNEL_ELEMENTS_LEN];
  331. UINT16 maxBlockSize;
  332. } PROGRAM_CONFIG_ELEMENT;
  333. typedef PROGRAM_CONFIG_ELEMENT AACInfoAddition;
  334. #endif //D_ENABLE_AAC_SUPPORT
  335. typedef struct
  336. {
  337. BYTE   streamID;
  338. AudioCodec audioCodec;
  339. DWORD  dwLength; // mp4 -sample count 
  340. DWORD dwScale; // mp4 -time scale
  341. DWORD dwRate; // mp4 -sampe delta
  342.     DWORD dwSamplesPerSec; 
  343.     DWORD  dwAvgBytesPerSec;
  344.     BYTE   channels; 
  345. #if (defined(D_ENABLE_DIVX_WMA_SUPPORT) || defined(D_ENABLE_ADPCM_SUPPORT))
  346. union {
  347. #ifdef D_ENABLE_ADPCM_SUPPORT
  348. ADPCMInfoAddition _adpcmInfoAddition;
  349. #endif
  350. #ifdef D_ENABLE_DIVX_WMA_SUPPORT
  351. WMAInfoAddition _wmaInfoAddition;
  352. #endif
  353. #ifdef D_ENABLE_AAC_SUPPORT
  354. AACInfoAddition _aacInfoAddition;
  355. #endif
  356. } _audioInfoEX;
  357. #endif
  358. BYTE headerDateLength;
  359. LanguageCode languageCode;
  360. } MPEG4AudioStreamInfo;
  361. typedef struct
  362. {
  363. BYTE   streamID;
  364. SubtitleType type;
  365. // DWORD dwExternalSubtitleAddr;
  366. char className[10]; // used in SAMI
  367. DWORD dwTimeScale; // used in MP4
  368. LanguageCode languageCode;
  369. DWORD dwOffsetInAvi; // used in AVI
  370. } MPEG4SubtitleStreamInfo;
  371. #define MPEG4_CHAPTER_NAME_LENGTH 15
  372. typedef struct
  373. {
  374. UINT16 uiChapterTime; // in second
  375. WORD wChapterName[MPEG4_CHAPTER_NAME_LENGTH];
  376. } MPEG4ChapterEntry;
  377. #ifdef IS_ASF_CAPABLE
  378. typedef struct {
  379. DWORD dwFileSize;
  380. DWORD dwDataPacketsCount;
  381. DWORD dwPlayDuration;
  382. DWORD dwPacketTimeInterval;
  383. DWORD dwPacketTimeIntervalDelta10000;
  384. DWORD dwPreroll;
  385. BOOL bBroadcast;
  386. BOOL bSeekable;
  387. DWORD dwDataPacketSize;
  388. } ASFProperties;
  389. #endif
  390. // <<< Robin_0903_2004
  391. #ifdef DIVX_SUPPORT_MULTI_SUBTITLE
  392. typedef struct _EXTEND_SUBTITLE_INFO_ST {
  393. DWORD dwSubtitlesFileAddress;
  394. DWORD dwSubtitlesFileSize;
  395. }Extend_Subtitle_Info_St;
  396. #endif
  397. // >>> Robin_0903_2004
  398. #define MP4_CHUNK_SIZE_TABLE_BUFF_SIZE 16
  399. #define MP4_PACK_CHUNK_SIZE_TABLE_BUFF_SIZE 10
  400. /////////////////////////////////////////////////////////////////////////////
  401. // Public Services
  402. WORD caclTimeOfFrame(DWORD dwFrameNumber, DWORD dwRate, DWORD dwScale);
  403. DWORD caclFrameOfTime(WORD wTime, DWORD dwRate, DWORD dwScale);
  404. void convertFOURCCToString(FOURCC forcc, LPSTR str);
  405. DWORD qwTimeDiv10000(QWORD time);
  406. void UTF8ToUnicode(BYTE* pUTFBuffer, WORD*  pUnicodeBuffer, UINT16 uiBufferSize,  WORD* wLastUnicode, WORD* uiUnicodeBufferSize);
  407. DivXVesrion determineDivXVersion(FOURCC fourccHandle, FOURCC fouccCompression);
  408. AudioCodec determineAudioCodec(DWORD dwFormatTag, WORD wFormatTag, BOOL bMP4);
  409. BOOL determineAudioInfo(UINT8* puiAudioSid, UINT8* puiAudioSidDecoder,DWORD* dwSampleRate);
  410. void prePlayProcessing(DWORD dwSamplingRate, UINT8 uiAudioSid,
  411.    UINT8 uiAudioSIDDecoder, UINT8 uiVideoSid, BOOL bClipStart);
  412. void MPEG4Clip_dynamic_malloc(UINT16* uiACBStartAddressAVI, UINT16* uiSPBStartAddressAVI, UINT16* uiAPPStartAddressAVI);
  413. #endif //__MPEG4CLIPSCOMMON_H_