]> granicus.if.org Git - libvpx/commitdiff
tests: silence a few type related warnings
authorJames Zern <jzern@google.com>
Thu, 18 Jul 2013 23:13:39 +0000 (16:13 -0700)
committerJames Zern <jzern@google.com>
Thu, 18 Jul 2013 23:13:39 +0000 (16:13 -0700)
Change-Id: If908328c1dbbb5bd84c57e30fab1cda1804933e4

test/ivf_video_source.h
test/subtract_test.cc
test/util.h

index 88bc597ae93fc3807ae4817c6bca062e058bfaec..926f801d4b276c4480473c9ff7cf3379533f4096 100644 (file)
@@ -47,7 +47,8 @@ class IVFVideoSource : public CompressedVideoSource {
   virtual void Init() {
     // Allocate a buffer for read in the compressed video frame.
     compressed_frame_buf_ = new uint8_t[libvpx_test::kCodeBufferSize];
-    ASSERT_TRUE(compressed_frame_buf_) << "Allocate frame buffer failed";
+    ASSERT_TRUE(compressed_frame_buf_ != NULL)
+        << "Allocate frame buffer failed";
   }
 
   virtual void Begin() {
index 81bfb662cde8ae1b6697b77f8268681da451a0bf..574bfbf47a2ae33097c1d78d635851156a584850 100644 (file)
@@ -61,7 +61,7 @@ TEST_P(SubtractBlockTest, SimpleSubtract) {
     int16_t *src_diff = be.src_diff;
     for (int r = 0; r < kBlockHeight; ++r) {
       for (int c = 0; c < kBlockWidth; ++c) {
-        src_diff[c] = 0xa5a5;
+        src_diff[c] = static_cast<int16_t>(0xa5a5);
       }
       src_diff += kDiffPredStride;
     }
index 533a1db5cebb107087b6c3901e9f3a2d8ff6b918..4d7f3d41ed57b696e958760609cf87e969359664 100644 (file)
@@ -37,7 +37,7 @@ static double compute_psnr(const vpx_image_t *img1,
                   img2->planes[VPX_PLANE_Y][i * img2->stride[VPX_PLANE_Y] + j];
       sqrerr += d * d;
     }
-  double mse = sqrerr / (width_y * height_y);
+  double mse = static_cast<double>(sqrerr) / (width_y * height_y);
   double psnr = 100.0;
   if (mse > 0.0) {
     psnr = 10 * log10(255.0 * 255.0 / mse);