Add speed feature to skip repeat interp search
Add speed feature to skip repeat interpolation
filter search (turn on for speed>=1)
1. Save the search result and current mv and ref_frame
at the end of each search for one block
2. At the begining of each search, check the saved
results, if there is matched result which has same
mv and ref_frame, the result can be reused.
3. Clear saved result at the begining of
av1_rd_pick_inter_mode_sb, search result only reused
in the same block.
4. For encoder, about 2.5% faster shows by encoding
15 frame of BasketballDrill_832x480_50.y4m, with no
coding loss. ( 486668 ms -> 474152 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=15
Change-Id: I333c02736c8f4a280ff710fed5e5ec053ad5d9aa
diff --git a/av1/encoder/block.h b/av1/encoder/block.h
index d372890..bbd5734 100644
--- a/av1/encoder/block.h
+++ b/av1/encoder/block.h
@@ -166,6 +166,13 @@
int sample_counts; // Number of samples collected.
} FIRST_PARTITION_PASS_STATS;
+#define MAX_INTERP_FILTER_STATS 64
+typedef struct {
+ InterpFilters filters;
+ MV mv[2];
+ int8_t ref_frames[2];
+} INTERPOLATION_FILTER_STATS;
+
typedef struct macroblock MACROBLOCK;
struct macroblock {
struct macroblock_plane plane[MAX_MB_PLANE];
@@ -183,6 +190,10 @@
FIRST_PARTITION_PASS_STATS
first_partition_pass_stats[FIRST_PARTITION_PASS_STATS_TABLES];
+ // [comp_idx][saved stat_idx]
+ INTERPOLATION_FILTER_STATS interp_filter_stats[2][MAX_INTERP_FILTER_STATS];
+ int interp_filter_stats_idx[2];
+
// Activate constrained coding block partition search range.
int use_cb_search_range;