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 "vp8/common/blockd.h" |
michael@0 | 13 | #include "onyx_int.h" |
michael@0 | 14 | #include "treewriter.h" |
michael@0 | 15 | #include "vp8/common/entropymode.h" |
michael@0 | 16 | |
michael@0 | 17 | |
michael@0 | 18 | void vp8_init_mode_costs(VP8_COMP *c) |
michael@0 | 19 | { |
michael@0 | 20 | VP8_COMMON *x = &c->common; |
michael@0 | 21 | struct rd_costs_struct *rd_costs = &c->rd_costs; |
michael@0 | 22 | |
michael@0 | 23 | { |
michael@0 | 24 | const vp8_tree_p T = vp8_bmode_tree; |
michael@0 | 25 | |
michael@0 | 26 | int i = 0; |
michael@0 | 27 | |
michael@0 | 28 | do |
michael@0 | 29 | { |
michael@0 | 30 | int j = 0; |
michael@0 | 31 | |
michael@0 | 32 | do |
michael@0 | 33 | { |
michael@0 | 34 | vp8_cost_tokens(rd_costs->bmode_costs[i][j], |
michael@0 | 35 | vp8_kf_bmode_prob[i][j], T); |
michael@0 | 36 | } |
michael@0 | 37 | while (++j < VP8_BINTRAMODES); |
michael@0 | 38 | } |
michael@0 | 39 | while (++i < VP8_BINTRAMODES); |
michael@0 | 40 | |
michael@0 | 41 | vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.bmode_prob, T); |
michael@0 | 42 | } |
michael@0 | 43 | vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.sub_mv_ref_prob, |
michael@0 | 44 | vp8_sub_mv_ref_tree); |
michael@0 | 45 | |
michael@0 | 46 | vp8_cost_tokens(rd_costs->mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree); |
michael@0 | 47 | vp8_cost_tokens(rd_costs->mbmode_cost[0], vp8_kf_ymode_prob, |
michael@0 | 48 | vp8_kf_ymode_tree); |
michael@0 | 49 | |
michael@0 | 50 | vp8_cost_tokens(rd_costs->intra_uv_mode_cost[1], x->fc.uv_mode_prob, |
michael@0 | 51 | vp8_uv_mode_tree); |
michael@0 | 52 | vp8_cost_tokens(rd_costs->intra_uv_mode_cost[0], vp8_kf_uv_mode_prob, |
michael@0 | 53 | vp8_uv_mode_tree); |
michael@0 | 54 | } |