ref: 7bca32a6a37c3ece2e5d30fcb393b9ea58139594
parent: 55214924ac5479c632cdcea78205f47c7fff9aa8
parent: 36420009ea3a3e462051084bf712ba51952b0d4e
author: Dmitry Kovalev <dkovalev@google.com>
date: Tue Feb 25 05:51:17 EST 2014
Merge "Changing vp9_full_search_sad{, x3, x8} signatures."
--- a/vp9/common/vp9_rtcd_defs.sh
+++ b/vp9/common/vp9_rtcd_defs.sh
@@ -737,7 +737,7 @@
#
# Motion search
#
-prototype int vp9_full_search_sad "const struct macroblock *x, const struct mv *ref_mv, int sad_per_bit, int distance, const struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv, int n"
+prototype int vp9_full_search_sad "const struct macroblock *x, const struct mv *ref_mv, int sad_per_bit, int distance, const struct vp9_variance_vtable *fn_ptr, DEC_MVCOSTS, const struct mv *center_mv, struct mv *best_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
--- a/vp9/encoder/vp9_mcomp.c
+++ b/vp9/encoder/vp9_mcomp.c
@@ -1525,7 +1525,7 @@
int sad_per_bit, int distance,
const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- const MV *center_mv, int block) {
+ const MV *center_mv, MV *best_mv) {
int r, c;
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *const what = x->plane[0].src.buf;
@@ -1544,7 +1544,6 @@
int best_sad = fn_ptr->sdf(what, what_stride, best_address, in_what_stride,
0x7fffffff) +
mvsad_err_cost(ref_mv, &fcenter_mv, mvjsadcost, mvsadcost, sad_per_bit);
- MV *best_mv = &xd->mi_8x8[0]->bmi[block].as_mv[0].as_mv;
*best_mv = *ref_mv;
for (r = row_min; r < row_max; ++r) {
@@ -1578,13 +1577,12 @@
int sad_per_bit, int distance,
const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- const MV *center_mv, int n) {
+ const MV *center_mv, MV *best_mv) {
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *const what = x->plane[0].src.buf;
const int what_stride = x->plane[0].src.stride;
const uint8_t *const in_what = xd->plane[0].pre[0].buf;
const int in_what_stride = xd->plane[0].pre[0].stride;
- MV *best_mv = &xd->mi_8x8[0]->bmi[n].as_mv[0].as_mv;
MV this_mv;
unsigned int bestsad = INT_MAX;
int r, c;
@@ -1684,13 +1682,12 @@
int sad_per_bit, int distance,
const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- const MV *center_mv, int n) {
+ const MV *center_mv, MV *best_mv) {
const MACROBLOCKD *const xd = &x->e_mbd;
const uint8_t *const what = x->plane[0].src.buf;
const int what_stride = x->plane[0].src.stride;
const uint8_t *const in_what = xd->plane[0].pre[0].buf;
const int in_what_stride = xd->plane[0].pre[0].stride;
- MV *best_mv = &xd->mi_8x8[0]->bmi[n].as_mv[0].as_mv;
MV this_mv;
unsigned int bestsad = INT_MAX;
int r, c;
--- a/vp9/encoder/vp9_mcomp.h
+++ b/vp9/encoder/vp9_mcomp.h
@@ -119,7 +119,7 @@
int distance,
const vp9_variance_fn_ptr_t *fn_ptr,
int *mvjcost, int *mvcost[2],
- const MV *center_mv, int n);
+ const MV *center_mv, MV *best_mv);
typedef int (*vp9_refining_search_fn_t)(const MACROBLOCK *x,
MV *ref_mv, int sad_per_bit,
--- a/vp9/encoder/vp9_rdopt.c
+++ b/vp9/encoder/vp9_rdopt.c
@@ -1851,22 +1851,22 @@
// Should we do a full search (best quality only)
if (cpi->oxcf.mode == MODE_BESTQUALITY ||
cpi->oxcf.mode == MODE_SECONDPASS_BEST) {
+ int_mv *const best_mv = &mi->bmi[i].as_mv[0];
/* Check if mvp_full is within the range. */
clamp_mv(&mvp_full, x->mv_col_min, x->mv_col_max,
x->mv_row_min, x->mv_row_max);
-
thissme = cpi->full_search_sad(x, &mvp_full,
sadpb, 16, v_fn_ptr,
x->nmvjointcost, x->mvcost,
- &bsi->ref_mv->as_mv, i);
-
+ &bsi->ref_mv->as_mv,
+ &best_mv->as_mv);
if (thissme < bestsme) {
bestsme = thissme;
- new_mv->as_int = mi->bmi[i].as_mv[0].as_int;
+ new_mv->as_int = best_mv->as_int;
} else {
- /* The full search result is actually worse so re-instate the
- * previous best vector */
- mi->bmi[i].as_mv[0].as_int = new_mv->as_int;
+ // The full search result is actually worse so re-instate the
+ // previous best vector
+ best_mv->as_int = new_mv->as_int;
}
}
--
⑨