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
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-02-10 20:41:38 +01:00
|
|
|
#include "vp8/common/blockd.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
#include "onyx_int.h"
|
|
|
|
#include "treewriter.h"
|
2011-02-10 20:41:38 +01:00
|
|
|
#include "vp8/common/entropymode.h"
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
|
|
|
|
void vp8_init_mode_costs(VP8_COMP *c)
|
|
|
|
{
|
|
|
|
VP8_COMMON *x = &c->common;
|
|
|
|
{
|
|
|
|
const vp8_tree_p T = vp8_bmode_tree;
|
|
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
int j = 0;
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
|
|
|
vp8_cost_tokens((int *)c->mb.bmode_costs[i][j], x->kf_bmode_prob[i][j], T);
|
|
|
|
}
|
|
|
|
while (++j < VP8_BINTRAMODES);
|
|
|
|
}
|
|
|
|
while (++i < VP8_BINTRAMODES);
|
|
|
|
|
|
|
|
vp8_cost_tokens((int *)c->mb.inter_bmode_costs, x->fc.bmode_prob, T);
|
|
|
|
}
|
2011-12-08 20:43:09 +01:00
|
|
|
vp8_cost_tokens((int *)c->mb.inter_bmode_costs,
|
|
|
|
x->fc.sub_mv_ref_prob, vp8_sub_mv_ref_tree);
|
2010-05-18 17:58:33 +02:00
|
|
|
|
|
|
|
vp8_cost_tokens(c->mb.mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree);
|
2011-08-05 01:30:27 +02:00
|
|
|
#if CONFIG_QIMODE
|
2011-08-31 21:01:58 +02:00
|
|
|
vp8_cost_tokens(c->mb.mbmode_cost[0],
|
2011-12-08 20:43:09 +01:00
|
|
|
x->kf_ymode_prob[c->common.kf_ymode_probs_index],
|
|
|
|
vp8_kf_ymode_tree);
|
2011-08-05 01:30:27 +02:00
|
|
|
#else
|
2011-12-08 20:43:09 +01:00
|
|
|
vp8_cost_tokens(c->mb.mbmode_cost[0],
|
|
|
|
x->kf_ymode_prob, vp8_kf_ymode_tree);
|
2011-08-05 01:30:27 +02:00
|
|
|
#endif
|
2011-08-05 01:30:27 +02:00
|
|
|
#if CONFIG_UVINTRA
|
2011-12-08 20:43:09 +01:00
|
|
|
vp8_cost_tokens(c->mb.intra_uv_mode_cost[1],
|
|
|
|
x->fc.uv_mode_prob[VP8_YMODES-1], vp8_uv_mode_tree);
|
|
|
|
vp8_cost_tokens(c->mb.intra_uv_mode_cost[0],
|
|
|
|
x->kf_uv_mode_prob[VP8_YMODES-1], vp8_uv_mode_tree);
|
2011-08-05 01:30:27 +02:00
|
|
|
#else
|
2011-12-08 20:43:09 +01:00
|
|
|
vp8_cost_tokens(c->mb.intra_uv_mode_cost[1],
|
|
|
|
x->fc.uv_mode_prob, vp8_uv_mode_tree);
|
|
|
|
vp8_cost_tokens(c->mb.intra_uv_mode_cost[0],
|
|
|
|
x->kf_uv_mode_prob, vp8_uv_mode_tree);
|
2011-08-05 01:30:27 +02:00
|
|
|
#endif
|
2011-08-05 01:30:27 +02:00
|
|
|
vp8_cost_tokens(c->mb.i8x8_mode_costs,
|
|
|
|
x->i8x8_mode_prob,vp8_i8x8_mode_tree);
|
|
|
|
|
2010-05-18 17:58:33 +02:00
|
|
|
}
|