shithub: libvpx

Download patch

ref: 19d01533413a20be62dd0b585eeb2e51ce1a0207
parent: 4d56e0969e09a6c74844f7b9c3e68917996fa275
parent: 66772d2b11a91450a7e2a08471de8e1be6fc0f2d
author: Jingning Han <[email protected]>
date: Mon Apr 22 00:59:04 EDT 2019

Merge "Fix issues with bits allocated and consumed"

--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -1356,7 +1356,12 @@
   write_uncompressed_header(cpi, &wb);
 
   // Skip the rest coding process if use show existing frame.
-  if (cpi->common.show_existing_frame) return;
+  if (cpi->common.show_existing_frame) {
+    uncompressed_hdr_size = vpx_wb_bytes_written(&wb);
+    data += uncompressed_hdr_size;
+    *size = data - dest;
+    return;
+  }
 
   saved_wb = wb;
   vpx_wb_write_literal(&wb, 0, 16);  // don't know in advance first part. size
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -3748,6 +3748,7 @@
           : 0;
 
   if (cm->show_existing_frame) {
+    cpi->rc.this_frame_target = 0;
     if (is_psnr_calc_enabled(cpi)) set_raw_source_frame(cpi);
     return 1;
   }
@@ -4071,6 +4072,7 @@
 #endif
 
   if (cm->show_existing_frame) {
+    rc->this_frame_target = 0;
     if (is_psnr_calc_enabled(cpi)) set_raw_source_frame(cpi);
     return;
   }