mem: Don't abort on av_malloc(0) in debug mode

This makes the behaviour consistent between debug and release mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
lavu: use intrinsics for emms on systems lacking inline asm support

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
x86/cpu: implement support for xgetbv through intrinsics

Signed-off-by: Martin Storsjö <martin@martin.st>
x86/cpu: implement support for cpuid through intrinsics

Signed-off-by: Martin Storsjö <martin@martin.st>
x86/cpu: implement get/set_eflags using intrinsics

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
mxfdec: set track edit rate num/den in expected order

This matches the order used for the index table edit rate.

Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mxfdec: detect uncomp pictures using essence container ul

This supports detection of uncompressed picture in files that
didn't include a Picture Coding Label. The lables weren't
available until SMPTE 377-1 and RP224v10

Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mxfdec: set pixel format for cdci picture formats

The properties of the CDCI Descriptor are insufficient to specify
the pixel format for uncompressed picture data. SMPTE 377-1 and
RP224v10 have defined a set of picture coding labels to indicate what
formatting was used.

This patch uses 2 labels to detect UYVY422 or YUYV422 pixel formats.

It defaults to UYVY422 for 8-bit 4:2:2 pictures to support files
that were created before the coding labels were introduced ~2008

The codec pix_fmt default was changed from 0 (PIX_FMT_YUV420P) to
-1 (PIX_FMT_NONE)

Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
mxfdec: truncate packets that extend past the next edit unit

This fixes rare cases where OPAtom may be treated
as OP1a, causing all essence to be read into RAM.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mxfdec: fix Avid AirSpeed files being misinterpreted as OP1a

The "ECs != 1 -> OP1a" assumption was wrong. Luckily, the file
that triggered that behavior had two ECs, not zero. Hence
distinguishing between them is simple in this case.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mxfdec: Add intra_only flag to MXFTrack

This allows future assumptions to be made without affecting non-intra files.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mxfdec: fix frame height vs field height confusion

Reviewed-by: Tomas Härdin <tomas.hardin@codemill.se>
Reveiwed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mxfdec: let pkt->pts = mxf->current_edit_unit if intra-only

We cannot do this in general since we could be reading
a file with B-frames while lacking an index.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mxfdec: only parse next partition pack if parsing forward

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mxfdec: fix off by one error.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
mss1: fix decoding masked regions in interframes

Spotted by Alberto Delmás
configure: Change the rdtsc check to a linker check

A compile-only test could succeed with an implicit function declaration.
Also move the check to the x86 section; rdtsc is x86-only.
x86: cpu: clean up check for cpuid instruction support

This adds macros for accessing the EFLAGS register and uses
these instead of coding the entire check in inline asm.

Signed-off-by: Mans Rullgard <mans@mansr.com>
Merge remote-tracking branch 'qatar/master'

* qatar/master:
  mss1: fix decoding masked regions in interframes
  mxfdec: fix off by one error.
  mxfdec: only parse next partition pack if parsing forward
  mxfdec: let pkt->pts = mxf->current_edit_unit if intra-only
  mxfdec: fix frame height vs field height confusion
  mxfdec: Add intra_only flag to MXFTrack
  mxfdec: fix Avid AirSpeed files being misinterpreted as OP1a
  mxfdec: truncate packets that extend past the next edit unit
  mxfdec: set pixel format for cdci picture formats
  mxfdec: detect uncomp pictures using essence container ul
  mxfdec: set track edit rate num/den in expected order
  x86/cpu: implement get/set_eflags using intrinsics
  x86/cpu: implement support for cpuid through intrinsics
  x86/cpu: implement support for xgetbv through intrinsics
  lavu: use intrinsics for emms on systems lacking inline asm support
  mem: Don't abort on av_malloc(0) in debug mode

Conflicts:
	configure
	libavformat/mxf.h
	libavformat/mxfdec.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
parseutils: ignore digits below the microsecond.

Accept 1.1234567 as simply 1.123456 instead of rejecting it.
The rounding is towards 0, which is acceptable and much simpler.