ref: a736bf6bfb66d08848b114344731c4e04ac5066d
parent: 89d10d8f3fd4e216686ead15b0165afc4d1152d0
author: Alex Converse <[email protected]>
date: Tue Oct 27 06:25:30 EDT 2015
Shrink probability remap tables. Saves 2288 bytes in vp8+vp9 libvpx.a. Change-Id: Iaa5712e59a9693ed58cea63de63781a96827e44e
--- a/vp10/decoder/dsubexp.c
+++ b/vp10/decoder/dsubexp.c
@@ -29,7 +29,7 @@
}
static int inv_remap_prob(int v, int m) {
- static int inv_map_table[MAX_PROB] = {
+ static uint8_t inv_map_table[MAX_PROB] = {
7, 20, 33, 46, 59, 72, 85, 98, 111, 124, 137, 150, 163, 176, 189,
202, 215, 228, 241, 254, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27,
--- a/vp10/encoder/subexp.c
+++ b/vp10/encoder/subexp.c
@@ -16,7 +16,7 @@
#define vp10_cost_upd256 ((int)(vp10_cost_one(upd) - vp10_cost_zero(upd)))
-static const int update_bits[255] = {
+static const uint8_t update_bits[255] = {
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
@@ -46,7 +46,7 @@
static int remap_prob(int v, int m) {
int i;
- static const int map_table[MAX_PROB - 1] = {
+ static const uint8_t map_table[MAX_PROB - 1] = {
// generated by:
// map_table[j] = split_index(j, MAX_PROB - 1, MODULUS_PARAM);
20, 21, 22, 23, 24, 25, 0, 26, 27, 28, 29, 30, 31, 32, 33,
--- a/vp9/decoder/vp9_dsubexp.c
+++ b/vp9/decoder/vp9_dsubexp.c
@@ -29,7 +29,7 @@
}
static int inv_remap_prob(int v, int m) {
- static int inv_map_table[MAX_PROB] = {
+ static uint8_t inv_map_table[MAX_PROB] = {
7, 20, 33, 46, 59, 72, 85, 98, 111, 124, 137, 150, 163, 176, 189,
202, 215, 228, 241, 254, 1, 2, 3, 4, 5, 6, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27,
--- a/vp9/encoder/vp9_subexp.c
+++ b/vp9/encoder/vp9_subexp.c
@@ -16,7 +16,7 @@
#define vp9_cost_upd256 ((int)(vp9_cost_one(upd) - vp9_cost_zero(upd)))
-static const int update_bits[255] = {
+static const uint8_t update_bits[255] = {
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
@@ -46,7 +46,7 @@
static int remap_prob(int v, int m) {
int i;
- static const int map_table[MAX_PROB - 1] = {
+ static const uint8_t map_table[MAX_PROB - 1] = {
// generated by:
// map_table[j] = split_index(j, MAX_PROB - 1, MODULUS_PARAM);
20, 21, 22, 23, 24, 25, 0, 26, 27, 28, 29, 30, 31, 32, 33,