Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | /* |
michael@0 | 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
michael@0 | 3 | * |
michael@0 | 4 | * Use of this source code is governed by a BSD-style license |
michael@0 | 5 | * that can be found in the LICENSE file in the root of the source |
michael@0 | 6 | * tree. An additional intellectual property rights grant can be found |
michael@0 | 7 | * in the file PATENTS. All contributing project authors may |
michael@0 | 8 | * be found in the AUTHORS file in the root of the source tree. |
michael@0 | 9 | */ |
michael@0 | 10 | |
michael@0 | 11 | |
michael@0 | 12 | #include "blockd.h" |
michael@0 | 13 | |
michael@0 | 14 | void vp8_setup_block_dptrs(MACROBLOCKD *x) |
michael@0 | 15 | { |
michael@0 | 16 | int r, c; |
michael@0 | 17 | |
michael@0 | 18 | for (r = 0; r < 4; r++) |
michael@0 | 19 | { |
michael@0 | 20 | for (c = 0; c < 4; c++) |
michael@0 | 21 | { |
michael@0 | 22 | x->block[r*4+c].predictor = x->predictor + r * 4 * 16 + c * 4; |
michael@0 | 23 | } |
michael@0 | 24 | } |
michael@0 | 25 | |
michael@0 | 26 | for (r = 0; r < 2; r++) |
michael@0 | 27 | { |
michael@0 | 28 | for (c = 0; c < 2; c++) |
michael@0 | 29 | { |
michael@0 | 30 | x->block[16+r*2+c].predictor = x->predictor + 256 + r * 4 * 8 + c * 4; |
michael@0 | 31 | |
michael@0 | 32 | } |
michael@0 | 33 | } |
michael@0 | 34 | |
michael@0 | 35 | for (r = 0; r < 2; r++) |
michael@0 | 36 | { |
michael@0 | 37 | for (c = 0; c < 2; c++) |
michael@0 | 38 | { |
michael@0 | 39 | x->block[20+r*2+c].predictor = x->predictor + 320 + r * 4 * 8 + c * 4; |
michael@0 | 40 | |
michael@0 | 41 | } |
michael@0 | 42 | } |
michael@0 | 43 | |
michael@0 | 44 | for (r = 0; r < 25; r++) |
michael@0 | 45 | { |
michael@0 | 46 | x->block[r].qcoeff = x->qcoeff + r * 16; |
michael@0 | 47 | x->block[r].dqcoeff = x->dqcoeff + r * 16; |
michael@0 | 48 | x->block[r].eob = x->eobs + r; |
michael@0 | 49 | } |
michael@0 | 50 | } |
michael@0 | 51 | |
michael@0 | 52 | void vp8_build_block_doffsets(MACROBLOCKD *x) |
michael@0 | 53 | { |
michael@0 | 54 | int block; |
michael@0 | 55 | |
michael@0 | 56 | for (block = 0; block < 16; block++) /* y blocks */ |
michael@0 | 57 | { |
michael@0 | 58 | x->block[block].offset = |
michael@0 | 59 | (block >> 2) * 4 * x->dst.y_stride + (block & 3) * 4; |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | for (block = 16; block < 20; block++) /* U and V blocks */ |
michael@0 | 63 | { |
michael@0 | 64 | x->block[block+4].offset = |
michael@0 | 65 | x->block[block].offset = |
michael@0 | 66 | ((block - 16) >> 1) * 4 * x->dst.uv_stride + (block & 1) * 4; |
michael@0 | 67 | } |
michael@0 | 68 | } |