/* * Copyright (c) 2014 The WebM project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree.
*/ #ifndef VPX_TEST_YUV_VIDEO_SOURCE_H_ #define VPX_TEST_YUV_VIDEO_SOURCE_H_
// This class extends VideoSource to allow parsing of raw YUV // formats of various color sampling and bit-depths so that we can // do actual file encodes. class YUVVideoSource : public VideoSource { public:
YUVVideoSource(const std::string &file_name, vpx_img_fmt format, unsignedint width, unsignedint height, int rate_numerator, int rate_denominator, unsignedint start, int limit)
: 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.
SetSize(width, height, format);
}
~YUVVideoSource() override {
vpx_img_free(img_); if (input_file_) fclose(input_file_);
}
void Begin() override { if (input_file_) fclose(input_file_);
input_file_ = OpenTestDataFile(file_name_);
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);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.