Commit Graph

101306 Commits

Author SHA1 Message Date
Andreas Rheinhardt
2869d71493 avfilter/lavfutils.h: Don't include avformat.h
Only lavfutils.c needs avformat.h, not lavfutils.h.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-25 22:03:32 +01:00
Andreas Rheinhardt
e4524270f4 avcodec/avcodec: Add missing deprecation to AVCodecParser.next
The whole old next API has been deprecated in commit
7e8eba2d87, yet deprecating the next
pointer has been forgotten (the next pointers of other structures are
below the public API delimiter, but such a delimiter doesn't exist for
AVCodecParser).

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-25 21:51:11 +01:00
James Almer
e96ea80e85 avcodec: unschedule removing some functions with FF_API_COPY_CONTEXT
These functions were never deprecated. The merge from commit 6988cf2969
included them by mistake.

Found-by: mkver
Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-25 17:35:13 -03:00
James Almer
7addddd49e Revert "avcodec/options: add missing FF_API_COPY_CONTEXT checks"
This reverts commit 0191f2d29c.

These functions were never deprecated. The merge from commit 6988cf2969
included them by mistake.

Found-by: mkver
Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-25 17:34:44 -03:00
Derek Buitenhuis
113a99270d doc/encoders: Add documentation for the GIF encoder
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-02-25 16:41:24 +00:00
Derek Buitenhuis
5a343853c0 avcodec/gifenc: Only write frame palette entries that actually used
GIF palette entries are not compressed, and writing 256 entries,
which can be up to every frame, uses a significant amount of
space, especially in extreme cases, where palettes can be very
small.

Example, first six seconds of Tears of Steel, palette generated
with libimagequant, 320x240 resolution, and with transparency
optimization + per frame palette:

    * Before patch: 186765 bytes
    * After patch: 77895 bytes

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-02-25 16:41:24 +00:00
Derek Buitenhuis
5f2804aba7 avcodec/gifenc: Add global_palette option
This option will disable the writing of the global palette in global
GIF header if it is set to 0, causing only the frame-level palette
to ever be written.

This will be useful later on when further frame-level palette
optimizations are introduced.

The default is 1, which maintains current default behavior.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2021-02-25 16:41:24 +00:00
Andreas Rheinhardt
6eab25fd13 avformat/wavenc: Improve unsupported codec error messages
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-25 16:52:50 +01:00
Paul B Mahol
95af3b6625 avfilter/vf_vif: add support for more formats 2021-02-25 16:38:27 +01:00
Paul B Mahol
550b7a9929 avfilter/vf_vif: simplify case comparing same inputs 2021-02-25 16:38:27 +01:00
Anton Khirnov
a5b737e625 tests/api-band-test: simplify code 2021-02-25 11:46:28 +01:00
Anton Khirnov
9e4225cf7f Handle AVID MJPEG streams directly in the MJPEG decoder.
AVID streams - currently handled by the AVRN decoder - can be (depending
on extradata contents) either MJPEG or raw video. To decode the MJPEG
variant, the AVRN decoder currently instantiates a MJPEG decoder
internally and forwards decoded frames to the caller (possibly after
cropping them).

This is suboptimal, because the AVRN decoder does not forward all the
features of the internal MJPEG decoder, such as direct rendering.
Handling such forwarding in a full and generic manner would be quite
hard, so it is simpler to just handle those streams in the MJPEG decoder
directly.

The AVRN decoder, which now handles only the raw streams, can now be
marked as supporting direct rendering.

This also removes the last remaining internal use of the obsolete
decoding API.
2021-02-25 11:46:28 +01:00
Guo, Yejun
ae4f6379d6 avfilter/vf_vif.c: fix build warning for [-Wmain]
src/libavfilter/vf_vif.c: In function ‘process_frame’:
src/libavfilter/vf_vif.c:542:20: warning: ‘main’ is usually a function [-Wmain]
     AVFrame *out, *main = NULL, *ref = NULL;
                    ^~~~

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-25 11:43:56 +01:00
Guo, Yejun
ac6dd87cd1 avfilter/vf_ssim.c: fix build warning for [-Wmain]
The build warning message:
src/libavfilter/vf_ssim.c: In function ‘ssim_plane_16bit’:
src/libavfilter/vf_ssim.c:246:24: warning: ‘main’ is usually a function [-Wmain]
         const uint8_t *main = td->main_data[c];
                        ^~~~
src/libavfilter/vf_ssim.c: In function ‘ssim_plane’:
src/libavfilter/vf_ssim.c:289:24: warning: ‘main’ is usually a function [-Wmain]
         const uint8_t *main = td->main_data[c];
                        ^~~~

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
2021-02-25 11:43:56 +01:00
Anton Khirnov
d3d99a0a06 lavc/lscrdec: use ff_reget_buffer()
It is simpler and more efficient.

Suggested-by: James Almer <jamrial@gmail.com>
2021-02-24 17:16:46 +01:00
Anton Khirnov
eed2125f3f tests/fate/apng: add a test for APNG_DISPOSE_OP_PREVIOUS 2021-02-24 17:16:46 +01:00
Anton Khirnov
5663301560 pngdec: fix and simplify apng reference handling
Current code is very confused and confusing. It uses two different
reference frames - "previous" and "last" - when only one is really
necessary. It also confuses the two, leading to incorrect output with
APNG_DISPOSE_OP_PREVIOUS mode.

Fixes #9017.
2021-02-24 17:16:46 +01:00
Anton Khirnov
087359ad85 lavc/lscrdec: drop unapplicable private capabilities
FF_CODEC_CAP_ALLOCATE_PROGRESS makes no sense because the decoder does
not support frame threading.
FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM makes no sense because the decoder
does not handle skip_frame.
2021-02-24 17:16:46 +01:00
Anton Khirnov
3a5b857d4c lavc: split LSCR decoder out of PNG decoder
It shares very little code with pngdec, so keeping them together only
makes the code harder to read.
2021-02-24 17:16:46 +01:00
Anton Khirnov
6853bdbdd2 tests: add a test for LSCR 2021-02-24 17:16:46 +01:00
Paul B Mahol
33025ab976 avcodec/cfhdenc: do not try to encode junk 2021-02-24 17:14:03 +01:00
Paul B Mahol
fbfa78508b avcodec/cfhdenc: add padding to each decomposition 2021-02-24 17:14:03 +01:00
Paul B Mahol
d69f4be1c6 avcodec/cfhdenc: refactor DSP code for CFHD encoder
This is needed to implement x86 SIMD.
2021-02-24 17:14:03 +01:00
Paul B Mahol
767d3f7dcf avcodec/exr: simplify piz decompression
Note that >32 codes are no longer supported, give
proper error code if such scenario ever happens.
2021-02-24 17:10:14 +01:00
Paul B Mahol
8213f0a7f7 avformat/vpk: check that samples_per_block is > 0
Fixes floating point exception.
2021-02-24 17:04:40 +01:00
James Almer
45a2902976 avutil/buffer: free all pooled buffers immediately after uninitializing the pool
No buffer will be fetched from the pool after it's uninitialized, so there's
no benefit from waiting until every single buffer has been returned to it
before freeing them all.
This should free some memory in certain scenarios, which can be beneficial in
low memory systems.

Based on a patch by Jonas Karlman.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-02-24 10:45:30 -03:00
Andreas Rheinhardt
b913a4e18d avcodec/rv34data: Remove rv34_dquant_tab
It is unused and coincides with ff_modified_quant_tab.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:52:40 +01:00
Andreas Rheinhardt
585b764f95 avcodec/x86/constants: Remove unused ff_pw_17
Unused since 80944df720.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:49:03 +01:00
Andreas Rheinhardt
c23a5523b5 swscale/x86/swscale: Remove unused ASM constants
The last user of g15Mask, r15Mask, g16Mask and r16Mask was disabled
in 77a416e8aa and finally removed in
36e8de07ed62609df45d064b56501e3084d25723; b15Mask and b16Mask were
apparently always unused (except for in_asm_used_var_warning_killer,
a function that only existed to make the compiler not optimize ASM
constants away).
w10 is unused since d604bab901, w02
since ef423a6618.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:47:54 +01:00
Andreas Rheinhardt
aad597a93c swscale/x86/rgb2rgb: Remove unused ASM constants
mask24hh etc. are unused since f099fbf5f3,
mask32b and mask32r since 296609f859,
mask32g since b38d487466 and mask32 since
f8a138be52.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:45:17 +01:00
Andreas Rheinhardt
49db6e4b4e swscale/x86/yuv2rgb: Remove unused ASM constants
mmx_grnmask is unused since 531f97b0c3,
the other constants since e934194b6a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:43:14 +01:00
Andreas Rheinhardt
f529793490 avcodec/celp_math: Disable unused function
The code using ff_exp2 (namely ff_acelp_decode_gain_code) use it only if
G729_BITEXACT is defined. So disable it if not.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:40:42 +01:00
Andreas Rheinhardt
7825cc392a avcodec/x86/diracdsp_init: Reuse macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:38:12 +01:00
Andreas Rheinhardt
0f317eb8e7 avcodec/x86/diracdsp_init: Simplify macro
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:36:13 +01:00
Andreas Rheinhardt
68bd6c7dac avcodec/x86/diracdsp_init: Make functions only used here static
This allowed to remove forward declarations. Because compilers expect
declarations for all functions they encounter even when it is within
blocks disabled via "if (0 && foo)", one has to use a real #if in
ff_diracdsp_init_x86.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 09:17:40 +01:00
Andreas Rheinhardt
3a80b1ac12 avcodec/x86/diracdsp_init: Remove unused MMX functions
Unused since a1f3b18bf5, yet as nonstatic
functions the compiler can't detect this, so that these functions aren't
stripped and no warning is emitted.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 08:58:57 +01:00
Andreas Rheinhardt
559a26600a avcodec/acelp_vectors: Remove unused ff_fc_2pulses_9bits_track1
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 08:57:17 +01:00
Andreas Rheinhardt
790be3125d avcodec/acelp_pitch_delay: Inline small functions only used once
ff_acelp_decode_8bit_to_1st_delay3, ff_acelp_decode_4bit_to_2nd_delay3
and ff_acelp_decode_5_6_bit_to_2nd_delay3 are all only used once (by
g729dec) whereas ff_acelp_decode_9bit_to_1st_delay6 and
ff_acelp_decode_6bit_to_2nd_delay6 are completely unused; with the
possible exception of ff_acelp_decode_4bit_to_2nd_delay3, these
functions are so small that inlining them is appropriate; and as long as
ff_acelp_decode_4bit_to_2nd_delay3 is only called once, this is also
true for it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 08:56:12 +01:00
Andreas Rheinhardt
bce9c5e276 avcodec/rangecoder: Move ff_rac_check_termination to tests/rangecoder.c
It is only used there.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 08:53:43 +01:00
Andreas Rheinhardt
f729dee615 avcodec/mqcenc: Remove unused ff_mqc_length
Unused since 4624656797.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 08:53:22 +01:00
Andreas Rheinhardt
4c8d9b1d09 avcodec/ac3tab: Remove unused ff_eac3_default_chmap
Added in 0c79b1402a to use it
in a function that was never used and was itself removed in
676f1f533e.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 08:47:11 +01:00
Andreas Rheinhardt
6f3fe7b2c0 avformat/asf: Move ff_asf_audio_conceal_none to its only user
It is only used inside code guarded by #ifdef DEBUG, i.e. it is normally
unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 08:17:50 +01:00
Andreas Rheinhardt
3bf07b1a2d avcodec/bitstream: Rewrite code to avoid triggering compiler warning
Clang infers from the existence of a default case that said case can be
taken. In case of libavcodec/bitstream.c said default case consisted of
an av_assert1 that evaluates to nothing in case of the ordinary assert
level. In this case (that doesn't happen) a variable wouldn't be
initialized, so Clang emitted Wsometimes-uninitialized warnings.
Solve this by making sure that the default path also initializes
the aforementioned variable.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 07:50:56 +01:00
Andreas Rheinhardt
1c9e53d70b avcodec/movtextenc: Check for too many styles
The counter for the number of styles is written on two bytes, ergo
anything > UINT16_MAX is invalid. This also fixes a compiler warning
because of a tautologically true check on 64bit systems.

Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-24 07:50:39 +01:00
Andreas Rheinhardt
78d5e1c653 avformat/Makefile: Remove unnecessary dependencies on vocdec
Commit 0d1229f1d2 factored the main part
of the voc demuxer's read_packet function out; yet when this Libav
commit was merged in f99195d56f, the
dependency of the other users of this function on vocdec.o was
unnecessarily kept. This commit fixes this.

While just at it, also disable the data only used by the voc demuxer
and muxer in voc.c if both of them are disabled.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 21:12:26 +01:00
Paul B Mahol
d7f10b2497 avcodec/exrenc: use correct type for actual_size as argument for zlib 2021-02-23 12:38:57 +01:00
Paul B Mahol
081cbe6961 avformat/imx: remove unused header 2021-02-23 11:57:51 +01:00
Andreas Rheinhardt
ad58113afe avcodec/tiff_data: Move data to its only user
tiff.c is the only user of the data from tiff_data.c (the dependency of
the tiff encoder of it is spurious). Therefore this commit moves all the
data from tiff_data.c to tiff_data.h (which is only included by tiff.c)
and makes the objects declared therein static.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 11:30:57 +01:00
Andreas Rheinhardt
926c1bf85c avformat/wavdec: Share wav and w64 options
The options of the w64 demuxer are a proper subset of the options for
the wav demuxer, making it possible to reuse a part of the options for
the wav demuxer for the w64 demuxer.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 11:30:57 +01:00
Andreas Rheinhardt
1df1083b6c avformat/wav: Deduplicate codec tags lists
Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2021-02-23 11:30:57 +01:00