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

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

Issue 181493009: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 9 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
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 static void write_ivf_frame_header(FILE *outfile, 132 static void write_ivf_frame_header(FILE *outfile,
133 const vpx_codec_cx_pkt_t *pkt) 133 const vpx_codec_cx_pkt_t *pkt)
134 { 134 {
135 char header[12]; 135 char header[12];
136 vpx_codec_pts_t pts; 136 vpx_codec_pts_t pts;
137 137
138 if(pkt->kind != VPX_CODEC_CX_FRAME_PKT) 138 if(pkt->kind != VPX_CODEC_CX_FRAME_PKT)
139 return; 139 return;
140 140
141 pts = pkt->data.frame.pts; 141 pts = pkt->data.frame.pts;
142 mem_put_le32(header, pkt->data.frame.sz); 142 mem_put_le32(header, (unsigned int)pkt->data.frame.sz);
143 mem_put_le32(header+4, pts&0xFFFFFFFF); 143 mem_put_le32(header+4, pts&0xFFFFFFFF);
144 mem_put_le32(header+8, pts >> 32); 144 mem_put_le32(header+8, pts >> 32);
145 145
146 (void) fwrite(header, 1, 12, outfile); 146 (void) fwrite(header, 1, 12, outfile);
147 } 147 }
148 148
149 int main(int argc, char **argv) { 149 int main(int argc, char **argv) {
150 FILE *infile, *outfile; 150 FILE *infile, *outfile;
151 vpx_codec_ctx_t codec; 151 vpx_codec_ctx_t codec;
152 vpx_codec_enc_cfg_t cfg; 152 vpx_codec_enc_cfg_t cfg;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 vpx_img_free(&raw); 250 vpx_img_free(&raw);
251 if(vpx_codec_destroy(&codec)) 251 if(vpx_codec_destroy(&codec))
252 die_codec(&codec, "Failed to destroy codec"); 252 die_codec(&codec, "Failed to destroy codec");
253 253
254 /* Try to rewrite the file header with the actual frame count */ 254 /* Try to rewrite the file header with the actual frame count */
255 if(!fseek(outfile, 0, SEEK_SET)) 255 if(!fseek(outfile, 0, SEEK_SET))
256 write_ivf_file_header(outfile, &cfg, frame_cnt-1); 256 write_ivf_file_header(outfile, &cfg, frame_cnt-1);
257 fclose(outfile); 257 fclose(outfile);
258 return EXIT_SUCCESS; 258 return EXIT_SUCCESS;
259 } 259 }
OLDNEW
« no previous file with comments | « source/libvpx/examples/vp8_set_maps.c ('k') | source/libvpx/examples/vp9_spatial_scalable_encoder.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698