Merge "Move psnrhvs function declaration to psnr.h" into nextgenv2
This commit is contained in:
		@@ -53,14 +53,14 @@ double compute_hbd_psnrhvs(const YV12_BUFFER_CONFIG *source,
 | 
				
			|||||||
                           uint32_t in_bd, uint32_t bd) {
 | 
					                           uint32_t in_bd, uint32_t bd) {
 | 
				
			||||||
  double tempy, tempu, tempv;
 | 
					  double tempy, tempu, tempv;
 | 
				
			||||||
  return vpx_psnrhvs(source, dest,
 | 
					  return vpx_psnrhvs(source, dest,
 | 
				
			||||||
                     &tempy, &tempu, &tempv, bd);
 | 
					                     &tempy, &tempu, &tempv, bd, in_bd);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
double compute_psnrhvs(const YV12_BUFFER_CONFIG *source,
 | 
					double compute_psnrhvs(const YV12_BUFFER_CONFIG *source,
 | 
				
			||||||
  const YV12_BUFFER_CONFIG *dest) {
 | 
					  const YV12_BUFFER_CONFIG *dest) {
 | 
				
			||||||
  double tempy, tempu, tempv;
 | 
					  double tempy, tempu, tempv;
 | 
				
			||||||
  return vpx_psnrhvs(source, dest,
 | 
					  return vpx_psnrhvs(source, dest,
 | 
				
			||||||
                     &tempy, &tempu, &tempv, 8);
 | 
					                     &tempy, &tempu, &tempv, 8, 8);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
double compute_hbd_fastssim(const YV12_BUFFER_CONFIG *source,
 | 
					double compute_hbd_fastssim(const YV12_BUFFER_CONFIG *source,
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4097,7 +4097,7 @@ static void compute_internal_stats(VP10_COMP *cpi) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    frame_all = vpx_calc_fastssim(orig, recon, &y, &u, &v, bit_depth);
 | 
					    frame_all = vpx_calc_fastssim(orig, recon, &y, &u, &v, bit_depth);
 | 
				
			||||||
    adjust_image_stat(y, u, v, frame_all, &cpi->fastssim);
 | 
					    adjust_image_stat(y, u, v, frame_all, &cpi->fastssim);
 | 
				
			||||||
    frame_all = vpx_psnrhvs(orig, recon, &y, &u, &v, bit_depth);
 | 
					    frame_all = vpx_psnrhvs(orig, recon, &y, &u, &v, bit_depth, in_bit_depth);
 | 
				
			||||||
    adjust_image_stat(y, u, v, frame_all, &cpi->psnrhvs);
 | 
					    adjust_image_stat(y, u, v, frame_all, &cpi->psnrhvs);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -4314,9 +4314,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    if (cm->show_frame) {
 | 
					    if (cm->show_frame) {
 | 
				
			||||||
      uint32_t bit_depth = 8;
 | 
					      uint32_t bit_depth = 8;
 | 
				
			||||||
#if CONFIG_VP9_HIGHBITDEPTH
 | 
					 | 
				
			||||||
      uint32_t in_bit_depth = 8;
 | 
					      uint32_t in_bit_depth = 8;
 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
      cpi->count++;
 | 
					      cpi->count++;
 | 
				
			||||||
#if CONFIG_VP9_HIGHBITDEPTH
 | 
					#if CONFIG_VP9_HIGHBITDEPTH
 | 
				
			||||||
    if (cm->use_highbitdepth) {
 | 
					    if (cm->use_highbitdepth) {
 | 
				
			||||||
@@ -4460,7 +4458,7 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
 | 
				
			|||||||
      {
 | 
					      {
 | 
				
			||||||
        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(cpi->Source, cm->frame_to_show, &y, &u, &v,
 | 
				
			||||||
                                bit_depth);
 | 
					                                bit_depth, in_bit_depth);
 | 
				
			||||||
        adjust_image_stat(y, u, v, frame_all, &cpi->psnrhvs);
 | 
					        adjust_image_stat(y, u, v, frame_all, &cpi->psnrhvs);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -56,6 +56,11 @@ void calc_psnr(const YV12_BUFFER_CONFIG *a,
 | 
				
			|||||||
               const YV12_BUFFER_CONFIG *b,
 | 
					               const YV12_BUFFER_CONFIG *b,
 | 
				
			||||||
               PSNR_STATS *psnr);
 | 
					               PSNR_STATS *psnr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					double vpx_psnrhvs(const YV12_BUFFER_CONFIG *source,
 | 
				
			||||||
 | 
					                   const YV12_BUFFER_CONFIG *dest,
 | 
				
			||||||
 | 
					                   double *phvs_y, double *phvs_u,
 | 
				
			||||||
 | 
					                   double *phvs_v, uint32_t bd, uint32_t in_bd);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int64_t highbd_get_sse(const uint8_t *a, int a_stride,
 | 
					int64_t highbd_get_sse(const uint8_t *a, int a_stride,
 | 
				
			||||||
                       const uint8_t *b, int b_stride,
 | 
					                       const uint8_t *b, int b_stride,
 | 
				
			||||||
                       int width, int height);
 | 
					                       int width, int height);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -248,27 +248,27 @@ static double calc_psnrhvs(const unsigned char *src, int _systride,
 | 
				
			|||||||
  return ret;
 | 
					  return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
double vpx_psnrhvs(const YV12_BUFFER_CONFIG *source,
 | 
					double vpx_psnrhvs(const YV12_BUFFER_CONFIG *src,
 | 
				
			||||||
                   const YV12_BUFFER_CONFIG *dest, double *y_psnrhvs,
 | 
					                   const YV12_BUFFER_CONFIG *dest, double *y_psnrhvs,
 | 
				
			||||||
                   double *u_psnrhvs, double *v_psnrhvs, uint32_t bit_depth) {
 | 
					                   double *u_psnrhvs, double *v_psnrhvs,
 | 
				
			||||||
 | 
					                   uint32_t bd, uint32_t in_bd) {
 | 
				
			||||||
  double psnrhvs;
 | 
					  double psnrhvs;
 | 
				
			||||||
  const double par = 1.0;
 | 
					  const double par = 1.0;
 | 
				
			||||||
  const int step = 7;
 | 
					  const int step = 7;
 | 
				
			||||||
  vpx_clear_system_state();
 | 
					  vpx_clear_system_state();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  assert(bit_depth == 8 || bit_depth == 10 || bit_depth == 12);
 | 
					  assert(bd == 8 || bd == 10 || bd == 12);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  *y_psnrhvs = calc_psnrhvs(source->y_buffer, source->y_stride, dest->y_buffer,
 | 
					  *y_psnrhvs = calc_psnrhvs(src->y_buffer, src->y_stride, dest->y_buffer,
 | 
				
			||||||
                            dest->y_stride, par, source->y_crop_width,
 | 
					                            dest->y_stride, par, src->y_crop_width,
 | 
				
			||||||
                            source->y_crop_height, step, csf_y, bit_depth);
 | 
					                            src->y_crop_height, step, csf_y, bd);
 | 
				
			||||||
  *u_psnrhvs = calc_psnrhvs(source->u_buffer, source->uv_stride, dest->u_buffer,
 | 
					  *u_psnrhvs = calc_psnrhvs(src->u_buffer, src->uv_stride, dest->u_buffer,
 | 
				
			||||||
                            dest->uv_stride, par, source->uv_crop_width,
 | 
					                            dest->uv_stride, par, src->uv_crop_width,
 | 
				
			||||||
                            source->uv_crop_height, step, csf_cb420, bit_depth);
 | 
					                            src->uv_crop_height, step, csf_cb420, bd);
 | 
				
			||||||
 | 
					  *v_psnrhvs = calc_psnrhvs(src->v_buffer, src->uv_stride, dest->v_buffer,
 | 
				
			||||||
  *v_psnrhvs = calc_psnrhvs(source->v_buffer, source->uv_stride, dest->v_buffer,
 | 
					                            dest->uv_stride, par, src->uv_crop_width,
 | 
				
			||||||
                            dest->uv_stride, par, source->uv_crop_width,
 | 
					                            src->uv_crop_height, step, csf_cr420, bd);
 | 
				
			||||||
                            source->uv_crop_height, step, csf_cr420, bit_depth);
 | 
					 | 
				
			||||||
  psnrhvs = (*y_psnrhvs) * .8 + .1 * ((*u_psnrhvs) + (*v_psnrhvs));
 | 
					  psnrhvs = (*y_psnrhvs) * .8 + .1 * ((*u_psnrhvs) + (*v_psnrhvs));
 | 
				
			||||||
  return convert_score_db(psnrhvs, 1.0, bit_depth);
 | 
					  return convert_score_db(psnrhvs, 1.0, bd);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -75,11 +75,6 @@ double vpx_calc_fastssim(const YV12_BUFFER_CONFIG *source,
 | 
				
			|||||||
                         double *ssim_y, double *ssim_u,
 | 
					                         double *ssim_y, double *ssim_u,
 | 
				
			||||||
                         double *ssim_v, uint32_t bit_depth);
 | 
					                         double *ssim_v, uint32_t bit_depth);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
double vpx_psnrhvs(const YV12_BUFFER_CONFIG *source,
 | 
					 | 
				
			||||||
                   const YV12_BUFFER_CONFIG *dest,
 | 
					 | 
				
			||||||
                   double *phvs_y, double *phvs_u,
 | 
					 | 
				
			||||||
                   double *phvs_v, uint32_t bit_depth);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
#if CONFIG_VP9_HIGHBITDEPTH
 | 
					#if CONFIG_VP9_HIGHBITDEPTH
 | 
				
			||||||
double vpx_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
 | 
					double vpx_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
 | 
				
			||||||
                            const YV12_BUFFER_CONFIG *dest,
 | 
					                            const YV12_BUFFER_CONFIG *dest,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user