Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
aom-rav1e
Commits
d0b77ac7
Commit
d0b77ac7
authored
Oct 20, 2017
by
Yushin Cho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove PVQ code
Change-Id: Id377c68e30031ad4697ca1ba311487b803a8af4c
parent
ab68ddb3
Changes
67
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
67 changed files
with
64 additions
and
7071 deletions
+64
-7071
aom_dsp/aom_dsp.mk
aom_dsp/aom_dsp.mk
+1
-1
aom_dsp/aom_dsp_rtcd_defs.pl
aom_dsp/aom_dsp_rtcd_defs.pl
+1
-1
av1/av1.cmake
av1/av1.cmake
+0
-59
av1/av1_common.mk
av1/av1_common.mk
+0
-22
av1/av1_cx.mk
av1/av1_cx.mk
+0
-11
av1/av1_cx_iface.c
av1/av1_cx_iface.c
+0
-8
av1/av1_dx.mk
av1/av1_dx.mk
+0
-20
av1/common/av1_rtcd_defs.pl
av1/common/av1_rtcd_defs.pl
+0
-39
av1/common/blockd.c
av1/common/blockd.c
+0
-3
av1/common/blockd.h
av1/common/blockd.h
+2
-39
av1/common/entropy.c
av1/common/entropy.c
+0
-64
av1/common/entropy.h
av1/common/entropy.h
+0
-5
av1/common/entropymode.c
av1/common/entropymode.c
+0
-3
av1/common/entropymode.h
av1/common/entropymode.h
+0
-11
av1/common/generic_code.c
av1/common/generic_code.c
+0
-112
av1/common/generic_code.h
av1/common/generic_code.h
+0
-81
av1/common/idct.c
av1/common/idct.c
+1
-13
av1/common/laplace_tables.c
av1/common/laplace_tables.c
+0
-657
av1/common/odintrin.h
av1/common/odintrin.h
+0
-55
av1/common/onyxc_int.h
av1/common/onyxc_int.h
+0
-9
av1/common/partition.c
av1/common/partition.c
+0
-256
av1/common/partition.h
av1/common/partition.h
+0
-40
av1/common/pvq.c
av1/common/pvq.c
+0
-1007
av1/common/pvq.h
av1/common/pvq.h
+0
-179
av1/common/pvq_state.c
av1/common/pvq_state.c
+0
-50
av1/common/pvq_state.h
av1/common/pvq_state.h
+0
-52
av1/common/quant_common.c
av1/common/quant_common.c
+0
-59
av1/common/quant_common.h
av1/common/quant_common.h
+0
-5
av1/common/x86/pvq_sse4.c
av1/common/x86/pvq_sse4.c
+0
-252
av1/common/x86/pvq_sse4.h
av1/common/x86/pvq_sse4.h
+0
-13
av1/common/zigzag.h
av1/common/zigzag.h
+0
-33
av1/common/zigzag16.c
av1/common/zigzag16.c
+0
-157
av1/common/zigzag32.c
av1/common/zigzag32.c
+0
-199
av1/common/zigzag4.c
av1/common/zigzag4.c
+0
-22
av1/common/zigzag8.c
av1/common/zigzag8.c
+0
-50
av1/decoder/decint.h
av1/decoder/decint.h
+0
-35
av1/decoder/decodeframe.c
av1/decoder/decodeframe.c
+1
-275
av1/decoder/decoder.c
av1/decoder/decoder.c
+0
-2
av1/decoder/decoder.h
av1/decoder/decoder.h
+0
-14
av1/decoder/detokenize.c
av1/decoder/detokenize.c
+0
-10
av1/decoder/detokenize.h
av1/decoder/detokenize.h
+1
-4
av1/decoder/generic_decoder.c
av1/decoder/generic_decoder.c
+0
-110
av1/decoder/laplace_decoder.c
av1/decoder/laplace_decoder.c
+0
-121
av1/decoder/pvq_decoder.c
av1/decoder/pvq_decoder.c
+0
-378
av1/decoder/pvq_decoder.h
av1/decoder/pvq_decoder.h
+0
-40
av1/encoder/bitstream.c
av1/encoder/bitstream.c
+11
-180
av1/encoder/block.h
av1/encoder/block.h
+0
-31
av1/encoder/context_tree.c
av1/encoder/context_tree.c
+0
-9
av1/encoder/context_tree.h
av1/encoder/context_tree.h
+0
-3
av1/encoder/daala_compat_enc.c
av1/encoder/daala_compat_enc.c
+0
-30
av1/encoder/encint.h
av1/encoder/encint.h
+0
-51
av1/encoder/encodeframe.c
av1/encoder/encodeframe.c
+11
-227
av1/encoder/encodemb.c
av1/encoder/encodemb.c
+16
-313
av1/encoder/encodemb.h
av1/encoder/encodemb.h
+0
-15
av1/encoder/encoder.c
av1/encoder/encoder.c
+0
-20
av1/encoder/encoder.h
av1/encoder/encoder.h
+0
-3
av1/encoder/firstpass.c
av1/encoder/firstpass.c
+0
-55
av1/encoder/generic_encoder.c
av1/encoder/generic_encoder.c
+0
-157
av1/encoder/laplace_encoder.c
av1/encoder/laplace_encoder.c
+0
-107
av1/encoder/pvq_encoder.c
av1/encoder/pvq_encoder.c
+0
-988
av1/encoder/pvq_encoder.h
av1/encoder/pvq_encoder.h
+0
-53
av1/encoder/rdopt.c
av1/encoder/rdopt.c
+15
-168
av1/encoder/rdopt.h
av1/encoder/rdopt.h
+1
-2
av1/encoder/tokenize.c
av1/encoder/tokenize.c
+3
-56
build/cmake/aom_config_defaults.cmake
build/cmake/aom_config_defaults.cmake
+0
-1
build/cmake/aom_experiment_deps.cmake
build/cmake/aom_experiment_deps.cmake
+0
-18
configure
configure
+0
-8
No files found.
aom_dsp/aom_dsp.mk
View file @
d0b77ac7
...
...
@@ -219,7 +219,7 @@ DSP_SRCS-$(HAVE_SSSE3) += x86/obmc_intrinsic_ssse3.h
DSP_SRCS-$(HAVE_MSA)
+=
mips/txfm_macros_msa.h
# forward transform
ifneq
($(findstring yes,$(CONFIG_AV1)
$(CONFIG_PVQ)
),)
ifneq
($(findstring yes,$(CONFIG_AV1)),)
DSP_SRCS-$(HAVE_AVX2)
+=
x86/txfm_common_avx2.h
ifeq
($(CONFIG_AV1_ENCODER),yes)
DSP_SRCS-yes
+=
fwd_txfm.c
...
...
aom_dsp/aom_dsp_rtcd_defs.pl
View file @
d0b77ac7
...
...
@@ -550,7 +550,7 @@ if (aom_config("CONFIG_HIGHBITDEPTH") eq "yes") {
#
# Forward transform
#
if
(
(
aom_config
("
CONFIG_AV1_ENCODER
")
eq
"
yes
")
||
(
aom_config
("
CONFIG_PVQ
")
eq
"
yes
"))
{
if
(
aom_config
("
CONFIG_AV1_ENCODER
")
eq
"
yes
"){
if
(
aom_config
("
CONFIG_HIGHBITDEPTH
")
eq
"
yes
")
{
add_proto
qw/void aom_fdct4x4/
,
"
const int16_t *input, tran_low_t *output, int stride
";
specialize
qw/aom_fdct4x4 sse2/
;
...
...
av1/av1.cmake
View file @
d0b77ac7
...
...
@@ -420,65 +420,6 @@ if (CONFIG_NCOBMC_ADAPT_WEIGHT)
"
${
AOM_ROOT
}
/av1/common/ncobmc_kernels.h"
)
endif
()
if
(
CONFIG_PVQ
)
set
(
AOM_AV1_COMMON_SOURCES
${
AOM_AV1_COMMON_SOURCES
}
"
${
AOM_ROOT
}
/av1/common/laplace_tables.c"
"
${
AOM_ROOT
}
/av1/common/pvq.c"
"
${
AOM_ROOT
}
/av1/common/pvq.h"
"
${
AOM_ROOT
}
/av1/common/pvq_state.c"
"
${
AOM_ROOT
}
/av1/common/pvq_state.h"
"
${
AOM_ROOT
}
/av1/common/partition.c"
"
${
AOM_ROOT
}
/av1/common/partition.h"
"
${
AOM_ROOT
}
/av1/common/generic_code.c"
"
${
AOM_ROOT
}
/av1/common/generic_code.h"
"
${
AOM_ROOT
}
/av1/common/zigzag4.c"
"
${
AOM_ROOT
}
/av1/common/zigzag8.c"
"
${
AOM_ROOT
}
/av1/common/zigzag16.c"
"
${
AOM_ROOT
}
/av1/common/zigzag32.c"
)
set
(
AOM_AV1_DECODER_SOURCES
${
AOM_AV1_DECODER_SOURCES
}
"
${
AOM_ROOT
}
/av1/decoder/decint.h"
"
${
AOM_ROOT
}
/av1/decoder/pvq_decoder.c"
"
${
AOM_ROOT
}
/av1/decoder/pvq_decoder.h"
"
${
AOM_ROOT
}
/av1/decoder/generic_decoder.c"
"
${
AOM_ROOT
}
/av1/decoder/laplace_decoder.c"
)
set
(
AOM_AV1_ENCODER_SOURCES
${
AOM_AV1_ENCODER_SOURCES
}
"
${
AOM_ROOT
}
/av1/encoder/daala_compat_enc.c"
"
${
AOM_ROOT
}
/av1/encoder/encint.h"
"
${
AOM_ROOT
}
/av1/encoder/pvq_encoder.c"
"
${
AOM_ROOT
}
/av1/encoder/pvq_encoder.h"
"
${
AOM_ROOT
}
/av1/encoder/generic_encoder.c"
"
${
AOM_ROOT
}
/av1/encoder/laplace_encoder.c"
)
set
(
AOM_AV1_COMMON_INTRIN_SSE4_1
${
AOM_AV1_COMMON_INTRIN_SSE4_1
}
"
${
AOM_ROOT
}
/av1/common/x86/pvq_sse4.c"
"
${
AOM_ROOT
}
/av1/common/x86/pvq_sse4.h"
)
if
(
NOT CONFIG_AV1_ENCODER
)
# TODO(tomfinegan): These should probably be in av1/common, and in a
# common source list. For now this mirrors the original build system.
set
(
AOM_AV1_DECODER_SOURCES
${
AOM_AV1_DECODER_SOURCES
}
"
${
AOM_ROOT
}
/av1/encoder/dct.c"
"
${
AOM_ROOT
}
/av1/encoder/hybrid_fwd_txfm.c"
"
${
AOM_ROOT
}
/av1/encoder/hybrid_fwd_txfm.h"
)
set
(
AOM_AV1_DECODER_ASM_SSE2
${
AOM_AV1_DECODER_ASM_SSE2
}
"
${
AOM_ROOT
}
/av1/encoder/x86/dct_sse2.asm"
)
set
(
AOM_AV1_DECODER_INTRIN_SSE2
${
AOM_AV1_DECODER_INTRIN_SSE2
}
"
${
AOM_ROOT
}
/av1/encoder/x86/dct_intrin_sse2.c"
)
endif
()
endif
()
if
(
CONFIG_WARPED_MOTION OR CONFIG_GLOBAL_MOTION
)
set
(
AOM_AV1_COMMON_SOURCES
${
AOM_AV1_COMMON_SOURCES
}
...
...
av1/av1_common.mk
View file @
d0b77ac7
...
...
@@ -128,28 +128,6 @@ ifeq ($(CONFIG_MOTION_VAR),yes)
AV1_COMMON_SRCS-yes
+=
common/obmc.h
endif
ifeq
($(CONFIG_PVQ),yes)
# PVQ from daala
AV1_COMMON_SRCS-yes
+=
common/pvq.c
AV1_COMMON_SRCS-yes
+=
common/partition.c
AV1_COMMON_SRCS-yes
+=
common/partition.h
AV1_COMMON_SRCS-yes
+=
common/zigzag4.c
AV1_COMMON_SRCS-yes
+=
common/zigzag8.c
AV1_COMMON_SRCS-yes
+=
common/zigzag16.c
AV1_COMMON_SRCS-yes
+=
common/zigzag32.c
AV1_COMMON_SRCS-yes
+=
common/zigzag.h
AV1_COMMON_SRCS-yes
+=
common/generic_code.c
AV1_COMMON_SRCS-yes
+=
common/pvq_state.c
AV1_COMMON_SRCS-yes
+=
common/laplace_tables.c
AV1_COMMON_SRCS-$(HAVE_SSE4_1)
+=
common/x86/pvq_sse4.c
AV1_COMMON_SRCS-$(HAVE_SSE4_1)
+=
common/x86/pvq_sse4.h
endif
ifneq
($(findstring yes,$(CONFIG_PVQ)$(CONFIG_DAALA_DIST)$(CONFIG_XIPHRC)),)
AV1_COMMON_SRCS-yes
+=
common/pvq.h
AV1_COMMON_SRCS-yes
+=
common/pvq_state.h
AV1_COMMON_SRCS-yes
+=
common/generic_code.h
endif
# common (msa)
AV1_COMMON_SRCS-$(HAVE_MSA)
+=
common/mips/msa/av1_idct4x4_msa.c
AV1_COMMON_SRCS-$(HAVE_MSA)
+=
common/mips/msa/av1_idct8x8_msa.c
...
...
av1/av1_cx.mk
View file @
d0b77ac7
...
...
@@ -118,17 +118,6 @@ endif
ifeq
($(CONFIG_CDEF),yes)
AV1_CX_SRCS-yes
+=
encoder/pickcdef.c
endif
ifeq
($(CONFIG_PVQ),yes)
# PVQ from daala
AV1_CX_SRCS-yes
+=
encoder/daala_compat_enc.c
AV1_CX_SRCS-yes
+=
encoder/pvq_encoder.c
AV1_CX_SRCS-yes
+=
encoder/pvq_encoder.h
AV1_CX_SRCS-yes
+=
encoder/generic_encoder.c
AV1_CX_SRCS-yes
+=
encoder/laplace_encoder.c
endif
ifneq
($(findstring yes,$(CONFIG_XIPHRC)$(CONFIG_PVQ)),)
AV1_CX_SRCS-yes
+=
encoder/encint.h
endif
AV1_CX_SRCS-$(HAVE_SSE2)
+=
encoder/x86/av1_quantize_sse2.c
AV1_CX_SRCS-$(HAVE_AVX2)
+=
encoder/x86/av1_quantize_avx2.c
...
...
av1/av1_cx_iface.c
View file @
d0b77ac7
...
...
@@ -328,14 +328,6 @@ static aom_codec_err_t validate_config(aom_codec_alg_priv_t *ctx,
if
(
extra_cfg
->
tuning
==
AOM_TUNE_SSIM
)
ERROR
(
"Option --tune=ssim is not currently supported in AV1."
);
// TODO(anybody) : remove this flag when PVQ supports pallete coding tool
#if CONFIG_PVQ
if
(
extra_cfg
->
content
==
AOM_CONTENT_SCREEN
)
ERROR
(
"Option --tune-content=screen is not currently supported when PVQ is "
"enabled."
);
#endif // CONFIG_PVQ
if
(
cfg
->
g_pass
==
AOM_RC_LAST_PASS
)
{
#if !CONFIG_XIPHRC
const
size_t
packet_sz
=
sizeof
(
FIRSTPASS_STATS
);
...
...
av1/av1_dx.mk
View file @
d0b77ac7
...
...
@@ -44,24 +44,4 @@ AV1_DX_SRCS-yes += decoder/inspection.c
AV1_DX_SRCS-yes
+=
decoder/inspection.h
endif
ifeq
($(CONFIG_PVQ),yes)
# PVQ from daala
AV1_DX_SRCS-yes
+=
decoder/pvq_decoder.c
AV1_DX_SRCS-yes
+=
decoder/pvq_decoder.h
AV1_DX_SRCS-yes
+=
decoder/decint.h
AV1_DX_SRCS-yes
+=
decoder/generic_decoder.c
AV1_DX_SRCS-yes
+=
decoder/laplace_decoder.c
AV1_DX_SRCS-yes
+=
encoder/hybrid_fwd_txfm.c
AV1_DX_SRCS-yes
+=
encoder/hybrid_fwd_txfm.h
AV1_DX_SRCS-yes
+=
encoder/dct.c
AV1_DX_SRCS-$(HAVE_SSE2)
+=
encoder/x86/dct_sse2.asm
AV1_DX_SRCS-$(HAVE_SSE2)
+=
encoder/x86/dct_intrin_sse2.c
AV1_DX_SRCS-$(HAVE_MSA)
+=
encoder/mips/msa/fdct4x4_msa.c
AV1_DX_SRCS-$(HAVE_MSA)
+=
encoder/mips/msa/fdct8x8_msa.c
AV1_DX_SRCS-$(HAVE_MSA)
+=
encoder/mips/msa/fdct16x16_msa.c
AV1_DX_SRCS-$(HAVE_MSA)
+=
encoder/mips/msa/fdct_msa.h
endif
AV1_DX_SRCS-yes
:=
$(
filter-out
$
(
AV1_DX_SRCS_REMOVE-yes
)
,
$
(
AV1_DX_SRCS-yes
))
av1/common/av1_rtcd_defs.pl
View file @
d0b77ac7
...
...
@@ -503,38 +503,6 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
}
# end encoder functions
# If PVQ is enabled, fwd transforms are required by decoder
if
(
aom_config
("
CONFIG_PVQ
")
eq
"
yes
")
{
# fdct functions
if
(
aom_config
("
CONFIG_HIGHBITDEPTH
")
eq
"
yes
")
{
add_proto
qw/void av1_fht4x4/
,
"
const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param
";
specialize
qw/av1_fht4x4 sse2/
;
add_proto
qw/void av1_fht8x8/
,
"
const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param
";
specialize
qw/av1_fht8x8 sse2/
;
add_proto
qw/void av1_fht16x16/
,
"
const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param
";
specialize
qw/av1_fht16x16 sse2/
;
add_proto
qw/void av1_fwht4x4/
,
"
const int16_t *input, tran_low_t *output, int stride
";
specialize
qw/av1_fwht4x4 sse2/
;
}
else
{
add_proto
qw/void av1_fht4x4/
,
"
const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param
";
specialize
qw/av1_fht4x4 sse2 msa/
;
add_proto
qw/void av1_fht8x8/
,
"
const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param
";
specialize
qw/av1_fht8x8 sse2 msa/
;
add_proto
qw/void av1_fht16x16/
,
"
const int16_t *input, tran_low_t *output, int stride, struct txfm_param *param
";
specialize
qw/av1_fht16x16 sse2 msa/
;
add_proto
qw/void av1_fwht4x4/
,
"
const int16_t *input, tran_low_t *output, int stride
";
specialize
qw/av1_fwht4x4 msa sse2/
;
}
}
# Deringing Functions
if
(
aom_config
("
CONFIG_CDEF
")
eq
"
yes
")
{
...
...
@@ -586,13 +554,6 @@ if (aom_config("CONFIG_CDEF") eq "yes") {
}
}
# PVQ Functions
if
(
aom_config
("
CONFIG_PVQ
")
eq
"
yes
")
{
add_proto
qw/double pvq_search_rdo_double/
,
"
const od_val16 *xcoeff, int n, int k, int *ypulse, double g2, double pvq_norm_lambda, int prev_k
";
specialize
qw/pvq_search_rdo_double sse4_1/
;
}
# WARPED_MOTION / GLOBAL_MOTION functions
if
((
aom_config
("
CONFIG_WARPED_MOTION
")
eq
"
yes
")
||
...
...
av1/common/blockd.c
View file @
d0b77ac7
...
...
@@ -187,7 +187,6 @@ void av1_foreach_transformed_block(const MACROBLOCKD *const xd,
}
#endif
#if !CONFIG_PVQ || CONFIG_VAR_TX
void
av1_set_contexts
(
const
MACROBLOCKD
*
xd
,
struct
macroblockd_plane
*
pd
,
int
plane
,
TX_SIZE
tx_size
,
int
has_eob
,
int
aoff
,
int
loff
)
{
...
...
@@ -225,8 +224,6 @@ void av1_set_contexts(const MACROBLOCKD *xd, struct macroblockd_plane *pd,
memset
(
l
,
has_eob
,
sizeof
(
ENTROPY_CONTEXT
)
*
txs_high
);
}
}
#endif
void
av1_reset_skip_context
(
MACROBLOCKD
*
xd
,
int
mi_row
,
int
mi_col
,
BLOCK_SIZE
bsize
)
{
int
i
;
...
...
av1/common/blockd.h
View file @
d0b77ac7
...
...
@@ -26,11 +26,7 @@
#include "av1/common/scale.h"
#include "av1/common/seg_common.h"
#include "av1/common/tile_common.h"
#if CONFIG_PVQ
#include "av1/common/pvq.h"
#include "av1/common/pvq_state.h"
#include "av1/decoder/decint.h"
#endif
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -87,32 +83,6 @@ static INLINE int is_inter_mode(PREDICTION_MODE mode) {
return
mode
>=
NEARESTMV
&&
mode
<=
NEW_NEWMV
;
}
#if CONFIG_PVQ
typedef
struct
PVQ_INFO
{
int
theta
[
PVQ_MAX_PARTITIONS
];
int
qg
[
PVQ_MAX_PARTITIONS
];
int
k
[
PVQ_MAX_PARTITIONS
];
od_coeff
y
[
OD_TXSIZE_MAX
*
OD_TXSIZE_MAX
];
int
nb_bands
;
int
off
[
PVQ_MAX_PARTITIONS
];
int
size
[
PVQ_MAX_PARTITIONS
];
int
skip_rest
;
int
skip_dir
;
int
bs
;
// log of the block size minus two,
// i.e. equivalent to aom's TX_SIZE
// Block skip info, indicating whether DC/AC, is coded.
PVQ_SKIP_TYPE
ac_dc_coded
;
// bit0: DC coded, bit1 : AC coded (1 means coded)
tran_low_t
dq_dc_residue
;
}
PVQ_INFO
;
typedef
struct
PVQ_QUEUE
{
PVQ_INFO
*
buf
;
// buffer for pvq info, stored in encoding order
int
curr_pos
;
// curr position to write PVQ_INFO
int
buf_len
;
// allocated buffer length
int
last_pos
;
// last written position of PVQ_INFO in a tile
}
PVQ_QUEUE
;
#endif
#if CONFIG_NCOBMC_ADAPT_WEIGHT
typedef
struct
superblock_mi_boundaries
{
int
mi_row_begin
;
...
...
@@ -613,13 +583,9 @@ typedef struct macroblockd_plane {
const
dequant_val_type_nuq
*
dequant_val_nuq
[
QUANT_PROFILES
];
#endif // CONFIG_NEW_QUANT
#if
CONFIG_PVQ ||
CONFIG_DIST_8X8
#if CONFIG_DIST_8X8
DECLARE_ALIGNED
(
16
,
int16_t
,
pred
[
MAX_SB_SQUARE
]);
#endif
#if CONFIG_PVQ
// PVQ: forward transformed predicted image, a reference for PVQ.
tran_low_t
*
pvq_ref_coeff
;
#endif
}
MACROBLOCKD_PLANE
;
#define BLOCK_OFFSET(x, i) \
...
...
@@ -761,9 +727,6 @@ typedef struct macroblockd {
CANDIDATE_MV
ref_mv_stack
[
MODE_CTX_REF_FRAMES
][
MAX_REF_MV_STACK_SIZE
];
uint8_t
is_sec_rect
;
#if CONFIG_PVQ
daala_dec_ctx
daala_dec
;
#endif
FRAME_CONTEXT
*
tile_ctx
;
/* Bit depth: 8, 10, 12 */
int
bd
;
...
...
av1/common/entropy.c
View file @
d0b77ac7
...
...
@@ -2417,67 +2417,3 @@ void av1_average_tile_inter_cdfs(AV1_COMMON *cm, FRAME_CONTEXT *fc,
AVERAGE_TILE_CDFS
(
lpf_sign_cdf
);
#endif // CONFIG_LPF_SB
}
#if CONFIG_PVQ
// Averaging PVQ's expected values for symbol coding
static
void
av1_average_pvq_ex
(
int
*
cxt_ptr
[],
int
*
fc_cxt_ptr
,
int
cxt_size
,
const
int
num_tiles
)
{
int
i
,
j
;
for
(
i
=
0
;
i
<
cxt_size
;
++
i
)
{
int
sum
=
0
;
for
(
j
=
0
;
j
<
num_tiles
;
++
j
)
sum
+=
cxt_ptr
[
j
][
i
];
fc_cxt_ptr
[
i
]
=
sum
/
num_tiles
;
}
}
#define AVERAGE_TILE_PVQ_EX(cname) \
for (i = 0; i < num_tiles; ++i) cxt_ptr[i] = (int *)&ec_ctxs[i]->cname; \
fc_cxt_ptr = (int *)&fc->cname; \
cxt_size = (int)sizeof(fc->cname) / sizeof(int); \
av1_average_pvq_ex(cxt_ptr, fc_cxt_ptr, cxt_size, num_tiles);
void
av1_default_pvq_probs
(
AV1_COMMON
*
cm
)
{
od_adapt_ctx
*
adapt
=
&
cm
->
fc
->
pvq_context
;
// Init with flat probabilities.
od_adapt_ctx_reset
(
adapt
,
0
);
// TODO(yushin): Prepare offline cdf and context table for PVQ,
// i.e. od_adapt_ctx, then load them from table,
// for example od_adapt_ctx default_pvq_context.
// Then do sth like this:
// av1_copy(cm->fc->pvq_context, default_pvq_context);
}
void
av1_average_tile_pvq_cdfs
(
FRAME_CONTEXT
*
fc
,
FRAME_CONTEXT
*
ec_ctxs
[],
const
int
num_tiles
)
{
int
i
,
j
,
cdf_size
,
cxt_size
;
aom_cdf_prob
*
cdf_ptr
[
MAX_TILE_ROWS
*
MAX_TILE_COLS
];
aom_cdf_prob
*
fc_cdf_ptr
;
int
*
cxt_ptr
[
MAX_TILE_ROWS
*
MAX_TILE_COLS
];
int
*
fc_cxt_ptr
;
AVERAGE_TILE_PVQ_EX
(
pvq_context
.
ex_dc
)
AVERAGE_TILE_PVQ_EX
(
pvq_context
.
ex_g
)
for
(
j
=
0
;
j
<
OD_NPLANES_MAX
;
j
++
)
{
AVERAGE_TILE_CDFS
(
pvq_context
.
model_dc
[
j
].
cdf
)
}
AVERAGE_TILE_CDFS
(
pvq_context
.
skip_cdf
)
AVERAGE_TILE_PVQ_EX
(
pvq_context
.
pvq
.
pvq_codeword_ctx
.
pvq_adapt
)
AVERAGE_TILE_CDFS
(
pvq_context
.
pvq
.
pvq_codeword_ctx
.
pvq_k1_cdf
)
AVERAGE_TILE_CDFS
(
pvq_context
.
pvq
.
pvq_codeword_ctx
.
pvq_split_cdf
)
for
(
j
=
0
;
j
<
3
;
j
++
)
{
AVERAGE_TILE_CDFS
(
pvq_context
.
pvq
.
pvq_param_model
[
j
].
cdf
)
}
AVERAGE_TILE_PVQ_EX
(
pvq_context
.
pvq
.
pvq_ext
)
AVERAGE_TILE_PVQ_EX
(
pvq_context
.
pvq
.
pvq_exg
)
AVERAGE_TILE_CDFS
(
pvq_context
.
pvq
.
pvq_gaintheta_cdf
)
AVERAGE_TILE_CDFS
(
pvq_context
.
pvq
.
pvq_skip_dir_cdf
)
}
#endif // CONFIG_PVQ
av1/common/entropy.h
View file @
d0b77ac7
...
...
@@ -388,11 +388,6 @@ void av1_average_tile_inter_cdfs(struct AV1Common *cm,
void
av1_average_tile_loopfilter_cdfs
(
struct
frame_contexts
*
fc
,
struct
frame_contexts
*
ec_ctxs
[],
aom_cdf_prob
*
cdf_ptrs
[],
int
num_tiles
);
#if CONFIG_PVQ
void
av1_default_pvq_probs
(
struct
AV1Common
*
cm
);
void
av1_average_tile_pvq_cdfs
(
struct
frame_contexts
*
fc
,
struct
frame_contexts
*
ec_ctxs
[],
int
num_tiles
);
#endif // CONFIG_PVQ
#ifdef __cplusplus
}
// extern "C"
#endif
...
...
av1/common/entropymode.c
View file @
d0b77ac7
...
...
@@ -6674,9 +6674,6 @@ void av1_setup_past_independence(AV1_COMMON *cm) {
#if CONFIG_LV_MAP
av1_init_lv_map
(
cm
);
#endif
#if CONFIG_PVQ
av1_default_pvq_probs
(
cm
);
#endif // CONFIG_PVQ
#if CONFIG_ADAPT_SCAN
av1_init_scan_order
(
cm
);
#endif
...
...
av1/common/entropymode.h
View file @
d0b77ac7
...
...
@@ -18,12 +18,6 @@
#include "av1/common/seg_common.h"
#include "aom_dsp/aom_filter.h"
#if CONFIG_PVQ
#include "av1/common/pvq.h"
#include "av1/common/pvq_state.h"
#include "av1/common/generic_code.h"
#endif // CONFIG_PVQ
#ifdef __cplusplus
extern
"C"
{
#endif
...
...
@@ -375,11 +369,6 @@ typedef struct frame_contexts {
#endif // CONFIG_LOOPFILTER_LEVEL
aom_prob
delta_lf_prob
[
DELTA_LF_PROBS
];
#endif
#if CONFIG_PVQ
// TODO(any): If PVQ is enabled, most of coefficient related cdf,
// such as coef_cdfs[], coef_tail_cdfs[], and coef_heaf_cdfs[] can be removed.
od_adapt_ctx
pvq_context
;
#endif // CONFIG_PVQ
#if CONFIG_CFL
aom_cdf_prob
cfl_sign_cdf
[
CDF_SIZE
(
CFL_JOINT_SIGNS
)];
aom_cdf_prob
cfl_alpha_cdf
[
CFL_ALPHA_CONTEXTS
][
CDF_SIZE
(
CFL_ALPHABET_SIZE
)];
...
...
av1/common/generic_code.c
deleted
100644 → 0
View file @
ab68ddb3
/*
* Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
/* clang-format off */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "generic_code.h"
void
aom_cdf_init_q15_1D
(
uint16_t
*
cdf
,
int
nsyms
,
int
cdf_size
)
{
int
i
;
for
(
i
=
0
;
i
<
nsyms
;
i
++
)
cdf
[
i
]
=
AOM_ICDF
((
i
+
1
)
*
CDF_PROB_TOP
/
nsyms
);
cdf
[
cdf_size
-
1
]
=
0
;
}
/** Adapts a Q15 cdf after encoding/decoding a symbol. */
void
aom_cdf_adapt_q15
(
int
val
,
uint16_t
*
cdf
,
int
n
,
int
*
count
,
int
rate
)
{
int
i
;
*
count
=
OD_MINI
(
*
count
+
1
,
1
<<
rate
);
OD_ASSERT
(
AOM_ICDF
(
cdf
[
n
-
1
])
==
32768
);
if
(
*
count
>=
1
<<
rate
)
{
/* Steady-state adaptation based on a simple IIR with dyadic rate. */
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
tmp
;
/* When (i < val), we want the adjustment ((cdf[i] - tmp) >> rate) to be
positive so long as (cdf[i] > i + 1), and 0 when (cdf[i] == i + 1),
to ensure we don't drive any probabilities to 0. Replacing cdf[i] with
(i + 2) and solving ((i + 2 - tmp) >> rate == 1) for tmp produces
tmp == i + 2 - (1 << rate). Using this value of tmp with
cdf[i] == i + 1 instead gives an adjustment of 0 as desired.
When (i >= val), we want ((cdf[i] - tmp) >> rate) to be negative so
long as cdf[i] < 32768 - (n - 1 - i), and 0 when
cdf[i] == 32768 - (n - 1 - i), again to ensure we don't drive any
probabilities to 0. Since right-shifting any negative value is still
negative, we can solve (32768 - (n - 1 - i) - tmp == 0) for tmp,
producing tmp = 32769 - n + i. Using this value of tmp with smaller
values of cdf[i] instead gives negative adjustments, as desired.
Combining the two cases gives the expression below. These could be
stored in a lookup table indexed by n and rate to avoid the
arithmetic. */
tmp
=
2
-
(
1
<<
rate
)
+
i
+
(
32767
+
(
1
<<
rate
)
-
n
)
*
(
i
>=
val
);
cdf
[
i
]
=
AOM_ICDF
(
AOM_ICDF
(
cdf
[
i
])
-
((
AOM_ICDF
(
cdf
[
i
])
-
tmp
)
>>
rate
));
}
}
else
{
int
alpha
;
/* Initial adaptation for the first symbols. The adaptation rate is
computed to be equivalent to what od_{en,de}code_cdf_adapt() does
when the initial cdf is set to increment/4. */
alpha
=
4
*
32768
/
(
n
+
4
**
count
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
tmp
;
tmp
=
(
32768
-
n
)
*
(
i
>=
val
)
+
i
+
1
;
cdf
[
i
]
=
AOM_ICDF
(
AOM_ICDF
(
cdf
[
i
])
-
(((
AOM_ICDF
(
cdf
[
i
])
-
tmp
)
*
alpha
)
>>
15
));
}
}
OD_ASSERT
(
AOM_ICDF
(
cdf
[
n
-
1
])
==
32768
);
}
/** Takes the base-2 log of E(x) in Q1.
*
* @param [in] ExQ16 expectation of x in Q16
*
* @retval 2*log2(ExQ16/2^16)
*/
int
log_ex
(
int
ex_q16
)
{
int
lg
;
int
lg_q1
;
int
odd
;
lg
=
OD_ILOG
(
ex_q16
);
if
(
lg
<
15
)
{
odd
=
ex_q16
*
ex_q16
>
2
<<
2
*
lg
;
}
else
{
int
tmp
;
tmp
=
ex_q16
>>
(
lg
-
8
);
odd
=
tmp
*
tmp
>
(
1
<<
15
);
}
lg_q1
=
OD_MAXI
(
0
,
2
*
lg
-
33
+
odd
);
return
lg_q1
;
}
/** Updates the probability model based on the encoded/decoded value
*
* @param [in,out] model generic prob model
* @param [in,out] ExQ16 expectation of x
* @param [in] x variable encoded/decoded (used for ExQ16)
* @param [in] xs variable x after shift (used for the model)
* @param [in] id id of the icdf to adapt
* @param [in] integration integration period of ExQ16 (leaky average over
* 1<<integration samples)
*/
void
generic_model_update
(
int
*
ex_q16
,
int
x
,
int
integration
)
{
/* We could have saturated ExQ16 directly, but this is safe and simpler */
x
=
OD_MINI
(
x
,
32767
);
OD_IIR_DIADIC
(
*
ex_q16
,
x
<<
16
,
integration
);
}
av1/common/generic_code.h
deleted
100644 → 0
View file @
ab68ddb3
/*
* Copyright (c) 2001-2016, Alliance for Open Media. All rights reserved
*
* This source code is subject to the terms of the BSD 2 Clause License and
* the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
* was not distributed with this source code in the LICENSE file, you can
* obtain it at www.aomedia.org/license/software. If the Alliance for Open
* Media Patent License 1.0 was not distributed with this source code in the
* PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/
/* clang-format off */
#if !defined(_generic_code_H)
# define _generic_code_H
# include "aom_dsp/bitreader.h"
# include "aom_dsp/bitwriter.h"
# define GENERIC_TABLES 12
#define generic_decode(r, model, ex_q16, integration, ACCT_STR_NAME) \
generic_decode_(r, model, ex_q16, integration ACCT_STR_ARG(ACCT_STR_NAME))
#define aom_decode_cdf_adapt_q15(r, cdf, n, count, rate, ACCT_STR_NAME) \
aom_decode_cdf_adapt_q15_(r, cdf, n, count, rate ACCT_STR_ARG(ACCT_STR_NAME))
#define aom_decode_cdf_adapt(r, cdf, n, increment, ACCT_STR_NAME) \
aom_decode_cdf_adapt_(r, cdf, n, increment ACCT_STR_ARG(ACCT_STR_NAME))
typedef
struct
{
/** cdf for multiple expectations of x */
uint16_t
cdf
[
GENERIC_TABLES
][
CDF_SIZE
(
16
)];
}
generic_encoder
;
#define OD_IIR_DIADIC(y, x, shift) ((y) += ((x) - (y)) >> (shift))
void
generic_model_init
(
generic_encoder
*
model
);
/* Initialize a CDF for use by aom_write_symbol_pvq()/aom_read_symbol_pvq().
This is used for CDFs whose size might not match the declared array size.
The only real requirement is that the first value of every CDF be zero.
Then aom_cdf_init_q15_1D() will be called with the real size the first time
the CDF is used. */
#define OD_CDFS_INIT_DYNAMIC(cdf) (memset(cdf, 0, sizeof(cdf)))
// WARNING: DO NOT USE this init function,
// if the size of cdf is different from what is declared by code.
#define OD_CDFS_INIT_Q15(cdfs) \
{ int n_cdfs = sizeof(cdfs)/sizeof(cdfs[0]); \
int cdf_size = sizeof(cdfs[0])/sizeof(cdfs[0][0]); \
int nsyms = cdf_size - 1; \
int i_; \
for (i_ = 0; i_ < n_cdfs; i_++) \
aom_cdf_init_q15_1D(cdfs[i_], nsyms, cdf_size); \
}