Lines Matching full:cdf
39 typedef unsigned (*decode_symbol_adapt_fn)(MsacContext *s, uint16_t *cdf,
41 typedef unsigned (*decode_adapt_fn)(MsacContext *s, uint16_t *cdf);
55 static void randomize_cdf(uint16_t *const cdf, const int n) { in randomize_cdf() argument
58 cdf[i] = 0; // padding in randomize_cdf()
59 cdf[i] = 0; // count in randomize_cdf()
61 cdf[i - 1] = cdf[i] + rnd() % (32768 - cdf[i] - i) + 1; in randomize_cdf()
100 fprintf(stderr, "cdf:\n"); in msac_dump()
121 randomize_cdf(cdf[0], ns); \
122 memcpy(cdf[1], cdf[0], sizeof(*cdf)); \
124 unsigned c_res = call_ref(&s_c, cdf[0], ns); \
125 unsigned a_res = call_new(&s_a, cdf[1], ns); \
127 memcmp(cdf[0], cdf[1], sizeof(**cdf) * (ns + 1))) \
131 cdf[0], cdf[1], ns); \
136 alternate(cdf[0], cdf[1]), ns); \
143 ALIGN_STK_32(uint16_t, cdf, 2, [16]); in check_decode_symbol()
146 declare_func(unsigned, MsacContext *s, uint16_t *cdf, size_t n_symbols); in check_decode_symbol()
156 declare_func(unsigned, MsacContext *s, uint16_t *cdf); in check_decode_bool_adapt()
158 uint16_t cdf[2][2]; in check_decode_bool_adapt() local
162 cdf[0][0] = cdf[1][0] = rnd() % 32767 + 1; in check_decode_bool_adapt()
163 cdf[0][1] = cdf[1][1] = 0; in check_decode_bool_adapt()
165 unsigned c_res = call_ref(&s_c, cdf[0]); in check_decode_bool_adapt()
166 unsigned a_res = call_new(&s_a, cdf[1]); in check_decode_bool_adapt()
168 memcmp(cdf[0], cdf[1], sizeof(*cdf))) in check_decode_bool_adapt()
171 msac_dump(c_res, a_res, &s_c, &s_a, cdf[0], cdf[1], 1); in check_decode_bool_adapt()
175 bench_new(alternate(&s_c, &s_a), alternate(cdf[0], cdf[1])); in check_decode_bool_adapt()
228 ALIGN_STK_16(uint16_t, cdf, 2, [16]); in check_decode_hi_tok()
231 declare_func(unsigned, MsacContext *s, uint16_t *cdf); in check_decode_hi_tok()
236 randomize_cdf(cdf[0], 3); in check_decode_hi_tok()
237 memcpy(cdf[1], cdf[0], sizeof(*cdf)); in check_decode_hi_tok()
239 unsigned c_res = call_ref(&s_c, cdf[0]); in check_decode_hi_tok()
240 unsigned a_res = call_new(&s_a, cdf[1]); in check_decode_hi_tok()
242 memcmp(cdf[0], cdf[1], sizeof(*cdf))) in check_decode_hi_tok()
245 msac_dump(c_res, a_res, &s_c, &s_a, cdf[0], cdf[1], 3); in check_decode_hi_tok()
250 bench_new(alternate(&s_c, &s_a), alternate(cdf[0], cdf[1])); in check_decode_hi_tok()