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

Side by Side Diff: source/libvpx/vpx/src/svc_encodeframe.c

Issue 668403002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vp9/vp9cx.mk ('k') | source/libvpx/vpx/src/vpx_image.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) 2013 The WebM project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 for (i = 0; i < svc_ctx->spatial_layers; ++i) { 343 for (i = 0; i < svc_ctx->spatial_layers; ++i) {
344 if (si->svc_params.scaling_factor_den[i] > 0) { 344 if (si->svc_params.scaling_factor_den[i] > 0) {
345 alloc_ratio[i] = (float)(si->svc_params.scaling_factor_num[i] * 1.0 / 345 alloc_ratio[i] = (float)(si->svc_params.scaling_factor_num[i] * 1.0 /
346 si->svc_params.scaling_factor_den[i]); 346 si->svc_params.scaling_factor_den[i]);
347 347
348 alloc_ratio[i] *= alloc_ratio[i]; 348 alloc_ratio[i] *= alloc_ratio[i];
349 total += alloc_ratio[i]; 349 total += alloc_ratio[i];
350 } 350 }
351 } 351 }
352 352
353 for (i = 0; i < svc_ctx->spatial_layers; ++i) { 353 for (i = 0; i < VPX_SS_MAX_LAYERS; ++i) {
354 if (total > 0) { 354 if (total > 0) {
355 enc_cfg->ss_target_bitrate[i] = (unsigned int) 355 enc_cfg->ss_target_bitrate[i] = (unsigned int)
356 (enc_cfg->rc_target_bitrate * alloc_ratio[i] / total); 356 (enc_cfg->rc_target_bitrate * alloc_ratio[i] / total);
357 } 357 }
358 } 358 }
359 } 359 }
360 } 360 }
361 361
362 vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx, 362 vpx_codec_err_t vpx_svc_init(SvcContext *svc_ctx, vpx_codec_ctx_t *codec_ctx,
363 vpx_codec_iface_t *iface, 363 vpx_codec_iface_t *iface,
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 if (svc_ctx == NULL) return; 599 if (svc_ctx == NULL) return;
600 // do not use get_svc_internal as it will unnecessarily allocate an 600 // do not use get_svc_internal as it will unnecessarily allocate an
601 // SvcInternal if it was not already allocated 601 // SvcInternal if it was not already allocated
602 si = (SvcInternal *)svc_ctx->internal; 602 si = (SvcInternal *)svc_ctx->internal;
603 if (si != NULL) { 603 if (si != NULL) {
604 free(si); 604 free(si);
605 svc_ctx->internal = NULL; 605 svc_ctx->internal = NULL;
606 } 606 }
607 } 607 }
608 608
OLDNEW
« no previous file with comments | « source/libvpx/vp9/vp9cx.mk ('k') | source/libvpx/vpx/src/vpx_image.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698