]> git.sesse.net Git - x264/log
x264
14 years agofix ffms demuxer to support input timebase values > 2^31
Steven Walters [Tue, 20 Apr 2010 23:48:02 +0000 (19:48 -0400)]
fix ffms demuxer to support input timebase values > 2^31

14 years agoFix 10l in cache_load changes
Fiona Glaser [Tue, 20 Apr 2010 23:53:06 +0000 (16:53 -0700)]
Fix 10l in cache_load changes
Broke constrained intra pred, probably not anything else.

14 years agoFaster fullpel predictor checking
Fiona Glaser [Tue, 20 Apr 2010 23:50:13 +0000 (16:50 -0700)]
Faster fullpel predictor checking
Also shave a few instructions off dia/hex motion estimation loops.

14 years agoFix checkasm's generation of deblock inputs (regression in r1517)
Loren Merritt [Tue, 20 Apr 2010 09:40:49 +0000 (09:40 +0000)]
Fix checkasm's generation of deblock inputs (regression in r1517)

14 years agoFix printing of bitrate when timestamps aren't available
Loren Merritt [Tue, 20 Apr 2010 09:17:18 +0000 (09:17 +0000)]
Fix printing of bitrate when timestamps aren't available
Doesn't affect x264cli, but was broken in some other apps in CFR mode.

14 years agoDon't check mv0 twice
Fiona Glaser [Tue, 20 Apr 2010 07:46:29 +0000 (00:46 -0700)]
Don't check mv0 twice
One less SAD in motion estimation.
Also rename bmv -> pmv; more accurate naming.

14 years agoRemove reordering restrictions from weightp
Fiona Glaser [Mon, 19 Apr 2010 18:02:27 +0000 (11:02 -0700)]
Remove reordering restrictions from weightp
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.

14 years agoPrint intra chroma pred modes in stats
Fiona Glaser [Tue, 20 Apr 2010 06:34:03 +0000 (23:34 -0700)]
Print intra chroma pred modes in stats

14 years agoAdd mv0 special case in pskip chroma MC
Fiona Glaser [Mon, 19 Apr 2010 05:54:48 +0000 (22:54 -0700)]
Add mv0 special case in pskip chroma MC
Significantly faster pskip MC.

14 years agoFix build scripts to work with non-GNU tools
Francois Cartegnie [Sun, 18 Apr 2010 20:04:59 +0000 (13:04 -0700)]
Fix build scripts to work with non-GNU tools

14 years agoFaster deblock reference frame checks
Fiona Glaser [Sat, 17 Apr 2010 03:04:13 +0000 (20:04 -0700)]
Faster deblock reference frame checks
Use a lookup table to simplify logic

14 years agoFaster chroma CBP handling
Henrik Gramner [Fri, 16 Apr 2010 20:39:45 +0000 (22:39 +0200)]
Faster chroma CBP handling

14 years agoFix issues with extremely large timebases
Fiona Glaser [Fri, 16 Apr 2010 18:36:43 +0000 (11:36 -0700)]
Fix issues with extremely large timebases
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.

14 years agoMMX code for predictor rounding/clipping
Fiona Glaser [Fri, 16 Apr 2010 19:06:07 +0000 (12:06 -0700)]
MMX code for predictor rounding/clipping
Faster predictor checking at subme < 3.

14 years agoFix four minor bugs found by Clang
Fiona Glaser [Fri, 16 Apr 2010 10:06:46 +0000 (03:06 -0700)]
Fix four minor bugs found by Clang

14 years agoMove deblocking/hpel into sliced threads
Fiona Glaser [Thu, 15 Apr 2010 23:32:31 +0000 (16:32 -0700)]
Move deblocking/hpel into sliced threads
Instead of doing both as a separate pass, do them during the main encode.
This requires disabling deblocking between slices (disable_deblock_idc == 2).
Overall performance gain is about 11% on --preset superfast with sliced threads.
Doesn't reduce the amount of actual computation done: only better parallelizes it.

14 years agoPrefetch MB data in cache_load
Fiona Glaser [Wed, 14 Apr 2010 21:43:25 +0000 (14:43 -0700)]
Prefetch MB data in cache_load
Dramatically reduces L1 cache misses.
~10% faster cache_load.

14 years agoFix a ton of pessimization caused by aliasing in cache_save and cache_load
Fiona Glaser [Fri, 23 Apr 2010 19:09:37 +0000 (19:09 +0000)]
Fix a ton of pessimization caused by aliasing in cache_save and cache_load

14 years agoAdd CP128/M128 macros using SSE
Fiona Glaser [Fri, 23 Apr 2010 19:09:18 +0000 (19:09 +0000)]
Add CP128/M128 macros using SSE

14 years agoFix various early terminations with slices
Fiona Glaser [Sun, 11 Apr 2010 20:36:50 +0000 (13:36 -0700)]
Fix various early terminations with slices
Neighbouring type values (type_top, etc) are now loaded even if the MB isn't available for prediction.
Significant overall performance increase (as high as 5-10%+) with lots of slices (e.g. with slice-max-size).

14 years agoEnable --fast-pskip on fast firstpass
Anton Mitrofanov [Tue, 13 Apr 2010 17:25:42 +0000 (21:25 +0400)]
Enable --fast-pskip on fast firstpass

14 years agoMake interlaced detection in avisynth only apply to field-based input
Steven Walters [Tue, 13 Apr 2010 12:44:37 +0000 (08:44 -0400)]
Make interlaced detection in avisynth only apply to field-based input
Fixes improper flagging of progressive sources.

14 years agoSet psy=0 in lossless mode
Anton Mitrofanov [Tue, 13 Apr 2010 15:55:12 +0000 (19:55 +0400)]
Set psy=0 in lossless mode
Doesn't actually affect output, just what's written in the SEI.

14 years agoFix a use of sad_x4 that had non-mod64 stride
Loren Merritt [Sun, 11 Apr 2010 04:20:04 +0000 (04:20 +0000)]
Fix a use of sad_x4 that had non-mod64 stride
Minimal speed improvement, but fixes a violation of internal api.

14 years agoMake keyint_min auto by default
Fiona Glaser [Sat, 10 Apr 2010 20:15:30 +0000 (13:15 -0700)]
Make keyint_min auto by default
Gives more reasonable default settings when using short GOPs.

14 years agoFaster mv predictor checking at subme < 3
Fiona Glaser [Sat, 10 Apr 2010 07:49:19 +0000 (00:49 -0700)]
Faster mv predictor checking at subme < 3
Simplify the predicted MV cost check.

14 years agoSpecial case in qpel refine for subme=1
Fiona Glaser [Sat, 10 Apr 2010 07:35:50 +0000 (00:35 -0700)]
Special case in qpel refine for subme=1
~15-20% faster qpel refine with subme=1.
Some minor cleanups in refine_supel.

14 years agoCosmetics: VLC tables
Henrik Gramner [Sat, 10 Apr 2010 00:21:01 +0000 (02:21 +0200)]
Cosmetics: VLC tables

14 years agoAdd faster mv0 special case for macroblock-tree
Fiona Glaser [Sat, 10 Apr 2010 01:13:22 +0000 (18:13 -0700)]
Add faster mv0 special case for macroblock-tree
Improves performance on low-motion video.

14 years agoAdd miscompilation check for x264_clz
Fiona Glaser [Fri, 9 Apr 2010 08:49:55 +0000 (01:49 -0700)]
Add miscompilation check for x264_clz
Running a Phenom-optimized build of x264 (e.g. -march=amdfam10) on a non-Phenom CPU didn't SIGILL; instead it would silently produce incorrect output.
Now, instead, it will error out loudly.

14 years agoFixing floating-point exception in level-checking
Anton Mitrofanov [Wed, 7 Apr 2010 09:17:20 +0000 (12:17 +0300)]
Fixing floating-point exception in level-checking
Doesn't cause any issues for x264cli, but might impact some calling apps that care (e.g. Delphi apps).

14 years agoSave a few bits in multislice encoding
Fiona Glaser [Fri, 9 Apr 2010 01:44:16 +0000 (18:44 -0700)]
Save a few bits in multislice encoding
Set the initial QP for each slice to the last QP of the previous slice.

14 years agoEarly termination in 16x8/8x16 search
Alex Wright [Wed, 7 Apr 2010 15:25:55 +0000 (01:25 +1000)]
Early termination in 16x8/8x16 search
Combine the actual cost of the first partition with the predicted cost of the second to avoid searching the second when possible.
Reduces the number of times the second partition is searched by up to ~75% in non-RD mode, ~10% in RD mode.
Negligible effect on compression.

14 years agoMake MV prediction work across slice boundaries
Fiona Glaser [Wed, 7 Apr 2010 14:45:00 +0000 (07:45 -0700)]
Make MV prediction work across slice boundaries
Should improve motion search with lots of small slices, e.g. with slice-max-size.
Still restricted by sliced threads (won't cross the boundary between two threadslices).
The output-changing part of the previous patch.

14 years agoCleanup and simplification of macroblock_load
Fiona Glaser [Wed, 7 Apr 2010 14:43:46 +0000 (07:43 -0700)]
Cleanup and simplification of macroblock_load
Doesn't do anything now, but will be useful for many future changes.
Splitting out neighbour calculation will make MBAFF implementation easier.
Calculation of neighbour_frame value (actual neighbouring MBs, ignoring slices) will be useful for some future patches.

14 years agoAdd missing #include to display-x11.c
Fiona Glaser [Wed, 7 Apr 2010 10:10:03 +0000 (03:10 -0700)]
Add missing #include to display-x11.c

14 years agoAdd TFF/BFF detection to all demuxers
Steven Walters [Wed, 7 Apr 2010 02:08:21 +0000 (22:08 -0400)]
Add TFF/BFF detection to all demuxers
Fix interlaced Avisynth input, automatically weave field-based input.

14 years agoCorrectly mark output frames as BREF
Fiona Glaser [Tue, 6 Apr 2010 20:53:22 +0000 (13:53 -0700)]
Correctly mark output frames as BREF
Simplify pic_out code.

14 years agoFix HRD compliance
Kieran Kunhya [Sat, 3 Apr 2010 21:59:59 +0000 (14:59 -0700)]
Fix HRD compliance
As usual, the spec is so insanely obfuscated that it's impossible to get things right the first time.

14 years agoBetter b16x8/8x16 early termination in B-frames
Alex Wright [Sat, 3 Apr 2010 21:50:26 +0000 (14:50 -0700)]
Better b16x8/8x16 early termination in B-frames
A bit slower but up to 1-2% better compression.

14 years agoFix 10L in B-skip improvement patch
Fiona Glaser [Fri, 2 Apr 2010 19:23:52 +0000 (12:23 -0700)]
Fix 10L in B-skip improvement patch

14 years agoFix printing of SEI header with VBV + ABR
Fiona Glaser [Fri, 2 Apr 2010 10:09:48 +0000 (03:09 -0700)]
Fix printing of SEI header with VBV + ABR
SEI header shouldn't say CBR unless bitrate == maxrate.

14 years agoSimplify slicetype_frame_cost
Fiona Glaser [Fri, 2 Apr 2010 05:33:42 +0000 (22:33 -0700)]
Simplify slicetype_frame_cost
Avoid redundant calculations when VBV is on (due to the intra-only call).
Move most of the logic into per-MB code.

14 years agoFaster CABAC state copying for small partitions
Fiona Glaser [Thu, 1 Apr 2010 22:51:59 +0000 (15:51 -0700)]
Faster CABAC state copying for small partitions
Save ~25 clocks per i4x4, i8x8, and sub8x8 RD call.

14 years agoMassive cosmetic and syntax cleanup
Fiona Glaser [Wed, 31 Mar 2010 08:44:07 +0000 (01:44 -0700)]
Massive cosmetic and syntax cleanup
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.

14 years agoFix array overread in b8x16 search
Fiona Glaser [Wed, 31 Mar 2010 06:30:09 +0000 (23:30 -0700)]
Fix array overread in b8x16 search

14 years agoFaster direct check with subpartitions off
Fiona Glaser [Tue, 30 Mar 2010 02:03:13 +0000 (19:03 -0700)]
Faster direct check with subpartitions off
Also simplify the whole function a bit.

14 years agoPrint crf-max with appropriate precision in SEI
Fiona Glaser [Mon, 29 Mar 2010 09:14:25 +0000 (02:14 -0700)]
Print crf-max with appropriate precision in SEI

14 years agoFix 10l in timecode seeking
Yusuke Nakamura [Mon, 29 Mar 2010 07:05:30 +0000 (00:05 -0700)]
Fix 10l in timecode seeking

14 years agoFix 10L: Remove needless error check
Yusuke Nakamura [Mon, 29 Mar 2010 04:51:02 +0000 (13:51 +0900)]
Fix 10L: Remove needless error check
This error check was for cfr input + --timebase, but that doesn't happen, and brings about a bug with vfr input.

14 years agoDon't use 2 L1 refs with pyramid + ref=1
Fiona Glaser [Mon, 29 Mar 2010 03:40:42 +0000 (20:40 -0700)]
Don't use 2 L1 refs with pyramid + ref=1
Slightly faster encoding with ref=1.

14 years agoUpdate copyright year in SEI header
Henrik Gramner [Sat, 27 Mar 2010 00:57:23 +0000 (17:57 -0700)]
Update copyright year in SEI header

14 years agoNew "superfast" preset, much faster intra analysis
Fiona Glaser [Fri, 26 Mar 2010 22:33:20 +0000 (15:33 -0700)]
New "superfast" preset, much faster intra analysis

Especially at the fastest settings, intra analysis was taking up the majority of MB analysis time.
This patch takes a ton more shortcuts at the fastest encoding settings, decreasing compression 0.5-5% but improving speed greatly.
Also rearrange the fastest presets a bit: now we have ultrafast, superfast, veryfast, faster.
superfast is the old veryfast (but much faster due to this patch).
veryfast is between the old veryfast and faster.
faster is the same as before except with MB-tree on.

Encoding with subme >= 5 should be unaffected by this patch.

14 years agoAvoid redundant MV prediction in duplicate refs
Fiona Glaser [Thu, 25 Mar 2010 21:46:24 +0000 (14:46 -0700)]
Avoid redundant MV prediction in duplicate refs

14 years agoCosmetics in mvd handling
Henrik Gramner [Wed, 24 Mar 2010 22:27:30 +0000 (23:27 +0100)]
Cosmetics in mvd handling
Use a 2D array instead of doing manual pointer arithmetic.

14 years agoFix make uninstall on systems with executable suffixes
Fiona Glaser [Wed, 24 Mar 2010 14:25:01 +0000 (07:25 -0700)]
Fix make uninstall on systems with executable suffixes

14 years agoAdd tune for still image compression
Fiona Glaser [Tue, 23 Mar 2010 21:00:58 +0000 (14:00 -0700)]
Add tune for still image compression
There has been some demand for this from companies looking to use x264 for still image compression (it can outperform JPEG or JPEG-2000 by a factor of 2 or more).
Still image compression is a bit different; because temporal stability isn't an issue, we can get away with far more powerful psy settings.

14 years agoPad non-mod16 resolutions using the correct field
Henrik Gramner [Mon, 22 Mar 2010 01:59:50 +0000 (02:59 +0100)]
Pad non-mod16 resolutions using the correct field

Improves compression of interlaced videos with non-mod16 heights.

14 years agoDocument slow/fast firstpass in --fullhelp
Fiona Glaser [Sun, 21 Mar 2010 16:10:00 +0000 (09:10 -0700)]
Document slow/fast firstpass in --fullhelp

14 years agoFix some misattributions in profiling
Holger Lubitz [Sat, 20 Mar 2010 19:41:21 +0000 (20:41 +0100)]
Fix some misattributions in profiling
Cycles spent in load_hadamard and the avg2 w16 ssse3 cacheline split code were misattributed.

14 years agoMuch faster non-RD intra analysis
Fiona Glaser [Sun, 21 Mar 2010 00:07:12 +0000 (17:07 -0700)]
Much faster non-RD intra analysis
Since every pred mode costs at least 1 bit, move that part into the initial SATD cost.
This lets i4x4/i8x8 analysis terminate earlier.
If the cost of the predicted mode is less than the cost of signalling any other mode, early-terminate the analysis.

14 years agoFix stack alignment in sliced threads
Fiona Glaser [Wed, 17 Mar 2010 22:53:43 +0000 (15:53 -0700)]
Fix stack alignment in sliced threads
Could cause crashes when called from non-GCC-compiled applications.

14 years agoCosmetics: use sizeof() where appropriate
Henrik Gramner [Tue, 16 Mar 2010 00:46:00 +0000 (01:46 +0100)]
Cosmetics: use sizeof() where appropriate

14 years agoSplit up analyse_init
Fiona Glaser [Mon, 15 Mar 2010 07:01:57 +0000 (00:01 -0700)]
Split up analyse_init
Save some time by avoiding some unnecessary inits and moving other parts to per-thread init.

14 years agoReduce stack usage of b-adapt 2's trellis
Henrik Gramner [Mon, 15 Mar 2010 00:19:45 +0000 (01:19 +0100)]
Reduce stack usage of b-adapt 2's trellis
Also remove some redundant code.

14 years agoVarious motion estimation optimizations
Fiona Glaser [Sun, 14 Mar 2010 08:25:02 +0000 (00:25 -0800)]
Various motion estimation optimizations
Faster method of checking MV range.
Predict MVs and cache MVs/MVDs for bidir qpel-RD.
A whole bunch of other minor optimizations.
Slightly better performance and compression.

14 years agoOverhaul macroblock_cache_rect
Fiona Glaser [Sun, 14 Mar 2010 08:19:59 +0000 (00:19 -0800)]
Overhaul macroblock_cache_rect
Unify the rectangle functions into a single one similar to ffmpeg's fill_rectangle.
Remove all cases of variable-size cache_rect calls; create a function-pointer-based system for handling such cases.
Should greatly decrease code size required for such calls.

14 years agoMake a bunch of small functions ALWAYS_INLINE
Fiona Glaser [Sun, 14 Mar 2010 23:48:22 +0000 (16:48 -0700)]
Make a bunch of small functions ALWAYS_INLINE
Probably no real effect for now, but needed for the next patch.

14 years agoTwo compatibility fixes
Loic Minier [Wed, 10 Mar 2010 13:26:46 +0000 (05:26 -0800)]
Two compatibility fixes
Add IA64 support in configure.

14 years agoFaster x264_macroblock_encode_pskip
Henrik Gramner [Fri, 5 Mar 2010 02:19:47 +0000 (03:19 +0100)]
Faster x264_macroblock_encode_pskip
GCC is apparently unable to optimize out the calculation of a variable when it isn't used.

14 years agoMuch more accurate B-skip detection at 2 < subme < 7
Fiona Glaser [Sun, 7 Mar 2010 12:10:30 +0000 (04:10 -0800)]
Much more accurate B-skip detection at 2 < subme < 7
Use the same method that x264 uses for P-skip detection.
This significantly improves quality (1-6%), but at a significant speed cost as well (5-20%).
It also may have a very positive visual effect in cases where the inaccurate skip detection resulted in slightly-off vectors in B-frames.
This could cause slight blurring or non-smooth motion in low-complexity frames at high quantizers.
Not all instances of this problem are solved: the only universal solution is non-locally-optimal mode decision, which x264 does not currently have.

subme >= 7 or <= 2 are unaffected.

14 years agoReformat profile restrictions in --fullhelp.
Alexander Strange [Sun, 7 Mar 2010 07:57:04 +0000 (02:57 -0500)]
Reformat profile restrictions in --fullhelp.

Put "no interlaced", "no lossless" on their own line to avoid them
running into the default options list.

14 years agoFix typo in configure
James Darnley [Sun, 7 Mar 2010 02:28:07 +0000 (18:28 -0800)]
Fix typo in configure

14 years agoAdd support for spaces to iPhone GAS preprocessor script
David Conrad [Sat, 6 Mar 2010 18:29:57 +0000 (10:29 -0800)]
Add support for spaces to iPhone GAS preprocessor script

14 years agoFix slightly wrong mp4 duration.
Yusuke Nakamura [Sat, 6 Mar 2010 10:25:30 +0000 (19:25 +0900)]
Fix slightly wrong mp4 duration.

14 years agoFix link errors with newest gpac cvs
Yusuke Nakamura [Sat, 6 Mar 2010 10:24:32 +0000 (19:24 +0900)]
Fix link errors with newest gpac cvs
gpac decided to randomly break API and require us to use their own custom malloc and free.

14 years agoSave a few bits in slice headers
Kieran Kunhya [Fri, 5 Mar 2010 20:43:02 +0000 (20:43 +0000)]
Save a few bits in slice headers
Don't override the maximum ref index in the slice header if it's the same as the default.
Also update the naming of the relevant variables in the PPS.

14 years agoShrink some arrays in x264_t
Fiona Glaser [Thu, 4 Mar 2010 17:59:09 +0000 (09:59 -0800)]
Shrink some arrays in x264_t
Also remove an unnecessary assignment from cache_load.

14 years agoUse x264_log in more places instead of fprintf
Fiona Glaser [Wed, 3 Mar 2010 19:22:29 +0000 (11:22 -0800)]
Use x264_log in more places instead of fprintf

14 years agoFix two nondeterminisms
Anton Mitrofanov [Wed, 3 Mar 2010 18:14:20 +0000 (10:14 -0800)]
Fix two nondeterminisms
Move noise reduction data into thread-specific data.
Use correct reference list for L1 temporal predictors.

14 years ago"CRF-max" support with VBV
Fiona Glaser [Fri, 19 Mar 2010 21:44:10 +0000 (14:44 -0700)]
"CRF-max" support with VBV
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.

14 years agoBlu-ray support: NAL-HRD, VFR ratecontrol, filler, pulldown
Kieran Kunhya [Tue, 2 Mar 2010 08:57:10 +0000 (00:57 -0800)]
Blu-ray support: NAL-HRD, VFR ratecontrol, filler, pulldown
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.

14 years agoTimecode input/output
Yusuke Nakamura [Mon, 1 Mar 2010 05:42:19 +0000 (21:42 -0800)]
Timecode input/output
--tcfile-in allows a user to specify a timecode v1 or v2 file to override input timestamps.
Useful for dealing with VFR input, especially when FFMS/LAVF support isn't available.
--tcfile-out writes a timecode v2 file containing the timecodes of the output file.
New --timebase option allows a user to change the stream timebase.
Intended primarily for forcing timebase with timecode files if necessary.
When using --seek, note that x264 will seek in the timecode file as well.

14 years agoMixed-refs support for B-frames
Alex Wright [Sun, 28 Feb 2010 09:29:15 +0000 (01:29 -0800)]
Mixed-refs support for B-frames
Small speed cost, usually a few percent at most. Generally has lowest cost in cases when it isn't very useful. Up to ~2% better compression overall on highly complex sources.

Also fix a few minor bugs in B-frame analysis and various bits of cleanup.

14 years agoFaster rounding of chroma DC coefficients
Henrik Gramner [Mon, 1 Mar 2010 21:01:04 +0000 (22:01 +0100)]
Faster rounding of chroma DC coefficients

14 years agoFaster cabac_encode_decision_asm
Holger Lubitz [Tue, 23 Mar 2010 23:54:39 +0000 (00:54 +0100)]
Faster cabac_encode_decision_asm
Minimizes instruction count, which also means smaller code.
Various other slight changes to allow more instruction level parallelism.

14 years agoFaster hpel_filter
Holger Lubitz [Tue, 23 Mar 2010 22:13:54 +0000 (23:13 +0100)]
Faster hpel_filter
On ssse3, use pmaddubsw for h filter too (similar to v filter).
Change 32-bit v and c filters to write the result non-temporal.
Add commented-out defines to disable non-temporal operation.
Hardly any black magic here, but still a measurable win especially for ssse3.

14 years agoIgnore XYSCSS in y4m if the newer standard C tag is present
David Conrad [Mon, 1 Mar 2010 01:34:09 +0000 (20:34 -0500)]
Ignore XYSCSS in y4m if the newer standard C tag is present

Apparently y4mscaler will generate 4:2:0 files with XYSCSS set to 444

14 years agoFix regression in r1450
Fiona Glaser [Tue, 2 Mar 2010 18:51:15 +0000 (10:51 -0800)]
Fix regression in r1450
I_PCM blocks would cause x264 to crash or generate bad output. Simplify PCM handling.

14 years agoFix crash with intra-refresh + aq-mode 0
Fiona Glaser [Sat, 27 Feb 2010 22:26:02 +0000 (14:26 -0800)]
Fix crash with intra-refresh + aq-mode 0

14 years agoFix regression in r1453
Fiona Glaser [Fri, 26 Feb 2010 13:04:48 +0000 (05:04 -0800)]
Fix regression in r1453
r1453 broke psy-trellis with --trellis 2

14 years agoFix regression in r1449
Fiona Glaser [Thu, 25 Feb 2010 10:07:48 +0000 (02:07 -0800)]
Fix regression in r1449
Incorrectly placed thread MV check could result in rare thread MV internal errors, esp. with --non-deterministic.
These weren't fatal errors (x264 could recover and continue with slight compression loss).

14 years agoCut size of MVD arrays by a factor of 2 again
Fiona Glaser [Thu, 25 Feb 2010 04:51:43 +0000 (20:51 -0800)]
Cut size of MVD arrays by a factor of 2 again
Only store the MVDs of the edges of each MB.

Thanks to Michael Niedermayer for the idea.

14 years agoDisable Altivec and VIS optimizations when --disable-asm is specified
David Conrad [Thu, 25 Feb 2010 00:39:57 +0000 (19:39 -0500)]
Disable Altivec and VIS optimizations when --disable-asm is specified

14 years agoFix a buffer overread on odd input resolutions
Loren Merritt [Wed, 24 Feb 2010 07:50:23 +0000 (23:50 -0800)]
Fix a buffer overread on odd input resolutions

14 years agoFix one bug, one corner case in VBV
Fiona Glaser [Wed, 24 Feb 2010 11:49:32 +0000 (03:49 -0800)]
Fix one bug, one corner case in VBV
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.

14 years agoPort Mans Rullgard's NEON intra prediction functions from ffmpeg
David Conrad [Wed, 24 Feb 2010 05:29:21 +0000 (00:29 -0500)]
Port Mans Rullgard's NEON intra prediction functions from ffmpeg

14 years agoRemove unused function
Fiona Glaser [Tue, 23 Feb 2010 21:52:15 +0000 (13:52 -0800)]
Remove unused function
Two other minor fixes.

14 years agoUse short startcode in more possible situations
Fiona Glaser [Tue, 23 Feb 2010 18:00:41 +0000 (10:00 -0800)]
Use short startcode in more possible situations
Previous patch didn't cover all possible uses according to B.1.2.

14 years agoFix fastfirstpass
Fiona Glaser [Tue, 23 Feb 2010 17:50:12 +0000 (09:50 -0800)]
Fix fastfirstpass
Apparently the libx264 preset changes made "fastfirstpass" into "fastsecondpass" inadvertantly.