Compare commits

...

59 Commits

Author SHA1 Message Date
Michael Niedermayer 140fd653ae Changelog: Remove "version <next>"
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:57:24 +02:00
Michael Niedermayer 09f15530e5 RELEASE_NOTES: Based on the version from 5.1
Name suggested by 3 people on ML

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:15:31 +02:00
Manuel Lauss af310e68db avcodec/sanm: fix issues with FTCH offset hack
Just add an extra x/y offset parameter pair to process_frame_obj(),
and store the size of the data to FTCH in a separate context member.
The only valid sizes for FTCH are 6 and 12, reject any other.
Finally, if a FOBJ uses codecs37 and above, enforce it to be subversion 2,
to use the simpler STOR/FTCH method.

Fixes BIGSLEEP-440183164/process_ftch.anim

Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d311382c38)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:07:20 +02:00
Michael Niedermayer c3747e011e avcodec/sanm: Eliminate reference into reallocated frame
AFAIK the original decoder uses the frame buffers in very strange ways
our implementation seems to mimic that and that results in the
bitstream input to point into a frame buffer while code then
parses that and potentially reallocates the frame buffer
leaving pointers hanging into dealllocated space

This simply uses a temporary buffer

Fixes: Writing into freed buffers
Fixes: BIGSLEEP-440183164/old_codec21.anim
Fixes: BIGSLEEP-440183164/old_codec4.anim

Found-by: Google Big Sleep

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c41a70b6bb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:07:20 +02:00
Michael Niedermayer f258c9a8e5 avcodec/sanm: Replace impossible bitstream check by assert
the space left and size have already been cross checked by the caller

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d4e28917af)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-22 01:07:19 +02:00
Marvin Scholz a6c578ef65 avformat/hlsproto: explicitly deprecate it
This makes it more clear that it will be removed in a future release.
2025-08-22 00:28:33 +02:00
Mark Thompson efa64c2acc hwcontext_vulkan: Fix build with older Vulkan headers
(cherry picked from commit 4a42e5a1e2)
2025-08-22 04:44:19 +09:00
Mark Thompson 9c5f654e44 hwcontext_vulkan: Fix build
(cherry picked from commit 19473362fc)
2025-08-22 04:44:19 +09:00
Mark Thompson 5494973d28 cbs_vp9: Fix VP9 passthrough
Don't overwrite the bitstream values when updating the top-level loop
filter and segmentation state, instead do the update separately at the
end of the frame parsing.

This also reverts the change to the passthrough tests which made them
have output not matching the input.

(cherry picked from commit 26a2a76346)
2025-08-22 04:44:19 +09:00
Benjamin Cheng 15cb74fc68 vulkan_vp9: Read segment and lf data from cbs
The previous change 26a2a76346 broke Vulkan decoding because the lf and
segmentation values contained within VP9RawFrameHeader can no longer be
updated.

Read the propogated values from the CBS instead.

(cherry picked from commit 7bfaa6d662)
2025-08-22 04:42:30 +09:00
vytskalt 9ddd245b09 hwcontext_vulkan: transfer EXCLUSIVE images to correct queue families
(cherry picked from commit a6b5a382dd)
2025-08-22 04:42:30 +09:00
Lynne c1a7f4040a lavfi/bwdif_vulkan: fix typo in temp_diff assignment
Thanks to Niklas Haas for pointing this out.

(cherry picked from commit 451e6bed43)
2025-08-22 04:42:30 +09:00
Kacper Michajłow 17f4cc0992 avcodec/vulkan_encode_av1: use CODEC_PIXFMTS to define pix_fmts
Fixes deprecation warnings.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit b7a3c426ea)
2025-08-22 04:42:30 +09:00
Niklas Haas eeff85f15d avutil/hwcontext_vulkan: also re-query dprops in device_init()
This can be unset if using an externally provided device, as in this case
device_create() never gets called.

(cherry picked from commit 881224b213)
2025-08-22 04:42:30 +09:00
Michael Niedermayer bc88c1d62e Prepare for 8.0
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 21:51:04 +02:00
Lynne 3b8fe34a30 aacdec_usac: use RefStruct to track unfinished extension buffers
Extensions in AAC USAC can be stored across multiple frames (mainly to keep CBR compliance).
This means that we need to reallocate a buffer when new data is received, accumulate the bitstream data,
and so on until the end of extension flag is signalled and the extension can be decoded.

This is made more complicated by the way in which the AAC channel layout switching is performed.
After decades of evolution, our AAC decoder evolved to double-buffer its entire configuration.
All changes are buffered, verified, and applied, on a per-frame basis if required, in often
random order.

Since we allocate the extension data on heap, this means that if configuration is applied,
in order to avoid double-freeing, we have to keep track of what we've allocated.

It should be noted that extensions which are spread in multiple frames are generally rare,
so an optimization to introduce av_refstruct_realloc() wouldn't generally be useful across the codebase.
Therefore, a copy is good enough for now.

Thanks to Michael Niedermayer for additional fixing.

Fixes: double free
Fixes: 393523547/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6740617236905984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
(cherry picked from commit c05fc27dd3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:52 +02:00
Michael Niedermayer ac8cbf2ad7 avcode: Use av_fast_realloc() in ff_lzf_uncompress()
Fixes: 438961582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5850827739955200
Fixes: mixed up realloc() functions

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Co-Authored-by: James Almer <jamrial@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 0a5046c099)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:52 +02:00
Michael Niedermayer 30b308f7a8 avcodec/dxv: Check coded_height, to avoid invalid av_clip()
Fixes: assertion failure
Fixes: 438961582/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5850827739955200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cdee519d40)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:51 +02:00
Michael Niedermayer afc8c20946 avcodec/aac/aacdec: dont allow ff_aac_output_configure() allocating a new frame if it has no frame
Fixes: null pointer dereference
Fixes: crash_test.mp4

Found-by: Intel PSIRT
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fcf180d9ea)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:51 +02:00
Michael Niedermayer debbeb006b avformat/lrcdec: Fix fate-sub-lrc-ms-remux on x86-32
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0243cf89b1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:51 +02:00
Michael Niedermayer 8c117d7fec swscale/swscale_internal: Use more precisse gamma
Avoids failure of xyz12 fate tests on mingw and linux x86-32

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ca20d42cd7)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:50 +02:00
Michael Niedermayer 5f8cb575e8 avcodec/sanm: Check w,h,left,top
The setup code fow w,h,left,top is complex, the code using it also falls in
at least 2 different classes, one using left/top the other not.

To ensure no out of array access happens we add this clear check.

Fixes: out of array access
Fixes: 439261995/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5383455572819968

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 134fbfd1dc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:50 +02:00
James Almer abf123b744 avformat/mov: don't use an allocated array for sample_size with HEIF images
The array is only ever needed for streams where each sample entry may have a
different value. Given that for non animated HEIF there's a single value that
applies to the image, use the field defined for that.

Fixes: NULL pointer dereference
Fixes: 437528618/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6537287645331456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit a28e01a6c1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:50 +02:00
Michael Niedermayer e97babf6bc avcodec/rv60dec: clear pu_info
pu_info is read uninitialized on damaged input and at that point the following codepath is dependant
on the uninitialized data. In one of these pathes out of array accesses happen.
None of this is replicatable

Less uninitialized data also should result in more reproducable reports

Fixes: Use of uninitialized memory
Fixes: 418335931/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV60_fuzzer-5103986067963904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 50affd2b09)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:49 +02:00
Kacper Michajłow 9bc89a2605 avformat/tls_openssl: use ascii - (0x2D) instead of 0x2010 hyphen
Too much AI is bad for you...

Fixes: 167e343bbe
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit 3a8b3dfeca)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:49 +02:00
Michael Niedermayer ac5ff0ae89 avcodec/utvideodec: Clear plane_start array
in pack mode the array is passed into decode_plane() without being initialized or used

Fixes: use of uninitialized memory
Fixes: 438780119/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_UTVIDEO_DEC_fuzzer-5464037027807232

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2a22972db3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:48 +02:00
Oliver Chang a2e445918e avcodec/prores_raw: Fix heap buffer overflow
When dimensions differ from context, those were updated using
ff_set_dimensions, however this overwrote the aligned coded_width and
coded_height that were set before, leading to a buffer overflow when
writing the frame data.

Fixes: OssFuzz 438771336
Fixes: Heap-buffer-overflow

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Marvin Scholz <epirat07@gmail.com>
Reviewed-by: Marvin Scholz <epirat07@gmail.com>
(cherry picked from commit c9e93df4ee)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:48 +02:00
Michael Niedermayer 34c39367aa .forgejo/CODEOWNERS: remove reference to secret apparently uncommited code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7d606ef0cc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:48 +02:00
Michael Niedermayer 3cab009519 fftools/ffmpeg_mux_init: Use 64bit for score computation in map_auto_video()
Fixes: signed integer overflow: 10 * 1952737655 cannot be represented in type 'int'
Fixes: PoC_avi_demux

Found-by: 2ourc3 (Salim LARGO)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cdbb5f1b93)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:47 +02:00
Michael Niedermayer 3e05b89590 tools/merge-all-source-plugins: Fix merge_internal() return code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b5b306ca31)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:47 +02:00
Michael Niedermayer 4a3e5ea8d2 tools: Split the list of source plugins out of "merge-all-source-plugins"
(cherry picked from commit fd31df4306)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:47 +02:00
Jiasheng Jiang 263e819aa4 libavfilter/dnn/dnn_backend_tf: Remove redundant av_freep() to avoid double free
Remove redundant av_freep() to avoid double free since task will be freed in dnn_free_model_tf() after the success of ff_queue_push_back().

Fixes: af052f9066 ("lavfi/dnn: fix mem leak in TF backend error handle")
Signed-off-by: Jiasheng Jiang <jiashengjiangcool@gmail.com>
(cherry picked from commit b8d5f65b9e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:46 +02:00
Michael Niedermayer 23655160ea avcodec/dxv: Use av_fast_realloc() for op_data
makes things consistent

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 373bd80b16)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:46 +02:00
Michael Niedermayer f2507dba3b avcodec/dxv: Use av_fast_realloc() and clear all new space
The code writing in the buffer has a wide range of error checks
which simply leave it partly uninitialized.

Initializing it on allocation ensures no sensitive data leaks and that
bugs are more reliably reproduceable

Fixes: use of uninitialized memory
Fixes: 435225510/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-4521918634196992

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4a0b793737)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:46 +02:00
Michael Niedermayer da3f5273fc avcodec/dxv: Clear ctex
same issue as with tex

Fixes: 431665305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5339599339847680
Fixes: use of uninitialized memory

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4e5f25c0a5)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:45 +02:00
Michael Niedermayer 6049800a10 avcodec/dxv: Check that we initialize op_data
Fixes: 431665305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DXV_DEC_fuzzer-5339599339847680
Fixes: use of uninitialized memory

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6a8c41dcac)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:45 +02:00
Michael Niedermayer e726f7af17 avcodec/sanm: Check mv in codec48_block()
Fixes: out of array read
Fixes: 436943287/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SANM_fuzzer-5011037029203968

This issue did oddly enough, not replicate

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d5bdb0b705)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:45 +02:00
Michael Niedermayer de76fb27a6 avcodec/exr: Check for pixel type consistency in DWA
Fixes: out of array access
Fixes: BIGSLEEP-436511754/testcase.exr

Found-by: Google Big Sleep
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0469d68acb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:44 +02:00
Kacper Michajłow 995d329cf9 avcodec/d3d12va_encode: fix label followed by a declaration warning
Fixes: d3d12va_encode.c: warning: label followed by a declaration is a
       C23 extension

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit ac6db22e37)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:44 +02:00
Kacper Michajłow 81dcb67813 avcodec/libvorbisdec: avoid overflow when assinging sample rate from long to int
Fixes: 416134551/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_DEC_fuzzer-6096101407260672
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit 2287a19abb)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:44 +02:00
Kacper Michajłow bde02336a4 avcodec/g726: init missing sample rate
Fixes: 416134551/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_G726_DEC_fuzzer-5695764455292928
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit c2f7dae70d)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:43 +02:00
Kacper Michajłow 6b1f994e43 avformat/lrcdec: limit input timestamp range to avoid overflows
Fixes: clusterfuzz-testcase-ffmpeg_dem_LRC_fuzzer-5226140131459072
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit c74bc74398)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:43 +02:00
Michael Niedermayer 5051753833 avcodec/scpr3: Clear clr
clr is passing into decode_run_p() its not used when not set
but this possibly triggers msan (it doesnt locally)

Fixes?: use of uninintialized memory
Fixes?: 436997807/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SCPR_fuzzer-6253316466606080

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3542260376)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:42 +02:00
Michael Niedermayer a676267a2c avcodec/ilbcdec: Clear cbvec when used with create_augmented_vector()
Fixes: use of uninitialized memory
Fixes: 42538134/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-6322020827070464

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9686fdd729)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:42 +02:00
Kacper Michajłow bd55bf8300 avformat/mov: clear old name from infe
heif_items are reused and to avoid leaking memory or using stale name,
clear it first.

Fixes: 432505829/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6654363487764480
Found-by: OSS-Fuzz
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
(cherry picked from commit 3bf8bf965f)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:42 +02:00
Leon Grutters 64c71cbe4e doc/community.texi: fix spelling error
Fixes: 262d41c804 ("all: fix typos found by codespell")
Signed-off-by: Leon Grutters <gruttersleonbot2@gmail.com>
(cherry picked from commit 777408d149)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:41 +02:00
Michael Niedermayer 2feaad5cb9 tools/merge-all-source-plugins: set version
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2025-08-19 17:56:41 +02:00
wangbin 048f6f4bd5 configure: fix -L flags for lld-link 2025-08-15 20:22:51 +02:00
Kacper Michajłow 4558ad6a77 avcodec/Makefile: add missing dependency for prores raw decoder (again)
proresdata.o is also needed, missed in a9e7b5aa07

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 21:08:15 +02:00
Kacper Michajłow 937d9ed849 avcodec/Makefile: add missing dependency for prores raw decoder
Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2025-08-14 07:54:51 -04:00
James Almer 13b161cd24 avcodec/cbs_apv: store derived tile information in a per frame basis
If a single fragment contains more than one frame unit, the tile information stored
in the private context will only correspond to one of them.

Fixes: crash (out of array access)
Fixes: 435489659/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-6194885205229568

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 4b39d776c3)
2025-08-12 19:13:06 -03:00
Michael Niedermayer 7c92f740ee avcodec/apv_decode: make apv_format_table consistent with the code and check it
Fixes: writing in a null pointer
Fixes: 435278398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APV_fuzzer-4566392923029504

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cfce595572)
2025-08-12 19:13:06 -03:00
Marton Balint 057b94649f swscale/swscale_unscaled: use 8 line alignment for planarCopyWrapper with dithering
Dithering relies on a 8 line dithering table and the code always uses it from
the beginning. So in order to make dithering independent from height of the
slices used we must enforce a 8 line alignment.

Fixes issue #20071.

Signed-off-by: Marton Balint <cus@passwd.hu>
(cherry picked from commit b61e510e75)
2025-08-13 00:02:59 +02:00
Martin Storsjö 26da3d0069 fate: Fix the sub-mcc tests on Windows in eastern time zones
Previously, these tests failed when running on Windows, if the
system is configured with a time zone east of Greenwich, i.e.
with a positive GMT offset.

The muxer converts the creation_date given by the user using
av_parse_time to unix time, as a time_t. The creation_date is
interpreted as a local time, i.e. according to the current time
zone. (This time_t value is then converted back to a broken out
local time form with localtime_r.)

The given reference date/time, "1970-01-01T00:00:00", is the
origin point for unix time, corresponding to time_t zero. However
when interpreted as local time, this doesn't map to exactly zero.
Time zones east of Greenwich reached this time a number of hours
before the point of zero time_t - so the corresponding time_t
value essentially is minus the GMT offset, in seconds.

Windows mktime returns an error, returning (time_t)-1, when given
such a "struct tm", while e.g. glibc mktime happily returns a
negative time_t. av_parse_time doesn't check the return value of
mktime for potential errors.

This is observable with the following test snippet:

    struct tm tm = { 0 };
    tm.tm_year = 70;
    tm.tm_isdst = -1;
    tm.tm_mday = 1;
    tm.tm_hour = 0;
    time_t t = mktime(&tm);
    printf("%d-%02d-%02d %02d:%02d:%02d\n", tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec);
    printf("t %d\n", (int)t);

By varying the value of tm_hour and the system time zone, one
can observe that Windows mktime returns -1 for all time_t values
that would have been negative.

This range limit is also documented by Microsoft in detail at
https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/mktime-mktime32-mktime64.

To avoid the issue, pick a different, arbitrary reference time,
which should have a nonnegative time_t for all time zones.

(cherry picked from commit 13139d6d83)
Signed-off-by: Martin Storsjö <martin@martin.st>
2025-08-12 13:45:57 +03:00
Leo Izen a8fdfddedb avcodec/vp9: fix leaked cbs fragment AVBufferRef
When this function returns, the fragment is never reset, so
current_frag->data_ref is never unref-ed, which ends up leaking it.
We call ff_cbs_fragment_reset to release the reference on its buffer.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2025-08-10 21:05:43 -04:00
Jacob Lifshay 89849ca92a tests/fate/subtitles: add test for smpte436m_to_eia608 bsf
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:35 -04:00
Jacob Lifshay 370cff8b33 lavc/bsf/smpte436m_to_eia608: fix memory leak -- forgot to free input av_packet
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:26 -04:00
Jacob Lifshay 9fd3869212 lavc/bsf/eia608_to_smpte436m: fix memory leak -- forgot to free input av_packet
reported in https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20024#issuecomment-2405

Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:15 -04:00
Jacob Lifshay 0a167141d0 tests/fate/subtitles: fix mcc test input file paths
they use tests/ref/fate/sub-mcc-remux as input,
so prefix them with $(SRC_PATH) so building works
when not in the source directory.

Fixes: #20183
Reported-by: Sean McGovern <gseanmcg@gmail.com>
Signed-off-by: Jacob Lifshay <programmerjake@gmail.com>
2025-08-10 13:13:07 -04:00
80 changed files with 550 additions and 270 deletions
-1
View File
@@ -53,7 +53,6 @@ libavutil/.*d3d12va.* @jianhuaw
libavutil/eval.* @michaelni
libavutil/iamf.* @jamrial
libavutil/integer.* @michaelni
libavutil/kiss99.* @michaelni
libavutil/lfg.* @michaelni
libavutil/lls.* @michaelni
libavutil/md5.* @michaelni
-2
View File
@@ -1,8 +1,6 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version <next>:
version 8.0:
- Whisper filter
+1 -1
View File
@@ -1 +1 @@
7.1.git
8.0
+15
View File
@@ -0,0 +1,15 @@
┌────────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 8.0 "Huffman" │
└────────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 8.0 "Huffman", about 11
months after the release of FFmpeg 7.1.
A complete Changelog is available at the root of the project, and the
complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git
We hope you will like this release as much as we enjoyed working on it, and
as usual, if you have any questions about it, or any FFmpeg related topic,
feel free to join us on the #ffmpeg IRC channel (on irc.libera.chat) or ask
on the mailing-lists.
Vendored
+1 -1
View File
@@ -5174,7 +5174,7 @@ probe_cc(){
# but we can force it back to gnu mode and get the version from there.
_ident=$($_cc -flavor gnu --version 2>/dev/null)
_ld_o='-out:$@'
_flags_filter=msvc_flags
_flags_filter=msvc_flags_link
_ld_lib='lib%.a'
_ld_path='-libpath:'
elif VSLANG=1033 $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
+1 -1
View File
@@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER =
PROJECT_NUMBER = 8.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
+1 -1
View File
@@ -123,7 +123,7 @@ Internally, the TC should take decisions with a majority, or using ranked-choice
Each TC member must vote on such decision according to what is, in their view, best for the project.
If a TC member feels they are affected by a conflict of interest with regards to the case, they should announce it and recurse themselves from the TC
If a TC member feels they are affected by a conflict of interest with regards to the case, they should announce it and recuse themselves from the TC
discussion and vote.
A conflict of interest is presumed to occur when a TC member has a personal interest (e.g. financial) in a specific outcome of the case.
+4 -4
View File
@@ -1593,7 +1593,7 @@ static int map_auto_video(Muxer *mux, const OptionsContext *o)
{
AVFormatContext *oc = mux->fc;
InputStream *best_ist = NULL;
int best_score = 0;
int64_t best_score = 0;
int qcr;
/* video: highest resolution */
@@ -1604,16 +1604,16 @@ static int map_auto_video(Muxer *mux, const OptionsContext *o)
for (int j = 0; j < nb_input_files; j++) {
InputFile *ifile = input_files[j];
InputStream *file_best_ist = NULL;
int file_best_score = 0;
int64_t file_best_score = 0;
for (int i = 0; i < ifile->nb_streams; i++) {
InputStream *ist = ifile->streams[i];
int score;
int64_t score;
if (ist->user_set_discard == AVDISCARD_ALL ||
ist->st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
continue;
score = ist->st->codecpar->width * ist->st->codecpar->height
score = ist->st->codecpar->width * (int64_t)ist->st->codecpar->height
+ 100000000 * !!(ist->st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS)
+ 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT);
if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
+1 -1
View File
@@ -637,7 +637,7 @@ OBJS-$(CONFIG_PRORES_DECODER) += proresdec.o proresdsp.o proresdata.o
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o proresdata.o
OBJS-$(CONFIG_PRORES_AW_ENCODER) += proresenc_anatoliy.o proresdata.o
OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o
OBJS-$(CONFIG_PRORES_RAW_DECODER) += prores_raw.o
OBJS-$(CONFIG_PRORES_RAW_DECODER) += prores_raw.o proresdsp.o proresdata.o
OBJS-$(CONFIG_PRORES_VIDEOTOOLBOX_ENCODER) += videotoolboxenc.o
OBJS-$(CONFIG_PROSUMER_DECODER) += prosumer.o
OBJS-$(CONFIG_PSD_DECODER) += psd.o
+28 -3
View File
@@ -62,6 +62,7 @@
#include "libavutil/opt.h"
#include "libavutil/tx.h"
#include "libavutil/version.h"
#include "libavutil/refstruct.h"
/*
* supported tools
@@ -421,6 +422,26 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
return layout;
}
static void copy_oc(OutputConfiguration *dst, OutputConfiguration *src)
{
int i;
for (i = 0; i < src->usac.nb_elems; i++) {
AACUsacElemConfig *src_e = &src->usac.elems[i];
AACUsacElemConfig *dst_e = &dst->usac.elems[i];
/* dst_e->ext.pl_buf is guaranteed to be set to src_e->ext.pl_buf
* upon this function's return */
av_refstruct_replace(&dst_e->ext.pl_buf, src_e->ext.pl_buf);
}
/* Unref all additional buffers to close leaks */
for (; i < dst->usac.nb_elems; i++)
av_refstruct_unref(&dst->usac.elems[i].ext.pl_buf);
/* Set all other properties */
*dst = *src;
}
/**
* Save current output configuration if and only if it has been locked.
*/
@@ -429,7 +450,7 @@ static int push_output_configuration(AACDecContext *ac)
int pushed = 0;
if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
ac->oc[0] = ac->oc[1];
copy_oc(&ac->oc[0], &ac->oc[1]);
pushed = 1;
}
ac->oc[1].status = OC_NONE;
@@ -443,7 +464,8 @@ static int push_output_configuration(AACDecContext *ac)
static void pop_output_configuration(AACDecContext *ac)
{
if (ac->oc[1].status != OC_LOCKED && ac->oc[0].status != OC_NONE) {
ac->oc[1] = ac->oc[0];
copy_oc(&ac->oc[1], &ac->oc[0]);
ac->avctx->ch_layout = ac->oc[1].ch_layout;
ff_aac_output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
ac->oc[1].status, 0);
@@ -466,6 +488,9 @@ int ff_aac_output_configure(AACDecContext *ac,
uint8_t id_map[TYPE_END][MAX_ELEM_ID] = {{ 0 }};
uint8_t type_counts[TYPE_END] = { 0 };
if (get_new_frame && !ac->frame)
return AVERROR_INVALIDDATA;
if (ac->oc[1].layout_map != layout_map) {
memcpy(ac->oc[1].layout_map, layout_map, tags * sizeof(layout_map[0]));
ac->oc[1].layout_map_tags = tags;
@@ -1107,7 +1132,7 @@ static av_cold int decode_close(AVCodecContext *avctx)
AACUSACConfig *usac = &oc->usac;
for (int j = 0; j < usac->nb_elems; j++) {
AACUsacElemConfig *ec = &usac->elems[j];
av_freep(&ec->ext.pl_data);
av_refstruct_unref(&ec->ext.pl_buf);
}
av_channel_layout_uninit(&ac->oc[i].ch_layout);
+2 -2
View File
@@ -344,7 +344,7 @@ typedef struct AACUsacElemConfig {
uint8_t payload_frag;
uint32_t default_len;
uint32_t pl_data_offset;
uint8_t *pl_data;
uint8_t *pl_buf;
} ext;
} AACUsacElemConfig;
@@ -353,7 +353,7 @@ typedef struct AACUSACConfig {
uint16_t core_frame_len;
uint16_t stream_identifier;
AACUsacElemConfig elems[64];
AACUsacElemConfig elems[MAX_ELEM_ID];
int nb_elems;
struct {
+20 -12
View File
@@ -24,12 +24,13 @@
#include "aacdec_ac.h"
#include "libavcodec/aacsbr.h"
#include "libavcodec/aactab.h"
#include "libavutil/mem.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/unary.h"
#include "libavutil/mem.h"
#include "libavutil/refstruct.h"
/* Number of scalefactor bands per complex prediction band, equal to 2. */
#define SFB_PER_PRED_BAND 2
@@ -1574,7 +1575,6 @@ static int parse_audio_preroll(AACDecContext *ac, GetBitContext *gb)
static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
GetBitContext *gb)
{
uint8_t *tmp;
uint8_t pl_frag_start = 1;
uint8_t pl_frag_end = 1;
uint32_t len;
@@ -1601,18 +1601,26 @@ static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
if (pl_frag_start)
e->ext.pl_data_offset = 0;
/* If an extension starts and ends this packet, we can directly use it */
/* If an extension starts and ends this packet, we can directly use it below.
* Otherwise, we have to copy it to a buffer and accumulate it. */
if (!(pl_frag_start && pl_frag_end)) {
tmp = av_realloc(e->ext.pl_data, e->ext.pl_data_offset + len);
if (!tmp) {
av_free(e->ext.pl_data);
/* Reallocate the data */
uint8_t *tmp_buf = av_refstruct_alloc_ext(e->ext.pl_data_offset + len,
AV_REFSTRUCT_FLAG_NO_ZEROING,
NULL, NULL);
if (!tmp_buf)
return AVERROR(ENOMEM);
}
e->ext.pl_data = tmp;
/* Copy the data over only if we had saved data to begin with */
if (e->ext.pl_buf)
memcpy(tmp_buf, e->ext.pl_buf, e->ext.pl_data_offset);
av_refstruct_unref(&e->ext.pl_buf);
e->ext.pl_buf = tmp_buf;
/* Readout data to a buffer */
for (int i = 0; i < len; i++)
e->ext.pl_data[e->ext.pl_data_offset + i] = get_bits(gb, 8);
e->ext.pl_buf[e->ext.pl_data_offset + i] = get_bits(gb, 8);
}
e->ext.pl_data_offset += len;
@@ -1624,7 +1632,7 @@ static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
GetBitContext *gb2 = gb;
GetBitContext gbc;
if (!(pl_frag_start && pl_frag_end)) {
ret = init_get_bits8(&gbc, e->ext.pl_data, pl_len);
ret = init_get_bits8(&gbc, e->ext.pl_buf, pl_len);
if (ret < 0)
return ret;
@@ -1642,7 +1650,7 @@ static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
/* This should never happen */
av_assert0(0);
}
av_freep(&e->ext.pl_data);
av_refstruct_unref(&e->ext.pl_buf);
if (ret < 0)
return ret;
+53 -7
View File
@@ -35,6 +35,16 @@
#include "thread.h"
typedef struct APVDerivedTileInfo {
uint8_t tile_cols;
uint8_t tile_rows;
uint16_t num_tiles;
// The spec uses an extra element on the end of these arrays
// not corresponding to any tile.
uint16_t col_starts[APV_MAX_TILE_COLS + 1];
uint16_t row_starts[APV_MAX_TILE_ROWS + 1];
} APVDerivedTileInfo;
typedef struct APVDecodeContext {
CodedBitstreamContext *cbc;
APVDSPContext dsp;
@@ -52,9 +62,9 @@ typedef struct APVDecodeContext {
static const enum AVPixelFormat apv_format_table[5][5] = {
{ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16 },
{ 0 }, // 4:2:0 is not valid.
{ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUV422P16 },
{ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUV444P16 },
{ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUVA444P16 },
{ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV422P16 },
{ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV444P16 },
{ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P12, 0 ,AV_PIX_FMT_YUVA444P16 },
};
static APVVLCLUT decode_lut;
@@ -75,6 +85,11 @@ static int apv_decode_check_format(AVCodecContext *avctx,
avctx->pix_fmt =
apv_format_table[header->frame_info.chroma_format_idc][bit_depth - 4 >> 2];
if (!avctx->pix_fmt) {
avpriv_request_sample(avctx, "YUVA444P14");
return AVERROR_PATCHWELCOME;
}
err = ff_set_dimensions(avctx,
FFALIGN(header->frame_info.frame_width, 16),
FFALIGN(header->frame_info.frame_height, 16));
@@ -179,7 +194,7 @@ static int apv_decode_tile_component(AVCodecContext *avctx, void *data,
APVRawFrame *input = data;
APVDecodeContext *apv = avctx->priv_data;
const CodedBitstreamAPVContext *apv_cbc = apv->cbc->priv_data;
const APVDerivedTileInfo *tile_info = &apv_cbc->tile_info;
const APVDerivedTileInfo *tile_info = &apv->tile_info;
int tile_index = job / apv_cbc->num_comp;
int comp_index = job % apv_cbc->num_comp;
@@ -292,12 +307,38 @@ fail:
return err;
}
static void apv_derive_tile_info(APVDerivedTileInfo *ti,
const APVRawFrameHeader *fh)
{
int frame_width_in_mbs = (fh->frame_info.frame_width + (APV_MB_WIDTH - 1)) >> 4;
int frame_height_in_mbs = (fh->frame_info.frame_height + (APV_MB_HEIGHT - 1)) >> 4;
int start_mb, i;
start_mb = 0;
for (i = 0; start_mb < frame_width_in_mbs; i++) {
ti->col_starts[i] = start_mb * APV_MB_WIDTH;
start_mb += fh->tile_info.tile_width_in_mbs;
}
ti->col_starts[i] = frame_width_in_mbs * APV_MB_WIDTH;
ti->tile_cols = i;
start_mb = 0;
for (i = 0; start_mb < frame_height_in_mbs; i++) {
ti->row_starts[i] = start_mb * APV_MB_HEIGHT;
start_mb += fh->tile_info.tile_height_in_mbs;
}
ti->row_starts[i] = frame_height_in_mbs * APV_MB_HEIGHT;
ti->tile_rows = i;
ti->num_tiles = ti->tile_cols * ti->tile_rows;
}
static int apv_decode(AVCodecContext *avctx, AVFrame *output,
APVRawFrame *input)
{
APVDecodeContext *apv = avctx->priv_data;
const CodedBitstreamAPVContext *apv_cbc = apv->cbc->priv_data;
const APVDerivedTileInfo *tile_info = &apv_cbc->tile_info;
const AVPixFmtDescriptor *desc = NULL;
APVDerivedTileInfo *tile_info = &apv->tile_info;
int err, job_count;
err = apv_decode_check_format(avctx, &input->frame_header);
@@ -306,6 +347,9 @@ static int apv_decode(AVCodecContext *avctx, AVFrame *output,
return err;
}
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
av_assert0(desc);
err = ff_thread_get_buffer(avctx, output, 0);
if (err < 0)
return err;
@@ -313,9 +357,11 @@ static int apv_decode(AVCodecContext *avctx, AVFrame *output,
apv->output_frame = output;
atomic_store_explicit(&apv->tile_errors, 0, memory_order_relaxed);
apv_derive_tile_info(tile_info, &input->frame_header);
// Each component within a tile is independent of every other,
// so we can decode all in parallel.
job_count = tile_info->num_tiles * apv_cbc->num_comp;
job_count = tile_info->num_tiles * desc->nb_components;
avctx->execute2(avctx, apv_decode_tile_component,
input, NULL, job_count);
+1 -1
View File
@@ -236,7 +236,7 @@ static int ff_eia608_to_smpte436m_filter(AVBSFContext *ctx, AVPacket *out)
if (ret < 0)
goto fail;
return 0;
ret = 0;
fail:
if (ret < 0)
+2
View File
@@ -68,6 +68,8 @@ static int ff_smpte436m_to_eia608_filter(AVBSFContext *ctx, AVPacket *out)
// verified it won't fail by running it above
av_smpte_291m_anc_8bit_extract_cta_708(&anc, out->data, ctx);
av_packet_free(&in);
return 0;
}
if (ret != AVERROR_EOF)
+6 -21
View File
@@ -37,33 +37,18 @@ static int cbs_apv_get_num_comp(const APVRawFrameHeader *fh)
}
}
static void cbs_apv_derive_tile_info(APVDerivedTileInfo *ti,
static void cbs_apv_derive_tile_info(CodedBitstreamContext *ctx,
const APVRawFrameHeader *fh)
{
CodedBitstreamAPVContext *priv = ctx->priv_data;
int frame_width_in_mbs = (fh->frame_info.frame_width + 15) / 16;
int frame_height_in_mbs = (fh->frame_info.frame_height + 15) / 16;
int start_mb, i;
int tile_cols = (frame_width_in_mbs + fh->tile_info.tile_width_in_mbs - 1) / fh->tile_info.tile_width_in_mbs;
int tile_rows = (frame_height_in_mbs + fh->tile_info.tile_height_in_mbs - 1) / fh->tile_info.tile_height_in_mbs;
start_mb = 0;
for (i = 0; start_mb < frame_width_in_mbs; i++) {
ti->col_starts[i] = start_mb * APV_MB_WIDTH;
start_mb += fh->tile_info.tile_width_in_mbs;
}
av_assert0(i <= APV_MAX_TILE_COLS);
ti->col_starts[i] = frame_width_in_mbs * APV_MB_WIDTH;
ti->tile_cols = i;
av_assert0(tile_cols <= APV_MAX_TILE_COLS && tile_rows <= APV_MAX_TILE_ROWS);
start_mb = 0;
for (i = 0; start_mb < frame_height_in_mbs; i++) {
av_assert0(i < APV_MAX_TILE_ROWS);
ti->row_starts[i] = start_mb * APV_MB_HEIGHT;
start_mb += fh->tile_info.tile_height_in_mbs;
}
av_assert0(i <= APV_MAX_TILE_ROWS);
ti->row_starts[i] = frame_height_in_mbs * APV_MB_HEIGHT;
ti->tile_rows = i;
ti->num_tiles = ti->tile_cols * ti->tile_rows;
priv->num_tiles = tile_cols * tile_rows;
}
+1 -11
View File
@@ -187,21 +187,11 @@ typedef struct APVRawMetadata {
} APVRawMetadata;
typedef struct APVDerivedTileInfo {
uint8_t tile_cols;
uint8_t tile_rows;
uint16_t num_tiles;
// The spec uses an extra element on the end of these arrays
// not corresponding to any tile.
uint16_t col_starts[APV_MAX_TILE_COLS + 1];
uint16_t row_starts[APV_MAX_TILE_ROWS + 1];
} APVDerivedTileInfo;
typedef struct CodedBitstreamAPVContext {
int bit_depth;
int num_comp;
APVDerivedTileInfo tile_info;
uint16_t num_tiles;
} CodedBitstreamAPVContext;
#endif /* AVCODEC_CBS_APV_H */
+3 -3
View File
@@ -128,10 +128,10 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx, RWContext *rw,
ub(1, tile_size_present_in_fh_flag);
cbs_apv_derive_tile_info(&priv->tile_info, fh);
cbs_apv_derive_tile_info(ctx, fh);
if (current->tile_size_present_in_fh_flag) {
for (int t = 0; t < priv->tile_info.num_tiles; t++) {
for (int t = 0; t < priv->num_tiles; t++) {
us(32, tile_size_in_fh[t], 10, MAX_UINT_BITS(32), 1, t);
}
}
@@ -262,7 +262,7 @@ static int FUNC(frame)(CodedBitstreamContext *ctx, RWContext *rw,
CHECK(FUNC(frame_header)(ctx, rw, &current->frame_header));
for (int t = 0; t < priv->tile_info.num_tiles; t++) {
for (int t = 0; t < priv->num_tiles; t++) {
us(32, tile_size[t], 10, MAX_UINT_BITS(32), 1, t);
CHECK(FUNC(tile)(ctx, rw, &current->tile[t],
+58 -29
View File
@@ -152,7 +152,6 @@ static int FUNC(interpolation_filter)(CodedBitstreamContext *ctx, RWContext *rw,
static int FUNC(loop_filter_params)(CodedBitstreamContext *ctx, RWContext *rw,
VP9RawFrameHeader *current)
{
CodedBitstreamVP9Context *vp9 = ctx->priv_data;
int err, i;
f(6, loop_filter_level);
@@ -160,8 +159,6 @@ static int FUNC(loop_filter_params)(CodedBitstreamContext *ctx, RWContext *rw,
f(1, loop_filter_delta_enabled);
if (current->loop_filter_delta_enabled) {
memcpy(current->loop_filter_ref_deltas, vp9->loop_filter_ref_deltas, sizeof(vp9->loop_filter_ref_deltas));
memcpy(current->loop_filter_mode_deltas, vp9->loop_filter_mode_deltas, sizeof(vp9->loop_filter_mode_deltas));
f(1, loop_filter_delta_update);
if (current->loop_filter_delta_update) {
for (i = 0; i < VP9_MAX_REF_FRAMES; i++) {
@@ -174,9 +171,9 @@ static int FUNC(loop_filter_params)(CodedBitstreamContext *ctx, RWContext *rw,
if (current->update_mode_delta[i])
ss(6, loop_filter_mode_deltas[i], 1, i);
}
memcpy(vp9->loop_filter_ref_deltas, current->loop_filter_ref_deltas, sizeof(vp9->loop_filter_ref_deltas));
memcpy(vp9->loop_filter_mode_deltas, current->loop_filter_mode_deltas, sizeof(vp9->loop_filter_mode_deltas));
}
} else {
infer(loop_filter_delta_update, 0);
}
return 0;
@@ -201,18 +198,11 @@ static int FUNC(segmentation_params)(CodedBitstreamContext *ctx, RWContext *rw,
{
static const uint8_t segmentation_feature_bits[VP9_SEG_LVL_MAX] = { 8, 6, 2, 0 };
static const uint8_t segmentation_feature_signed[VP9_SEG_LVL_MAX] = { 1, 1, 0, 0 };
CodedBitstreamVP9Context *vp9 = ctx->priv_data;
int err, i, j;
f(1, segmentation_enabled);
if (current->segmentation_enabled) {
memcpy(current->segmentation_tree_probs, vp9->segmentation_tree_probs, sizeof(vp9->segmentation_tree_probs));
memcpy(current->segmentation_pred_prob, vp9->segmentation_pred_prob, sizeof(vp9->segmentation_pred_prob));
memcpy(current->feature_enabled, vp9->feature_enabled, sizeof(vp9->feature_enabled));
memcpy(current->feature_value, vp9->feature_value, sizeof(vp9->feature_value));
memcpy(current->feature_sign, vp9->feature_sign, sizeof(vp9->feature_sign));
f(1, segmentation_update_map);
if (current->segmentation_update_map) {
for (i = 0; i < 7; i++)
@@ -224,8 +214,6 @@ static int FUNC(segmentation_params)(CodedBitstreamContext *ctx, RWContext *rw,
else
infer(segmentation_pred_prob[i], 255);
}
memcpy(vp9->segmentation_tree_probs, current->segmentation_tree_probs, sizeof(vp9->segmentation_tree_probs));
memcpy(vp9->segmentation_pred_prob, current->segmentation_pred_prob, sizeof(vp9->segmentation_pred_prob));
}
f(1, segmentation_update_data);
@@ -248,10 +236,9 @@ static int FUNC(segmentation_params)(CodedBitstreamContext *ctx, RWContext *rw,
}
}
}
memcpy(vp9->feature_enabled, current->feature_enabled, sizeof(vp9->feature_enabled));
memcpy(vp9->feature_value, current->feature_value, sizeof(vp9->feature_value));
memcpy(vp9->feature_sign, current->feature_sign, sizeof(vp9->feature_sign));
}
} else {
infer(segmentation_update_data, 0);
}
return 0;
@@ -368,18 +355,6 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
f(2, frame_context_idx);
if (current->frame_type == VP9_KEY_FRAME || current->error_resilient_mode || current->intra_only) {
infer(update_ref_delta[0], 1);
infer(update_ref_delta[1], 0);
infer(update_ref_delta[2], -1);
infer(update_ref_delta[3], -1);
infer(loop_filter_mode_deltas[0], 0);
infer(loop_filter_mode_deltas[1], 0);
memset(vp9->feature_enabled, 0, sizeof(current->feature_enabled));
memset(vp9->feature_value, 0, sizeof(current->feature_value));
memset(vp9->feature_sign, 0, sizeof(current->feature_sign));
}
CHECK(FUNC(loop_filter_params)(ctx, rw, current));
CHECK(FUNC(quantization_params)(ctx, rw, current));
CHECK(FUNC(segmentation_params)(ctx, rw, current));
@@ -399,6 +374,60 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
}
}
// Update top-level loop filter and segmentation state with changes
// from this frame.
if (current->frame_type == VP9_KEY_FRAME ||
current->intra_only ||
current->error_resilient_mode) {
// setup_past_independence() - fill with the initial values.
vp9->loop_filter_ref_deltas[VP9_INTRA_FRAME] = 1;
vp9->loop_filter_ref_deltas[VP9_LAST_FRAME] = 0;
vp9->loop_filter_ref_deltas[VP9_GOLDEN_FRAME] = -1;
vp9->loop_filter_ref_deltas[VP9_ALTREF_FRAME] = -1;
vp9->loop_filter_mode_deltas[0] = 0;
vp9->loop_filter_mode_deltas[1] = 0;
memset(vp9->feature_enabled, 0, sizeof(vp9->feature_enabled));
memset(vp9->feature_value, 0, sizeof(vp9->feature_value));
memset(vp9->feature_sign, 0, sizeof(vp9->feature_sign));
} else {
// Modify previous state based on updates in this frame.
if (current->loop_filter_delta_update) {
for (i = 0; i < 4; i++) {
if (current->update_ref_delta[i])
vp9->loop_filter_ref_deltas[i] =
current->loop_filter_ref_deltas[i];
}
for (i = 0; i < 2; i++) {
if (current->update_mode_delta[i])
vp9->loop_filter_mode_deltas[i] =
current->loop_filter_mode_deltas[i];
}
}
if (current->segmentation_update_data) {
memcpy(vp9->feature_enabled, current->feature_enabled,
sizeof(vp9->feature_enabled));
memcpy(vp9->feature_value, current->feature_value,
sizeof(vp9->feature_value));
memcpy(vp9->feature_sign, current->feature_sign,
sizeof(vp9->feature_sign));
if (current->segmentation_update_map) {
memcpy(vp9->segmentation_tree_probs,
current->segmentation_tree_probs,
sizeof(vp9->segmentation_tree_probs));
memcpy(vp9->segmentation_pred_prob,
current->segmentation_pred_prob,
sizeof(vp9->segmentation_pred_prob));
}
}
}
av_log(ctx->log_ctx, AV_LOG_DEBUG, "Frame: size %dx%d "
"subsample %dx%d bit_depth %d tiles %dx%d.\n",
vp9->frame_width, vp9->frame_height,
+6 -7
View File
@@ -973,8 +973,7 @@ rc_mode_found:
case RC_MODE_CQP:
// cqp ConfigParams will be updated in ctx->codec->configure.
break;
case RC_MODE_CBR:
case RC_MODE_CBR: {
D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR *cbr_ctl;
ctx->rc.ConfigParams.DataSize = sizeof(D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR);
@@ -995,8 +994,8 @@ rc_mode_found:
ctx->rc.ConfigParams.pConfiguration_CBR = cbr_ctl;
break;
case RC_MODE_VBR:
}
case RC_MODE_VBR: {
D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR *vbr_ctl;
ctx->rc.ConfigParams.DataSize = sizeof(D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR);
@@ -1018,8 +1017,8 @@ rc_mode_found:
ctx->rc.ConfigParams.pConfiguration_VBR = vbr_ctl;
break;
case RC_MODE_QVBR:
}
case RC_MODE_QVBR: {
D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR *qvbr_ctl;
ctx->rc.ConfigParams.DataSize = sizeof(D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR);
@@ -1039,7 +1038,7 @@ rc_mode_found:
ctx->rc.ConfigParams.pConfiguration_QVBR = qvbr_ctl;
break;
}
default:
break;
}
+36 -12
View File
@@ -38,12 +38,15 @@ typedef struct DXVContext {
GetByteContext gbc;
uint8_t *tex_data; // Compressed texture
unsigned tex_data_size;
uint8_t *ctex_data; // Compressed chroma texture
unsigned ctex_data_size;
int64_t tex_size; // Texture size
size_t tex_size; // Texture size
int64_t ctex_size; // Chroma texture size
uint8_t *op_data[4]; // Opcodes
unsigned op_data_size[4];
int64_t op_size[4]; // Opcodes size
} DXVContext;
@@ -274,7 +277,9 @@ static int dxv_decompress_opcodes(GetByteContext *gb, void *dstp, size_t op_size
if ((flag & 3) == 0) {
bytestream2_skip(gb, 1);
bytestream2_get_buffer(gb, dstp, op_size);
int read_size = bytestream2_get_buffer(gb, dstp, op_size);
if (read_size != op_size)
return AVERROR_INVALIDDATA;
} else if ((flag & 3) == 1) {
bytestream2_skip(gb, 1);
memset(dstp, bytestream2_get_byte(gb), op_size);
@@ -823,7 +828,7 @@ static int dxv_decompress_dxt5(AVCodecContext *avctx)
static int dxv_decompress_lzf(AVCodecContext *avctx)
{
DXVContext *ctx = avctx->priv_data;
return ff_lzf_uncompress(&ctx->gbc, &ctx->tex_data, &ctx->tex_size);
return ff_lzf_uncompress(&ctx->gbc, &ctx->tex_data, &ctx->tex_size, &ctx->tex_data_size);
}
static int dxv_decompress_raw(AVCodecContext *avctx)
@@ -935,6 +940,8 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame,
}
break;
}
if (avctx->coded_height / 2 / TEXTURE_BLOCK_H < 1)
return AVERROR_INVALIDDATA;
texdsp_ctx.slice_count = av_clip(avctx->thread_count, 1,
avctx->coded_height / TEXTURE_BLOCK_H);
@@ -969,9 +976,14 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame,
ctx->tex_size = avctx->coded_width / (texdsp_ctx.raw_ratio / (avctx->pix_fmt == AV_PIX_FMT_RGBA ? 4 : 1)) *
avctx->coded_height / TEXTURE_BLOCK_H *
texdsp_ctx.tex_ratio;
ret = av_reallocp(&ctx->tex_data, ctx->tex_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret < 0)
return ret;
unsigned old_size = ctx->tex_data_size;
void *ptr = av_fast_realloc(ctx->tex_data, &ctx->tex_data_size, ctx->tex_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!ptr)
return AVERROR(ENOMEM);
ctx->tex_data = ptr;
if (ctx->tex_data_size > old_size)
memset(ctx->tex_data + old_size, 0, ctx->tex_data_size - old_size);
if (avctx->pix_fmt != AV_PIX_FMT_RGBA) {
int i;
@@ -985,13 +997,20 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame,
ctx->op_size[2] = avctx->coded_width * avctx->coded_height / 32;
ctx->op_size[3] = avctx->coded_width * avctx->coded_height / 16;
ret = av_reallocp(&ctx->ctex_data, ctx->ctex_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret < 0)
return ret;
old_size = ctx->ctex_data_size;
ptr = av_fast_realloc(ctx->ctex_data, &ctx->ctex_data_size, ctx->ctex_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!ptr)
return AVERROR(ENOMEM);
ctx->ctex_data = ptr;
if (old_size < ctx->ctex_data_size)
memset(ctx->ctex_data + old_size, 0, ctx->ctex_data_size - old_size);
for (i = 0; i < 4; i++) {
ret = av_reallocp(&ctx->op_data[i], ctx->op_size[i]);
if (ret < 0)
return ret;
old_size = ctx->op_data_size[i];
ptr = av_fast_realloc(ctx->op_data[i], &ctx->op_data_size[i], ctx->op_size[i]);
if (!ptr)
return AVERROR(ENOMEM);
ctx->op_data[i] = ptr;
}
}
@@ -1078,11 +1097,16 @@ static av_cold int dxv_close(AVCodecContext *avctx)
DXVContext *ctx = avctx->priv_data;
av_freep(&ctx->tex_data);
ctx->tex_data_size = 0;
av_freep(&ctx->ctex_data);
ctx->ctex_data_size = 0;
av_freep(&ctx->op_data[0]);
av_freep(&ctx->op_data[1]);
av_freep(&ctx->op_data[2]);
av_freep(&ctx->op_data[3]);
memset(ctx->op_data_size, 0, sizeof(ctx->op_data_size));
return 0;
}
+11
View File
@@ -2086,6 +2086,17 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
if ((ret = decode_header(s, picture)) < 0)
return ret;
if (s->compression == EXR_DWAA ||
s->compression == EXR_DWAB) {
for (int i = 0; i<s->nb_channels; i++) {
EXRChannel *channel = &s->channels[i];
if (channel->pixel_type != s->pixel_type) {
avpriv_request_sample(s->avctx, "mixed pixel type DWA");
return AVERROR_PATCHWELCOME;
}
}
}
switch (s->pixel_type) {
case EXR_HALF:
if (s->channel_offsets[3] >= 0) {
+2
View File
@@ -455,6 +455,8 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
g726_reset(c);
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
if (!avctx->sample_rate)
avctx->sample_rate = 8000;
return 0;
}
+2
View File
@@ -675,6 +675,7 @@ static void get_codebook(int16_t * cbvec, /* (o) Constructed codebook vector *
/* get vector */
memcpy(cbvec, mem + lMem - k, cbveclen * 2);
} else if (index < base_size) {
memset(cbvec, 0, cbveclen * 2);
/* Calculate lag */
@@ -701,6 +702,7 @@ static void get_codebook(int16_t * cbvec, /* (o) Constructed codebook vector *
filter_mafq12(&mem[memIndTest + 4], cbvec, kCbFiltersRev, CB_FILTERLEN, cbveclen);
} else {
memset(cbvec, 0, cbveclen * 2);
/* interpolated vectors */
/* Stuff zeros outside memory buffer */
memIndTest = lMem - cbveclen - CB_FILTERLEN;
+6
View File
@@ -114,6 +114,12 @@ static av_cold int oggvorbis_decode_init(AVCodecContext *avccontext)
}
}
if (context->vi.rate <= 0 || context->vi.rate > INT_MAX) {
av_log(avccontext, AV_LOG_ERROR, "vorbis rate is invalid\n");
ret = AVERROR_INVALIDDATA;
goto error;
}
av_channel_layout_uninit(&avccontext->ch_layout);
avccontext->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
avccontext->ch_layout.nb_channels = context->vi.channels;
+18 -5
View File
@@ -37,7 +37,22 @@
#define LZF_LITERAL_MAX (1 << 5)
#define LZF_LONG_BACKREF 7 + 2
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
static inline int lzf_realloc(uint8_t **buf, size_t *size, int addition, unsigned *allocated_size)
{
void *ptr = av_fast_realloc(*buf, allocated_size, *size + addition);
if (!ptr) {
av_freep(buf); //probably not needed
return AVERROR(ENOMEM);
}
*buf = ptr;
*size += addition;
return 0;
}
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, size_t *size, unsigned *allocated_size)
{
int ret = 0;
uint8_t *p = *buf;
@@ -49,8 +64,7 @@ int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
if (s < LZF_LITERAL_MAX) {
s++;
if (s > *size - len) {
*size += s + *size /2;
ret = av_reallocp(buf, *size);
ret = lzf_realloc(buf, size, s, allocated_size);
if (ret < 0)
return ret;
p = *buf + len;
@@ -75,8 +89,7 @@ int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
return AVERROR_INVALIDDATA;
if (l > *size - len) {
*size += l + *size / 2;
ret = av_reallocp(buf, *size);
ret = lzf_realloc(buf, size, l, allocated_size);
if (ret < 0)
return ret;
p = *buf + len;
+1 -1
View File
@@ -24,6 +24,6 @@
#include "bytestream.h"
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size);
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, size_t *size, unsigned *allocated_size);
#endif /* AVCODEC_LZF_H */
+3 -2
View File
@@ -40,7 +40,8 @@ typedef struct NotchLCContext {
unsigned uncompressed_size;
uint8_t *lzf_buffer;
int64_t lzf_size;
size_t lzf_size;
unsigned lzf_alloc_size;
unsigned texture_size_x;
unsigned texture_size_y;
@@ -490,7 +491,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
return AVERROR_PATCHWELCOME;
if (s->format == 0) {
ret = ff_lzf_uncompress(gb, &s->lzf_buffer, &s->lzf_size);
ret = ff_lzf_uncompress(gb, &s->lzf_buffer, &s->lzf_size, &s->lzf_alloc_size);
if (ret < 0)
return ret;
+3 -3
View File
@@ -367,9 +367,6 @@ static int decode_frame(AVCodecContext *avctx,
if ((w & 1) || (h & 1))
return AVERROR_INVALIDDATA;
avctx->coded_width = FFALIGN(w, 16);
avctx->coded_height = FFALIGN(h, 16);
if (w != avctx->width || h != avctx->height) {
av_log(avctx, AV_LOG_WARNING, "picture resolution change: %ix%i -> %ix%i\n",
avctx->width, avctx->height, w, h);
@@ -377,6 +374,9 @@ static int decode_frame(AVCodecContext *avctx,
return ret;
}
avctx->coded_width = FFALIGN(w, 16);
avctx->coded_height = FFALIGN(h, 16);
enum AVPixelFormat pix_fmt = AV_PIX_FMT_BAYER_RGGB16;
if (pix_fmt != s->pix_fmt) {
s->pix_fmt = pix_fmt;
+2
View File
@@ -308,6 +308,8 @@ static int update_dimensions_clear_info(RV60Context *s, int width, int height)
if ((ret = av_reallocp_array(&s->blk_info, s->blk_stride * (s->cu_height << 4), sizeof(s->blk_info[0]))) < 0)
return ret;
memset(s->pu_info, 0, s->pu_stride * (s->cu_height << 3) * sizeof(s->pu_info[0]));
for (int j = 0; j < s->cu_height << 4; j++)
for (int i = 0; i < s->cu_width << 4; i++)
s->blk_info[j*s->blk_stride + i].mv.mvref = MVREF_NONE;
+64 -38
View File
@@ -277,6 +277,7 @@ typedef struct SANMVideoContext {
uint16_t *fbuf, *frm0, *frm1, *frm2;
uint8_t *stored_frame;
uint32_t fbuf_size, frm0_size, frm1_size, frm2_size;
uint32_t stor_size;
uint32_t stored_frame_size;
uint8_t *rle_buf;
@@ -471,9 +472,11 @@ static av_cold int init_buffers(SANMVideoContext *ctx)
av_fast_padded_mallocz(&ctx->frm0, &ctx->frm0_size, ctx->buf_size);
av_fast_padded_mallocz(&ctx->frm1, &ctx->frm1_size, ctx->buf_size);
av_fast_padded_mallocz(&ctx->frm2, &ctx->frm2_size, ctx->buf_size);
if (!ctx->version)
if (!ctx->version) {
av_fast_padded_mallocz(&ctx->stored_frame,
&ctx->stored_frame_size, ctx->buf_size);
ctx->stor_size = 0;
}
if (!ctx->frm0 || !ctx->frm1 || !ctx->frm2 ||
(!ctx->stored_frame && !ctx->version)) {
@@ -1427,8 +1430,18 @@ static void c48_4to8(uint8_t *dst, const uint8_t *src, const uint16_t w)
}
}
static int codec48_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *db,
const uint16_t w)
static int check_mv(int x, int y, const uint16_t w, int h, int blocksize, int mvofs) {
if (mvofs < -x + -y*w)
return AVERROR_INVALIDDATA;
if (mvofs > w-x-blocksize + w*(h-y-blocksize))
return AVERROR_INVALIDDATA;
return 0;
}
static int codec48_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *db, int x, int y,
const uint16_t w, int h)
{
uint8_t opc, sb[16];
int i, j, k, l;
@@ -1453,6 +1466,8 @@ static int codec48_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *db,
if (bytestream2_get_bytes_left(&ctx->gb) < 2)
return 1;
mvofs = bytestream2_get_le16(&ctx->gb);
if (check_mv(x, y, w, h, 8, mvofs))
return 1;
for (i = 0; i < 8; i++) {
ofs = w * i;
for (k = 0; k < 8; k++)
@@ -1480,6 +1495,8 @@ static int codec48_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *db,
for (k = 0; k < 8; k += 4) {
opc = bytestream2_get_byteu(&ctx->gb);
mvofs = c37_mv[opc * 2] + (c37_mv[opc * 2 + 1] * w);
if (check_mv(x+k, y+i, w, h, 4, mvofs))
return 1;
for (j = 0; j < 4; j++) {
ofs = (w * (j + i)) + k;
for (l = 0; l < 4; l++)
@@ -1494,6 +1511,8 @@ static int codec48_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *db,
for (i = 0; i < 8; i += 4) {
for (k = 0; k < 8; k += 4) {
mvofs = bytestream2_get_le16(&ctx->gb);
if (check_mv(x+k, y+i, w, h, 4, mvofs))
return 1;
for (j = 0; j < 4; j++) {
ofs = (w * (j + i)) + k;
for (l = 0; l < 4; l++)
@@ -1516,6 +1535,8 @@ static int codec48_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *db,
ofs = (w * i) + j;
opc = bytestream2_get_byteu(&ctx->gb);
mvofs = c37_mv[opc * 2] + (c37_mv[opc * 2 + 1] * w);
if (check_mv(x+j, y+i, w, h, 2, mvofs))
return 1;
for (l = 0; l < 2; l++) {
*(dst + ofs + l + 0) = *(db + ofs + l + 0 + mvofs);
*(dst + ofs + l + w) = *(db + ofs + l + w + mvofs);
@@ -1530,6 +1551,8 @@ static int codec48_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *db,
for (j = 0; j < 8; j += 2) {
ofs = w * i + j;
mvofs = bytestream2_get_le16(&ctx->gb);
if (check_mv(x+j, y+i, w, h, 2, mvofs))
return 1;
for (l = 0; l < 2; l++) {
*(dst + ofs + l + 0) = *(db + ofs + l + 0 + mvofs);
*(dst + ofs + l + w) = *(db + ofs + l + w + mvofs);
@@ -1548,6 +1571,8 @@ static int codec48_block(SANMVideoContext *ctx, uint8_t *dst, uint8_t *db,
break;
default: // copy 8x8 block from prev, c37_mv from source
mvofs = c37_mv[opc * 2] + (c37_mv[opc * 2 + 1] * w);
if (check_mv(x, y, w, h, 8, mvofs))
return 1;
for (i = 0; i < 8; i++) {
ofs = i * w;
for (l = 0; l < 8; l++)
@@ -1613,7 +1638,7 @@ static int old_codec48(SANMVideoContext *ctx, int width, int height)
if (seq == ctx->prev_seq + 1) {
for (j = 0; j < height; j += 8) {
for (i = 0; i < width; i += 8) {
if (codec48_block(ctx, dst + i, prev + i, width))
if (codec48_block(ctx, dst + i, prev + i, i, j, width, height))
return AVERROR_INVALIDDATA;
}
dst += width * 8;
@@ -1638,7 +1663,8 @@ static int old_codec48(SANMVideoContext *ctx, int width, int height)
return 0;
}
static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb,
int xoff, int yoff)
{
uint16_t w, h, parm2;
uint8_t codec, param;
@@ -1647,14 +1673,14 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
codec = bytestream2_get_byteu(gb);
param = bytestream2_get_byteu(gb);
left = bytestream2_get_le16u(gb);
top = bytestream2_get_le16u(gb);
left = bytestream2_get_le16u(gb) + xoff;
top = bytestream2_get_le16u(gb) + yoff;
w = bytestream2_get_le16u(gb);
h = bytestream2_get_le16u(gb);
bytestream2_skip(gb, 2);
parm2 = bytestream2_get_le16u(gb);
if (w < 1 || h < 1 || w > 800 || h > 600 || left > 800 || top > 600 || left + w <= 0 || top + h <= 0) {
if (w < 1 || h < 1 || w > 640 || h > 480 || left > 640 || top > 480 || left + w <= 0 || top + h <= 0) {
av_log(ctx->avctx, AV_LOG_WARNING,
"ignoring invalid fobj dimensions: c%d %d %d @ %d %d\n",
codec, w, h, left, top);
@@ -1678,7 +1704,7 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
if (w > xres || h > yres)
return AVERROR_INVALIDDATA;
ctx->have_dimensions = 1;
} else if (codec == 37 || codec == 47 || codec == 48) {
} else if (fsc) {
/* these codecs work on full frames, trust their dimensions */
xres = w;
yres = h;
@@ -1694,7 +1720,7 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
xres = w;
yres = h;
ctx->have_dimensions = 1;
} else if (((xres == 424) && (yres == 260)) || /* RA1 */
} else if (((xres == 424) && (yres == 260)) || /* RA2 */
((xres == 320) && (yres == 200)) || /* ft/dig/... */
((xres == 640) && (yres == 480))) { /* ol/comi/mots... */
ctx->have_dimensions = 1;
@@ -1728,6 +1754,10 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
}
}
/* users of codecs>=37 are subversion 2, enforce that for STOR/FTCH */
if (fsc)
ctx->subversion = 2;
/* clear the main buffer on the first fob */
if (ctx->first_fob) {
ctx->first_fob = 0;
@@ -1735,6 +1765,11 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
memset(ctx->fbuf, 0, ctx->frm0_size);
}
if (w + FFMAX(left, 0) > ctx->avctx->width || h + FFMAX(top, 0) > ctx->avctx->height) {
avpriv_request_sample(ctx->avctx, "overly large frame\n");
return AVERROR_PATCHWELCOME;
}
switch (codec) {
case 1:
case 3:
@@ -1792,41 +1827,31 @@ static int process_frame_obj(SANMVideoContext *ctx, GetByteContext *gb)
static int process_ftch(SANMVideoContext *ctx, int size)
{
uint8_t *sf = ctx->stored_frame;
int xoff, yoff, left, top, ret;
int xoff, yoff, ret;
GetByteContext gb;
uint32_t sz;
/* FTCH defines additional x/y offsets */
if (size != 12) {
if (bytestream2_get_bytes_left(&ctx->gb) < 6)
return AVERROR_INVALIDDATA;
if (size == 6) {
bytestream2_skip(&ctx->gb, 2);
xoff = bytestream2_get_le16u(&ctx->gb);
yoff = bytestream2_get_le16u(&ctx->gb);
} else {
if (bytestream2_get_bytes_left(&ctx->gb) < 12)
return AVERROR_INVALIDDATA;
} else if (size == 12) {
av_assert0(bytestream2_get_bytes_left(&ctx->gb) >= 12);
bytestream2_skip(&ctx->gb, 4);
xoff = bytestream2_get_be32u(&ctx->gb);
yoff = bytestream2_get_be32u(&ctx->gb);
}
sz = *(uint32_t *)(sf + 0);
if ((sz > 0) && (sz <= ctx->stored_frame_size - 4)) {
/* add the FTCH offsets to the left/top values of the stored FOBJ */
left = av_le2ne16(*(int16_t *)(sf + 4 + 2));
top = av_le2ne16(*(int16_t *)(sf + 4 + 4));
*(int16_t *)(sf + 4 + 2) = av_le2ne16(left + xoff);
*(int16_t *)(sf + 4 + 4) = av_le2ne16(top + yoff);
} else
return 1;
if (ctx->stor_size > 0) {
/* decode the stored FOBJ */
bytestream2_init(&gb, sf + 4, sz);
ret = process_frame_obj(ctx, &gb);
/* now restore the original left/top values again */
*(int16_t *)(sf + 4 + 2) = av_le2ne16(left);
*(int16_t *)(sf + 4 + 4) = av_le2ne16(top);
uint8_t *bitstream = av_malloc(ctx->stor_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!bitstream)
return AVERROR(ENOMEM);
memcpy(bitstream, ctx->stored_frame, ctx->stor_size);
bytestream2_init(&gb, bitstream, ctx->stor_size);
ret = process_frame_obj(ctx, &gb, xoff, yoff);
av_free(bitstream);
} else {
/* this happens a lot in RA1: The individual files are meant to
* be played in sequence, with some referencing objects STORed
@@ -2319,8 +2344,9 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
case MKBETAG('F', 'O', 'B', 'J'):
if (size < 16)
return AVERROR_INVALIDDATA;
if (ret = process_frame_obj(ctx, &ctx->gb))
if (ret = process_frame_obj(ctx, &ctx->gb, 0, 0)) {
return ret;
}
have_img = 1;
/* STOR: for ANIMv0/1 store the whole FOBJ datablock, as it
@@ -2331,12 +2357,12 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
if (to_store) {
to_store = 0;
if (ctx->subversion < 2) {
if (size + 4 <= ctx->stored_frame_size) {
if (size <= ctx->stored_frame_size) {
int pos2 = bytestream2_tell(&ctx->gb);
bytestream2_seek(&ctx->gb, pos, SEEK_SET);
*(uint32_t *)(ctx->stored_frame) = size;
bytestream2_get_bufferu(&ctx->gb, ctx->stored_frame + 4, size);
bytestream2_get_bufferu(&ctx->gb, ctx->stored_frame, size);
bytestream2_seek(&ctx->gb, pos2, SEEK_SET);
ctx->stor_size = size;
} else {
av_log(avctx, AV_LOG_ERROR, "FOBJ too large for STOR\n");
ret = AVERROR(ENOMEM);
+1 -1
View File
@@ -1167,7 +1167,7 @@ static int decompress_p3(AVCodecContext *avctx,
}
} else {
int run, bx = x * 16 + sx1, by = y * 16 + sy1;
uint32_t clr, ptype = 0, r, g, b;
uint32_t clr = 0, ptype = 0, r, g, b;
if (bx >= avctx->width)
return AVERROR_INVALIDDATA;
+1 -1
View File
@@ -585,7 +585,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
int buf_size = avpkt->size;
UtvideoContext *c = avctx->priv_data;
int i, j;
const uint8_t *plane_start[5];
const uint8_t *plane_start[5] = {NULL};
int plane_size, max_slice_size = 0, slice_start, slice_end, slice_size;
int ret;
GetByteContext gb;
+2 -2
View File
@@ -1679,8 +1679,6 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
&s->s.frames[CUR_FRAME] : &s->s.ref_frames[i]);
}
ff_cbs_fragment_reset(&s->current_frag);
goto finish;
}
@@ -1805,6 +1803,8 @@ static int vp9_decode_frame(AVCodecContext *avctx, AVFrame *frame,
}
finish:
ff_cbs_fragment_reset(&s->current_frag);
ff_progress_frame_report(&s->s.frames[CUR_FRAME].tf, INT_MAX);
// ref frame setup
for (int i = 0; i < 8; i++)
+1 -4
View File
@@ -1394,10 +1394,7 @@ const FFCodec ff_av1_vulkan_encoder = {
AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.defaults = vulkan_encode_av1_defaults,
.p.pix_fmts = (const enum AVPixelFormat[]) {
AV_PIX_FMT_VULKAN,
AV_PIX_FMT_NONE,
},
CODEC_PIXFMTS(AV_PIX_FMT_VULKAN),
.hw_configs = ff_vulkan_encode_hw_configs,
.p.wrapper_name = "vulkan",
};
+15 -14
View File
@@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "vp9shared.h"
#include "vp9dec.h"
#include "vulkan_decode.h"
@@ -109,7 +109,9 @@ static int vk_vp9_start_frame(AVCodecContext *avctx,
{
int err;
int ref_count = 0;
const VP9SharedContext *s = avctx->priv_data;
const VP9Context *priv = avctx->priv_data;
const CodedBitstreamVP9Context *vp9 = priv->cbc->priv_data;
const VP9SharedContext *s = &priv->s;
uint32_t frame_id_alloc_mask = 0;
const VP9Frame *pic = &s->frames[CUR_FRAME];
@@ -182,15 +184,14 @@ static int vk_vp9_start_frame(AVCodecContext *avctx,
.update_mode_delta = 0x0,
};
for (int i = 0; i < 2; i++)
ap->loop_filter.update_mode_delta |= pic->frame_header->update_mode_delta[i];
for (int i = 0; i < STD_VIDEO_VP9_MAX_REF_FRAMES; i++) {
ap->loop_filter.loop_filter_ref_deltas[i] = pic->frame_header->loop_filter_ref_deltas[i];
ap->loop_filter.loop_filter_ref_deltas[i] = vp9->loop_filter_ref_deltas[i];
ap->loop_filter.update_ref_delta |= pic->frame_header->update_ref_delta[i];
}
for (int i = 0; i < STD_VIDEO_VP9_LOOP_FILTER_ADJUSTMENTS; i++)
ap->loop_filter.loop_filter_mode_deltas[i] = pic->frame_header->loop_filter_mode_deltas[i];
for (int i = 0; i < STD_VIDEO_VP9_LOOP_FILTER_ADJUSTMENTS; i++) {
ap->loop_filter.loop_filter_mode_deltas[i] = vp9->loop_filter_mode_deltas[i];
ap->loop_filter.update_mode_delta |= pic->frame_header->update_mode_delta[i];
}
ap->segmentation = (StdVideoVP9Segmentation) {
.flags = (StdVideoVP9SegmentationFlags) {
@@ -202,16 +203,16 @@ static int vk_vp9_start_frame(AVCodecContext *avctx,
};
for (int i = 0; i < STD_VIDEO_VP9_MAX_SEGMENTATION_TREE_PROBS; i++)
ap->segmentation.segmentation_tree_probs[i] = pic->frame_header->segmentation_tree_probs[i];
ap->segmentation.segmentation_tree_probs[i] = vp9->segmentation_tree_probs[i];
for (int i = 0; i < STD_VIDEO_VP9_MAX_SEGMENTATION_PRED_PROB; i++)
ap->segmentation.segmentation_pred_prob[i] = pic->frame_header->segmentation_pred_prob[i];
ap->segmentation.segmentation_pred_prob[i] = vp9->segmentation_pred_prob[i];
for (int i = 0; i < STD_VIDEO_VP9_MAX_SEGMENTS; i++) {
ap->segmentation.FeatureEnabled[i] = 0x0;
for (int j = 0; j < STD_VIDEO_VP9_SEG_LVL_MAX; j++) {
ap->segmentation.FeatureEnabled[i] |= pic->frame_header->feature_enabled[i][j] << j;
ap->segmentation.FeatureData[i][j] = pic->frame_header->feature_sign[i][j] ?
-pic->frame_header->feature_value[i][j] :
+pic->frame_header->feature_value[i][j];
ap->segmentation.FeatureEnabled[i] |= vp9->feature_enabled[i][j] << j;
ap->segmentation.FeatureData[i][j] = vp9->feature_sign[i][j] ?
-vp9->feature_value[i][j] :
+vp9->feature_value[i][j];
}
}
+1
View File
@@ -61,6 +61,7 @@ OBJS-$(CONFIG_MLP_DECODER) += x86/mlpdsp_init.o
OBJS-$(CONFIG_MPEG4_DECODER) += x86/mpeg4videodsp.o x86/xvididct_init.o
OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o
OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp_init.o
OBJS-$(CONFIG_PRORES_RAW_DECODER) += x86/proresdsp_init.o
OBJS-$(CONFIG_RV40_DECODER) += x86/rv40dsp_init.o
OBJS-$(CONFIG_SBC_ENCODER) += x86/sbcdsp_init.o
OBJS-$(CONFIG_SVQ1_ENCODER) += x86/svq1enc_init.o
-2
View File
@@ -833,14 +833,12 @@ static int dnn_execute_model_tf(const DNNModel *model, DNNExecBaseParams *exec_p
ret = extract_lltask_from_task(task, tf_model->lltask_queue);
if (ret != 0) {
av_freep(&task);
av_log(ctx, AV_LOG_ERROR, "unable to extract last level task from task.\n");
return ret;
}
request = ff_safe_queue_pop_front(tf_model->request_queue);
if (!request) {
av_freep(&task);
av_log(ctx, AV_LOG_ERROR, "unable to get infer request.\n");
return AVERROR(EINVAL);
}
+1 -1
View File
@@ -47,7 +47,7 @@ vec4 process_line(vec4 prev2[5], vec4 prev1[2], vec4 cur[4], vec4 next1[2], vec4
vec4 temp_diff[3];
temp_diff[0] = abs(prev2[2] - next2[2]);
temp_diff[1] = (abs(prev1[0] - fc) + abs(prev1[1] - fe)) / 2;
temp_diff[1] = (abs(next1[0] - fc) + abs(next1[1] - fe)) / 2;
temp_diff[2] = (abs(next1[0] - fc) + abs(next1[1] - fe)) / 2;
vec4 diff = max(temp_diff[0] / 2, max(temp_diff[1], temp_diff[2]));
bvec4 diff_mask = equal(diff, vec4(0));
+4 -4
View File
@@ -206,10 +206,10 @@ static int hls_open(URLContext *h, const char *uri, int flags)
goto fail;
}
av_log(h, AV_LOG_WARNING,
"Using the hls protocol is discouraged, please try using the "
"hls demuxer instead. The hls demuxer should be more complete "
"and work as well as the protocol implementation. (If not, "
"please report it.) To use the demuxer, simply use %s as url.\n",
"Using the hls protocol is deprecated and it will be remove in "
"a future release, please use the hls demuxer instead. "
"If encountering issues with it, please report them. "
"To use the demuxer, simply use %s as url.\n",
s->playlisturl);
if ((ret = parse_playlist(h, s->playlisturl)) < 0)
+4 -4
View File
@@ -78,7 +78,7 @@ static int64_t count_ts(const char *p)
static int64_t read_ts(const char *p, int64_t *start)
{
int64_t offset = 0;
uint64_t mm;
uint32_t mm;
double ss;
char prefix[3];
@@ -88,11 +88,11 @@ static int64_t read_ts(const char *p, int64_t *start)
if(p[offset] != '[') {
return 0;
}
int ret = sscanf(p, "%2[[-]%"SCNu64":%lf]", prefix, &mm, &ss);
if (ret != 3 || prefix[0] != '[') {
int ret = sscanf(p, "%2[[-]%"SCNu32":%lf]", prefix, &mm, &ss);
if (ret != 3 || prefix[0] != '[' || ss < 0 || ss > 60) {
return 0;
}
*start = (mm * 60 + ss) * AV_TIME_BASE;
*start = llrint((mm * 60 + ss) * AV_TIME_BASE);
if (prefix[1] == '-') {
*start = - *start;
}
+5 -6
View File
@@ -5456,10 +5456,6 @@ static int heif_add_stream(MOVContext *c, HEIFItem *item)
if (!sc->chunk_offsets)
goto fail;
sc->chunk_count = 1;
sc->sample_sizes = av_malloc_array(1, sizeof(*sc->sample_sizes));
if (!sc->sample_sizes)
goto fail;
sc->sample_count = 1;
sc->stts_data = av_malloc_array(1, sizeof(*sc->stts_data));
if (!sc->stts_data)
goto fail;
@@ -8957,6 +8953,7 @@ static int mov_read_infe(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return AVERROR(ENOMEM);
}
av_freep(&item->name);
av_bprint_finalize(&item_name, ret ? &item->name : NULL);
item->item_id = item_id;
item->type = item_type;
@@ -10470,11 +10467,13 @@ static int mov_parse_heif_items(AVFormatContext *s)
st->codecpar->width = item->width;
st->codecpar->height = item->height;
sc->sample_size = sc->stsz_sample_size = item->extent_length;
sc->sample_count = 1;
err = sanity_checks(s, sc, item->item_id);
if (err || !sc->sample_count)
if (err)
return AVERROR_INVALIDDATA;
sc->sample_sizes[0] = item->extent_length;
sc->chunk_offsets[0] = item->extent_offset + offset;
if (item->item_id == mov->primary_item_id)
+5 -5
View File
@@ -34,8 +34,8 @@
#include <openssl/x509v3.h>
/**
* Returns a heapallocated nullterminated string containing
* the PEMencoded public key. Caller must free.
* Returns a heap-allocated null-terminated string containing
* the PEM-encoded public key. Caller must free.
*/
static char *pkey_to_pem_string(EVP_PKEY *pkey) {
BIO *mem = NULL;
@@ -60,7 +60,7 @@ static char *pkey_to_pem_string(EVP_PKEY *pkey) {
if (!pem_str)
goto err;
// Copy data & NULterminate
// Copy data & NUL-terminate
memcpy(pem_str, bptr->data, bptr->length);
pem_str[bptr->length] = '\0';
@@ -425,7 +425,7 @@ error:
/**
* Deserialize a PEMencoded private or public key from a NUL-terminated C string.
* Deserialize a PEM-encoded private or public key from a NUL-terminated C string.
*
* @param pem_str The PEM text, e.g.
* "-----BEGIN PRIVATE KEY-----\n\n-----END PRIVATE KEY-----\n"
@@ -456,7 +456,7 @@ static EVP_PKEY *pkey_from_pem_string(const char *pem_str, int is_priv)
}
/**
* Deserialize a PEMencoded certificate from a NUL-terminated C string.
* Deserialize a PEM-encoded certificate from a NUL-terminated C string.
*
* @param pem_str The PEM text, e.g.
* "-----BEGIN CERTIFICATE-----\n\n-----END CERTIFICATE-----\n"
+6 -4
View File
@@ -1868,6 +1868,8 @@ static int vulkan_device_init(AVHWDeviceContext *ctx)
p->props.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
p->props.pNext = &p->hprops;
p->hprops.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT;
p->hprops.pNext = &p->dprops;
p->dprops.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
vk->GetPhysicalDeviceProperties2(hwctx->phys_dev, &p->props);
av_log(ctx, AV_LOG_VERBOSE, "Using device: %s\n",
@@ -2464,7 +2466,7 @@ static int prepare_frame(AVHWFramesContext *hwfc, FFVkExecPool *ectx,
VkImageMemoryBarrier2 img_bar[AV_NUM_DATA_POINTERS];
int nb_img_bar = 0;
uint32_t dst_qf = VK_QUEUE_FAMILY_IGNORED;
uint32_t dst_qf = p->nb_img_qfs > 1 ? VK_QUEUE_FAMILY_IGNORED : p->img_qfs[0];
VkImageLayout new_layout;
VkAccessFlags2 new_access;
VkPipelineStageFlagBits2 src_stage = VK_PIPELINE_STAGE_2_NONE;
@@ -2906,7 +2908,7 @@ static int vulkan_frames_init(AVHWFramesContext *hwfc)
if (p->dev_is_nvidia &&
(((fmt->nb_images == 1) && (fmt->vk_planes > 1)) ||
(av_pix_fmt_desc_get(hwfc->sw_format)->nb_components == 1)))
supported_usage &= ~VK_IMAGE_USAGE_HOST_TRANSFER_BIT;
supported_usage &= ~VK_IMAGE_USAGE_HOST_TRANSFER_BIT_EXT;
/* Image usage flags */
if (!hwctx->usage) {
@@ -3986,7 +3988,7 @@ static VkImageAspectFlags plane_index_to_aspect(int plane) {
if (plane == 2) return VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT;
if (plane == 3) return VK_IMAGE_ASPECT_MEMORY_PLANE_3_BIT_EXT;
av_assert2 (false && "Invalid plane index");
av_assert2 (0 && "Invalid plane index");
return VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT;
}
@@ -4546,7 +4548,7 @@ static int vulkan_transfer_frame(AVHWFramesContext *hwfc,
VK_ACCESS_TRANSFER_READ_BIT,
upload ? VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL :
VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL,
VK_QUEUE_FAMILY_IGNORED);
p->nb_img_qfs > 1 ? VK_QUEUE_FAMILY_IGNORED : p->img_qfs[0]);
vk->CmdPipelineBarrier2(cmd_buf, &(VkDependencyInfo) {
.sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO,
+2 -2
View File
@@ -545,8 +545,8 @@ struct SwsInternal {
int use_mmx_vfilter;
/* pre defined color-spaces gamma */
#define XYZ_GAMMA (2.6f)
#define RGB_GAMMA (2.2f)
#define XYZ_GAMMA (2.6)
#define RGB_GAMMA (2.2)
uint16_t *xyzgamma;
uint16_t *rgbgamma;
uint16_t *xyzgammainv;
+5 -2
View File
@@ -2676,10 +2676,13 @@ void ff_get_unscaled_swscale(SwsInternal *c)
isSemiPlanarYUV(srcFormat) == isSemiPlanarYUV(dstFormat) &&
isSwappedChroma(srcFormat) == isSwappedChroma(dstFormat))))
{
if (isPacked(c->opts.src_format))
if (isPacked(c->opts.src_format)) {
c->convert_unscaled = packedCopyWrapper;
else /* Planar YUV or gray */
} else { /* Planar YUV or gray */
c->convert_unscaled = planarCopyWrapper;
if (c->opts.dither != SWS_DITHER_NONE)
c->dst_slice_align = 8 << c->chrDstVSubSample;
}
}
#if ARCH_PPC
+9 -5
View File
@@ -131,20 +131,24 @@ fate-sub-rcwt: CMP = oneline
fate-sub-rcwt: REF = d86f179094a5752d68aa97d82cf887b0
FATE_SUBTITLES-$(call ALLYES, AVDEVICE LAVFI_INDEV MOVIE_FILTER MPEGTS_DEMUXER MCC_MUXER EIA608_TO_SMPTE436M_BSF) += fate-sub-mcc
fate-sub-mcc: CMD = md5 -f lavfi -i "movie=$(TARGET_SAMPLES)/sub/scte20.ts[out0+subcc]" -map 0:s -c copy -override_time_code_rate ntsc -creation_time "1970-01-01T00:00:00" -bitexact -f mcc
fate-sub-mcc: CMD = md5 -f lavfi -i "movie=$(TARGET_SAMPLES)/sub/scte20.ts[out0+subcc]" -map 0:s -c copy -override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00" -bitexact -f mcc
fate-sub-mcc: CMP = oneline
fate-sub-mcc: REF = 752c60c3a74445a2a76e1a6465064763
fate-sub-mcc: REF = 779ca7759324441febd6aa6039f29308
FATE_SUBTITLES-$(call DEMMUX, MCC, MCC, SMPTE436M_TO_EIA608_BSF EIA608_TO_SMPTE436M_BSF) += fate-sub-mcc-remux-eia608-bsf
fate-sub-mcc-remux-eia608-bsf: CMD = fmtstdout mcc -f mcc -i tests/ref/fate/sub-mcc-remux -map 0:s -c copy -bsf "eia608_to_smpte436m=cdp_frame_rate=60000/1001:initial_cdp_sequence_cntr=65535:line_number=11" -override_time_code_rate ntsc -creation_time "1970-01-01T00:00:00"
fate-sub-mcc-remux-eia608-bsf: CMD = fmtstdout mcc -f mcc -i $(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:s -c copy -bsf "eia608_to_smpte436m=cdp_frame_rate=60000/1001:initial_cdp_sequence_cntr=65535:line_number=11" -override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00"
fate-sub-mcc-remux-eia608-bsf: CMP = rawdiff
FATE_SUBTITLES-$(call DEMMUX, MCC, MCC, SMPTE436M_TO_EIA608_BSF EIA608_TO_SMPTE436M_BSF) += fate-sub-mcc-remux-eia608
fate-sub-mcc-remux-eia608: CMD = fmtstdout mcc -f mcc -i tests/ref/fate/sub-mcc-remux -map 0:s -c copy -override_time_code_rate ntsc -creation_time "1970-01-01T00:00:00"
fate-sub-mcc-remux-eia608: CMD = fmtstdout mcc -f mcc -i $(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:s -c copy -override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00"
fate-sub-mcc-remux-eia608: CMP = rawdiff
FATE_SUBTITLES-$(call DEMMUX, MCC, MCC, SMPTE436M_TO_EIA608_BSF EIA608_TO_SMPTE436M_BSF) += fate-sub-mcc-remux-eia608-recode
fate-sub-mcc-remux-eia608-recode: CMD = fmtstdout mcc -eia608_extract 0 -f mcc -i $(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:d -c copy -bsf smpte436m_to_eia608 -override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00"
fate-sub-mcc-remux-eia608-recode: CMP = rawdiff
FATE_SUBTITLES-$(call DEMMUX, MCC, MCC) += fate-sub-mcc-remux
fate-sub-mcc-remux: CMD = fmtstdout mcc -eia608_extract 0 -f mcc -i tests/ref/fate/sub-mcc-remux -map 0:d -c copy -override_time_code_rate ntsc -creation_time "1970-01-01T00:00:00"
fate-sub-mcc-remux: CMD = fmtstdout mcc -eia608_extract 0 -f mcc -i $(SRC_PATH)/tests/ref/fate/sub-mcc-remux -map 0:d -c copy -override_time_code_rate ntsc -creation_time "1970-01-02T00:00:00"
fate-sub-mcc-remux: CMP = rawdiff
FATE_SUBTITLES-$(call FRAMECRC, MPEGTS, DVBSUB, DVBSUB_ENCODER) += fate-sub-dvb
+1 -1
View File
@@ -1 +1 @@
0f43cdcbdc97ea6651c56540d97610e5
fe62460fe28202e0666e628afd8602ca
+1 -1
View File
@@ -1 +1 @@
af456bb18c4f5e6fb83c559769ce1b07
6838422ebb45df353a2bad62b9aff8e9
+1 -1
View File
@@ -1 +1 @@
af98321cd43a36f065f8c728e22f2c06
179e228004c396a301c89f34b6c72f68
+1 -1
View File
@@ -1 +1 @@
8b4ce818cde9621481b6bf7997b544b8
1d1f0768c547461ae2abef57f0aabc24
@@ -1 +1 @@
ea65b698e86322709257caf9038da40a
13fa042ee1b4079c227a5c5c96e2db38
@@ -1 +1 @@
c1047aeeb593f2f87818d9bd19cb12f2
2ab7c95e4637fb6a15efd8c0a8d6af98
@@ -1 +1 @@
cb14fde4f0f99d6e962fb109d3db36ee
b5be66a6a8792f7aac090beb9f3b4555
@@ -1 +1 @@
0f1cfba95edb2446689547fc012f741b
7bde6532fc682bfa3f5170cf9d607865
@@ -1 +1 @@
db40458891febf9f007c98e735e02ab9
1e40e8b48e4682e8b8004b9e0e60a5b6
+1 -1
View File
@@ -1 +1 @@
855cffb78a063ad0dfc432ae593974a2
9bb416c0304a13c4f66c56aef8431cd4
+1 -1
View File
@@ -1 +1 @@
8f6c44c4098915261e7708ab270877ff
3a7ed001d30f96d4888f5ca16e6263ce
@@ -1 +1 @@
0ed4ec02fd72c0b594d74c5cbd7e252f
7315bb7b55693a87c350b48cd2ee9811
@@ -1 +1 @@
1e8d7e1bd62a04bf47270c72a1c55bb7
1a7b5bf86bf0bbef10c9a1b2c799b276
@@ -1 +1 @@
c2ca28679265c1c86d4a7ef60cc061ff
9b7a0b7fc081542d9be1074b23054861
+1 -1
View File
@@ -1 +1 @@
pixdesc-xyz12be 1508a33dea936c45d9ee13f7743af00d
pixdesc-xyz12be 198f43f452bc55f4ca1e0e0171de5c4c
+1 -1
View File
@@ -1 +1 @@
pixdesc-xyz12le da2d1326fa5747a7f6ce5ac1e1494aea
pixdesc-xyz12le 5ca7d9ab5e01cc1bdc906520926721eb
+2 -2
View File
@@ -117,8 +117,8 @@ xv36be 9f556ee59a672fd8725f0bb36ce3e4b0
xv36le e08dcbde02f1c28a3554f372ad1278e2
xv48be ce34993b4b4411bba1d852b9b86aa39e
xv48le df913a7e61b162aa98303e5393e60c63
xyz12be f257f86373207af8aed0a1a05171df3b
xyz12le 7922f99edc44a2c26a25becbea9914cc
xyz12be d4562ab725e3ab7e5573dd03218bb03c
xyz12le ce17d867c3fea4c42324e40353b72de4
y210le 04e9487b6cce38e7531437e946cdd586
y212le 825768be8fe92708ae80be84855066ed
y216le 0e99aeddfee304e72d525d72998d9e9b
+2 -2
View File
@@ -114,8 +114,8 @@ xv36be 23b6f253fcb375e4145cfcb562268c5f
xv36le 778286003497f92b84d0bd8258d6b85d
xv48be c90889b2cf54cc78bd58e8c47d4eb791
xv48le 2c15c1254449ec5f9135ae61bdf4e1d5
xyz12be e2f9f6a1ec205ab675a5a1c9521dfa6c
xyz12le fea1da11c07736303b139bc52b7d4759
xyz12be 05d6fc3fbe70403160ff4e1b8a4aa969
xyz12le 3c7328a2f8497f0b4635b84df381a2b8
ya16be 071add03126a11dc6a06209e9b409f8d
ya16le b723211dc0647c944768c6e45e066b36
ya8 51a8dd297e35d40b06d3ebe8f4717895
+2 -2
View File
@@ -117,8 +117,8 @@ xv36be bcc7bda2d0a5d43db4464af6a4cb5d65
xv36le ba99f258370f2a56993e8760e6b30194
xv48be 2abcd986a34789ba4310be3969020d0d
xv48le f6f2e33f260f48334197538f3331f7bc
xyz12be 3b6eb75517263b9e54b9bfa869de394f
xyz12le 27d1d6a488cbc5d53e8d12fa0e162ddb
xyz12be a17930e991ca4ff86de5c2dc3b1e9b51
xyz12le b134b258a9593bc2019f0493f079f3a1
y210le 4c2fba1dc40322584977d15dd07c9146
y212le ac2a47c45187dd54d0f55293cbffd954
y216le e65b5bfae1b40edbbed2012e9cd45e31
+2 -2
View File
@@ -106,8 +106,8 @@ xv36be 962386c88268f4382004c3a7a82c5eb8
xv36le bcceffc985aaa8414c4b8072aa0889bd
xv48be 4d6e4004b03767f12df8bb4e76c98ddf
xv48le 9e94d82461a2131063157ac0dbe9467b
xyz12be ba6928f85c202cd77e216934f6bf0698
xyz12le 964680cd3f3db8a7ef5510f90196961a
xyz12be 65fe8da4ad44c83855360144eba41853
xyz12le f13851b3ba4e511ab1436786ec0727bd
y210le 22b1a02a39c4b325726bf8793bf1e8f2
y212le 2f08fb195b948056c844acb1eee8d649
y216le 360cb98ac80b13d3a8ec61c9f1ff3bac
+2 -2
View File
@@ -114,8 +114,8 @@ xv36be 98f578df965eed369f46cb135e2d1345
xv36le e478b4b54698beb3ce1b9a2dd691d544
xv48be e030a2c7b1b600cfacb691b6e90c2e3d
xv48le fbd7f8c65cd6fc9f9108dc9a1f977dc3
xyz12be 3c50a51a3c486a0c6853e4bbbcf3f244
xyz12le e020897d826ea20ded16f30ea1eb018d
xyz12be c678c7f19c610063f352a0253121441f
xyz12le 2320702cb1c8ccaad27d7004d4f3a195
ya16be 70fa41c32ecaf3370edc38add6096db2
ya16le 3b2c20f9e80717628ced6c6468507f63
ya8 4ad5920716de3d2fbbc49f95adb60345
+2 -2
View File
@@ -116,8 +116,8 @@ xv36be 3bbb949278ea55cc947ee03bd9c27c2d
xv36le 102c0e817d375ddd6b2cfbb4262dec95
xv48be 4d7376651fb7b3e84d00abad6c785aad
xv48le a1a8ff16d9a864568e5e557734bf3d6d
xyz12be b7d50e283360bf69fd661369110b26ef
xyz12le d5b1d45c3a136bb3d04f70a619c86c8d
xyz12be 3d9ae42c65eb645bb8e99dc708716f2d
xyz12le b27ec91dcff02d2b94b17c136be55001
y210le d4cf9b53cd7ff22f087743d483e88480
y212le d5a2b4677ddb4a3bc3e5cd5cbb20f426
y216le 9e44c6d76b09bcbe71738423b4b3d67a
+2 -2
View File
@@ -117,8 +117,8 @@ xv36be 9f556ee59a672fd8725f0bb36ce3e4b0
xv36le e08dcbde02f1c28a3554f372ad1278e2
xv48be ce34993b4b4411bba1d852b9b86aa39e
xv48le df913a7e61b162aa98303e5393e60c63
xyz12be f257f86373207af8aed0a1a05171df3b
xyz12le 7922f99edc44a2c26a25becbea9914cc
xyz12be d4562ab725e3ab7e5573dd03218bb03c
xyz12le ce17d867c3fea4c42324e40353b72de4
y210le 04e9487b6cce38e7531437e946cdd586
y212le 825768be8fe92708ae80be84855066ed
y216le 0e99aeddfee304e72d525d72998d9e9b
+2 -2
View File
@@ -117,8 +117,8 @@ xv36be 4d084adca0228d7750d1e2e877e0d79b
xv36le de9c74e94dc19c828e1572aa283d8aca
xv48be 9e58d1a045df100b0dec116e13be5b4e
xv48le fd873d53609b2fbdfe99470f515a234c
xyz12be f1905012d9b845306d9bef68d0fc81d5
xyz12le cfe1a3bbe391d83d381f590a00e1a16d
xyz12be 94ed06895d7030b97c36ccb9aae3722a
xyz12le fcb73d6b6192ab64ca9ff668fe6562f6
y210le 7c2aef142d88ab343ec01acd45f38466
y212le 39a3c0c843041ad4501b3107dd91ef17
y216le 17be2999e97d36b8ed903f07ef428c09
+2 -2
View File
@@ -104,8 +104,8 @@ xv36be 2261a0e3db5ee607d37f68d19704ae15
xv36le 9202133de91bf64c76ca27d5cd0c816a
xv48be 14373b7fe123225689e76fe2ce43fb93
xv48le 319df9724a067c7b5efa215f9f54d127
xyz12be 69737aceb508a73365664d04c340dd3b
xyz12le 70dd5fab9d8383b0d2e772b3b6569df4
xyz12be 38ce311e8734b535484c2e2ba70626d0
xyz12le 24a0e779fce6eaed687cb2c416a61eb9
ya16be 6098f7d2ede0aab6b2d93d2b4f4d915a
ya16le 1fae63e3e320ba9e6c12c29a48c44eff
ya8 d4b7a62f80681fa44c977ff3a64f4ce4
+2 -2
View File
@@ -117,8 +117,8 @@ xv36be c0272372d3e1a59adb3931ee433a5d5b
xv36le ffe6ab75ebc09134c3451f8f6ef0d501
xv48be bdfc3217ae456b370dbdcf4d52606a3f
xv48le 53dbebab73a66539c04644ef56dc6bbb
xyz12be 1bffa153a4a3ae61fd18e370f95161d9
xyz12le a0e93443826621a9d6c48354d949898a
xyz12be b9b83d36d58f4ad129894207888b3b3c
xyz12le b9764e43bacbbfc410e4b6558486115f
y210le f8847bedd3ae6e1c0cf84a823f275e31
y212le c801725ae31e3b8f5be269359d49f191
y216le 985db498aedf3fb1c547ad07442b7258
+1 -1
View File
@@ -38,7 +38,7 @@ File Format=MacCaption_MCC V2.0
UUID=0087C4F6-A6B4-5469-8C8E-BBF44950401D
Creation Program=FFmpeg
Creation Date=Thursday, January 1, 1970
Creation Date=Friday, January 2, 1970
Creation Time=00:00:00
Time Code Rate=30DF
+1 -1
View File
@@ -38,7 +38,7 @@ File Format=MacCaption_MCC V2.0
UUID=0087C4F6-A6B4-5469-8C8E-BBF44950401D
Creation Program=FFmpeg
Creation Date=Thursday, January 1, 1970
Creation Date=Friday, January 2, 1970
Creation Time=00:00:00
Time Code Rate=30DF
+1 -1
View File
@@ -38,7 +38,7 @@ File Format=MacCaption_MCC V2.0
UUID=0087C4F6-A6B4-5469-8C8E-BBF44950401D
Creation Program=FFmpeg
Creation Date=Thursday, January 1, 1970
Creation Date=Friday, January 2, 1970
Creation Time=00:00:00
Time Code Rate=30DF
@@ -0,0 +1,76 @@
File Format=MacCaption_MCC V2.0
///////////////////////////////////////////////////////////////////////////////////
// Computer Prompting and Captioning Company
// Ancillary Data Packet Transfer File
//
// Permission to generate this format is granted provided that
// 1. This ANC Transfer file format is used on an as-is basis and no warranty is given, and
// 2. This entire descriptive information text is included in a generated .mcc file.
//
// General file format:
// HH:MM:SS:FF(tab)[Hexadecimal ANC data in groups of 2 characters]
// Hexadecimal data starts with the Ancillary Data Packet DID (Data ID defined in S291M)
// and concludes with the Check Sum following the User Data Words.
// Each time code line must contain at most one complete ancillary data packet.
// To transfer additional ANC Data successive lines may contain identical time code.
// Time Code Rate=[24, 25, 30, 30DF, 50, 60, 60DF]
//
// ANC data bytes may be represented by one ASCII character according to the following schema:
// G FAh 00h 00h
// H 2 x (FAh 00h 00h)
// I 3 x (FAh 00h 00h)
// J 4 x (FAh 00h 00h)
// K 5 x (FAh 00h 00h)
// L 6 x (FAh 00h 00h)
// M 7 x (FAh 00h 00h)
// N 8 x (FAh 00h 00h)
// O 9 x (FAh 00h 00h)
// P FBh 80h 80h
// Q FCh 80h 80h
// R FDh 80h 80h
// S 96h 69h
// T 61h 01h
// U E1h 00h 00h 00h
// Z 00h
//
///////////////////////////////////////////////////////////////////////////////////
UUID=0087C4F6-A6B4-5469-8C8E-BBF44950401D
Creation Program=FFmpeg
Creation Date=Friday, January 2, 1970
Creation Time=00:00:00
Time Code Rate=30DF
00:00:58:29 T49S494F43ZZ72F4QROO74ZZBFAB
00:00:59:00 T49S494F43Z0172F4QROO74Z01BDAB
00:00:59:01 T49S494F43Z0272F4QROO74Z02BBAB
00:00:59:02 T49S494F43Z0372F4QROO74Z03B9AB
00:00:59:03 T49S494F43Z0472F4QROO74Z04B7AB
00:00:59:04 T49S494F43Z0572F4QROO74Z05B5AB
00:00:59:05 T49S494F43Z0672F4QROO74Z06B3AB
00:00:59:06 T49S494F43Z0772F4QROO74Z07B1AB
00:00:59:07 T49S494F43Z0872F4QROO74Z08AFAB
00:00:59:08 T49S494F43Z0972F4QROO74Z09ADAB
00:00:59:09 T49S494F43Z0A72F4QROO74Z0AABAB
00:00:59:10 T49S494F43Z0B72F4QROO74Z0BA9AB
00:00:59:11 T49S494F43Z0C72F4QROO74Z0CA7AB
00:00:59:12 T49S494F43Z0D72F4QROO74Z0DA5AB
00:00:59:13 T49S494F43Z0E72F4QROO74Z0EA3AB
00:00:59:14 T49S494F43Z0F72F4QROO74Z0FA1AB
00:00:59:15 T49S494F43Z1072F4QROO74Z109FAB
00:00:59:16 T49S494F43Z1172F4QROO74Z119DAB
00:00:59:17 T49S494F43Z1272F4QROO74Z129BAB
00:00:59:18 T49S494F43Z1372F4QROO74Z1399AB
00:00:59:19 T49S494F43Z1472F4QROO74Z1497AB
00:00:59:20 T49S494F43Z1572F4QROO74Z1595AB
00:00:59:21 T49S494F43Z1672F4QROO74Z1693AB
00:00:59:22 T49S494F43Z1772F4QROO74Z1791AB
00:00:59:23 T49S494F43Z1872F4QROO74Z188FAB
00:00:59:24 T49S494F43Z1972F4QROO74Z198DAB
00:00:59:25 T49S494F43Z1A72F4QROO74Z1A8BAB
00:00:59:26 T49S494F43Z1B72F4QROO74Z1B89AB
00:00:59:27 T49S494F43Z1C72F4QROO74Z1C87AB
00:00:59:28 T49S494F43Z1D72F4QROO74Z1D85AB
00:00:59:29 T49S494F43Z1E72F4QROO74Z1E83AB
00:01:00:02 T49S494F43Z1F72F4QROO74Z1F81AB
+1 -1
View File
@@ -1,2 +1,2 @@
47b890678bb9195107c2f7afb2344bbf *tests/data/pixfmt/xyz12le.yuv
f14b14a12c864408a0115f55eaef9934 *tests/data/pixfmt/xyz12le.yuv
304128 tests/data/pixfmt/xyz12le.yuv
+16 -4
View File
@@ -2,8 +2,11 @@
#If a version is set then we only try merging a source plugin with matching version as a generic one could change the ABI to master HEAD
merge_internal(){ # $1=repository, $2=refspec
[ -n "$version" ] && git pull --no-rebase --log --stat --commit --no-edit $1 sourceplugin-$2-$version
[ -z "$version" ] && git pull --no-rebase --log --stat --commit --no-edit $1 sourceplugin-$2
branch="sourceplugin-$2"
if [ -n "$version" ] ; then
branch="$branch-$version"
fi
git pull --no-rebase --log --stat --commit --no-edit "$1" "$branch"
}
unset succeeded failed version
@@ -29,9 +32,18 @@ git diff --exit-code >/dev/null ||\
git diff --cached --exit-code >/dev/null ||\
error "Please commit local changes first"
#version="12.34"
version="8.0"
merge "https://github.com/michaelni/FFmpeg.git" "libpostproc"
[ $# -ne 1 ] &&\
error "Usage: $0 source-plugins.txt"
while IFS=' ' read -r a b; do
case "$a" in
''|'#'*) continue ;;
esac
merge "$a" "$b"
done < "$1"
[ -n "$version" ] && echo version: $version
[ -n "$succeeded" ] && echo Succeeded merging: $succeeded
+4
View File
@@ -0,0 +1,4 @@
# List of source plugins
# libpostproc, GPL, maintained by Michael Niedermayer
https://github.com/michaelni/FFmpeg.git libpostproc