Merge "Skip computation of distortion in vp8_pick_inter_mode if active_map is used"
[libvpx.git] / vp8 / decoder / dequantize.h
blob2e662a59382861cc2305f474ba553ceaadb2ac2c
1 /*
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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 */
12 #ifndef DEQUANTIZE_H
13 #define DEQUANTIZE_H
14 #include "vp8/common/blockd.h"
16 #define prototype_dequant_block(sym) \
17 void sym(BLOCKD *x)
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)
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)
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)
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)
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)
45 #if ARCH_X86 || ARCH_X86_64
46 #include "x86/dequantize_x86.h"
47 #endif
49 #if ARCH_ARM
50 #include "arm/dequantize_arm.h"
51 #endif
53 #ifndef vp8_dequant_block
54 #define vp8_dequant_block vp8_dequantize_b_c
55 #endif
56 extern prototype_dequant_block(vp8_dequant_block);
58 #ifndef vp8_dequant_idct_add
59 #define vp8_dequant_idct_add vp8_dequant_idct_add_c
60 #endif
61 extern prototype_dequant_idct_add(vp8_dequant_idct_add);
63 #ifndef vp8_dequant_dc_idct_add
64 #define vp8_dequant_dc_idct_add vp8_dequant_dc_idct_add_c
65 #endif
66 extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add);
68 #ifndef vp8_dequant_dc_idct_add_y_block
69 #define vp8_dequant_dc_idct_add_y_block vp8_dequant_dc_idct_add_y_block_c
70 #endif
71 extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block);
73 #ifndef vp8_dequant_idct_add_y_block
74 #define vp8_dequant_idct_add_y_block vp8_dequant_idct_add_y_block_c
75 #endif
76 extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block);
78 #ifndef vp8_dequant_idct_add_uv_block
79 #define vp8_dequant_idct_add_uv_block vp8_dequant_idct_add_uv_block_c
80 #endif
81 extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block);
84 typedef prototype_dequant_block((*vp8_dequant_block_fn_t));
86 typedef prototype_dequant_idct_add((*vp8_dequant_idct_add_fn_t));
88 typedef prototype_dequant_dc_idct_add((*vp8_dequant_dc_idct_add_fn_t));
90 typedef prototype_dequant_dc_idct_add_y_block((*vp8_dequant_dc_idct_add_y_block_fn_t));
92 typedef prototype_dequant_idct_add_y_block((*vp8_dequant_idct_add_y_block_fn_t));
94 typedef prototype_dequant_idct_add_uv_block((*vp8_dequant_idct_add_uv_block_fn_t));
96 typedef struct
98 vp8_dequant_block_fn_t block;
99 vp8_dequant_idct_add_fn_t idct_add;
100 vp8_dequant_dc_idct_add_fn_t dc_idct_add;
101 vp8_dequant_dc_idct_add_y_block_fn_t dc_idct_add_y_block;
102 vp8_dequant_idct_add_y_block_fn_t idct_add_y_block;
103 vp8_dequant_idct_add_uv_block_fn_t idct_add_uv_block;
104 } vp8_dequant_rtcd_vtable_t;
106 #if CONFIG_RUNTIME_CPU_DETECT
107 #define DEQUANT_INVOKE(ctx,fn) (ctx)->fn
108 #else
109 #define DEQUANT_INVOKE(ctx,fn) vp8_dequant_##fn
110 #endif
112 #endif