Commit f289f9f5 authored by Sarah Parker's avatar Sarah Parker

Use default reference gm params in error resilient mode

This allows gm parameters to be written when error resilient mode
is enabled but avoids depending on stored parameters from the
previous frame.

BUG=aomedia:741

Change-Id: Iae455a346e0eebb18e2bcfadc8826c75aedfee99
parent 5b2021ea
......@@ -4368,6 +4368,8 @@ static int read_global_motion_params(WarpedMotionParams *params,
static void read_global_motion(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
int frame;
for (frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
if (cm->error_resilient_mode)
set_default_warp_params(&cm->prev_frame->global_motion[frame]);
int good_params = read_global_motion_params(
&cm->global_motion[frame], &cm->prev_frame->global_motion[frame], rb,
cm->allow_high_precision_mv);
......@@ -4398,6 +4400,7 @@ static void read_global_motion(AV1_COMMON *cm, struct aom_read_bit_buffer *rb) {
cm->global_motion[frame].wmmat[3]);
*/
}
if (!cm->error_resilient_mode)
memcpy(cm->cur_frame->global_motion, cm->global_motion,
TOTAL_REFS_PER_FRAME * sizeof(WarpedMotionParams));
}
......@@ -4859,8 +4862,7 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
#endif // CONFIG_EXT_TX
#if CONFIG_GLOBAL_MOTION
if (!(frame_is_intra_only(cm) || cm->error_resilient_mode))
read_global_motion(cm, rb);
if (!frame_is_intra_only(cm)) read_global_motion(cm, rb);
#endif
read_tile_info(pbi, rb);
......
......@@ -4306,6 +4306,8 @@ static void write_global_motion(AV1_COMP *cpi,
AV1_COMMON *const cm = &cpi->common;
int frame;
for (frame = LAST_FRAME; frame <= ALTREF_FRAME; ++frame) {
if (cm->error_resilient_mode)
set_default_warp_params(&cm->prev_frame->global_motion[frame]);
write_global_motion_params(&cm->global_motion[frame],
&cm->prev_frame->global_motion[frame], wb,
cm->allow_high_precision_mv);
......@@ -4614,8 +4616,7 @@ static void write_uncompressed_header(AV1_COMP *cpi,
#endif // CONFIG_EXT_TX
#if CONFIG_GLOBAL_MOTION
if (!(frame_is_intra_only(cm) || cm->error_resilient_mode))
write_global_motion(cpi, wb);
if (!frame_is_intra_only(cm)) write_global_motion(cpi, wb);
#endif // CONFIG_GLOBAL_MOTION
write_tile_info(cm, wb);
......
......@@ -5224,6 +5224,8 @@ static void encode_frame_internal(AV1_COMP *cpi) {
ref_buf[frame] = get_ref_frame_buffer(cpi, frame);
int pframe;
set_default_warp_params(&cm->global_motion[frame]);
if (cm->error_resilient_mode)
set_default_warp_params(&cm->prev_frame->global_motion[frame]);
// check for duplicate buffer
for (pframe = LAST_FRAME; pframe < frame; ++pframe) {
if (ref_buf[frame] == ref_buf[pframe]) break;
......@@ -5326,6 +5328,7 @@ static void encode_frame_internal(AV1_COMP *cpi) {
}
cpi->global_motion_search_done = 1;
}
if (!cm->error_resilient_mode)
memcpy(cm->cur_frame->global_motion, cm->global_motion,
TOTAL_REFS_PER_FRAME * sizeof(WarpedMotionParams));
#endif // CONFIG_GLOBAL_MOTION
......
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