mpegvideo_enc: rework direct mode check

Remove stray semicolon and share codepaths.

CC: libav-stable@libav.org
Bug-Id: CID 991857
mpegvideo_enc: factor out denominator and explicitly cast operands

CC: libav-stable@libav.org
Bug-Id: CID 608053
mpeg12enc: factor out check in encode_dc

Makes coverity less confused and the code more readable.

CC: libav-stable@libav.org
Bug-Id: CID 751744
mpeg12dec: simplify context duplication

CC: libav-stable@libav.org
Bug-Id: CID 717453 / CID 717454 / CID 717915
pthreads_frame: Do not leak on failure path

CC: libav-stable@libav.org
Bug-Id: CID 1135767
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
mjpegdec: fix undefined shift

Add a comment to explain the code.

CC: libav-stable@libav.org
Bug-Id: CID 1194388
Merge commit 'e0a1d0a2b04eb5220d00fc7ce46a57cc5e3c7118'

* commit 'e0a1d0a2b04eb5220d00fc7ce46a57cc5e3c7118':
  mpegvideo_enc: rework direct mode check

Conflicts:
	libavcodec/mpegvideo_enc.c

See: ad985671986464015f3136ad6882ef232c19fc22
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '0a6664706168dc1049967bec311970d720581625'

* commit '0a6664706168dc1049967bec311970d720581625':
  mpegvideo_enc: factor out denominator and explicitly cast operands

Conflicts:
	libavcodec/mpegvideo_enc.c

See: c753b56b4d56724284dd7ed972efdb843db80f12
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '37b3361e755361d4ff14a2973df001c0140d98d6'

* commit '37b3361e755361d4ff14a2973df001c0140d98d6':
  mpeg12enc: factor out check in encode_dc

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '5d29efe4b0154ce305d66fed2ac23e5842439256'

* commit '5d29efe4b0154ce305d66fed2ac23e5842439256':
  mpeg12dec: simplify context duplication

Not merged, theres no point in copying data and afterwards zeroing it
Also zeroing is not correct on its own

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit 'ac4a5e3abd8a022ab32245ad527ffc37eabab8b1'

* commit 'ac4a5e3abd8a022ab32245ad527ffc37eabab8b1':
  pthreads_frame: Do not leak on failure path

See: 11679e1b90f6e52a3643efb45d06ea5adf65098a
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Merge commit '199d9f995da53fe2507821f6d96bbc692574e1a9'

* commit '199d9f995da53fe2507821f6d96bbc692574e1a9':
  mjpegdec: fix undefined shift

Conflicts:
	libavcodec/mjpegdec.c

See: b4329605289e25bb071ec1c1182bf25fc83b09aa
Merged-by: Michael Niedermayer <michaelni@gmx.at>
lavd/avfoundation: Update documentation to mention audio capabilities.

Reviewed-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>