History

vp9 rc lib: Allow aq 3 to work for SVC with unit test

Also use round to cast float to int with more accurate calculation to avoid error accumulation which causes qp to be different after ~290 frames.

Jerome Jiang committed 5 years ago

Commit 59c9e1d1 parent 15a75b43 files · +6 −4Browse files

Unified · Split

3 files
  1. test/ratectrl_rtc_test.cc +3 −1
  2. vp9/encoder/vp9_ratectrl.c +2 −2
  3. vp9/ratectrl_rtc.cc +1 −1
test/ratectrl_rtc_test.cc+3−1
@@ -270,6 +270,7 @@ class RcInterfaceSvcTest : public ::libvpx_test::EncoderTest, · 269 unmodified lines
270270 for (int i = 0; i < VPX_MAX_LAYERS; ++i) {
271271 svc_params_.max_quantizers[i] = 56;
272272 svc_params_.min_quantizers[i] = 2;
273+ svc_params_.speed_per_layer[i] = 7;
273274 }
274275 cfg_.rc_end_usage = VPX_CBR;
275276 cfg_.g_lag_in_frames = 0;
@@ -318,6 +319,7 @@ class RcInterfaceSvcTest : public ::libvpx_test::EncoderTest, · 42 unmodified lines
318319 rc_cfg_.ss_number_layers = 3;
319320 rc_cfg_.ts_number_layers = 3;
320321 rc_cfg_.rc_mode = VPX_CBR;
322+ rc_cfg_.aq_mode = aq_mode_;
321323
322324 rc_cfg_.scaling_factor_num[0] = 1;
323325 rc_cfg_.scaling_factor_den[0] = 4;
@@ -367,7 +369,7 @@ TEST_P(RcInterfaceSvcTest, Svc) { RunSvc(); } · 43 unmodified lines
367369
368370 VP9_INSTANTIATE_TEST_SUITE(RcInterfaceTest, ::testing::Values(0, 3),
369371 ::testing::Values(VPX_CBR, VPX_VBR));
370−VP9_INSTANTIATE_TEST_SUITE(RcInterfaceSvcTest, ::testing::Values(0));
372+VP9_INSTANTIATE_TEST_SUITE(RcInterfaceSvcTest, ::testing::Values(0, 3));
371373 } // namespace
372374
373375 int main(int argc, char **argv) {
vp9/encoder/vp9_ratectrl.c+2−2
@@ -277,9 +277,9 @@ static void update_buffer_level_svc_preencode(VP9_COMP *cpi) { · 276 unmodified lines
277277 svc->current_superframe > 0) {
278278 // TODO(marpan): This may need to be modified for temporal layers.
279279 const double framerate_pts = 10000000.0 / ts_delta;
280− lrc->bits_off_target += (int)(lc->target_bandwidth / framerate_pts);
280+ lrc->bits_off_target += (int)round(lc->target_bandwidth / framerate_pts);
281281 } else {
282− lrc->bits_off_target += (int)(lc->target_bandwidth / lc->framerate);
282+ lrc->bits_off_target += (int)round(lc->target_bandwidth / lc->framerate);
283283 }
284284 // Clip buffer level to maximum buffer size for the layer.
285285 lrc->bits_off_target =
vp9/ratectrl_rtc.cc+1−1
@@ -105,7 +105,7 @@ void VP9RateControlRTC::UpdateRateControl( · 104 unmodified lines
105105 cpi_->framerate = rc_cfg.framerate;
106106 cpi_->svc.number_spatial_layers = rc_cfg.ss_number_layers;
107107 cpi_->svc.number_temporal_layers = rc_cfg.ts_number_layers;
108−
108+ vp9_set_mb_mi(cm, cm->width, cm->height);
109109 for (int sl = 0; sl < cpi_->svc.number_spatial_layers; ++sl) {
110110 for (int tl = 0; tl < cpi_->svc.number_temporal_layers; ++tl) {
111111 const int layer =

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t