1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libvpx/vp8/common/mbpitch.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,68 @@ 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 + 1.15 +#include "blockd.h" 1.16 + 1.17 +void vp8_setup_block_dptrs(MACROBLOCKD *x) 1.18 +{ 1.19 + int r, c; 1.20 + 1.21 + for (r = 0; r < 4; r++) 1.22 + { 1.23 + for (c = 0; c < 4; c++) 1.24 + { 1.25 + x->block[r*4+c].predictor = x->predictor + r * 4 * 16 + c * 4; 1.26 + } 1.27 + } 1.28 + 1.29 + for (r = 0; r < 2; r++) 1.30 + { 1.31 + for (c = 0; c < 2; c++) 1.32 + { 1.33 + x->block[16+r*2+c].predictor = x->predictor + 256 + r * 4 * 8 + c * 4; 1.34 + 1.35 + } 1.36 + } 1.37 + 1.38 + for (r = 0; r < 2; r++) 1.39 + { 1.40 + for (c = 0; c < 2; c++) 1.41 + { 1.42 + x->block[20+r*2+c].predictor = x->predictor + 320 + r * 4 * 8 + c * 4; 1.43 + 1.44 + } 1.45 + } 1.46 + 1.47 + for (r = 0; r < 25; r++) 1.48 + { 1.49 + x->block[r].qcoeff = x->qcoeff + r * 16; 1.50 + x->block[r].dqcoeff = x->dqcoeff + r * 16; 1.51 + x->block[r].eob = x->eobs + r; 1.52 + } 1.53 +} 1.54 + 1.55 +void vp8_build_block_doffsets(MACROBLOCKD *x) 1.56 +{ 1.57 + int block; 1.58 + 1.59 + for (block = 0; block < 16; block++) /* y blocks */ 1.60 + { 1.61 + x->block[block].offset = 1.62 + (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4; 1.63 + } 1.64 + 1.65 + for (block = 16; block < 20; block++) /* U and V blocks */ 1.66 + { 1.67 + x->block[block+4].offset = 1.68 + x->block[block].offset = 1.69 + ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4; 1.70 + } 1.71 +}