2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
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.
14 #include "treewriter.h"
15 #include "entropymode.h"
18 void vp8_init_mode_costs(VP8_COMP
*c
)
20 VP8_COMMON
*x
= &c
->common
;
22 const vp8_tree_p T
= vp8_bmode_tree
;
32 vp8_cost_tokens((int *)c
->mb
.bmode_costs
[i
][j
], x
->kf_bmode_prob
[i
][j
], T
);
34 while (++j
< VP8_BINTRAMODES
);
36 while (++i
< VP8_BINTRAMODES
);
38 vp8_cost_tokens((int *)c
->mb
.inter_bmode_costs
, x
->fc
.bmode_prob
, T
);
40 vp8_cost_tokens((int *)c
->mb
.inter_bmode_costs
, x
->fc
.sub_mv_ref_prob
, vp8_sub_mv_ref_tree
);
42 vp8_cost_tokens(c
->mb
.mbmode_cost
[1], x
->fc
.ymode_prob
, vp8_ymode_tree
);
43 vp8_cost_tokens(c
->mb
.mbmode_cost
[0], x
->kf_ymode_prob
, vp8_kf_ymode_tree
);
45 vp8_cost_tokens(c
->mb
.intra_uv_mode_cost
[1], x
->fc
.uv_mode_prob
, vp8_uv_mode_tree
);
46 vp8_cost_tokens(c
->mb
.intra_uv_mode_cost
[0], x
->kf_uv_mode_prob
, vp8_uv_mode_tree
);