Add checks to disable PC_WIENER if superres is on
Since tx_skip will be misaligned with superres, turn PC_WIENER
off when superres is on.
This piece of code was missed when we moved code from
research-in-loop-filters branch.
diff --git a/av1/decoder/decodeframe.c b/av1/decoder/decodeframe.c
index 26028bb..21ad549 100644
--- a/av1/decoder/decodeframe.c
+++ b/av1/decoder/decodeframe.c
@@ -2688,6 +2688,12 @@
#if CONFIG_LR_FLEX_SYNTAX
uint8_t plane_lr_tools_disable_mask =
cm->seq_params.lr_tools_disable_mask[p > 0];
+#if CONFIG_PC_WIENER
+ // If superres is used turn off PC_WIENER since tx_skip values will
+ // be misaligned.
+ if (av1_superres_scaled(cm))
+ plane_lr_tools_disable_mask |= (1 << RESTORE_PC_WIENER);
+#endif // CONFIG_PC_WIENER
av1_set_lr_tools(plane_lr_tools_disable_mask, p, &cm->features);
const int ndx = rb_read_uniform(rb, cm->features.lr_frame_tools_count[p]);
rsi->frame_restoration_type = index_to_frame_restoration_type(cm, p, ndx);
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 7de9ac9..aa75140 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -3045,6 +3045,24 @@
cm->cur_frame->buf.render_height = cm->render_height;
cm->cur_frame->buf.bit_depth = (unsigned int)seq_params->bit_depth;
+#if CONFIG_LR_FLEX_SYNTAX
+ // If superres is used turn off PC_WIENER since tx_skip values will
+ // not be aligned.
+ uint8_t master_lr_tools_disable_mask[2] = {
+ cm->seq_params.lr_tools_disable_mask[0],
+ cm->seq_params.lr_tools_disable_mask[1]
+ };
+#if CONFIG_PC_WIENER
+ if (av1_superres_scaled(cm)) {
+ master_lr_tools_disable_mask[0] |= (1 << RESTORE_PC_WIENER);
+ master_lr_tools_disable_mask[1] |= (1 << RESTORE_PC_WIENER);
+ }
+#endif // CONFIG_PC_WIENER
+ av1_set_lr_tools(master_lr_tools_disable_mask[0], 0, &cm->features);
+ av1_set_lr_tools(master_lr_tools_disable_mask[1], 1, &cm->features);
+ av1_set_lr_tools(master_lr_tools_disable_mask[1], 2, &cm->features);
+#endif // CONFIG_LR_FLEX_SYNTAX
+
// Pick the loop filter level for the frame.
if (!is_global_intrabc_allowed(cm)) {
loopfilter_frame(cpi, cm);