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

Side by Side Diff: source/libvpx/vpx/src/vpx_encoder.c

Issue 478033002: 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/src/vpx_decoder.c ('k') | source/libvpx/vpx/vp8cx.h » ('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
(...skipping 17 matching lines...) Expand all
28 vpx_codec_err_t res; 28 vpx_codec_err_t res;
29 29
30 if (ver != VPX_ENCODER_ABI_VERSION) 30 if (ver != VPX_ENCODER_ABI_VERSION)
31 res = VPX_CODEC_ABI_MISMATCH; 31 res = VPX_CODEC_ABI_MISMATCH;
32 else if (!ctx || !iface || !cfg) 32 else if (!ctx || !iface || !cfg)
33 res = VPX_CODEC_INVALID_PARAM; 33 res = VPX_CODEC_INVALID_PARAM;
34 else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION) 34 else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION)
35 res = VPX_CODEC_ABI_MISMATCH; 35 res = VPX_CODEC_ABI_MISMATCH;
36 else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) 36 else if (!(iface->caps & VPX_CODEC_CAP_ENCODER))
37 res = VPX_CODEC_INCAPABLE; 37 res = VPX_CODEC_INCAPABLE;
38 else if ((flags & VPX_CODEC_USE_XMA) && !(iface->caps & VPX_CODEC_CAP_XMA))
39 res = VPX_CODEC_INCAPABLE;
40 else if ((flags & VPX_CODEC_USE_PSNR) 38 else if ((flags & VPX_CODEC_USE_PSNR)
41 && !(iface->caps & VPX_CODEC_CAP_PSNR)) 39 && !(iface->caps & VPX_CODEC_CAP_PSNR))
42 res = VPX_CODEC_INCAPABLE; 40 res = VPX_CODEC_INCAPABLE;
43 else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION) 41 else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION)
44 && !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION)) 42 && !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION))
45 res = VPX_CODEC_INCAPABLE; 43 res = VPX_CODEC_INCAPABLE;
46 else { 44 else {
47 ctx->iface = iface; 45 ctx->iface = iface;
48 ctx->name = iface->name; 46 ctx->name = iface->name;
49 ctx->priv = NULL; 47 ctx->priv = NULL;
(...skipping 23 matching lines...) Expand all
73 vpx_codec_err_t res = VPX_CODEC_OK; 71 vpx_codec_err_t res = VPX_CODEC_OK;
74 72
75 if (ver != VPX_ENCODER_ABI_VERSION) 73 if (ver != VPX_ENCODER_ABI_VERSION)
76 res = VPX_CODEC_ABI_MISMATCH; 74 res = VPX_CODEC_ABI_MISMATCH;
77 else if (!ctx || !iface || !cfg || (num_enc > 16 || num_enc < 1)) 75 else if (!ctx || !iface || !cfg || (num_enc > 16 || num_enc < 1))
78 res = VPX_CODEC_INVALID_PARAM; 76 res = VPX_CODEC_INVALID_PARAM;
79 else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION) 77 else if (iface->abi_version != VPX_CODEC_INTERNAL_ABI_VERSION)
80 res = VPX_CODEC_ABI_MISMATCH; 78 res = VPX_CODEC_ABI_MISMATCH;
81 else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) 79 else if (!(iface->caps & VPX_CODEC_CAP_ENCODER))
82 res = VPX_CODEC_INCAPABLE; 80 res = VPX_CODEC_INCAPABLE;
83 else if ((flags & VPX_CODEC_USE_XMA) && !(iface->caps & VPX_CODEC_CAP_XMA))
84 res = VPX_CODEC_INCAPABLE;
85 else if ((flags & VPX_CODEC_USE_PSNR) 81 else if ((flags & VPX_CODEC_USE_PSNR)
86 && !(iface->caps & VPX_CODEC_CAP_PSNR)) 82 && !(iface->caps & VPX_CODEC_CAP_PSNR))
87 res = VPX_CODEC_INCAPABLE; 83 res = VPX_CODEC_INCAPABLE;
88 else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION) 84 else if ((flags & VPX_CODEC_USE_OUTPUT_PARTITION)
89 && !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION)) 85 && !(iface->caps & VPX_CODEC_CAP_OUTPUT_PARTITION))
90 res = VPX_CODEC_INCAPABLE; 86 res = VPX_CODEC_INCAPABLE;
91 else { 87 else {
92 int i; 88 int i;
93 void *mem_loc = NULL; 89 void *mem_loc = NULL;
94 90
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 151
156 return SAVE_STATUS(ctx, res); 152 return SAVE_STATUS(ctx, res);
157 } 153 }
158 154
159 155
160 vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface, 156 vpx_codec_err_t vpx_codec_enc_config_default(vpx_codec_iface_t *iface,
161 vpx_codec_enc_cfg_t *cfg, 157 vpx_codec_enc_cfg_t *cfg,
162 unsigned int usage) { 158 unsigned int usage) {
163 vpx_codec_err_t res; 159 vpx_codec_err_t res;
164 vpx_codec_enc_cfg_map_t *map; 160 vpx_codec_enc_cfg_map_t *map;
161 int i;
165 162
166 if (!iface || !cfg || usage > INT_MAX) 163 if (!iface || !cfg || usage > INT_MAX)
167 res = VPX_CODEC_INVALID_PARAM; 164 res = VPX_CODEC_INVALID_PARAM;
168 else if (!(iface->caps & VPX_CODEC_CAP_ENCODER)) 165 else if (!(iface->caps & VPX_CODEC_CAP_ENCODER))
169 res = VPX_CODEC_INCAPABLE; 166 res = VPX_CODEC_INCAPABLE;
170 else { 167 else {
171 res = VPX_CODEC_INVALID_PARAM; 168 res = VPX_CODEC_INVALID_PARAM;
172 169
173 for (map = iface->enc.cfg_maps; map->usage >= 0; map++) { 170 for (i = 0; i < iface->enc.cfg_map_count; ++i) {
171 map = iface->enc.cfg_maps + i;
174 if (map->usage == (int)usage) { 172 if (map->usage == (int)usage) {
175 *cfg = map->cfg; 173 *cfg = map->cfg;
176 cfg->g_usage = usage; 174 cfg->g_usage = usage;
177 res = VPX_CODEC_OK; 175 res = VPX_CODEC_OK;
178 break; 176 break;
179 } 177 }
180 } 178 }
181 } 179 }
182 180
183 return res; 181 return res;
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 394
397 pkt = (const vpx_codec_cx_pkt_t *)*iter; 395 pkt = (const vpx_codec_cx_pkt_t *)*iter;
398 396
399 if ((size_t)(pkt - list->pkts) < list->cnt) 397 if ((size_t)(pkt - list->pkts) < list->cnt)
400 *iter = pkt + 1; 398 *iter = pkt + 1;
401 else 399 else
402 pkt = NULL; 400 pkt = NULL;
403 401
404 return pkt; 402 return pkt;
405 } 403 }
OLDNEW
« no previous file with comments | « source/libvpx/vpx/src/vpx_decoder.c ('k') | source/libvpx/vpx/vp8cx.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698