From eea111f16ac881275d8088af84d4e942d4527e6e Mon Sep 17 00:00:00 2001 From: wangch Date: Tue, 5 Dec 2017 18:07:21 -0500 Subject: [PATCH] Test gerrit. --- vp9/encoder/vp9_encoder.c | 35 +++++++++++++++++++++++++++++++++++ vp9/encoder/vp9_firstpass.c | 1 + 2 files changed, 36 insertions(+) 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