| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 static void update_layer_contexts (VP8_COMP *cpi) | 1394 static void update_layer_contexts (VP8_COMP *cpi) |
| 1395 { | 1395 { |
| 1396 VP8_CONFIG *oxcf = &cpi->oxcf; | 1396 VP8_CONFIG *oxcf = &cpi->oxcf; |
| 1397 | 1397 |
| 1398 /* Update snapshots of the layer contexts to reflect new parameters */ | 1398 /* Update snapshots of the layer contexts to reflect new parameters */ |
| 1399 if (oxcf->number_of_layers > 1) | 1399 if (oxcf->number_of_layers > 1) |
| 1400 { | 1400 { |
| 1401 unsigned int i; | 1401 unsigned int i; |
| 1402 double prev_layer_framerate=0; | 1402 double prev_layer_framerate=0; |
| 1403 | 1403 |
| 1404 assert(oxcf->number_of_layers <= VPX_TS_MAX_LAYERS); |
| 1404 for (i=0; i<oxcf->number_of_layers; i++) | 1405 for (i=0; i<oxcf->number_of_layers; i++) |
| 1405 { | 1406 { |
| 1406 LAYER_CONTEXT *lc = &cpi->layer_context[i]; | 1407 LAYER_CONTEXT *lc = &cpi->layer_context[i]; |
| 1407 | 1408 |
| 1408 lc->framerate = | 1409 lc->framerate = |
| 1409 cpi->ref_framerate / oxcf->rate_decimator[i]; | 1410 cpi->ref_framerate / oxcf->rate_decimator[i]; |
| 1410 lc->target_bandwidth = oxcf->target_bitrate[i] * 1000; | 1411 lc->target_bandwidth = oxcf->target_bitrate[i] * 1000; |
| 1411 | 1412 |
| 1412 lc->starting_buffer_level = rescale( | 1413 lc->starting_buffer_level = rescale( |
| 1413 (int)oxcf->starting_buffer_level_in_ms, | 1414 (int)oxcf->starting_buffer_level_in_ms, |
| (...skipping 3650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5064 avg_duration /= interval; | 5065 avg_duration /= interval; |
| 5065 | 5066 |
| 5066 cpi->ref_framerate = 10000000.0 / avg_duration; | 5067 cpi->ref_framerate = 10000000.0 / avg_duration; |
| 5067 } | 5068 } |
| 5068 | 5069 |
| 5069 if (cpi->oxcf.number_of_layers > 1) | 5070 if (cpi->oxcf.number_of_layers > 1) |
| 5070 { | 5071 { |
| 5071 unsigned int i; | 5072 unsigned int i; |
| 5072 | 5073 |
| 5073 /* Update frame rates for each layer */ | 5074 /* Update frame rates for each layer */ |
| 5075 assert(cpi->oxcf.number_of_layers <= VPX_TS_MAX_LAYERS); |
| 5074 for (i=0; i<cpi->oxcf.number_of_layers; i++) | 5076 for (i=0; i<cpi->oxcf.number_of_layers; i++) |
| 5075 { | 5077 { |
| 5076 LAYER_CONTEXT *lc = &cpi->layer_context[i]; | 5078 LAYER_CONTEXT *lc = &cpi->layer_context[i]; |
| 5077 lc->framerate = cpi->ref_framerate / | 5079 lc->framerate = cpi->ref_framerate / |
| 5078 cpi->oxcf.rate_decimator[i]; | 5080 cpi->oxcf.rate_decimator[i]; |
| 5079 } | 5081 } |
| 5080 } | 5082 } |
| 5081 else | 5083 else |
| 5082 vp8_new_framerate(cpi, cpi->ref_framerate); | 5084 vp8_new_framerate(cpi, cpi->ref_framerate); |
| 5083 } | 5085 } |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5592 } | 5594 } |
| 5593 | 5595 |
| 5594 return Total; | 5596 return Total; |
| 5595 } | 5597 } |
| 5596 | 5598 |
| 5597 | 5599 |
| 5598 int vp8_get_quantizer(VP8_COMP *cpi) | 5600 int vp8_get_quantizer(VP8_COMP *cpi) |
| 5599 { | 5601 { |
| 5600 return cpi->common.base_qindex; | 5602 return cpi->common.base_qindex; |
| 5601 } | 5603 } |
| OLD | NEW |