1. 30 Jan, 2010 5 commits
  2. 28 Jan, 2010 1 commit
  3. 21 Jan, 2010 1 commit
    • Fiona Glaser's avatar
      Various performance optimizations · f5af5f14
      Fiona Glaser authored
      Simplify and compact storage of direct motion vectors, faster --direct auto.
      Shrink various arrays to save a bit of cache.
      Simplify and reorganize B macroblock type writing in CABAC.
      Add some missing ALIGNED macros.
      f5af5f14
  4. 14 Jan, 2010 3 commits
    • Fiona Glaser's avatar
      Faster weightp motion search · fd1cf294
      Fiona Glaser authored
      For blind-weight dupes, copy the motion vector from the main search and qpel-refine instead of doing a full search.
      Fix the p8x8 early termination, which had unexpected results when combined with blind weighting.
      Overall, marginally reduces compression but should potentially improve speed by over 5%.
      fd1cf294
    • 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
  5. 09 Dec, 2009 1 commit
    • 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
  6. 05 Dec, 2009 1 commit
  7. 25 Nov, 2009 1 commit
    • Fiona Glaser's avatar
      Fix weightb with delta_poc_bottom · b02dd712
      Fiona Glaser authored
      Has no effect yet, but will be required once we add TFF/BFF signalling support in interlaced mode.
      Gives 0.5-0.7% better compression with proper TFF/BFF signalling.
      b02dd712
  8. 15 Nov, 2009 1 commit
  9. 12 Nov, 2009 1 commit
    • Fiona Glaser's avatar
      Fix all aliasing violations · 03cb8c09
      Fiona Glaser authored
      New type-punning macros perform write/read-combining without aliasing violations per the second-to-last part of 6.5.7 in the C99 specification.
      GCC 4.4, however, doesn't seem to have read this part of the spec and still warns about the violations.
      Regardless, it seems to fix all known aliasing miscompilations, so perhaps the GCC warning generator is just broken.
      As such, add -Wno-strict-aliasing to CFLAGS.
      03cb8c09
  10. 09 Nov, 2009 3 commits
    • 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
    • Steven Walters's avatar
    • Anton Mitrofanov's avatar
      Fix large file support, broken in r1302 · f3c9e6f3
      Anton Mitrofanov authored
      f3c9e6f3
  11. 25 Oct, 2009 1 commit
  12. 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
  13. 12 Oct, 2009 2 commits
    • Loren Merritt's avatar
      change all dct arrays to 1d. · 1fbba0ca
      Loren Merritt authored
      the C standard doesn't allow you to iterate 1-dimensionally over 2d arrays, and nothing other than the dsp functions themselves cares about the 2dness of dct.
      this fixes a miscompilation in x264_mb_optimize_chroma_dc.
      1fbba0ca
    • Anton Mitrofanov's avatar
      Optimize exp2fix8 · 1a1b9c6f
      Anton Mitrofanov authored
      Slightly faster and more accurate rounding.
      1a1b9c6f
  14. 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
  15. 23 Sep, 2009 1 commit
  16. 21 Sep, 2009 2 commits
    • Fiona Glaser's avatar
      Add intra prediction modes to output stats · bbf573c7
      Fiona Glaser authored
      Also eliminate some NANs in stat output with intra-only encoding.
      Marginal speedup: disable stat calculation if log level is below X264_LOG_INFO.
      Various minor cosmetics.
      bbf573c7
    • 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
  17. 14 Sep, 2009 1 commit
    • Fiona Glaser's avatar
      Make MV costs global instead of static · b1eac265
      Fiona Glaser authored
      Fixes some extremely rare threading race conditions and makes the code cleaner.
      Downside: slightly higher memory usage when calling multiple encoders from the same application.
      b1eac265
  18. 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
  19. 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
  20. 27 Aug, 2009 2 commits
  21. 23 Aug, 2009 1 commit
    • David Conrad's avatar
      GSOC merge part 2: ARM stack alignment · ca7da1ae
      David Conrad authored
      Neither GCC nor ARMCC support 16 byte stack alignment despite the fact that NEON loads require it.
      These macros only work for arrays, but fortunately that covers almost all instances of stack alignment in x264.
      ca7da1ae
  22. 08 Aug, 2009 1 commit
  23. 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
  24. 26 Jul, 2009 1 commit
    • Fiona Glaser's avatar
      Add QPRD support as subme=10 · 4304c427
      Fiona Glaser authored
      Refactor trellis lambda selection to be done in analyse_init instead of in trellis.
      This will allow for more easy adaption of lambda later on; for now it allows constant lambda across variable QPs.
      QPRD is only available with adaptive quantization enabled and generally improves SSIM and visual quality.
      Additionally, weight the SSD values from RD based on the relative QP offset for chroma; helps visually at high QPs where chroma has a lower QP than luma.
      This fixes some visual artifacts created by QPRD at high QPs.
      Note that this generally hurts PSNR and SSIM, and so is only on when psy-RD is on.
      4304c427
  25. 19 Jun, 2009 1 commit
  26. 18 Apr, 2009 1 commit
    • Fiona Glaser's avatar
      Add "coded blocks" stat to output information. · 448ea688
      Fiona Glaser authored
      This measures the total percentage of blocks, intra and inter, which have nonzero coefficients.
      "y,uvAC,uvDC" refers to luma, chroma DC, and chroma AC blocks.
      Note that skip blocks are included in this stat.
      448ea688
  27. 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
  28. 16 Feb, 2009 1 commit
  29. 04 Feb, 2009 1 commit