Add EndToEndSSIMTest to check SSIM quality based gating

The unit-tests EndToEndSSIMTest and EndToEndSSIMTestLarge are introduced
(in a new file end_to_end_ssim_test.cc) to check the adherence to a
given SSIM threshold.

The files/functions which are needed for AOMSSIM metric calculation
have been moved outside the CONFIG_INTERNAL_STATS macro. As SSIM
related functions (which are defined in aom_dsp/ssim.c) need to
be called in end_to_end_ssim_test.cc, the file is moved under
if(NOT BUILD_SHARED_LIBS) in test.cmake.

similarity() in aom_dsp/ssim.c is also modified to silence static
analyzer warnings.

The file end_to_end_test.cc is renamed end_to_end_psnr_test.cc.

BUG=aomedia:2959

Change-Id: I6be641bfd2794511775de87a97a45a6d56101576
diff --git a/aom_dsp/ssim.h b/aom_dsp/ssim.h
index b481ae9..67f1bf8 100644
--- a/aom_dsp/ssim.h
+++ b/aom_dsp/ssim.h
@@ -20,6 +20,7 @@
 
 #include "config/aom_config.h"
 
+#if CONFIG_INTERNAL_STATS
 #include "aom_scale/yv12config.h"
 
 // metrics used for calculating ssim, ssim2, dssim, and ssimc
@@ -87,6 +88,16 @@
                    const YV12_BUFFER_CONFIG *recon, const uint32_t bit_depth,
                    const uint32_t in_bit_depth, int is_hbd, double *weight,
                    double *frame_ssim2);
+#endif  // CONFIG_INTERNAL_STATS
+
+double aom_ssim2(const uint8_t *img1, const uint8_t *img2, int stride_img1,
+                 int stride_img2, int width, int height);
+
+#if CONFIG_AV1_HIGHBITDEPTH
+double aom_highbd_ssim2(const uint8_t *img1, const uint8_t *img2,
+                        int stride_img1, int stride_img2, int width, int height,
+                        uint32_t bd, uint32_t shift);
+#endif  // CONFIG_AV1_HIGHBITDEPTH
 
 #ifdef __cplusplus
 }  // extern "C"