Commit Graph

36 Commits

Author SHA1 Message Date
James Almer e7a9dd03ab avcodec/libaomdec: print libaomdec version in verbose level
info level will be too noisy if several instances of the decoder are fired
at the same time, as will be the case with tiled AVIF.

Signed-off-by: James Almer <jamrial@gmail.com>
2024-02-06 10:34:50 -03:00
Andreas Rheinhardt 8238bc0b5e avcodec/defs: Add AV_PROFILE_* defines, deprecate FF_PROFILE_* defines
These defines are also used in other contexts than just AVCodecContext
ones, e.g. in libavformat. Furthermore, given that these defines are
public, the AV-prefix is the right one, so deprecate (and not just move)
the FF-macros.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-07 00:39:02 +02:00
James Almer dc7bd7c5a5 avcodec: use the new AVFrame key_frame flag in all decoders and encoders
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-04 18:48:22 -03:00
James Zern fff4dbd90b avcodec/libaomdec: fix pix_fmt w/AVCOL_SPC_RGB
Signed-off-by: James Zern <jzern@google.com>
Reviewed-by: Vignesh Venkatasubramanian <vigneshv@google.com>
2022-10-31 10:06:55 -07:00
Andreas Rheinhardt 48286d4d98 avcodec/codec_internal: Add macro to set AVCodec.long_name
It reduces typing: Before this patch, there were 105 codecs
whose long_name-definition exceeded the 80 char line length
limit. Now there are only nine of them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-03 15:42:57 +02:00
Andreas Rheinhardt b9eaf77ed1 avcodec/internal: Move ff_set_dimensions() to decode.h
Decoder-only, as the dimensions are set by the user when encoding.

Also fixup the other headers a bit while removing unnecessary internal.h
inclusions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-27 14:14:57 +02:00
Andreas Rheinhardt 66b691f99f avcodec/internal: Move ff_get_buffer() to decode.h
Only used by decoders (encoders have ff_encode_alloc_frame()).

Also clean up the other headers a bit while removing now redundant
internal.h inclusions.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-27 14:14:56 +02:00
James Almer b0cd979a0b avcodec/libaomenc: support AV_CODEC_CAP_ENCODER_RECON_FRAME
Signed-off-by: James Almer <jamrial@gmail.com>
2022-08-02 09:56:27 -03:00
Andreas Rheinhardt 6aad1204cc avcodec: Add FF_CODEC_CAP_NOT_INIT_THREADSAFE
This is in preparation of switching the default init-thread-safety
to a codec being init-thread-safe.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-18 19:58:56 +02:00
Andreas Rheinhardt 4243da4ff4 avcodec/codec_internal: Use union for FFCodec decode/encode callbacks
This is possible, because every given FFCodec has to implement
exactly one of these. Doing so decreases sizeof(FFCodec) and
therefore decreases the size of the binary.
Notice that in case of position-independent code the decrease
is in .data.rel.ro, so that this translates to decreased
memory consumption.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-05 20:02:37 +02:00
Andreas Rheinhardt ce7dbd0481 avcodec/codec_internal: Make FFCodec.decode use AVFrame*
This increases type-safety by avoiding conversions from/through void*.
It also avoids the boilerplate "AVFrame *frame = data;" line
for non-subtitle decoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-05 19:54:09 +02:00
Andreas Rheinhardt 20f9727018 avcodec/codec_internal: Add FFCodec, hide internal part of AVCodec
Up until now, codec.h contains both public and private parts
of AVCodec. This exposes the internals of AVCodec to users
and leads them into the temptation of actually using them
and forces us to forward-declare structures and types that
users can't use at all.

This commit changes this by adding a new structure FFCodec to
codec_internal.h that extends AVCodec, i.e. contains the public
AVCodec as first member; the private fields of AVCodec are moved
to this structure, leaving codec.h clean.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 01:33:09 +01:00
Andreas Rheinhardt a688f3c13c avcodec/internal: Move FF_CODEC_CAP_* to a new header codec_internal.h
Also move FF_CODEC_TAGS_END as well as struct AVCodecDefault.
This reduces the amount of files that have to include internal.h
(which comes with quite a lot of indirect inclusions), as e.g.
most encoders don't need it. It is furthemore in preparation
for moving the private part of AVCodec out of the public codec.h.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 01:33:09 +01:00
James Almer 28fac45bde avcodec/libaomdec: use intermediate arrays for plane pointers and strides
Fixes -Wstringop-overflow warnings with libaom >= 2.0.0, where the unused alpha
plane was removed from aom_image.

Reviewed-by: James Zern <jzern@google.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-11-01 14:58:36 -03:00
Matt Oliver d92fdc7144 libaom: Dont use aom_codec_av1_dx_algo.
This fixes linking errors where variables cannot be correctly linked in from an external shared library such as with msvc (requires dllimport which is not used by libaom). Instead just call the function that returns the same variable.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
2021-10-30 13:37:45 +11:00
Andreas Rheinhardt 69f120ead7 avcodec/avcodec: Don't include cpu.h
It is not used here at all; instead, add it where it is used without
including it or any of the arch-specific CPU headers.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22 12:59:07 +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
Anton Khirnov d43b26b30d lavc/libaomdec: fix build with 1.0.0
aom_codec_frame_flags_t in libaom 1.0.0 is defined in aom_encoder.h,
whereas for newer versions it was moved to aom_codec.h
2021-04-18 08:36:17 +02:00
James Almer 8b954a727a avcodec/libaomdec: export frame pict_type
Should fix ticket #9180

Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-16 11:09:03 -03:00
Anton Khirnov 7d09579190 lavc: rename AV_CODEC_CAP_AUTO_THREADS->AV_CODEC_CAP_OTHER_THREADS
This cap is currently used to mark multithreading-capable codecs that
wrap external libraries with their own multithreading code. The name is
highly confusing for our API users, since libavcodec ALWAYS handles
thread_count=0 (see commit message in previous commit). Therefore rename
the cap and update its documentation to make its meaning clear.

The old name is kept deprecated until next+1 major bump.
2021-03-16 10:38:41 +01:00
Anton Khirnov 8a129077cc lavc: replace internal use of AV_CODEC_CAP_AUTO_THREADS with an internal cap
AV_CODEC_CAP_AUTO_THREADS was originally added in b4d44a45f9 to mark
codecs that spawn threads internally and are able to select an optimal
threads count by themselves (all such codecs are wrappers around
external libraries). It is used by lavc generic code to check whether it
should handle thread_count=0 itself or pass the zero directly to the
codec implementation. Within this meaning, it is clearly supposed to be
an internal cap rather than a public one, since from the viewpoint of a
libavcodec user, lavc ALWAYS handles thread_count=0. Whether it happens
in the generic code or within the codec internals is not a meaningful
difference for the caller.

External aspects of this flag will be dealt with in the following
commit.
2021-03-16 10:34:29 +01:00
Derek Buitenhuis 3fc3d712a9 avcodec/libaomdec: Set SAR based on RenderWidth and RenderHeight
This is the same thing we do in libdav1d.c

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2020-08-21 23:58:10 +01:00
James Almer e08a876e67 avcodec/libaomdec: remove bogus comment
It's a remnant from libvpx that's not valid for libaom.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-10-04 15:44:15 -03:00
James Almer 309c3a0e81 avcodec/libaom: fix setting amount of threads
The libaom doxy says that a value of 0 for the threads fields is
equivalent to a value of 1, whereas for avctx->thread_count it means
the maximum amount of threads possible for the host system.

Use av_cpu_count() to get the correct thread count when auto threads
is requested.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2018-09-13 13:44:45 -03:00
James Almer 728760de35 Revert "avcodec/libaomdec: auto insert dump_extra bitstream filter"
This reverts commit e45ed15594.

The Matroska spec was updated to not remove Sequence Header OBUs from key
frames, so this is no longer needed.
2018-08-17 15:17:59 -03:00
James Almer e45ed15594 avcodec/libaomdec: auto insert dump_extra bitstream filter
Some containers, like Matroska, may propagate key frames with no Sequence
Header OBU since it's provided in extradata instead.
With this change, the Sequence Header will be appended to the packet data
before calling aom_codec_decode().

Signed-off-by: James Almer <jamrial@gmail.com>
2018-08-02 12:41:05 -03:00
James Almer 2accdd3871 avcodec/libaomdec: fix broken pix_fmt changes from the previous commit
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-04 02:13:40 -03:00
James Almer f3fae82042 avcodec/libaomdec: add support for monochrome files
All such files are signaled as I42016, as there's no monochrome value
in aom_img_fmt_t.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-03 15:33:48 -03:00
James Almer d5343a5005 avcodec/libaomdec: remove duplicate code
Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-03 15:27:18 -03:00
James Almer 4897c80cc6 avcodec/libaomdec: remove references to gbrp pixfmt
Support for this needs testing, so remove for now.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-02 17:54:36 -03:00
James Almer 97de37da9c libavcodec/libaomdec: add support for transfer characteristics and color primaries
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-29 01:03:14 -03:00
James Almer 88e9b616b9 libavcodec/libaomdec: use the matrix coefficients value from aom_image
"color_space" is no longer a sytax element in libaom.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-29 00:37:00 -03:00
James Almer c0f0c9f531 avcode/profiles: add AV1 profiles
Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-29 00:05:52 -03:00
James Almer d039d7d4a4 avcodec/libaomdec: remove references to yuv440p pixfmt
While the enums are defined in the libaom headers, it's not officially
supported.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-03-28 21:29:15 -03:00
James Almer 0dc11d8bbd Merge commit 'c438899a706422b8362a13714580e988be4d638b'
* commit 'c438899a706422b8362a13714580e988be4d638b':
  Add AV1 video decoding support through libaom

This contains some extra changes taken from the libvpx decoder
wrapper, most of them contained in the set_pix_fmt() function.

Merged-by: James Almer <jamrial@gmail.com>
2018-03-28 18:09:46 -03:00
Luca Barbato c438899a70 Add AV1 video decoding support through libaom
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-03-12 08:12:43 +01:00