summaryrefslogtreecommitdiff
path: root/vp9/encoder/vp9_cost.c
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2016-02-17 13:39:44 -0800
committerAlex Converse <aconverse@google.com>2016-02-17 14:46:26 -0800
commit09f9c5d7f90bd19dfc1994926a6e35680ba9545c (patch)
tree4b885467bbbd25a070ac47459e586e608b8b7073 /vp9/encoder/vp9_cost.c
parentfdc977afc6b431c7577e70d151f89ea726bcaf8f (diff)
downloadlibvpx-09f9c5d7f90bd19dfc1994926a6e35680ba9545c.tar
libvpx-09f9c5d7f90bd19dfc1994926a6e35680ba9545c.tar.gz
libvpx-09f9c5d7f90bd19dfc1994926a6e35680ba9545c.tar.bz2
libvpx-09f9c5d7f90bd19dfc1994926a6e35680ba9545c.zip
Better workaround for Bug 1089.
Don't initialize first pass costs for a number of symbols where first pass probabilities aren't initialized. This brings a 1.22x first pass speedup. https://bugs.chromium.org/p/webm/issues/detail?id=1089 Change-Id: I97438c357bd88f52f5a15c697031cf0c3cc8f510
Diffstat (limited to 'vp9/encoder/vp9_cost.c')
-rw-r--r--vp9/encoder/vp9_cost.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/vp9/encoder/vp9_cost.c b/vp9/encoder/vp9_cost.c
index c85f76322..5d14742bc 100644
--- a/vp9/encoder/vp9_cost.c
+++ b/vp9/encoder/vp9_cost.c
@@ -12,9 +12,8 @@
#include "vp9/encoder/vp9_cost.h"
/* round(-log2(i/256.) * (1 << VP9_PROB_COST_SHIFT))
- Begins and ends with a bogus entry to satisfy use of prob=0 in the firstpass.
- https://code.google.com/p/webm/issues/detail?id=1089 */
-const uint16_t vp9_prob_cost[257] = {
+ Begins with a bogus entry for simpler addressing. */
+const uint16_t vp9_prob_cost[256] = {
4096, 4096, 3584, 3284, 3072, 2907, 2772, 2659, 2560, 2473, 2395, 2325,
2260, 2201, 2147, 2096, 2048, 2003, 1961, 1921, 1883, 1847, 1813, 1780,
1748, 1718, 1689, 1661, 1635, 1609, 1584, 1559, 1536, 1513, 1491, 1470,
@@ -36,13 +35,14 @@ const uint16_t vp9_prob_cost[257] = {
125, 122, 119, 115, 112, 109, 105, 102, 99, 95, 92, 89,
86, 82, 79, 76, 73, 70, 66, 63, 60, 57, 54, 51,
48, 45, 42, 38, 35, 32, 29, 26, 23, 20, 18, 15,
- 12, 9, 6, 3, 3};
+ 12, 9, 6, 3};
static void cost(int *costs, vpx_tree tree, const vpx_prob *probs,
int i, int c) {
const vpx_prob prob = probs[i / 2];
int b;
+ assert(prob != 0);
for (b = 0; b <= 1; ++b) {
const int cc = c + vp9_cost_bit(prob, b);
const vpx_tree_index ii = tree[i + b];