summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* swscale/swscale_unscaled: fix packed16togbra16() for formats with bpc ↵Ramiro Polla2025-05-231-4/+4
| | | | | | | | | | | | | | | | | | | | | between 9-14 bits Currently, packed16togbra16() always sets the alpha value to 0xFFFF, without taking the bit depth into consideration. This causes a bug on x86, which can be reproduced with: ./libswscale/tests/swscale -unscaled 1 -src xyz12le -dst gbrap12be The problem arises in ff_hscale14to15_4_ssse3(), in the conversion from gbrap12be to yuva444p, which comes after the conversion from xyz12le to gbrap12be. It has something to do with pmaddwd not working on unsigned values. There is some code to deal with 0xFFFF if the input has a bit depth of 16, but not for bit depths < 16. We could fix ff_hscale14to15_4_ssse3() to also work correctly with 0xFFFF on bit depths < 16, or we could just not write 0xFFFF there in the first place, which is what this commit does.
* swscale/swscale_unscaled: fix packed30togbra10() for formats with bpc ↵Ramiro Polla2025-05-231-2/+3
| | | | | | | | | between 9-14 bits Currently, packed30togbra10() always sets the alpha value to 0xFFFF, without taking the bit depth into consideration. This commit restricts the alpha value to the bit depth.
* swscale/swscale_unscaled: fix planarCopyWrapper() for yuv444p => yuva444pRamiro Polla2025-05-221-1/+1
| | | | | | | | Currently, planarCopyWrapper() assumes that src[3] must be NULL when the source format has no alpha plane. This commit updates the condition for filling the alpha plane based on the number of components available in the source format as well.
* build: remove unused SLIBOBJS variableRamiro Polla2025-05-223-8/+4
| | | | | | | | | | The SLIBOBJS variable was introduced in 56572787ae2 but is no longer used. Another variable, SHLIBOBJS, was introduced after SLIBOBJS, in 20b0d24c2f7. The functionality from SLIBOBJS was effectively migrated to SHLIBOBJS in b77fff47d0d. No code has used SLIBOBJS since. This commit removes all remaining references to SLIBOBJS from the build system.
* doc/examples/qsv_decode: use av_err2strTristan Matthews2025-05-221-5/+2
| | | | Signed-off-by: Marvin Scholz <[email protected]>
* doc/examples/filter_audio: use av_err2strTristan Matthews2025-05-221-3/+1
| | | | Signed-off-by: Marvin Scholz <[email protected]>
* vulkan/ffv1: fix sync issue in cached bitstream reader/writerLynne2025-05-232-0/+3
| | | | | | The issue is that there is an explicit lack of synchronization as only the very first invocation writes symbols and updates the state, which other invocations then store.
* rtpdec: Set bitrate for pcm-mulaw audioErik Linge2025-05-221-0/+7
| | | | | Signed-off-by: Marvin Scholz <[email protected]> Co-authored-by: Marvin Scholz <[email protected]>
* libavformat/rtpdec_opus: add fmtp parsing of sprop-maxcapturerateErik Linge2025-05-221-0/+34
| | | | | Co-authored-by: Marvin Scholz <[email protected]> Signed-off-by: Marvin Scholz <[email protected]>
* libavformat/rtpdec_opus: Set duration field on Opus AVPacketJonathan Baudanza2025-05-224-55/+120
| | | | | | | | | | | | | | | | | | | | This commit will properly set the duration field of Opus AVPackets. Currently, duration is set to 0 on Opus packets from the RTP demuxer. The Ogg muxer depends on the duration field to properly compute the page granule value. Without a proper duration, the granule will be wrong, and result in negative pts values in ogg files. See oggenc.c:657 (ogg_write_packet_internal) This commit calculates using the opus_duration function, which was copied from oggparseopus.c I moved this functionality and the existing opus extradata functionality (added by me in 6c24f2b) into a new rtpdec_opus.c file. Reviewed-by: Tristan Matthews <[email protected]> Signed-off-by: Marvin Scholz <[email protected]>
* avformat/dhav: fix backward scanning for get_duration and optimize seekingJustin Ruggles2025-05-221-15/+39
| | | | | | | | | | | | | | | | The backwards scanning done for incomplete final packets should not assume a specific alignment at the end of the file. Truncated files result in hundreds of thousands of seeks if the final packet does not fall on a specific byte boundary, which can be extremely slow. For example, with HTTP, each backwards seek results in a separate HTTP request. This changes the scanning to check for the end tag 1 byte at a time and buffers the last 1 MiB to avoid additional seek operations. Co-authored-by: Derek Buitenhuis <[email protected]> Signed-off-by: Justin Ruggles <[email protected]> Signed-off-by: Derek Buitenhuis <[email protected]>
* avutil/refstruct: Remove redundant checkAndreas Rheinhardt2025-05-221-1/+1
| | | | | | We now require C11. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avfilter/vf_interlace_vulkan: fix FPS and PTS calculationNiklas Haas2025-05-211-1/+9
| | | | | | ol->frame_rate is 0/0, so we need to calcalute the correct value based on the il->frame_rate instead. Also adjust the time base, PTS and frame_duration values accordingly. (Logic taken from vf_tinterlace.c)
* avcodec/amfenc_h264: improve B-frame usability and simplify optionsDmitrii Ovchinnikov2025-05-211-17/+52
| | | | | | | - Query GPU caps for B-frame support and warn if unsupported. - Make `-max_b_frames` optional - Drop explicit `-pa_lookahead_buffer_depth` requirement in adaptive mode.
* avcodec/atrac3: Use av_unreachable() instead of av_assert1(0)Andreas Rheinhardt2025-05-211-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/4xm: Use av_unreachable() instead of av_assert0(0)Andreas Rheinhardt2025-05-211-1/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mjpegenc_common: Use av_unreachable() instead of av_assert0(0)Andreas Rheinhardt2025-05-211-2/+3
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/adpcm: Use av_unreachable() instead of av_assert0()Andreas Rheinhardt2025-05-211-1/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vp9: Replace av_assert(0) by av_unreachable()Andreas Rheinhardt2025-05-211-1/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/rv20enc: Use av_assert1() instead of av_assert0()Andreas Rheinhardt2025-05-211-6/+6
| | | | | | | There is really no good reason to perform these checks in release builds. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo encs: Add put_bits_assume_flushed() to encode_headerAndreas Rheinhardt2025-05-2110-6/+26
| | | | | | | This allows the compiler to remove the implicit "Do I need to output the PutBitContext buffer here?" checks. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vlc: Make assert check more strictAndreas Rheinhardt2025-05-211-1/+1
| | | | | | | The earlier code allowed callers to use arbitrary values as symbols_size as long as no symbols were present. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_{dec,motion}: Mark unreachable code as unreachableAndreas Rheinhardt2025-05-212-2/+3
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/wmaenc: Use av_unreachable() instead of av_assert0(0)Andreas Rheinhardt2025-05-211-4/+5
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/speedhqenc: Use av_unreachable() for unreachable conditionAndreas Rheinhardt2025-05-211-1/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/e?ac3enc: Inform compiler about PutBitContext being blankAndreas Rheinhardt2025-05-212-0/+4
| | | | | | | | | | This turned out to be very beneficial: For GCC 13, the codesize of ac3_output_frame_header went down from 4522B to 1247B and from 10762B to 9298B for eac3_output_frame_header. For Clang 17, the numbers went down from 3923B to 2477B and from 8338B to 6548B (always with -O3). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/put_bits: Allow to mark places where PutBitContext is flushedAndreas Rheinhardt2025-05-211-0/+10
| | | | | | | This will allow the compiler to optimize the "is the cache full?" branches away from some put_bits(). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/dolby_e_parse: Use av_unreachable instead of av_assert0(0)Andreas Rheinhardt2025-05-211-1/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/utvideoenc: Remove always-false pixel format checkAndreas Rheinhardt2025-05-211-3/+2
| | | | | | Mark it as unreachable instead. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/vlc: Make code more readable with av_unreachable()Andreas Rheinhardt2025-05-211-2/+2
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/pcm-dvdenc: Mark unreachable default cases as unreachableAndreas Rheinhardt2025-05-211-2/+3
| | | | | | | | Fixes a Clang warning when asserts are disabled: "variable 'quant' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized]" Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg4videodec: Mark impossible switch case as unreachableAndreas Rheinhardt2025-05-211-1/+3
| | | | | | Alternative to 8fc649b931a3cbc3a2dd9b50b75a9261a2fb4b49. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/proresenc_anatoliy: Mark impossible case as unreachableAndreas Rheinhardt2025-05-211-5/+11
| | | | | | | Alternative fix for fix Coverity issue 1440385 (instead of 6106177ad66ab28f44520534f386239d2405eeab). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/amrwbdec: Mark default switch as unreachableAndreas Rheinhardt2025-05-211-1/+2
| | | | | | | Alternative fix for Coverity issue #1473499 instead of a3bb269db92601e2dc0e99352468d02f7b26c7c2. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avutil/avassert: Add av_unreachable() and av_assume() macrosAndreas Rheinhardt2025-05-213-1/+46
| | | | | | | | | | | | | Useful to let the compiler and static analyzers know that something is unreachable without adding an av_assert (which would be either dead for the compiler or add runtime overhead) for this. The implementation used here enforces the use of a message to provide a reason why a particular code is supposed to be unreachable. Reviewed-by: Ramiro Polla <[email protected]> Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/svq3: Improve returning last pictureAndreas Rheinhardt2025-05-211-6/+2
| | | | | | | | | | | Use av_frame_move_ref() instead of av_frame_ref(). This allows to remove the separate variable for whether we have already returned the delayed last pic. It also makes stream looping work when looping multiple times; previously the delayed pic was only output the first time, because last_frame_output was never reset. Signed-off-by: Andreas Rheinhardt <[email protected]>
* tests/fate/qt: Use passthrough fps_mode for svq3-watermarkAndreas Rheinhardt2025-05-212-1/+2
| | | | | | | | | The file has buggy timestamps (it uses B-frames, yet pts==dts) and therefore the last frame is currently discarded by FFmpeg cli. Using -fps_mode passthrough avoids this and provides coverage of the SVQ3 draining logic. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/svq3: Allocate picture buffers during initAndreas Rheinhardt2025-05-211-41/+42
| | | | | | Also allocate them jointly. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/svq3: Allocate motion_val jointlyAndreas Rheinhardt2025-05-211-16/+9
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/svq3: Deduplicate allocating dummy frameAndreas Rheinhardt2025-05-211-16/+19
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/svq3: Improve returned error codesAndreas Rheinhardt2025-05-211-5/+7
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/svq3: Factor out decoding extradataAndreas Rheinhardt2025-05-211-127/+132
| | | | | | | | | Reduces indentation and avoids an extra variable for whether a sequence header has been found. It also fixes potential undefined behaviour: NULL + 0 is undefined and happens when no extradata is available. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg12enc: Combine put_bits()Andreas Rheinhardt2025-05-211-2/+1
| | | | | | | This is a 16bit field in the spec, so using a single put_bits() to write it is more natural. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg12dec: Remove nonsense commentAndreas Rheinhardt2025-05-211-3/+0
| | | | | | Everything in mpeg12dec.c is about decoding. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg12dec: Remove redundant save_width/heightAndreas Rheinhardt2025-05-211-7/+1
| | | | | | | | | | These have been added in 29644cb504eee88bd40f95abaa392047946c6066 in 2007 at a time when the MPEG-1/2 parser just set the AVCodecContext's dimensions when encountering a sequence header, so that the checks for the coded dimensions didn't trigger. Yet this is no more and so we can simply remove these redundant checks. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpeg12dec: Set save_chroma_format also for VCR2Andreas Rheinhardt2025-05-211-0/+1
| | | | | | | | Otherwise the MpegEncContext would be unnecessarily reinitialized once (this does not affect the output for an intra-only variant like VCR2) in mpeg_decode_postinit(). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/mpegvideo_dec: Move ff_mpv_report_decode_progress() to h263dec.cAndreas Rheinhardt2025-05-213-10/+8
| | | | | | | It is its only user. Also make it static and call it before ff_mpeg_draw_horiz_band(). Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/tests/avcodec: Check only frame-mt decoders set update_thread_ctxAndreas Rheinhardt2025-05-211-0/+3
| | | | | | Possible since 554b52b1b3f653ab3e59a0004da73b7aaf0fc4fd. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/ratecontrol: Fix wrong sizeof expressionAndreas Rheinhardt2025-05-211-1/+1
| | | | | | | Fixes Coverity issue #1644200. Introduced in 89a8033fc918b2f0ef435e5a3077455ceb8ff913. Signed-off-by: Andreas Rheinhardt <[email protected]>
* avcodec/tests/.gitignore: Add apv test toolAndreas Rheinhardt2025-05-211-0/+1
| | | | Signed-off-by: Andreas Rheinhardt <[email protected]>