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 "vp8/common/blockd.h" michael@0: #include "onyx_int.h" michael@0: #include "treewriter.h" michael@0: #include "vp8/common/entropymode.h" michael@0: michael@0: michael@0: void vp8_init_mode_costs(VP8_COMP *c) michael@0: { michael@0: VP8_COMMON *x = &c->common; michael@0: struct rd_costs_struct *rd_costs = &c->rd_costs; michael@0: michael@0: { michael@0: const vp8_tree_p T = vp8_bmode_tree; michael@0: michael@0: int i = 0; michael@0: michael@0: do michael@0: { michael@0: int j = 0; michael@0: michael@0: do michael@0: { michael@0: vp8_cost_tokens(rd_costs->bmode_costs[i][j], michael@0: vp8_kf_bmode_prob[i][j], T); michael@0: } michael@0: while (++j < VP8_BINTRAMODES); michael@0: } michael@0: while (++i < VP8_BINTRAMODES); michael@0: michael@0: vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.bmode_prob, T); michael@0: } michael@0: vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.sub_mv_ref_prob, michael@0: vp8_sub_mv_ref_tree); michael@0: michael@0: vp8_cost_tokens(rd_costs->mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree); michael@0: vp8_cost_tokens(rd_costs->mbmode_cost[0], vp8_kf_ymode_prob, michael@0: vp8_kf_ymode_tree); michael@0: michael@0: vp8_cost_tokens(rd_costs->intra_uv_mode_cost[1], x->fc.uv_mode_prob, michael@0: vp8_uv_mode_tree); michael@0: vp8_cost_tokens(rd_costs->intra_uv_mode_cost[0], vp8_kf_uv_mode_prob, michael@0: vp8_uv_mode_tree); michael@0: }