#include <limits.h>
#include "global.h"
#include "memalloc.h"
#include "me_umhexsmp.h"
#include "refbuf.h"
#include "macroblock.h"
#include "me_distortion.h"
#include "mv_search.h"
Go to the source code of this file.
Defines | |
#define | SEARCH_ONE_PIXEL |
#define | SEARCH_ONE_PIXEL_BIPRED |
Functions | |
void | smpUMHEX_init (ImageParameters *p_Img) |
int | smpUMHEX_get_mem (ImageParameters *p_Img) |
void | smpUMHEX_free_mem (ImageParameters *p_Img) |
int | smpUMHEXIntegerPelBlockMotionSearch (Macroblock *currMB, MotionVector *pred_mv, MEBlock *mv_block, int min_mcost, int lambda_factor) |
int | smpUMHEXFullSubPelBlockMotionSearch (Macroblock *currMB, MotionVector *pred_mv, MEBlock *mv_block, int min_mcost, int lambda_factor) |
int | smpUMHEXSubPelBlockMotionSearch (Macroblock *currMB, MotionVector *pred_mv, MEBlock *mv_block, int min_mcost, int lambda_factor) |
int | smpUMHEXSubPelBlockME (Macroblock *currMB, MotionVector *pred_mv, MEBlock *mv_block, int min_mcost, int *lambda_factor) |
int | smpUMHEXBipredIntegerPelBlockMotionSearch (Macroblock *currMB, int list, MotionVector *pred_mv1, MotionVector *pred_mv2, MotionVector *mv1, MotionVector *mv2, MEBlock *mv_block, int search_range, int min_mcost, int lambda_factor) |
void | smpUMHEX_decide_intrabk_SAD (Macroblock *currMB) |
void | smpUMHEX_skip_intrabk_SAD (Macroblock *currMB) |
void | smpUMHEX_setup (Macroblock *currMB, short ref, int list, int block_y, int block_x, int blocktype, short ******all_mv) |
Variables | |
static const MotionVector | Diamond [4] = {{-4, 0}, {4, 0}, {0, -4}, {0, 4}} |
static const MotionVector | Diamond_SubPelSearch [4] = {{-1, 0}, {1, 0}, {0, -1}, {0, 1}} |
static const MotionVector | Hexagon [6] = {{-8, 0}, {8, 0},{-4, -8}, {4, 8}, {-4, 8}, {4 , -8}} |
static const short | Big_Hexagon_X [16] = {-16, 16, 0, 0,-16, 16,-16, 16,-16, 16,-16, 16,-8, 8,-8, 8} |
static const short | Big_Hexagon_Y [16] = { 0, 0,-16, 16,-4, 4, 4,-4,-8, 8, 8,-8,-12, 12, 12,-12} |
static const short | block_type_shift_factor [8] = {0, 0, 1, 1, 2, 3, 3, 1} |
Definition in file me_umhexsmp.c.
#define SEARCH_ONE_PIXEL |
Value:
if((iabs(cand.mv_x - center.mv_x)>>2) <= search_range && \ (iabs(cand.mv_y - center.mv_y)>>2) <= search_range) \ { \ mcost = mv_cost (p_Img, lambda_factor, &cand, &pred); \ mcost += mv_block->computePredFPel( ref_picture, mv_block, min_mcost - mcost, &cand); \ if (mcost < min_mcost) \ { \ best = cand; \ min_mcost = mcost; \ } \ }
Definition at line 48 of file me_umhexsmp.c.
#define SEARCH_ONE_PIXEL_BIPRED |
Value:
if ((iabs(cand.mv_x - center2.mv_x)>>2) <= search_range \ && (iabs(cand.mv_y - center2.mv_x)>>2) <= search_range) \ { \ mcost = mv_cost (p_Img, lambda_factor, ¢er1, &pred1); \ mcost += mv_cost (p_Img, lambda_factor, &cand, &pred2); \ if (mcost < min_mcost) \ { \ mcost += mv_block->computeBiPredFPel(ref_picture1, ref_picture2, \ mv_block, min_mcost - mcost, ¢er1, &cand); \ if (mcost < min_mcost) \ { \ best = cand; \ min_mcost = mcost; \ } \ } \ }
Definition at line 61 of file me_umhexsmp.c.
void smpUMHEX_decide_intrabk_SAD | ( | Macroblock * | currMB | ) |
Set neighbouring block mode (intra/inter) used for fast motion estimation.
Definition at line 886 of file me_umhexsmp.c.
References macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, macroblock::pix_y, and slice::slice_type.
Referenced by init_enc_mb_params().
void smpUMHEX_free_mem | ( | ImageParameters * | p_Img | ) |
Free space for fast motion estimation.
Definition at line 123 of file me_umhexsmp.c.
References free_mem2D(), and free_mem3Dint().
Referenced by free_global_buffers().
int smpUMHEX_get_mem | ( | ImageParameters * | p_Img | ) |
Allocation of space for fast motion estimation.
Definition at line 103 of file me_umhexsmp.c.
References get_mem2D(), get_mem3Dint(), img_par::height, no_mem_exit(), and img_par::width.
Referenced by init_global_buffers().
void smpUMHEX_init | ( | ImageParameters * | p_Img | ) |
Set thresholds for fast motion estimation Those thresholds may be adjusted to trade off rate-distortion performance and simplified UMHEX speed.
Definition at line 87 of file me_umhexsmp.c.
Referenced by init_global_buffers().
void smpUMHEX_setup | ( | Macroblock * | currMB, | |
short | ref, | |||
int | list, | |||
int | block_y, | |||
int | block_x, | |||
int | blocktype, | |||
short ****** | all_mv | |||
) |
Set up prediction MV and prediction up layer cost used for fast motion estimation.
Definition at line 959 of file me_umhexsmp.c.
References macroblock::block_x, macroblock::block_y, and macroblock::p_Img.
Referenced by BlockMotionSearch().
void smpUMHEX_skip_intrabk_SAD | ( | Macroblock * | currMB | ) |
Set cost to zero if neighbouring block is intra used for fast motion estimation.
Definition at line 923 of file me_umhexsmp.c.
References img_par::number, macroblock::p_Img, macroblock::p_slice, macroblock::pix_x, and slice::slice_type.
Referenced by end_encode_one_macroblock().
int smpUMHEXBipredIntegerPelBlockMotionSearch | ( | Macroblock * | currMB, | |
int | list, | |||
MotionVector * | pred_mv1, | |||
MotionVector * | pred_mv2, | |||
MotionVector * | mv1, | |||
MotionVector * | mv2, | |||
MEBlock * | mv_block, | |||
int | search_range, | |||
int | min_mcost, | |||
int | lambda_factor | |||
) |
smpUMHEXBipredIntegerPelBlockMotionSearch: fast pixel block motion search for bipred mode
Definition at line 666 of file me_umhexsmp.c.
References macroblock::p_Img.
Referenced by init_ME_engine().
int smpUMHEXFullSubPelBlockMotionSearch | ( | Macroblock * | currMB, | |
MotionVector * | pred_mv, | |||
MEBlock * | mv_block, | |||
int | min_mcost, | |||
int | lambda_factor | |||
) |
Sub pixel block motion search enhanced.
Definition at line 380 of file me_umhexsmp.c.
References macroblock::p_Img, macroblock::p_slice, slice::slice_type, img_par::start_me_refinement_hp, and img_par::start_me_refinement_qp.
int smpUMHEXIntegerPelBlockMotionSearch | ( | Macroblock * | currMB, | |
MotionVector * | pred_mv, | |||
MEBlock * | mv_block, | |||
int | min_mcost, | |||
int | lambda_factor | |||
) |
Fast integer pixel block motion estimation.
Definition at line 142 of file me_umhexsmp.c.
References macroblock::p_Img.
Referenced by init_ME_engine().
int smpUMHEXSubPelBlockMotionSearch | ( | Macroblock * | currMB, | |
MotionVector * | pred_mv, | |||
MEBlock * | mv_block, | |||
int | min_mcost, | |||
int | lambda_factor | |||
) |
Fast sub pixel block motion estimation.
Definition at line 510 of file me_umhexsmp.c.
References macroblock::p_Img, and img_par::start_me_refinement_hp.