1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-02 03:06:28 +02:00
Commit Graph

111802 Commits

Author SHA1 Message Date
Rémi Denis-Courmont
05115a77e0 lavu/timer: use time for AV_READ_TIME on RISC-V
So far, AV_READ_TIME would return the cycle counter. This posed two
problems:
1) On recent systems, it would just raise an illegal instruction
   exception. Indeed RDCYCLE is blocked in user space to ward off some
   side channel attacks. In particular, this would cause the random
   number generator to crash.
2) It does not match the x86 behaviour and the apparent original intent
   of AV_READ_TIME in the functional code base (outside test cases).

So this replaces the cycle counter with the time counter. The unit is
a platform-dependent constant fraction of time, and the value should be
stable across harts (RISC-V lingo for physical CPU thread).
2023-08-24 20:58:57 +03:00
Michael Niedermayer
5f5a1ccd04
avcodec/wavarc: Check that nb_samples is not negative
It is currently probably not possible for it to be negative as
the needed 2Mb input buf size is not achievable. But it is more
robust to check for it too.
If it would become negative than code like
s->samples[0][n] = s->samples[0][s->nb_samples + n];
would crash

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-23 22:52:26 +02:00
Michael Niedermayer
1a81a40de2
avcodec/wavarc: Check shift
Fixes: shift exponent 1285 is too large for 32-bit type 'int'
Fixes: 60870/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WAVARC_fuzzer-5332050340347904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-23 22:52:26 +02:00
Michael Niedermayer
0ce322a51e
avcodec/xvididct: Fix integer overflow in idct_row()
Fixes: signed integer overflow: -1403461578 + -843974775 cannot be represented in type 'int'
Fixes: 60868/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG1VIDEO_fuzzer-4599793035378688

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-08-23 22:52:26 +02:00
Timo Rothenpieler
f225f8d746 avformat/hls: reset the playlist init segment on seek
The mp4 demuxer gets very upset when it gets flushed and not re-fed this
data.
2023-08-22 23:46:11 +02:00
Aleksoid
7eb0d9e905 avcodec/nvenc: add option to limit slice size 2023-08-22 23:46:11 +02:00
Martin Storsjö
95433eb3aa fate/matroska: Stop using unicode in command line paramters
The fate-run.sh shell script exports LC_ALL=C before invoking the
test executables; this is probably done for consistency.

When executing Windows binaries with Wine, it normally handles
UTF-8 command line parameters just fine - but with LC_ALL set to
C, it treats them as plain ASCII.

As the unicode command line parameters wasn't the main thing
being tested here, just convert them to plain ASCII, for
portability. This fixes the test for all test configurations that
use Wine.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-22 22:09:40 +03:00
Martin Storsjö
aea2d269db configure: Include objbase.h when checking for CoTaskMemFree
ddc1cd5cdd defined WIN32_LEAN_AND_MEAN
globally, which makes for much fewer transitive includes from
windows.h. With that define, CoTaskMemFree no longer gets
implicitly declared by just including windows.h, but one has to
include the right header objbase.h too.

That commit caused ole32 to no longer get detected, which caused
dxva2 to no longer be enabled. This gets fixed by this patch.

Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-21 23:11:43 +03:00
Evgeny Pavlov
cb1479faca avfilter/vf_ssim: Fix x86 assembly code for SSIM calculation
This commit fixes bug #10495

The code had several bugs related to post-loop compensation code:
- test assembly instruction performs bitwise AND operation and
generate flags used by jz branch instruction. Wrong test condition
leads to incorrect branching
- Incorrect compensation code for some branches

Signed-off-by: Evgeny Pavlov <lucenticus@gmail.com>
2023-08-21 17:04:51 +02:00
Chris Spencer
f0b1cab538 hwcontext_vulkan: always use create_pnext in vulkan_pool_alloc
Currently, create_pnext is only used if an applicable external memory
extension is enabled. This will usually the case when used from the command
line, but may not be when the Vulkan context is created manually.

For images used in video decoding, create_pnext contains the video profile
list, which is mandatory.[1] This fixes a GPU crash when using RADV.

[1] https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkImageCreateInfo.html#VUID-VkImageCreateInfo-usage-04815

Signed-off-by: Chris Spencer <spencercw@gmail.com>
2023-08-20 22:47:09 +02:00
James Almer
8c789c5da3 avutil/thread: add wrappers for pthread_cond_t functions
This abstraction is similar to the existing one for pthread_mutex_t and
pthread_once_t functions, and should reduce the amount of ifdeffery used
in future code.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-19 10:03:07 -03:00
James Almer
7e246a5db5 doc/APIChanges: remove bogus entry
New AVOptions in modules don't belong here.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-18 08:27:27 -03:00
Zhao Zhili
ff094f5ebb avutil/channel_layout: make pre-defined channel layouts C++ friendly
C++ doesn't support designated initializers until C++20. We have
a bunch of pre-defined channel layouts, the gains to make them
usable in C++ exceed the losses.

Bump minor version so C++ project can check before use these defines.

Also initialize .opaque field explicitly to reduce warning in C++.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-18 08:27:24 -03:00
Nuo Mi
81a48d96e2 cbs_h266: slice_header, fix inference for pred_weight_table
Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
763eb59187 cbs_h266: H266RawSliceHeader, expose NumRefIdxActive[]
Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
088bda0f8e cbs_h266: H266RawPredWeightTable, expose num_weights_l0 and num_weights_l1
Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
ea8571dc99 cbs_h266: H266RawSliceHeader, expose NumEntryPoints
Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
ad8dc5e814 cbs_h266: fix slice_height_in_ctus for single slice tile
Failed clips:
TILE_E_Nokia_2.bit
TILE_D_Nokia_2.bit
LMCS_A_Dolby_3.bit

Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
c837c055a2 cbs_h266: fix inference for xh_deblocking_filter_disabled_flag
if !ph_deblocking_params_present_flag is true, ph_deblocking_filter_disabled_flag infered from pps
if !sh_deblocking_params_present_flag is true, sh_deblocking_filter_disabled_flag infered from ph

Failed clips:
ENT444MAINTIER_C_Sony_3.bit
ENT444HIGHTIER_D_Sony_3.bit

Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
d7f851b8c4 cbs_h266: fix inference for sh_alf_enabled_flag
if pps_alf_info_in_ph_flag is true
sh_alf_enabled_flag infered from ph

Failed clip:
LTRP_A_ERICSSON_3.bit

Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Nuo Mi
fe745c2007 cbs_h266: fix inference for sh_lmcs_used_flag and sh_explicit_scaling_list_used_flag
if sh_picture_header_in_slice_header_flag is true
sh_lmcs_used_flag and sh_explicit_scaling_list_used_flag are infered from ph

Failed clips:
LMCS: CLM_A_KDDI_2.bit STILL444_A_KDDI_1.bit
Scaling: SCALING_B_InterDigital_1.bit SCALING_A_InterDigital_1.bit

Signed-off-by: James Almer <jamrial@gmail.com>
2023-08-17 10:05:24 -03:00
Leo Izen
7098bec73b
avcodec/exr: tag gamma=1.0 output as linear light
By default the OpenEXR decoder outputs linear light pixel data by
applying a gamma=1.0 transfer (i.e. a no-op). When it does so, it
should tag the data as linear so color-managed filters or other tools
can work with it correctly.

Signed-off-by: Leo Izen <leo.izen@gmail.com>
2023-08-17 07:42:58 -04:00
Wenbin Chen
9ae4863cc5 libavfilter/vf_vpp_qsv: Fix a timestamp bug when framerate is not set
If user doesn't set framerate when he creates a filter, the filter uses
default framerate {0, 1}. This causes error when setting timebase to
1/framerate. Now change it to pass inlink->time_base to outlink when
framerate is not set.
This patch fixes ticket: #10476 #10468

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-08-17 12:06:09 +08:00
Haihao Xiang
e0a5c35270 lavc/qsvenc: return error with zero output
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-08-17 12:06:09 +08:00
Haihao Xiang
a7f24d79b8 lavc/qsvenc_hevc: restore the default gop size
commit a3c0a3e changed the default settings and expected the runtime can
choose a best value. However the runtime doesn't set a valid gop size
for hevc encoder, hence the output steam is non-seekable, which is
inconvenient to user [1][2]

[1] https://github.com/intel/media-driver/issues/1576
[2] https://ffmpeg.org/pipermail/ffmpeg-user/2023-August/056716.html

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-08-17 12:06:09 +08:00
David Rosca
2ec58055f5 lavu/hwcontext_vaapi: Add vaapi_drm_format_map support for x2rgb10
Support for allocating frames with x2rgb10 format was added
in c00264f501, this adds support for importing DMA-BUFs.
2023-08-17 12:06:09 +08:00
Paul B Mahol
3057ce797f avcodec/wavpack: fix indentation 2023-08-16 22:05:14 +02:00
Paul B Mahol
082133fc07 avcodec/tta: fix minor code style issues 2023-08-16 21:36:40 +02:00
Paul B Mahol
8f7850a22e avcodec/wavpack: reduce extra dereferencing inside loops 2023-08-16 12:36:18 +02:00
Paul B Mahol
8653dcaf7d avformat/sox*: extend long name 2023-08-15 21:42:21 +02:00
Paul B Mahol
4d0a25d760 avformat/soxdec: improve probe a little 2023-08-15 21:42:20 +02:00
Paul B Mahol
4b30aef4c0 avcodec/alac: use branchless sign 2023-08-15 19:09:23 +02:00
Paul B Mahol
4463778aab avcodec/alac: reduce dereferencing inside loops
Also fix style while here.
2023-08-15 19:09:22 +02:00
Paul B Mahol
a3b434e151 avcodec/wavpackenc: add support for encoding unspec channel layouts
Also write 0 for chmask if mask have bits outside of first 32 bits,
as wavpack does not support more bits than 32 for channel layouts.
2023-08-15 00:32:45 +02:00
Paul B Mahol
46412a8935 avcodec/wavpack: remove hard limitation on number of supported channels 2023-08-15 00:32:44 +02:00
L. E. Segovia
ddc1cd5cdd configure: Set WIN32_LEAN_AND_MEAN at configure time
Including winsock2.h or windows.h without WIN32_LEAN_AND_MEAN cause
bzlib.h to parse as nonsense, due to an instance of #define char small
in rpcndr.h.

See:

https://stackoverflow.com/a/27794577

Signed-off-by: L. E. Segovia <amy@amyspark.me>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-14 22:57:28 +03:00
Paul B Mahol
c704901324 Bump minor libavfilter version and add Changelog entry 2023-08-14 11:24:12 +02:00
Paul B Mahol
24c013369d avfilter/af_asdr: remove wrong scaling from sdr, and fix sisdr formula 2023-08-14 11:19:56 +02:00
Paul B Mahol
10110a30b5 avfilter/af_asdr: use single structure for sums 2023-08-14 11:19:56 +02:00
Paul B Mahol
e41d52216c avfilter: add asisdr filter 2023-08-14 11:19:56 +02:00
Paul B Mahol
951def850a avfilter: add apsnr filter 2023-08-14 11:19:55 +02:00
Steven Liu
a1928dff2c Changelog: Add Support hevc,vp9,av1 codec in enhanced flv format
Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2023-08-14 15:21:16 +08:00
Steven Liu
a9a92682dd avformat/flv: correct the video frametype mask to 0x70
because the flv specification said the video frametype
should use value range from 0x00 to 0x70,
so use 0xF0 have no problem before support enhanced flv,
but the 0xF0 will get incorrect result after support enhanced flv,
so should set the video frametype mask 0x70 to make it correct now.

Reported-By: flvAnalyser <hybase@qq.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-08-14 14:17:35 +08:00
Steven Liu
ab88970fba avformat/flvdec: remove unused context member of flv
The exheader is unnecessary after 207e9f4e50
Iust use local varible can do the same function.

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2023-08-14 14:14:07 +08:00
Random Joe
176ed008bd avcodec/cuviddec: dynamically set max decode surfaces 2023-08-13 19:13:01 +02:00
Andreas Rheinhardt
f7715feb5d fate/matroska: Fix requirements of fate-matroska-alac-remux test
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-13 16:47:12 +02:00
Andreas Rheinhardt
5d07757c70 fate/matroska: Add test for stereo 3D
Just mark a non-stereo file as stereo to test the code.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-08-13 16:46:54 +02:00
Paul B Mahol
a5b334e18e avfilter/af_astats: fix reporting of noise_floor for small number of samples 2023-08-13 14:38:28 +02:00
Paul B Mahol
90afcc2bfd avfilter/af_astats: drop usage of histogram for noise floor calculation 2023-08-13 14:24:47 +02:00
Paul B Mahol
80fdf51b8f avfilter/af_asdr: add fltp sample format support 2023-08-13 02:33:32 +02:00