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 <stdio.h> |
michael@0 | 13 | #include "blockd.h" |
michael@0 | 14 | |
michael@0 | 15 | |
michael@0 | 16 | void vp8_print_modes_and_motion_vectors(MODE_INFO *mi, int rows, int cols, int frame) |
michael@0 | 17 | { |
michael@0 | 18 | |
michael@0 | 19 | int mb_row; |
michael@0 | 20 | int mb_col; |
michael@0 | 21 | int mb_index = 0; |
michael@0 | 22 | FILE *mvs = fopen("mvs.stt", "a"); |
michael@0 | 23 | |
michael@0 | 24 | /* print out the macroblock Y modes */ |
michael@0 | 25 | mb_index = 0; |
michael@0 | 26 | fprintf(mvs, "Mb Modes for Frame %d\n", frame); |
michael@0 | 27 | |
michael@0 | 28 | for (mb_row = 0; mb_row < rows; mb_row++) |
michael@0 | 29 | { |
michael@0 | 30 | for (mb_col = 0; mb_col < cols; mb_col++) |
michael@0 | 31 | { |
michael@0 | 32 | |
michael@0 | 33 | fprintf(mvs, "%2d ", mi[mb_index].mbmi.mode); |
michael@0 | 34 | |
michael@0 | 35 | mb_index++; |
michael@0 | 36 | } |
michael@0 | 37 | |
michael@0 | 38 | fprintf(mvs, "\n"); |
michael@0 | 39 | mb_index++; |
michael@0 | 40 | } |
michael@0 | 41 | |
michael@0 | 42 | fprintf(mvs, "\n"); |
michael@0 | 43 | |
michael@0 | 44 | mb_index = 0; |
michael@0 | 45 | fprintf(mvs, "Mb mv ref for Frame %d\n", frame); |
michael@0 | 46 | |
michael@0 | 47 | for (mb_row = 0; mb_row < rows; mb_row++) |
michael@0 | 48 | { |
michael@0 | 49 | for (mb_col = 0; mb_col < cols; mb_col++) |
michael@0 | 50 | { |
michael@0 | 51 | |
michael@0 | 52 | fprintf(mvs, "%2d ", mi[mb_index].mbmi.ref_frame); |
michael@0 | 53 | |
michael@0 | 54 | mb_index++; |
michael@0 | 55 | } |
michael@0 | 56 | |
michael@0 | 57 | fprintf(mvs, "\n"); |
michael@0 | 58 | mb_index++; |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | fprintf(mvs, "\n"); |
michael@0 | 62 | |
michael@0 | 63 | /* print out the macroblock UV modes */ |
michael@0 | 64 | mb_index = 0; |
michael@0 | 65 | fprintf(mvs, "UV Modes for Frame %d\n", frame); |
michael@0 | 66 | |
michael@0 | 67 | for (mb_row = 0; mb_row < rows; mb_row++) |
michael@0 | 68 | { |
michael@0 | 69 | for (mb_col = 0; mb_col < cols; mb_col++) |
michael@0 | 70 | { |
michael@0 | 71 | |
michael@0 | 72 | fprintf(mvs, "%2d ", mi[mb_index].mbmi.uv_mode); |
michael@0 | 73 | |
michael@0 | 74 | mb_index++; |
michael@0 | 75 | } |
michael@0 | 76 | |
michael@0 | 77 | mb_index++; |
michael@0 | 78 | fprintf(mvs, "\n"); |
michael@0 | 79 | } |
michael@0 | 80 | |
michael@0 | 81 | fprintf(mvs, "\n"); |
michael@0 | 82 | |
michael@0 | 83 | /* print out the block modes */ |
michael@0 | 84 | mb_index = 0; |
michael@0 | 85 | fprintf(mvs, "Mbs for Frame %d\n", frame); |
michael@0 | 86 | { |
michael@0 | 87 | int b_row; |
michael@0 | 88 | |
michael@0 | 89 | for (b_row = 0; b_row < 4 * rows; b_row++) |
michael@0 | 90 | { |
michael@0 | 91 | int b_col; |
michael@0 | 92 | int bindex; |
michael@0 | 93 | |
michael@0 | 94 | for (b_col = 0; b_col < 4 * cols; b_col++) |
michael@0 | 95 | { |
michael@0 | 96 | mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); |
michael@0 | 97 | bindex = (b_row & 3) * 4 + (b_col & 3); |
michael@0 | 98 | |
michael@0 | 99 | if (mi[mb_index].mbmi.mode == B_PRED) |
michael@0 | 100 | fprintf(mvs, "%2d ", mi[mb_index].bmi[bindex].as_mode); |
michael@0 | 101 | else |
michael@0 | 102 | fprintf(mvs, "xx "); |
michael@0 | 103 | |
michael@0 | 104 | } |
michael@0 | 105 | |
michael@0 | 106 | fprintf(mvs, "\n"); |
michael@0 | 107 | } |
michael@0 | 108 | } |
michael@0 | 109 | fprintf(mvs, "\n"); |
michael@0 | 110 | |
michael@0 | 111 | /* print out the macroblock mvs */ |
michael@0 | 112 | mb_index = 0; |
michael@0 | 113 | fprintf(mvs, "MVs for Frame %d\n", frame); |
michael@0 | 114 | |
michael@0 | 115 | for (mb_row = 0; mb_row < rows; mb_row++) |
michael@0 | 116 | { |
michael@0 | 117 | for (mb_col = 0; mb_col < cols; mb_col++) |
michael@0 | 118 | { |
michael@0 | 119 | fprintf(mvs, "%5d:%-5d", mi[mb_index].mbmi.mv.as_mv.row / 2, mi[mb_index].mbmi.mv.as_mv.col / 2); |
michael@0 | 120 | |
michael@0 | 121 | mb_index++; |
michael@0 | 122 | } |
michael@0 | 123 | |
michael@0 | 124 | mb_index++; |
michael@0 | 125 | fprintf(mvs, "\n"); |
michael@0 | 126 | } |
michael@0 | 127 | |
michael@0 | 128 | fprintf(mvs, "\n"); |
michael@0 | 129 | |
michael@0 | 130 | |
michael@0 | 131 | /* print out the block modes */ |
michael@0 | 132 | mb_index = 0; |
michael@0 | 133 | fprintf(mvs, "MVs for Frame %d\n", frame); |
michael@0 | 134 | { |
michael@0 | 135 | int b_row; |
michael@0 | 136 | |
michael@0 | 137 | for (b_row = 0; b_row < 4 * rows; b_row++) |
michael@0 | 138 | { |
michael@0 | 139 | int b_col; |
michael@0 | 140 | int bindex; |
michael@0 | 141 | |
michael@0 | 142 | for (b_col = 0; b_col < 4 * cols; b_col++) |
michael@0 | 143 | { |
michael@0 | 144 | mb_index = (b_row >> 2) * (cols + 1) + (b_col >> 2); |
michael@0 | 145 | bindex = (b_row & 3) * 4 + (b_col & 3); |
michael@0 | 146 | fprintf(mvs, "%3d:%-3d ", mi[mb_index].bmi[bindex].mv.as_mv.row, mi[mb_index].bmi[bindex].mv.as_mv.col); |
michael@0 | 147 | |
michael@0 | 148 | } |
michael@0 | 149 | |
michael@0 | 150 | fprintf(mvs, "\n"); |
michael@0 | 151 | } |
michael@0 | 152 | } |
michael@0 | 153 | fprintf(mvs, "\n"); |
michael@0 | 154 | |
michael@0 | 155 | |
michael@0 | 156 | fclose(mvs); |
michael@0 | 157 | } |