1. 30 Jan, 2010 2 commits
    • Loren Merritt's avatar
      Fix log2f detection, include order, some gcc warnings · 202938b1
      Loren Merritt authored
      r1413 caused crashes on any system with malloc.h.
      Also switch to std=c99 or std=gnu99 if supported by the compiler.
      Fix visualize support.
      202938b1
    • Yusuke Nakamura's avatar
      Improve DTS generation, move DTS compression into libx264 · afc36d0b
      Yusuke Nakamura authored
      This change fixes some cases in which PTS could be less than DTS.
      
      Additionally, a new parameter, b_dts_compress, enables DTS compression.
      DTS compression eliminates negative DTS (i.e. initial delay) due to B-frames.
      The algorithm changes timebase in order to avoid duplicating DTS.
      Currently, in x264cli, only the FLV muxer uses it.  The MP4 muxer doesn't need it, as it uses an EditBox instead.
      afc36d0b
  2. 14 Jan, 2010 2 commits
    • 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.
      cde39046
    • Kieran Kunhya's avatar
      LAVF/FFMS input support, native VFR timestamp handling · 30d76a5e
      Kieran Kunhya authored
      libx264 now takes three new API parameters.
      b_vfr_input tells x264 whether or not the input is VFR, and is 1 by default.
      i_timebase_num and i_timebase_den pass the timebase to x264.
      
      x264_picture_t now returns the DTS of each frame: the calling app need not calculate it anymore.
      
      Add libavformat and FFMS2 input support: requires libav* and ffms2 libraries respectively.
      FFMS2 is _STRONGLY_ preferred over libavformat: we encourage all distributions to compile with FFMS2 support if at all possible.
      FFMS2 can be found at http://code.google.com/p/ffmpegsource/.
      --index, a new x264cli option, allows the user to store (or load) an FFMS2 index file for future use, to avoid re-indexing in the future.
      
      Overhaul the muxers to pass through timestamps instead of assuming CFR.
      Also overhaul muxers to correctly use b_annexb and b_repeat_headers to simplify the code.
      Remove VFW input support, since it's now pretty much redundant with native AVS support and LAVF support.
      Finally, overhaul a large part of the x264cli internals.
      
      --force-cfr, a new x264cli option, allows the user to force the old method of timestamp handling.  May be useful in case of a source with broken timestamps.
      Avisynth, YUV, and Y4M input are all still CFR.  LAVF or FFMS2 must be used for VFR support.
      
      Do note that this patch does *not* add VFR ratecontrol yet.
      Support for telecined input is also somewhat dubious at the moment.
      
      Large parts of this patch by Mike Gurlitz <mike.gurlitz@gmail.com>, Steven Walters <kemuri9@gmail.com>, and Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>.
      30d76a5e
  3. 09 Dec, 2009 2 commits
    • Fiona Glaser's avatar
      Add fast pskip to x264 SEI info header · c0e6a945
      Fiona Glaser authored
      c0e6a945
    • 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.
      6f221210
  4. 09 Nov, 2009 1 commit
    • 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!
      ccac8546
  5. 19 Oct, 2009 1 commit
    • Lamont Alston's avatar
      Make B-pyramid spec-compliant · cf5ba813
      Lamont Alston authored
      The rules of the specification with regard to picture buffering for pyramid coding are widely ignored.
      x264's b-pyramid implementation, despite being practically identical to that proposed by the original paper, was technically not compliant.
      Now it is.
      Two modes are now available:
      1) strict b-pyramid, while worse for compression, follows the rule mandated by Blu-ray (no P-frames can reference B-frames)
      2) normal b-pyramid, which is like the old mode except fully compliant.
      This patch also adds MMCO support (necessary for compliant pyramid in some cases).
      MB-tree still doesn't support b-pyramid (but will soon).
      cf5ba813
  6. 07 Oct, 2009 1 commit
    • Fiona Glaser's avatar
      Constrained intra prediction support · 7639d496
      Fiona Glaser authored
      Enable with --constrained-intra.  Significantly reduces compression, but required for the base layer of SVC encodes and maybe some other use-cases.
      
      Commit sponsored by a media streaming company that wishes to remain anonymous.
      7639d496
  7. 21 Sep, 2009 1 commit
    • Fiona Glaser's avatar
      Major API change: encapsulate NALs within libx264 · 7a0fbed7
      Fiona Glaser authored
      libx264 now returns NAL units instead of raw data.  x264_nal_encode is no longer a public function.
      See x264.h for full documentation of changes.
      New parameter: b_annexb, on by default.  If disabled, startcodes are replaced by sizes as in mp4.
      x264's VBV now works on a NAL level, taking into account escape codes.
      VBV will also take into account the bit cost of SPS/PPS, but only if b_repeat_headers is set.
      Add an overhead tracking system to VBV to better predict the constant overhead of frames (headers, NALU overhead, etc).
      7a0fbed7
  8. 02 Sep, 2009 1 commit
    • Steven Walters's avatar
      Threaded lookahead · 6940dcae
      Steven Walters authored
      Move lookahead into a separate thread, set to higher priority than the other threads, for optimal performance.
      Reduces the amount that lookahead bottlenecks encoding, greatly increasing performance with lookahead-intensive settings (e.g. b-adapt 2) on many-core CPUs.
      Buffer size can be controlled with --sync-lookahead, which defaults to auto (threads+bframes buffer size).
      Note that this buffer is separate from the rc-lookahead value.
      Note also that this does not split lookahead itself into multiple threads yet; this may be added in the future.
      Additionally, split frames into "fdec" and "fenc" frame types and keep the two separate.
      This split greatly reduces memory usage, which helps compensate for the larger lookahead size.
      Extremely special thanks to Michael Kazmier and Alex Giladi of Avail Media, the original authors of this patch.
      6940dcae
  9. 31 Aug, 2009 1 commit
    • Fiona Glaser's avatar
      Multi-slice encoding support · 4ccbb199
      Fiona Glaser authored
      Slicing support is available through three methods (which can be mixed):
      --slices sets a number of slices per frame and ensures rectangular slices (required for Blu-ray).  Overridden by either of the following options:
      --slice-max-mbs sets a maximum number of macroblocks per slice.
      --slice-max-size sets a maximum slice size, in bytes (includes NAL overhead).
      Implement macroblock re-encoding support to allow highly accurate slice size limitation.  Might be useful for other things in the future, too.
      4ccbb199
  10. 19 Aug, 2009 1 commit
    • Fiona Glaser's avatar
      Add support for frame-accurate parameter changes · c83699f1
      Fiona Glaser authored
      Parameter structs can now be passed with individual frames.
      The previous method would only change the parameter of what was currently being encoded, which due to delay might be very far from an intended exact frame.
      Also add support for changing aspect ratio.  Only works in a stream with repeating headers and requires the caller to force an IDR to ensure instant effect.
      c83699f1
  11. 17 Aug, 2009 1 commit
    • Fiona Glaser's avatar
      Lookahead VBV · 30a82c75
      Fiona Glaser authored
      Use the large-scale lookahead capability introduced in MB-tree for ratecontrol purposes.
      (Does not require MB-tree, however.)
      Greatly improved quality and compliance in 1-pass VBV mode, especially in CBR; +2db OPSNR or more in some cases.
      Fix some other bugs in VBV, which should improve non-lookahead mode as well.
      Change the tolerance algorithm in row VBV to allow for more significant mispredictions when buffer is nearly full.
      Note that due to the fixing of an extremely long-standing bug (>1 year), bitrates may change by nontrivial amounts in CRF without MB-tree.
      30a82c75
  12. 08 Aug, 2009 1 commit
  13. 07 Aug, 2009 1 commit
    • Fiona Glaser's avatar
      Macroblock-tree ratecontrol · 835ccc3c
      Fiona Glaser authored
      On by default; can be turned off with --no-mbtree.
      Uses a large lookahead to track temporal propagation of data and weight quality accordingly.
      Requires a very large separate statsfile (2 bytes per macroblock) in multi-pass mode.
      Doesn't work with b-pyramid yet.
      Note that MB-tree inherently measures quality different from the standard qcomp method, so bitrates produced by CRF may change somewhat.
      This makes the "medium" preset a bit slower.  Accordingly, make "fast" slower as well, and introduce a new preset "faster" between "fast" and "veryfast".
      All presets "fast" and above will have MB-tree on.
      Add a new option, --rc-lookahead, to control the distance MB tree looks ahead to perform propagation analysis.
      Default is 40; larger values will be slower and require more memory but give more accurate results.
      This value will be used in the future to control ratecontrol lookahead (VBV).
      Add a new option, --no-psy, to disable all psy optimizations that don't improve PSNR or SSIM.
      This disables psy-RD/trellis, but also other more subtle internal psy optimizations that can't be controlled directly via external parameters.
      Quality improvement from MB-tree is about 2-70% depending on content.
      Strength of MB-tree adjustments can be tweaked using qcompress; higher values mean lower MB-tree strength.
      Note that MB-tree may perform slightly suboptimally on fades; this will be fixed by weighted prediction, which is coming soon.
      835ccc3c
  14. 07 Jul, 2009 1 commit
    • Fiona Glaser's avatar
      Totally new preset system for x264.c (not libx264), new defaults · 71b9d885
      Fiona Glaser authored
      Other new features include "tune" and "profile" settings; see --help for more details.
      Unlike most other settings, "preset" and "tune" act before all other options.
      However, "profile" acts afterwards, overriding all other options.
      Our defaults have also changed: new defaults are --subme 7 --bframes 3 --8x8dct --no-psnr --no-ssim --threads auto --ref 3 --mixed-refs --trellis 1 --weightb --crf 23 --progress.
      Users will hopefully find these changes to greatly improve usability.
      71b9d885
  15. 04 Mar, 2009 1 commit
    • Fiona Glaser's avatar
      Remove non-pre scenecut · 42f27d04
      Fiona Glaser authored
      Add support for no-b-adapt + pre-scenecut (patch by BugMaster)
      Pre-scenecut was generally better than regular scenecut in terms of accuracy and regular scenecut didn't work in threaded mode anyways.
      Add no-scenecut option (scenecut=0 is now no scenecut; previously it was -1)
      Fix an incorrect bias towards P-frames near scenecuts with B-adapt 2.
      Simplify pre-scenecut code.
      42f27d04
  16. 11 Feb, 2009 1 commit
  17. 20 Jan, 2009 1 commit
    • Fiona Glaser's avatar
      Eliminate support for direct_8x8_inference=0 · 1f0e78d8
      Fiona Glaser authored
      The benefit in the most extreme contrived situation was at most 0.001db PSNR, at the cost of slower decoding.
      As this option was basically useless, it was a waste of code and prevented some other useful optimizations.
      Remove some unused mc code related to sub-8x8 partitions.
      Small deblocking speedup when p4x4 is used.
      Also remove unused x264_nal_decode prototype from x264.h.
      1f0e78d8
  18. 25 Dec, 2008 1 commit
  19. 02 Oct, 2008 1 commit
    • Fiona Glaser's avatar
      Rework subme system, add RD refinement in B-frames · 60455fff
      Fiona Glaser authored
      The new system is as follows: subme6 is RD in I/P frames, subme7 is RD in all frames, subme8 is RD refinement in I/P frames, and subme9 is RD refinement in all frames.
      subme6 == old subme6, subme7 == old subme6+brdo, subme8 == old subme7+brdo, subme9 == no equivalent
      --b-rdo has, accordingly, been removed.  --bime has also been removed, and instead enabled automatically at subme >= 5.
      RD refinement in B-frames (subme9) includes both qpel-RD and an RD version of bime.
      60455fff
  20. 15 Sep, 2008 2 commits
    • Fiona Glaser's avatar
      Psychovisually optimized rate-distortion optimization and trellis · ecc9bfab
      Fiona Glaser authored
      The latter, psy-trellis, is disabled by default and is reserved as experimental; your mileage may vary.
      Default subme is raised to 6 so that psy RD is on by default.
      ecc9bfab
    • Fiona Glaser's avatar
      Add optional more optimal B-frame decision method · 95ed2720
      Fiona Glaser authored
      This method (--b-adapt 2) uses a Viterbi algorithm somewhat similar to that used in trellis quantization.
      Note that it is not fully optimized and is very slow with large --bframes values.
      It also takes into account weightb, which should improve fade detection.
      Additionally, changes were made to cache lowres intra results for each frame to avoid recalculating them.  This should improve performance in both B-frame decision methods.
      This can also be done for motion vectors, which will dramatically improve b-adapt 2 performance when it is complete.
      This patch also reads b_adapt and scenecut settings from the first pass so that the x264 header information in the output file will have correct information (since frametype decision is only done on the first pass).
      95ed2720
  21. 14 Sep, 2008 1 commit
    • Fiona Glaser's avatar
      Move adaptive quantization to before ratecontrol, eliminate qcomp bias · 80458ffc
      Fiona Glaser authored
      This change improves VBV accuracy and improves bit distribution in CRF and 2pass.
      Instead of being applied after ratecontrol, AQ becomes part of the complexity measure that ratecontrol uses.
      This allows for modularity for changes to AQ; a new AQ algorithm can be introduced simply by introducing a new aq_mode and a corresponding if in adaptive_quant_frame.
      This also allows quantizer field smoothing, since quantizers are calculated beofrehand rather during encoding.
      Since there is no more reason for it, aq_mode 1 is removed.  The new mode 1 is in a sense a merger of the old modes 1 and 2.
      WARNING: This change redefines CRF when using AQ, so output bitrate for a given CRF may be significantly different from before this change!
      80458ffc
  22. 06 Sep, 2008 1 commit
    • Fiona Glaser's avatar
      Revert part of r963 · 654e5498
      Fiona Glaser authored
      In some rare (but significant) cases, the optimized nal_encode algorithm gave incorrect results.
      654e5498
  23. 05 Sep, 2008 1 commit
  24. 30 Aug, 2008 1 commit
  25. 21 Aug, 2008 1 commit
  26. 18 Jul, 2008 1 commit
  27. 04 Jul, 2008 1 commit
    • Fiona Glaser's avatar
      Update file headers throughout x264 · bdbd4fe7
      Fiona Glaser authored
      Update "Authors" lists based on actual authorship; highest is most important
      Update copyright notices and remove old CVS tags from file headers
      Add file headers to GTK and other sections missing them
      Update FSF address
      Other header-related cosmetics
      bdbd4fe7
  28. 20 May, 2008 1 commit
  29. 14 May, 2008 1 commit
  30. 21 Apr, 2008 1 commit
  31. 30 Mar, 2008 1 commit
  32. 27 Jan, 2008 1 commit
  33. 17 Jul, 2007 1 commit
  34. 12 Jul, 2007 1 commit
  35. 02 May, 2007 1 commit
  36. 15 Dec, 2006 1 commit
    • Loren Merritt's avatar
      New threading method: · 7b4f6a1f
      Loren Merritt authored
      Encode multiple frames in prallel instead of dividing each frame into slices.
      Improves speed, and reduces the bitrate penalty of threading.
      
      Side effects:
      It is no longer possible to re-encode a frame, so threaded scenecut detection
      must run in the pre-me pass, which is faster but less precise. 
      It is now useful to use more threads than you have cpus. --threads=auto has
      been updated to use cpus*1.5.
      Minor changes to ratecontrol.
      
      New options: --pre-scenecut, --mvrange-thread, --non-deterministic
      
      
      git-svn-id: svn://svn.videolan.org/x264/trunk@607 df754926-b1dd-0310-bc7b-ec298dee348c
      7b4f6a1f