]> granicus.if.org Git - libvpx/commitdiff
Support code show_existing_frame in bit-stream header
authorJingning Han <jingning@google.com>
Fri, 17 Aug 2018 18:27:37 +0000 (11:27 -0700)
committerJingning Han <jingning@google.com>
Fri, 17 Aug 2018 23:18:32 +0000 (16:18 -0700)
Allow the bit-stream writer to support potential use of
show_existing_frame. At this point, cm->show_existing_frame is
always 0.

Change-Id: I64fed1d72db6d4902d56774854ce24fb7a082e0c

vp9/encoder/vp9_bitstream.c

index 0c6681c2b689ce3ae452b1eb5f971a822e5e2af7..9f39c189b1d5e2fb5b7ef1221811b8209991bce9 100644 (file)
@@ -1192,7 +1192,13 @@ static void write_uncompressed_header(VP9_COMP *cpi,
 
   write_profile(cm->profile, wb);
 
-  vpx_wb_write_bit(wb, 0);  // show_existing_frame
+  // If to use show existing frame.
+  vpx_wb_write_bit(wb, cm->show_existing_frame);
+  if (cm->show_existing_frame) {
+    vpx_wb_write_literal(wb, cpi->alt_fb_idx, 3);
+    return;
+  }
+
   vpx_wb_write_bit(wb, cm->frame_type);
   vpx_wb_write_bit(wb, cm->show_frame);
   vpx_wb_write_bit(wb, cm->error_resilient_mode);