aboutsummaryrefslogtreecommitdiff
path: root/libvpx/test/yuv_video_source.h
diff options
context:
space:
mode:
Diffstat (limited to 'libvpx/test/yuv_video_source.h')
-rw-r--r--libvpx/test/yuv_video_source.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/libvpx/test/yuv_video_source.h b/libvpx/test/yuv_video_source.h
index 383ab8f1b..51948c0ef 100644
--- a/libvpx/test/yuv_video_source.h
+++ b/libvpx/test/yuv_video_source.h
@@ -27,8 +27,8 @@ class YUVVideoSource : public VideoSource {
YUVVideoSource(const std::string &file_name, vpx_img_fmt format,
unsigned int width, unsigned int height, int rate_numerator,
int rate_denominator, unsigned int start, int limit)
- : file_name_(file_name), input_file_(NULL), img_(NULL), start_(start),
- limit_(limit), frame_(0), width_(0), height_(0),
+ : file_name_(file_name), input_file_(nullptr), img_(nullptr),
+ start_(start), limit_(limit), frame_(0), width_(0), height_(0),
format_(VPX_IMG_FMT_NONE), framerate_numerator_(rate_numerator),
framerate_denominator_(rate_denominator) {
// This initializes format_, raw_size_, width_, height_ and allocates img.
@@ -43,7 +43,7 @@ class YUVVideoSource : public VideoSource {
virtual void Begin() {
if (input_file_) fclose(input_file_);
input_file_ = OpenTestDataFile(file_name_);
- ASSERT_TRUE(input_file_ != NULL)
+ ASSERT_NE(input_file_, nullptr)
<< "Input file open failed. Filename: " << file_name_;
if (start_) {
fseek(input_file_, static_cast<unsigned>(raw_size_) * start_, SEEK_SET);
@@ -58,7 +58,9 @@ class YUVVideoSource : public VideoSource {
FillFrame();
}
- virtual vpx_image_t *img() const { return (frame_ < limit_) ? img_ : NULL; }
+ virtual vpx_image_t *img() const {
+ return (frame_ < limit_) ? img_ : nullptr;
+ }
// Models a stream where Timebase = 1/FPS, so pts == frame.
virtual vpx_codec_pts_t pts() const { return frame_; }
@@ -78,8 +80,8 @@ class YUVVideoSource : public VideoSource {
vpx_img_fmt format) {
if (width != width_ || height != height_ || format != format_) {
vpx_img_free(img_);
- img_ = vpx_img_alloc(NULL, format, width, height, 1);
- ASSERT_TRUE(img_ != NULL);
+ img_ = vpx_img_alloc(nullptr, format, width, height, 1);
+ ASSERT_NE(img_, nullptr);
width_ = width;
height_ = height;
format_ = format;
@@ -99,7 +101,7 @@ class YUVVideoSource : public VideoSource {
}
virtual void FillFrame() {
- ASSERT_TRUE(input_file_ != NULL);
+ ASSERT_NE(input_file_, nullptr);
// Read a frame from input_file.
if (fread(img_->img_data, raw_size_, 1, input_file_) == 0) {
limit_ = frame_;