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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 "Enable multiframe quality enhancement"); | 124 "Enable multiframe quality enhancement"); |
125 | 125 |
126 static const arg_def_t *vp8_pp_args[] = { | 126 static const arg_def_t *vp8_pp_args[] = { |
127 &addnoise_level, &deblock, &demacroblock_level, &pp_debug_info, | 127 &addnoise_level, &deblock, &demacroblock_level, &pp_debug_info, |
128 &pp_disp_ref_frame, &pp_disp_mb_modes, &pp_disp_b_modes, &pp_disp_mvs, &mfqe, | 128 &pp_disp_ref_frame, &pp_disp_mb_modes, &pp_disp_b_modes, &pp_disp_mvs, &mfqe, |
129 NULL | 129 NULL |
130 }; | 130 }; |
131 #endif | 131 #endif |
132 | 132 |
133 #if CONFIG_LIBYUV | 133 #if CONFIG_LIBYUV |
134 static INLINE int vpx_image_scale(vpx_image_t *src, vpx_image_t *dst, | 134 static INLINE int libyuv_scale(vpx_image_t *src, vpx_image_t *dst, |
135 FilterModeEnum mode) { | 135 FilterModeEnum mode) { |
136 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH | 136 #if CONFIG_VP9 && CONFIG_VP9_HIGHBITDEPTH |
137 if (src->fmt == VPX_IMG_FMT_I42016) { | 137 if (src->fmt == VPX_IMG_FMT_I42016) { |
138 assert(dst->fmt == VPX_IMG_FMT_I42016); | 138 assert(dst->fmt == VPX_IMG_FMT_I42016); |
139 return I420Scale_16((uint16_t*)src->planes[VPX_PLANE_Y], | 139 return I420Scale_16((uint16_t*)src->planes[VPX_PLANE_Y], |
140 src->stride[VPX_PLANE_Y]/2, | 140 src->stride[VPX_PLANE_Y]/2, |
141 (uint16_t*)src->planes[VPX_PLANE_U], | 141 (uint16_t*)src->planes[VPX_PLANE_U], |
142 src->stride[VPX_PLANE_U]/2, | 142 src->stride[VPX_PLANE_U]/2, |
143 (uint16_t*)src->planes[VPX_PLANE_V], | 143 (uint16_t*)src->planes[VPX_PLANE_V], |
144 src->stride[VPX_PLANE_V]/2, | 144 src->stride[VPX_PLANE_V]/2, |
(...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 if ((img = vpx_codec_get_frame(&decoder, &iter))) { | 901 if ((img = vpx_codec_get_frame(&decoder, &iter))) { |
902 ++frame_out; | 902 ++frame_out; |
903 got_data = 1; | 903 got_data = 1; |
904 } | 904 } |
905 | 905 |
906 vpx_usec_timer_mark(&timer); | 906 vpx_usec_timer_mark(&timer); |
907 dx_time += (unsigned int)vpx_usec_timer_elapsed(&timer); | 907 dx_time += (unsigned int)vpx_usec_timer_elapsed(&timer); |
908 | 908 |
909 if (vpx_codec_control(&decoder, VP8D_GET_FRAME_CORRUPTED, &corrupted)) { | 909 if (vpx_codec_control(&decoder, VP8D_GET_FRAME_CORRUPTED, &corrupted)) { |
910 warn("Failed VP8_GET_FRAME_CORRUPTED: %s", vpx_codec_error(&decoder)); | 910 warn("Failed VP8_GET_FRAME_CORRUPTED: %s", vpx_codec_error(&decoder)); |
911 goto fail; | 911 if (!keep_going) |
| 912 goto fail; |
912 } | 913 } |
913 frames_corrupted += corrupted; | 914 frames_corrupted += corrupted; |
914 | 915 |
915 if (progress) | 916 if (progress) |
916 show_progress(frame_in, frame_out, dx_time); | 917 show_progress(frame_in, frame_out, dx_time); |
917 | 918 |
918 if (!noblit && img) { | 919 if (!noblit && img) { |
919 const int PLANES_YUV[] = {VPX_PLANE_Y, VPX_PLANE_U, VPX_PLANE_V}; | 920 const int PLANES_YUV[] = {VPX_PLANE_Y, VPX_PLANE_U, VPX_PLANE_V}; |
920 const int PLANES_YVU[] = {VPX_PLANE_Y, VPX_PLANE_V, VPX_PLANE_U}; | 921 const int PLANES_YVU[] = {VPX_PLANE_Y, VPX_PLANE_V, VPX_PLANE_U}; |
921 const int *planes = flipuv ? PLANES_YVU : PLANES_YUV; | 922 const int *planes = flipuv ? PLANES_YVU : PLANES_YUV; |
(...skipping 19 matching lines...) Expand all Loading... |
941 display_height = display_size[1]; | 942 display_height = display_size[1]; |
942 } | 943 } |
943 } | 944 } |
944 scaled_img = vpx_img_alloc(NULL, img->fmt, display_width, | 945 scaled_img = vpx_img_alloc(NULL, img->fmt, display_width, |
945 display_height, 16); | 946 display_height, 16); |
946 scaled_img->bit_depth = img->bit_depth; | 947 scaled_img->bit_depth = img->bit_depth; |
947 } | 948 } |
948 | 949 |
949 if (img->d_w != scaled_img->d_w || img->d_h != scaled_img->d_h) { | 950 if (img->d_w != scaled_img->d_w || img->d_h != scaled_img->d_h) { |
950 #if CONFIG_LIBYUV | 951 #if CONFIG_LIBYUV |
951 vpx_image_scale(img, scaled_img, kFilterBox); | 952 libyuv_scale(img, scaled_img, kFilterBox); |
952 img = scaled_img; | 953 img = scaled_img; |
953 #else | 954 #else |
954 fprintf(stderr, "Failed to scale output frame: %s.\n" | 955 fprintf(stderr, "Failed to scale output frame: %s.\n" |
955 "Scaling is disabled in this configuration. " | 956 "Scaling is disabled in this configuration. " |
956 "To enable scaling, configure with --enable-libyuv\n", | 957 "To enable scaling, configure with --enable-libyuv\n", |
957 vpx_codec_error(&decoder)); | 958 vpx_codec_error(&decoder)); |
958 return EXIT_FAILURE; | 959 return EXIT_FAILURE; |
959 #endif | 960 #endif |
960 } | 961 } |
961 } | 962 } |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 if (arg_match(&arg, &looparg, argi)) { | 1129 if (arg_match(&arg, &looparg, argi)) { |
1129 loops = arg_parse_uint(&arg); | 1130 loops = arg_parse_uint(&arg); |
1130 break; | 1131 break; |
1131 } | 1132 } |
1132 } | 1133 } |
1133 free(argv); | 1134 free(argv); |
1134 for (i = 0; !error && i < loops; i++) | 1135 for (i = 0; !error && i < loops; i++) |
1135 error = main_loop(argc, argv_); | 1136 error = main_loop(argc, argv_); |
1136 return error; | 1137 return error; |
1137 } | 1138 } |
OLD | NEW |