That's where it lives in aom/master.
Change-Id: I38f405827d9c2d0b06ef5f3bfd7cadc35d5991ef
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef AV1_COMMON_ANS_H_
-#define AV1_COMMON_ANS_H_
+#ifndef AOM_DSP_ANS_H_
+#define AOM_DSP_ANS_H_
// An implementation of Asymmetric Numeral Systems
// http://arxiv.org/abs/1311.2540v2
#define ANS_DIVIDE_BY_MULTIPLY 1
#if ANS_DIVIDE_BY_MULTIPLY
-#include "av1/common/divide.h"
+#include "aom_dsp/divide.h"
#define ANS_DIVREM(quotient, remainder, dividend, divisor) \
do { \
quotient = fastdiv(dividend, divisor); \
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
-#endif // AV1_COMMON_ANS_H_
+#endif // AOM_DSP_ANS_H_
# bit reader
DSP_SRCS-yes += prob.h
DSP_SRCS-yes += prob.c
+DSP_SRCS-$(CONFIG_ANS) += ans.h
ifeq ($(CONFIG_ENCODERS),yes)
DSP_SRCS-yes += bitwriter.h
DSP_SRCS-yes += dkboolwriter.c
DSP_SRCS-yes += bitwriter_buffer.c
DSP_SRCS-yes += bitwriter_buffer.h
+DSP_SRCS-$(CONFIG_ANS) += buf_ans.h
+DSP_SRCS-$(CONFIG_ANS) += buf_ans.c
+DSP_SRCS-$(CONFIG_ANS) += divide.h
+DSP_SRCS-$(CONFIG_ANS) += divide.c
DSP_SRCS-yes += psnr.c
DSP_SRCS-yes += psnr.h
DSP_SRCS-$(CONFIG_INTERNAL_STATS) += ssim.c
#include <string.h>
-#include "av1/common/common.h"
-#include "av1/encoder/buf_ans.h"
-#include "av1/encoder/encoder.h"
+#include "aom_dsp/buf_ans.h"
#include "aom_mem/aom_mem.h"
+#include "aom/internal/aom_codec_internal.h"
-void av1_buf_ans_alloc(struct BufAnsCoder *c, struct AV1Common *cm,
- int size_hint) {
- c->cm = cm;
+void aom_buf_ans_alloc(struct BufAnsCoder *c,
+ struct aom_internal_error_info *error, int size_hint) {
+ c->error = error;
c->size = size_hint;
- CHECK_MEM_ERROR(cm, c->buf, aom_malloc(c->size * sizeof(*c->buf)));
+ AOM_CHECK_MEM_ERROR(error, c->buf, aom_malloc(c->size * sizeof(*c->buf)));
// Initialize to overfull to trigger the assert in write.
c->offset = c->size + 1;
}
-void av1_buf_ans_free(struct BufAnsCoder *c) {
+void aom_buf_ans_free(struct BufAnsCoder *c) {
aom_free(c->buf);
c->buf = NULL;
c->size = 0;
}
-void av1_buf_ans_grow(struct BufAnsCoder *c) {
+void aom_buf_ans_grow(struct BufAnsCoder *c) {
struct buffered_ans_symbol *new_buf = NULL;
int new_size = c->size * 2;
- CHECK_MEM_ERROR(c->cm, new_buf, aom_malloc(new_size * sizeof(*new_buf)));
+ AOM_CHECK_MEM_ERROR(c->error, new_buf,
+ aom_malloc(new_size * sizeof(*new_buf)));
memcpy(new_buf, c->buf, c->size * sizeof(*c->buf));
aom_free(c->buf);
c->buf = new_buf;
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef AV1_ENCODER_BUF_ANS_H_
-#define AV1_ENCODER_BUF_ANS_H_
+#ifndef AOM_DSP_BUF_ANS_H_
+#define AOM_DSP_BUF_ANS_H_
// Buffered forward ANS writer.
// Symbols are written to the writer in forward (decode) order and serialzed
// backwards due to ANS's stack like behavior.
#include <assert.h>
#include "./aom_config.h"
#include "aom/aom_integer.h"
-#include "av1/common/ans.h"
+#include "aom_dsp/ans.h"
#ifdef __cplusplus
extern "C" {
};
struct BufAnsCoder {
- struct AV1Common *cm;
+ struct aom_internal_error_info *error;
struct buffered_ans_symbol *buf;
int size;
int offset;
};
-void av1_buf_ans_alloc(struct BufAnsCoder *c, struct AV1Common *cm,
- int size_hint);
+void aom_buf_ans_alloc(struct BufAnsCoder *c,
+ struct aom_internal_error_info *error, int size_hint);
-void av1_buf_ans_free(struct BufAnsCoder *c);
+void aom_buf_ans_free(struct BufAnsCoder *c);
-void av1_buf_ans_grow(struct BufAnsCoder *c);
+void aom_buf_ans_grow(struct BufAnsCoder *c);
static INLINE void buf_ans_write_reset(struct BufAnsCoder *const c) {
c->offset = 0;
AnsP8 prob) {
assert(c->offset <= c->size);
if (c->offset == c->size) {
- av1_buf_ans_grow(c);
+ aom_buf_ans_grow(c);
}
c->buf[c->offset].method = ANS_METHOD_UABS;
c->buf[c->offset].val_start = val;
const struct rans_sym *const sym) {
assert(c->offset <= c->size);
if (c->offset == c->size) {
- av1_buf_ans_grow(c);
+ aom_buf_ans_grow(c);
}
c->buf[c->offset].method = ANS_METHOD_RANS;
c->buf[c->offset].val_start = sym->cum_prob;
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
-#endif // AV1_ENCODER_BUF_ANS_H_
+#endif // AOM_DSP_BUF_ANS_H_
* be found in the AUTHORS file in the root of the source tree.
*/
-#include "av1/common/divide.h"
+#include "aom_dsp/divide.h"
/* Constants for divide by multiply for small divisors generated with:
void init_fastdiv() {
* be found in the AUTHORS file in the root of the source tree.
*/
-#ifndef AV1_COMMON_DIVIDE_H_
-#define AV1_COMMON_DIVIDE_H_
+#ifndef AOM_DSP_DIVIDE_H_
+#define AOM_DSP_DIVIDE_H_
// An implemntation of the divide by multiply alogrithm
// https://gmplib.org/~tege/divcnst-pldi94.pdf
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
-#endif // AV1_COMMON_DIVIDE_H_
+#endif // AOM_DSP_DIVIDE_H_
AV1_COMMON_SRCS-yes += av1_common.mk
AV1_COMMON_SRCS-yes += av1_iface_common.h
-AV1_COMMON_SRCS-yes += common/ans.h
AV1_COMMON_SRCS-yes += common/alloccommon.c
AV1_COMMON_SRCS-yes += common/blockd.c
AV1_COMMON_SRCS-yes += common/debugmodes.c
-AV1_COMMON_SRCS-yes += common/divide.h
AV1_COMMON_SRCS-yes += common/entropy.c
AV1_COMMON_SRCS-yes += common/entropymode.c
AV1_COMMON_SRCS-yes += common/entropymv.c
endif
AV1_COMMON_SRCS-yes += common/av1_convolve.c
AV1_COMMON_SRCS-yes += common/av1_convolve.h
-AV1_COMMON_SRCS-$(CONFIG_ANS) += common/ans.h
-AV1_COMMON_SRCS-$(CONFIG_ANS) += common/divide.h
-AV1_COMMON_SRCS-$(CONFIG_ANS) += common/divide.c
AV1_COMMON_SRCS-$(CONFIG_LOOP_RESTORATION) += common/restoration.h
AV1_COMMON_SRCS-$(CONFIG_LOOP_RESTORATION) += common/restoration.c
ifeq (yes,$(filter yes,$(CONFIG_GLOBAL_MOTION) $(CONFIG_WARPED_MOTION)))
AV1_CX_SRCS-yes += encoder/resize.c
AV1_CX_SRCS-yes += encoder/resize.h
AV1_CX_SRCS-$(CONFIG_INTERNAL_STATS) += encoder/blockiness.c
-AV1_CX_SRCS-$(CONFIG_ANS) += encoder/buf_ans.h
-AV1_CX_SRCS-$(CONFIG_ANS) += encoder/buf_ans.c
AV1_CX_SRCS-yes += encoder/tokenize.c
AV1_CX_SRCS-yes += encoder/treewriter.c
#include "aom_dsp/prob.h"
#if CONFIG_ANS
-#include "av1/common/ans.h"
+#include "aom_dsp/ans.h"
#endif // CONFIG_ANS
#include "av1/common/common.h"
#include "av1/common/enums.h"
#include "./aom_config.h"
#if CONFIG_ANS
-#include "av1/common/ans.h"
+#include "aom_dsp/ans.h"
#include "aom/aomdx.h" // for av1_decrypt_cb
#define aom_reader struct AnsDecoder
#define aom_reader_has_error ans_reader_has_error
#include "aom_mem/aom_mem.h"
#include "aom_ports/mem.h"
-#include "av1/common/ans.h"
+#if CONFIG_ANS
+#include "aom_dsp/ans.h"
+#endif // CONFIG_ANS
#include "av1/common/blockd.h"
#include "av1/common/common.h"
#include "av1/common/entropy.h"
#define AV1_DECODER_DETOKENIZE_H_
#include "av1/decoder/decoder.h"
-#include "av1/common/ans.h"
+#if CONFIG_ANS
+#include "aom_dsp/ans.h"
+#endif // CONFIG_ANS
#include "av1/common/scan.h"
#ifdef __cplusplus
#include "av1/common/tile_common.h"
#if CONFIG_ANS
-#include "av1/encoder/buf_ans.h"
+#include "aom_dsp/buf_ans.h"
#endif // CONFIG_ANS
#include "av1/encoder/bitstream.h"
#include "av1/encoder/cost.h"
#if CONFIG_ANS
typedef struct BufAnsCoder BufAnsCoder;
-#include "av1/encoder/buf_ans.h"
+#include "aom_dsp/buf_ans.h"
#define aom_writer BufAnsCoder
#define aom_write buf_uabs_write
#define aom_write_bit buf_uabs_write_bit
#include "av1/encoder/cost.h"
#if CONFIG_ANS
-#include "av1/common/ans.h"
+#include "aom_dsp/ans.h"
#endif // CONFIG_ANS
#include "av1/common/entropy.h"
#include "aom_dsp/prob.h"
#include "aom/aom_integer.h"
#if CONFIG_ANS
-#include "av1/common/ans.h"
+#include "aom_dsp/ans.h"
#endif // CONFIG_ANS
#ifdef __cplusplus
#include "av1/encoder/aq_variance.h"
#include "av1/encoder/bitstream.h"
#if CONFIG_ANS
-#include "av1/encoder/buf_ans.h"
+#include "aom_dsp/buf_ans.h"
#endif
#include "av1/encoder/context_tree.h"
#include "av1/encoder/encodeframe.h"
cpi->source_diff_var = NULL;
}
#if CONFIG_ANS
- av1_buf_ans_free(&cpi->buf_ans);
+ aom_buf_ans_free(&cpi->buf_ans);
#endif // CONFIG_ANS
}
CHECK_MEM_ERROR(cm, cpi->tile_tok[0][0],
aom_calloc(tokens, sizeof(*cpi->tile_tok[0][0])));
#if CONFIG_ANS
- av1_buf_ans_alloc(&cpi->buf_ans, cm, tokens);
+ aom_buf_ans_alloc(&cpi->buf_ans, &cm->error, tokens);
#endif // CONFIG_ANS
}
#include "av1/common/onyxc_int.h"
#include "av1/encoder/aq_cyclicrefresh.h"
#if CONFIG_ANS
-#include "av1/encoder/buf_ans.h"
+#include "aom_dsp/buf_ans.h"
#endif
#include "av1/encoder/context_tree.h"
#include "av1/encoder/encodemb.h"
#include <limits.h>
#if CONFIG_ANS
-#include "av1/common/ans.h"
+#include "aom_dsp/ans.h"
#endif // CONFIG_ANS
#include "av1/common/blockd.h"
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/acm_random.h"
-#include "av1/common/ans.h"
+#include "aom_dsp/ans.h"
#include "av1/encoder/treewriter.h"
#include "aom_dsp/bitreader.h"
#include "aom_dsp/bitwriter.h"