[x264-devel] Double the base framerate for frame-sequential 3D files

Jason Garrett-Glaser git at videolan.org
Wed Jan 26 02:56:57 CET 2011


x264 | branch: master | Jason Garrett-Glaser <darkshikari at gmail.com> | Tue Jan 11 11:04:52 2011 -0800| [065f6965a224efd59201d681dcdcf51f35429808] | committer: Jason Garrett-Glaser

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.

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=065f6965a224efd59201d681dcdcf51f35429808
---

 encoder/ratecontrol.h |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/encoder/ratecontrol.h b/encoder/ratecontrol.h
index abd72d1..f5aa9a8 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)
 



More information about the x264-devel mailing list