Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
aom-rav1e
Commits
1ac1ae73
Commit
1ac1ae73
authored
Sep 17, 2016
by
Alex Converse
Browse files
Move ANS to aom_dsp.
That's where it lives in aom/master. Change-Id: I38f405827d9c2d0b06ef5f3bfd7cadc35d5991ef
parent
eb00cb28
Changes
20
Hide whitespace changes
Inline
Side-by-side
a
v1/common
/ans.h
→
a
om_dsp
/ans.h
View file @
1ac1ae73
...
...
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef A
V1_COMMON
_ANS_H_
#define A
V1_COMMON
_ANS_H_
#ifndef A
OM_DSP
_ANS_H_
#define A
OM_DSP
_ANS_H_
// An implementation of Asymmetric Numeral Systems
// http://arxiv.org/abs/1311.2540v2
...
...
@@ -21,7 +21,7 @@
#define ANS_DIVIDE_BY_MULTIPLY 1
#if ANS_DIVIDE_BY_MULTIPLY
#include "a
v1/common
/divide.h"
#include "a
om_dsp
/divide.h"
#define ANS_DIVREM(quotient, remainder, dividend, divisor) \
do { \
quotient = fastdiv(dividend, divisor); \
...
...
@@ -411,4 +411,4 @@ static INLINE int ans_reader_has_error(const struct AnsDecoder *const ans) {
#ifdef __cplusplus
}
// extern "C"
#endif // __cplusplus
#endif // A
V1_COMMON
_ANS_H_
#endif // A
OM_DSP
_ANS_H_
aom_dsp/aom_dsp.mk
View file @
1ac1ae73
...
...
@@ -19,6 +19,7 @@ DSP_SRCS-$(ARCH_X86)$(ARCH_X86_64) += x86/synonyms.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
...
...
@@ -26,6 +27,10 @@ DSP_SRCS-yes += dkboolwriter.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
...
...
a
v1/encoder
/buf_ans.c
→
a
om_dsp
/buf_ans.c
View file @
1ac1ae73
...
...
@@ -10,30 +10,30 @@
#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
a
v1
_buf_ans_alloc
(
struct
BufAnsCoder
*
c
,
struct
AV1Common
*
cm
,
int
size_hint
)
{
c
->
cm
=
cm
;
void
a
om
_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
a
v1
_buf_ans_free
(
struct
BufAnsCoder
*
c
)
{
void
a
om
_buf_ans_free
(
struct
BufAnsCoder
*
c
)
{
aom_free
(
c
->
buf
);
c
->
buf
=
NULL
;
c
->
size
=
0
;
}
void
a
v1
_buf_ans_grow
(
struct
BufAnsCoder
*
c
)
{
void
a
om
_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
;
...
...
a
v1/encoder
/buf_ans.h
→
a
om_dsp
/buf_ans.h
View file @
1ac1ae73
...
...
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef A
V1_ENCODER
_BUF_ANS_H_
#define A
V1_ENCODER
_BUF_ANS_H_
#ifndef A
OM_DSP
_BUF_ANS_H_
#define A
OM_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.
...
...
@@ -17,7 +17,7 @@
#include <assert.h>
#include "./aom_config.h"
#include "aom/aom_integer.h"
#include "a
v1/common
/ans.h"
#include "a
om_dsp
/ans.h"
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -34,18 +34,18 @@ struct buffered_ans_symbol {
};
struct
BufAnsCoder
{
struct
AV1Common
*
cm
;
struct
aom_internal_error_info
*
error
;
struct
buffered_ans_symbol
*
buf
;
int
size
;
int
offset
;
};
void
a
v1
_buf_ans_alloc
(
struct
BufAnsCoder
*
c
,
struct
AV1Common
*
cm
,
int
size_hint
);
void
a
om
_buf_ans_alloc
(
struct
BufAnsCoder
*
c
,
struct
aom_internal_error_info
*
error
,
int
size_hint
);
void
a
v1
_buf_ans_free
(
struct
BufAnsCoder
*
c
);
void
a
om
_buf_ans_free
(
struct
BufAnsCoder
*
c
);
void
a
v1
_buf_ans_grow
(
struct
BufAnsCoder
*
c
);
void
a
om
_buf_ans_grow
(
struct
BufAnsCoder
*
c
);
static
INLINE
void
buf_ans_write_reset
(
struct
BufAnsCoder
*
const
c
)
{
c
->
offset
=
0
;
...
...
@@ -55,7 +55,7 @@ static INLINE void buf_uabs_write(struct BufAnsCoder *const c, uint8_t val,
AnsP8
prob
)
{
assert
(
c
->
offset
<=
c
->
size
);
if
(
c
->
offset
==
c
->
size
)
{
a
v1
_buf_ans_grow
(
c
);
a
om
_buf_ans_grow
(
c
);
}
c
->
buf
[
c
->
offset
].
method
=
ANS_METHOD_UABS
;
c
->
buf
[
c
->
offset
].
val_start
=
val
;
...
...
@@ -67,7 +67,7 @@ static INLINE void buf_rans_write(struct BufAnsCoder *const c,
const
struct
rans_sym
*
const
sym
)
{
assert
(
c
->
offset
<=
c
->
size
);
if
(
c
->
offset
==
c
->
size
)
{
a
v1
_buf_ans_grow
(
c
);
a
om
_buf_ans_grow
(
c
);
}
c
->
buf
[
c
->
offset
].
method
=
ANS_METHOD_RANS
;
c
->
buf
[
c
->
offset
].
val_start
=
sym
->
cum_prob
;
...
...
@@ -106,4 +106,4 @@ static INLINE void buf_uabs_write_literal(struct BufAnsCoder *c, int literal,
#ifdef __cplusplus
}
// extern "C"
#endif // __cplusplus
#endif // A
V1_ENCODER
_BUF_ANS_H_
#endif // A
OM_DSP
_BUF_ANS_H_
a
v1/common
/divide.c
→
a
om_dsp
/divide.c
View file @
1ac1ae73
...
...
@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#include "a
v1/common
/divide.h"
#include "a
om_dsp
/divide.h"
/* Constants for divide by multiply for small divisors generated with:
void init_fastdiv() {
...
...
a
v1/common
/divide.h
→
a
om_dsp
/divide.h
View file @
1ac1ae73
...
...
@@ -8,8 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef A
V1_COMMON
_DIVIDE_H_
#define A
V1_COMMON
_DIVIDE_H_
#ifndef A
OM_DSP
_DIVIDE_H_
#define A
OM_DSP
_DIVIDE_H_
// An implemntation of the divide by multiply alogrithm
// https://gmplib.org/~tege/divcnst-pldi94.pdf
...
...
@@ -37,4 +37,4 @@ static INLINE unsigned fastdiv(unsigned x, int y) {
#ifdef __cplusplus
}
// extern "C"
#endif // __cplusplus
#endif // A
V1_COMMON
_DIVIDE_H_
#endif // A
OM_DSP
_DIVIDE_H_
av1/av1_common.mk
View file @
1ac1ae73
...
...
@@ -11,11 +11,9 @@
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
...
...
@@ -82,9 +80,6 @@ AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/av1_highbd_convolve_filters_sse4.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/av1_cx.mk
View file @
1ac1ae73
...
...
@@ -86,8 +86,6 @@ AV1_CX_SRCS-yes += encoder/subexp.h
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
...
...
av1/common/entropy.h
View file @
1ac1ae73
...
...
@@ -16,7 +16,7 @@
#include "aom_dsp/prob.h"
#if CONFIG_ANS
#include "a
v1/common
/ans.h"
#include "a
om_dsp
/ans.h"
#endif // CONFIG_ANS
#include "av1/common/common.h"
#include "av1/common/enums.h"
...
...
av1/decoder/bitreader.h
View file @
1ac1ae73
...
...
@@ -17,7 +17,7 @@
#include "./aom_config.h"
#if CONFIG_ANS
#include "a
v1/common
/ans.h"
#include "a
om_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
...
...
av1/decoder/detokenize.c
View file @
1ac1ae73
...
...
@@ -12,7 +12,9 @@
#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"
...
...
av1/decoder/detokenize.h
View file @
1ac1ae73
...
...
@@ -13,7 +13,9 @@
#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
...
...
av1/encoder/bitstream.c
View file @
1ac1ae73
...
...
@@ -37,7 +37,7 @@
#include "av1/common/tile_common.h"
#if CONFIG_ANS
#include "a
v1/encoder
/buf_ans.h"
#include "a
om_dsp
/buf_ans.h"
#endif // CONFIG_ANS
#include "av1/encoder/bitstream.h"
#include "av1/encoder/cost.h"
...
...
av1/encoder/bitwriter.h
View file @
1ac1ae73
...
...
@@ -23,7 +23,7 @@
#if CONFIG_ANS
typedef
struct
BufAnsCoder
BufAnsCoder
;
#include "a
v1/encoder
/buf_ans.h"
#include "a
om_dsp
/buf_ans.h"
#define aom_writer BufAnsCoder
#define aom_write buf_uabs_write
#define aom_write_bit buf_uabs_write_bit
...
...
av1/encoder/cost.c
View file @
1ac1ae73
...
...
@@ -12,7 +12,7 @@
#include "av1/encoder/cost.h"
#if CONFIG_ANS
#include "a
v1/common
/ans.h"
#include "a
om_dsp
/ans.h"
#endif // CONFIG_ANS
#include "av1/common/entropy.h"
...
...
av1/encoder/cost.h
View file @
1ac1ae73
...
...
@@ -14,7 +14,7 @@
#include "aom_dsp/prob.h"
#include "aom/aom_integer.h"
#if CONFIG_ANS
#include "a
v1/common
/ans.h"
#include "a
om_dsp
/ans.h"
#endif // CONFIG_ANS
#ifdef __cplusplus
...
...
av1/encoder/encoder.c
View file @
1ac1ae73
...
...
@@ -32,7 +32,7 @@
#include "av1/encoder/aq_variance.h"
#include "av1/encoder/bitstream.h"
#if CONFIG_ANS
#include "a
v1/encoder
/buf_ans.h"
#include "a
om_dsp
/buf_ans.h"
#endif
#include "av1/encoder/context_tree.h"
#include "av1/encoder/encodeframe.h"
...
...
@@ -485,7 +485,7 @@ static void dealloc_compressor_data(AV1_COMP *cpi) {
cpi
->
source_diff_var
=
NULL
;
}
#if CONFIG_ANS
a
v1
_buf_ans_free
(
&
cpi
->
buf_ans
);
a
om
_buf_ans_free
(
&
cpi
->
buf_ans
);
#endif // CONFIG_ANS
}
...
...
@@ -811,7 +811,7 @@ void av1_alloc_compressor_data(AV1_COMP *cpi) {
CHECK_MEM_ERROR
(
cm
,
cpi
->
tile_tok
[
0
][
0
],
aom_calloc
(
tokens
,
sizeof
(
*
cpi
->
tile_tok
[
0
][
0
])));
#if CONFIG_ANS
a
v1
_buf_ans_alloc
(
&
cpi
->
buf_ans
,
cm
,
tokens
);
a
om
_buf_ans_alloc
(
&
cpi
->
buf_ans
,
&
cm
->
error
,
tokens
);
#endif // CONFIG_ANS
}
...
...
av1/encoder/encoder.h
View file @
1ac1ae73
...
...
@@ -22,7 +22,7 @@
#include "av1/common/onyxc_int.h"
#include "av1/encoder/aq_cyclicrefresh.h"
#if CONFIG_ANS
#include "a
v1/encoder
/buf_ans.h"
#include "a
om_dsp
/buf_ans.h"
#endif
#include "av1/encoder/context_tree.h"
#include "av1/encoder/encodemb.h"
...
...
av1/encoder/rd.h
View file @
1ac1ae73
...
...
@@ -15,7 +15,7 @@
#include <limits.h>
#if CONFIG_ANS
#include "a
v1/common
/ans.h"
#include "a
om_dsp
/ans.h"
#endif // CONFIG_ANS
#include "av1/common/blockd.h"
...
...
test/av1_ans_test.cc
View file @
1ac1ae73
...
...
@@ -20,7 +20,7 @@
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/acm_random.h"
#include "a
v1/common
/ans.h"
#include "a
om_dsp
/ans.h"
#include "av1/encoder/treewriter.h"
#include "aom_dsp/bitreader.h"
#include "aom_dsp/bitwriter.h"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment