Commit 3f7f1943 authored by Jim Bankoski's avatar Jim Bankoski

Adds a fastssim metric to VPX internal stats.

This code appeared in the Daala project first and was originally
committed by Nathan Egge.

Change-Id: Iadce416a091929c51b46637ebdec984cddcaf18c
parent e865be95
......@@ -1615,7 +1615,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
cpi->total_ssimg_v = 0;
cpi->total_ssimg_all = 0;
}
cpi->total_fastssim_all = 0;
#endif
cpi->first_time_stamp_ever = INT64_MAX;
......@@ -1849,14 +1849,18 @@ void vp9_remove_compressor(VP9_COMP *cpi) {
const double totalp_ssim = 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",
"VPXSSIM\tVPSSIMP\tFASTSSIM 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%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,
total_encode_time);
}
if (cpi->b_calculate_ssimg) {
fprintf(f, "BitRate\tSSIM_Y\tSSIM_U\tSSIM_V\tSSIM_A\t Time(ms)\n");
fprintf(f, "%7.2f\t%6.4f\t%6.4f\t%6.4f\t%6.4f\t%8.0f\n", dr,
......@@ -4142,6 +4146,17 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
cpi->total_ssimg_v += v;
cpi->total_ssimg_all += frame_all;
}
{
double y, u, v, frame_all;
frame_all = vp9_calc_fastssim(cpi->Source, cm->frame_to_show, &y, &u,
&v);
cpi->total_fastssim_y += y;
cpi->total_fastssim_u += u;
cpi->total_fastssim_v += v;
cpi->total_fastssim_all += frame_all;
/* TODO(JBB): add 10/12 bit support */
}
}
}
......
......@@ -415,6 +415,11 @@ typedef struct VP9_COMP {
double total_ssimg_v;
double total_ssimg_all;
double total_fastssim_y;
double total_fastssim_u;
double total_fastssim_v;
double total_fastssim_all;
int b_calculate_ssimg;
#endif
int b_calculate_psnr;
......
This diff is collapsed.
......@@ -23,6 +23,9 @@ double vp9_calc_ssim(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
double vp9_calc_ssimg(YV12_BUFFER_CONFIG *source, YV12_BUFFER_CONFIG *dest,
double *ssim_y, double *ssim_u, double *ssim_v);
double vp9_calc_fastssim(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,
......
......@@ -34,6 +34,7 @@ VP9_CX_SRCS-yes += encoder/vp9_encodemv.c
VP9_CX_SRCS-yes += encoder/vp9_ethread.h
VP9_CX_SRCS-yes += encoder/vp9_ethread.c
VP9_CX_SRCS-yes += encoder/vp9_extend.c
VP9_CX_SRCS-$(CONFIG_INTERNAL_STATS) += encoder/vp9_fastssim.c
VP9_CX_SRCS-yes += encoder/vp9_firstpass.c
VP9_CX_SRCS-yes += encoder/vp9_block.h
VP9_CX_SRCS-yes += encoder/vp9_writer.h
......
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