2010-05-18 11:58:33 -04:00
|
|
|
/*
|
2010-09-09 08:16:39 -04:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 11:58:33 -04:00
|
|
|
*
|
2010-06-18 12:39:21 -04:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 16:19:40 -04:00
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
2010-06-18 12:39:21 -04:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 16:19:40 -04:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 11:58:33 -04:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-11-27 13:59:17 -08:00
|
|
|
#include "vp9/common/vp9_blockd.h"
|
2012-11-28 10:41:40 -08:00
|
|
|
#include "vp9/encoder/vp9_onyx_int.h"
|
|
|
|
#include "vp9/encoder/vp9_treewriter.h"
|
2012-11-27 13:59:17 -08:00
|
|
|
#include "vp9/common/vp9_entropymode.h"
|
2010-05-18 11:58:33 -04:00
|
|
|
|
|
|
|
|
2012-10-30 17:53:32 -07:00
|
|
|
void vp9_init_mode_costs(VP9_COMP *c) {
|
2013-08-23 19:30:33 -07:00
|
|
|
VP9_COMMON *const cm = &c->common;
|
2013-05-30 09:58:53 -07:00
|
|
|
const vp9_tree_p KT = vp9_intra_mode_tree;
|
2012-10-30 14:25:33 -07:00
|
|
|
int i, j;
|
|
|
|
|
2013-08-22 18:40:34 -07:00
|
|
|
for (i = 0; i < INTRA_MODES; i++) {
|
|
|
|
for (j = 0; j < INTRA_MODES; j++) {
|
2013-07-17 16:50:52 -07:00
|
|
|
vp9_cost_tokens((int *)c->mb.y_mode_costs[i][j], vp9_kf_y_mode_prob[i][j],
|
|
|
|
KT);
|
2012-10-30 14:25:33 -07:00
|
|
|
}
|
2012-07-13 15:21:29 -07:00
|
|
|
}
|
2012-10-30 14:25:33 -07:00
|
|
|
|
2012-11-15 15:50:07 -08:00
|
|
|
// TODO(rbultje) separate tables for superblock costing?
|
2013-08-23 19:30:33 -07:00
|
|
|
vp9_cost_tokens(c->mb.mbmode_cost, cm->fc.y_mode_prob[1],
|
2013-05-30 09:58:53 -07:00
|
|
|
vp9_intra_mode_tree);
|
2012-10-30 12:58:42 -07:00
|
|
|
vp9_cost_tokens(c->mb.intra_uv_mode_cost[1],
|
2013-08-23 19:30:33 -07:00
|
|
|
cm->fc.uv_mode_prob[INTRA_MODES - 1], vp9_intra_mode_tree);
|
2012-10-30 12:58:42 -07:00
|
|
|
vp9_cost_tokens(c->mb.intra_uv_mode_cost[0],
|
2013-08-22 18:40:34 -07:00
|
|
|
vp9_kf_uv_mode_prob[INTRA_MODES - 1],
|
2013-07-17 16:50:52 -07:00
|
|
|
vp9_intra_mode_tree);
|
2012-06-20 05:07:24 -07:00
|
|
|
|
2013-08-22 18:40:34 -07:00
|
|
|
for (i = 0; i <= SWITCHABLE_FILTERS; ++i)
|
2012-10-30 14:25:33 -07:00
|
|
|
vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i],
|
2013-08-23 19:30:33 -07:00
|
|
|
cm->fc.switchable_interp_prob[i],
|
2012-10-30 17:12:12 -07:00
|
|
|
vp9_switchable_interp_tree);
|
2010-05-18 11:58:33 -04:00
|
|
|
}
|