| 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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0)) | 109 if (vpx_codec_dec_init(&codec, decoder->interface(), NULL, 0)) |
| 110 die_codec(&codec, "Failed to initialize decoder"); | 110 die_codec(&codec, "Failed to initialize decoder"); |
| 111 | 111 |
| 112 while (vpx_video_reader_read_frame(reader)) { | 112 while (vpx_video_reader_read_frame(reader)) { |
| 113 vpx_codec_iter_t iter = NULL; | 113 vpx_codec_iter_t iter = NULL; |
| 114 vpx_image_t *img = NULL; | 114 vpx_image_t *img = NULL; |
| 115 size_t frame_size = 0; | 115 size_t frame_size = 0; |
| 116 const unsigned char *frame = vpx_video_reader_get_frame(reader, | 116 const unsigned char *frame = vpx_video_reader_get_frame(reader, |
| 117 &frame_size); | 117 &frame_size); |
| 118 if (vpx_codec_decode(&codec, frame, frame_size, NULL, 0)) | 118 if (vpx_codec_decode(&codec, frame, (unsigned int)frame_size, NULL, 0)) |
| 119 die_codec(&codec, "Failed to decode frame"); | 119 die_codec(&codec, "Failed to decode frame"); |
| 120 | 120 |
| 121 while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { | 121 while ((img = vpx_codec_get_frame(&codec, &iter)) != NULL) { |
| 122 unsigned char digest[16]; | 122 unsigned char digest[16]; |
| 123 | 123 |
| 124 get_image_md5(img, digest); | 124 get_image_md5(img, digest); |
| 125 print_md5(outfile, digest); | 125 print_md5(outfile, digest); |
| 126 fprintf(outfile, " img-%dx%d-%04d.i420\n", | 126 fprintf(outfile, " img-%dx%d-%04d.i420\n", |
| 127 img->d_w, img->d_h, ++frame_cnt); | 127 img->d_w, img->d_h, ++frame_cnt); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 | 130 |
| 131 printf("Processed %d frames.\n", frame_cnt); | 131 printf("Processed %d frames.\n", frame_cnt); |
| 132 if (vpx_codec_destroy(&codec)) | 132 if (vpx_codec_destroy(&codec)) |
| 133 die_codec(&codec, "Failed to destroy codec."); | 133 die_codec(&codec, "Failed to destroy codec."); |
| 134 | 134 |
| 135 vpx_video_reader_close(reader); | 135 vpx_video_reader_close(reader); |
| 136 | 136 |
| 137 fclose(outfile); | 137 fclose(outfile); |
| 138 return EXIT_SUCCESS; | 138 return EXIT_SUCCESS; |
| 139 } | 139 } |
| OLD | NEW |