/* * Copyright (c) 2019, 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.
*/
void FramePktHook(const aom_codec_cx_pkt_t *pkt) override { // Time since last timestamp = duration.
aom_codec_pts_t duration = pkt->data.frame.pts - last_pts_;
if (duration > 1) { // If first drop not set and we have a drop set it to this time. if (!first_drop_) first_drop_ = last_pts_ + 1; // Update the number of frame drops.
num_drops_ += static_cast<int>(duration - 1); // Update counter for total number of frames (#frames input to encoder). // Needed for setting the proper layer_id below.
tot_frame_number_ += static_cast<int>(duration - 1);
}
// Add to the buffer the bits we'd expect from a constant bitrate server.
bits_in_buffer_model_ += static_cast<int64_t>(
duration * timebase_ * cfg_.rc_target_bitrate * 1000);
// Buffer should not go negative.
ASSERT_GE(bits_in_buffer_model_, 0)
<< "Buffer Underrun at frame " << pkt->data.frame.pts;
aom_codec_pts_t last_pts_; double timebase_; int frame_number_; // Counter for number of non-dropped/encoded frames. int tot_frame_number_; // Counter for total number of input frames.
int64_t bits_total_; double duration_; double effective_datarate_; int set_cpu_used_;
int64_t bits_in_buffer_model_;
aom_codec_pts_t first_drop_; int num_drops_; int denoiser_on_; int denoiser_offon_test_; int denoiser_offon_period_; unsignedint aq_mode_; bool speed_change_test_; int tile_columns_; int tile_rows_; bool auto_tiles_; bool screen_mode_; double max_perc_spike_; double max_perc_spike_high_; int num_spikes_; int num_spikes_high_; // These are use for test with dynamic bitrate change. // Used to verify that the encoder can respond and hit bitrate that is updated // during the sequence. int frame_update_bitrate_; int target_bitrate_update_[3]; double effective_datarate_dynamic_[3];
int64_t bits_total_dynamic_[3]; int frame_number_dynamic_[3];
};
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.