From 6305abe1143f0e8d64fcd1e9250ee9a4205eb519 Mon Sep 17 00:00:00 2001 From: Angie Chiang Date: Mon, 24 Oct 2016 12:24:44 -0700 Subject: [PATCH] Refactor: Add macro LOG_SWITCHABLE_FILTERS Change-Id: I7593ff2f8949d8bc26ca1c8577faaefb09640b59 --- av1/common/filter.h | 4 ++++ av1/decoder/decodeframe.c | 2 +- av1/encoder/bitstream.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/av1/common/filter.h b/av1/common/filter.h index 0ac52a9ff..15fc806dc 100644 --- a/av1/common/filter.h +++ b/av1/common/filter.h @@ -33,8 +33,12 @@ extern "C" { #define SUPPORT_NONINTERPOLATING_FILTERS 0 /* turn on for experimentation */ #define SWITCHABLE_FILTERS 5 /* Number of switchable filters */ +#define LOG_SWITCHABLE_FILTERS \ + 3 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */ #else #define SWITCHABLE_FILTERS 3 /* Number of switchable filters */ +#define LOG_SWITCHABLE_FILTERS \ + 2 /* (1 << LOG_SWITCHABLE_FILTERS) > SWITCHABLE_FILTERS */ #endif // CONFIG_EXT_INTERP #define USE_TEMPORALFILTER_12TAP 1 diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c index e39d08e2a..9ffd30a67 100644 --- a/av1/decoder/decodeframe.c +++ b/av1/decoder/decodeframe.c @@ -2239,7 +2239,7 @@ static void setup_segmentation_dequant(AV1_COMMON *const cm) { static InterpFilter read_interp_filter(struct aom_read_bit_buffer *rb) { return aom_rb_read_bit(rb) ? SWITCHABLE - : aom_rb_read_literal(rb, 2 + CONFIG_EXT_INTERP); + : aom_rb_read_literal(rb, LOG_SWITCHABLE_FILTERS); } static void setup_render_size(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) { diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c index df27fbccd..5660e069f 100644 --- a/av1/encoder/bitstream.c +++ b/av1/encoder/bitstream.c @@ -2915,7 +2915,7 @@ static void write_interp_filter(InterpFilter filter, struct aom_write_bit_buffer *wb) { aom_wb_write_bit(wb, filter == SWITCHABLE); if (filter != SWITCHABLE) - aom_wb_write_literal(wb, filter, 2 + CONFIG_EXT_INTERP); + aom_wb_write_literal(wb, filter, LOG_SWITCHABLE_FILTERS); } static void fix_interp_filter(AV1_COMMON *cm, FRAME_COUNTS *counts) {