OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebM project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 static const arg_def_t mfqe = ARG_DEF(NULL, "mfqe", 0, | 116 static const arg_def_t mfqe = ARG_DEF(NULL, "mfqe", 0, |
117 "Enable multiframe quality enhancement"); | 117 "Enable multiframe quality enhancement"); |
118 | 118 |
119 static const arg_def_t *vp8_pp_args[] = { | 119 static const arg_def_t *vp8_pp_args[] = { |
120 &addnoise_level, &deblock, &demacroblock_level, &pp_debug_info, | 120 &addnoise_level, &deblock, &demacroblock_level, &pp_debug_info, |
121 &pp_disp_ref_frame, &pp_disp_mb_modes, &pp_disp_b_modes, &pp_disp_mvs, &mfqe, | 121 &pp_disp_ref_frame, &pp_disp_mb_modes, &pp_disp_b_modes, &pp_disp_mvs, &mfqe, |
122 NULL | 122 NULL |
123 }; | 123 }; |
124 #endif | 124 #endif |
125 | 125 |
126 static int vpx_image_scale(vpx_image_t *src, vpx_image_t *dst, | 126 static INLINE int vpx_image_scale(vpx_image_t *src, vpx_image_t *dst, |
127 FilterModeEnum mode) { | 127 FilterModeEnum mode) { |
128 assert(src->fmt == VPX_IMG_FMT_I420); | 128 assert(src->fmt == VPX_IMG_FMT_I420); |
129 assert(dst->fmt == VPX_IMG_FMT_I420); | 129 assert(dst->fmt == VPX_IMG_FMT_I420); |
130 return I420Scale(src->planes[VPX_PLANE_Y], src->stride[VPX_PLANE_Y], | 130 return I420Scale(src->planes[VPX_PLANE_Y], src->stride[VPX_PLANE_Y], |
131 src->planes[VPX_PLANE_U], src->stride[VPX_PLANE_U], | 131 src->planes[VPX_PLANE_U], src->stride[VPX_PLANE_U], |
132 src->planes[VPX_PLANE_V], src->stride[VPX_PLANE_V], | 132 src->planes[VPX_PLANE_V], src->stride[VPX_PLANE_V], |
133 src->d_w, src->d_h, | 133 src->d_w, src->d_h, |
134 dst->planes[VPX_PLANE_Y], dst->stride[VPX_PLANE_Y], | 134 dst->planes[VPX_PLANE_Y], dst->stride[VPX_PLANE_Y], |
135 dst->planes[VPX_PLANE_U], dst->stride[VPX_PLANE_U], | 135 dst->planes[VPX_PLANE_U], dst->stride[VPX_PLANE_U], |
136 dst->planes[VPX_PLANE_V], dst->stride[VPX_PLANE_V], | 136 dst->planes[VPX_PLANE_V], dst->stride[VPX_PLANE_V], |
137 dst->d_w, dst->d_h, | 137 dst->d_w, dst->d_h, |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 snprintf(q, q_len - 1, "%07d", frame_in); | 418 snprintf(q, q_len - 1, "%07d", frame_in); |
419 break; | 419 break; |
420 case '8': | 420 case '8': |
421 snprintf(q, q_len - 1, "%08d", frame_in); | 421 snprintf(q, q_len - 1, "%08d", frame_in); |
422 break; | 422 break; |
423 case '9': | 423 case '9': |
424 snprintf(q, q_len - 1, "%09d", frame_in); | 424 snprintf(q, q_len - 1, "%09d", frame_in); |
425 break; | 425 break; |
426 default: | 426 default: |
427 die("Unrecognized pattern %%%c\n", p[1]); | 427 die("Unrecognized pattern %%%c\n", p[1]); |
| 428 break; |
428 } | 429 } |
429 | 430 |
430 pat_len = strlen(q); | 431 pat_len = strlen(q); |
431 if (pat_len >= q_len - 1) | 432 if (pat_len >= q_len - 1) |
432 die("Output filename too long.\n"); | 433 die("Output filename too long.\n"); |
433 q += pat_len; | 434 q += pat_len; |
434 p += 2; | 435 p += 2; |
435 q_len -= pat_len; | 436 q_len -= pat_len; |
436 } else { | 437 } else { |
437 size_t copy_len; | 438 size_t copy_len; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 const VpxInterface *interface = NULL; | 505 const VpxInterface *interface = NULL; |
505 const VpxInterface *fourcc_interface = NULL; | 506 const VpxInterface *fourcc_interface = NULL; |
506 uint64_t dx_time = 0; | 507 uint64_t dx_time = 0; |
507 struct arg arg; | 508 struct arg arg; |
508 char **argv, **argi, **argj; | 509 char **argv, **argi, **argj; |
509 | 510 |
510 int single_file; | 511 int single_file; |
511 int use_y4m = 1; | 512 int use_y4m = 1; |
512 int opt_yv12 = 0; | 513 int opt_yv12 = 0; |
513 int opt_i420 = 0; | 514 int opt_i420 = 0; |
514 vpx_codec_dec_cfg_t cfg = {0}; | 515 vpx_codec_dec_cfg_t cfg = {0, 0, 0}; |
515 #if CONFIG_VP8_DECODER | 516 #if CONFIG_VP8_DECODER |
516 vp8_postproc_cfg_t vp8_pp_cfg = {0}; | 517 vp8_postproc_cfg_t vp8_pp_cfg = {0}; |
517 int vp8_dbg_color_ref_frame = 0; | 518 int vp8_dbg_color_ref_frame = 0; |
518 int vp8_dbg_color_mb_modes = 0; | 519 int vp8_dbg_color_mb_modes = 0; |
519 int vp8_dbg_color_b_modes = 0; | 520 int vp8_dbg_color_b_modes = 0; |
520 int vp8_dbg_display_mv = 0; | 521 int vp8_dbg_display_mv = 0; |
521 #endif | 522 #endif |
522 int frames_corrupted = 0; | 523 int frames_corrupted = 0; |
523 int dec_flags = 0; | 524 int dec_flags = 0; |
524 int do_scale = 0; | 525 int do_scale = 0; |
525 vpx_image_t *scaled_img = NULL; | 526 vpx_image_t *scaled_img = NULL; |
526 int frame_avail, got_data; | 527 int frame_avail, got_data; |
527 int num_external_frame_buffers = 0; | 528 int num_external_frame_buffers = 0; |
528 struct ExternalFrameBufferList ext_fb_list = {0}; | 529 struct ExternalFrameBufferList ext_fb_list = {0, NULL}; |
529 | 530 |
530 const char *outfile_pattern = NULL; | 531 const char *outfile_pattern = NULL; |
531 char outfile_name[PATH_MAX] = {0}; | 532 char outfile_name[PATH_MAX] = {0}; |
532 FILE *outfile = NULL; | 533 FILE *outfile = NULL; |
533 | 534 |
534 MD5Context md5_ctx; | 535 MD5Context md5_ctx; |
535 unsigned char md5_digest[16]; | 536 unsigned char md5_digest[16]; |
536 | 537 |
537 struct VpxDecInputContext input = {0}; | 538 struct VpxDecInputContext input = {NULL, NULL}; |
538 struct VpxInputContext vpx_input_ctx = {0}; | 539 struct VpxInputContext vpx_input_ctx; |
539 #if CONFIG_WEBM_IO | 540 #if CONFIG_WEBM_IO |
540 struct WebmInputContext webm_ctx = {0}; | 541 struct WebmInputContext webm_ctx = {0}; |
541 input.webm_ctx = &webm_ctx; | 542 input.webm_ctx = &webm_ctx; |
542 #endif | 543 #endif |
543 input.vpx_input_ctx = &vpx_input_ctx; | 544 input.vpx_input_ctx = &vpx_input_ctx; |
544 | 545 |
545 /* Parse command line */ | 546 /* Parse command line */ |
546 exec_name = argv_[0]; | 547 exec_name = argv_[0]; |
547 argv = argv_dup(argc - 1, argv_ + 1); | 548 argv = argv_dup(argc - 1, argv_ + 1); |
548 | 549 |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1032 if (arg_match(&arg, &looparg, argi)) { | 1033 if (arg_match(&arg, &looparg, argi)) { |
1033 loops = arg_parse_uint(&arg); | 1034 loops = arg_parse_uint(&arg); |
1034 break; | 1035 break; |
1035 } | 1036 } |
1036 } | 1037 } |
1037 free(argv); | 1038 free(argv); |
1038 for (i = 0; !error && i < loops; i++) | 1039 for (i = 0; !error && i < loops; i++) |
1039 error = main_loop(argc, argv_); | 1040 error = main_loop(argc, argv_); |
1040 return error; | 1041 return error; |
1041 } | 1042 } |
OLD | NEW |