test/: apply clang-format

Change-Id: I1138fbeff5f63beb5c0de2c357793da12502d453
This commit is contained in:
clang-format
2016-08-11 17:46:05 -07:00
committed by James Zern
parent 712e66dafa
commit 3a826f1d3d
91 changed files with 3429 additions and 4555 deletions

View File

@@ -25,19 +25,11 @@ namespace libvpx_test {
class YUVVideoSource : public VideoSource {
public:
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),
format_(VPX_IMG_FMT_NONE),
framerate_numerator_(rate_numerator),
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),
format_(VPX_IMG_FMT_NONE), framerate_numerator_(rate_numerator),
framerate_denominator_(rate_denominator) {
// This initializes format_, raw_size_, width_, height_ and allocates img.
SetSize(width, height, format);
@@ -45,13 +37,11 @@ class YUVVideoSource : public VideoSource {
virtual ~YUVVideoSource() {
vpx_img_free(img_);
if (input_file_)
fclose(input_file_);
if (input_file_) fclose(input_file_);
}
virtual void Begin() {
if (input_file_)
fclose(input_file_);
if (input_file_) fclose(input_file_);
input_file_ = OpenTestDataFile(file_name_);
ASSERT_TRUE(input_file_ != NULL) << "Input file open failed. Filename: "
<< file_name_;
@@ -67,7 +57,7 @@ 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_ : NULL; }
// Models a stream where Timebase = 1/FPS, so pts == frame.
virtual vpx_codec_pts_t pts() const { return frame_; }
@@ -93,32 +83,15 @@ class YUVVideoSource : public VideoSource {
height_ = height;
format_ = format;
switch (format) {
case VPX_IMG_FMT_I420:
raw_size_ = width * height * 3 / 2;
break;
case VPX_IMG_FMT_I422:
raw_size_ = width * height * 2;
break;
case VPX_IMG_FMT_I440:
raw_size_ = width * height * 2;
break;
case VPX_IMG_FMT_I444:
raw_size_ = width * height * 3;
break;
case VPX_IMG_FMT_I42016:
raw_size_ = width * height * 3;
break;
case VPX_IMG_FMT_I42216:
raw_size_ = width * height * 4;
break;
case VPX_IMG_FMT_I44016:
raw_size_ = width * height * 4;
break;
case VPX_IMG_FMT_I44416:
raw_size_ = width * height * 6;
break;
default:
ASSERT_TRUE(0);
case VPX_IMG_FMT_I420: raw_size_ = width * height * 3 / 2; break;
case VPX_IMG_FMT_I422: raw_size_ = width * height * 2; break;
case VPX_IMG_FMT_I440: raw_size_ = width * height * 2; break;
case VPX_IMG_FMT_I444: raw_size_ = width * height * 3; break;
case VPX_IMG_FMT_I42016: raw_size_ = width * height * 3; break;
case VPX_IMG_FMT_I42216: raw_size_ = width * height * 4; break;
case VPX_IMG_FMT_I44016: raw_size_ = width * height * 4; break;
case VPX_IMG_FMT_I44416: raw_size_ = width * height * 6; break;
default: ASSERT_TRUE(0);
}
}
}