From: Jason Garrett-Glaser Date: Tue, 11 Jan 2011 19:04:52 +0000 (-0800) Subject: Double the base framerate for frame-sequential 3D files X-Git-Url: http://www.zmx.ovh/git.videolan.org/?a=commitdiff_plain;h=065f6965a224efd59201d681dcdcf51f35429808;p=x264.git Double the base framerate for frame-sequential 3D files A 60fps frame-sequential 3D file is really only 30 FPS, just alternating between eyes. Accordingly, ratecontrol should treat it as if it was really 30 FPS. This will increase the bitrate at the same CRF level for such videos when --frame-packing 5 is used. --- diff --git a/encoder/ratecontrol.h b/encoder/ratecontrol.h index abd72d1e..f5aa9a83 100644 --- a/encoder/ratecontrol.h +++ b/encoder/ratecontrol.h @@ -28,12 +28,14 @@ #define X264_RATECONTROL_H /* Completely arbitrary. Ratecontrol lowers relative quality at higher framerates - * and the reverse at lower framerates; this serves as the center of the curve. */ -#define BASE_FRAME_DURATION (0.04f) + * and the reverse at lower framerates; this serves as the center of the curve. + * Halve all the values for frame-packed 3D to compensate for the "doubled" + * framerate. */ +#define BASE_FRAME_DURATION (0.04f / ((h->param.i_frame_packing == 5)+1)) /* Arbitrary limitations as a sanity check. */ -#define MAX_FRAME_DURATION 1.00f -#define MIN_FRAME_DURATION 0.01f +#define MAX_FRAME_DURATION (1.00f / ((h->param.i_frame_packing == 5)+1)) +#define MIN_FRAME_DURATION (0.01f / ((h->param.i_frame_packing == 5)+1)) #define CLIP_DURATION(f) x264_clip3f(f,MIN_FRAME_DURATION,MAX_FRAME_DURATION)