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 "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#ifndef vp8_dequant_block
54#define vp8_dequant_block vp8_dequantize_b_c
55#endif
56extern prototype_dequant_block(vp8_dequant_block);
57
58#ifndef vp8_dequant_idct_add
59#define vp8_dequant_idct_add vp8_dequant_idct_add_c
60#endif
61extern prototype_dequant_idct_add(vp8_dequant_idct_add);
62
63#ifndef vp8_dequant_dc_idct_add
64#define vp8_dequant_dc_idct_add vp8_dequant_dc_idct_add_c
65#endif
66extern prototype_dequant_dc_idct_add(vp8_dequant_dc_idct_add);
67
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
71extern prototype_dequant_dc_idct_add_y_block(vp8_dequant_dc_idct_add_y_block);
72
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
76extern prototype_dequant_idct_add_y_block(vp8_dequant_idct_add_y_block);
77
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
81extern prototype_dequant_idct_add_uv_block(vp8_dequant_idct_add_uv_block);
82
83
84typedef prototype_dequant_block((*vp8_dequant_block_fn_t));
85
86typedef prototype_dequant_idct_add((*vp8_dequant_idct_add_fn_t));
87
88typedef prototype_dequant_dc_idct_add((*vp8_dequant_dc_idct_add_fn_t));
89
90typedef prototype_dequant_dc_idct_add_y_block((*vp8_dequant_dc_idct_add_y_block_fn_t));
91
92typedef prototype_dequant_idct_add_y_block((*vp8_dequant_idct_add_y_block_fn_t));
93
94typedef prototype_dequant_idct_add_uv_block((*vp8_dequant_idct_add_uv_block_fn_t));
95
96typedef struct
97{
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;
105
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
111
112#endif
113