Squashed 'captive/libx264/csrc/' changes from 69a0443..a3ac64b

a3ac64b OpenCL support improvement/refactoring
c47347c x86: shave a few instructions off AVX deblock
b547a4e x86: AVX2 dequant_4x4_dc
907573d x86: AVX2 high bit-depth dequant
442c6a4 x86-64: 64-bit variant of AVX2 hpel_filter
26a6451 x86: AVX2 high bit-depth denoise_dct
db95d6a x86: AVX2 high bit-depth quant
327386f x86: AVX2 add16x16_idct_dc
c82db4e x86: faster AVX2 quant_4x4x4
b79f4a6 x86: AVX2 intra_sad_x3_8x8c
2c0bca3 x86: AVX2 high bit-depth intra_sad_x3_8x8
b2c30e1 x86: AVX2 deblock strength
37edf16 x86: Faster high bit-depth intra_sad_x3_4x4
a9ed051 x86: faster SSSE3 hpel
9373d5f x86-64: faster SSSE3 trellis
2a71604 x86: 32-byte align the stack if possible
eefaff1 x86inc: Utilize the shadow space on 64-bit Windows
b4be6e5 x86: Don't use explicitly aligned versions of SAD on AVX CPUs
99f553e x86: Add missing initializations for high bit-depth sad_aligned
42f2f78 x86: add Jaguar CPU detection
f12a17f x86inc: Remove .rodata kludges
c3b166a checkasm: Use 64-bit cycle counters
e943696 checkasm: Fix stack alignment bug
b1749e2 Fix invalid memcpy in sliced-threads
76a5c3a Fix two bugs in slice-min-mbs and slices-max
3b1f1f7 x86: SSSE3 LUT-based faster coeff_level_run
c05bf54 x86-64: BMI2 cabac_residual functions
437f808 x86: SSSE3 ads_mvs
2ad961f x86: AVX2 pixel_ssd_nv12_core
40406b8 x86: AVX2 high bit-depth pixel_ssd
c2852be x86: AVX2 high bit-depth pixel_sad_x3/pixel_sad_x4
fa9dcd0 x86: AVX2 high bit-depth vsad
567d036 x86: AVX2 high bit-depth pixel_sad
6cc9f16 x86: AVX2 high_bit_depth pixel_avg2, get_ref, mc_copy_w16, mc_luma
c371128 x86: AVX2 nal_escape
255271f x86: AVX memzero_aligned
43632cc x86: AVX2 predict_16x16_dc
dcad117 x86: AVX2 predict_8x8c_p/predict_8x16c_p
f5bff68 x86: AVX2 predict_16x16_p
92eb201 x86: AVX high bit-depth predict_16x16_v
16f3261 x86: AVX2 high bit-depth predict_4x4_h
a38b5fc x86: AVX2 high bit-depth predict_16x16_h
89f8263 x86: AVX2 high bit-depth predict_8x8c_h/predict_8x16c_h
78b8af8 x86util: Support ymm registers in HADD macros
d07b421 x86: more AVX2 framework, AVX2 functions, plus some existing asm tweaks
e228f65 x86inc: create xm# and ym#, analagous to m#
e916dfb x86inc: fix AVX emulation of cmp(p|s)(s|d)
5b01ce1 x86-64: cabac_block_residual assembly
3a5f6c0 OpenCL lookahead
e436158 weightp: improve scale/offset search, chroma
389d06e Add slices-max feature
f546e98 Add slice-min-mbs feature
1db4621 Disable mbtree asm with cpu-independent option
fceb3b1 Show "avs: no" --disable-avs option instead of empty string
68ee80a lavf input: don't use deprecated AVStream fields
5980580 Fix y4m input with C420paldv colorspace
580cc69 x86: correctly check stack alignment for Atom hadamard_ac
b3c15fc x86inc: fix some corner cases of SWAP
89aecb4 Fix array overreads that caused miscompilation in gcc 4.8
e355b0e Fix undefined behavior in x264_ratecontrol_mb
c832fe9 ARM: Fix bug in x264_quant_4x4x4_neon
b3065e6 ARM: update NEON mc_chroma to work with NV12 and re-enable it
e82cf2c CABAC/CAVLC: use the new bit-iterating macro here too
253e2c3 quant_4x4x4: quant one 8x8 block at a time
eaae05e Add AvxSynth support to the AviSynth input module.
b2c70f6 Eliminate some branchiness in ME/analysis
9d600d6 Fix some store forwarding stalls There's quite a few others, but most of them don't help to fix or there's no easy way to avoid them.
9fe40b1 x86: faster AVX satd/sa8d/sa8d_satd/hadamard_ac
4f24bb3 x86: detect Bobcat, improve Atom optimizations, reorganize flags
d556d55 x86: combined SA8D/SATD dsp function
5c2ca5d x86: port SSE2+ SATD functions to high bit depth
b09bc0c x86: faster high bit depth ssd
9104985 x86: optimize and clean up predictor checking Branchlessly handle elimination of candidates in MMX roundclip asm. Add a new asm function, similar to roundclip, except without the round part. Optimize and organize the C code, and make both subme>=3 and subme<3 consistent. Add lots of explanatory comments and try to make things a little more understandable. ~5-10% faster with subme>=3, ~15-20% faster with subme<3.
a216e5c Fix two bugs in predictor checking pmv wasn't checked properly in some cases, as well as zero vector. Output-changing portion of the following patch.
4d220bc Improve lookahead-threads auto selection Smarter decision to improve fast-first-pass performance in 2-pass encodes. Dramatically improves CPU utilization on multi-core systems.
c63a518 x86: Use SSE instead of SSE2 for copying data
0ce5b43 64-bit cabac optimizations
51a5976 configure: add QNX support
486ff39 Windows: Enable DEP and ASLR
8da42b7 x86inc: Set ELF hidden visibility for global constants
9890192 x86inc: Add cvisible macro for C functions with public prefix
91b0f0e x86inc: rename program_name to private_prefix Synced from libav. The new name is more descriptive and will allow defining a separate public prefix for externally visible library symbols.
a4e7759 x264.h: improve x264_encoder_reconfig documentation
ce9efea Cosmetics: stricter definition of parameterless functions
e403db4 Update "Install and compile x264" in doc/regression_test.txt
c13fbaf Fix possible non-determinism with mbtree + open-gop + sync-lookahead
736d69b x86: don't use the red zone on win64
637005e x86-64: fix trellis asm with interlacing
ba5ce76 x86-32: use simple nop codes for <= sse
bc13772 Bump dates to 2013
3508f4a x86inc: Drop tzcnt workaround
b924133 AVX2/FMA3 version of mbtree_propagate First AVX2 function for testing. Bump yasm version to 1.2.0 for AVX2 support.
d967c09 x86inc: Use VEX-encoded instructions in AVX functions Automatically use VEX-encoding in AVX/AVX2/XOP/FMA3/FMA4 functions for all instructions that exists in a VEX-encoded version. This change makes it easier to extend existing code to use AVX2. Also add support for AVX emulation of a few instructions that were missing before.
f6c6286 x86inc: activate REP_RET automatically Now RET checks whether it immediately follows a branch, so the programmer dosen't have to keep track of that condition. REP_RET is still needed manually when it's a branch target, but that's much rarer. The implementation involves lots of spurious labels, but that's ok because we strip them.
755fece x86inc: support stack mem allocation and re-alignment in PROLOGUE Use this in 8-bit loopfilter functions so they can be used if there is no aligned stack (e.g. x86-32 MSVC or ICC 10.x).
c69e2d0 Update config.guess and config.sub
9c4ba4b Fix crash if the first frame is forced to a non-keyframe This is obviously bad user input, but x264 shouldn't crash if it happens.
593e8cc Fix build on ARM with binutils >= 2.23.51.0.6 GAS doesn't seem to like spaces in vld1 anymore, so remove those.
55b5162 Fix pthread_join emulation on win32 and BeOS Doesn't actually affect x264, but it's more correct.
0059dcf Fix typo in r2222 Slightly wrong numbers in level table.
28ee1f4 configure: fix gpac detection with -Wp,-D_FORTIFY_SOURCE=2
67a69c0 Solaris: use sysconf to get processor count Solaris responds correctly to the same value as Cygwin, so let's use that.
6e68ab7 lavf input: allocate AVFrame correctly Allocate AVFrames correctly with avcodec_alloc_frame(). This caused crashes with newer libavcodecs that try to free frame extradata.
a632fe1 Fix crash when using libx264.dll compiled with ICL for X86_64
1cffe9f Fix possible issues with out-of-spec QP values Fixes a possible regression in r2228.
349b9bd Attempt to optimize PPS pic_init_qp in 2-pass mode Small compression improvement; up to ~0.5% in extreme cases. Helps more with small slice sizes (tiny resolutions or slice-max-size). Note that this changes the 2-pass stats file format.
8437d0d Improve slice header QP selection Use the first macroblock of each slice instead of the last of the previous. Lets us pick a reasonable initial QP for the first slice too. Slightly improved compression.
d2d8364 Update level dpb size calculation to match newer H.264 spec Doesn't actually change encoding behavior, but makes it more correct. Warning messages should now be accurate at higher bit depths and non-4:2:0. Technically, since it redefines x264_level_t, this is an API version increment.
28ddb0d Add support for the ffmpeg/vapoursynth high bit depth y4m extensions
64cbe75 x86inc: Rename 3dnow2 to 3dnowext The name "3dnowext" is more common than "3dnow2". Doesn't affect x264.
f418867 x86inc: only define program_name if the macro is unset. This allows overriding the value from outside the file. This can be useful if x86inc.asm is used outside of x264.
f6a8615 Disable ARM NEON MRC CPU test for Apple devices The Apple A6 CPU doesn't support performance counters, so this test caused a crash.
6889f2c Fix crash with no-scenecut + mbtree
4dbfcd4 Fix reconfiguring to crf=0 Lossless mode can't currently be enabled mid-stream.
2ec8c64 Fix ALIGNED_ARRAY_EMU macros on ICL ICL's preprocessor doesn't handle it correctly. This fix is similar to libav's fix in 0db2d9.
2f154ac Fix use of deprecated av_close_input_file call
9fc0065 Fix pkg-config for dynamic vs static linking
b22f22f Set libm in the configure script if the OS has libm Prerequisite for another configure patch after this. Idea copied from libpthread.
198a7ea Enhance mb_info: add mb_info_update This feature lets the callee know which decoded macroblocks have changed.
f6e9002 Fix mb_info_free with sliced threads x264 would free mb_info before it was completely done using it.
de725e9 Enhance nalu_process Add the input frame opaque pointer to the arguments. This makes it easier to use with multiple simultaneous x264 encodes.
174cfac Improve mb_info constant mb optimization Allow fast skipping even if the pskip MV isn't zero.
f57e707 Export the average effective CRF of each frame Useful to judge the resulting quality of a frame when VBV is enabled.
d7fd6cc Remove special-casing for OpenBSD pthread handling Previously it was policy to use -pthread, but OpenBSD now recommends -lpthread. its been libpthread anyway and policy has changed to stop using -pthread.
8f76448 x86inc: automatically insert vzeroupper for YMM functions Backported from libav.
68dfb7b Free user supplied data when deleting a frame This eliminates a memory leak when calling x264_encoder_close.
d9d2288 Revert r2204 People don't seem to like this so I'm just going to get rid of it.
5f615f7 Faster predictor checking with subme<3 Fix a typo that made an early-skip less effective. Avoid a relatively unpredictable branch. Slightly changed output due to the typo-fix. ~50 cycles faster on Core i7.
5af86be Try 8x8 transform analysis even when sub8x8 partitions are present Turn off the sub8x8 partitions, try it, and turn them back on if it didn't help. Small compression improvement with p4x4 on (~0.1-0.5%). Also update related comments.
913485d Support changing resolutions between passes with macroblock-tree Implement a basic separable bilinear filter to rescale the quantizer offsets. Structure inspired by swscale, but floating-point instead of fixed-point. Not as optimized as it could be, but it's quite fast already.
8b535d9 Print elapsed time in encoding progress indicator
11e32c5 Cap ratecontrol predictor parameters Limits VBV mispredictions after long periods of relatively constant video.
e21e9c9 x86inc: import patches from libav Allow manual invocation of WIN64_SPILL_XMM even under INIT_MMX SSE version of mova is movaps rather than movdqa. YMM version of movnta. Add mp size for named arguments. Fix DEFINE_ARGS when used outside of a cglobal. Define a few more cpuflags. 3-argument wrappers for a few more instructions.
37be552 Fix crash with --fps 0 Fix some integer overflows and check input parameters better. Also fix incorrect type specifiers for demuxer info printing.
999b753 Threaded lookahead
ecfbf9d Add support for RGB formats in bit-depth conversion filter
1c97f35 Fix some bugs in mb_info code

git-subtree-dir: captive/libx264/csrc
git-subtree-split: a3ac64b8b467eea1264c0053022893bc84b2e9a2
Merge commit '7c1f5a0387c84239383949d4bf79841ef755babe' into development

Latest libx264