ref: 9134e9f8bbb4e27684c2e48936c91b67797c79f9
parent: c0307e6cea0fcd79577eaa107f76b07acaf1d4e6
author: Ronald S. Bultje <[email protected]>
date: Mon Jan 18 09:03:45 EST 2016
Use input framerate as timebase if none was explicitly specified. After patch: $ vpxenc tennis_sif.y4m --end-usage=q -q 20 -o x.ivf --ivf --codec=vp9 --limit=30 $ ffmpeg -i x.ivf -i tennis_sif.y4m -lavfi psnr -f null - [..] [Parsed_psnr_0 @ 0x7f8913c21e40] PSNR y:43.270594 u:46.300362 v:47.011172 average:44.097994 min:43.460704 max:52.509271 Before patch: $ vpxenc tennis_sif.y4m --end-usage=q -q 20 -o x.ivf --ivf --codec=vp9 --limit=30 $ ffmpeg -i x.ivf -i tennis_sif.y4m -lavfi psnr -f null - [..] [Parsed_psnr_0 @ 0x7fbdaac22780] PSNR y:27.427366 u:41.505376 v:36.853477 average:28.990890 min:22.219454 max:52.509271 $ ffmpeg -i x.ivf -f rawvideo x.yuv $ ffmpeg -f rawvideo -vcodec rawvideo -video_size 352x240 -framerate 29.97 -i x.yuv -i tennis_sif.y4m -lavfi psnr -f null - [..] [Parsed_psnr_0 @ 0x7fadf9e013a0] PSNR y:43.270594 u:46.300362 v:47.011172 average:44.097994 min:43.460704 max:52.509271 Change-Id: Ifac2d6c2ff8379b2d318fe5cfe4be0bf1bc9f27f
--- a/vpxenc.c
+++ b/vpxenc.c
@@ -2074,6 +2074,8 @@
if (!global.have_framerate) {
global.framerate.num = input.framerate.numerator;
global.framerate.den = input.framerate.denominator;
+ FOREACH_STREAM(stream->config.cfg.g_timebase.den = global.framerate.num;
+ stream->config.cfg.g_timebase.num = global.framerate.den);
}
FOREACH_STREAM(set_default_kf_interval(stream, &global));