Speed up av1_get_switchable_rate
The switchable_ctx for each filter during
interpolation filter type search are always
the same, no need to call av1_get_switchable_rate
repetitively.
For encoder, about 0.3% faster shows by encoding
20 frame of BasketballDrill_832x480_50.y4m.
( 510848 ms -> 509604 ms)
a) gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609
b) CPU: Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz
c) Config cmd
cmake ../ -DENABLE_CCACHE=1 -DCONFIG_LOWBITDEPTH=1
d) Test cmd:
./aomenc --cpu-used=1 --end-usage=vbr \
--target-bitrate=800 --limit=20
Change-Id: I38d4ae3cadf36c38ecb076bd491a8c0bf0abf40d
diff --git a/av1/encoder/rd.h b/av1/encoder/rd.h
index 281b676..692367d 100644
--- a/av1/encoder/rd.h
+++ b/av1/encoder/rd.h
@@ -43,6 +43,9 @@
#define RD_THRESH_MAX_FACT 64
#define RD_THRESH_INC 1
+// Factor to weigh the rate for switchable interp filters.
+#define SWITCHABLE_INTERP_RATE_FACTOR 1
+
// This enumerator type needs to be kept aligned with the mode order in
// const MODE_DEFINITION av1_mode_order[MAX_MODES] used in the rd code.
typedef enum {