// (c) 2005-2007 Electronic Arts Inc.
// ------------------------------------------------------------
//					   AVI 2 Chunk tool
//					  ------------------
// Converts AVI files to the EA Chunk format
//
// Format:
//		   [AVhd] - main header contains basic description
//		   [AUhd] - {optional} possible audio header of some form
//		   [MDAT] - Interleaved movie and audio data
//		   [MDAT]
//			 .
//			 .
//			 .
// ------------------------------------------------------------

#ifndef AVI2CHUNK_H
#define AVI2CHUNK_H


// ************************************************************
// FourCC:	 MVhd
// Little Endian
// 00000: 4d566864 20000000 44583530 00010001  MVhd ...DX50....
// 00010: 01000000 3c000000 01000000 04000000  ....<...........
// ************************************************************
struct ChunkedAviHeader
{
  char	 mId[4];					// 'MVhd' FourCC
  char	 mLength[4];				// Length of 'MVhd' chunk
  char	 mCompressor[4];			// Compressor FourCC
  char	 mWidth[2];
  char	 mHeight[2];
  char	 mTotalFrames[4];			// Total number of frames in the file. This should always be accurate
  char	 mSuggestedBufferSize[4];	// Recommended decode buffer size
  char	 mFpsNumerator[4];			// FPS = Numerator/Denominator
  char	 mFpsDenominator[2];		// Eg. 30000/1001=29.97
  char	 mFlags[2]; 				// Eg. uses B-frames
};

struct ChunkHeader
{
  char mId[4];
  char mLength[4];
};

#endif

