| OLD | NEW |
| 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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) | 111 if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) |
| 112 die_codec(&codec, "Failed to turn off postproc."); | 112 die_codec(&codec, "Failed to turn off postproc."); |
| 113 } else if (frame_cnt % 30 == 16) { | 113 } else if (frame_cnt % 30 == 16) { |
| 114 vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE, | 114 vp8_postproc_cfg_t pp = {VP8_DEBLOCK | VP8_DEMACROBLOCK | VP8_MFQE, |
| 115 4, 0}; | 115 4, 0}; |
| 116 if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) | 116 if (vpx_codec_control(&codec, VP8_SET_POSTPROC, &pp)) |
| 117 die_codec(&codec, "Failed to turn on postproc."); | 117 die_codec(&codec, "Failed to turn on postproc."); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 // Decode the frame with 15ms deadline | 120 // Decode the frame with 15ms deadline |
| 121 if (vpx_codec_decode(&codec, frame, frame_size, NULL, 15000)) | 121 if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 15000)) |
| 122 die_codec(&codec, "Failed to decode frame"); | 122 die_codec(&codec, "Failed to decode frame"); |
| 123 | 123 |
| 124 while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { | 124 while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { |
| 125 vpx_img_write(img, outfile); | 125 vpx_img_write(img, outfile); |
| 126 } | 126 } |
| 127 } | 127 } |
| 128 | 128 |
| 129 printf("Processed %d frames.\n", frame_cnt); | 129 printf("Processed %d frames.\n", frame_cnt); |
| 130 if (vpx_codec_destroy(&codec)) | 130 if (vpx_codec_destroy(&codec)) |
| 131 die_codec(&codec, "Failed to destroy codec"); | 131 die_codec(&codec, "Failed to destroy codec"); |
| 132 | 132 |
| 133 printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", | 133 printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", |
| 134 info->frame_width, info->frame_height, argv[2]); | 134 info->frame_width, info->frame_height, argv[2]); |
| 135 | 135 |
| 136 vpx_video_reader_close(reader); | 136 vpx_video_reader_close(reader); |
| 137 | 137 |
| 138 fclose(outfile); | 138 fclose(outfile); |
| 139 return EXIT_SUCCESS; | 139 return EXIT_SUCCESS; |
| 140 } | 140 } |
| OLD | NEW |