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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 int usage; | 44 int usage; |
45 struct vp9_extracfg cfg; | 45 struct vp9_extracfg cfg; |
46 }; | 46 }; |
47 | 47 |
48 static const struct extraconfig_map extracfg_map[] = { | 48 static const struct extraconfig_map extracfg_map[] = { |
49 { | 49 { |
50 0, | 50 0, |
51 { | 51 { |
52 NULL, | 52 NULL, |
53 0, /* cpu_used */ | 53 0, /* cpu_used */ |
54 0, /* enable_auto_alt_ref */ | 54 1, /* enable_auto_alt_ref */ |
55 0, /* noise_sensitivity */ | 55 0, /* noise_sensitivity */ |
56 0, /* Sharpness */ | 56 0, /* Sharpness */ |
57 0, /* static_thresh */ | 57 0, /* static_thresh */ |
58 0, /* tile_columns */ | 58 0, /* tile_columns */ |
59 0, /* tile_rows */ | 59 0, /* tile_rows */ |
60 0, /* arnr_max_frames */ | 60 7, /* arnr_max_frames */ |
61 3, /* arnr_strength */ | 61 5, /* arnr_strength */ |
62 3, /* arnr_type*/ | 62 3, /* arnr_type*/ |
63 0, /* experimental mode */ | 63 0, /* experimental mode */ |
64 0, /* tuning*/ | 64 0, /* tuning*/ |
65 10, /* cq_level */ | 65 10, /* cq_level */ |
66 0, /* rc_max_intra_bitrate_pct */ | 66 0, /* rc_max_intra_bitrate_pct */ |
67 0, /* lossless */ | 67 0, /* lossless */ |
68 0, /* frame_parallel_decoding_mode */ | 68 0, /* frame_parallel_decoding_mode */ |
69 } | 69 } |
70 } | 70 } |
71 }; | 71 }; |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 | 404 |
405 static vpx_codec_err_t set_param(vpx_codec_alg_priv_t *ctx, | 405 static vpx_codec_err_t set_param(vpx_codec_alg_priv_t *ctx, |
406 int ctrl_id, | 406 int ctrl_id, |
407 va_list args) { | 407 va_list args) { |
408 vpx_codec_err_t res = VPX_CODEC_OK; | 408 vpx_codec_err_t res = VPX_CODEC_OK; |
409 struct vp9_extracfg xcfg = ctx->vp8_cfg; | 409 struct vp9_extracfg xcfg = ctx->vp8_cfg; |
410 | 410 |
411 #define MAP(id, var) case id: var = CAST(id, args); break; | 411 #define MAP(id, var) case id: var = CAST(id, args); break; |
412 | 412 |
413 switch (ctrl_id) { | 413 switch (ctrl_id) { |
414 MAP(VP8E_SET_CPUUSED, xcfg.cpu_used); | 414 MAP(VP8E_SET_CPUUSED, xcfg.cpu_used); |
415 MAP(VP8E_SET_ENABLEAUTOALTREF, xcfg.enable_auto_alt_ref); | 415 MAP(VP8E_SET_ENABLEAUTOALTREF, xcfg.enable_auto_alt_ref); |
416 MAP(VP8E_SET_NOISE_SENSITIVITY, xcfg.noise_sensitivity); | 416 MAP(VP8E_SET_NOISE_SENSITIVITY, xcfg.noise_sensitivity); |
417 MAP(VP8E_SET_SHARPNESS, xcfg.Sharpness); | 417 MAP(VP8E_SET_SHARPNESS, xcfg.Sharpness); |
418 MAP(VP8E_SET_STATIC_THRESHOLD, xcfg.static_thresh); | 418 MAP(VP8E_SET_STATIC_THRESHOLD, xcfg.static_thresh); |
419 MAP(VP9E_SET_TILE_COLUMNS, xcfg.tile_columns); | 419 MAP(VP9E_SET_TILE_COLUMNS, xcfg.tile_columns); |
420 MAP(VP9E_SET_TILE_ROWS, xcfg.tile_rows); | 420 MAP(VP9E_SET_TILE_ROWS, xcfg.tile_rows); |
421 | 421 MAP(VP8E_SET_ARNR_MAXFRAMES, xcfg.arnr_max_frames); |
422 MAP(VP8E_SET_ARNR_MAXFRAMES, xcfg.arnr_max_frames); | 422 MAP(VP8E_SET_ARNR_STRENGTH, xcfg.arnr_strength); |
423 MAP(VP8E_SET_ARNR_STRENGTH, xcfg.arnr_strength); | 423 MAP(VP8E_SET_ARNR_TYPE, xcfg.arnr_type); |
424 MAP(VP8E_SET_ARNR_TYPE, xcfg.arnr_type); | 424 MAP(VP8E_SET_TUNING, xcfg.tuning); |
425 MAP(VP8E_SET_TUNING, xcfg.tuning); | 425 MAP(VP8E_SET_CQ_LEVEL, xcfg.cq_level); |
426 MAP(VP8E_SET_CQ_LEVEL, xcfg.cq_level); | 426 MAP(VP8E_SET_MAX_INTRA_BITRATE_PCT, xcfg.rc_max_intra_bitrate_pct); |
427 MAP(VP8E_SET_MAX_INTRA_BITRATE_PCT, xcfg.rc_max_intra_bitrate_pct); | 427 MAP(VP9E_SET_LOSSLESS, xcfg.lossless); |
428 MAP(VP9E_SET_LOSSLESS, xcfg.lossless); | |
429 MAP(VP9E_SET_FRAME_PARALLEL_DECODING, xcfg.frame_parallel_decoding_mode); | 428 MAP(VP9E_SET_FRAME_PARALLEL_DECODING, xcfg.frame_parallel_decoding_mode); |
430 } | 429 } |
431 | 430 |
432 res = validate_config(ctx, &ctx->cfg, &xcfg); | 431 res = validate_config(ctx, &ctx->cfg, &xcfg); |
433 | 432 |
434 if (!res) { | 433 if (!res) { |
435 ctx->vp8_cfg = xcfg; | 434 ctx->vp8_cfg = xcfg; |
436 set_vp9e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg); | 435 set_vp9e_config(&ctx->oxcf, ctx->cfg, ctx->vp8_cfg); |
437 vp9_change_config(ctx->cpi, &ctx->oxcf); | 436 vp9_change_config(ctx->cpi, &ctx->oxcf); |
438 } | 437 } |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 {VP8E_SET_CPUUSED, set_param}, | 1018 {VP8E_SET_CPUUSED, set_param}, |
1020 {VP8E_SET_NOISE_SENSITIVITY, set_param}, | 1019 {VP8E_SET_NOISE_SENSITIVITY, set_param}, |
1021 {VP8E_SET_ENABLEAUTOALTREF, set_param}, | 1020 {VP8E_SET_ENABLEAUTOALTREF, set_param}, |
1022 {VP8E_SET_SHARPNESS, set_param}, | 1021 {VP8E_SET_SHARPNESS, set_param}, |
1023 {VP8E_SET_STATIC_THRESHOLD, set_param}, | 1022 {VP8E_SET_STATIC_THRESHOLD, set_param}, |
1024 {VP9E_SET_TILE_COLUMNS, set_param}, | 1023 {VP9E_SET_TILE_COLUMNS, set_param}, |
1025 {VP9E_SET_TILE_ROWS, set_param}, | 1024 {VP9E_SET_TILE_ROWS, set_param}, |
1026 {VP8E_GET_LAST_QUANTIZER, get_param}, | 1025 {VP8E_GET_LAST_QUANTIZER, get_param}, |
1027 {VP8E_GET_LAST_QUANTIZER_64, get_param}, | 1026 {VP8E_GET_LAST_QUANTIZER_64, get_param}, |
1028 {VP8E_SET_ARNR_MAXFRAMES, set_param}, | 1027 {VP8E_SET_ARNR_MAXFRAMES, set_param}, |
1029 {VP8E_SET_ARNR_STRENGTH, set_param}, | 1028 {VP8E_SET_ARNR_STRENGTH, set_param}, |
1030 {VP8E_SET_ARNR_TYPE, set_param}, | 1029 {VP8E_SET_ARNR_TYPE, set_param}, |
1031 {VP8E_SET_TUNING, set_param}, | 1030 {VP8E_SET_TUNING, set_param}, |
1032 {VP8E_SET_CQ_LEVEL, set_param}, | 1031 {VP8E_SET_CQ_LEVEL, set_param}, |
1033 {VP8E_SET_MAX_INTRA_BITRATE_PCT, set_param}, | 1032 {VP8E_SET_MAX_INTRA_BITRATE_PCT, set_param}, |
1034 {VP9E_SET_LOSSLESS, set_param}, | 1033 {VP9E_SET_LOSSLESS, set_param}, |
1035 {VP9E_SET_FRAME_PARALLEL_DECODING, set_param}, | 1034 {VP9E_SET_FRAME_PARALLEL_DECODING, set_param}, |
1036 {VP9_GET_REFERENCE, get_reference}, | 1035 {VP9_GET_REFERENCE, get_reference}, |
1037 { -1, NULL}, | 1036 { -1, NULL}, |
1038 }; | 1037 }; |
1039 | 1038 |
1040 static vpx_codec_enc_cfg_map_t vp9e_usage_cfg_map[] = { | 1039 static vpx_codec_enc_cfg_map_t vp9e_usage_cfg_map[] = { |
1041 { | 1040 { |
1042 0, | 1041 0, |
1043 { | 1042 { |
1044 0, /* g_usage */ | 1043 0, /* g_usage */ |
1045 0, /* g_threads */ | 1044 0, /* g_threads */ |
1046 0, /* g_profile */ | 1045 0, /* g_profile */ |
1047 | 1046 |
1048 320, /* g_width */ | 1047 320, /* g_width */ |
1049 240, /* g_height */ | 1048 240, /* g_height */ |
1050 {1, 30}, /* g_timebase */ | 1049 {1, 30}, /* g_timebase */ |
1051 | 1050 |
1052 0, /* g_error_resilient */ | 1051 0, /* g_error_resilient */ |
1053 | 1052 |
1054 VPX_RC_ONE_PASS, /* g_pass */ | 1053 VPX_RC_ONE_PASS, /* g_pass */ |
1055 | 1054 |
1056 0, /* g_lag_in_frames */ | 1055 25, /* g_lag_in_frames */ |
1057 | 1056 |
1058 0, /* rc_dropframe_thresh */ | 1057 0, /* rc_dropframe_thresh */ |
1059 0, /* rc_resize_allowed */ | 1058 0, /* rc_resize_allowed */ |
1060 60, /* rc_resize_down_thresold */ | 1059 60, /* rc_resize_down_thresold */ |
1061 30, /* rc_resize_up_thresold */ | 1060 30, /* rc_resize_up_thresold */ |
1062 | 1061 |
1063 VPX_VBR, /* rc_end_usage */ | 1062 VPX_VBR, /* rc_end_usage */ |
1064 #if VPX_ENCODER_ABI_VERSION > (1 + VPX_CODEC_ABI_VERSION) | 1063 #if VPX_ENCODER_ABI_VERSION > (1 + VPX_CODEC_ABI_VERSION) |
1065 {0}, /* rc_twopass_stats_in */ | 1064 {0}, /* rc_twopass_stats_in */ |
1066 #endif | 1065 #endif |
1067 256, /* rc_target_bandwidth */ | 1066 256, /* rc_target_bandwidth */ |
1068 4, /* rc_min_quantizer */ | 1067 0, /* rc_min_quantizer */ |
1069 63, /* rc_max_quantizer */ | 1068 63, /* rc_max_quantizer */ |
1070 100, /* rc_undershoot_pct */ | 1069 100, /* rc_undershoot_pct */ |
1071 100, /* rc_overshoot_pct */ | 1070 100, /* rc_overshoot_pct */ |
1072 | 1071 |
1073 6000, /* rc_max_buffer_size */ | 1072 6000, /* rc_max_buffer_size */ |
1074 4000, /* rc_buffer_initial_size; */ | 1073 4000, /* rc_buffer_initial_size; */ |
1075 5000, /* rc_buffer_optimal_size; */ | 1074 5000, /* rc_buffer_optimal_size; */ |
1076 | 1075 |
1077 50, /* rc_two_pass_vbrbias */ | 1076 50, /* rc_two_pass_vbrbias */ |
1078 0, /* rc_two_pass_vbrmin_section */ | 1077 0, /* rc_two_pass_vbrmin_section */ |
1079 400, /* rc_two_pass_vbrmax_section */ | 1078 2000, /* rc_two_pass_vbrmax_section */ |
1080 | 1079 |
1081 /* keyframing settings (kf) */ | 1080 /* keyframing settings (kf) */ |
1082 VPX_KF_AUTO, /* g_kfmode*/ | 1081 VPX_KF_AUTO, /* g_kfmode*/ |
1083 0, /* kf_min_dist */ | 1082 0, /* kf_min_dist */ |
1084 9999, /* kf_max_dist */ | 1083 9999, /* kf_max_dist */ |
1085 | 1084 |
1086 #if VPX_ENCODER_ABI_VERSION == (1 + VPX_CODEC_ABI_VERSION) | 1085 #if VPX_ENCODER_ABI_VERSION == (1 + VPX_CODEC_ABI_VERSION) |
1087 1, /* g_delete_first_pass_file */ | 1086 1, /* g_delete_first_pass_file */ |
1088 "vp8.fpf" /* first pass filename */ | 1087 "vp8.fpf" /* first pass filename */ |
1089 #endif | 1088 #endif |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1145 { | 1144 { |
1146 vp9e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t peek_si; */ | 1145 vp9e_usage_cfg_map, /* vpx_codec_enc_cfg_map_t peek_si; */ |
1147 vp9e_encode, /* vpx_codec_encode_fn_t encode; */ | 1146 vp9e_encode, /* vpx_codec_encode_fn_t encode; */ |
1148 vp9e_get_cxdata, /* vpx_codec_get_cx_data_fn_t frame_get; */ | 1147 vp9e_get_cxdata, /* vpx_codec_get_cx_data_fn_t frame_get; */ |
1149 vp9e_set_config, | 1148 vp9e_set_config, |
1150 NOT_IMPLEMENTED, | 1149 NOT_IMPLEMENTED, |
1151 vp9e_get_preview, | 1150 vp9e_get_preview, |
1152 } /* encoder functions */ | 1151 } /* encoder functions */ |
1153 }; | 1152 }; |
1154 #endif | 1153 #endif |
OLD | NEW |