# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::SequenceDecompressor Class Reference

Decompresses a sequence of frames from a stream. More...

`#include <seq_decompress.h>`

Collaboration diagram for dirac::SequenceDecompressor:

[legend]

List of all members.

## Public Member Functions

- SequenceDecompressor (ParseUnitByteIO &parseunit, bool verbosity)
    Constructor.
- ~SequenceDecompressor ()
    Destructor.
- void NewAccessUnit (ParseUnitByteIO &parseunit_byteio)
    Marks beginning of a new AccessUnit.
- Frame & DecompressNextFrame (ParseUnitByteIO *p_parseunit_byteio, bool skip=false)
    Decompress the next frame in sequence.
- Frame & GetNextFrame ()
    Get the next frame available for display.
- const FrameParams & GetNextFrameParams () const
    Get the next frame parameters.
- bool Finished ()
    Determine if decompression is complete.
- ParseParams & GetParseParams ()
    Interrogates for parse parameters.
- SeqParams & GetSeqParams ()
    Interrogates for decompression parameters.
- SourceParams & GetSourceParams ()
    Interrogates for source parameters.

## Private Member Functions

- SequenceDecompressor (const SequenceDecompressor &cpy)
    Copy constructor is private and body-less.
- SequenceDecompressor & operator= (const SequenceDecompressor &rhs)
    Assignment = is private and body-less.

## Private Attributes

- bool m_all_done
    Completion flag, returned via the Finished method.
- DecoderParams m_decparams
    Parameters for the decompression, as provided in constructor.
- ParseParams m_parse_params
    The parse parameters obtained from the stream header.
- SeqParams m_sparams
    The sequence parameters obtained from the stream header.
- SourceParams m_srcparams
    The source parameters obtained from the stream header.
- FrameBuffer * m_fbuffer
    A picture buffer used for local storage of frames whilst pending re-ordering or being used for reference.
- int m_current_code_fnum
    Number of the frame in coded order which is to be decoded.
- int m_delay
    A delay so that we don't display what we haven't decoded.
- int m_last_frame_read
    Index, in display order, of the last frame read.
- int m_show_fnum
    Index, in display order of the frame to be displayed next - computed from delay and current_code_fnum.
- FrameDecompressor * m_fdecoder
    Frame decompressor object.
- int m_current_accessunit_fnum
    Current AccessUnit frame-number.
- int m_highest_fnum
    Highest frame-num processed - for tracking end-of-sequence.

## Detailed Description

This class decompresses a sequence of frames, frame by frame.

## Constructor & Destructor Documentation

dirac::SequenceDecompressor::SequenceDecompressor | ( | ParseUnitByteIO & | parseunit,
|  | bool | verbosity |
| ) |  |  |

Initializes the decompressor with an input stream and level of output detail.

Parameters:

  | parseunit | First access-unit of new sequence
  | verbosity | when true, increases the amount of information displayed during decompression

dirac::SequenceDecompressor::~SequenceDecompressor | ( |  | ) |

Closes files and releases resources.

dirac::SequenceDecompressor::SequenceDecompressor | ( | const SequenceDecompressor & | cpy | ) | `[private]`

Copy constructor is private and body-less. This class should not be copied.

## Member Function Documentation

void dirac::SequenceDecompressor::NewAccessUnit | ( | ParseUnitByteIO & | parseunit_byteio | ) |

Parameters:

  | parseunit_byteio | AccessUnit info in Dirac-stream format

Frame& dirac::SequenceDecompressor::DecompressNextFrame | ( | ParseUnitByteIO * | p_parseunit_byteio,
|  | bool | skip = `false` |
| ) |  |  |

This function decodes the next frame in coding order and returns the next frame in display order. In general these will differ, and because of re-ordering there is a delay which needs to be imposed. This creates problems at the start and at the end of the sequence which must be dealt with. At the start we just keep outputting frame 0. At the end you will need to loop for longer to get all the frames out. It's up to the calling function to do something with the decoded frames as they come out -- write them to screen or to file, as required.

Parameters:

  | p_parseunit_byteio | Frame information in Dirac-stream format
  | skip | skip decoding next frame

Returns:
  reference to the next locally decoded frame available for display

Frame& dirac::SequenceDecompressor::GetNextFrame | ( |  | ) |

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

bool dirac::SequenceDecompressor::Finished | ( |  | ) |

Indicates whether or not the last frame in the sequence has been decompressed.

Returns:
  true if last frame has been compressed; false if not

ParseParams& dirac::SequenceDecompressor::GetParseParams | ( |  | ) | `[inline]`

Returns the parse parameters used for this decompression run.

Returns:
  parse parameters.

References m_parse_params.

SeqParams& dirac::SequenceDecompressor::GetSeqParams | ( |  | ) | `[inline]`

Returns the parameters used for this decompression run.

Returns:
  decompression parameters originally provide din the constructor.

References m_sparams.

SourceParams& dirac::SequenceDecompressor::GetSourceParams | ( |  | ) | `[inline]`

Returns the source parameters used for this decompression run.

Returns:
  source parameters.

References m_srcparams.

SequenceDecompressor& dirac::SequenceDecompressor::operator= | ( | const SequenceDecompressor & | rhs | ) | `[private]`

Assignment = is private and body-less. This class should not be assigned.

## Member Data Documentation

bool dirac::SequenceDecompressor::m_all_done`[private]`

DecoderParams dirac::SequenceDecompressor::m_decparams`[private]`

ParseParams dirac::SequenceDecompressor::m_parse_params`[private]`

Referenced by GetParseParams().

SeqParams dirac::SequenceDecompressor::m_sparams`[private]`

Referenced by GetSeqParams().

SourceParams dirac::SequenceDecompressor::m_srcparams`[private]`

Referenced by GetSourceParams().

FrameBuffer* dirac::SequenceDecompressor::m_fbuffer`[private]`

int dirac::SequenceDecompressor::m_current_code_fnum`[private]`

int dirac::SequenceDecompressor::m_delay`[private]`

int dirac::SequenceDecompressor::m_last_frame_read`[private]`

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

FrameDecompressor* dirac::SequenceDecompressor::m_fdecoder`[private]`

int dirac::SequenceDecompressor::m_current_accessunit_fnum`[private]`

int dirac::SequenceDecompressor::m_highest_fnum`[private]`

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

- seq_decompress.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.