dirac::FrameBuffer Class Reference

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

#include <frame_buffer.h>

List of all members.

Public Member Functions

 FrameBuffer (ChromaFormat cf, int xlen, int ylen)
 Constructor.
 FrameBuffer (ChromaFormat cf, int L1sep, int xlen, int ylen)
 Constructor.
 FrameBuffer (ChromaFormat cf, int numL1, int L1sep, int xlen, int ylen)
 Constructor.
 FrameBuffer (const FrameBuffer &cpy)
 Copy constructor.
FrameBufferoperator= (const FrameBuffer &rhs)
 Operator=.
 ~FrameBuffer ()
 Destructor.
FrameGetFrame (unsigned int fnum)
 Get frame with a given frame number (NOT with a given position in the buffer).
const FrameGetFrame (unsigned int fnum) const
 Get frame with a given frame number (NOT with a given position in the buffer).
PicArrayGetComponent (unsigned int frame_num, CompSort c)
 Get component with a given component sort and frame number (NOT with a given position in the buffer).
const PicArrayGetComponent (unsigned int frame_num, CompSort c) const
 Get component with a given component sort and frame number (NOT with a given position in the buffer).
PicArrayGetUpComponent (unsigned int frame_num, CompSort c)
 Get upconverted component with a given component sort and frame number (NOT with a given position in the buffer).
const PicArrayGetUpComponent (unsigned int frame_num, CompSort c) const
 Get upconverted component with a given component sort and frame number (NOT with a given position in the buffer).
size_t Size () const
 Return the number of frames in the buffer.
void PushFrame (unsigned int frame_num)
 Put a new frame into the top of the buffer.
void PushFrame (const FrameParams &fp)
 Put a new frame into the top of the buffer.
void PushFrame (const Frame &frame)
 Put a copy of a new frame into the top of the buffer.
void PushFrame (StreamPicInput *picin, const FrameParams &fp)
 Read a new frame into the buffer.
void PushFrame (StreamPicInput *picin, unsigned int fnum)
 Read a new frame into the buffer.
void Clean (int fnum)
 Delete expired frames.
const FrameParamsGetFParams () const
 Return the default frame parameters.


Detailed Description

Holds frames both for reference and to overcome reordering delay.

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

Definition at line 59 of file frame_buffer.h.


Constructor & Destructor Documentation

FrameBuffer::FrameBuffer ChromaFormat  cf,
int  xlen,
int  ylen
 

Constructor.

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

Parameters:
cf the Chroma format of frames in the buffer
xlen the width of frames in the buffer
ylen the hieght of frames in the buffer

Definition at line 43 of file frame_buffer.cpp.

FrameBuffer::FrameBuffer ChromaFormat  cf,
int  L1sep,
int  xlen,
int  ylen
 

Constructor.

Creates a FrameBuffer using the chroma format and the separation in frames between L1 frames. Suitable for compressing when there is no GOP structure, only an initial I-frame, or when the temporal prediction structure is to be determined on the fly.

Parameters:
cf the Chroma format of frames in the buffer
L1sep the number of Layer 2 frames between Layer 1 frames
xlen the width of frames in the buffer
ylen the hieght of frames in the buffer

Definition at line 51 of file frame_buffer.cpp.

FrameBuffer::FrameBuffer ChromaFormat  cf,
int  numL1,
int  L1sep,
int  xlen,
int  ylen
 

Constructor.

Creates a FrameBuffer using the chroma format, the number of L1 frames between I frames and the separation in frames between L1 frames. 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 frames in the buffer
numL1 the number of Layer 1 frames before the next I frame. 0 means that there is only one I frame.
L1sep the number of Layer 2 frames between Layer 1 frames
xlen the width of frames in the buffer
ylen the hieght of frames in the buffer

Definition at line 59 of file frame_buffer.cpp.

FrameBuffer::FrameBuffer const FrameBuffer cpy  ) 
 

Copy constructor.

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

Definition at line 80 of file frame_buffer.cpp.

References m_frame_data.


Member Function Documentation

void FrameBuffer::Clean int  fnum  ) 
 

Delete expired frames.

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

Definition at line 308 of file frame_buffer.cpp.

Referenced by dirac::SequenceCompressor::CompressNextFrame(), and dirac::SequenceDecompressor::DecompressNextFrame().

FrameBuffer & FrameBuffer::operator= const FrameBuffer rhs  ) 
 

Operator=.

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

Definition at line 102 of file frame_buffer.cpp.

References m_fnum_map, m_fparams, and m_frame_data.

void FrameBuffer::PushFrame StreamPicInput picin,
unsigned int  fnum
 

Read a new frame into the buffer.

Read a new frame into the buffer. Frame parameters associated with the frame will be derived from the frame number and the internal GOP parameters in the frame buffer.

Parameters:
picin the picture input
fnum the frame number

Definition at line 277 of file frame_buffer.cpp.

References PushFrame().

void FrameBuffer::PushFrame StreamPicInput picin,
const FrameParams fp
 

Read a new frame into the buffer.

Read a new frame into the buffer. Frame parameters associated with the frame will be as given by the frame parameter object.

Parameters:
picin the picture input
fp the frame parameters to apply to the frame

Definition at line 269 of file frame_buffer.cpp.

References PushFrame(), and dirac::StreamPicInput::ReadNextFrame().

void FrameBuffer::PushFrame const Frame frame  ) 
 

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

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

Definition at line 254 of file frame_buffer.cpp.

References dirac::FrameParams::FrameNum(), and dirac::Frame::GetFparams().

void FrameBuffer::PushFrame const FrameParams fp  ) 
 

Put a new frame into the top of the buffer.

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

Definition at line 241 of file frame_buffer.cpp.

References dirac::FrameParams::FrameNum().

void FrameBuffer::PushFrame unsigned int  frame_num  ) 
 

Put a new frame into the top of the buffer.

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

Parameters:
frame_num the number of the frame being inserted

Definition at line 227 of file frame_buffer.cpp.

References dirac::FrameParams::FrameNum(), and dirac::FrameParams::SetFrameNum().

Referenced by dirac::FrameDecompressor::Decompress(), dirac::SequenceCompressor::LoadNextFrame(), and PushFrame().


The documentation for this class was generated from the following files:
Generated on Tue Dec 13 14:49:21 2005 for guliverkli by  doxygen 1.4.5