1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/libvpx/vp9/encoder/vp9_modecosts.c Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 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 "vp9/common/vp9_blockd.h" 1.16 +#include "vp9/encoder/vp9_onyx_int.h" 1.17 +#include "vp9/encoder/vp9_treewriter.h" 1.18 +#include "vp9/common/vp9_entropymode.h" 1.19 + 1.20 + 1.21 +void vp9_init_mode_costs(VP9_COMP *c) { 1.22 + VP9_COMMON *const cm = &c->common; 1.23 + const vp9_tree_index *KT = vp9_intra_mode_tree; 1.24 + int i, j; 1.25 + 1.26 + for (i = 0; i < INTRA_MODES; i++) { 1.27 + for (j = 0; j < INTRA_MODES; j++) { 1.28 + vp9_cost_tokens((int *)c->mb.y_mode_costs[i][j], vp9_kf_y_mode_prob[i][j], 1.29 + KT); 1.30 + } 1.31 + } 1.32 + 1.33 + // TODO(rbultje) separate tables for superblock costing? 1.34 + vp9_cost_tokens(c->mb.mbmode_cost, cm->fc.y_mode_prob[1], 1.35 + vp9_intra_mode_tree); 1.36 + vp9_cost_tokens(c->mb.intra_uv_mode_cost[1], 1.37 + cm->fc.uv_mode_prob[INTRA_MODES - 1], vp9_intra_mode_tree); 1.38 + vp9_cost_tokens(c->mb.intra_uv_mode_cost[0], 1.39 + vp9_kf_uv_mode_prob[INTRA_MODES - 1], 1.40 + vp9_intra_mode_tree); 1.41 + 1.42 + for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) 1.43 + vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i], 1.44 + cm->fc.switchable_interp_prob[i], 1.45 + vp9_switchable_interp_tree); 1.46 +}