1 /* 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 12 #ifndef __INC_ENCODEMB_H 13 #define __INC_ENCODEMB_H 14 15 #include "vpx_ports/config.h" 16 #include "block.h" 17 18 #define prototype_mberr(sym) \ 19 int (sym)(MACROBLOCK *mb, int dc) 20 21 #define prototype_berr(sym) \ 22 int (sym)(short *coeff, short *dqcoeff) 23 24 #define prototype_mbuverr(sym) \ 25 int (sym)(MACROBLOCK *mb) 26 27 #define prototype_subb(sym) \ 28 void (sym)(BLOCK *be,BLOCKD *bd, int pitch) 29 30 #define prototype_submby(sym) \ 31 void (sym)(short *diff, unsigned char *src, unsigned char *pred, int stride) 32 33 #define prototype_submbuv(sym) \ 34 void (sym)(short *diff, unsigned char *usrc, unsigned char *vsrc,\ 35 unsigned char *pred, int stride) 36 37 #if ARCH_X86 || ARCH_X86_64 38 #include "x86/encodemb_x86.h" 39 #endif 40 41 #if ARCH_ARM 42 #include "arm/encodemb_arm.h" 43 #endif 44 45 #ifndef vp8_encodemb_berr 46 #define vp8_encodemb_berr vp8_block_error_c 47 #endif 48 extern prototype_berr(vp8_encodemb_berr); 49 50 #ifndef vp8_encodemb_mberr 51 #define vp8_encodemb_mberr vp8_mbblock_error_c 52 #endif 53 extern prototype_mberr(vp8_encodemb_mberr); 54 55 #ifndef vp8_encodemb_mbuverr 56 #define vp8_encodemb_mbuverr vp8_mbuverror_c 57 #endif 58 extern prototype_mbuverr(vp8_encodemb_mbuverr); 59 60 #ifndef vp8_encodemb_subb 61 #define vp8_encodemb_subb vp8_subtract_b_c 62 #endif 63 extern prototype_subb(vp8_encodemb_subb); 64 65 #ifndef vp8_encodemb_submby 66 #define vp8_encodemb_submby vp8_subtract_mby_c 67 #endif 68 extern prototype_submby(vp8_encodemb_submby); 69 70 #ifndef vp8_encodemb_submbuv 71 #define vp8_encodemb_submbuv vp8_subtract_mbuv_c 72 #endif 73 extern prototype_submbuv(vp8_encodemb_submbuv); 74 75 76 typedef struct 77 { 78 prototype_berr(*berr); 79 prototype_mberr(*mberr); 80 prototype_mbuverr(*mbuverr); 81 prototype_subb(*subb); 82 prototype_submby(*submby); 83 prototype_submbuv(*submbuv); 84 } vp8_encodemb_rtcd_vtable_t; 85 86 #if CONFIG_RUNTIME_CPU_DETECT 87 #define ENCODEMB_INVOKE(ctx,fn) (ctx)->fn 88 #else 89 #define ENCODEMB_INVOKE(ctx,fn) vp8_encodemb_##fn 90 #endif 91 92 93 94 #include "onyx_int.h" 95 struct VP8_ENCODER_RTCD; 96 void vp8_encode_inter16x16(const struct VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x); 97 98 extern void vp8_stuff_inter16x16(MACROBLOCK *x); 99 100 void vp8_build_dcblock(MACROBLOCK *b); 101 void vp8_transform_mb(MACROBLOCK *mb); 102 void vp8_transform_mbuv(MACROBLOCK *x); 103 void vp8_transform_intra_mby(MACROBLOCK *x); 104 void vp8_encode_inter16x16uvrd(const struct VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x); 105 void vp8_optimize_mby(MACROBLOCK *x, const struct VP8_ENCODER_RTCD *rtcd); 106 void vp8_optimize_mbuv(MACROBLOCK *x, const struct VP8_ENCODER_RTCD *rtcd); 107 void vp8_encode_inter16x16y(const struct VP8_ENCODER_RTCD *rtcd, MACROBLOCK *x); 108 #endif 109