# Dirac - A Video Codec

Created by the British Broadcasting Corporation.

# dirac::MotionEstimator Class Reference

Class to handle the whole motion estimation process. More...

`#include <motion_estimate.h>`

Collaboration diagram for dirac::MotionEstimator:

[legend]

List of all members.

## Public Member Functions

- MotionEstimator (const EncoderParams &encp)
    Constructor.
- ~MotionEstimator ()
    Destructor.
- void DoME (const FrameBuffer &my_buffer, int frame_num, MEData &me_data)
    Do the motion estimation.

## Private Member Functions

- MotionEstimator (const MotionEstimator &cpy)
    Copy constructor: private, body-less - class should not be copied.
- MotionEstimator & operator= (const MotionEstimator &rhs)
    Assignment= : //private, body-less - class should not be assigned.
- void SetChromaDC (const FrameBuffer &my_buffer, int frame_num, MvData &mv_data)
    Go through all the intra blocks and extract the chroma dc values to be coded.
- void SetChromaDC (const PicArray &pic_data, MvData &mv_data, CompSort csort)
    Called by previous fn for each component.
- ValueType GetChromaBlockDC (const PicArray &pic_data, int xloc, int yloc, int split)
    Called by previous fn for each block.

## Private Attributes

- const EncoderParams & m_encparams
    A local reference to the encoder parameters.

## Detailed Description

Class to handle the whole motion estimation process, which works in three stages.

First a pixel-accurate estimate is formed by looking at the current frame data and the data from the reference frame(s). Motion vectors are found for every block.

Second, these pixel-accurate motion vectors are refined to sub-pixel accuracy. This means some sort of upconversion needs to be applied to the reference. This can be done by actually upconverting the reference to create a bigger picture or by doing some interpolation of values on the fly.

Third, mode decisions have to be made. This means choosing which (if any) reference to use for each block, and whether to use the same motion vectors for groups of blocks together. A 2x2 group of blocks is called a sub-MB and a 4x4 group of blocks is a MB (Macroblock). All the MV data is organised by MB.

## Constructor & Destructor Documentation

dirac::MotionEstimator::MotionEstimator | ( | const EncoderParams & | encp | ) |

dirac::MotionEstimator::~MotionEstimator | ( |  | ) | `[inline]`

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

## Member Function Documentation

void dirac::MotionEstimator::DoME | ( | const FrameBuffer & | my_buffer,
|  | int | frame_num,
|  | MEData & | me_data |
| ) |  |  |

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

void dirac::MotionEstimator::SetChromaDC | ( | const FrameBuffer & | my_buffer,
|  | int | frame_num,
|  | MvData & | mv_data |
| ) |  |  | `[private]`

void dirac::MotionEstimator::SetChromaDC | ( | const PicArray & | pic_data,
|  | MvData & | mv_data,
|  | CompSort | csort |
| ) |  |  | `[private]`

ValueType dirac::MotionEstimator::GetChromaBlockDC | ( | const PicArray & | pic_data,
|  | int | xloc,
|  | int | yloc,
|  | int | split |
| ) |  |  | `[private]`

## Member Data Documentation

const EncoderParams& dirac::MotionEstimator::m_encparams `[private]`

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

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