2010-05-18 17:58:33 +02:00
|
|
|
/*
|
2010-09-09 14:16:39 +02:00
|
|
|
* Copyright (c) 2010 The WebM project authors. All Rights Reserved.
|
2010-05-18 17:58:33 +02:00
|
|
|
*
|
2010-06-18 18:39:21 +02:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
2010-06-04 22:19:40 +02: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 18:39:21 +02:00
|
|
|
* in the file PATENTS. All contributing project authors may
|
2010-06-04 22:19:40 +02:00
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2010-05-18 17:58:33 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-11-27 22:59:17 +01:00
|
|
|
#include "vp9/common/vp9_blockd.h"
|
2012-11-28 19:41:40 +01:00
|
|
|
#include "vp9/encoder/vp9_onyx_int.h"
|
|
|
|
#include "vp9/encoder/vp9_treewriter.h"
|
2012-11-27 22:59:17 +01:00
|
|
|
#include "vp9/common/vp9_entropymode.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
|
2012-10-31 01:53:32 +01:00
|
|
|
void vp9_init_mode_costs(VP9_COMP *c) {
|
|
|
|
VP9_COMMON *x = &c->common;
|
2013-05-30 18:58:53 +02:00
|
|
|
const vp9_tree_p KT = vp9_intra_mode_tree;
|
2012-10-30 22:25:33 +01:00
|
|
|
int i, j;
|
|
|
|
|
2013-05-31 01:21:48 +02:00
|
|
|
for (i = 0; i < VP9_INTRA_MODES; i++) {
|
|
|
|
for (j = 0; j < VP9_INTRA_MODES; j++) {
|
2013-05-30 18:58:53 +02:00
|
|
|
vp9_cost_tokens((int *)c->mb.y_mode_costs[i][j],
|
|
|
|
x->kf_y_mode_prob[i][j], KT);
|
2012-10-30 22:25:33 +01:00
|
|
|
}
|
2012-07-14 00:21:29 +02:00
|
|
|
}
|
2012-10-30 22:25:33 +01:00
|
|
|
|
2012-11-16 00:50:07 +01:00
|
|
|
// TODO(rbultje) separate tables for superblock costing?
|
2013-06-03 19:39:40 +02:00
|
|
|
vp9_cost_tokens(c->mb.mbmode_cost, x->fc.y_mode_prob[1],
|
2013-05-30 18:58:53 +02:00
|
|
|
vp9_intra_mode_tree);
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_cost_tokens(c->mb.intra_uv_mode_cost[1],
|
2013-05-31 01:21:48 +02:00
|
|
|
x->fc.uv_mode_prob[VP9_INTRA_MODES - 1], vp9_intra_mode_tree);
|
2012-10-30 20:58:42 +01:00
|
|
|
vp9_cost_tokens(c->mb.intra_uv_mode_cost[0],
|
2013-05-31 01:21:48 +02:00
|
|
|
x->kf_uv_mode_prob[VP9_INTRA_MODES - 1], vp9_intra_mode_tree);
|
2012-06-20 14:07:24 +02:00
|
|
|
|
2012-10-31 22:40:53 +01:00
|
|
|
for (i = 0; i <= VP9_SWITCHABLE_FILTERS; ++i)
|
2012-10-30 22:25:33 +01:00
|
|
|
vp9_cost_tokens((int *)c->mb.switchable_interp_costs[i],
|
|
|
|
x->fc.switchable_interp_prob[i],
|
2012-10-31 01:12:12 +01:00
|
|
|
vp9_switchable_interp_tree);
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|