Simplify the search in pickrst.c
The end results should be essentially the same, except hopefully a
little better because the previous code got the costing slightly
wrong if there were multiple tiles.
The code was doing something quite complicated to search for the best
restoration types; this patch makes it much simpler. Basically,
av1_pick_filter_restoration loops over the planes in the image. For
each plane, it loops over the possible restoration types, calling
search_rest_type for each one.
search_rest_type iterates over the restoration units in the image,
resetting the current context on tile boundaries and calling
search_<rest_type> for each restoration unit.
The search_norestore function just computes the SSE error with no
restoration. The search_wiener and search_sgrproj functions compute
the best set of coefficients and then the resulting SSE error with
those coefficients (ignoring the bit cost, so the result can be
re-used for switchable restoration).
In all cases but search_norestore, the search function has to decide
what restoration type is best for each restoration unit. For example,
search_wiener could choose to enable or disable Wiener filtering on
this unit.
Eventually, search_rest_type calculates the RDCOST after summing bit
rates and SSE errors over the restoration units. This cost gets
returned to av1_pick_filter_restoration which can then choose the best
frame-level restoration type.
Change-Id: I9bc17eb47cc46413adae749a43a440825c41bba6
diff --git a/av1/encoder/encoder.h b/av1/encoder/encoder.h
index b326d5c..d01a31a 100644
--- a/av1/encoder/encoder.h
+++ b/av1/encoder/encoder.h
@@ -435,9 +435,7 @@
YV12_BUFFER_CONFIG last_frame_uf;
#if CONFIG_LOOP_RESTORATION
YV12_BUFFER_CONFIG trial_frame_rst;
- uint8_t *extra_rstbuf; // Extra buffers used in restoration search
- RestorationInfo rst_search[MAX_MB_PLANE]; // Used for encoder side search
-#endif // CONFIG_LOOP_RESTORATION
+#endif
// Ambient reconstruction err target for force key frames
int64_t ambient_err;