Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: source/libvpx/vp9/encoder/vp9_svc_layercontext.c

Issue 1124333011: libvpx: Pull from upstream (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/libvpx.git@master
Patch Set: only update to last nights LKGR Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_subexp.c ('k') | source/libvpx/vp9/encoder/vp9_temporal_filter.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 28 matching lines...) Expand all
39 #if CONFIG_VP9_HIGHBITDEPTH 39 #if CONFIG_VP9_HIGHBITDEPTH
40 cpi->common.use_highbitdepth, 40 cpi->common.use_highbitdepth,
41 #endif 41 #endif
42 VP9_ENC_BORDER_IN_PIXELS, 42 VP9_ENC_BORDER_IN_PIXELS,
43 cpi->common.byte_alignment, 43 cpi->common.byte_alignment,
44 NULL, NULL, NULL)) 44 NULL, NULL, NULL))
45 vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR, 45 vpx_internal_error(&cpi->common.error, VPX_CODEC_MEM_ERROR,
46 "Failed to allocate empty frame for multiple frame " 46 "Failed to allocate empty frame for multiple frame "
47 "contexts"); 47 "contexts");
48 48
49 vpx_memset(cpi->svc.empty_frame.img.buffer_alloc, 0x80, 49 memset(cpi->svc.empty_frame.img.buffer_alloc, 0x80,
50 cpi->svc.empty_frame.img.buffer_alloc_sz); 50 cpi->svc.empty_frame.img.buffer_alloc_sz);
51 cpi->svc.empty_frame_width = cpi->common.width; 51 cpi->svc.empty_frame_width = cpi->common.width;
52 cpi->svc.empty_frame_height = cpi->common.height; 52 cpi->svc.empty_frame_height = cpi->common.height;
53 } 53 }
54 } 54 }
55 55
56 for (layer = 0; layer < layer_end; ++layer) { 56 for (layer = 0; layer < layer_end; ++layer) {
57 LAYER_CONTEXT *const lc = &svc->layer_context[layer]; 57 LAYER_CONTEXT *const lc = &svc->layer_context[layer];
58 RATE_CONTROL *const lrc = &lc->rc; 58 RATE_CONTROL *const lrc = &lc->rc;
59 int i; 59 int i;
60 lc->current_video_frame_in_layer = 0; 60 lc->current_video_frame_in_layer = 0;
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 const VP9EncoderConfig *const oxcf = &cpi->oxcf; 188 const VP9EncoderConfig *const oxcf = &cpi->oxcf;
189 LAYER_CONTEXT *const lc = get_layer_context(cpi); 189 LAYER_CONTEXT *const lc = get_layer_context(cpi);
190 RATE_CONTROL *const lrc = &lc->rc; 190 RATE_CONTROL *const lrc = &lc->rc;
191 191
192 lc->framerate = framerate; 192 lc->framerate = framerate;
193 lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate); 193 lrc->avg_frame_bandwidth = (int)(lc->target_bandwidth / lc->framerate);
194 lrc->min_frame_bandwidth = (int)(lrc->avg_frame_bandwidth * 194 lrc->min_frame_bandwidth = (int)(lrc->avg_frame_bandwidth *
195 oxcf->two_pass_vbrmin_section / 100); 195 oxcf->two_pass_vbrmin_section / 100);
196 lrc->max_frame_bandwidth = (int)(((int64_t)lrc->avg_frame_bandwidth * 196 lrc->max_frame_bandwidth = (int)(((int64_t)lrc->avg_frame_bandwidth *
197 oxcf->two_pass_vbrmax_section) / 100); 197 oxcf->two_pass_vbrmax_section) / 100);
198 vp9_rc_set_gf_max_interval(cpi, lrc); 198 vp9_rc_set_gf_interval_range(cpi, lrc);
199 } 199 }
200 200
201 void vp9_restore_layer_context(VP9_COMP *const cpi) { 201 void vp9_restore_layer_context(VP9_COMP *const cpi) {
202 LAYER_CONTEXT *const lc = get_layer_context(cpi); 202 LAYER_CONTEXT *const lc = get_layer_context(cpi);
203 const int old_frame_since_key = cpi->rc.frames_since_key; 203 const int old_frame_since_key = cpi->rc.frames_since_key;
204 const int old_frame_to_key = cpi->rc.frames_to_key; 204 const int old_frame_to_key = cpi->rc.frames_to_key;
205 205
206 cpi->rc = lc->rc; 206 cpi->rc = lc->rc;
207 cpi->twopass = lc->twopass; 207 cpi->twopass = lc->twopass;
208 cpi->oxcf.target_bandwidth = lc->target_bandwidth; 208 cpi->oxcf.target_bandwidth = lc->target_bandwidth;
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 // Only remove the buffer when pop the highest layer. 406 // Only remove the buffer when pop the highest layer.
407 if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) { 407 if (cpi->svc.spatial_layer_id == cpi->svc.number_spatial_layers - 1) {
408 vp9_lookahead_pop(ctx, drain); 408 vp9_lookahead_pop(ctx, drain);
409 } 409 }
410 } 410 }
411 } 411 }
412 412
413 return buf; 413 return buf;
414 } 414 }
415 #endif 415 #endif
OLDNEW
« no previous file with comments | « source/libvpx/vp9/encoder/vp9_subexp.c ('k') | source/libvpx/vp9/encoder/vp9_temporal_filter.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698