Commit d300f0e4 authored by Cheng Chen's avatar Cheng Chen
Browse files

Extend frame marker bits from 4 to 5

Although four bits are enough to represent current distances since
Golden Frame Group is 16, for flexibility, we use 5 bits and allow
frame distance up to 32.

BUG=aomedia:1072

Change-Id: I9f413baffd656eb8bd54333ba31a4e33faefd57a
parent 95d900a2
......@@ -86,6 +86,11 @@ extern "C" {
// MAX_PALETTE_BSIZE.
#define PALETTE_BLOCK_SIZES (MAX_PALETTE_BSIZE - MIN_PALETTE_BSIZE + 1)
#if CONFIG_FRAME_MARKER
#define FRAME_OFFSET_BITS 5
#define MAX_FRAME_DISTANCE ((1 << FRAME_OFFSET_BITS) - 1)
#endif
#if CONFIG_LOOPFILTER_LEVEL
// 4 frame filter levels: y plane vertical, y plane horizontal,
// u plane, and v plane
......@@ -111,8 +116,6 @@ extern "C" {
#define USE_LOOP_FILTER_SUPERBLOCK 1
#endif // CONFIG_LPF_SB
#define MAX_FRAME_DISTANCE (INT16_MAX - 1)
#if CONFIG_JNT_COMP
typedef enum COMPOUND_DIST_WEIGHT_MODE {
DIST,
......
......@@ -2972,7 +2972,8 @@ static size_t read_uncompressed_header(AV1Decoder *pbi,
#if CONFIG_FRAME_MARKER
if (cm->show_frame == 0) {
cm->frame_offset = cm->current_video_frame + aom_rb_read_literal(rb, 4);
cm->frame_offset =
cm->current_video_frame + aom_rb_read_literal(rb, FRAME_OFFSET_BITS);
} else {
cm->frame_offset = cm->current_video_frame;
}
......
......@@ -3840,7 +3840,7 @@ static void write_uncompressed_header_frame(AV1_COMP *cpi,
cpi->twopass.gf_group.brf_src_offset[cpi->twopass.gf_group.index];
arf_offset = AOMMIN((MAX_GF_INTERVAL - 1), arf_offset + brf_offset);
aom_wb_write_literal(wb, arf_offset, 4);
aom_wb_write_literal(wb, arf_offset, FRAME_OFFSET_BITS);
}
#if CONFIG_EXT_SKIP
......@@ -4213,7 +4213,7 @@ static void write_uncompressed_header_obu(AV1_COMP *cpi,
cpi->twopass.gf_group.brf_src_offset[cpi->twopass.gf_group.index];
arf_offset = AOMMIN((MAX_GF_INTERVAL - 1), arf_offset + brf_offset);
aom_wb_write_literal(wb, arf_offset, 4);
aom_wb_write_literal(wb, arf_offset, FRAME_OFFSET_BITS);
}
#endif
......
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