|
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 */ |
|
10 |
|
11 |
|
12 #include "vp9/common/vp9_blockd.h" |
|
13 #include "vp9/encoder/vp9_onyx_int.h" |
|
14 #include "vp9/encoder/vp9_treewriter.h" |
|
15 #include "vp9/common/vp9_entropymode.h" |
|
16 |
|
17 |
|
18 void vp9_init_mode_costs(VP9_COMP *c) { |
|
19 VP9_COMMON *const cm = &c->common; |
|
20 const vp9_tree_index *KT = vp9_intra_mode_tree; |
|
21 int i, j; |
|
22 |
|
23 for (i = 0; i < INTRA_MODES; i++) { |
|
24 for (j = 0; j < INTRA_MODES; j++) { |
|
25 vp9_cost_tokens((int *)c->mb.y_mode_costs[i][j], vp9_kf_y_mode_prob[i][j], |
|
26 KT); |
|
27 } |
|
28 } |
|
29 |
|
30 // TODO(rbultje) separate tables for superblock costing? |
|
31 vp9_cost_tokens(c->mb.mbmode_cost, cm->fc.y_mode_prob[1], |
|
32 vp9_intra_mode_tree); |
|
33 vp9_cost_tokens(c->mb.intra_uv_mode_cost[1], |
|
34 cm->fc.uv_mode_prob[INTRA_MODES - 1], vp9_intra_mode_tree); |
|
35 vp9_cost_tokens(c->mb.intra_uv_mode_cost[0], |
|
36 vp9_kf_uv_mode_prob[INTRA_MODES - 1], |
|
37 vp9_intra_mode_tree); |
|
38 |
|
39 for (i = 0; i < SWITCHABLE_FILTER_CONTEXTS; ++i) |
|
40 vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i], |
|
41 cm->fc.switchable_interp_prob[i], |
|
42 vp9_switchable_interp_tree); |
|
43 } |