File MPEGgenerator.str.pre
Version 1.0


This file contains functions that allow one to encode MPEG-2 compliant video. The code is based on the MPEG-2 specification (ISO/IEC 13818-2). The MPEG-2 encoder is a work in progress, although it works within a limited test range. Throughout the source code, citations are made in cases where an understanding of the code would be helped by looking at an outside source. The format I have chosen is (cite NUM#, LOOKUP_INFO). NUM=1 refers to ISO/IEC: 13818-2, and NUM=2 refers to the reference MPEG implementation written in C, available at [www.mpeg.org].


Component Summary
int->bit MPEGStreamGenerator
          Performs variable length encoding on an MPEG-2 compliant bit stream in accordance with the IEEE MPEG-2 specification.
bit->bit BitAlignStartCodes
          Bit-aligns the start codes.

Component Detail

MPEGStreamGenerator

int->bit MPEGStreamGenerator
Performs variable length encoding on an MPEG-2 compliant bit stream in accordance with the IEEE MPEG-2 specification.

Input:
<int> - A series of macroblocks, motion vectors, and associated picture data
Output:
<bit> - An MPEG-2 variable length encoded bitstream. The start codes are not aligned correctly: another filter is used to clean this up.
Parameters:
intra_quantiser_matrix - The intra quantiser matrix to be used for quantization
non_intra_quantiser_matrix - The non-intra quantiser matrix to be used for quantization
intra_dc_precision - The intra dc precision to be used
q_scale_type - The quantization scale type

BitAlignStartCodes

bit->bit BitAlignStartCodes()
Bit-aligns the start codes. This should be part of the generator but to simplify the code has been moved out. Performance is slightly worse, but you wouldn't want to write the generator in StreamIt anyway.

Input:
<bit> - An MPEG-2 encoded stream with non-aligned start codes
Output:
<bit> - An MPEG-2 encoded stream with aligned start codes

Please contact the author (Matthew Drake) for more information.