1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-30 00:30:24 +02:00
Commit Graph

14 Commits

Author SHA1 Message Date
Andreas Rheinhardt
ed6549887a avcodec/encoders: Remove redundant setting of AV_PKT_FLAG_KEY
It is now set generically for all those encoders whose corresponding
AVCodecDescriptor has the AV_CODEC_PROP_INTRA_ONLY.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-28 01:57:10 +02:00
Andreas Rheinhardt
56e9e0273a avcodec/encode: Always use intermediate buffer in ff_alloc_packet2()
Up until now, ff_alloc_packet2() has a min_size parameter:
It is supposed to be a lower bound on the final size of the packet
to allocate. If it is not too far from the upper bound (namely,
if it is at least half the upper bound), then ff_alloc_packet2()
already allocates the final, already refcounted packet; if it is
not, then the packet is not refcounted and its data only points to
a buffer owned by the AVCodecContext (in this case, the packet will
be made refcounted in encode_simple_internal() in libavcodec/encode.c).
The goal of this was to avoid data copies and intermediate buffers
if one has a precise lower bound.

Yet those encoders for which precise lower bounds exist have recently
been switched to ff_get_encode_buffer() (which automatically allocates
final buffers), leaving only two encoders to actually set the min_size
to something else than zero (namely aliaspixenc and hapenc). Both of
these encoders use a very low lower bound that is not helpful in any
nontrivial case.

This commit therefore removes the min_size parameter as well as the
codepath in ff_alloc_packet2() for the allocation of final buffers.
Furthermore, the function has been renamed to ff_alloc_packet() and
moved to encode.h alongside ff_get_encode_buffer().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-06-08 12:52:50 +02:00
Andreas Rheinhardt
a247ac640d avcodec: Constify AVCodecs
Given that the AVCodec.next pointer has now been removed, most of the
AVCodecs are not modified at all any more and can therefore be made
const (as this patch does); the only exceptions are the very few codecs
for external libraries that have a init_static_data callback.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 10:43:15 -03:00
Tom Butterworth
bd6fa80d56 avcodec/hap: add "compressor" option to Hap encoder to disable secondary compression
The secondary compression in Hap is optional, this change exposes that option to
the user as some use-cases favour higher bitrate files to reduce workload
decoding.
Adds "none" or "snappy" as options for "compressor". Selecting "none" disregards
"chunks" option: chunking is only of benefit decompressing Snappy.

Reviewed-by: Martin Vignali <martin.vignali@gmail.com>
Signed-off-by: Tom Butterworth <bangnoise@gmail.com>
2016-11-10 14:27:38 +00:00
Tom Butterworth
0a24587588 avcodec/hap: pass texture-compression destination as argument, not in context
This allows a subsequent change to compress directly into the output packet when possible.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Tom Butterworth <bangnoise@gmail.com>
2016-11-08 17:05:27 +00:00
Tom Butterworth
92280f86b4 avcodec/hap: consistent name for codec
"Vidvox Hap", not "Vidvox Hap encoder" or "Vidvox Hap decoder". Fixes
bad name in "ffmpeg -codecs", matches other codec naming.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2016-11-04 11:19:47 -08:00
Carl Eugen Hoyos
5a51ca2da7 lavc/hapenc: Use the correct printf length modifier for size_t arguments.
Fixes the following warning:
libavcodec/hapenc.c:122:20: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘size_t’ [-Wformat]

Based on a patch by Diego Biurrun.
2016-11-02 01:55:40 +01:00
Tom Butterworth
a60539bb5e avcodec/hap: set bits_per_coded_sample
fixes issue where alpha is ignored in some players

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-10-23 12:10:07 +02:00
Michael Niedermayer
500bfbe27a avcodec/hapenc: Remove use of deprecated ff_alloc_packet()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-08-05 15:45:50 +02:00
Tom Butterworth
64539e1213 avcodec/hap: (trivial) rename enum values and document their meaning
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-23 20:59:57 +02:00
Tom Butterworth
26e8247c1c avcodec/hap: (trivial) clarify comment
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-23 20:57:52 +02:00
Tom Butterworth
c7e6443441 Support the Hap chunked frame format
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-22 16:15:53 +02:00
Michael Niedermayer
55219a78c7 Merge commit '7ca3e5203f133eb41a0b5c3a1d753a7427ba72e7'
* commit '7ca3e5203f133eb41a0b5c3a1d753a7427ba72e7':
  Hap decoder and encoder

Conflicts:
	Changelog
	configure
	doc/general.texi
	libavcodec/allcodecs.c
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2015-06-22 22:47:32 +02:00
Vittorio Giovara
7ca3e5203f Hap decoder and encoder
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-06-22 15:23:08 +01:00