SUPERRES_AUTO: don't save/restore cur_frame->buf.
Provides speed-up, avoids potential crash, no change in stats.
This was unnecessary:
- The cur_frame->buf is reallocated to appropriate size (if needed) at
the beginning of frame encode anyway, and
- It wasn't needed to save/restore actual content
It was also leading to a potential out-of-bound write in 'seg_map' when
cm->cur_frame->mi_cols != cm->mi_params.mi_cols, in
av1_setup_past_independence().
Related changes:
- Uncomment an assert in aom_yv12_copy_frame_c() that would have caught
this problem.
- Use cm->cur_frame->mi_cols / mi_rows instead of cm->mi_params.mi_cols
/ mi_rows when appropriate.
Change-Id: I7e9a3538f5e8e71879774461a898483dadb41afb
(cherry picked from commit ff783141118bb7c870459dc09a24ef5b026f69bd)
diff --git a/av1/encoder/encoder.c b/av1/encoder/encoder.c
index 13d06dc..6bfc9b0 100644
--- a/av1/encoder/encoder.c
+++ b/av1/encoder/encoder.c
@@ -2795,8 +2795,6 @@
}
}
- release_copy_buffer(&cpi->coding_context);
-
return err;
}
@@ -3066,7 +3064,8 @@
update_reference_segmentation_map(cpi);
} else if (cm->last_frame_seg_map) {
memcpy(cm->cur_frame->seg_map, cm->last_frame_seg_map,
- cm->mi_params.mi_cols * cm->mi_params.mi_rows * sizeof(uint8_t));
+ cm->cur_frame->mi_cols * cm->cur_frame->mi_rows *
+ sizeof(*cm->cur_frame->seg_map));
}
}