summaryrefslogtreecommitdiff
path: root/vp9
diff options
context:
space:
mode:
authorDeepa K G <deepa.kg@ittiam.com>2019-01-22 16:13:03 +0530
committerDeepa K G <deepa.kg@ittiam.com>2019-04-18 07:39:23 +0000
commit66772d2b11a91450a7e2a08471de8e1be6fc0f2d (patch)
treef8e041594cd9485dfb848aa1d55aabe1d5fbc5a3 /vp9
parente718cade1dc7179daede6b695166702dbf6ab8b4 (diff)
downloadlibvpx-66772d2b11a91450a7e2a08471de8e1be6fc0f2d.tar
libvpx-66772d2b11a91450a7e2a08471de8e1be6fc0f2d.tar.gz
libvpx-66772d2b11a91450a7e2a08471de8e1be6fc0f2d.tar.bz2
libvpx-66772d2b11a91450a7e2a08471de8e1be6fc0f2d.zip
Fix issues with bits allocated and consumed
For show existing frames, set the variables this_frame_target and projected_frame_size correctly. Change-Id: Id5f06eb4ac195f6b63c0199d9d761eaaaea79bbd
Diffstat (limited to 'vp9')
-rw-r--r--vp9/encoder/vp9_bitstream.c7
-rw-r--r--vp9/encoder/vp9_encoder.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/vp9/encoder/vp9_bitstream.c b/vp9/encoder/vp9_bitstream.c
index 1eac502c7..da600fb8e 100644
--- a/vp9/encoder/vp9_bitstream.c
+++ b/vp9/encoder/vp9_bitstream.c
@@ -1356,7 +1356,12 @@ void vp9_pack_bitstream(VP9_COMP *cpi, uint8_t *dest, size_t *size) {
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
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index 4f103ff26..f7e3237dc 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -3748,6 +3748,7 @@ static int encode_without_recode_loop(VP9_COMP *cpi, size_t *size,
: 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 @@ static void encode_with_recode_loop(VP9_COMP *cpi, size_t *size,
#endif
if (cm->show_existing_frame) {
+ rc->this_frame_target = 0;
if (is_psnr_calc_enabled(cpi)) set_raw_source_frame(cpi);
return;
}