Commit Graph

103683 Commits

Author SHA1 Message Date
Adam Chelminski 715f63232f avcodec/libvpxenc: Apply codec options to alpha codec context
When encoding yuva420 (alpha) frames, the vpx encoder uses a second
vpx_codec_ctx to encode the alpha stream. However, codec options were
only being applied to the primary encoder. This patch updates
codecctl_int and codecctl_intp to also apply codec options to the alpha
codec context when encoding frames with alpha.

This is necessary to take advantage of libvpx speed optimizations
such as 'row-mt' and 'cpu-used' when encoding videos with alpha.
Without this patch, the speed optimizations are only applied to the
primary stream encoding, and the overall encoding is just as slow
as it would be without the options specified.

Signed-off-by: Adam Chelminski <chelminski.adam@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2021-09-08 18:48:00 -07:00
Andreas Rheinhardt 3008a93b4d avformat/rtpdec: Make ff_rtp_handler_iterate() static
Possible since 6197453761.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt cd3d7b0f8f avformat/rawdec: Make ff_raw_data_read_header() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt 49916dafb9 avformat/mov_chan: Make ff_mov_get_channel_layout() static
Possible since 3bab7cd128.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt 41751e4aef avcodec/iirfilter: Make ff_iir_filter_flt() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt 854f7bab5a avcodec/snow_dwt: Make ff_snow_(horizont|vertic)al_compose97i static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt faa62773cb avcodec/jpeg2000: Make ff_tag_tree_size() static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt fc9cb7d51a avcodec/mqcenc: Make ff_mqc_flush() static
Only used as an auxiliary function for ff_mqc_flush_to() since
4624656797.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt 25394eb72e avcodec/qsv: Make ff_qsv_map_error() static
It is only an auxiliary function to ff_qsv_print_(error|warning)().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt 029bfc3501 avcodec/h263dec: Make ff_h263_hw_config_list static
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt fd43b868e1 avcodec/cbs: Make ff_cbs_alloc_unit_data() static
Forgotten in 7c92eaace2.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Andreas Rheinhardt 97bc4695fb avcodec/bsf: ff_list_bsf static
It is a special BSF that is only available via the av_bsf_list-API;
it is not part of the list generated from the declarations in
bitstream_filters.c and therefore needn't have external linkage.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-09-08 22:59:14 +02:00
Paul B Mahol 7b523a06d0 avformat/dhav: use frame number if timestamp difference is zero 2021-09-08 22:54:55 +02:00
Artem Galin 19a17388d8 libavfilter/vf_deinterlace_qsv: enabling d3d11va support, added mfxhdlpair
Adding DX11 relevant device type checks and adjusting callback with
proper MediaSDK pair type support.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:48:32 -03:00
Artem Galin c1cebaa4c4 libavfilter/vf_scale_qsv: add MFX_MEMTYPE_FROM_VPPOUT flag to frame_type
In case of DX11 device type, Media SDK is sensitive to these flags.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:48:32 -03:00
Artem Galin 46c6946eee libavfilter/vf_scale_qsv: enabling d3d11va support, added mfxhdlpair
Adding DX11 relevant device type checks and adjusting callback with
proper MediaSDK pair type support.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:48:32 -03:00
Artem Galin 36166cc304 libavfilter/qsvvpp: add MFX_MEMTYPE_FROM_VPPOUT flag to output frames
In case of DX11 device type, Media SDK is sensitive to these flags.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:48:32 -03:00
Artem Galin a611c35001 libavfilter/qsvvpp: enabling d3d11va support, added mfxhdlpair
Adding DX11 relevant device type checks and adjusting callback with
proper MediaSDK pair type support.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:48:32 -03:00
Artem Galin 4f78711f9c libavutil/hwcontext_d3d11va: adding more texture information to the D3D11 hwcontext API
Microsoft VideoProcessor requires texture with D3DUSAGE_RENDERTARGET flag as output.
There is no way to allocate array of textures with D3D11_BIND_RENDER_TARGET flag
and .ArraySize > 2 by ID3D11Device_CreateTexture2D due to the Microsoft limitation.
Adding AVD3D11FrameDescriptors array to store array of single textures
instead of texture with multiple slices resolves this.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:48:02 -03:00
Artem Galin f1cd1dc6ce libavutil/hwcontext_qsv: add usage child_device_type argument to explicitly select d3d11va/DX11 device type
UPD: Rebase of last patch set over current master and use DX9 as default device type.

Makes selection of dxva2/DX9 device type by default as before with explicit d3d11va/DX11 usage to cover more HW configurations.
Added warning message to expect changing default device type in the future.

Fixes TGL / AV1 decode as requires DX11 with explicit DX11 type
selection.

Add headless/multi adapter support and fixes:
    https://trac.ffmpeg.org/ticket/7511
    https://trac.ffmpeg.org/ticket/6827
    http://ffmpeg.org/pipermail/ffmpeg-trac/2017-November/041901.html
    https://trac.ffmpeg.org/ticket/7933
    338fbcd5bb
    https://github.com/jellyfin/jellyfin/issues/2626#issuecomment-602153952

Any other fixes are welcome including OpenCL interop patch since I don't have proper setup to validate this use case

Decoding, encoding, transcoding have been validated.

child_device_type option is responsible for d3d11va/dxva2 device selection

Usage examples:

DirectX 11:
    -init_hw_device qsv:hw,child_device_type=d3d11va
    -init_hw_device qsv:hw,child_device_type=d3d11va,child_device=0
OR
    -init_hw_device d3d11va=dx -init_hw_device qsv@dx

DirectX 9 is still supported but requires explicit selection:
    -init_hw_device qsv:hw,child_device_type=dxva2
OR
    -init_hw_device dxva2=dx -init_hw_device qsv@dx

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:42:53 -03:00
Artem Galin a08a5299ac libavutil/hwcontext_qsv: supporting d3d11va device type
This enables usage of non-powered/headless GPU, better HDR support.
Pool of resources is allocated as one texture with array of slices.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:42:53 -03:00
Artem Galin 776d5a7472 libavcodec/qsv: enabling d3d11va support, added mfxhdlpair
Adding DX11 relevant device type checks and adjusting callbacks with
proper MediaSDK pair type support.

Extending structure for proper MediaSDK pair type support.

Signed-off-by: Artem Galin <artem.galin@intel.com>
2021-09-08 17:42:52 -03:00
Paul B Mahol 3df55c7bd6 avfilter/af_speechnorm: add timeline support 2021-09-08 22:13:26 +02:00
Paul B Mahol 5db1e07a62 avfilter/af_speechnorm: check return value of av_frame_make_writable() 2021-09-08 21:44:54 +02:00
Paul B Mahol ccd95cb248 avfilter/af_speechnorm: use floats in place of doubles where it is already float used 2021-09-08 21:44:54 +02:00
Michael Niedermayer 2d36d2fbd7 avcodec/h264_parser: Fix nalsize check
Fixes: Assertion failure
Fixes: 37463/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-4914693494931456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-09-08 20:14:00 +02:00
Paul B Mahol 38ab20e591 avfilter/af_silenceremove: fix stop_silence handling 2021-09-08 19:10:39 +02:00
Paul B Mahol 8a42ee6697 avfilter/af_silenceremove: avoid returning 1 sample duration frames 2021-09-08 19:10:39 +02:00
Paul B Mahol 3b331468da avfilter/af_silenceremove: fix processing of periods > 1 2021-09-08 19:10:39 +02:00
Paul B Mahol 5e7e2e5031 avfilter/af_silenceremove: guard against negative numbers 2021-09-08 10:45:53 +02:00
Paul B Mahol c3e11e3092 avfilter/af_silenceremove: add asserts to check for NaNs 2021-09-08 10:45:53 +02:00
Paul B Mahol 4e1ee16cbb avfilter/af_silenceremove: use duration option for window option 2021-09-07 19:44:25 +02:00
Paul B Mahol 15e844ed9d avfilter/af_silenceremove: fix indentation 2021-09-07 19:44:25 +02:00
Paul B Mahol 1d1e8a47b7 avfilter/af_silenceremove: cover default case too 2021-09-07 19:44:25 +02:00
Paul B Mahol 9e33572b3d avcodec/mlpenc: simplify some complicated expressions more 2021-09-07 18:16:13 +02:00
Paul B Mahol 1cbd4b00b1 avcodec/mlpenc: simplify strange pointer initializations 2021-09-07 18:16:13 +02:00
Paul B Mahol 7ebeef6aff avformat/mlpdec: fix time_base for packet timestamps 2021-09-07 18:16:13 +02:00
Paul B Mahol 5d92b73c64 avcodec/mlpdec: fix integer sanitizer warning under clang
Fixes:
libavcodec/mlpdec.c:1108:37: runtime error: negation of 1 cannot be represented in type 'unsigned int'
2021-09-07 18:16:13 +02:00
James Almer 5fe648d04a libswscale/swscale: initialize all dst plane pointers in sws_receive_slice()
Fixes valgrind warnings about use of uninitialised values.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-09-07 09:44:58 -03:00
Peter Ross c655a734b1 avcodec/siren: MSN Siren decoder
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Peter Ross <pross@xvid.org>
2021-09-07 18:07:11 +10:00
Paul B Mahol b9426f371a avcodec/mlpenc: remove convoluted incomplete multiple substreams support code
It is very hard to follow data structures indirections in current code,
so just remove it for now.
2021-09-07 00:18:33 +02:00
Paul B Mahol e811b0080e avcodec/mlpenc: use variables local to for loops 2021-09-07 00:18:33 +02:00
Limin Wang 75001ae844 avcodec/nvenc: add constrainedFrame encoding support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:25:26 +02:00
Limin Wang 3756525a59 avcodec/nvenc: add single slice intra refresh support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:13:00 +02:00
Limin Wang e6bd5171ac avcodec/nvenc: add intra refresh support
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 14:12:57 +02:00
Limin Wang 85489e0308 avcodec/nvenc: make number of slices per frame configurable
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
2021-09-06 13:33:53 +02:00
Anton Khirnov 60515a6d61 lavfi/vf_scale: pass the thread count to the scaler 2021-09-06 09:18:05 +02:00
Anton Khirnov d6fdc78e91 sws: implement slice threading 2021-09-06 09:17:53 +02:00
Anton Khirnov 22c6fbc847 lavfi/vf_scale: convert to the frame-based sws API 2021-09-06 09:17:06 +02:00
Anton Khirnov 42cd64c182 sws: add a new scaling API 2021-09-06 09:16:52 +02:00