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.
17 void vp8_short_fdct4x4_c(int16_t *input
, int16_t *output
, int32_t pitch
) {
23 for (i
= 0; i
< 4; ++i
) {
24 a1
= ((ip
[0] + ip
[3]));
25 b1
= ((ip
[1] + ip
[2]));
26 c1
= ((ip
[1] - ip
[2]));
27 d1
= ((ip
[0] - ip
[3]));
33 //printf("a1 = %08x\tb1 = %08x\tc1 = %08x\td1 = %08x\n", a1, b1, c1, d1);
37 //printf("op[0] = %04x\top[2] = %04x\n", (uint16_t)op[0], (uint16_t)op[2]);
39 op
[1] = (c1
* 2217 + d1
* 5352 + 14500) >> 12;
40 op
[3] = (d1
* 2217 - c1
* 5352 + 7500) >> 12;
41 //printf("op[1] = %04x\top[3] = %04x\n", (uint16_t)op[1], (uint16_t)op[3]);
48 for (i
= 0; i
< 4; ++i
) {
53 //printf("a1 = %08x\tb1 = %08x\tc1 = %08x\td1 = %08x\n", a1, b1, c1, d1);
55 op
[0] = (a1
+ b1
+ 7) >> 4;
56 op
[8] = (a1
- b1
+ 7) >> 4;
57 //printf("op[%d] = %08x\top[%d] = %08x\n", i, op[0], i+8, op[8]);
59 op
[4] = ((c1
* 2217 + d1
* 5352 + 12000) >> 16) + (d1
!= 0);
60 op
[12] = (d1
* 2217 - c1
* 5352 + 51000) >> 16;
61 //printf("op[%d] = %04x\top[%d] = %04x\n", i+4, (uint16_t)op[4], i+12, (uint16_t)op[12]);