#include <limits.h>
#include "global.h"
#include "memalloc.h"
#include "me_umhexsmp.h"
#include "refbuf.h"
#include "me_distortion.h"
#include "mv-search.h"

Go to the source code of this file.
Defines | |
| #define | SEARCH_ONE_PIXEL_HELPER |
| #define | SEARCH_ONE_PIXEL_BIPRED_HELPER |
Functions | |
| void | smpUMHEX_init () |
| int | smpUMHEX_get_mem () |
| void | smpUMHEX_free_mem () |
| int | smpUMHEXIntegerPelBlockMotionSearch (Macroblock *currMB, imgpel *orig_pic, short ref, int list, char ***refPic, short ****tmp_mv, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred_mv, MotionVector *mv, int search_range, int min_mcost, int lambda_factor, int apply_weights) |
| int | smpUMHEXFullSubPelBlockMotionSearch (imgpel *orig_pic, short ref, int list, int list_offset, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred_mv, MotionVector *mv, int search_pos2, int search_pos4, int min_mcost, int lambda_factor, int apply_weights) |
| int | smpUMHEXSubPelBlockMotionSearch (imgpel *orig_pic, short ref, int list, int list_offset, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred_mv, MotionVector *mv, int search_pos2, int search_pos4, int min_mcost, int lambda_factor, int apply_weights) |
| int | smpUMHEXSubPelBlockME (imgpel *orig_pic, short ref, int list, int list_offset, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred_mv, MotionVector *mv, int search_pos2, int search_pos4, int min_mcost, int *lambda_factor, int apply_weights) |
| int | smpUMHEXBipredIntegerPelBlockMotionSearch (Macroblock *currMB, imgpel *cur_pic, short ref, int list, char ***refPic, short ****tmp_mv, int pic_pix_x, int pic_pix_y, int blocktype, MotionVector *pred_mv1, MotionVector *pred_mv2, MotionVector *mv1, MotionVector *mv2, int search_range, int min_mcost, int iteration_no, int lambda_factor, int apply_weights) |
| void | smpUMHEX_decide_intrabk_SAD () |
| void | smpUMHEX_skip_intrabk_SAD (int best_mode, int ref_max) |
| void | smpUMHEX_setup (short ref, int list, int block_y, int block_x, int blocktype, short ******all_mv) |
Variables | |
| static const short | Diamond_X [4] = {-1, 1, 0, 0} |
| static const short | Diamond_Y [4] = { 0, 0,-1, 1} |
| static const short | Hexagon_X [6] = {-2, 2,-1, 1,-1, 1} |
| static const short | Hexagon_Y [6] = { 0, 0,-2, 2, 2,-2} |
| static const short | Big_Hexagon_X [16] = {-4, 4, 0, 0,-4, 4,-4, 4,-4, 4,-4, 4,-2, 2,-2, 2} |
| static const short | Big_Hexagon_Y [16] = { 0, 0,-4, 4,-1, 1, 1,-1,-2, 2, 2,-2,-3, 3, 3,-3} |
| const short | block_type_shift_factor [8] = {0, 0, 1, 1, 2, 3, 3, 1} |
| static StorablePicture * | ref_pic_ptr |
| static int | dist_method |
| short * | spiral_hpel_search_x |
| short * | spiral_hpel_search_y |
| short * | spiral_search_x |
| short * | spiral_search_y |
Definition in file me_umhexsmp.c.
| #define SEARCH_ONE_PIXEL_BIPRED_HELPER |
Value:
if (iabs(cand_x - center2_x) <= search_range && iabs(cand_y - center2_y) <= search_range) \ { \ mcost = MV_COST (lambda_factor, mvshift, center1_x, center1_y, pred_x1, pred_y1); \ mcost += MV_COST (lambda_factor, mvshift, cand_x, cand_y, pred_x2, pred_y2); \ if (mcost < min_mcost) \ { \ mcost += computeBiPred(cur_pic, blocksize_y, blocksize_x, \ min_mcost - mcost, \ (center1_x << 2) + IMG_PAD_SIZE_TIMES4, \ (center1_y << 2) + IMG_PAD_SIZE_TIMES4, \ (cand_x << 2) + IMG_PAD_SIZE_TIMES4, \ (cand_y << 2) + IMG_PAD_SIZE_TIMES4); \ if (mcost < min_mcost) \ { \ best_x = cand_x; \ best_y = cand_y; \ min_mcost = mcost; \ } \ } \ }
Definition at line 68 of file me_umhexsmp.c.
| #define SEARCH_ONE_PIXEL_HELPER |
Value:
if(iabs(cand_x - center_x) <= search_range && iabs(cand_y - center_y) <= search_range) \ { \ mcost = MV_COST (lambda_factor, mvshift, cand_x, cand_y, pred_x, pred_y); \ mcost += computeUniPred[dist_method]( orig_pic, blocksize_y, blocksize_x, \ min_mcost - mcost, (cand_x + IMG_PAD_SIZE) << 2, (cand_y + IMG_PAD_SIZE) << 2); \ if (mcost < min_mcost) \ { \ best_x = cand_x; \ best_y = cand_y; \ min_mcost = mcost; \ } \ }
Definition at line 54 of file me_umhexsmp.c.
| void smpUMHEX_decide_intrabk_SAD | ( | void | ) |
Set neighbouring block mode (intra/inter) used for fast motion estimation.
Definition at line 1092 of file me_umhexsmp.c.
References ImageParameters::pix_x, ImageParameters::pix_y, and ImageParameters::type.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
| void smpUMHEX_free_mem | ( | void | ) |
Free space for fast motion estimation.
Definition at line 132 of file me_umhexsmp.c.
References free_mem2D(), and free_mem3Dint().
Referenced by free_global_buffers().

| int smpUMHEX_get_mem | ( | void | ) |
Allocation of space for fast motion estimation.
Definition at line 113 of file me_umhexsmp.c.
References get_mem2D(), get_mem3Dint(), ImageParameters::height, no_mem_exit(), and ImageParameters::width.
Referenced by init_global_buffers().

| void smpUMHEX_init | ( | void | ) |
Set thresholds for fast motion estimation Those thresholds may be adjusted to trade off rate-distortion performance and simplified UMHEX speed.
Definition at line 98 of file me_umhexsmp.c.
Referenced by init_global_buffers().
| void smpUMHEX_setup | ( | 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 1158 of file me_umhexsmp.c.
References ImageParameters::pix_x, and ImageParameters::pix_y.
Referenced by BlockMotionSearch().
| void smpUMHEX_skip_intrabk_SAD | ( | int | best_mode, | |
| int | ref_max | |||
| ) |
Set cost to zero if neighbouring block is intra used for fast motion estimation.
Definition at line 1125 of file me_umhexsmp.c.
References ImageParameters::number, ImageParameters::pix_x, and ImageParameters::type.
Referenced by encode_one_macroblock_high(), encode_one_macroblock_highfast(), encode_one_macroblock_highloss(), and encode_one_macroblock_low().
| int smpUMHEXBipredIntegerPelBlockMotionSearch | ( | Macroblock * | currMB, | |
| imgpel * | cur_pic, | |||
| short | ref, | |||
| int | list, | |||
| char *** | refPic, | |||
| short **** | tmp_mv, | |||
| int | pic_pix_x, | |||
| int | pic_pix_y, | |||
| int | blocktype, | |||
| MotionVector * | pred_mv1, | |||
| MotionVector * | pred_mv2, | |||
| MotionVector * | mv1, | |||
| MotionVector * | mv2, | |||
| int | search_range, | |||
| int | min_mcost, | |||
| int | iteration_no, | |||
| int | lambda_factor, | |||
| int | apply_weights | |||
| ) |
smpUMHEXBipredIntegerPelBlockMotionSearch: fast pixel block motion search for bipred mode
Definition at line 803 of file me_umhexsmp.c.
References InputParameters::blc_size, computeBiPredSAD1(), computeBiPredSAD2(), IMG_PAD_SIZE_TIMES4, storable_picture::imgUV_sub, macroblock::list_offset, storable_picture::p_curr_img_sub, storable_picture::size_x, storable_picture::size_x_cr_pad, storable_picture::size_x_pad, storable_picture::size_y, storable_picture::size_y_cr_pad, and storable_picture::size_y_pad.
Referenced by init_ME_engine().

| int smpUMHEXFullSubPelBlockMotionSearch | ( | imgpel * | orig_pic, | |
| short | ref, | |||
| int | list, | |||
| int | list_offset, | |||
| int | pic_pix_x, | |||
| int | pic_pix_y, | |||
| int | blocktype, | |||
| MotionVector * | pred_mv, | |||
| MotionVector * | mv, | |||
| int | search_pos2, | |||
| int | search_pos4, | |||
| int | min_mcost, | |||
| int | lambda_factor, | |||
| int | apply_weights | |||
| ) |
Sub pixel block motion search enhanced.
Definition at line 420 of file me_umhexsmp.c.
References InputParameters::blc_size, IMG_PAD_SIZE, storable_picture::imgUV_sub, storable_picture::p_curr_img_sub, Q_PEL, InputParameters::rdopt, storable_picture::size_x, storable_picture::size_x_cr_pad, storable_picture::size_x_pad, storable_picture::size_y, storable_picture::size_y_cr_pad, storable_picture::size_y_pad, and ImageParameters::type.
| int smpUMHEXIntegerPelBlockMotionSearch | ( | Macroblock * | currMB, | |
| imgpel * | orig_pic, | |||
| short | ref, | |||
| int | list, | |||
| char *** | refPic, | |||
| short **** | tmp_mv, | |||
| int | pic_pix_x, | |||
| int | pic_pix_y, | |||
| int | blocktype, | |||
| MotionVector * | pred_mv, | |||
| MotionVector * | mv, | |||
| int | search_range, | |||
| int | min_mcost, | |||
| int | lambda_factor, | |||
| int | apply_weights | |||
| ) |
Fast integer pixel block motion estimation.
Definition at line 149 of file me_umhexsmp.c.
References InputParameters::blc_size, F_PEL, IMG_PAD_SIZE_TIMES4, storable_picture::imgUV_sub, macroblock::list_offset, storable_picture::p_curr_img_sub, storable_picture::size_x, storable_picture::size_x_cr_pad, storable_picture::size_x_pad, storable_picture::size_y, storable_picture::size_y_cr_pad, and storable_picture::size_y_pad.
Referenced by init_ME_engine().
| int smpUMHEXSubPelBlockMotionSearch | ( | imgpel * | orig_pic, | |
| short | ref, | |||
| int | list, | |||
| int | list_offset, | |||
| int | pic_pix_x, | |||
| int | pic_pix_y, | |||
| int | blocktype, | |||
| MotionVector * | pred_mv, | |||
| MotionVector * | mv, | |||
| int | search_pos2, | |||
| int | search_pos4, | |||
| int | min_mcost, | |||
| int | lambda_factor, | |||
| int | apply_weights | |||
| ) |
Fast sub pixel block motion estimation.
Definition at line 588 of file me_umhexsmp.c.
References InputParameters::blc_size, IMG_PAD_SIZE, storable_picture::imgUV_sub, storable_picture::p_curr_img_sub, Q_PEL, storable_picture::size_x, storable_picture::size_x_cr_pad, storable_picture::size_x_pad, storable_picture::size_y, storable_picture::size_y_cr_pad, and storable_picture::size_y_pad.