1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

20341 Commits

Author SHA1 Message Date
Luca Barbato
1ec72c6c68 libx264: Make sure the extradata are padded 2015-10-23 11:13:35 +02:00
Vittorio Giovara
dca23ffbc7 lavc: Deprecate AVPicture structure and related functions
This structure served as a bridge between data pointers and frames,
but it suffers from several limitations:
- it is not refcounted and data must be copied to every time
- it cannot be expanded without ABI break due to being used on the stack
- its functions are just wrappers to imgutils which add a layer of
  unneeded indirection, and maintenance burden
- it allows hacks like embedding uncompressed data in packets
- its use is often confusing to our users

AVFrame provides a much better API, and, if a full blown frame is not
needed, it is just as simple and more straightfoward to use data and
linesize arrays directly.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-22 13:32:15 +02:00
Vittorio Giovara
3ee2c60cc2 utils: Use data buffers directly instead of an AVPicture
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-22 13:31:58 +02:00
Vittorio Giovara
a17a766190 lavc: Add data and linesize to AVSubtitleRect
Use the new fields directly instead of the ones from AVPicture.
This removes a layer of indirection which serves no pratical purpose
whatsoever, and will help in removing AVPicture structure completely
later.

Every subtitle encoder/decoder seamlessly points to the new arrays,
so it is possible to deprecate AVSubtitleRect.pict.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 12:02:29 +02:00
Vittorio Giovara
f890677d05 Replace any remaining avpicture function with imgutils
avpicture_get_size() -> av_image_get_buffer_size()

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:59 +02:00
Vittorio Giovara
13bddab7de nuv: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:54 +02:00
Vittorio Giovara
48c0638683 dpx: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:46 +02:00
Vittorio Giovara
f0a106578d roqvideodec: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:38 +02:00
Luca Barbato
ef3a3519c1 rawdec: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:33 +02:00
Luca Barbato
fcc1280acb rawenc: Replace avpicture functions with imgutils
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:59:07 +02:00
Vittorio Giovara
3496cec433 msrle: Use AVFrame instead of AVPicture
Callers always use a frame and cast it to AVPicture, change
ff_msrle_decode() to accept an AVFrame directly instead.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-21 11:51:07 +02:00
Anton Khirnov
dc923bc23b qsvenc: add an API for allocating opaque surfaces 2015-10-16 20:00:40 +02:00
Anton Khirnov
2ec96b6bd5 qsvenc: cosmetics, reindent 2015-10-16 20:00:17 +02:00
Anton Khirnov
f6f32fc93d qsvenc: set the timestamp for PIX_FMT_QSV frames as well 2015-10-16 20:00:12 +02:00
Anton Khirnov
772c87c5a6 qsvenc: support passing arbitrary external buffers to the encoder 2015-10-16 20:00:02 +02:00
Luca Barbato
b52307933b wrapped_avframe: Drop a now-unused variable 2015-10-16 17:45:09 +02:00
Luca Barbato
49d7fcd774 mpeg12: Unbreak building stale code
Broken in 2d59159508
2015-10-16 17:45:09 +02:00
Derek Buitenhuis
504e3f75bf aac: Make codec init run under ff_thread_once
This makes AAC init threadsafe.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2015-10-15 14:00:24 -04:00
Vittorio Giovara
2d59159508 lavc: AV-prefix a few left out capabilities 2015-10-15 15:47:16 +02:00
Derek Buitenhuis
d15368ee39 h264: Run VLC init under pthread_once
This makes the h.264 decoder threadsafe to initialize.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-14 14:35:34 +02:00
Luca Barbato
08377f9c3b dxva: Include last the internal header
It redefines _WIN32_WINNT, possibly causing problems with the
w32pthreads.h header.
2015-10-14 14:35:34 +02:00
wm4
6a23a34274 mimic: drop AVPicture usage
Work on the AVFrame references directly.

Instead of setting up a flipped/swapped "view" on the pictures,
flip/swap them when returning decoded frames to the API user.
2015-10-14 11:25:53 +02:00
Vittorio Giovara
6fdd4c678a libschroedinger: Properly use AVFrame API
Rather than copying data buffers around, allocate a proper frame, and
use the standard AVFrame functions. This effectively makes the decoder
capable of direct rendering.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-14 11:24:55 +02:00
Vittorio Giovara
901f9c0a32 qtrle: Properly use AVFrame API
Rather than copying data buffers around, just add a reference to
the current frame.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-10-14 11:24:24 +02:00
Derek Buitenhuis
17e41cf361 avcodec: Do not lock during init if there is no init function
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-13 13:43:29 +02:00
Luca Barbato
00332e0a06 wrapped_avframe: Initial implementation 2015-10-10 14:50:34 +02:00
Mario Gasparoni
c3e5c47bda libopenh264enc: Added max_nal_size option
Also added dynamic slice_mode option, needed for the max_nal_size.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-09 16:53:44 +02:00
Anton Khirnov
a8956eca1f cabac: Make CABAC states hardcoded
There is not much reason to generate such a small table at runtime.

Signed-off-by: Derek Buitenhuis <derekb@vimeo.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-10-08 21:55:31 +02:00
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