Dirac - A Video Codec

Created by the British Broadcasting Corporation.


dirac::EncQueue Class Reference

Holds pictures both for reference and to overcome reordering delay. More...

#include <enc_queue.h>

Public Member Functions

 EncQueue ()
 Default Constructor.
 EncQueue (ChromaFormat cf, const int xlen, const int ylen, const unsigned int luma_depth, const unsigned int chroma_depth, bool using_ac)
 Constructor.
 EncQueue (ChromaFormat cf, const int numL1, const int L1sep, const int xlen, const int ylen, const unsigned int luma_depth, const unsigned int chroma_depth, bool interlace, bool using_ac)
 Constructor.
 EncQueue (const EncQueue &cpy)
 Copy constructor.
EncQueueoperator= (const EncQueue &rhs)
 Operator=.
 ~EncQueue ()
 Destructor.
EncPictureGetPicture (const unsigned int pnum)
 Get picture with a given picture number (NOT with a given position in the buffer)
const EncPictureGetPicture (const unsigned int pnum) const
 Get picture with a given picture number (NOT with a given position in the buffer)
EncPictureGetPicture (const unsigned int pnum, bool &is_present)
 Get picture with a given picture number, setting a flag to true if it's there.
const EncPictureGetPicture (const unsigned int pnum, bool &is_present) const
 Get picture with a given picture number, setting a flag to true if it's there.
bool IsPictureAvail (const unsigned int pnum) const
 Return true if picture with the particular picture number is available else return false.
std::vector< int > Members () const
 Returns a list of member pictures.
int Size () const
 Returns the size of the queue.
void PushPicture (const PictureParams &pp)
 Put a new picture into the top of the buffer.
void CopyPicture (const EncPicture &picture)
 Put a copy of a new picture into the buffer.
void SetRetiredPictureNum (const int show_pnum, const int current_coded_pnum)
 Sets the reference picture number that will be cleaned.
void CleanAll (const int show_pnum, const int current_coded_pnum)
 Delete all expired pictures.
void CleanRetired (const int show_pnum, const int current_coded_pnum)
 Delete retired reference pictures and expired non-ref pictures.
void Remove (int pnum)
 Delete picture.

Private Member Functions

void ClearSlot (const unsigned int pos)
 Clear internal data slot number pos.

Private Attributes

std::vector< EncPicture * > m_pic_data
 the buffer storing all the values
std::map< unsigned int, unsigned int > m_pnum_map
 the map from picture numbers to position in the buffer

Detailed Description

The buffer holds pictures in a stack to overcome both reordering due to bi-directional prediction and use as references for subsequence motion estimation. Pictures, and components of pictures, can be accessed by their picture numbers. GOP parameters can be included in the constructors so that pictures can be given types (I picture, L1 picture or L2 picture) on being pushed onto the stack; alternatively, these parameters can be overridden.

Constructor & Destructor Documentation

◆ EncQueue() [1/4]

dirac::EncQueue::EncQueue ( )

Referenced by EncQueue(), and operator=().

◆ EncQueue() [2/4]

dirac::EncQueue::EncQueue ( ChromaFormat cf,
const int xlen,
const int ylen,
const unsigned int luma_depth,
const unsigned int chroma_depth,
bool using_ac )

Creates a EncQueue using the chroma format. Suitable for compressing when there are no L2 pictures, or when the temporal prediction structure is to be determined on the fly.

Parameters
cfthe Chroma format of pictures in the buffer
xlenthe luma width of pictures in the buffer
ylenthe luma height of pictures in the buffer
luma_depththe video depth of the luma comp in the buffer
chroma_depththe video depth of the chroma comp in the buffer
using_acTrue if using Arithmetic coding to code coefficient data

◆ EncQueue() [3/4]

dirac::EncQueue::EncQueue ( ChromaFormat cf,
const int numL1,
const int L1sep,
const int xlen,
const int ylen,
const unsigned int luma_depth,
const unsigned int chroma_depth,
bool interlace,
bool using_ac )

Creates a EncQueue using the chroma format, the number of L1 pictures between I pictures and the separation in pictures between L1 pictures. Suitable for compressing when there is a full GOP structure or when the temporal prediction structure is to be determined on the fly.

Parameters
cfthe Chroma format of pictures in the buffer
numL1the number of Layer 1 pictures before the next I picture. 0 means that there is only one I picture.
L1septhe number of Layer 2 pictures between Layer 1 pictures
xlenthe luma width of pictures in the buffer
ylenthe luma height of pictures in the buffer
luma_depththe video depth of the luma comp in the buffer
chroma_depththe video depth of the chroma comp in the buffer
interlaceSet true if material is being coded in interlaced mode
using_acTrue if using Arithmetic coding to code coefficient data

◆ EncQueue() [4/4]

dirac::EncQueue::EncQueue ( const EncQueue & cpy)

Copy constructor. Removes the current contents of the pictureture buffer and copies in the contents of the initialising buffer.

References EncQueue().

◆ ~EncQueue()

dirac::EncQueue::~EncQueue ( )

Member Function Documentation

◆ CleanAll()

void dirac::EncQueue::CleanAll ( const int show_pnum,
const int current_coded_pnum )

Delete pictures which have been output and which are no longer required for reference. Expiry times are set in each picture's picture parameters.

Parameters
show_pnumpicture number in display order that can be output
current_coded_pnumpicture number in display order of picture currently being coded

◆ CleanRetired()

void dirac::EncQueue::CleanRetired ( const int show_pnum,
const int current_coded_pnum )

Delete pictures which have been output and retired reference pictures. Expiry times are set in each picture's picture parameters.

Parameters
show_pnumpicture number in display order that can be output
current_coded_pnumpicture number in display order of picture currently being coded

◆ ClearSlot()

void dirac::EncQueue::ClearSlot ( const unsigned int pos)
private

Clear internal data slot number pos

◆ CopyPicture()

void dirac::EncQueue::CopyPicture ( const EncPicture & picture)

Put a copy of a new picture into the buffer.

◆ GetPicture() [1/4]

EncPicture & dirac::EncQueue::GetPicture ( const unsigned int pnum)

◆ GetPicture() [2/4]

const EncPicture & dirac::EncQueue::GetPicture ( const unsigned int pnum) const

◆ GetPicture() [3/4]

EncPicture & dirac::EncQueue::GetPicture ( const unsigned int pnum,
bool & is_present )

◆ GetPicture() [4/4]

const EncPicture & dirac::EncQueue::GetPicture ( const unsigned int pnum,
bool & is_present ) const

◆ IsPictureAvail()

bool dirac::EncQueue::IsPictureAvail ( const unsigned int pnum) const

◆ Members()

std::vector< int > dirac::EncQueue::Members ( ) const

◆ operator=()

EncQueue & dirac::EncQueue::operator= ( const EncQueue & rhs)

Operator=. Assigns all elements of the rhs to the lhs.

References EncQueue().

◆ PushPicture()

void dirac::EncQueue::PushPicture ( const PictureParams & pp)

Put a new picture into the top of the buffer. EncPicture parameters associated with the picture will be as given by the picture parameter object.

◆ Remove()

void dirac::EncQueue::Remove ( int pnum)

Delete picture.

Parameters
pnumpicture number in display order to be deleted from picture buffer

◆ SetRetiredPictureNum()

void dirac::EncQueue::SetRetiredPictureNum ( const int show_pnum,
const int current_coded_pnum )

Indicate which picture which has been output and which is no longer required for reference. Expiry times are set in each picture's picture parameters.

Parameters
show_pnumpicture number in display order that can be output
current_coded_pnumpicture number in display order of picture currently being coded

◆ Size()

int dirac::EncQueue::Size ( ) const
inline

References m_pic_data.

Member Data Documentation

◆ m_pic_data

std::vector<EncPicture*> dirac::EncQueue::m_pic_data
private

Referenced by Size().

◆ m_pnum_map

std::map<unsigned int,unsigned int> dirac::EncQueue::m_pnum_map
private

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

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