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
rtsp: Parse the mode=receive/record parameter in transport lines

We need to support the nonstandard mode=receive, for compatibility
with older libavformat clients.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtsp: Move rtsp_read_close

This avoids having to add forward declarations in the following
RTSP listen mode commit.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtsp: Make rtsp_open_transport_ctx() non-static

This is required for the upcoming RTSP listen mode.

Signed-off-by: Martin Storsjö <martin@martin.st>
rtsp: Add listen mode

This makes the RTSP demuxer act as a server, listening for an
incoming connection.

Signed-off-by: Martin Storsjö <martin@martin.st>
TechSmith Screen Codec 2 decoder
configure: Check for the math function rint

Add a fallback implementation if it doesn't exist.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavcodec: Add more AAC profiles

TODO: Are the mpeg2 ones official or specific to the fraunhofer
encoder?
Add support for AAC encoding via the external library fdk-aac

For enabling VBR, the general consensus seems to be to use the
qscale flag. There doesn't seem to be any consistent way to
indicate the actual desired quality though. Both libfaac and
libmp3lame calculate avctx->global_quality / FF_QP2LAMBDA and set
that as the libraries' VBR quality parameters, with wildly different
results. On libmp3lame, the VBR quality parameter is between 0 (best)
and 10 (worst), while the scale goes in the opposite direction for
libfaac, where higher quality values gives you better quality.

Therefore, for now, I just pass the actual value of
avctx->global_quality through. You can set it to values between 1
and 5:
1 - about 32 kbps/channel
2 - about 40 kbps/channel
3 - about 48-56 kbps/channel
4 - about 64 kbps/channel
5 - about 80-96 kbps/channel
Add a fdk-aac based decoder