| 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 11 matching lines...) Expand all Loading... |
| 22 // your application. In general, an IVF file consists of a file header, | 22 // your application. In general, an IVF file consists of a file header, |
| 23 // followed by a variable number of frames. Each frame consists of a frame | 23 // followed by a variable number of frames. Each frame consists of a frame |
| 24 // header followed by a variable length payload. The length of the payload | 24 // header followed by a variable length payload. The length of the payload |
| 25 // is specified in the first four bytes of the frame header. The payload is | 25 // is specified in the first four bytes of the frame header. The payload is |
| 26 // the raw compressed data. | 26 // the raw compressed data. |
| 27 // | 27 // |
| 28 // Standard Includes | 28 // Standard Includes |
| 29 // ----------------- | 29 // ----------------- |
| 30 // For decoders, you only have to include `vpx_decoder.h` and then any | 30 // For decoders, you only have to include `vpx_decoder.h` and then any |
| 31 // header files for the specific codecs you use. In this case, we're using | 31 // header files for the specific codecs you use. In this case, we're using |
| 32 // vp8. The `VPX_CODEC_DISABLE_COMPAT` macro can be defined to ensure | 32 // vp8. |
| 33 // strict compliance with the latest SDK by disabling some backwards | |
| 34 // compatibility features. Defining this macro is encouraged. | |
| 35 // | 33 // |
| 36 // Initializing The Codec | 34 // Initializing The Codec |
| 37 // ---------------------- | 35 // ---------------------- |
| 38 // The decoder is initialized by the following code. This is an example for | 36 // The decoder is initialized by the following code. This is an example for |
| 39 // the VP8 decoder, but the code is analogous for all algorithms. Replace | 37 // the VP8 decoder, but the code is analogous for all algorithms. Replace |
| 40 // `vpx_codec_vp8_dx()` with a pointer to the interface exposed by the | 38 // `vpx_codec_vp8_dx()` with a pointer to the interface exposed by the |
| 41 // algorithm you want to use. The `cfg` argument is left as NULL in this | 39 // algorithm you want to use. The `cfg` argument is left as NULL in this |
| 42 // example, because we want the algorithm to determine the stream | 40 // example, because we want the algorithm to determine the stream |
| 43 // configuration (width/height) and allocate memory automatically. This | 41 // configuration (width/height) and allocate memory automatically. This |
| 44 // parameter is generally only used if you need to preallocate memory, | 42 // parameter is generally only used if you need to preallocate memory, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 74 // -------------- | 72 // -------------- |
| 75 // This example does not special case any error return codes. If there was | 73 // This example does not special case any error return codes. If there was |
| 76 // an error, a descriptive message is printed and the program exits. With | 74 // an error, a descriptive message is printed and the program exits. With |
| 77 // few exeptions, vpx_codec functions return an enumerated error status, | 75 // few exeptions, vpx_codec functions return an enumerated error status, |
| 78 // with the value `0` indicating success. | 76 // with the value `0` indicating success. |
| 79 | 77 |
| 80 #include <stdio.h> | 78 #include <stdio.h> |
| 81 #include <stdlib.h> | 79 #include <stdlib.h> |
| 82 #include <string.h> | 80 #include <string.h> |
| 83 | 81 |
| 84 #define VPX_CODEC_DISABLE_COMPAT 1 | |
| 85 | |
| 86 #include "vpx/vp8dx.h" | 82 #include "vpx/vp8dx.h" |
| 87 #include "vpx/vpx_decoder.h" | 83 #include "vpx/vpx_decoder.h" |
| 88 | 84 |
| 89 #include "./tools_common.h" | 85 #include "./tools_common.h" |
| 90 #include "./video_reader.h" | 86 #include "./video_reader.h" |
| 91 #include "./vpx_config.h" | 87 #include "./vpx_config.h" |
| 92 | 88 |
| 93 static const char *exec_name; | 89 static const char *exec_name; |
| 94 | 90 |
| 95 void usage_exit() { | 91 void usage_exit() { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 145 |
| 150 printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", | 146 printf("Play: ffplay -f rawvideo -pix_fmt yuv420p -s %dx%d %s\n", |
| 151 info->frame_width, info->frame_height, argv[2]); | 147 info->frame_width, info->frame_height, argv[2]); |
| 152 | 148 |
| 153 vpx_video_reader_close(reader); | 149 vpx_video_reader_close(reader); |
| 154 | 150 |
| 155 fclose(outfile); | 151 fclose(outfile); |
| 156 | 152 |
| 157 return EXIT_SUCCESS; | 153 return EXIT_SUCCESS; |
| 158 } | 154 } |
| OLD | NEW |