Fix build with Android NDK

Android NDK does not expose sched_getaffinity.
Really fix quantization factor allocation

Actually allocate less (instead of just initialize less) and fix comments.
x86: Pass -Worphan-labels to yasm

Makes it easier to detect typos.
x86inc: warn if XOP integer FMA instruction emulation is impossible

Emulation requires a temporary register if arguments 1 and 4 are the same; this
doesn't obey the semantics of the original instruction, so we can't emulate
that in x86inc.

ffmpeg has an x86util emulation for that case; I'll add it if x264's asm ever
needs it.

Also add pmacsdql emulation.
x86inc: Support arbitrary stack alignments

If the stack is known to be at least 32-byte aligned we can safely store ymm
registers on the stack without doing manual alignment.

Change ALLOC_STACK to always align the stack before allocating stack space for
consistency. Previously alignment would occur either before or after allocating
stack space depending on whether manual alignment was required or not.
Fix pointer cast warning for 64-bit builds
x86: Minor mbtree_propagate_cost improvements

Reduce the number of registers used from 7 to 6.
Reduce the number of vector registers used by the AVX2 implementation from 8 to 7.
Multiply fps_factor by 1/256 once per frame instead of once per macroblock row.
Use mova instead of movu for dst since it's guaranteed to be aligned.
Some cosmetics.
Write 3D metadata when outputting Matroska

For when --frame-packing is set.
Don't set chroma_loc_info_present_flag for non-4:2:0

The H.264 spec says it shouldn't be set in these cases.
x86: SSE2 and SSSE3 plane_copy_deinterleave_rgb

About 5.6x faster than C on Haswell.
x86inc: free up variable name "n" in global namespace
Fix corruption with CAVLC overflow handling in MBAFF+main profile

Probably a regression in 83561e.
configure: correctly support gpac 0.5.0
Macroblock tree overhaul/optimization

Move the second core part of macroblock tree into an assembly function;
SIMD-optimize roughly half of it (for x86). Roughly ~25-65% faster mbtree,
depending on content.

Slightly change how mbtree handles the tradeoff between range and precision
for propagation.

Overall a slight (but mostly negligible) effect on SSIM and ~2% faster.
Merge branch 'plain' into tMod

Conflicts:
	common/cpu.h
	output/matroska.c
	output/matroska_ebml.c
	output/matroska_ebml.h