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 DEQUANTIZE_H 13 #define DEQUANTIZE_H 14 #include "vp8/common/blockd.h" 15 16 #define prototype_dequant_block(sym) \ 17 void sym(BLOCKD *x) 18 19 #define prototype_dequant_idct_add(sym) \ 20 void sym(short *input, short *dq, \ 21 unsigned char *pred, unsigned char *output, \ 22 int pitch, int stride) 23 24 #define prototype_dequant_dc_idct_add(sym) \ 25 void sym(short *input, short *dq, \ 26 unsigned char *pred, unsigned char *output, \ 27 int pitch, int stride, \ 28 int dc) 29 30 #define prototype_dequant_dc_idct_add_y_block(sym) \ 31 void sym(short *q, short *dq, \ 32 unsigned char *pre, unsigned char *dst, \ 33 int stride, char *eobs, short *dc) 34 35 #define prototype_dequant_idct_add_y_block(sym) \ 36 void sym(short *q, short *dq, \ 37 unsigned char *pre, unsigned char *dst, \ 38 int stride, char *eobs) 39 40 #define prototype_dequant_idct_add_uv_block(sym) \ 41 void sym(short *q, short *dq, \ 42 unsigned char *pre, unsigned char *dst_u, \ 43 unsigned char *dst_v, int stride, char *eobs) 44 45 #if ARCH_X86 || ARCH_X86_64 46 #include "x86/dequantize_x86.h" 47 #endif 48 49 #if ARCH_ARM 50 #include "arm/dequantize_arm.h" 51 #endif 52 53 #if ARCH_MIPS 54 #if defined(MIPS_DSP_REV) && MIPS_DSP_REV>=2 55 #include "mips/dequantize_mips.h" 56 #endif 57 #endif 58 59 #ifndef vp8_dequant_block 60 #define vp8_dequant_block vp8_dequantize_b_c 61 #endif 62 extern prototype_dequant_block(vp8_dequant_block); 63 64 #ifndef vp8_dequant_idct_add 65 #define vp8_dequant_idct_add vp8_dequant_idct_add_c 66 #endif 67 extern prototype_dequant_idct_add(vp8_dequant_idct_add); 68 69 #ifndef vp8_dequant_dc_idct_add 70 #define vp8_dequant_dc_idct_add vp8_dequant_dc_idct_add_c 71 #endif 72 extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add); 73 74 #ifndef vp8_dequant_dc_idct_add_y_block 75 #define vp8_dequant_dc_idct_add_y_block vp8_dequant_dc_idct_add_y_block_c 76 #endif 77 extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block); 78 79 #ifndef vp8_dequant_idct_add_y_block 80 #define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_c 81 #endif 82 extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block); 83 84 #ifndef vp8_dequant_idct_add_uv_block 85 #define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_c 86 #endif 87 extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block); 88 89 90 typedef prototype_dequant_block((*vp8_dequant_block_fn_t)); 91 92 typedef prototype_dequant_idct_add((*vp8_dequant_idct_add_fn_t)); 93 94 typedef prototype_dequant_dc_idct_add((*vp8_dequant_dc_idct_add_fn_t)); 95 96 typedef prototype_dequant_dc_idct_add_y_block((*vp8_dequant_dc_idct_add_y_block_fn_t)); 97 98 typedef prototype_dequant_idct_add_y_block((*vp8_dequant_idct_add_y_block_fn_t)); 99 100 typedef prototype_dequant_idct_add_uv_block((*vp8_dequant_idct_add_uv_block_fn_t)); 101 102 typedef struct 103 { 104 vp8_dequant_block_fn_t block; 105 vp8_dequant_idct_add_fn_t idct_add; 106 vp8_dequant_dc_idct_add_fn_t dc_idct_add; 107 vp8_dequant_dc_idct_add_y_block_fn_t dc_idct_add_y_block; 108 vp8_dequant_idct_add_y_block_fn_t idct_add_y_block; 109 vp8_dequant_idct_add_uv_block_fn_t idct_add_uv_block; 110 } vp8_dequant_rtcd_vtable_t; 111 112 #if CONFIG_RUNTIME_CPU_DETECT 113 #define DEQUANT_INVOKE(ctx,fn) (ctx)->fn 114 #else 115 #define DEQUANT_INVOKE(ctx,fn) vp8_dequant_##fn 116 #endif 117 118 #endif 119