MPEG4 Decoder

MPEG4 decoder:

The main features include:

  1. It decodes MPEG4 SP (Simple Profile) video elementary bit-stream;
  2. It supports video resolution up to 768 x 576;
  3. The MPEG4 decoder can decode bit-stream data from a continuous stream without knowledge of the frame boundary (for example, read data from a file). It can also accept bit stream for one frame at a time.
  4. In the first case, the buffer will be filled up by the application before calling the decoder for the first time. Then, every time before calling decoding next frame, check how many data left in the buffer. If the buffer is half empty, copy the bytes that are left over to the start position of the buffer, then followed by new data read in.
  5. For the second case, if you know the bit stream data is exactly for one frame (you know the bit stream boundary for each frame), just copy the data to the buffer start each time you call the decoder.
  6. The decoded image will be sent back to the caller in YUV raw format after every frame is decoded. It is up to the caller (application) to decide how to handle the decoded image, whether to display, to store to a file, or to trans-code to other formats.
  7. A decoder parameter structure is defined as:typedef struct _SRI_MPEG4_DEC_PARAM {
    unsigned char *InputBitstreamBuffer;
    unsigned char *DecodedYUVimage;
    unsigned long *BytesConsumed;
    int *PictureWidth;
    int *PictureHeight;
    int *VOPTimeIncrement;
    int *FrameNumber;


  8. There are 5 functions inside this library:int SRI_MPEG4_InitDecoder(
    SRI_MPEG4_DEC_PARAM * MPEG4DecParameters)

    int SRI_MPEG4_DecodeFrame(
    int DecHandler,
    SRI_MPEG4_DEC_PARAM * MPEG4DecParameters)

    int SRI_MPEG4_ReleaseDecoder(
    int DecHandler,
    SRI_MPEG4_DEC_PARAM * MPEG4DecParameters)

    int SRI_MPEG4_GetPicType(
    int DecHandler,
    int *PicType)

    int SRI_MPEG4_GetQuant(
    int DecHandler,
    unsigned char *QuantBuf,
    int BufSize)


Download the package:
Package includes: MPEG4 decoder filter library, demo program source code with project files (for Windows) and make file (for Linux), example MPEG4 video clip and test script batch file.