summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTom Finegan <tomfinegan@google.com>2014-02-20 12:51:36 -0800
committerTom Finegan <tomfinegan@google.com>2014-02-20 12:51:36 -0800
commitb5793bf9b41ed2e6b1394f88789d839dc7067a36 (patch)
treef75857a033728741ec6810eb9f243773f315d34d /test
parentcde6b50cb15947be71014c011824f962e30bb6f6 (diff)
downloadlibvpx-b5793bf9b41ed2e6b1394f88789d839dc7067a36.tar
libvpx-b5793bf9b41ed2e6b1394f88789d839dc7067a36.tar.gz
libvpx-b5793bf9b41ed2e6b1394f88789d839dc7067a36.tar.bz2
libvpx-b5793bf9b41ed2e6b1394f88789d839dc7067a36.zip
cq_test.cc: Use size_t for file size and unsigned int for target bitrate.
Silences warnings and minizes required casts. Change-Id: I7d6c5b87c56191f3bec7b0747d7dbe8938e8ec82
Diffstat (limited to 'test')
-rw-r--r--test/cq_test.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/cq_test.cc b/test/cq_test.cc
index a2c829163..7da7b80aa 100644
--- a/test/cq_test.cc
+++ b/test/cq_test.cc
@@ -20,7 +20,7 @@ namespace {
const int kCQLevelMin = 4;
const int kCQLevelMax = 63;
const int kCQLevelStep = 8;
-const int kCQTargetBitrate = 2000;
+const unsigned int kCQTargetBitrate = 2000;
class CQTest : public ::libvpx_test::EncoderTest,
public ::libvpx_test::CodecTestWithParam<int> {
@@ -66,17 +66,17 @@ class CQTest : public ::libvpx_test::EncoderTest,
return pow(10.0, avg_psnr / 10.0) / file_size_;
}
- int file_size() const { return file_size_; }
+ size_t file_size() const { return file_size_; }
int n_frames() const { return n_frames_; }
private:
int cq_level_;
- int file_size_;
+ size_t file_size_;
double psnr_;
int n_frames_;
};
-int prev_actual_bitrate = kCQTargetBitrate;
+unsigned int prev_actual_bitrate = kCQTargetBitrate;
TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) {
const vpx_rational timebase = { 33333333, 1000000000 };
cfg_.g_timebase = timebase;
@@ -88,7 +88,8 @@ TEST_P(CQTest, LinearPSNRIsHigherForCQLevel) {
timebase.den, timebase.num, 0, 30);
ASSERT_NO_FATAL_FAILURE(RunLoop(&video));
const double cq_psnr_lin = GetLinearPSNROverBitrate();
- const int cq_actual_bitrate = file_size() * 8 * 30 / (n_frames() * 1000);
+ const unsigned int cq_actual_bitrate =
+ static_cast<unsigned int>(file_size()) * 8 * 30 / (n_frames() * 1000);
EXPECT_LE(cq_actual_bitrate, kCQTargetBitrate);
EXPECT_LE(cq_actual_bitrate, prev_actual_bitrate);
prev_actual_bitrate = cq_actual_bitrate;