av1/encoder/mcomp.c
// For the following foo_search, the input arguments are:
// x: The struct used to hold a bunch of random configs.
// start_mv: where we are starting our motion search
// search_param: how many steps to skip in our motion search. For example,
//   a value 3 suggests that 3 search steps have already taken place prior to
//   this function call, so we jump directly to step 4 of the search process
// sad_per_bit: a multiplier used to convert rate to sad cost
// do_init_search: if on, do an initial search of all possible scales around the
//   start_mv, and then pick the best scale.
// cond_list: used to hold the cost around the best full mv so we can use it to
//   speed up subpel search later.
// vfp: a function pointer to the simd function so we can compute the cost
//   efficiently
// ref_mv: the reference mv used to compute the mv cost
For the following foo_search, the input arguments are:
x: The struct used to hold a bunch of random configs.
start_mv: where we are starting our motion search
search_param: how many steps to skip in our motion search. For example,
a value 3 suggests that 3 search steps have already taken place prior to
this function call, so we jump directly to step 4 of the search process
sad_per_bit: a multiplier used to convert rate to sad cost
do_init_search: if on, do an initial search of all possible scales around the
start_mv, and then pick the best scale.
cond_list: used to hold the cost around the best full mv so we can use it to
speed up subpel search later.
vfp: a function pointer to the simd function so we can compute the cost
efficiently
ref_mv: the reference mv used to compute the mv cost
For the following foo_search the input arguments are : x : The struct used to hold a bunch of random configs . start_mv : where we are starting our motion search search_param : how many steps to skip in our motion search . For example a value 3 suggests that 3 search steps have already taken place prior to this function call so we jump directly to step 4 of the search process sad_per_bit : a multiplier used to convert rate to sad cost do_init_search : if on do an initial search of all possible scales around the start_mv and then pick the best scale . cond_list : used to hold the cost around the best full mv so we can use it to speed up subpel search later . vfp : a function pointer to the simd function so we can compute the cost efficiently ref_mv : the reference mv used to compute the mv cost
static int hex_search(const MACROBLOCK *x, const FULLPEL_MV start_mv,
                      int search_param, int sad_per_bit, int do_init_search,
                      int *cost_list, const aom_variance_fn_ptr_t *vfp,
                      const MV *ref_mv, FULLPEL_MV *best_mv) {
  static const int hex_num_candidates[MAX_PATTERN_SCALES] = { 8, 6, 6, 6, 6, 6,
                                                              6, 6, 6, 6, 6 };
  static const MV hex_candidates[MAX_PATTERN_SCALES][MAX_PATTERN_CANDIDATES] = {
    { { -1, -1 }, { 0, -1 }, { 1, -1 }, { 1, 0 }, { 1, 1 }, { 0, 1 }, { -1, 1 },
      { -1, 0 } },
    { { -1, -2 }, { 1, -2 }, { 2, 0 }, { 1, 2 }, { -1, 2 }, { -2, 0 } },
    { { -2, -4 }, { 2, -4 }, { 4, 0 }, { 2, 4 }, { -2, 4 }, { -4, 0 } },
    { { -4, -8 }, { 4, -8 }, { 8, 0 }, { 4, 8 }, { -4, 8 }, { -8, 0 } },
    { { -8, -16 }, { 8, -16 }, { 16, 0 }, { 8, 16 }, { -8, 16 }, { -16, 0 } },
    { { -16, -32 }, { 16, -32 }, { 32, 0 }, { 16, 32 }, { -16, 32 },
      { -32, 0 } },
    { { -32, -64 }, { 32, -64 }, { 64, 0 }, { 32, 64 }, { -32, 64 },
      { -64, 0 } },
    { { -64, -128 }, { 64, -128 }, { 128, 0 }, { 64, 128 }, { -64, 128 },
      { -128, 0 } },
    { { -128, -256 }, { 128, -256 }, { 256, 0 }, { 128, 256 }, { -128, 256 },
      { -256, 0 } },
    { { -256, -512 }, { 256, -512 }, { 512, 0 }, { 256, 512 }, { -256, 512 },
      { -512, 0 } },
    { { -512, -1024 }, { 512, -1024 }, { 1024, 0 }, { 512, 1024 },
      { -512, 1024 }, { -1024, 0 } },
  };
  return pattern_search(x, start_mv, search_param, sad_per_bit, do_init_search,
                        cost_list, vfp, ref_mv, hex_num_candidates,
                        hex_candidates, best_mv);
}
static int hex_search ( const MACROBLOCK * x , const FULLPEL_MV start_mv , int search_param , int sad_per_bit , int do_init_search , int * cost_list , const aom_variance_fn_ptr_t * vfp , const MV * ref_mv , FULLPEL_MV * best_mv ) { static const int hex_num_candidates [ MAX_PATTERN_SCALES ] = { 8 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 , 6 } ; static const MV hex_candidates [ MAX_PATTERN_SCALES ] [ MAX_PATTERN_CANDIDATES ] = { { { -1 , -1 } , { 0 , -1 } , { 1 , -1 } , { 1 , 0 } , { 1 , 1 } , { 0 , 1 } , { -1 , 1 } , { -1 , 0 } } , { { -1 , -2 } , { 1 , -2 } , { 2 , 0 } , { 1 , 2 } , { -1 , 2 } , { -2 , 0 } } , { { -2 , -4 } , { 2 , -4 } , { 4 , 0 } , { 2 , 4 } , { -2 , 4 } , { -4 , 0 } } , { { -4 , -8 } , { 4 , -8 } , { 8 , 0 } , { 4 , 8 } , { -4 , 8 } , { -8 , 0 } } , { { -8 , -16 } , { 8 , -16 } , { 16 , 0 } , { 8 , 16 } , { -8 , 16 } , { -16 , 0 } } , { { -16 , -32 } , { 16 , -32 } , { 32 , 0 } , { 16 , 32 } , { -16 , 32 } , { -32 , 0 } } , { { -32 , -64 } , { 32 , -64 } , { 64 , 0 } , { 32 , 64 } , { -32 , 64 } , { -64 , 0 } } , { { -64 , -128 } , { 64 , -128 } , { 128 , 0 } , { 64 , 128 } , { -64 , 128 } , { -128 , 0 } } , { { -128 , -256 } , { 128 , -256 } , { 256 , 0 } , { 128 , 256 } , { -128 , 256 } , { -256 , 0 } } , { { -256 , -512 } , { 256 , -512 } , { 512 , 0 } , { 256 , 512 } , { -256 , 512 } , { -512 , 0 } } , { { -512 , -1024 } , { 512 , -1024 } , { 1024 , 0 } , { 512 , 1024 } , { -512 , 1024 } , { -1024 , 0 } } , } ; return pattern_search ( x , start_mv , search_param , sad_per_bit , do_init_search , cost_list , vfp , ref_mv , hex_num_candidates , hex_candidates , best_mv ) ; }
For the following foo_search, the input arguments are:
x: The struct used to hold a bunch of random configs.
For the following foo_search the input arguments are : x : The struct used to hold a bunch of random configs .
// First scale has 8-closest points, the rest have 6 points in hex shape // at increasing scales // Note that the largest candidate step at each scale is 2^scale /* clang-format off */ /* clang-format on */