Commit d803cb96 authored by Urvang Joshi's avatar Urvang Joshi

Fix segmentation fault when encoding all keyframes (kf-max-dist=0).

The issue was that:
- We call av1_setup_pre_planes() when this is not an intra-only frame,
but,
- But, we do motion vector search for any frame other than first frame
Doing both of these only when this is not an intra-only frames makes
logical sense and fixes the crash too.

This also avoids doing motion search for intra-only frames in the first
pass.

Verified that there is no change in compression performance for video,
as well as when forcing all keyframes.

BUG=aomedia:133

Change-Id: I7b18c0568eaa29c6c97f31f226243e5a9dbaecf1
parent c2d38715
......@@ -720,8 +720,7 @@ void av1_first_pass(AV1_COMP *cpi, const struct lookahead_entry *source) {
x->mv_col_min = -((mb_col * 16) + BORDER_MV_PIXELS_B16);
x->mv_col_max = ((cm->mb_cols - 1 - mb_col) * 16) + BORDER_MV_PIXELS_B16;
// Other than for the first frame do a motion search.
if (cm->current_video_frame > 0) {
if (!frame_is_intra_only(cm)) { // Do a motion search
int tmp_err, motion_error, raw_motion_error;
// Assume 0,0 motion with no mv overhead.
MV mv = { 0, 0 }, tmp_mv = { 0, 0 };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment