short col;
} MV;
-typedef union
+typedef union int_mv
{
uint32_t as_int;
MV as_mv;
/* Encoder forward decls */
struct block;
struct macroblock;
+struct variance_vtable;
+union int_mv;
EOF
}
forward_decls common_forward_decls
specialize vp8_subtract_mbuv mmx sse2 media neon
vp8_subtract_mbuv_media=vp8_subtract_mbuv_armv6
+#
+# Motion search
+#
+prototype int vp8_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, int *mvcost[2], union int_mv *center_mv"
+specialize vp8_full_search_sad sse3 sse4_1
+vp8_full_search_sad_sse3=vp8_full_search_sadx3
+vp8_full_search_sad_sse4_1=vp8_full_search_sadx8
+
+prototype int vp8_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, int *mvcost[2], union int_mv *center_mv"
+specialize vp8_refining_search_sad sse3
+vp8_refining_search_sad_sse3=vp8_refining_search_sadx4
+
+prototype int vp8_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, int *mvcost[2], union int_mv *center_mv"
+vp8_diamond_search_sad_sse3=vp8_diamond_search_sadx4
+
+
# End of encoder only functions
fi
void vp8_cmachine_specific_config(VP8_COMP *cpi)
{
#if CONFIG_RUNTIME_CPU_DETECT
- cpi->rtcd.search.full_search = vp8_full_search_sad;
- cpi->rtcd.search.refining_search = vp8_refining_search_sad;
- cpi->rtcd.search.diamond_search = vp8_diamond_search_sad;
#if !(CONFIG_REALTIME_ONLY)
cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_c;
#endif
#undef CHECK_POINT
#undef CHECK_BETTER
-int vp8_diamond_search_sad
+int vp8_diamond_search_sad_c
(
MACROBLOCK *x,
BLOCK *b,
+ mv_err_cost(&this_mv, center_mv, mvcost, x->errorperbit);
}
-int vp8_full_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
+int vp8_full_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
int sad_per_bit, int distance,
vp8_variance_fn_ptr_t *fn_ptr, int *mvcost[2],
int_mv *center_mv)
return INT_MAX;
}
-int vp8_refining_search_sad(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
+int vp8_refining_search_sad_c(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *ref_mv,
int error_per_bit, int search_range,
vp8_variance_fn_ptr_t *fn_ptr, int *mvcost[2],
int_mv *center_mv)
(MACROBLOCK *x, BLOCK *b, BLOCKD *d, int_mv *bestmv, int_mv *ref_mv,
int error_per_bit, const vp8_variance_fn_ptr_t *vfp, int *mvcost[2],
int *distortion, unsigned int *sse);
+
extern fractional_mv_step_fp vp8_find_best_sub_pixel_step_iteratively;
extern fractional_mv_step_fp vp8_find_best_sub_pixel_step;
extern fractional_mv_step_fp vp8_find_best_half_pixel_step;
extern fractional_mv_step_fp vp8_skip_fractional_mv_step;
-#define prototype_full_search_sad(sym)\
- int (sym)\
- (\
- MACROBLOCK *x, \
- BLOCK *b, \
- BLOCKD *d, \
- int_mv *ref_mv, \
- int sad_per_bit, \
- int distance, \
- vp8_variance_fn_ptr_t *fn_ptr, \
- int *mvcost[2], \
- int_mv *center_mv \
- )
-
-#define prototype_refining_search_sad(sym)\
- int (sym)\
- (\
- MACROBLOCK *x, \
- BLOCK *b, \
- BLOCKD *d, \
- int_mv *ref_mv, \
- int sad_per_bit, \
- int distance, \
- vp8_variance_fn_ptr_t *fn_ptr, \
- int *mvcost[2], \
- int_mv *center_mv \
- )
-
-#define prototype_diamond_search_sad(sym)\
- int (sym)\
- (\
- MACROBLOCK *x, \
- BLOCK *b, \
- BLOCKD *d, \
- int_mv *ref_mv, \
- int_mv *best_mv, \
- int search_param, \
- int sad_per_bit, \
- int *num00, \
- vp8_variance_fn_ptr_t *fn_ptr, \
- int *mvcost[2], \
- int_mv *center_mv \
- )
-
-#if ARCH_X86 || ARCH_X86_64
-#include "x86/mcomp_x86.h"
-#endif
-
-typedef prototype_full_search_sad(*vp8_full_search_fn_t);
-extern prototype_full_search_sad(vp8_full_search_sad);
-extern prototype_full_search_sad(vp8_full_search_sadx3);
-extern prototype_full_search_sad(vp8_full_search_sadx8);
-
-typedef prototype_refining_search_sad(*vp8_refining_search_fn_t);
-extern prototype_refining_search_sad(vp8_refining_search_sad);
-extern prototype_refining_search_sad(vp8_refining_search_sadx4);
-
-typedef prototype_diamond_search_sad(*vp8_diamond_search_fn_t);
-extern prototype_diamond_search_sad(vp8_diamond_search_sad);
-extern prototype_diamond_search_sad(vp8_diamond_search_sadx4);
-
-#ifndef vp8_search_full_search
-#define vp8_search_full_search vp8_full_search_sad
-#endif
-extern prototype_full_search_sad(vp8_search_full_search);
-
-#ifndef vp8_search_refining_search
-#define vp8_search_refining_search vp8_refining_search_sad
-#endif
-extern prototype_refining_search_sad(vp8_search_refining_search);
-
-#ifndef vp8_search_diamond_search
-#define vp8_search_diamond_search vp8_diamond_search_sad
-#endif
-extern prototype_diamond_search_sad(vp8_search_diamond_search);
-
-typedef struct
-{
- prototype_full_search_sad(*full_search);
- prototype_refining_search_sad(*refining_search);
- prototype_diamond_search_sad(*diamond_search);
-} vp8_search_rtcd_vtable_t;
-
-#if CONFIG_RUNTIME_CPU_DETECT
-#define SEARCH_INVOKE(ctx,fn) (ctx)->fn
-#else
-#define SEARCH_INVOKE(ctx,fn) vp8_search_##fn
-#endif
+typedef int (*vp8_full_search_fn_t)
+ (
+ MACROBLOCK *x,
+ BLOCK *b,
+ BLOCKD *d,
+ int_mv *ref_mv,
+ int sad_per_bit,
+ int distance,
+ vp8_variance_fn_ptr_t *fn_ptr,
+ int *mvcost[2],
+ int_mv *center_mv
+ );
+
+typedef int (*vp8_refining_search_fn_t)
+ (
+ MACROBLOCK *x,
+ BLOCK *b,
+ BLOCKD *d,
+ int_mv *ref_mv,
+ int sad_per_bit,
+ int distance,
+ vp8_variance_fn_ptr_t *fn_ptr,
+ int *mvcost[2],
+ int_mv *center_mv
+ );
+
+typedef int (*vp8_diamond_search_fn_t)
+ (
+ MACROBLOCK *x,
+ BLOCK *b,
+ BLOCKD *d,
+ int_mv *ref_mv,
+ int_mv *best_mv,
+ int search_param,
+ int sad_per_bit,
+ int *num00,
+ vp8_variance_fn_ptr_t *fn_ptr,
+ int *mvcost[2],
+ int_mv *center_mv
+ );
#endif
cpi->fn_ptr[BLOCK_4X4].copymem = vp8_copy32xn;
#endif
- cpi->full_search_sad = SEARCH_INVOKE(&cpi->rtcd.search, full_search);
- cpi->diamond_search_sad = SEARCH_INVOKE(&cpi->rtcd.search, diamond_search);
- cpi->refining_search_sad = SEARCH_INVOKE(&cpi->rtcd.search, refining_search);
+ cpi->full_search_sad = vp8_full_search_sad;
+ cpi->diamond_search_sad = vp8_diamond_search_sad;
+ cpi->refining_search_sad = vp8_refining_search_sad;
// make sure frame 1 is okay
cpi->error_bins[0] = cpi->common.MBs;
typedef struct VP8_ENCODER_RTCD
{
- vp8_search_rtcd_vtable_t search;
vp8_temporal_rtcd_vtable_t temporal;
} VP8_ENCODER_RTCD;
int ref_stride
);
-typedef struct
+typedef struct variance_vtable
{
vp8_sad_fn_t sdf;
vp8_variance_fn_t vf;
+++ /dev/null
-/*
- * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-
-#ifndef MCOMP_X86_H
-#define MCOMP_X86_H
-
-#if HAVE_SSE3
-#if !CONFIG_RUNTIME_CPU_DETECT
-
-#undef vp8_search_full_search
-#define vp8_search_full_search vp8_full_search_sadx3
-
-#undef vp8_search_refining_search
-#define vp8_search_refining_search vp8_refining_search_sadx4
-
-#undef vp8_search_diamond_search
-#define vp8_search_diamond_search vp8_diamond_search_sadx4
-
-#endif
-#endif
-
-#if HAVE_SSE4_1
-#if !CONFIG_RUNTIME_CPU_DETECT
-
-#undef vp8_search_full_search
-#define vp8_search_full_search vp8_full_search_sadx8
-
-#endif
-#endif
-
-#endif
-
}
#endif
-#if HAVE_SSE3
- if (flags & HAS_SSE3)
- {
- cpi->rtcd.search.full_search = vp8_full_search_sadx3;
- cpi->rtcd.search.diamond_search = vp8_diamond_search_sadx4;
- cpi->rtcd.search.refining_search = vp8_refining_search_sadx4;
- }
-#endif
-
-#if HAVE_SSE4_1
- if (flags & HAS_SSE4_1)
- {
- cpi->rtcd.search.full_search = vp8_full_search_sadx8;
- }
-#endif
-
#endif
}
VP8_CX_SRCS_REMOVE-yes += encoder/temporal_filter.c
endif
-VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/mcomp_x86.h
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/temporal_filter_x86.h
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/x86_csystemdependent.c
VP8_CX_SRCS-$(HAVE_MMX) += encoder/x86/variance_mmx.c