summaryrefslogtreecommitdiff
path: root/examples/vpx_temporal_scalable_patterns.c
diff options
context:
space:
mode:
authorMarco Paniconi <marpan@google.com>2014-02-26 14:00:43 -0800
committerMarco Paniconi <marpan@google.com>2014-02-26 14:30:09 -0800
commitd32e000ae0e76e05522af79246d0f67db1a5da83 (patch)
treed25ea39e99499c287a96a81671dc0729512c9a14 /examples/vpx_temporal_scalable_patterns.c
parent08f250f56559950b9f204c5e0665a55368535245 (diff)
downloadlibvpx-d32e000ae0e76e05522af79246d0f67db1a5da83.tar
libvpx-d32e000ae0e76e05522af79246d0f67db1a5da83.tar.gz
libvpx-d32e000ae0e76e05522af79246d0f67db1a5da83.tar.bz2
libvpx-d32e000ae0e76e05522af79246d0f67db1a5da83.zip
Update some comments in vpx_temporal_scalable_patterns.
Change-Id: I747d26c544cc56feaaf7c75403f2f4c16a496bb7
Diffstat (limited to 'examples/vpx_temporal_scalable_patterns.c')
-rw-r--r--examples/vpx_temporal_scalable_patterns.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/examples/vpx_temporal_scalable_patterns.c b/examples/vpx_temporal_scalable_patterns.c
index 29a266d29..6ec1b6208 100644
--- a/examples/vpx_temporal_scalable_patterns.c
+++ b/examples/vpx_temporal_scalable_patterns.c
@@ -52,6 +52,12 @@ struct RateControlMetrics {
double layer_encoding_bitrate[VPX_TS_MAX_LAYERS];
};
+// Note: these rate control metrics assume only 1 key frame in the
+// sequence (i.e., first frame only). So for temporal pattern# 7
+// (which has key frame for every frame on base layer), the metrics
+// computation will be off/wrong.
+// TODO(marpan): Update these metrics to account for multiple key frames
+// in the stream.
static void set_rate_control_metrics(struct RateControlMetrics *rc,
vpx_codec_enc_cfg_t *cfg) {
unsigned int i = 0;
@@ -565,6 +571,9 @@ int main(int argc, char **argv) {
}
vpx_codec_control(&codec, VP8E_SET_STATIC_THRESHOLD, 1);
vpx_codec_control(&codec, VP8E_SET_TOKEN_PARTITIONS, 1);
+ // This controls the maximum target size of the key frame.
+ // For generating smaller key frames, use a smaller max_intra_size_pct
+ // value, like 100 or 200.
max_intra_size_pct = (int) (((double)cfg.rc_buf_optimal_sz * 0.5)
* ((double) cfg.g_timebase.den / cfg.g_timebase.num) / 10.0);
vpx_codec_control(&codec, VP8E_SET_MAX_INTRA_BITRATE_PCT, max_intra_size_pct);