1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libvpx/vp8/common/idct_blk.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,90 @@ 1.4 +/* 1.5 + * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license 1.8 + * that can be found in the LICENSE file in the root of the source 1.9 + * tree. An additional intellectual property rights grant can be found 1.10 + * in the file PATENTS. All contributing project authors may 1.11 + * be found in the AUTHORS file in the root of the source tree. 1.12 + */ 1.13 + 1.14 +#include "vpx_config.h" 1.15 +#include "vp8_rtcd.h" 1.16 +#include "vpx_mem/vpx_mem.h" 1.17 + 1.18 +void vp8_dequant_idct_add_c(short *input, short *dq, 1.19 + unsigned char *dest, int stride); 1.20 +void vp8_dc_only_idct_add_c(short input_dc, unsigned char * pred, 1.21 + int pred_stride, unsigned char *dst_ptr, 1.22 + int dst_stride); 1.23 + 1.24 +void vp8_dequant_idct_add_y_block_c 1.25 + (short *q, short *dq, 1.26 + unsigned char *dst, int stride, char *eobs) 1.27 +{ 1.28 + int i, j; 1.29 + 1.30 + for (i = 0; i < 4; i++) 1.31 + { 1.32 + for (j = 0; j < 4; j++) 1.33 + { 1.34 + if (*eobs++ > 1) 1.35 + vp8_dequant_idct_add_c (q, dq, dst, stride); 1.36 + else 1.37 + { 1.38 + vp8_dc_only_idct_add_c (q[0]*dq[0], dst, stride, dst, stride); 1.39 + vpx_memset(q, 0, 2 * sizeof(q[0])); 1.40 + } 1.41 + 1.42 + q += 16; 1.43 + dst += 4; 1.44 + } 1.45 + 1.46 + dst += 4*stride - 16; 1.47 + } 1.48 +} 1.49 + 1.50 +void vp8_dequant_idct_add_uv_block_c 1.51 + (short *q, short *dq, 1.52 + unsigned char *dstu, unsigned char *dstv, int stride, char *eobs) 1.53 +{ 1.54 + int i, j; 1.55 + 1.56 + for (i = 0; i < 2; i++) 1.57 + { 1.58 + for (j = 0; j < 2; j++) 1.59 + { 1.60 + if (*eobs++ > 1) 1.61 + vp8_dequant_idct_add_c (q, dq, dstu, stride); 1.62 + else 1.63 + { 1.64 + vp8_dc_only_idct_add_c (q[0]*dq[0], dstu, stride, dstu, stride); 1.65 + vpx_memset(q, 0, 2 * sizeof(q[0])); 1.66 + } 1.67 + 1.68 + q += 16; 1.69 + dstu += 4; 1.70 + } 1.71 + 1.72 + dstu += 4*stride - 8; 1.73 + } 1.74 + 1.75 + for (i = 0; i < 2; i++) 1.76 + { 1.77 + for (j = 0; j < 2; j++) 1.78 + { 1.79 + if (*eobs++ > 1) 1.80 + vp8_dequant_idct_add_c (q, dq, dstv, stride); 1.81 + else 1.82 + { 1.83 + vp8_dc_only_idct_add_c (q[0]*dq[0], dstv, stride, dstv, stride); 1.84 + vpx_memset(q, 0, 2 * sizeof(q[0])); 1.85 + } 1.86 + 1.87 + q += 16; 1.88 + dstv += 4; 1.89 + } 1.90 + 1.91 + dstv += 4*stride - 8; 1.92 + } 1.93 +}