OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 #include <stdlib.h> | 12 #include <stdlib.h> |
13 #include <string.h> | 13 #include <string.h> |
14 | 14 |
15 #include "vpx/vpx_encoder.h" | 15 #include "vpx/vpx_encoder.h" |
16 #include "vpx/vp8cx.h" | 16 #include "vpx/vp8cx.h" |
17 | 17 |
18 #include "../tools_common.h" | 18 #include "../tools_common.h" |
19 #include "../video_writer.h" | 19 #include "../video_writer.h" |
20 | 20 |
21 static const char *exec_name; | 21 static const char *exec_name; |
22 | 22 |
23 void usage_exit() { | 23 void usage_exit(void) { |
24 fprintf(stderr, "vp9_lossless_encoder: Example demonstrating VP9 lossless " | 24 fprintf(stderr, "vp9_lossless_encoder: Example demonstrating VP9 lossless " |
25 "encoding feature. Supports raw input only.\n"); | 25 "encoding feature. Supports raw input only.\n"); |
26 fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile>\n", exec_name); | 26 fprintf(stderr, "Usage: %s <width> <height> <infile> <outfile>\n", exec_name); |
27 exit(EXIT_FAILURE); | 27 exit(EXIT_FAILURE); |
28 } | 28 } |
29 | 29 |
30 static int encode_frame(vpx_codec_ctx_t *codec, | 30 static int encode_frame(vpx_codec_ctx_t *codec, |
31 vpx_image_t *img, | 31 vpx_image_t *img, |
32 int frame_index, | 32 int frame_index, |
33 int flags, | 33 int flags, |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 printf("Processed %d frames.\n", frame_count); | 135 printf("Processed %d frames.\n", frame_count); |
136 | 136 |
137 vpx_img_free(&raw); | 137 vpx_img_free(&raw); |
138 if (vpx_codec_destroy(&codec)) | 138 if (vpx_codec_destroy(&codec)) |
139 die_codec(&codec, "Failed to destroy codec."); | 139 die_codec(&codec, "Failed to destroy codec."); |
140 | 140 |
141 vpx_video_writer_close(writer); | 141 vpx_video_writer_close(writer); |
142 | 142 |
143 return EXIT_SUCCESS; | 143 return EXIT_SUCCESS; |
144 } | 144 } |
OLD | NEW |