Commit Graph

2446 Commits

Author SHA1 Message Date
Brad Hards
bbc0eb7fcb avcodec: add constants for KLV pseudo-profile.
There are two different ways KLV is used in MISB specs - sync and async.
The corresponding text (in ST1401) says:

ISO/IEC 13818-1 Table-34 defines a stream_type = 0x15 for “Metadata carried in PES packets,”
and Table 2-22 defines a stream_id = 0xFC for “metadata stream.”

and

In ISO/IEC 13818-1, Table-34 defines a stream_type = 0x06 for “PES packets containing private
data,” and Table 2-22 defines a stream_id = 0xBD for “private_stream_1.”

These constants allow us to distinguish the two cases, as codec profiles.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-05-31 18:31:54 +02:00
Anton Khirnov
b5aee6086b avcodec.h: move avcodec_get_{type,name} to codec_id.h 2020-05-27 10:22:17 +02:00
Anton Khirnov
ba6cada92e avcodec.h: split AVCodec API into its own header 2020-05-27 10:22:17 +02:00
Anton Khirnov
bdd6aa25c1 avcodec.h: split bitstream filters API into its own header 2020-05-22 14:38:57 +02:00
Anton Khirnov
9d443c3e68 avcodec.h: split AVCodecParameters API into its own header 2020-05-22 14:38:57 +02:00
James Almer
13b1bbff0b avcodec: deprecate Lossless and Intra Only encoder capabilites
Both are codec properties and not encoder capabilities. The relevant
AVCodecDescriptor.props flags exist for this purpose.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-05-21 12:32:15 -03:00
Anton Khirnov
c584409643 lavc: add a flag for exporting AVVideoEncParams from decoders 2020-05-12 09:37:47 +02:00
Mark Thompson
858eba0ca4 lavc: Extend hardware config metadata to encoders 2020-04-26 18:38:25 +01:00
Philip Langdale
22b25b3ea5 avcodec: Add explicit capability flag for encoder flushing
Previously, there was no way to flush an encoder such that after
draining, the encoder could be used again. We generally suggested
that clients teardown and replace the encoder instance in these
situations. However, for at least some hardware encoders, the cost of
this tear down/replace cycle is very high, which can get in the way of
some use-cases - for example: segmented encoding with nvenc.

To help address that use case, we added support for calling
avcodec_flush_buffers() to nvenc and things worked in practice,
although it was not clearly documented as to whether this should work
or not. There was only one previous example of an encoder implementing
the flush callback (audiotoolboxenc) and it's unclear if that was
intentional or not. However, it was clear that calling
avocdec_flush_buffers() on any other encoder would leave the encoder in
an undefined state, and that's not great.

As part of cleaning this up, this change introduces a formal capability
flag for encoders that support flushing and ensures a flush call is a
no-op for any other encoder. This allows client code to check if it is
meaningful to call flush on an encoder before actually doing it.

I have not attempted to separate the steps taken inside
avcodec_flush_buffers() because it's not doing anything that's wrong
for an encoder. But I did add a sanity check to reject attempts to
flush a frame threaded encoder because I couldn't wrap my head around
whether that code path was actually safe or not. As this combination
doesn't exist today, we'll deal with it if it ever comes up.
2020-04-15 14:54:42 -07:00
Anton Khirnov
1f4cf92cfb pthread_frame: merge the functionality for normal decoder init and init_thread_copy
The current design, where
- proper init is called for the first per-thread context
- first thread's private data is copied into private data for all the
  other threads
- a "fixup" function is called for all the other threads to e.g.
  allocate dynamically allocated data
is very fragile and hard to follow, so it is abandoned. Instead, the
same init function is used to init each per-thread context. Where
necessary, AVCodecInternal.is_copy can be used to differentiate between
the first thread and the other ones (e.g. for decoding the extradata
just once).
2020-04-10 15:24:54 +02:00
Anton Khirnov
672946c7fe avcodec.h: split AVCodecDescriptor API into its own header 2020-04-10 14:15:14 +02:00
Anton Khirnov
c6978418b8 avcodec.h: split codec IDs into their own header 2020-04-10 13:57:21 +02:00
Anton Khirnov
9875fd24ce avcodec.h: split AVPacket API into its own header 2020-04-10 13:54:03 +02:00
Paul B Mahol
481ebb1c8b avcodec: add MV30 decoder 2020-04-10 12:22:09 +02:00
Andreas Rheinhardt
c52ec0367d avcodec/avcodec, avpacket: Return blank packet on av_packet_ref() failure
Up until now, it was completely unspecified what the content of the
destination packet dst was on error. Depending upon where the error
happened calling av_packet_unref() on dst might be dangerous.

This commit changes this by making sure that dst is blank on error, so
unreferencing it again is safe (and still pointless). This behaviour is
documented.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-28 03:59:15 +01:00
Andreas Rheinhardt
e621f2b6cd avcodec/avpacket: Always treat dst in av_packet_ref as uninitialized
av_packet_ref() mostly treated the destination packet dst as uninitialized,
i.e. the destination fields were simply overwritten. But if the source
packet was not reference-counted, dst->buf was treated as if it pointed
to an already allocated buffer (if != NULL) to be reallocated to the
desired size.

The documentation did not explicitly state whether the dst will be treated
as uninitialized, but it stated that if the source packet is not refcounted,
a new buffer in dst will be allocated. This and the fact that the side-data
as well as the codepath taken in case src is refcounted always treated the
packet as uninitialized means that dst should always be treated as
uninitialized for the sake of consistency. And this behaviour has been
explicitly documented.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-03-28 03:54:48 +01:00
Andriy Gelman
1e3d4fa0fb avcodec/avcodec: Fix typos
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2020-03-18 00:58:07 -03:00
Paul B Mahol
fed0de3728 avcodec: add CRI HCA decoder 2020-03-17 16:07:25 +01:00
Paul B Mahol
c6bbdba9cd avcodec: add derf dpcm decoder 2020-03-17 16:05:15 +01:00
Paul B Mahol
230703a9fa avcodec: add ADPCM IMA MTF decoder 2020-03-17 16:03:39 +01:00
vectronic
05d27f342b API: add AV_PKT_DATA_ICC_PROFILE to AVPacketSideDataType
Signed-off-by: vectronic <hello.vectronic@gmail.com>
2020-03-10 15:10:06 +00:00
Zane van Iperen
d90413e1e5 avcodec: add decoder for High Voltage Software's ALP ADPCM
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-03-09 01:43:51 +01:00
Linjie Fu
220c7dadc4 lavc/avcodec.h: fix missing line breaks in API documentation
"In both cases.." and "Repeat this call until.." would be better to
be in a separate line.

http://ffmpeg.org/doxygen/trunk/group__lavc__encdec.html

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-28 19:40:05 +01:00
James Almer
c48e5431c8 avcodec: add some documentation to the AVProducerReferenceTime struct
Signed-off-by: James Almer <jamrial@gmail.com>
2020-02-22 23:19:08 -03:00
James Almer
d005a7cdfd avcodec: add an AVCodecContext flag to export PRFT side data on demand
Signed-off-by: James Almer <jamrial@gmail.com>
2020-02-22 23:19:07 -03:00
James Almer
c666689491 avcodec: add an AVCodecContext field to signal types of packet, frame, and coded stream side data to export
Add an initial mvs flag to is, analog to the export_mvs flags2 one.

Signed-off-by: James Almer <jamrial@gmail.com>
2020-02-22 23:19:07 -03:00
Zane van Iperen
af65357207 avcodec: add decoder for Rayman 2's ADPCM variant
Adds support for the ADPCM variant used in Rayman 2's files.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2020-02-21 14:46:19 +01:00
Paul B Mahol
464310c160 avcodec: add siren audio decoder 2020-02-20 14:41:26 +01:00
Paul B Mahol
dfb0b9370d avcodec: fix pcm zork decoder
Fixes #1939
2020-02-16 12:54:57 +01:00
Alyssa Milburn
732d77dc50 avcodec: add cdtoons decoder
This adds a decoder for Broderbund's sprite-based QuickTime CDToons
codec, based on the decoder I wrote for ScummVM.

Signed-off-by: Alyssa Milburn <amilburn@zall.org>
2020-02-15 10:55:33 +01:00
Andreas Rheinhardt
568d62117d avcodec/avcodec: Nits
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-13 00:40:47 +01:00
Zane van Iperen
5d038a86d6 avcodec: add decoder for Simon & Schuster Interactive's ADPCM variant
Adds support for the ADPCM variant used by some Simon & Schuster
Interactive games such as Real War, and Real War: Rogue States.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-02-06 17:26:22 +01:00
Zane van Iperen
bf890ae0d7 avcodec: add decoder for argonaut games' adpcm codec
Adds support for the ADPCM variant used by some Argonaut Games' games,
such as 'Croc! Legend of the Gobbos', and 'Croc 2'.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2020-01-26 10:23:54 +01:00
Michael Niedermayer
550a6b4212 avcodec/avcodec: Add codec_tags array to AVCodec
This allows the fuzzer to target meaningfull codec tags instead
of hunting the 4gb space, which it seems to have problems with.

Suggested-by: James
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2020-01-22 21:50:49 +01:00
James Almer
717b2074ec avcodec: add a Producer Reference Time AVPacketSideData type
Signed-off-by: James Almer <jamrial@gmail.com>
2020-01-15 23:33:41 -03:00
Yuki Tsuchiya
30047b6a57 lavc: add MPEG-H 3D Audio codec id
Signed-off-by: James Almer <jamrial@gmail.com>
2019-12-12 11:44:29 -03:00
Paul B Mahol
ed58f8475f avcodec: add mvha video decoder 2019-11-27 23:54:20 +01:00
Paul B Mahol
61dc7add30 avcodec: add mvdv video decoder 2019-11-27 23:53:43 +01:00
Andreas Rheinhardt
41b05b849f avcodec/avcodec: Adapt the doc of av_bsf_send_packet to match its actual implementation.
Explicitly allowing empty packets to signal flushing helps getting rid
of special cases. It does not hinder the ability to send i.e.
timing-only packets, because one can send packets with zero size and
pkt->data set.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-11-14 12:02:41 -03:00
Michael Niedermayer
f8406ab4b9 avcodec: add max_samples
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-09-25 17:18:37 +02:00
Anthony Delannoy
81bb71761a avcodec: add EPG codec ID
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-09-19 21:30:54 +02:00
Carl Eugen Hoyos
551fcbbccb lavc/g729dec: Support decoding Sipro ACELP.KELVIN.
Fixes ticket #4799.
Analyzed-by: Aleksandr Ustinov
2019-09-16 20:57:53 +02:00
Paul B Mahol
7c0b3ba7dd avcodec: add IMM5 decoder 2019-08-29 21:04:54 +02:00
James Almer
056865a1d6 avcodec: clarify the allocation requirements for intra_matrix and inter_matrix fields
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2019-07-17 17:56:15 -03:00
James Almer
7cb4f8c962 avcodec: remove reference to AVPacket's destruct field
The field was removed years ago.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-07-15 11:20:03 -03:00
Peter Ross
43dbdee264 VP4 video decoder 2019-06-12 20:06:20 +10:00
Gyan Doshi
3153a6502a avcodec: add AV_CODEC_FLAG_DROPCHANGED to flags
Discard decoded frames which differ from first decoded frame in stream.
2019-04-20 10:38:01 +05:30
Paul B Mahol
16f7c1f291 avcodec: add LSCR decoder
Fixes #4711.
2019-04-13 18:10:11 +02:00
Paul B Mahol
d0f24df648 avcodec: add ADPCM AGM decoder 2019-04-11 11:58:34 +02:00
Paul B Mahol
4e8cbbf70e avcodec: add Amuse Graphics decoder
This work is sponsored by VideoLAN.
2019-03-31 10:48:43 +02:00