]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years agoavfilter/vsrc_sierpinski: change seed option type
Paul B Mahol [Thu, 21 Nov 2019 16:38:48 +0000 (17:38 +0100)]
avfilter/vsrc_sierpinski: change seed option type

4 years agoavfilter/vsrc_sierpinski: fix another typos
Paul B Mahol [Thu, 21 Nov 2019 16:35:35 +0000 (17:35 +0100)]
avfilter/vsrc_sierpinski: fix another typos

4 years agoavfilter/vsrc_testsrc: simplify color filter commands parsing
Paul B Mahol [Thu, 21 Nov 2019 16:30:21 +0000 (17:30 +0100)]
avfilter/vsrc_testsrc: simplify color filter commands parsing

4 years agoavfilter/vf_chromakey: add support for commands
Paul B Mahol [Thu, 21 Nov 2019 16:19:40 +0000 (17:19 +0100)]
avfilter/vf_chromakey: add support for commands

4 years agoavfilter/vf_lumakey: add support for commands
Paul B Mahol [Thu, 21 Nov 2019 15:59:39 +0000 (16:59 +0100)]
avfilter/vf_lumakey: add support for commands

4 years agoavfilter/vf_lumakey: change options to doubles, so that values are automatically...
Paul B Mahol [Thu, 21 Nov 2019 15:52:48 +0000 (16:52 +0100)]
avfilter/vf_lumakey: change options to doubles, so that values are automatically scaled

4 years agoavfilter/vf_lumakey: add support for 12bit yuva formats
Paul B Mahol [Thu, 21 Nov 2019 15:40:17 +0000 (16:40 +0100)]
avfilter/vf_lumakey: add support for 12bit yuva formats

4 years agoavfilter/vf_scroll: add support for slice threading
Paul B Mahol [Thu, 21 Nov 2019 11:55:17 +0000 (12:55 +0100)]
avfilter/vf_scroll: add support for slice threading

4 years agoavfilter/vf_chromashift: add support for commands
Paul B Mahol [Thu, 21 Nov 2019 11:24:02 +0000 (12:24 +0100)]
avfilter/vf_chromashift: add support for commands

4 years agoavfilter/vf_fillborders: add support for commands
Paul B Mahol [Thu, 21 Nov 2019 11:07:58 +0000 (12:07 +0100)]
avfilter/vf_fillborders: add support for commands

4 years agoavfilter/af_afftdn: simplify changing commands
Paul B Mahol [Thu, 21 Nov 2019 10:49:23 +0000 (11:49 +0100)]
avfilter/af_afftdn: simplify changing commands

4 years agoavfilter/vf_median: clip radius instead of erroring out
Paul B Mahol [Thu, 21 Nov 2019 10:21:31 +0000 (11:21 +0100)]
avfilter/vf_median: clip radius instead of erroring out

4 years agoavfilter/vf_median: add support for commands
Paul B Mahol [Wed, 20 Nov 2019 21:27:43 +0000 (22:27 +0100)]
avfilter/vf_median: add support for commands

4 years agoavcodec/mjpegbdec: Fix yuv444 pix_fmt detection
Alex Mogurenko [Wed, 20 Nov 2019 11:22:46 +0000 (13:22 +0200)]
avcodec/mjpegbdec: Fix yuv444 pix_fmt detection

by default adobe_transform set to 0 and because of that mjpegb decoder detects yuv444 pix fmt as bgrp

4 years agoavfilter/f_graphmonitor: output frames in pts gaps
Paul B Mahol [Wed, 20 Nov 2019 16:44:18 +0000 (17:44 +0100)]
avfilter/f_graphmonitor: output frames in pts gaps

4 years agoavcodec/iff: Move index use after check in decodeplane8()
Michael Niedermayer [Tue, 29 Oct 2019 18:12:23 +0000 (19:12 +0100)]
avcodec/iff: Move index use after check in decodeplane8()

Fixes: index 9 out of bounds for type 'const uint64_t [8][256]'
Fixes: 18409/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5767030560522240
Fixes: 18720/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5651995784642560
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/atrac3: Check for huge block aligns
Michael Niedermayer [Sun, 20 Oct 2019 21:51:58 +0000 (23:51 +0200)]
avcodec/atrac3: Check for huge block aligns

The largest documented frame size = block align is 1024 bytes
(https://wiki.multimedia.cx/index.php/ATRAC3)

Without a limit this can allocate arbitrary memory and trigger OOM
Fixes: OOM
Fixes: 18337/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3_fuzzer-5763861478637568
Fixes: 18556/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC3AL_fuzzer-5646183334936576
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ralf: use multiply instead of shift to avoid undefined behavior in decode_block()
Michael Niedermayer [Sat, 2 Nov 2019 14:52:52 +0000 (15:52 +0100)]
avcodec/ralf: use multiply instead of shift to avoid undefined behavior in decode_block()

Fixes: left shift of negative value -249
Fixes: 18566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5649394561187840
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/wmadec: Require previous exponents for reuse
Michael Niedermayer [Thu, 31 Oct 2019 13:38:16 +0000 (14:38 +0100)]
avcodec/wmadec: Require previous exponents for reuse

Fixes: division by zero
Fixes: 18474/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAV2_fuzzer-5764986962182144
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1_block: Fix undefined behavior in ac prediction rescaling
Michael Niedermayer [Thu, 31 Oct 2019 14:00:32 +0000 (15:00 +0100)]
avcodec/vc1_block: Fix undefined behavior in ac prediction rescaling

The intermediates are required to fit in 12bit (8.1.3.9 Coefficient Scaling)
See SMPTE 421M-2006 and Amendment 1-2007

Fixes: signed integer overflow: -20691 * 262144 cannot be represented in type 'int'
Fixes: 18479/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5128912371187712
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/qdm2: The smallest header seems to have 2 bytes so treat 1 as invalid
Michael Niedermayer [Thu, 31 Oct 2019 14:22:53 +0000 (15:22 +0100)]
avcodec/qdm2: The smallest header seems to have 2 bytes so treat 1 as invalid

Fixes: Timeout (217sec -> 2ms)
Fixes: 18488/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5708293662310400
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/apedec: Fixes integer overflow of res+*data in do_apply_filter()
Michael Niedermayer [Tue, 29 Oct 2019 17:30:07 +0000 (18:30 +0100)]
avcodec/apedec: Fixes integer overflow of res+*data in do_apply_filter()

Fixes: signed integer overflow: 7400 + 2147482786 cannot be represented in type 'int'
Fixes: 18405/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5708834760294400
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/ra288: Check block_align for the assumed value
Michael Niedermayer [Tue, 29 Oct 2019 17:46:34 +0000 (18:46 +0100)]
avcodec/ra288: Check block_align for the assumed value

Fixes: Timeout (224sec -> 1ms)
Fixes: 18408/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_288_fuzzer-5740382570151936
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/sonic: Fix integer overflow in predictor_calc_error()
Michael Niedermayer [Mon, 21 Oct 2019 21:41:49 +0000 (23:41 +0200)]
avcodec/sonic: Fix integer overflow in predictor_calc_error()

Fixes: signed integer overflow: 5 * -1094995529 cannot be represented in type 'int'
Fixes: 18346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SONIC_fuzzer-5709623893426176
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/vividas: Add EOF check in val_1 loop in track_header()
Michael Niedermayer [Tue, 29 Oct 2019 21:17:45 +0000 (22:17 +0100)]
avformat/vividas: Add EOF check in val_1 loop in track_header()

Fixes: Timeout (148sec -> 0.1sec)
Fixes: 18427/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5682124627116032
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/atrac9dec: Check precision_fine/coarse
Michael Niedermayer [Sat, 19 Oct 2019 16:48:03 +0000 (18:48 +0200)]
avcodec/atrac9dec: Check precision_fine/coarse

Clipping is done as it was preferred in review
See: [FFmpeg-devel] [PATCH 1/5] avcodec/atrac9dec: Check precision_fine/coarse

Fixes: out of array access
Fixes: 18330/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ATRAC9_fuzzer-5641113058148352
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/matroskadec: Fix default value of BlockAddID
Andreas Rheinhardt [Wed, 20 Nov 2019 12:26:59 +0000 (13:26 +0100)]
avformat/matroskadec: Fix default value of BlockAddID

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/af_rubberband: fix sample overqueueing
Paul B Mahol [Wed, 20 Nov 2019 12:05:50 +0000 (13:05 +0100)]
avfilter/af_rubberband: fix sample overqueueing

Fixes #8389

4 years agoavfilter/vf_chromakey: add >8 bit support
Paul B Mahol [Mon, 18 Nov 2019 10:50:07 +0000 (11:50 +0100)]
avfilter/vf_chromakey: add >8 bit support

4 years agoavcodec/dvdec: Use av_clip_uint8 instead of ff_crop_tab
Michael Niedermayer [Fri, 15 Nov 2019 23:10:53 +0000 (00:10 +0100)]
avcodec/dvdec: Use av_clip_uint8 instead of ff_crop_tab

Fixes: out of array access
Fixes: 18788/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DVVIDEO_fuzzer-6254863113781248
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Baptiste Coudurier <baptiste.coudurier@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/amfnec: allocate packets using av_new_packet()
James Almer [Tue, 19 Nov 2019 22:42:48 +0000 (19:42 -0300)]
avcodec/amfnec: allocate packets using av_new_packet()

This ensures they will be reference counted, as required by the AVCodec.receive_packet()
API.

Should fix ticket #8386.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agofate/cbs: add initial AV1 tests
James Almer [Mon, 18 Nov 2019 02:07:27 +0000 (23:07 -0300)]
fate/cbs: add initial AV1 tests

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_midequalizer: add 16bit formats
Paul B Mahol [Tue, 19 Nov 2019 12:08:07 +0000 (13:08 +0100)]
avfilter/vf_midequalizer: add 16bit formats

4 years agoavfilter/vf_deblock: add 12bit yuva formats
Paul B Mahol [Tue, 19 Nov 2019 11:43:26 +0000 (12:43 +0100)]
avfilter/vf_deblock: add 12bit yuva formats

4 years agoavfilter/vf_weave: pal and hwaccel formats are not supported
Paul B Mahol [Tue, 19 Nov 2019 11:35:55 +0000 (12:35 +0100)]
avfilter/vf_weave: pal and hwaccel formats are not supported

4 years agoavfilter/vf_blend: cosmetics: reindent
Paul B Mahol [Tue, 19 Nov 2019 11:14:36 +0000 (12:14 +0100)]
avfilter/vf_blend: cosmetics: reindent

4 years agoavfilter/vf_chromashift: remove unused header
Paul B Mahol [Tue, 19 Nov 2019 09:37:12 +0000 (10:37 +0100)]
avfilter/vf_chromashift: remove unused header

Reverts ef479ee660e4dfbf2645fe3a50d8639fdc22ab1b.

4 years agoavfilter/Makefile: add missing dependency for lut3d
Gyan Doshi [Tue, 19 Nov 2019 07:06:59 +0000 (12:36 +0530)]
avfilter/Makefile: add missing dependency for lut3d

lut3d requires framesync

4 years agoavfilter/Makefile: add missing dependency for chromashift
Gyan Doshi [Tue, 19 Nov 2019 07:05:35 +0000 (12:35 +0530)]
avfilter/Makefile: add missing dependency for chromashift

chromashift requires framesync

4 years agodoc/filters: correct libvmaf example
Gyan Doshi [Tue, 19 Nov 2019 08:39:43 +0000 (14:09 +0530)]
doc/filters: correct libvmaf example

AVTB is 1/AV_TIME_BASE

4 years agodoc/filters: correct ssim example
Gyan Doshi [Tue, 19 Nov 2019 08:38:39 +0000 (14:08 +0530)]
doc/filters: correct ssim example

AVTB is 1/AV_TIME_BASE

4 years agodoc/filters: correct psnr example
Gyan Doshi [Tue, 19 Nov 2019 08:34:23 +0000 (14:04 +0530)]
doc/filters: correct psnr example

AVTB is 1/AV_TIME_BASE

4 years agoavfilter/Makefile: add missing dependency for scale_cuda
Gyan Doshi [Tue, 19 Nov 2019 06:37:03 +0000 (12:07 +0530)]
avfilter/Makefile: add missing dependency for scale_cuda

scale_cuda includes scale.h

4 years agoavcodec/cbs_av1: keep separate reference frame state for reading and writing
James Almer [Mon, 18 Nov 2019 00:08:56 +0000 (21:08 -0300)]
avcodec/cbs_av1: keep separate reference frame state for reading and writing

In scearios where a Temporal Unit is written right after reading it using the same
CBS context (av1_metadata, av1_frame_merge, etc), the reference frame state used
by the writer must not be the state that's the result of the reader having already
parsed the current frame in question.

This fixes writing Switch frames, and frames using short ref signaling.

Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/vf_bm3d: improve threshold scaling with different block_size and depth
Paul B Mahol [Mon, 18 Nov 2019 22:20:18 +0000 (23:20 +0100)]
avfilter/vf_bm3d: improve threshold scaling with different block_size and depth

4 years agoavfilter/vf_dedot: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 17:31:31 +0000 (18:31 +0100)]
avfilter/vf_dedot: add 12bit yuva formats

4 years agoavfilter/vf_deflicker: add support for alpha formats
Paul B Mahol [Mon, 18 Nov 2019 17:27:28 +0000 (18:27 +0100)]
avfilter/vf_deflicker: add support for alpha formats

4 years agoavfilter/vf_amplify: add support for alpha formats
Paul B Mahol [Mon, 18 Nov 2019 17:24:11 +0000 (18:24 +0100)]
avfilter/vf_amplify: add support for alpha formats

4 years agoavfilter/vf_limiter: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 17:20:15 +0000 (18:20 +0100)]
avfilter/vf_limiter: add 12bit yuva formats

4 years agoavfilter/vf_fillborders: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 17:18:27 +0000 (18:18 +0100)]
avfilter/vf_fillborders: add 12bit yuva formats

4 years agoavfilter/vf_premultiply: add support for 12bit yuva format
Paul B Mahol [Mon, 18 Nov 2019 17:15:05 +0000 (18:15 +0100)]
avfilter/vf_premultiply: add support for 12bit yuva format

4 years agoavfilter/vf_chromashift: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 17:12:28 +0000 (18:12 +0100)]
avfilter/vf_chromashift: add 12bit yuva formats

4 years agoavfilter/vf_midequalizer: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 17:07:39 +0000 (18:07 +0100)]
avfilter/vf_midequalizer: add 12bit yuva formats

4 years agoavfilter/vf_convolution: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 17:01:12 +0000 (18:01 +0100)]
avfilter/vf_convolution: add 12bit yuva formats

4 years agoavfilter/vf_neighbor: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 17:00:25 +0000 (18:00 +0100)]
avfilter/vf_neighbor: add 12bit yuva formats

4 years agoavfilter/vf_maskedminmax: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 16:56:34 +0000 (17:56 +0100)]
avfilter/vf_maskedminmax: add 12bit yuva formats

4 years agoavfilter/vf_maskedmerge: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 16:55:21 +0000 (17:55 +0100)]
avfilter/vf_maskedmerge: add 12bit yuva formats

4 years agoavfilter/vf_maskedclamp: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 16:53:45 +0000 (17:53 +0100)]
avfilter/vf_maskedclamp: add 12bit yuva formats

4 years agoavfilter/vf_scroll: add support for 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 16:50:05 +0000 (17:50 +0100)]
avfilter/vf_scroll: add support for 12bit yuva formats

4 years agoavfilter/vf_blend: add 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 16:47:35 +0000 (17:47 +0100)]
avfilter/vf_blend: add 12bit yuva formats

4 years agoavfilter/vf_vaguedenoiser: add support for alpha formats
Paul B Mahol [Mon, 18 Nov 2019 16:42:47 +0000 (17:42 +0100)]
avfilter/vf_vaguedenoiser: add support for alpha formats

4 years agoavfilter/vf_bm3d: use boolean for ref option
Paul B Mahol [Mon, 18 Nov 2019 16:39:45 +0000 (17:39 +0100)]
avfilter/vf_bm3d: use boolean for ref option

4 years agoavfilter/vf_fftdnoiz: add support for alpha formats
Paul B Mahol [Mon, 18 Nov 2019 16:36:56 +0000 (17:36 +0100)]
avfilter/vf_fftdnoiz: add support for alpha formats

4 years agoavfilter/vf_bm3d: add support for alpha formats
Paul B Mahol [Mon, 18 Nov 2019 16:33:19 +0000 (17:33 +0100)]
avfilter/vf_bm3d: add support for alpha formats

4 years agoavfilter/vf_w3fdif: add support for more >8 bit alpha formats
Paul B Mahol [Mon, 18 Nov 2019 16:30:44 +0000 (17:30 +0100)]
avfilter/vf_w3fdif: add support for more >8 bit alpha formats

4 years agoavfilter/vf_avgblur: add support for 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 16:27:42 +0000 (17:27 +0100)]
avfilter/vf_avgblur: add support for 12bit yuva formats

4 years agoavfilter/vf_gblur: add support for 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 16:26:59 +0000 (17:26 +0100)]
avfilter/vf_gblur: add support for 12bit yuva formats

4 years agoavfilter/vf_median: add support for 12bit yuva formats
Paul B Mahol [Mon, 18 Nov 2019 16:24:52 +0000 (17:24 +0100)]
avfilter/vf_median: add support for 12bit yuva formats

4 years agoavfilter/vf_remap: add support for 12bit yuva format
Paul B Mahol [Mon, 18 Nov 2019 16:21:09 +0000 (17:21 +0100)]
avfilter/vf_remap: add support for 12bit yuva format

4 years agoavfilter/vf_lut2: add 12bit depth alpha formats
Paul B Mahol [Mon, 18 Nov 2019 16:15:29 +0000 (17:15 +0100)]
avfilter/vf_lut2: add 12bit depth alpha formats

4 years agoavfilter/vf_atadenoise: support alpha formats
Paul B Mahol [Mon, 18 Nov 2019 16:01:14 +0000 (17:01 +0100)]
avfilter/vf_atadenoise: support alpha formats

4 years agoavfilter/vf_xmedian: add support for alpha formats
Paul B Mahol [Mon, 18 Nov 2019 15:59:15 +0000 (16:59 +0100)]
avfilter/vf_xmedian: add support for alpha formats

4 years agodoc/filters: improve libvmaf section
Gyan Doshi [Mon, 18 Nov 2019 14:02:07 +0000 (19:32 +0530)]
doc/filters: improve libvmaf section

Added default values, correct strings for default model path and pool
method.

4 years agoavdevice/decklink: add option to drop frames till timecode is seen
Gyan Doshi [Mon, 9 Sep 2019 13:03:09 +0000 (18:33 +0530)]
avdevice/decklink: add option to drop frames till timecode is seen

Option wait_for_tc only takes effect if tc_format is set

4 years agoavcodec/cbs: Fix potential overflow
Andreas Rheinhardt [Sun, 17 Nov 2019 07:34:36 +0000 (08:34 +0100)]
avcodec/cbs: Fix potential overflow

The number of bits in a PutBitContext must fit into an int, yet nothing
guaranteed the size argument cbs_write_unit_data() uses in init_put_bits()
to be in the range 0..INT_MAX / 8. This has been changed.

Furthermore, the check 8 * data_size > data_bit_start that there is
data beyond the initial padding when writing mpeg2 or H.264/5 slices
could also overflow, so divide it by 8 to get an equivalent check
without this problem.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavcodec/cbs: Factor out common code for writing units
Andreas Rheinhardt [Sun, 17 Nov 2019 07:34:35 +0000 (08:34 +0100)]
avcodec/cbs: Factor out common code for writing units

All cbs-functions to write units share a common pattern:
1. They check whether they have a write buffer (that is used to store
the unit's data until the needed size becomes known after writing the
unit when a dedicated buffer will be allocated).
2. They use this buffer for a PutBitContext.
3. The (codec-specific) writing takes place through the PutBitContext.
4. The return value is checked. AVERROR(ENOSPC) here always indicates
that the buffer was too small and leads to a reallocation of said
buffer.
5. The final buffer will be allocated and the data copied.

This commit factors this common code out in a single function in cbs.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
4 years agoavformat/flacdec: Remove useless packet
Andreas Rheinhardt [Tue, 8 Oct 2019 05:41:16 +0000 (07:41 +0200)]
avformat/flacdec: Remove useless packet

flac_read_timestamp() applied av_init_packet() to a packet (which
initializes all fields of the packet except for data and size) and then
went on to use only the data and size fields. In other words: Said
packet can be removed and replaced by an uint8_t * and an int.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavf/Makefile: Specify sln demuxer requirements.
Carl Eugen Hoyos [Sun, 17 Nov 2019 22:40:14 +0000 (23:40 +0100)]
lavf/Makefile: Specify sln demuxer requirements.

Mentioned in ticket #8378.

4 years agoconfigure: Add fft dependency for showspatial filter.
Carl Eugen Hoyos [Sun, 17 Nov 2019 22:29:23 +0000 (23:29 +0100)]
configure: Add fft dependency for showspatial filter.

Mentioned in ticket #8378.

4 years agoconfigure: Add fft dependency for headphone filter.
Carl Eugen Hoyos [Sun, 17 Nov 2019 22:24:38 +0000 (23:24 +0100)]
configure: Add fft dependency for headphone filter.

Mentioned in ticket #8378.

4 years agoavcodec: Add more kCVImageBufferColorPrimaries to videotoolboxenc
Nomis101 [Sun, 3 Nov 2019 00:20:38 +0000 (01:20 +0100)]
avcodec: Add more kCVImageBufferColorPrimaries to videotoolboxenc

Signed-off-by: Rick Kern <kernrj@gmail.com>
4 years agoavfilter/f_loop: switch aloop to activate
Paul B Mahol [Sun, 17 Nov 2019 15:20:58 +0000 (16:20 +0100)]
avfilter/f_loop: switch aloop to activate

4 years agoavfilter/f_loop: fix pts handling when timebase and 1/samplerate differ
Paul B Mahol [Sun, 17 Nov 2019 14:21:07 +0000 (15:21 +0100)]
avfilter/f_loop: fix pts handling when timebase and 1/samplerate differ

4 years agoavfilter/af_sidechaincompress: fix pts handling when timebase and 1/samplerate differ
Paul B Mahol [Sun, 17 Nov 2019 11:30:10 +0000 (12:30 +0100)]
avfilter/af_sidechaincompress: fix pts handling when timebase and 1/samplerate differ

4 years agoavfilter/af_anlmdn: fix pts handling when timebase and 1/samplerate differ
Paul B Mahol [Sun, 17 Nov 2019 11:25:54 +0000 (12:25 +0100)]
avfilter/af_anlmdn: fix pts handling when timebase and 1/samplerate differ

4 years agoavfilter/af_agate: fix pts handling when timebase and 1/samplerate differ
Paul B Mahol [Sun, 17 Nov 2019 11:23:48 +0000 (12:23 +0100)]
avfilter/af_agate: fix pts handling when timebase and 1/samplerate differ

4 years agoavfilter/af_afftdn: fix pts handling when timebase and 1/samplerate differ
Paul B Mahol [Sun, 17 Nov 2019 11:21:10 +0000 (12:21 +0100)]
avfilter/af_afftdn: fix pts handling when timebase and 1/samplerate differ

4 years agoavfilter/af_afftfilt: fix pts handling when timebase and 1/samplerate differ
Paul B Mahol [Sun, 17 Nov 2019 11:19:39 +0000 (12:19 +0100)]
avfilter/af_afftfilt: fix pts handling when timebase and 1/samplerate differ

4 years agoavfilter/af_adeclick: fix pts handling when timebase and 1/samplerate differ
Paul B Mahol [Sun, 17 Nov 2019 11:17:51 +0000 (12:17 +0100)]
avfilter/af_adeclick: fix pts handling when timebase and 1/samplerate differ

4 years agoavfilter/af_aecho: switch to activate
Paul B Mahol [Sun, 17 Nov 2019 10:57:52 +0000 (11:57 +0100)]
avfilter/af_aecho: switch to activate

4 years agodoc/APIchanges: update for av_expr_count_vars
Gyan Doshi [Sun, 17 Nov 2019 05:34:58 +0000 (11:04 +0530)]
doc/APIchanges: update for av_expr_count_vars

4 years agoavutil/eval: add function to track variable use
Gyan Doshi [Sun, 17 Nov 2019 05:32:10 +0000 (11:02 +0530)]
avutil/eval: add function to track variable use

1)Some filters allow cross-referenced expressions e.g. x=y+10. In
such cases, filters evaluate expressions multiple times for
successful evaluation of all expressions. If the expression for one or
more variables contains a RNG, the result may vary across evaluation
leading to inconsistent values across the cross-referenced expressions.

2)A related case is circular expressions e.g. x=y+10 and y=x+10 which
cannot be succesfully resolved.

3)Certain filter variables may only be applicable in specific eval modes
and lead to a failure of evaluation in other modes e.g. pts is only
relevant for frame eval mode.

At present, there is no reliable means to identify these occurrences and
thus the error messages provided are broad or inaccurate. The helper
function introduced - av_expr_count_vars - allows developers to identify
the use and count of variables in expressions and thus tailor the error
message, allow for a graceful fallback and/or decide evaluation order.

4 years agolavf/rtmpproto: fix the playpath truncation if the len > 512
Jun Zhao [Fri, 15 Nov 2019 11:10:47 +0000 (19:10 +0800)]
lavf/rtmpproto: fix the playpath truncation if the len > 512

fix the playpath truncation if the len > 512

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Found-by: liuwenhuang <liuwenhuang@tencent.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavcodec/nvenc: make sure newly allocated packets are refcounted
Timo Rothenpieler [Sun, 17 Nov 2019 00:27:44 +0000 (01:27 +0100)]
avcodec/nvenc: make sure newly allocated packets are refcounted

Fixes ticket 8383

Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
4 years agolavc/libopencore-amr: Silence a warning about an unused function.
Carl Eugen Hoyos [Sat, 16 Nov 2019 23:35:14 +0000 (00:35 +0100)]
lavc/libopencore-amr: Silence a warning about an unused function.

4 years agoavfilter/vf_framepack: really fix ef466a8b29f8
Paul B Mahol [Sat, 16 Nov 2019 23:21:18 +0000 (00:21 +0100)]
avfilter/vf_framepack: really fix ef466a8b29f8

4 years agoavfilter/vf_framepack: switch to activate
Paul B Mahol [Sat, 16 Nov 2019 22:53:39 +0000 (23:53 +0100)]
avfilter/vf_framepack: switch to activate

4 years agoavformat/mp3dec: Check for occurances of headers within frames during probing
Limin Wang [Thu, 7 Nov 2019 16:16:22 +0000 (00:16 +0800)]
avformat/mp3dec: Check for occurances of headers within frames during probing

Fixes misdetection of zYLx.wav

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mp3dec: Check that the frame fits within the probe buffer
Michael Niedermayer [Thu, 7 Nov 2019 20:16:32 +0000 (21:16 +0100)]
avformat/mp3dec: Check that the frame fits within the probe buffer

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_framepack: fix timestamps for frameseq format
Paul B Mahol [Sat, 16 Nov 2019 22:31:03 +0000 (23:31 +0100)]
avfilter/vf_framepack: fix timestamps for frameseq format