Skip to content

Commit 48a7b6b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 1e9df42 + 989febf commit 48a7b6b

File tree

720 files changed

+15456
-8644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

720 files changed

+15456
-8644
lines changed

Changelog

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ version <next>:
99
- Argonaut Games CVG muxer
1010
- Concatf protocol
1111
- afwtdn audio filter
12+
- audio and video segment filters
13+
- Apple Graphics (SMC) encoder
14+
- hsvkey and hsvhold video filters
15+
- adecorrelate audio filter
16+
- atilt audio filter
17+
- grayworld video filter
18+
- AV1 Low overhead bitstream format muxer
19+
- swscale slice threading
20+
- MSN Siren decoder
21+
- scharr video filter
22+
- apsyclip audio filter
1223

1324

1425
version 4.4:

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o $(FF_DEP_LIBS)
6464

6565
tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS)
6666
tools/enum_options$(EXESUF): $(FF_DEP_LIBS)
67+
tools/scale_slice_test$(EXESUF): $(FF_DEP_LIBS)
68+
tools/scale_slice_test$(EXESUF): ELIBS = $(FF_EXTRALIBS)
6769
tools/sofa2wavs$(EXESUF): ELIBS = $(FF_EXTRALIBS)
6870
tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS)
6971
tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS)

compat/cuda/cuda_runtime.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,5 +184,6 @@ static inline __device__ double fabs(double a) { return __builtin_fabs(a); }
184184

185185
static inline __device__ float __sinf(float a) { return __nvvm_sin_approx_f(a); }
186186
static inline __device__ float __cosf(float a) { return __nvvm_cos_approx_f(a); }
187+
static inline __device__ float __expf(float a) { return __nvvm_ex2_approx_f(a * (float)__builtin_log2(__builtin_exp(1))); }
187188

188189
#endif /* COMPAT_CUDA_CUDA_RUNTIME_H */

configure

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3388,6 +3388,7 @@ mxf_opatom_muxer_select="mxf_muxer"
33883388
nut_muxer_select="riffenc"
33893389
nuv_demuxer_select="riffdec"
33903390
obu_demuxer_select="av1_frame_merge_bsf av1_parser"
3391+
obu_muxer_select="av1_metadata_bsf"
33913392
oga_muxer_select="ogg_muxer"
33923393
ogg_demuxer_select="dirac_parse"
33933394
ogv_muxer_select="ogg_muxer"
@@ -3547,7 +3548,6 @@ afir_filter_select="rdft"
35473548
ametadata_filter_deps="avformat"
35483549
amovie_filter_deps="avcodec avformat"
35493550
aresample_filter_deps="swresample"
3550-
asoftclip_filter_deps="swresample"
35513551
asr_filter_deps="pocketsphinx"
35523552
ass_filter_deps="libass"
35533553
atempo_filter_deps="avcodec"
@@ -3565,16 +3565,12 @@ chromaber_vulkan_filter_deps="vulkan_lib libglslang"
35653565
colorkey_opencl_filter_deps="opencl"
35663566
colormatrix_filter_deps="gpl"
35673567
convolution_opencl_filter_deps="opencl"
3568-
convolve_filter_deps="avcodec"
3569-
convolve_filter_select="fft"
35703568
coreimage_filter_deps="coreimage appkit"
35713569
coreimage_filter_extralibs="-framework OpenGL"
35723570
coreimagesrc_filter_deps="coreimage appkit"
35733571
coreimagesrc_filter_extralibs="-framework OpenGL"
35743572
cover_rect_filter_deps="avcodec avformat gpl"
35753573
cropdetect_filter_deps="gpl"
3576-
deconvolve_filter_deps="avcodec"
3577-
deconvolve_filter_select="fft"
35783574
deinterlace_qsv_filter_deps="libmfx"
35793575
deinterlace_vaapi_filter_deps="vaapi"
35803576
delogo_filter_deps="gpl"
@@ -5947,7 +5943,7 @@ elif enabled mips; then
59475943
enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-mloongson-ext' && append MMIFLAGS '-mloongson-ext'
59485944

59495945
# MMI can be detected at runtime too
5950-
enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi'
5946+
enabled mmi && check_inline_asm mmi '"pxor $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi'
59515947

59525948
if enabled bigendian && enabled msa; then
59535949
disable msa
@@ -6387,7 +6383,7 @@ enabled avisynth && require_headers "avisynth/avisynth_c.h"
63876383
enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; }
63886384
enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint
63896385
enabled decklink && { require_headers DeckLinkAPI.h &&
6390-
{ test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0a0000" || die "ERROR: Decklink API version must be >= 10.10"; } }
6386+
{ test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0000" || die "ERROR: Decklink API version must be >= 10.11"; } }
63916387
enabled frei0r && require_headers "frei0r.h dlfcn.h"
63926388
enabled gmp && require gmp gmp.h mpz_export -lgmp
63936389
enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
@@ -7258,8 +7254,6 @@ enabled aresample_filter && prepend avfilter_deps "swresample"
72587254
enabled atempo_filter && prepend avfilter_deps "avcodec"
72597255
enabled bm3d_filter && prepend avfilter_deps "avcodec"
72607256
enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
7261-
enabled convolve_filter && prepend avfilter_deps "avcodec"
7262-
enabled deconvolve_filter && prepend avfilter_deps "avcodec"
72637257
enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
72647258
enabled elbg_filter && prepend avfilter_deps "avcodec"
72657259
enabled fftfilt_filter && prepend avfilter_deps "avcodec"

doc/APIchanges

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,35 @@ libavutil: 2021-04-27
1414

1515
API changes, most recent first:
1616

17+
2021-09-08 - xxxxxxxxxx - lavu 57.5.100 - hwcontext_d3d11va.h
18+
Add AVD3D11VAFramesContext.texture_infos
19+
20+
2021-09-06 - xxxxxxxxxx - lsws 6.1.100 - swscale.h
21+
Add AVFrame-based scaling API:
22+
- sws_scale_frame()
23+
- sws_frame_start()
24+
- sws_frame_end()
25+
- sws_send_slice()
26+
- sws_receive_slice()
27+
- sws_receive_slice_alignment()
28+
29+
2021-09-02 - xxxxxxxxxx - lavc 59.7.100 - avcodec.h
30+
Incremented the number of elements of AVCodecParser.codec_ids to seven.
31+
32+
2021-08-24 - xxxxxxxxxx - lavc 59.6.100 - avcodec.h
33+
Add FF_CODEC_PROPERTY_FILM_GRAIN
34+
35+
2021-08-20 - xxxxxxxxxx - lavfi 8.3.100 - avfilter.H
36+
Add avfilter_filter_pad_count() as a replacement for avfilter_pad_count().
37+
Deprecate avfilter_pad_count().
38+
39+
2021-08-17 - xxxxxxxxxx - lavu 57.4.101 - opt.h
40+
av_opt_copy() now guarantees that allocated src and dst options
41+
don't alias each other even on error.
42+
43+
2021-08-14 - xxxxxxxxxx - lavu 57.4.100 - imgutils.h
44+
Add av_image_copy_plane_uc_from()
45+
1746
2021-08-02 - xxxxxxxxxx - lavc 59.4.100 - packet.h
1847
Add AVPacket.opaque, AVPacket.opaque_ref, AVPacket.time_base.
1948

doc/demuxers.texi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ backslash or single quotes.
9696
All subsequent file-related directives apply to that file.
9797

9898
@item @code{ffconcat version 1.0}
99-
Identify the script type and version. It also sets the @option{safe} option
100-
to 1 if it was -1.
99+
Identify the script type and version.
101100

102101
To make FFmpeg recognize the format automatically, this directive must
103102
appear exactly as is (no extra space or byte-order-mark) on the very first
@@ -152,6 +151,10 @@ Metadata of the packets of the file. The specified metadata will be set for
152151
each file packet. You can specify this directive multiple times to add multiple
153152
metadata entries.
154153

154+
@item @code{option @var{key} @var{value}}
155+
Option to access, open and probe the file.
156+
Can be present multiple times.
157+
155158
@item @code{stream}
156159
Introduce a stream in the virtual file.
157160
All subsequent stream-related directives apply to the last introduced
@@ -177,7 +180,8 @@ This demuxer accepts the following option:
177180
@table @option
178181

179182
@item safe
180-
If set to 1, reject unsafe file paths. A file path is considered safe if it
183+
If set to 1, reject unsafe file paths and directives.
184+
A file path is considered safe if it
181185
does not contain a protocol specification and is relative and all components
182186
only contain characters from the portable character set (letters, digits,
183187
period, underscore and hyphen) and have no period at the beginning of a
@@ -187,9 +191,6 @@ If set to 0, any file name is accepted.
187191

188192
The default is 1.
189193

190-
-1 is equivalent to 1 if the format was automatically
191-
probed and 0 otherwise.
192-
193194
@item auto_convert
194195
If set to 1, try to perform automatic conversions on packet data to make the
195196
streams concatenable.

doc/examples/encode_video.c

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,25 @@ int main(int argc, char **argv)
155155
for (i = 0; i < 25; i++) {
156156
fflush(stdout);
157157

158-
/* make sure the frame data is writable */
158+
/* Make sure the frame data is writable.
159+
On the first round, the frame is fresh from av_frame_get_buffer()
160+
and therefore we know it is writable.
161+
But on the next rounds, encode() will have called
162+
avcodec_send_frame(), and the codec may have kept a reference to
163+
the frame in its internal structures, that makes the frame
164+
unwritable.
165+
av_frame_make_writable() checks that and allocates a new buffer
166+
for the frame only if necessary.
167+
*/
159168
ret = av_frame_make_writable(frame);
160169
if (ret < 0)
161170
exit(1);
162171

163-
/* prepare a dummy image */
172+
/* Prepare a dummy image.
173+
In real code, this is where you would have your own logic for
174+
filling the frame. FFmpeg does not care what you put in the
175+
frame.
176+
*/
164177
/* Y */
165178
for (y = 0; y < c->height; y++) {
166179
for (x = 0; x < c->width; x++) {
@@ -185,7 +198,12 @@ int main(int argc, char **argv)
185198
/* flush the encoder */
186199
encode(c, NULL, pkt, f);
187200

188-
/* add sequence end code to have a real MPEG file */
201+
/* Add sequence end code to have a real MPEG file.
202+
It makes only sense because this tiny examples writes packets
203+
directly. This is called "elementary stream" and only works for some
204+
codecs. To create a valid file, you usually need to write packets
205+
into a proper file format or protocol; see muxing.c.
206+
*/
189207
if (codec->id == AV_CODEC_ID_MPEG1VIDEO || codec->id == AV_CODEC_ID_MPEG2VIDEO)
190208
fwrite(endcode, 1, sizeof(endcode), f);
191209
fclose(f);

doc/examples/qsvdec.c

Lines changed: 9 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,10 @@
4444
#include "libavutil/hwcontext_qsv.h"
4545
#include "libavutil/mem.h"
4646

47-
typedef struct DecodeContext {
48-
AVBufferRef *hw_device_ref;
49-
} DecodeContext;
50-
5147
static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts)
5248
{
5349
while (*pix_fmts != AV_PIX_FMT_NONE) {
5450
if (*pix_fmts == AV_PIX_FMT_QSV) {
55-
DecodeContext *decode = avctx->opaque;
56-
AVHWFramesContext *frames_ctx;
57-
AVQSVFramesContext *frames_hwctx;
58-
int ret;
59-
60-
/* create a pool of surfaces to be used by the decoder */
61-
avctx->hw_frames_ctx = av_hwframe_ctx_alloc(decode->hw_device_ref);
62-
if (!avctx->hw_frames_ctx)
63-
return AV_PIX_FMT_NONE;
64-
frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
65-
frames_hwctx = frames_ctx->hwctx;
66-
67-
frames_ctx->format = AV_PIX_FMT_QSV;
68-
frames_ctx->sw_format = avctx->sw_pix_fmt;
69-
frames_ctx->width = FFALIGN(avctx->coded_width, 32);
70-
frames_ctx->height = FFALIGN(avctx->coded_height, 32);
71-
frames_ctx->initial_pool_size = 32;
72-
73-
frames_hwctx->frame_type = MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET;
74-
75-
ret = av_hwframe_ctx_init(avctx->hw_frames_ctx);
76-
if (ret < 0)
77-
return AV_PIX_FMT_NONE;
78-
7951
return AV_PIX_FMT_QSV;
8052
}
8153

@@ -87,7 +59,7 @@ static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts)
8759
return AV_PIX_FMT_NONE;
8860
}
8961

90-
static int decode_packet(DecodeContext *decode, AVCodecContext *decoder_ctx,
62+
static int decode_packet(AVCodecContext *decoder_ctx,
9163
AVFrame *frame, AVFrame *sw_frame,
9264
AVPacket *pkt, AVIOContext *output_ctx)
9365
{
@@ -144,12 +116,12 @@ int main(int argc, char **argv)
144116
AVPacket pkt = { 0 };
145117
AVFrame *frame = NULL, *sw_frame = NULL;
146118

147-
DecodeContext decode = { NULL };
148-
149119
AVIOContext *output_ctx = NULL;
150120

151121
int ret, i;
152122

123+
AVBufferRef *device_ref = NULL;
124+
153125
if (argc < 3) {
154126
fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
155127
return 1;
@@ -177,7 +149,7 @@ int main(int argc, char **argv)
177149
}
178150

179151
/* open the hardware device */
180-
ret = av_hwdevice_ctx_create(&decode.hw_device_ref, AV_HWDEVICE_TYPE_QSV,
152+
ret = av_hwdevice_ctx_create(&device_ref, AV_HWDEVICE_TYPE_QSV,
181153
"auto", NULL, 0);
182154
if (ret < 0) {
183155
fprintf(stderr, "Cannot open the hardware device\n");
@@ -209,7 +181,8 @@ int main(int argc, char **argv)
209181
decoder_ctx->extradata_size = video_st->codecpar->extradata_size;
210182
}
211183

212-
decoder_ctx->opaque = &decode;
184+
185+
decoder_ctx->hw_device_ctx = av_buffer_ref(device_ref);
213186
decoder_ctx->get_format = get_format;
214187

215188
ret = avcodec_open2(decoder_ctx, NULL, NULL);
@@ -239,15 +212,15 @@ int main(int argc, char **argv)
239212
break;
240213

241214
if (pkt.stream_index == video_st->index)
242-
ret = decode_packet(&decode, decoder_ctx, frame, sw_frame, &pkt, output_ctx);
215+
ret = decode_packet(decoder_ctx, frame, sw_frame, &pkt, output_ctx);
243216

244217
av_packet_unref(&pkt);
245218
}
246219

247220
/* flush the decoder */
248221
pkt.data = NULL;
249222
pkt.size = 0;
250-
ret = decode_packet(&decode, decoder_ctx, frame, sw_frame, &pkt, output_ctx);
223+
ret = decode_packet(decoder_ctx, frame, sw_frame, &pkt, output_ctx);
251224

252225
finish:
253226
if (ret < 0) {
@@ -263,7 +236,7 @@ int main(int argc, char **argv)
263236

264237
avcodec_free_context(&decoder_ctx);
265238

266-
av_buffer_unref(&decode.hw_device_ref);
239+
av_buffer_unref(&device_ref);
267240

268241
avio_close(output_ctx);
269242

doc/ffmpeg.texi

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,9 @@ device type:
11041104
@item dxva2
11051105
@var{device} is the number of the Direct3D 9 display adapter.
11061106

1107+
@item d3d11va
1108+
@var{device} is the number of the Direct3D 11 display adapter.
1109+
11071110
@item vaapi
11081111
@var{device} is either an X11 display name or a DRM render node.
11091112
If not specified, it will attempt to open the default X11 display (@emph{$DISPLAY})
@@ -1127,9 +1130,21 @@ If not specified, it will attempt to open the default X11 display (@emph{$DISPLA
11271130
@end table
11281131
If not specified, @samp{auto_any} is used.
11291132
(Note that it may be easier to achieve the desired result for QSV by creating the
1130-
platform-appropriate subdevice (@samp{dxva2} or @samp{vaapi}) and then deriving a
1133+
platform-appropriate subdevice (@samp{dxva2} or @samp{d3d11va} or @samp{vaapi}) and then deriving a
11311134
QSV device from that.)
11321135

1136+
Alternatively, @samp{child_device_type} helps to choose platform-appropriate subdevice type.
1137+
On Windows @samp{d3d11va} is used as default subdevice type.
1138+
1139+
Examples:
1140+
@table @emph
1141+
@item -init_hw_device qsv:hw,child_device_type=d3d11va
1142+
Choose the GPU subdevice with type @samp{d3d11va} and create QSV device with @samp{MFX_IMPL_HARDWARE}.
1143+
1144+
@item -init_hw_device qsv:hw,child_device_type=dxva2
1145+
Choose the GPU subdevice with type @samp{dxva2} and create QSV device with @samp{MFX_IMPL_HARDWARE}.
1146+
@end table
1147+
11331148
@item opencl
11341149
@var{device} selects the platform and device as @emph{platform_index.device_index}.
11351150

@@ -1232,6 +1247,9 @@ Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
12321247
@item dxva2
12331248
Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
12341249

1250+
@item d3d11va
1251+
Use D3D11VA (DirectX Video Acceleration) hardware acceleration.
1252+
12351253
@item vaapi
12361254
Use VAAPI (Video Acceleration API) hardware acceleration.
12371255

doc/ffprobe.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@
223223
<xsd:attribute name="coded_width" type="xsd:int"/>
224224
<xsd:attribute name="coded_height" type="xsd:int"/>
225225
<xsd:attribute name="closed_captions" type="xsd:boolean"/>
226+
<xsd:attribute name="film_grain" type="xsd:boolean"/>
226227
<xsd:attribute name="has_b_frames" type="xsd:int"/>
227228
<xsd:attribute name="sample_aspect_ratio" type="xsd:string"/>
228229
<xsd:attribute name="display_aspect_ratio" type="xsd:string"/>

0 commit comments

Comments
 (0)