Commit d418f68e authored by Sebastien Alaiwan's avatar Sebastien Alaiwan

Simplify FRAME_ID constants

Change-Id: I75890c0f64f93f48299895d1e0bcfbf91846a4ab
parent 06b40cc3
......@@ -59,9 +59,9 @@ extern "C" {
#if CONFIG_REFERENCE_BUFFER
/* Constant values while waiting for the sequence header */
#define FRAME_ID_NUMBERS_PRESENT_FLAG 1
#define FRAME_ID_LENGTH_MINUS7 8 // Allows frame id up to 2^15-1
#define DELTA_FRAME_ID_LENGTH_MINUS2 12 // Allows frame id deltas up to 2^14-1
#endif // CONFIG_REFERENCE_BUFFER
#define FRAME_ID_LENGTH 15
#define DELTA_FRAME_ID_LENGTH 14
#endif // CONFIG_REFERENCE_BUFFER
#if CONFIG_NO_FRAME_CONTEXT_SIGNALING
#define FRAME_CONTEXTS (FRAME_BUFFERS + 1)
......
......@@ -3592,8 +3592,8 @@ void write_sequence_header(AV1_COMMON *const cm,
cm->large_scale_tile ? 0 :
#endif // CONFIG_EXT_TILE
FRAME_ID_NUMBERS_PRESENT_FLAG;
seq_params->frame_id_length = FRAME_ID_LENGTH_MINUS7 + 7;
seq_params->delta_frame_id_length = DELTA_FRAME_ID_LENGTH_MINUS2 + 2;
seq_params->frame_id_length = FRAME_ID_LENGTH;
seq_params->delta_frame_id_length = DELTA_FRAME_ID_LENGTH;
aom_wb_write_bit(wb, seq_params->frame_id_numbers_present_flag);
if (seq_params->frame_id_numbers_present_flag) {
......@@ -4714,8 +4714,8 @@ static uint32_t write_sequence_header_obu(AV1_COMP *cpi, uint8_t *const dst) {
seq_params->frame_id_numbers_present_flag = FRAME_ID_NUMBERS_PRESENT_FLAG;
aom_wb_write_literal(&wb, seq_params->frame_id_numbers_present_flag, 1);
if (seq_params->frame_id_numbers_present_flag) {
seq_params->frame_id_length = FRAME_ID_LENGTH_MINUS7 + 7;
seq_params->delta_frame_id_length = DELTA_FRAME_ID_LENGTH_MINUS2 + 2;
seq_params->frame_id_length = FRAME_ID_LENGTH;
seq_params->delta_frame_id_length = DELTA_FRAME_ID_LENGTH;
// We must always have delta_frame_id_length < frame_id_length,
// in order for a frame to be referenced with a unique delta.
// Avoid wasting bits by using a coding that enforces this restriction.
......
......@@ -5398,7 +5398,7 @@ static void encode_frame_to_data_rate(AV1_COMP *cpi, size_t *size,
if (cm->seq_params.frame_id_numbers_present_flag) {
/* Non-normative definition of current_frame_id ("frame counter" with
* wraparound) */
const int frame_id_length = FRAME_ID_LENGTH_MINUS7 + 7;
const int frame_id_length = FRAME_ID_LENGTH;
if (cm->current_frame_id == -1) {
int lsb, msb;
/* quasi-random initialization of current_frame_id for a key 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