diff options
author | Ronald S. Bultje <rbultje@google.com> | 2013-04-01 17:22:29 -0700 |
---|---|---|
committer | Gerrit Code Review <gerrit@gerrit.golo.chromium.org> | 2013-04-01 17:22:29 -0700 |
commit | cdac4ad4e67b7a3407cf05537bc8424272571ee1 (patch) | |
tree | 85b381038287cc12c577ad3ca005f51dc56115ea /vp9/encoder/vp9_onyx_if.c | |
parent | e3955007dff1a32bb3b63f3f415b09c616f665a4 (diff) | |
parent | 6dd6ffb0bbb450069553f4484871b1e378b18c04 (diff) | |
download | libvpx-cdac4ad4e67b7a3407cf05537bc8424272571ee1.tar libvpx-cdac4ad4e67b7a3407cf05537bc8424272571ee1.tar.gz libvpx-cdac4ad4e67b7a3407cf05537bc8424272571ee1.tar.bz2 libvpx-cdac4ad4e67b7a3407cf05537bc8424272571ee1.zip |
Merge "Calculate SSIM over both reconstruction as well as postproc buffer." into experimental
Diffstat (limited to 'vp9/encoder/vp9_onyx_if.c')
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index 656975aa4..912db5edb 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -1514,6 +1514,8 @@ VP9_PTR vp9_create_compressor(VP9_CONFIG *oxcf) { cpi->tot_recode_hits = 0; cpi->summed_quality = 0; cpi->summed_weights = 0; + cpi->summedp_quality = 0; + cpi->summedp_weights = 0; } if (cpi->b_calculate_ssimg) { @@ -1709,18 +1711,25 @@ void vp9_remove_compressor(VP9_PTR *ptr) { if (cpi->b_calculate_psnr) { YV12_BUFFER_CONFIG *lst_yv12 = &cpi->common.yv12_fb[cpi->common.ref_frame_map[cpi->lst_fb_idx]]; - double samples = 3.0 / 2 * cpi->count * lst_yv12->y_width * lst_yv12->y_height; + double samples = 3.0 / 2 * cpi->count * + lst_yv12->y_width * lst_yv12->y_height; double total_psnr = vp9_mse2psnr(samples, 255.0, cpi->total_sq_error); double total_psnr2 = vp9_mse2psnr(samples, 255.0, cpi->total_sq_error2); - double total_ssim = 100 * pow(cpi->summed_quality / cpi->summed_weights, 8.0); - - fprintf(f, "Bitrate\tAVGPsnr\tGLBPsnr\tAVPsnrP\tGLPsnrP\tVPXSSIM\t Time(ms)\n"); - fprintf(f, "%7.2f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%8.0f\n", - dr, cpi->total / cpi->count, total_psnr, cpi->totalp / cpi->count, total_psnr2, total_ssim, + double total_ssim = 100 * pow(cpi->summed_quality / + cpi->summed_weights, 8.0); + double total_ssimp = 100 * pow(cpi->summedp_quality / + cpi->summedp_weights, 8.0); + + fprintf(f, "Bitrate\tAVGPsnr\tGLBPsnr\tAVPsnrP\tGLPsnrP\t" + "VPXSSIM\tVPSSIMP\t Time(ms)\n"); + fprintf(f, "%7.2f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%8.0f\n", + dr, cpi->total / cpi->count, total_psnr, + cpi->totalp / cpi->count, total_psnr2, total_ssim, total_ssimp, total_encode_time); -// fprintf(f, "%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%8.0f %10ld\n", -// dr, cpi->total / cpi->count, total_psnr, cpi->totalp / cpi->count, total_psnr2, total_ssim, -// total_encode_time, cpi->tot_recode_hits); +// fprintf(f, "%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%7.3f\t%8.0f %10ld\n", +// dr, cpi->total / cpi->count, total_psnr, +// cpi->totalp / cpi->count, total_psnr2, total_ssim, +// total_encode_time, cpi->tot_recode_hits); } if (cpi->b_calculate_ssimg) { @@ -3950,10 +3959,16 @@ int vp9_get_compressed_data(VP9_PTR ptr, unsigned int *frame_flags, cpi->totalp += frame_psnr2; frame_ssim2 = vp9_calc_ssim(cpi->Source, - &cm->post_proc_buffer, 1, &weight); + recon, 1, &weight); cpi->summed_quality += frame_ssim2 * weight; cpi->summed_weights += weight; + + frame_ssim2 = vp9_calc_ssim(cpi->Source, + &cm->post_proc_buffer, 1, &weight); + + cpi->summedp_quality += frame_ssim2 * weight; + cpi->summedp_weights += weight; #if 0 { FILE *f = fopen("q_used.stt", "a"); |