1
0
Fork 0
Commit Graph

19 Commits

Author SHA1 Message Date
Anton Khirnov 08bebeb1be Revert "all: Don't set AVClass.item_name to its default value"
Some callers assume that item_name is always set, so this may be
considered an API break.

This reverts commit 0c6203c97a.
2024-01-20 10:34:48 +01:00
Andreas Rheinhardt 0c6203c97a all: Don't set AVClass.item_name to its default value
Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9;
also avoids relocations.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-12-22 15:12:33 +01:00
Haihao Xiang 1f88fb80d5 lavc/qsvenc_jpeg: accept YUYV422 and BGRA in system memory
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-01-17 10:10:52 +08: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
Haihao Xiang 6900feef06 lavc/qsv: create mfx session using oneVPL for decoding/encoding
If qsv hwdevice is available, use the mfxLoader handle in qsv hwdevice
to create mfx session. Otherwise create mfx session with a new mfxLoader
handle.

This is in preparation for oneVPL support
2022-08-12 10:43:39 +08:00
Haihao Xiang 3e61b7dd7f qsv: remove mfx/ prefix from mfx headers
The following Cflags has been added to libmfx.pc, so mfx/ prefix is no
longer needed when including mfx headers in FFmpeg.
   Cflags: -I${includedir} -I${includedir}/mfx

Some old versions of libmfx have the following Cflags in libmfx.pc
   Cflags: -I${includedir}

We may add -I${includedir}/mfx to CFLAGS when running 'configure
--enable-libmfx' for old versions of libmfx, if so, mfx headers without
mfx/ prefix can be included too.

If libmfx comes without pkg-config support, we may do a small change to
the settings of the environment(e.g. set -I/opt/intel/mediasdk/include/mfx
instead of -I/opt/intel/mediasdk/include to CFLAGS), then the build can
find the mfx headers without mfx/ prefix

After applying this change, we won't need to change #include for mfx
headers when mfx headers are installed under a new directory.

This is in preparation for oneVPL support (mfx headers in oneVPL are
installed under vpl directory)
2022-08-12 10:43:39 +08: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 5aabb2596f avcodec/codec_internal: Rename AVCodecDefault->FFCodecDefault
This structure is no longer declared in a public header,
so using an FF-prefix is more appropriate.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 01:33:10 +01: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
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
Mark Thompson 5a1ff44907 lavc/qsvenc: Add hardware config metadata
All of these encoders can accept libmfx surfaces directly in a hardware
frames context, or they can accept software frames if a suitable device
is supplied to use.
2020-04-26 18:38:25 +01:00
Zhong Li 6f9d7c556d lavc/qsvenc: no need to include h264.h for jpeg encoder
Signed-off-by: Zhong Li <zhong.li@intel.com>
2019-04-03 22:57:55 +08:00
Zhong Li 92c25963e8 lavc/qsvenc_jpeg: set a default quality
Keep alignment with vaapi mjpeg encoder.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-10-23 19:52:47 +08:00
Zhong Li 0e3d7d845d lavc/qsvenc_jpeg: add async_depth support
Currently qsv (m)jpeg encoding is broken.
Regression introducing by the commit(id: c1bcd3): fix async support,
which requires the minimum async_depth to be 1, instead previous zero.
But the default async_depth of qsv (m)jpeg encoding is still initialized
(mostly) as zero.

This patch also abviously improves qsv (m)jpeg encoding performance
due to the default async_depth is changed to 4.

Signed-off-by: Zhong Li <zhong.li@intel.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2018-10-23 19:52:41 +08:00
wm4 b945fed629 avcodec: add metadata to identify wrappers and hardware decoders
Explicitly identify decoder/encoder wrappers with a common name. This
saves API users from guessing by the name suffix. For example, they
don't have to guess that "h264_qsv" is the h264 QSV implementation, and
instead they can just check the AVCodec .codec and .wrapper_name fields.

Explicitly mark AVCodec entries that are hardware decoders or most
likely hardware decoders with new AV_CODEC_CAPs. The purpose is allowing
API users listing hardware decoders in a more generic way. The proposed
AVCodecHWConfig does not provide this information fully, because it's
concerned with decoder configuration, not information about the fact
whether the hardware is used or not.

AV_CODEC_CAP_HYBRID exists specifically for QSV, which can have software
implementations in case the hardware is not capable.

Based on a patch by Philip Langdale <philipl@overt.org>.

Merges Libav commit 47687a2f8a.
2017-12-14 19:37:56 +01:00
James Almer 9d3eb75cf6 avcodec/qsvenc_jpeg: fix copyright header
Fixes fate-source after 1926f13a20.

Signed-off-by: James Almer <jamrial@gmail.com>
2017-11-08 14:58:51 -03:00
Huang, Zhengxu 2fd6e7d077 libavcodec/mjpeg_qsv: Add QSV MJPEG encoder
usage:
-hwaccel qsv -c:v h264_qsv -i in -c:v mjpeg_qsv -global_quality 80 -f
mjpeg out

Signed-off-by: ChaoX A Liu <chaox.a.liu@gmail.com>
Signed-off-by: Zhengxu Huang <zhengxu.maxwell@gmail.com>
Signed-off-by: Andrew Zhang <huazh407@gmail.com
Signed-off-by: Maxym Dmytrychenko <maxim.d33@gmail.com>
2017-07-25 13:27:43 +02:00