Example #1
0
static domain_pool_t *
alloc_qac_domain_pool (unsigned max_domains, unsigned max_edges,
		       const wfa_t *wfa)
/*
 *  Domain pool with state images {0, ..., 'max_domains').
 *  Underlying probability model: quasi arithmetic coding of columns.
 */
{
   domain_pool_t *pool;
   unsigned	  state;
   
   pool                  = default_alloc ();
   pool->model           = qac_model_alloc (max_domains);
   pool->generate        = qac_generate;
   pool->bits            = qac_bits;
   pool->update          = qac_update;
   pool->append          = qac_append;
   pool->chroma		 = qac_chroma;
   pool->model_free      = qac_model_free;
   pool->model_duplicate = qac_model_duplicate;
   
   for (state = 0; state < wfa->basis_states; state++)
      if (usedomain (state, wfa))
	  qac_append (state, -1, wfa, pool->model);

   return pool;
}
Example #2
0
struct co_sched* co_sched_new(struct co_alloc* alloc)
{
    if (!alloc) {
        alloc = default_alloc();
    }
    struct co_sched* sched = (struct co_sched*)alloc->alloc(sizeof(struct co_sched));
    sched->alloc = alloc;
    memset(sched, 0, sizeof(struct co_sched));
}
Example #3
0
static domain_pool_t *
alloc_empty_domain_pool (unsigned max_domains, unsigned max_edges,
			 const wfa_t *wfa)
/*
 *  Domain pool with no state images available.
 */
{
   return default_alloc ();
}
Example #4
0
static coeff_t *
alloc_uniform_coeff_model (rpf_t *rpf, rpf_t *dc_rpf,
			   unsigned min_level, unsigned max_level)
/*
 *  Underlying probability model: uniform distribution.
 *  I.e. each coefficient is written as such with
 *  (1 + exponent_bits + mantissa_bits) bits.
 */
{
   coeff_t *coeff = default_alloc (rpf, dc_rpf, min_level, max_level);

   coeff->bits   = uniform_bits;
   coeff->update = uniform_update;
   
   return coeff;
}
Example #5
0
static coeff_t *
alloc_aac_coeff_model (rpf_t *rpf, rpf_t *dc_rpf,
		       unsigned min_level, unsigned max_level)
/*
 *  Underlying probability model: adaptive arithmetic coding using
 *  the level of a range as context.
 */
{
   coeff_t *coeff = default_alloc (rpf, dc_rpf, min_level, max_level);
   
   coeff->bits            = aac_bits;
   coeff->update          = aac_update;
   coeff->model_free      = aac_model_free;
   coeff->model_duplicate = aac_model_duplicate;
   coeff->model		  = aac_model_alloc (coeff);
   
   return coeff;
}