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

Side by Side Diff: source/libvpx/vp8/encoder/firstpass.c

Issue 181493009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 9 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/vp8/common/x86/loopfilter_sse2.asm ('k') | source/libvpx/vp8/encoder/onyx_if.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) 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 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after
2437 this_frame_coded_error = this_frame.coded_error; 2437 this_frame_coded_error = this_frame.coded_error;
2438 2438
2439 /* keyframe and section processing ! */ 2439 /* keyframe and section processing ! */
2440 if (cpi->twopass.frames_to_key == 0) 2440 if (cpi->twopass.frames_to_key == 0)
2441 { 2441 {
2442 /* Define next KF group and assign bits to it */ 2442 /* Define next KF group and assign bits to it */
2443 vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame)); 2443 vpx_memcpy(&this_frame_copy, &this_frame, sizeof(this_frame));
2444 find_next_key_frame(cpi, &this_frame_copy); 2444 find_next_key_frame(cpi, &this_frame_copy);
2445 2445
2446 /* Special case: Error error_resilient_mode mode does not make much 2446 /* Special case: Error error_resilient_mode mode does not make much
2447 * sense for two pass but with its current meaning but this code is 2447 * sense for two pass but with its current meaning this code is
2448 * designed to stop outlandish behaviour if someone does set it when 2448 * designed to stop outlandish behaviour if someone does set it when
2449 * using two pass. It effectively disables GF groups. This is 2449 * using two pass. It effectively disables GF groups. This is
2450 * temporary code till we decide what should really happen in this 2450 * temporary code until we decide what should really happen in this
2451 * case. 2451 * case.
2452 */ 2452 */
2453 if (cpi->oxcf.error_resilient_mode) 2453 if (cpi->oxcf.error_resilient_mode)
2454 { 2454 {
2455 cpi->twopass.gf_group_bits = cpi->twopass.kf_group_bits; 2455 cpi->twopass.gf_group_bits = cpi->twopass.kf_group_bits;
2456 cpi->twopass.gf_group_error_left = 2456 cpi->twopass.gf_group_error_left =
2457 (int)cpi->twopass.kf_group_error_left; 2457 (int)cpi->twopass.kf_group_error_left;
2458 cpi->baseline_gf_interval = cpi->twopass.frames_to_key; 2458 cpi->baseline_gf_interval = cpi->twopass.frames_to_key;
2459 cpi->frames_till_gf_update_due = cpi->baseline_gf_interval; 2459 cpi->frames_till_gf_update_due = cpi->baseline_gf_interval;
2460 cpi->source_alt_ref_pending = 0; 2460 cpi->source_alt_ref_pending = 0;
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2766 kf_group_err += calculate_modified_err(cpi, this_frame); 2766 kf_group_err += calculate_modified_err(cpi, this_frame);
2767 2767
2768 /* These figures keep intra and coded error counts for all frames 2768 /* These figures keep intra and coded error counts for all frames
2769 * including key frames in the group. The effect of the key frame 2769 * including key frames in the group. The effect of the key frame
2770 * itself can be subtracted out using the first_frame data 2770 * itself can be subtracted out using the first_frame data
2771 * collected above 2771 * collected above
2772 */ 2772 */
2773 kf_group_intra_err += this_frame->intra_error; 2773 kf_group_intra_err += this_frame->intra_error;
2774 kf_group_coded_err += this_frame->coded_error; 2774 kf_group_coded_err += this_frame->coded_error;
2775 2775
2776 /* load a the next frame's stats */ 2776 /* Load the next frame's stats. */
2777 vpx_memcpy(&last_frame, this_frame, sizeof(*this_frame)); 2777 vpx_memcpy(&last_frame, this_frame, sizeof(*this_frame));
2778 input_stats(cpi, this_frame); 2778 input_stats(cpi, this_frame);
2779 2779
2780 /* Provided that we are not at the end of the file... */ 2780 /* Provided that we are not at the end of the file... */
2781 if (cpi->oxcf.auto_key 2781 if (cpi->oxcf.auto_key
2782 && lookup_next_frame_stats(cpi, &next_frame) != EOF) 2782 && lookup_next_frame_stats(cpi, &next_frame) != EOF)
2783 { 2783 {
2784 /* Normal scene cut check */ 2784 /* Normal scene cut check */
2785 if ( ( i >= MIN_GF_INTERVAL ) && 2785 if ( ( i >= MIN_GF_INTERVAL ) &&
2786 test_candidate_kf(cpi, &last_frame, this_frame, &next_frame) ) 2786 test_candidate_kf(cpi, &last_frame, this_frame, &next_frame) )
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
3358 } 3358 }
3359 3359
3360 if ((cpi->common.Width != new_width) || (cpi->common.Height != new_heigh t)) 3360 if ((cpi->common.Width != new_width) || (cpi->common.Height != new_heigh t))
3361 { 3361 {
3362 cpi->common.Width = new_width; 3362 cpi->common.Width = new_width;
3363 cpi->common.Height = new_height; 3363 cpi->common.Height = new_height;
3364 vp8_alloc_compressor_data(cpi); 3364 vp8_alloc_compressor_data(cpi);
3365 } 3365 }
3366 } 3366 }
3367 } 3367 }
OLDNEW
« no previous file with comments | « source/libvpx/vp8/common/x86/loopfilter_sse2.asm ('k') | source/libvpx/vp8/encoder/onyx_if.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698