Fiona Glaser [Thu, 4 Sep 2008 05:12:23 +0000 (22:12 -0700)]
CAVLC cleanup and optimizations
Also move some small functions in macroblock.c to a .h file so they can be inlined.
Fiona Glaser [Thu, 4 Sep 2008 04:43:06 +0000 (21:43 -0700)]
Faster avg_weight assembly
Unrolling the loop a bit improves performance
Fiona Glaser [Wed, 3 Sep 2008 22:35:22 +0000 (15:35 -0700)]
Faster H asm intra prediction functions
Take advantage of the H prediction method invented for merged intra SAD and apply it to regular prediction, too.
Fiona Glaser [Wed, 3 Sep 2008 22:32:16 +0000 (15:32 -0700)]
Add merged SAD for i16x16 analysis
Roughly 30% faster i16x16 analysis under subme=1
Fiona Glaser [Wed, 3 Sep 2008 22:15:17 +0000 (15:15 -0700)]
Add sad_aligned for faster subme=1 mbcmp
Distinguish between unaligned and aligned uses of mbcmp
SAD_aligned, for MMX SADs, uses non-cacheline SADs.
Fiona Glaser [Tue, 2 Sep 2008 18:49:55 +0000 (11:49 -0700)]
Improve progress indicator
Show average bitrate so far during encoding
Decrease update interval for longer encodes (max of 10 frames encoded between updates)
Fiona Glaser [Mon, 1 Sep 2008 17:35:41 +0000 (10:35 -0700)]
Fix speed regression in r951
Row SATDs are only necessary in VBV mode, so don't need to be checked if VBV is off.
Holger Lubitz [Mon, 1 Sep 2008 02:55:50 +0000 (20:55 -0600)]
zigzag asm
Guillaume Poirier [Sun, 31 Aug 2008 19:46:31 +0000 (21:46 +0200)]
fix SOFLAGS used when building gtk frontend
patch by Markus Kanet %darkvision A gmx P eu%
Loren Merritt [Thu, 21 Aug 2008 02:56:56 +0000 (20:56 -0600)]
remove the distinction between itex and ptex
(changes 2pass statsfile format)
Loren Merritt [Thu, 21 Aug 2008 02:51:39 +0000 (20:51 -0600)]
hardcode the ratecontrol equation, and remove the rceq option
Fiona Glaser [Wed, 27 Aug 2008 17:14:36 +0000 (13:14 -0400)]
Fix some uses of uninitialized row_satd values in VBV
Resolves some issues with QP51 in I-frames with scenecut
Fiona Glaser [Tue, 26 Aug 2008 18:51:29 +0000 (14:51 -0400)]
Activate trellis in p8x8 qpel RD
Also clean up macroblock.c with some refactoring
Note that this change significantly reduces subme7+trellis2 performance, but improves quality.
Issue originally reported by Alex_W.
Gabriel Bouvigne [Mon, 25 Aug 2008 14:50:45 +0000 (10:50 -0400)]
Improve VBV accuracy
Don't use the previous frame's row SATD as a predictor if it is too different from this frame's row SATD.
Guillaume Poirier [Fri, 22 Aug 2008 19:05:37 +0000 (21:05 +0200)]
improve generation of Darwin libraries
Patch by vmrsss %vmrsss A gmail P com%
Fiona Glaser [Fri, 22 Aug 2008 01:23:08 +0000 (21:23 -0400)]
Fix compilation in gcc 3.4.x (issue in r946)
Due to a bug in gcc 3.4.x, in certain cases of inlining, the array_non_zero_int_mmx inline asssembly is miscompiled and causes a crash with --subme 7 --8x8dct.
This minor hack fixes this issue.
Loic Le Loarer [Thu, 21 Aug 2008 10:19:24 +0000 (04:19 -0600)]
shut up various gcc warnings
Loren Merritt [Thu, 21 Aug 2008 10:15:49 +0000 (04:15 -0600)]
fix a crash with invalid args and --thread-input (introduced in r921)
Loren Merritt [Wed, 20 Aug 2008 11:36:32 +0000 (05:36 -0600)]
drop support for x86_32 PIC.
Loren Merritt [Tue, 19 Aug 2008 07:55:57 +0000 (01:55 -0600)]
use permute macros in satd
move some more shared macros to x264util.asm
Loren Merritt [Thu, 21 Aug 2008 02:32:13 +0000 (20:32 -0600)]
cosmetics
Loren Merritt [Thu, 21 Aug 2008 01:00:52 +0000 (19:00 -0600)]
r940 broke threads
Fiona Glaser [Wed, 20 Aug 2008 17:28:15 +0000 (13:28 -0400)]
Cleanups in macroblock_cache_save/load
A bit more loop unrolling, and moving some constant code to the global init function
Fiona Glaser [Tue, 19 Aug 2008 20:18:24 +0000 (14:18 -0600)]
Deblocking code cleanup and cosmetics
Convert the style of the deblocking code to the standard x264 style
Eliminate some trailing whitespace
Fiona Glaser [Tue, 19 Aug 2008 05:03:37 +0000 (23:03 -0600)]
4% faster deblock: special-case macroblock edges
Along with a bit of related code reorganization and macroification
David Pethes [Sat, 16 Aug 2008 15:43:26 +0000 (09:43 -0600)]
Add dedicated variance function instead of using SAD+SSD
Faster variance calculation
Loren Merritt [Fri, 15 Aug 2008 09:04:28 +0000 (03:04 -0600)]
6% faster deblock: remove some clips, earlier termiantion on low qps.
Fiona Glaser [Fri, 15 Aug 2008 01:31:42 +0000 (19:31 -0600)]
Faster deblocking
Early termination for bS=0, alpha=0, beta=0
Refactoring, various other optimizations
About 30% faster deblocking overall.
Loren Merritt [Sat, 2 Aug 2008 14:19:50 +0000 (08:19 -0600)]
asm cosmetics
Daniel Vergien [Wed, 6 Aug 2008 14:10:53 +0000 (08:10 -0600)]
yet another posix-emulating define on solaris
Gabriel Bouvigne [Wed, 6 Aug 2008 13:45:05 +0000 (07:45 -0600)]
update msvc projectfile
Loren Merritt [Wed, 6 Aug 2008 13:34:42 +0000 (07:34 -0600)]
drop support for msvc6
Fiona Glaser [Sat, 9 Aug 2008 15:36:04 +0000 (09:36 -0600)]
Prevent VBV from lowering quantizer too much
This code seemed to act up unexpectedly sometimes, creating a situation where in 1-pass VBV mode, a frame's quantizer would drop all the way to qpmin and then shoot back upwards to qpmax, causing serious visual issues.
This change may decrease bitrate in VBV mode, but that is preferable to the artifacting produced by this code.
Fiona Glaser [Sat, 9 Aug 2008 15:34:37 +0000 (09:34 -0600)]
Improve subme7 at low QPs and add subme7 support in lossless mode
Loren Merritt [Thu, 31 Jul 2008 04:35:20 +0000 (22:35 -0600)]
cosmetics: merge x86inc*.asm
Fiona Glaser [Wed, 30 Jul 2008 21:29:46 +0000 (15:29 -0600)]
Add missing x264util.asm
Fiona Glaser [Wed, 30 Jul 2008 21:28:21 +0000 (15:28 -0600)]
Basic sanity checking of qpmax/qpmin options
Fiona Glaser [Wed, 30 Jul 2008 20:42:29 +0000 (14:42 -0600)]
Fix regression in r922
set the chroma DC coefficients to zero for residual coding in qpel-rd
fix C99ism
Holger Lubitz [Wed, 30 Jul 2008 03:36:01 +0000 (21:36 -0600)]
Refactor asm macros part 2: DCT
Holger Lubitz [Wed, 30 Jul 2008 03:26:58 +0000 (21:26 -0600)]
Refactor asm macros part 1: DCT
Fiona Glaser [Tue, 29 Jul 2008 23:08:38 +0000 (17:08 -0600)]
Improve intra RD refine, speed up residual_write_cabac
a do/while loop can be used for residual_write, but i8x8 had to be fixed so that it wouldn't call residual_write with zero coeffs
proper nnz handling added to cabac intra rd refine
chroma cbp added to 8x8 chroma rd
cbp was tested, but wasn't useful
Fiona Glaser [Tue, 29 Jul 2008 19:42:41 +0000 (13:42 -0600)]
Fix a few more minor memleaks
Loren Merritt [Sat, 26 Jul 2008 00:14:31 +0000 (18:14 -0600)]
stats summary: print distribution of numbers of consecutive B-frames
Loic Le Loarer [Fri, 25 Jul 2008 22:08:32 +0000 (16:08 -0600)]
add interlacing to the list of stuff checked by x264_validate_levels
Fiona Glaser [Thu, 24 Jul 2008 13:58:50 +0000 (07:58 -0600)]
Fix C99-ism in r907
Fiona Glaser [Fri, 18 Jul 2008 00:17:22 +0000 (18:17 -0600)]
Faster temporal predictor calculation
Split into a separate commit because this changes rounding, and thus changes output slightly.
Fiona Glaser [Thu, 17 Jul 2008 13:55:24 +0000 (07:55 -0600)]
Align lowres planes for improved cacheline split performance
Loren Merritt [Wed, 16 Jul 2008 02:16:16 +0000 (20:16 -0600)]
autodetect level based on resolution/bitrate/refs/etc, rather than defaulting to L5.1
if vbv is not enabled (and especially in crf/cqp), we have to guess max bitrate, so we might underestimate the required level.
Loren Merritt [Fri, 18 Jul 2008 02:25:03 +0000 (20:25 -0600)]
fix bs_write_ue_big for values >= 0x10000.
(no immediate effect, since nothing writes such values yet)
BugMaster [Wed, 16 Jul 2008 17:54:51 +0000 (11:54 -0600)]
Fix lossless mode borked in r901
Fiona Glaser [Sat, 12 Jul 2008 20:37:58 +0000 (14:37 -0600)]
Relax QPfile restrictions
Allow a QPfile to contain fewer frames than the total number of frames in the video and have ratecontrol fill in the rest.
Patch by kemuri9.
Fiona Glaser [Sat, 12 Jul 2008 20:10:38 +0000 (14:10 -0600)]
Limit MVrange correctly in interlaced mode
Bug report by Sigma Designs, Inc.
Fiona Glaser [Sat, 12 Jul 2008 04:53:27 +0000 (22:53 -0600)]
Fix bug with PCM and adaptive quantization
In rare cases CABAC desync could occur, causing bitstream corruption
BugMaster [Fri, 11 Jul 2008 22:00:02 +0000 (16:00 -0600)]
Fix memory leak upon x264 closing
Doesn't affect the CLI, but potentially important for programs which call x264 as a shared library.
Fiona Glaser [Fri, 11 Jul 2008 21:45:54 +0000 (15:45 -0600)]
Fix compilation on PPC systems (borked in r903)
Bigendian systems didn't have endian_fix32 defined
Fiona Glaser [Fri, 11 Jul 2008 20:16:18 +0000 (14:16 -0600)]
Add L1 reflist and B macroblock types to x264 info
Also remove display of "PCM" if PCM mode is never used in the encode.
L1 reflist information will only show if pyramid coding is used.
Fiona Glaser [Thu, 10 Jul 2008 14:36:45 +0000 (08:36 -0600)]
Fix and enable I_PCM macroblock support
In RD mode, always consider PCM as a macroblock mode possibility
Fix bitstream writing for PCM blocks in CAVLC and CABAC, and a few other minor changes to make PCM work.
PCM macroblocks improve compression at very low QPs (1-5) and in lossless mode.
Loren Merritt [Sat, 5 Jul 2008 03:03:26 +0000 (21:03 -0600)]
de-duplicate vlc tables
Loren Merritt [Sat, 5 Jul 2008 00:56:30 +0000 (18:56 -0600)]
faster ue/se/te write
Fiona Glaser [Sat, 5 Jul 2008 00:32:32 +0000 (18:32 -0600)]
faster bs_write
Loren Merritt [Thu, 3 Jul 2008 06:37:16 +0000 (00:37 -0600)]
cosmetics in ssd asm
Fiona Glaser [Sun, 6 Jul 2008 18:59:15 +0000 (12:59 -0600)]
Various optimizations and cosmetics
Update AUTHORS file with Gabriel and me
update XCHG macro to work correctly in if statements
Add new lookup tables for block_idx and fdec/fenc addresses
Slightly faster array_non_zero_count_mmx (patch by holger)
Eliminate branch in analyse_intra
Unroll loops in and clean up chroma encode
Convert some for loops to do/while loops for speed improvement
Do explicit write-combining on --me tesa mvsad_t struct
Shrink --me esa zero[] array
Speed up bime by reducing size of visited[][][] array
Fiona Glaser [Sun, 6 Jul 2008 17:15:19 +0000 (11:15 -0600)]
Resolve floating point exception with frame_init_lowres mmx
In some cases, the mmx version of frame_init_lowres could leave the FPU uninitialized for use in ratecontrol, resulting in floating point exceptions.
Since frame_init_lowres is such a time-consuming function, an emms was just put at the end, since it costs almost nothing compared to the total time of frame_init_lowres.
Eric Petit [Fri, 4 Jul 2008 09:31:32 +0000 (11:31 +0200)]
Update my email address
Fiona Glaser [Fri, 4 Jul 2008 02:05:00 +0000 (20:05 -0600)]
Update file headers throughout x264
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
Fiona Glaser [Thu, 3 Jul 2008 02:59:24 +0000 (20:59 -0600)]
denoise_dct asm
Loren Merritt [Thu, 3 Jul 2008 02:55:10 +0000 (20:55 -0600)]
cosmetics in permutation macros
SWAP can now take mmregs directly, rather than just their numbers
Fiona Glaser [Wed, 2 Jul 2008 16:43:57 +0000 (10:43 -0600)]
Fix bug in adaptive quantization
In some cases adaptive quantization did not correctly calculate the variance.
Bug reported by MasterNobody
Loren Merritt [Sun, 29 Jun 2008 06:00:03 +0000 (00:00 -0600)]
lowres_init asm
rounding is changed for asm convenience. this makes the c version slower, but there's no way around that if all the implementations are to have the same results.
Fiona Glaser [Wed, 2 Jul 2008 05:42:39 +0000 (23:42 -0600)]
Optimizations and cosmetics in macroblock.c
If an i4x4 dct block has no coefficients, don't bother with dequant/zigzag/idct. Not useful for larger sizes because the odds of an empty block are much lower.
Cosmetics in i16x16 to be more consistent with other similar functions.
Add an SSD threshold for chroma in probe_skip to improve speed and minimize time spent on chroma skip analysis.
Rename lambda arrays to lambda_tab for consistency.
Gabriel Bouvigne [Fri, 27 Jun 2008 03:09:55 +0000 (21:09 -0600)]
some asm functions require aligned stack. disable these when compiling with msvc/icc.
Fiona Glaser [Tue, 24 Jun 2008 21:27:41 +0000 (15:27 -0600)]
Move bitstream end check to macroblock level
Additionally, instead of silently truncating the frame upon reaching the end of the buffer, reallocate a larger buffer instead.
Fiona Glaser [Tue, 24 Jun 2008 18:23:50 +0000 (12:23 -0600)]
Convert NNZ to raster order and other optimizations
Converting NNZ to raster order simplifies a lot of the load/store code and allows more use of write-combining.
More use of write-combining throughout load/save code in common/macroblock.c
GCC has aliasing issues in the case of stores to 8-bit heap-allocated arrays; dereferencing the pointer once avoids this problem and significantly increases performance.
More manual loop unrolling and such.
Move all packXtoY functions to macroblock.h so any function can use them.
Add pack8to32.
Minor optimizations to encoder/macroblock.c
Loren Merritt [Thu, 12 Jun 2008 09:00:23 +0000 (03:00 -0600)]
mc_chroma_sse2/ssse3
Loren Merritt [Thu, 12 Jun 2008 14:43:41 +0000 (08:43 -0600)]
checkasm --bench=function_name
Loren Merritt [Thu, 12 Jun 2008 07:39:22 +0000 (01:39 -0600)]
interleave psnr/ssim computation with reference frame filtering, to improve cache coherency
Fiona Glaser [Sun, 15 Jun 2008 17:59:25 +0000 (11:59 -0600)]
Add more inline asm and a runtime check for MMXEXT support
x264 will now terminate gracefully rather than SIGILL when run on a machine with no MMXEXT support.
A configure option is now available to build x264 without assembly support for support on such old CPUs as the Pentium 2, K6, etc.
Fiona Glaser [Sun, 15 Jun 2008 17:51:36 +0000 (11:51 -0600)]
Use aligned memcpy for x264_me_t struct and cosmetics
Fiona Glaser [Sun, 15 Jun 2008 17:50:17 +0000 (11:50 -0600)]
Cosmetics and loop unrolling
GCC is not very good at loop unrolling in cases where it can perform constant propagation, so the unrolling unfortunately has to be done manually.
Fiona Glaser [Thu, 12 Jun 2008 15:17:49 +0000 (09:17 -0600)]
Fix regression in 64-bit in r882
i_mvc needs to be 64-bit when used with a 64-bit memory pointer
Fiona Glaser [Thu, 12 Jun 2008 14:09:22 +0000 (08:09 -0600)]
More tweaks to me.c
Added inline MMX version of UMH's predictor difference test
Various cosmetics throughout me.c
Removed a C99-ism introduced in r878.
Fiona Glaser [Thu, 12 Jun 2008 00:23:00 +0000 (18:23 -0600)]
Fix regression in r736
r736 added intra RD refinement to B-frames; however, it is possible for subme=7 to be used without b-rdo.
This means intra RD isn't run, and therefore it is possible for intra chroma analysis to not have been run, since update_cache was never called for an intra block, and chroma ME is not required even at subme=7.
r801, which removed a memset, made this worse because previously the chroma prediction mode was at least initialized to zero; now it was not initialized at all.
Therefore, --no-chroma-me, --subme 7, and no --b-rdo had the potential to crash.
This change restricts intra RD refinement to only be run when --b-rdo is enabled (sensible to begin with), thus preventing a crash in this case.
Fiona Glaser [Wed, 11 Jun 2008 03:37:57 +0000 (21:37 -0600)]
Fix regression in r850
Bug resulted in rare incorrect chroma encoding
Gabriel Bouvigne [Wed, 11 Jun 2008 00:40:52 +0000 (18:40 -0600)]
Cosmetics in VBV handling
Fiona Glaser [Wed, 11 Jun 2008 00:34:46 +0000 (18:34 -0600)]
Tweaks and cosmetics in me.c
Use write-combining for predictor checking and other tweaks.
Fiona Glaser [Fri, 6 Jun 2008 20:59:10 +0000 (14:59 -0600)]
Partially inline trellis quantization
Inlining trellis into the 4x4/8x8 trellis wrappers increases trellis speed by about 5-10% through constant propagation.
Fiona Glaser [Fri, 6 Jun 2008 18:32:57 +0000 (12:32 -0600)]
Various cosmetic changes.
Fiona Glaser [Sat, 7 Jun 2008 04:57:33 +0000 (22:57 -0600)]
avg_weight_sse2
Loren Merritt [Sat, 7 Jun 2008 05:31:22 +0000 (23:31 -0600)]
many changes to which asm functions are enabled on which cpus.
with Phenom, 3dnow is no longer equivalent to "sse2 is slow", so make a new flag for that.
some sse2 functions are useful only on Core2 and Phenom, so make a "sse2 is fast" flag for that.
some ssse3 instructions didn't become useful until Penryn, so yet another flag.
disable sse2 completely on Pentium M and Core1, because it's uniformly slower than mmx.
enable some sse2 functions on Athlon64 that always were faster and we just didn't notice.
remove mc_luma_sse3, because the only cpu that has lddqu (namely Pentium 4D) doesn't have "sse2 is fast".
don't print mmx1, sse1, nor 3dnow in the detected cpuflags, since we don't really have any such functions. likewise don't print sse3 unless it's used (Pentium 4D).
Loren Merritt [Sat, 7 Jun 2008 05:30:37 +0000 (23:30 -0600)]
enable ssse3 phadd satd on Penryn.
Loren Merritt [Sat, 7 Jun 2008 04:59:37 +0000 (22:59 -0600)]
benchmark most of the asm functions (checkasm --bench).
Fiona Glaser [Thu, 5 Jun 2008 17:32:05 +0000 (11:32 -0600)]
Cosmetic: fix C99-ism
Fiona Glaser [Thu, 5 Jun 2008 03:28:48 +0000 (21:28 -0600)]
Use a gaussian window for cplxblur
Cplxblur was originally intended to use a gaussian window, but in its current form did not. This change provides a tiny improvement to 2pass ratecontrol.
Loren Merritt [Mon, 2 Jun 2008 15:47:50 +0000 (09:47 -0600)]
cosmetics
Loren Merritt [Mon, 2 Jun 2008 15:40:49 +0000 (09:40 -0600)]
nasm compatible NX stack
Loren Merritt [Mon, 2 Jun 2008 14:57:59 +0000 (08:57 -0600)]
CQP is incompatible with AQ
Fiona Glaser [Sat, 24 May 2008 19:10:21 +0000 (13:10 -0600)]
memzero_aligned_mmx
BugMaster [Sat, 24 May 2008 07:09:07 +0000 (01:09 -0600)]
binmode stdin on mingw, not just msvc
Fiona Glaser [Sat, 24 May 2008 03:22:29 +0000 (21:22 -0600)]
omit redundant mc after non-rdo dct size decision, and in b-direct rdo
Fiona Glaser [Wed, 9 Apr 2008 22:46:51 +0000 (16:46 -0600)]
allow fractional CRF values with AQ.