summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangch <wangch@google.com>2017-12-05 18:07:21 -0500
committerwangch <wangch@google.com>2017-12-05 18:07:21 -0500
commiteea111f16ac881275d8088af84d4e942d4527e6e (patch)
tree92173a089930275dabb47b9d5f05722b330bf876
parent90ce21e519505986c413aa493c13128a451df61a (diff)
downloadlibvpx-sandbox/wangch@google.com/vp9.tar.gz
-rw-r--r--vp9/encoder/vp9_encoder.c35
-rw-r--r--vp9/encoder/vp9_firstpass.c1
2 files changed, 36 insertions, 0 deletions
diff --git a/vp9/encoder/vp9_encoder.c b/vp9/encoder/vp9_encoder.c
index d5afbb884..9bd2a516a 100644
--- a/vp9/encoder/vp9_encoder.c
+++ b/vp9/encoder/vp9_encoder.c
@@ -5286,6 +5286,21 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
}
#endif // CONFIG_REALTIME_ONLY
+#if 1
+ {
+ VP9_COMMON *const cm = &cpi->common;
+ TWO_PASS *const twopass = &cpi->twopass;
+ GF_GROUP *const gf_group = &twopass->gf_group;
+
+ printf("Frame=%d, gf_group_update_type[gf_group_index=%d]=%d, "
+ "show_frame=%d\n",
+ cm->current_video_frame, gf_group->index,
+ gf_group->update_type[gf_group->index],
+ cm->show_frame);
+ }
+#endif // 0
+
+
if (cm->refresh_frame_context)
cm->frame_contexts[cm->frame_context_idx] = *cm->fc;
@@ -5319,6 +5334,13 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
if (oxcf->pass != 1) {
double samples = 0.0;
cpi->bytes += (int)(*size);
+
+ #if 1
+ {
+ printf("Frame %d: rate: %d\n",
+ cm->current_video_frame, (int)(*size));
+ }
+#endif // 0
if (cm->show_frame) {
uint32_t bit_depth = 8;
@@ -5348,6 +5370,19 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
cpi->total_sq_error += psnr.sse[0];
cpi->total_samples += psnr.samples[0];
samples = psnr.samples[0];
+
+#if 1
+ {
+ const int rddiv = cpi->rd.RDDIV;
+ const int rdmult = cpi->rd.RDMULT;
+ const int64_t rdcost = RDCOST(
+ rdmult, rddiv, (int)(*size) * 8, psnr.sse[0]);
+ printf("Frame %d: distortion: %" PRIu64 " rdcost: %" PRId64 "\n",
+ cm->current_video_frame, psnr.sse[0], rdcost);
+ printf("%d %d\n", rddiv, rdmult);
+
+ }
+#endif // 0
{
PSNR_STATS psnr2;
diff --git a/vp9/encoder/vp9_firstpass.c b/vp9/encoder/vp9_firstpass.c
index b4c46014c..e042a5606 100644
--- a/vp9/encoder/vp9_firstpass.c
+++ b/vp9/encoder/vp9_firstpass.c
@@ -2600,6 +2600,7 @@ static void define_gf_group(VP9_COMP *cpi, FIRSTPASS_STATS *this_frame) {
#endif
// Set the interval until the next gf.
+ // rc->baseline_gf_interval = 8;
rc->baseline_gf_interval = i - (is_key_frame || rc->source_alt_ref_pending);
// Only encode alt reference frame in temporal base layer. So