Merge "vpxdec: report parse errors from webm_guess_framerate()"
[libvpx.git] / vp8 / decoder / idct_blk.c
blobc98bd5bb8415f64633d6b07b1e5aa956df32efb4
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 */
11 #include "vpx_ports/config.h"
12 #include "idct.h"
13 #include "dequantize.h"
15 void vp8_dequant_dc_idct_add_c(short *input, short *dq, unsigned char *pred,
16 unsigned char *dest, int pitch, int stride,
17 int Dc);
18 void vp8_dequant_idct_add_c(short *input, short *dq, unsigned char *pred,
19 unsigned char *dest, int pitch, int stride);
20 void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr,
21 unsigned char *dst_ptr, int pitch, int stride);
23 void vp8_dequant_dc_idct_add_y_block_c
24 (short *q, short *dq, unsigned char *pre,
25 unsigned char *dst, int stride, char *eobs, short *dc)
27 int i, j;
29 for (i = 0; i < 4; i++)
31 for (j = 0; j < 4; j++)
33 if (*eobs++ > 1)
34 vp8_dequant_dc_idct_add_c (q, dq, pre, dst, 16, stride, dc[0]);
35 else
36 vp8_dc_only_idct_add_c (dc[0], pre, dst, 16, stride);
38 q += 16;
39 pre += 4;
40 dst += 4;
41 dc ++;
44 pre += 64 - 16;
45 dst += 4*stride - 16;
49 void vp8_dequant_idct_add_y_block_c
50 (short *q, short *dq, unsigned char *pre,
51 unsigned char *dst, int stride, char *eobs)
53 int i, j;
55 for (i = 0; i < 4; i++)
57 for (j = 0; j < 4; j++)
59 if (*eobs++ > 1)
60 vp8_dequant_idct_add_c (q, dq, pre, dst, 16, stride);
61 else
63 vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dst, 16, stride);
64 ((int *)q)[0] = 0;
67 q += 16;
68 pre += 4;
69 dst += 4;
72 pre += 64 - 16;
73 dst += 4*stride - 16;
77 void vp8_dequant_idct_add_uv_block_c
78 (short *q, short *dq, unsigned char *pre,
79 unsigned char *dstu, unsigned char *dstv, int stride, char *eobs)
81 int i, j;
83 for (i = 0; i < 2; i++)
85 for (j = 0; j < 2; j++)
87 if (*eobs++ > 1)
88 vp8_dequant_idct_add_c (q, dq, pre, dstu, 8, stride);
89 else
91 vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dstu, 8, stride);
92 ((int *)q)[0] = 0;
95 q += 16;
96 pre += 4;
97 dstu += 4;
100 pre += 32 - 8;
101 dstu += 4*stride - 8;
104 for (i = 0; i < 2; i++)
106 for (j = 0; j < 2; j++)
108 if (*eobs++ > 1)
109 vp8_dequant_idct_add_c (q, dq, pre, dstv, 8, stride);
110 else
112 vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dstv, 8, stride);
113 ((int *)q)[0] = 0;
116 q += 16;
117 pre += 4;
118 dstv += 4;
121 pre += 32 - 8;
122 dstv += 4*stride - 8;