Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Side by Side Diff: source/libvpx/vpxdec.c

Issue 484923003: libvpx: Pull from upstream (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « source/libvpx/vpx_ports/vpx_timer.h ('k') | source/libvpx/vpxenc.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 #include <assert.h> 11 #include <assert.h>
12 #include <stdio.h> 12 #include <stdio.h>
13 #include <stdlib.h> 13 #include <stdlib.h>
14 #include <stdarg.h> 14 #include <stdarg.h>
15 #include <string.h> 15 #include <string.h>
16 #include <limits.h> 16 #include <limits.h>
17 17
18 #include "./vpx_config.h"
19
20 #if CONFIG_LIBYUV
18 #include "third_party/libyuv/include/libyuv/scale.h" 21 #include "third_party/libyuv/include/libyuv/scale.h"
22 #endif
19 23
20 #include "./args.h" 24 #include "./args.h"
21 #include "./ivfdec.h" 25 #include "./ivfdec.h"
22 26
23 #define VPX_CODEC_DISABLE_COMPAT 1 27 #define VPX_CODEC_DISABLE_COMPAT 1
24 #include "./vpx_config.h"
25 #include "vpx/vpx_decoder.h" 28 #include "vpx/vpx_decoder.h"
26 #include "vpx_ports/mem_ops.h" 29 #include "vpx_ports/mem_ops.h"
27 #include "vpx_ports/vpx_timer.h" 30 #include "vpx_ports/vpx_timer.h"
28 31
29 #if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER 32 #if CONFIG_VP8_DECODER || CONFIG_VP9_DECODER
30 #include "vpx/vp8dx.h" 33 #include "vpx/vp8dx.h"
31 #endif 34 #endif
32 35
33 #include "./md5_utils.h" 36 #include "./md5_utils.h"
34 37
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 static const arg_def_t mfqe = ARG_DEF(NULL, "mfqe", 0, 119 static const arg_def_t mfqe = ARG_DEF(NULL, "mfqe", 0,
117 "Enable multiframe quality enhancement"); 120 "Enable multiframe quality enhancement");
118 121
119 static const arg_def_t *vp8_pp_args[] = { 122 static const arg_def_t *vp8_pp_args[] = {
120 &addnoise_level, &deblock, &demacroblock_level, &pp_debug_info, 123 &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, 124 &pp_disp_ref_frame, &pp_disp_mb_modes, &pp_disp_b_modes, &pp_disp_mvs, &mfqe,
122 NULL 125 NULL
123 }; 126 };
124 #endif 127 #endif
125 128
129 #if CONFIG_LIBYUV
126 static INLINE int vpx_image_scale(vpx_image_t *src, vpx_image_t *dst, 130 static INLINE int vpx_image_scale(vpx_image_t *src, vpx_image_t *dst,
127 FilterModeEnum mode) { 131 FilterModeEnum mode) {
128 assert(src->fmt == VPX_IMG_FMT_I420); 132 assert(src->fmt == VPX_IMG_FMT_I420);
129 assert(dst->fmt == VPX_IMG_FMT_I420); 133 assert(dst->fmt == VPX_IMG_FMT_I420);
130 return I420Scale(src->planes[VPX_PLANE_Y], src->stride[VPX_PLANE_Y], 134 return I420Scale(src->planes[VPX_PLANE_Y], src->stride[VPX_PLANE_Y],
131 src->planes[VPX_PLANE_U], src->stride[VPX_PLANE_U], 135 src->planes[VPX_PLANE_U], src->stride[VPX_PLANE_U],
132 src->planes[VPX_PLANE_V], src->stride[VPX_PLANE_V], 136 src->planes[VPX_PLANE_V], src->stride[VPX_PLANE_V],
133 src->d_w, src->d_h, 137 src->d_w, src->d_h,
134 dst->planes[VPX_PLANE_Y], dst->stride[VPX_PLANE_Y], 138 dst->planes[VPX_PLANE_Y], dst->stride[VPX_PLANE_Y],
135 dst->planes[VPX_PLANE_U], dst->stride[VPX_PLANE_U], 139 dst->planes[VPX_PLANE_U], dst->stride[VPX_PLANE_U],
136 dst->planes[VPX_PLANE_V], dst->stride[VPX_PLANE_V], 140 dst->planes[VPX_PLANE_V], dst->stride[VPX_PLANE_V],
137 dst->d_w, dst->d_h, 141 dst->d_w, dst->d_h,
138 mode); 142 mode);
139 } 143 }
144 #endif
140 145
141 void usage_exit() { 146 void usage_exit() {
142 int i; 147 int i;
143 148
144 fprintf(stderr, "Usage: %s <options> filename\n\n" 149 fprintf(stderr, "Usage: %s <options> filename\n\n"
145 "Options:\n", exec_name); 150 "Options:\n", exec_name);
146 arg_show_usage(stderr, all_args); 151 arg_show_usage(stderr, all_args);
147 #if CONFIG_VP8_DECODER 152 #if CONFIG_VP8_DECODER
148 fprintf(stderr, "\nVP8 Postprocessing Options:\n"); 153 fprintf(stderr, "\nVP8 Postprocessing Options:\n");
149 arg_show_usage(stderr, vp8_pp_args); 154 arg_show_usage(stderr, vp8_pp_args);
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 const char *outfile_pattern = NULL; 536 const char *outfile_pattern = NULL;
532 char outfile_name[PATH_MAX] = {0}; 537 char outfile_name[PATH_MAX] = {0};
533 FILE *outfile = NULL; 538 FILE *outfile = NULL;
534 539
535 MD5Context md5_ctx; 540 MD5Context md5_ctx;
536 unsigned char md5_digest[16]; 541 unsigned char md5_digest[16];
537 542
538 struct VpxDecInputContext input = {NULL, NULL}; 543 struct VpxDecInputContext input = {NULL, NULL};
539 struct VpxInputContext vpx_input_ctx; 544 struct VpxInputContext vpx_input_ctx;
540 #if CONFIG_WEBM_IO 545 #if CONFIG_WEBM_IO
541 struct WebmInputContext webm_ctx = {0}; 546 struct WebmInputContext webm_ctx;
547 memset(&(webm_ctx), 0, sizeof(webm_ctx));
542 input.webm_ctx = &webm_ctx; 548 input.webm_ctx = &webm_ctx;
543 #endif 549 #endif
544 input.vpx_input_ctx = &vpx_input_ctx; 550 input.vpx_input_ctx = &vpx_input_ctx;
545 551
546 /* Parse command line */ 552 /* Parse command line */
547 exec_name = argv_[0]; 553 exec_name = argv_[0];
548 argv = argv_dup(argc - 1, argv_ + 1); 554 argv = argv_dup(argc - 1, argv_ + 1);
549 555
550 for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) { 556 for (argi = argj = argv; (*argj = *argi); argi += arg.argv_step) {
551 memset(&arg, 0, sizeof(arg)); 557 memset(&arg, 0, sizeof(arg));
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
1033 if (arg_match(&arg, &looparg, argi)) { 1039 if (arg_match(&arg, &looparg, argi)) {
1034 loops = arg_parse_uint(&arg); 1040 loops = arg_parse_uint(&arg);
1035 break; 1041 break;
1036 } 1042 }
1037 } 1043 }
1038 free(argv); 1044 free(argv);
1039 for (i = 0; !error && i < loops; i++) 1045 for (i = 0; !error && i < loops; i++)
1040 error = main_loop(argc, argv_); 1046 error = main_loop(argc, argv_);
1041 return error; 1047 return error;
1042 } 1048 }
OLDNEW
« no previous file with comments | « source/libvpx/vpx_ports/vpx_timer.h ('k') | source/libvpx/vpxenc.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698