Commit 02affd26 authored by Yaowu Xu's avatar Yaowu Xu

misc-fix: use enum for reset_frame_context consts

This commit merge the fixes that address the issues with the syntax
element reset_frame_context, and the conflict between frame_parallel_
decoding_mode and refresh_frame_context.

Related tracking issue:
https://bugs.chromium.org/p/webm/issues/detail?id=1030
Original libvpx commit:
62da0bf1
d1474f02

Change-Id: Iff0369c272d5eca5207b307a70911965a1f2f404
parent 5e941728
......@@ -1762,7 +1762,6 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
if (cm->error_resilient_mode) {
cm->reset_frame_context = RESET_FRAME_CONTEXT_ALL;
} else {
#if CONFIG_MISC_FIXES
if (cm->intra_only) {
cm->reset_frame_context = aom_rb_read_bit(rb)
? RESET_FRAME_CONTEXT_ALL
......@@ -1776,15 +1775,6 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
? RESET_FRAME_CONTEXT_ALL
: RESET_FRAME_CONTEXT_CURRENT;
}
#else
static const RESET_FRAME_CONTEXT_MODE reset_frame_context_conv_tbl[4] = {
RESET_FRAME_CONTEXT_NONE, RESET_FRAME_CONTEXT_NONE,
RESET_FRAME_CONTEXT_CURRENT, RESET_FRAME_CONTEXT_ALL
};
cm->reset_frame_context =
reset_frame_context_conv_tbl[aom_rb_read_literal(rb, 2)];
#endif
}
if (cm->intra_only) {
......@@ -1870,10 +1860,6 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
cm->refresh_frame_context = aom_rb_read_bit(rb)
? REFRESH_FRAME_CONTEXT_FORWARD
: REFRESH_FRAME_CONTEXT_BACKWARD;
#if !CONFIG_MISC_FIXES
} else {
aom_rb_read_bit(rb); // parallel decoding mode flag
#endif
}
} else {
cm->refresh_frame_context = REFRESH_FRAME_CONTEXT_OFF;
......
......@@ -2003,7 +2003,6 @@ static void write_uncompressed_header(AV1_COMP *cpi,
if (!cm->show_frame) aom_wb_write_bit(wb, cm->intra_only);
if (!cm->error_resilient_mode) {
#if CONFIG_MISC_FIXES
if (cm->intra_only) {
aom_wb_write_bit(wb,
cm->reset_frame_context == RESET_FRAME_CONTEXT_ALL);
......@@ -2014,12 +2013,6 @@ static void write_uncompressed_header(AV1_COMP *cpi,
aom_wb_write_bit(wb,
cm->reset_frame_context == RESET_FRAME_CONTEXT_ALL);
}
#else
static const int reset_frame_context_conv_tbl[3] = { 0, 2, 3 };
aom_wb_write_literal(
wb, reset_frame_context_conv_tbl[cm->reset_frame_context], 2);
#endif
}
#if CONFIG_EXT_REFS
......@@ -2080,9 +2073,7 @@ static void write_uncompressed_header(AV1_COMP *cpi,
if (!cm->error_resilient_mode) {
aom_wb_write_bit(wb,
cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_OFF);
#if CONFIG_MISC_FIXES
if (cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_OFF)
#endif
aom_wb_write_bit(
wb, cm->refresh_frame_context != REFRESH_FRAME_CONTEXT_BACKWARD);
}
......
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