]> git.sesse.net Git - x264/log
x264
14 years agoMuch faster and simpler direct spatial calculation
Fiona Glaser [Tue, 16 Feb 2010 18:13:33 +0000 (10:13 -0800)]
Much faster and simpler direct spatial calculation

14 years agoSimpleBlock requires Matroska Doctype v2
Fiona Glaser [Sun, 21 Feb 2010 22:21:26 +0000 (14:21 -0800)]
SimpleBlock requires Matroska Doctype v2

14 years agoAdd GPAC version check
Yusuke Nakamura [Tue, 16 Feb 2010 19:05:21 +0000 (11:05 -0800)]
Add GPAC version check

14 years agoFix stupid regression in interlaced in r1430
Fiona Glaser [Tue, 23 Feb 2010 09:44:44 +0000 (01:44 -0800)]
Fix stupid regression in interlaced in r1430
With ref > 8 or b-pyramid, an array over-read could cause slightly incorrect B-frames.

14 years agoFix overread of scratch buffer
Fiona Glaser [Mon, 22 Feb 2010 21:04:47 +0000 (13:04 -0800)]
Fix overread of scratch buffer
Could cause crashes on non-mod16 frames.

14 years agoFix integer overflow in chroma SSD check
Fiona Glaser [Mon, 22 Feb 2010 19:21:51 +0000 (11:21 -0800)]
Fix integer overflow in chroma SSD check
Could cause bad skips at very high quantizers on extreme inputs.

14 years agoFix I and B-frame QPs with threads
Anton Mitrofanov [Tue, 16 Feb 2010 17:41:55 +0000 (09:41 -0800)]
Fix I and B-frame QPs with threads
Rounding errors resulted in slightly wrong QPs with threads enabled.

14 years agoFix compilation on ARM
David Conrad [Mon, 15 Feb 2010 09:02:46 +0000 (01:02 -0800)]
Fix compilation on ARM

14 years agoRemove unnecessary PIC support macros
Loren Merritt [Thu, 28 Jan 2010 18:09:07 +0000 (18:09 +0000)]
Remove unnecessary PIC support macros
yasm has a directive to enable PIC globally

14 years agoDon't even try direct temporal when it would give junk MVs
Fiona Glaser [Sat, 13 Feb 2010 19:19:38 +0000 (11:19 -0800)]
Don't even try direct temporal when it would give junk MVs
In PbBbP pyramid structure, the last "b" cannot use temporal because L0Ref0(L1Ref0) != L0Ref0.
Don't even bother analyzing it, just use spatial.
Should improve speed and direct auto effectiveness in CRF and 1-pass modes when b-pyramid is used.
Also makes --direct temporal useful with --b-pyramid, since it will fall back to spatial for frames where temporal is broken.

14 years agoiPhone compilation support
David Conrad [Sun, 4 Oct 2009 11:24:42 +0000 (07:24 -0400)]
iPhone compilation support
Also add --sysroot to configure options

To build for iPhone 3gs / iPod touch 3g:
CC=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc ./configure --host=arm-apple-darwin --sysroot=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk

For older devices, add
--extra-cflags='-arch armv6 -mcpu=arm1176jzf-s' --extra-ldflags='-arch armv6' --disable-asm

14 years agoARM NEON versions of weightp functions
David Conrad [Sat, 9 Jan 2010 03:40:09 +0000 (22:40 -0500)]
ARM NEON versions of weightp functions

14 years agoUse #ifdef instead of #if in checkasm
David Conrad [Sat, 13 Feb 2010 09:25:56 +0000 (01:25 -0800)]
Use #ifdef instead of #if in checkasm

14 years agoMake the ABR buffer consider the distance to the end of the video
Fiona Glaser [Sat, 13 Feb 2010 08:52:31 +0000 (00:52 -0800)]
Make the ABR buffer consider the distance to the end of the video
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.

14 years agoMark cli_input/output_t variables as const when possible
Alexander Strange [Sat, 13 Feb 2010 07:22:04 +0000 (02:22 -0500)]
Mark cli_input/output_t variables as const when possible

14 years agomkv: Write the x264 version into the file header
Alexander Strange [Sat, 13 Feb 2010 07:00:57 +0000 (02:00 -0500)]
mkv: Write the x264 version into the file header

This only updates the "writing application"; matroska_ebml.c is the
"muxing application", but the version string for that is still hardcoded.

14 years agomkv: Write SimpleBlock instead of Block for frame headers
Alexander Strange [Sat, 13 Feb 2010 06:41:41 +0000 (01:41 -0500)]
mkv: Write SimpleBlock instead of Block for frame headers

mkvtoolnix writes these by default since 2009/04/13.
Slightly simplifies muxer and allows 'mkvinfo -s' to show B-frames
as 'B' (but not B-ref frames).

14 years agoAllow | as a separator between psy-rd and psy-trellis values.
Alexander Strange [Mon, 10 Nov 2008 05:55:20 +0000 (00:55 -0500)]
Allow | as a separator between psy-rd and psy-trellis values.
[,:/] are all taken when setting psy-trellis in a zone in an mencoder option.

Also fix a comment typo and remove a useless line of code.

14 years agoBackport various speed tweak ideas from ffmpeg
Fiona Glaser [Sat, 13 Feb 2010 05:15:12 +0000 (21:15 -0800)]
Backport various speed tweak ideas from ffmpeg
Add mv0 early termination to spatial direct calculation
Up to twice as fast direct mv calculation on near-motionless video.

Branchless CAVLC level code adjustment based on trailing ones.
A few clocks faster.

Check tc value before clipping in C version of deblock functions.
Much faster, but nobody uses those anyways.

Thanks to Michael Niedermayer for the ideas.

14 years agoImplement direct temporal + interlaced
Fiona Glaser [Fri, 12 Feb 2010 11:33:54 +0000 (03:33 -0800)]
Implement direct temporal + interlaced
This was much easier than I expected.
It will also be basically useless until TFF/BFF support gets in, since it requires delta_poc_bottom to be set correctly to work well.

14 years agoAllow longer keyints with intra refresh
Fiona Glaser [Wed, 10 Feb 2010 21:44:28 +0000 (13:44 -0800)]
Allow longer keyints with intra refresh
If a long keyint is specified (longer than macroblock width-1), the refresh will simply not occur all the time.
In other words, a refresh will take place, and then x264 will wait until keyint is over to start another refresh.

14 years agoOverhaul sliced-threads VBV
Fiona Glaser [Wed, 10 Feb 2010 20:12:29 +0000 (12:12 -0800)]
Overhaul sliced-threads VBV
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.

14 years agoPrint psy-(rd|trellis) with more precision in userdata SEI
Fiona Glaser [Tue, 9 Feb 2010 23:08:31 +0000 (15:08 -0800)]
Print psy-(rd|trellis) with more precision in userdata SEI

14 years agoMore formatting fixes in x264 help
Fiona Glaser [Mon, 15 Feb 2010 08:55:16 +0000 (00:55 -0800)]
More formatting fixes in x264 help

14 years agoFaster 2x2 chroma DC dequant
Henrik Gramner [Mon, 8 Feb 2010 23:53:52 +0000 (15:53 -0800)]
Faster 2x2 chroma DC dequant

14 years agoWrite PASP atom in mp4 muxing
Yusuke Nakamura [Mon, 8 Feb 2010 09:48:38 +0000 (01:48 -0800)]
Write PASP atom in mp4 muxing
Adds container-level aspect ratio support for mp4.

14 years agoFix 2-pass ratecontrol continuation in case of missing statsfile
Fiona Glaser [Thu, 4 Feb 2010 04:27:57 +0000 (20:27 -0800)]
Fix 2-pass ratecontrol continuation in case of missing statsfile
Didn't work properly if MB-tree was enabled.

14 years agoSmarter QPRD
Fiona Glaser [Thu, 4 Feb 2010 04:01:16 +0000 (20:01 -0800)]
Smarter QPRD
Catch some cases in which RD checks can be avoided; reduces QPRD RD calls by 10-20%.

14 years agoFix subpel iteration counts with B-frame analysis and subme 6/8
Fiona Glaser [Thu, 4 Feb 2010 02:36:44 +0000 (18:36 -0800)]
Fix subpel iteration counts with B-frame analysis and subme 6/8
Since subme 6 means "like subme 5, except RD on P-frames", B-frame analysis
shouldn't use the RD subpel counts at subme 6.  Similarly with subme 8.
Slightly faster (and very marginally worse) compression at subme 6 and 8.

14 years agoSimplify decimate checks in macroblock_encode
Fiona Glaser [Thu, 4 Feb 2010 02:19:29 +0000 (18:19 -0800)]
Simplify decimate checks in macroblock_encode
Also fix a misleading comment.

14 years agoImprove bidir search, fix some artifacts in fades
Fiona Glaser [Tue, 2 Feb 2010 11:15:18 +0000 (03:15 -0800)]
Improve bidir search, fix some artifacts in fades
Modify analysis to allow bidir to use different motion vectors than L0/L1.
Always try the <0,0,0,0> motion vector for bidir.
Eliminates almost all errant motion vectors in fades.
Slightly improves PSNR as well (~0.015db).

14 years agoSlightly faster predictor_difference_mmxext
Fiona Glaser [Mon, 1 Feb 2010 21:04:47 +0000 (13:04 -0800)]
Slightly faster predictor_difference_mmxext

14 years agoAdd ability to adjust ratecontrol parameters on the fly
Fiona Glaser [Fri, 29 Jan 2010 10:40:41 +0000 (02:40 -0800)]
Add ability to adjust ratecontrol parameters on the fly
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.

14 years agoFix regression in r1406
Yusuke Nakamura [Sat, 30 Jan 2010 21:53:01 +0000 (13:53 -0800)]
Fix regression in r1406
Bitrate was printed incorrectly for some input framerates.

14 years agoFix log2f detection, include order, some gcc warnings
Loren Merritt [Sat, 30 Jan 2010 20:01:51 +0000 (12:01 -0800)]
Fix log2f detection, include order, some gcc warnings
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.

14 years agoFix abstraction violations in x264.c
Fiona Glaser [Fri, 29 Jan 2010 19:01:44 +0000 (11:01 -0800)]
Fix abstraction violations in x264.c
No calling application--not even x264cli--should ever look inside x264_t.

14 years agoMove -D CFLAGS to config.h
Diogo Franco [Fri, 29 Jan 2010 01:28:03 +0000 (17:28 -0800)]
Move -D CFLAGS to config.h

14 years agoFix stat with large file support
Steven Walters [Fri, 29 Jan 2010 01:26:40 +0000 (17:26 -0800)]
Fix stat with large file support

14 years agoImplement ffms2 version check
Diogo Franco [Thu, 28 Jan 2010 04:29:50 +0000 (20:29 -0800)]
Implement ffms2 version check
Depends on ffms2 version 2.13.1 (r272).
Tries pkg-config's built-in version checking first.
Uses only the preprocessor to avoid cross-compilation issues.

14 years agoFix implicit CBR message to only print when in ABR mode
Fiona Glaser [Thu, 28 Jan 2010 03:41:27 +0000 (19:41 -0800)]
Fix implicit CBR message to only print when in ABR mode
Also make it print outside of debug mode.

14 years agoAdd configure check for log2 support
Diogo Franco [Wed, 27 Jan 2010 21:11:08 +0000 (13:11 -0800)]
Add configure check for log2 support
Some incredibly braindamaged operating systems, such as FreeBSD, blatantly ignore the C specification and omit certain functions that are required by ISO C.
log2f is one of these functions that periodically goes missing in such operating systems.

14 years agoAdd config.log support
Diogo Franco [Wed, 27 Jan 2010 18:12:42 +0000 (10:12 -0800)]
Add config.log support
Now, if configure fails, you'll be able to see why.

14 years agoFix cross-compiling with lavf, add support for ffms2.pc
Diogo Franco [Wed, 27 Jan 2010 17:26:35 +0000 (09:26 -0800)]
Fix cross-compiling with lavf, add support for ffms2.pc
Also update configure script to work with newest ffms.

14 years agoImprove DTS generation, move DTS compression into libx264
Yusuke Nakamura [Wed, 27 Jan 2010 00:01:54 +0000 (16:01 -0800)]
Improve DTS generation, move DTS compression into libx264
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.

14 years agoVarious threading-related cosmetics
Anton Mitrofanov [Tue, 26 Jan 2010 19:41:18 +0000 (11:41 -0800)]
Various threading-related cosmetics
Simplify a lot of code and remove some unnecessary variables.

14 years agoHardcode the bs_t in cavlc.c; passing it around is a waste
Fiona Glaser [Mon, 25 Jan 2010 19:23:55 +0000 (11:23 -0800)]
Hardcode the bs_t in cavlc.c; passing it around is a waste

Saves ~1.5kb of code size, very slight speed boost.

14 years agoFix lavf input with pipes and image sequences
David Conrad [Sun, 24 Jan 2010 02:05:25 +0000 (18:05 -0800)]
Fix lavf input with pipes and image sequences
x264 should now be able to encode from an image sequence using an image2-style formatted string (e.g. file%02d.jpg).

14 years agoFix bitstream alignment with multiple slices
Fiona Glaser [Fri, 22 Jan 2010 07:07:11 +0000 (23:07 -0800)]
Fix bitstream alignment with multiple slices
Broke multi-slice encoding on CPUs without unaligned access.
New system simply forces a bitstream realignment at the start of each writing function and flushes when it reaches the end.

14 years agoMerge nnz_backup with scratch buffer
Fiona Glaser [Thu, 21 Jan 2010 18:00:07 +0000 (10:00 -0800)]
Merge nnz_backup with scratch buffer
Slightly less memory usage.

14 years agoUse cross-prefix properly with pkg-config for cross-compiling
Steven Walters [Wed, 20 Jan 2010 17:00:54 +0000 (09:00 -0800)]
Use cross-prefix properly with pkg-config for cross-compiling

14 years agoVarious performance optimizations
Fiona Glaser [Tue, 19 Jan 2010 04:29:33 +0000 (20:29 -0800)]
Various performance optimizations
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.

14 years agoFix crash on new AMD M300 and similar CPUs
Fiona Glaser [Mon, 18 Jan 2010 23:50:06 +0000 (15:50 -0800)]
Fix crash on new AMD M300 and similar CPUs
Apparently these CPUs have SSE4a, but not misaligned SSE.

14 years agoFix intra refresh with subme < 6
Fiona Glaser [Mon, 18 Jan 2010 00:11:05 +0000 (19:11 -0500)]
Fix intra refresh with subme < 6
Also improve the quality of intra masking.

14 years agoAdd support for multiple --tune options
Fiona Glaser [Sun, 17 Jan 2010 01:11:29 +0000 (20:11 -0500)]
Add support for multiple --tune options
Tunes apply in the order they are listed in the case of conflicts.
Psy tunings, i.e. film/animation/grain/psnr/ssim, cannot be combined.
Also clarify --profile, which forces the limits of a profile, not the profile itself.

14 years agoVarious bugfixes and tweaks in analysis
Fiona Glaser [Sat, 16 Jan 2010 07:50:15 +0000 (02:50 -0500)]
Various bugfixes and tweaks in analysis
Fix the oldest-ever bug in x264: b16x8 analysis used the wrong width for predict_mv.
Fix cache_ref calls for slightly better MV prediction in bsub16x16 analysis.
Make B-partition analysis consider reference frame costs.
Various other minor changes.
Overall very slightly improved mode decision and motion search in B-frames.

14 years agoMore --me tesa optimizations
Loren Merritt [Thu, 14 Jan 2010 19:52:12 +0000 (14:52 -0500)]
More --me tesa optimizations

14 years agoFix typo in configure
Fiona Glaser [Thu, 14 Jan 2010 15:39:10 +0000 (10:39 -0500)]
Fix typo in configure

14 years agoMake --fps force CFR mode
Fiona Glaser [Thu, 14 Jan 2010 05:07:30 +0000 (00:07 -0500)]
Make --fps force CFR mode

14 years agoEliminate intentional array overflow in quant matrix handling
Fiona Glaser [Thu, 14 Jan 2010 01:21:31 +0000 (20:21 -0500)]
Eliminate intentional array overflow in quant matrix handling
While it probably never caused problems, it was incredibly ugly and evil.

14 years agoFaster --me tesa
Fiona Glaser [Thu, 14 Jan 2010 01:16:13 +0000 (20:16 -0500)]
Faster --me tesa

14 years agoFix static pthreads + dynamically linked x264 on win32
Anton Mitrofanov [Wed, 13 Jan 2010 20:44:00 +0000 (15:44 -0500)]
Fix static pthreads + dynamically linked x264 on win32
Add the necessary static pthread initialization code to a new DLLmain function.

14 years agoAdd getopt_long to the included getopt.c
Steven Walters [Wed, 13 Jan 2010 03:55:10 +0000 (22:55 -0500)]
Add getopt_long to the included getopt.c
Fixes option handling on OSs that have a nonworking/missing getopt (e.g. Solaris).

14 years agoFaster psy-trellis init
Fiona Glaser [Wed, 13 Jan 2010 01:14:35 +0000 (20:14 -0500)]
Faster psy-trellis init
Remove some unncessary zigzags.

14 years agoSimplfy intra mode availability handling
Fiona Glaser [Wed, 13 Jan 2010 00:19:07 +0000 (19:19 -0500)]
Simplfy intra mode availability handling
Slightly faster, 1.5kb smaller binary size, less code.

14 years agoFix free callback, add x264_encoder_parameters function
Fiona Glaser [Sun, 10 Jan 2010 20:14:02 +0000 (15:14 -0500)]
Fix free callback, add x264_encoder_parameters function
x264 would try to use the passed param struct after freeing if the param_free callback was set.
Probably didn't cause any issues, as probably no programs used the callback in this location yet.

A new x264_encoder_parameters function is now available in the API.
This function lets the calling application grab the current state of the encoder's parameters.
Use this in x264cli to ensure that the param struct used for set_param is updated with whatever changes x264_encoder_open has made to it.

Patch partially by Anton Mitrofanov <BugMaster@narod.ru>.

14 years agoFix x264 compilation on Apple GCC
David Conrad [Sat, 9 Jan 2010 06:52:33 +0000 (01:52 -0500)]
Fix x264 compilation on Apple GCC
Apple's GCC stupidly ignores the ARM ABI and doesn't give any stack alignment beyond 4.

14 years agoFaster weightp motion search
Fiona Glaser [Sat, 2 Jan 2010 08:27:46 +0000 (03:27 -0500)]
Faster weightp motion search
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%.

14 years agoMore correct padding constants for lowres planes
Fiona Glaser [Thu, 31 Dec 2009 18:45:27 +0000 (13:45 -0500)]
More correct padding constants for lowres planes
Since lowres analysis isn't interlace-aware, we don't need to double the vertical padding for interlaced video.

14 years agoFix some invalid reads caught by valgrind
Fiona Glaser [Thu, 31 Dec 2009 07:57:45 +0000 (02:57 -0500)]
Fix some invalid reads caught by valgrind
Temporal predictor calculation was misled by invalid reference counts for I-frames.

14 years agoPeriodic intra refresh
Fiona Glaser [Tue, 22 Dec 2009 23:59:29 +0000 (18:59 -0500)]
Periodic intra refresh
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.

14 years agoLAVF/FFMS input support, native VFR timestamp handling
Kieran Kunhya [Mon, 28 Dec 2009 15:42:17 +0000 (10:42 -0500)]
LAVF/FFMS input support, native VFR timestamp handling
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>.

14 years agoMore help typo fixes
Fiona Glaser [Wed, 16 Dec 2009 00:59:00 +0000 (16:59 -0800)]
More help typo fixes

14 years agoFix x264_clz on inputs > 1<<31
Loren Merritt [Thu, 14 Jan 2010 03:07:30 +0000 (03:07 +0000)]
Fix x264_clz on inputs > 1<<31
(though x264 never generates such inputs)

14 years agoDon't do sum/ssd analysis if weightp == 1
Fiona Glaser [Sun, 13 Dec 2009 11:16:04 +0000 (03:16 -0800)]
Don't do sum/ssd analysis if weightp == 1
Typo fixes in comments and help.

14 years agoFix two bugs in 2-pass ratecontrol
Fiona Glaser [Sat, 12 Dec 2009 01:22:18 +0000 (17:22 -0800)]
Fix two bugs in 2-pass ratecontrol
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.

14 years agoAvisynth-MT and 2.6 compatibility fixes
Steven Walters [Fri, 11 Dec 2009 03:48:51 +0000 (19:48 -0800)]
Avisynth-MT and 2.6 compatibility fixes
Explain to the user why YV12 conversion is forced with Avisynth 2.6.
Fix encoding with Avisynth-MT scripts by inserting the necessary Distributor() call; speeds such scripts back up to expected levels.

14 years agoFix zone parsing on mingw
Steven Walters [Thu, 10 Dec 2009 00:03:19 +0000 (16:03 -0800)]
Fix zone parsing on mingw
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.

14 years agoMore lookahead optimizations
Fiona Glaser [Wed, 9 Dec 2009 23:03:44 +0000 (15:03 -0800)]
More lookahead optimizations
Under subme 1, don't do any qpel search at all and round temporal MVs accordingly.
Drop internal subme with subme 1 to do fullpel predictor checks only.
Other minor optimizations.

14 years agoVarious minor missing changes from previous commits
Fiona Glaser [Wed, 9 Dec 2009 13:56:35 +0000 (05:56 -0800)]
Various minor missing changes from previous commits
Boolify sliced threads too
Remove unused constants from dct-a.asm
Fix a few typos/minor errors in preset documentation

14 years agoFix regression in direct=auto/temporal in r1364
Fiona Glaser [Fri, 11 Dec 2009 00:52:39 +0000 (16:52 -0800)]
Fix regression in direct=auto/temporal in r1364
Bug caused rare race condition in frame reference handling.
This resulted in invalid bitstreams in some B-frames and, very rarely, crashes.

14 years agoAdd fast pskip to x264 SEI info header
Fiona Glaser [Wed, 9 Dec 2009 01:46:55 +0000 (17:46 -0800)]
Add fast pskip to x264 SEI info header

14 years agoMinor seeking fix with Avisynth input
Steven Walters [Tue, 8 Dec 2009 19:36:25 +0000 (11:36 -0800)]
Minor seeking fix with Avisynth input
Seeking past the end of the input with --seek would result in the same frame being repeated over and over.

14 years agoAdd support for MB-tree + B-pyramid
Fiona Glaser [Tue, 8 Dec 2009 11:08:17 +0000 (03:08 -0800)]
Add support for MB-tree + B-pyramid
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.

14 years agoUse aliasing-avoidance macros in array_non_zero
Fiona Glaser [Tue, 8 Dec 2009 02:34:05 +0000 (18:34 -0800)]
Use aliasing-avoidance macros in array_non_zero

14 years agoMMX version of 8x8 interlaced zigzag
Cleo Saulnier [Mon, 7 Dec 2009 20:40:14 +0000 (12:40 -0800)]
MMX version of 8x8 interlaced zigzag
Just as fast as SSSE3 on Nehalem (and faster on Conroe/Penryn), so remove the SSSE3 version.

14 years agoBring back slice-based threading support
Fiona Glaser [Mon, 7 Dec 2009 08:49:41 +0000 (00:49 -0800)]
Bring back slice-based threading support
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.

14 years agoAdd more detailed help for presets/tunes/profiles
Alex Jurkiewicz [Tue, 8 Dec 2009 02:17:29 +0000 (18:17 -0800)]
Add more detailed help for presets/tunes/profiles
Shows what options they represent.

14 years agoqpel RD no longer needs mbcmp_unaligned
Fiona Glaser [Sat, 5 Dec 2009 11:19:44 +0000 (03:19 -0800)]
qpel RD no longer needs mbcmp_unaligned

14 years agoensure that all boolean options are {0,1} so they print consistently in the options SEI
Loren Merritt [Wed, 9 Dec 2009 00:37:09 +0000 (00:37 +0000)]
ensure that all boolean options are {0,1} so they print consistently in the options SEI

14 years agoActually do r1356
Fiona Glaser [Sat, 5 Dec 2009 10:27:30 +0000 (02:27 -0800)]
Actually do r1356
Somehow commit r1356 got lost in the ether.  I'm not sure how, but now it's fixed.

14 years agoRemove some unused code from x264.c
Steven Walters [Fri, 4 Dec 2009 20:17:56 +0000 (12:17 -0800)]
Remove some unused code from x264.c

14 years agoSSSE3 version of zigzag_8x8_field
Fiona Glaser [Thu, 3 Dec 2009 23:36:52 +0000 (15:36 -0800)]
SSSE3 version of zigzag_8x8_field
Slightly faster interlaced encoding with 8x8dct.
Helps most on Nehalem, somewhat disappointing on Conroe/Penryn.

14 years agoFix crash in interlaced with >8 refs
Fiona Glaser [Thu, 3 Dec 2009 03:55:45 +0000 (19:55 -0800)]
Fix crash in interlaced with >8 refs
Crash introduced in weightp.

14 years agoSignificantly faster qpel-RD
Fiona Glaser [Wed, 2 Dec 2009 00:15:15 +0000 (16:15 -0800)]
Significantly faster qpel-RD
Cache the results of MC, like in bidir-RD.
Slightly changes output due to the necessary reordering of satd/RD calls.
5-10% faster qpel-RD.

14 years agoAdd x264 prefix to functions with ffmpeg equivalents
David Conrad [Tue, 1 Dec 2009 20:23:09 +0000 (12:23 -0800)]
Add x264 prefix to functions with ffmpeg equivalents
Not important now, but will be when we add libav* input support.

14 years ago10L in r1353
Fiona Glaser [Mon, 30 Nov 2009 09:41:24 +0000 (01:41 -0800)]
10L in r1353
Broke mp4 output.

14 years agoEnhanced Avisynth input support
Steven Walters [Fri, 27 Nov 2009 06:37:18 +0000 (22:37 -0800)]
Enhanced Avisynth input support
Requires avisynth_c.h from the Avisynth API headers.
Reports errors properly from Avisynth script input.
Automatically construct input scripts for almost any input file.
Tries ffmpegsource2, DSS2, directshowsource, and many other sourcing methods, based on the input file extension.
Automatically converts to YV12.

14 years agoMuch faster weightp
Fiona Glaser [Wed, 25 Nov 2009 18:40:08 +0000 (10:40 -0800)]
Much faster weightp
Move sum/ssd calculation out of lookahead and do it only once per frame.
Also various minor optimizations, cosmetics, and cleanups.

14 years agoFix bugs in fps/timestamp handling in FLV muxer
Kieran Kunhya [Wed, 25 Nov 2009 09:26:02 +0000 (01:26 -0800)]
Fix bugs in fps/timestamp handling in FLV muxer

14 years agoFix bug in weightp analysis
Fiona Glaser [Wed, 25 Nov 2009 06:37:02 +0000 (22:37 -0800)]
Fix bug in weightp analysis
Weights weren't reset upon early terminations, so old (wrong) weights could stick around.
Small compression improvement.