]> granicus.if.org Git - libvpx/commitdiff
Remove a flavor of SSIM that is never really used.
authorYaowu Xu <yaowu@google.com>
Thu, 4 Feb 2016 22:16:56 +0000 (14:16 -0800)
committerYaowu Xu <yaowu@google.com>
Mon, 8 Feb 2016 19:22:08 +0000 (11:22 -0800)
Change-Id: I61ea7f63acbcfeecd3f7dba5a5a38b980efc802b

vp10/encoder/encoder.c
vp10/encoder/encoder.h
vp8/encoder/onyx_if.c
vp8/encoder/onyx_int.h
vp9/encoder/vp9_encoder.c
vp9/encoder/vp9_encoder.h
vpx_dsp/ssim.c
vpx_dsp/ssim.h

index 374a62e7f9db6b59de6f37d8fcd4e954dc851dd9..ddb0c55757dd6107c32e161098481325e60548ad 100644 (file)
@@ -1677,7 +1677,6 @@ VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf,
 
   cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS;
 #if CONFIG_INTERNAL_STATS
-  cpi->b_calculate_ssimg = 0;
   cpi->b_calculate_blockiness = 1;
   cpi->b_calculate_consistency = 1;
   cpi->total_inconsistency = 0;
@@ -1701,11 +1700,7 @@ VP10_COMP *vp10_create_compressor(VP10EncoderConfig *oxcf,
     cpi->summedp_weights = 0;
   }
 
-  if (cpi->b_calculate_ssimg) {
-    cpi->ssimg.worst= 100.0;
-  }
   cpi->fastssim.worst = 100.0;
-
   cpi->psnrhvs.worst = 100.0;
 
   if (cpi->b_calculate_blockiness) {
@@ -1954,12 +1949,6 @@ void vp10_remove_compressor(VP10_COMP *cpi) {
           SNPRINT2(results, "\t%7.3f", cpi->worst_consistency);
         }
 
-        if (cpi->b_calculate_ssimg) {
-          SNPRINT(headings, "\t  SSIMG\tWtSSIMG");
-          SNPRINT2(results, "\t%7.3f", cpi->ssimg.stat[ALL] / cpi->count);
-          SNPRINT2(results, "\t%7.3f", cpi->ssimg.worst);
-        }
-
         fprintf(f, "%s\t    Time\n", headings);
         fprintf(f, "%s\t%8.0f\n", results, total_encode_time);
       }
@@ -4509,21 +4498,6 @@ int vp10_get_compressed_data(VP10_COMP *cpi, unsigned int *frame_flags,
         }
       }
 
-      if (cpi->b_calculate_ssimg) {
-        double y, u, v, frame_all;
-#if CONFIG_VP9_HIGHBITDEPTH
-        if (cm->use_highbitdepth) {
-          frame_all = vpx_highbd_calc_ssimg(cpi->Source, cm->frame_to_show, &y,
-                                            &u, &v, (int)cm->bit_depth);
-        } else {
-          frame_all = vpx_calc_ssimg(cpi->Source, cm->frame_to_show, &y, &u,
-                                     &v);
-        }
-#else
-        frame_all = vpx_calc_ssimg(cpi->Source, cm->frame_to_show, &y, &u, &v);
-#endif  // CONFIG_VP9_HIGHBITDEPTH
-        adjust_image_stat(y, u, v, frame_all, &cpi->ssimg);
-      }
 #if CONFIG_VP9_HIGHBITDEPTH
       if (!cm->use_highbitdepth)
 #endif
index c89aee25f65eb595cc837730f05f347be77a133b..940c9a51acd737ea96924f7b70eb0aa5956af100 100644 (file)
@@ -436,11 +436,9 @@ typedef struct VP10_COMP {
   unsigned int tot_recode_hits;
   double worst_ssim;
 
-  ImageStat ssimg;
   ImageStat fastssim;
   ImageStat psnrhvs;
 
-  int b_calculate_ssimg;
   int b_calculate_blockiness;
 
   int b_calculate_consistency;
index 5a4b37dcff176a5a503428f3966712e0f8ae7cf2..b1c2e11c9204c0e67345e5233a2d2b7e817cf471 100644 (file)
@@ -2007,8 +2007,6 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
 
     cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS;
 #if CONFIG_INTERNAL_STATS
-    cpi->b_calculate_ssimg = 0;
-
     cpi->count = 0;
     cpi->bytes = 0;
 
@@ -2029,14 +2027,6 @@ struct VP8_COMP* vp8_create_compressor(VP8_CONFIG *oxcf)
         cpi->summed_weights = 0;
     }
 
-    if (cpi->b_calculate_ssimg)
-    {
-        cpi->total_ssimg_y = 0;
-        cpi->total_ssimg_u = 0;
-        cpi->total_ssimg_v = 0;
-        cpi->total_ssimg_all = 0;
-    }
-
 #endif
 
     cpi->first_time_stamp_ever = 0x7FFFFFFF;
@@ -2315,45 +2305,6 @@ void vp8_remove_compressor(VP8_COMP **ptr)
                                total_ssim, total_encode_time);
                 }
             }
-
-            if (cpi->b_calculate_ssimg)
-            {
-                if (cpi->oxcf.number_of_layers > 1)
-                {
-                    int i;
-
-                    fprintf(f, "Layer\tBitRate\tSSIM_Y\tSSIM_U\tSSIM_V\tSSIM_A\t"
-                               "Time(us)\n");
-                    for (i=0; i<(int)cpi->oxcf.number_of_layers; i++)
-                    {
-                        double dr = (double)cpi->bytes_in_layer[i] *
-                                    8.0 / 1000.0  / time_encoded;
-                        fprintf(f, "%5d\t%7.3f\t%6.4f\t"
-                                "%6.4f\t%6.4f\t%6.4f\t%8.0f\n",
-                                i, dr,
-                                cpi->total_ssimg_y_in_layer[i] /
-                                     cpi->frames_in_layer[i],
-                                cpi->total_ssimg_u_in_layer[i] /
-                                     cpi->frames_in_layer[i],
-                                cpi->total_ssimg_v_in_layer[i] /
-                                     cpi->frames_in_layer[i],
-                                cpi->total_ssimg_all_in_layer[i] /
-                                     cpi->frames_in_layer[i],
-                                total_encode_time);
-                    }
-                }
-                else
-                {
-                    fprintf(f, "BitRate\tSSIM_Y\tSSIM_U\tSSIM_V\tSSIM_A\t"
-                               "Time(us)\n");
-                    fprintf(f, "%7.3f\t%6.4f\t%6.4f\t%6.4f\t%6.4f\t%8.0f\n", dr,
-                            cpi->total_ssimg_y / cpi->count,
-                            cpi->total_ssimg_u / cpi->count,
-                            cpi->total_ssimg_v / cpi->count,
-                            cpi->total_ssimg_all / cpi->count, total_encode_time);
-                }
-            }
-
             fclose(f);
 #if 0
             f = fopen("qskip.stt", "a");
@@ -5761,38 +5712,6 @@ int vp8_get_compressed_data(VP8_COMP *cpi, unsigned int *frame_flags, unsigned l
                 }
 #endif
             }
-
-            if (cpi->b_calculate_ssimg)
-            {
-                double y, u, v, frame_all;
-                frame_all = vpx_calc_ssimg(cpi->Source, cm->frame_to_show,
-                    &y, &u, &v);
-
-                if (cpi->oxcf.number_of_layers > 1)
-                {
-                    unsigned int i;
-
-                    for (i=cpi->current_layer;
-                         i<cpi->oxcf.number_of_layers; i++)
-                    {
-                        if (!cpi->b_calculate_psnr)
-                            cpi->frames_in_layer[i]++;
-
-                        cpi->total_ssimg_y_in_layer[i] += y;
-                        cpi->total_ssimg_u_in_layer[i] += u;
-                        cpi->total_ssimg_v_in_layer[i] += v;
-                        cpi->total_ssimg_all_in_layer[i] += frame_all;
-                    }
-                }
-                else
-                {
-                    cpi->total_ssimg_y += y;
-                    cpi->total_ssimg_u += u;
-                    cpi->total_ssimg_v += v;
-                    cpi->total_ssimg_all += frame_all;
-                }
-            }
-
         }
     }
 
index 2b2f7a0a9ae77afd9ea9d92aad0165c0a54c0885..b436548fd66368c1518937b67cde982b53a550e3 100644 (file)
@@ -637,13 +637,6 @@ typedef struct VP8_COMP
     double summed_weights;
     unsigned int tot_recode_hits;
 
-
-    double total_ssimg_y;
-    double total_ssimg_u;
-    double total_ssimg_v;
-    double total_ssimg_all;
-
-    int b_calculate_ssimg;
 #endif
     int b_calculate_psnr;
 
@@ -689,11 +682,6 @@ typedef struct VP8_COMP
     double sum_ssim[VPX_TS_MAX_LAYERS];
     double sum_weights[VPX_TS_MAX_LAYERS];
 
-    double total_ssimg_y_in_layer[VPX_TS_MAX_LAYERS];
-    double total_ssimg_u_in_layer[VPX_TS_MAX_LAYERS];
-    double total_ssimg_v_in_layer[VPX_TS_MAX_LAYERS];
-    double total_ssimg_all_in_layer[VPX_TS_MAX_LAYERS];
-
 #if CONFIG_MULTI_RES_ENCODING
     /* Number of MBs per row at lower-resolution level */
     int    mr_low_res_mb_cols;
index 8a46738cd566f050f4520026e005d579876d5ca6..019abfe7e0d27f2376e717b6386c23cda3859052 100644 (file)
@@ -1723,7 +1723,6 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
 
   cpi->b_calculate_psnr = CONFIG_INTERNAL_STATS;
 #if CONFIG_INTERNAL_STATS
-  cpi->b_calculate_ssimg = 0;
   cpi->b_calculate_blockiness = 1;
   cpi->b_calculate_consistency = 1;
   cpi->total_inconsistency = 0;
@@ -1747,11 +1746,7 @@ VP9_COMP *vp9_create_compressor(VP9EncoderConfig *oxcf,
     cpi->summedp_weights = 0;
   }
 
-  if (cpi->b_calculate_ssimg) {
-    cpi->ssimg.worst= 100.0;
-  }
   cpi->fastssim.worst = 100.0;
-
   cpi->psnrhvs.worst = 100.0;
 
   if (cpi->b_calculate_blockiness) {
@@ -2042,13 +2037,6 @@ void vp9_remove_compressor(VP9_COMP *cpi) {
           SNPRINT2(results, "\t%7.3f", consistency);
           SNPRINT2(results, "\t%7.3f", cpi->worst_consistency);
         }
-
-        if (cpi->b_calculate_ssimg) {
-          SNPRINT(headings, "\t  SSIMG\tWtSSIMG");
-          SNPRINT2(results, "\t%7.3f", cpi->ssimg.stat[ALL] / cpi->count);
-          SNPRINT2(results, "\t%7.3f", cpi->ssimg.worst);
-        }
-
         fprintf(f, "%s\t    Time\n", headings);
         fprintf(f, "%s\t%8.0f\n", results, total_encode_time);
       }
@@ -4677,21 +4665,6 @@ int vp9_get_compressed_data(VP9_COMP *cpi, unsigned int *frame_flags,
         }
       }
 
-      if (cpi->b_calculate_ssimg) {
-        double y, u, v, frame_all;
-#if CONFIG_VP9_HIGHBITDEPTH
-        if (cm->use_highbitdepth) {
-          frame_all = vpx_highbd_calc_ssimg(cpi->Source, cm->frame_to_show, &y,
-                                            &u, &v, (int)cm->bit_depth);
-        } else {
-          frame_all = vpx_calc_ssimg(cpi->Source, cm->frame_to_show, &y, &u,
-                                     &v);
-        }
-#else
-        frame_all = vpx_calc_ssimg(cpi->Source, cm->frame_to_show, &y, &u, &v);
-#endif  // CONFIG_VP9_HIGHBITDEPTH
-        adjust_image_stat(y, u, v, frame_all, &cpi->ssimg);
-      }
 #if CONFIG_VP9_HIGHBITDEPTH
       if (!cm->use_highbitdepth)
 #endif
index 838ceacd67ae0e200426317ee4a5999f38d27574..3b74bb8e3048ea4f3b8b597c85b78a60a9820716 100644 (file)
@@ -432,13 +432,10 @@ typedef struct VP9_COMP {
   unsigned int tot_recode_hits;
   double worst_ssim;
 
-  ImageStat ssimg;
   ImageStat fastssim;
   ImageStat psnrhvs;
 
-  int b_calculate_ssimg;
   int b_calculate_blockiness;
-
   int b_calculate_consistency;
 
   double total_inconsistency;
index cfe5bb331cea8925fe8532b52fc3de5a701fa79e..fd932433fc2ce690c4b9370906774741730744ae 100644 (file)
@@ -182,31 +182,6 @@ double vpx_calc_ssim(const YV12_BUFFER_CONFIG *source,
   return ssimv;
 }
 
-double vpx_calc_ssimg(const YV12_BUFFER_CONFIG *source,
-                      const YV12_BUFFER_CONFIG *dest,
-                      double *ssim_y, double *ssim_u, double *ssim_v) {
-  double ssim_all = 0;
-  double a, b, c;
-
-  a = vpx_ssim2(source->y_buffer, dest->y_buffer,
-                source->y_stride, dest->y_stride,
-                source->y_crop_width, source->y_crop_height);
-
-  b = vpx_ssim2(source->u_buffer, dest->u_buffer,
-                source->uv_stride, dest->uv_stride,
-                source->uv_crop_width, source->uv_crop_height);
-
-  c = vpx_ssim2(source->v_buffer, dest->v_buffer,
-                source->uv_stride, dest->uv_stride,
-                source->uv_crop_width, source->uv_crop_height);
-  *ssim_y = a;
-  *ssim_u = b;
-  *ssim_v = c;
-  ssim_all = (a * 4 + b + c) / 6;
-
-  return ssim_all;
-}
-
 // traditional ssim as per: http://en.wikipedia.org/wiki/Structural_similarity
 //
 // Re working out the math ->
@@ -478,28 +453,4 @@ double vpx_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
   return ssimv;
 }
 
-double vpx_highbd_calc_ssimg(const YV12_BUFFER_CONFIG *source,
-                             const YV12_BUFFER_CONFIG *dest, double *ssim_y,
-                             double *ssim_u, double *ssim_v, unsigned int bd) {
-  double ssim_all = 0;
-  double a, b, c;
-
-  a = vpx_highbd_ssim2(source->y_buffer, dest->y_buffer,
-                       source->y_stride, dest->y_stride,
-                       source->y_crop_width, source->y_crop_height, bd);
-
-  b = vpx_highbd_ssim2(source->u_buffer, dest->u_buffer,
-                       source->uv_stride, dest->uv_stride,
-                       source->uv_crop_width, source->uv_crop_height, bd);
-
-  c = vpx_highbd_ssim2(source->v_buffer, dest->v_buffer,
-                       source->uv_stride, dest->uv_stride,
-                       source->uv_crop_width, source->uv_crop_height, bd);
-  *ssim_y = a;
-  *ssim_u = b;
-  *ssim_v = c;
-  ssim_all = (a * 4 + b + c) / 6;
-
-  return ssim_all;
-}
 #endif  // CONFIG_VP9_HIGHBITDEPTH
index 1d90f9b4dbcb13ed7a6dd19cea7576bcd363871e..0074c3622a6841adf853262c1fc8bda7815e089d 100644 (file)
@@ -70,10 +70,6 @@ double vpx_calc_ssim(const YV12_BUFFER_CONFIG *source,
                      const YV12_BUFFER_CONFIG *dest,
                      double *weight);
 
-double vpx_calc_ssimg(const YV12_BUFFER_CONFIG *source,
-                      const YV12_BUFFER_CONFIG *dest,
-                      double *ssim_y, double *ssim_u, double *ssim_v);
-
 double vpx_calc_fastssim(const YV12_BUFFER_CONFIG *source,
                          const YV12_BUFFER_CONFIG *dest,
                          double *ssim_y, double *ssim_u, double *ssim_v);
@@ -87,13 +83,6 @@ double vpx_highbd_calc_ssim(const YV12_BUFFER_CONFIG *source,
                             const YV12_BUFFER_CONFIG *dest,
                             double *weight,
                             unsigned int bd);
-
-double vpx_highbd_calc_ssimg(const YV12_BUFFER_CONFIG *source,
-                             const YV12_BUFFER_CONFIG *dest,
-                             double *ssim_y,
-                             double *ssim_u,
-                             double *ssim_v,
-                             unsigned int bd);
 #endif  // CONFIG_VP9_HIGHBITDEPTH
 
 #ifdef __cplusplus