Commit Graph

104361 Commits

Author SHA1 Message Date
Fei Wang
e7ff5722b1 cbs_av1: fix incorrect data type
Since order_hint_bits_minus_1 range is 0~7, cur_frame_hint can be
most 128. And similar return value for cbs_av1_get_relative_dist.
So if plus them and use int8_t for the result may lose its precision.

Signed-off-by: Fei Wang <fei.w.wang@intel.com>
2021-10-16 19:00:43 -03:00
Tsutomu Seki
9b445663a5 avfilter/opencl: Fix program_opencl for source code larger than 64kB
The condition (pos < len) is always true and the
rest of the OpenCL program code would not be read, while
the maximum number of "rb" is "len - pos - 1", and then, the
maximum number of the "pos" is "len - 1".

Fixes: trac.ffmpeg.org/ticket/9217
2021-10-16 12:17:23 +02:00
Paul B Mahol
5bcc61ce87 avfilter/vf_v360: add reset_rot option 2021-10-16 11:39:15 +02:00
Niklas Haas
3cc3f5de2a avcodec/hevcdec: apply H.274 film grain
Similar in spirit and design to 66845cffc3, but slightly simpler due
to the lack of interlaced frames in HEVC. See that commit for more
details.

For the seed value, since no specification for this appears to exist, I
semi-arbitrarily decided to base it off the POC id alone, since there's
no analog of the idr_pic_id in HEVC's I-frames. This design is stable
across remuxes and seeks, but changes for adjacent frames with a period
that's typically long enough not to be noticeable, which makes it
satisfy all of the requirements that a film grain seed should have.

Tested with and without threading, using a patch to insert film grain
metadata artificially (for lack of real files containing film grain).
2021-10-15 11:55:45 -03:00
Zane van Iperen
5d16660598
avformat/argo_asf: use title metadata when muxing
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-10-15 23:40:15 +10:00
Zane van Iperen
9a2b9aafba
avformat/argo_asf: pass name through as metadata
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-10-15 23:40:15 +10:00
Zane van Iperen
20fa838da5
avformat/argo_asf: cleanup and NULL-terminate name field in header
Preparation for metadata changes in the following patches. Saves
having to create an extra buffer.

Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-10-15 23:39:47 +10:00
Wu Jianhua
2c734a8496 libswscale/x86/rgb2rgb: add shuffle_bytes avx2
Performance data(Less is better):
    shuffle_bytes_ssse3   3.64654
    shuffle_bytes_avx2    0.94288

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
2021-10-15 10:59:20 +02:00
Paul B Mahol
767f162432 avfilter/window_func: unify all filters win_func option that use this header 2021-10-15 10:45:50 +02:00
James Almer
39f3c98bb1 x86/vf_lut3d: use three operand form for some instructions
Fixes compilation with old yasm.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-10-14 18:09:38 -03:00
Paul B Mahol
890cef1ff6 avfilter/vf_fftfilt: export FFT arrays size 2021-10-14 20:26:23 +02:00
Paul B Mahol
e1b820fa33 avfilter/vf_overlay: unbreak alpha composition with negative y and threads > 1 2021-10-14 20:05:39 +02:00
Martin Storsjö
bb10f8d802 avfilter/vf_fftfilt: Use av_clip_uint8
The refactoring in 844890b1bc caused
fate-source to point out that this could be av_clip_uintp2 (or
rather av_clip_uint8).

Signed-off-by: Martin Storsjö <martin@martin.st>
2021-10-14 14:05:39 +03:00
Paul B Mahol
c336c7a9d7 fate: update histogram test results 2021-10-14 12:22:38 +02:00
Paul B Mahol
df05603291 avfilter/vf_histogram: add colors_mode option 2021-10-14 12:16:30 +02:00
Paul B Mahol
7d3a9bb54b avfilter/vf_fftfilt: add gray formats >8 depth support 2021-10-14 10:08:59 +02:00
Pekka Väänänen
4d52e36bd0 avformat/westwood_vqa: Store VQFL codebook chunks
High color 15-bit VQA3 video streams contain high level chunks with
only codebook updates that shouldn't be considered new frames. Now
the demuxer stores a reference to such VQFL chunks and returns them
later along with a VQFR chunk with full frame data.
2021-10-14 09:59:52 +02:00
Paul B Mahol
844890b1bc avfilter/vf_fftfilt: add slice threading support 2021-10-14 01:27:16 +02:00
Paul B Mahol
8add1b39e2 avfilter/vf_fftfilt: simplify bits/len calculation 2021-10-14 01:27:16 +02:00
Paul B Mahol
933765aa0e avfilter: add xcorrelate video filter 2021-10-13 19:09:21 +02:00
Paul B Mahol
32eaf4069e avfilter: add limitdiff video filter 2021-10-13 19:02:34 +02:00
Soft Works
73fe19f09c avfilter/vf_palettegen: cosmetic changes
Signed-off-by: softworkz <softworkz@hotmail.com>
2021-10-13 18:52:14 +02:00
Soft Works
dea673d0d5 avfilter/vf_palette(gen|use): support palettes with alpha 2021-10-13 18:52:14 +02:00
Mark Reid
3ee7250116 avfilter/vf_lut3d: fix building with --disable-optimizations 2021-10-13 18:01:21 +02:00
Limin Wang
871fee82e1 avcodec/videotoolboxenc: use goto end for memory cleanup
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-13 20:12:30 +08:00
Limin Wang
f25871d790 avcodec/avs3_parser: Fix usage of init_get_bits() and use init_get_bits8()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-13 20:12:30 +08:00
Limin Wang
ba03e4ed33 avcodec/audiotoolboxdec: Fix usage of init_get_bits() and use init_get_bits8()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-13 20:12:30 +08:00
Paul B Mahol
13141339c1 avformat/dhav: make duration extraction more robust 2021-10-13 12:14:39 +02:00
Paul B Mahol
6384175d8c avformat/dhav: check if timestamp matches when seeking 2021-10-13 12:14:39 +02:00
Nachiket Tarate
f14adb0516 libavformat/hls: correct indentation
Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2021-10-13 11:24:02 +08:00
Nachiket Tarate
ff958b3846 libavformat/hls: add support for decryption of HLS media segments encrypted using SAMPLE-AES encryption method
Apple HTTP Live Streaming Sample Encryption:

https://developer.apple.com/library/ios/documentation/AudioVideo/Conceptual/HLS_Sample_Encryption

Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2021-10-13 11:23:53 +08:00
Nachiket Tarate
ef0f5d1be6 libavformat/mov: add support for 'cens', 'cbc1' and 'cbcs' encryption schemes specified in Common Encryption (CENC) standard
correct implementation of 'cenc' encryption scheme to support
decryption of partial cipher blocks at the end of subsamples

https://www.iso.org/standard/68042.html

Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2021-10-13 11:23:44 +08:00
Nachiket Tarate
343c03c61c libavcodec/adts_header: add frame_length field and avpriv function to parse AAC ADTS header
These will be used by HLS demuxer in case of sample decryption.

Signed-off-by: Nachiket Tarate <nachiket.programmer@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2021-10-13 11:23:37 +08:00
Michael Niedermayer
1902a60dda avcodec/gemdec: Use ff_set_dimensions()
Fixes: OOM
Fixes: 39798/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GEM_fuzzer-5611636853964800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-11 20:07:35 +02:00
Michael Niedermayer
17e36fac0b avcodec/utils: Ensure 8x8 alignment for ARGO in avcodec_align_dimensions2()
Fixes: out of array access
Fixes: 39736/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ARGO_fuzzer-4820016722214912

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-10-11 20:07:35 +02:00
Limin Wang
78c30857b7 avformat/rtpdec_rfc4175: return the proper value
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-11 23:27:27 +08:00
Limin Wang
5724e8a664 avformat/rtpdec_rfc4175: Remove redundant initialization
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-11 23:27:21 +08:00
Limin Wang
f7823c9a3a avformat/rtpdec_rfc4175: use av_get_bits_per_pixel()
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-11 23:27:15 +08:00
Limin Wang
617cf44c8c avcodec/bitpacked: check av_buffer_ref result
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-11 23:27:08 +08:00
Zhao Zhili
a742ba60f1 libavcodec/speexdec: fix memleak in error path
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-11 15:24:41 +02:00
Andreas Rheinhardt
f626a3d0e0 Revert "avfilter/vf_idet: reduce noisyness if the filter has been auto inserted"
This reverts commit 723c37d3b7.
Said commit was in preparation for auto-inserting the idet filter.
This has never happened; even if it did, the code is wrong, because
it segfaults if the filter instance doesn't have a name (having one
is not mandatory). Furthermore, it is documented for libavfilter to
not assign any semantics to the name, which this check violates.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-10-11 15:24:00 +02:00
Limin Wang
6260c611c5 avformat/libsrt: add snddropdelay parameter for srt
Reviewed-by: "zhilizhao(赵志立)" <quinkblack@foxmail.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2021-10-11 18:43:47 +08:00
Paul B Mahol
90a0da9f14 avfilter/vsrc_testsrc: add planar formats for haldclutsrc 2021-10-11 10:54:05 +02:00
Mark Reid
716b396740 avfilter/vf_lut3d: add x86-optimized tetrahedral interpolation
I spotted an interesting pattern that I didn't see before that leads to the implementation being faster.
The bit shifting table I was using before is no longer needed, and was able to remove quite a few lines. 
I also add use of FMA on the AVX2 version.

f32 1920x1080 1 thread with prelut
c impl
1434012700 UNITS in lut3d->interp,       1 runs,      0 skips
1434035335 UNITS in lut3d->interp,       2 runs,      0 skips
1423615347 UNITS in lut3d->interp,       4 runs,      0 skips
1426268863 UNITS in lut3d->interp,       8 runs,      0 skips

sse2
905484420 UNITS in lut3d->interp,       1 runs,      0 skips
905659010 UNITS in lut3d->interp,       2 runs,      0 skips
915167140 UNITS in lut3d->interp,       4 runs,      0 skips
915834222 UNITS in lut3d->interp,       8 runs,      0 skips

avx
574794860 UNITS in lut3d->interp,       1 runs,      0 skips
581035090 UNITS in lut3d->interp,       2 runs,      0 skips
584116720 UNITS in lut3d->interp,       4 runs,      0 skips
581460290 UNITS in lut3d->interp,       8 runs,      0 skips

avx2
301698880 UNITS in lut3d->interp,       1 runs,      0 skips
301982880 UNITS in lut3d->interp,       2 runs,      0 skips
306962430 UNITS in lut3d->interp,       4 runs,      0 skips
305472025 UNITS in lut3d->interp,       8 runs,      0 skips

gbrap16 1920x1080 1 thread with prelut
c impl
1480894840 UNITS in lut3d->interp,       1 runs,      0 skips
1502922990 UNITS in lut3d->interp,       2 runs,      0 skips
1496114307 UNITS in lut3d->interp,       4 runs,      0 skips
1492554551 UNITS in lut3d->interp,       8 runs,      0 skips

sse2
980777180 UNITS in lut3d->interp,       1 runs,      0 skips
986121520 UNITS in lut3d->interp,       2 runs,      0 skips
986489840 UNITS in lut3d->interp,       4 runs,      0 skips
998832248 UNITS in lut3d->interp,       8 runs,      0 skips

avx
622212360 UNITS in lut3d->interp,       1 runs,      0 skips
622981160 UNITS in lut3d->interp,       2 runs,      0 skips
645396315 UNITS in lut3d->interp,       4 runs,      0 skips
641057075 UNITS in lut3d->interp,       8 runs,      0 skips

avx2
321336400 UNITS in lut3d->interp,       1 runs,      0 skips
321268920 UNITS in lut3d->interp,       2 runs,      0 skips
323459895 UNITS in lut3d->interp,       4 runs,      0 skips
324949967 UNITS in lut3d->interp,       8 runs,      0 skips
2021-10-10 22:23:48 +02:00
Paul B Mahol
5133f4c2c1 avcodec/lagarith: return early on error
Also return proper error values.
2021-10-10 22:05:54 +02:00
Paul B Mahol
148ada5577 avcodec: add native Speex decoder 2021-10-10 17:44:41 +02:00
Gijs Peskens
5274f2f7f8 avformat/librist: replace deprecated functions
This gets rid of of rist_receiver_data_read, rist_receiver_data_block_free and rist_parse_address
these functions have been deprecated since librist release v0.2.1 and are replaced with functions
suffixed with 2.
I added a version macro check at the top of the file to ensure ffmpeg can still be compiled against
older versions.

Signed-off-by: Gijs Peskens <gijs@peskens.net>
Signed-off-by: Marton Balint <cus@passwd.hu>
2021-10-10 17:25:23 +02:00
Marton Balint
9420f7e095 avformat/mpegts: fix max_packet_size in mpegts payload parsing
The maximum allowed useful PES payload data was set to PES_packet_length, but
it is in fact smaller by the length of the PES header.

This changes how corrupt streams are packetized:
- If PES header length is bigger than PES_packet_length then the PES packet
  payload will be handled as an unbound packet
- PES packets with payload across multiple MPEGTS packets will always be
  splitted if with the next chunk of data the payload should exceed
  PES_packet_length, previously a PES_header_length amount of excess was
  allowed.

Fixes ticket #9355.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-10-10 16:54:15 +02:00
Marton Balint
aeea2ad0e4 avformat/mpegts: rename PES total_size to PES_packet_length
This renames PESContext->total_size to PESContext->PES_packet_length and keeps
it 0 for unbound packets, so its name and semantics will match the standard.

There should be no change in functionality.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-10-10 16:54:15 +02:00
Marton Balint
65cd43cff3 avformat/mpegts: delay allocation of PES buffer
This allows us to allocate the buffer in a single code path.

Signed-off-by: Marton Balint <cus@passwd.hu>
2021-10-10 16:54:15 +02:00