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_ports/config.h" 12 #include "vp8/common/idct.h" 13 #include "dequantize.h" 14 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); 22 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) 26 { 27 int i, j; 28 29 for (i = 0; i < 4; i++) 30 { 31 for (j = 0; j < 4; j++) 32 { 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); 37 38 q += 16; 39 pre += 4; 40 dst += 4; 41 dc ++; 42 } 43 44 pre += 64 - 16; 45 dst += 4*stride - 16; 46 } 47 } 48 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) 52 { 53 int i, j; 54 55 for (i = 0; i < 4; i++) 56 { 57 for (j = 0; j < 4; j++) 58 { 59 if (*eobs++ > 1) 60 vp8_dequant_idct_add_c (q, dq, pre, dst, 16, stride); 61 else 62 { 63 vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dst, 16, stride); 64 ((int *)q)[0] = 0; 65 } 66 67 q += 16; 68 pre += 4; 69 dst += 4; 70 } 71 72 pre += 64 - 16; 73 dst += 4*stride - 16; 74 } 75 } 76 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) 80 { 81 int i, j; 82 83 for (i = 0; i < 2; i++) 84 { 85 for (j = 0; j < 2; j++) 86 { 87 if (*eobs++ > 1) 88 vp8_dequant_idct_add_c (q, dq, pre, dstu, 8, stride); 89 else 90 { 91 vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dstu, 8, stride); 92 ((int *)q)[0] = 0; 93 } 94 95 q += 16; 96 pre += 4; 97 dstu += 4; 98 } 99 100 pre += 32 - 8; 101 dstu += 4*stride - 8; 102 } 103 104 for (i = 0; i < 2; i++) 105 { 106 for (j = 0; j < 2; j++) 107 { 108 if (*eobs++ > 1) 109 vp8_dequant_idct_add_c (q, dq, pre, dstv, 8, stride); 110 else 111 { 112 vp8_dc_only_idct_add_c (q[0]*dq[0], pre, dstv, 8, stride); 113 ((int *)q)[0] = 0; 114 } 115 116 q += 16; 117 pre += 4; 118 dstv += 4; 119 } 120 121 pre += 32 - 8; 122 dstv += 4*stride - 8; 123 } 124 } 125