Remove custom rans types

(cherry picked from aom/master commit 11206c60d930be9d29100567aa67f2a65463852a)

Includes renames in a bunch of places not handled by the original
due to differing tree states.

Change-Id: Ic74d9d8850b8c80a51e55e425bbf472a67e2653f
This commit is contained in:
Alex Converse
2016-09-04 13:30:43 +02:00
committed by Pascal Massimino
parent 4ce69de9a6
commit 9ed1a2ff44
10 changed files with 295 additions and 296 deletions

View File

@@ -15,7 +15,7 @@
#include "aom_dsp/ans.h" #include "aom_dsp/ans.h"
#include "aom_dsp/prob.h" #include "aom_dsp/prob.h"
static int find_largest(const AnsP10 *const pdf_tab, int num_syms) { static int find_largest(const aom_cdf_prob *const pdf_tab, int num_syms) {
int largest_idx = -1; int largest_idx = -1;
int largest_p = -1; int largest_p = -1;
int i; int i;
@@ -29,8 +29,9 @@ static int find_largest(const AnsP10 *const pdf_tab, int num_syms) {
return largest_idx; return largest_idx;
} }
void aom_rans_merge_prob8_pdf(AnsP10 *const out_pdf, const AnsP8 node_prob, void aom_rans_merge_prob8_pdf(aom_cdf_prob *const out_pdf,
const AnsP10 *const src_pdf, int in_syms) { const AnsP8 node_prob,
const aom_cdf_prob *const src_pdf, int in_syms) {
int i; int i;
int adjustment = RANS_PRECISION; int adjustment = RANS_PRECISION;
const int round_fact = ANS_P8_PRECISION >> 1; const int round_fact = ANS_P8_PRECISION >> 1;

View File

@@ -26,21 +26,16 @@ extern "C" {
typedef uint8_t AnsP8; typedef uint8_t AnsP8;
#define ANS_P8_PRECISION 256u #define ANS_P8_PRECISION 256u
#define ANS_P8_SHIFT 8 #define ANS_P8_SHIFT 8
typedef uint16_t AnsP10; #define RANS_PRECISION 1024u
#define ANS_P10_PRECISION 1024u
#define RANS_PROB_BITS 10 #define RANS_PROB_BITS 10
#define RANS_PRECISION ANS_P10_PRECISION #define L_BASE (RANS_PRECISION * 4) // L_BASE % precision must be 0
#define L_BASE (ANS_P10_PRECISION * 4) // L_BASE % precision must be 0
#define IO_BASE 256 #define IO_BASE 256
// Range I = { L_BASE, L_BASE + 1, ..., L_BASE * IO_BASE - 1 } // Range I = { L_BASE, L_BASE + 1, ..., L_BASE * IO_BASE - 1 }
// This is now just a boring cdf. void aom_rans_merge_prob8_pdf(aom_cdf_prob *const out_pdf,
typedef uint16_t rans_lut[16]; const AnsP8 node_prob,
const aom_cdf_prob *const src_pdf, int in_syms);
void aom_rans_merge_prob8_pdf(AnsP10 *const out_pdf, const AnsP8 node_prob,
const AnsP10 *const src_pdf, int in_syms);
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif // __cplusplus #endif // __cplusplus

View File

@@ -62,14 +62,14 @@ static INLINE int uabs_read_bit(struct AnsDecoder *ans) {
struct rans_dec_sym { struct rans_dec_sym {
uint8_t val; uint8_t val;
AnsP10 prob; aom_cdf_prob prob;
AnsP10 cum_prob; // not-inclusive aom_cdf_prob cum_prob; // not-inclusive
}; };
static INLINE void fetch_sym(struct rans_dec_sym *out, const rans_lut cdf, static INLINE void fetch_sym(struct rans_dec_sym *out, const aom_cdf_prob *cdf,
AnsP10 rem) { aom_cdf_prob rem) {
int i; int i;
AnsP10 cum_prob = 0, top_prob; aom_cdf_prob cum_prob = 0, top_prob;
// TODO(skal): if critical, could be a binary search. // TODO(skal): if critical, could be a binary search.
// Or, better, an O(1) alias-table. // Or, better, an O(1) alias-table.
for (i = 0; rem >= (top_prob = cdf[i]); ++i) { for (i = 0; rem >= (top_prob = cdf[i]); ++i) {
@@ -80,7 +80,7 @@ static INLINE void fetch_sym(struct rans_dec_sym *out, const rans_lut cdf,
out->cum_prob = cum_prob; out->cum_prob = cum_prob;
} }
static INLINE int rans_read(struct AnsDecoder *ans, const rans_lut tab) { static INLINE int rans_read(struct AnsDecoder *ans, const aom_cdf_prob *tab) {
unsigned rem; unsigned rem;
unsigned quo; unsigned quo;
struct rans_dec_sym sym; struct rans_dec_sym sym;

View File

@@ -75,8 +75,8 @@ static INLINE void uabs_write(struct AnsCoder *ans, int val, AnsP8 p0) {
} }
struct rans_sym { struct rans_sym {
AnsP10 prob; aom_cdf_prob prob;
AnsP10 cum_prob; // not-inclusive aom_cdf_prob cum_prob; // not-inclusive
}; };
// rANS with normalization // rANS with normalization
@@ -84,7 +84,7 @@ struct rans_sym {
// ANS_P10_PRECISION is m // ANS_P10_PRECISION is m
static INLINE void rans_write(struct AnsCoder *ans, static INLINE void rans_write(struct AnsCoder *ans,
const struct rans_sym *const sym) { const struct rans_sym *const sym) {
const AnsP10 p = sym->prob; const aom_cdf_prob p = sym->prob;
while (ans->state >= L_BASE / RANS_PRECISION * IO_BASE * p) { while (ans->state >= L_BASE / RANS_PRECISION * IO_BASE * p) {
ans->buf[ans->buf_offset++] = ans->state % IO_BASE; ans->buf[ans->buf_offset++] = ans->state % IO_BASE;
ans->state /= IO_BASE; ans->state /= IO_BASE;

View File

@@ -418,263 +418,264 @@ const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES] = {
// beta = 8 // beta = 8
// Values for tokens ONE_TOKEN through CATEGORY6_TOKEN included here. // Values for tokens ONE_TOKEN through CATEGORY6_TOKEN included here.
// ZERO_TOKEN and EOB_TOKEN are coded as flags outside this coder. // ZERO_TOKEN and EOB_TOKEN are coded as flags outside this coder.
const AnsP10 av1_pareto8_token_probs[COEFF_PROB_MODELS][ENTROPY_TOKENS - 2] = { const aom_cdf_prob
{ 4, 4, 4, 4, 8, 15, 30, 57, 103, 795 }, av1_pareto8_token_probs[COEFF_PROB_MODELS][ENTROPY_TOKENS - 2] = {
{ 8, 8, 8, 8, 15, 30, 57, 103, 168, 619 }, { 4, 4, 4, 4, 8, 15, 30, 57, 103, 795 },
{ 12, 12, 12, 12, 23, 43, 80, 138, 205, 487 }, { 8, 8, 8, 8, 15, 30, 57, 103, 168, 619 },
{ 16, 16, 15, 15, 30, 56, 101, 165, 225, 385 }, { 12, 12, 12, 12, 23, 43, 80, 138, 205, 487 },
{ 20, 20, 19, 19, 36, 68, 119, 186, 231, 306 }, { 16, 16, 15, 15, 30, 56, 101, 165, 225, 385 },
{ 24, 23, 23, 22, 43, 79, 135, 201, 230, 244 }, { 20, 20, 19, 19, 36, 68, 119, 186, 231, 306 },
{ 28, 27, 26, 26, 49, 89, 149, 211, 223, 196 }, { 24, 23, 23, 22, 43, 79, 135, 201, 230, 244 },
{ 32, 31, 30, 29, 55, 98, 160, 218, 212, 159 }, { 28, 27, 26, 26, 49, 89, 149, 211, 223, 196 },
{ 36, 35, 33, 32, 60, 107, 171, 221, 200, 129 }, { 32, 31, 30, 29, 55, 98, 160, 218, 212, 159 },
{ 40, 38, 37, 35, 66, 115, 179, 222, 187, 105 }, { 36, 35, 33, 32, 60, 107, 171, 221, 200, 129 },
{ 44, 42, 40, 38, 71, 122, 186, 221, 174, 86 }, { 40, 38, 37, 35, 66, 115, 179, 222, 187, 105 },
{ 48, 45, 43, 41, 76, 129, 192, 219, 160, 71 }, { 44, 42, 40, 38, 71, 122, 186, 221, 174, 86 },
{ 52, 49, 46, 44, 80, 136, 196, 215, 148, 58 }, { 48, 45, 43, 41, 76, 129, 192, 219, 160, 71 },
{ 56, 53, 49, 46, 85, 142, 200, 210, 135, 48 }, { 52, 49, 46, 44, 80, 136, 196, 215, 148, 58 },
{ 60, 56, 52, 49, 89, 147, 203, 204, 124, 40 }, { 56, 53, 49, 46, 85, 142, 200, 210, 135, 48 },
{ 64, 60, 55, 52, 93, 151, 205, 198, 113, 33 }, { 60, 56, 52, 49, 89, 147, 203, 204, 124, 40 },
{ 68, 63, 58, 54, 97, 156, 205, 192, 103, 28 }, { 64, 60, 55, 52, 93, 151, 205, 198, 113, 33 },
{ 72, 66, 61, 57, 100, 160, 206, 185, 94, 23 }, { 68, 63, 58, 54, 97, 156, 205, 192, 103, 28 },
{ 76, 70, 64, 59, 104, 163, 205, 178, 85, 20 }, { 72, 66, 61, 57, 100, 160, 206, 185, 94, 23 },
{ 80, 73, 67, 61, 107, 166, 205, 171, 77, 17 }, { 76, 70, 64, 59, 104, 163, 205, 178, 85, 20 },
{ 84, 76, 69, 63, 110, 169, 204, 164, 71, 14 }, { 80, 73, 67, 61, 107, 166, 205, 171, 77, 17 },
{ 88, 80, 72, 65, 113, 171, 202, 157, 64, 12 }, { 84, 76, 69, 63, 110, 169, 204, 164, 71, 14 },
{ 92, 83, 75, 67, 116, 173, 200, 150, 58, 10 }, { 88, 80, 72, 65, 113, 171, 202, 157, 64, 12 },
{ 96, 86, 77, 69, 118, 175, 198, 143, 53, 9 }, { 92, 83, 75, 67, 116, 173, 200, 150, 58, 10 },
{ 100, 89, 80, 71, 121, 176, 195, 137, 48, 7 }, { 96, 86, 77, 69, 118, 175, 198, 143, 53, 9 },
{ 104, 92, 82, 73, 123, 178, 192, 130, 44, 6 }, { 100, 89, 80, 71, 121, 176, 195, 137, 48, 7 },
{ 108, 96, 84, 75, 125, 178, 189, 124, 40, 5 }, { 104, 92, 82, 73, 123, 178, 192, 130, 44, 6 },
{ 112, 98, 87, 76, 127, 179, 186, 118, 36, 5 }, { 108, 96, 84, 75, 125, 178, 189, 124, 40, 5 },
{ 116, 101, 89, 78, 129, 179, 183, 112, 33, 4 }, { 112, 98, 87, 76, 127, 179, 186, 118, 36, 5 },
{ 120, 104, 91, 80, 131, 180, 179, 106, 30, 3 }, { 116, 101, 89, 78, 129, 179, 183, 112, 33, 4 },
{ 124, 107, 93, 81, 132, 180, 176, 101, 27, 3 }, { 120, 104, 91, 80, 131, 180, 179, 106, 30, 3 },
{ 128, 110, 95, 82, 134, 179, 172, 96, 25, 3 }, { 124, 107, 93, 81, 132, 180, 176, 101, 27, 3 },
{ 132, 113, 97, 84, 135, 179, 168, 91, 23, 2 }, { 128, 110, 95, 82, 134, 179, 172, 96, 25, 3 },
{ 136, 116, 99, 85, 136, 179, 164, 86, 21, 2 }, { 132, 113, 97, 84, 135, 179, 168, 91, 23, 2 },
{ 140, 119, 101, 86, 137, 178, 160, 82, 19, 2 }, { 136, 116, 99, 85, 136, 179, 164, 86, 21, 2 },
{ 144, 122, 103, 88, 138, 177, 157, 77, 17, 1 }, { 140, 119, 101, 86, 137, 178, 160, 82, 19, 2 },
{ 148, 124, 105, 89, 139, 176, 153, 73, 16, 1 }, { 144, 122, 103, 88, 138, 177, 157, 77, 17, 1 },
{ 152, 127, 107, 90, 140, 175, 149, 69, 14, 1 }, { 148, 124, 105, 89, 139, 176, 153, 73, 16, 1 },
{ 156, 130, 108, 91, 141, 173, 145, 66, 13, 1 }, { 152, 127, 107, 90, 140, 175, 149, 69, 14, 1 },
{ 160, 133, 110, 92, 141, 172, 141, 62, 12, 1 }, { 156, 130, 108, 91, 141, 173, 145, 66, 13, 1 },
{ 164, 135, 111, 93, 142, 171, 137, 59, 11, 1 }, { 160, 133, 110, 92, 141, 172, 141, 62, 12, 1 },
{ 168, 138, 113, 94, 142, 169, 133, 56, 10, 1 }, { 164, 135, 111, 93, 142, 171, 137, 59, 11, 1 },
{ 172, 140, 115, 94, 142, 168, 130, 53, 9, 1 }, { 168, 138, 113, 94, 142, 169, 133, 56, 10, 1 },
{ 176, 143, 116, 95, 143, 166, 126, 50, 8, 1 }, { 172, 140, 115, 94, 142, 168, 130, 53, 9, 1 },
{ 180, 145, 118, 96, 143, 164, 122, 47, 8, 1 }, { 176, 143, 116, 95, 143, 166, 126, 50, 8, 1 },
{ 184, 147, 119, 96, 143, 163, 119, 45, 7, 1 }, { 180, 145, 118, 96, 143, 164, 122, 47, 8, 1 },
{ 188, 150, 120, 97, 143, 161, 116, 42, 6, 1 }, { 184, 147, 119, 96, 143, 163, 119, 45, 7, 1 },
{ 192, 152, 121, 98, 143, 159, 112, 40, 6, 1 }, { 188, 150, 120, 97, 143, 161, 116, 42, 6, 1 },
{ 196, 155, 123, 98, 142, 157, 109, 38, 5, 1 }, { 192, 152, 121, 98, 143, 159, 112, 40, 6, 1 },
{ 200, 157, 124, 99, 142, 155, 105, 36, 5, 1 }, { 196, 155, 123, 98, 142, 157, 109, 38, 5, 1 },
{ 204, 159, 125, 99, 142, 153, 102, 34, 5, 1 }, { 200, 157, 124, 99, 142, 155, 105, 36, 5, 1 },
{ 208, 161, 126, 100, 142, 151, 99, 32, 4, 1 }, { 204, 159, 125, 99, 142, 153, 102, 34, 5, 1 },
{ 212, 164, 127, 100, 141, 149, 96, 30, 4, 1 }, { 208, 161, 126, 100, 142, 151, 99, 32, 4, 1 },
{ 216, 166, 129, 100, 141, 147, 93, 28, 3, 1 }, { 212, 164, 127, 100, 141, 149, 96, 30, 4, 1 },
{ 220, 168, 130, 101, 140, 144, 90, 27, 3, 1 }, { 216, 166, 129, 100, 141, 147, 93, 28, 3, 1 },
{ 224, 170, 131, 101, 140, 142, 87, 25, 3, 1 }, { 220, 168, 130, 101, 140, 144, 90, 27, 3, 1 },
{ 228, 172, 132, 101, 139, 140, 84, 24, 3, 1 }, { 224, 170, 131, 101, 140, 142, 87, 25, 3, 1 },
{ 232, 174, 132, 101, 139, 138, 81, 23, 3, 1 }, { 228, 172, 132, 101, 139, 140, 84, 24, 3, 1 },
{ 236, 176, 133, 101, 138, 136, 79, 22, 2, 1 }, { 232, 174, 132, 101, 139, 138, 81, 23, 3, 1 },
{ 240, 178, 134, 102, 137, 134, 76, 20, 2, 1 }, { 236, 176, 133, 101, 138, 136, 79, 22, 2, 1 },
{ 244, 180, 135, 102, 136, 131, 74, 19, 2, 1 }, { 240, 178, 134, 102, 137, 134, 76, 20, 2, 1 },
{ 248, 182, 135, 102, 136, 129, 71, 18, 2, 1 }, { 244, 180, 135, 102, 136, 131, 74, 19, 2, 1 },
{ 252, 184, 136, 101, 135, 127, 69, 17, 2, 1 }, { 248, 182, 135, 102, 136, 129, 71, 18, 2, 1 },
{ 256, 186, 137, 102, 134, 124, 66, 16, 2, 1 }, { 252, 184, 136, 101, 135, 127, 69, 17, 2, 1 },
{ 260, 188, 138, 102, 133, 122, 64, 15, 1, 1 }, { 256, 186, 137, 102, 134, 124, 66, 16, 2, 1 },
{ 264, 190, 138, 101, 132, 120, 62, 15, 1, 1 }, { 260, 188, 138, 102, 133, 122, 64, 15, 1, 1 },
{ 268, 191, 139, 101, 131, 118, 60, 14, 1, 1 }, { 264, 190, 138, 101, 132, 120, 62, 15, 1, 1 },
{ 272, 193, 139, 101, 130, 116, 58, 13, 1, 1 }, { 268, 191, 139, 101, 131, 118, 60, 14, 1, 1 },
{ 276, 195, 139, 101, 129, 114, 56, 12, 1, 1 }, { 272, 193, 139, 101, 130, 116, 58, 13, 1, 1 },
{ 280, 196, 140, 101, 128, 111, 54, 12, 1, 1 }, { 276, 195, 139, 101, 129, 114, 56, 12, 1, 1 },
{ 284, 198, 140, 101, 127, 109, 52, 11, 1, 1 }, { 280, 196, 140, 101, 128, 111, 54, 12, 1, 1 },
{ 288, 200, 141, 100, 126, 107, 50, 10, 1, 1 }, { 284, 198, 140, 101, 127, 109, 52, 11, 1, 1 },
{ 292, 201, 141, 100, 125, 105, 48, 10, 1, 1 }, { 288, 200, 141, 100, 126, 107, 50, 10, 1, 1 },
{ 296, 203, 141, 100, 123, 103, 47, 9, 1, 1 }, { 292, 201, 141, 100, 125, 105, 48, 10, 1, 1 },
{ 300, 204, 142, 99, 122, 101, 45, 9, 1, 1 }, { 296, 203, 141, 100, 123, 103, 47, 9, 1, 1 },
{ 304, 206, 142, 99, 121, 99, 43, 8, 1, 1 }, { 300, 204, 142, 99, 122, 101, 45, 9, 1, 1 },
{ 308, 207, 142, 99, 119, 97, 42, 8, 1, 1 }, { 304, 206, 142, 99, 121, 99, 43, 8, 1, 1 },
{ 312, 209, 142, 99, 118, 95, 40, 7, 1, 1 }, { 308, 207, 142, 99, 119, 97, 42, 8, 1, 1 },
{ 316, 210, 142, 98, 117, 93, 39, 7, 1, 1 }, { 312, 209, 142, 99, 118, 95, 40, 7, 1, 1 },
{ 320, 211, 142, 98, 116, 91, 37, 7, 1, 1 }, { 316, 210, 142, 98, 117, 93, 39, 7, 1, 1 },
{ 324, 213, 142, 97, 115, 89, 36, 6, 1, 1 }, { 320, 211, 142, 98, 116, 91, 37, 7, 1, 1 },
{ 328, 214, 142, 97, 113, 87, 35, 6, 1, 1 }, { 324, 213, 142, 97, 115, 89, 36, 6, 1, 1 },
{ 332, 215, 143, 96, 112, 85, 33, 6, 1, 1 }, { 328, 214, 142, 97, 113, 87, 35, 6, 1, 1 },
{ 336, 216, 143, 96, 111, 83, 32, 5, 1, 1 }, { 332, 215, 143, 96, 112, 85, 33, 6, 1, 1 },
{ 340, 218, 143, 95, 109, 81, 31, 5, 1, 1 }, { 336, 216, 143, 96, 111, 83, 32, 5, 1, 1 },
{ 344, 219, 142, 95, 108, 79, 30, 5, 1, 1 }, { 340, 218, 143, 95, 109, 81, 31, 5, 1, 1 },
{ 348, 220, 142, 94, 107, 78, 29, 4, 1, 1 }, { 344, 219, 142, 95, 108, 79, 30, 5, 1, 1 },
{ 352, 221, 142, 94, 105, 76, 28, 4, 1, 1 }, { 348, 220, 142, 94, 107, 78, 29, 4, 1, 1 },
{ 356, 222, 142, 93, 104, 74, 27, 4, 1, 1 }, { 352, 221, 142, 94, 105, 76, 28, 4, 1, 1 },
{ 360, 223, 142, 92, 103, 72, 26, 4, 1, 1 }, { 356, 222, 142, 93, 104, 74, 27, 4, 1, 1 },
{ 364, 224, 142, 92, 101, 70, 25, 4, 1, 1 }, { 360, 223, 142, 92, 103, 72, 26, 4, 1, 1 },
{ 368, 225, 142, 91, 100, 69, 24, 3, 1, 1 }, { 364, 224, 142, 92, 101, 70, 25, 4, 1, 1 },
{ 372, 226, 141, 91, 99, 67, 23, 3, 1, 1 }, { 368, 225, 142, 91, 100, 69, 24, 3, 1, 1 },
{ 376, 227, 141, 90, 97, 66, 22, 3, 1, 1 }, { 372, 226, 141, 91, 99, 67, 23, 3, 1, 1 },
{ 380, 228, 141, 89, 96, 64, 21, 3, 1, 1 }, { 376, 227, 141, 90, 97, 66, 22, 3, 1, 1 },
{ 384, 229, 140, 89, 95, 62, 20, 3, 1, 1 }, { 380, 228, 141, 89, 96, 64, 21, 3, 1, 1 },
{ 388, 229, 140, 88, 93, 61, 20, 3, 1, 1 }, { 384, 229, 140, 89, 95, 62, 20, 3, 1, 1 },
{ 392, 230, 140, 87, 92, 60, 19, 2, 1, 1 }, { 388, 229, 140, 88, 93, 61, 20, 3, 1, 1 },
{ 396, 231, 140, 86, 91, 58, 18, 2, 1, 1 }, { 392, 230, 140, 87, 92, 60, 19, 2, 1, 1 },
{ 400, 232, 139, 86, 89, 57, 17, 2, 1, 1 }, { 396, 231, 140, 86, 91, 58, 18, 2, 1, 1 },
{ 404, 232, 139, 85, 88, 55, 17, 2, 1, 1 }, { 400, 232, 139, 86, 89, 57, 17, 2, 1, 1 },
{ 408, 233, 138, 84, 87, 54, 16, 2, 1, 1 }, { 404, 232, 139, 85, 88, 55, 17, 2, 1, 1 },
{ 412, 234, 138, 84, 85, 52, 15, 2, 1, 1 }, { 408, 233, 138, 84, 87, 54, 16, 2, 1, 1 },
{ 416, 234, 137, 83, 84, 51, 15, 2, 1, 1 }, { 412, 234, 138, 84, 85, 52, 15, 2, 1, 1 },
{ 420, 235, 137, 82, 82, 50, 14, 2, 1, 1 }, { 416, 234, 137, 83, 84, 51, 15, 2, 1, 1 },
{ 424, 236, 136, 81, 81, 48, 14, 2, 1, 1 }, { 420, 235, 137, 82, 82, 50, 14, 2, 1, 1 },
{ 428, 236, 136, 81, 80, 47, 13, 1, 1, 1 }, { 424, 236, 136, 81, 81, 48, 14, 2, 1, 1 },
{ 432, 236, 135, 80, 79, 46, 13, 1, 1, 1 }, { 428, 236, 136, 81, 80, 47, 13, 1, 1, 1 },
{ 436, 237, 135, 79, 77, 45, 12, 1, 1, 1 }, { 432, 236, 135, 80, 79, 46, 13, 1, 1, 1 },
{ 440, 238, 134, 78, 76, 43, 12, 1, 1, 1 }, { 436, 237, 135, 79, 77, 45, 12, 1, 1, 1 },
{ 444, 238, 134, 77, 75, 42, 11, 1, 1, 1 }, { 440, 238, 134, 78, 76, 43, 12, 1, 1, 1 },
{ 448, 238, 133, 77, 73, 41, 11, 1, 1, 1 }, { 444, 238, 134, 77, 75, 42, 11, 1, 1, 1 },
{ 452, 239, 132, 76, 72, 40, 10, 1, 1, 1 }, { 448, 238, 133, 77, 73, 41, 11, 1, 1, 1 },
{ 456, 239, 131, 75, 71, 39, 10, 1, 1, 1 }, { 452, 239, 132, 76, 72, 40, 10, 1, 1, 1 },
{ 460, 239, 131, 74, 70, 38, 9, 1, 1, 1 }, { 456, 239, 131, 75, 71, 39, 10, 1, 1, 1 },
{ 464, 240, 130, 73, 68, 37, 9, 1, 1, 1 }, { 460, 239, 131, 74, 70, 38, 9, 1, 1, 1 },
{ 468, 240, 129, 72, 67, 36, 9, 1, 1, 1 }, { 464, 240, 130, 73, 68, 37, 9, 1, 1, 1 },
{ 472, 240, 128, 72, 66, 35, 8, 1, 1, 1 }, { 468, 240, 129, 72, 67, 36, 9, 1, 1, 1 },
{ 476, 240, 127, 71, 65, 34, 8, 1, 1, 1 }, { 472, 240, 128, 72, 66, 35, 8, 1, 1, 1 },
{ 480, 240, 127, 70, 63, 33, 8, 1, 1, 1 }, { 476, 240, 127, 71, 65, 34, 8, 1, 1, 1 },
{ 484, 241, 126, 69, 62, 32, 7, 1, 1, 1 }, { 480, 240, 127, 70, 63, 33, 8, 1, 1, 1 },
{ 488, 241, 125, 68, 61, 31, 7, 1, 1, 1 }, { 484, 241, 126, 69, 62, 32, 7, 1, 1, 1 },
{ 492, 241, 124, 67, 60, 30, 7, 1, 1, 1 }, { 488, 241, 125, 68, 61, 31, 7, 1, 1, 1 },
{ 496, 241, 124, 66, 59, 29, 6, 1, 1, 1 }, { 492, 241, 124, 67, 60, 30, 7, 1, 1, 1 },
{ 500, 240, 123, 66, 58, 28, 6, 1, 1, 1 }, { 496, 241, 124, 66, 59, 29, 6, 1, 1, 1 },
{ 504, 240, 122, 65, 57, 27, 6, 1, 1, 1 }, { 500, 240, 123, 66, 58, 28, 6, 1, 1, 1 },
{ 508, 240, 121, 64, 55, 27, 6, 1, 1, 1 }, { 504, 240, 122, 65, 57, 27, 6, 1, 1, 1 },
{ 512, 241, 120, 63, 54, 26, 5, 1, 1, 1 }, { 508, 240, 121, 64, 55, 27, 6, 1, 1, 1 },
{ 516, 241, 119, 62, 53, 25, 5, 1, 1, 1 }, { 512, 241, 120, 63, 54, 26, 5, 1, 1, 1 },
{ 520, 240, 118, 62, 52, 24, 5, 1, 1, 1 }, { 516, 241, 119, 62, 53, 25, 5, 1, 1, 1 },
{ 524, 240, 117, 60, 51, 24, 5, 1, 1, 1 }, { 520, 240, 118, 62, 52, 24, 5, 1, 1, 1 },
{ 528, 239, 116, 60, 50, 23, 5, 1, 1, 1 }, { 524, 240, 117, 60, 51, 24, 5, 1, 1, 1 },
{ 532, 239, 116, 59, 49, 22, 4, 1, 1, 1 }, { 528, 239, 116, 60, 50, 23, 5, 1, 1, 1 },
{ 536, 239, 115, 58, 48, 21, 4, 1, 1, 1 }, { 532, 239, 116, 59, 49, 22, 4, 1, 1, 1 },
{ 540, 239, 113, 57, 47, 21, 4, 1, 1, 1 }, { 536, 239, 115, 58, 48, 21, 4, 1, 1, 1 },
{ 544, 238, 113, 56, 46, 20, 4, 1, 1, 1 }, { 540, 239, 113, 57, 47, 21, 4, 1, 1, 1 },
{ 548, 238, 112, 55, 45, 19, 4, 1, 1, 1 }, { 544, 238, 113, 56, 46, 20, 4, 1, 1, 1 },
{ 552, 238, 110, 55, 44, 19, 3, 1, 1, 1 }, { 548, 238, 112, 55, 45, 19, 4, 1, 1, 1 },
{ 556, 237, 110, 54, 43, 18, 3, 1, 1, 1 }, { 552, 238, 110, 55, 44, 19, 3, 1, 1, 1 },
{ 560, 237, 108, 53, 42, 18, 3, 1, 1, 1 }, { 556, 237, 110, 54, 43, 18, 3, 1, 1, 1 },
{ 564, 236, 108, 52, 41, 17, 3, 1, 1, 1 }, { 560, 237, 108, 53, 42, 18, 3, 1, 1, 1 },
{ 568, 236, 106, 51, 40, 17, 3, 1, 1, 1 }, { 564, 236, 108, 52, 41, 17, 3, 1, 1, 1 },
{ 572, 235, 105, 51, 39, 16, 3, 1, 1, 1 }, { 568, 236, 106, 51, 40, 17, 3, 1, 1, 1 },
{ 576, 235, 104, 50, 38, 15, 3, 1, 1, 1 }, { 572, 235, 105, 51, 39, 16, 3, 1, 1, 1 },
{ 580, 234, 103, 49, 37, 15, 3, 1, 1, 1 }, { 576, 235, 104, 50, 38, 15, 3, 1, 1, 1 },
{ 584, 234, 102, 48, 37, 14, 2, 1, 1, 1 }, { 580, 234, 103, 49, 37, 15, 3, 1, 1, 1 },
{ 588, 233, 101, 47, 36, 14, 2, 1, 1, 1 }, { 584, 234, 102, 48, 37, 14, 2, 1, 1, 1 },
{ 592, 233, 100, 46, 35, 13, 2, 1, 1, 1 }, { 588, 233, 101, 47, 36, 14, 2, 1, 1, 1 },
{ 596, 231, 99, 46, 34, 13, 2, 1, 1, 1 }, { 592, 233, 100, 46, 35, 13, 2, 1, 1, 1 },
{ 600, 230, 98, 45, 33, 13, 2, 1, 1, 1 }, { 596, 231, 99, 46, 34, 13, 2, 1, 1, 1 },
{ 604, 230, 97, 44, 32, 12, 2, 1, 1, 1 }, { 600, 230, 98, 45, 33, 13, 2, 1, 1, 1 },
{ 608, 229, 96, 43, 31, 12, 2, 1, 1, 1 }, { 604, 230, 97, 44, 32, 12, 2, 1, 1, 1 },
{ 612, 228, 95, 42, 31, 11, 2, 1, 1, 1 }, { 608, 229, 96, 43, 31, 12, 2, 1, 1, 1 },
{ 616, 227, 93, 42, 30, 11, 2, 1, 1, 1 }, { 612, 228, 95, 42, 31, 11, 2, 1, 1, 1 },
{ 620, 227, 92, 41, 29, 10, 2, 1, 1, 1 }, { 616, 227, 93, 42, 30, 11, 2, 1, 1, 1 },
{ 624, 226, 92, 40, 28, 10, 1, 1, 1, 1 }, { 620, 227, 92, 41, 29, 10, 2, 1, 1, 1 },
{ 628, 225, 90, 39, 28, 10, 1, 1, 1, 1 }, { 624, 226, 92, 40, 28, 10, 1, 1, 1, 1 },
{ 632, 224, 89, 39, 27, 9, 1, 1, 1, 1 }, { 628, 225, 90, 39, 28, 10, 1, 1, 1, 1 },
{ 636, 223, 88, 38, 26, 9, 1, 1, 1, 1 }, { 632, 224, 89, 39, 27, 9, 1, 1, 1, 1 },
{ 640, 222, 87, 37, 25, 9, 1, 1, 1, 1 }, { 636, 223, 88, 38, 26, 9, 1, 1, 1, 1 },
{ 644, 221, 86, 36, 25, 8, 1, 1, 1, 1 }, { 640, 222, 87, 37, 25, 9, 1, 1, 1, 1 },
{ 648, 220, 84, 36, 24, 8, 1, 1, 1, 1 }, { 644, 221, 86, 36, 25, 8, 1, 1, 1, 1 },
{ 652, 219, 83, 35, 23, 8, 1, 1, 1, 1 }, { 648, 220, 84, 36, 24, 8, 1, 1, 1, 1 },
{ 656, 218, 82, 34, 23, 7, 1, 1, 1, 1 }, { 652, 219, 83, 35, 23, 8, 1, 1, 1, 1 },
{ 660, 217, 81, 33, 22, 7, 1, 1, 1, 1 }, { 656, 218, 82, 34, 23, 7, 1, 1, 1, 1 },
{ 664, 215, 80, 33, 21, 7, 1, 1, 1, 1 }, { 660, 217, 81, 33, 22, 7, 1, 1, 1, 1 },
{ 668, 214, 78, 32, 21, 7, 1, 1, 1, 1 }, { 664, 215, 80, 33, 21, 7, 1, 1, 1, 1 },
{ 672, 213, 78, 31, 20, 6, 1, 1, 1, 1 }, { 668, 214, 78, 32, 21, 7, 1, 1, 1, 1 },
{ 676, 211, 76, 31, 20, 6, 1, 1, 1, 1 }, { 672, 213, 78, 31, 20, 6, 1, 1, 1, 1 },
{ 680, 210, 75, 30, 19, 6, 1, 1, 1, 1 }, { 676, 211, 76, 31, 20, 6, 1, 1, 1, 1 },
{ 684, 209, 74, 29, 18, 6, 1, 1, 1, 1 }, { 680, 210, 75, 30, 19, 6, 1, 1, 1, 1 },
{ 688, 208, 73, 28, 18, 5, 1, 1, 1, 1 }, { 684, 209, 74, 29, 18, 6, 1, 1, 1, 1 },
{ 692, 206, 72, 28, 17, 5, 1, 1, 1, 1 }, { 688, 208, 73, 28, 18, 5, 1, 1, 1, 1 },
{ 696, 205, 70, 27, 17, 5, 1, 1, 1, 1 }, { 692, 206, 72, 28, 17, 5, 1, 1, 1, 1 },
{ 700, 203, 69, 27, 16, 5, 1, 1, 1, 1 }, { 696, 205, 70, 27, 17, 5, 1, 1, 1, 1 },
{ 704, 201, 68, 26, 16, 5, 1, 1, 1, 1 }, { 700, 203, 69, 27, 16, 5, 1, 1, 1, 1 },
{ 708, 201, 67, 25, 15, 4, 1, 1, 1, 1 }, { 704, 201, 68, 26, 16, 5, 1, 1, 1, 1 },
{ 712, 198, 66, 25, 15, 4, 1, 1, 1, 1 }, { 708, 201, 67, 25, 15, 4, 1, 1, 1, 1 },
{ 716, 197, 65, 24, 14, 4, 1, 1, 1, 1 }, { 712, 198, 66, 25, 15, 4, 1, 1, 1, 1 },
{ 720, 196, 63, 23, 14, 4, 1, 1, 1, 1 }, { 716, 197, 65, 24, 14, 4, 1, 1, 1, 1 },
{ 724, 194, 62, 23, 13, 4, 1, 1, 1, 1 }, { 720, 196, 63, 23, 14, 4, 1, 1, 1, 1 },
{ 728, 193, 61, 22, 13, 3, 1, 1, 1, 1 }, { 724, 194, 62, 23, 13, 4, 1, 1, 1, 1 },
{ 732, 191, 60, 22, 12, 3, 1, 1, 1, 1 }, { 728, 193, 61, 22, 13, 3, 1, 1, 1, 1 },
{ 736, 189, 59, 21, 12, 3, 1, 1, 1, 1 }, { 732, 191, 60, 22, 12, 3, 1, 1, 1, 1 },
{ 740, 188, 58, 20, 11, 3, 1, 1, 1, 1 }, { 736, 189, 59, 21, 12, 3, 1, 1, 1, 1 },
{ 744, 186, 56, 20, 11, 3, 1, 1, 1, 1 }, { 740, 188, 58, 20, 11, 3, 1, 1, 1, 1 },
{ 748, 184, 55, 19, 11, 3, 1, 1, 1, 1 }, { 744, 186, 56, 20, 11, 3, 1, 1, 1, 1 },
{ 752, 182, 54, 19, 10, 3, 1, 1, 1, 1 }, { 748, 184, 55, 19, 11, 3, 1, 1, 1, 1 },
{ 756, 181, 53, 18, 10, 2, 1, 1, 1, 1 }, { 752, 182, 54, 19, 10, 3, 1, 1, 1, 1 },
{ 760, 179, 52, 18, 9, 2, 1, 1, 1, 1 }, { 756, 181, 53, 18, 10, 2, 1, 1, 1, 1 },
{ 764, 177, 51, 17, 9, 2, 1, 1, 1, 1 }, { 760, 179, 52, 18, 9, 2, 1, 1, 1, 1 },
{ 768, 174, 50, 17, 9, 2, 1, 1, 1, 1 }, { 764, 177, 51, 17, 9, 2, 1, 1, 1, 1 },
{ 772, 173, 49, 16, 8, 2, 1, 1, 1, 1 }, { 768, 174, 50, 17, 9, 2, 1, 1, 1, 1 },
{ 776, 171, 47, 16, 8, 2, 1, 1, 1, 1 }, { 772, 173, 49, 16, 8, 2, 1, 1, 1, 1 },
{ 780, 169, 46, 15, 8, 2, 1, 1, 1, 1 }, { 776, 171, 47, 16, 8, 2, 1, 1, 1, 1 },
{ 784, 167, 45, 15, 7, 2, 1, 1, 1, 1 }, { 780, 169, 46, 15, 8, 2, 1, 1, 1, 1 },
{ 788, 165, 44, 14, 7, 2, 1, 1, 1, 1 }, { 784, 167, 45, 15, 7, 2, 1, 1, 1, 1 },
{ 792, 162, 43, 14, 7, 2, 1, 1, 1, 1 }, { 788, 165, 44, 14, 7, 2, 1, 1, 1, 1 },
{ 796, 161, 42, 13, 7, 1, 1, 1, 1, 1 }, { 792, 162, 43, 14, 7, 2, 1, 1, 1, 1 },
{ 800, 159, 41, 13, 6, 1, 1, 1, 1, 1 }, { 796, 161, 42, 13, 7, 1, 1, 1, 1, 1 },
{ 804, 157, 40, 12, 6, 1, 1, 1, 1, 1 }, { 800, 159, 41, 13, 6, 1, 1, 1, 1, 1 },
{ 808, 154, 39, 12, 6, 1, 1, 1, 1, 1 }, { 804, 157, 40, 12, 6, 1, 1, 1, 1, 1 },
{ 812, 153, 38, 11, 5, 1, 1, 1, 1, 1 }, { 808, 154, 39, 12, 6, 1, 1, 1, 1, 1 },
{ 816, 150, 37, 11, 5, 1, 1, 1, 1, 1 }, { 812, 153, 38, 11, 5, 1, 1, 1, 1, 1 },
{ 820, 148, 36, 10, 5, 1, 1, 1, 1, 1 }, { 816, 150, 37, 11, 5, 1, 1, 1, 1, 1 },
{ 824, 145, 35, 10, 5, 1, 1, 1, 1, 1 }, { 820, 148, 36, 10, 5, 1, 1, 1, 1, 1 },
{ 828, 143, 34, 10, 4, 1, 1, 1, 1, 1 }, { 824, 145, 35, 10, 5, 1, 1, 1, 1, 1 },
{ 832, 141, 33, 9, 4, 1, 1, 1, 1, 1 }, { 828, 143, 34, 10, 4, 1, 1, 1, 1, 1 },
{ 836, 138, 32, 9, 4, 1, 1, 1, 1, 1 }, { 832, 141, 33, 9, 4, 1, 1, 1, 1, 1 },
{ 840, 136, 30, 9, 4, 1, 1, 1, 1, 1 }, { 836, 138, 32, 9, 4, 1, 1, 1, 1, 1 },
{ 844, 133, 30, 8, 4, 1, 1, 1, 1, 1 }, { 840, 136, 30, 9, 4, 1, 1, 1, 1, 1 },
{ 848, 131, 29, 8, 3, 1, 1, 1, 1, 1 }, { 844, 133, 30, 8, 4, 1, 1, 1, 1, 1 },
{ 852, 129, 28, 7, 3, 1, 1, 1, 1, 1 }, { 848, 131, 29, 8, 3, 1, 1, 1, 1, 1 },
{ 856, 126, 27, 7, 3, 1, 1, 1, 1, 1 }, { 852, 129, 28, 7, 3, 1, 1, 1, 1, 1 },
{ 860, 123, 26, 7, 3, 1, 1, 1, 1, 1 }, { 856, 126, 27, 7, 3, 1, 1, 1, 1, 1 },
{ 864, 121, 25, 6, 3, 1, 1, 1, 1, 1 }, { 860, 123, 26, 7, 3, 1, 1, 1, 1, 1 },
{ 868, 118, 24, 6, 3, 1, 1, 1, 1, 1 }, { 864, 121, 25, 6, 3, 1, 1, 1, 1, 1 },
{ 872, 116, 23, 6, 2, 1, 1, 1, 1, 1 }, { 868, 118, 24, 6, 3, 1, 1, 1, 1, 1 },
{ 876, 113, 22, 6, 2, 1, 1, 1, 1, 1 }, { 872, 116, 23, 6, 2, 1, 1, 1, 1, 1 },
{ 880, 111, 21, 5, 2, 1, 1, 1, 1, 1 }, { 876, 113, 22, 6, 2, 1, 1, 1, 1, 1 },
{ 884, 108, 20, 5, 2, 1, 1, 1, 1, 1 }, { 880, 111, 21, 5, 2, 1, 1, 1, 1, 1 },
{ 888, 105, 19, 5, 2, 1, 1, 1, 1, 1 }, { 884, 108, 20, 5, 2, 1, 1, 1, 1, 1 },
{ 892, 102, 19, 4, 2, 1, 1, 1, 1, 1 }, { 888, 105, 19, 5, 2, 1, 1, 1, 1, 1 },
{ 896, 99, 18, 4, 2, 1, 1, 1, 1, 1 }, { 892, 102, 19, 4, 2, 1, 1, 1, 1, 1 },
{ 900, 97, 17, 4, 1, 1, 1, 1, 1, 1 }, { 896, 99, 18, 4, 2, 1, 1, 1, 1, 1 },
{ 904, 94, 16, 4, 1, 1, 1, 1, 1, 1 }, { 900, 97, 17, 4, 1, 1, 1, 1, 1, 1 },
{ 908, 92, 15, 3, 1, 1, 1, 1, 1, 1 }, { 904, 94, 16, 4, 1, 1, 1, 1, 1, 1 },
{ 912, 89, 14, 3, 1, 1, 1, 1, 1, 1 }, { 908, 92, 15, 3, 1, 1, 1, 1, 1, 1 },
{ 916, 85, 14, 3, 1, 1, 1, 1, 1, 1 }, { 912, 89, 14, 3, 1, 1, 1, 1, 1, 1 },
{ 920, 82, 13, 3, 1, 1, 1, 1, 1, 1 }, { 916, 85, 14, 3, 1, 1, 1, 1, 1, 1 },
{ 924, 79, 12, 3, 1, 1, 1, 1, 1, 1 }, { 920, 82, 13, 3, 1, 1, 1, 1, 1, 1 },
{ 928, 77, 11, 2, 1, 1, 1, 1, 1, 1 }, { 924, 79, 12, 3, 1, 1, 1, 1, 1, 1 },
{ 932, 73, 11, 2, 1, 1, 1, 1, 1, 1 }, { 928, 77, 11, 2, 1, 1, 1, 1, 1, 1 },
{ 936, 70, 10, 2, 1, 1, 1, 1, 1, 1 }, { 932, 73, 11, 2, 1, 1, 1, 1, 1, 1 },
{ 940, 67, 9, 2, 1, 1, 1, 1, 1, 1 }, { 936, 70, 10, 2, 1, 1, 1, 1, 1, 1 },
{ 944, 64, 8, 2, 1, 1, 1, 1, 1, 1 }, { 940, 67, 9, 2, 1, 1, 1, 1, 1, 1 },
{ 948, 60, 8, 2, 1, 1, 1, 1, 1, 1 }, { 944, 64, 8, 2, 1, 1, 1, 1, 1, 1 },
{ 952, 58, 7, 1, 1, 1, 1, 1, 1, 1 }, { 948, 60, 8, 2, 1, 1, 1, 1, 1, 1 },
{ 956, 54, 7, 1, 1, 1, 1, 1, 1, 1 }, { 952, 58, 7, 1, 1, 1, 1, 1, 1, 1 },
{ 960, 51, 6, 1, 1, 1, 1, 1, 1, 1 }, { 956, 54, 7, 1, 1, 1, 1, 1, 1, 1 },
{ 964, 48, 5, 1, 1, 1, 1, 1, 1, 1 }, { 960, 51, 6, 1, 1, 1, 1, 1, 1, 1 },
{ 968, 44, 5, 1, 1, 1, 1, 1, 1, 1 }, { 964, 48, 5, 1, 1, 1, 1, 1, 1, 1 },
{ 972, 41, 4, 1, 1, 1, 1, 1, 1, 1 }, { 968, 44, 5, 1, 1, 1, 1, 1, 1, 1 },
{ 976, 37, 4, 1, 1, 1, 1, 1, 1, 1 }, { 972, 41, 4, 1, 1, 1, 1, 1, 1, 1 },
{ 980, 34, 3, 1, 1, 1, 1, 1, 1, 1 }, { 976, 37, 4, 1, 1, 1, 1, 1, 1, 1 },
{ 984, 30, 3, 1, 1, 1, 1, 1, 1, 1 }, { 980, 34, 3, 1, 1, 1, 1, 1, 1, 1 },
{ 988, 27, 2, 1, 1, 1, 1, 1, 1, 1 }, { 984, 30, 3, 1, 1, 1, 1, 1, 1, 1 },
{ 992, 23, 2, 1, 1, 1, 1, 1, 1, 1 }, { 988, 27, 2, 1, 1, 1, 1, 1, 1, 1 },
{ 996, 19, 2, 1, 1, 1, 1, 1, 1, 1 }, { 992, 23, 2, 1, 1, 1, 1, 1, 1, 1 },
{ 1000, 16, 1, 1, 1, 1, 1, 1, 1, 1 }, { 996, 19, 2, 1, 1, 1, 1, 1, 1, 1 },
{ 1004, 12, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1000, 16, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1008, 8, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1004, 12, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1012, 4, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1008, 8, 1, 1, 1, 1, 1, 1, 1, 1 },
{ 1015, 1, 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 },
}; { 1015, 1, 1, 1, 1, 1, 1, 1, 1, 1 },
};
#endif // CONFIG_ANS #endif // CONFIG_ANS
/* clang-format off */ /* clang-format off */
@@ -2801,7 +2802,8 @@ void av1_model_to_full_probs(const aom_prob *model, aom_prob *full) {
} }
#if CONFIG_ANS #if CONFIG_ANS
static void build_token_cdfs(const aom_prob *pdf_model, rans_lut cdf) { static void build_token_cdfs(const aom_prob *pdf_model,
aom_cdf_prob cdf[ENTROPY_TOKENS]) {
int i, sum = 0; int i, sum = 0;
assert(pdf_model[2] != 0); assert(pdf_model[2] != 0);
for (i = 0; i < ENTROPY_TOKENS - 2; ++i) { for (i = 0; i < ENTROPY_TOKENS - 2; ++i) {

View File

@@ -191,10 +191,10 @@ static INLINE const uint8_t *get_band_translate(TX_SIZE tx_size) {
extern const aom_tree_index av1_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)]; extern const aom_tree_index av1_coef_con_tree[TREE_SIZE(ENTROPY_TOKENS)];
extern const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES]; extern const aom_prob av1_pareto8_full[COEFF_PROB_MODELS][MODEL_NODES];
#if CONFIG_ANS #if CONFIG_ANS
extern const AnsP10 av1_pareto8_token_probs[COEFF_PROB_MODELS] typedef aom_cdf_prob coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]
[ENTROPY_TOKENS - 2]; [ENTROPY_TOKENS];
extern const aom_cdf_prob av1_pareto8_token_probs[COEFF_PROB_MODELS]
typedef rans_lut coeff_cdf_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]; [ENTROPY_TOKENS - 2];
#endif // CONFIG_ANS #endif // CONFIG_ANS
typedef aom_prob av1_coeff_probs_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS] typedef aom_prob av1_coeff_probs_model[REF_TYPES][COEF_BANDS][COEFF_CONTEXTS]

View File

@@ -75,9 +75,9 @@ static int decode_coefs(const MACROBLOCKD *xd, PLANE_TYPE type,
fc->coef_probs[tx_size_ctx][type][ref]; fc->coef_probs[tx_size_ctx][type][ref];
const aom_prob *prob; const aom_prob *prob;
#if CONFIG_ANS #if CONFIG_ANS
const rans_lut(*coef_cdfs)[COEFF_CONTEXTS] = const aom_cdf_prob(*const coef_cdfs)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
fc->coef_cdfs[tx_size_ctx][type][ref]; fc->coef_cdfs[tx_size_ctx][type][ref];
const rans_lut *cdf; const aom_cdf_prob(*cdf)[ENTROPY_TOKENS];
#endif // CONFIG_ANS #endif // CONFIG_ANS
unsigned int(*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1]; unsigned int(*coef_counts)[COEFF_CONTEXTS][UNCONSTRAINED_NODES + 1];
unsigned int(*eob_branch_count)[COEFF_CONTEXTS]; unsigned int(*eob_branch_count)[COEFF_CONTEXTS];

View File

@@ -387,7 +387,7 @@ static void set_entropy_context_b(int plane, int block, int blk_row,
static INLINE void add_token(TOKENEXTRA **t, const aom_prob *context_tree, static INLINE void add_token(TOKENEXTRA **t, const aom_prob *context_tree,
#if CONFIG_ANS #if CONFIG_ANS
const rans_lut *token_cdf, const aom_cdf_prob (*token_cdf)[ENTROPY_TOKENS],
#endif // CONFIG_ANS #endif // CONFIG_ANS
int32_t extra, uint8_t token, int32_t extra, uint8_t token,
uint8_t skip_eob_node, unsigned int *counts) { uint8_t skip_eob_node, unsigned int *counts) {
@@ -487,8 +487,8 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
cpi->common.fc->coef_probs[txsize_sqr_map[tx_size]][type][ref]; cpi->common.fc->coef_probs[txsize_sqr_map[tx_size]][type][ref];
#endif // CONFIG_ENTROPY #endif // CONFIG_ENTROPY
#if CONFIG_ANS #if CONFIG_ANS
rans_lut(*const coef_cdfs)[COEFF_CONTEXTS] = aom_cdf_prob(*const coef_cdfs)[COEFF_CONTEXTS][ENTROPY_TOKENS] =
cpi->common.fc->coef_cdfs[txsize_sqr_map[tx_size]][type][ref]; cpi->common.fc->coef_cdfs[tx_size][type][ref];
#endif // CONFIG_ANS #endif // CONFIG_ANS
unsigned int(*const eob_branch)[COEFF_CONTEXTS] = unsigned int(*const eob_branch)[COEFF_CONTEXTS] =
td->counts->eob_branch[txsize_sqr_map[tx_size]][type][ref]; td->counts->eob_branch[txsize_sqr_map[tx_size]][type][ref];
@@ -511,7 +511,7 @@ static void tokenize_b(int plane, int block, int blk_row, int blk_col,
add_token(&t, coef_probs[band[c]][pt], add_token(&t, coef_probs[band[c]][pt],
#if CONFIG_ANS #if CONFIG_ANS
(const rans_lut *)&coef_cdfs[band[c]][pt], (const aom_cdf_prob(*)[ENTROPY_TOKENS]) & coef_cdfs[band[c]][pt],
#endif // CONFIG_ANS #endif // CONFIG_ANS
extra, (uint8_t)token, (uint8_t)skip_eob, counts[band[c]][pt]); extra, (uint8_t)token, (uint8_t)skip_eob, counts[band[c]][pt]);

View File

@@ -37,7 +37,7 @@ typedef struct {
typedef struct { typedef struct {
const aom_prob *context_tree; const aom_prob *context_tree;
#if CONFIG_ANS #if CONFIG_ANS
const rans_lut *token_cdf; const aom_cdf_prob (*token_cdf)[ENTROPY_TOKENS];
#endif // CONFIG_ANS #endif // CONFIG_ANS
EXTRABIT extra; EXTRABIT extra;
uint8_t token; uint8_t token;

View File

@@ -79,13 +79,13 @@ bool check_uabs(const PvVec &pv_vec, uint8_t *buf) {
const rans_sym rans_sym_tab[] = { const rans_sym rans_sym_tab[] = {
{ 67, 0 }, { 99, 67 }, { 575, 166 }, { 283, 741 }, { 67, 0 }, { 99, 67 }, { 575, 166 }, { 283, 741 },
}; };
const int kRansSymbols =
static_cast<int>(sizeof(rans_sym_tab) / sizeof(rans_sym_tab[0]));
std::vector<int> ans_encode_build_vals(const rans_sym *tab, int iters) { std::vector<int> ans_encode_build_vals(const rans_sym *tab, int iters) {
std::vector<int> p_to_sym; std::vector<int> p_to_sym;
int i = 0; for (int i = 0; i < kRansSymbols; ++i) {
while (p_to_sym.size() < RANS_PRECISION) {
p_to_sym.insert(p_to_sym.end(), tab[i].prob, i); p_to_sym.insert(p_to_sym.end(), tab[i].prob, i);
++i;
} }
assert(p_to_sym.size() == RANS_PRECISION); assert(p_to_sym.size() == RANS_PRECISION);
std::vector<int> ret; std::vector<int> ret;
@@ -97,7 +97,8 @@ std::vector<int> ans_encode_build_vals(const rans_sym *tab, int iters) {
return ret; return ret;
} }
void rans_build_dec_tab(const struct rans_sym sym_tab[], rans_lut dec_tab) { void rans_build_dec_tab(const struct rans_sym sym_tab[],
aom_cdf_prob *dec_tab) {
unsigned int sum = 0; unsigned int sum = 0;
for (int i = 0; sum < RANS_PRECISION; ++i) { for (int i = 0; sum < RANS_PRECISION; ++i) {
dec_tab[i] = sum += sym_tab[i].prob; dec_tab[i] = sum += sym_tab[i].prob;
@@ -108,7 +109,7 @@ bool check_rans(const std::vector<int> &sym_vec, const rans_sym *const tab,
uint8_t *buf) { uint8_t *buf) {
AnsCoder a; AnsCoder a;
ans_write_init(&a, buf); ans_write_init(&a, buf);
rans_lut dec_tab; aom_cdf_prob dec_tab[kRansSymbols];
rans_build_dec_tab(tab, dec_tab); rans_build_dec_tab(tab, dec_tab);
std::clock_t start = std::clock(); std::clock_t start = std::clock();