| 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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 } | 623 } |
| 624 } | 624 } |
| 625 #endif | 625 #endif |
| 626 | 626 |
| 627 // skip initial frames | 627 // skip initial frames |
| 628 for (i = 0; i < app_input.frames_to_skip; ++i) | 628 for (i = 0; i < app_input.frames_to_skip; ++i) |
| 629 vpx_img_read(&raw, infile); | 629 vpx_img_read(&raw, infile); |
| 630 | 630 |
| 631 if (svc_ctx.speed != -1) | 631 if (svc_ctx.speed != -1) |
| 632 vpx_codec_control(&codec, VP8E_SET_CPUUSED, svc_ctx.speed); | 632 vpx_codec_control(&codec, VP8E_SET_CPUUSED, svc_ctx.speed); |
| 633 vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, 0); | 633 if (svc_ctx.threads) |
| 634 vpx_codec_control(&codec, VP9E_SET_TILE_COLUMNS, (svc_ctx.threads >> 1)); |
| 634 | 635 |
| 635 // Encode frames | 636 // Encode frames |
| 636 while (!end_of_stream) { | 637 while (!end_of_stream) { |
| 637 vpx_codec_iter_t iter = NULL; | 638 vpx_codec_iter_t iter = NULL; |
| 638 const vpx_codec_cx_pkt_t *cx_pkt; | 639 const vpx_codec_cx_pkt_t *cx_pkt; |
| 639 if (frame_cnt >= app_input.frames_to_code || !vpx_img_read(&raw, infile)) { | 640 if (frame_cnt >= app_input.frames_to_code || !vpx_img_read(&raw, infile)) { |
| 640 // We need one extra vpx_svc_encode call at end of stream to flush | 641 // We need one extra vpx_svc_encode call at end of stream to flush |
| 641 // encoder and get remaining data | 642 // encoder and get remaining data |
| 642 end_of_stream = 1; | 643 end_of_stream = 1; |
| 643 } | 644 } |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 vpx_video_writer_close(outfile[tl]); | 783 vpx_video_writer_close(outfile[tl]); |
| 783 } | 784 } |
| 784 } | 785 } |
| 785 #endif | 786 #endif |
| 786 vpx_img_free(&raw); | 787 vpx_img_free(&raw); |
| 787 // display average size, psnr | 788 // display average size, psnr |
| 788 printf("%s", vpx_svc_dump_statistics(&svc_ctx)); | 789 printf("%s", vpx_svc_dump_statistics(&svc_ctx)); |
| 789 vpx_svc_release(&svc_ctx); | 790 vpx_svc_release(&svc_ctx); |
| 790 return EXIT_SUCCESS; | 791 return EXIT_SUCCESS; |
| 791 } | 792 } |
| OLD | NEW |