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 24 matching lines...) Expand all Loading... |
35 unsigned int cq_level; // constrained quality level | 35 unsigned int cq_level; // constrained quality level |
36 unsigned int rc_max_intra_bitrate_pct; | 36 unsigned int rc_max_intra_bitrate_pct; |
37 unsigned int lossless; | 37 unsigned int lossless; |
38 unsigned int frame_parallel_decoding_mode; | 38 unsigned int frame_parallel_decoding_mode; |
39 AQ_MODE aq_mode; | 39 AQ_MODE aq_mode; |
40 unsigned int frame_periodic_boost; | 40 unsigned int frame_periodic_boost; |
41 BIT_DEPTH bit_depth; | 41 BIT_DEPTH bit_depth; |
42 }; | 42 }; |
43 | 43 |
44 struct extraconfig_map { | 44 struct extraconfig_map { |
45 int usage; | 45 unsigned int usage; |
46 struct vp9_extracfg cfg; | 46 struct vp9_extracfg cfg; |
47 }; | 47 }; |
48 | 48 |
49 static const struct extraconfig_map extracfg_map[] = { | 49 static const struct extraconfig_map extracfg_map[] = { |
50 { | 50 { |
51 0, | 51 0, |
52 { // NOLINT | 52 { // NOLINT |
53 NULL, | 53 NULL, |
54 0, // cpu_used | 54 0, // cpu_used |
55 1, // enable_auto_alt_ref | 55 1, // enable_auto_alt_ref |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 if (n_packets_per_layer[i] < 2) { | 238 if (n_packets_per_layer[i] < 2) { |
239 ERROR("rc_twopass_stats_in requires at least two packets for each " | 239 ERROR("rc_twopass_stats_in requires at least two packets for each " |
240 "layer."); | 240 "layer."); |
241 } | 241 } |
242 | 242 |
243 stats = (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + | 243 stats = (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + |
244 n_packets - cfg->ss_number_layers + i; | 244 n_packets - cfg->ss_number_layers + i; |
245 layer_id = (int)stats->spatial_layer_id; | 245 layer_id = (int)stats->spatial_layer_id; |
246 | 246 |
247 if (layer_id >= cfg->ss_number_layers | 247 if (layer_id >= cfg->ss_number_layers |
248 ||(int)(stats->count + 0.5) != n_packets_per_layer[layer_id] - 1) | 248 ||(unsigned int)(stats->count + 0.5) != |
| 249 n_packets_per_layer[layer_id] - 1) |
249 ERROR("rc_twopass_stats_in missing EOS stats packet"); | 250 ERROR("rc_twopass_stats_in missing EOS stats packet"); |
250 } | 251 } |
251 } else { | 252 } else { |
252 if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz) | 253 if (cfg->rc_twopass_stats_in.sz < 2 * packet_sz) |
253 ERROR("rc_twopass_stats_in requires at least two packets."); | 254 ERROR("rc_twopass_stats_in requires at least two packets."); |
254 | 255 |
255 stats = | 256 stats = |
256 (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + n_packets - 1; | 257 (const FIRSTPASS_STATS *)cfg->rc_twopass_stats_in.buf + n_packets - 1; |
257 | 258 |
258 if ((int)(stats->count + 0.5) != n_packets - 1) | 259 if ((int)(stats->count + 0.5) != n_packets - 1) |
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 ctx->pending_cx_data = cx_data; | 817 ctx->pending_cx_data = cx_data; |
817 ctx->pending_cx_data_sz += size; | 818 ctx->pending_cx_data_sz += size; |
818 ctx->pending_frame_sizes[ctx->pending_frame_count++] = size; | 819 ctx->pending_frame_sizes[ctx->pending_frame_count++] = size; |
819 ctx->pending_frame_magnitude |= size; | 820 ctx->pending_frame_magnitude |= size; |
820 cx_data += size; | 821 cx_data += size; |
821 cx_data_sz -= size; | 822 cx_data_sz -= size; |
822 continue; | 823 continue; |
823 } | 824 } |
824 | 825 |
825 // Add the frame packet to the list of returned packets. | 826 // Add the frame packet to the list of returned packets. |
826 round = (vpx_codec_pts_t)1000000 * ctx->cfg.g_timebase.num / 2 - 1; | 827 round = (vpx_codec_pts_t)10000000 * ctx->cfg.g_timebase.num / 2 - 1; |
827 delta = (dst_end_time_stamp - dst_time_stamp); | 828 delta = (dst_end_time_stamp - dst_time_stamp); |
828 pkt.kind = VPX_CODEC_CX_FRAME_PKT; | 829 pkt.kind = VPX_CODEC_CX_FRAME_PKT; |
829 pkt.data.frame.pts = | 830 pkt.data.frame.pts = |
830 (dst_time_stamp * ctx->cfg.g_timebase.den + round) | 831 (dst_time_stamp * ctx->cfg.g_timebase.den + round) |
831 / ctx->cfg.g_timebase.num / 10000000; | 832 / ctx->cfg.g_timebase.num / 10000000; |
832 pkt.data.frame.duration = (unsigned long) | 833 pkt.data.frame.duration = (unsigned long) |
833 ((delta * ctx->cfg.g_timebase.den + round) | 834 ((delta * ctx->cfg.g_timebase.den + round) |
834 / ctx->cfg.g_timebase.num / 10000000); | 835 / ctx->cfg.g_timebase.num / 10000000); |
835 pkt.data.frame.flags = lib_flags << 16; | 836 pkt.data.frame.flags = lib_flags << 16; |
836 | 837 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 // TODO(yaowu): Need to re-implement and test for VP9. | 997 // TODO(yaowu): Need to re-implement and test for VP9. |
997 return VPX_CODEC_INVALID_PARAM; | 998 return VPX_CODEC_INVALID_PARAM; |
998 } | 999 } |
999 | 1000 |
1000 | 1001 |
1001 static vpx_codec_err_t ctrl_set_active_map(vpx_codec_alg_priv_t *ctx, | 1002 static vpx_codec_err_t ctrl_set_active_map(vpx_codec_alg_priv_t *ctx, |
1002 int ctr_id, va_list args) { | 1003 int ctr_id, va_list args) { |
1003 vpx_active_map_t *const map = va_arg(args, vpx_active_map_t *); | 1004 vpx_active_map_t *const map = va_arg(args, vpx_active_map_t *); |
1004 | 1005 |
1005 if (map) { | 1006 if (map) { |
1006 if (!vp9_set_active_map(ctx->cpi, map->active_map, map->rows, map->cols)) | 1007 if (!vp9_set_active_map(ctx->cpi, map->active_map, |
| 1008 (int)map->rows, (int)map->cols)) |
1007 return VPX_CODEC_OK; | 1009 return VPX_CODEC_OK; |
1008 else | 1010 else |
1009 return VPX_CODEC_INVALID_PARAM; | 1011 return VPX_CODEC_INVALID_PARAM; |
1010 } else { | 1012 } else { |
1011 return VPX_CODEC_INVALID_PARAM; | 1013 return VPX_CODEC_INVALID_PARAM; |
1012 } | 1014 } |
1013 } | 1015 } |
1014 | 1016 |
1015 static vpx_codec_err_t ctrl_set_scale_mode(vpx_codec_alg_priv_t *ctx, | 1017 static vpx_codec_err_t ctrl_set_scale_mode(vpx_codec_alg_priv_t *ctx, |
1016 int ctr_id, va_list args) { | 1018 int ctr_id, va_list args) { |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 { // NOLINT | 1218 { // NOLINT |
1217 encoder_usage_cfg_map, // vpx_codec_enc_cfg_map_t | 1219 encoder_usage_cfg_map, // vpx_codec_enc_cfg_map_t |
1218 encoder_encode, // vpx_codec_encode_fn_t | 1220 encoder_encode, // vpx_codec_encode_fn_t |
1219 encoder_get_cxdata, // vpx_codec_get_cx_data_fn_t | 1221 encoder_get_cxdata, // vpx_codec_get_cx_data_fn_t |
1220 encoder_set_config, // vpx_codec_enc_config_set_fn_t | 1222 encoder_set_config, // vpx_codec_enc_config_set_fn_t |
1221 NOT_IMPLEMENTED, // vpx_codec_get_global_headers_fn_t | 1223 NOT_IMPLEMENTED, // vpx_codec_get_global_headers_fn_t |
1222 encoder_get_preview, // vpx_codec_get_preview_frame_fn_t | 1224 encoder_get_preview, // vpx_codec_get_preview_frame_fn_t |
1223 NOT_IMPLEMENTED , // vpx_codec_enc_mr_get_mem_loc_fn_t | 1225 NOT_IMPLEMENTED , // vpx_codec_enc_mr_get_mem_loc_fn_t |
1224 } | 1226 } |
1225 }; | 1227 }; |
OLD | NEW |