Index: source/libvpx/vp8/encoder/ratectrl.c |
=================================================================== |
--- source/libvpx/vp8/encoder/ratectrl.c (revision 240950) |
+++ source/libvpx/vp8/encoder/ratectrl.c (working copy) |
@@ -174,14 +174,6 @@ |
600, 600, 600, 600, 600, 600, 600, 600, |
}; |
-/* % adjustment to target kf size based on seperation from previous frame */ |
-static const int kf_boost_seperation_adjustment[16] = |
-{ |
- 30, 40, 50, 55, 60, 65, 70, 75, |
- 80, 85, 90, 95, 100, 100, 100, 100, |
-}; |
- |
- |
static const int gf_adjust_table[101] = |
{ |
100, |
@@ -956,6 +948,21 @@ |
if (cpi->bits_off_target > cpi->oxcf.maximum_buffer_size) |
cpi->bits_off_target = (int)cpi->oxcf.maximum_buffer_size; |
cpi->buffer_level = cpi->bits_off_target; |
+ |
+ if (cpi->oxcf.number_of_layers > 1) { |
+ unsigned int i; |
+ |
+ // Propagate bits saved by dropping the frame to higher layers. |
+ for (i = cpi->current_layer + 1; i < cpi->oxcf.number_of_layers; |
+ i++) { |
+ LAYER_CONTEXT *lc = &cpi->layer_context[i]; |
+ lc->bits_off_target += (int)(lc->target_bandwidth / |
+ lc->framerate); |
+ if (lc->bits_off_target > lc->maximum_buffer_size) |
+ lc->bits_off_target = lc->maximum_buffer_size; |
+ lc->buffer_level = lc->bits_off_target; |
+ } |
+ } |
} |
} |
@@ -1223,7 +1230,6 @@ |
{ |
Q = cpi->oxcf.gold_q; |
} |
- |
} |
else |
{ |