| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 rc.layer_target_bitrate[i - 11] = strtol(argv[i], NULL, 0); | 601 rc.layer_target_bitrate[i - 11] = strtol(argv[i], NULL, 0); |
| 602 if (strncmp(encoder->name, "vp8", 3) == 0) | 602 if (strncmp(encoder->name, "vp8", 3) == 0) |
| 603 cfg.ts_target_bitrate[i - 11] = rc.layer_target_bitrate[i - 11]; | 603 cfg.ts_target_bitrate[i - 11] = rc.layer_target_bitrate[i - 11]; |
| 604 else if (strncmp(encoder->name, "vp9", 3) == 0) | 604 else if (strncmp(encoder->name, "vp9", 3) == 0) |
| 605 cfg.layer_target_bitrate[i - 11] = rc.layer_target_bitrate[i - 11]; | 605 cfg.layer_target_bitrate[i - 11] = rc.layer_target_bitrate[i - 11]; |
| 606 } | 606 } |
| 607 | 607 |
| 608 // Real time parameters. | 608 // Real time parameters. |
| 609 cfg.rc_dropframe_thresh = strtol(argv[9], NULL, 0); | 609 cfg.rc_dropframe_thresh = strtol(argv[9], NULL, 0); |
| 610 cfg.rc_end_usage = VPX_CBR; | 610 cfg.rc_end_usage = VPX_CBR; |
| 611 cfg.rc_resize_allowed = 0; | |
| 612 cfg.rc_min_quantizer = 2; | 611 cfg.rc_min_quantizer = 2; |
| 613 cfg.rc_max_quantizer = 56; | 612 cfg.rc_max_quantizer = 56; |
| 614 if (strncmp(encoder->name, "vp9", 3) == 0) | 613 if (strncmp(encoder->name, "vp9", 3) == 0) |
| 615 cfg.rc_max_quantizer = 52; | 614 cfg.rc_max_quantizer = 52; |
| 616 cfg.rc_undershoot_pct = 50; | 615 cfg.rc_undershoot_pct = 50; |
| 617 cfg.rc_overshoot_pct = 50; | 616 cfg.rc_overshoot_pct = 50; |
| 618 cfg.rc_buf_initial_sz = 500; | 617 cfg.rc_buf_initial_sz = 500; |
| 619 cfg.rc_buf_optimal_sz = 600; | 618 cfg.rc_buf_optimal_sz = 600; |
| 620 cfg.rc_buf_sz = 1000; | 619 cfg.rc_buf_sz = 1000; |
| 621 | 620 |
| 621 // Disable dynamic resizing by default. |
| 622 cfg.rc_resize_allowed = 0; |
| 623 |
| 622 // Use 1 thread as default. | 624 // Use 1 thread as default. |
| 623 cfg.g_threads = 1; | 625 cfg.g_threads = 1; |
| 624 | 626 |
| 625 // Enable error resilient mode. | 627 // Enable error resilient mode. |
| 626 cfg.g_error_resilient = 1; | 628 cfg.g_error_resilient = 1; |
| 627 cfg.g_lag_in_frames = 0; | 629 cfg.g_lag_in_frames = 0; |
| 628 cfg.kf_mode = VPX_KF_AUTO; | 630 cfg.kf_mode = VPX_KF_AUTO; |
| 629 | 631 |
| 630 // Disable automatic keyframe placement. | 632 // Disable automatic keyframe placement. |
| 631 cfg.kf_min_dist = cfg.kf_max_dist = 3000; | 633 cfg.kf_min_dist = cfg.kf_max_dist = 3000; |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 if (vpx_codec_destroy(&codec)) | 817 if (vpx_codec_destroy(&codec)) |
| 816 die_codec(&codec, "Failed to destroy codec"); | 818 die_codec(&codec, "Failed to destroy codec"); |
| 817 | 819 |
| 818 // Try to rewrite the output file headers with the actual frame count. | 820 // Try to rewrite the output file headers with the actual frame count. |
| 819 for (i = 0; i < cfg.ts_number_layers; ++i) | 821 for (i = 0; i < cfg.ts_number_layers; ++i) |
| 820 vpx_video_writer_close(outfile[i]); | 822 vpx_video_writer_close(outfile[i]); |
| 821 | 823 |
| 822 vpx_img_free(&raw); | 824 vpx_img_free(&raw); |
| 823 return EXIT_SUCCESS; | 825 return EXIT_SUCCESS; |
| 824 } | 826 } |
| OLD | NEW |