media/libvpx/vp8/encoder/modecosts.c

Thu, 15 Jan 2015 15:59:08 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:59:08 +0100
branch
TOR_BUG_9701
changeset 10
ac0c01689b40
permissions
-rw-r--r--

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.

     1 /*
     2  *  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
     3  *
     4  *  Use of this source code is governed by a BSD-style license
     5  *  that can be found in the LICENSE file in the root of the source
     6  *  tree. An additional intellectual property rights grant can be found
     7  *  in the file PATENTS.  All contributing project authors may
     8  *  be found in the AUTHORS file in the root of the source tree.
     9  */
    12 #include "vp8/common/blockd.h"
    13 #include "onyx_int.h"
    14 #include "treewriter.h"
    15 #include "vp8/common/entropymode.h"
    18 void vp8_init_mode_costs(VP8_COMP *c)
    19 {
    20     VP8_COMMON *x = &c->common;
    21     struct rd_costs_struct *rd_costs = &c->rd_costs;
    23     {
    24         const vp8_tree_p T = vp8_bmode_tree;
    26         int i = 0;
    28         do
    29         {
    30             int j = 0;
    32             do
    33             {
    34                 vp8_cost_tokens(rd_costs->bmode_costs[i][j],
    35                                 vp8_kf_bmode_prob[i][j], T);
    36             }
    37             while (++j < VP8_BINTRAMODES);
    38         }
    39         while (++i < VP8_BINTRAMODES);
    41         vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.bmode_prob, T);
    42     }
    43     vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.sub_mv_ref_prob,
    44                     vp8_sub_mv_ref_tree);
    46     vp8_cost_tokens(rd_costs->mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree);
    47     vp8_cost_tokens(rd_costs->mbmode_cost[0], vp8_kf_ymode_prob,
    48                     vp8_kf_ymode_tree);
    50     vp8_cost_tokens(rd_costs->intra_uv_mode_cost[1], x->fc.uv_mode_prob,
    51                     vp8_uv_mode_tree);
    52     vp8_cost_tokens(rd_costs->intra_uv_mode_cost[0], vp8_kf_uv_mode_prob,
    53                     vp8_uv_mode_tree);
    54 }

mercurial