Fix compilation with OpenCL on MacOS X

Also fix crash in the case of OpenCL error during encoding.
Fix building with compilers without inline asm support

Also fix crash in high bit depth builds compiled with unaligned stack.
Fix potential misaligment crash in AVX2 denoise_dct
Fix build with PIC on some systems
Fix possible crash when writing very large filler NALUs

Bitstream-reallocation function didn't handle the case of filler.
OpenCL cosmetics
Interface: if vbv-maxrate < bitrate, set bitrate = vbv-maxrate

This probably makes more sense to the user than setting vbv-maxrate = bitrate,
as before.
Add "--stitchable" option for segmented encoding

Stops x264 from attempting to optimize global stream headers, ensuring that
different segments of a video will have identical headers when used with
identical encoding settings.
Add new color primaries, transfer characteristics, matrix coefficients
x86: faster AVX2 iDCT, AVX deblock_luma_h, deblock_luma_h_intra
Tweak i16x16-delta-quant-avoidance code

Don't omit the delta quant if it'd raise the quantizer to do so; this fixes
a rare flickering issue caused by deblocking.
x86: Remove X264_CPU_SSE_MISALIGN functions

Prevents a crash if the misaligned exception mask bit is cleared for some reason.

Misaligned SSE functions are only used on AMD Phenom CPUs and the benefit is miniscule.
They also require modifying the MXCSR control register and by removing those functions
we can get rid of that complexity altogether.

VEX-encoded instructions also supports unaligned memory operands. I tried adding AVX
implementations of all removed functions but there were no performance improvements on
Ivy Bridge. pixel_sad_x3 and pixel_sad_x4 had significant code size reductions though
so I kept them and added some minor cosmetics fixes and tweaks.
x86: Faster AVX2 pixel_sad_x3 and pixel_sad_x4
x86: SSSE3 implementation of pixel_sad_x3 and pixel_sad_x4
Transparent hugepage support

Combine frame and mb data mallocs into a single large malloc.
Additionally, on Linux systems with hugepage support, ask for hugepages on
large mallocs.

This gives a small performance improvement (~0.2-0.9%) on systems without
hugepage support, as well as a small memory footprint reduction.

On recent Linux kernels with hugepage support enabled (set to madvise or
always), it improves performance up to 4% at the cost of about 7-12% more
memory usage on typical settings..

It may help even more on Haswell and other recent CPUs with improved 2MB page
support in hardware.
Fix AVX2 detection bug on some CPUs