ans: Move buf_ans_flush to the .c file
It is called relatively rarely and doesn't need to be inlined.
Change-Id: I4ee7f95548f008f2ee29da807aaca54b9a25aecd
diff --git a/aom_dsp/buf_ans.h b/aom_dsp/buf_ans.h
index 0a1de1a..f670112 100644
--- a/aom_dsp/buf_ans.h
+++ b/aom_dsp/buf_ans.h
@@ -52,6 +52,8 @@
void aom_buf_ans_grow(struct BufAnsCoder *c);
+void aom_buf_ans_flush(struct BufAnsCoder *const c);
+
static INLINE void buf_ans_write_init(struct BufAnsCoder *const c,
uint8_t *const output_buffer) {
c->offset = 0;
@@ -83,23 +85,6 @@
++c->offset;
}
-static INLINE void buf_ans_flush(struct BufAnsCoder *const c) {
- int offset;
- for (offset = c->offset - 1; offset >= 0; --offset) {
- if (c->buf[offset].method == ANS_METHOD_RANS) {
- struct rans_sym sym;
- sym.prob = c->buf[offset].prob;
- sym.cum_prob = c->buf[offset].val_start;
- rans_write(&c->ans, &sym);
- } else {
- uabs_write(&c->ans, (uint8_t)c->buf[offset].val_start,
- (AnsP8)c->buf[offset].prob);
- }
- }
- c->offset = 0;
- c->output_bytes += ans_write_end(&c->ans);
-}
-
static INLINE void buf_uabs_write_bit(struct BufAnsCoder *c, int bit) {
buf_uabs_write(c, bit, 128);
}