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 #include "vpx_config.h"
12 #include "vp8_rtcd.h"
13 #include "vpx_mem/vpx_mem.h"
14
15 void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *dest,
16 int stride);
17 void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred,
18 int pred_stride, unsigned char *dst_ptr,
19 int dst_stride);
20
vp8_dequant_idct_add_y_block_c(short * q,short * dq,unsigned char * dst,int stride,char * eobs)21 void vp8_dequant_idct_add_y_block_c(short *q, short *dq, unsigned char *dst,
22 int stride, char *eobs) {
23 int i, j;
24
25 for (i = 0; i < 4; ++i) {
26 for (j = 0; j < 4; ++j) {
27 if (*eobs++ > 1) {
28 vp8_dequant_idct_add_c(q, dq, dst, stride);
29 } else {
30 vp8_dc_only_idct_add_c(q[0] * dq[0], dst, stride, dst, stride);
31 memset(q, 0, 2 * sizeof(q[0]));
32 }
33
34 q += 16;
35 dst += 4;
36 }
37
38 dst += 4 * stride - 16;
39 }
40 }
41
vp8_dequant_idct_add_uv_block_c(short * q,short * dq,unsigned char * dstu,unsigned char * dstv,int stride,char * eobs)42 void vp8_dequant_idct_add_uv_block_c(short *q, short *dq, unsigned char *dstu,
43 unsigned char *dstv, int stride,
44 char *eobs) {
45 int i, j;
46
47 for (i = 0; i < 2; ++i) {
48 for (j = 0; j < 2; ++j) {
49 if (*eobs++ > 1) {
50 vp8_dequant_idct_add_c(q, dq, dstu, stride);
51 } else {
52 vp8_dc_only_idct_add_c(q[0] * dq[0], dstu, stride, dstu, stride);
53 memset(q, 0, 2 * sizeof(q[0]));
54 }
55
56 q += 16;
57 dstu += 4;
58 }
59
60 dstu += 4 * stride - 8;
61 }
62
63 for (i = 0; i < 2; ++i) {
64 for (j = 0; j < 2; ++j) {
65 if (*eobs++ > 1) {
66 vp8_dequant_idct_add_c(q, dq, dstv, stride);
67 } else {
68 vp8_dc_only_idct_add_c(q[0] * dq[0], dstv, stride, dstv, stride);
69 memset(q, 0, 2 * sizeof(q[0]));
70 }
71
72 q += 16;
73 dstv += 4;
74 }
75
76 dstv += 4 * stride - 8;
77 }
78 }
79