1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00
Commit Graph

105427 Commits

Author SHA1 Message Date
Andreas Rheinhardt
b8b1c49bfa fate/mpeg4: Add test for MPEG-4 Simple Studio Profile
The sample mpeg4/mpeg4_sstp_dpcm.m4v existed in the FATE-suite,
but it was surprisingly unused.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 19:30:25 +01:00
Andreas Rheinhardt
d4d87f2ac5 avcodec/mpegvideo: Fix crash when using lowres with 10bit MPEG-4
In this case the macroblocks written to are smaller, yet
the MPEG-4 Simple Studio Profile code for 10bit DPCM ignored this;
e.g. in case of lowres = 2 or = 3, the sample mpeg4_sstp_dpcm.m4v
from the FATE-suite reads beyond the end of the buffer.

This commit fixes this by taking lowres into account.
The DPCM macroblocks of the aforementioned sample look
as good as can be expected after this patch; yet the non-DPCM
coded macroblocks are simply corrupt.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 19:30:25 +01:00
Andreas Rheinhardt
9953fc9a23 avcodec/mpegvideo: Fix off-by-one error when decoding >8 bit MPEG-4
Fixes visual corruptions on two macroblocks from two frames from
https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket4447/A003C003_SR_422_23.98p.mxf

Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 19:30:25 +01:00
Andreas Rheinhardt
83c1ac6570 avcodec/mpegvideo_enc: Don't hardcode list of codecs supporting bframes
Check for the encoder's AV_CODEC_CAP_DELAY instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 19:30:24 +01:00
Andreas Rheinhardt
0063a06aaa avcodec/mpegvideo_enc: Localize check for invalid number of b-frames
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 19:30:24 +01:00
Andreas Rheinhardt
aeb83322aa avcodec/mpegvideo: Move frame_rate_index to (Mpeg1|MPEG12Enc)Context
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 19:30:24 +01:00
Andreas Rheinhardt
e17ceeba3c avcodec/mpegvideo_enc: Move H.263p? encoders to ituh263enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:31 +01:00
Andreas Rheinhardt
2098d1f4c5 avcodec/mpegvideo_enc: Move msmpeg4/wmv1 encoders to msmpeg4enc.c
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:31 +01:00
Andreas Rheinhardt
4bbfe02ca0 avcodec/mpegvideo: Move gop_picture_number to MPEG12EncContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:31 +01:00
Andreas Rheinhardt
b90ea35182 avcodec/mpegvideo_enc: Don't sync gop_picture_number among slice threads
It is only used by the main thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:31 +01:00
Andreas Rheinhardt
757be51ded avcodec/mpegvideo: Move timecode_frame_start to Mpeg1Context
It is only used there and only by the main thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:31 +01:00
Andreas Rheinhardt
01f60973a4 avcodec/mpegvideo: Move aspect_ratio_info to Mpeg1Context
Only used there and only by the main thread.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:31 +01:00
Andreas Rheinhardt
30dfd87da1 avcodec/mpeg4videodec: Use stack variable for aspect_ratio_info
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:31 +01:00
Andreas Rheinhardt
9288b6366b avcodec/ituh263dec: Use stack variable for aspect_ratio_info
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
f2da650258 avcodec/ituh263enc: Use stack variable for aspect_ratio_info
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
b326c2dcdc avcodec/mpeg4videoenc: Use stack variable for aspect_ratio_info
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
5256658af5 avcodec/mpeg12enc: Reindent after the previous commit
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
d3a2d06633 avcodec/mpeg12enc: Return early if no Sequence Header is written
Allows to avoid one level of indentation.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
f05ba7b169 avcodec/mpeg12enc: Use stack variable for aspect_ratio_info
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
769703613a avcodec/ituh263enc: Use stack variable for custom_pcf
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
426d65e3e3 avcodec/mpeg4?video: Move vo_type to Mpeg4DecContext
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
eb67659884 avcodec/mpeg4videodec: Keep vo_type in sync between threads
Otherwise one can get outdated values when setting FF_DEBUG_PICT_INFO.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
49627b2f2a avcodec/mpeg4videoenc: Use stack variable for vo_type
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
7f6596c8bb avcodec/h263: Move decoding-only stuff to a new header h263dec.h
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
85bbae8473 avcodec/h263: Remove declaration for inexistent function
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Andreas Rheinhardt
218d1f76d4 avcodec/jpeg2000dec: Move preparations to main thread, fix race
jpeg2000_decode_tile() (which is run concurrently by several threads
when using slice threading) currently modifies some joint values
before doing its actual work. This is a data race that happens to work
because all threads set the same values; but it is nevertheless
undefined behaviour.

Fix this by performing said preparatory work in the main thread instead.
This fixes the vsynth(1|2|_lena)-jpeg2000(-97)? FATE-tests when using
TSAN and slice threading.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-29 18:34:30 +01:00
Paul B Mahol
e13f0b9456 avfilter/vf_v360: improve xyz_to_fisheye() 2022-01-29 17:36:37 +01:00
Paul B Mahol
3981dbd192 avfilter/vf_v360: improve xyz_to_dfisheye() even more 2022-01-29 17:36:37 +01:00
Timo Rothenpieler
2f323b1978 avutil/hwcontext_qsv: fix typo 2022-01-29 15:37:38 +01:00
Paul B Mahol
d388dc20b9 avfilter/af_afir: switch to lavu/tx 2022-01-29 11:46:55 +01:00
Haihao Xiang
8ca06a8148 lavc/qsvdec: export AVFilmGrainParams side data
When AV_CODEC_EXPORT_DATA_FILM_GRAIN is present, AV1 decoder should
disable film grain application and export the corresponding side data

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-29 12:02:52 +08:00
Haihao Xiang
7c24a768d3 lavc/qsvdec: track the runtime session version
We may check the runtime version for the given features

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-29 12:02:52 +08:00
Haihao Xiang
8dd507bf0d lavc/qsv: allow to add more parameter buffers to QSV frame
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-29 12:02:52 +08:00
Haihao Xiang
80801e5705 lavc/qsvenc: add tile encoding support for VP9
Add -tile_rows and -tile_cols options to specify the number of tile
rows and columns

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-29 12:02:52 +08:00
nyanmisaka
4cc7239d8b libavutil/hwcontext_opencl: fix a bug for mapping qsv frame to opencl
mfxHDLPair was added to qsv, so modify qsv->opencl map function as well.
Now the following commandline works:

ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 \
-init_hw_device qsv=qs@va -init_hw_device opencl=ocl@va -filter_hw_device ocl \
-hwaccel qsv -hwaccel_output_format qsv -hwaccel_device qs -c:v h264_qsv \
-i input.264 -vf "hwmap=derive_device=opencl,format=opencl,avgblur_opencl, \
hwmap=derive_device=qsv:reverse=1:extra_hw_frames=32,format=qsv" \
-c:v h264_qsv output.264

Signed-off-by: nyanmisaka <nst799610810@gmail.com>
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-01-29 12:02:52 +08:00
Wenbin Chen
a5b1e632c9 libavcodec/vaapi_decode: fix the problem that init_pool_size < nb_surface
For vaapi if the init_pool_size is not zero, the pool size is fixed.
This means max surfaces is init_pool_size, but when mapping vaapi
frame to qsv frame, the init_pool_size < nb_surface. The cause is that
vaapi_decode_make_config() config the init_pool_size and it is called
twice. The first time is to init frame_context and the second time is to
init codec. On the second time the init_pool_size is changed to original
value so the init_pool_size is lower than the reall size because
pool_size used to initialize frame_context need to plus thread_count and
3 (guarantee 4 base work surfaces). Now add code to make sure
init_pool_size is only set once. Now the following commandline works:

ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 \
-hwaccel_output_format vaapi -i input.264 \
-vf "hwmap=derive_device=qsv,format=qsv" \
-c:v h264_qsv output.264

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2022-01-29 12:02:52 +08:00
Lynne
35080149ef
x86/tx_float: mark AVX2 functions as AVXSLOW
Makes Bulldozer prefer AVX functions rather than AVX2,
which are 64% slower:

AVX:  117653 decicycles in av_tx (fft), 1048535 runs,     41 skips
AVX2: 193385 decicycles in av_tx (fft), 1048561 runs,     15 skips

The only difference between both is that vgatherdpd is used in
the former. We don't want to mark them with the new SLOW_GATHER
flag however, since gathers are still faster on Haswell/Zen 2/3
than plain loads.
2022-01-29 03:08:16 +01:00
Lynne
7e35e0224c
lavu/tx: do not unconditionally free subcontexts if initialization fails
If a codelet initializes 2 subtransforms, and the second one fails,
the failure would free all subcontexts.
Instead, if there are subcontexts still left, don't free the array.
If all initializations fail, the init() function will return,
and reset_ctx() from the previous step will clean up all contained
subtransforms.
2022-01-29 01:02:37 +01:00
Lynne
265731f201
lavu/tx: reset subcontext pointer if initialization fails
Thanks to mkver for pointing this out.
2022-01-29 00:53:35 +01:00
Lynne
95f02e43e1
lavu/tx: print debug info even if no transforms are found 2022-01-28 08:28:02 +01:00
Steven Liu
9887ec3e9b avutil/tx: add null pointer check after av_mallocz
Fix CID: 1497863
there will get null pointer in attempt to initialize each if alloc memory failed.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2022-01-28 08:27:48 +01:00
Steven Liu
f0044d886f avutil/tx: remove deadcode of the control flow
Fix CID: 1497864
The control flow should return ENOSYS if nb_cd_matches is 0 at before
and the ret equal AVERROR(ENOMEM) or goto end label, so remove the last
control flow if (ret >= 0) before end label.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2022-01-28 08:27:46 +01:00
Lynne
3c831847a8
hwcontext_vulkan: avoid using 64-bit enums
MSVC (2016, but possibly more) still force enums to be basic ints.
2022-01-27 10:27:09 +01:00
Lynne
238e11b71f
lavu/tx: avoid using 64-bit enums
MSVC (2016, but possibly more) still force enums to be basic ints.
2022-01-27 10:21:25 +01:00
Zhao Zhili
2b15acb96a configure: add libplacebo to help message 2022-01-27 10:05:27 +01:00
Wenbin Chen
e102fd98d6 libavcodec/qsvenc: Add intra refresh to hevc_qsv and add new intra refresh parameter
Add intra refresh support to hevc_qsv as well.
Add an new intra refresh type: "horizontal", and an new param
ref_cycle_dist. This param specify the distance between the
beginnings of the intra-refresh cycles in frames.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-27 10:26:39 +08:00
Wenbin Chen
2ecc4fde5f libavcodec/qsvenc: Add b_strategy option to hevc_qsv
Add b_strategy option to hevc_qsv. By enabling this option, encoder can
use b frames as reference.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-27 10:26:33 +08:00
Wenbin Chen
168c6e23a5 libavcodec/qsvenc: Add max slice size support to hevc_qsv
Add max_slice_size option to hevc_qsv as well.

Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2022-01-27 10:26:26 +08:00
Andreas Rheinhardt
5e9ac1ebec avcodec/h264data: Add missing rational.h inclusion
Fixes checkheaders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-01-27 02:45:19 +01:00
Lynne
6c397f6bb5
x86/tx_float: add missing FF_TX_OUT_OF_PLACE flag to functions
This caused smaller length dedicated transforms to not be picked up.
2022-01-27 02:18:35 +01:00