[x264-devel] commit: Blu-ray support: NAL-HRD, VFR ratecontrol, filler, pulldown ( Kieran Kunhya )

git at videolan.org git at videolan.org
Sun Mar 28 04:44:19 CEST 2010


x264 | branch: master | Kieran Kunhya <kieran at kunhya.com> | Tue Mar  2 00:57:10 2010 -0800| [c6de86497cdd7b7f3cce7d8a95d723c7d0c9f505] | committer: Jason Garrett-Glaser 

Blu-ray support: NAL-HRD, VFR ratecontrol, filler, pulldown
x264 can now generate Blu-ray-compliant streams for authoring Blu-ray Discs!
Compliance tested using Sony BD-ROM Verifier 1.21.
Thanks to The Criterion Collection for sponsoring compliance testing!

An example command, using constant quality mode, for 1080p24 content:
x264 --crf 16 --preset veryslow --tune film --weightp 0 --bframes 3 --nal-hrd vbr --vbv-maxrate 40000 --vbv-bufsize 30000 --level 4.1 --keyint 24 --b-pyramid strict --slices 4 --aud --colorprim "bt709" --transfer "bt709" --colormatrix "bt709" --sar 1:1 <input> -o <output>

This command is much more complicated than usual due to the very complicated restrictions the Blu-ray spec has.
Most options after "tune" are required by the spec.
--weightp 0 is not, but there are known bugged Blu-ray player chipsets (Mediatek, notably) that will decode video with --weightp 1 or 2 incorrectly.
Furthermore, note the Blu-ray spec has very strict limitations on allowed resolution/fps combinations.
Examples include 1080p @ 24000/1001fps (NTSC FILM) and 720p @ 60000/1001fps.

Detailed features introduced in this patch:

Full NAL-HRD compliance, with both VBR (no filler) and CBR (filler) modes.
Can be enabled with --nal-hrd vbr/cbr.
libx264 now returns HRD timing information to the caller in the form of an x264_hrd_t.
x264cli doesn't currently use it, but this information is critical for compliant TS muxing.

Full VFR ratecontrol support: VBV, 1-pass ABR, and 2-pass modes.
This means that, even without knowing the average framerate, x264 can achieve a correct bitrate in target bitrate modes.
Note that this changes the statsfile format; first pass encodes make before this patch will have to be re-run.

Pulldown support: libx264 allows the calling application to specify a pulldown mode for each frame.
This is similar to the way that RFFs (Repeat Field Flags) work in MPEG-2.
Note that libx264 does not modify timestamps: it assumes the calling application has set timestamps correctly for pulldown!
x264cli contains an example implementation of caller-side pulldown code.

Pic_struct support: necessary for pulldown and allows interlaced signalling.
Also signal TFF vs BFF with delta_poc_bottom: should significantly improve interlaced compression.
--tff and --bff should be preferred to the old --interlaced in order to tell x264 what field order to use.

Huge thanks to Alex Giladi and Lamont Alston for their work on code that eventually became part of this patch.

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

 common/common.c       |   22 ++++-
 common/common.h       |   31 ++++++-
 common/frame.c        |   10 ++
 common/frame.h        |   12 +++
 common/osdep.h        |   13 +++
 common/set.h          |   21 ++++
 encoder/encoder.c     |  220 +++++++++++++++++++++++++++++++++++---------
 encoder/ratecontrol.c |  245 +++++++++++++++++++++++++++++++++++++++++--------
 encoder/ratecontrol.h |    4 +-
 encoder/set.c         |  136 ++++++++++++++++++++++++---
 encoder/set.h         |    3 +
 encoder/slicetype.c   |  112 ++++++++++++++++++++++-
 input/avs.c           |    1 +
 output/flv.c          |   12 +-
 output/matroska.c     |   12 +-
 output/mp4.c          |   12 +-
 x264.c                |  108 ++++++++++++++++++++--
 x264.h                |   63 ++++++++++++-
 18 files changed, 901 insertions(+), 136 deletions(-)

Diff:   http://git.videolan.org/gitweb.cgi/x264.git/?a=commitdiff;h=c6de86497cdd7b7f3cce7d8a95d723c7d0c9f505


More information about the x264-devel mailing list