📄 me_kc.hpp
字号:
#ifndef _ME_HPP_
#define _ME_HPP_
#include "idb_types.hpp"
#include "idb_deftypes.hpp"
// Utility macros for declaring and argument passing of MB structures
#define MB_EXPAND(var) \
var##0, var##1, var##2, var##3, \
var##4, var##5, var##6, var##7
#define MB_PARAM_VAL(vtype, var) \
vtype var##0, vtype var##1, vtype var##2, vtype var##3, \
vtype var##4, vtype var##5, vtype var##6, vtype var##7
#define MB_PARAM_REF(vtype, var) \
vtype##& var##0, vtype##& var##1, vtype##& var##2, vtype##& var##3, \
vtype##& var##4, vtype##& var##5, vtype##& var##6, vtype##& var##7
// Macro to load a four-pixel wide column of macroblocks of the search
// region. This is a macro instead of a function since we cannot
// currently pass streams as function arguments.
#define LOAD_4_SEARCH_COLS(row0, row1, row2, do_read, search_region, idx) \
row0(ALL, do_read) >> search_region[0+idx]; \
row0(ALL, do_read) >> search_region[12+idx]; \
row1(ALL, do_read) >> search_region[24+idx]; \
row1(ALL, do_read) >> search_region[36+idx]; \
row2(ALL, do_read) >> search_region[48+idx]; \
row2(ALL, do_read) >> search_region[60+idx]; \
idx = idx + 1;
// Function prototypes. Implementations are in
// me_fns_kc.cpp.
#ifdef _IMAGINE_BUILD
#define ME_EXTERN_
#else
#define ME_EXTERN_ extern
#endif
ME_EXTERN_ inline int
check_xy(int top_range, int bottom_range,
int left_range, int right_range,
int test_x, int test_y);
ME_EXTERN_ inline void
save_MB(array<ubyte4>& save_arr,
MB_PARAM_VAL(ubyte4, mb));
ME_EXTERN_ inline void
load_MB(array<ubyte4>& save_arr,
MB_PARAM_REF(ubyte4, mb));
ME_EXTERN_ inline void
extract_ref_MB4(array<ubyte4>& search_region,
int start_idx,
int x, int y,
int range_x, int range_y,
int& sr_row, int& sr_col, int& rot_perm,
MB_PARAM_REF(ubyte4, ref_mb));
ME_EXTERN_ inline void
extract_ref_MB(array<ubyte4>& search_region,
int start_idx,
int x, int y,
int range_x, int range_y,
MB_PARAM_REF(ubyte4, ref_mb));
ME_EXTERN_ inline void
shift_ref_MB4(array<ubyte4>& search_region,
int sr_row, int& sr_col,
int range_x,
int rot_perm,
MB_PARAM_REF(ubyte4, ref_mb));
ME_EXTERN_ inline void
compare_MB(MB_PARAM_VAL(ubyte4, ref_mb),
MB_PARAM_VAL(ubyte4, mb),
int test_x, int test_y, int in_range,
int& mv_x, int& mv_y, uint& mv_sad);
#include "idb_undeftypes.hpp"
#ifdef _IMAGINE_BUILD
#include "me_fns_kc.cpp"
#endif
#endif // _ME_HPP_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -