Commit Graph

20313 Commits

Author SHA1 Message Date
Alexandra Khirnova
58b42345b3 dcadec: reorganise context data
place primary audio coding header data into DCAAudioHeader
structure to make DCAContext clearer
and move channel related data to DCAChan structure to make
them easier to use by extensions

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-07 18:45:49 +02:00
Vittorio Giovara
3a4d369ea4 g2m: Relax resolution change constraints
Do not fail when original resolution is smaller than current one,
as the frame buffer is resized automatically.

Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>
2015-10-07 18:45:49 +02:00
wm4
39f01e346c mmaldec: be more tolerant against MMAL not returning decoded output
In some situations, MMAL won't return a decoded frame for certain input
frames. This can happen if a frame fails to decode, or if a packet does
not actually contain a complete frame. In these situations, we would
deadlock (or actually timeout) waiting for an expected output frame,
which is not ideal. On the other hand, there are situations where we
definitely have to block to avoid deadlocks. (This mess is a
consequence of trying to map MMAL's asynchronous and flexible
dataflow to libavcodec, which is more static and rigid.)

Solve this by doing a blocking wait only if the amount of buffered data
is too big. The whole purpose of the blocking wait is to avoid excessive
buffering of input data, so we can skip it if it appears to be low. The
consequence is that libavcodec can gracefully return no frame to the
API user.

We want to track the number of full packets to make our heuristic work.
But MMAL buffers are fixed-size, requiring splitting large packets. This
is why the previous commit is needed. We use the ..._FRAME_END flag to
remember packet boundaries, but MMAL does not preserve these buffer
flags when returning buffers to the user.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-04 19:34:04 +02:00
wm4
65db4899fa mmaldec: refactor to have more context per MMAL input buffer
The next commit needs 1 bit of additional information per MMAL buffer
sent to the MMAL input port. This information will be needed when the
buffer is recycled (i.e. returned by the input port's callback).
Normally, we could use MMAL_BUFFER_HEADER_FLAG_USER0, but that is
unexpectedly not preserved.

Do this by storing a pointer to FFBufferEntry in the MMAL buffer's
user data, instead of an AVBufferRef. This also changes the lifetime
of FFBufferEntry.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-04 19:34:04 +02:00
Derek Buitenhuis
eae58428bd avcodec: Do not lock during open for codecs marked as having threadsafe init
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-04 13:21:16 +02:00
Vittorio Giovara
abe9adfb31 rangecoder: Use AV_RB16 instead of bytestream_get_be16
Silence an incompatible-pointer-types-discards-qualifiers warning from clang.
rangecoder.c:58:34: warning: passing
      'uint8_t **' (aka 'unsigned char **') to parameter of type
      'const uint8_t **' (aka 'const unsigned char **') discards qualifiers in
      nested pointer types [-Wincompatible-pointer-types-discards-qualifiers]
2015-10-04 13:09:08 +02:00
Vittorio Giovara
b8b13acd70 hevc: Simplify logical check
The intended meaning is "if this block is the first block in a slice then
its left boundary is a slice boundary". Silence a logical-not-parentheses
warning from gcc.
2015-10-04 13:08:58 +02:00
Vittorio Giovara
10aa6f9db4 h264: Use the correct argument context in debug log 2015-10-04 13:07:12 +02:00
Vittorio Giovara
4628443ca3 h263: Drop uninitialized variable use from log message 2015-10-04 13:07:12 +02:00
Vittorio Giovara
1da2a20763 dvbsubdec: Fix function return type 2015-10-04 13:07:12 +02:00
Vittorio Giovara
cab63a8b59 dv: Mark internal frame reference as const
Silence a warning due to frame assignment in dvenc. All uses of the
reference in dvdec are read only, except the ones in the main decoding
function, so use the frame pointer directly there.
2015-10-04 13:06:34 +02:00
Vittorio Giovara
4c160fa239 dcadec: Always initialize return variable
Silence an uninitialized warning from clang.
2015-10-04 13:06:27 +02:00
Anton Khirnov
bb198c4997 d3d11va: make av_d3d11va_alloc_context() available at all times
The public API should not depend on the build configuration.
2015-10-03 14:09:23 +02:00
Anton Khirnov
f320287159 d3d11va: check for malloc failure 2015-10-03 14:08:13 +02:00
Christophe Gisquet
e54d7e4e8e dnxhddata: Deduplicate cid 1256 chroma table
CID 1256 is specified as using the same table for luma and chroma,
which is the same as CID 1235 luma table. This is consistent with
the format supposedly being RGB, although most sequences seem to
actually be YCbCr-encoded.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-02 13:12:19 +02:00
Jeremy James
1fb63d6f43 dnxhddata: Deduplicate dnx100 tables
Tables 1258 and 1259 were not zigzagged when added, so it was not
possible to notice the equivalence.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-02 13:12:12 +02:00
Jeremy James
cc320296ab dnxhddata: Fix cid 1260 luma and chroma tables
These table was not zigzagged when added.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-02 13:12:04 +02:00
Joseph Artsimovich
bfe1cd80eb dnxhddata: Fix 10-bit DNxHD quant matrices
Convert them to zigzag order, as the rest of them are.

When I was adding support for 10-bit DNxHD, I just copy-pasted the
missing quant matrices from the spec. Now it turns out the existing
matrices in dnxhddata.c were in zigzag order. This resulted in wrong
quantization for 10-bit DNxHD. The attached patch fixes the problem by
converting 10-bit quant matrices to zigzag order.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-10-02 13:11:57 +02:00
Derek Buitenhuis
380146924e x264: Add option to force IDR frames
When forwarding the frame type information, by default x264 can
decide which kind of keyframe output, add an option to force it
to output IDR frames in to support use-cases such as preparing
the content for segmented streams formats.
2015-10-01 14:27:45 +02:00
Yu Xiaolei
eb02387add x264: Expose the NV21 input support
x264 build 147 adds the native support for NV21.

Useful to avoid additional pixel format conversion when encoding
from a wide range of capture devices, Android among those.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-01 14:00:28 +02:00
Alexandra Khirnova
d0a3e89d41 dcadec: make a number of samples per subband per subsubframe a named constant
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-01 12:29:06 +02:00
Vittorio Giovara
9a3202a98b Screenpresso SPV1 decoder
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-30 16:45:11 +02:00
Vittorio Giovara
1aa24df74c lavu: Deprecate AVFrame.error[]
These field are difficult to interpret, and are provided by a single
encoder (mpegvideoenc). In general they do not belong to a structure
containing raw data only, so remove them from AVFrame.

Mpegvideoenc now uses a private field in Picture for its internal
computations.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-30 16:44:33 +02:00
Vittorio Giovara
e94e651c76 dnxhddec: Enable frame threading
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-29 14:33:01 +02:00
Christophe Gisquet
c49cbecbae dnxhddec: Decode and use interlace mb flag
This bit is 1 in some samples, and seems to coincide with interlaced
mbs and CID1260. 2008 specs do not know about it, and maintain qscale
is 11 bits. This looks oversized, but may help larger bitdepths.

Currently, it leads to an obviously incorrect qscale value, meaning
its syntax is shifted by 1. However, reading 11 bits also leads to
obviously incorrect decoding: qscale seems to be 10 bits.

However, as most profiles still have 11bits qscale, the feature is
restricted to the CID1260 profile (this flag is dependent on
a higher-level flag located in the header).

The encoder writes 12 bits of syntax, last and first bits always 0,
which is now somewhat inconsistent with the decoder, but ends up with
the same effect (progressive + reserved bit).

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-29 14:33:01 +02:00
Vittorio Giovara
cf7d2f2d21 lavc: Simplify checking quant bias option 2015-09-29 14:33:01 +02:00
Ganesh Ajjanagadde
4885bde318 motion_est_template: Fix undefined left shift of negative number
This fixes a -Wshift-negative-value warning reported with clang 3.7+.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-09-29 14:33:00 +02:00
Ganesh Ajjanagadde
977f41e274 mlpdec: Fix a undefined left shift of negative number
This fixes a -Wshift-negative-value warning reported with clang 3.7+.

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
2015-09-29 14:33:00 +02:00
wm4
948f3c19a8 lavc: Make AVPacket.duration int64, and deprecate convergence_duration
Note that convergence_duration had another meaning, one which was in
practice never used. The only real use for it was a 64 bit replacement
for the duration field. It's better just to make duration 64 bits, and
to get rid of it.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-29 14:33:00 +02:00
Gregory J. Wolfe
1a4c5fe560 libopenh264enc: Use av_log() to log messages
File libopenh264enc.c has been modified so that the encoder uses av_log()
to log messages (error, warning, info, etc.) instead of logging them
directly to stderr.  At the time the encoder is created, the current
libav log level is mapped to an equivalent libopenh264 log level.  This
log level, and a message logging function that invokes av_log() to
actually log messages, are then set on the encoder.

This contains further changes and simplifications by Michael Niedermayer
and Martin Storsjö.

Signed-off-by: Martin Storsjö <martin@martin.st>
2015-09-29 11:37:36 +03:00
Anton Khirnov
8aecec8402 qsvdec: make ff_qsv_decode_init() static
It is not used outside of qsvdec.c anymore.
2015-09-28 15:46:58 +02:00
Anton Khirnov
2c32eace5e qsvdec: close the MFX decoder on uninit 2015-09-28 15:45:17 +02:00
Anton Khirnov
d0c8c380ec qsv: document AVQSVContext members 2015-09-28 15:44:47 +02:00
Anton Khirnov
5d2daebf3c qsvenc: mark the encoders as INIT_CLEANUP
Should fix some leaks on init failure.
2015-09-28 15:43:04 +02:00
Anton Khirnov
83847cc8fa qsvenc: do not try to close the encoder if the session is NULL 2015-09-28 15:42:56 +02:00
Anton Khirnov
741b352b16 qsvdec: list supported pixel formats
This is useful for detecting QSV-enabled decoders.
2015-09-28 15:42:46 +02:00
wm4
a41e5e192e vdpau: fix constrained baseline fallback
It appears vdpau drivers can return constrained baseline as unsupported,
even if libvdpau knows about the symbol, and the main profile is
supported.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-09-28 11:05:27 +02:00
wm4
a5d58fea68 lavc: reimplement avcodec_get_type() using codec descriptors
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-09-28 10:50:38 +02:00
Rémi Denis-Courmont
b10b6ac7a9 vdpau: deprecate av_vdpau_get_profile()
This function can intrinsically not deal with codec profile fallback
(for H.264 Constrained Baseline especially), and was made redundant
by av_vdpau_bind_context().

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2015-09-28 09:45:58 +02:00
Vittorio Giovara
b2417ee6d1 dxv: Improve error message 2015-09-24 10:57:30 +02:00
Vittorio Giovara
1bcd4a476b dxv: Support RAW intermediate compression
Sample-Id: boombox64.mov
Reported-by: Aarni Koskela
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-24 10:57:25 +02:00
Vittorio Giovara
bbf71d46db dxv: Print texture information after header parsing 2015-09-24 10:57:25 +02:00
Vittorio Giovara
fb2889691c dxv: Support the original first version
DXV 1.0 provided DXT1 with LZF only.

Sample-Id: Orange-Strings-07_640_DXV.mov
Reported-by: Carl Eugen Hoyos
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-24 10:57:20 +02:00
Vittorio Giovara
588a5619da dxv: Parse ancillary encoder information
Header does not contain the number of channels, but rather the encoder
version, so rename the variable, and read the additional byte.
2015-09-24 10:56:44 +02:00
wm4
a9b8c638cf mmal: Fix AVBufferRef usage
AVBufferRef.data and AVPacket.data don't need to have the same value.
AVPacket could point anywhere into the buffer. Likewise, the sizes
don't need to be the same.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-24 10:34:46 +02:00
wm4
49623f5319 mmal: Remove setting extradata on input format
This works only for extradata sizes up to 128 bytes. Additionally, I
could never actually see it doing anything. The new code using
MMAL_BUFFER_HEADER_FLAG_CONFIG now takes care of this.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-24 10:34:38 +02:00
wm4
f290e48d86 mmal: drop the h264 BSF
We can send mp4-style data directly. But for some reason, this requires
sending the extradata as buffer with MMAL_BUFFER_HEADER_FLAG_CONFIG
set. Reuse the infrastructure for sending AVPackets to do this.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-24 10:34:28 +02:00
Steve Lhomme
e3d4784eb3 d3d11va: WindowsPhone requires a mutex around ID3D11VideoContext 2015-09-17 10:33:21 +02:00
Kevin Wheatley
4a66422450 pixfmt: Add new SMPTE color primaries and transfer characteristic values
Appeared in ITU-T Rec H.265 10/2014.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-09-17 10:31:43 +02:00
Alexandra Hájková
7778859835 dcadec: set channel layout in a separate function
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-09-16 20:21:07 +02:00