Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Side by Side Diff: source/libvpx/examples/simple_encoder.c

Issue 592203002: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/examples/simple_decoder.c ('k') | source/libvpx/examples/twopass_encoder.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 10 matching lines...) Expand all
21 // your application. In general, an IVF file consists of a file header, 21 // your application. In general, an IVF file consists of a file header,
22 // followed by a variable number of frames. Each frame consists of a frame 22 // followed by a variable number of frames. Each frame consists of a frame
23 // header followed by a variable length payload. The length of the payload 23 // header followed by a variable length payload. The length of the payload
24 // is specified in the first four bytes of the frame header. The payload is 24 // is specified in the first four bytes of the frame header. The payload is
25 // the raw compressed data. 25 // the raw compressed data.
26 // 26 //
27 // Standard Includes 27 // Standard Includes
28 // ----------------- 28 // -----------------
29 // For encoders, you only have to include `vpx_encoder.h` and then any 29 // For encoders, you only have to include `vpx_encoder.h` and then any
30 // header files for the specific codecs you use. In this case, we're using 30 // header files for the specific codecs you use. In this case, we're using
31 // vp8. The `VPX_CODEC_DISABLE_COMPAT` macro can be defined to ensure 31 // vp8.
32 // strict compliance with the latest SDK by disabling some backwards
33 // compatibility features. Defining this macro is encouraged.
34 // 32 //
35 // Getting The Default Configuration 33 // Getting The Default Configuration
36 // --------------------------------- 34 // ---------------------------------
37 // Encoders have the notion of "usage profiles." For example, an encoder 35 // Encoders have the notion of "usage profiles." For example, an encoder
38 // may want to publish default configurations for both a video 36 // may want to publish default configurations for both a video
39 // conferencing application and a best quality offline encoder. These 37 // conferencing application and a best quality offline encoder. These
40 // obviously have very different default settings. Consult the 38 // obviously have very different default settings. Consult the
41 // documentation for your codec to see if it provides any default 39 // documentation for your codec to see if it provides any default
42 // configurations. All codecs provide a default configuration, number 0, 40 // configurations. All codecs provide a default configuration, number 0,
43 // which is valid for material in the vacinity of QCIF/QVGA. 41 // which is valid for material in the vacinity of QCIF/QVGA.
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 // ------------------------- 92 // -------------------------
95 // Error resiliency is controlled by the g_error_resilient member of the 93 // Error resiliency is controlled by the g_error_resilient member of the
96 // configuration structure. Use the `decode_with_drops` example to decode with 94 // configuration structure. Use the `decode_with_drops` example to decode with
97 // frames 5-10 dropped. Compare the output for a file encoded with this example 95 // frames 5-10 dropped. Compare the output for a file encoded with this example
98 // versus one encoded with the `simple_encoder` example. 96 // versus one encoded with the `simple_encoder` example.
99 97
100 #include <stdio.h> 98 #include <stdio.h>
101 #include <stdlib.h> 99 #include <stdlib.h>
102 #include <string.h> 100 #include <string.h>
103 101
104 #define VPX_CODEC_DISABLE_COMPAT 1
105 #include "vpx/vpx_encoder.h" 102 #include "vpx/vpx_encoder.h"
106 103
107 #include "./tools_common.h" 104 #include "./tools_common.h"
108 #include "./video_writer.h" 105 #include "./video_writer.h"
109 106
110 static const char *exec_name; 107 static const char *exec_name;
111 108
112 void usage_exit() { 109 void usage_exit() {
113 fprintf(stderr, 110 fprintf(stderr,
114 "Usage: %s <codec> <width> <height> <infile> <outfile> " 111 "Usage: %s <codec> <width> <height> <infile> <outfile> "
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 printf("Processed %d frames.\n", frame_count); 247 printf("Processed %d frames.\n", frame_count);
251 248
252 vpx_img_free(&raw); 249 vpx_img_free(&raw);
253 if (vpx_codec_destroy(&codec)) 250 if (vpx_codec_destroy(&codec))
254 die_codec(&codec, "Failed to destroy codec."); 251 die_codec(&codec, "Failed to destroy codec.");
255 252
256 vpx_video_writer_close(writer); 253 vpx_video_writer_close(writer);
257 254
258 return EXIT_SUCCESS; 255 return EXIT_SUCCESS;
259 } 256 }
OLDNEW
« no previous file with comments | « source/libvpx/examples/simple_decoder.c ('k') | source/libvpx/examples/twopass_encoder.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698