]> git.sesse.net Git - x264/log
x264
14 years agoFix two warnings + some minor optimizations
Fiona Glaser [Fri, 23 Oct 2009 05:38:32 +0000 (22:38 -0700)]
Fix two warnings + some minor optimizations

14 years agoFix a typo in b-pyramid help
Fiona Glaser [Tue, 20 Oct 2009 05:38:01 +0000 (22:38 -0700)]
Fix a typo in b-pyramid help
And an errant space in common/macroblock.c

14 years agoA bit more write-combining in macroblock_cache_load
Henrik Gramner [Mon, 19 Oct 2009 19:57:47 +0000 (12:57 -0700)]
A bit more write-combining in macroblock_cache_load

14 years agosplit muxers.c into one file per format
Steven Walters [Sat, 24 Oct 2009 00:23:50 +0000 (00:23 +0000)]
split muxers.c into one file per format
simplify internal muxer API

14 years agoUpdate fprofile with the latest change to b-pyramid
Fiona Glaser [Mon, 19 Oct 2009 09:43:48 +0000 (02:43 -0700)]
Update fprofile with the latest change to b-pyramid

14 years agoFix assertion fail and incorrect costs with pyramid+VBV
Steven Walters [Sat, 17 Oct 2009 19:54:41 +0000 (12:54 -0700)]
Fix assertion fail and incorrect costs with pyramid+VBV
Deal properly with QPfile'd B-refs.  x264 should handle multiple B-refs per minigop now, though only via forced frametypes.

14 years agoImprove CRF initial QP selection, fix get_qscale bug
Fiona Glaser [Sat, 17 Oct 2009 10:04:56 +0000 (03:04 -0700)]
Improve CRF initial QP selection, fix get_qscale bug
If qcomp=1 (as in mb-tree), we don't need ABR_INIT_QP.
get_qscale could give slightly weird results with still images

14 years agoPrint more accurate error message if dump_yuv fails
Fiona Glaser [Wed, 14 Oct 2009 18:32:27 +0000 (11:32 -0700)]
Print more accurate error message if dump_yuv fails

14 years agoReduce memory usage of b-adapt 2 trellis
Steven Walters [Tue, 13 Oct 2009 16:56:04 +0000 (09:56 -0700)]
Reduce memory usage of b-adapt 2 trellis
Also fix a minor bug where the algorithm ignored the last frame in the trellis.

14 years agoMake B-pyramid spec-compliant
Lamont Alston [Tue, 13 Oct 2009 06:32:16 +0000 (23:32 -0700)]
Make B-pyramid spec-compliant
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).

14 years agoAdd missing free for nal_buffer
Fiona Glaser [Tue, 13 Oct 2009 06:28:26 +0000 (23:28 -0700)]
Add missing free for nal_buffer
Fixes a memory leak.

14 years agosync yasm macros to ffmpeg
Loren Merritt [Sun, 18 Oct 2009 21:47:18 +0000 (21:47 +0000)]
sync yasm macros to ffmpeg

14 years agoeliminate some divisions
Loren Merritt [Sat, 17 Oct 2009 14:54:49 +0000 (14:54 +0000)]
eliminate some divisions

14 years agoFix glitches with slow-firstpass + weightb + multiref + 2pass
Fiona Glaser [Tue, 13 Oct 2009 01:40:28 +0000 (18:40 -0700)]
Fix glitches with slow-firstpass + weightb + multiref + 2pass
Bug in r1277

14 years agoSimplify some code in b-adapt 2's trellis
Henrik Gramner [Mon, 12 Oct 2009 22:44:13 +0000 (15:44 -0700)]
Simplify some code in b-adapt 2's trellis

14 years agoFix a very rare integer overflow in slicetype analysis
Fiona Glaser [Mon, 12 Oct 2009 22:38:51 +0000 (15:38 -0700)]
Fix a very rare integer overflow in slicetype analysis
Caused an assert failure when it occurred.
Bug is as old as adaptive B-frames.

14 years agoReduce the aggressiveness of 2-pass VBV
Fiona Glaser [Mon, 12 Oct 2009 20:14:19 +0000 (13:14 -0700)]
Reduce the aggressiveness of 2-pass VBV
Now that B-frames are properly covered, we don't have to be as aggressive.
This eliminates some issues with skyrocketing QPs in B-frames in 2-pass VBV.

14 years agoFix regression: disable flash detection without B-frames
Fiona Glaser [Mon, 12 Oct 2009 18:29:23 +0000 (11:29 -0700)]
Fix regression: disable flash detection without B-frames

14 years agochange all dct arrays to 1d.
Loren Merritt [Sat, 10 Oct 2009 04:43:00 +0000 (04:43 +0000)]
change all dct arrays to 1d.
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.

14 years agoAdd row-based VBV for B-frames
Fiona Glaser [Mon, 12 Oct 2009 03:17:50 +0000 (20:17 -0700)]
Add row-based VBV for B-frames
While B-frames still aren't explicitly covered by ratecontrol, this should resolve issues of VBV underflows due to larger-than-expected B-frames.

14 years agoImprove VBV, fix bug in 2-pass VBV introduced in MB-tree
Fiona Glaser [Sun, 11 Oct 2009 00:35:03 +0000 (17:35 -0700)]
Improve VBV, fix bug in 2-pass VBV introduced in MB-tree
Bug caused AQ'd row/frame costs to not be calculated (and thus caused underflows).
Also make VBV more aggressive with more threads in 2-pass mode.
Finally, --ratetol now affects VBV aggressiveness (higher is less aggressive).

14 years agoOptimize exp2fix8
Anton Mitrofanov [Thu, 8 Oct 2009 21:55:26 +0000 (14:55 -0700)]
Optimize exp2fix8
Slightly faster and more accurate rounding.

14 years agoAvoid scenecuts in flashes and similar situations
Fiona Glaser [Thu, 8 Oct 2009 11:27:11 +0000 (04:27 -0700)]
Avoid scenecuts in flashes and similar situations
"Flashes" are defined as any scene which lasts a very short period before a previous scene returns.
A common example of this is of course a camera flash.
Accordingly, look ahead during scenecut analysis and rule out the possibility of certain frames being scenecuts.
Also handles cases of tons of short scenes in sequence and avoids making those scenecuts as well.
Can only catch flashes of 1 frame in length with b-adapt 1.
With b-adapt 2, can catch flashes of length --bframes.
Speed cost should be negligible.

14 years agoFix bug where x264 generated non-compliant bitstreams with insane SAR values
Fiona Glaser [Wed, 7 Oct 2009 05:15:10 +0000 (22:15 -0700)]
Fix bug where x264 generated non-compliant bitstreams with insane SAR values

14 years agorm msvc project files and related ifdefs
Loren Merritt [Wed, 30 Sep 2009 22:39:13 +0000 (22:39 +0000)]
rm msvc project files and related ifdefs

14 years agoSSE4 version of 4x4 idct
Holger Lubitz [Tue, 6 Oct 2009 22:17:34 +0000 (15:17 -0700)]
SSE4 version of 4x4 idct
27->24 clocks on Nehalem.
This is really just an excuse to use "movsd" in a real function.
Add some comments to subsum-related macros in x86util.

14 years agoConstrained intra prediction support
Fiona Glaser [Mon, 5 Oct 2009 02:15:28 +0000 (19:15 -0700)]
Constrained intra prediction support
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.

14 years agoSlightly improve non-RD p8x8 mode decision
Fiona Glaser [Sun, 4 Oct 2009 07:48:27 +0000 (00:48 -0700)]
Slightly improve non-RD p8x8 mode decision
Subpartition costs are effectively zero in CABAC if sub-8x8 search is off.

14 years agoReorder reference frames optimally on second pass
Fiona Glaser [Sat, 3 Oct 2009 07:59:02 +0000 (00:59 -0700)]
Reorder reference frames optimally on second pass
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!

14 years agoFix typo in ratecontrol_summary
Fiona Glaser [Wed, 30 Sep 2009 19:13:16 +0000 (12:13 -0700)]
Fix typo in ratecontrol_summary

14 years agoClip log2_max_frame_num
Fiona Glaser [Wed, 30 Sep 2009 06:32:07 +0000 (23:32 -0700)]
Clip log2_max_frame_num
It's still much higher than it needs to be, but that will be fixed with the upcoming MMCO patch.
Also make sure we don't write too large a frame_num or poc in slice header.

14 years agoFix some issues with 3-pass statsfile handling
Anton Mitrofanov [Sat, 26 Sep 2009 19:44:53 +0000 (12:44 -0700)]
Fix some issues with 3-pass statsfile handling
The value of i_frame during encoder_close was incorrect.

14 years agoFix ctrl-C termation message with few frames encoded
Anton Mitrofanov [Sat, 26 Sep 2009 19:42:46 +0000 (12:42 -0700)]
Fix ctrl-C termation message with few frames encoded

14 years agoAdd support for single-frame VBV, improve compliance
Fiona Glaser [Fri, 25 Sep 2009 23:23:52 +0000 (16:23 -0700)]
Add support for single-frame VBV, improve compliance
This allows both constant-framesize and capped-framesize encoding.
Literal constant framesize isn't actually supported yet due to the lack of
filler support.
Example with 30fps video: --vbv-bufsize 200 --vbv-maxrate 6000 will ensure that
no frame is ever larger than 200 kilobits.

One example use-case of this is for zero-delay streaming where bandwidth costs
need to be minimized.  If every frame is smaller than 200 kilobits and the
client has a 6 megabit connection, every single frame can be instantly sent
to the client and handled without any decoder-side buffer.

Fix a mistake in VBV calculation--this may have caused the VBV to be slightly
non-compliant in some situations without x264 realizing it.
Add primitive prediction handling for rows with quantizers lower than their
reference.  This slightly improves VBV in CBR mode.
Various other minor improvements to VBV, mostly to make single-frame VBV work.

Commit sponsored by a media streaming company that wishes to remain anonymous.

14 years agoFix 10l in API change
Fiona Glaser [Thu, 24 Sep 2009 15:40:45 +0000 (08:40 -0700)]
Fix 10l in API change
frame_num was set to 1, not 0, for the first frame.  This broke spec compliance.
Didn't actually seem to cause any problems though except for breaking decoding on Quicktime.

14 years agoAllow user-set FPS for inputs other than YUV
Steven Walters [Wed, 23 Sep 2009 22:04:02 +0000 (15:04 -0700)]
Allow user-set FPS for inputs other than YUV

14 years agoImprove threaded frame handling
Anton Mitrofanov [Wed, 23 Sep 2009 19:31:53 +0000 (12:31 -0700)]
Improve threaded frame handling
Avoid unnecessary cond_wait

14 years agoAttempt to detect miscompilation due to bug in gcc 4.2
Fiona Glaser [Wed, 23 Sep 2009 00:30:19 +0000 (17:30 -0700)]
Attempt to detect miscompilation due to bug in gcc 4.2
I don't know if this bug still affects latest x264, but it can't hurt to try to detect it.
Accordingly refuse to open the encoder if detected.
Apparently VLC (on Windows) has been distributed for some time with a completely
broken x264 due to the use of a completely broken compiler (gcc 4.2).  In
particular, the MV costs seem to be calculated incorrectly on win32 when linking
from an application compiled without -ffast-math to an application with
-ffast-math.
I am not entirely certain why this occurs, but the result is, unsurprisingly,
encoding quality that makes MPEG-2 look good, due to the motion search being
completely broken.

14 years agoReally fix encoder_close crash this time
Steven Walters [Tue, 22 Sep 2009 19:14:23 +0000 (12:14 -0700)]
Really fix encoder_close crash this time
Not-entirely-fixed in r1253.

14 years agoCheck for 16x16 partitions masquerading as smaller ones
Fiona Glaser [Mon, 21 Sep 2009 04:58:08 +0000 (21:58 -0700)]
Check for 16x16 partitions masquerading as smaller ones
Saves a few bits when using qpel-RD.

14 years agoUpdate config.guess/sub; add Snow Leopard support
David Conrad [Sun, 20 Sep 2009 08:16:51 +0000 (01:16 -0700)]
Update config.guess/sub; add Snow Leopard support

14 years agoFix integer overflow in 2-pass VBV
Fiona Glaser [Sat, 19 Sep 2009 16:50:59 +0000 (09:50 -0700)]
Fix integer overflow in 2-pass VBV
Bug caused slight undersizing in 2-pass mode in some cases.

14 years agoFix bug with various bizarre commandline combinations and mbtree
Fiona Glaser [Fri, 18 Sep 2009 21:28:31 +0000 (14:28 -0700)]
Fix bug with various bizarre commandline combinations and mbtree
Second pass would have mbtree on even though the first pass didn't (and thus encoding would immediately fail).

14 years agoAdd intra prediction modes to output stats
Fiona Glaser [Thu, 17 Sep 2009 20:02:02 +0000 (13:02 -0700)]
Add intra prediction modes to output stats
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.

14 years agoOverhaul syntax in muxers.c/matroska.c
Fiona Glaser [Thu, 17 Sep 2009 04:34:48 +0000 (21:34 -0700)]
Overhaul syntax in muxers.c/matroska.c
The inconsistent syntax in these files has finally come to an end.

14 years agoMajor API change: encapsulate NALs within libx264
Fiona Glaser [Thu, 17 Sep 2009 03:00:00 +0000 (20:00 -0700)]
Major API change: encapsulate NALs within libx264
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).

14 years agoAdd missing fclose for mbtree input statsfile on second pass
Fiona Glaser [Mon, 14 Sep 2009 19:30:38 +0000 (12:30 -0700)]
Add missing fclose for mbtree input statsfile on second pass
Bug report by VFRmaniac

14 years agoImprove progress indicator behavior
Fiona Glaser [Mon, 14 Sep 2009 18:07:23 +0000 (11:07 -0700)]
Improve progress indicator behavior
Progress indicator will now indicate based on output frame, not input frame.

14 years agoUpdate yasm configure check
Fiona Glaser [Mon, 14 Sep 2009 10:21:14 +0000 (03:21 -0700)]
Update yasm configure check
lzcnt apparently requires yasm 0.6.2.

14 years agoMake MV costs global instead of static
Fiona Glaser [Sun, 13 Sep 2009 08:02:37 +0000 (01:02 -0700)]
Make MV costs global instead of static
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.

14 years agoDon't print scenecut message multiple times in verbose mode
Fiona Glaser [Sat, 12 Sep 2009 00:30:14 +0000 (17:30 -0700)]
Don't print scenecut message multiple times in verbose mode
Occurred mostly with b-adapt 2.

14 years agoOptimize rounding of luma and chroma DC coefficients
Fiona Glaser [Thu, 10 Sep 2009 09:55:21 +0000 (02:55 -0700)]
Optimize rounding of luma and chroma DC coefficients
Reduce bitrate mostly-losslessly at low quantizers.
In some rare cases, bitrate reduction may be as high as 10%.
Luma rounding optimization (helps much less than chroma) requires trellis.

14 years agoFix crash if encoder_close is called before delayed frames are flushed
Steven Walters [Wed, 9 Sep 2009 19:19:40 +0000 (12:19 -0700)]
Fix crash if encoder_close is called before delayed frames are flushed
Also no longer flush frames when ctrl-Cing x264, so x264 will close faster.

14 years agoImprove x264 help
Fiona Glaser [Sun, 6 Sep 2009 21:55:48 +0000 (14:55 -0700)]
Improve x264 help
Now has three help options: --help, --longhelp, and --fullhelp.
--help only shows the most basic options; most users should not need more than these.
Add usage examples.
Fix typo in a comment.

14 years agoFactor out a redundant RD call in qpel-RD
Fiona Glaser [Sun, 6 Sep 2009 02:22:21 +0000 (19:22 -0700)]
Factor out a redundant RD call in qpel-RD
Fixes a problem that was supposed to be, but didn't, get fully fixed in r1238.

14 years agoFix RD early-skip
Fiona Glaser [Sun, 6 Sep 2009 01:56:18 +0000 (18:56 -0700)]
Fix RD early-skip
Small quality improvement and speedup, was broken by r1214.

14 years agoFaster CAVLC mb header writing for B macroblocks
Fiona Glaser [Sun, 6 Sep 2009 01:55:46 +0000 (18:55 -0700)]
Faster CAVLC mb header writing for B macroblocks

14 years agoCompile fixes for pre-ARMv6T2 and/or PIC
David Conrad [Wed, 2 Sep 2009 23:14:59 +0000 (16:14 -0700)]
Compile fixes for pre-ARMv6T2 and/or PIC

14 years agoChange priority handling on some OSs
Steven Walters [Wed, 2 Sep 2009 19:33:50 +0000 (12:33 -0700)]
Change priority handling on some OSs
Instead of setting the lookahead thread to max priority, lower all the other threads' priorities instead.
This is particularly useful when the "max priority" is "realtime", as in Windows, which can cause some problems.

14 years agoThreaded lookahead
Steven Walters [Wed, 2 Sep 2009 01:46:51 +0000 (18:46 -0700)]
Threaded lookahead
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.

14 years agoForce a link error in case of incompatible API
Fiona Glaser [Tue, 1 Sep 2009 18:36:54 +0000 (11:36 -0700)]
Force a link error in case of incompatible API
This is because the number of bug reports due to miscompiled ffmpeg builds is reaching critical mass.
The name of x264_encoder_open is now #defined based on the current X264_BUILD.
Note that this changes the calling convention required for dlopen, but not for ordinary calls to x264_encoder_open.

14 years agoGet rid of "CBR" descriptor from qcomp
Fiona Glaser [Tue, 1 Sep 2009 05:44:45 +0000 (22:44 -0700)]
Get rid of "CBR" descriptor from qcomp
Though technically accurate in some vague way, I have never actually seen this
option used correctly, rather it has been used by hundreds of people who can't
read the documentation and believe that qcomp=0 is what should be used for CBR
encoding.

14 years agoFaster me=tesa
Loren Merritt [Sun, 30 Aug 2009 20:49:07 +0000 (20:49 +0000)]
Faster me=tesa
But it still spends all too much time in me_search_ref rather than asm.

14 years agoMulti-slice encoding support
Fiona Glaser [Mon, 31 Aug 2009 13:36:41 +0000 (06:36 -0700)]
Multi-slice encoding support
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.

14 years agoFix a valgrind warning in b-adapt 2
Fiona Glaser [Sun, 30 Aug 2009 00:09:55 +0000 (17:09 -0700)]
Fix a valgrind warning in b-adapt 2

14 years agofix asm symbols for oprofile (regression in r1221)
Loren Merritt [Sat, 29 Aug 2009 10:31:08 +0000 (10:31 +0000)]
fix asm symbols for oprofile (regression in r1221)

14 years agoFix bug in intra analysis in B-frames
Anton Mitrofanov [Fri, 28 Aug 2009 22:07:12 +0000 (15:07 -0700)]
Fix bug in intra analysis in B-frames
i8x8/i4x4 never got analysed when fast_intra was toggled and RD was off; up to a 2-3% quality improvement in non-RD mode.
With this bug dating back to r369, this is probably the second-oldest bug ever fixed in x264.

14 years agoFix bug in b16x16 qpel RD
Anton Mitrofanov [Fri, 28 Aug 2009 21:56:44 +0000 (14:56 -0700)]
Fix bug in b16x16 qpel RD
Incorrect cost was used to initialize the search.

14 years agoCheck minimum chroma QP in addition to luma QP during CQM init
Fiona Glaser [Thu, 27 Aug 2009 22:21:22 +0000 (15:21 -0700)]
Check minimum chroma QP in addition to luma QP during CQM init
Correctly error out if the implied minimum chroma QP is too low.
Add missing emms to checkasm macroblock_tree_propagate test.

14 years agoFaster mbtree propagate and x264_log2, less memory usage
Fiona Glaser [Thu, 27 Aug 2009 21:16:45 +0000 (14:16 -0700)]
Faster mbtree propagate and x264_log2, less memory usage
Avoid an int->float conversion with a small table.
Change lowres_inter_types to a bitfield; cut its size by 75%.
Somewhat lower memory usage with lots of bframes.
Make log2/exp2 tables global to avoid duplication.

14 years agoFix keyint=1 + VBV + rc-lookahead
Fiona Glaser [Thu, 27 Aug 2009 03:30:47 +0000 (20:30 -0700)]
Fix keyint=1 + VBV + rc-lookahead

14 years agoFaster x264_exp2fix8
Fiona Glaser [Thu, 27 Aug 2009 03:16:10 +0000 (20:16 -0700)]
Faster x264_exp2fix8
22->13 cycles on Core 2 with mfpmath=sse

14 years agocompile x86 with fpmath=sse by default
Loren Merritt [Thu, 27 Aug 2009 06:05:57 +0000 (06:05 +0000)]
compile x86 with fpmath=sse by default

14 years agoARM configure: enable NEON-related options by default
David Conrad [Tue, 25 Aug 2009 00:17:41 +0000 (17:17 -0700)]
ARM configure: enable NEON-related options by default
When compiling for ARM, x264 will compile by default for Cortex A8 unless specified otherwise.
To compile for pre-ARMv6, --disable-asm is required.

14 years ago2-pass VBV fixes
Fiona Glaser [Mon, 24 Aug 2009 10:28:11 +0000 (03:28 -0700)]
2-pass VBV fixes
Properly run slicetype frame cost with 2pass + MB-tree.
Slash the VBV rate tolerance in 2-pass mode; increasing it made sense for the highly reactive 1-pass VBV algorithm, but not for 2-pass.
2-pass's planned frame sizes are guaranteed to be reasonable, since they are based on a real first pass, while 1-pass's, based on lookahead SATD, cannot always be trusted.

14 years agoGSOC merge part 8: ARM NEON intra prediction assembly functions (partial)
David Conrad [Mon, 24 Aug 2009 08:38:42 +0000 (01:38 -0700)]
GSOC merge part 8: ARM NEON intra prediction assembly functions (partial)
4x4 dc/h/ddr/ddl, 8x8 dc/h, 8x8c h/v, 16x16 dc/h/v

14 years agoGSOC merge part 7: ARM NEON deblock assembly functions (partial)
David Conrad [Mon, 24 Aug 2009 08:10:30 +0000 (01:10 -0700)]
GSOC merge part 7: ARM NEON deblock assembly functions (partial)
Originally written for ffmpeg by Mans Rullgard; ported by David.
Luma and chroma inter deblocking; no intra yet.

14 years agoGSOC merge part 6: ARM NEON quant assembly functions (partial)
David Conrad [Mon, 24 Aug 2009 07:58:42 +0000 (00:58 -0700)]
GSOC merge part 6: ARM NEON quant assembly functions (partial)
(de)quant 4x4, (de)quant 8x8, (de)quant DC, coeff_last

14 years agoGSOC merge part 5: ARM NEON dct assembly functions
David Conrad [Sun, 23 Aug 2009 09:03:48 +0000 (02:03 -0700)]
GSOC merge part 5: ARM NEON dct assembly functions
(i)dct4x4dc, (i)dct4x4, (i)dct8x8, (i)dct_dc, zigzag_scan_frame_4x4

14 years agoGSOC merge part 4: ARM NEON mc assembly functions
David Conrad [Sun, 23 Aug 2009 08:35:10 +0000 (01:35 -0700)]
GSOC merge part 4: ARM NEON mc assembly functions
prefetch, memcpy_aligned, memzero_aligned, avg, mc_luma, get_ref, mc_chroma, hpel_filter, frame_init_lowres

14 years agoGSOC merge part 3: ARM NEON pixel assembly functions
David Conrad [Sun, 23 Aug 2009 06:55:29 +0000 (23:55 -0700)]
GSOC merge part 3: ARM NEON pixel assembly functions
SAD, SADX3/X4, SSD, SATD, SA8D, Hadamard_AC, VAR, VAR2, SSIM

14 years agoGSOC merge part 2: ARM stack alignment
David Conrad [Sun, 23 Aug 2009 06:40:33 +0000 (23:40 -0700)]
GSOC merge part 2: ARM stack alignment
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.

14 years agoFix unaligned accesses in bitstream writer
David Conrad [Fri, 21 Aug 2009 03:44:09 +0000 (20:44 -0700)]
Fix unaligned accesses in bitstream writer
Fixes x264 on CPUs with no unaligned access support (e.g. SPARC).
Improves performance marginally on CPUs with penalties for unaligned stores (e.g. some x86).

14 years agoFix bug in calculation of I-frame costs with AQ.
Fiona Glaser [Thu, 20 Aug 2009 20:08:25 +0000 (13:08 -0700)]
Fix bug in calculation of I-frame costs with AQ.

14 years agoGSOC merge part 1: Framework for ARM assembly optimizations
David Conrad [Thu, 20 Aug 2009 00:03:02 +0000 (17:03 -0700)]
GSOC merge part 1: Framework for ARM assembly optimizations
x264 will detect which ARM core it's building for and only build NEON asm if the target is ARMv6 or above, then enable NEON at runtime.

14 years agoFix a bug in checkasm and two OSX fixes
David Conrad [Wed, 19 Aug 2009 23:18:36 +0000 (16:18 -0700)]
Fix a bug in checkasm and two OSX fixes
MC chroma checkasm test could crash in some situations
Remove -lmx, as it's not needed and the iPhone doesn't have it.
Remove unused sqrtf emulation; it breaks if math.h is included.

14 years agoImprove QPRD
Fiona Glaser [Wed, 19 Aug 2009 08:49:47 +0000 (01:49 -0700)]
Improve QPRD
Always check the last macroblock's QP, even if the normal search doesn't reach it.
Raise the failure threshold when moving towards the last macroblock's QP.
0.2-1% improved compression.

14 years agoFix MB-tree with keyint<3
Fiona Glaser [Wed, 19 Aug 2009 04:53:28 +0000 (21:53 -0700)]
Fix MB-tree with keyint<3
Also slightly improve VBV keyint handling.

14 years agoFix bug in VBV lookahead + no MB-tree
Fiona Glaser [Wed, 19 Aug 2009 02:25:45 +0000 (19:25 -0700)]
Fix bug in VBV lookahead + no MB-tree
I-frames need to have VBV lookahead run on them as well.

14 years agoAdd support for frame-accurate parameter changes
Fiona Glaser [Wed, 19 Aug 2009 01:37:26 +0000 (18:37 -0700)]
Add support for frame-accurate parameter changes
Parameter structs can now be passed with individual frames.
The previous method would only change the parameter of what was currently being encoded, which due to delay might be very far from an intended exact frame.
Also add support for changing aspect ratio.  Only works in a stream with repeating headers and requires the caller to force an IDR to ensure instant effect.

14 years agoFix x264_encoder_reconfig with multithreading
Fiona Glaser [Tue, 18 Aug 2009 22:46:26 +0000 (15:46 -0700)]
Fix x264_encoder_reconfig with multithreading
New behavior: reconfigging the encoder will result in changes being applied
to each of the encoding threads as they finish encoding the current frame.

14 years agoFix two bugs in QPRD
Fiona Glaser [Sun, 16 Aug 2009 10:29:49 +0000 (03:29 -0700)]
Fix two bugs in QPRD
QPRD could in some cases force blocks to skip when they shouldn't be ~(+0.01db)
Force QPRD to abide by qpmin/qpmax restrictions.

14 years agoLookahead VBV
Fiona Glaser [Sun, 16 Aug 2009 02:02:31 +0000 (19:02 -0700)]
Lookahead VBV
Use the large-scale lookahead capability introduced in MB-tree for ratecontrol purposes.
(Does not require MB-tree, however.)
Greatly improved quality and compliance in 1-pass VBV mode, especially in CBR; +2db OPSNR or more in some cases.
Fix some other bugs in VBV, which should improve non-lookahead mode as well.
Change the tolerance algorithm in row VBV to allow for more significant mispredictions when buffer is nearly full.
Note that due to the fixing of an extremely long-standing bug (>1 year), bitrates may change by nontrivial amounts in CRF without MB-tree.

14 years agoFix bug in b-adapt 1
Fiona Glaser [Fri, 14 Aug 2009 14:20:07 +0000 (07:20 -0700)]
Fix bug in b-adapt 1
B-adapt 1 didn't use more than MAX(1,bframes-1) B-frames when MB-tree was off.

14 years agoFix a potential failure in VBV
Fiona Glaser [Fri, 14 Aug 2009 00:13:33 +0000 (17:13 -0700)]
Fix a potential failure in VBV
If VBV does underflow, ratecontrol could be permanently broken for the rest of the clip.
Revert part of the previous VBV changes to fix this.

14 years agonew API function x264_encoder_delayed_frames.
Anton Mitrofanov [Thu, 13 Aug 2009 21:40:21 +0000 (21:40 +0000)]
new API function x264_encoder_delayed_frames.
fix x264cli on streams whose total length is less than the encoder latency.

14 years agoAdd no-mbtree to fprofile (and fix pyramid in fprofile)
Fiona Glaser [Thu, 13 Aug 2009 21:12:26 +0000 (14:12 -0700)]
Add no-mbtree to fprofile (and fix pyramid in fprofile)

14 years agoDon't print a warning about direct=auto in 2pass when B-frames are off
Fiona Glaser [Sun, 9 Aug 2009 23:06:52 +0000 (16:06 -0700)]
Don't print a warning about direct=auto in 2pass when B-frames are off

14 years agofix lowres padding, which failed to extrapolate the right side for some resolutions.
Loren Merritt [Thu, 13 Aug 2009 05:02:59 +0000 (05:02 +0000)]
fix lowres padding, which failed to extrapolate the right side for some resolutions.
fix a buffer overread in x264_mbtree_propagate_cost_sse2. no effect on actual behavior, only theoretical correctness.
fix x264_slicetype_frame_cost_recalculate on I-frames, which previously used all 0 mb costs.
shut up a valgrind warning in predict_8x8_filter_mmx.

14 years agosimd part of x264_macroblock_tree_propagate.
Loren Merritt [Sun, 9 Aug 2009 04:00:36 +0000 (04:00 +0000)]
simd part of x264_macroblock_tree_propagate.
1.6x faster on conroe.