Remove the starting zero from ANS CDFs.

This brings it in line with the Daala CDFs and will make it easier to
share code.

Change-Id: Idfd2d2b33c3b9b2c4e72ce72fb3d8039013448b9
(cherry picked from aom/master commit af98507ca928afe33e9f88fdd2ca168379528d6a)
This commit is contained in:
Alex Converse
2016-08-22 12:44:16 -07:00
parent a1ac972867
commit e9f70f8f10
5 changed files with 23 additions and 18 deletions

View File

@@ -98,9 +98,9 @@ std::vector<int> ans_encode_build_vals(const rans_sym *tab, int iters) {
}
void rans_build_dec_tab(const struct rans_sym sym_tab[], rans_lut dec_tab) {
dec_tab[0] = 0;
for (int i = 1; dec_tab[i - 1] < RANS_PRECISION; ++i) {
dec_tab[i] = dec_tab[i - 1] + sym_tab[i - 1].prob;
unsigned int sum = 0;
for (int i = 0; sum < RANS_PRECISION; ++i) {
dec_tab[i] = sum += sym_tab[i].prob;
}
}