[NORMATIVE] Send level for still pictures
This was missed in the original patch.
BUG=aomedia:1725
Change-Id: I38a307748ad2bc87e931123767eb9a23d3fa2361
diff --git a/av1/av1_dx_iface.c b/av1/av1_dx_iface.c
index a707649..050f5dd 100644
--- a/av1/av1_dx_iface.c
+++ b/av1/av1_dx_iface.c
@@ -163,16 +163,24 @@
return length_field_size;
}
-static void parse_operating_points(struct aom_read_bit_buffer *rb) {
- const uint8_t operating_points_minus1_cnt =
- aom_rb_read_literal(rb, OP_POINTS_MINUS1_BITS);
- for (int i = 0; i < operating_points_minus1_cnt + 1; i++) {
- aom_rb_read_literal(rb, OP_POINTS_IDC_BITS); // idc
- aom_rb_read_literal(rb, LEVEL_BITS); // level
- if (aom_rb_read_literal(rb, 1)) { // decoder_rate_model_param_present_flag
- aom_rb_read_literal(rb, 12); // decode_to_display_rate_ratio
- aom_rb_read_literal(rb, 24); // initial_display_delay
- aom_rb_read_literal(rb, 4); // extra_frame_buffers
+static void parse_operating_points(struct aom_read_bit_buffer *rb,
+ int red_hdr) {
+ if (red_hdr) {
+ aom_rb_read_literal(rb, LEVEL_BITS); // level
+ } else {
+ const uint8_t operating_points_minus1_cnt =
+ aom_rb_read_literal(rb, OP_POINTS_MINUS1_BITS);
+ for (int i = 0; i < operating_points_minus1_cnt + 1; i++) {
+ aom_rb_read_literal(rb, OP_POINTS_IDC_BITS); // idc
+ aom_rb_read_literal(rb, LEVEL_BITS); // level
+#if !CONFIG_BUFFER_MODEL
+ if (aom_rb_read_literal(rb,
+ 1)) { // decoder_rate_model_param_present_flag
+ aom_rb_read_literal(rb, 12); // decode_to_display_rate_ratio
+ aom_rb_read_literal(rb, 24); // initial_display_delay
+ aom_rb_read_literal(rb, 4); // extra_frame_buffers
+ }
+#endif // !CONFIG_BUFFER_MODEL
}
}
}
@@ -230,9 +238,7 @@
return AOM_CODEC_UNSUP_BITSTREAM;
}
- if (!reduced_still_picture_hdr) {
- parse_operating_points(&rb);
- }
+ parse_operating_points(&rb, reduced_still_picture_hdr);
int num_bits_width = aom_rb_read_literal(&rb, 4) + 1;
int num_bits_height = aom_rb_read_literal(&rb, 4) + 1;
diff --git a/av1/decoder/obu.c b/av1/decoder/obu.c
index b0e91cc..6b53b00 100644
--- a/av1/decoder/obu.c
+++ b/av1/decoder/obu.c
@@ -160,7 +160,7 @@
if (seq_params->reduced_still_picture_hdr) {
pbi->common.enhancement_layers_cnt = 1;
seq_params->operating_point_idc[0] = 0;
- seq_params->level[0] = 0;
+ seq_params->level[0] = aom_rb_read_literal(rb, LEVEL_BITS);
seq_params->decoder_rate_model_param_present_flag[0] = 0;
} else {
uint8_t operating_points_minus1_cnt =
diff --git a/av1/encoder/bitstream.c b/av1/encoder/bitstream.c
index 75048cc..efa5c29 100644
--- a/av1/encoder/bitstream.c
+++ b/av1/encoder/bitstream.c
@@ -3459,13 +3459,17 @@
// whether to use reduced still picture header
aom_wb_write_bit(&wb, cm->seq_params.reduced_still_picture_hdr);
- if (!cm->seq_params.reduced_still_picture_hdr) {
+ if (cm->seq_params.reduced_still_picture_hdr) {
+ aom_wb_write_literal(&wb, 0, LEVEL_BITS); // level[0]
+ } else {
uint8_t operating_points_minus1_cnt = enhancement_layers_cnt;
- aom_wb_write_literal(&wb, operating_points_minus1_cnt, 5);
+ aom_wb_write_literal(&wb, operating_points_minus1_cnt,
+ OP_POINTS_MINUS1_BITS);
int i;
for (i = 0; i < operating_points_minus1_cnt + 1; i++) {
- aom_wb_write_literal(&wb, 0, 12); // operating_point_idc[i]
- aom_wb_write_literal(&wb, 0, 4); // level[i]
+ aom_wb_write_literal(&wb, 0,
+ OP_POINTS_IDC_BITS); // operating_point_idc[i]
+ aom_wb_write_literal(&wb, 0, LEVEL_BITS); // level[i]
#if !CONFIG_BUFFER_MODEL
aom_wb_write_literal(&wb, 0, 1); // decoder_rate_model_present_flag[i]
#endif