michael@0: /* michael@0: * Copyright (c) 2010 The WebM project authors. All Rights Reserved. michael@0: * michael@0: * Use of this source code is governed by a BSD-style license michael@0: * that can be found in the LICENSE file in the root of the source michael@0: * tree. An additional intellectual property rights grant can be found michael@0: * in the file PATENTS. All contributing project authors may michael@0: * be found in the AUTHORS file in the root of the source tree. michael@0: */ michael@0: michael@0: michael@0: #include "vp9/common/vp9_blockd.h" michael@0: #include "vp9/encoder/vp9_onyx_int.h" michael@0: #include "vp9/encoder/vp9_treewriter.h" michael@0: #include "vp9/common/vp9_entropymode.h" michael@0: michael@0: michael@0: void vp9_init_mode_costs(VP9_COMP *c) { michael@0: VP9_COMMON *const cm = &c->common; michael@0: const vp9_tree_index *KT = vp9_intra_mode_tree; michael@0: int i, j; michael@0: michael@0: for (i = 0; i < INTRA_MODES; i++) { michael@0: for (j = 0; j < INTRA_MODES; j++) { michael@0: vp9_cost_tokens((int *)c->mb.y_mode_costs[i][j], vp9_kf_y_mode_prob[i][j], michael@0: KT); michael@0: } michael@0: } michael@0: michael@0: // TODO(rbultje) separate tables for superblock costing? michael@0: vp9_cost_tokens(c->mb.mbmode_cost, cm->fc.y_mode_prob[1], michael@0: vp9_intra_mode_tree); michael@0: vp9_cost_tokens(c->mb.intra_uv_mode_cost[1], michael@0: cm->fc.uv_mode_prob[INTRA_MODES - 1], vp9_intra_mode_tree); michael@0: vp9_cost_tokens(c->mb.intra_uv_mode_cost[0], michael@0: vp9_kf_uv_mode_prob[INTRA_MODES - 1], michael@0: vp9_intra_mode_tree); michael@0: michael@0: for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) michael@0: vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i], michael@0: cm->fc.switchable_interp_prob[i], michael@0: vp9_switchable_interp_tree); michael@0: }