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
178178 }
179179
180180 // Flush encoder.
181− while (encode_frame(&codec, NULL, -1, writer)) {};
181+ while (encode_frame(&codec, NULL, -1, writer)) {}
182182
183183 printf("\n");
184184 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
183183 enc_cfg->kf_min_dist = arg_parse_uint(&arg);
184184 enc_cfg->kf_max_dist = enc_cfg->kf_min_dist;
185185 } 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",
187187 string_options, arg.val);
188188 } else if (arg_match(&arg, &passes_arg, argi)) {
189189 passes = arg_parse_uint(&arg);
@@ -198,10 +198,10 @@ static void parse_command_line(int argc, const char **argv_, · 8 unmodified lines
198198 } else if (arg_match(&arg, &fpf_name_arg, argi)) {
199199 fpf_file_name = arg.val;
200200 } 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",
202202 string_options, arg.val);
203203 } 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",
205205 string_options, arg.val);
206206 } else if (arg_match(&arg, &min_bitrate_arg, argi)) {
207207 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
516516 // Adjust rd for ZEROMV and LAST, if LAST is the closest reference frame.
517517 if (this_mode == ZEROMV &&
518518 x->e_mbd.mode_info_context->mbmi.ref_frame == LAST_FRAME &&
519− (denoise_aggressive || cpi->closest_reference_frame == LAST_FRAME))
520− {
521− this_rd = ((int64_t)this_rd) * rd_adj / 100;
519+ (denoise_aggressive || cpi->closest_reference_frame == LAST_FRAME)) {
520+ this_rd = ((int64_t)this_rd) * rd_adj / 100;
522521 }
523522
524523 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
112112 * structure. More memory may be required at the time the stream
113113 * information becomes known.
114114 */
115− if (!ctx->priv)
116− {
117− vp8_init_ctx(ctx);
118− priv = (vpx_codec_alg_priv_t *)ctx->priv;
119−
120− /* initialize number of fragments to zero */
121− priv->fragments.count = 0;
122− /* is input fragments enabled? */
123− priv->fragments.enabled =
124− (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS);
125−
126− /*post processing level initialized to do nothing */
127− }
128− else
129− {
130− priv = (vpx_codec_alg_priv_t *)ctx->priv;
115+ if (!ctx->priv) {
116+ vp8_init_ctx(ctx);
117+ priv = (vpx_codec_alg_priv_t *)ctx->priv;
118+
119+ /* initialize number of fragments to zero */
120+ priv->fragments.count = 0;
121+ /* is input fragments enabled? */
122+ priv->fragments.enabled =
123+ (priv->base.init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS);
124+
125+ /*post processing level initialized to do nothing */
126+ } else {
127+ priv = (vpx_codec_alg_priv_t *)ctx->priv;
131128 }
132129
133130 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
138135
139136 if (priv->yv12_frame_buffers.use_frame_threads &&
140137 ((ctx->priv->init_flags & VPX_CODEC_USE_ERROR_CONCEALMENT) ||
141− (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS)))
142− {
143− /* row-based threading, error concealment, and input fragments will
144− * not be supported when using frame-based threading */
145− res = VPX_CODEC_INVALID_PARAM;
138+ (ctx->priv->init_flags & VPX_CODEC_USE_INPUT_FRAGMENTS))) {
139+ /* row-based threading, error concealment, and input fragments will
140+ * not be supported when using frame-based threading */
141+ res = VPX_CODEC_INVALID_PARAM;
146142 }
147143
148144 return res;
vpxdec.c+41−44
@@ -47,52 +47,49 @@ struct VpxDecInputContext { · 46 unmodified lines
4747 struct WebmInputContext *webm_ctx;
4848 };
4949
50−static const arg_def_t looparg = ARG_DEF(NULL, "loops", 1,
51− "Number of times to decode the file");
52−static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1,
53− "Codec to use");
54−static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0,
55− "Output raw YV12 frames");
56−static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0,
57− "Output raw I420 frames");
58−static const arg_def_t flipuvarg = ARG_DEF(NULL, "flipuv", 0,
59− "Flip the chroma planes in the output");
60−static const arg_def_t rawvideo = ARG_DEF(NULL, "rawvideo", 0,
61− "Output raw YUV frames");
62−static const arg_def_t noblitarg = ARG_DEF(NULL, "noblit", 0,
63− "Don't process the decoded frames");
64−static const arg_def_t progressarg = ARG_DEF(NULL, "progress", 0,
65− "Show progress after each frame decodes");
66−static const arg_def_t limitarg = ARG_DEF(NULL, "limit", 1,
67− "Stop decoding after n frames");
68−static const arg_def_t skiparg = ARG_DEF(NULL, "skip", 1,
69− "Skip the first n input frames");
70−static const arg_def_t postprocarg = ARG_DEF(NULL, "postproc", 0,
71− "Postprocess decoded frames");
72−static const arg_def_t summaryarg = ARG_DEF(NULL, "summary", 0,
73− "Show timing summary");
74−static const arg_def_t outputfile = ARG_DEF("o", "output", 1,
75− "Output file name pattern (see below)");
76−static const arg_def_t threadsarg = ARG_DEF("t", "threads", 1,
77− "Max threads to use");
78−static const arg_def_t verbosearg = ARG_DEF("v", "verbose", 0,
79− "Show version string");
80−static const arg_def_t error_concealment = ARG_DEF(NULL, "error-concealment", 0,
81− "Enable decoder error-concealment");
82−static const arg_def_t scalearg = ARG_DEF("S", "scale", 0,
83− "Scale output frames uniformly");
84−static const arg_def_t continuearg =
85− ARG_DEF("k", "keep-going", 0, "(debug) Continue decoding after error");
86−
87−static const arg_def_t fb_arg =
88− ARG_DEF(NULL, "frame-buffers", 1, "Number of frame buffers to use");
89−
90−static const arg_def_t md5arg = ARG_DEF(NULL, "md5", 0,
91− "Compute the MD5 sum of the decoded frame");
50+static const arg_def_t looparg = ARG_DEF(
51+ NULL, "loops", 1, "Number of times to decode the file");
52+static const arg_def_t codecarg = ARG_DEF(
53+ NULL, "codec", 1, "Codec to use");
54+static const arg_def_t use_yv12 = ARG_DEF(
55+ NULL, "yv12", 0, "Output raw YV12 frames");
56+static const arg_def_t use_i420 = ARG_DEF(
57+ NULL, "i420", 0, "Output raw I420 frames");
58+static const arg_def_t flipuvarg = ARG_DEF(
59+ NULL, "flipuv", 0, "Flip the chroma planes in the output");
60+static const arg_def_t rawvideo = ARG_DEF(
61+ NULL, "rawvideo", 0, "Output raw YUV frames");
62+static const arg_def_t noblitarg = ARG_DEF(
63+ NULL, "noblit", 0, "Don't process the decoded frames");
64+static const arg_def_t progressarg = ARG_DEF(
65+ NULL, "progress", 0, "Show progress after each frame decodes");
66+static const arg_def_t limitarg = ARG_DEF(
67+ NULL, "limit", 1, "Stop decoding after n frames");
68+static const arg_def_t skiparg = ARG_DEF(
69+ NULL, "skip", 1, "Skip the first n input frames");
70+static const arg_def_t postprocarg = ARG_DEF(
71+ NULL, "postproc", 0, "Postprocess decoded frames");
72+static const arg_def_t summaryarg = ARG_DEF(
73+ NULL, "summary", 0, "Show timing summary");
74+static const arg_def_t outputfile = ARG_DEF(
75+ "o", "output", 1, "Output file name pattern (see below)");
76+static const arg_def_t threadsarg = ARG_DEF(
77+ "t", "threads", 1, "Max threads to use");
78+static const arg_def_t verbosearg = ARG_DEF(
79+ "v", "verbose", 0, "Show version string");
80+static const arg_def_t error_concealment = ARG_DEF(
81+ NULL, "error-concealment", 0, "Enable decoder error-concealment");
82+static const arg_def_t scalearg = ARG_DEF(
83+ "S", "scale", 0, "Scale output frames uniformly");
84+static const arg_def_t continuearg = ARG_DEF(
85+ "k", "keep-going", 0, "(debug) Continue decoding after error");
86+static const arg_def_t fb_arg = ARG_DEF(
87+ NULL, "frame-buffers", 1, "Number of frame buffers to use");
88+static const arg_def_t md5arg = ARG_DEF(
89+ NULL, "md5", 0, "Compute the MD5 sum of the decoded frame");
9290 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH
9391 static const arg_def_t outbitdeptharg = ARG_DEF(
94− NULL, "output-bit-depth", 1,
95− "Output bit-depth for decoded frames");
92+ NULL, "output-bit-depth", 1, "Output bit-depth for decoded frames");
9693 #endif
9794
9895 static 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
128128 return 0;
129129 }
130130
131−static const arg_def_t debugmode = ARG_DEF("D", "debug", 0,
132− "Debug mode (makes output deterministic)");
133−static const arg_def_t outputfile = ARG_DEF("o", "output", 1,
134− "Output filename");
135−static const arg_def_t use_yv12 = ARG_DEF(NULL, "yv12", 0,
136− "Input file is YV12 ");
137−static const arg_def_t use_i420 = ARG_DEF(NULL, "i420", 0,
138− "Input file is I420 (default)");
139−static const arg_def_t use_i422 = ARG_DEF(NULL, "i422", 0,
140− "Input file is I422");
141−static const arg_def_t use_i444 = ARG_DEF(NULL, "i444", 0,
142− "Input file is I444");
143−static const arg_def_t use_i440 = ARG_DEF(NULL, "i440", 0,
144− "Input file is I440");
145−static const arg_def_t codecarg = ARG_DEF(NULL, "codec", 1,
146− "Codec to use");
147−static const arg_def_t passes = ARG_DEF("p", "passes", 1,
148− "Number of passes (1/2)");
149−static const arg_def_t pass_arg = ARG_DEF(NULL, "pass", 1,
150− "Pass to execute (1/2)");
151−static const arg_def_t fpf_name = ARG_DEF(NULL, "fpf", 1,
152− "First pass statistics file name");
131+static const arg_def_t debugmode = ARG_DEF(
132+ "D", "debug", 0, "Debug mode (makes output deterministic)");
133+static const arg_def_t outputfile = ARG_DEF(
134+ "o", "output", 1, "Output filename");
135+static const arg_def_t use_yv12 = ARG_DEF(
136+ NULL, "yv12", 0, "Input file is YV12 ");
137+static const arg_def_t use_i420 = ARG_DEF(
138+ NULL, "i420", 0, "Input file is I420 (default)");
139+static const arg_def_t use_i422 = ARG_DEF(
140+ NULL, "i422", 0, "Input file is I422");
141+static const arg_def_t use_i444 = ARG_DEF(
142+ NULL, "i444", 0, "Input file is I444");
143+static const arg_def_t use_i440 = ARG_DEF(
144+ NULL, "i440", 0, "Input file is I440");
145+static const arg_def_t codecarg = ARG_DEF(
146+ NULL, "codec", 1, "Codec to use");
147+static const arg_def_t passes = ARG_DEF(
148+ "p", "passes", 1, "Number of passes (1/2)");
149+static const arg_def_t pass_arg = ARG_DEF(
150+ NULL, "pass", 1, "Pass to execute (1/2)");
151+static const arg_def_t fpf_name = ARG_DEF(
152+ NULL, "fpf", 1, "First pass statistics file name");
153153 #if CONFIG_FP_MB_STATS
154−static const arg_def_t fpmbf_name = ARG_DEF(NULL, "fpmbf", 1,
155− "First pass block statistics file name");
154+static const arg_def_t fpmbf_name = ARG_DEF(
155+ NULL, "fpmbf", 1, "First pass block statistics file name");
156156 #endif
157−static const arg_def_t limit = ARG_DEF(NULL, "limit", 1,
158− "Stop encoding after n input frames");
159−static const arg_def_t skip = ARG_DEF(NULL, "skip", 1,
160− "Skip the first n input frames");
161−static const arg_def_t deadline = ARG_DEF("d", "deadline", 1,
162− "Deadline per frame (usec)");
163−static const arg_def_t best_dl = ARG_DEF(NULL, "best", 0,
164− "Use Best Quality Deadline");
165−static const arg_def_t good_dl = ARG_DEF(NULL, "good", 0,
166− "Use Good Quality Deadline");
167−static const arg_def_t rt_dl = ARG_DEF(NULL, "rt", 0,
168− "Use Realtime Quality Deadline");
169−static const arg_def_t quietarg = ARG_DEF("q", "quiet", 0,
170− "Do not print encode progress");
171−static const arg_def_t verbosearg = ARG_DEF("v", "verbose", 0,
172− "Show encoder parameters");
173−static const arg_def_t psnrarg = ARG_DEF(NULL, "psnr", 0,
174− "Show PSNR in status line");
157+static const arg_def_t limit = ARG_DEF(
158+ NULL, "limit", 1, "Stop encoding after n input frames");
159+static const arg_def_t skip = ARG_DEF(
160+ NULL, "skip", 1, "Skip the first n input frames");
161+static const arg_def_t deadline = ARG_DEF(
162+ "d", "deadline", 1, "Deadline per frame (usec)");
163+static const arg_def_t best_dl = ARG_DEF(
164+ NULL, "best", 0, "Use Best Quality Deadline");
165+static const arg_def_t good_dl = ARG_DEF(
166+ NULL, "good", 0, "Use Good Quality Deadline");
167+static const arg_def_t rt_dl = ARG_DEF(
168+ NULL, "rt", 0, "Use Realtime Quality Deadline");
169+static const arg_def_t quietarg = ARG_DEF(
170+ "q", "quiet", 0, "Do not print encode progress");
171+static const arg_def_t verbosearg = ARG_DEF(
172+ "v", "verbose", 0, "Show encoder parameters");
173+static const arg_def_t psnrarg = ARG_DEF(
174+ NULL, "psnr", 0, "Show PSNR in status line");
175175
176176 static const struct arg_enum_list test_decode_enum[] = {
177177 {"off", TEST_DECODE_OFF},
@@ -179,25 +179,25 @@ static const struct arg_enum_list test_decode_enum[] = { · 1 unmodified line
179179 {"warn", TEST_DECODE_WARN},
180180 {NULL, 0}
181181 };
182−static const arg_def_t recontest = ARG_DEF_ENUM(NULL, "test-decode", 1,
183− "Test encode/decode mismatch",
184− test_decode_enum);
185−static const arg_def_t framerate = ARG_DEF(NULL, "fps", 1,
186− "Stream frame rate (rate/scale)");
187−static const arg_def_t use_ivf = ARG_DEF(NULL, "ivf", 0,
188− "Output IVF (default is WebM if WebM IO is enabled)");
189−static const arg_def_t out_part = ARG_DEF("P", "output-partitions", 0,
190− "Makes encoder output partitions. Requires IVF output!");
191−static const arg_def_t q_hist_n = ARG_DEF(NULL, "q-hist", 1,
192− "Show quantizer histogram (n-buckets)");
193−static const arg_def_t rate_hist_n = ARG_DEF(NULL, "rate-hist", 1,
194− "Show rate histogram (n-buckets)");
195−static const arg_def_t disable_warnings =
196− ARG_DEF(NULL, "disable-warnings", 0,
197− "Disable warnings about potentially incorrect encode settings.");
198−static const arg_def_t disable_warning_prompt =
199− ARG_DEF("y", "disable-warning-prompt", 0,
200− "Display warnings, but do not prompt user to continue.");
182+static const arg_def_t recontest = ARG_DEF_ENUM(
183+ NULL, "test-decode", 1, "Test encode/decode mismatch", test_decode_enum);
184+static const arg_def_t framerate = ARG_DEF(
185+ NULL, "fps", 1, "Stream frame rate (rate/scale)");
186+static const arg_def_t use_ivf = ARG_DEF(
187+ NULL, "ivf", 0, "Output IVF (default is WebM if WebM IO is enabled)");
188+static const arg_def_t out_part = ARG_DEF(
189+ "P", "output-partitions", 0,
190+ "Makes encoder output partitions. Requires IVF output!");
191+static const arg_def_t q_hist_n = ARG_DEF(
192+ NULL, "q-hist", 1, "Show quantizer histogram (n-buckets)");
193+static const arg_def_t rate_hist_n = ARG_DEF(
194+ NULL, "rate-hist", 1, "Show rate histogram (n-buckets)");
195+static const arg_def_t disable_warnings = ARG_DEF(
196+ NULL, "disable-warnings", 0,
197+ "Disable warnings about potentially incorrect encode settings.");
198+static const arg_def_t disable_warning_prompt = ARG_DEF(
199+ "y", "disable-warning-prompt", 0,
200+ "Display warnings, but do not prompt user to continue.");
201201
202202 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH
203203 static const arg_def_t test16bitinternalarg = ARG_DEF(
@@ -213,16 +213,14 @@ static const arg_def_t *main_args[] = { · 9 unmodified lines
213213 NULL
214214 };
215215
216−static const arg_def_t usage = ARG_DEF("u", "usage", 1,
217− "Usage profile number to use");
218−static const arg_def_t threads = ARG_DEF("t", "threads", 1,
219− "Max number of threads to use");
220−static const arg_def_t profile = ARG_DEF(NULL, "profile", 1,
221− "Bitstream profile number to use");
222−static const arg_def_t width = ARG_DEF("w", "width", 1,
223− "Frame width");
224−static const arg_def_t height = ARG_DEF("h", "height", 1,
225− "Frame height");
216+static const arg_def_t usage = ARG_DEF(
217+ "u", "usage", 1, "Usage profile number to use");
218+static const arg_def_t threads = ARG_DEF(
219+ "t", "threads", 1, "Max number of threads to use");
220+static const arg_def_t profile = ARG_DEF(
221+ NULL, "profile", 1, "Bitstream profile number to use");
222+static const arg_def_t width = ARG_DEF("w", "width", 1, "Frame width");
223+static const arg_def_t height = ARG_DEF("h", "height", 1, "Frame height");
226224 #if CONFIG_WEBM_IO
227225 static const struct arg_enum_list stereo_mode_enum[] = {
228226 {"mono", STEREO_FORMAT_MONO},
@@ -232,15 +230,15 @@ static const struct arg_enum_list stereo_mode_enum[] = { · 3 unmodified lines
232230 {"right-left", STEREO_FORMAT_RIGHT_LEFT},
233231 {NULL, 0}
234232 };
235−static const arg_def_t stereo_mode = ARG_DEF_ENUM(NULL, "stereo-mode", 1,
236− "Stereo 3D video format", stereo_mode_enum);
233+static const arg_def_t stereo_mode = ARG_DEF_ENUM(
234+ NULL, "stereo-mode", 1, "Stereo 3D video format", stereo_mode_enum);
237235 #endif
238−static const arg_def_t timebase = ARG_DEF(NULL, "timebase", 1,
239− "Output timestamp precision (fractional seconds)");
240−static const arg_def_t error_resilient = ARG_DEF(NULL, "error-resilient", 1,
241− "Enable error resiliency features");
242−static const arg_def_t lag_in_frames = ARG_DEF(NULL, "lag-in-frames", 1,
243− "Max number of frames to lag");
236+static const arg_def_t timebase = ARG_DEF(
237+ NULL, "timebase", 1, "Output timestamp precision (fractional seconds)");
238+static const arg_def_t error_resilient = ARG_DEF(
239+ NULL, "error-resilient", 1, "Enable error resiliency features");
240+static const arg_def_t lag_in_frames = ARG_DEF(
241+ NULL, "lag-in-frames", 1, "Max number of frames to lag");
244242
245243 static const arg_def_t *global_args[] = {
246244 &use_yv12, &use_i420, &use_i422, &use_i444, &use_i440,
@@ -257,18 +255,18 @@ static const arg_def_t *global_args[] = { · 10 unmodified lines
257255 &lag_in_frames, NULL
258256 };
259257
260−static const arg_def_t dropframe_thresh = ARG_DEF(NULL, "drop-frame", 1,
261− "Temporal resampling threshold (buf %)");
262−static const arg_def_t resize_allowed = ARG_DEF(NULL, "resize-allowed", 1,
263− "Spatial resampling enabled (bool)");
264−static const arg_def_t resize_width = ARG_DEF(NULL, "resize-width", 1,
265− "Width of encoded frame");
266−static const arg_def_t resize_height = ARG_DEF(NULL, "resize-height", 1,
267− "Height of encoded frame");
268−static const arg_def_t resize_up_thresh = ARG_DEF(NULL, "resize-up", 1,
269− "Upscale threshold (buf %)");
270−static const arg_def_t resize_down_thresh = ARG_DEF(NULL, "resize-down", 1,
271− "Downscale threshold (buf %)");
258+static const arg_def_t dropframe_thresh = ARG_DEF(
259+ NULL, "drop-frame", 1, "Temporal resampling threshold (buf %)");
260+static const arg_def_t resize_allowed = ARG_DEF(
261+ NULL, "resize-allowed", 1, "Spatial resampling enabled (bool)");
262+static const arg_def_t resize_width = ARG_DEF(
263+ NULL, "resize-width", 1, "Width of encoded frame");
264+static const arg_def_t resize_height = ARG_DEF(
265+ NULL, "resize-height", 1, "Height of encoded frame");
266+static const arg_def_t resize_up_thresh = ARG_DEF(
267+ NULL, "resize-up", 1, "Upscale threshold (buf %)");
268+static const arg_def_t resize_down_thresh = ARG_DEF(
269+ NULL, "resize-down", 1, "Downscale threshold (buf %)");
272270 static const struct arg_enum_list end_usage_enum[] = {
273271 {"vbr", VPX_VBR},
274272 {"cbr", VPX_CBR},
@@ -276,24 +274,24 @@ static const struct arg_enum_list end_usage_enum[] = { · 1 unmodified line
276274 {"q", VPX_Q},
277275 {NULL, 0}
278276 };
279−static const arg_def_t end_usage = ARG_DEF_ENUM(NULL, "end-usage", 1,
280− "Rate control mode", end_usage_enum);
281−static const arg_def_t target_bitrate = ARG_DEF(NULL, "target-bitrate", 1,
282− "Bitrate (kbps)");
283−static const arg_def_t min_quantizer = ARG_DEF(NULL, "min-q", 1,
284− "Minimum (best) quantizer");
285−static const arg_def_t max_quantizer = ARG_DEF(NULL, "max-q", 1,
286− "Maximum (worst) quantizer");
287−static const arg_def_t undershoot_pct = ARG_DEF(NULL, "undershoot-pct", 1,
288− "Datarate undershoot (min) target (%)");
289−static const arg_def_t overshoot_pct = ARG_DEF(NULL, "overshoot-pct", 1,
290− "Datarate overshoot (max) target (%)");
291−static const arg_def_t buf_sz = ARG_DEF(NULL, "buf-sz", 1,
292− "Client buffer size (ms)");
293−static const arg_def_t buf_initial_sz = ARG_DEF(NULL, "buf-initial-sz", 1,
294− "Client initial buffer size (ms)");
295−static const arg_def_t buf_optimal_sz = ARG_DEF(NULL, "buf-optimal-sz", 1,
296− "Client optimal buffer size (ms)");
277+static const arg_def_t end_usage = ARG_DEF_ENUM(
278+ NULL, "end-usage", 1, "Rate control mode", end_usage_enum);
279+static const arg_def_t target_bitrate = ARG_DEF(
280+ NULL, "target-bitrate", 1, "Bitrate (kbps)");
281+static const arg_def_t min_quantizer = ARG_DEF(
282+ NULL, "min-q", 1, "Minimum (best) quantizer");
283+static const arg_def_t max_quantizer = ARG_DEF(
284+ NULL, "max-q", 1, "Maximum (worst) quantizer");
285+static const arg_def_t undershoot_pct = ARG_DEF(
286+ NULL, "undershoot-pct", 1, "Datarate undershoot (min) target (%)");
287+static const arg_def_t overshoot_pct = ARG_DEF(
288+ NULL, "overshoot-pct", 1, "Datarate overshoot (max) target (%)");
289+static const arg_def_t buf_sz = ARG_DEF(
290+ NULL, "buf-sz", 1, "Client buffer size (ms)");
291+static const arg_def_t buf_initial_sz = ARG_DEF(
292+ NULL, "buf-initial-sz", 1, "Client initial buffer size (ms)");
293+static const arg_def_t buf_optimal_sz = ARG_DEF(
294+ NULL, "buf-optimal-sz", 1, "Client optimal buffer size (ms)");
297295 static const arg_def_t *rc_args[] = {
298296 &dropframe_thresh, &resize_allowed, &resize_width, &resize_height,
299297 &resize_up_thresh, &resize_down_thresh, &end_usage, &target_bitrate,
@@ -302,59 +300,59 @@ static const arg_def_t *rc_args[] = { · 2 unmodified lines
302300 };
303301
304302
305−static const arg_def_t bias_pct = ARG_DEF(NULL, "bias-pct", 1,
306− "CBR/VBR bias (0=CBR, 100=VBR)");
307−static const arg_def_t minsection_pct = ARG_DEF(NULL, "minsection-pct", 1,
308− "GOP min bitrate (% of target)");
309−static const arg_def_t maxsection_pct = ARG_DEF(NULL, "maxsection-pct", 1,
310− "GOP max bitrate (% of target)");
303+static const arg_def_t bias_pct = ARG_DEF(
304+ NULL, "bias-pct", 1, "CBR/VBR bias (0=CBR, 100=VBR)");
305+static const arg_def_t minsection_pct = ARG_DEF(
306+ NULL, "minsection-pct", 1, "GOP min bitrate (% of target)");
307+static const arg_def_t maxsection_pct = ARG_DEF(
308+ NULL, "maxsection-pct", 1, "GOP max bitrate (% of target)");
311309 static const arg_def_t *rc_twopass_args[] = {
312310 &bias_pct, &minsection_pct, &maxsection_pct, NULL
313311 };
314312
315313
316−static const arg_def_t kf_min_dist = ARG_DEF(NULL, "kf-min-dist", 1,
317− "Minimum keyframe interval (frames)");
318−static const arg_def_t kf_max_dist = ARG_DEF(NULL, "kf-max-dist", 1,
319− "Maximum keyframe interval (frames)");
320−static const arg_def_t kf_disabled = ARG_DEF(NULL, "disable-kf", 0,
321− "Disable keyframe placement");
314+static const arg_def_t kf_min_dist = ARG_DEF(
315+ NULL, "kf-min-dist", 1, "Minimum keyframe interval (frames)");
316+static const arg_def_t kf_max_dist = ARG_DEF(
317+ NULL, "kf-max-dist", 1, "Maximum keyframe interval (frames)");
318+static const arg_def_t kf_disabled = ARG_DEF(
319+ NULL, "disable-kf", 0, "Disable keyframe placement");
322320 static const arg_def_t *kf_args[] = {
323321 &kf_min_dist, &kf_max_dist, &kf_disabled, NULL
324322 };
325323
326324
327−static const arg_def_t noise_sens = ARG_DEF(NULL, "noise-sensitivity", 1,
328− "Noise sensitivity (frames to blur)");
329−static const arg_def_t sharpness = ARG_DEF(NULL, "sharpness", 1,
330− "Loop filter sharpness (0..7)");
331−static const arg_def_t static_thresh = ARG_DEF(NULL, "static-thresh", 1,
332− "Motion detection threshold");
333−static const arg_def_t cpu_used = ARG_DEF(NULL, "cpu-used", 1,
334− "CPU Used (-16..16)");
335−static const arg_def_t auto_altref = ARG_DEF(NULL, "auto-alt-ref", 1,
336− "Enable automatic alt reference frames");
337−static const arg_def_t arnr_maxframes = ARG_DEF(NULL, "arnr-maxframes", 1,
338− "AltRef max frames (0..15)");
339−static const arg_def_t arnr_strength = ARG_DEF(NULL, "arnr-strength", 1,
340− "AltRef filter strength (0..6)");
341−static const arg_def_t arnr_type = ARG_DEF(NULL, "arnr-type", 1,
342− "AltRef type");
325+static const arg_def_t noise_sens = ARG_DEF(
326+ NULL, "noise-sensitivity", 1, "Noise sensitivity (frames to blur)");
327+static const arg_def_t sharpness = ARG_DEF(
328+ NULL, "sharpness", 1, "Loop filter sharpness (0..7)");
329+static const arg_def_t static_thresh = ARG_DEF(
330+ NULL, "static-thresh", 1, "Motion detection threshold");
331+static const arg_def_t cpu_used = ARG_DEF(
332+ NULL, "cpu-used", 1, "CPU Used (-16..16)");
333+static const arg_def_t auto_altref = ARG_DEF(
334+ NULL, "auto-alt-ref", 1, "Enable automatic alt reference frames");
335+static const arg_def_t arnr_maxframes = ARG_DEF(
336+ NULL, "arnr-maxframes", 1, "AltRef max frames (0..15)");
337+static const arg_def_t arnr_strength = ARG_DEF(
338+ NULL, "arnr-strength", 1, "AltRef filter strength (0..6)");
339+static const arg_def_t arnr_type = ARG_DEF(
340+ NULL, "arnr-type", 1, "AltRef type");
343341 static const struct arg_enum_list tuning_enum[] = {
344342 {"psnr", VP8_TUNE_PSNR},
345343 {"ssim", VP8_TUNE_SSIM},
346344 {NULL, 0}
347345 };
348−static const arg_def_t tune_ssim = ARG_DEF_ENUM(NULL, "tune", 1,
349− "Material to favor", tuning_enum);
350−static const arg_def_t cq_level = ARG_DEF(NULL, "cq-level", 1,
351− "Constant/Constrained Quality level");
352−static const arg_def_t max_intra_rate_pct = ARG_DEF(NULL, "max-intra-rate", 1,
353− "Max I-frame bitrate (pct)");
346+static const arg_def_t tune_ssim = ARG_DEF_ENUM(
347+ NULL, "tune", 1, "Material to favor", tuning_enum);
348+static const arg_def_t cq_level = ARG_DEF(
349+ NULL, "cq-level", 1, "Constant/Constrained Quality level");
350+static const arg_def_t max_intra_rate_pct = ARG_DEF(
351+ NULL, "max-intra-rate", 1, "Max I-frame bitrate (pct)");
354352
355353 #if CONFIG_VP8_ENCODER
356−static const arg_def_t token_parts =
357− ARG_DEF(NULL, "token-parts", 1, "Number of token partitions to use, log2");
354+static const arg_def_t token_parts = ARG_DEF(
355+ NULL, "token-parts", 1, "Number of token partitions to use, log2");
358356 static const arg_def_t *vp8_args[] = {
359357 &cpu_used, &auto_altref, &noise_sens, &sharpness, &static_thresh,
360358 &token_parts, &arnr_maxframes, &arnr_strength, &arnr_type,
@@ -372,11 +370,12 @@ static const int vp8_arg_ctrl_map[] = { · 11 unmodified lines
372370 #endif
373371
374372 #if CONFIG_VP9_ENCODER
375−static const arg_def_t tile_cols =
376− ARG_DEF(NULL, "tile-columns", 1, "Number of tile columns to use, log2");
377−static const arg_def_t tile_rows =
378− ARG_DEF(NULL, "tile-rows", 1, "Number of tile rows to use, log2");
379−static const arg_def_t lossless = ARG_DEF(NULL, "lossless", 1, "Lossless mode");
373+static const arg_def_t tile_cols = ARG_DEF(
374+ NULL, "tile-columns", 1, "Number of tile columns to use, log2");
375+static const arg_def_t tile_rows = ARG_DEF(
376+ NULL, "tile-rows", 1, "Number of tile rows to use, log2");
377+static const arg_def_t lossless = ARG_DEF(
378+ NULL, "lossless", 1, "Lossless mode");
380379 static const arg_def_t frame_parallel_decoding = ARG_DEF(
381380 NULL, "frame-parallel", 1, "Enable frame parallel decodability features");
382381 static const arg_def_t aq_mode = ARG_DEF(
@@ -395,13 +394,12 @@ static const struct arg_enum_list bitdepth_enum[] = { · 12 unmodified lines
395394 {NULL, 0}
396395 };
397396
398−static const arg_def_t bitdeptharg = ARG_DEF_ENUM("b", "bit-depth", 1,
399− "Bit depth for codec "
400− "(8 for version <=1, "
401− "10 or 12 for version 2)",
402− bitdepth_enum);
403−static const arg_def_t inbitdeptharg = ARG_DEF(NULL, "input-bit-depth", 1,
404− "Bit depth of input");
397+static const arg_def_t bitdeptharg = ARG_DEF_ENUM(
398+ "b", "bit-depth", 1,
399+ "Bit depth for codec (8 for version <=1, 10 or 12 for version 2)",
400+ bitdepth_enum);
401+static const arg_def_t inbitdeptharg = ARG_DEF(
402+ NULL, "input-bit-depth", 1, "Bit depth of input");
405403 #endif
406404
407405 static const struct arg_enum_list tune_content_enum[] = {
@@ -1161,7 +1159,6 @@ static int parse_stream_params(struct VpxEncoderConfig *global, · 753 unmodified lines
11611159 if (j == config->arg_ctrl_cnt)
11621160 config->arg_ctrl_cnt++;
11631161 }
1164−
11651162 }
11661163 }
11671164 if (!match)
@@ -1917,14 +1914,15 @@ int main(int argc, const char **argv_) { · 749 unmodified lines
19171914 /* If the input file doesn't specify its w/h (raw files), try to get
19181915 * the data from the first stream's configuration.
19191916 */
1920− if (!input.width || !input.height)
1921− FOREACH_STREAM( {
1922− if (stream->config.cfg.g_w && stream->config.cfg.g_h) {
1923− input.width = stream->config.cfg.g_w;
1924− input.height = stream->config.cfg.g_h;
1925− break;
1926− }
1927− });
1917+ if (!input.width || !input.height) {
1918+ FOREACH_STREAM({
1919+ if (stream->config.cfg.g_w && stream->config.cfg.g_h) {
1920+ input.width = stream->config.cfg.g_w;
1921+ input.height = stream->config.cfg.g_h;
1922+ break;
1923+ }
1924+ });
1925+ }
19281926
19291927 /* Update stream configurations from the input file's parameters */
19301928 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