Commit 1aeee2e9 authored by Frederic Barbier's avatar Frederic Barbier Committed by Steinar Midtskogen

Remove experimental flag of CDEF

This experiment has been adopted, we can simplify the code
by dropping the associated preprocessor conditionals.

Change-Id: I17bd46ebad7796d04fb4065fb36da0e1c4eeaf9b
parent 26b8a99e
......@@ -435,12 +435,10 @@ static const arg_def_t tile_loopfilter = ARG_DEF(
#endif // CONFIG_LOOPFILTERING_ACROSS_TILES
static const arg_def_t lossless =
ARG_DEF(NULL, "lossless", 1, "Lossless mode (0: false (default), 1: true)");
#if CONFIG_CDEF
static const arg_def_t enable_cdef =
ARG_DEF(NULL, "enable-cdef", 1,
"Enable the constrained directional enhancement filter (0: false, "
"1: true (default))");
#endif
#if CONFIG_AOM_QM
static const arg_def_t enable_qm =
ARG_DEF(NULL, "enable-qm", 1,
......@@ -580,9 +578,7 @@ static const arg_def_t *av1_args[] = { &cpu_used_av1,
&max_inter_rate_pct,
&gf_cbr_boost_pct,
&lossless,
#if CONFIG_CDEF
&enable_cdef,
#endif
#if CONFIG_AOM_QM
&enable_qm,
&qm_min,
......@@ -640,9 +636,7 @@ static const int av1_arg_ctrl_map[] = { AOME_SET_CPUUSED,
AV1E_SET_MAX_INTER_BITRATE_PCT,
AV1E_SET_GF_CBR_BOOST_PCT,
AV1E_SET_LOSSLESS,
#if CONFIG_CDEF
AV1E_SET_ENABLE_CDEF,
#endif
#if CONFIG_AOM_QM
AV1E_SET_ENABLE_QM,
AV1E_SET_QM_MIN,
......
......@@ -227,61 +227,59 @@ else ()
"${AOM_ROOT}/av1/encoder/arm/neon/error_neon.c")
endif ()
if (CONFIG_CDEF)
set(AOM_AV1_COMMON_SOURCES
${AOM_AV1_COMMON_SOURCES}
"${AOM_ROOT}/av1/common/cdef.c"
"${AOM_ROOT}/av1/common/cdef.h"
"${AOM_ROOT}/av1/common/cdef_block.c"
"${AOM_ROOT}/av1/common/cdef_block.h")
set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/pickcdef.c")
set(AOM_AV1_COMMON_INTRIN_SSE2
${AOM_AV1_COMMON_INTRIN_SSE2}
"${AOM_ROOT}/av1/common/cdef_block_sse2.c")
set(AOM_AV1_COMMON_INTRIN_SSSE3
${AOM_AV1_COMMON_INTRIN_SSSE3}
"${AOM_ROOT}/av1/common/cdef_block_ssse3.c")
set(AOM_AV1_COMMON_INTRIN_SSE4_1
${AOM_AV1_COMMON_INTRIN_SSE4_1}
"${AOM_ROOT}/av1/common/cdef_block_sse4.c")
set(AOM_AV1_COMMON_INTRIN_AVX2
${AOM_AV1_COMMON_INTRIN_AVX2}
"${AOM_ROOT}/av1/common/cdef_block_avx2.c")
set(AOM_AV1_COMMON_INTRIN_NEON
${AOM_AV1_COMMON_INTRIN_NEON}
"${AOM_ROOT}/av1/common/cdef_block_neon.c")
if (NOT CONFIG_CDEF_SINGLEPASS)
set(AOM_AV1_COMMON_SOURCES
${AOM_AV1_COMMON_SOURCES}
"${AOM_ROOT}/av1/common/cdef.c"
"${AOM_ROOT}/av1/common/cdef.h"
"${AOM_ROOT}/av1/common/cdef_block.c"
"${AOM_ROOT}/av1/common/cdef_block.h")
set(AOM_AV1_ENCODER_SOURCES
${AOM_AV1_ENCODER_SOURCES}
"${AOM_ROOT}/av1/encoder/pickcdef.c")
"${AOM_ROOT}/av1/common/clpf.c"
"${AOM_ROOT}/av1/common/clpf_simd.h"
"${AOM_ROOT}/av1/common/cdef_block_simd.h")
set(AOM_AV1_COMMON_INTRIN_SSE2
${AOM_AV1_COMMON_INTRIN_SSE2}
"${AOM_ROOT}/av1/common/cdef_block_sse2.c")
"${AOM_ROOT}/av1/common/clpf_sse2.c")
set(AOM_AV1_COMMON_INTRIN_SSSE3
${AOM_AV1_COMMON_INTRIN_SSSE3}
"${AOM_ROOT}/av1/common/cdef_block_ssse3.c")
"${AOM_ROOT}/av1/common/clpf_ssse3.c")
set(AOM_AV1_COMMON_INTRIN_SSE4_1
${AOM_AV1_COMMON_INTRIN_SSE4_1}
"${AOM_ROOT}/av1/common/cdef_block_sse4.c")
set(AOM_AV1_COMMON_INTRIN_AVX2
${AOM_AV1_COMMON_INTRIN_AVX2}
"${AOM_ROOT}/av1/common/cdef_block_avx2.c")
"${AOM_ROOT}/av1/common/clpf_sse4.c")
set(AOM_AV1_COMMON_INTRIN_NEON
${AOM_AV1_COMMON_INTRIN_NEON}
"${AOM_ROOT}/av1/common/cdef_block_neon.c")
if (NOT CONFIG_CDEF_SINGLEPASS)
set(AOM_AV1_COMMON_SOURCES
${AOM_AV1_COMMON_SOURCES}
"${AOM_ROOT}/av1/common/clpf.c"
"${AOM_ROOT}/av1/common/clpf_simd.h"
"${AOM_ROOT}/av1/common/cdef_block_simd.h")
set(AOM_AV1_COMMON_INTRIN_SSE2
${AOM_AV1_COMMON_INTRIN_SSE2}
"${AOM_ROOT}/av1/common/clpf_sse2.c")
set(AOM_AV1_COMMON_INTRIN_SSSE3
${AOM_AV1_COMMON_INTRIN_SSSE3}
"${AOM_ROOT}/av1/common/clpf_ssse3.c")
set(AOM_AV1_COMMON_INTRIN_SSE4_1
${AOM_AV1_COMMON_INTRIN_SSE4_1}
"${AOM_ROOT}/av1/common/clpf_sse4.c")
set(AOM_AV1_COMMON_INTRIN_NEON
${AOM_AV1_COMMON_INTRIN_NEON}
"${AOM_ROOT}/av1/common/clpf_neon.c")
endif ()
"${AOM_ROOT}/av1/common/clpf_neon.c")
endif ()
if (CONFIG_CONVOLVE_ROUND)
......
......@@ -93,7 +93,6 @@ AV1_COMMON_SRCS-$(HAVE_SSE4_1) += common/x86/intra_edge_sse4.c
endif
AV1_COMMON_SRCS-yes += common/warped_motion.h
AV1_COMMON_SRCS-yes += common/warped_motion.c
ifeq ($(CONFIG_CDEF),yes)
ifeq ($(CONFIG_CDEF_SINGLEPASS),yes)
AV1_COMMON_SRCS-$(HAVE_AVX2) += common/cdef_block_avx2.c
else
......@@ -113,7 +112,6 @@ AV1_COMMON_SRCS-yes += common/cdef_block.h
AV1_COMMON_SRCS-yes += common/cdef_block_simd.h
AV1_COMMON_SRCS-yes += common/cdef.c
AV1_COMMON_SRCS-yes += common/cdef.h
endif
AV1_COMMON_SRCS-yes += common/odintrin.c
AV1_COMMON_SRCS-yes += common/odintrin.h
......
......@@ -115,9 +115,7 @@ AV1_CX_SRCS-yes += ../third_party/vector/vector.c
AV1_CX_SRCS-yes += encoder/hash_motion.c
AV1_CX_SRCS-yes += encoder/hash_motion.h
endif
ifeq ($(CONFIG_CDEF),yes)
AV1_CX_SRCS-yes += encoder/pickcdef.c
endif
AV1_CX_SRCS-$(HAVE_SSE2) += encoder/x86/av1_quantize_sse2.c
AV1_CX_SRCS-$(HAVE_AVX2) += encoder/x86/av1_quantize_avx2.c
......
......@@ -54,9 +54,7 @@ struct av1_extracfg {
unsigned int rc_max_inter_bitrate_pct;
unsigned int gf_cbr_boost_pct;
unsigned int lossless;
#if CONFIG_CDEF
unsigned int enable_cdef;
#endif
#if CONFIG_AOM_QM
unsigned int enable_qm;
unsigned int qm_min;
......@@ -120,9 +118,7 @@ static struct av1_extracfg default_extra_cfg = {
0, // rc_max_inter_bitrate_pct
0, // gf_cbr_boost_pct
0, // lossless
#if CONFIG_CDEF
1, // enable_cdef
#endif
1, // enable_cdef
#if CONFIG_AOM_QM
0, // enable_qm
DEFAULT_QM_FIRST, // qm_min
......@@ -504,9 +500,7 @@ static aom_codec_err_t set_encoder_config(
oxcf->cq_level = av1_quantizer_to_qindex(extra_cfg->cq_level);
oxcf->fixed_q = -1;
#if CONFIG_CDEF
oxcf->using_cdef = extra_cfg->enable_cdef;
#endif
#if CONFIG_AOM_QM
oxcf->using_qm = extra_cfg->enable_qm;
oxcf->qm_minlevel = extra_cfg->qm_min;
......@@ -879,14 +873,12 @@ static aom_codec_err_t ctrl_set_lossless(aom_codec_alg_priv_t *ctx,
return update_extra_cfg(ctx, &extra_cfg);
}
#if CONFIG_CDEF
static aom_codec_err_t ctrl_set_enable_cdef(aom_codec_alg_priv_t *ctx,
va_list args) {
struct av1_extracfg extra_cfg = ctx->extra_cfg;
extra_cfg.enable_cdef = CAST(AV1E_SET_ENABLE_CDEF, args);
return update_extra_cfg(ctx, &extra_cfg);
}
#endif
#if CONFIG_AOM_QM
static aom_codec_err_t ctrl_set_enable_qm(aom_codec_alg_priv_t *ctx,
......@@ -1613,9 +1605,7 @@ static aom_codec_ctrl_fn_map_t encoder_ctrl_maps[] = {
{ AV1E_SET_MAX_INTER_BITRATE_PCT, ctrl_set_rc_max_inter_bitrate_pct },
{ AV1E_SET_GF_CBR_BOOST_PCT, ctrl_set_rc_gf_cbr_boost_pct },
{ AV1E_SET_LOSSLESS, ctrl_set_lossless },
#if CONFIG_CDEF
{ AV1E_SET_ENABLE_CDEF, ctrl_set_enable_cdef },
#endif
#if CONFIG_AOM_QM
{ AV1E_SET_ENABLE_QM, ctrl_set_enable_qm },
{ AV1E_SET_QM_MIN, ctrl_set_qm_min },
......
......@@ -452,52 +452,50 @@ if (aom_config("CONFIG_AV1_ENCODER") eq "yes") {
# Deringing Functions
if (aom_config("CONFIG_CDEF") eq "yes") {
add_proto qw/int cdef_find_dir/, "const uint16_t *img, int stride, int32_t *var, int coeff_shift";
if (aom_config("CONFIG_CDEF_SINGLEPASS") ne "yes") {
add_proto qw/void aom_clpf_block_hbd/, "uint16_t *dst, const uint16_t *src, int dstride, int sstride, int sizex, int sizey, unsigned int strength, unsigned int bd";
add_proto qw/void aom_clpf_hblock_hbd/, "uint16_t *dst, const uint16_t *src, int dstride, int sstride, int sizex, int sizey, unsigned int strength, unsigned int bd";
add_proto qw/void aom_clpf_block/, "uint8_t *dst, const uint16_t *src, int dstride, int sstride, int sizex, int sizey, unsigned int strength, unsigned int bd";
add_proto qw/void aom_clpf_hblock/, "uint8_t *dst, const uint16_t *src, int dstride, int sstride, int sizex, int sizey, unsigned int strength, unsigned int bd";
add_proto qw/void cdef_direction_4x4/, "uint16_t *y, int ystride, const uint16_t *in, int threshold, int dir, int damping";
add_proto qw/void cdef_direction_8x8/, "uint16_t *y, int ystride, const uint16_t *in, int threshold, int dir, int damping";
add_proto qw/void copy_8x8_16bit_to_8bit/, "uint8_t *dst, int dstride, const uint16_t *src, int sstride";
add_proto qw/void copy_4x4_16bit_to_8bit/, "uint8_t *dst, int dstride, const uint16_t *src, int sstride";
add_proto qw/void copy_8x8_16bit_to_16bit/, "uint16_t *dst, int dstride, const uint16_t *src, int sstride";
add_proto qw/void copy_4x4_16bit_to_16bit/, "uint16_t *dst, int dstride, const uint16_t *src, int sstride";
} else {
add_proto qw/void cdef_filter_block/, "uint8_t *dst8, uint16_t *dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int bsize, int max, int coeff_shift";
}
add_proto qw/int cdef_find_dir/, "const uint16_t *img, int stride, int32_t *var, int coeff_shift";
if (aom_config("CONFIG_CDEF_SINGLEPASS") ne "yes") {
add_proto qw/void aom_clpf_block_hbd/, "uint16_t *dst, const uint16_t *src, int dstride, int sstride, int sizex, int sizey, unsigned int strength, unsigned int bd";
add_proto qw/void aom_clpf_hblock_hbd/, "uint16_t *dst, const uint16_t *src, int dstride, int sstride, int sizex, int sizey, unsigned int strength, unsigned int bd";
add_proto qw/void aom_clpf_block/, "uint8_t *dst, const uint16_t *src, int dstride, int sstride, int sizex, int sizey, unsigned int strength, unsigned int bd";
add_proto qw/void aom_clpf_hblock/, "uint8_t *dst, const uint16_t *src, int dstride, int sstride, int sizex, int sizey, unsigned int strength, unsigned int bd";
add_proto qw/void cdef_direction_4x4/, "uint16_t *y, int ystride, const uint16_t *in, int threshold, int dir, int damping";
add_proto qw/void cdef_direction_8x8/, "uint16_t *y, int ystride, const uint16_t *in, int threshold, int dir, int damping";
add_proto qw/void copy_8x8_16bit_to_8bit/, "uint8_t *dst, int dstride, const uint16_t *src, int sstride";
add_proto qw/void copy_4x4_16bit_to_8bit/, "uint8_t *dst, int dstride, const uint16_t *src, int sstride";
add_proto qw/void copy_8x8_16bit_to_16bit/, "uint16_t *dst, int dstride, const uint16_t *src, int sstride";
add_proto qw/void copy_4x4_16bit_to_16bit/, "uint16_t *dst, int dstride, const uint16_t *src, int sstride";
} else {
add_proto qw/void cdef_filter_block/, "uint8_t *dst8, uint16_t *dst16, int dstride, const uint16_t *in, int pri_strength, int sec_strength, int dir, int pri_damping, int sec_damping, int bsize, int max, int coeff_shift";
}
add_proto qw/void copy_rect8_8bit_to_16bit/, "uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h";
add_proto qw/void copy_rect8_16bit_to_16bit/, "uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h";
# VS compiling for 32 bit targets does not support vector types in
# structs as arguments, which makes the v256 type of the intrinsics
# hard to support, so optimizations for this target are disabled.
if ($opts{config} !~ /libs-x86-win32-vs.*/) {
if (aom_config("CONFIG_CDEF_SINGLEPASS") eq "yes") {
specialize qw/cdef_find_dir sse2 ssse3 sse4_1 avx2 neon/;
specialize qw/cdef_filter_block sse2 ssse3 sse4_1 avx2 neon/;
specialize qw/copy_rect8_8bit_to_16bit sse2 ssse3 sse4_1 avx2 neon/;
specialize qw/copy_rect8_16bit_to_16bit sse2 ssse3 sse4_1 avx2 neon/;
} else {
specialize qw/cdef_find_dir sse2 ssse3 sse4_1 neon/;
specialize qw/aom_clpf_block_hbd sse2 ssse3 sse4_1 neon/;
specialize qw/aom_clpf_hblock_hbd sse2 ssse3 sse4_1 neon/;
specialize qw/aom_clpf_block sse2 ssse3 sse4_1 neon/;
specialize qw/aom_clpf_hblock sse2 ssse3 sse4_1 neon/;
specialize qw/cdef_find_dir sse2 ssse3 sse4_1 neon/;
specialize qw/cdef_direction_4x4 sse2 ssse3 sse4_1 neon/;
specialize qw/cdef_direction_8x8 sse2 ssse3 sse4_1 neon/;
specialize qw/copy_8x8_16bit_to_8bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_4x4_16bit_to_8bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_8x8_16bit_to_16bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_4x4_16bit_to_16bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_rect8_8bit_to_16bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_rect8_16bit_to_16bit sse2 ssse3 sse4_1 neon/;
}
add_proto qw/void copy_rect8_8bit_to_16bit/, "uint16_t *dst, int dstride, const uint8_t *src, int sstride, int v, int h";
add_proto qw/void copy_rect8_16bit_to_16bit/, "uint16_t *dst, int dstride, const uint16_t *src, int sstride, int v, int h";
# VS compiling for 32 bit targets does not support vector types in
# structs as arguments, which makes the v256 type of the intrinsics
# hard to support, so optimizations for this target are disabled.
if ($opts{config} !~ /libs-x86-win32-vs.*/) {
if (aom_config("CONFIG_CDEF_SINGLEPASS") eq "yes") {
specialize qw/cdef_find_dir sse2 ssse3 sse4_1 avx2 neon/;
specialize qw/cdef_filter_block sse2 ssse3 sse4_1 avx2 neon/;
specialize qw/copy_rect8_8bit_to_16bit sse2 ssse3 sse4_1 avx2 neon/;
specialize qw/copy_rect8_16bit_to_16bit sse2 ssse3 sse4_1 avx2 neon/;
} else {
specialize qw/cdef_find_dir sse2 ssse3 sse4_1 neon/;
specialize qw/aom_clpf_block_hbd sse2 ssse3 sse4_1 neon/;
specialize qw/aom_clpf_hblock_hbd sse2 ssse3 sse4_1 neon/;
specialize qw/aom_clpf_block sse2 ssse3 sse4_1 neon/;
specialize qw/aom_clpf_hblock sse2 ssse3 sse4_1 neon/;
specialize qw/cdef_find_dir sse2 ssse3 sse4_1 neon/;
specialize qw/cdef_direction_4x4 sse2 ssse3 sse4_1 neon/;
specialize qw/cdef_direction_8x8 sse2 ssse3 sse4_1 neon/;
specialize qw/copy_8x8_16bit_to_8bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_4x4_16bit_to_8bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_8x8_16bit_to_16bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_4x4_16bit_to_16bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_rect8_8bit_to_16bit sse2 ssse3 sse4_1 neon/;
specialize qw/copy_rect8_16bit_to_16bit sse2 ssse3 sse4_1 neon/;
}
}
......
......@@ -526,14 +526,12 @@ typedef struct AV1Common {
BLOCK_SIZE sb_size; // Size of the superblock used for this frame
int mib_size; // Size of the superblock in units of MI blocks
int mib_size_log2; // Log 2 of above.
#if CONFIG_CDEF
int cdef_pri_damping;
int cdef_sec_damping;
int nb_cdef_strengths;
int cdef_strengths[CDEF_MAX_STRENGTHS];
int cdef_uv_strengths[CDEF_MAX_STRENGTHS];
int cdef_bits;
#endif
int delta_q_present_flag;
// Resolution of delta quant
......
......@@ -33,9 +33,7 @@
#endif // CONFIG_BITSTREAM_DEBUG
#include "av1/common/alloccommon.h"
#if CONFIG_CDEF
#include "av1/common/cdef.h"
#endif
#if CONFIG_INSPECTION
#include "av1/decoder/inspection.h"
#endif
......@@ -1004,7 +1002,6 @@ static void decode_partition(AV1Decoder *const pbi, MACROBLOCKD *const xd,
}
#endif
#if CONFIG_CDEF
if (bsize == cm->sb_size) {
int width_step = mi_size_wide[BLOCK_64X64];
int height_step = mi_size_wide[BLOCK_64X64];
......@@ -1023,7 +1020,6 @@ static void decode_partition(AV1Decoder *const pbi, MACROBLOCKD *const xd,
}
}
}
#endif // CONFIG_CDEF
#if CONFIG_LOOP_RESTORATION
for (int plane = 0; plane < MAX_MB_PLANE; ++plane) {
int rcol0, rcol1, rrow0, rrow1, tile_tl_idx;
......@@ -1351,7 +1347,6 @@ static void setup_loopfilter(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
}
}
#if CONFIG_CDEF
static void setup_cdef(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
#if CONFIG_INTRABC
if (cm->allow_intrabc && NO_FILTER_FOR_IBC) return;
......@@ -1372,7 +1367,6 @@ static void setup_cdef(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
: 0;
}
}
#endif // CONFIG_CDEF
static INLINE int read_delta_q(struct aom_read_bit_buffer *rb) {
return aom_rb_read_bit(rb) ? aom_rb_read_inv_signed_literal(rb, 6) : 0;
......@@ -1801,20 +1795,15 @@ static void read_tile_info(AV1Decoder *const pbi,
#else
const int no_loopfilter = !lf->filter_level;
#endif
#if CONFIG_CDEF
const int no_cdef = cm->cdef_bits == 0 && cm->cdef_strengths[0] == 0 &&
cm->nb_cdef_strengths == 1;
#endif
#if CONFIG_LOOP_RESTORATION
const int no_restoration =
cm->rst_info[0].frame_restoration_type == RESTORE_NONE &&
cm->rst_info[1].frame_restoration_type == RESTORE_NONE &&
cm->rst_info[2].frame_restoration_type == RESTORE_NONE;
#endif
cm->single_tile_decoding = no_loopfilter
#if CONFIG_CDEF
&& no_cdef
#endif
cm->single_tile_decoding = no_loopfilter && no_cdef
#if CONFIG_LOOP_RESTORATION
&& no_restoration
#endif
......@@ -3202,11 +3191,9 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
#else
lf->filter_level = 0;
#endif
#if CONFIG_CDEF
cm->cdef_bits = 0;
cm->cdef_strengths[0] = 0;
cm->nb_cdef_strengths = 1;
#endif // CONFIG_CDEF
#if CONFIG_LOOP_RESTORATION
cm->rst_info[0].frame_restoration_type = RESTORE_NONE;
cm->rst_info[1].frame_restoration_type = RESTORE_NONE;
......@@ -3305,11 +3292,9 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
}
cm->all_lossless = all_lossless(cm, xd);
setup_segmentation_dequant(cm);
#if CONFIG_CDEF
if (!cm->all_lossless) {
setup_cdef(cm, rb);
}
#endif
#if CONFIG_LOOP_RESTORATION
decode_restoration_mode(cm, rb);
#endif // CONFIG_LOOP_RESTORATION
......@@ -3842,7 +3827,6 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data,
}
#endif
#if CONFIG_CDEF
if (!cm->skip_loop_filter &&
#if CONFIG_INTRABC
!(cm->allow_intrabc && NO_FILTER_FOR_IBC) &&
......@@ -3850,7 +3834,6 @@ void av1_decode_tg_tiles_and_wrapup(AV1Decoder *pbi, const uint8_t *data,
!cm->all_lossless) {
av1_cdef_frame(&pbi->cur_buf->buf, cm, &pbi->mb);
}
#endif // CONFIG_CDEF
#if CONFIG_FRAME_SUPERRES
superres_post_decode(pbi);
......
......@@ -11,9 +11,7 @@
#include "av1/decoder/decoder.h"
#include "av1/decoder/inspection.h"
#include "av1/common/enums.h"
#if CONFIG_CDEF
#include "av1/common/cdef.h"
#endif
#if CONFIG_CFL
#include "av1/common/cfl.h"
#endif
......@@ -55,9 +53,7 @@ int ifd_inspect(insp_frame_data *fd, void *decoder) {
#if CONFIG_ACCOUNTING
fd->accounting = &pbi->accounting;
#endif
#if CONFIG_CDEF
// TODO(negge): copy per frame CDEF data
#endif
// TODO(negge): copy per frame CDEF data
int i, j;
for (i = 0; i < MAX_SEGMENTS; i++) {
for (j = 0; j < 2; j++) {
......@@ -104,13 +100,11 @@ int ifd_inspect(insp_frame_data *fd, void *decoder) {
mi->tx_type = mbmi->tx_type;
mi->tx_size = mbmi->tx_size;
#if CONFIG_CDEF
mi->cdef_level =
cm->cdef_strengths[mbmi->cdef_strength] / CDEF_SEC_STRENGTHS;
mi->cdef_strength =
cm->cdef_strengths[mbmi->cdef_strength] % CDEF_SEC_STRENGTHS;
mi->cdef_strength += mi->cdef_strength == 3;
#endif
#if CONFIG_CFL
if (mbmi->uv_mode == UV_CFL_PRED) {
mi->cfl_alpha_idx = mbmi->cfl_alpha_idx;
......
......@@ -49,10 +49,8 @@ struct insp_mi_data {
#endif
int16_t tx_type;
int16_t tx_size;
#if CONFIG_CDEF
int16_t cdef_level;
int16_t cdef_strength;
#endif
#if CONFIG_CFL
int16_t cfl_alpha_idx;
int16_t cfl_alpha_sign;
......@@ -77,9 +75,7 @@ struct insp_frame_data {
int16_t y_dequant[MAX_SEGMENTS][2];
int16_t u_dequant[MAX_SEGMENTS][2];
int16_t v_dequant[MAX_SEGMENTS][2];
#if CONFIG_CDEF
// TODO(negge): add per frame CDEF data
#endif
// TODO(negge): add per frame CDEF data
int delta_q_present_flag;
int delta_q_res;
};
......
......@@ -24,9 +24,7 @@
#include "aom_util/debug_util.h"
#endif // CONFIG_BITSTREAM_DEBUG
#if CONFIG_CDEF
#include "av1/common/cdef.h"
#endif // CONFIG_CDEF
#include "av1/common/entropy.h"
#include "av1/common/entropymode.h"
#include "av1/common/entropymv.h"
......@@ -2443,7 +2441,6 @@ static void write_modes_sb(AV1_COMP *const cpi, const TileInfo *const tile,
}
#endif
#if CONFIG_CDEF
if (bsize == cm->sb_size && cm->cdef_bits != 0 && !cm->all_lossless) {
int width_step = mi_size_wide[BLOCK_64X64];
int height_step = mi_size_high[BLOCK_64X64];
......@@ -2464,7 +2461,6 @@ static void write_modes_sb(AV1_COMP *const cpi, const TileInfo *const tile,
}
}
}
#endif
#if CONFIG_LOOP_RESTORATION
for (int plane = 0; plane < MAX_MB_PLANE; ++plane) {
int rcol0, rcol1, rrow0, rrow1, tile_tl_idx;
......@@ -2747,7 +2743,6 @@ static void encode_loopfilter(AV1_COMMON *cm, struct aom_write_bit_buffer *wb) {
}
}
#if CONFIG_CDEF
static void encode_cdef(const AV1_COMMON *cm, struct aom_write_bit_buffer *wb) {
#if CONFIG_INTRABC
if (cm->allow_intrabc && NO_FILTER_FOR_IBC) return;
......@@ -2767,7 +2762,6 @@ static void encode_cdef(const AV1_COMMON *cm, struct aom_write_bit_buffer *wb) {
aom_wb_write_literal(wb, cm->cdef_uv_strengths[i], CDEF_STRENGTH_BITS);
}
}
#endif
static void write_delta_q(struct aom_write_bit_buffer *wb, int delta_q) {
if (delta_q != 0) {
......@@ -4093,11 +4087,9 @@ static void write_uncompressed_header_frame(AV1_COMP *cpi,
}
}
}
#if CONFIG_CDEF
if (!cm->all_lossless) {
encode_cdef(cm, wb);
}
#endif
#if CONFIG_LOOP_RESTORATION
encode_restoration_mode(cm, wb);
#endif // CONFIG_LOOP_RESTORATION
......@@ -4454,11 +4446,9 @@ static void write_uncompressed_header_obu(AV1_COMP *cpi,
}
}
}
#if CONFIG_CDEF
if (!cm->all_lossless) {
encode_cdef(cm, wb);
}
#endif
#if CONFIG_LOOP_RESTORATION
encode_restoration_mode(cm, wb);
#endif // CONFIG_LOOP_RESTORATION
......
......@@ -16,9 +16,7 @@
#include "./aom_config.h"
#include "av1/common/alloccommon.h"
#if CONFIG_CDEF
#include "av1/common/cdef.h"
#endif // CONFIG_CDEF
#include "av1/common/filter.h"
#include "av1/common/idct.h"
#include "av1/common/reconinter.h"
......@@ -4610,9 +4608,7 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
MACROBLOCKD *xd = &cpi->td.mb.e_mbd;
struct loopfilter *lf = &cm->lf;
int no_loopfilter = 0;
#if CONFIG_CDEF
int no_cdef = 0;
#endif
#if CONFIG_LOOP_RESTORATION
int no_restoration = 0;
if (is_lossless_requested(&cpi->oxcf)
......@@ -4628,7 +4624,6 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
}
#endif
#if CONFIG_CDEF
if (is_lossless_requested(&cpi->oxcf) || !cpi->oxcf.using_cdef
#if CONFIG_EXT_TILE
|| cm->single_tile_decoding
......@@ -4636,7 +4631,6 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
) {
no_cdef = 1;
}
#endif
if (no_loopfilter) {
#if CONFIG_LOOPFILTER_LEVEL
......@@ -4692,7 +4686,6 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
av1_loop_restoration_save_boundary_lines(cm->frame_to_show, cm, 0);
#endif
#if CONFIG_CDEF
if (no_cdef) {
cm->cdef_bits = 0;
cm->cdef_strengths[0] = 0;
......@@ -4705,7 +4698,6 @@ static void loopfilter_frame(AV1_COMP *cpi, AV1_COMMON *cm) {
// Apply the filter
av1_cdef_frame(cm->frame_to_show, cm, xd);
}
#endif
#if CONFIG_FRAME_SUPERRES
superres_post_encode(cpi);
......
......@@ -196,9 +196,7 @@ typedef struct AV1EncoderConfig {
#if CONFIG_EXT_DELTA_Q
DELTAQ_MODE deltaq_mode;
#endif
#if CONFIG_CDEF
int using_cdef;
#endif
#if CONFIG_AOM_QM
int using_qm;
int qm_minlevel;
......
......@@ -156,9 +156,7 @@ static void set_good_speed_features_framesize_independent(AV1_COMP *cpi,
} else {
sf->use_square_partition_only = !frame_is_intra_only(cm);
}
#if CONFIG_CDEF
sf->fast_cdef_search = 1;
#endif // CONFIG_CDEF
sf->less_rectangular_check = 1;
......@@ -450,9 +448,7 @@ void av1_set_speed_features_framesize_independent(AV1_COMP *cpi) {
#if CONFIG_EXT_PARTITION_TYPES
sf->prune_ext_partition_types_search = 0;
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_CDEF
sf->fast_cdef_search = 0;
#endif // CONFIG_CDEF
// Set this at the appropriate speed levels
sf->use_transform_domain_distortion = 0;
......
......@@ -338,9 +338,7 @@ typedef struct SPEED_FEATURES {
int prune_ext_partition_types_search;
#endif // CONFIG_EXT_PARTITION_TYPES
#if CONFIG_CDEF
int fast_cdef_search;
#endif // CONFIG_CDEF
// Skip rectangular partition test when partition type none gives better
// rd than partition type split.
......
......@@ -111,7 +111,6 @@ set(CONFIG_AMVR 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_ANS 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_AOM_QM 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_BGSPRITE 0 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_CDEF 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_CDEF_SINGLEPASS 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_CFL 1 CACHE NUMBER "AV1 experiment flag.")
set(CONFIG_COLORSPACE_HEADERS 0 CACHE NUMBER "AV1 experiment flag.")
......
......@@ -247,7 +247,6 @@ HAVE_LIST="
"
EXPERIMENT_LIST="
fp_mb_stats
cdef
cdef_singlepass
rect_tx_ext
tpl_mv
......@@ -495,7 +494,6 @@ post_process_cmdline() {
# Enable adopted experiments by default
soft_enable adopted_experiments
if enabled adopted_experiments; then
soft_enable cdef
soft_enable cdef_singlepass
soft_enable ext_intra
soft_enable intra_edge
......@@ -546,7 +544,6 @@ post_process_cmdline() {
enabled compound_round && soft_enable convolve_round
enabled ext_intra_mod && enable_feature intra_edge
enabled intra_edge && enable_feature ext_intra
enabled cdef_singlepass && enable_feature cdef
enabled mfmv && enable_feature frame_marker
enabled jnt_comp && enable_feature frame_marker
enabled frame_refs && enable_feature frame_marker
......
......@@ -119,9 +119,7 @@ static const arg_def_t *main_args[] = { &limit_arg,
&dump_uv_mode_arg,
&dump_skip_arg,
&dump_filter_arg,
#if CONFIG_CDEF
&dump_cdef_arg,
#endif
#if CONFIG_DUAL_FILTER
&dump_dual_filter_type_arg,
#endif
......@@ -570,14 +568,12 @@ void inspect(void *pbi, void *data) {
put_block_info(buf, NULL, "filter", offsetof(insp_mi_data, filter), 0);
#endif
}
#if CONFIG_CDEF
if (layers & CDEF_LAYER) {
buf += put_block_info(buf, NULL, "cdef_level",
offsetof(insp_mi_data, cdef_level), 0);
buf += put_block_info(buf, NULL, "cdef_strength",
offsetof(insp_mi_data, cdef_strength), 0);
}
#endif
#if CONFIG_CFL
if (layers & CFL_LAYER) {
buf += put_block_info(buf, NULL, "cfl_alpha_idx",
......@@ -734,10 +730,8 @@ static void parse_args(char **argv) {
layers |= SKIP_LAYER;
else if (arg_match(&arg, &dump_filter_arg, argi))
layers |= FILTER_LAYER;
#if CONFIG_CDEF
else if (arg_match(&arg, &dump_cdef_arg, argi))
layers |= CDEF_LAYER;
#endif
#if CONFIG_CFL
else if (arg_match(&arg, &dump_cfl_arg, argi))
layers |= CFL_LAYER;
......
......@@ -138,17 +138,15 @@ if (NOT BUILD_SHARED_LIBS)
${AOM_UNIT_TEST_ENCODER_SOURCES}
"${AOM_ROOT}/test/motion_vector_test.cc")
if (CONFIG_CDEF)
if (CONFIG_CDEF_SINGLEPASS)
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
"${AOM_ROOT}/test/cdef_test.cc")
else ()
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
"${AOM_ROOT}/test/clpf_test.cc"
"${AOM_ROOT}/test/dering_test.cc")
endif ()
if (CONFIG_CDEF_SINGLEPASS)
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
"${AOM_ROOT}/test/cdef_test.cc")
else ()
set(AOM_UNIT_TEST_COMMON_SOURCES
${AOM_UNIT_TEST_COMMON_SOURCES}
"${AOM_ROOT}/test/clpf_test.cc"
"${AOM_ROOT}/test/dering_test.cc")
endif ()
if (CONFIG_INTRABC)
......
......@@ -136,10 +136,10 @@ LIBAOM_TEST_SRCS-$(CONFIG_ADAPT_SCAN) += scan_test.cc
LIBAOM_TEST_SRCS-yes += convolve_test.cc
LIBAOM_TEST_SRCS-yes += lpf_8_test.cc
ifeq ($(CONFIG_CDEF_SINGLEPASS),yes)
LIBAOM_TEST_SRCS-$(CONFIG_CDEF) += cdef_test.cc
LIBAOM_TEST_SRCS-yes += cdef_test.cc
else
LIBAOM_TEST_SRCS-$(CONFIG_CDEF) += dering_test.cc
LIBAOM_TEST_SRCS-$(CONFIG_CDEF) += clpf_test.cc
LIBAOM_TEST_SRCS-yes += dering_test.cc
LIBAOM_TEST_SRCS-yes += clpf_test.cc
endif
LIBAOM_TEST_SRCS-yes += simd_cmp_impl.h
LIBAOM_TEST_SRCS-$(HAVE_SSE2) += simd_cmp_sse2.cc
......