From 065f6965a224efd59201d681dcdcf51f35429808 Mon Sep 17 00:00:00 2001 From: Jason Garrett-Glaser Date: Tue, 11 Jan 2011 11:04:52 -0800 Subject: [PATCH] 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. --- encoder/ratecontrol.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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) -- 2.47.3