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 "segmentation.h" |
michael@0 | 13 | #include "vpx_mem/vpx_mem.h" |
michael@0 | 14 | |
michael@0 | 15 | void vp8_update_gf_useage_maps(VP8_COMP *cpi, VP8_COMMON *cm, MACROBLOCK *x) |
michael@0 | 16 | { |
michael@0 | 17 | int mb_row, mb_col; |
michael@0 | 18 | |
michael@0 | 19 | MODE_INFO *this_mb_mode_info = cm->mi; |
michael@0 | 20 | |
michael@0 | 21 | x->gf_active_ptr = (signed char *)cpi->gf_active_flags; |
michael@0 | 22 | |
michael@0 | 23 | if ((cm->frame_type == KEY_FRAME) || (cm->refresh_golden_frame)) |
michael@0 | 24 | { |
michael@0 | 25 | /* Reset Gf useage monitors */ |
michael@0 | 26 | vpx_memset(cpi->gf_active_flags, 1, (cm->mb_rows * cm->mb_cols)); |
michael@0 | 27 | cpi->gf_active_count = cm->mb_rows * cm->mb_cols; |
michael@0 | 28 | } |
michael@0 | 29 | else |
michael@0 | 30 | { |
michael@0 | 31 | /* for each macroblock row in image */ |
michael@0 | 32 | for (mb_row = 0; mb_row < cm->mb_rows; mb_row++) |
michael@0 | 33 | { |
michael@0 | 34 | /* for each macroblock col in image */ |
michael@0 | 35 | for (mb_col = 0; mb_col < cm->mb_cols; mb_col++) |
michael@0 | 36 | { |
michael@0 | 37 | |
michael@0 | 38 | /* If using golden then set GF active flag if not already set. |
michael@0 | 39 | * If using last frame 0,0 mode then leave flag as it is |
michael@0 | 40 | * else if using non 0,0 motion or intra modes then clear |
michael@0 | 41 | * flag if it is currently set |
michael@0 | 42 | */ |
michael@0 | 43 | if ((this_mb_mode_info->mbmi.ref_frame == GOLDEN_FRAME) || (this_mb_mode_info->mbmi.ref_frame == ALTREF_FRAME)) |
michael@0 | 44 | { |
michael@0 | 45 | if (*(x->gf_active_ptr) == 0) |
michael@0 | 46 | { |
michael@0 | 47 | *(x->gf_active_ptr) = 1; |
michael@0 | 48 | cpi->gf_active_count ++; |
michael@0 | 49 | } |
michael@0 | 50 | } |
michael@0 | 51 | else if ((this_mb_mode_info->mbmi.mode != ZEROMV) && *(x->gf_active_ptr)) |
michael@0 | 52 | { |
michael@0 | 53 | *(x->gf_active_ptr) = 0; |
michael@0 | 54 | cpi->gf_active_count--; |
michael@0 | 55 | } |
michael@0 | 56 | |
michael@0 | 57 | x->gf_active_ptr++; /* Step onto next entry */ |
michael@0 | 58 | this_mb_mode_info++; /* skip to next mb */ |
michael@0 | 59 | |
michael@0 | 60 | } |
michael@0 | 61 | |
michael@0 | 62 | /* this is to account for the border */ |
michael@0 | 63 | this_mb_mode_info++; |
michael@0 | 64 | } |
michael@0 | 65 | } |
michael@0 | 66 | } |