Commit 6c998d75 authored by Sarah Parker's avatar Sarah Parker

Avoid sending gm params if source and ref are different sizes

Change-Id: I4b4272c99ba6ff4d983dcb694b3ea4d5de1b4e14
parent 1bc82866
......@@ -4892,10 +4892,17 @@ static void read_global_motion_params(WarpedMotionParams *params,
static void read_global_motion(AV1_COMMON *cm, aom_reader *r) {
int frame;
YV12_BUFFER_CONFIG *ref_buf;
for (frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
read_global_motion_params(&cm->global_motion[frame],
&cm->prev_frame->global_motion[frame], r,
cm->allow_high_precision_mv);
ref_buf = get_ref_frame(cm, frame);
if (cm->width == ref_buf->y_crop_width &&
cm->height == ref_buf->y_crop_height) {
read_global_motion_params(&cm->global_motion[frame],
&cm->prev_frame->global_motion[frame], r,
cm->allow_high_precision_mv);
} else {
set_default_warp_params(&cm->global_motion[frame]);
}
/*
printf("Dec Ref %d [%d/%d]: %d %d %d %d\n",
frame, cm->current_video_frame, cm->show_frame,
......
......@@ -4494,10 +4494,18 @@ static void write_global_motion_params(WarpedMotionParams *params,
static void write_global_motion(AV1_COMP *cpi, aom_writer *w) {
AV1_COMMON *const cm = &cpi->common;
int frame;
YV12_BUFFER_CONFIG *ref_buf;
for (frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
write_global_motion_params(&cm->global_motion[frame],
&cm->prev_frame->global_motion[frame], w,
cm->allow_high_precision_mv);
ref_buf = get_ref_frame_buffer(cpi, frame);
if (cpi->source->y_crop_width == ref_buf->y_crop_width &&
cpi->source->y_crop_height == ref_buf->y_crop_height) {
write_global_motion_params(&cm->global_motion[frame],
&cm->prev_frame->global_motion[frame], w,
cm->allow_high_precision_mv);
} else {
assert(cm->global_motion[frame].wmtype == IDENTITY &&
"Invalid warp type for frames of different resolutions");
}
/*
printf("Frame %d/%d: Enc Ref %d (used %d): %d %d %d %d\n",
cm->current_video_frame, cm->show_frame, frame,
......
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