Commit 1838d877 authored by Jim Bankoski's avatar Jim Bankoski Committed by Paul Wilkins

invoke macro removal encodemb

Change-Id: I321280abcf48f3dc16e194d29bde2bd3baec6006
parent 47fb1474
......@@ -255,7 +255,7 @@ typedef struct {
union b_mode_info bmi[16];
} MODE_INFO;
typedef struct {
typedef struct blockd {
short *qcoeff;
short *dqcoeff;
unsigned char *predictor;
......@@ -277,7 +277,7 @@ typedef struct {
union b_mode_info bmi;
} BLOCKD;
typedef struct MacroBlockD {
typedef struct macroblockd {
DECLARE_ALIGNED(16, short, diff[400]); /* from idct diff */
DECLARE_ALIGNED(16, unsigned char, predictor[384]);
DECLARE_ALIGNED(16, short, qcoeff[400]);
......
......@@ -81,22 +81,22 @@ typedef void loop_filter_uvfunction
/* assorted loopfilter functions which get used elsewhere */
struct VP8Common;
struct MacroBlockD;
struct macroblockd;
void vp8_loop_filter_init(struct VP8Common *cm);
void vp8_loop_filter_frame_init(struct VP8Common *cm,
struct MacroBlockD *mbd,
struct macroblockd *mbd,
int default_filt_lvl);
void vp8_loop_filter_frame(struct VP8Common *cm, struct MacroBlockD *mbd);
void vp8_loop_filter_frame(struct VP8Common *cm, struct macroblockd *mbd);
void vp8_loop_filter_partial_frame(struct VP8Common *cm,
struct MacroBlockD *mbd,
struct macroblockd *mbd,
int default_filt_lvl);
void vp8_loop_filter_frame_yonly(struct VP8Common *cm,
struct MacroBlockD *mbd,
struct macroblockd *mbd,
int default_filt_lvl);
void vp8_loop_filter_update_sharpness(loop_filter_info_n *lfi,
......
common_forward_decls() {
cat <<EOF
#include "vp8/common/blockd.h"
struct loop_filter_info;
struct blockd;
struct macroblockd;
struct loop_filter_info;
/* Encoder forward decls */
struct block;
struct macroblock;
struct variance_vtable;
/* Encoder forward decls */
struct variance_vtable;
union int_mv;
......@@ -70,55 +77,55 @@ specialize vp8_recon2b sse2
prototype void vp8_recon4b "unsigned char *pred_ptr, short *diff_ptr, unsigned char *dst_ptr, int stride"
specialize vp8_recon4b sse2
prototype void vp8_recon_mb "MACROBLOCKD *x"
prototype void vp8_recon_mb "struct macroblockd *x"
specialize vp8_recon_mb
prototype void vp8_recon_mby "MACROBLOCKD *x"
prototype void vp8_recon_mby "struct macroblockd *x"
specialize vp8_recon_mby
prototype void vp8_build_intra_predictors_mby_s "MACROBLOCKD *x"
prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby_s
prototype void vp8_build_intra_predictors_sby_s "MACROBLOCKD *x"
prototype void vp8_build_intra_predictors_sby_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_sby_s;
prototype void vp8_build_intra_predictors_sbuv_s "MACROBLOCKD *x"
prototype void vp8_build_intra_predictors_sbuv_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_sbuv_s;
prototype void vp8_build_intra_predictors_mby "MACROBLOCKD *x"
prototype void vp8_build_intra_predictors_mby "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby;
prototype void vp8_build_comp_intra_predictors_mby "MACROBLOCKD *x"
prototype void vp8_build_comp_intra_predictors_mby "struct macroblockd *x"
specialize vp8_build_comp_intra_predictors_mby;
prototype void vp8_build_intra_predictors_mby_s "MACROBLOCKD *x"
prototype void vp8_build_intra_predictors_mby_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mby_s;
prototype void vp8_build_intra_predictors_mbuv "MACROBLOCKD *x"
prototype void vp8_build_intra_predictors_mbuv "struct macroblockd *x"
specialize vp8_build_intra_predictors_mbuv;
prototype void vp8_build_intra_predictors_mbuv_s "MACROBLOCKD *x"
prototype void vp8_build_intra_predictors_mbuv_s "struct macroblockd *x"
specialize vp8_build_intra_predictors_mbuv_s;
prototype void vp8_build_comp_intra_predictors_mbuv "MACROBLOCKD *x"
prototype void vp8_build_comp_intra_predictors_mbuv "struct macroblockd *x"
specialize vp8_build_comp_intra_predictors_mbuv;
prototype void vp8_intra4x4_predict "BLOCKD *x, int b_mode, unsigned char *predictor"
prototype void vp8_intra4x4_predict "struct blockd *x, int b_mode, unsigned char *predictor"
specialize vp8_intra4x4_predict;
prototype void vp8_comp_intra4x4_predict "BLOCKD *x, int b_mode, int second_mode, unsigned char *predictor"
prototype void vp8_comp_intra4x4_predict "struct blockd *x, int b_mode, int second_mode, unsigned char *predictor"
specialize vp8_comp_intra4x4_predict;
prototype void vp8_intra8x8_predict "BLOCKD *x, int b_mode, unsigned char *predictor"
prototype void vp8_intra8x8_predict "struct blockd *x, int b_mode, unsigned char *predictor"
specialize vp8_intra8x8_predict;
prototype void vp8_comp_intra8x8_predict "BLOCKD *x, int b_mode, int second_mode, unsigned char *predictor"
prototype void vp8_comp_intra8x8_predict "struct blockd *x, int b_mode, int second_mode, unsigned char *predictor"
specialize vp8_comp_intra8x8_predict;
prototype void vp8_intra_uv4x4_predict "BLOCKD *x, int b_mode, unsigned char *predictor"
prototype void vp8_intra_uv4x4_predict "struct blockd *x, int b_mode, unsigned char *predictor"
specialize vp8_intra_uv4x4_predict;
prototype void vp8_comp_intra_uv4x4_predict "BLOCKD *x, int b_mode, int second_mode, unsigned char *predictor"
prototype void vp8_comp_intra_uv4x4_predict "struct blockd *x, int b_mode, int second_mode, unsigned char *predictor"
specialize vp8_comp_intra_uv4x4_predict;
#
......@@ -367,6 +374,30 @@ specialize vp8_sub_pixel_mse32x32
prototype unsigned int vp8_get_mb_ss "const short *"
specialize vp8_get_mb_ss mmx sse2
# ENCODEMB INVOKE
prototype int vp8_mbblock_error "struct macroblock *mb, int dc"
specialize vp8_mbblock_error mmx sse2
vp8_mbblock_error_sse2=vp8_mbblock_error_xmm
prototype int vp8_block_error "short *coeff, short *dqcoeff, int block_size"
specialize vp8_block_error mmx sse2
vp8_block_error_sse2=vp8_block_error_xmm
prototype void vp8_subtract_b "struct block *be, struct blockd *bd, int pitch"
specialize vp8_subtract_b mmx sse2
prototype int vp8_mbuverror "struct macroblock *mb"
specialize vp8_mbuverror mmx sse2
vp8_mbuverror_sse2=vp8_mbuverror_xmm
prototype void vp8_subtract_b "struct block *be, struct blockd *bd, int pitch"
specialize vp8_subtract_b mmx sse2
prototype void vp8_subtract_mby "short *diff, unsigned char *src, unsigned char *pred, int stride"
specialize vp8_subtract_mby mmx sse2
prototype void vp8_subtract_mbuv "short *diff, unsigned char *usrc, unsigned char *vsrc, unsigned char *pred, int stride"
specialize vp8_subtract_mbuv mmx sse2
#
# Structured Similarity (SSIM)
......
......@@ -24,7 +24,7 @@ typedef struct {
int offset;
} search_site;
typedef struct {
typedef struct block {
// 16 Y blocks, 4 U blocks, 4 V blocks each with 16 entries
short *src_diff;
short *coeff;
......@@ -82,7 +82,7 @@ typedef struct {
int64_t txfm_rd_diff[NB_TXFM_MODES];
} PICK_MODE_CONTEXT;
typedef struct {
typedef struct macroblock {
DECLARE_ALIGNED(16, short, src_diff[400]); // 16x16 Y 8x8 U 8x8 V 4x4 2nd Y
DECLARE_ALIGNED(16, short, coeff[400]); // 16x16 Y 8x8 U 8x8 V 4x4 2nd Y
DECLARE_ALIGNED(16, unsigned char, thismb[256]); // 16x16 Y
......
......@@ -9,6 +9,7 @@
*/
#include "vpx_ports/config.h"
#include "vpx_rtcd.h"
#include "vp8/common/idct.h"
#include "quantize.h"
#include "vp8/common/reconintra.h"
......@@ -18,7 +19,6 @@
#include "dct.h"
#include "vp8/common/g_common.h"
#include "encodeintra.h"
#include "vpx_rtcd.h"
#if CONFIG_RUNTIME_CPU_DETECT
#define IF_RTCD(x) (x)
......@@ -70,7 +70,7 @@ void vp8_encode_intra4x4block(const VP8_ENCODER_RTCD *rtcd,
}
#endif
ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, b, 16);
vp8_subtract_b(be, b, 16);
tx_type = get_tx_type(&x->e_mbd, b);
if (tx_type != DCT_DCT) {
......@@ -109,8 +109,7 @@ void vp8_encode_intra16x16mby(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
vp8_build_comp_intra_predictors_mby(xd);
#endif
ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src),
xd->predictor, b->src_stride);
vp8_subtract_mby(x->src_diff, *(b->base_src), xd->predictor, b->src_stride);
if (tx_size == TX_16X16) {
BLOCKD *bd = &xd->block[0];
......@@ -159,9 +158,9 @@ void vp8_encode_intra16x16mbuv(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
}
#endif
ENCODEMB_INVOKE(&rtcd->encodemb, submbuv)(x->src_diff,
x->src.u_buffer, x->src.v_buffer,
xd->predictor, x->src.uv_stride);
vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer,
xd->predictor, x->src.uv_stride);
if (tx_size == TX_4X4) {
vp8_transform_mbuv_4x4(x);
vp8_quantize_mbuv_4x4(x);
......@@ -221,7 +220,7 @@ void vp8_encode_intra8x8(const VP8_ENCODER_RTCD *rtcd,
for (i = 0; i < 4; i++) {
b = &xd->block[ib + iblock[i]];
be = &x->block[ib + iblock[i]];
ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, b, 16);
vp8_subtract_b(be, b, 16);
x->vp8_short_fdct4x4(be->src_diff, be->coeff, 32);
x->quantize_b_4x4(be, b);
vp8_inverse_transform_b_4x4(IF_RTCD(&rtcd->common->idct), b, 32);
......@@ -261,7 +260,7 @@ void vp8_encode_intra_uv4x4(const VP8_ENCODER_RTCD *rtcd,
}
#endif
ENCODEMB_INVOKE(&rtcd->encodemb, subb)(be, b, 8);
vp8_subtract_b(be, b, 8);
x->vp8_short_fdct4x4(be->src_diff, be->coeff, 16);
x->quantize_b_4x4(be, b);
......
......@@ -19,6 +19,7 @@
#include "vpx_mem/vpx_mem.h"
#include "rdopt.h"
#include "vp8/common/systemdependent.h"
#include "vpx_rtcd.h"
#if CONFIG_RUNTIME_CPU_DETECT
#define IF_RTCD(x) (x)
......@@ -126,8 +127,10 @@ void vp8_subtract_mby_c(short *diff, unsigned char *src,
static void vp8_subtract_mb(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
BLOCK *b = &x->block[0];
ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src), x->e_mbd.predictor, b->src_stride);
ENCODEMB_INVOKE(&rtcd->encodemb, submbuv)(x->src_diff, x->src.u_buffer, x->src.v_buffer, x->e_mbd.predictor, x->src.uv_stride);
vp8_subtract_mby(x->src_diff, *(b->base_src), x->e_mbd.predictor,
b->src_stride);
vp8_subtract_mbuv(x->src_diff, x->src.u_buffer, x->src.v_buffer,
x->e_mbd.predictor, x->src.uv_stride);
}
static void build_dcblock_4x4(MACROBLOCK *x) {
......@@ -942,8 +945,7 @@ void vp8_encode_inter16x16y(const VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x) {
vp8_build_1st_inter16x16_predictors_mby(xd, xd->predictor, 16, 0);
ENCODEMB_INVOKE(&rtcd->encodemb, submby)(x->src_diff, *(b->base_src),
xd->predictor, b->src_stride);
vp8_subtract_mby(x->src_diff, *(b->base_src), xd->predictor, b->src_stride);
vp8_transform_mby_4x4(x);
vp8_quantize_mby_4x4(x);
......
......@@ -15,73 +15,6 @@
#include "vpx_ports/config.h"
#include "block.h"
#define prototype_mberr(sym) \
int (sym)(MACROBLOCK *mb, int dc)
#define prototype_berr(sym) \
int (sym)(short *coeff, short *dqcoeff, int block_size)
#define prototype_mbuverr(sym) \
int (sym)(MACROBLOCK *mb)
#define prototype_subb(sym) \
void (sym)(BLOCK *be,BLOCKD *bd, int pitch)
#define prototype_submby(sym) \
void (sym)(short *diff, unsigned char *src, unsigned char *pred, int stride)
#define prototype_submbuv(sym) \
void (sym)(short *diff, unsigned char *usrc, unsigned char *vsrc,\
unsigned char *pred, int stride)
#if ARCH_X86 || ARCH_X86_64
#include "x86/encodemb_x86.h"
#endif
#if ARCH_ARM
#include "arm/encodemb_arm.h"
#endif
#ifndef vp8_encodemb_berr
#define vp8_encodemb_berr vp8_block_error_c
#endif
extern prototype_berr(vp8_encodemb_berr);
#ifndef vp8_encodemb_mberr
#define vp8_encodemb_mberr vp8_mbblock_error_c
#endif
extern prototype_mberr(vp8_encodemb_mberr);
#ifndef vp8_encodemb_mbuverr
#define vp8_encodemb_mbuverr vp8_mbuverror_c
#endif
extern prototype_mbuverr(vp8_encodemb_mbuverr);
#ifndef vp8_encodemb_subb
#define vp8_encodemb_subb vp8_subtract_b_c
#endif
extern prototype_subb(vp8_encodemb_subb);
#ifndef vp8_encodemb_submby
#define vp8_encodemb_submby vp8_subtract_mby_c
#endif
extern prototype_submby(vp8_encodemb_submby);
#ifndef vp8_encodemb_submbuv
#define vp8_encodemb_submbuv vp8_subtract_mbuv_c
#endif
extern prototype_submbuv(vp8_encodemb_submbuv);
typedef struct {
prototype_berr(*berr);
prototype_mberr(*mberr);
prototype_mbuverr(*mbuverr);
prototype_subb(*subb);
prototype_submby(*submby);
prototype_submbuv(*submbuv);
} vp8_encodemb_rtcd_vtable_t;
typedef struct {
MB_PREDICTION_MODE mode;
MV_REFERENCE_FRAME ref_frame;
......
......@@ -32,14 +32,6 @@ void vp8_cmachine_specific_config(VP8_COMP *cpi) {
cpi->rtcd.fdct.fast4x4 = vp8_short_fdct4x4_c;
cpi->rtcd.fdct.fast8x4 = vp8_short_fdct8x4_c;
cpi->rtcd.fdct.walsh_short4x4 = vp8_short_walsh4x4_c;
cpi->rtcd.encodemb.berr = vp8_block_error_c;
cpi->rtcd.encodemb.mberr = vp8_mbblock_error_c;
cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_c;
cpi->rtcd.encodemb.subb = vp8_subtract_b_c;
cpi->rtcd.encodemb.submby = vp8_subtract_mby_c;
cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_c;
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;
......
......@@ -351,7 +351,6 @@ typedef struct {
typedef struct VP8_ENCODER_RTCD {
VP8_COMMON_RTCD *common;
vp8_fdct_rtcd_vtable_t fdct;
vp8_encodemb_rtcd_vtable_t encodemb;
vp8_search_rtcd_vtable_t search;
vp8_temporal_rtcd_vtable_t temporal;
} VP8_ENCODER_RTCD;
......
This diff is collapsed.
/*
* 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 ENCODEMB_X86_H
#define ENCODEMB_X86_H
/* Note:
*
* This platform is commonly built for runtime CPU detection. If you modify
* any of the function mappings present in this file, be sure to also update
* them in the function pointer initialization code
*/
#if HAVE_MMX
extern prototype_berr(vp8_block_error_mmx);
extern prototype_mberr(vp8_mbblock_error_mmx);
extern prototype_mbuverr(vp8_mbuverror_mmx);
extern prototype_subb(vp8_subtract_b_mmx);
extern prototype_submby(vp8_subtract_mby_mmx);
extern prototype_submbuv(vp8_subtract_mbuv_mmx);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_encodemb_berr
#define vp8_encodemb_berr vp8_block_error_mmx
#undef vp8_encodemb_mberr
#define vp8_encodemb_mberr vp8_mbblock_error_mmx
#undef vp8_encodemb_mbuverr
#define vp8_encodemb_mbuverr vp8_mbuverror_mmx
#undef vp8_encodemb_subb
#define vp8_encodemb_subb vp8_subtract_b_mmx
#undef vp8_encodemb_submby
#define vp8_encodemb_submby vp8_subtract_mby_mmx
#undef vp8_encodemb_submbuv
#define vp8_encodemb_submbuv vp8_subtract_mbuv_mmx
#endif
#endif
#if HAVE_SSE2
extern prototype_berr(vp8_block_error_xmm);
extern prototype_mberr(vp8_mbblock_error_xmm);
extern prototype_mbuverr(vp8_mbuverror_xmm);
extern prototype_subb(vp8_subtract_b_sse2);
extern prototype_submby(vp8_subtract_mby_sse2);
extern prototype_submbuv(vp8_subtract_mbuv_sse2);
#if !CONFIG_RUNTIME_CPU_DETECT
#undef vp8_encodemb_berr
#define vp8_encodemb_berr vp8_block_error_xmm
#undef vp8_encodemb_mberr
#define vp8_encodemb_mberr vp8_mbblock_error_xmm
#undef vp8_encodemb_mbuverr
#define vp8_encodemb_mbuverr vp8_mbuverror_xmm
#undef vp8_encodemb_subb
#define vp8_encodemb_subb vp8_subtract_b_sse2
#undef vp8_encodemb_submby
#define vp8_encodemb_submby vp8_subtract_mby_sse2
#undef vp8_encodemb_submbuv
#define vp8_encodemb_submbuv vp8_subtract_mbuv_sse2
#endif
#endif
#endif
......@@ -88,25 +88,8 @@ void vp8_arch_x86_encoder_init(VP8_COMP *cpi) {
*/
/* Override default functions with fastest ones for this CPU. */
#if HAVE_MMX
if (flags & HAS_MMX) {
cpi->rtcd.encodemb.berr = vp8_block_error_mmx;
cpi->rtcd.encodemb.mberr = vp8_mbblock_error_mmx;
cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_mmx;
cpi->rtcd.encodemb.subb = vp8_subtract_b_mmx;
cpi->rtcd.encodemb.submby = vp8_subtract_mby_mmx;
cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_mmx;
}
#endif
#if HAVE_SSE2
if (flags & HAS_SSE2) {
cpi->rtcd.encodemb.berr = vp8_block_error_xmm;
cpi->rtcd.encodemb.mberr = vp8_mbblock_error_xmm;
cpi->rtcd.encodemb.mbuverr = vp8_mbuverror_xmm;
cpi->rtcd.encodemb.subb = vp8_subtract_b_sse2;
cpi->rtcd.encodemb.submby = vp8_subtract_mby_sse2;
cpi->rtcd.encodemb.submbuv = vp8_subtract_mbuv_sse2;
cpi->rtcd.temporal.apply = vp8_temporal_filter_apply_sse2;
}
......
......@@ -89,7 +89,6 @@ VP8_CX_SRCS-yes += encoder/mbgraph.c
VP8_CX_SRCS-yes += encoder/mbgraph.h
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/encodemb_x86.h
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/dct_x86.h
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/mcomp_x86.h
VP8_CX_SRCS-$(ARCH_X86)$(ARCH_X86_64) += encoder/x86/quantize_x86.h
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment