Commit a653f20d authored by Nathan E. Egge's avatar Nathan E. Egge Committed by Nathan Egge
Browse files

Use aom_writer with od_encode_cdf_adapt_q15().

Change the od_encode_cdf_adapt_q15() function to take an aom_writer
 struct instead of an od_ec_enc struct.
Rename od_encode_cdf_adapt_q15() to aom_encode_cdf_adapt_q15().

Change-Id: I631af7be4b553fbb10a4c72e1958aa48a4c8245a
parent d6c2dc4f
......@@ -14,6 +14,7 @@
#if !defined(_generic_code_H)
# define _generic_code_H
# include "aom_dsp/bitwriter.h"
# include "aom_dsp/entdec.h"
# include "aom_dsp/entenc.h"
......@@ -56,7 +57,7 @@ void aom_cdf_init(uint16_t *cdf, int ncdfs, int nsyms, int val, int first);
void aom_cdf_adapt_q15(int val, uint16_t *cdf, int n, int *count, int rate);
void od_encode_cdf_adapt_q15(od_ec_enc *ec, int val, uint16_t *cdf, int n,
void aom_encode_cdf_adapt_q15(aom_writer *w, int val, uint16_t *cdf, int n,
int *count, int rate);
void od_encode_cdf_adapt(od_ec_enc *ec, int val, uint16_t *cdf, int n,
......
......@@ -17,6 +17,7 @@
#include <stdio.h>
#include "aom_dsp/bitwriter.h"
#include "aom_dsp/entdec.h"
#include "aom_dsp/entenc.h"
#include "av1/common/generic_code.h"
......@@ -26,14 +27,14 @@
/** Encodes a value from 0 to N-1 (with N up to 16) based on a cdf and adapts
* the cdf accordingly.
*
* @param [in,out] enc range encoder
* @param [in,out] w multi-symbol entropy encoder
* @param [in] val variable being encoded
* @param [in,out] cdf CDF of the variable (Q15)
* @param [in] n number of values possible
* @param [in,out] count number of symbols encoded with that cdf so far
* @param [in] rate adaptation rate shift (smaller is faster)
*/
void od_encode_cdf_adapt_q15(od_ec_enc *ec, int val, uint16_t *cdf, int n,
void aom_encode_cdf_adapt_q15(aom_writer *w, int val, uint16_t *cdf, int n,
int *count, int rate) {
int i;
if (*count == 0) {
......@@ -46,7 +47,7 @@ void od_encode_cdf_adapt_q15(od_ec_enc *ec, int val, uint16_t *cdf, int n,
cdf[i] = cdf[i]*32768/ft;
}
}
od_ec_encode_cdf_q15(ec, val, cdf, n);
aom_write_symbol(w, val, cdf, n);
aom_cdf_adapt_q15(val, cdf, n, count, rate);
}
......
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