/* * Copyright (c) 2016, Alliance for Open Media. All rights reserved. * * This source code is subject to the terms of the BSD 2 Clause License and * the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License * was not distributed with this source code in the LICENSE file, you can * obtain it at www.aomedia.org/license/software. If the Alliance for Open * Media Patent License 1.0 was not distributed with this source code in the * PATENTS file, you can obtain it at www.aomedia.org/license/patent.
*/ #ifndef AOM_TEST_YUV_VIDEO_SOURCE_H_ #define AOM_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, aom_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_(AOM_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 {
aom_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.