History

vp9: Reset buffer level on large bitrate changes.

For a large change in the target avg_frame_bandwidth, via the update in change_config()), reset the buffer_level to optimal_level. This fix prevents possible frame drops, where for example, encoder suddenly goes from lower to higher bitrate.

Marco committed 8 years ago

Commit a2127231 parent 08a668a2 files · +5 −0Browse files

Unified · Split

2 files
  1. vp9/encoder/vp9_encoder.c +3 −0
  2. vp9/encoder/vp9_svc_layercontext.c +2 −0
vp9/encoder/vp9_encoder.c+3−0
@@ -1868,6 +1868,7 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) { · 1867 unmodified lines
18681868 // Check for resetting the rc flags (rc_1_frame, rc_2_frame) if the
18691869 // configuration change has a large change in avg_frame_bandwidth.
18701870 // For SVC check for resetting based on spatial layer average bandwidth.
1871+ // Also reset buffer level to optimal level.
18711872 if (cm->current_video_frame > 0) {
18721873 if (cpi->use_svc) {
18731874 vp9_svc_check_reset_layer_rc_flag(cpi);
@@ -1876,6 +1877,8 @@ void vp9_change_config(struct VP9_COMP *cpi, const VP9EncoderConfig *oxcf) { · 2 unmodified lines
18761877 rc->avg_frame_bandwidth < (rc->last_avg_frame_bandwidth >> 1)) {
18771878 rc->rc_1_frame = 0;
18781879 rc->rc_2_frame = 0;
1880+ rc->bits_off_target = rc->optimal_buffer_level;
1881+ rc->buffer_level = rc->optimal_buffer_level;
18791882 }
18801883 }
18811884 }
vp9/encoder/vp9_svc_layercontext.c+2−0
@@ -881,6 +881,8 @@ void vp9_svc_check_reset_layer_rc_flag(VP9_COMP *const cpi) { · 880 unmodified lines
881881 RATE_CONTROL *lrc = &lc->rc;
882882 lrc->rc_1_frame = 0;
883883 lrc->rc_2_frame = 0;
884+ lrc->bits_off_target = lrc->optimal_buffer_level;
885+ lrc->buffer_level = lrc->optimal_buffer_level;
884886 }
885887 }
886888 }

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