]> git.sesse.net Git - ffmpeg/log
ffmpeg
3 years agolavu/tx: simplify in-place permute search function
Lynne [Sat, 27 Feb 2021 03:19:55 +0000 (04:19 +0100)]
lavu/tx: simplify in-place permute search function

3 years agoavcodec/exrenc: add half-float support
Paul B Mahol [Fri, 26 Feb 2021 23:28:54 +0000 (00:28 +0100)]
avcodec/exrenc: add half-float support

3 years agoavcodec: add missing FF_API_OLD_ENCDEC wrappers to xmm clobber functions
James Almer [Fri, 26 Feb 2021 22:22:42 +0000 (19:22 -0300)]
avcodec: add missing FF_API_OLD_ENCDEC wrappers to xmm clobber functions

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec: Add missing FF_API define for libavcodec pix fmt API
Andreas Rheinhardt [Fri, 26 Feb 2021 06:38:33 +0000 (07:38 +0100)]
avcodec: Add missing FF_API define for libavcodec pix fmt API

avcodec_find_best_pix_fmt2 has been deprecated and replaced by
avcodec_find_best_pix_fmt_of_2 in 2a54ae9df8cbc1717b3929222ac75f384e2ff240.
avcodec_find_best_pix_fmt_of_2 and avcodec_get_pix_fmt_loss meanwhile
were deprecated in 617e866e25b72fa5d9f9d6bbcbd7e4bd69e63a54 when these
functions were de facto moved to libavutil; this has been mentioned in
APIchanges in f7a1c5e4d2294a8970ede7f6deb2fe0a64e202a5. Yet the
attribute_deprecated was never set for the latter two functions and they
were not wrapped in an FF_API define. This commit does this.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agofftools/ffmpeg_filter: Don't use deprecated function
Andreas Rheinhardt [Fri, 26 Feb 2021 07:38:26 +0000 (08:38 +0100)]
fftools/ffmpeg_filter: Don't use deprecated function

avcodec_find_best_pix_fmt_of_2 has been moved to libavutil in
617e866e25b72fa5d9f9d6bbcbd7e4bd69e63a54.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agolavu/tx: require output argument to match input for inplace transforms
Lynne [Fri, 26 Feb 2021 04:40:07 +0000 (05:40 +0100)]
lavu/tx: require output argument to match input for inplace transforms

This simplifies some assembly code by a lot, by either saving a branch
or saving an entire duplicated function.

3 years agoavformat/imx: set video stream duration
Paul B Mahol [Thu, 25 Feb 2021 22:04:55 +0000 (23:04 +0100)]
avformat/imx: set video stream duration

3 years agoavcodec/imx: use ff_reget_buffer()
Paul B Mahol [Thu, 25 Feb 2021 20:42:02 +0000 (21:42 +0100)]
avcodec/imx: use ff_reget_buffer()

Also flush internal stuff upon seeking.
This codec is not intra only.

3 years agoavformat/avlanguage: Remove long disabled av_convert_lang_to
Andreas Rheinhardt [Thu, 25 Feb 2021 17:27:50 +0000 (18:27 +0100)]
avformat/avlanguage: Remove long disabled av_convert_lang_to

1582e306a47977b09fddb029b999f99eb03cd485 scheduled it for removal with
libavformat major version 58, but it was never removed.

Reviewed-by: Paul B Mahol <onemda@gmail.com
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/lavfutils.h: Don't include avformat.h
Andreas Rheinhardt [Thu, 25 Feb 2021 15:30:01 +0000 (16:30 +0100)]
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>
3 years agoavcodec/avcodec: Add missing deprecation to AVCodecParser.next
Andreas Rheinhardt [Thu, 25 Feb 2021 00:45:11 +0000 (01:45 +0100)]
avcodec/avcodec: Add missing deprecation to AVCodecParser.next

The whole old next API has been deprecated in commit
7e8eba2d8755962d9dca5eade57bf8f591a73c0c, 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>
3 years agoavcodec: unschedule removing some functions with FF_API_COPY_CONTEXT
James Almer [Thu, 25 Feb 2021 20:17:33 +0000 (17:17 -0300)]
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>
3 years agoRevert "avcodec/options: add missing FF_API_COPY_CONTEXT checks"
James Almer [Thu, 25 Feb 2021 20:15:21 +0000 (17:15 -0300)]
Revert "avcodec/options: add missing FF_API_COPY_CONTEXT checks"

This reverts commit 0191f2d29c2a62b8699ac75f09708187e943814c.

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>
3 years agodoc/encoders: Add documentation for the GIF encoder
Derek Buitenhuis [Sun, 21 Feb 2021 13:11:37 +0000 (13:11 +0000)]
doc/encoders: Add documentation for the GIF encoder

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
3 years agoavcodec/gifenc: Only write frame palette entries that actually used
Derek Buitenhuis [Thu, 4 Feb 2021 16:44:44 +0000 (16:44 +0000)]
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>
3 years agoavcodec/gifenc: Add global_palette option
Derek Buitenhuis [Sat, 20 Feb 2021 17:22:51 +0000 (17:22 +0000)]
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>
3 years agoavformat/wavenc: Improve unsupported codec error messages
Andreas Rheinhardt [Thu, 25 Feb 2021 06:37:54 +0000 (07:37 +0100)]
avformat/wavenc: Improve unsupported codec error messages

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavfilter/vf_vif: add support for more formats
Paul B Mahol [Thu, 25 Feb 2021 15:36:08 +0000 (16:36 +0100)]
avfilter/vf_vif: add support for more formats

3 years agoavfilter/vf_vif: simplify case comparing same inputs
Paul B Mahol [Thu, 25 Feb 2021 14:52:33 +0000 (15:52 +0100)]
avfilter/vf_vif: simplify case comparing same inputs

3 years agotests/api-band-test: simplify code
Anton Khirnov [Wed, 27 Jan 2021 10:08:29 +0000 (11:08 +0100)]
tests/api-band-test: simplify code

3 years agoHandle AVID MJPEG streams directly in the MJPEG decoder.
Anton Khirnov [Sat, 12 Dec 2020 14:09:10 +0000 (15:09 +0100)]
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.

3 years agoavfilter/vf_vif.c: fix build warning for [-Wmain]
Guo, Yejun [Thu, 25 Feb 2021 06:38:12 +0000 (14:38 +0800)]
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>
3 years agoavfilter/vf_ssim.c: fix build warning for [-Wmain]
Guo, Yejun [Thu, 25 Feb 2021 06:38:11 +0000 (14:38 +0800)]
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>
3 years agolavc/lscrdec: use ff_reget_buffer()
Anton Khirnov [Wed, 24 Feb 2021 08:38:22 +0000 (09:38 +0100)]
lavc/lscrdec: use ff_reget_buffer()

It is simpler and more efficient.

Suggested-by: James Almer <jamrial@gmail.com>
3 years agotests/fate/apng: add a test for APNG_DISPOSE_OP_PREVIOUS
Anton Khirnov [Tue, 16 Feb 2021 20:19:38 +0000 (21:19 +0100)]
tests/fate/apng: add a test for APNG_DISPOSE_OP_PREVIOUS

3 years agopngdec: fix and simplify apng reference handling
Anton Khirnov [Sun, 14 Feb 2021 15:37:33 +0000 (16:37 +0100)]
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.

3 years agolavc/lscrdec: drop unapplicable private capabilities
Anton Khirnov [Sun, 14 Feb 2021 15:12:39 +0000 (16:12 +0100)]
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.

3 years agolavc: split LSCR decoder out of PNG decoder
Anton Khirnov [Sun, 14 Feb 2021 14:50:10 +0000 (15:50 +0100)]
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.

3 years agotests: add a test for LSCR
Anton Khirnov [Sun, 14 Feb 2021 14:55:57 +0000 (15:55 +0100)]
tests: add a test for LSCR

3 years agoavcodec/cfhdenc: do not try to encode junk
Paul B Mahol [Thu, 18 Feb 2021 22:42:01 +0000 (23:42 +0100)]
avcodec/cfhdenc: do not try to encode junk

3 years agoavcodec/cfhdenc: add padding to each decomposition
Paul B Mahol [Sat, 13 Feb 2021 20:49:14 +0000 (21:49 +0100)]
avcodec/cfhdenc: add padding to each decomposition

3 years agoavcodec/cfhdenc: refactor DSP code for CFHD encoder
Paul B Mahol [Tue, 9 Feb 2021 18:17:27 +0000 (19:17 +0100)]
avcodec/cfhdenc: refactor DSP code for CFHD encoder

This is needed to implement x86 SIMD.

3 years agoavcodec/exr: simplify piz decompression
Paul B Mahol [Sat, 20 Feb 2021 01:35:06 +0000 (02:35 +0100)]
avcodec/exr: simplify piz decompression

Note that >32 codes are no longer supported, give
proper error code if such scenario ever happens.

3 years agoavformat/vpk: check that samples_per_block is > 0
Paul B Mahol [Wed, 24 Feb 2021 16:03:11 +0000 (17:03 +0100)]
avformat/vpk: check that samples_per_block is > 0

Fixes floating point exception.

3 years agoavutil/buffer: free all pooled buffers immediately after uninitializing the pool
James Almer [Sat, 20 Feb 2021 13:21:47 +0000 (10:21 -0300)]
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>
3 years agoavcodec/rv34data: Remove rv34_dquant_tab
Andreas Rheinhardt [Sat, 20 Feb 2021 14:22:38 +0000 (15:22 +0100)]
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>
3 years agoavcodec/x86/constants: Remove unused ff_pw_17
Andreas Rheinhardt [Fri, 19 Feb 2021 06:41:36 +0000 (07:41 +0100)]
avcodec/x86/constants: Remove unused ff_pw_17

Unused since 80944df720da98d6e5ee0e355db5814735914ec9.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoswscale/x86/swscale: Remove unused ASM constants
Andreas Rheinhardt [Fri, 19 Feb 2021 05:50:43 +0000 (06:50 +0100)]
swscale/x86/swscale: Remove unused ASM constants

The last user of g15Mask, r15Mask, g16Mask and r16Mask was disabled
in 77a416e8aab77058b542030870fd7178b62d2a62 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 d604bab901f6dfaaad672ef2164e42b1f350474c, w02
since ef423a661818f3c0d8206a2abbc65ff555cc0c67.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoswscale/x86/rgb2rgb: Remove unused ASM constants
Andreas Rheinhardt [Fri, 19 Feb 2021 03:49:04 +0000 (04:49 +0100)]
swscale/x86/rgb2rgb: Remove unused ASM constants

mask24hh etc. are unused since f099fbf5f3ac1d6b3753fc8dfda6558572111fbd,
mask32b and mask32r since 296609f859a587575b91fe9e9691f2707d6e8136,
mask32g since b38d487466e68bd6baf2889017d2a751831560f0 and mask32 since
f8a138be5257f751ef7d3c6b7ab534c0434e90e7.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoswscale/x86/yuv2rgb: Remove unused ASM constants
Andreas Rheinhardt [Fri, 19 Feb 2021 03:31:02 +0000 (04:31 +0100)]
swscale/x86/yuv2rgb: Remove unused ASM constants

mmx_grnmask is unused since 531f97b0c32d1d421f3ac614e002c53951658115,
the other constants since e934194b6a4159b7960cabefb0dd8b998c1961e8.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/celp_math: Disable unused function
Andreas Rheinhardt [Fri, 19 Feb 2021 01:22:36 +0000 (02:22 +0100)]
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>
3 years agoavcodec/x86/diracdsp_init: Reuse macro
Andreas Rheinhardt [Fri, 19 Feb 2021 00:50:40 +0000 (01:50 +0100)]
avcodec/x86/diracdsp_init: Reuse macro

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/x86/diracdsp_init: Simplify macro
Andreas Rheinhardt [Fri, 19 Feb 2021 00:50:01 +0000 (01:50 +0100)]
avcodec/x86/diracdsp_init: Simplify macro

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/x86/diracdsp_init: Make functions only used here static
Andreas Rheinhardt [Fri, 19 Feb 2021 00:32:25 +0000 (01:32 +0100)]
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>
3 years agoavcodec/x86/diracdsp_init: Remove unused MMX functions
Andreas Rheinhardt [Thu, 18 Feb 2021 23:43:45 +0000 (00:43 +0100)]
avcodec/x86/diracdsp_init: Remove unused MMX functions

Unused since a1f3b18bf55f106c974eacb1dc831be4d2bd5277, 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>
3 years agoavcodec/acelp_vectors: Remove unused ff_fc_2pulses_9bits_track1
Andreas Rheinhardt [Thu, 18 Feb 2021 22:14:11 +0000 (23:14 +0100)]
avcodec/acelp_vectors: Remove unused ff_fc_2pulses_9bits_track1

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/acelp_pitch_delay: Inline small functions only used once
Andreas Rheinhardt [Thu, 18 Feb 2021 20:24:51 +0000 (21:24 +0100)]
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>
3 years agoavcodec/rangecoder: Move ff_rac_check_termination to tests/rangecoder.c
Andreas Rheinhardt [Thu, 18 Feb 2021 18:54:24 +0000 (19:54 +0100)]
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>
3 years agoavcodec/mqcenc: Remove unused ff_mqc_length
Andreas Rheinhardt [Thu, 18 Feb 2021 18:50:06 +0000 (19:50 +0100)]
avcodec/mqcenc: Remove unused ff_mqc_length

Unused since 4624656797b667eb6405186682eb04e74dfd90fd.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/ac3tab: Remove unused ff_eac3_default_chmap
Andreas Rheinhardt [Thu, 18 Feb 2021 18:46:25 +0000 (19:46 +0100)]
avcodec/ac3tab: Remove unused ff_eac3_default_chmap

Added in 0c79b1402a48a99f32435a0f5ad2364c58c6fcf3 to use it
in a function that was never used and was itself removed in
676f1f533e2c2960d81784188592a066b9ff1c3d.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/asf: Move ff_asf_audio_conceal_none to its only user
Andreas Rheinhardt [Thu, 18 Feb 2021 18:39:21 +0000 (19:39 +0100)]
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>
3 years agoavcodec/bitstream: Rewrite code to avoid triggering compiler warning
Andreas Rheinhardt [Sun, 21 Feb 2021 00:44:18 +0000 (01:44 +0100)]
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>
3 years agoavcodec/movtextenc: Check for too many styles
Andreas Rheinhardt [Sat, 20 Feb 2021 22:42:04 +0000 (23:42 +0100)]
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>
3 years agoavformat/Makefile: Remove unnecessary dependencies on vocdec
Andreas Rheinhardt [Tue, 23 Feb 2021 10:56:12 +0000 (11:56 +0100)]
avformat/Makefile: Remove unnecessary dependencies on vocdec

Commit 0d1229f1d2b8f26dd50c6be7917bb8ed8cb95364 factored the main part
of the voc demuxer's read_packet function out; yet when this Libav
commit was merged in f99195d56f4aab266926724ca1cfae822df4df16, 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>
3 years agoavcodec/exrenc: use correct type for actual_size as argument for zlib
Paul B Mahol [Tue, 23 Feb 2021 11:30:55 +0000 (12:30 +0100)]
avcodec/exrenc: use correct type for actual_size as argument for zlib

3 years agoavformat/imx: remove unused header
Paul B Mahol [Tue, 23 Feb 2021 10:57:07 +0000 (11:57 +0100)]
avformat/imx: remove unused header

3 years agoavcodec/tiff_data: Move data to its only user
Andreas Rheinhardt [Sat, 20 Feb 2021 03:20:14 +0000 (04:20 +0100)]
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>
3 years agoavformat/wavdec: Share wav and w64 options
Andreas Rheinhardt [Thu, 18 Feb 2021 03:06:53 +0000 (04:06 +0100)]
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>
3 years agoavformat/wav: Deduplicate codec tags lists
Andreas Rheinhardt [Thu, 18 Feb 2021 02:43:13 +0000 (03:43 +0100)]
avformat/wav: Deduplicate codec tags lists

Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/avienc, wtvenc: Deduplicate codec tags list
Andreas Rheinhardt [Thu, 18 Feb 2021 02:26:57 +0000 (03:26 +0100)]
avformat/avienc, wtvenc: Deduplicate codec tags list

Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/aiff: Deduplicate codec tags and codec tags list
Andreas Rheinhardt [Thu, 18 Feb 2021 01:39:34 +0000 (02:39 +0100)]
avformat/aiff: Deduplicate codec tags and codec tags list

Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/ast: Deduplicate codec tags lists
Andreas Rheinhardt [Thu, 18 Feb 2021 01:26:03 +0000 (02:26 +0100)]
avformat/ast: Deduplicate codec tags lists

Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/movenc: Deduplicate codec tags lists
Andreas Rheinhardt [Thu, 18 Feb 2021 01:15:06 +0000 (02:15 +0100)]
avformat/movenc: Deduplicate codec tags lists

Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/oma: Move stuff only used by demuxer to demuxer
Andreas Rheinhardt [Thu, 18 Feb 2021 01:01:09 +0000 (02:01 +0100)]
avformat/oma: Move stuff only used by demuxer to demuxer

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/oma: Deduplicate codec tags list
Andreas Rheinhardt [Thu, 18 Feb 2021 00:51:41 +0000 (01:51 +0100)]
avformat/oma: Deduplicate codec tags list

Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/rso: Deduplicate codec tags list
Andreas Rheinhardt [Thu, 18 Feb 2021 00:46:05 +0000 (01:46 +0100)]
avformat/rso: Deduplicate codec tags list

Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/voc: Deduplicate codec tags list
Andreas Rheinhardt [Thu, 18 Feb 2021 00:42:14 +0000 (01:42 +0100)]
avformat/voc: Deduplicate codec tags list

Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/caf: Deduplicate codec tags list
Andreas Rheinhardt [Thu, 18 Feb 2021 00:31:18 +0000 (01:31 +0100)]
avformat/caf: Deduplicate codec tags list

Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/asfenc: Deduplicate codec tags lists
Andreas Rheinhardt [Thu, 18 Feb 2021 00:24:24 +0000 (01:24 +0100)]
avformat/asfenc: Deduplicate codec tags lists

Also saves relocations.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/au: Deduplicate codec_tag lists
Andreas Rheinhardt [Thu, 18 Feb 2021 00:16:26 +0000 (01:16 +0100)]
avformat/au: Deduplicate codec_tag lists

Also saves a relocation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/isom: Remove outcommented function
Andreas Rheinhardt [Wed, 10 Feb 2021 14:42:10 +0000 (15:42 +0100)]
avformat/isom: Remove outcommented function

There is another ff_mov_read_chan in mov_chan.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/isom: Split movaudio/movvideo tags off into a separate file
Andreas Rheinhardt [Wed, 10 Feb 2021 13:27:09 +0000 (14:27 +0100)]
avformat/isom: Split movaudio/movvideo tags off into a separate file

The NUT and avi demuxers only need ff_codec_movvideo_tags and so this
removes a dependency on the rest of isom.c as well as on mpeg4audio.c
(which isom depends on); it is similar for the Matroska demuxer and
muxers, except that the mpeg4audio.c dependency can't be avoided.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavformat/Makefile: Remove outdated AIFF demuxer dependency on iso_media
Andreas Rheinhardt [Wed, 10 Feb 2021 12:44:58 +0000 (13:44 +0100)]
avformat/Makefile: Remove outdated AIFF demuxer dependency on iso_media

This is a result of the mov channel parsing stuff being factored out
of mov.c twice: Once in 91b782720fd0df5571775b6591bc41797d6ecf78
to isom.c and later in 3bab7cd12802dc5abf2c5cc6dec49e9e249ce204.

Also remove the isom.h header; and while just at it, remove an unused
mathematics.h inclusion.

(isom.c actually depends upon mpeg4audio from libavcodec for
avpriv_mpeg4audio_get_config2 and avpriv_mpa_freq_tab; yet there is
no configure dependency for iso_media which leads to failure of shared
builds.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/Makefile: Remove outdated dependency of FLV demuxer on mpeg4audio
Andreas Rheinhardt [Wed, 10 Feb 2021 11:51:06 +0000 (12:51 +0100)]
avcodec/Makefile: Remove outdated dependency of FLV demuxer on mpeg4audio

Unneeded since f96a653184e63cea91e08ea75ae60d309e431f40 and
b2bb09bcc330156e9d79d7ddfa59f9c5d05ca149.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mpeg4audio: Use proper logcontext for logging
Andreas Rheinhardt [Wed, 10 Feb 2021 11:12:55 +0000 (12:12 +0100)]
avcodec/mpeg4audio: Use proper logcontext for logging

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/scpr3: Avoid code duplication when updating models
Andreas Rheinhardt [Sat, 13 Feb 2021 10:39:12 +0000 (11:39 +0100)]
avcodec/scpr3: Avoid code duplication when updating models

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoconfigure: Remove mpegvideo_enc dependency from ljpeg encoder
Andreas Rheinhardt [Wed, 17 Feb 2021 23:05:00 +0000 (00:05 +0100)]
configure: Remove mpegvideo_enc dependency from ljpeg encoder

It only existed because some code in mjpegenc_common.c relied on it;
yet said code was actually only used by mjpegenc.c and has been moved
there.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/Makefile: Don't build mjpegenc_huffman unconditionally
Andreas Rheinhardt [Wed, 17 Feb 2021 22:41:58 +0000 (23:41 +0100)]
avcodec/Makefile: Don't build mjpegenc_huffman unconditionally

Only the mjpeg and amv encoders as well as its testprogram actually need
it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/mjpegenc_common: Move stuff only used by mjpegenc.c to it
Andreas Rheinhardt [Wed, 17 Feb 2021 22:16:58 +0000 (23:16 +0100)]
avcodec/mjpegenc_common: Move stuff only used by mjpegenc.c to it

This allows to make ff_init_uni_ac_vlc static;
ff_mjpeg_encode_picture_frame has also been made static, but it could
always have been made static.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/jpegtables: Move ff_mjpeg_build_huffman_codes to mjpegenc_common
Andreas Rheinhardt [Tue, 9 Feb 2021 23:31:46 +0000 (00:31 +0100)]
avcodec/jpegtables: Move ff_mjpeg_build_huffman_codes to mjpegenc_common

Since g2meet.c doesn't use it any more, only encoders use it and
the place for their common code is mjpegenc_common.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/g2meet, mjpegdec: Factor out common VLC initialization code
Andreas Rheinhardt [Tue, 9 Feb 2021 23:20:26 +0000 (00:20 +0100)]
avcodec/g2meet, mjpegdec: Factor out common VLC initialization code

While just at it, remove the nb_codes parameter: It is redundant
(the number of codes is implicitly contained in the array containing how
many entries of a specific size there are) and for this reason it might
even be wrong, so it is better to check what is actually used instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/Makefile: Remove redundant mjpegdec dependency from tiff decoder
Andreas Rheinhardt [Tue, 9 Feb 2021 23:05:36 +0000 (00:05 +0100)]
avcodec/Makefile: Remove redundant mjpegdec dependency from tiff decoder

The MJPEG decoder is already activated by configure whenever the tiff
decoder is selected; ergo it is unnecessary to add a dependency in the
Makefile.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoconfigure, libavcodec/Makefile: Fix avrn dependencies
Andreas Rheinhardt [Tue, 9 Feb 2021 21:13:13 +0000 (22:13 +0100)]
configure, libavcodec/Makefile: Fix avrn dependencies

The avrn decoder actually only needs one thing: The MJPEG decoder.
Instead the Makefile made it compile mjpegdec and configure required
some of the prerequisites of the MJPEG decoder (exif and jpegtables).
Even if all the prerequisites of the MJPEG decoder were required, it
would still not make the MJPEG decoder usable, because for that
the MJPEG decoder needs to be in the list of codecs in codec_list.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/avrndec: Remove unnecessary headers
Andreas Rheinhardt [Tue, 9 Feb 2021 21:09:12 +0000 (22:09 +0100)]
avcodec/avrndec: Remove unnecessary headers

The avrn decoder does not use any internals of the MJPEG decoder since
e0031ca29a471c4a540ba2e01b3f81af03ef757b.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoavcodec/Makefile: Remove spurios dcaenc dependency
Andreas Rheinhardt [Tue, 9 Feb 2021 19:57:10 +0000 (20:57 +0100)]
avcodec/Makefile: Remove spurios dcaenc dependency

It does not need dca.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agoconfigure, libavcodec/Makefile: Remove spurious CAF demuxer dependencies
Andreas Rheinhardt [Tue, 9 Feb 2021 13:41:53 +0000 (14:41 +0100)]
configure, libavcodec/Makefile: Remove spurious CAF demuxer dependencies

Forgotten in 604fbb3132e88727e496c96c92cfe02748c25a1a.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
3 years agolsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments
Chip Kerchner [Sat, 10 Oct 2020 00:17:20 +0000 (20:17 -0400)]
lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments

Add inline function for vec_xl if VSX is not supported. vec_xl intrinsic
is only available on POWER 7 or higher.

Fixes ticket #8750.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
3 years agoavcodec: remove pointless lowres deprecation wrappers
James Almer [Sat, 13 Feb 2021 16:32:23 +0000 (13:32 -0300)]
avcodec: remove pointless lowres deprecation wrappers

Neither the feature, public fields, or AVOptions were ever truly deprecated,
nor will have been removed if this FF_API_ define was left in place, so
get rid of it as it's misleading.

Signed-off-by: James Almer <jamrial@gmail.com>
3 years agoavcodec/mjpegdec: Cleanup ff_smvjpeg_decoder()
Michael Niedermayer [Sat, 19 Dec 2020 23:06:32 +0000 (00:06 +0100)]
avcodec/mjpegdec: Cleanup ff_smvjpeg_decoder()

Fixes: memleaks
Fixes: 28533/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-6242529653686272
Fixes: 30594/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMVJPEG_fuzzer-6549216035995648
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoavcodec/cri: Stop the bitreader at the end of uncompressed input
Michael Niedermayer [Mon, 1 Feb 2021 19:11:47 +0000 (20:11 +0100)]
avcodec/cri: Stop the bitreader at the end of uncompressed input

Fixes: Timeout
Fixes: 29983/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-6420415838814208
Fixes: 30595/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CRI_fuzzer-6559089360502784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
3 years agoconfigure: use no-narrowing for cuda-llvm compilation
Matt Oliver [Fri, 12 Feb 2021 15:59:42 +0000 (02:59 +1100)]
configure: use no-narrowing for cuda-llvm compilation

This fixes llvm compiler generating errors about narrowing conversion with
recent releases.

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
3 years agocompat/cuda: correct ushort4 to use ushort
Matt Oliver [Fri, 12 Feb 2021 15:58:25 +0000 (02:58 +1100)]
compat/cuda: correct ushort4 to use ushort

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
3 years agoavcodec/cuviddec: set ulMaxDisplayDelay to zero if low_delay flag is set
Michal Novotny [Fri, 19 Feb 2021 22:33:25 +0000 (14:33 -0800)]
avcodec/cuviddec: set ulMaxDisplayDelay to zero if low_delay flag is set

Zero is the recommended value in Nvidia coding samples for low latency use-cases.

Signed-off-by: Michal Novotny <michal.novotny@comprimato.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
3 years agoavcodec/nvenc: don't disable b-frames by default
Ricardo Monteiro [Fri, 19 Feb 2021 10:47:37 +0000 (11:47 +0100)]
avcodec/nvenc: don't disable b-frames by default

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
3 years agoffprobe: stop setting AVCodecContext.framerate
Anton Khirnov [Mon, 8 Feb 2021 11:22:13 +0000 (12:22 +0100)]
ffprobe: stop setting AVCodecContext.framerate

That field is supposed to be exported by decoders, it makes no sense for
a user to set it.

3 years agoffprobe: stop printing deprecated fields
Anton Khirnov [Mon, 8 Feb 2021 11:14:27 +0000 (12:14 +0100)]
ffprobe: stop printing deprecated fields

The FF_API macros are private and must not be used by external callers.
As the fields in question are to be removed without replacement, just
drop them.
The fields are:
AVPacket.convergence_duration
AVCodecContext.time_base
AVCodecContext.timecode_frame_start
AV_PIX_FMT_FLAG_PSEUDOPAL pixel descriptor flag

3 years agoffprobe: drop code accessing deprecated AVStream.codec
Anton Khirnov [Mon, 8 Feb 2021 11:05:55 +0000 (12:05 +0100)]
ffprobe: drop code accessing deprecated AVStream.codec

3 years agoffprobe: do not use deprecated AVStream.codec for max bitrate
Anton Khirnov [Mon, 8 Feb 2021 11:03:00 +0000 (12:03 +0100)]
ffprobe: do not use deprecated AVStream.codec for max bitrate

Use the decoder context instead.

3 years agoffprobe: remove an unnecessary deprecation guard
Anton Khirnov [Mon, 8 Feb 2021 11:00:13 +0000 (12:00 +0100)]
ffprobe: remove an unnecessary deprecation guard

The code it is guarding is not accessing anything deprecated
(disregarding the fact that a library caller must not use FF_API
deprecation guards).

3 years agoavformat/mov: fix timecode with counter mode flag set
Mark Reid [Sun, 17 Jan 2021 01:48:45 +0000 (17:48 -0800)]
avformat/mov: fix timecode with counter mode flag set

The current behaviour ends up squaring the avg_frame_rate if the conter mode flag is set.
This messes up the timecode calculation, and looks to me as a regression that
seems to have been introduced 428b4aac.

Upon further testing is seems that no special case is need for having the counter flag set.
av_timecode_init appears to handles the timecode correctly, at least in the sample files
I have.

Here is a sample mov file with the counter flag set
https://www.dropbox.com/s/5l4fucb9lhq523s/timecode_counter_mode.mov

before the patch ffmpeg will report the timecode as:
00:37:11:97 and warns that the timecode framerate is 576000000/1002001

after patch:
14:50:55:02

Signed-off-by: Anton Khirnov <anton@khirnov.net>