1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libvpx/vp8/encoder/modecosts.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,54 @@ 1.4 +/* 1.5 + * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 1.6 + * 1.7 + * Use of this source code is governed by a BSD-style license 1.8 + * that can be found in the LICENSE file in the root of the source 1.9 + * tree. An additional intellectual property rights grant can be found 1.10 + * in the file PATENTS. All contributing project authors may 1.11 + * be found in the AUTHORS file in the root of the source tree. 1.12 + */ 1.13 + 1.14 + 1.15 +#include "vp8/common/blockd.h" 1.16 +#include "onyx_int.h" 1.17 +#include "treewriter.h" 1.18 +#include "vp8/common/entropymode.h" 1.19 + 1.20 + 1.21 +void vp8_init_mode_costs(VP8_COMP *c) 1.22 +{ 1.23 + VP8_COMMON *x = &c->common; 1.24 + struct rd_costs_struct *rd_costs = &c->rd_costs; 1.25 + 1.26 + { 1.27 + const vp8_tree_p T = vp8_bmode_tree; 1.28 + 1.29 + int i = 0; 1.30 + 1.31 + do 1.32 + { 1.33 + int j = 0; 1.34 + 1.35 + do 1.36 + { 1.37 + vp8_cost_tokens(rd_costs->bmode_costs[i][j], 1.38 + vp8_kf_bmode_prob[i][j], T); 1.39 + } 1.40 + while (++j < VP8_BINTRAMODES); 1.41 + } 1.42 + while (++i < VP8_BINTRAMODES); 1.43 + 1.44 + vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.bmode_prob, T); 1.45 + } 1.46 + vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.sub_mv_ref_prob, 1.47 + vp8_sub_mv_ref_tree); 1.48 + 1.49 + vp8_cost_tokens(rd_costs->mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree); 1.50 + vp8_cost_tokens(rd_costs->mbmode_cost[0], vp8_kf_ymode_prob, 1.51 + vp8_kf_ymode_tree); 1.52 + 1.53 + vp8_cost_tokens(rd_costs->intra_uv_mode_cost[1], x->fc.uv_mode_prob, 1.54 + vp8_uv_mode_tree); 1.55 + vp8_cost_tokens(rd_costs->intra_uv_mode_cost[0], vp8_kf_uv_mode_prob, 1.56 + vp8_uv_mode_tree); 1.57 +}