1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00
Commit Graph

2538 Commits

Author SHA1 Message Date
Andreas Rheinhardt
8320e236c1 avcodec/opus: Rename opus.c->opus_celt.c, opus_celt.c->opusdec_celt.c
Since commit 4fc2531fff opus.c
contains only the celt stuff shared between decoder and encoder.
meanwhile, opus_celt.c is decoder-only. So the new names
reflect the actual content better than the current ones.

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-09 19:45:06 +02:00
Andreas Rheinhardt
4fc2531fff avcodec/opus: Move stuff shared by decoder and parser to a new file
opus.h (which is used by all the Opus code) currently includes
several structures only used by the parser and the decoder;
several elements of OpusContext are even only used by the decoder.

This commit therefore moves the part of OpusContext that is shared
between these two components (and used by ff_opus_parse_extradata())
out into a new structure and moves all the other accompanying
structures and functions to a new header, opus_parse.h; the
functions itself are also moved to a new file, opus_parse.c.
(This also allows to remove several spurious dependencies
of the Opus parser and encoder.)

Reviewed-by: Lynne <dev@lynne.ee>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-05 02:04:41 +02:00
Andreas Rheinhardt
ef285d59ac configure, avcodec/Makefile: Remove obsolete mpegvideo dependencies
As long as ff_mpeg12_common_init() existed in mpeg12.c,
it added a dependency of mpeg12.o on mpegvideodata.o
(which provides ff_mpeg2_dc_scale_table, which is used
in ff_mpeg12_common_init()). mpegvideodata.o is normally
provided by the mpegvideo subsystem and therefore several
codecs and the MPEG-1/2 parser added a configure dependency
on said subsystem (additionally, the eatqi decoder just
added a Makefile dependency on mpegvideodata.o).

Given that ff_mpeg12_common_init() is no more, these dependencies
can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-10-04 17:41:34 +02:00
James Almer
b92e14147f avcodec: add a bsf to reorder DTS into PTS
Starting with an h264 implementation. Can be extended to support other codecs.

A few caveats:
- OpenGOP streams are currently not supported. The firt packet must be an IDR
  frame.
- In some streams, a few frames at the end may not get a reordered PTS when
  they reference frames past EOS. The code added to derive timestamps from
  previous frames needs to extended.

Addresses ticket #502.

Signed-off-by: James Almer <jamrial@gmail.com>
2022-10-04 08:40:16 -03:00
Paul B Mahol
4b6b75c752 avcodec: add Media 100i decoder 2022-09-30 19:11:36 +02:00
Paul B Mahol
a166b8a19b avcodec: add FTR audio decoder and parser 2022-09-24 14:03:59 +02:00
Paul B Mahol
84f467454b avcodec: add APAC decoder 2022-09-23 20:26:28 +02:00
Paul B Mahol
79dcee34dd avcodec: add XWD parser 2022-09-17 10:15:01 +02:00
Andreas Rheinhardt
aaf6d85283 avcodec/Makefile: Remove obsolete adx_parser->adx.c dependency
Obsolete since b024209b1f.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-16 11:21:22 +02:00
Paul B Mahol
e91bc521af avcodec: add Micronas SC-4 parser 2022-09-16 10:02:19 +02:00
Paul B Mahol
ea93943bee avcodec: add MI-SC4 audio decoder 2022-09-16 10:02:19 +02:00
Paul B Mahol
88170070c4 avcodec: add bonk audio decoder 2022-09-12 11:34:27 +02:00
Andreas Rheinhardt
17b1375965 avcodec/flac: Move ff_flac_get_max_frame_size() to flacenc.c
It is its only user.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-09-02 11:55:22 +02:00
Timo Rothenpieler
6dc79f1d04 avutil/half2float: move non-inline init code out of header 2022-08-19 22:09:36 +02:00
Timo Rothenpieler
b77fff47d0 configure: always enable gnu_windres if available
Use the appropiate Makefile variable to ensure the resource file is
only built into shared libraries instead.
2022-08-13 14:42:36 +02:00
Peter Ross
23758380d0 avcodec: WBMP (Wireless Application Protocol Bitmap) image format
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2022-08-07 19:18:18 +10:00
Andreas Rheinhardt
6c4595190e avcodec/flacdsp: Split encoder-only parts into a ctx of its own
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-05 03:28:45 +02:00
Jun Zhao
33afa2167e lavc/Makefile: fix make checkheaders fail
Fix the build break when used make checkheaders

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
2022-08-05 00:55:53 +08:00
Andreas Rheinhardt
b0e38c7d1e configure: Add msmpeg4(dec|enc) subsystems
The msmpeg4 decoders/encoders share a common set of prerequisites,
ergo it makes sense to use common subsystems for them. This also
allows to remove the CONFIG_MSMPEG4_DECODER/ENCODER ad-hoc defines
(which violated the CONFIG_ namespace).

Reviewed-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:18:25 +02:00
Andreas Rheinhardt
b10e218df1 configure, avcodec/Makefile: Make IntraX8 select WMV2DSP, fix MIPS build
IntraX8 uses WMV2DSP directly, so it should have a direct dependency
on it. Also remove the indirect Makefile dependency of the VC-1 decoder
on wmv2dsp.o. Notice that since the addition of the MIPS WMV2DSP
implementation building only the VC-1 decoder would fail, because
no Makefile dependency VC1->wmv2dsp_init_mips.o has been added.
This is of course fixed by this commit.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-08-03 21:17: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
Niklas Haas
c688ddc067 avcodec: add common fflcms2 boilerplate
Handling this in general code makes more sense than handling it in
individual codec files, because it would be a lot of unnecessary code
duplication for the plenty of formats that support exporting ICC
profiles (jpg, png, tiff, webp, jxl, ...).

encode.c and decode.c will be in charge of initializing this state as
needed, so we merely need to make sure to uninit it afterwards from the
common destructor path.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-07-30 11:42:06 +02:00
Niklas Haas
1cbd4552fe fflcms2: move to libavcodec
We will need this helper inside libavcodec in the future, so move it
there, leaving behind an #include to the raw source file in its old
location in libvfilter. This approach is inspired by the handling of
vulkan.c, and avoids us needing to expose any of it publicly (or
semi-publicly) in e.g. libavutil, thus avoiding any ABI headaches.

It's debatable whether the actual code belongs in libavcodec or
libavfilter, but I decided to put it into libavcodec because it
conceptually deals with encoding and decoding ICC profiles, and will be
used to decode embedded ICC profiles in image files.

Signed-off-by: Niklas Haas <git@haasn.dev>
2022-07-30 11:42:06 +02:00
Andreas Rheinhardt
7ab9b30800 avcodec/vp56: Move VP5-9 range coder functions to a header of their own
Also use a vpx prefix for them.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-07-28 03:49:54 +02:00
Paul B Mahol
307ab7fe8a avcodec: add Radiance HDR image format support 2022-07-16 21:43:54 +02:00
Paul B Mahol
ff1450e449 avcodec: add PHM decoder and encoder 2022-07-03 15:16:31 +02:00
ManojGuptaBonda
a44fba0b5b AV1 VDPAU hwaccel Decode support
Support for VDPAU accelerated AV1 decoding was added with libvdpau-1.5.
Support for the same in ffmpeg is added with this patch. Profiles
related to VDPAU AV1 can be found in latest vdpau.h present in
libvdpau-1.5.

Add AV1 VDPAU to list of hwaccels and supported formats
Added file vdpau_av1.c and Modified configure to add VDPAU AV1 support.
Mapped AV1 profiles to VDPAU AV1 profiles. Populated the codec specific
params that need to be passed to VDPAU.

Signed-off-by: Philip Langdale <philipl@overt.org>
2022-06-25 09:05:58 +08:00
Zhao Zhili
e0cddee277 avcodec/avs2_parser: parse more info
Including video resolution, framerate and picture type, etc.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2022-06-24 15:37:23 +08:00
Paul B Mahol
973fab5653 avcodec: add QOI decoder and demuxer and parser and encoder and muxer 2022-06-05 13:06:54 +02:00
John Stebbins
326f9fd01b lavc/pgs_frame_merge_bsf: add bsf to merge PGS segments
Required to remux m2ts to mkv
Minor changes and porting to FFBitStreamFilter done by the committer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 10:03:30 +02:00
Andreas Rheinhardt
f2b79c5b85 lib*/version: Move library version functions into files of their own
This avoids having to rebuild big files every time FFMPEG_VERSION
changes (which it does with every commit).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 06:49:32 +02:00
Andreas Rheinhardt
2eb7e38cb8 avcodec/Makefile: Add libjxl.h to SKIPHEADERS if necessary
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-04-29 01:30:14 +02:00
Leo Izen
5f0b4e9c70 avcodec/libjxl: add Jpeg XL encoding via libjxl
This commit adds encoding support to libavcodec
for Jpeg XL images via the external library libjxl.
2022-04-23 19:51:46 +02:00
Leo Izen
458cc7e314 avcodec/libjxl: add Jpeg XL decoding via libjxl
This commit adds decoding support to libavcodec
for Jpeg XL images via the external library libjxl.
2022-04-23 19:51:46 +02:00
Anton Khirnov
ce3c20f2aa lavc: move default get_buffer2() to its own file
It is also used by some encoders, so decode.c is not the right place for
it.
2022-04-13 12:15:02 +02:00
Marton Balint
ee50cc18b3 avcodec/vbnenc: add VBN encoder
Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Marton Balint
013d774e22 avcodec/vbndec: add VBN decoder
Add support for decoding Vizrt Binary Image (VBN) files.

LZW-compressed data is not supported yet.

Signed-off-by: Marton Balint <cus@passwd.hu>
2022-04-10 20:12:23 +02:00
Andreas Rheinhardt
495de744fa avcodec/bitstream: Move code for initializing VLCs to file of its own
bitstream.c is currently the disjoint union of three parts:
The first part is ff_log2_run, the second part are some auxiliary
functions for the PutBits-API; and the third part is the code
for creating VLCs. This commit moves the latter into a file of its own.
This has the advantage of making one of the hacks in tableprint_vlc.h
redundant as vlc.c does not include config.h (whereas the PutBits-API
part does).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-21 23:25:36 +01:00
Andreas Rheinhardt
9cae7f9450 avcodec/zlib_wrapper: Add wrapper for deflateInit()
The rationale is the same as for the wrappers for inflateInit(),
although the case for it is admittedly not so strong because
there are less users of deflateInit().
Also remove an unnecessary inclusion of config.h in
libavformat/protocols.c in order to trigger a request for reconfigure
(which is needed for CONFIG_DEFLATE_WRAPPER to take effect).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-19 00:18:36 +01:00
Andreas Rheinhardt
dd8a55cb3e avcodec/zlib_wrapper: Add wrappers for zlib inflateInit, inflateEnd
It is not documented to be safe to call inflateEnd() on a z_stream
that has never been successfully been initialized by inflateInit(),
but just zeroed. It just happens to work and several codecs rely
on this (they have FF_CODEC_CAP_INIT_CLEANUP set and even call
inflateEnd() when inflateInit() failed or has never been called).
To avoid this, other codecs recorded whether their zstream has been
initialized successfully or not.

This commit adds wrappers for inflateInit() and inflateEnd() that
do what these other codecs do; furthermore, they also take care of
properly setting up the zstream before inflateInit() and emit
an error message in case of error.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-19 00:18:35 +01:00
Martin Storsjö
f2da2e1458 libavcodec: Split version.h
This avoids including version.h in all source files, avoiding
unnecessary rebuilds when the version number is bumped. Only
version_major.h is included by the main header, which defines
availability of e.g. FF_API_* macros, and which is bumped much
less often.

This isn't done for libavutil/version.h, because that header needs
to be included essentially everywhere due to LIBAVUTIL_VERSION_INT
being used wherever an AVClass is constructed.

Signed-off-by: Martin Storsjö <martin@martin.st>
2022-03-16 14:04:35 +02:00
Michael Niedermayer
6f9b4b3e15 avcodec: Add dv marker bsf
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2022-03-14 19:58:54 +01:00
Jack Bruienne
39a33038ce avcodec: add DFPWM1a codec
From the wiki page (https://wiki.vexatos.com/dfpwm):
> DFPWM (Dynamic Filter Pulse Width Modulation) is an audio codec
> created by Ben “GreaseMonkey” Russell in 2012, originally to be used
> as a voice codec for asiekierka's pixmess, a C remake of 64pixels.
> It is a 1-bit-per-sample codec which uses a dynamic-strength one-pole
> low-pass filter as a predictor. Due to the fact that a raw DPFWM decoding
> creates a high-pitched whine, it is often followed by some post-processing
> filters to make the stream more listenable.

It has recently gained popularity through the ComputerCraft mod for
Minecraft, which added support for audio through this codec, as well as
the Computronics expansion which preceeded the official support. These
both implement the slightly adjusted 1a version of the codec, which is
the version I have chosen for this patch.

This patch adds a new codec (with encoding and decoding) for DFPWM1a.
The codec sources are pretty simple: they use the reference codec with
a basic wrapper to connect it to the FFmpeg AVCodec system.

To clarify, the codec does not have a specific sample rate - it is
provided by the container (or user), which is typically 48000, but has
also been known to be 32768. The codec does not specify channel info
either, and it's pretty much always used with one mono channel.
However, since it appears that libavcodec expects both sample rate and
channel count to be handled by either the codec or container, I have
made the decision to allow multiple channels interleaved, which as far
as I know has never been used, but it works fine here nevertheless. The
accompanying raw format has a channels option to set this. (I expect
most users of this will not use multiple channels, but it remains an
option just in case.)

This patch will be highly useful to ComputerCraft developers who are
working with audio, as it is the standard format for audio, and there
are few user-friendly encoders out there, and even fewer decoders. It
will streamline the process for importing and listening to audio,
replacing the need to write code or use tools that require very
specific input formats.

You may use the CraftOS-PC program (https://www.craftos-pc.cc) to test
out DFPWM playback. To use it, run the program and type this command:
"attach left speaker" Then run "speaker play <file.dfpwm>" for each file.
The app runs in a sandbox, so files have to be transferred in first;
the easiest way to do this is to simply drag the file on the window.
(Or copy files to the folder at https://www.craftos-pc.cc/docs/saves.)

Sample DFPWM files can be generated with an online tool at
https://music.madefor.cc. This is the current best way to encode DFPWM
files. Simply drag an audio file onto the page, and it will encode it,
giving a download link on the page.

I've made sure to update all of the docs as per Developer§7, and I've
tested it as per section 8. Test files encoded to DFPWM play correctly
in ComputerCraft, and other files that work in CC are correctly decoded.
I have also verified that corrupt files do not crash the decoder - this
should theoretically not be an issue as the result size is constant with
respect to the input size.

Signed-off-by: Jack Bruienne <jackbruienne@gmail.com>
2022-03-10 14:05:25 +01:00
Paul B Mahol
47c3b34506 avcodec: add pcm-bluray encoder 2022-03-06 12:45:59 +01:00
Limin Wang
5cd3c83a86 avcodec: support for CUVA HDR Vivid metadata
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2022-03-01 09:08:43 +08:00
Anton Khirnov
be95df12bb lavc/mpeg*: drop the XvMC hwaccel code
XvMC was last relevant over 10 years ago, if ever. There is no reason to
use it today.
2022-02-15 10:16:15 +01:00
Andreas Rheinhardt
df4cb384fb avcodec/Makefile: Add missing entry for ADPCM_IMA_AMV_ENCODER
Forgotten in 555f5c1fc5.

Reviewed-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-06 08:12:28 +01:00
Andreas Rheinhardt
a2372f904c avcodec/Makefile: Only compile nvenc.o if needed
This fixes compilation errors in case nvenc is enabled
(e.g. autodected) with both nvenc-based encoders disabled
because nvenc uses ff_alloc_a53_sei(), yet only the nvenc-based
encoders require atsc_a53.
(This error does not manifest itself in case of static linking
(nothing pulls in nvenc.o), but it exists with shared builds.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2022-01-05 19:33:14 +01:00
Andreas Rheinhardt
aa8bb05d29 avcodec/Makefile: Add missing HEVC decoder->h274.o dependency
Forgotten in 3cc3f5de2a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-05 14:41:39 +01:00
Andreas Rheinhardt
07fd34aca7 avcodec/Makefile: Add missing mpegaudiodata.o dependency to MPEGAUDIO
mpegaudiodec_template.c uses stuff from mpegaudiodata directly,
yet this dependency was only indirectly fulfilled via mpegaudio-headers
before 33e6d57f01. Since this commit,
the latter only needs (and therefore provides) mpegaudiotabs,
leading to compilation failures.
This commit adds this missing direct dependency directly.
(Sorry for not having checked indirect dependencies.)

Found-by: Zane van Iperen <zane@zanevaniperen.com>
Reviewed-by: Zane van Iperen <zane@zanevaniperen.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-05 05:11:33 +01:00