mode_decision.c File Reference

Main macroblock mode decision functions and helpers. More...

#include <math.h>
#include <limits.h>
#include <float.h>
#include "global.h"
#include "rdopt_coding_state.h"
#include "mb_access.h"
#include "intrarefresh.h"
#include "image.h"
#include "transform8x8.h"
#include "ratectl.h"
#include "mode_decision.h"
#include "fmo.h"
#include "me_umhex.h"
#include "me_umhexsmp.h"
#include "macroblock.h"
#include "rdoq.h"
#include "errdo.h"
#include "q_around.h"

Include dependency graph for mode_decision.c:

Go to the source code of this file.

Functions

void reset_valid_modes (RD_PARAMS *enc_mb)
void init_enc_mb_params (Macroblock *currMB, RD_PARAMS *enc_mb, int intra, int bslice)
void list_prediction_cost (Macroblock *currMB, int list, int block, int mode, RD_PARAMS *enc_mb, int bmcost[5], char best_ref[2])
int compute_ref_cost (RD_PARAMS *enc_mb, int ref, int list)
void determine_prediction_list (int mode, int bmcost[5], char best_ref[2], char *best_pdir, int *cost, short *bipred_me)
void compute_mode_RD_cost (Slice *currSlice, Macroblock *currMB, RD_PARAMS *enc_mb, int mode, double *min_rdcost, double *min_dcost, double *min_rate, int i16mode, short bslice, short *inter_skip, int is_cavlc)
void submacroblock_mode_decision (Slice *currSlice, RD_PARAMS *enc_mb, RD_8x8DATA *dataTr, Macroblock *currMB, int ****cofACtr, int *have_direct, short bslice, int block, int *cost_direct, int *cost, int *cost8x8_direct, int transform8x8, int is_cavlc)
void submacroblock_mode_decision_low (Slice *currSlice, RD_PARAMS *enc_mb, RD_8x8DATA *dataTr, Macroblock *currMB, int ****cofACtr, int *have_direct, short bslice, int block, int *cost_direct, int *cost, int *cost8x8_direct, int transform8x8, int is_cavlc)
int check_for_SI16 ()
void get_initial_mb16x16_cost (Macroblock *currMB)
void adjust_mb16x16_cost (int cost)
void update_lambda_costs (RD_PARAMS *enc_mb, int lambda_mf[3])
int iminarray (int arr[], int size, int *minind)
int is_bipred_enabled (int mode)
int transform_termination_control (Macroblock *currMB, int mode, int bslice)
int bslice_16x16_termination_control (Block8x8Info *b8x8info, int *ctr16x16, int mode, int bslice)

Variables

const int b8_mode_table [6] = {0, 4, 5, 6, 7}
const int mb_mode_table [9] = {0, 1, 2, 3, P8x8, I16MB, I4MB, I8MB, IPCM}
int luma_transform_size_8x8_flag


Detailed Description

Main macroblock mode decision functions and helpers.

Definition in file mode_decision.c.


Function Documentation

int bslice_16x16_termination_control ( Block8x8Info *  b8x8info,
int *  ctr16x16,
int  mode,
int  bslice 
)

Update prediction direction for mode P16x16 to check all prediction directions.

Definition at line 1342 of file mode_decision.c.

References Block8x8Info::best8x8pdir, Block8x8Info::bipred8x8me, InputParameters::BiPredMotionEstimation, and error().

Referenced by compute_mode_RD_cost().

Here is the call graph for this function:

int check_for_SI16 ( void   ) 

Checks whether a primary SP slice macroblock was encoded as I16.

Definition at line 1196 of file mode_decision.c.

References ImageParameters::pix_x, and ImageParameters::pix_y.

Referenced by init_enc_mb_params().

void compute_mode_RD_cost ( Slice *  currSlice,
Macroblock *  currMB,
RD_PARAMS *  enc_mb,
int  mode,
double *  min_rdcost,
double *  min_dcost,
double *  min_rate,
int  i16mode,
short  bslice,
short *  inter_skip,
int  is_cavlc 
)

void determine_prediction_list ( int  mode,
int  bmcost[5],
char  best_ref[2],
char *  best_pdir,
int *  cost,
short *  bipred_me 
)

Determination of prediction list based on simple distortion computation.

Definition at line 284 of file mode_decision.c.

References iminarray().

Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), encode_one_macroblock_low(), submacroblock_mode_decision(), and submacroblock_mode_decision_low().

Here is the call graph for this function:

int iminarray ( int  arr[],
int  size,
int *  minind 
)

Return array's minimum and its index.

Definition at line 1256 of file mode_decision.c.

Referenced by determine_prediction_list().

void init_enc_mb_params ( Macroblock *  currMB,
RD_PARAMS *  enc_mb,
int  intra,
int  bslice 
)

int is_bipred_enabled ( int  mode  ) 

void list_prediction_cost ( Macroblock *  currMB,
int  list,
int  block,
int  mode,
RD_PARAMS *  enc_mb,
int  bmcost[5],
char  best_ref[2] 
)

void reset_valid_modes ( RD_PARAMS *  enc_mb  ) 

Reset Valid Modes.

Definition at line 43 of file mode_decision.c.

Referenced by init_enc_mb_params().

void submacroblock_mode_decision ( Slice *  currSlice,
RD_PARAMS *  enc_mb,
RD_8x8DATA *  dataTr,
Macroblock *  currMB,
int ****  cofACtr,
int *  have_direct,
short  bslice,
int  block,
int *  cost_direct,
int *  cost,
int *  cost8x8_direct,
int  transform8x8,
int  is_cavlc 
)

void submacroblock_mode_decision_low ( Slice *  currSlice,
RD_PARAMS *  enc_mb,
RD_8x8DATA *  dataTr,
Macroblock *  currMB,
int ****  cofACtr,
int *  have_direct,
short  bslice,
int  block,
int *  cost_direct,
int *  cost,
int *  cost8x8_direct,
int  transform8x8,
int  is_cavlc 
)

int transform_termination_control ( Macroblock *  currMB,
int  mode,
int  bslice 
)

Decides whether to perform tranform 8x8 for this mode.

Definition at line 1308 of file mode_decision.c.

References macroblock::luma_transform_size_8x8_flag, and InputParameters::Transform8x8Mode.

Referenced by compute_mode_RD_cost().


Documentation generated with DoxyGen