Change to use local variables consistently

This commit does not change the computation, nor results.

Change-Id: I1a7bb47050220d970f075458b507c5e55d93b22e
This commit is contained in:
Yaowu Xu
2016-02-05 08:17:01 -08:00
parent 204e77e059
commit 090eaadf20

View File

@@ -4370,13 +4370,13 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
cpi->bytes += (int)(*size); cpi->bytes += (int)(*size);
if (cm->show_frame) { if (cm->show_frame) {
YV12_BUFFER_CONFIG *orig = cpi->Source;
YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show;
cpi->count++; cpi->count++;
if (cpi->b_calculate_psnr) { if (cpi->b_calculate_psnr) {
YV12_BUFFER_CONFIG *orig = cpi->Source;
YV12_BUFFER_CONFIG *recon = cpi->common.frame_to_show;
YV12_BUFFER_CONFIG *pp = &cm->post_proc_buffer;
PSNR_STATS psnr; PSNR_STATS psnr;
YV12_BUFFER_CONFIG *pp = &cm->post_proc_buffer;
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
calc_highbd_psnr(orig, recon, &psnr, cpi->td.mb.e_mbd.bd, calc_highbd_psnr(orig, recon, &psnr, cpi->td.mb.e_mbd.bd,
cpi->oxcf.input_bit_depth); cpi->oxcf.input_bit_depth);
@@ -4394,7 +4394,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
PSNR_STATS psnr2; PSNR_STATS psnr2;
double frame_ssim2 = 0, weight = 0; double frame_ssim2 = 0, weight = 0;
#if CONFIG_VP9_POSTPROC #if CONFIG_VP9_POSTPROC
if (vpx_alloc_frame_buffer(&cm->post_proc_buffer, if (vpx_alloc_frame_buffer(pp,
recon->y_crop_width, recon->y_crop_height, recon->y_crop_width, recon->y_crop_height,
cm->subsampling_x, cm->subsampling_y, cm->subsampling_x, cm->subsampling_y,
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
@@ -4406,8 +4406,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
"Failed to allocate post processing buffer"); "Failed to allocate post processing buffer");
} }
vp10_deblock(cm->frame_to_show, &cm->post_proc_buffer, vp10_deblock(recon, pp, cm->lf.filter_level * 10 / 6);
cm->lf.filter_level * 10 / 6);
#endif #endif
vpx_clear_system_state(); vpx_clear_system_state();
@@ -4440,13 +4439,13 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
#if CONFIG_VP9_HIGHBITDEPTH #if CONFIG_VP9_HIGHBITDEPTH
if (cm->use_highbitdepth) { if (cm->use_highbitdepth) {
frame_ssim2 = vpx_highbd_calc_ssim( frame_ssim2 = vpx_highbd_calc_ssim(orig, pp, &weight,
orig, &cm->post_proc_buffer, &weight, (int)cm->bit_depth); (int)cm->bit_depth);
} else { } else {
frame_ssim2 = vpx_calc_ssim(orig, &cm->post_proc_buffer, &weight); frame_ssim2 = vpx_calc_ssim(orig, pp, &weight);
} }
#else #else
frame_ssim2 = vpx_calc_ssim(orig, &cm->post_proc_buffer, &weight); frame_ssim2 = vpx_calc_ssim(orig, pp, &weight);
#endif // CONFIG_VP9_HIGHBITDEPTH #endif // CONFIG_VP9_HIGHBITDEPTH
cpi->summedp_quality += frame_ssim2 * weight; cpi->summedp_quality += frame_ssim2 * weight;
@@ -4468,9 +4467,8 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
#endif #endif
{ {
double frame_blockiness = vp10_get_blockiness( double frame_blockiness = vp10_get_blockiness(
cpi->Source->y_buffer, cpi->Source->y_stride, orig->y_buffer, orig->y_stride, recon->y_buffer, recon->y_stride,
cm->frame_to_show->y_buffer, cm->frame_to_show->y_stride, orig->y_width, orig->y_height);
cpi->Source->y_width, cpi->Source->y_height);
cpi->worst_blockiness = cpi->worst_blockiness =
VPXMAX(cpi->worst_blockiness, frame_blockiness); VPXMAX(cpi->worst_blockiness, frame_blockiness);
cpi->total_blockiness += frame_blockiness; cpi->total_blockiness += frame_blockiness;
@@ -4483,10 +4481,8 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
#endif #endif
{ {
double this_inconsistency = vpx_get_ssim_metrics( double this_inconsistency = vpx_get_ssim_metrics(
cpi->Source->y_buffer, cpi->Source->y_stride, orig->y_buffer, orig->y_stride, recon->y_buffer, recon->y_stride,
cm->frame_to_show->y_buffer, cm->frame_to_show->y_stride, orig->y_width, orig->y_height, cpi->ssim_vars, &cpi->metrics, 1);
cpi->Source->y_width, cpi->Source->y_height, cpi->ssim_vars,
&cpi->metrics, 1);
const double peak = (double)((1 << cpi->oxcf.input_bit_depth) - 1); const double peak = (double)((1 << cpi->oxcf.input_bit_depth) - 1);
double consistency = vpx_sse_to_psnr(samples, peak, double consistency = vpx_sse_to_psnr(samples, peak,
@@ -4503,8 +4499,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
#endif #endif
{ {
double y, u, v, frame_all; double y, u, v, frame_all;
frame_all = vpx_calc_fastssim(cpi->Source, cm->frame_to_show, &y, &u, frame_all = vpx_calc_fastssim(orig, recon, &y, &u, &v);
&v);
adjust_image_stat(y, u, v, frame_all, &cpi->fastssim); adjust_image_stat(y, u, v, frame_all, &cpi->fastssim);
/* TODO(JBB): add 10/12 bit support */ /* TODO(JBB): add 10/12 bit support */
} }
@@ -4513,7 +4508,7 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
#endif #endif
{ {
double y, u, v, frame_all; double y, u, v, frame_all;
frame_all = vpx_psnrhvs(cpi->Source, cm->frame_to_show, &y, &u, &v); frame_all = vpx_psnrhvs(orig, recon, &y, &u, &v);
adjust_image_stat(y, u, v, frame_all, &cpi->psnrhvs); adjust_image_stat(y, u, v, frame_all, &cpi->psnrhvs);
} }
} }