# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::DiracParser Class Reference

Dirac Stream Parser Class. More...

`#include <dirac_cppparser.h>`

Collaboration diagram for dirac::DiracParser:

[legend]

List of all members.

## Public Member Functions

- DiracParser (bool verbose=false)
    Constructor.
- ~DiracParser ()
    Destructor.
- void SetBuffer (char *start, char *end)
    Adds bytes to encoder.
- DecoderState Parse ()
    Parse the data in internal buffer.
- const ParseParams & GetParseParams () const
    Return the parse parameters of the current sequence.
- const SeqParams & GetSeqParams () const
    Return the sequence parameters of the current sequence.
- const SourceParams & GetSourceParams () const
    Return the source parameters of the current sequence.
- const FrameParams & GetNextFrameParams () const
    Return the frame parameters of the next frame to be decoded.
- const Frame & GetNextFrame () const
    Return the decoded frame.
- void SetSkip (bool skip)
    Return the last frame in the sequence.

## Private Member Functions

- DiracParser (const DiracParser &dp)
    private body-less copy constructor
- DiracParser & operator= (const DiracParser &dp)
    private body-less assignement constructor

## Private Attributes

- DecoderState m_state
    Current state of parser.
- DecoderState m_next_state
    Next state the parser will enter.
- int m_show_fnum
    frame number of last frame decoded in display order
- SequenceDecompressor * m_decomp
    Sequence decompressor object.
- bool m_skip
    skip next frame flag
- FrameSort m_skip_type
    skip frame type
- bool m_verbose
    verbose flag
- DiracByteStream m_dirac_byte_stream
    Byte Stream Buffer.

## Detailed Description

This class is a wrapper around the SequenceDecompressor class. The Sequence Decompressor class needs a full frame of data to be available to decompress a frame successfully. So, the DiracParser class uses the InputStreamBuffer class to store data until a chunk is available to be processed and then invokes the SequenceDecompressor functions to process data. A chunk of data can be a start of sequence, a frame or end of sequence data. The istream used to instantiate the SequenceDecompressor object is created using an InputStreamBuffer object which is manipulated the DiracParser. This ensures that data is always available for processing by the SequenceDecompressor object.

## Constructor & Destructor Documentation

dirac::DiracParser::DiracParser | ( | bool | verbose = `false` | ) |

Constructor takes

Parameters:

  | verbose | boolean flag. Set to true for verbose output

dirac::DiracParser::~DiracParser | ( |  | ) |

dirac::DiracParser::DiracParser | ( | const DiracParser & | dp | ) | `[private]`

## Member Function Documentation

void dirac::DiracParser::SetBuffer | ( | char * | start,
|  | char * | end |
| ) |  |  |

SetBuffer takes

Parameters:

  | start | Start of input buffer
  | end | End of input buffer

DecoderState dirac::DiracParser::Parse | ( |  | ) |

Parses the data in the input buffer. This function returns one of the following values
STATE_BUFFER : Not enough data in internal buffer to process
STATE_SEQUENCE : Start of sequence detected
STATE_PICTURE_START : Start of picture detected
STATE_PICTURE_AVAIL : Decoded picture available
STATE_SEQUENCE_END : End of sequence detected
STATE_INVALID : Invalid stream. Stop further processing

const ParseParams& dirac::DiracParser::GetParseParams | ( |  | ) | const

const SeqParams& dirac::DiracParser::GetSeqParams | ( |  | ) | const

const SourceParams& dirac::DiracParser::GetSourceParams | ( |  | ) | const

const FrameParams& dirac::DiracParser::GetNextFrameParams | ( |  | ) | const

const Frame& dirac::DiracParser::GetNextFrame | ( |  | ) | const

void dirac::DiracParser::SetSkip | ( | bool | skip | ) |

Set the skip flag

Set the skip flag to the value specified in skip. If skip is true, the parser will skip decoding the next frame until the this function is called again with skip set to false

DiracParser& dirac::DiracParser::operator= | ( | const DiracParser & | dp | ) | `[private]`

## Member Data Documentation

DecoderState dirac::DiracParser::m_state`[private]`

DecoderState dirac::DiracParser::m_next_state`[private]`

int dirac::DiracParser::m_show_fnum`[private]`

SequenceDecompressor* dirac::DiracParser::m_decomp`[private]`

bool dirac::DiracParser::m_skip`[private]`

FrameSort dirac::DiracParser::m_skip_type`[private]`

bool dirac::DiracParser::m_verbose`[private]`

DiracByteStream dirac::DiracParser::m_dirac_byte_stream`[private]`

The documentation for this class was generated from the following file:

- dirac_cppparser.h

© 2004 British Broadcasting Corporation. Dirac code licensed under the Mozilla Public License (MPL) Version 1.1.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.