Commit 9757c1ad authored by Jim Bankoski's avatar Jim Bankoski Committed by Gerrit Code Review

adds psnrhvs to internal stats.

PSNR HVS is a human visual system weighted version of SNR that's
gained some popularity from academia and apparently better matches
MOS testing.

This code is borrowed from the Daala Project but uses our FDCT code.

Change-Id: Idd10fbc93129f7f4734946f6009f87d0f44cd2d7
parent 3f7f1943
......@@ -1615,7 +1615,15 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
cpi->total_ssimg_v = 0;
cpi->total_ssimg_all = 0;
}
cpi->total_fastssim_y = 0;
cpi->total_fastssim_u = 0;
cpi->total_fastssim_v = 0;
cpi->total_fastssim_all = 0;
cpi->total_psnrhvs_y = 0;
cpi->total_psnrhvs_u = 0;
cpi->total_psnrhvs_v = 0;
cpi->total_psnrhvs_all = 0;
#endif
cpi->first_time_stamp_ever = INT64_MAX;
......@@ -1851,12 +1859,13 @@ void vp9_remove_compressor(VP9_COMP *cpi) {
fprintf(f, "Bitrate\tAVGPsnr\tGLBPsnr\tAVPsnrP\tGLPsnrP\t"
"VPXSSIM\tVPSSIMP\tFASTSSIM Time(ms)\n");
"VPXSSIM\tVPSSIMP\tFASTSSIM\tPSNRHVS\tTime(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%7.3f\t%8.0f\n",
"%7.3f\t%7.3f\t%7.3f\t%8.0f\n",
dr, cpi->total / cpi->count, total_psnr,
cpi->totalp / cpi->count, totalp_psnr, total_ssim, totalp_ssim,
cpi->total_fastssim_all / cpi->count,
cpi->total_psnrhvs_all / cpi->count,
total_encode_time);
}
......@@ -4157,6 +4166,15 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
cpi->total_fastssim_all += frame_all;
/* TODO(JBB): add 10/12 bit support */
}
{
double y, u, v, frame_all;
frame_all = vp9_psnrhvs(cpi->Source, cm->frame_to_show, &y, &u, &v);
cpi->total_psnrhvs_y += y;
cpi->total_psnrhvs_u += u;
cpi->total_psnrhvs_v += v;
cpi->total_psnrhvs_all += frame_all;
}
}
}
......
......@@ -420,6 +420,11 @@ typedef struct VP9_COMP {
double total_fastssim_v;
double total_fastssim_all;
double total_psnrhvs_y;
double total_psnrhvs_u;
double total_psnrhvs_v;
double total_psnrhvs_all;
int b_calculate_ssimg;
#endif
int b_calculate_psnr;
......
This diff is collapsed.
......@@ -26,6 +26,9 @@ double vp9_calc_ssimg(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
double vp9_calc_fastssim(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
double *ssim_y, double *ssim_u, double *ssim_v);
double vp9_psnrhvs(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
double *ssim_y, double *ssim_u, double *ssim_v);
#if CONFIG_VP9_HIGHBITDEPTH
double vp9_highbd_calc_ssim(YV12_BUFFER_CONFIG *source,
YV12_BUFFER_CONFIG *dest,
......
......@@ -63,6 +63,7 @@ VP9_CX_SRCS-yes += encoder/vp9_mcomp.c
VP9_CX_SRCS-yes += encoder/vp9_encoder.c
VP9_CX_SRCS-yes += encoder/vp9_picklpf.c
VP9_CX_SRCS-yes += encoder/vp9_picklpf.h
VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += encoder/vp9_psnrhvs.c
VP9_CX_SRCS-yes += encoder/vp9_quantize.c
VP9_CX_SRCS-yes += encoder/vp9_ratectrl.c
VP9_CX_SRCS-yes += encoder/vp9_rd.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment