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;
void RunBasicRateTargetingTest(::libaom_test::VideoSource *video, constint bitrate, double low_rate_err_limit, double high_rate_err_limit) {
cfg_.rc_target_bitrate = bitrate;
ResetModel();
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
ASSERT_GE(effective_datarate_, cfg_.rc_target_bitrate * low_rate_err_limit)
<< " The datarate for the file is lower than target by too much!";
ASSERT_LE(effective_datarate_, cfg_.rc_target_bitrate * high_rate_err_limit)
<< " The datarate for the file is greater than target by too much!";
}
void RunBasicRateTargetingTestReversed(::libaom_test::VideoSource *video, constint bitrate, double low_rate_err_limit, double high_rate_err_limit) {
cfg_.rc_target_bitrate = bitrate;
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
ASSERT_GE(static_cast<double>(cfg_.rc_target_bitrate),
effective_datarate_ * low_rate_err_limit)
<< " The datarate for the file exceeds the target by too much!";
ASSERT_LE(static_cast<double>(cfg_.rc_target_bitrate),
effective_datarate_ * high_rate_err_limit)
<< " The datarate for the file missed the target!"
<< cfg_.rc_target_bitrate << " " << effective_datarate_;
}
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]; int avif_mode_; int lag_realtime_mode_;
};
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.