Dirac - A Video Codec

Created by the British Broadcasting Corporation.


dirac::MotionCompensator Class Referenceabstract

Abstract Motion compensator class. More...

#include <mot_comp.h>

Inheritance diagram for dirac::MotionCompensator:
Collaboration diagram for dirac::MotionCompensator:

Public Member Functions

 MotionCompensator (const PicturePredParams &ppp)
 Constructor.
virtual ~MotionCompensator ()
 Destructor.
void CreateBlock (int xbsep, int ybsep, bool FullX, bool FullY, TwoDArray< ValueType > &WeightArray)
 Compensate a picture.
*Flips the values in an array in the x direction void FlipX (const TwoDArray< ValueType > &Original, TwoDArray< ValueType > &Flipped)
*Flips the values in an array in the y direction void FlipY (const TwoDArray< ValueType > &Original, TwoDArray< ValueType > &Flipped)
virtual void CompensateBlock (TwoDArray< ValueType > &pic_data, const ImageCoords &pos, const ImageCoords &orig_pic_size, PredMode block_mode, ValueType dc, const PicArray &ref1up_data, const MVector &mv1, const PicArray &ref2up_data, const MVector &mv2, const TwoDArray< ValueType > &Weights)
*Predict pixels in a block Pure virtual SubClasses need to define virtual it void BlockPixelPred (TwoDArray< ValueType > &block_data, const ImageCoords &pos, const ImageCoords &orig_pic_size, const PicArray &refup_data, const MVector &mv)=0
void AdjustBlockByRefWeights (TwoDArray< ValueType > &val1_block, TwoDArray< ValueType > &val2_block, PredMode block_mode)
void AdjustBlockBySpatialWeights (TwoDArray< ValueType > &val_block, const ImageCoords &pos, const TwoDArray< ValueType > &wt_array)

Static Public Member Functions

static void CompensatePicture (const PicturePredParams &ppp, const AddOrSub direction, const MvData &mv_data, Picture *in_pic, Picture *refptr[2])
 Convenience function to perform motion compensation on a picture.

Protected Attributes

*The codec parameters PicturePredParams m_predparams
*The chroma format ChromaFormat m_cformat
bool luma_or_chroma
AddOrSub m_add_or_sub
OLBParams m_bparams
TwoDArray< ValueType > * m_block_weights
TwoDArray< ValueType > * m_macro_block_weights
TwoDArray< ValueType > * m_sub_block_weights

Detailed Description

Motion compensator class, for doing motion compensation with two references and overlapped blocks, using raised-cosine roll-off. This is an abstract class. It must be sub-classed and the BlockPixelPred must be defined in the sub-classes.

Constructor & Destructor Documentation

◆ MotionCompensator()

dirac::MotionCompensator::MotionCompensator ( const PicturePredParams & ppp)

Constructor initialises using codec parameters.

Referenced by CompensatePicture().

◆ ~MotionCompensator()

virtual dirac::MotionCompensator::~MotionCompensator ( )
virtual

Member Function Documentation

◆ AdjustBlockByRefWeights()

void dirac::MotionCompensator::AdjustBlockByRefWeights ( TwoDArray< ValueType > & val1_block,
TwoDArray< ValueType > & val2_block,
PredMode block_mode )

◆ AdjustBlockBySpatialWeights()

void dirac::MotionCompensator::AdjustBlockBySpatialWeights ( TwoDArray< ValueType > & val_block,
const ImageCoords & pos,
const TwoDArray< ValueType > & wt_array )

◆ BlockPixelPred()

*Predict pixels in a block Pure virtual SubClasses need to define virtual it void dirac::MotionCompensator::BlockPixelPred ( TwoDArray< ValueType > & block_data,
const ImageCoords & pos,
const ImageCoords & orig_pic_size,
const PicArray & refup_data,
const MVector & mv )
pure virtual

◆ CompensateBlock()

virtual void dirac::MotionCompensator::CompensateBlock ( TwoDArray< ValueType > & pic_data,
const ImageCoords & pos,
const ImageCoords & orig_pic_size,
PredMode block_mode,
ValueType dc,
const PicArray & ref1up_data,
const MVector & mv1,
const PicArray & ref2up_data,
const MVector & mv2,
const TwoDArray< ValueType > & Weights )
virtual

◆ CompensatePicture()

void dirac::MotionCompensator::CompensatePicture ( const PicturePredParams & ppp,
const AddOrSub direction,
const MvData & mv_data,
Picture * in_pic,
Picture * refptr[2] )
static

Static function that motion compensates a picture. It uses the MV precision value in the PicturePredParams to instantiate the appropriate MotionCompensation sub-class.

Parameters
pppPicture prediction parameters
directionwhether we're subtracting or adding
mv_datathe motion vector data
in_picPointer to picture being motion compensated
refptrArray of pointers to reference pictures.

References CompensatePicture(), and MotionCompensator().

Referenced by CompensatePicture().

◆ CreateBlock()

void dirac::MotionCompensator::CreateBlock ( int xbsep,
int ybsep,
bool FullX,
bool FullY,
TwoDArray< ValueType > & WeightArray )
    Perform motion compensated addition/subtraction on a picture using
    parameters
    \param    direction whether we're subtracting or adding

`

Parameters
mv_datathe motion vector data
in_picPointer to picture being motion compensated
refsptrArray of pointers to reference pictures. */ void CompensatePicture( const AddOrSub direction , const MvData& mv_data, Picture* in_pic , Picture* refsptr[2] );

private: private, body-less copy constructor: this class should not be copied MotionCompensator( const MotionCompensator& cpy ); private, body-less assignment=: this class should not be assigned MotionCompensator& operator=( const MotionCompensator& rhs );

functions

    Motion-compensate a component
void CompensateComponent( Picture* pic ,
                          Picture* refsptr[2] ,
                          const MvData& mv_data , const CompSort cs);

    Recalculate the weight matrix and store other key block related parameters.
    DC-compensate an individual block
void DCBlock( TwoDArray<ValueType> &block_data ,
              const ValueType dc);
void ReConfig();

Calculates a weighting arrays blocks. void CalculateWeights(int xbsep, int ybsep, TwoDArray<ValueType>* wt_array);

Calculates a weighting block.

/*! Params defines the block parameters so the relevant weighting arrays can be created. FullX and FullY refer to whether the weight should be adjusted for the edge of an image. eg. 1D Weighting shapes in x direction FullX true FullX false


  • *
    • *
      • *

◆ FlipX()

*Flips the values in an array in the x direction void dirac::MotionCompensator::FlipX ( const TwoDArray< ValueType > & Original,
TwoDArray< ValueType > & Flipped )

◆ FlipY()

*Flips the values in an array in the y direction void dirac::MotionCompensator::FlipY ( const TwoDArray< ValueType > & Original,
TwoDArray< ValueType > & Flipped )

Member Data Documentation

◆ luma_or_chroma

bool dirac::MotionCompensator::luma_or_chroma
protected

◆ m_add_or_sub

AddOrSub dirac::MotionCompensator::m_add_or_sub
protected

◆ m_block_weights

TwoDArray<ValueType>* dirac::MotionCompensator::m_block_weights
protected

◆ m_bparams

OLBParams dirac::MotionCompensator::m_bparams
protected

◆ m_cformat

* The chroma format ChromaFormat dirac::MotionCompensator::m_cformat
protected

◆ m_macro_block_weights

TwoDArray<ValueType>* dirac::MotionCompensator::m_macro_block_weights
protected

◆ m_predparams

* The codec parameters PicturePredParams dirac::MotionCompensator::m_predparams
protected

◆ m_sub_block_weights

TwoDArray<ValueType>* dirac::MotionCompensator::m_sub_block_weights
protected

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.