Dirac - A Video Codec

Created by the British Broadcasting Corporation.


dirac::PictureBuffer Class Reference

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

#include <picture_buffer.h>

Collaboration diagram for dirac::PictureBuffer:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Private Member Functions

Private Attributes


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

dirac::PictureBuffer::PictureBuffer (  ) 

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

Creates a PictureBuffer 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:
cf the Chroma format of pictures in the buffer
xlen the luma width of pictures in the buffer
ylen the luma height of pictures in the buffer
luma_depth the video depth of the luma comp in the buffer
chroma_depth the video depth of the chroma comp in the buffer
using_ac True if using Arithmetic coding to code coefficient data

dirac::PictureBuffer::PictureBuffer ( 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 PictureBuffer 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:
cf the Chroma format of pictures in the buffer
numL1 the number of Layer 1 pictures before the next I picture. 0 means that there is only one I picture.
L1sep the number of Layer 2 pictures between Layer 1 pictures
xlen the luma width of pictures in the buffer
ylen the luma height of pictures in the buffer
luma_depth the video depth of the luma comp in the buffer
chroma_depth the video depth of the chroma comp in the buffer
interlace Set true if material is being coded in interlaced mode
using_ac True if using Arithmetic coding to code coefficient data

dirac::PictureBuffer::PictureBuffer ( const PictureBuffer cpy  ) 

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

dirac::PictureBuffer::~PictureBuffer (  ) 


Member Function Documentation

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

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

Picture& dirac::PictureBuffer::GetPicture ( const unsigned int  pnum  ) 

const Picture& dirac::PictureBuffer::GetPicture ( const unsigned int  pnum  )  const

Picture& dirac::PictureBuffer::GetPicture ( const unsigned int  pnum,
bool &  is_present 
)

const Picture& dirac::PictureBuffer::GetPicture ( const unsigned int  pnum,
bool &  is_present 
) const

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

PicArray& dirac::PictureBuffer::GetComponent ( const unsigned int  pic_num,
CompSort  c 
)

const PicArray& dirac::PictureBuffer::GetComponent ( const unsigned int  pic_num,
CompSort  c 
) const

PicArray& dirac::PictureBuffer::GetUpComponent ( const unsigned int  pic_num,
CompSort  c 
)

const PicArray& dirac::PictureBuffer::GetUpComponent ( const unsigned int  pic_num,
CompSort  c 
) const

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

void dirac::PictureBuffer::PushPicture ( const unsigned int  pic_num  ) 

Put a new picture into the top of the buffer. Picture parameters associated with the picture will be the built-in parameters for the buffer.

Parameters:
pic_num the number of the picture being inserted

void dirac::PictureBuffer::PushPicture ( const PictureParams fp  ) 

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

void dirac::PictureBuffer::PushPicture ( const Picture picture  ) 

Put a copy of a new picture into the top of the buffer.

void dirac::PictureBuffer::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_pnum picture number in display order that can be output
current_coded_pnum picture number in display order of picture currently being coded

void dirac::PictureBuffer::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_pnum picture number in display order that can be output
current_coded_pnum picture number in display order of picture currently being coded

void dirac::PictureBuffer::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_pnum picture number in display order that can be output
current_coded_pnum picture number in display order of picture currently being coded

void dirac::PictureBuffer::Clean ( int  pnum  ) 

Delete picture.

Parameters:
pnum picture number in display order to be deleted from picture buffer

const PictureParams& dirac::PictureBuffer::GetPictureParams (  )  const [inline]

References m_pparams.

PictureParams& dirac::PictureBuffer::GetPictureParams (  )  [inline]

References m_pparams.

void dirac::PictureBuffer::SetPictureParams ( const unsigned int  pnum  ) 

void dirac::PictureBuffer::Remove ( const unsigned int  pnum  )  [private]

Remove a picture with a given picture number (in display order) from the buffer. Searches through the buffer and removes picture(s) with that number.

void dirac::PictureBuffer::SetProgressiveParams ( const unsigned int  pnum  )  [private]

void dirac::PictureBuffer::SetInterlacedParams ( const unsigned int  pnum  )  [private]


Member Data Documentation

std::vector<Picture*> dirac::PictureBuffer::m_pic_data [private]

std::vector<bool> dirac::PictureBuffer::m_pic_in_use [private]

std::map<unsigned int,unsigned int> dirac::PictureBuffer::m_pnum_map [private]

Referenced by GetPictureParams().

unsigned int dirac::PictureBuffer::m_num_L1 [private]

unsigned int dirac::PictureBuffer::m_L1_sep [private]

unsigned int dirac::PictureBuffer::m_gop_len [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.