summaryrefslogtreecommitdiffstats
path: root/libvpx/vp8/encoder/modecosts.c
diff options
context:
space:
mode:
authorJohann <johannkoenig@google.com>2012-10-10 11:46:26 -0700
committerJohann <johannkoenig@google.com>2012-12-11 11:30:01 -0800
commit1b362b15af34006e6a11974088a46d42b903418e (patch)
tree5c05c1e135557201ef2797e62a4e1480e712a7a2 /libvpx/vp8/encoder/modecosts.c
parentb9c4e676b7be3cf3a9e45e06d71bf0ca92344a5b (diff)
downloadandroid_external_libvpx-1b362b15af34006e6a11974088a46d42b903418e.tar.gz
android_external_libvpx-1b362b15af34006e6a11974088a46d42b903418e.tar.bz2
android_external_libvpx-1b362b15af34006e6a11974088a46d42b903418e.zip
Update libvpx and incorporate new build system
Move libvpx down a directory. Separate libwebm and rename it. It would be more accurate to rename external/libvpx to external/webm. Use file lists directly from upstream libvpx. This allows adding new targets and new features (such as the encoder) easily. MIPS and x86 options are in progress. See new file "UPDATING" The new libvpx checkout is not from a release branch. The decoder is stable but it should be checked and potentially updated if the encoder is enabled. Requires I42b51e2845a696a6e211dde00951afc8f571336f which updates libstagefright to account for new paths and library names. Change-Id: I739f99d48b8d7e6354c416ef2ca79c954826307f
Diffstat (limited to 'libvpx/vp8/encoder/modecosts.c')
-rw-r--r--libvpx/vp8/encoder/modecosts.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/libvpx/vp8/encoder/modecosts.c b/libvpx/vp8/encoder/modecosts.c
new file mode 100644
index 0000000..c61563c
--- /dev/null
+++ b/libvpx/vp8/encoder/modecosts.c
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2010 The WebM project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+
+#include "vp8/common/blockd.h"
+#include "onyx_int.h"
+#include "treewriter.h"
+#include "vp8/common/entropymode.h"
+
+
+void vp8_init_mode_costs(VP8_COMP *c)
+{
+ VP8_COMMON *x = &c->common;
+ struct rd_costs_struct *rd_costs = &c->rd_costs;
+
+ {
+ const vp8_tree_p T = vp8_bmode_tree;
+
+ int i = 0;
+
+ do
+ {
+ int j = 0;
+
+ do
+ {
+ vp8_cost_tokens(rd_costs->bmode_costs[i][j],
+ vp8_kf_bmode_prob[i][j], T);
+ }
+ while (++j < VP8_BINTRAMODES);
+ }
+ while (++i < VP8_BINTRAMODES);
+
+ vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.bmode_prob, T);
+ }
+ vp8_cost_tokens(rd_costs->inter_bmode_costs, x->fc.sub_mv_ref_prob,
+ vp8_sub_mv_ref_tree);
+
+ vp8_cost_tokens(rd_costs->mbmode_cost[1], x->fc.ymode_prob, vp8_ymode_tree);
+ vp8_cost_tokens(rd_costs->mbmode_cost[0], vp8_kf_ymode_prob,
+ vp8_kf_ymode_tree);
+
+ vp8_cost_tokens(rd_costs->intra_uv_mode_cost[1], x->fc.uv_mode_prob,
+ vp8_uv_mode_tree);
+ vp8_cost_tokens(rd_costs->intra_uv_mode_cost[0], vp8_kf_uv_mode_prob,
+ vp8_uv_mode_tree);
+}