ref: 4bfa583c6e139198a9db83016fbd787648b70ef5
parent: dc3b508f573de77abe8ec15d0644d9ad87898699
author: Jerome Jiang <jianj@google.com>
date: Thu Mar 21 15:04:38 EDT 2019
fix redundant cast in examples. Change-Id: I84280de82053f9056bda9d813baa6165ca9bcd1e
--- a/examples/svc_encodeframe.c
+++ b/examples/svc_encodeframe.c
@@ -457,8 +457,7 @@
svc_log(svc_ctx, SVC_LOG_ERROR,
"spatial layers * temporal layers exceeds the maximum number of "
"allowed layers of %d\n",
- svc_ctx->spatial_layers * svc_ctx->temporal_layers,
- (int)VPX_MAX_LAYERS);
+ svc_ctx->spatial_layers * svc_ctx->temporal_layers, VPX_MAX_LAYERS);
return VPX_CODEC_INVALID_PARAM;
}
res = assign_layer_bitrates(svc_ctx, enc_cfg);
@@ -584,10 +583,10 @@
for (i = 0; i < svc_ctx->spatial_layers; ++i) {
svc_log(svc_ctx, SVC_LOG_INFO,
"Layer %d Average PSNR=[%2.3f, %2.3f, %2.3f, %2.3f], Bytes=[%u]\n",
- i, (double)si->psnr_sum[i][0] / number_of_frames,
- (double)si->psnr_sum[i][1] / number_of_frames,
- (double)si->psnr_sum[i][2] / number_of_frames,
- (double)si->psnr_sum[i][3] / number_of_frames, si->bytes_sum[i]);
+ i, si->psnr_sum[i][0] / number_of_frames,
+ si->psnr_sum[i][1] / number_of_frames,
+ si->psnr_sum[i][2] / number_of_frames,
+ si->psnr_sum[i][3] / number_of_frames, si->bytes_sum[i]);
// the following psnr calculation is deduced from ffmpeg.c#print_report
y_scale = si->width * si->height * 255.0 * 255.0 * number_of_frames;
scale[1] = y_scale;
--- a/examples/vp9_spatial_svc_encoder.c
+++ b/examples/vp9_spatial_svc_encoder.c
@@ -1125,7 +1125,7 @@
&ref_frame_config);
// Keep track of input frames, to account for frame drops in rate control
// stats/metrics.
- for (sl = 0; sl < (unsigned int)enc_cfg.ss_number_layers; ++sl) {
+ for (sl = 0; sl < enc_cfg.ss_number_layers; ++sl) {
++rc.layer_input_frames[sl * enc_cfg.ts_number_layers +
layer_id.temporal_layer_id];
}