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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 } while(0) | 128 } while(0) |
129 | 129 |
130 static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, | 130 static vpx_codec_err_t validate_config(vpx_codec_alg_priv_t *ctx, |
131 const vpx_codec_enc_cfg_t *cfg, | 131 const vpx_codec_enc_cfg_t *cfg, |
132 const struct vp8_extracfg *vp8_cfg, | 132 const struct vp8_extracfg *vp8_cfg, |
133 int finalize) | 133 int finalize) |
134 { | 134 { |
135 RANGE_CHECK(cfg, g_w, 1, 16383); /* 14 bits available */ | 135 RANGE_CHECK(cfg, g_w, 1, 16383); /* 14 bits available */ |
136 RANGE_CHECK(cfg, g_h, 1, 16383); /* 14 bits available */ | 136 RANGE_CHECK(cfg, g_h, 1, 16383); /* 14 bits available */ |
137 RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000); | 137 RANGE_CHECK(cfg, g_timebase.den, 1, 1000000000); |
138 RANGE_CHECK(cfg, g_timebase.num, 1, cfg->g_timebase.den); | 138 RANGE_CHECK(cfg, g_timebase.num, 1, 1000000000); |
139 RANGE_CHECK_HI(cfg, g_profile, 3); | 139 RANGE_CHECK_HI(cfg, g_profile, 3); |
140 RANGE_CHECK_HI(cfg, rc_max_quantizer, 63); | 140 RANGE_CHECK_HI(cfg, rc_max_quantizer, 63); |
141 RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer); | 141 RANGE_CHECK_HI(cfg, rc_min_quantizer, cfg->rc_max_quantizer); |
142 RANGE_CHECK_HI(cfg, g_threads, 64); | 142 RANGE_CHECK_HI(cfg, g_threads, 64); |
143 #if CONFIG_REALTIME_ONLY | 143 #if CONFIG_REALTIME_ONLY |
144 RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); | 144 RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); |
145 #elif CONFIG_MULTI_RES_ENCODING | 145 #elif CONFIG_MULTI_RES_ENCODING |
146 if (ctx->base.enc.total_encoders > 1) | 146 if (ctx->base.enc.total_encoders > 1) |
147 RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); | 147 RANGE_CHECK_HI(cfg, g_lag_in_frames, 0); |
148 #else | 148 #else |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 if (!res) | 471 if (!res) |
472 { | 472 { |
473 ctx->cfg = *cfg; | 473 ctx->cfg = *cfg; |
474 set_vp8e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg, NULL); | 474 set_vp8e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg, NULL); |
475 vp8_change_config(ctx->cpi, &ctx->oxcf); | 475 vp8_change_config(ctx->cpi, &ctx->oxcf); |
476 } | 476 } |
477 | 477 |
478 return res; | 478 return res; |
479 } | 479 } |
480 | 480 |
481 int vp8_reverse_trans(int); | |
482 | |
483 static vpx_codec_err_t get_quantizer(vpx_codec_alg_priv_t *ctx, va_list args) | 481 static vpx_codec_err_t get_quantizer(vpx_codec_alg_priv_t *ctx, va_list args) |
484 { | 482 { |
485 int *const arg = va_arg(args, int *); | 483 int *const arg = va_arg(args, int *); |
486 if (arg == NULL) | 484 if (arg == NULL) |
487 return VPX_CODEC_INVALID_PARAM; | 485 return VPX_CODEC_INVALID_PARAM; |
488 *arg = vp8_get_quantizer(ctx->cpi); | 486 *arg = vp8_get_quantizer(ctx->cpi); |
489 return VPX_CODEC_OK; | 487 return VPX_CODEC_OK; |
490 } | 488 } |
491 | 489 |
492 static vpx_codec_err_t get_quantizer64(vpx_codec_alg_priv_t *ctx, va_list args) | 490 static vpx_codec_err_t get_quantizer64(vpx_codec_alg_priv_t *ctx, va_list args) |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1388 1, /* 1 cfg map */ | 1386 1, /* 1 cfg map */ |
1389 vp8e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t cfg_maps; */ | 1387 vp8e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t cfg_maps; */ |
1390 vp8e_encode, /* vpx_codec_encode_fn_t encode; */ | 1388 vp8e_encode, /* vpx_codec_encode_fn_t encode; */ |
1391 vp8e_get_cxdata, /* vpx_codec_get_cx_data_fn_t get_cx_data; */ | 1389 vp8e_get_cxdata, /* vpx_codec_get_cx_data_fn_t get_cx_data; */ |
1392 vp8e_set_config, | 1390 vp8e_set_config, |
1393 NULL, | 1391 NULL, |
1394 vp8e_get_preview, | 1392 vp8e_get_preview, |
1395 vp8e_mr_alloc_mem, | 1393 vp8e_mr_alloc_mem, |
1396 } /* encoder functions */ | 1394 } /* encoder functions */ |
1397 }; | 1395 }; |
OLD | NEW |