History

Resolves some lint errors

And also fixes some style consistency issues.

Deb Mukherjee committed 12 years ago

Commit a349ee31 parent 29771776 files · +228 −238Browse files

Unified · Split

6 files
  1. examples/vp8cx_set_ref.c +1 −1
  2. examples/vp9_spatial_svc_encoder.c +3 −3
  3. vp8/encoder/pickinter.c +2 −3
  4. vp8/vp8_dx_iface.c +17 −21
  5. vpxdec.c +41 −44
  6. vpxenc.c +164 −166
examples/vp8cx_set_ref.c+1−1
@@ -178,7 +178,7 @@ int main(int argc, char **argv) { · 177 unmodified lines
178 }178 }
179 179
180 // Flush encoder.180 // Flush encoder.
181 while (encode_frame(&codec, NULL, -1, writer)) {};181 while (encode_frame(&codec, NULL, -1, writer)) {}
182 182
183 printf("\n");183 printf("\n");
184 fclose(infile);184 fclose(infile);
examples/vp9_spatial_svc_encoder.c+3−3
@@ -183,7 +183,7 @@ static void parse_command_line(int argc, const char **argv_, · 182 unmodified lines
183 enc_cfg->kf_min_dist = arg_parse_uint(&arg);183 enc_cfg->kf_min_dist = arg_parse_uint(&arg);
184 enc_cfg->kf_max_dist = enc_cfg->kf_min_dist;184 enc_cfg->kf_max_dist = enc_cfg->kf_min_dist;
185 } else if (arg_match(&arg, &scale_factors_arg, argi)) {185 } else if (arg_match(&arg, &scale_factors_arg, argi)) {
186 snprintf(string_options, 1024, "%s scale-factors=%s",186 snprintf(string_options, sizeof(string_options), "%s scale-factors=%s",
187 string_options, arg.val);187 string_options, arg.val);
188 } else if (arg_match(&arg, &passes_arg, argi)) {188 } else if (arg_match(&arg, &passes_arg, argi)) {
189 passes = arg_parse_uint(&arg);189 passes = arg_parse_uint(&arg);
@@ -198,10 +198,10 @@ static void parse_command_line(int argc, const char **argv_, · 8 unmodified lines
198 } else if (arg_match(&arg, &fpf_name_arg, argi)) {198 } else if (arg_match(&arg, &fpf_name_arg, argi)) {
199 fpf_file_name = arg.val;199 fpf_file_name = arg.val;
200 } else if (arg_match(&arg, &min_q_arg, argi)) {200 } else if (arg_match(&arg, &min_q_arg, argi)) {
201 snprintf(string_options, 1024, "%s min-quantizers=%s",201 snprintf(string_options, sizeof(string_options), "%s min-quantizers=%s",
202 string_options, arg.val);202 string_options, arg.val);
203 } else if (arg_match(&arg, &max_q_arg, argi)) {203 } else if (arg_match(&arg, &max_q_arg, argi)) {
204 snprintf(string_options, 1024, "%s max-quantizers=%s",204 snprintf(string_options, sizeof(string_options), "%s max-quantizers=%s",
205 string_options, arg.val);205 string_options, arg.val);
206 } else if (arg_match(&arg, &min_bitrate_arg, argi)) {206 } else if (arg_match(&arg, &min_bitrate_arg, argi)) {
207 min_bitrate = arg_parse_uint(&arg);207 min_bitrate = arg_parse_uint(&arg);
vp8/encoder/pickinter.c+2−3
@@ -516,9 +516,8 @@ static int evaluate_inter_mode(unsigned int* sse, int rate2, int* distortion2, · 515 unmodified lines
516 // Adjust rd for ZEROMV and LAST, if LAST is the closest reference frame.516 // Adjust rd for ZEROMV and LAST, if LAST is the closest reference frame.
517 if (this_mode == ZEROMV &&517 if (this_mode == ZEROMV &&
518 x->e_mbd.mode_info_context->mbmi.ref_frame == LAST_FRAME &&518 x->e_mbd.mode_info_context->mbmi.ref_frame == LAST_FRAME &&
519 (denoise_aggressive || cpi->closest_reference_frame == LAST_FRAME))519 (denoise_aggressive || cpi->closest_reference_frame == LAST_FRAME)) {
520 {520 this_rd = ((int64_t)this_rd) * rd_adj / 100;
521 this_rd = ((int64_t)this_rd) * rd_adj / 100;
522 }521 }
523 522
524 check_for_encode_breakout(*sse, x);523 check_for_encode_breakout(*sse, x);
vp8/vp8_dx_iface.c+17−21
@@ -112,22 +112,19 @@ static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx, · 111 unmodified lines
112 * structure. More memory may be required at the time the stream112 * structure. More memory may be required at the time the stream
113 * information becomes known.113 * information becomes known.
114 */114 */
115 if (!ctx->priv)115 if (!ctx->priv) {
116 {116 vp8_init_ctx(ctx);
117 vp8_init_ctx(ctx);117 priv = (vpx_codec_alg_priv_t *)ctx->priv;
118 priv = (vpx_codec_alg_priv_t *)ctx->priv;118
119 119 /* initialize number of fragments to zero */
120 /* initialize number of fragments to zero */120 priv->fragments.count = 0;
121 priv->fragments.count = 0;121 /* is input fragments enabled? */
122 /* is input fragments enabled? */122 priv->fragments.enabled =
123 priv->fragments.enabled =123 (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS);
124 (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS);124
125 125 /*post processing level initialized to do nothing */
126 /*post processing level initialized to do nothing */126 } else {
127 }127 priv = (vpx_codec_alg_priv_t *)ctx->priv;
128 else
129 {
130 priv = (vpx_codec_alg_priv_t *)ctx->priv;
131 }128 }
132 129
133 priv->yv12_frame_buffers.use_frame_threads =130 priv->yv12_frame_buffers.use_frame_threads =
@@ -138,11 +135,10 @@ static vpx_codec_err_t vp8_init(vpx_codec_ctx_t *ctx, · 4 unmodified lines
138 135
139 if (priv->yv12_frame_buffers.use_frame_threads &&136 if (priv->yv12_frame_buffers.use_frame_threads &&
140 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) ||137 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) ||
141 (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS)))138 (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) {
142 {139 /* row-based threading, error concealment, and input fragments will
143 /* row-based threading, error concealment, and input fragments will140 * not be supported when using frame-based threading */
144 * not be supported when using frame-based threading */141 res = VPX_CODEC_INVALID_PARAM;
145 res = VPX_CODEC_INVALID_PARAM;
146 }142 }
147 143
148 return res;144 return res;
vpxdec.c+41−44
@@ -47,52 +47,49 @@ struct VpxDecInputContext { · 46 unmodified lines
47 struct WebmInputContext *webm_ctx;47 struct WebmInputContext *webm_ctx;
48};48};
49 49
50static const arg_def_t looparg = ARG_DEF(NULL, "loops", 1,50static const arg_def_t looparg = ARG_DEF(
51 "Number of times to decode the file");51 NULL, "loops", 1, "Number of times to decode the file");
52static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1,52static const arg_def_t codecarg = ARG_DEF(
53 "Codec to use");53 NULL, "codec", 1, "Codec to use");
54static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0,54static const arg_def_t use_yv12 = ARG_DEF(
55 "Output raw YV12 frames");55 NULL, "yv12", 0, "Output raw YV12 frames");
56static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0,56static const arg_def_t use_i420 = ARG_DEF(
57 "Output raw I420 frames");57 NULL, "i420", 0, "Output raw I420 frames");
58static const arg_def_t flipuvarg = ARG_DEF(NULL, "flipuv", 0,58static const arg_def_t flipuvarg = ARG_DEF(
59 "Flip the chroma planes in the output");59 NULL, "flipuv", 0, "Flip the chroma planes in the output");
60static const arg_def_t rawvideo = ARG_DEF(NULL, "rawvideo", 0,60static const arg_def_t rawvideo = ARG_DEF(
61 "Output raw YUV frames");61 NULL, "rawvideo", 0, "Output raw YUV frames");
62static const arg_def_t noblitarg = ARG_DEF(NULL, "noblit", 0,62static const arg_def_t noblitarg = ARG_DEF(
63 "Don't process the decoded frames");63 NULL, "noblit", 0, "Don't process the decoded frames");
64static const arg_def_t progressarg = ARG_DEF(NULL, "progress", 0,64static const arg_def_t progressarg = ARG_DEF(
65 "Show progress after each frame decodes");65 NULL, "progress", 0, "Show progress after each frame decodes");
66static const arg_def_t limitarg = ARG_DEF(NULL, "limit", 1,66static const arg_def_t limitarg = ARG_DEF(
67 "Stop decoding after n frames");67 NULL, "limit", 1, "Stop decoding after n frames");
68static const arg_def_t skiparg = ARG_DEF(NULL, "skip", 1,68static const arg_def_t skiparg = ARG_DEF(
69 "Skip the first n input frames");69 NULL, "skip", 1, "Skip the first n input frames");
70static const arg_def_t postprocarg = ARG_DEF(NULL, "postproc", 0,70static const arg_def_t postprocarg = ARG_DEF(
71 "Postprocess decoded frames");71 NULL, "postproc", 0, "Postprocess decoded frames");
72static const arg_def_t summaryarg = ARG_DEF(NULL, "summary", 0,72static const arg_def_t summaryarg = ARG_DEF(
73 "Show timing summary");73 NULL, "summary", 0, "Show timing summary");
74static const arg_def_t outputfile = ARG_DEF("o", "output", 1,74static const arg_def_t outputfile = ARG_DEF(
75 "Output file name pattern (see below)");75 "o", "output", 1, "Output file name pattern (see below)");
76static const arg_def_t threadsarg = ARG_DEF("t", "threads", 1,76static const arg_def_t threadsarg = ARG_DEF(
77 "Max threads to use");77 "t", "threads", 1, "Max threads to use");
78static const arg_def_t verbosearg = ARG_DEF("v", "verbose", 0,78static const arg_def_t verbosearg = ARG_DEF(
79 "Show version string");79 "v", "verbose", 0, "Show version string");
80static const arg_def_t error_concealment = ARG_DEF(NULL, "error-concealment", 0,80static const arg_def_t error_concealment = ARG_DEF(
81 "Enable decoder error-concealment");81 NULL, "error-concealment", 0, "Enable decoder error-concealment");
82static const arg_def_t scalearg = ARG_DEF("S", "scale", 0,82static const arg_def_t scalearg = ARG_DEF(
83 "Scale output frames uniformly");83 "S", "scale", 0, "Scale output frames uniformly");
84static const arg_def_t continuearg =84static const arg_def_t continuearg = ARG_DEF(
85 ARG_DEF("k", "keep-going", 0, "(debug) Continue decoding after error");85 "k", "keep-going", 0, "(debug) Continue decoding after error");
86 86static const arg_def_t fb_arg = ARG_DEF(
87static const arg_def_t fb_arg =87 NULL, "frame-buffers", 1, "Number of frame buffers to use");
88 ARG_DEF(NULL, "frame-buffers", 1, "Number of frame buffers to use");88static const arg_def_t md5arg = ARG_DEF(
89 89 NULL, "md5", 0, "Compute the MD5 sum of the decoded frame");
90static const arg_def_t md5arg = ARG_DEF(NULL, "md5", 0,
91 "Compute the MD5 sum of the decoded frame");
92#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH90#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH
93static const arg_def_t outbitdeptharg = ARG_DEF(91static const arg_def_t outbitdeptharg = ARG_DEF(
94 NULL, "output-bit-depth", 1,92 NULL, "output-bit-depth", 1, "Output bit-depth for decoded frames");
95 "Output bit-depth for decoded frames");
96#endif93#endif
97 94
98static const arg_def_t *all_args[] = {95static const arg_def_t *all_args[] = {
vpxenc.c+164−166
@@ -128,50 +128,50 @@ int fourcc_is_ivf(const char detect[4]) { · 127 unmodified lines
128 return 0;128 return 0;
129}129}
130 130
131static const arg_def_t debugmode = ARG_DEF("D", "debug", 0,131static const arg_def_t debugmode = ARG_DEF(
132 "Debug mode (makes output deterministic)");132 "D", "debug", 0, "Debug mode (makes output deterministic)");
133static const arg_def_t outputfile = ARG_DEF("o", "output", 1,133static const arg_def_t outputfile = ARG_DEF(
134 "Output filename");134 "o", "output", 1, "Output filename");
135static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0,135static const arg_def_t use_yv12 = ARG_DEF(
136 "Input file is YV12 ");136 NULL, "yv12", 0, "Input file is YV12 ");
137static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0,137static const arg_def_t use_i420 = ARG_DEF(
138 "Input file is I420 (default)");138 NULL, "i420", 0, "Input file is I420 (default)");
139static const arg_def_t use_i422 = ARG_DEF(NULL, "i422", 0,139static const arg_def_t use_i422 = ARG_DEF(
140 "Input file is I422");140 NULL, "i422", 0, "Input file is I422");
141static const arg_def_t use_i444 = ARG_DEF(NULL, "i444", 0,141static const arg_def_t use_i444 = ARG_DEF(
142 "Input file is I444");142 NULL, "i444", 0, "Input file is I444");
143static const arg_def_t use_i440 = ARG_DEF(NULL, "i440", 0,143static const arg_def_t use_i440 = ARG_DEF(
144 "Input file is I440");144 NULL, "i440", 0, "Input file is I440");
145static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1,145static const arg_def_t codecarg = ARG_DEF(
146 "Codec to use");146 NULL, "codec", 1, "Codec to use");
147static const arg_def_t passes = ARG_DEF("p", "passes", 1,147static const arg_def_t passes = ARG_DEF(
148 "Number of passes (1/2)");148 "p", "passes", 1, "Number of passes (1/2)");
149static const arg_def_t pass_arg = ARG_DEF(NULL, "pass", 1,149static const arg_def_t pass_arg = ARG_DEF(
150 "Pass to execute (1/2)");150 NULL, "pass", 1, "Pass to execute (1/2)");
151static const arg_def_t fpf_name = ARG_DEF(NULL, "fpf", 1,151static const arg_def_t fpf_name = ARG_DEF(
152 "First pass statistics file name");152 NULL, "fpf", 1, "First pass statistics file name");
153#if CONFIG_FP_MB_STATS153#if CONFIG_FP_MB_STATS
154static const arg_def_t fpmbf_name = ARG_DEF(NULL, "fpmbf", 1,154static const arg_def_t fpmbf_name = ARG_DEF(
155 "First pass block statistics file name");155 NULL, "fpmbf", 1, "First pass block statistics file name");
156#endif156#endif
157static const arg_def_t limit = ARG_DEF(NULL, "limit", 1,157static const arg_def_t limit = ARG_DEF(
158 "Stop encoding after n input frames");158 NULL, "limit", 1, "Stop encoding after n input frames");
159static const arg_def_t skip = ARG_DEF(NULL, "skip", 1,159static const arg_def_t skip = ARG_DEF(
160 "Skip the first n input frames");160 NULL, "skip", 1, "Skip the first n input frames");
161static const arg_def_t deadline = ARG_DEF("d", "deadline", 1,161static const arg_def_t deadline = ARG_DEF(
162 "Deadline per frame (usec)");162 "d", "deadline", 1, "Deadline per frame (usec)");
163static const arg_def_t best_dl = ARG_DEF(NULL, "best", 0,163static const arg_def_t best_dl = ARG_DEF(
164 "Use Best Quality Deadline");164 NULL, "best", 0, "Use Best Quality Deadline");
165static const arg_def_t good_dl = ARG_DEF(NULL, "good", 0,165static const arg_def_t good_dl = ARG_DEF(
166 "Use Good Quality Deadline");166 NULL, "good", 0, "Use Good Quality Deadline");
167static const arg_def_t rt_dl = ARG_DEF(NULL, "rt", 0,167static const arg_def_t rt_dl = ARG_DEF(
168 "Use Realtime Quality Deadline");168 NULL, "rt", 0, "Use Realtime Quality Deadline");
169static const arg_def_t quietarg = ARG_DEF("q", "quiet", 0,169static const arg_def_t quietarg = ARG_DEF(
170 "Do not print encode progress");170 "q", "quiet", 0, "Do not print encode progress");
171static const arg_def_t verbosearg = ARG_DEF("v", "verbose", 0,171static const arg_def_t verbosearg = ARG_DEF(
172 "Show encoder parameters");172 "v", "verbose", 0, "Show encoder parameters");
173static const arg_def_t psnrarg = ARG_DEF(NULL, "psnr", 0,173static const arg_def_t psnrarg = ARG_DEF(
174 "Show PSNR in status line");174 NULL, "psnr", 0, "Show PSNR in status line");
175 175
176static const struct arg_enum_list test_decode_enum[] = {176static const struct arg_enum_list test_decode_enum[] = {
177 {"off", TEST_DECODE_OFF},177 {"off", TEST_DECODE_OFF},
@@ -179,25 +179,25 @@ static const struct arg_enum_list test_decode_enum[] = { · 1 unmodified line
179 {"warn", TEST_DECODE_WARN},179 {"warn", TEST_DECODE_WARN},
180 {NULL, 0}180 {NULL, 0}
181};181};
182static const arg_def_t recontest = ARG_DEF_ENUM(NULL, "test-decode", 1,182static const arg_def_t recontest = ARG_DEF_ENUM(
183 "Test encode/decode mismatch",183 NULL, "test-decode", 1, "Test encode/decode mismatch", test_decode_enum);
184 test_decode_enum);184static const arg_def_t framerate = ARG_DEF(
185static const arg_def_t framerate = ARG_DEF(NULL, "fps", 1,185 NULL, "fps", 1, "Stream frame rate (rate/scale)");
186 "Stream frame rate (rate/scale)");186static const arg_def_t use_ivf = ARG_DEF(
187static const arg_def_t use_ivf = ARG_DEF(NULL, "ivf", 0,187 NULL, "ivf", 0, "Output IVF (default is WebM if WebM IO is enabled)");
188 "Output IVF (default is WebM if WebM IO is enabled)");188static const arg_def_t out_part = ARG_DEF(
189static const arg_def_t out_part = ARG_DEF("P", "output-partitions", 0,189 "P", "output-partitions", 0,
190 "Makes encoder output partitions. Requires IVF output!");190 "Makes encoder output partitions. Requires IVF output!");
191static const arg_def_t q_hist_n = ARG_DEF(NULL, "q-hist", 1,191static const arg_def_t q_hist_n = ARG_DEF(
192 "Show quantizer histogram (n-buckets)");192 NULL, "q-hist", 1, "Show quantizer histogram (n-buckets)");
193static const arg_def_t rate_hist_n = ARG_DEF(NULL, "rate-hist", 1,193static const arg_def_t rate_hist_n = ARG_DEF(
194 "Show rate histogram (n-buckets)");194 NULL, "rate-hist", 1, "Show rate histogram (n-buckets)");
195static const arg_def_t disable_warnings =195static const arg_def_t disable_warnings = ARG_DEF(
196 ARG_DEF(NULL, "disable-warnings", 0,196 NULL, "disable-warnings", 0,
197 "Disable warnings about potentially incorrect encode settings.");197 "Disable warnings about potentially incorrect encode settings.");
198static const arg_def_t disable_warning_prompt =198static const arg_def_t disable_warning_prompt = ARG_DEF(
199 ARG_DEF("y", "disable-warning-prompt", 0,199 "y", "disable-warning-prompt", 0,
200 "Display warnings, but do not prompt user to continue.");200 "Display warnings, but do not prompt user to continue.");
201 201
202#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH202#if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH
203static const arg_def_t test16bitinternalarg = ARG_DEF(203static const arg_def_t test16bitinternalarg = ARG_DEF(
@@ -213,16 +213,14 @@ static const arg_def_t *main_args[] = { · 9 unmodified lines
213 NULL213 NULL
214};214};
215 215
216static const arg_def_t usage = ARG_DEF("u", "usage", 1,216static const arg_def_t usage = ARG_DEF(
217 "Usage profile number to use");217 "u", "usage", 1, "Usage profile number to use");
218static const arg_def_t threads = ARG_DEF("t", "threads", 1,218static const arg_def_t threads = ARG_DEF(
219 "Max number of threads to use");219 "t", "threads", 1, "Max number of threads to use");
220static const arg_def_t profile = ARG_DEF(NULL, "profile", 1,220static const arg_def_t profile = ARG_DEF(
221 "Bitstream profile number to use");221 NULL, "profile", 1, "Bitstream profile number to use");
222static const arg_def_t width = ARG_DEF("w", "width", 1,222static const arg_def_t width = ARG_DEF("w", "width", 1, "Frame width");
223 "Frame width");223static const arg_def_t height = ARG_DEF("h", "height", 1, "Frame height");
224static const arg_def_t height = ARG_DEF("h", "height", 1,
225 "Frame height");
226#if CONFIG_WEBM_IO224#if CONFIG_WEBM_IO
227static const struct arg_enum_list stereo_mode_enum[] = {225static const struct arg_enum_list stereo_mode_enum[] = {
228 {"mono", STEREO_FORMAT_MONO},226 {"mono", STEREO_FORMAT_MONO},
@@ -232,15 +230,15 @@ static const struct arg_enum_list stereo_mode_enum[] = { · 3 unmodified lines
232 {"right-left", STEREO_FORMAT_RIGHT_LEFT},230 {"right-left", STEREO_FORMAT_RIGHT_LEFT},
233 {NULL, 0}231 {NULL, 0}
234};232};
235static const arg_def_t stereo_mode = ARG_DEF_ENUM(NULL, "stereo-mode", 1,233static const arg_def_t stereo_mode = ARG_DEF_ENUM(
236 "Stereo 3D video format", stereo_mode_enum);234 NULL, "stereo-mode", 1, "Stereo 3D video format", stereo_mode_enum);
237#endif235#endif
238static const arg_def_t timebase = ARG_DEF(NULL, "timebase", 1,236static const arg_def_t timebase = ARG_DEF(
239 "Output timestamp precision (fractional seconds)");237 NULL, "timebase", 1, "Output timestamp precision (fractional seconds)");
240static const arg_def_t error_resilient = ARG_DEF(NULL, "error-resilient", 1,238static const arg_def_t error_resilient = ARG_DEF(
241 "Enable error resiliency features");239 NULL, "error-resilient", 1, "Enable error resiliency features");
242static const arg_def_t lag_in_frames = ARG_DEF(NULL, "lag-in-frames", 1,240static const arg_def_t lag_in_frames = ARG_DEF(
243 "Max number of frames to lag");241 NULL, "lag-in-frames", 1, "Max number of frames to lag");
244 242
245static const arg_def_t *global_args[] = {243static const arg_def_t *global_args[] = {
246 &use_yv12, &use_i420, &use_i422, &use_i444, &use_i440,244 &use_yv12, &use_i420, &use_i422, &use_i444, &use_i440,
@@ -257,18 +255,18 @@ static const arg_def_t *global_args[] = { · 10 unmodified lines
257 &lag_in_frames, NULL255 &lag_in_frames, NULL
258};256};
259 257
260static const arg_def_t dropframe_thresh = ARG_DEF(NULL, "drop-frame", 1,258static const arg_def_t dropframe_thresh = ARG_DEF(
261 "Temporal resampling threshold (buf %)");259 NULL, "drop-frame", 1, "Temporal resampling threshold (buf %)");
262static const arg_def_t resize_allowed = ARG_DEF(NULL, "resize-allowed", 1,260static const arg_def_t resize_allowed = ARG_DEF(
263 "Spatial resampling enabled (bool)");261 NULL, "resize-allowed", 1, "Spatial resampling enabled (bool)");
264static const arg_def_t resize_width = ARG_DEF(NULL, "resize-width", 1,262static const arg_def_t resize_width = ARG_DEF(
265 "Width of encoded frame");263 NULL, "resize-width", 1, "Width of encoded frame");
266static const arg_def_t resize_height = ARG_DEF(NULL, "resize-height", 1,264static const arg_def_t resize_height = ARG_DEF(
267 "Height of encoded frame");265 NULL, "resize-height", 1, "Height of encoded frame");
268static const arg_def_t resize_up_thresh = ARG_DEF(NULL, "resize-up", 1,266static const arg_def_t resize_up_thresh = ARG_DEF(
269 "Upscale threshold (buf %)");267 NULL, "resize-up", 1, "Upscale threshold (buf %)");
270static const arg_def_t resize_down_thresh = ARG_DEF(NULL, "resize-down", 1,268static const arg_def_t resize_down_thresh = ARG_DEF(
271 "Downscale threshold (buf %)");269 NULL, "resize-down", 1, "Downscale threshold (buf %)");
272static const struct arg_enum_list end_usage_enum[] = {270static const struct arg_enum_list end_usage_enum[] = {
273 {"vbr", VPX_VBR},271 {"vbr", VPX_VBR},
274 {"cbr", VPX_CBR},272 {"cbr", VPX_CBR},
@@ -276,24 +274,24 @@ static const struct arg_enum_list end_usage_enum[] = { · 1 unmodified line
276 {"q", VPX_Q},274 {"q", VPX_Q},
277 {NULL, 0}275 {NULL, 0}
278};276};
279static const arg_def_t end_usage = ARG_DEF_ENUM(NULL, "end-usage", 1,277static const arg_def_t end_usage = ARG_DEF_ENUM(
280 "Rate control mode", end_usage_enum);278 NULL, "end-usage", 1, "Rate control mode", end_usage_enum);
281static const arg_def_t target_bitrate = ARG_DEF(NULL, "target-bitrate", 1,279static const arg_def_t target_bitrate = ARG_DEF(
282 "Bitrate (kbps)");280 NULL, "target-bitrate", 1, "Bitrate (kbps)");
283static const arg_def_t min_quantizer = ARG_DEF(NULL, "min-q", 1,281static const arg_def_t min_quantizer = ARG_DEF(
284 "Minimum (best) quantizer");282 NULL, "min-q", 1, "Minimum (best) quantizer");
285static const arg_def_t max_quantizer = ARG_DEF(NULL, "max-q", 1,283static const arg_def_t max_quantizer = ARG_DEF(
286 "Maximum (worst) quantizer");284 NULL, "max-q", 1, "Maximum (worst) quantizer");
287static const arg_def_t undershoot_pct = ARG_DEF(NULL, "undershoot-pct", 1,285static const arg_def_t undershoot_pct = ARG_DEF(
288 "Datarate undershoot (min) target (%)");286 NULL, "undershoot-pct", 1, "Datarate undershoot (min) target (%)");
289static const arg_def_t overshoot_pct = ARG_DEF(NULL, "overshoot-pct", 1,287static const arg_def_t overshoot_pct = ARG_DEF(
290 "Datarate overshoot (max) target (%)");288 NULL, "overshoot-pct", 1, "Datarate overshoot (max) target (%)");
291static const arg_def_t buf_sz = ARG_DEF(NULL, "buf-sz", 1,289static const arg_def_t buf_sz = ARG_DEF(
292 "Client buffer size (ms)");290 NULL, "buf-sz", 1, "Client buffer size (ms)");
293static const arg_def_t buf_initial_sz = ARG_DEF(NULL, "buf-initial-sz", 1,291static const arg_def_t buf_initial_sz = ARG_DEF(
294 "Client initial buffer size (ms)");292 NULL, "buf-initial-sz", 1, "Client initial buffer size (ms)");
295static const arg_def_t buf_optimal_sz = ARG_DEF(NULL, "buf-optimal-sz", 1,293static const arg_def_t buf_optimal_sz = ARG_DEF(
296 "Client optimal buffer size (ms)");294 NULL, "buf-optimal-sz", 1, "Client optimal buffer size (ms)");
297static const arg_def_t *rc_args[] = {295static const arg_def_t *rc_args[] = {
298 &dropframe_thresh, &resize_allowed, &resize_width, &resize_height,296 &dropframe_thresh, &resize_allowed, &resize_width, &resize_height,
299 &resize_up_thresh, &resize_down_thresh, &end_usage, &target_bitrate,297 &resize_up_thresh, &resize_down_thresh, &end_usage, &target_bitrate,
@@ -302,59 +300,59 @@ static const arg_def_t *rc_args[] = { · 2 unmodified lines
302};300};
303 301
304 302
305static const arg_def_t bias_pct = ARG_DEF(NULL, "bias-pct", 1,303static const arg_def_t bias_pct = ARG_DEF(
306 "CBR/VBR bias (0=CBR, 100=VBR)");304 NULL, "bias-pct", 1, "CBR/VBR bias (0=CBR, 100=VBR)");
307static const arg_def_t minsection_pct = ARG_DEF(NULL, "minsection-pct", 1,305static const arg_def_t minsection_pct = ARG_DEF(
308 "GOP min bitrate (% of target)");306 NULL, "minsection-pct", 1, "GOP min bitrate (% of target)");
309static const arg_def_t maxsection_pct = ARG_DEF(NULL, "maxsection-pct", 1,307static const arg_def_t maxsection_pct = ARG_DEF(
310 "GOP max bitrate (% of target)");308 NULL, "maxsection-pct", 1, "GOP max bitrate (% of target)");
311static const arg_def_t *rc_twopass_args[] = {309static const arg_def_t *rc_twopass_args[] = {
312 &bias_pct, &minsection_pct, &maxsection_pct, NULL310 &bias_pct, &minsection_pct, &maxsection_pct, NULL
313};311};
314 312
315 313
316static const arg_def_t kf_min_dist = ARG_DEF(NULL, "kf-min-dist", 1,314static const arg_def_t kf_min_dist = ARG_DEF(
317 "Minimum keyframe interval (frames)");315 NULL, "kf-min-dist", 1, "Minimum keyframe interval (frames)");
318static const arg_def_t kf_max_dist = ARG_DEF(NULL, "kf-max-dist", 1,316static const arg_def_t kf_max_dist = ARG_DEF(
319 "Maximum keyframe interval (frames)");317 NULL, "kf-max-dist", 1, "Maximum keyframe interval (frames)");
320static const arg_def_t kf_disabled = ARG_DEF(NULL, "disable-kf", 0,318static const arg_def_t kf_disabled = ARG_DEF(
321 "Disable keyframe placement");319 NULL, "disable-kf", 0, "Disable keyframe placement");
322static const arg_def_t *kf_args[] = {320static const arg_def_t *kf_args[] = {
323 &kf_min_dist, &kf_max_dist, &kf_disabled, NULL321 &kf_min_dist, &kf_max_dist, &kf_disabled, NULL
324};322};
325 323
326 324
327static const arg_def_t noise_sens = ARG_DEF(NULL, "noise-sensitivity", 1,325static const arg_def_t noise_sens = ARG_DEF(
328 "Noise sensitivity (frames to blur)");326 NULL, "noise-sensitivity", 1, "Noise sensitivity (frames to blur)");
329static const arg_def_t sharpness = ARG_DEF(NULL, "sharpness", 1,327static const arg_def_t sharpness = ARG_DEF(
330 "Loop filter sharpness (0..7)");328 NULL, "sharpness", 1, "Loop filter sharpness (0..7)");
331static const arg_def_t static_thresh = ARG_DEF(NULL, "static-thresh", 1,329static const arg_def_t static_thresh = ARG_DEF(
332 "Motion detection threshold");330 NULL, "static-thresh", 1, "Motion detection threshold");
333static const arg_def_t cpu_used = ARG_DEF(NULL, "cpu-used", 1,331static const arg_def_t cpu_used = ARG_DEF(
334 "CPU Used (-16..16)");332 NULL, "cpu-used", 1, "CPU Used (-16..16)");
335static const arg_def_t auto_altref = ARG_DEF(NULL, "auto-alt-ref", 1,333static const arg_def_t auto_altref = ARG_DEF(
336 "Enable automatic alt reference frames");334 NULL, "auto-alt-ref", 1, "Enable automatic alt reference frames");
337static const arg_def_t arnr_maxframes = ARG_DEF(NULL, "arnr-maxframes", 1,335static const arg_def_t arnr_maxframes = ARG_DEF(
338 "AltRef max frames (0..15)");336 NULL, "arnr-maxframes", 1, "AltRef max frames (0..15)");
339static const arg_def_t arnr_strength = ARG_DEF(NULL, "arnr-strength", 1,337static const arg_def_t arnr_strength = ARG_DEF(
340 "AltRef filter strength (0..6)");338 NULL, "arnr-strength", 1, "AltRef filter strength (0..6)");
341static const arg_def_t arnr_type = ARG_DEF(NULL, "arnr-type", 1,339static const arg_def_t arnr_type = ARG_DEF(
342 "AltRef type");340 NULL, "arnr-type", 1, "AltRef type");
343static const struct arg_enum_list tuning_enum[] = {341static const struct arg_enum_list tuning_enum[] = {
344 {"psnr", VP8_TUNE_PSNR},342 {"psnr", VP8_TUNE_PSNR},
345 {"ssim", VP8_TUNE_SSIM},343 {"ssim", VP8_TUNE_SSIM},
346 {NULL, 0}344 {NULL, 0}
347};345};
348static const arg_def_t tune_ssim = ARG_DEF_ENUM(NULL, "tune", 1,346static const arg_def_t tune_ssim = ARG_DEF_ENUM(
349 "Material to favor", tuning_enum);347 NULL, "tune", 1, "Material to favor", tuning_enum);
350static const arg_def_t cq_level = ARG_DEF(NULL, "cq-level", 1,348static const arg_def_t cq_level = ARG_DEF(
351 "Constant/Constrained Quality level");349 NULL, "cq-level", 1, "Constant/Constrained Quality level");
352static const arg_def_t max_intra_rate_pct = ARG_DEF(NULL, "max-intra-rate", 1,350static const arg_def_t max_intra_rate_pct = ARG_DEF(
353 "Max I-frame bitrate (pct)");351 NULL, "max-intra-rate", 1, "Max I-frame bitrate (pct)");
354 352
355#if CONFIG_VP8_ENCODER353#if CONFIG_VP8_ENCODER
356static const arg_def_t token_parts =354static const arg_def_t token_parts = ARG_DEF(
357 ARG_DEF(NULL, "token-parts", 1, "Number of token partitions to use, log2");355 NULL, "token-parts", 1, "Number of token partitions to use, log2");
358static const arg_def_t *vp8_args[] = {356static const arg_def_t *vp8_args[] = {
359 &cpu_used, &auto_altref, &noise_sens, &sharpness, &static_thresh,357 &cpu_used, &auto_altref, &noise_sens, &sharpness, &static_thresh,
360 &token_parts, &arnr_maxframes, &arnr_strength, &arnr_type,358 &token_parts, &arnr_maxframes, &arnr_strength, &arnr_type,
@@ -372,11 +370,12 @@ static const int vp8_arg_ctrl_map[] = { · 11 unmodified lines
372#endif370#endif
373 371
374#if CONFIG_VP9_ENCODER372#if CONFIG_VP9_ENCODER
375static const arg_def_t tile_cols =373static const arg_def_t tile_cols = ARG_DEF(
376 ARG_DEF(NULL, "tile-columns", 1, "Number of tile columns to use, log2");374 NULL, "tile-columns", 1, "Number of tile columns to use, log2");
377static const arg_def_t tile_rows =375static const arg_def_t tile_rows = ARG_DEF(
378 ARG_DEF(NULL, "tile-rows", 1, "Number of tile rows to use, log2");376 NULL, "tile-rows", 1, "Number of tile rows to use, log2");
379static const arg_def_t lossless = ARG_DEF(NULL, "lossless", 1, "Lossless mode");377static const arg_def_t lossless = ARG_DEF(
378 NULL, "lossless", 1, "Lossless mode");
380static const arg_def_t frame_parallel_decoding = ARG_DEF(379static const arg_def_t frame_parallel_decoding = ARG_DEF(
381 NULL, "frame-parallel", 1, "Enable frame parallel decodability features");380 NULL, "frame-parallel", 1, "Enable frame parallel decodability features");
382static const arg_def_t aq_mode = ARG_DEF(381static const arg_def_t aq_mode = ARG_DEF(
@@ -395,13 +394,12 @@ static const struct arg_enum_list bitdepth_enum[] = { · 12 unmodified lines
395 {NULL, 0}394 {NULL, 0}
396};395};
397 396
398static const arg_def_t bitdeptharg = ARG_DEF_ENUM("b", "bit-depth", 1,397static const arg_def_t bitdeptharg = ARG_DEF_ENUM(
399 "Bit depth for codec "398 "b", "bit-depth", 1,
400 "(8 for version <=1, "399 "Bit depth for codec (8 for version <=1, 10 or 12 for version 2)",
401 "10 or 12 for version 2)",400 bitdepth_enum);
402 bitdepth_enum);401static const arg_def_t inbitdeptharg = ARG_DEF(
403static const arg_def_t inbitdeptharg = ARG_DEF(NULL, "input-bit-depth", 1,402 NULL, "input-bit-depth", 1, "Bit depth of input");
404 "Bit depth of input");
405#endif403#endif
406 404
407static const struct arg_enum_list tune_content_enum[] = {405static const struct arg_enum_list tune_content_enum[] = {
@@ -1161,7 +1159,6 @@ static int parse_stream_params(struct VpxEncoderConfig *global, · 753 unmodified lines
1161 if (j == config->arg_ctrl_cnt)1159 if (j == config->arg_ctrl_cnt)
1162 config->arg_ctrl_cnt++;1160 config->arg_ctrl_cnt++;
1163 }1161 }
1164
1165 }1162 }
1166 }1163 }
1167 if (!match)1164 if (!match)
@@ -1917,14 +1914,15 @@ int main(int argc, const char **argv_) { · 749 unmodified lines
1917 /* If the input file doesn't specify its w/h (raw files), try to get1914 /* If the input file doesn't specify its w/h (raw files), try to get
1918 * the data from the first stream's configuration.1915 * the data from the first stream's configuration.
1919 */1916 */
1920 if (!input.width || !input.height)1917 if (!input.width || !input.height) {
1921 FOREACH_STREAM( {1918 FOREACH_STREAM({
1922 if (stream->config.cfg.g_w && stream->config.cfg.g_h) {1919 if (stream->config.cfg.g_w && stream->config.cfg.g_h) {
1923 input.width = stream->config.cfg.g_w;1920 input.width = stream->config.cfg.g_w;
1924 input.height = stream->config.cfg.g_h;1921 input.height = stream->config.cfg.g_h;
1925 break;1922 break;
1926 }1923 }
1927 });1924 });
1925 }
1928 1926
1929 /* Update stream configurations from the input file's parameters */1927 /* Update stream configurations from the input file's parameters */
1930 if (!input.width || !input.height)1928 if (!input.width || !input.height)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t