remove invoke_search macro
Removed invoke search from encoder Change-Id: I3d809b795abe6df0e71366edfe94026aaede14fb
This commit is contained in:
Родитель
849c9540d5
Коммит
7849aa20ed
|
@ -18,7 +18,7 @@ typedef struct {
|
||||||
short col;
|
short col;
|
||||||
} MV;
|
} MV;
|
||||||
|
|
||||||
typedef union {
|
typedef union int_mv {
|
||||||
uint32_t as_int;
|
uint32_t as_int;
|
||||||
MV as_mv;
|
MV as_mv;
|
||||||
} int_mv; /* facilitates faster equality tests and copies */
|
} int_mv; /* facilitates faster equality tests and copies */
|
||||||
|
|
|
@ -11,6 +11,8 @@ struct block;
|
||||||
struct macroblock;
|
struct macroblock;
|
||||||
struct variance_vtable;
|
struct variance_vtable;
|
||||||
|
|
||||||
|
#define DEC_MVCOSTS int *mvjcost, int *mvcost[2]
|
||||||
|
|
||||||
/* Encoder forward decls */
|
/* Encoder forward decls */
|
||||||
struct variance_vtable;
|
struct variance_vtable;
|
||||||
union int_mv;
|
union int_mv;
|
||||||
|
@ -484,6 +486,21 @@ specialize vp9_short_walsh4x4_x8
|
||||||
prototype void vp9_short_walsh8x4_x8 "short *InputData, short *OutputData, int pitch"
|
prototype void vp9_short_walsh8x4_x8 "short *InputData, short *OutputData, int pitch"
|
||||||
specialize vp9_short_walsh8x4_x8
|
specialize vp9_short_walsh8x4_x8
|
||||||
|
|
||||||
|
#
|
||||||
|
# Motion search
|
||||||
|
#
|
||||||
|
prototype int vp9_full_search_sad "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
|
||||||
|
specialize vp9_full_search_sad sse3 sse4_1
|
||||||
|
vp9_full_search_sad_sse3=vp9_full_search_sadx3
|
||||||
|
vp9_full_search_sad_sse4_1=vp9_full_search_sadx8
|
||||||
|
|
||||||
|
prototype int vp9_refining_search_sad "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, int sad_per_bit, int distance, struct variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
|
||||||
|
specialize vp9_refining_search_sad sse3
|
||||||
|
vp9_refining_search_sad_sse3=vp9_refining_search_sadx4
|
||||||
|
|
||||||
|
prototype int vp9_diamond_search_sad "struct macroblock *x, struct block *b, struct blockd *d, union int_mv *ref_mv, union int_mv *best_mv, int search_param, int sad_per_bit, int *num00, struct variance_vtable *fn_ptr, DEC_MVCOSTS, union int_mv *center_mv"
|
||||||
|
vp9_diamond_search_sad_sse3=vp9_diamond_search_sadx4
|
||||||
|
|
||||||
fi
|
fi
|
||||||
# end encoder functions
|
# end encoder functions
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,6 @@ extern void vp9_yv12_copy_partial_frame(YV12_BUFFER_CONFIG *src_ybc,
|
||||||
void vp9_cmachine_specific_config(VP9_COMP *cpi) {
|
void vp9_cmachine_specific_config(VP9_COMP *cpi) {
|
||||||
#if CONFIG_RUNTIME_CPU_DETECT
|
#if CONFIG_RUNTIME_CPU_DETECT
|
||||||
cpi->rtcd.common = &cpi->common.rtcd;
|
cpi->rtcd.common = &cpi->common.rtcd;
|
||||||
|
|
||||||
cpi->rtcd.search.full_search = vp9_full_search_sad;
|
|
||||||
cpi->rtcd.search.refining_search = vp9_refining_search_sad;
|
|
||||||
cpi->rtcd.search.diamond_search = vp9_diamond_search_sad;
|
|
||||||
cpi->rtcd.temporal.apply = vp9_temporal_filter_apply_c;
|
cpi->rtcd.temporal.apply = vp9_temporal_filter_apply_c;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1255,7 +1255,7 @@ cal_neighbors:
|
||||||
#undef CHECK_POINT
|
#undef CHECK_POINT
|
||||||
#undef CHECK_BETTER
|
#undef CHECK_BETTER
|
||||||
|
|
||||||
int vp9_diamond_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
|
int vp9_diamond_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
|
||||||
int_mv *ref_mv, int_mv *best_mv,
|
int_mv *ref_mv, int_mv *best_mv,
|
||||||
int search_param, int sad_per_bit, int *num00,
|
int search_param, int sad_per_bit, int *num00,
|
||||||
vp9_variance_fn_ptr_t *fn_ptr, DEC_MVCOSTS,
|
vp9_variance_fn_ptr_t *fn_ptr, DEC_MVCOSTS,
|
||||||
|
@ -1568,7 +1568,7 @@ int vp9_full_pixel_diamond(VP9_COMP *cpi, MACROBLOCK *x, BLOCK *b,
|
||||||
return bestsme;
|
return bestsme;
|
||||||
}
|
}
|
||||||
|
|
||||||
int vp9_full_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
|
int vp9_full_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
|
||||||
int sad_per_bit, int distance,
|
int sad_per_bit, int distance,
|
||||||
vp9_variance_fn_ptr_t *fn_ptr, DEC_MVCOSTS,
|
vp9_variance_fn_ptr_t *fn_ptr, DEC_MVCOSTS,
|
||||||
int_mv *center_mv) {
|
int_mv *center_mv) {
|
||||||
|
@ -1942,11 +1942,10 @@ int vp9_full_search_sadx8(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
|
||||||
else
|
else
|
||||||
return INT_MAX;
|
return INT_MAX;
|
||||||
}
|
}
|
||||||
|
int vp9_refining_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
|
||||||
int vp9_refining_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
|
int_mv *ref_mv, int error_per_bit,
|
||||||
int error_per_bit, int search_range,
|
int search_range, vp9_variance_fn_ptr_t *fn_ptr,
|
||||||
vp9_variance_fn_ptr_t *fn_ptr, DEC_MVCOSTS,
|
DEC_MVCOSTS, int_mv *center_mv) {
|
||||||
int_mv *center_mv) {
|
|
||||||
MV neighbors[4] = {{ -1, 0}, {0, -1}, {0, 1}, {1, 0}};
|
MV neighbors[4] = {{ -1, 0}, {0, -1}, {0, 1}, {1, 0}};
|
||||||
int i, j;
|
int i, j;
|
||||||
short this_row_offset, this_col_offset;
|
short this_row_offset, this_col_offset;
|
||||||
|
|
|
@ -68,87 +68,24 @@ extern fractional_mv_step_fp vp9_find_best_sub_pixel_step_iteratively;
|
||||||
extern fractional_mv_step_fp vp9_find_best_sub_pixel_step;
|
extern fractional_mv_step_fp vp9_find_best_sub_pixel_step;
|
||||||
extern fractional_mv_step_fp vp9_find_best_half_pixel_step;
|
extern fractional_mv_step_fp vp9_find_best_half_pixel_step;
|
||||||
|
|
||||||
#define prototype_full_search_sad(sym)\
|
typedef int (*vp9_full_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
|
||||||
int (sym)\
|
int_mv *ref_mv, int sad_per_bit,
|
||||||
(\
|
int distance, vp9_variance_fn_ptr_t *fn_ptr,
|
||||||
MACROBLOCK *x, \
|
DEC_MVCOSTS, int_mv *center_mv);
|
||||||
BLOCK *b, \
|
|
||||||
BLOCKD *d, \
|
|
||||||
int_mv *ref_mv, \
|
|
||||||
int sad_per_bit, \
|
|
||||||
int distance, \
|
|
||||||
vp9_variance_fn_ptr_t *fn_ptr, \
|
|
||||||
DEC_MVSADCOSTS, \
|
|
||||||
int_mv *center_mv \
|
|
||||||
)
|
|
||||||
|
|
||||||
#define prototype_refining_search_sad(sym)\
|
typedef int (*vp9_refining_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
|
||||||
int (sym)\
|
int_mv *ref_mv, int sad_per_bit,
|
||||||
(\
|
int distance,
|
||||||
MACROBLOCK *x, \
|
vp9_variance_fn_ptr_t *fn_ptr,
|
||||||
BLOCK *b, \
|
DEC_MVCOSTS, int_mv *center_mv);
|
||||||
BLOCKD *d, \
|
|
||||||
int_mv *ref_mv, \
|
|
||||||
int sad_per_bit, \
|
|
||||||
int distance, \
|
|
||||||
vp9_variance_fn_ptr_t *fn_ptr, \
|
|
||||||
DEC_MVSADCOSTS, \
|
|
||||||
int_mv *center_mv \
|
|
||||||
)
|
|
||||||
|
|
||||||
#define prototype_diamond_search_sad(sym)\
|
typedef int (*vp9_diamond_search_fn_t)(MACROBLOCK *x, BLOCK *b, BLOCKD *d,
|
||||||
int (sym)\
|
int_mv *ref_mv, int_mv *best_mv,
|
||||||
(\
|
int search_param, int sad_per_bit,
|
||||||
MACROBLOCK *x, \
|
int *num00,
|
||||||
BLOCK *b, \
|
vp9_variance_fn_ptr_t *fn_ptr,
|
||||||
BLOCKD *d, \
|
DEC_MVCOSTS, int_mv *center_mv);
|
||||||
int_mv *ref_mv, \
|
|
||||||
int_mv *best_mv, \
|
|
||||||
int search_param, \
|
|
||||||
int sad_per_bit, \
|
|
||||||
int *num00, \
|
|
||||||
vp9_variance_fn_ptr_t *fn_ptr, \
|
|
||||||
DEC_MVSADCOSTS, \
|
|
||||||
int_mv *center_mv \
|
|
||||||
)
|
|
||||||
|
|
||||||
#if ARCH_X86 || ARCH_X86_64
|
|
||||||
#include "x86/mcomp_x86.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef prototype_full_search_sad(*vp9_full_search_fn_t);
|
|
||||||
extern prototype_full_search_sad(vp9_full_search_sad);
|
|
||||||
extern prototype_full_search_sad(vp9_full_search_sadx3);
|
|
||||||
extern prototype_full_search_sad(vp9_full_search_sadx8);
|
|
||||||
|
|
||||||
typedef prototype_refining_search_sad(*vp9_refining_search_fn_t);
|
|
||||||
extern prototype_refining_search_sad(vp9_refining_search_sad);
|
|
||||||
extern prototype_refining_search_sad(vp9_refining_search_sadx4);
|
|
||||||
|
|
||||||
typedef prototype_diamond_search_sad(*vp9_diamond_search_fn_t);
|
|
||||||
extern prototype_diamond_search_sad(vp9_diamond_search_sad);
|
|
||||||
extern prototype_diamond_search_sad(vp9_diamond_search_sadx4);
|
|
||||||
|
|
||||||
#ifndef vp9_search_full_search
|
|
||||||
#define vp9_search_full_search vp9_full_search_sad
|
|
||||||
#endif
|
|
||||||
extern prototype_full_search_sad(vp9_search_full_search);
|
|
||||||
|
|
||||||
#ifndef vp9_search_refining_search
|
|
||||||
#define vp9_search_refining_search vp9_refining_search_sad
|
|
||||||
#endif
|
|
||||||
extern prototype_refining_search_sad(vp9_search_refining_search);
|
|
||||||
|
|
||||||
#ifndef vp9_search_diamond_search
|
|
||||||
#define vp9_search_diamond_search vp9_diamond_search_sad
|
|
||||||
#endif
|
|
||||||
extern prototype_diamond_search_sad(vp9_search_diamond_search);
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
prototype_full_search_sad(*full_search);
|
|
||||||
prototype_refining_search_sad(*refining_search);
|
|
||||||
prototype_diamond_search_sad(*diamond_search);
|
|
||||||
} vp9_search_rtcd_vtable_t;
|
|
||||||
|
|
||||||
#if CONFIG_RUNTIME_CPU_DETECT
|
#if CONFIG_RUNTIME_CPU_DETECT
|
||||||
#define SEARCH_INVOKE(ctx,fn) (ctx)->fn
|
#define SEARCH_INVOKE(ctx,fn) (ctx)->fn
|
||||||
|
|
|
@ -1976,9 +1976,9 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) {
|
||||||
cpi->fn_ptr[BLOCK_4X4].copymem = vp9_copy32xn;
|
cpi->fn_ptr[BLOCK_4X4].copymem = vp9_copy32xn;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
cpi->full_search_sad = SEARCH_INVOKE(&cpi->rtcd.search, full_search);
|
cpi->full_search_sad = vp9_full_search_sad;
|
||||||
cpi->diamond_search_sad = SEARCH_INVOKE(&cpi->rtcd.search, diamond_search);
|
cpi->diamond_search_sad = vp9_diamond_search_sad;
|
||||||
cpi->refining_search_sad = SEARCH_INVOKE(&cpi->rtcd.search, refining_search);
|
cpi->refining_search_sad = vp9_refining_search_sad;
|
||||||
|
|
||||||
// make sure frame 1 is okay
|
// make sure frame 1 is okay
|
||||||
cpi->error_bins[0] = cpi->common.MBs;
|
cpi->error_bins[0] = cpi->common.MBs;
|
||||||
|
|
|
@ -349,7 +349,6 @@ typedef struct {
|
||||||
|
|
||||||
typedef struct VP9_ENCODER_RTCD {
|
typedef struct VP9_ENCODER_RTCD {
|
||||||
VP9_COMMON_RTCD *common;
|
VP9_COMMON_RTCD *common;
|
||||||
vp9_search_rtcd_vtable_t search;
|
|
||||||
vp9_temporal_rtcd_vtable_t temporal;
|
vp9_temporal_rtcd_vtable_t temporal;
|
||||||
} VP9_ENCODER_RTCD;
|
} VP9_ENCODER_RTCD;
|
||||||
|
|
||||||
|
|
|
@ -95,20 +95,6 @@ void vp9_arch_x86_encoder_init(VP9_COMP *cpi) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_SSE3
|
|
||||||
if (flags & HAS_SSE3) {
|
|
||||||
cpi->rtcd.search.full_search = vp9_full_search_sadx3;
|
|
||||||
cpi->rtcd.search.diamond_search = vp9_diamond_search_sadx4;
|
|
||||||
cpi->rtcd.search.refining_search = vp9_refining_search_sadx4;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#if HAVE_SSE4_1
|
|
||||||
if (flags & HAS_SSE4_1) {
|
|
||||||
cpi->rtcd.search.full_search = vp9_full_search_sadx8;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче