]> git.videolan.org Git - x264.git/commitdiff
Double the base framerate for frame-sequential 3D files
authorJason Garrett-Glaser <darkshikari@gmail.com>
Tue, 11 Jan 2011 19:04:52 +0000 (11:04 -0800)
committerJason Garrett-Glaser <jason@x264.com>
Tue, 25 Jan 2011 20:16:34 +0000 (12:16 -0800)
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

index abd72d1e83619eec76a92b3360de60c6a4fe2ac7..f5aa9a83fe029073544dabcd0d5e7582b68970c7 100644 (file)
 #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)