Commit ddbc2e2a authored by Alex Converse's avatar Alex Converse
Browse files

Switch rANS to 15 bit precision, and adjust L_BASE.

This causes rANS to operate at the same precision as the Daala EC.

rans10uabs8lbase12 → rans15uabs8lbase15

objective-1-fast
PSNR YCbCr:      0.01%      0.01%      0.01%
   PSNRHVS:      0.01%
      SSIM:      0.01%
    MSSSIM:      0.01%
 CIEDE2000:      0.01%

subset1
PSNR YCbCr:     -0.01%     -0.00%     -0.00%
   PSNRHVS:     -0.01%
      SSIM:     -0.01%
    MSSSIM:     -0.01%
 CIEDE2000:     -0.01%

Change-Id: I6ef0a4f6198784b3712a61af9f105d560a22eaea
parent 9e3eacfe
......@@ -26,10 +26,12 @@ extern "C" {
typedef uint8_t AnsP8;
#define ANS_P8_PRECISION 256u
#define ANS_P8_SHIFT 8
#define RANS_PRECISION 1024u
#define RANS_PROB_BITS 10
#define RANS_PROB_BITS 15
#define RANS_PRECISION (1u << RANS_PROB_BITS)
#define L_BASE (RANS_PRECISION * 4) // L_BASE % precision must be 0
// L_BASE % PRECISION must be 0. Increasing L_BASE beyond 2**15 will cause uabs
// to overflow.
#define L_BASE (RANS_PRECISION)
#define IO_BASE 256
// Range I = { L_BASE, L_BASE + 1, ..., L_BASE * IO_BASE - 1 }
......
......@@ -111,8 +111,12 @@ static INLINE int ans_read_init(struct AnsDecoder *const ans,
if (offset < 3) return 1;
ans->buf_offset = offset - 3;
ans->state = mem_get_le24(buf + offset - 3) & 0x3FFFFF;
} else if ((buf[offset - 1] & 0xE0) == 0xE0) {
if (offset < 4) return 1;
ans->buf_offset = offset - 4;
ans->state = mem_get_le32(buf + offset - 4) & 0x1FFFFFFF;
} else {
// x == 3 implies this byte is a superframe marker
// 110xxxxx implies this byte is a superframe marker
return 1;
}
ans->state += L_BASE;
......
......@@ -69,6 +69,9 @@ static INLINE int ans_write_end(struct AnsCoder *const ans) {
} else if (state < (1 << 22)) {
mem_put_le24(ans->buf + ans->buf_offset, (0x02 << 22) + state);
return ans->buf_offset + 3;
} else if (state < (1 << 29)) {
mem_put_le32(ans->buf + ans->buf_offset, (0x07 << 29) + state);
return ans->buf_offset + 4;
} else {
assert(0 && "State is too large to be serialized");
return ans->buf_offset;
......
......@@ -405,7 +405,6 @@ const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
// ZERO_TOKEN and EOB_TOKEN are coded as flags outside this coder.
const aom_cdf_prob
av1_pareto8_token_probs[COEFF_PROB_MODELS][ENTROPY_TOKENS - 2] = {
#if CONFIG_DAALA_EC
{ 128, 127, 127, 126, 251, 495, 965, 1832, 3305, 25412 },
{ 256, 254, 252, 249, 492, 959, 1820, 3283, 5365, 19838 },
{ 384, 379, 374, 369, 724, 1392, 2574, 4417, 6568, 15587 },
......@@ -661,263 +660,6 @@ const aom_cdf_prob
{ 32384, 357, 19, 2, 1, 1, 1, 1, 1, 1 },
{ 32512, 238, 11, 1, 1, 1, 1, 1, 1, 1 },
{ 32640, 117, 4, 1, 1, 1, 1, 1, 1, 1 },
#else
{ 4, 4, 4, 4, 8, 15, 30, 57, 103, 795 },
{ 8, 8, 8, 8, 15, 30, 57, 103, 168, 619 },
{ 12, 12, 12, 12, 23, 43, 80, 138, 205, 487 },
{ 16, 16, 15, 15, 30, 56, 101, 165, 225, 385 },
{ 20, 20, 19, 19, 36, 68, 119, 186, 231, 306 },
{ 24, 23, 23, 22, 43, 79, 135, 201, 230, 244 },
{ 28, 27, 26, 26, 49, 89, 149, 211, 223, 196 },
{ 32, 31, 30, 29, 55, 98, 160, 218, 212, 159 },
{ 36, 35, 33, 32, 60, 107, 171, 221, 200, 129 },
{ 40, 38, 37, 35, 66, 115, 179, 222, 187, 105 },
{ 44, 42, 40, 38, 71, 122, 186, 221, 174, 86 },
{ 48, 45, 43, 41, 76, 129, 192, 219, 160, 71 },
{ 52, 49, 46, 44, 80, 136, 196, 215, 148, 58 },
{ 56, 53, 49, 46, 85, 142, 200, 210, 135, 48 },
{ 60, 56, 52, 49, 89, 147, 203, 204, 124, 40 },
{ 64, 60, 55, 52, 93, 151, 205, 198, 113, 33 },
{ 68, 63, 58, 54, 97, 156, 205, 192, 103, 28 },
{ 72, 66, 61, 57, 100, 160, 206, 185, 94, 23 },
{ 76, 70, 64, 59, 104, 163, 205, 178, 85, 20 },
{ 80, 73, 67, 61, 107, 166, 205, 171, 77, 17 },
{ 84, 76, 69, 63, 110, 169, 204, 164, 71, 14 },
{ 88, 80, 72, 65, 113, 171, 202, 157, 64, 12 },
{ 92, 83, 75, 67, 116, 173, 200, 150, 58, 10 },
{ 96, 86, 77, 69, 118, 175, 198, 143, 53, 9 },
{ 100, 89, 80, 71, 121, 176, 195, 137, 48, 7 },
{ 104, 92, 82, 73, 123, 178, 192, 130, 44, 6 },
{ 108, 96, 84, 75, 125, 178, 189, 124, 40, 5 },
{ 112, 98, 87, 76, 127, 179, 186, 118, 36, 5 },
{ 116, 101, 89, 78, 129, 179, 183, 112, 33, 4 },
{ 120, 104, 91, 80, 131, 180, 179, 106, 30, 3 },
{ 124, 107, 93, 81, 132, 180, 176, 101, 27, 3 },
{ 128, 110, 95, 82, 134, 179, 172, 96, 25, 3 },
{ 132, 113, 97, 84, 135, 179, 168, 91, 23, 2 },
{ 136, 116, 99, 85, 136, 179, 164, 86, 21, 2 },
{ 140, 119, 101, 86, 137, 178, 160, 82, 19, 2 },
{ 144, 122, 103, 88, 138, 177, 157, 77, 17, 1 },
{ 148, 124, 105, 89, 139, 176, 153, 73, 16, 1 },
{ 152, 127, 107, 90, 140, 175, 149, 69, 14, 1 },
{ 156, 130, 108, 91, 141, 173, 145, 66, 13, 1 },
{ 160, 133, 110, 92, 141, 172, 141, 62, 12, 1 },
{ 164, 135, 111, 93, 142, 171, 137, 59, 11, 1 },
{ 168, 138, 113, 94, 142, 169, 133, 56, 10, 1 },
{ 172, 140, 115, 94, 142, 168, 130, 53, 9, 1 },
{ 176, 143, 116, 95, 143, 166, 126, 50, 8, 1 },
{ 180, 145, 118, 96, 143, 164, 122, 47, 8, 1 },
{ 184, 147, 119, 96, 143, 163, 119, 45, 7, 1 },
{ 188, 150, 120, 97, 143, 161, 116, 42, 6, 1 },
{ 192, 152, 121, 98, 143, 159, 112, 40, 6, 1 },
{ 196, 155, 123, 98, 142, 157, 109, 38, 5, 1 },
{ 200, 157, 124, 99, 142, 155, 105, 36, 5, 1 },
{ 204, 159, 125, 99, 142, 153, 102, 34, 5, 1 },
{ 208, 161, 126, 100, 142, 151, 99, 32, 4, 1 },
{ 212, 164, 127, 100, 141, 149, 96, 30, 4, 1 },
{ 216, 166, 129, 100, 141, 147, 93, 28, 3, 1 },
{ 220, 168, 130, 101, 140, 144, 90, 27, 3, 1 },
{ 224, 170, 131, 101, 140, 142, 87, 25, 3, 1 },
{ 228, 172, 132, 101, 139, 140, 84, 24, 3, 1 },
{ 232, 174, 132, 101, 139, 138, 81, 23, 3, 1 },
{ 236, 176, 133, 101, 138, 136, 79, 22, 2, 1 },
{ 240, 178, 134, 102, 137, 134, 76, 20, 2, 1 },
{ 244, 180, 135, 102, 136, 131, 74, 19, 2, 1 },
{ 248, 182, 135, 102, 136, 129, 71, 18, 2, 1 },
{ 252, 184, 136, 101, 135, 127, 69, 17, 2, 1 },
{ 256, 186, 137, 102, 134, 124, 66, 16, 2, 1 },
{ 260, 188, 138, 102, 133, 122, 64, 15, 1, 1 },
{ 264, 190, 138, 101, 132, 120, 62, 15, 1, 1 },
{ 268, 191, 139, 101, 131, 118, 60, 14, 1, 1 },
{ 272, 193, 139, 101, 130, 116, 58, 13, 1, 1 },
{ 276, 195, 139, 101, 129, 114, 56, 12, 1, 1 },
{ 280, 196, 140, 101, 128, 111, 54, 12, 1, 1 },
{ 284, 198, 140, 101, 127, 109, 52, 11, 1, 1 },
{ 288, 200, 141, 100, 126, 107, 50, 10, 1, 1 },
{ 292, 201, 141, 100, 125, 105, 48, 10, 1, 1 },
{ 296, 203, 141, 100, 123, 103, 47, 9, 1, 1 },
{ 300, 204, 142, 99, 122, 101, 45, 9, 1, 1 },
{ 304, 206, 142, 99, 121, 99, 43, 8, 1, 1 },
{ 308, 207, 142, 99, 119, 97, 42, 8, 1, 1 },
{ 312, 209, 142, 99, 118, 95, 40, 7, 1, 1 },
{ 316, 210, 142, 98, 117, 93, 39, 7, 1, 1 },
{ 320, 211, 142, 98, 116, 91, 37, 7, 1, 1 },
{ 324, 213, 142, 97, 115, 89, 36, 6, 1, 1 },
{ 328, 214, 142, 97, 113, 87, 35, 6, 1, 1 },
{ 332, 215, 143, 96, 112, 85, 33, 6, 1, 1 },
{ 336, 216, 143, 96, 111, 83, 32, 5, 1, 1 },
{ 340, 218, 143, 95, 109, 81, 31, 5, 1, 1 },
{ 344, 219, 142, 95, 108, 79, 30, 5, 1, 1 },
{ 348, 220, 142, 94, 107, 78, 29, 4, 1, 1 },
{ 352, 221, 142, 94, 105, 76, 28, 4, 1, 1 },
{ 356, 222, 142, 93, 104, 74, 27, 4, 1, 1 },
{ 360, 223, 142, 92, 103, 72, 26, 4, 1, 1 },
{ 364, 224, 142, 92, 101, 70, 25, 4, 1, 1 },
{ 368, 225, 142, 91, 100, 69, 24, 3, 1, 1 },
{ 372, 226, 141, 91, 99, 67, 23, 3, 1, 1 },
{ 376, 227, 141, 90, 97, 66, 22, 3, 1, 1 },
{ 380, 228, 141, 89, 96, 64, 21, 3, 1, 1 },
{ 384, 229, 140, 89, 95, 62, 20, 3, 1, 1 },
{ 388, 229, 140, 88, 93, 61, 20, 3, 1, 1 },
{ 392, 230, 140, 87, 92, 60, 19, 2, 1, 1 },
{ 396, 231, 140, 86, 91, 58, 18, 2, 1, 1 },
{ 400, 232, 139, 86, 89, 57, 17, 2, 1, 1 },
{ 404, 232, 139, 85, 88, 55, 17, 2, 1, 1 },
{ 408, 233, 138, 84, 87, 54, 16, 2, 1, 1 },
{ 412, 234, 138, 84, 85, 52, 15, 2, 1, 1 },
{ 416, 234, 137, 83, 84, 51, 15, 2, 1, 1 },
{ 420, 235, 137, 82, 82, 50, 14, 2, 1, 1 },
{ 424, 236, 136, 81, 81, 48, 14, 2, 1, 1 },
{ 428, 236, 136, 81, 80, 47, 13, 1, 1, 1 },
{ 432, 236, 135, 80, 79, 46, 13, 1, 1, 1 },
{ 436, 237, 135, 79, 77, 45, 12, 1, 1, 1 },
{ 440, 238, 134, 78, 76, 43, 12, 1, 1, 1 },
{ 444, 238, 134, 77, 75, 42, 11, 1, 1, 1 },
{ 448, 238, 133, 77, 73, 41, 11, 1, 1, 1 },
{ 452, 239, 132, 76, 72, 40, 10, 1, 1, 1 },
{ 456, 239, 131, 75, 71, 39, 10, 1, 1, 1 },
{ 460, 239, 131, 74, 70, 38, 9, 1, 1, 1 },
{ 464, 240, 130, 73, 68, 37, 9, 1, 1, 1 },
{ 468, 240, 129, 72, 67, 36, 9, 1, 1, 1 },
{ 472, 240, 128, 72, 66, 35, 8, 1, 1, 1 },
{ 476, 240, 127, 71, 65, 34, 8, 1, 1, 1 },
{ 480, 240, 127, 70, 63, 33, 8, 1, 1, 1 },
{ 484, 241, 126, 69, 62, 32, 7, 1, 1, 1 },
{ 488, 241, 125, 68, 61, 31, 7, 1, 1, 1 },
{ 492, 241, 124, 67, 60, 30, 7, 1, 1, 1 },
{ 496, 241, 124, 66, 59, 29, 6, 1, 1, 1 },
{ 500, 240, 123, 66, 58, 28, 6, 1, 1, 1 },
{ 504, 240, 122, 65, 57, 27, 6, 1, 1, 1 },
{ 508, 240, 121, 64, 55, 27, 6, 1, 1, 1 },
{ 512, 241, 120, 63, 54, 26, 5, 1, 1, 1 },
{ 516, 241, 119, 62, 53, 25, 5, 1, 1, 1 },
{ 520, 240, 118, 62, 52, 24, 5, 1, 1, 1 },
{ 524, 240, 117, 60, 51, 24, 5, 1, 1, 1 },
{ 528, 239, 116, 60, 50, 23, 5, 1, 1, 1 },
{ 532, 239, 116, 59, 49, 22, 4, 1, 1, 1 },
{ 536, 239, 115, 58, 48, 21, 4, 1, 1, 1 },
{ 540, 239, 113, 57, 47, 21, 4, 1, 1, 1 },
{ 544, 238, 113, 56, 46, 20, 4, 1, 1, 1 },
{ 548, 238, 112, 55, 45, 19, 4, 1, 1, 1 },
{ 552, 238, 110, 55, 44, 19, 3, 1, 1, 1 },
{ 556, 237, 110, 54, 43, 18, 3, 1, 1, 1 },
{ 560, 237, 108, 53, 42, 18, 3, 1, 1, 1 },
{ 564, 236, 108, 52, 41, 17, 3, 1, 1, 1 },
{ 568, 236, 106, 51, 40, 17, 3, 1, 1, 1 },
{ 572, 235, 105, 51, 39, 16, 3, 1, 1, 1 },
{ 576, 235, 104, 50, 38, 15, 3, 1, 1, 1 },
{ 580, 234, 103, 49, 37, 15, 3, 1, 1, 1 },
{ 584, 234, 102, 48, 37, 14, 2, 1, 1, 1 },
{ 588, 233, 101, 47, 36, 14, 2, 1, 1, 1 },
{ 592, 233, 100, 46, 35, 13, 2, 1, 1, 1 },
{ 596, 231, 99, 46, 34, 13, 2, 1, 1, 1 },
{ 600, 230, 98, 45, 33, 13, 2, 1, 1, 1 },
{ 604, 230, 97, 44, 32, 12, 2, 1, 1, 1 },
{ 608, 229, 96, 43, 31, 12, 2, 1, 1, 1 },
{ 612, 228, 95, 42, 31, 11, 2, 1, 1, 1 },
{ 616, 227, 93, 42, 30, 11, 2, 1, 1, 1 },
{ 620, 227, 92, 41, 29, 10, 2, 1, 1, 1 },
{ 624, 226, 92, 40, 28, 10, 1, 1, 1, 1 },
{ 628, 225, 90, 39, 28, 10, 1, 1, 1, 1 },
{ 632, 224, 89, 39, 27, 9, 1, 1, 1, 1 },
{ 636, 223, 88, 38, 26, 9, 1, 1, 1, 1 },
{ 640, 222, 87, 37, 25, 9, 1, 1, 1, 1 },
{ 644, 221, 86, 36, 25, 8, 1, 1, 1, 1 },
{ 648, 220, 84, 36, 24, 8, 1, 1, 1, 1 },
{ 652, 219, 83, 35, 23, 8, 1, 1, 1, 1 },
{ 656, 218, 82, 34, 23, 7, 1, 1, 1, 1 },
{ 660, 217, 81, 33, 22, 7, 1, 1, 1, 1 },
{ 664, 215, 80, 33, 21, 7, 1, 1, 1, 1 },
{ 668, 214, 78, 32, 21, 7, 1, 1, 1, 1 },
{ 672, 213, 78, 31, 20, 6, 1, 1, 1, 1 },
{ 676, 211, 76, 31, 20, 6, 1, 1, 1, 1 },
{ 680, 210, 75, 30, 19, 6, 1, 1, 1, 1 },
{ 684, 209, 74, 29, 18, 6, 1, 1, 1, 1 },
{ 688, 208, 73, 28, 18, 5, 1, 1, 1, 1 },
{ 692, 206, 72, 28, 17, 5, 1, 1, 1, 1 },
{ 696, 205, 70, 27, 17, 5, 1, 1, 1, 1 },
{ 700, 203, 69, 27, 16, 5, 1, 1, 1, 1 },
{ 704, 201, 68, 26, 16, 5, 1, 1, 1, 1 },
{ 708, 201, 67, 25, 15, 4, 1, 1, 1, 1 },
{ 712, 198, 66, 25, 15, 4, 1, 1, 1, 1 },
{ 716, 197, 65, 24, 14, 4, 1, 1, 1, 1 },
{ 720, 196, 63, 23, 14, 4, 1, 1, 1, 1 },
{ 724, 194, 62, 23, 13, 4, 1, 1, 1, 1 },
{ 728, 193, 61, 22, 13, 3, 1, 1, 1, 1 },
{ 732, 191, 60, 22, 12, 3, 1, 1, 1, 1 },
{ 736, 189, 59, 21, 12, 3, 1, 1, 1, 1 },
{ 740, 188, 58, 20, 11, 3, 1, 1, 1, 1 },
{ 744, 186, 56, 20, 11, 3, 1, 1, 1, 1 },
{ 748, 184, 55, 19, 11, 3, 1, 1, 1, 1 },
{ 752, 182, 54, 19, 10, 3, 1, 1, 1, 1 },
{ 756, 181, 53, 18, 10, 2, 1, 1, 1, 1 },
{ 760, 179, 52, 18, 9, 2, 1, 1, 1, 1 },
{ 764, 177, 51, 17, 9, 2, 1, 1, 1, 1 },
{ 768, 174, 50, 17, 9, 2, 1, 1, 1, 1 },
{ 772, 173, 49, 16, 8, 2, 1, 1, 1, 1 },
{ 776, 171, 47, 16, 8, 2, 1, 1, 1, 1 },
{ 780, 169, 46, 15, 8, 2, 1, 1, 1, 1 },
{ 784, 167, 45, 15, 7, 2, 1, 1, 1, 1 },
{ 788, 165, 44, 14, 7, 2, 1, 1, 1, 1 },
{ 792, 162, 43, 14, 7, 2, 1, 1, 1, 1 },
{ 796, 161, 42, 13, 7, 1, 1, 1, 1, 1 },
{ 800, 159, 41, 13, 6, 1, 1, 1, 1, 1 },
{ 804, 157, 40, 12, 6, 1, 1, 1, 1, 1 },
{ 808, 154, 39, 12, 6, 1, 1, 1, 1, 1 },
{ 812, 153, 38, 11, 5, 1, 1, 1, 1, 1 },
{ 816, 150, 37, 11, 5, 1, 1, 1, 1, 1 },
{ 820, 148, 36, 10, 5, 1, 1, 1, 1, 1 },
{ 824, 145, 35, 10, 5, 1, 1, 1, 1, 1 },
{ 828, 143, 34, 10, 4, 1, 1, 1, 1, 1 },
{ 832, 141, 33, 9, 4, 1, 1, 1, 1, 1 },
{ 836, 138, 32, 9, 4, 1, 1, 1, 1, 1 },
{ 840, 136, 30, 9, 4, 1, 1, 1, 1, 1 },
{ 844, 133, 30, 8, 4, 1, 1, 1, 1, 1 },
{ 848, 131, 29, 8, 3, 1, 1, 1, 1, 1 },
{ 852, 129, 28, 7, 3, 1, 1, 1, 1, 1 },
{ 856, 126, 27, 7, 3, 1, 1, 1, 1, 1 },
{ 860, 123, 26, 7, 3, 1, 1, 1, 1, 1 },
{ 864, 121, 25, 6, 3, 1, 1, 1, 1, 1 },
{ 868, 118, 24, 6, 3, 1, 1, 1, 1, 1 },
{ 872, 116, 23, 6, 2, 1, 1, 1, 1, 1 },
{ 876, 113, 22, 6, 2, 1, 1, 1, 1, 1 },
{ 880, 111, 21, 5, 2, 1, 1, 1, 1, 1 },
{ 884, 108, 20, 5, 2, 1, 1, 1, 1, 1 },
{ 888, 105, 19, 5, 2, 1, 1, 1, 1, 1 },
{ 892, 102, 19, 4, 2, 1, 1, 1, 1, 1 },
{ 896, 99, 18, 4, 2, 1, 1, 1, 1, 1 },
{ 900, 97, 17, 4, 1, 1, 1, 1, 1, 1 },
{ 904, 94, 16, 4, 1, 1, 1, 1, 1, 1 },
{ 908, 92, 15, 3, 1, 1, 1, 1, 1, 1 },
{ 912, 89, 14, 3, 1, 1, 1, 1, 1, 1 },
{ 916, 85, 14, 3, 1, 1, 1, 1, 1, 1 },
{ 920, 82, 13, 3, 1, 1, 1, 1, 1, 1 },
{ 924, 79, 12, 3, 1, 1, 1, 1, 1, 1 },
{ 928, 77, 11, 2, 1, 1, 1, 1, 1, 1 },
{ 932, 73, 11, 2, 1, 1, 1, 1, 1, 1 },
{ 936, 70, 10, 2, 1, 1, 1, 1, 1, 1 },
{ 940, 67, 9, 2, 1, 1, 1, 1, 1, 1 },
{ 944, 64, 8, 2, 1, 1, 1, 1, 1, 1 },
{ 948, 60, 8, 2, 1, 1, 1, 1, 1, 1 },
{ 952, 58, 7, 1, 1, 1, 1, 1, 1, 1 },
{ 956, 54, 7, 1, 1, 1, 1, 1, 1, 1 },
{ 960, 51, 6, 1, 1, 1, 1, 1, 1, 1 },
{ 964, 48, 5, 1, 1, 1, 1, 1, 1, 1 },
{ 968, 44, 5, 1, 1, 1, 1, 1, 1, 1 },
{ 972, 41, 4, 1, 1, 1, 1, 1, 1, 1 },
{ 976, 37, 4, 1, 1, 1, 1, 1, 1, 1 },
{ 980, 34, 3, 1, 1, 1, 1, 1, 1, 1 },
{ 984, 30, 3, 1, 1, 1, 1, 1, 1, 1 },
{ 988, 27, 2, 1, 1, 1, 1, 1, 1, 1 },
{ 992, 23, 2, 1, 1, 1, 1, 1, 1, 1 },
{ 996, 19, 2, 1, 1, 1, 1, 1, 1, 1 },
{ 1000, 16, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1004, 12, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1008, 8, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1012, 4, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1015, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1015, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
#endif
};
#endif // CONFIG_RANS
......
......@@ -74,7 +74,8 @@ bool check_uabs(const PvVec &pv_vec, uint8_t *buf) {
return ans_read_end(&d);
}
const aom_cdf_prob spareto65[] = { 260, 188, 138, 102, 133, 122, 64, 15, 1, 1 };
const aom_cdf_prob spareto65[] = { 8320, 6018, 4402, 3254, 4259,
3919, 2057, 492, 45, 2 };
const int kRansSymbols =
static_cast<int>(sizeof(spareto65) / sizeof(spareto65[0]));
......@@ -94,7 +95,8 @@ std::vector<int> ans_encode_build_vals(rans_sym *const tab, int iters) {
std::vector<int> ret;
libaom_test::ACMRandom gen(18543637);
for (int i = 0; i < iters; ++i) {
int sym = p_to_sym[gen.Rand8() * 4];
int sym =
p_to_sym[((gen.Rand8() << 8) + gen.Rand8()) & (RANS_PRECISION - 1)];
ret.push_back(sym);
}
return ret;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment