Created by the British Broadcasting Corporation.
Decides between superblock and block prediction modes. More...
#include <me_mode_decn.h>
Public Member Functions | |
ModeDecider (const EncoderParams &encp) | |
Constructor. More... | |
~ModeDecider () | |
Destructor. More... | |
void | DoModeDecn (EncQueue &my_buffer, int pic_num) |
Does the actual mode decision. More... | |
Private Member Functions | |
ModeDecider (const ModeDecider &cpy) | |
ModeDecider & | operator= (const ModeDecider &rhs) |
void | DoSBDecn () |
void | DoLevelDecn (int level) |
Make a mode decision given a particular level of decomposition. More... | |
float | DoUnitDecn (const int xpos, const int ypos, const int level) |
Decide on a mode for a given prediction unit (block, sub-SB or SB) More... | |
void | DoME (const int xpos, const int ypos, const int level) |
Do motion estimation for a prediction unit at a given level. More... | |
float | ModeCost (const int xindex, const int yindex) |
Return a measure of the cost of coding a given mode. More... | |
ValueType | GetDCPred (int xblock, int yblock) |
Get a prediction for the dc value of a block. More... | |
float | GetDCVar (const ValueType dc_val, const ValueType dc_pred) |
Get a measure of DC value variance. More... | |
void | SetDC (EncQueue &my_buffer, int pic_num) |
Go through all the intra blocks and extract the chroma dc values to be coded. More... | |
void | SetDC (const PicArray &pic_data, MEData &me_data, CompSort cs) |
Called by previous fn for each component. More... | |
ValueType | GetBlockDC (const PicArray &pic_data, int xloc, int yloc, int split, CompSort cs) |
Called by previous fn for each block. More... | |
Private Attributes | |
PictureSort | m_psort |
const EncoderParams & | m_encparams |
A local reference to the encoder parameters. More... | |
const PicturePredParams * | m_predparams |
A local pointer to the picture prediction params. More... | |
float | m_lambda |
The Lagrangian parameter for motion estimation. More... | |
OneDArray< float > | m_level_factor |
Correction factor for comparing SAD costs for different SB splittings. More... | |
OneDArray< float > | m_mode_factor |
Correction factor for comparing mode costs for different SB splittings. More... | |
OneDArray< MEData * > | m_me_data_set |
Motion vector data for each level of splitting. More... | |
const PicArray * | m_pic_data |
const PicArray * | m_ref1_updata |
const PicArray * | m_ref2_updata |
int | num_refs |
IntraBlockDiff * | m_intradiff |
BiBlockDiff * | m_bicheckdiff |
int | m_xsb_loc |
int | m_ysb_loc |
Loops over all the superblocks and decides on the best modes. A superblock is a square of 16 blocks. There are three possible splitting levels: level 0 means the superblock is considered as a single block; level 1 means the superblock is considered as 4 larger blocks, termed sub-superblocks; level 0 means the superblock is split right down to blocks.
In deciding which modes to adopt, the ModeDecider object calculates costs for all permutations, doing motion estimation for the level 1 and level 0 modes as these have not been calculated before. The process of decision for each is as follows. For each SB, we loop over the levels, and call DoLevelDecn. DoLevelDecn does motion estimation if it's necessary. Then it assumes that we don't have a common block mode and calls DoUnitDecn which finds the best mode for each unit in the SB at that level, individually. When we've got a best cost for that level we go up to the next one.
dirac::ModeDecider::ModeDecider | ( | const EncoderParams & | encp | ) |
The constructor creates arrays for handling the motion vector data at splitting levels 0 and 1, as motion estimation must be performed for these levels.
dirac::ModeDecider::~ModeDecider | ( | ) |
The destructor destroys the classes created in the constructor
|
private |
|
private |
|
private |
void dirac::ModeDecider::DoModeDecn | ( | EncQueue & | my_buffer, |
int | pic_num | ||
) |
Does the mode decision
my_buffer | the buffer of all the relevant frames |
pic_num | the picture number for which motion estimation is being done |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
© 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.