output example: set the stream timebase

This is required by the new API.
output example: convert audio to the format supported by the encoder
hevcdsp: remove an unneeded variable in the loop filter

beta0 and beta1 will always be the same
hevc: SSE2 and SSSE3 loop filters

Additional contributions by James Almer <jamrial@gmail.com>,
Carl Eugen Hoyos <cehoyos@ag.or.at>, Fiona Glaser <fiona@x264.com> and
Anton Khirnov <anton@khirnov.net>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
Merge commit '884f7c975f0af25febe86660e87bf3b2165a0309'

* commit '884f7c975f0af25febe86660e87bf3b2165a0309':
  output example: set the stream timebase

Conflicts:
	doc/examples/muxing.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/muxing: move swr context to OutputStream

Idea from: 56f98e340fca894a76d1ddbe33118b8d8c4db34a
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/muxing: pick a supported channel layout if stereo isnt supported by the encoder

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/muxing: select a supported sample rate for the encoder, favor 44100

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/muxing: Support setting flags, for example for setting bitexact

This would allow the example to be used in regression tests

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '56f98e340fca894a76d1ddbe33118b8d8c4db34a'

* commit '56f98e340fca894a76d1ddbe33118b8d8c4db34a':
  output example: convert audio to the format supported by the encoder

Conflicts:
	doc/examples/muxing.c

Not merged as our example code already does that for what is needed
and we generate matching data for the rest. generating fixed data
and converting all parameters could be done of course.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
avcodec: Mark argument in av_{parser|hwaccel|bitstream_filter}_next as const
avformat: Mark argument in av_{i|o}format_next/ffurl_protocol_next as const
avformat: Mark AVOutputFormat argument in avformat_query_codec as const
Merge commit '73bb8f61d48dbf7237df2e9cacd037f12b84b00a'

* commit '73bb8f61d48dbf7237df2e9cacd037f12b84b00a':
  hevcdsp: remove an unneeded variable in the loop filter

Conflicts:
	libavcodec/hevc_filter.c

See: d7e162d46b4a0fc03ca5161cdcac840152f048cb
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '1a880b2fb8456ce68eefe5902bac95fea1e6a72d'

* commit '1a880b2fb8456ce68eefe5902bac95fea1e6a72d':
  hevc: SSE2 and SSSE3 loop filters

Conflicts:
	libavcodec/hevcdsp.c
	libavcodec/hevcdsp.h
	libavcodec/x86/Makefile
	libavcodec/x86/hevc_deblock.asm
	libavcodec/x86/hevcdsp_init.c

See: de7b89fd43f850d77cf24ad6ae50185dfe391e91 and several others
Merged-by: Michael Niedermayer <michaelni@gmx.at>
avcodec/x86/hevcdsp_init: make license header consistent

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
x86/hevc_idct: add 12bit idct_dc

Signed-off-by: James Almer <jamrial@gmail.com>
Reviewed-by: Mickaël Raulet <mraulet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/muxing: free swr context at the end

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/muxing: Move samples_count to OutputStream

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
doc/examples/muxing: add alloc_audio_frame() and use it to simplify code.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>