1. 24 Dec, 2017 2 commits
    • Anton Mitrofanov's avatar
      Cosmetics · b00bcafe
      Anton Mitrofanov authored
      b00bcafe
    • Vittorio Giovara's avatar
      Unify 8-bit and 10-bit CLI and libraries · 71ed44c7
      Vittorio Giovara authored
      Add 'i_bitdepth' to x264_param_t with the corresponding '--output-depth' CLI
      option to set the bit depth at runtime.
      
      Drop the 'x264_bit_depth' global variable. Rather than hardcoding it to an
      incorrect value, it's preferable to induce a linking failure. If applications
      relies on this symbol this will make it more obvious where the problem is.
      
      Add Makefile rules that compiles modules with different bit depths. Assembly
      on x86 is prefixed with the 'private_prefix' define, while all other archs
      modify their function prefix internally.
      
      Templatize the main C library, x86/x86_64 assembly, ARM assembly, AARCH64
      assembly, PowerPC assembly, and MIPS assembly.
      
      The depth and cache CLI filters heavily depend on bit depth size, so they
      need to be duplicated for each value. This means having to rename these
      filters, and adjust the callers to use the right version.
      
      Unfortunately the threaded input CLI module inherits a common.h dependency
      (input/frame -> common/threadpool -> common/frame -> common/common) which
      is extremely complicated to address in a sensible way. Instead duplicate
      the module and select the appropriate one at run time.
      
      Each bitdepth needs different checkasm compilation rules, so split the main
      checkasm target into two executables.
      71ed44c7
  2. 19 May, 2017 1 commit
  3. 21 Jan, 2017 1 commit
  4. 01 Dec, 2016 1 commit
    • Anton Mitrofanov's avatar
      Cosmetics · b2b39dae
      Anton Mitrofanov authored
      Also make x264_weighted_reference_duplicate() static.
      b2b39dae
  5. 13 Jun, 2016 1 commit
  6. 16 Jan, 2016 1 commit
  7. 23 Feb, 2015 1 commit
  8. 08 Jan, 2014 1 commit
  9. 30 Oct, 2013 1 commit
  10. 09 Jan, 2013 1 commit
  11. 07 Mar, 2012 1 commit
    • Fiona Glaser's avatar
      Add row-reencoding support to VBV for improved accuracy · 2535ba17
      Fiona Glaser authored
      Extremely accurate, possibly 100% so (I can't get it to fail even with difficult VBVs).
      Does not yet support rows split on slice boundaries (occurs often with slice-max-size/mbs).
      Still inaccurate with sliced threads, but better than before.
      2535ba17
  12. 04 Feb, 2012 1 commit
  13. 25 Jan, 2011 2 commits
  14. 10 Jan, 2011 1 commit
    • Fiona Glaser's avatar
      VFR/framerate-aware ratecontrol, part 2 · c583687f
      Fiona Glaser authored
      MB-tree and qcomp complexity estimation now consider the duration of a frame in their calculations.
      This is very important for visual optimizations, as frames that last longer are inherently more important quality-wise.
      Improves VFR-aware PSNR as much as 1-2db on extreme test cases, ~0.5db on more ordinary VFR clips (e.g. deduped anime episodes).
      
      WARNING: This change redefines x264's internal quality measurement.
      x264 will now scale its quality based on the framerate of the video due to the aforementioned frame duration logic.
      That is, --crf X will give lower quality per frame for a 60fps video than for a 30fps one.
      This will make --crf closer to constant perceptual quality than previously.
      The "center" for this change is 25fps: that is, videos lower than 25fps will go up in quality at the same CRF and videos above will go down.
      This choice is completely arbitrary.
      
      Note that to take full advantage of this, x264 must encode your video at the correct framerate, with the correct timestamps.
      c583687f
  15. 18 Sep, 2010 1 commit
    • Fiona Glaser's avatar
      Update source file headers · 213a99d0
      Fiona Glaser authored
      Update dates, improve file descriptions, make things more consistent.
      Also add information about commercial licensing.
      213a99d0
  16. 25 Jun, 2010 1 commit
    • Fiona Glaser's avatar
      Improve HRD accuracy · 5a57688f
      Fiona Glaser authored
      In a staggering display of brain damage, the spec requires all HRD math to be done in infinite precision despite the output being of quite limited precision.
      Accordingly, convert buffer management to work in units of timescale.
      These accumulating rounding errors probably didn't cause any real problems, but might in theory cause issues in very picky muxers on extremely long-running streams.
      5a57688f
  17. 02 Jun, 2010 1 commit
    • Fiona Glaser's avatar
      Add API tool to apply arbitrary quantizer offsets · 7adf25b1
      Fiona Glaser authored
      The calling application can now pass a "map" of quantizer offsets to apply to each frame.
      An optional callback to free the map can also be included.
      This allows all kinds of flexible region-of-interest coding and similar.
      7adf25b1
  18. 06 May, 2010 1 commit
    • 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.
      9ce27834
  19. 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.
      e9726b63
  20. 27 Mar, 2010 1 commit
    • 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.
      bb9b16b4
  21. 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.
      34c42187
  22. 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
  23. 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
  24. 07 Oct, 2009 1 commit
    • Fiona Glaser's avatar
      Reorder reference frames optimally on second pass · c1322c31
      Fiona Glaser authored
      About +0.1-0.2% compression at normal bitrates, up to +1% at very low bitrates.
      Only works if the first pass uses the same number of refs as the second (i.e. not with fast first pass).
      Thus, only worthwhile at insanely slow speeds: as such, enable slow-firstpass by default with preset placebo.
      Note that this changes the stats file format!
      c1322c31
  25. 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
  26. 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
  27. 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
  28. 21 Aug, 2008 1 commit
  29. 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
  30. 02 Jun, 2008 1 commit
    • Gabriel Bouvigne's avatar
      2-pass VBV support and improved VBV handling · 56f2bc89
      Gabriel Bouvigne authored
      Dramatically improves 1-pass VBV ratecontrol (especially CBR) and provides support for VBV in 2-pass mode.  This consists of a series of functions that attempts to find overflows and underflows in the VBV from the first-pass statsfile and fix them before encoding.
      1-pass VBV code partially by Fiona Glaser.
      56f2bc89
  31. 24 Apr, 2008 1 commit
  32. 30 Mar, 2008 1 commit
  33. 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
  34. 09 Mar, 2006 1 commit
  35. 22 Nov, 2005 1 commit
  36. 11 Mar, 2005 1 commit
  37. 28 Aug, 2004 1 commit
  38. 06 Aug, 2004 1 commit