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.
12 #include "vpx_ports/config.h"
13 #include "dequantize.h"
14 #include "vp8/common/idct.h"
15 #include "vpx_mem/vpx_mem.h"
17 extern void vp8_short_idct4x4llm_c(short *input
, short *output
, int pitch
) ;
18 extern void vp8_short_idct4x4llm_1_c(short *input
, short *output
, int pitch
);
21 void vp8_dequantize_b_c(BLOCKD
*d
)
24 short *DQ
= d
->dqcoeff
;
26 short *DQC
= d
->dequant
;
28 for (i
= 0; i
< 16; i
++)
30 DQ
[i
] = Q
[i
] * DQC
[i
];
34 void vp8_dequant_idct_add_c(short *input
, short *dq
, unsigned char *pred
,
35 unsigned char *dest
, int pitch
, int stride
)
38 short *diff_ptr
= output
;
42 for (i
= 0; i
< 16; i
++)
44 input
[i
] = dq
[i
] * input
[i
];
47 /* the idct halves ( >> 1) the pitch */
48 vp8_short_idct4x4llm_c(input
, output
, 4 << 1);
50 vpx_memset(input
, 0, 32);
52 for (r
= 0; r
< 4; r
++)
54 for (c
= 0; c
< 4; c
++)
56 int a
= diff_ptr
[c
] + pred
[c
];
64 dest
[c
] = (unsigned char) a
;
73 void vp8_dequant_dc_idct_add_c(short *input
, short *dq
, unsigned char *pred
,
74 unsigned char *dest
, int pitch
, int stride
,
79 short *diff_ptr
= output
;
84 for (i
= 1; i
< 16; i
++)
86 input
[i
] = dq
[i
] * input
[i
];
89 /* the idct halves ( >> 1) the pitch */
90 vp8_short_idct4x4llm_c(input
, output
, 4 << 1);
92 vpx_memset(input
, 0, 32);
94 for (r
= 0; r
< 4; r
++)
96 for (c
= 0; c
< 4; c
++)
98 int a
= diff_ptr
[c
] + pred
[c
];
106 dest
[c
] = (unsigned char) a
;