1. 02 Jun, 2010 2 commits
  2. 31 May, 2010 1 commit
  3. 26 May, 2010 1 commit
  4. 18 May, 2010 1 commit
  5. 06 May, 2010 3 commits
    • Fiona Glaser's avatar
      Don't force row QPs to integer values with VBV · 9ce27834
      Fiona Glaser authored
      VBV should no longer raise the bitrate of the video.  That is, at a given quality level or average bitrate, turning on VBV should only lower the bitrate.
      This isn't quite true if adaptive quant is off, but nobody should be doing that anyways.
      Also may result in slightly more accurate per-row VBV ratecontrol.
    • Fiona Glaser's avatar
      Deduplicate asm constants, automate name prefixing · 311c4bb1
      Fiona Glaser authored
      Auto-prefix global constants with x264_ in cextern.
      Eliminate x264_ prefix from asm files; automate it in cglobal.
      Deduplicate asm constants wherever possible to save data cache (move them to a new const-a.asm).
      Remove x264_emms() entirely on non-x86 (don't even call an empty function).
      Add cextern_naked for a non-prefixed cextern (used in checkasm).
    • Fiona Glaser's avatar
      Make options SEI use weight* instead of wpred* · c490e416
      Fiona Glaser authored
      More intuitive and maps more reasonably to the CLI options.
      Breaks statsfile backwards-compatibility.
  6. 23 Apr, 2010 2 commits
    • Fiona Glaser's avatar
      Remove reordering restrictions from weightp · 564cfb8a
      Fiona Glaser authored
      Apparently the spec does allow two consecutive copies of the same frame in the reference list.
      This involves an incredibly ugly hack to wrap around the frame number.
      Very slight compression improvement.
    • Fiona Glaser's avatar
      Fix issues with extremely large timebases · d48c3809
      Fiona Glaser authored
      With timebase denominators >= 2^30 , x264 would silently overflow and cause odd issues.
      Now x264 will explicitly fail with timebase denominators >= 2^31 and work with timebase denominators 2^31 > x >= 2^30.
  7. 06 Apr, 2010 1 commit
    • Kieran Kunhya's avatar
      Fix HRD compliance · e9726b63
      Kieran Kunhya authored
      As usual, the spec is so insanely obfuscated that it's impossible to get things right the first time.
  8. 05 Apr, 2010 1 commit
    • Fiona Glaser's avatar
      Massive cosmetic and syntax cleanup · 58d2349d
      Fiona Glaser authored
      Convert all applicable loops to use C99 loop index syntax.
      Clean up most inconsistent syntax in ratecontrol.c, visualize, ppc, etc.
      Replace log(x)/log(2) constructs with log2, and similar with log10.
      Fix all -Wshadow violations.
      Fix visualize support.
  9. 27 Mar, 2010 2 commits
    • Fiona Glaser's avatar
      "CRF-max" support with VBV · 7ff23daa
      Fiona Glaser authored
      This is a rather curious feature that may have more use than is initially obvious.
      In CRF mode with VBV enabled, CRF-max allows the user to specify a quality level which the encoder will never go below, even due to the effects of VBV.
      This is not the same as qpmax, which is not aware of issues like scene complexity.
      Setting this WILL cause VBV underflows in any situation where the encoder would have needed to exceed the relevant CRF to avoid underflow.
      Why might one want to do this even if it would cause VBV underflows?
      In the case of streaming, particularly ultra-low-latency streaming, it may be preferable to drop frames than to display frames that are of too low a quality.
      Thus, in extremely complex scenes, rather than display completely awful video, the streaming server could simply drop to a lower framerate.
      Scenecuts, which normally look terrible under situations like single-frame VBV, could be handled by just displaying them a bit later and dropping frames to compensate.
      In other words, it's better to see the scenecut 150ms delayed than for it to look like a blocky mess for 150ms.
      On the caller-side, this would be handled by detecting the output size of x264's frames and dropping future frames to compensate if necessary.
      This can also be used in normal encoding simply to ensure that VBV does not hurt quality too much (at the cost of potentially causing underflows).
      This can help quite a lot when using single-frame VBV and sliced threads, where VBV can often be somewhat unstable.
    • Kieran Kunhya's avatar
      Blu-ray support: NAL-HRD, VFR ratecontrol, filler, pulldown · bb9b16b4
      Kieran Kunhya authored
      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.
  10. 25 Feb, 2010 1 commit
    • Fiona Glaser's avatar
      Fix one bug, one corner case in VBV · 89aa4e87
      Fiona Glaser authored
      qp_novbv wasn't set correctly for B-frames.
      Disable ABR code for frames with zero complexity.
      Disable ABR code for CBR mode; it is completely unnecessary and can have negative consequences.
  11. 23 Feb, 2010 2 commits
  12. 16 Feb, 2010 1 commit
  13. 15 Feb, 2010 3 commits
    • Fiona Glaser's avatar
      Make the ABR buffer consider the distance to the end of the video · fc94a283
      Fiona Glaser authored
      Should improve bitrate accuracy in 2-pass mode.
      May also slightly improve quality by allowing more variation earlier-on in a file.
      Also fix abr_buffer with 1-pass: it does something very different than what it does for 2-pass.
      Thus, the earlier change that increased it based on threads caused 1-pass ABR to be somewhat less accurate.
    • Fiona Glaser's avatar
      Overhaul sliced-threads VBV · 282bbbc5
      Fiona Glaser authored
      Make predictors thread-local and allow each thread to poll the others to get their predicted sizes.
      Many, many other tweaks to improve quality with small VBV and sliced threads.
      Note this may somewhat increase the risk of a VBV underflow in such extreme situations (single-frame VBV).
      This is tolerable, as most relevant use-cases are better off with a few rare underflows (even if they have to drop a slice) than consistent low quality.
    • Fiona Glaser's avatar
      Fix 2-pass ratecontrol continuation in case of missing statsfile · 46819d56
      Fiona Glaser authored
      Didn't work properly if MB-tree was enabled.
  14. 14 Feb, 2010 1 commit
    • Fiona Glaser's avatar
      Add ability to adjust ratecontrol parameters on the fly · 34c42187
      Fiona Glaser authored
      encoder_reconfig and x264_picture_t->param can now be used to change ratecontrol parameters.
      This is extraordinarily useful in certain streaming situations where the encoder needs to adapt the bitrate to network circumstances.
      What can be changed:
      1) CRF can be adjusted if in CRF mode.
      2) VBV maxrate and bufsize can be adjusted if in VBV mode.
      3) Bitrate can be adjusted if in CBR mode.
      However, x264 cannot switch between modes and cannot change bitrate in ABR mode.
      Also fix a bug where x264_picture_t->param reconfig method would not always be frame-exact.
      Commit sponsored by SayMama video calling.
  15. 30 Jan, 2010 3 commits
  16. 14 Jan, 2010 1 commit
    • Fiona Glaser's avatar
      Periodic intra refresh · cde39046
      Fiona Glaser authored
      Uses SEI recovery points, a moving vertical "bar" of intra blocks, and motion vector restrictions to eliminate keyframes.
      Attempt to hide the visual appearance of the intra bar when --no-psy isn't set.
      Enabled with --intra-refresh.
      The refresh interval is controlled using keyint, but won't exceed the number of macroblock columns in the frame.
      Greatly benefits low-latency streaming by making it possible to achieve constant framesize without intra-only encoding.
      Combined with slice-max size for one slice per packet, tests suggest effective resiliance against packet loss as high as 25%.
      x264 is now the best free software low-latency video encoder in the world.
      Accordingly, change the API to add b_keyframe to the parameters present in output pictures.
      Calling applications should check this to see if a frame is seekable, not the frame type.
      Also make x264's motion estimation strictly abide by horizontal MV range limits in order for PIR to work.
      Also fix a major bug in sliced-threads VBV handling.
      Also change "auto" threads for sliced threads to "cores" instead of "1.5*cores" after performance testing.
      Also simplify ratecontrol's checking of first pass options.
      Also some minor tweaks to row-based VBV that should improve VBV accuracy on small frames.
  17. 15 Dec, 2009 1 commit
    • Fiona Glaser's avatar
      Fix two bugs in 2-pass ratecontrol · f30aed6d
      Fiona Glaser authored
      last_qscale_for wasn't set during the 2pass init code.
      abr_buffer was way too small in the case of multiple threads, so accordingly increase its buffer size based on the number of threads.
      May significantly increase quality with many threads in 2-pass mode, especially in cases with extremely large I-frames, such as anime.
  18. 11 Dec, 2009 1 commit
    • Steven Walters's avatar
      Fix zone parsing on mingw · e09a20eb
      Steven Walters authored
      Due to MinGW evidently being in the hands of a pack of phenomenal idiots, MinGW does not have strtok_r, a basic string function.
      As such, remove the dependency on strtok_r in zone parsing.
      Previously, using zones for anything other than ratecontrol failed.
  19. 09 Dec, 2009 2 commits
    • Fiona Glaser's avatar
      Add support for MB-tree + B-pyramid · c186d2ac
      Fiona Glaser authored
      Modify B-adapt 2 to consider pyramid in its calculations.
      Generally results in many more B-frames being used when pyramid is on.
      Modify MB-tree statsfile reading to handle the reordering necessary.
      Make differing keyint or pyramid between passes into a fatal error.
    • Fiona Glaser's avatar
      Bring back slice-based threading support · 6f221210
      Fiona Glaser authored
      Enabled with --sliced-threads
      Unlike normal threading, adds no encoding latency.
      Less efficient than normal threading, both performance and compression-wise.
      Useful for low-latency encoding environments where performance is still important, such as HD videoconferencing.
      Add --tune zerolatency, which eliminates all x264 encoder-side latency (no delayed frames at all).
      Some tweaks to VBV ratecontrol and lookahead (in addition to those required by sliced threading).
      Commit sponsored by a media streaming company that wishes to remain anonymous.
  20. 22 Nov, 2009 1 commit
  21. 17 Nov, 2009 1 commit
    • Fiona Glaser's avatar
      Faster weightp analysis · 63f71477
      Fiona Glaser authored
      Modify pixel_var slightly to return the necessary information and use it for weight analysis instead of sad/ssd.
      Various minor cosmetics.
  22. 12 Nov, 2009 1 commit
    • Dylan Yudaken's avatar
      Various weightp fixes · 45b28315
      Dylan Yudaken authored
      Make weightp results match in threaded vs non-threaded mode.
      Fix two-pass with slow-firstpass.
  23. 09 Nov, 2009 4 commits
    • Steven Walters's avatar
      Fix weightp logfile parsing on MinGW · b3052970
      Steven Walters authored
    • Dylan Yudaken's avatar
      Weighted P-frame prediction · ccac8546
      Dylan Yudaken authored
      Merge Dylan's Google Summer of Code 2009 tree.
      Detect fades and use weighted prediction to improve compression and quality.
      "Blind" mode provides a small overall quality increase by using a -1 offset without doing any analysis, as described in JVT-AB033.
      "Smart", the default mode, also performs fade detection and decides weights accordingly.
      MB-tree takes into account the effects of "smart" analysis in lookahead, even further improving quality in fades.
      If psy is on, mbtree is on, interlaced is off, and weightp is off, fade detection will still be performed.
      However, it will be used to adjust quality instead of create actual weights.
      This will improve quality in fades when encoding in Baseline profile.
      Doesn't add support for interlaced encoding with weightp yet.
      Only adds support for luma weights, not chroma weights.
      Internal code for chroma weights is in, but there's no analysis yet.
      Baseline profile requires that weightp be off.
      All weightp modes may cause minor breakage in non-compliant decoders that take shortcuts in deblocking reference frame checks.
      "Smart" may cause serious breakage in non-compliant decoders that take shortcuts in handling of duplicate reference frames.
      Thanks to Google for sponsoring our most successful Summer of Code yet!
    • Steven Walters's avatar
    • Fiona Glaser's avatar
      Fix extremely rare infinite loop in 2-pass VBV · d2e7a5a6
      Fiona Glaser authored
      Implicit conversion from double->float lost enough precision to cause the loop termination condition to never trigger.
      Bug report by Tal Aloni.
  24. 29 Oct, 2009 1 commit
  25. 25 Oct, 2009 1 commit
  26. 19 Oct, 2009 1 commit