diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 5a19b963..00000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -*.pnm -diff -text -tests/ref/fate/sub-scc eol=crlf diff --git a/.mailmap b/.mailmap new file mode 100644 index 00000000..ba072f38 --- /dev/null +++ b/.mailmap @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + +rcombs + + + diff --git a/Changelog b/Changelog index 9c992b5c..0b32c1e4 100644 --- a/Changelog +++ b/Changelog @@ -1,303 +1,268 @@ Entries are sorted chronologically from oldest to youngest within each release, releases are sorted from youngest to oldest. -version 4.2.2 -- cbs_mpeg2: Fix parsing the last unit -- cbs_mpeg2: Rearrange start code search -- cbs_mpeg2: Decompose Sequence End -- cbs_mpeg2: Fix parsing of picture and slice headers -- cbs: Remove useless initializations -- mpeg2_metadata, cbs_mpeg2: Fix handling of colour_description -- lavc/cbs_h2645_syntax_template: Fix memleak -- avcodec/cbs: Fix potential overflow -- avcodec/cbs: Factor out common code for writing units -- avcodec/ffwavesynth: Fix undefined overflow in wavesynth_synth_sample() -- avcodec/ffwavesynth: Fix undefined overflow in wavesynth_synth_sample() -- avcodec/cook: Use 3 stage VLC decoding for channel_coupling -- avcodec/wmalosslessdec: Fixes undefined overflow in dequantization in decode_subframe() -- avcodec/sonic: Check e in get_symbol() -- avcodec/twinvqdec: Correct overflow in block align check -- avcodec/vc1dec: Fix "return -1" cases -- avcodec/vc1dec: Free sprite_output_frame on error -- avcodec/atrac9dec: Clamp band_ext_data to max that can be read if skipped. -- avcodec/agm: Include block size in the MV check for flags == 3 -- avcodec/wmadec: Keep track of exponent initialization per channel -- avcodec/iff: Check that video_size is large enough for the read parameters -- avcodec/cbs_vp9: Check data_size -- avcodec/cbs_vp9: Check index_size -- avcodec/adpcm: Clip predictor for APC -- avcodec/targa: Check colors vs. available space -- avcodec/dstdec: Use get_ur_golomb_jpegls() -- avcodec/wmavoice: Check remaining input in parse_packet_header() -- avcodec/wmalosslessdec: Fix 2 overflows in mclms -- avcodec/wmaprodec: Fixes integer overflow with 32bit samples -- avcodec/adpcm: Fix invalid shift in xa_decode() -- avcodec/wmalosslessdec: Fix several integer issues -- avcodec/wmalosslessdec: Check that padding bits is not more than sample bits -- avcodec/iff: Skip overflowing runs in decode_delta_d() -- avcodec/pnm: Check that the header is not truncated -- avcodec/mp3_header_decompress_bsf: Check sample_rate_index -- avcodec/cbs_av1_syntax_template: Check num_y_points -- avformat/rmdec: Initialize and sanity check offset in ivr_read_header() -- avcodec/agm: Do not allow MVs out of the picture area as no edge is allocated -- avcodec/apedec: Fix 2 integer overflows -- avformat/id3v2: Fix double-free on error -- avcodec/wmaprodec: Set packet_loss when we error out on a sanity check -- avcodec/wmaprodec: Check offset -- avcodec/truemotion2: Fix 2 integer overflows in tm2_low_res_block() -- avcodec/wmaprodec: Check if the channel sum of all internal contexts match the external -- avcodec/atrac9dec: Check q_unit_cnt more completely before using it to access at9_tab_band_ext_group -- avcodec/fitsdec: Use lrint() -- avcodec/g729dec: Avoid using buf_size -- avcodec/g729dec: Factor block_size out -- avcodec/g729dec: require buf_size to be non 0 -- avcodec/alac: Fix integer overflow in lpc_prediction() with sign -- avcodec/wmaprodec: Fix buflen computation in save_bits() -- avcodec/vc1_block: Fix integer overflow in AC rescaling in vc1_decode_i_block_adv() -- avcodec/vmdaudio: Check chunk counts to avoid integer overflow -- avformat/mxfdec: Clear metadata_sets_count in mxf_read_close() -- avcodec/nuv: Use ff_set_dimensions() -- avformat/vividas: Error out on audio packets in the absence of audio streams -- avformat/vividas: Check and require 1 video stream -- avcodec/ffwavesynth: Fix integer overflow with pink_ts_cur/next -- avcodec/ralf: Fix integer overflows with the filter coefficient in decode_channel() -- avcodec/g729dec: Use 64bit and clip in scalar product -- avcodec/mxpegdec: Check for multiple SOF -- avcodec/nuv: Move comptype check up -- avcodec/wmavoice: Fix integer overflow in synth_frame() -- avcodec/rawdec: Check bits_per_coded_sample more pedantically for 16bit cases -- avutil/lfg: Correct index increment type to avoid undefined behavior -- avcodec/cngdec: Remove AV_CODEC_CAP_DELAY -- avcodec/iff: Move index use after check in decodeplane8() -- avcodec/atrac3: Check for huge block aligns -- avcodec/ralf: use multiply instead of shift to avoid undefined behavior in decode_block() -- avcodec/wmadec: Require previous exponents for reuse -- avcodec/vc1_block: Fix undefined behavior in ac prediction rescaling -- avcodec/qdm2: The smallest header seems to have 2 bytes so treat 1 as invalid -- avcodec/apedec: Fixes integer overflow of res+*data in do_apply_filter() -- avcodec/sonic: Fix integer overflow in predictor_calc_error() -- avformat/vividas: Add EOF check in val_1 loop in track_header() -- avcodec/atrac9dec: Check precision_fine/coarse -- avformat/mp3dec: Check that the frame fits within the probe buffer -- vcodec/agm: Alloc based on coded dimensions -- avcodec/wmaprodec: get frame during frame decode -- avcodec/interplayacm: Fix overflow of last unused value -- avcodec/adpcm: Fix undefined behavior with negative predictions in IMA OKI -- avcodec/cook: Move up and extend block_align check -- avcodec/sbcdec: Fix integer overflows in sbc_synthesize_four() -- avcodec/twinvq: Check block_align -- avcodec/cook: Enlarge gain table -- avcodec/cook: Check samples_per_channel earlier -- avcodec/atrac3plus: Check split point in fill mode 3 -- avcodec/wmavoice: Check sample_rate -- avcodec/xsubdec: fix overflow in alpha handling -- avcodec/iff: Check available space before entering loop in decode_long_vertical_delta2() / decode_long_vertical_delta() -- avcodec/apedec: Fix integer overflow in filter_3800() -- avutil/lfg: Document the AVLFG struct -- avcodec/ffv1dec: Use a different error message for the slice level CRC -- avcodec/apedec: Fix undefined integer overflow in long_filter_ehigh_3830() -- avcodec/dstdec: Check that AC probabilities are within range -- avcodec/dstdec: Check read_table() for failure -- avformat/vividas: Fix n_sb_blocks Check -- avcodec/snowenc: Set mb_num to avoid ratecontrol floating point divisions by 0.0 -- avcodec/snowenc: Fix 2 undefined shifts -- avformat/nutenc: Do not pass NULL to memcmp() in get_needed_flags() -- avcodec/aptx: Check the number of channels -- avcodec/aacdec_template: Check samplerate -- avcodec/truemotion2: Fix several integer overflows in tm2_low_res_block() -- avcodec/utils: Check block_align -- avcodec/wmalosslessdec: Fix some integer anomalies -- avcodec/adpcm: Fix invalid shifts in ADPCM DTK -- avcodec/apedec: Only clear the needed buffer space, instead of all -- avcodec/libvorbisdec: Fix insufficient input checks leading to out of array reads -- avcodec/g723_1dec: fix invalid shift with negative sid_gain -- avcodec/vp5: Check render_x/y -- avcodec/hcom: Check the root entry and the right entries -- avcodec/qdrw: Check input for header/skiped space before get_buffer() -- avcodec/ralf: Skip initializing unused filter variables -- avcodec/takdec: Fix overflow with large sample rates -- avcodec/atrac9dec: Set channels -- avcodec/alsdec: Check that input space for header exists in read_diff_float_data() -- avformat/pjsdec: Check duration for overflow -- avcodec/agm: Check for reference frame earlier -- avcodec/ptx: Check that the input contains at least one line -- avcodec/alac: Fix integer overflow in LPC -- avcodec/smacker: Fix integer overflows in pred[] in smka_decode_frame() -- avcodec/aliaspixdec: Check input size against minimal picture size -- avcodec/ffwavesynth: Fix integer overflows in pink noise addition -- avcodec/vc1_block: Fixes integer overflow in vc1_decode_i_block_adv() -- avcodec/wmalosslessdec: Check block_align -- avcodec/g729dec: Avoid computing invalid temporary pointers for ff_acelp_weighted_vector_sum() -- avcodec/g729postfilter: Fix left shift of negative value -- avcodec/binkaudio: Check sample rate -- avcodec/sbcdec: Fix integer overflows in sbc_synthesize_eight() -- avcodec/adpcm: Check initial predictor for ADPCM_IMA_EA_EACS -- avcodec/g723_1dec: Fix overflow in shift -- avcodec/apedec: Fix integer overflow in predictor_update_3930() -- avcodec/g729postfilter: Fix undefined intermediate pointers -- avcodec/g729postfilter: Fix undefined shifts -- avcodec/lsp: Fix undefined shifts in lsp2poly() -- avcodec/adpcm: Fix left shifts in AV_CODEC_ID_ADPCM_EA -- avformat/shortendec: Check k in probe -- avfilter/vf_geq: Use av_clipd() instead of av_clipf() -- avcodec/wmaprodec: Check that the streams channels do not exceed the overall channels -- avcodec/qdmc: Check input space in qdmc_get_vlc() -- avcodec/wmaprodec: Fix cleanup on error -- avcodec/pcm: Check bits_per_coded_sample -- avcodec/exr: Allow duplicate use of channel indexes -- avcodec/fitsdec: Fail on 0 naxisn -- avcodec/dxv: Subtract 12 earlier in dxv_decompress_cocg() -- libavcodec/dxv: Remove redundant seek -- avcodec/ituh263dec: Check input for minimal frame size -- avcodec/truemotion1: Check that the input has enough space for a minimal index_stream -- avformat/mpsubdec: Clear queue on error -- avcodec/sunrast: Check that the input is large enough for the maximally compressed image -- avcodec/sunrast: Check for availability of maplength before allocating image -- avformat/subtitles: Check nb_subs in ff_subtitles_queue_finalize() -- avcodec/vc1_block: Fix invalid left shift in vc1_decode_p_mb() -- avcodec/wmaprodec: Check if there is a stream -- avcodec/g2meet: Check for end of input in jpg_decode_block() -- avcodec/g2meet: Check if adjusted pixel was on the stack -- avformat/electronicarts: If no packet has been read at the end do not treat it as if theres a packet -- avcodec/dxv: Check op_offset in dxv_decompress_yo() -- avcodec/utils: Check sample_rate before opening the decoder -- avcodec/aptx: Fix multiple shift anomalies -- avcodec/fitsdec: fix use of uninitialised values -- avcodec/motionpixels: Mark 2 functions as always_inline -- avcodec/ituh263dec: Make the condition for the studio slice start code match between ff_h263_resync() and ff_mpeg4_decode_studio_slice_header() -- avcodec/ralf: Fix integer overflow in decode_channel() -- vcodec/vc1: compute rangex/y only for P/B frames -- avcodec/vc1_pred: Fix invalid shifts in scaleforopp() -- avcodec/vc1_block: Fix invalid shift with rangeredfrm -- avcodec/vc1: Check for excessive resolution -- avcodec/vc1: check REFDIST -- avcodec/apedec: Fix several integer overflows in predictor_update_filter() and do_apply_filter() -- avcodec/hevc_cabac: Tighten the limit on k in ff_hevc_cu_qp_delta_abs() -- avcodec/4xm: Check index in decode_i_block() also in the path where its not used. -- avcodec/loco: Check for end of input in the first line -- avcodec/atrac3: Check block_align -- avcodec/alsdec: Avoid dereferencing context pointer in inner interleave loop -- avcodec/hcom: Check that there are dictionary entries -- avcodec/fitsdec: Prevent division by 0 with huge data_max -- avcodec/dstdec: Fix integer overflow in samples_per_frame computation -- avcodec/g729_parser: Check block_size -- avcodec/sbcdec: Initialize number of channels -- avcodec/utils: Optimize ff_color_frame() using memcpy() -- avcodec/aacdec: Check if we run out of input in read_stream_mux_config() -- avcodec/utils: Use av_memcpy_backptr() in ff_color_frame() -- avcodec/smacker: Fix integer overflow in signed int multiply in SMK_BLK_FILL -- avcodec/alac: Fix invalid shifts in 20/24 bps -- avcodec/alac: fix undefined behavior with INT_MIN in lpc_prediction() -- avcodec/ffwavesynth: Fix integer overflow in timestamps -- avformat/vividas: Test size and packet numbers a bit more -- avformat/vividas: Check n_sb_blocks against input space -- avcodec/dxv: Check op_offset in both directions -- avcodec/adpcm: Check number of channels for MTAF -- avcodec/sunrast: Fix indention -- avcodec/sunrast: Fix return type for "unsupported (compression) type" -- avcodec/utils: Check channels fully earlier -- avformat/mov: Check for EOF in mov_read_meta() -- avcodec/hevcdec: Fix memleak of a53_caption -- avformat/vividas: Remove align offset which is always masked off -- avformat/vividas: remove dead assignment -- avformat/cdxl: Fix integer overflow in intermediate -- avcodec/hevcdec: repeat character in skiped -- repeat an even number of characters in occured -- avcodec/gdv: Replace assert() checking bitstream by if() -- libavcodec/utils: Free threads on init failure -- avcodec/htmlsubtitles: Avoid locale dependant isdigit() -- avcodec/alsdec: Check k from being outside what our implementation can handle -- avcodec/takdec: Fix integer overflow in decorrelate() -- avcodec/aacps: Fix integer overflows in hybrid_synthesis() -- avcodec/mpeg4videodec: Fix integer overflow in mpeg4_decode_studio_block() -- avcodec/vp56rac: delay signaling an error on truncated input -- avcodec/pnm_parser: Use memchr() in pnm_parse() -- tests: Fix bash errors in lavf_container tests. -- avformat/matroskadec: Fix use-after-free when demuxing ProRes -- avformat/matroskadec: Fix demuxing ProRes -- avcodec/cbs_av1: fix array size for ar_coeffs_cb_plus_128 and ar_coeffs_cr_plus_128 -- avcodec/cbs_av1: avoid reading trailing bits when obu type is OBU_TILE_LIST -- lavc/cbs_h2645: Fix incorrect max size of nalu unit -- avcodec/extract_extradata_bsf: Don't unref uninitialized buffers -- avformat/av1: Fix leak of dynamic buffer in case of parsing failure -- libavformat/rtsp: return error if rtsp_hd_out is null instead of crash -- cbs_h264: Fix missing inferred colour description fields -- avcodec/cbs_av1: keep separate reference frame state for reading and writing -- avcodec/cbs_av1: fix reading reference order hint in skip_mode_params() -- avcodec/amfnec: allocate packets using av_new_packet() -- avcodec/nvenc: make sure newly allocated packets are refcounted -- lavc/mpeg4audio: add chan_config check to avoid indeterminate channels -- aformat/movenc: add missing padding to output track extradata -- avcodec/nvenc: add driver version info for SDK 9.1 -- avcodec/bsf: check that AVBSFInternal was allocated before dereferencing it +version 5.1.1: +- avformat/asfdec_o: limit recursion depth in asf_read_unknown() +- avformat/mov: Check count sums in build_open_gop_key_points() +- doc/git-howto.texi: Document commit signing +- libavcodec/8bps: Check that line lengths fit within the buffer +- avcodec/midivid: Perform lzss_uncompress() before ff_reget_buffer() +- libavformat/iff: Check for overflow in body_end calculation +- avformat/avidec: Prevent entity expansion attacks +- avcodec/h263dec: Sanity check against minimal I/P frame size +- avcodec/hevcdec: Check s->ref in the md5 path similar to hwaccel +- avcodec/mpegaudiodec_template: use unsigned shift in handle_crc() +- avformat/subviewerdec: Make read_ts() more flexible +- avcodec/mjpegdec: bayer and rct are incompatible +- MAINTAINERS: Add ED25519 key for signing my commits in the future +- avcodec/pngdec: Fix APNG_DISPOSE_OP_BACKGROUND +- avcodec/libvpx: fix assembling vp9 packets with alpha channel +- fftools/ffmpeg_opt: try to propagate the requested output channel layout +- avcodec/libsvtav1: properly initialize the flush EbBufferHeaderType struct +- configure: enable the av1_frame_split bsf for the av1 decoder +- swresample/swresample: fill the correct buffer to print the output layout string +- ffprobe: restore reporting error code for failed inputs +- ipfsgateway: Remove default gateway +- avcodec/libspeexdec: Fix use of uninitialized value +- avformat/avisynth: use ch_layout.nb_channels for channel count +- fate/lavf-image: Disable file checksums for exr tests +- tests/fate-run: Allow to skip file checksums for lavf_image +- fate/imf: Rename IMF fate-target +- avcodec/alac: don't fail if channels aren't set during init() when extradata is valid +- configure: properly require libx264 if enabled + + +version 5.1: +- add ipfs/ipns protocol support +- dialogue enhance audio filter +- dropped obsolete XvMC hwaccel +- pcm-bluray encoder +- DFPWM audio encoder/decoder and raw muxer/demuxer +- SITI filter +- Vizrt Binary Image encoder/decoder +- avsynctest source filter +- feedback video filter +- pixelize video filter +- colormap video filter +- colorchart video source filter +- multiply video filter +- PGS subtitle frame merge bitstream filter +- blurdetect filter +- tiltshelf audio filter +- QOI image format support +- ffprobe -o option +- virtualbass audio filter +- VDPAU AV1 hwaccel +- PHM image format support +- remap_opencl filter +- added chromakey_cuda filter + + +version 5.0: +- ADPCM IMA Westwood encoder +- Westwood AUD muxer +- ADPCM IMA Acorn Replay decoder +- Argonaut Games CVG demuxer +- Argonaut Games CVG muxer +- Concatf protocol +- afwtdn audio filter +- audio and video segment filters +- Apple Graphics (SMC) encoder +- hsvkey and hsvhold video filters +- adecorrelate audio filter +- atilt audio filter +- grayworld video filter +- AV1 Low overhead bitstream format muxer +- swscale slice threading +- MSN Siren decoder +- scharr video filter +- apsyclip audio filter +- morpho video filter +- amr parser +- (a)latency filters +- GEM Raster image decoder +- asdr audio filter +- speex decoder +- limitdiff video filter +- xcorrelate video filter +- varblur video filter +- huesaturation video filter +- colorspectrum source video filter +- RTP packetizer for uncompressed video (RFC 4175) +- bitpacked encoder +- VideoToolbox VP9 hwaccel +- VideoToolbox ProRes hwaccel +- support loongarch. +- aspectralstats audio filter +- adynamicsmooth audio filter +- libplacebo filter +- vflip_vulkan, hflip_vulkan and flip_vulkan filters +- adynamicequalizer audio filter +- yadif_videotoolbox filter +- VideoToolbox ProRes encoder +- anlmf audio filter +- IMF demuxer (experimental) + + +version 4.4: +- AudioToolbox output device +- MacCaption demuxer +- PGX decoder +- chromanr video filter +- VDPAU accelerated HEVC 10/12bit decoding +- ADPCM IMA Ubisoft APM encoder +- Rayman 2 APM muxer +- AV1 encoding support SVT-AV1 +- Cineform HD encoder +- ADPCM Argonaut Games encoder +- Argonaut Games ASF muxer +- AV1 Low overhead bitstream format demuxer +- RPZA video encoder +- ADPCM IMA MOFLEX decoder +- MobiClip FastAudio decoder +- MobiClip video decoder +- MOFLEX demuxer +- MODS demuxer +- PhotoCD decoder +- MCA demuxer +- AV1 decoder (Hardware acceleration used only) +- SVS demuxer +- Argonaut Games BRP demuxer +- DAT demuxer +- aax demuxer +- IPU decoder, parser and demuxer +- Intel QSV-accelerated AV1 decoding +- Argonaut Games Video decoder +- libwavpack encoder removed +- ACE demuxer +- AVS3 demuxer +- AVS3 video decoder via libuavs3d +- Cintel RAW decoder +- VDPAU accelerated VP9 10/12bit decoding +- afreqshift and aphaseshift filters +- High Voltage Software ADPCM encoder +- LEGO Racers ALP (.tun & .pcm) muxer +- AV1 VAAPI decoder +- adenorm filter +- ADPCM IMA AMV encoder +- AMV muxer +- NVDEC AV1 hwaccel +- DXVA2/D3D11VA hardware accelerated AV1 decoding +- speechnorm filter +- SpeedHQ encoder +- asupercut filter +- asubcut filter +- Microsoft Paint (MSP) version 2 decoder +- Microsoft Paint (MSP) demuxer +- AV1 monochrome encoding support via libaom >= 2.0.1 +- asuperpass and asuperstop filter +- shufflepixels filter +- tmidequalizer filter +- estdif filter +- epx filter +- Dolby E parser +- shear filter +- kirsch filter +- colortemperature filter +- colorcontrast filter +- PFM encoder +- colorcorrect filter +- binka demuxer +- XBM parser +- xbm_pipe demuxer +- colorize filter +- CRI parser +- aexciter audio filter +- exposure video filter +- monochrome video filter +- setts bitstream filter +- vif video filter +- OpenEXR image encoder +- Simbiosis IMX decoder +- Simbiosis IMX demuxer +- Digital Pictures SGA demuxer and decoders +- TTML subtitle encoder and muxer +- identity video filter +- msad video filter +- gophers protocol +- RIST protocol via librist + + +version 4.3: +- v360 filter +- Intel QSV-accelerated MJPEG decoding +- Intel QSV-accelerated VP9 decoding +- Support for TrueHD in mp4 +- Support AMD AMF encoder on Linux (via Vulkan) +- IMM5 video decoder +- ZeroMQ protocol +- support Sipro ACELP.KELVIN decoding +- streamhash muxer +- sierpinski video source +- scroll video filter +- photosensitivity filter +- anlms filter +- arnndn filter +- bilateral filter +- maskedmin and maskedmax filters +- VDPAU VP9 hwaccel +- median filter +- QSV-accelerated VP9 encoding +- AV1 encoding support via librav1e +- AV1 frame merge bitstream filter +- AV1 Annex B demuxer +- axcorrelate filter +- mvdv decoder +- mvha decoder +- MPEG-H 3D Audio support in mp4 +- thistogram filter +- freezeframes filter +- Argonaut Games ADPCM decoder +- Argonaut Games ASF demuxer +- xfade video filter +- xfade_opencl filter +- afirsrc audio filter source +- pad_opencl filter +- Simon & Schuster Interactive ADPCM decoder +- Real War KVAG demuxer +- CDToons video decoder +- siren audio decoder +- Rayman 2 ADPCM decoder +- Rayman 2 APM demuxer +- cas video filter +- High Voltage Software ADPCM decoder +- LEGO Racers ALP (.tun & .pcm) demuxer +- AMQP 0-9-1 protocol (RabbitMQ) +- Vulkan support +- avgblur_vulkan, overlay_vulkan, scale_vulkan and chromaber_vulkan filters +- ADPCM IMA MTF decoder +- FWSE demuxer +- DERF DPCM decoder +- DERF demuxer +- CRI HCA decoder +- CRI HCA demuxer +- overlay_cuda filter +- switch from AvxSynth to AviSynth+ on Linux +- mv30 decoder +- Expanded styling support for 3GPP Timed Text Subtitles (movtext) +- WebP parser +- tmedian filter +- maskedthreshold filter +- Support for muxing pcm and pgs in m2ts +- Cunning Developments ADPCM decoder +- asubboost filter +- Pro Pinball Series Soundbank demuxer +- pcm_rechunk bitstream filter +- scdet filter +- NotchLC decoder +- gradients source video filter +- MediaFoundation encoder wrapper +- untile filter +- Simon & Schuster Interactive ADPCM encoder +- PFM decoder +- dblur video filter +- Real War KVAG muxer -version 4.2.1: -- avformat/vividas: check for tiny blocks using alignment -- avcodec/vc1_pred: Fix refdist in scaleforopp() -- avcodec/vorbisdec: fix FASTDIV usage for vr_type == 2 -- avcodec/iff: Check for overlap in cmap_read_palette() -- avcodec/apedec: Fix 32bit int overflow in do_apply_filter() -- lavf/rawenc: Only accept the appropriate stream type for raw muxers. -- avformat/matroskadec: use av_fast_realloc to reallocate ebml list arrays -- avformat/matroskadec: use proper types for some EbmlSyntax fields -- avcodec/ralf: fix undefined shift in extend_code() -- avcodec/ralf: fix undefined shift -- avcodec/bgmc: Check input space in ff_bgmc_decode_init() -- avcodec/vp3: Check for end of input in 2 places of vp4_unpack_macroblocks() -- avcodec/truemotion2: Fix multiple integer overflows in tm2_null_res_block() -- avcodec/vc1_block: Check the return code from vc1_decode_p_block() -- avcodec/vc1dec: Require res_sprite for wmv3images -- avcodec/vc1_block: Check for double escapes -- avcodec/vorbisdec: Check get_vlc2() failure -- avcodec/tta: Fix integer overflow in prediction -- avcodec/vb: Check input packet size to be large enough to contain flags -- avcodec/cavsdec: Limit the number of access units per packet to 2 -- avcodec/atrac9dec: Check block_align -- avcodec/alac: Check for bps of 0 -- avcodec/alac: Fix multiple integer overflows in lpc_prediction() -- avcodec/rl2: set dimensions -- avcodec/aacdec: Add FF_CODEC_CAP_INIT_CLEANUP -- avcodec/idcinvideo: Add 320x240 default maximum resolution -- avformat/realtextdec: free queue on error -- avcodec/vp5/6/8: use vpX_rac_is_end() -- avformat/vividas: Check av_xiphlacing() return value before use -- avcodec/alsdec: Fix integer overflow in decode_var_block_data() -- avcodec/alsdec: Limit maximum channels to 512 -- avcodec/anm: Check input size for a frame with just a stop code -- avcodec/flicvideo: Optimize and Simplify FLI_COPY in flic_decode_frame_24BPP() by using bytestream2_get_buffer() -- avcodec/loco: Check left column value -- avcodec/ffwavesynth: Fixes invalid shift with pink noise seeking -- avcodec/ffwavesynth: Fix integer overflow for some corner case values -- avcodec/indeo2: Check remaining input more often -- avcodec/diracdec: Check that slices are fewer than pixels -- avcodec/vp56: Consider the alpha start as end of the prior header -- avcodec/4xm: Check for end of input in decode_p_block() -- avcodec/hevcdec: Check delta_luma_weight_l0/1 -- avcodec/hnm4video: Optimize postprocess_current_frame() -- avcodec/hevc_refs: Optimize 16bit generate_missing_ref() -- avcodec/scpr: Use av_memcpy_backptr() in type 17 and 33 -- avcodec/tiff: Enforce increasing offsets -- avcodec/dds: Use ff_set_dimensions() -- avformat/vividas: Fix another infinite loop -- avformat/vividas: Fix infinite loop in header parser -- avcodec/mpc8: Fix 32bit mask/enum -- avcodec/alsdec: Fix integer overflows of raw_samples in decode_var_block_data() -- avcodec/alsdec: Fix integer overflow of raw_samples in decode_blocks() -- avcodec/alsdec: fix mantisse shift -- avcodec/pngdec: consider chunk size in minimal size check -- avcodec/vc1_block: Fix invalid shifts in vc1_decode_i_blocks() -- avcodec/vc1_block: fix invalid shift in vc1_decode_p_mb() -- avcodec/aacdec_template: fix integer overflow in imdct_and_windowing() -- avformat/mpegts: Check if ready on SCTE reception -- avcodec/omx: fix xFramerate calculation -- avformat/avidec: add support for recognizing HEVC fourcc when demuxing -- avformat/mpegts: fix teletext PTS when selecting teletext streams only -- avcodec/h2645_parse: zero initialize the rbsp buffer -- avcodec/omx: Fix handling of fragmented buffers -- avcodec/omx: ensure zerocopy mode can be disabled on rpi builds -- avformat/mxfdec: do not ignore bad size errors -- avformat/matroskadec: Fix seeking -- ffplay: properly detect all window size changes version 4.2: - tpad filter diff --git a/LICENSE.md b/LICENSE.md index c7d6bf71..613070e1 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -21,10 +21,11 @@ Specifically, the GPL parts of FFmpeg are: - `compat/solaris/make_sunver.pl` - `doc/t2h.pm` - `doc/texi2pod.pl` - - `libswresample/swresample-test.c` + - `libswresample/tests/swresample.c` - `tests/checkasm/*` - `tests/tiny_ssim.c` - the following filters in libavfilter: + - `signature_lookup.c` - `vf_blackframe.c` - `vf_boxblur.c` - `vf_colormatrix.c` @@ -34,13 +35,13 @@ Specifically, the GPL parts of FFmpeg are: - `vf_eq.c` - `vf_find_rect.c` - `vf_fspp.c` - - `vf_geq.c` - `vf_histeq.c` - `vf_hqdn3d.c` - - `vf_interlace.c` - `vf_kerndeint.c` + - `vf_lensfun.c` (GPL version 3 or later) - `vf_mcdeint.c` - `vf_mpdecimate.c` + - `vf_nnedi.c` - `vf_owdenoise.c` - `vf_perspective.c` - `vf_phase.c` @@ -49,12 +50,14 @@ Specifically, the GPL parts of FFmpeg are: - `vf_pullup.c` - `vf_repeatfields.c` - `vf_sab.c` + - `vf_signature.c` - `vf_smartblur.c` - `vf_spp.c` - `vf_stereo3d.c` - `vf_super2xsai.c` - `vf_tinterlace.c` - `vf_uspp.c` + - `vf_vaguedenoiser.c` - `vsrc_mptestsrc.c` Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then @@ -80,24 +83,39 @@ affect the licensing of binaries resulting from the combination. ### Compatible libraries -The following libraries are under GPL: +The following libraries are under GPL version 2: +- avisynth - frei0r - libcdio +- libdavs2 - librubberband - libvidstab - libx264 - libx265 - libxavs +- libxavs2 - libxvid When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by passing `--enable-gpl` to configure. -The OpenCORE and VisualOn libraries are under the Apache License 2.0. That -license is incompatible with the LGPL v2.1 and the GPL v2, but not with +The following libraries are under LGPL version 3: +- gmp +- libaribb24 +- liblensfun + +When combining them with FFmpeg, use the configure option `--enable-version3` to +upgrade FFmpeg to the LGPL v3. + +The VMAF, mbedTLS, RK MPI, OpenCORE and VisualOn libraries are under the Apache License +2.0. That license is incompatible with the LGPL v2.1 and the GPL v2, but not with version 3 of those licenses. So to combine these libraries with FFmpeg, the license version needs to be upgraded by passing `--enable-version3` to configure. +The smbclient library is under the GPL v3, to combine it with FFmpeg, +the options `--enable-gpl` and `--enable-version3` have to be passed to +configure to upgrade FFmpeg to the GPL v3. + ### Incompatible libraries There are certain libraries you can combine with FFmpeg whose licenses are not diff --git a/MAINTAINERS b/MAINTAINERS index 88b0109f..499f6ad0 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -53,11 +53,11 @@ Communication website Deby Barbara Lepage fate.ffmpeg.org Timothy Gu Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos +Patchwork Andriy Gelman mailing lists Baptiste Coudurier -Google+ Paul B Mahol, Michael Niedermayer, Alexander Strasser -Twitter Lou Logan, Reynaldo H. Verdejo Pinochet +Twitter Reynaldo H. Verdejo Pinochet Launchpad Timothy Gu -ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, Rodger Combs, wm4 +ffmpeg-security Andreas Cadhalpun, Carl Eugen Hoyos, Clément Bœsch, Michael Niedermayer, Reimar Doeffinger, rcombs, wm4 libavutil @@ -78,6 +78,7 @@ Other: float_dsp Loren Merritt hash Reimar Doeffinger hwcontext_cuda* Timo Rothenpieler + hwcontext_vulkan* Lynne intfloat* Michael Niedermayer integer.c, integer.h Michael Niedermayer lzo Reimar Doeffinger @@ -88,6 +89,7 @@ Other: rational.c, rational.h Michael Niedermayer rc4 Reimar Doeffinger ripemd.c, ripemd.h James Almer + tx* Lynne libavcodec @@ -136,13 +138,14 @@ Codecs: 8bps.c Roberto Togni 8svx.c Jaikrishnan Menon aacenc*, aaccoder.c Rostislav Pehlivanov + adpcm.c Zane van Iperen alacenc.c Jaikrishnan Menon alsdec.c Thilo Borgmann, Umair Khan aptx.c Aurelien Jacobs ass* Aurelien Jacobs asv* Michael Niedermayer atrac3plus* Maxim Poliakovski - audiotoolbox* Rodger Combs + audiotoolbox* rcombs avs2* Huiwen Ren bgmc.c, bgmc.h Thilo Borgmann binkaudio.c Peter Ross @@ -158,6 +161,7 @@ Codecs: cscd.c Reimar Doeffinger cuviddec.c Timo Rothenpieler dca* foo86 + dfpwm* Jack Bruienne dirac* Rostislav Pehlivanov dnxhd* Baptiste Coudurier dolby_e* foo86 @@ -190,14 +194,17 @@ Codecs: libcodec2.c Tomas Härdin libdirac* David Conrad libdavs2.c Huiwen Ren + libjxl*.c, libjxl.h Leo Izen libgsm.c Michel Bardiaux libkvazaar.c Arttu Ylä-Outinen + libopenh264enc.c Martin Storsjo, Linjie Fu libopenjpeg.c Jaikrishnan Menon libopenjpegenc.c Michael Bradshaw libtheoraenc.c David Conrad libvorbis.c David Conrad libvpx* James Zern libxavs.c Stefan Gehrer + libxavs2.c Huiwen Ren libzvbi-teletextdec.c Marton Balint lzo.h, lzo.c Reimar Doeffinger mdec.c Michael Niedermayer @@ -213,6 +220,7 @@ Codecs: msvideo1.c Mike Melanson nuv.c Reimar Doeffinger nvdec*, nvenc* Timo Rothenpieler + omx.c Martin Storsjo, Aman Gupta opus* Rostislav Pehlivanov paf.* Paul B Mahol pcx.c Ivo van Poorten @@ -220,7 +228,7 @@ Codecs: ptx.c Ivo van Poorten qcelp* Reynaldo H. Verdejo Pinochet qdm2.c, qdm2data.h Roberto Togni - qsv* Mark Thompson, Zhong Li + qsv* Mark Thompson, Zhong Li, Haihao Xiang qtrle.c Mike Melanson ra144.c, ra144.h, ra288.c, ra288.h Roberto Togni resample2.c Michael Niedermayer @@ -230,7 +238,6 @@ Codecs: rv10.c Michael Niedermayer s3tc* Ivo van Poorten smc.c Mike Melanson - smvjpegdec.c Ash Hughes snow* Michael Niedermayer, Loren Merritt sonic.c Alex Beregszaszi speedhq.c Steinar H. Gunderson @@ -261,7 +268,6 @@ Codecs: xan.c Mike Melanson xbm* Paul B Mahol xface Stefano Sabatini - xvmc.c Ivan Kalvachev xwd* Paul B Mahol Hardware acceleration: @@ -269,8 +275,8 @@ Hardware acceleration: dxva2* Hendrik Leppkes, Laurent Aimar, Steve Lhomme d3d11va* Steve Lhomme mediacodec* Matthieu Bouron, Aman Gupta - vaapi* Gwenole Beauchesne - vaapi_encode* Mark Thompson + vaapi* Haihao Xiang + vaapi_encode* Mark Thompson, Haihao Xiang vdpau* Philip Langdale, Carl Eugen Hoyos videotoolbox* Rick Kern, Aman Gupta @@ -349,6 +355,7 @@ Filters: vf_il.c Paul B Mahol vf_(t)interlace Thomas Mundt (CC ) vf_lenscorrection.c Daniel Oberhoff + vf_libplacebo.c Niklas Haas vf_mergeplanes.c Paul B Mahol vf_mestimate.c Davinder Singh vf_minterpolate.c Davinder Singh @@ -368,6 +375,8 @@ Filters: Sources: vsrc_mandelbrot.c Michael Niedermayer +dnn Yejun Guo + libavformat =========== @@ -386,7 +395,13 @@ Muxers/Demuxers: afc.c Paul B Mahol aiffdec.c Baptiste Coudurier, Matthieu Bouron aiffenc.c Baptiste Coudurier, Matthieu Bouron + alp.c Zane van Iperen + amvenc.c Zane van Iperen + apm.c Zane van Iperen apngdec.c Benoit Fouet + argo_asf.c Zane van Iperen + argo_brp.c Zane van Iperen + argo_cvg.c Zane van Iperen ass* Aurelien Jacobs astdec.c Paul B Mahol astenc.c James Almer @@ -403,6 +418,7 @@ Muxers/Demuxers: dashdec.c Steven Liu dashenc.c Karthick Jeyapal daud.c Reimar Doeffinger + dfpwmdec.c Jack Bruienne dss.c Oleksij Rempel dtsdec.c foo86 dtshddec.c Paul B Mahol @@ -423,15 +439,17 @@ Muxers/Demuxers: ipmovie.c Mike Melanson ircam* Paul B Mahol iss.c Stefan Gehrer + jpegxl_probe.* Leo Izen jvdec.c Peter Ross + kvag.c Zane van Iperen libmodplug.c Clément Bœsch libopenmpt.c Josh de Kock lmlm4.c Ivo van Poorten lvfdec.c Paul B Mahol lxfdec.c Tomas Härdin - matroska.c Aurelien Jacobs - matroskadec.c Aurelien Jacobs - matroskaenc.c David Conrad + matroska.c Aurelien Jacobs, Andreas Rheinhardt + matroskadec.c Aurelien Jacobs, Andreas Rheinhardt + matroskaenc.c David Conrad, Andreas Rheinhardt matroska subtitles (matroskaenc.c) John Peebles metadata* Aurelien Jacobs mgsts.c Paul B Mahol @@ -446,7 +464,7 @@ Muxers/Demuxers: mpegtsenc.c Baptiste Coudurier msnwc_tcp.c Ramiro Polla mtv.c Reynaldo H. Verdejo Pinochet - mxf* Baptiste Coudurier + mxf* Baptiste Coudurier, Tomas Härdin nistspheredec.c Paul B Mahol nsvdec.c Francois Revol nut* Michael Niedermayer @@ -454,9 +472,9 @@ Muxers/Demuxers: oggdec.c, oggdec.h David Conrad oggenc.c Baptiste Coudurier oggparse*.c David Conrad - oggparsedaala* Rostislav Pehlivanov oma.c Maxim Poliakovski paf.c Paul B Mahol + pp_bnk.c Zane van Iperen psxstr.c Mike Melanson pva.c Ivo van Poorten pvfdec.c Paul B Mahol @@ -501,7 +519,9 @@ Protocols: bluray.c Petri Hintukainen ftp.c Lukasz Marek http.c Ronald S. Bultje + libsrt.c Zhao Zhili libssh.c Lukasz Marek + libzmq.c Andriy Gelman mms*.c Ronald S. Bultje udp.c Luca Abeni icecast.c Marvin Scholz @@ -526,6 +546,7 @@ Operating systems / CPU architectures Alpha Falk Hueffner MIPS Manojkumar Bhosale, Shiyou Yin +LoongArch Shiyou Yin Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier Amiga / PowerPC Colin Ward Linux / PowerPC Lauri Kasanen @@ -557,6 +578,7 @@ Joakim Plate Jun Zhao Kieran Kunhya Kirill Gavrilov +Limin Wang Martin Storsjö Panagiotis Issaris Pedro Arthur @@ -595,17 +617,22 @@ Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7 FFmpeg release signing key FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8 Ganesh Ajjanagadde C96A 848E 97C3 CEA2 AB72 5CE4 45F9 6A2D 3C36 FB1B Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4 +Haihao Xiang (haihao) 1F0C 31E8 B4FE F7A4 4DC1 DC99 E0F5 76D4 76FC 437F Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368 James Almer 7751 2E8C FD94 A169 57E6 9A7A 1463 01AD 7376 59E0 Jean Delvare 7CA6 9F44 60F1 BDC4 1FD2 C858 A552 6B9B B3CD 4E6A +Leo Izen (thebombzen) B6FD 3CFC 7ACF 83FC 9137 6945 5A71 C331 FD2F A19A Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE -Lou Logan (llogan) 7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A +Lynne FE50 139C 6805 72CA FD52 1F8D A2FE A5F0 3F03 4464 Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB + DD1E C9E8 DE08 5C62 9B3E 1846 B18E 8928 B394 8D64 Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93 +Niklas Haas (haasn) 1DDB 8076 B14D 5B48 32FC 99D9 EB52 DA9C 02BA 6FB4 Nikolay Aleksandrov 8978 1D8C FB71 588E 4B27 EAA8 C4F0 B5FC E011 13B1 Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029 Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B Philip Langdale 5DC5 8D66 5FBA 3A43 18EC 045E F8D6 B194 6A75 682E +Ramiro Polla 7859 C65B 751B 1179 792E DAE8 8E95 8B2F 9B6C 5700 Reimar Doeffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7 Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4 Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A @@ -614,7 +641,9 @@ Sascha Sommer 38A0 F88B 868E 9D3A 97D4 D6A0 E823 706F 1E07 0D3C Stefano Sabatini 0D0B AD6B 5330 BBAD D3D6 6A0C 719C 2839 FC43 2D5F Steinar H. Gunderson C2E9 004F F028 C18E 4EAD DB83 7F61 7561 7797 8F76 Stephan Hilb 4F38 0B3A 5F39 B99B F505 E562 8D5C 5554 4E17 8863 +Thilo Borgmann (thilo) CE1D B7F4 4D20 FC3A DD9F FE5A 257C 5B8F 1D20 B92F Tiancheng "Timothy" Gu 9456 AFC0 814A 8139 E994 8351 7FE6 B095 B582 B0D4 Tim Nicholson 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83 Tomas Härdin (thardin) A79D 4E3D F38F 763F 91F5 8B33 A01E 8AE0 41BB 2551 Wei Gao 4269 7741 857A 0E60 9EC5 08D2 4744 4EFA 62C1 87B9 +Zane van Iperen (zane) 61AE D40F 368B 6F26 9DAE 3892 6861 6B2D 8AC4 DCC5 diff --git a/Makefile b/Makefile index 532372c9..61f79e27 100644 --- a/Makefile +++ b/Makefile @@ -13,17 +13,19 @@ vpath %.v $(SRC_PATH) vpath %.texi $(SRC_PATH) vpath %.cu $(SRC_PATH) vpath %.ptx $(SRC_PATH) +vpath %.metal $(SRC_PATH) vpath %/fate_config.sh.template $(SRC_PATH) TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options +ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale swresample + # $(FFLIBS-yes) needs to be in linking order FFLIBS-$(CONFIG_AVDEVICE) += avdevice FFLIBS-$(CONFIG_AVFILTER) += avfilter FFLIBS-$(CONFIG_AVFORMAT) += avformat FFLIBS-$(CONFIG_AVCODEC) += avcodec -FFLIBS-$(CONFIG_AVRESAMPLE) += avresample FFLIBS-$(CONFIG_POSTPROC) += postproc FFLIBS-$(CONFIG_SWRESAMPLE) += swresample FFLIBS-$(CONFIG_SWSCALE) += swscale @@ -50,24 +52,40 @@ $(TOOLS): %$(EXESUF): %.o target_dec_%_fuzzer$(EXESUF): target_dec_%_fuzzer.o $(FF_DEP_LIBS) $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH) +tools/target_bsf_%_fuzzer$(EXESUF): tools/target_bsf_%_fuzzer.o $(FF_DEP_LIBS) + $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH) + +target_dem_%_fuzzer$(EXESUF): target_dem_%_fuzzer.o $(FF_DEP_LIBS) + $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH) + tools/target_dem_fuzzer$(EXESUF): tools/target_dem_fuzzer.o $(FF_DEP_LIBS) $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH) +tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o $(FF_DEP_LIBS) + $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) $(LIBFUZZER_PATH) + + +tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS) +tools/enum_options$(EXESUF): $(FF_DEP_LIBS) +tools/scale_slice_test$(EXESUF): $(FF_DEP_LIBS) +tools/scale_slice_test$(EXESUF): ELIBS = $(FF_EXTRALIBS) tools/sofa2wavs$(EXESUF): ELIBS = $(FF_EXTRALIBS) tools/uncoded_frame$(EXESUF): $(FF_DEP_LIBS) tools/uncoded_frame$(EXESUF): ELIBS = $(FF_EXTRALIBS) tools/target_dec_%_fuzzer$(EXESUF): $(FF_DEP_LIBS) +tools/target_dem_%_fuzzer$(EXESUF): $(FF_DEP_LIBS) CONFIGURABLE_COMPONENTS = \ $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c)) \ $(SRC_PATH)/libavcodec/bitstream_filters.c \ + $(SRC_PATH)/libavcodec/hwaccels.h \ $(SRC_PATH)/libavcodec/parsers.c \ $(SRC_PATH)/libavformat/protocols.c \ -config.h: ffbuild/.config +config_components.h: ffbuild/.config ffbuild/.config: $(CONFIGURABLE_COMPONENTS) @-tput bold 2>/dev/null - @-printf '\nWARNING: $(?) newer than config.h, rerun configure\n\n' + @-printf '\nWARNING: $(?) newer than config_components.h, rerun configure\n\n' @-tput sgr0 2>/dev/null SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \ @@ -75,7 +93,8 @@ SUBDIR_VARS := CLEANFILES FFLIBS HOSTPROGS TESTPROGS TOOLS \ ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \ ALTIVEC-OBJS VSX-OBJS MMX-OBJS X86ASM-OBJS \ MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \ - MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS + MMI-OBJS LSX-OBJS LASX-OBJS OBJS SLIBOBJS SHLIBOBJS \ + STLIBOBJS HOSTOBJS TESTOBJS define RESET $(1) := @@ -97,12 +116,13 @@ include $(SRC_PATH)/fftools/Makefile include $(SRC_PATH)/doc/Makefile include $(SRC_PATH)/doc/examples/Makefile -libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h +$(ALLFFLIBS:%=lib%/version.o): libavutil/ffversion.h $(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF) ifeq ($(STRIPTYPE),direct) $(STRIP) -o $@ $< else + $(RM) $@ $(CP) $< $@ $(STRIP) $@ endif @@ -143,11 +163,12 @@ clean:: $(RM) -rf coverage.info coverage.info.in lcov distclean:: clean - $(RM) .version avversion.h config.asm config.h mapfile \ + $(RM) .version config.asm config.h config_components.h mapfile \ ffbuild/.config ffbuild/config.* libavutil/avconfig.h \ version.h libavutil/ffversion.h libavcodec/codec_names.h \ libavcodec/bsf_list.c libavformat/protocol_list.c \ libavcodec/codec_list.c libavcodec/parser_list.c \ + libavfilter/filter_list.c libavdevice/indev_list.c libavdevice/outdev_list.c \ libavformat/muxer_list.c libavformat/demuxer_list.c ifeq ($(SRC_LINK),src) $(RM) src diff --git a/README.md b/README.md index 447347c7..f8c23f28 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ such as audio, video, subtitles and related metadata. * `libavcodec` provides implementation of a wider range of codecs. * `libavformat` implements streaming protocols, container formats and basic I/O access. * `libavutil` includes hashers, decompressors and miscellaneous utility functions. -* `libavfilter` provides a mean to alter decoded Audio and Video through chain of filters. +* `libavfilter` provides means to alter decoded audio and video through a directed graph of connected filters. * `libavdevice` provides an abstraction to access capture and playback devices. * `libswresample` implements audio mixing and resampling routines. * `libswscale` implements color conversion and scaling routines. diff --git a/RELEASE b/RELEASE index af8c8ec7..ac14c3df 100644 --- a/RELEASE +++ b/RELEASE @@ -1 +1 @@ -4.2.2 +5.1.1 diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 324dcc37..afc06316 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -1,15 +1,18 @@ - ┌────────────────────────────────────┐ - │ RELEASE NOTES for FFmpeg 4.2 "Ada" │ - └────────────────────────────────────┘ + ┌────────────────────────────────────────────┐ + │ RELEASE NOTES for FFmpeg 5.1 "Riemann" LTS │ + └────────────────────────────────────────────┘ - The FFmpeg Project proudly presents FFmpeg 4.2 "Ada", about 8 - months after the release of FFmpeg 4.1. + The FFmpeg Project proudly presents FFmpeg 5.1 "Riemann" LTS, about 6 + months after the release of FFmpeg 5.0, our first Long Term Support + release. While several past FFmpeg releases have enjoyed long term + support, this is the first release where such an intention is made + clear at release. A complete Changelog is available at the root of the project, and the complete Git history on https://git.ffmpeg.org/gitweb/ffmpeg.git We hope you will like this release as much as we enjoyed working on it, and as usual, if you have any questions about it, or any FFmpeg related topic, - feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask + feel free to join us on the #ffmpeg IRC channel (on irc.libera.chat) or ask on the mailing-lists. diff --git a/VERSION b/VERSION index af8c8ec7..ac14c3df 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.2 +5.1.1 diff --git a/compat/atomics/win32/stdatomic.h b/compat/atomics/win32/stdatomic.h index bb8e6e7e..28a627bf 100644 --- a/compat/atomics/win32/stdatomic.h +++ b/compat/atomics/win32/stdatomic.h @@ -96,7 +96,7 @@ do { \ atomic_load(object) #define atomic_exchange(object, desired) \ - InterlockedExchangePointer(object, desired); + InterlockedExchangePointer((PVOID volatile *)object, (PVOID)desired) #define atomic_exchange_explicit(object, desired, order) \ atomic_exchange(object, desired) diff --git a/compat/avisynth/avisynth_c.h b/compat/avisynth/avisynth_c.h deleted file mode 100644 index 8d17125a..00000000 --- a/compat/avisynth/avisynth_c.h +++ /dev/null @@ -1,1264 +0,0 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301 USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -// NOTE: this is a partial update of the Avisynth C interface to recognize -// new color spaces added in Avisynth 2.60. By no means is this document -// completely Avisynth 2.60 compliant. -// 170103: added new CPU constants (FMA4, AVX512xx) -// 171102: define SIZETMOD. do not use yet, experimental. Offsets are size_t instead of int. Affects x64. -// 171106: avs_get_row_size calls into avs_get_row_size_p, instead of direct field access -// 171106: avs_get_height calls into avs_get_row_size_p, instead of direct field access -// 180524: AVSC_EXPORT to dllexport in capi.h for avisynth_c_plugin_init -// 180524: avs_is_same_colorspace VideoInfo parameters to const -// 181230: Readability: functions regrouped to mix less AVSC_API and AVSC_INLINE, put together Avisynth+ specific stuff -// 181230: use #ifndef AVSC_NO_DECLSPEC for AVSC_INLINE functions which are calling API functions -// 181230: comments on avs_load_library (helper for loading API entries dynamically into a struct using AVSC_NO_DECLSPEC define) -// 181230: define alias AVS_FRAME_ALIGN as FRAME_ALIGN -// 181230: remove unused form of avs_get_rowsize and avs_get_height (kept earlier for reference) -// 190104: avs_load_library: smart fallback mechanism for Avisynth+ specific functions: -// if they are not loadable, they will work in a classic Avisynth compatible mode -// Example#1: e.g. avs_is_444 will call the existing avs_is_yv24 instead -// Example#2: avs_bits_per_component will return 8 for all colorspaces (Classic Avisynth supports only 8 bits/pixel) -// Thus the Avisynth+ specific API functions are safely callable even when connected to classic Avisynth DLL - -#ifndef __AVISYNTH_C__ -#define __AVISYNTH_C__ - -#include "avs/config.h" -#include "avs/capi.h" -#include "avs/types.h" - -#define AVS_FRAME_ALIGN FRAME_ALIGN -///////////////////////////////////////////////////////////////////// -// -// Constants -// - -#ifndef __AVISYNTH_6_H__ -enum { AVISYNTH_INTERFACE_VERSION = 6 }; -#endif - -enum {AVS_SAMPLE_INT8 = 1<<0, - AVS_SAMPLE_INT16 = 1<<1, - AVS_SAMPLE_INT24 = 1<<2, - AVS_SAMPLE_INT32 = 1<<3, - AVS_SAMPLE_FLOAT = 1<<4}; - -enum {AVS_PLANAR_Y=1<<0, - AVS_PLANAR_U=1<<1, - AVS_PLANAR_V=1<<2, - AVS_PLANAR_ALIGNED=1<<3, - AVS_PLANAR_Y_ALIGNED=AVS_PLANAR_Y|AVS_PLANAR_ALIGNED, - AVS_PLANAR_U_ALIGNED=AVS_PLANAR_U|AVS_PLANAR_ALIGNED, - AVS_PLANAR_V_ALIGNED=AVS_PLANAR_V|AVS_PLANAR_ALIGNED, - AVS_PLANAR_A=1<<4, - AVS_PLANAR_R=1<<5, - AVS_PLANAR_G=1<<6, - AVS_PLANAR_B=1<<7, - AVS_PLANAR_A_ALIGNED=AVS_PLANAR_A|AVS_PLANAR_ALIGNED, - AVS_PLANAR_R_ALIGNED=AVS_PLANAR_R|AVS_PLANAR_ALIGNED, - AVS_PLANAR_G_ALIGNED=AVS_PLANAR_G|AVS_PLANAR_ALIGNED, - AVS_PLANAR_B_ALIGNED=AVS_PLANAR_B|AVS_PLANAR_ALIGNED}; - - // Colorspace properties. -enum { - AVS_CS_YUVA = 1 << 27, - AVS_CS_BGR = 1 << 28, - AVS_CS_YUV = 1 << 29, - AVS_CS_INTERLEAVED = 1 << 30, - AVS_CS_PLANAR = 1 << 31, - - AVS_CS_SHIFT_SUB_WIDTH = 0, - AVS_CS_SHIFT_SUB_HEIGHT = 8, - AVS_CS_SHIFT_SAMPLE_BITS = 16, - - AVS_CS_SUB_WIDTH_MASK = 7 << AVS_CS_SHIFT_SUB_WIDTH, - AVS_CS_SUB_WIDTH_1 = 3 << AVS_CS_SHIFT_SUB_WIDTH, // YV24 - AVS_CS_SUB_WIDTH_2 = 0 << AVS_CS_SHIFT_SUB_WIDTH, // YV12, I420, YV16 - AVS_CS_SUB_WIDTH_4 = 1 << AVS_CS_SHIFT_SUB_WIDTH, // YUV9, YV411 - - AVS_CS_VPLANEFIRST = 1 << 3, // YV12, YV16, YV24, YV411, YUV9 - AVS_CS_UPLANEFIRST = 1 << 4, // I420 - - AVS_CS_SUB_HEIGHT_MASK = 7 << AVS_CS_SHIFT_SUB_HEIGHT, - AVS_CS_SUB_HEIGHT_1 = 3 << AVS_CS_SHIFT_SUB_HEIGHT, // YV16, YV24, YV411 - AVS_CS_SUB_HEIGHT_2 = 0 << AVS_CS_SHIFT_SUB_HEIGHT, // YV12, I420 - AVS_CS_SUB_HEIGHT_4 = 1 << AVS_CS_SHIFT_SUB_HEIGHT, // YUV9 - - AVS_CS_SAMPLE_BITS_MASK = 7 << AVS_CS_SHIFT_SAMPLE_BITS, - AVS_CS_SAMPLE_BITS_8 = 0 << AVS_CS_SHIFT_SAMPLE_BITS, - AVS_CS_SAMPLE_BITS_10 = 5 << AVS_CS_SHIFT_SAMPLE_BITS, - AVS_CS_SAMPLE_BITS_12 = 6 << AVS_CS_SHIFT_SAMPLE_BITS, - AVS_CS_SAMPLE_BITS_14 = 7 << AVS_CS_SHIFT_SAMPLE_BITS, - AVS_CS_SAMPLE_BITS_16 = 1 << AVS_CS_SHIFT_SAMPLE_BITS, - AVS_CS_SAMPLE_BITS_32 = 2 << AVS_CS_SHIFT_SAMPLE_BITS, - - AVS_CS_PLANAR_MASK = AVS_CS_PLANAR | AVS_CS_INTERLEAVED | AVS_CS_YUV | AVS_CS_BGR | AVS_CS_YUVA | AVS_CS_SAMPLE_BITS_MASK | AVS_CS_SUB_HEIGHT_MASK | AVS_CS_SUB_WIDTH_MASK, - AVS_CS_PLANAR_FILTER = ~(AVS_CS_VPLANEFIRST | AVS_CS_UPLANEFIRST), - - AVS_CS_RGB_TYPE = 1 << 0, - AVS_CS_RGBA_TYPE = 1 << 1, - - AVS_CS_GENERIC_YUV420 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_2 | AVS_CS_SUB_WIDTH_2, // 4:2:0 planar - AVS_CS_GENERIC_YUV422 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_2, // 4:2:2 planar - AVS_CS_GENERIC_YUV444 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_1, // 4:4:4 planar - AVS_CS_GENERIC_Y = AVS_CS_PLANAR | AVS_CS_INTERLEAVED | AVS_CS_YUV, // Y only (4:0:0) - AVS_CS_GENERIC_RGBP = AVS_CS_PLANAR | AVS_CS_BGR | AVS_CS_RGB_TYPE, // planar RGB - AVS_CS_GENERIC_RGBAP = AVS_CS_PLANAR | AVS_CS_BGR | AVS_CS_RGBA_TYPE, // planar RGBA - AVS_CS_GENERIC_YUVA420 = AVS_CS_PLANAR | AVS_CS_YUVA | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_2 | AVS_CS_SUB_WIDTH_2, // 4:2:0:A planar - AVS_CS_GENERIC_YUVA422 = AVS_CS_PLANAR | AVS_CS_YUVA | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_2, // 4:2:2:A planar - AVS_CS_GENERIC_YUVA444 = AVS_CS_PLANAR | AVS_CS_YUVA | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_1 }; // 4:4:4:A planar - - - // Specific color formats -enum { - AVS_CS_UNKNOWN = 0, - AVS_CS_BGR24 = AVS_CS_RGB_TYPE | AVS_CS_BGR | AVS_CS_INTERLEAVED, - AVS_CS_BGR32 = AVS_CS_RGBA_TYPE | AVS_CS_BGR | AVS_CS_INTERLEAVED, - AVS_CS_YUY2 = 1<<2 | AVS_CS_YUV | AVS_CS_INTERLEAVED, - // AVS_CS_YV12 = 1<<3 Reserved - // AVS_CS_I420 = 1<<4 Reserved - AVS_CS_RAW32 = 1<<5 | AVS_CS_INTERLEAVED, - - AVS_CS_YV24 = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_8, // YUV 4:4:4 planar - AVS_CS_YV16 = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_8, // YUV 4:2:2 planar - AVS_CS_YV12 = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_8, // YUV 4:2:0 planar - AVS_CS_I420 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_UPLANEFIRST | AVS_CS_SUB_HEIGHT_2 | AVS_CS_SUB_WIDTH_2, // YUV 4:2:0 planar - AVS_CS_IYUV = AVS_CS_I420, - AVS_CS_YV411 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_1 | AVS_CS_SUB_WIDTH_4, // YUV 4:1:1 planar - AVS_CS_YUV9 = AVS_CS_PLANAR | AVS_CS_YUV | AVS_CS_SAMPLE_BITS_8 | AVS_CS_VPLANEFIRST | AVS_CS_SUB_HEIGHT_4 | AVS_CS_SUB_WIDTH_4, // YUV 4:1:0 planar - AVS_CS_Y8 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_8, // Y 4:0:0 planar - - //------------------------- - // AVS16: new planar constants go live! Experimental PF 160613 - // 10-12-14-16 bit + planar RGB + BGR48/64 160725 - AVS_CS_YUV444P10 = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_10, // YUV 4:4:4 10bit samples - AVS_CS_YUV422P10 = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_10, // YUV 4:2:2 10bit samples - AVS_CS_YUV420P10 = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_10, // YUV 4:2:0 10bit samples - AVS_CS_Y10 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_10, // Y 4:0:0 10bit samples - - AVS_CS_YUV444P12 = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_12, // YUV 4:4:4 12bit samples - AVS_CS_YUV422P12 = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_12, // YUV 4:2:2 12bit samples - AVS_CS_YUV420P12 = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_12, // YUV 4:2:0 12bit samples - AVS_CS_Y12 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_12, // Y 4:0:0 12bit samples - - AVS_CS_YUV444P14 = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_14, // YUV 4:4:4 14bit samples - AVS_CS_YUV422P14 = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_14, // YUV 4:2:2 14bit samples - AVS_CS_YUV420P14 = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_14, // YUV 4:2:0 14bit samples - AVS_CS_Y14 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_14, // Y 4:0:0 14bit samples - - AVS_CS_YUV444P16 = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_16, // YUV 4:4:4 16bit samples - AVS_CS_YUV422P16 = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_16, // YUV 4:2:2 16bit samples - AVS_CS_YUV420P16 = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_16, // YUV 4:2:0 16bit samples - AVS_CS_Y16 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_16, // Y 4:0:0 16bit samples - - // 32 bit samples (float) - AVS_CS_YUV444PS = AVS_CS_GENERIC_YUV444 | AVS_CS_SAMPLE_BITS_32, // YUV 4:4:4 32bit samples - AVS_CS_YUV422PS = AVS_CS_GENERIC_YUV422 | AVS_CS_SAMPLE_BITS_32, // YUV 4:2:2 32bit samples - AVS_CS_YUV420PS = AVS_CS_GENERIC_YUV420 | AVS_CS_SAMPLE_BITS_32, // YUV 4:2:0 32bit samples - AVS_CS_Y32 = AVS_CS_GENERIC_Y | AVS_CS_SAMPLE_BITS_32, // Y 4:0:0 32bit samples - - // RGB packed - AVS_CS_BGR48 = AVS_CS_RGB_TYPE | AVS_CS_BGR | AVS_CS_INTERLEAVED | AVS_CS_SAMPLE_BITS_16, // BGR 3x16 bit - AVS_CS_BGR64 = AVS_CS_RGBA_TYPE | AVS_CS_BGR | AVS_CS_INTERLEAVED | AVS_CS_SAMPLE_BITS_16, // BGR 4x16 bit - // no packed 32 bit (float) support for these legacy types - - // RGB planar - AVS_CS_RGBP = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_8, // Planar RGB 8 bit samples - AVS_CS_RGBP10 = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_10, // Planar RGB 10bit samples - AVS_CS_RGBP12 = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_12, // Planar RGB 12bit samples - AVS_CS_RGBP14 = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_14, // Planar RGB 14bit samples - AVS_CS_RGBP16 = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_16, // Planar RGB 16bit samples - AVS_CS_RGBPS = AVS_CS_GENERIC_RGBP | AVS_CS_SAMPLE_BITS_32, // Planar RGB 32bit samples - - // RGBA planar - AVS_CS_RGBAP = AVS_CS_GENERIC_RGBAP | AVS_CS_SAMPLE_BITS_8, // Planar RGBA 8 bit samples - AVS_CS_RGBAP10 = AVS_CS_GENERIC_RGBAP | AVS_CS_SAMPLE_BITS_10, // Planar RGBA 10bit samples - AVS_CS_RGBAP12 = AVS_CS_GENERIC_RGBAP | AVS_CS_SAMPLE_BITS_12, // Planar RGBA 12bit samples - AVS_CS_RGBAP14 = AVS_CS_GENERIC_RGBAP | AVS_CS_SAMPLE_BITS_14, // Planar RGBA 14bit samples - AVS_CS_RGBAP16 = AVS_CS_GENERIC_RGBAP | AVS_CS_SAMPLE_BITS_16, // Planar RGBA 16bit samples - AVS_CS_RGBAPS = AVS_CS_GENERIC_RGBAP | AVS_CS_SAMPLE_BITS_32, // Planar RGBA 32bit samples - - // Planar YUVA - AVS_CS_YUVA444 = AVS_CS_GENERIC_YUVA444 | AVS_CS_SAMPLE_BITS_8, // YUVA 4:4:4 8bit samples - AVS_CS_YUVA422 = AVS_CS_GENERIC_YUVA422 | AVS_CS_SAMPLE_BITS_8, // YUVA 4:2:2 8bit samples - AVS_CS_YUVA420 = AVS_CS_GENERIC_YUVA420 | AVS_CS_SAMPLE_BITS_8, // YUVA 4:2:0 8bit samples - - AVS_CS_YUVA444P10 = AVS_CS_GENERIC_YUVA444 | AVS_CS_SAMPLE_BITS_10, // YUVA 4:4:4 10bit samples - AVS_CS_YUVA422P10 = AVS_CS_GENERIC_YUVA422 | AVS_CS_SAMPLE_BITS_10, // YUVA 4:2:2 10bit samples - AVS_CS_YUVA420P10 = AVS_CS_GENERIC_YUVA420 | AVS_CS_SAMPLE_BITS_10, // YUVA 4:2:0 10bit samples - - AVS_CS_YUVA444P12 = AVS_CS_GENERIC_YUVA444 | AVS_CS_SAMPLE_BITS_12, // YUVA 4:4:4 12bit samples - AVS_CS_YUVA422P12 = AVS_CS_GENERIC_YUVA422 | AVS_CS_SAMPLE_BITS_12, // YUVA 4:2:2 12bit samples - AVS_CS_YUVA420P12 = AVS_CS_GENERIC_YUVA420 | AVS_CS_SAMPLE_BITS_12, // YUVA 4:2:0 12bit samples - - AVS_CS_YUVA444P14 = AVS_CS_GENERIC_YUVA444 | AVS_CS_SAMPLE_BITS_14, // YUVA 4:4:4 14bit samples - AVS_CS_YUVA422P14 = AVS_CS_GENERIC_YUVA422 | AVS_CS_SAMPLE_BITS_14, // YUVA 4:2:2 14bit samples - AVS_CS_YUVA420P14 = AVS_CS_GENERIC_YUVA420 | AVS_CS_SAMPLE_BITS_14, // YUVA 4:2:0 14bit samples - - AVS_CS_YUVA444P16 = AVS_CS_GENERIC_YUVA444 | AVS_CS_SAMPLE_BITS_16, // YUVA 4:4:4 16bit samples - AVS_CS_YUVA422P16 = AVS_CS_GENERIC_YUVA422 | AVS_CS_SAMPLE_BITS_16, // YUVA 4:2:2 16bit samples - AVS_CS_YUVA420P16 = AVS_CS_GENERIC_YUVA420 | AVS_CS_SAMPLE_BITS_16, // YUVA 4:2:0 16bit samples - - AVS_CS_YUVA444PS = AVS_CS_GENERIC_YUVA444 | AVS_CS_SAMPLE_BITS_32, // YUVA 4:4:4 32bit samples - AVS_CS_YUVA422PS = AVS_CS_GENERIC_YUVA422 | AVS_CS_SAMPLE_BITS_32, // YUVA 4:2:2 32bit samples - AVS_CS_YUVA420PS = AVS_CS_GENERIC_YUVA420 | AVS_CS_SAMPLE_BITS_32, // YUVA 4:2:0 32bit samples - -}; - -enum { - AVS_IT_BFF = 1<<0, - AVS_IT_TFF = 1<<1, - AVS_IT_FIELDBASED = 1<<2}; - -enum { - AVS_FILTER_TYPE=1, - AVS_FILTER_INPUT_COLORSPACE=2, - AVS_FILTER_OUTPUT_TYPE=9, - AVS_FILTER_NAME=4, - AVS_FILTER_AUTHOR=5, - AVS_FILTER_VERSION=6, - AVS_FILTER_ARGS=7, - AVS_FILTER_ARGS_INFO=8, - AVS_FILTER_ARGS_DESCRIPTION=10, - AVS_FILTER_DESCRIPTION=11}; - -enum { //SUBTYPES - AVS_FILTER_TYPE_AUDIO=1, - AVS_FILTER_TYPE_VIDEO=2, - AVS_FILTER_OUTPUT_TYPE_SAME=3, - AVS_FILTER_OUTPUT_TYPE_DIFFERENT=4}; - -enum { - // New 2.6 explicitly defined cache hints. - AVS_CACHE_NOTHING=10, // Do not cache video. - AVS_CACHE_WINDOW=11, // Hard protect up to X frames within a range of X from the current frame N. - AVS_CACHE_GENERIC=12, // LRU cache up to X frames. - AVS_CACHE_FORCE_GENERIC=13, // LRU cache up to X frames, override any previous CACHE_WINDOW. - - AVS_CACHE_GET_POLICY=30, // Get the current policy. - AVS_CACHE_GET_WINDOW=31, // Get the current window h_span. - AVS_CACHE_GET_RANGE=32, // Get the current generic frame range. - - AVS_CACHE_AUDIO=50, // Explicitly do cache audio, X byte cache. - AVS_CACHE_AUDIO_NOTHING=51, // Explicitly do not cache audio. - AVS_CACHE_AUDIO_NONE=52, // Audio cache off (auto mode), X byte initial cache. - AVS_CACHE_AUDIO_AUTO=53, // Audio cache on (auto mode), X byte initial cache. - - AVS_CACHE_GET_AUDIO_POLICY=70, // Get the current audio policy. - AVS_CACHE_GET_AUDIO_SIZE=71, // Get the current audio cache size. - - AVS_CACHE_PREFETCH_FRAME=100, // Queue request to prefetch frame N. - AVS_CACHE_PREFETCH_GO=101, // Action video prefetches. - - AVS_CACHE_PREFETCH_AUDIO_BEGIN=120, // Begin queue request transaction to prefetch audio (take critical section). - AVS_CACHE_PREFETCH_AUDIO_STARTLO=121, // Set low 32 bits of start. - AVS_CACHE_PREFETCH_AUDIO_STARTHI=122, // Set high 32 bits of start. - AVS_CACHE_PREFETCH_AUDIO_COUNT=123, // Set low 32 bits of length. - AVS_CACHE_PREFETCH_AUDIO_COMMIT=124, // Enqueue request transaction to prefetch audio (release critical section). - AVS_CACHE_PREFETCH_AUDIO_GO=125, // Action audio prefetches. - - AVS_CACHE_GETCHILD_CACHE_MODE=200, // Cache ask Child for desired video cache mode. - AVS_CACHE_GETCHILD_CACHE_SIZE=201, // Cache ask Child for desired video cache size. - AVS_CACHE_GETCHILD_AUDIO_MODE=202, // Cache ask Child for desired audio cache mode. - AVS_CACHE_GETCHILD_AUDIO_SIZE=203, // Cache ask Child for desired audio cache size. - - AVS_CACHE_GETCHILD_COST=220, // Cache ask Child for estimated processing cost. - AVS_CACHE_COST_ZERO=221, // Child response of zero cost (ptr arithmetic only). - AVS_CACHE_COST_UNIT=222, // Child response of unit cost (less than or equal 1 full frame blit). - AVS_CACHE_COST_LOW=223, // Child response of light cost. (Fast) - AVS_CACHE_COST_MED=224, // Child response of medium cost. (Real time) - AVS_CACHE_COST_HI=225, // Child response of heavy cost. (Slow) - - AVS_CACHE_GETCHILD_THREAD_MODE=240, // Cache ask Child for thread safety. - AVS_CACHE_THREAD_UNSAFE=241, // Only 1 thread allowed for all instances. 2.5 filters default! - AVS_CACHE_THREAD_CLASS=242, // Only 1 thread allowed for each instance. 2.6 filters default! - AVS_CACHE_THREAD_SAFE=243, // Allow all threads in any instance. - AVS_CACHE_THREAD_OWN=244, // Safe but limit to 1 thread, internally threaded. - - AVS_CACHE_GETCHILD_ACCESS_COST=260, // Cache ask Child for preferred access pattern. - AVS_CACHE_ACCESS_RAND=261, // Filter is access order agnostic. - AVS_CACHE_ACCESS_SEQ0=262, // Filter prefers sequential access (low cost) - AVS_CACHE_ACCESS_SEQ1=263, // Filter needs sequential access (high cost) - }; - -#ifdef BUILDING_AVSCORE -AVSValue create_c_video_filter(AVSValue args, void * user_data, IScriptEnvironment * e0); - -struct AVS_ScriptEnvironment { - IScriptEnvironment * env; - const char * error; - AVS_ScriptEnvironment(IScriptEnvironment * e = 0) - : env(e), error(0) {} -}; -#endif - -typedef struct AVS_Clip AVS_Clip; -typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment; - -///////////////////////////////////////////////////////////////////// -// -// AVS_VideoInfo -// - -// AVS_VideoInfo is laid out identically to VideoInfo -typedef struct AVS_VideoInfo { - int width, height; // width=0 means no video - unsigned fps_numerator, fps_denominator; - int num_frames; - - int pixel_type; - - int audio_samples_per_second; // 0 means no audio - int sample_type; - INT64 num_audio_samples; - int nchannels; - - // Image type properties - - int image_type; -} AVS_VideoInfo; - -// useful functions of the above -AVSC_INLINE int avs_has_video(const AVS_VideoInfo * p) - { return (p->width!=0); } - -AVSC_INLINE int avs_has_audio(const AVS_VideoInfo * p) - { return (p->audio_samples_per_second!=0); } - -AVSC_INLINE int avs_is_rgb(const AVS_VideoInfo * p) - { return !!(p->pixel_type&AVS_CS_BGR); } - -AVSC_INLINE int avs_is_rgb24(const AVS_VideoInfo * p) - { return ((p->pixel_type&AVS_CS_BGR24)==AVS_CS_BGR24) && ((p->pixel_type & AVS_CS_SAMPLE_BITS_MASK) == AVS_CS_SAMPLE_BITS_8); } - -AVSC_INLINE int avs_is_rgb32(const AVS_VideoInfo * p) - { return ((p->pixel_type&AVS_CS_BGR32)==AVS_CS_BGR32) && ((p->pixel_type & AVS_CS_SAMPLE_BITS_MASK) == AVS_CS_SAMPLE_BITS_8); } - -AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo * p) - { return !!(p->pixel_type&AVS_CS_YUV ); } - -AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p) - { return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; } - -AVSC_API(int, avs_is_yv24)(const AVS_VideoInfo * p); // avs+: for generic 444 check, use avs_is_yuv444 - -AVSC_API(int, avs_is_yv16)(const AVS_VideoInfo * p); // avs+: for generic 422 check, use avs_is_yuv422 - -AVSC_API(int, avs_is_yv12)(const AVS_VideoInfo * p) ; // avs+: for generic 420 check, use avs_is_yuv420 - -AVSC_API(int, avs_is_yv411)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_y8)(const AVS_VideoInfo * p); // avs+: for generic grayscale, use avs_is_y - -AVSC_API(int, avs_get_plane_width_subsampling)(const AVS_VideoInfo * p, int plane); - -AVSC_API(int, avs_get_plane_height_subsampling)(const AVS_VideoInfo * p, int plane); - -AVSC_API(int, avs_bits_per_pixel)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_bytes_from_pixels)(const AVS_VideoInfo * p, int pixels); - -AVSC_API(int, avs_row_size)(const AVS_VideoInfo * p, int plane); - -AVSC_API(int, avs_bmp_size)(const AVS_VideoInfo * vi); - -AVSC_API(int, avs_is_color_space)(const AVS_VideoInfo * p, int c_space); - -// no API for these, inline helper functions -AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property) -{ - return ((p->image_type & property) == property); -} - -AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p) -{ - return !!(p->pixel_type & AVS_CS_PLANAR); -} - -AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p) -{ - return !!(p->image_type & AVS_IT_FIELDBASED); -} - -AVSC_INLINE int avs_is_parity_known(const AVS_VideoInfo * p) -{ - return ((p->image_type & AVS_IT_FIELDBASED) && (p->image_type & (AVS_IT_BFF | AVS_IT_TFF))); -} - -AVSC_INLINE int avs_is_bff(const AVS_VideoInfo * p) -{ - return !!(p->image_type & AVS_IT_BFF); -} - -AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p) -{ - return !!(p->image_type & AVS_IT_TFF); -} - -AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p) - { return p->audio_samples_per_second; } - -AVSC_INLINE int avs_bytes_per_channel_sample(const AVS_VideoInfo * p) -{ - switch (p->sample_type) { - case AVS_SAMPLE_INT8: return sizeof(signed char); - case AVS_SAMPLE_INT16: return sizeof(signed short); - case AVS_SAMPLE_INT24: return 3; - case AVS_SAMPLE_INT32: return sizeof(signed int); - case AVS_SAMPLE_FLOAT: return sizeof(float); - default: return 0; - } -} - -AVSC_INLINE int avs_bytes_per_audio_sample(const AVS_VideoInfo * p) - { return p->nchannels*avs_bytes_per_channel_sample(p);} - -AVSC_INLINE INT64 avs_audio_samples_from_frames(const AVS_VideoInfo * p, INT64 frames) - { return ((INT64)(frames) * p->audio_samples_per_second * p->fps_denominator / p->fps_numerator); } - -AVSC_INLINE int avs_frames_from_audio_samples(const AVS_VideoInfo * p, INT64 samples) - { return (int)(samples * (INT64)p->fps_numerator / (INT64)p->fps_denominator / (INT64)p->audio_samples_per_second); } - -AVSC_INLINE INT64 avs_audio_samples_from_bytes(const AVS_VideoInfo * p, INT64 bytes) - { return bytes / avs_bytes_per_audio_sample(p); } - -AVSC_INLINE INT64 avs_bytes_from_audio_samples(const AVS_VideoInfo * p, INT64 samples) - { return samples * avs_bytes_per_audio_sample(p); } - -AVSC_INLINE int avs_audio_channels(const AVS_VideoInfo * p) - { return p->nchannels; } - -AVSC_INLINE int avs_sample_type(const AVS_VideoInfo * p) - { return p->sample_type;} - -// useful mutator -AVSC_INLINE void avs_set_property(AVS_VideoInfo * p, int property) - { p->image_type|=property; } - -AVSC_INLINE void avs_clear_property(AVS_VideoInfo * p, int property) - { p->image_type&=~property; } - -AVSC_INLINE void avs_set_field_based(AVS_VideoInfo * p, int isfieldbased) - { if (isfieldbased) p->image_type|=AVS_IT_FIELDBASED; else p->image_type&=~AVS_IT_FIELDBASED; } - -AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned denominator) -{ - unsigned x=numerator, y=denominator; - while (y) { // find gcd - unsigned t = x%y; x = y; y = t; - } - p->fps_numerator = numerator/x; - p->fps_denominator = denominator/x; -} - -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE int avs_is_same_colorspace(const AVS_VideoInfo * x, const AVS_VideoInfo * y) -{ - return (x->pixel_type == y->pixel_type) - || (avs_is_yv12(x) && avs_is_yv12(y)); -} -#endif - -// Avisynth+ extensions -AVSC_API(int, avs_is_rgb48)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_rgb64)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_yuv444p16)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv444 - -AVSC_API(int, avs_is_yuv422p16)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv422 - -AVSC_API(int, avs_is_yuv420p16)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv420 - -AVSC_API(int, avs_is_y16)(const AVS_VideoInfo * p); // obsolete, use avs_is_y - -AVSC_API(int, avs_is_yuv444ps)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv444 - -AVSC_API(int, avs_is_yuv422ps)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv422 - -AVSC_API(int, avs_is_yuv420ps)(const AVS_VideoInfo * p); // obsolete, use avs_is_yuv420 - -AVSC_API(int, avs_is_y32)(const AVS_VideoInfo * p); // obsolete, use avs_is_y - -AVSC_API(int, avs_is_444)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_422)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_420)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_y)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_yuva)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_planar_rgb)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_is_planar_rgba)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_num_components)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_component_size)(const AVS_VideoInfo * p); - -AVSC_API(int, avs_bits_per_component)(const AVS_VideoInfo * p); -// end of Avisynth+ specific - -///////////////////////////////////////////////////////////////////// -// -// AVS_VideoFrame -// - -// VideoFrameBuffer holds information about a memory block which is used -// for video data. For efficiency, instances of this class are not deleted -// when the refcount reaches zero; instead they're stored in a linked list -// to be reused. The instances are deleted when the corresponding AVS -// file is closed. - -// AVS_VideoFrameBuffer is laid out identically to VideoFrameBuffer -// DO NOT USE THIS STRUCTURE DIRECTLY -typedef struct AVS_VideoFrameBuffer { - BYTE * data; -#ifdef SIZETMOD - size_t data_size; -#else - int data_size; -#endif - // sequence_number is incremented every time the buffer is changed, so - // that stale views can tell they're no longer valid. - volatile long sequence_number; - - volatile long refcount; -} AVS_VideoFrameBuffer; - -// VideoFrame holds a "window" into a VideoFrameBuffer. - -// AVS_VideoFrame is laid out identically to IVideoFrame -// DO NOT USE THIS STRUCTURE DIRECTLY -typedef struct AVS_VideoFrame { - volatile long refcount; - AVS_VideoFrameBuffer * vfb; -#ifdef SIZETMOD - size_t offset; -#else - int offset; -#endif - int pitch, row_size, height; -#ifdef SIZETMOD - size_t offsetU, offsetV; -#else - int offsetU, offsetV; -#endif - int pitchUV; // U&V offsets are from top of picture. - int row_sizeUV, heightUV; // for Planar RGB offsetU, offsetV is for the 2nd and 3rd Plane. - // for Planar RGB pitchUV and row_sizeUV = 0, because when no VideoInfo (MakeWriteable) - // the decision on existence of UV is checked by zero pitch - // AVS+ extension, avisynth.h: class does not break plugins if appended here -#ifdef SIZETMOD - size_t offsetA; -#else - int offsetA; -#endif - int pitchA, row_sizeA; // 4th alpha plane support, pitch and row_size is 0 is none -} AVS_VideoFrame; - -// Access functions for AVS_VideoFrame -AVSC_API(int, avs_get_pitch_p)(const AVS_VideoFrame * p, int plane); - -AVSC_API(int, avs_get_row_size_p)(const AVS_VideoFrame * p, int plane); - -AVSC_API(int, avs_get_height_p)(const AVS_VideoFrame * p, int plane); - -AVSC_API(const BYTE *, avs_get_read_ptr_p)(const AVS_VideoFrame * p, int plane); - -AVSC_API(int, avs_is_writable)(const AVS_VideoFrame * p); - -AVSC_API(BYTE *, avs_get_write_ptr_p)(const AVS_VideoFrame * p, int plane); - -AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *); -// makes a shallow copy of a video frame -AVSC_API(AVS_VideoFrame *, avs_copy_video_frame)(AVS_VideoFrame *); - -// no API for these, inline helper functions -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) { - return avs_get_pitch_p(p, 0); -} -#endif - -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) { - return avs_get_row_size_p(p, 0); } -#endif - - -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) { - return avs_get_height_p(p, 0); -} -#endif - -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE const BYTE* avs_get_read_ptr(const AVS_VideoFrame * p) { - return avs_get_read_ptr_p(p, 0);} -#endif - -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE BYTE* avs_get_write_ptr(const AVS_VideoFrame * p) { - return avs_get_write_ptr_p(p, 0);} -#endif - -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE void avs_release_frame(AVS_VideoFrame * f) - {avs_release_video_frame(f);} -#endif - -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE AVS_VideoFrame * avs_copy_frame(AVS_VideoFrame * f) - {return avs_copy_video_frame(f);} -#endif - -///////////////////////////////////////////////////////////////////// -// -// AVS_Value -// - -// Treat AVS_Value as a fat pointer. That is use avs_copy_value -// and avs_release_value appropriately as you would if AVS_Value was -// a pointer. - -// To maintain source code compatibility with future versions of the -// avisynth_c API don't use the AVS_Value directly. Use the helper -// functions below. - -// AVS_Value is laid out identically to AVSValue -typedef struct AVS_Value AVS_Value; -struct AVS_Value { - short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong - // for some function e'rror - short array_size; - union { - void * clip; // do not use directly, use avs_take_clip - char boolean; - int integer; - float floating_pt; - const char * string; - const AVS_Value * array; - } d; -}; - -// AVS_Value should be initialized with avs_void. -// Should also set to avs_void after the value is released -// with avs_copy_value. Consider it the equivalent of setting -// a pointer to NULL -static const AVS_Value avs_void = {'v'}; - -AVSC_API(void, avs_copy_value)(AVS_Value * dest, AVS_Value src); -AVSC_API(void, avs_release_value)(AVS_Value); -AVSC_API(AVS_Clip *, avs_take_clip)(AVS_Value, AVS_ScriptEnvironment *); -AVSC_API(void, avs_set_to_clip)(AVS_Value *, AVS_Clip *); - - -// no API for these, inline helper functions -AVSC_INLINE int avs_defined(AVS_Value v) { return v.type != 'v'; } -AVSC_INLINE int avs_is_clip(AVS_Value v) { return v.type == 'c'; } -AVSC_INLINE int avs_is_bool(AVS_Value v) { return v.type == 'b'; } -AVSC_INLINE int avs_is_int(AVS_Value v) { return v.type == 'i'; } -AVSC_INLINE int avs_is_float(AVS_Value v) { return v.type == 'f' || v.type == 'i'; } -AVSC_INLINE int avs_is_string(AVS_Value v) { return v.type == 's'; } -AVSC_INLINE int avs_is_array(AVS_Value v) { return v.type == 'a'; } -AVSC_INLINE int avs_is_error(AVS_Value v) { return v.type == 'e'; } - -AVSC_INLINE int avs_as_bool(AVS_Value v) - { return v.d.boolean; } -AVSC_INLINE int avs_as_int(AVS_Value v) - { return v.d.integer; } -AVSC_INLINE const char * avs_as_string(AVS_Value v) - { return avs_is_error(v) || avs_is_string(v) ? v.d.string : 0; } -AVSC_INLINE double avs_as_float(AVS_Value v) - { return avs_is_int(v) ? v.d.integer : v.d.floating_pt; } -AVSC_INLINE const char * avs_as_error(AVS_Value v) - { return avs_is_error(v) ? v.d.string : 0; } -AVSC_INLINE const AVS_Value * avs_as_array(AVS_Value v) - { return v.d.array; } -AVSC_INLINE int avs_array_size(AVS_Value v) - { return avs_is_array(v) ? v.array_size : 1; } -AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index) - { return avs_is_array(v) ? v.d.array[index] : v; } - -// only use these functions on an AVS_Value that does not already have -// an active value. Remember, treat AVS_Value as a fat pointer. -AVSC_INLINE AVS_Value avs_new_value_bool(int v0) - { AVS_Value v; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; } -AVSC_INLINE AVS_Value avs_new_value_int(int v0) - { AVS_Value v; v.type = 'i'; v.d.integer = v0; return v; } -AVSC_INLINE AVS_Value avs_new_value_string(const char * v0) - { AVS_Value v; v.type = 's'; v.d.string = v0; return v; } -AVSC_INLINE AVS_Value avs_new_value_float(float v0) - { AVS_Value v; v.type = 'f'; v.d.floating_pt = v0; return v;} -AVSC_INLINE AVS_Value avs_new_value_error(const char * v0) - { AVS_Value v; v.type = 'e'; v.d.string = v0; return v; } -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0) - { AVS_Value v; avs_set_to_clip(&v, v0); return v; } -#endif -AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size) - { AVS_Value v; v.type = 'a'; v.d.array = v0; v.array_size = (short)size; return v; } -// end of inline helper functions - -///////////////////////////////////////////////////////////////////// -// -// AVS_Clip -// - -AVSC_API(void, avs_release_clip)(AVS_Clip *); -AVSC_API(AVS_Clip *, avs_copy_clip)(AVS_Clip *); - -AVSC_API(const char *, avs_clip_get_error)(AVS_Clip *); // return 0 if no error - -AVSC_API(const AVS_VideoInfo *, avs_get_video_info)(AVS_Clip *); - -AVSC_API(int, avs_get_version)(AVS_Clip *); - -AVSC_API(AVS_VideoFrame *, avs_get_frame)(AVS_Clip *, int n); -// The returned video frame must be released with avs_release_video_frame - -AVSC_API(int, avs_get_parity)(AVS_Clip *, int n); -// return field parity if field_based, else parity of first field in frame - -AVSC_API(int, avs_get_audio)(AVS_Clip *, void * buf, - INT64 start, INT64 count); -// start and count are in samples - -AVSC_API(int, avs_set_cache_hints)(AVS_Clip *, - int cachehints, int frame_range); - -// This is the callback type used by avs_add_function -typedef AVS_Value (AVSC_CC * AVS_ApplyFunc) - (AVS_ScriptEnvironment *, AVS_Value args, void * user_data); - -typedef struct AVS_FilterInfo AVS_FilterInfo; -struct AVS_FilterInfo -{ - // these members should not be modified outside of the AVS_ApplyFunc callback - AVS_Clip * child; - AVS_VideoInfo vi; - AVS_ScriptEnvironment * env; - AVS_VideoFrame * (AVSC_CC * get_frame)(AVS_FilterInfo *, int n); - int (AVSC_CC * get_parity)(AVS_FilterInfo *, int n); - int (AVSC_CC * get_audio)(AVS_FilterInfo *, void * buf, - INT64 start, INT64 count); - int (AVSC_CC * set_cache_hints)(AVS_FilterInfo *, int cachehints, - int frame_range); - void (AVSC_CC * free_filter)(AVS_FilterInfo *); - - // Should be set when ever there is an error to report. - // It is cleared before any of the above methods are called - const char * error; - // this is to store whatever and may be modified at will - void * user_data; -}; - -// Create a new filter -// fi is set to point to the AVS_FilterInfo so that you can -// modify it once it is initialized. -// store_child should generally be set to true. If it is not -// set than ALL methods (the function pointers) must be defined -// If it is set than you do not need to worry about freeing the child -// clip. -AVSC_API(AVS_Clip *, avs_new_c_filter)(AVS_ScriptEnvironment * e, - AVS_FilterInfo * * fi, - AVS_Value child, int store_child); - -///////////////////////////////////////////////////////////////////// -// -// AVS_ScriptEnvironment -// - -// For GetCPUFlags. These are backwards-compatible with those in VirtualDub. -enum { - /* slowest CPU to support extension */ - AVS_CPU_FORCE = 0x01, // N/A - AVS_CPU_FPU = 0x02, // 386/486DX - AVS_CPU_MMX = 0x04, // P55C, K6, PII - AVS_CPU_INTEGER_SSE = 0x08, // PIII, Athlon - AVS_CPU_SSE = 0x10, // PIII, Athlon XP/MP - AVS_CPU_SSE2 = 0x20, // PIV, Hammer - AVS_CPU_3DNOW = 0x40, // K6-2 - AVS_CPU_3DNOW_EXT = 0x80, // Athlon - AVS_CPU_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2, - // which only Hammer will have anyway) - AVS_CPUF_SSE3 = 0x100, // PIV+, K8 Venice - AVS_CPUF_SSSE3 = 0x200, // Core 2 - AVS_CPUF_SSE4 = 0x400, // Penryn, Wolfdale, Yorkfield - AVS_CPUF_SSE4_1 = 0x400, - AVS_CPUF_AVX = 0x800, // Sandy Bridge, Bulldozer - AVS_CPUF_SSE4_2 = 0x1000, // Nehalem - // AVS+ - AVS_CPUF_AVX2 = 0x2000, // Haswell - AVS_CPUF_FMA3 = 0x4000, - AVS_CPUF_F16C = 0x8000, - AVS_CPUF_MOVBE = 0x10000, // Big Endian Move - AVS_CPUF_POPCNT = 0x20000, - AVS_CPUF_AES = 0x40000, - AVS_CPUF_FMA4 = 0x80000, - - AVS_CPUF_AVX512F = 0x100000, // AVX-512 Foundation. - AVS_CPUF_AVX512DQ = 0x200000, // AVX-512 DQ (Double/Quad granular) Instructions - AVS_CPUF_AVX512PF = 0x400000, // AVX-512 Prefetch - AVS_CPUF_AVX512ER = 0x800000, // AVX-512 Exponential and Reciprocal - AVS_CPUF_AVX512CD = 0x1000000, // AVX-512 Conflict Detection - AVS_CPUF_AVX512BW = 0x2000000, // AVX-512 BW (Byte/Word granular) Instructions - AVS_CPUF_AVX512VL = 0x4000000, // AVX-512 VL (128/256 Vector Length) Extensions - AVS_CPUF_AVX512IFMA = 0x8000000, // AVX-512 IFMA integer 52 bit - AVS_CPUF_AVX512VBMI = 0x10000000 // AVX-512 VBMI -}; - - -AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error - -AVSC_API(int, avs_get_cpu_flags)(AVS_ScriptEnvironment *); -AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version); - -AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length); -AVSC_API(char *, avs_sprintf)(AVS_ScriptEnvironment *, const char * fmt, ...); - -AVSC_API(char *, avs_vsprintf)(AVS_ScriptEnvironment *, const char * fmt, void* val); - // note: val is really a va_list; I hope everyone typedefs va_list to a pointer - -AVSC_API(int, avs_add_function)(AVS_ScriptEnvironment *, - const char * name, const char * params, - AVS_ApplyFunc apply, void * user_data); - -AVSC_API(int, avs_function_exists)(AVS_ScriptEnvironment *, const char * name); - -AVSC_API(AVS_Value, avs_invoke)(AVS_ScriptEnvironment *, const char * name, - AVS_Value args, const char** arg_names); -// The returned value must be be released with avs_release_value - -AVSC_API(AVS_Value, avs_get_var)(AVS_ScriptEnvironment *, const char* name); -// The returned value must be be released with avs_release_value - -AVSC_API(int, avs_set_var)(AVS_ScriptEnvironment *, const char* name, AVS_Value val); - -AVSC_API(int, avs_set_global_var)(AVS_ScriptEnvironment *, const char* name, const AVS_Value val); - -//void avs_push_context(AVS_ScriptEnvironment *, int level=0); -//void avs_pop_context(AVS_ScriptEnvironment *); - -AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *, - const AVS_VideoInfo * vi, int align); -// align should be at least 16 for classic Avisynth -// Avisynth+: any value, Avs+ ensures a minimum alignment if too small align is provided - -// no API for these, inline helper functions -#ifndef AVSC_NO_DECLSPEC -// this inline function is calling an API function -AVSC_INLINE AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env, - const AVS_VideoInfo * vi) - {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);} - -// an older compatibility alias -// this inline function is calling an API function -AVSC_INLINE AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env, - const AVS_VideoInfo * vi) - {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);} -#endif -// end of inline helper functions - -AVSC_API(int, avs_make_writable)(AVS_ScriptEnvironment *, AVS_VideoFrame * * pvf); - -AVSC_API(void, avs_bit_blt)(AVS_ScriptEnvironment *, BYTE* dstp, int dst_pitch, const BYTE* srcp, int src_pitch, int row_size, int height); - -typedef void (AVSC_CC *AVS_ShutdownFunc)(void* user_data, AVS_ScriptEnvironment * env); -AVSC_API(void, avs_at_exit)(AVS_ScriptEnvironment *, AVS_ShutdownFunc function, void * user_data); - -AVSC_API(AVS_VideoFrame *, avs_subframe)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height); -// The returned video frame must be be released - -AVSC_API(int, avs_set_memory_max)(AVS_ScriptEnvironment *, int mem); - -AVSC_API(int, avs_set_working_dir)(AVS_ScriptEnvironment *, const char * newdir); - -// avisynth.dll exports this; it's a way to use it as a library, without -// writing an AVS script or without going through AVIFile. -AVSC_API(AVS_ScriptEnvironment *, avs_create_script_environment)(int version); - -// this symbol is the entry point for the plugin and must -// be defined -AVSC_EXPORT -const char * AVSC_CC avisynth_c_plugin_init(AVS_ScriptEnvironment* env); - - -AVSC_API(void, avs_delete_script_environment)(AVS_ScriptEnvironment *); - - -AVSC_API(AVS_VideoFrame *, avs_subframe_planar)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV); -// The returned video frame must be be released - -#ifdef AVSC_NO_DECLSPEC -// This part uses LoadLibrary and related functions to dynamically load Avisynth instead of declspec(dllimport) -// When AVSC_NO_DECLSPEC is defined, you can use avs_load_library to populate API functions into a struct -// AVSC_INLINE functions which call onto an API functions should be treated specially (todo) - -/* - The following functions needs to have been declared, probably from windows.h - - void* malloc(size_t) - void free(void*); - - HMODULE LoadLibrary(const char*); - void* GetProcAddress(HMODULE, const char*); - FreeLibrary(HMODULE); -*/ - - -typedef struct AVS_Library AVS_Library; - -#define AVSC_DECLARE_FUNC(name) name##_func name - -// AVSC_DECLARE_FUNC helps keeping naming convention: type is xxxxx_func, function name is xxxxx -// e.g. "AVSC_DECLARE_FUNC(avs_add_function);" -// is a shortcut for "avs_add_function_func avs_add_function;" - -// Note: AVSC_INLINE functions which call into API, -// are guarded by #ifndef AVSC_NO_DECLSPEC -// They should call the appropriate library-> API entry - -struct AVS_Library { - HMODULE handle; - - AVSC_DECLARE_FUNC(avs_add_function); - AVSC_DECLARE_FUNC(avs_at_exit); - AVSC_DECLARE_FUNC(avs_bit_blt); - AVSC_DECLARE_FUNC(avs_check_version); - AVSC_DECLARE_FUNC(avs_clip_get_error); - AVSC_DECLARE_FUNC(avs_copy_clip); - AVSC_DECLARE_FUNC(avs_copy_value); - AVSC_DECLARE_FUNC(avs_copy_video_frame); - AVSC_DECLARE_FUNC(avs_create_script_environment); - AVSC_DECLARE_FUNC(avs_delete_script_environment); - AVSC_DECLARE_FUNC(avs_function_exists); - AVSC_DECLARE_FUNC(avs_get_audio); - AVSC_DECLARE_FUNC(avs_get_cpu_flags); - AVSC_DECLARE_FUNC(avs_get_frame); - AVSC_DECLARE_FUNC(avs_get_parity); - AVSC_DECLARE_FUNC(avs_get_var); - AVSC_DECLARE_FUNC(avs_get_version); - AVSC_DECLARE_FUNC(avs_get_video_info); - AVSC_DECLARE_FUNC(avs_invoke); - AVSC_DECLARE_FUNC(avs_make_writable); - AVSC_DECLARE_FUNC(avs_new_c_filter); - AVSC_DECLARE_FUNC(avs_new_video_frame_a); - AVSC_DECLARE_FUNC(avs_release_clip); - AVSC_DECLARE_FUNC(avs_release_value); - AVSC_DECLARE_FUNC(avs_release_video_frame); - AVSC_DECLARE_FUNC(avs_save_string); - AVSC_DECLARE_FUNC(avs_set_cache_hints); - AVSC_DECLARE_FUNC(avs_set_global_var); - AVSC_DECLARE_FUNC(avs_set_memory_max); - AVSC_DECLARE_FUNC(avs_set_to_clip); - AVSC_DECLARE_FUNC(avs_set_var); - AVSC_DECLARE_FUNC(avs_set_working_dir); - AVSC_DECLARE_FUNC(avs_sprintf); - AVSC_DECLARE_FUNC(avs_subframe); - AVSC_DECLARE_FUNC(avs_subframe_planar); - AVSC_DECLARE_FUNC(avs_take_clip); - AVSC_DECLARE_FUNC(avs_vsprintf); - - AVSC_DECLARE_FUNC(avs_get_error); - AVSC_DECLARE_FUNC(avs_is_yv24); - AVSC_DECLARE_FUNC(avs_is_yv16); - AVSC_DECLARE_FUNC(avs_is_yv12); - AVSC_DECLARE_FUNC(avs_is_yv411); - AVSC_DECLARE_FUNC(avs_is_y8); - AVSC_DECLARE_FUNC(avs_is_color_space); - - AVSC_DECLARE_FUNC(avs_get_plane_width_subsampling); - AVSC_DECLARE_FUNC(avs_get_plane_height_subsampling); - AVSC_DECLARE_FUNC(avs_bits_per_pixel); - AVSC_DECLARE_FUNC(avs_bytes_from_pixels); - AVSC_DECLARE_FUNC(avs_row_size); - AVSC_DECLARE_FUNC(avs_bmp_size); - AVSC_DECLARE_FUNC(avs_get_pitch_p); - AVSC_DECLARE_FUNC(avs_get_row_size_p); - AVSC_DECLARE_FUNC(avs_get_height_p); - AVSC_DECLARE_FUNC(avs_get_read_ptr_p); - AVSC_DECLARE_FUNC(avs_is_writable); - AVSC_DECLARE_FUNC(avs_get_write_ptr_p); - - // Avisynth+ specific - // Note: these functions are simulated/use fallback to existing functions - AVSC_DECLARE_FUNC(avs_is_rgb48); - AVSC_DECLARE_FUNC(avs_is_rgb64); - AVSC_DECLARE_FUNC(avs_is_yuv444p16); - AVSC_DECLARE_FUNC(avs_is_yuv422p16); - AVSC_DECLARE_FUNC(avs_is_yuv420p16); - AVSC_DECLARE_FUNC(avs_is_y16); - AVSC_DECLARE_FUNC(avs_is_yuv444ps); - AVSC_DECLARE_FUNC(avs_is_yuv422ps); - AVSC_DECLARE_FUNC(avs_is_yuv420ps); - AVSC_DECLARE_FUNC(avs_is_y32); - AVSC_DECLARE_FUNC(avs_is_444); - AVSC_DECLARE_FUNC(avs_is_422); - AVSC_DECLARE_FUNC(avs_is_420); - AVSC_DECLARE_FUNC(avs_is_y); - AVSC_DECLARE_FUNC(avs_is_yuva); - AVSC_DECLARE_FUNC(avs_is_planar_rgb); - AVSC_DECLARE_FUNC(avs_is_planar_rgba); - AVSC_DECLARE_FUNC(avs_num_components); - AVSC_DECLARE_FUNC(avs_component_size); - AVSC_DECLARE_FUNC(avs_bits_per_component); - // end of Avisynth+ specific - -}; - -#undef AVSC_DECLARE_FUNC - -// Helper functions for fallback simulation -// Avisynth+ extensions do not exist in classic Avisynth so they are simulated -AVSC_INLINE int avs_is_xx_fallback_return_false(const AVS_VideoInfo * p) -{ - return 0; -} - -// Avisynth+ extensions do not exist in classic Avisynth so they are simulated -AVSC_INLINE int avs_num_components_fallback(const AVS_VideoInfo * p) -{ - switch (p->pixel_type) { - case AVS_CS_UNKNOWN: - return 0; - case AVS_CS_RAW32: - case AVS_CS_Y8: - return 1; - case AVS_CS_BGR32: - return 4; // not planar but return the count - default: - return 3; - } -} - -// Avisynth+ extensions do not exist in classic Avisynth so they are simulated -AVSC_INLINE int avs_component_size_fallback(const AVS_VideoInfo * p) -{ - return 1; -} - -// Avisynth+ extensions do not exist in classic Avisynth so they are simulated -AVSC_INLINE int avs_bits_per_component_fallback(const AVS_VideoInfo * p) -{ - return 8; -} -// End of helper functions for fallback simulation - -// avs_load_library() allocates an array for API procedure entries -// reads and fills the entries with live procedure addresses. -// AVSC_INLINE helpers which are calling into API procedures are not treated here (todo) - -AVSC_INLINE AVS_Library * avs_load_library() { - AVS_Library *library = (AVS_Library *)malloc(sizeof(AVS_Library)); - if (library == NULL) - return NULL; - library->handle = LoadLibrary("avisynth"); - if (library->handle == NULL) - goto fail; - -#define __AVSC_STRINGIFY(x) #x -#define AVSC_STRINGIFY(x) __AVSC_STRINGIFY(x) -#define AVSC_LOAD_FUNC(name) {\ - library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name));\ - if (library->name == NULL)\ - goto fail;\ -} - -#if 0 -// FFmpeg-specific: we don't use the FALLBACK stuff, and it causes build errors, -// so ifdef it out on our side. - -// When an API function is not loadable, let's try a replacement -// Missing Avisynth+ functions will be substituted with classic Avisynth compatible methods -/* -Avisynth+ When method is missing (classic Avisynth) -avs_is_rgb48 constant false -avs_is_rgb64 constant false -avs_is_yuv444p16 constant false -avs_is_yuv422p16 constant false -avs_is_yuv420p16 constant false -avs_is_y16 constant false -avs_is_yuv444ps constant false -avs_is_yuv422ps constant false -avs_is_yuv420ps constant false -avs_is_y32 constant false -avs_is_444 avs_is_yv24 -avs_is_422 avs_is_yv16 -avs_is_420 avs_is_yv12 -avs_is_y avs_is_y8 -avs_is_yuva constant false -avs_is_planar_rgb constant false -avs_is_planar_rgba constant false -avs_num_components special: avs_num_components_fake Y8:1 RGB32:4 else 3 -avs_component_size constant 1 (1 bytes/component) -avs_bits_per_component constant 8 (8 bits/component) -*/ - - // try to load an alternative function -#define AVSC_LOAD_FUNC_FALLBACK(name,name2) {\ - library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name));\ - if (library->name == NULL)\ - library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name2));\ - if (library->name == NULL)\ - goto fail;\ -} - - // try to assign a replacement function -#define AVSC_LOAD_FUNC_FALLBACK_SIMULATED(name,name2) {\ - library->name = (name##_func) GetProcAddress(library->handle, AVSC_STRINGIFY(name));\ - if (library->name == NULL)\ - library->name = name2;\ - if (library->name == NULL)\ - goto fail;\ -} -#endif - - AVSC_LOAD_FUNC(avs_add_function); - AVSC_LOAD_FUNC(avs_at_exit); - AVSC_LOAD_FUNC(avs_bit_blt); - AVSC_LOAD_FUNC(avs_check_version); - AVSC_LOAD_FUNC(avs_clip_get_error); - AVSC_LOAD_FUNC(avs_copy_clip); - AVSC_LOAD_FUNC(avs_copy_value); - AVSC_LOAD_FUNC(avs_copy_video_frame); - AVSC_LOAD_FUNC(avs_create_script_environment); - AVSC_LOAD_FUNC(avs_delete_script_environment); - AVSC_LOAD_FUNC(avs_function_exists); - AVSC_LOAD_FUNC(avs_get_audio); - AVSC_LOAD_FUNC(avs_get_cpu_flags); - AVSC_LOAD_FUNC(avs_get_frame); - AVSC_LOAD_FUNC(avs_get_parity); - AVSC_LOAD_FUNC(avs_get_var); - AVSC_LOAD_FUNC(avs_get_version); - AVSC_LOAD_FUNC(avs_get_video_info); - AVSC_LOAD_FUNC(avs_invoke); - AVSC_LOAD_FUNC(avs_make_writable); - AVSC_LOAD_FUNC(avs_new_c_filter); - AVSC_LOAD_FUNC(avs_new_video_frame_a); - AVSC_LOAD_FUNC(avs_release_clip); - AVSC_LOAD_FUNC(avs_release_value); - AVSC_LOAD_FUNC(avs_release_video_frame); - AVSC_LOAD_FUNC(avs_save_string); - AVSC_LOAD_FUNC(avs_set_cache_hints); - AVSC_LOAD_FUNC(avs_set_global_var); - AVSC_LOAD_FUNC(avs_set_memory_max); - AVSC_LOAD_FUNC(avs_set_to_clip); - AVSC_LOAD_FUNC(avs_set_var); - AVSC_LOAD_FUNC(avs_set_working_dir); - AVSC_LOAD_FUNC(avs_sprintf); - AVSC_LOAD_FUNC(avs_subframe); - AVSC_LOAD_FUNC(avs_subframe_planar); - AVSC_LOAD_FUNC(avs_take_clip); - AVSC_LOAD_FUNC(avs_vsprintf); - - AVSC_LOAD_FUNC(avs_get_error); - AVSC_LOAD_FUNC(avs_is_yv24); - AVSC_LOAD_FUNC(avs_is_yv16); - AVSC_LOAD_FUNC(avs_is_yv12); - AVSC_LOAD_FUNC(avs_is_yv411); - AVSC_LOAD_FUNC(avs_is_y8); - AVSC_LOAD_FUNC(avs_is_color_space); - - AVSC_LOAD_FUNC(avs_get_plane_width_subsampling); - AVSC_LOAD_FUNC(avs_get_plane_height_subsampling); - AVSC_LOAD_FUNC(avs_bits_per_pixel); - AVSC_LOAD_FUNC(avs_bytes_from_pixels); - AVSC_LOAD_FUNC(avs_row_size); - AVSC_LOAD_FUNC(avs_bmp_size); - AVSC_LOAD_FUNC(avs_get_pitch_p); - AVSC_LOAD_FUNC(avs_get_row_size_p); - AVSC_LOAD_FUNC(avs_get_height_p); - AVSC_LOAD_FUNC(avs_get_read_ptr_p); - AVSC_LOAD_FUNC(avs_is_writable); - AVSC_LOAD_FUNC(avs_get_write_ptr_p); - -#if 0 - // Avisynth+ specific but made them callable for classic Avisynth hosts - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_rgb48, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_rgb64, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv444p16, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv422p16, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv420p16, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_y16, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv444ps, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv422ps, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuv420ps, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_y32, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK(avs_is_444, avs_is_yv24); - AVSC_LOAD_FUNC_FALLBACK(avs_is_422, avs_is_yv16); - AVSC_LOAD_FUNC_FALLBACK(avs_is_420, avs_is_yv12); - AVSC_LOAD_FUNC_FALLBACK(avs_is_y, avs_is_y8); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_yuva, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_planar_rgb, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_is_planar_rgba, avs_is_xx_fallback_return_false); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_num_components, avs_num_components_fallback); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_component_size, avs_component_size_fallback); - AVSC_LOAD_FUNC_FALLBACK_SIMULATED(avs_bits_per_component, avs_bits_per_component_fallback); -#endif - -#undef __AVSC_STRINGIFY -#undef AVSC_STRINGIFY -#undef AVSC_LOAD_FUNC -#undef AVSC_LOAD_FUNC_FALLBACK -#undef AVSC_LOAD_FUNC_FALLBACK_SIMULATED - - return library; - -fail: - free(library); - return NULL; -} - -AVSC_INLINE void avs_free_library(AVS_Library *library) { - if (library == NULL) - return; - FreeLibrary(library->handle); - free(library); -} -#endif - -#endif diff --git a/compat/avisynth/avs/capi.h b/compat/avisynth/avs/capi.h deleted file mode 100644 index 8799bf1f..00000000 --- a/compat/avisynth/avs/capi.h +++ /dev/null @@ -1,94 +0,0 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -#ifndef AVS_CAPI_H -#define AVS_CAPI_H - -#ifdef __cplusplus -# define EXTERN_C extern "C" -#else -# define EXTERN_C -#endif - -#ifdef BUILDING_AVSCORE -# if defined(GCC) && defined(X86_32) -# define AVSC_CC -# else // MSVC builds and 64-bit GCC -# ifndef AVSC_USE_STDCALL -# define AVSC_CC __cdecl -# else -# define AVSC_CC __stdcall -# endif -# endif -#else // needed for programs that talk to AviSynth+ -# ifndef AVSC_WIN32_GCC32 // see comment below -# ifndef AVSC_USE_STDCALL -# define AVSC_CC __cdecl -# else -# define AVSC_CC __stdcall -# endif -# else -# define AVSC_CC -# endif -#endif - -// On 64-bit Windows, there's only one calling convention, -// so there is no difference between MSVC and GCC. On 32-bit, -// this isn't true. The convention that GCC needs to use to -// even build AviSynth+ as 32-bit makes anything that uses -// it incompatible with 32-bit MSVC builds of AviSynth+. -// The AVSC_WIN32_GCC32 define is meant to provide a user -// switchable way to make builds of FFmpeg to test 32-bit -// GCC builds of AviSynth+ without having to screw around -// with alternate headers, while still default to the usual -// situation of using 32-bit MSVC builds of AviSynth+. - -// Hopefully, this situation will eventually be resolved -// and a broadly compatible solution will arise so the -// same 32-bit FFmpeg build can handle either MSVC or GCC -// builds of AviSynth+. - -#define AVSC_INLINE static __inline - -#ifdef BUILDING_AVSCORE -# define AVSC_EXPORT __declspec(dllexport) -# define AVSC_API(ret, name) EXTERN_C AVSC_EXPORT ret AVSC_CC name -#else -# define AVSC_EXPORT EXTERN_C __declspec(dllexport) -# ifndef AVSC_NO_DECLSPEC -# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name -# else -# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func) -# endif -#endif - -#endif //AVS_CAPI_H diff --git a/compat/avisynth/avs/config.h b/compat/avisynth/avs/config.h deleted file mode 100644 index a7d3e692..00000000 --- a/compat/avisynth/avs/config.h +++ /dev/null @@ -1,70 +0,0 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -#ifndef AVS_CONFIG_H -#define AVS_CONFIG_H - -// Undefine this to get cdecl calling convention -#define AVSC_USE_STDCALL 1 - -// NOTE TO PLUGIN AUTHORS: -// Because FRAME_ALIGN can be substantially higher than the alignment -// a plugin actually needs, plugins should not use FRAME_ALIGN to check for -// alignment. They should always request the exact alignment value they need. -// This is to make sure that plugins work over the widest range of AviSynth -// builds possible. -#define FRAME_ALIGN 64 - -#if defined(_M_AMD64) || defined(__x86_64) -# define X86_64 -#elif defined(_M_IX86) || defined(__i386__) -# define X86_32 -#else -# error Unsupported CPU architecture. -#endif - -#if defined(_MSC_VER) -# define MSVC -#elif defined(__GNUC__) -# define GCC -#elif defined(__clang__) -# define CLANG -#else -# error Unsupported compiler. -#endif - -#if defined(GCC) -# undef __forceinline -# define __forceinline inline -#endif - -#endif //AVS_CONFIG_H diff --git a/compat/avisynth/avs/types.h b/compat/avisynth/avs/types.h deleted file mode 100644 index df15f1d8..00000000 --- a/compat/avisynth/avs/types.h +++ /dev/null @@ -1,57 +0,0 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -#ifndef AVS_TYPES_H -#define AVS_TYPES_H - -// Define all types necessary for interfacing with avisynth.dll - -#ifdef __cplusplus - #include -#else - #include -#endif - -// Raster types used by VirtualDub & Avisynth -typedef unsigned int Pixel32; -typedef unsigned char BYTE; - -// Audio Sample information -typedef float SFLOAT; - -#ifdef __GNUC__ -typedef long long int INT64; -#else -typedef __int64 INT64; -#endif - -#endif //AVS_TYPES_H diff --git a/compat/avisynth/avxsynth_c.h b/compat/avisynth/avxsynth_c.h deleted file mode 100644 index 991f4be1..00000000 --- a/compat/avisynth/avxsynth_c.h +++ /dev/null @@ -1,728 +0,0 @@ -// Avisynth C Interface Version 0.20 -// Copyright 2003 Kevin Atkinson - -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, -// MA 02110-1301 USA, or visit -// http://www.gnu.org/copyleft/gpl.html . -// -// As a special exception, I give you permission to link to the -// Avisynth C interface with independent modules that communicate with -// the Avisynth C interface solely through the interfaces defined in -// avisynth_c.h, regardless of the license terms of these independent -// modules, and to copy and distribute the resulting combined work -// under terms of your choice, provided that every copy of the -// combined work is accompanied by a complete copy of the source code -// of the Avisynth C interface and Avisynth itself (with the version -// used to produce the combined work), being distributed under the -// terms of the GNU General Public License plus this exception. An -// independent module is a module which is not derived from or based -// on Avisynth C Interface, such as 3rd-party filters, import and -// export plugins, or graphical user interfaces. - -#ifndef __AVXSYNTH_C__ -#define __AVXSYNTH_C__ - -#include "windowsPorts/windows2linux.h" -#include - -#ifdef __cplusplus -# define EXTERN_C extern "C" -#else -# define EXTERN_C -#endif - -#define AVSC_USE_STDCALL 1 - -#ifndef AVSC_USE_STDCALL -# define AVSC_CC __cdecl -#else -# define AVSC_CC __stdcall -#endif - -#define AVSC_INLINE static __inline - -#ifdef AVISYNTH_C_EXPORTS -# define AVSC_EXPORT EXTERN_C -# define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name -#else -# define AVSC_EXPORT EXTERN_C __declspec(dllexport) -# ifndef AVSC_NO_DECLSPEC -# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name -# else -# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func) -# endif -#endif - -#ifdef __GNUC__ -typedef long long int INT64; -#else -typedef __int64 INT64; -#endif - - -///////////////////////////////////////////////////////////////////// -// -// Constants -// - -#ifndef __AVXSYNTH_H__ -enum { AVISYNTH_INTERFACE_VERSION = 3 }; -#endif - -enum {AVS_SAMPLE_INT8 = 1<<0, - AVS_SAMPLE_INT16 = 1<<1, - AVS_SAMPLE_INT24 = 1<<2, - AVS_SAMPLE_INT32 = 1<<3, - AVS_SAMPLE_FLOAT = 1<<4}; - -enum {AVS_PLANAR_Y=1<<0, - AVS_PLANAR_U=1<<1, - AVS_PLANAR_V=1<<2, - AVS_PLANAR_ALIGNED=1<<3, - AVS_PLANAR_Y_ALIGNED=AVS_PLANAR_Y|AVS_PLANAR_ALIGNED, - AVS_PLANAR_U_ALIGNED=AVS_PLANAR_U|AVS_PLANAR_ALIGNED, - AVS_PLANAR_V_ALIGNED=AVS_PLANAR_V|AVS_PLANAR_ALIGNED}; - - // Colorspace properties. -enum {AVS_CS_BGR = 1<<28, - AVS_CS_YUV = 1<<29, - AVS_CS_INTERLEAVED = 1<<30, - AVS_CS_PLANAR = 1<<31}; - - // Specific colorformats -enum { - AVS_CS_UNKNOWN = 0, - AVS_CS_BGR24 = 1<<0 | AVS_CS_BGR | AVS_CS_INTERLEAVED, - AVS_CS_BGR32 = 1<<1 | AVS_CS_BGR | AVS_CS_INTERLEAVED, - AVS_CS_YUY2 = 1<<2 | AVS_CS_YUV | AVS_CS_INTERLEAVED, - AVS_CS_YV12 = 1<<3 | AVS_CS_YUV | AVS_CS_PLANAR, // y-v-u, planar - AVS_CS_I420 = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR, // y-u-v, planar - AVS_CS_IYUV = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR // same as above -}; - -enum { - AVS_IT_BFF = 1<<0, - AVS_IT_TFF = 1<<1, - AVS_IT_FIELDBASED = 1<<2}; - -enum { - AVS_FILTER_TYPE=1, - AVS_FILTER_INPUT_COLORSPACE=2, - AVS_FILTER_OUTPUT_TYPE=9, - AVS_FILTER_NAME=4, - AVS_FILTER_AUTHOR=5, - AVS_FILTER_VERSION=6, - AVS_FILTER_ARGS=7, - AVS_FILTER_ARGS_INFO=8, - AVS_FILTER_ARGS_DESCRIPTION=10, - AVS_FILTER_DESCRIPTION=11}; - -enum { //SUBTYPES - AVS_FILTER_TYPE_AUDIO=1, - AVS_FILTER_TYPE_VIDEO=2, - AVS_FILTER_OUTPUT_TYPE_SAME=3, - AVS_FILTER_OUTPUT_TYPE_DIFFERENT=4}; - -enum { - AVS_CACHE_NOTHING=0, - AVS_CACHE_RANGE=1, - AVS_CACHE_ALL=2, - AVS_CACHE_AUDIO=3, - AVS_CACHE_AUDIO_NONE=4, - AVS_CACHE_AUDIO_AUTO=5 -}; - -#define AVS_FRAME_ALIGN 16 - -typedef struct AVS_Clip AVS_Clip; -typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment; - -///////////////////////////////////////////////////////////////////// -// -// AVS_VideoInfo -// - -// AVS_VideoInfo is layed out identicly to VideoInfo -typedef struct AVS_VideoInfo { - int width, height; // width=0 means no video - unsigned fps_numerator, fps_denominator; - int num_frames; - - int pixel_type; - - int audio_samples_per_second; // 0 means no audio - int sample_type; - INT64 num_audio_samples; - int nchannels; - - // Imagetype properties - - int image_type; -} AVS_VideoInfo; - -// useful functions of the above -AVSC_INLINE int avs_has_video(const AVS_VideoInfo * p) - { return (p->width!=0); } - -AVSC_INLINE int avs_has_audio(const AVS_VideoInfo * p) - { return (p->audio_samples_per_second!=0); } - -AVSC_INLINE int avs_is_rgb(const AVS_VideoInfo * p) - { return !!(p->pixel_type&AVS_CS_BGR); } - -AVSC_INLINE int avs_is_rgb24(const AVS_VideoInfo * p) - { return (p->pixel_type&AVS_CS_BGR24)==AVS_CS_BGR24; } // Clear out additional properties - -AVSC_INLINE int avs_is_rgb32(const AVS_VideoInfo * p) - { return (p->pixel_type & AVS_CS_BGR32) == AVS_CS_BGR32 ; } - -AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo * p) - { return !!(p->pixel_type&AVS_CS_YUV ); } - -AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p) - { return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; } - -AVSC_INLINE int avs_is_yv12(const AVS_VideoInfo * p) - { return ((p->pixel_type & AVS_CS_YV12) == AVS_CS_YV12)||((p->pixel_type & AVS_CS_I420) == AVS_CS_I420); } - -AVSC_INLINE int avs_is_color_space(const AVS_VideoInfo * p, int c_space) - { return ((p->pixel_type & c_space) == c_space); } - -AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property) - { return ((p->pixel_type & property)==property ); } - -AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p) - { return !!(p->pixel_type & AVS_CS_PLANAR); } - -AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p) - { return !!(p->image_type & AVS_IT_FIELDBASED); } - -AVSC_INLINE int avs_is_parity_known(const AVS_VideoInfo * p) - { return ((p->image_type & AVS_IT_FIELDBASED)&&(p->image_type & (AVS_IT_BFF | AVS_IT_TFF))); } - -AVSC_INLINE int avs_is_bff(const AVS_VideoInfo * p) - { return !!(p->image_type & AVS_IT_BFF); } - -AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p) - { return !!(p->image_type & AVS_IT_TFF); } - -AVSC_INLINE int avs_bits_per_pixel(const AVS_VideoInfo * p) -{ - switch (p->pixel_type) { - case AVS_CS_BGR24: return 24; - case AVS_CS_BGR32: return 32; - case AVS_CS_YUY2: return 16; - case AVS_CS_YV12: - case AVS_CS_I420: return 12; - default: return 0; - } -} -AVSC_INLINE int avs_bytes_from_pixels(const AVS_VideoInfo * p, int pixels) - { return pixels * (avs_bits_per_pixel(p)>>3); } // Will work on planar images, but will return only luma planes - -AVSC_INLINE int avs_row_size(const AVS_VideoInfo * p) - { return avs_bytes_from_pixels(p,p->width); } // Also only returns first plane on planar images - -AVSC_INLINE int avs_bmp_size(const AVS_VideoInfo * vi) - { if (avs_is_planar(vi)) {int p = vi->height * ((avs_row_size(vi)+3) & ~3); p+=p>>1; return p; } return vi->height * ((avs_row_size(vi)+3) & ~3); } - -AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p) - { return p->audio_samples_per_second; } - - -AVSC_INLINE int avs_bytes_per_channel_sample(const AVS_VideoInfo * p) -{ - switch (p->sample_type) { - case AVS_SAMPLE_INT8: return sizeof(signed char); - case AVS_SAMPLE_INT16: return sizeof(signed short); - case AVS_SAMPLE_INT24: return 3; - case AVS_SAMPLE_INT32: return sizeof(signed int); - case AVS_SAMPLE_FLOAT: return sizeof(float); - default: return 0; - } -} -AVSC_INLINE int avs_bytes_per_audio_sample(const AVS_VideoInfo * p) - { return p->nchannels*avs_bytes_per_channel_sample(p);} - -AVSC_INLINE INT64 avs_audio_samples_from_frames(const AVS_VideoInfo * p, INT64 frames) - { return ((INT64)(frames) * p->audio_samples_per_second * p->fps_denominator / p->fps_numerator); } - -AVSC_INLINE int avs_frames_from_audio_samples(const AVS_VideoInfo * p, INT64 samples) - { return (int)(samples * (INT64)p->fps_numerator / (INT64)p->fps_denominator / (INT64)p->audio_samples_per_second); } - -AVSC_INLINE INT64 avs_audio_samples_from_bytes(const AVS_VideoInfo * p, INT64 bytes) - { return bytes / avs_bytes_per_audio_sample(p); } - -AVSC_INLINE INT64 avs_bytes_from_audio_samples(const AVS_VideoInfo * p, INT64 samples) - { return samples * avs_bytes_per_audio_sample(p); } - -AVSC_INLINE int avs_audio_channels(const AVS_VideoInfo * p) - { return p->nchannels; } - -AVSC_INLINE int avs_sample_type(const AVS_VideoInfo * p) - { return p->sample_type;} - -// useful mutator -AVSC_INLINE void avs_set_property(AVS_VideoInfo * p, int property) - { p->image_type|=property; } - -AVSC_INLINE void avs_clear_property(AVS_VideoInfo * p, int property) - { p->image_type&=~property; } - -AVSC_INLINE void avs_set_field_based(AVS_VideoInfo * p, int isfieldbased) - { if (isfieldbased) p->image_type|=AVS_IT_FIELDBASED; else p->image_type&=~AVS_IT_FIELDBASED; } - -AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned denominator) -{ - unsigned x=numerator, y=denominator; - while (y) { // find gcd - unsigned t = x%y; x = y; y = t; - } - p->fps_numerator = numerator/x; - p->fps_denominator = denominator/x; -} - -AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo * x, AVS_VideoInfo * y) -{ - return (x->pixel_type == y->pixel_type) - || (avs_is_yv12(x) && avs_is_yv12(y)); -} - -///////////////////////////////////////////////////////////////////// -// -// AVS_VideoFrame -// - -// VideoFrameBuffer holds information about a memory block which is used -// for video data. For efficiency, instances of this class are not deleted -// when the refcount reaches zero; instead they're stored in a linked list -// to be reused. The instances are deleted when the corresponding AVS -// file is closed. - -// AVS_VideoFrameBuffer is layed out identicly to VideoFrameBuffer -// DO NOT USE THIS STRUCTURE DIRECTLY -typedef struct AVS_VideoFrameBuffer { - unsigned char * data; - int data_size; - // sequence_number is incremented every time the buffer is changed, so - // that stale views can tell they're no longer valid. - long sequence_number; - - long refcount; -} AVS_VideoFrameBuffer; - -// VideoFrame holds a "window" into a VideoFrameBuffer. - -// AVS_VideoFrame is layed out identicly to IVideoFrame -// DO NOT USE THIS STRUCTURE DIRECTLY -typedef struct AVS_VideoFrame { - int refcount; - AVS_VideoFrameBuffer * vfb; - int offset, pitch, row_size, height, offsetU, offsetV, pitchUV; // U&V offsets are from top of picture. -} AVS_VideoFrame; - -// Access functions for AVS_VideoFrame -AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) { - return p->pitch;} - -AVSC_INLINE int avs_get_pitch_p(const AVS_VideoFrame * p, int plane) { - switch (plane) { - case AVS_PLANAR_U: case AVS_PLANAR_V: return p->pitchUV;} - return p->pitch;} - -AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) { - return p->row_size; } - -AVSC_INLINE int avs_get_row_size_p(const AVS_VideoFrame * p, int plane) { - int r; - switch (plane) { - case AVS_PLANAR_U: case AVS_PLANAR_V: - if (p->pitchUV) return p->row_size>>1; - else return 0; - case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED: - if (p->pitchUV) { - r = ((p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)) )>>1; // Aligned rowsize - if (r < p->pitchUV) - return r; - return p->row_size>>1; - } else return 0; - case AVS_PLANAR_Y_ALIGNED: - r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize - if (r <= p->pitch) - return r; - return p->row_size; - } - return p->row_size; -} - -AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) { - return p->height;} - -AVSC_INLINE int avs_get_height_p(const AVS_VideoFrame * p, int plane) { - switch (plane) { - case AVS_PLANAR_U: case AVS_PLANAR_V: - if (p->pitchUV) return p->height>>1; - return 0; - } - return p->height;} - -AVSC_INLINE const unsigned char* avs_get_read_ptr(const AVS_VideoFrame * p) { - return p->vfb->data + p->offset;} - -AVSC_INLINE const unsigned char* avs_get_read_ptr_p(const AVS_VideoFrame * p, int plane) -{ - switch (plane) { - case AVS_PLANAR_U: return p->vfb->data + p->offsetU; - case AVS_PLANAR_V: return p->vfb->data + p->offsetV; - default: return p->vfb->data + p->offset;} -} - -AVSC_INLINE int avs_is_writable(const AVS_VideoFrame * p) { - return (p->refcount == 1 && p->vfb->refcount == 1);} - -AVSC_INLINE unsigned char* avs_get_write_ptr(const AVS_VideoFrame * p) -{ - if (avs_is_writable(p)) { - ++p->vfb->sequence_number; - return p->vfb->data + p->offset; - } else - return 0; -} - -AVSC_INLINE unsigned char* avs_get_write_ptr_p(const AVS_VideoFrame * p, int plane) -{ - if (plane==AVS_PLANAR_Y && avs_is_writable(p)) { - ++p->vfb->sequence_number; - return p->vfb->data + p->offset; - } else if (plane==AVS_PLANAR_Y) { - return 0; - } else { - switch (plane) { - case AVS_PLANAR_U: return p->vfb->data + p->offsetU; - case AVS_PLANAR_V: return p->vfb->data + p->offsetV; - default: return p->vfb->data + p->offset; - } - } -} - -#if defined __cplusplus -extern "C" -{ -#endif // __cplusplus -AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *); -// makes a shallow copy of a video frame -AVSC_API(AVS_VideoFrame *, avs_copy_video_frame)(AVS_VideoFrame *); -#if defined __cplusplus -} -#endif // __cplusplus - -#ifndef AVSC_NO_DECLSPEC -AVSC_INLINE void avs_release_frame(AVS_VideoFrame * f) - {avs_release_video_frame(f);} -AVSC_INLINE AVS_VideoFrame * avs_copy_frame(AVS_VideoFrame * f) - {return avs_copy_video_frame(f);} -#endif - -///////////////////////////////////////////////////////////////////// -// -// AVS_Value -// - -// Treat AVS_Value as a fat pointer. That is use avs_copy_value -// and avs_release_value appropiaty as you would if AVS_Value was -// a pointer. - -// To maintain source code compatibility with future versions of the -// avisynth_c API don't use the AVS_Value directly. Use the helper -// functions below. - -// AVS_Value is layed out identicly to AVSValue -typedef struct AVS_Value AVS_Value; -struct AVS_Value { - short type; // 'a'rray, 'c'lip, 'b'ool, 'i'nt, 'f'loat, 's'tring, 'v'oid, or 'l'ong - // for some function e'rror - short array_size; - union { - void * clip; // do not use directly, use avs_take_clip - char boolean; - int integer; - INT64 integer64; // match addition of __int64 to avxplugin.h - float floating_pt; - const char * string; - const AVS_Value * array; - } d; -}; - -// AVS_Value should be initilized with avs_void. -// Should also set to avs_void after the value is released -// with avs_copy_value. Consider it the equalvent of setting -// a pointer to NULL -static const AVS_Value avs_void = {'v'}; - -AVSC_API(void, avs_copy_value)(AVS_Value * dest, AVS_Value src); -AVSC_API(void, avs_release_value)(AVS_Value); - -AVSC_INLINE int avs_defined(AVS_Value v) { return v.type != 'v'; } -AVSC_INLINE int avs_is_clip(AVS_Value v) { return v.type == 'c'; } -AVSC_INLINE int avs_is_bool(AVS_Value v) { return v.type == 'b'; } -AVSC_INLINE int avs_is_int(AVS_Value v) { return v.type == 'i'; } -AVSC_INLINE int avs_is_float(AVS_Value v) { return v.type == 'f' || v.type == 'i'; } -AVSC_INLINE int avs_is_string(AVS_Value v) { return v.type == 's'; } -AVSC_INLINE int avs_is_array(AVS_Value v) { return v.type == 'a'; } -AVSC_INLINE int avs_is_error(AVS_Value v) { return v.type == 'e'; } - -#if defined __cplusplus -extern "C" -{ -#endif // __cplusplus -AVSC_API(AVS_Clip *, avs_take_clip)(AVS_Value, AVS_ScriptEnvironment *); -AVSC_API(void, avs_set_to_clip)(AVS_Value *, AVS_Clip *); -#if defined __cplusplus -} -#endif // __cplusplus - -AVSC_INLINE int avs_as_bool(AVS_Value v) - { return v.d.boolean; } -AVSC_INLINE int avs_as_int(AVS_Value v) - { return v.d.integer; } -AVSC_INLINE const char * avs_as_string(AVS_Value v) - { return avs_is_error(v) || avs_is_string(v) ? v.d.string : 0; } -AVSC_INLINE double avs_as_float(AVS_Value v) - { return avs_is_int(v) ? v.d.integer : v.d.floating_pt; } -AVSC_INLINE const char * avs_as_error(AVS_Value v) - { return avs_is_error(v) ? v.d.string : 0; } -AVSC_INLINE const AVS_Value * avs_as_array(AVS_Value v) - { return v.d.array; } -AVSC_INLINE int avs_array_size(AVS_Value v) - { return avs_is_array(v) ? v.array_size : 1; } -AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index) - { return avs_is_array(v) ? v.d.array[index] : v; } - -// only use these functions on am AVS_Value that does not already have -// an active value. Remember, treat AVS_Value as a fat pointer. -AVSC_INLINE AVS_Value avs_new_value_bool(int v0) - { AVS_Value v = {0}; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; } -AVSC_INLINE AVS_Value avs_new_value_int(int v0) - { AVS_Value v = {0}; v.type = 'i'; v.d.integer = v0; return v; } -AVSC_INLINE AVS_Value avs_new_value_string(const char * v0) - { AVS_Value v = {0}; v.type = 's'; v.d.string = v0; return v; } -AVSC_INLINE AVS_Value avs_new_value_float(float v0) - { AVS_Value v = {0}; v.type = 'f'; v.d.floating_pt = v0; return v;} -AVSC_INLINE AVS_Value avs_new_value_error(const char * v0) - { AVS_Value v = {0}; v.type = 'e'; v.d.string = v0; return v; } -#ifndef AVSC_NO_DECLSPEC -AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0) - { AVS_Value v = {0}; avs_set_to_clip(&v, v0); return v; } -#endif -AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size) - { AVS_Value v = {0}; v.type = 'a'; v.d.array = v0; v.array_size = size; return v; } - -///////////////////////////////////////////////////////////////////// -// -// AVS_Clip -// -#if defined __cplusplus -extern "C" -{ -#endif // __cplusplus -AVSC_API(void, avs_release_clip)(AVS_Clip *); -AVSC_API(AVS_Clip *, avs_copy_clip)(AVS_Clip *); - -AVSC_API(const char *, avs_clip_get_error)(AVS_Clip *); // return 0 if no error - -AVSC_API(const AVS_VideoInfo *, avs_get_video_info)(AVS_Clip *); - -AVSC_API(int, avs_get_version)(AVS_Clip *); - -AVSC_API(AVS_VideoFrame *, avs_get_frame)(AVS_Clip *, int n); -// The returned video frame must be released with avs_release_video_frame - -AVSC_API(int, avs_get_parity)(AVS_Clip *, int n); -// return field parity if field_based, else parity of first field in frame - -AVSC_API(int, avs_get_audio)(AVS_Clip *, void * buf, - INT64 start, INT64 count); -// start and count are in samples - -AVSC_API(int, avs_set_cache_hints)(AVS_Clip *, - int cachehints, size_t frame_range); -#if defined __cplusplus -} -#endif // __cplusplus - -// This is the callback type used by avs_add_function -typedef AVS_Value (AVSC_CC * AVS_ApplyFunc) - (AVS_ScriptEnvironment *, AVS_Value args, void * user_data); - -typedef struct AVS_FilterInfo AVS_FilterInfo; -struct AVS_FilterInfo -{ - // these members should not be modified outside of the AVS_ApplyFunc callback - AVS_Clip * child; - AVS_VideoInfo vi; - AVS_ScriptEnvironment * env; - AVS_VideoFrame * (AVSC_CC * get_frame)(AVS_FilterInfo *, int n); - int (AVSC_CC * get_parity)(AVS_FilterInfo *, int n); - int (AVSC_CC * get_audio)(AVS_FilterInfo *, void * buf, - INT64 start, INT64 count); - int (AVSC_CC * set_cache_hints)(AVS_FilterInfo *, int cachehints, - int frame_range); - void (AVSC_CC * free_filter)(AVS_FilterInfo *); - - // Should be set when ever there is an error to report. - // It is cleared before any of the above methods are called - const char * error; - // this is to store whatever and may be modified at will - void * user_data; -}; - -// Create a new filter -// fi is set to point to the AVS_FilterInfo so that you can -// modify it once it is initilized. -// store_child should generally be set to true. If it is not -// set than ALL methods (the function pointers) must be defined -// If it is set than you do not need to worry about freeing the child -// clip. -#if defined __cplusplus -extern "C" -{ -#endif // __cplusplus -AVSC_API(AVS_Clip *, avs_new_c_filter)(AVS_ScriptEnvironment * e, - AVS_FilterInfo * * fi, - AVS_Value child, int store_child); -#if defined __cplusplus -} -#endif // __cplusplus - - -///////////////////////////////////////////////////////////////////// -// -// AVS_ScriptEnvironment -// - -// For GetCPUFlags. These are backwards-compatible with those in VirtualDub. -enum { - /* slowest CPU to support extension */ - AVS_CPU_FORCE = 0x01, // N/A - AVS_CPU_FPU = 0x02, // 386/486DX - AVS_CPU_MMX = 0x04, // P55C, K6, PII - AVS_CPU_INTEGER_SSE = 0x08, // PIII, Athlon - AVS_CPU_SSE = 0x10, // PIII, Athlon XP/MP - AVS_CPU_SSE2 = 0x20, // PIV, Hammer - AVS_CPU_3DNOW = 0x40, // K6-2 - AVS_CPU_3DNOW_EXT = 0x80, // Athlon - AVS_CPU_X86_64 = 0xA0, // Hammer (note: equiv. to 3DNow + SSE2, - // which only Hammer will have anyway) -}; - -#if defined __cplusplus -extern "C" -{ -#endif // __cplusplus -AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error - -AVSC_API(long, avs_get_cpu_flags)(AVS_ScriptEnvironment *); -AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version); - -AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length); -AVSC_API(char *, avs_sprintf)(AVS_ScriptEnvironment *, const char * fmt, ...); - -AVSC_API(char *, avs_vsprintf)(AVS_ScriptEnvironment *, const char * fmt, va_list val); - // note: val is really a va_list; I hope everyone typedefs va_list to a pointer - -AVSC_API(int, avs_add_function)(AVS_ScriptEnvironment *, - const char * name, const char * params, - AVS_ApplyFunc apply, void * user_data); - -AVSC_API(int, avs_function_exists)(AVS_ScriptEnvironment *, const char * name); - -AVSC_API(AVS_Value, avs_invoke)(AVS_ScriptEnvironment *, const char * name, - AVS_Value args, const char** arg_names); -// The returned value must be be released with avs_release_value - -AVSC_API(AVS_Value, avs_get_var)(AVS_ScriptEnvironment *, const char* name); -// The returned value must be be released with avs_release_value - -AVSC_API(int, avs_set_var)(AVS_ScriptEnvironment *, const char* name, AVS_Value val); - -AVSC_API(int, avs_set_global_var)(AVS_ScriptEnvironment *, const char* name, const AVS_Value val); - -//void avs_push_context(AVS_ScriptEnvironment *, int level=0); -//void avs_pop_context(AVS_ScriptEnvironment *); - -AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *, - const AVS_VideoInfo * vi, int align); -// align should be at least 16 -#if defined __cplusplus -} -#endif // __cplusplus - -#ifndef AVSC_NO_DECLSPEC -AVSC_INLINE -AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env, - const AVS_VideoInfo * vi) - {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);} - -AVSC_INLINE -AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env, - const AVS_VideoInfo * vi) - {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);} -#endif - -#if defined __cplusplus -extern "C" -{ -#endif // __cplusplus -AVSC_API(int, avs_make_writable)(AVS_ScriptEnvironment *, AVS_VideoFrame * * pvf); - -AVSC_API(void, avs_bit_blt)(AVS_ScriptEnvironment *, unsigned char* dstp, int dst_pitch, const unsigned char* srcp, int src_pitch, int row_size, int height); - -typedef void (AVSC_CC *AVS_ShutdownFunc)(void* user_data, AVS_ScriptEnvironment * env); -AVSC_API(void, avs_at_exit)(AVS_ScriptEnvironment *, AVS_ShutdownFunc function, void * user_data); - -AVSC_API(AVS_VideoFrame *, avs_subframe)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height); -// The returned video frame must be be released - -AVSC_API(int, avs_set_memory_max)(AVS_ScriptEnvironment *, int mem); - -AVSC_API(int, avs_set_working_dir)(AVS_ScriptEnvironment *, const char * newdir); - -// avisynth.dll exports this; it's a way to use it as a library, without -// writing an AVS script or without going through AVIFile. -AVSC_API(AVS_ScriptEnvironment *, avs_create_script_environment)(int version); -#if defined __cplusplus -} -#endif // __cplusplus - -// this symbol is the entry point for the plugin and must -// be defined -AVSC_EXPORT -const char * AVSC_CC avisynth_c_plugin_init(AVS_ScriptEnvironment* env); - - -#if defined __cplusplus -extern "C" -{ -#endif // __cplusplus -AVSC_API(void, avs_delete_script_environment)(AVS_ScriptEnvironment *); - - -AVSC_API(AVS_VideoFrame *, avs_subframe_planar)(AVS_ScriptEnvironment *, AVS_VideoFrame * src, int rel_offset, int new_pitch, int new_row_size, int new_height, int rel_offsetU, int rel_offsetV, int new_pitchUV); -// The returned video frame must be be released -#if defined __cplusplus -} -#endif // __cplusplus - -#endif //__AVXSYNTH_C__ diff --git a/compat/avisynth/windowsPorts/basicDataTypeConversions.h b/compat/avisynth/windowsPorts/basicDataTypeConversions.h deleted file mode 100644 index ff367d5a..00000000 --- a/compat/avisynth/windowsPorts/basicDataTypeConversions.h +++ /dev/null @@ -1,85 +0,0 @@ -#ifndef __DATA_TYPE_CONVERSIONS_H__ -#define __DATA_TYPE_CONVERSIONS_H__ - -#include -#include - -#ifdef __cplusplus -namespace avxsynth { -#endif // __cplusplus - -typedef int64_t __int64; -typedef int32_t __int32; -#ifdef __cplusplus -typedef bool BOOL; -#else -typedef uint32_t BOOL; -#endif // __cplusplus -typedef void* HMODULE; -typedef void* LPVOID; -typedef void* PVOID; -typedef PVOID HANDLE; -typedef HANDLE HWND; -typedef HANDLE HINSTANCE; -typedef void* HDC; -typedef void* HBITMAP; -typedef void* HICON; -typedef void* HFONT; -typedef void* HGDIOBJ; -typedef void* HBRUSH; -typedef void* HMMIO; -typedef void* HACMSTREAM; -typedef void* HACMDRIVER; -typedef void* HIC; -typedef void* HACMOBJ; -typedef HACMSTREAM* LPHACMSTREAM; -typedef void* HACMDRIVERID; -typedef void* LPHACMDRIVER; -typedef unsigned char BYTE; -typedef BYTE* LPBYTE; -typedef char TCHAR; -typedef TCHAR* LPTSTR; -typedef const TCHAR* LPCTSTR; -typedef char* LPSTR; -typedef LPSTR LPOLESTR; -typedef const char* LPCSTR; -typedef LPCSTR LPCOLESTR; -typedef wchar_t WCHAR; -typedef unsigned short WORD; -typedef unsigned int UINT; -typedef UINT MMRESULT; -typedef uint32_t DWORD; -typedef DWORD COLORREF; -typedef DWORD FOURCC; -typedef DWORD HRESULT; -typedef DWORD* LPDWORD; -typedef DWORD* DWORD_PTR; -typedef int32_t LONG; -typedef int32_t* LONG_PTR; -typedef LONG_PTR LRESULT; -typedef uint32_t ULONG; -typedef uint32_t* ULONG_PTR; -//typedef __int64_t intptr_t; -typedef uint64_t _fsize_t; - - -// -// Structures -// - -typedef struct _GUID { - DWORD Data1; - WORD Data2; - WORD Data3; - BYTE Data4[8]; -} GUID; - -typedef GUID REFIID; -typedef GUID CLSID; -typedef CLSID* LPCLSID; -typedef GUID IID; - -#ifdef __cplusplus -}; // namespace avxsynth -#endif // __cplusplus -#endif // __DATA_TYPE_CONVERSIONS_H__ diff --git a/compat/avisynth/windowsPorts/windows2linux.h b/compat/avisynth/windowsPorts/windows2linux.h deleted file mode 100644 index 7cf46002..00000000 --- a/compat/avisynth/windowsPorts/windows2linux.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef __WINDOWS2LINUX_H__ -#define __WINDOWS2LINUX_H__ - -/* - * LINUX SPECIFIC DEFINITIONS -*/ -// -// Data types conversions -// -#include -#include -#include "basicDataTypeConversions.h" - -#ifdef __cplusplus -namespace avxsynth { -#endif // __cplusplus -// -// purposefully define the following MSFT definitions -// to mean nothing (as they do not mean anything on Linux) -// -#define __stdcall -#define __cdecl -#define noreturn -#define __declspec(x) -#define STDAPI extern "C" HRESULT -#define STDMETHODIMP HRESULT __stdcall -#define STDMETHODIMP_(x) x __stdcall - -#define STDMETHOD(x) virtual HRESULT x -#define STDMETHOD_(a, x) virtual a x - -#ifndef TRUE -#define TRUE true -#endif - -#ifndef FALSE -#define FALSE false -#endif - -#define S_OK (0x00000000) -#define S_FALSE (0x00000001) -#define E_NOINTERFACE (0X80004002) -#define E_POINTER (0x80004003) -#define E_FAIL (0x80004005) -#define E_OUTOFMEMORY (0x8007000E) - -#define INVALID_HANDLE_VALUE ((HANDLE)((LONG_PTR)-1)) -#define FAILED(hr) ((hr) & 0x80000000) -#define SUCCEEDED(hr) (!FAILED(hr)) - - -// -// Functions -// -#define MAKEDWORD(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) -#define MAKEWORD(a,b) (((a) << 8) | (b)) - -#define lstrlen strlen -#define lstrcpy strcpy -#define lstrcmpi strcasecmp -#define _stricmp strcasecmp -#define InterlockedIncrement(x) __sync_fetch_and_add((x), 1) -#define InterlockedDecrement(x) __sync_fetch_and_sub((x), 1) -// Windows uses (new, old) ordering but GCC has (old, new) -#define InterlockedCompareExchange(x,y,z) __sync_val_compare_and_swap(x,z,y) - -#define UInt32x32To64(a, b) ( (uint64_t) ( ((uint64_t)((uint32_t)(a))) * ((uint32_t)(b)) ) ) -#define Int64ShrlMod32(a, b) ( (uint64_t) ( (uint64_t)(a) >> (b) ) ) -#define Int32x32To64(a, b) ((__int64)(((__int64)((long)(a))) * ((long)(b)))) - -#define MulDiv(nNumber, nNumerator, nDenominator) (int32_t) (((int64_t) (nNumber) * (int64_t) (nNumerator) + (int64_t) ((nDenominator)/2)) / (int64_t) (nDenominator)) - -#ifdef __cplusplus -}; // namespace avxsynth -#endif // __cplusplus - -#endif // __WINDOWS2LINUX_H__ diff --git a/compat/cuda/cuda_runtime.h b/compat/cuda/cuda_runtime.h index 92c55ad8..5837c1ad 100644 --- a/compat/cuda/cuda_runtime.h +++ b/compat/cuda/cuda_runtime.h @@ -1,7 +1,7 @@ /* * Minimum CUDA compatibility definitions header * - * Copyright (c) 2019 Rodger Combs + * Copyright (c) 2019 rcombs * * This file is part of FFmpeg. * @@ -49,6 +49,16 @@ typedef struct __device_builtin__ __align__(4) ushort2 unsigned short x, y; } ushort2; +typedef struct __device_builtin__ __align__(8) float2 +{ + float x, y; +} float2; + +typedef struct __device_builtin__ __align__(8) int2 +{ + int x, y; +} int2; + typedef struct __device_builtin__ uint3 { unsigned int x, y, z; @@ -56,11 +66,6 @@ typedef struct __device_builtin__ uint3 typedef struct uint3 dim3; -typedef struct __device_builtin__ __align__(8) int2 -{ - int x, y; -} int2; - typedef struct __device_builtin__ __align__(4) uchar4 { unsigned char x, y, z, w; @@ -68,7 +73,7 @@ typedef struct __device_builtin__ __align__(4) uchar4 typedef struct __device_builtin__ __align__(8) ushort4 { - unsigned char x, y, z, w; + unsigned short x, y, z, w; } ushort4; typedef struct __device_builtin__ __align__(16) int4 @@ -76,6 +81,11 @@ typedef struct __device_builtin__ __align__(16) int4 int x, y, z, w; } int4; +typedef struct __device_builtin__ __align__(16) float4 +{ + float x, y, z, w; +} float4; + // Accessors for special registers #define GETCOMP(reg, comp) \ asm("mov.u32 %0, %%" #reg "." #comp ";" : "=r"(tmp)); \ @@ -100,24 +110,31 @@ GET(getThreadIdx, tid) #define threadIdx (getThreadIdx()) // Basic initializers (simple macros rather than inline functions) +#define make_int2(a, b) ((int2){.x = a, .y = b}) #define make_uchar2(a, b) ((uchar2){.x = a, .y = b}) #define make_ushort2(a, b) ((ushort2){.x = a, .y = b}) +#define make_float2(a, b) ((float2){.x = a, .y = b}) +#define make_int4(a, b, c, d) ((int4){.x = a, .y = b, .z = c, .w = d}) #define make_uchar4(a, b, c, d) ((uchar4){.x = a, .y = b, .z = c, .w = d}) #define make_ushort4(a, b, c, d) ((ushort4){.x = a, .y = b, .z = c, .w = d}) +#define make_float4(a, b, c, d) ((float4){.x = a, .y = b, .z = c, .w = d}) // Conversions from the tex instruction's 4-register output to various types #define TEX2D(type, ret) static inline __device__ void conv(type* out, unsigned a, unsigned b, unsigned c, unsigned d) {*out = (ret);} TEX2D(unsigned char, a & 0xFF) TEX2D(unsigned short, a & 0xFFFF) +TEX2D(float, a) TEX2D(uchar2, make_uchar2(a & 0xFF, b & 0xFF)) TEX2D(ushort2, make_ushort2(a & 0xFFFF, b & 0xFFFF)) +TEX2D(float2, make_float2(a, b)) TEX2D(uchar4, make_uchar4(a & 0xFF, b & 0xFF, c & 0xFF, d & 0xFF)) TEX2D(ushort4, make_ushort4(a & 0xFFFF, b & 0xFFFF, c & 0xFFFF, d & 0xFFFF)) +TEX2D(float4, make_float4(a, b, c, d)) // Template calling tex instruction and converting the output to the selected type -template -static inline __device__ T tex2D(cudaTextureObject_t texObject, float x, float y) +template +inline __device__ T tex2D(cudaTextureObject_t texObject, float x, float y) { T ret; unsigned ret1, ret2, ret3, ret4; @@ -128,4 +145,47 @@ static inline __device__ T tex2D(cudaTextureObject_t texObject, float x, float y return ret; } +template<> +inline __device__ float4 tex2D(cudaTextureObject_t texObject, float x, float y) +{ + float4 ret; + asm("tex.2d.v4.f32.f32 {%0, %1, %2, %3}, [%4, {%5, %6}];" : + "=r"(ret.x), "=r"(ret.y), "=r"(ret.z), "=r"(ret.w) : + "l"(texObject), "f"(x), "f"(y)); + return ret; +} + +template<> +inline __device__ float tex2D(cudaTextureObject_t texObject, float x, float y) +{ + return tex2D(texObject, x, y).x; +} + +template<> +inline __device__ float2 tex2D(cudaTextureObject_t texObject, float x, float y) +{ + float4 ret = tex2D(texObject, x, y); + return make_float2(ret.x, ret.y); +} + +// Math helper functions +static inline __device__ float floorf(float a) { return __builtin_floorf(a); } +static inline __device__ float floor(float a) { return __builtin_floorf(a); } +static inline __device__ double floor(double a) { return __builtin_floor(a); } +static inline __device__ float ceilf(float a) { return __builtin_ceilf(a); } +static inline __device__ float ceil(float a) { return __builtin_ceilf(a); } +static inline __device__ double ceil(double a) { return __builtin_ceil(a); } +static inline __device__ float truncf(float a) { return __builtin_truncf(a); } +static inline __device__ float trunc(float a) { return __builtin_truncf(a); } +static inline __device__ double trunc(double a) { return __builtin_trunc(a); } +static inline __device__ float fabsf(float a) { return __builtin_fabsf(a); } +static inline __device__ float fabs(float a) { return __builtin_fabsf(a); } +static inline __device__ double fabs(double a) { return __builtin_fabs(a); } +static inline __device__ float sqrtf(float a) { return __builtin_sqrtf(a); } + +static inline __device__ float __saturatef(float a) { return __nvvm_saturate_f(a); } +static inline __device__ float __sinf(float a) { return __nvvm_sin_approx_f(a); } +static inline __device__ float __cosf(float a) { return __nvvm_cos_approx_f(a); } +static inline __device__ float __expf(float a) { return __nvvm_ex2_approx_f(a * (float)__builtin_log2(__builtin_exp(1))); } + #endif /* COMPAT_CUDA_CUDA_RUNTIME_H */ diff --git a/compat/cuda/ptx2c.sh b/compat/cuda/ptx2c.sh deleted file mode 100755 index 0750e7a3..00000000 --- a/compat/cuda/ptx2c.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -# Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -# DEALINGS IN THE SOFTWARE. - -set -e - -OUT="$1" -IN="$2" -NAME="$(basename "$IN" | sed 's/\..*//')" - -printf "const char %s_ptx[] = \\" "$NAME" > "$OUT" -while IFS= read -r LINE -do - printf "\n\t\"%s\\\n\"" "$(printf "%s" "$LINE" | sed -e 's/\r//g' -e 's/["\\]/\\&/g')" >> "$OUT" -done < "$IN" -printf ";\n" >> "$OUT" - -exit 0 diff --git a/compat/msvcrt/snprintf.c b/compat/msvcrt/snprintf.c index c64653fe..43f5c3bb 100644 --- a/compat/msvcrt/snprintf.c +++ b/compat/msvcrt/snprintf.c @@ -59,7 +59,7 @@ int avpriv_vsnprintf(char *s, size_t n, const char *fmt, * recommends to provide _snprintf/_vsnprintf() a buffer size that * is one less than the actual buffer, and zero it before calling * _snprintf/_vsnprintf() to workaround this problem. - * See http://msdn.microsoft.com/en-us/library/1kt27hek(v=vs.80).aspx */ + * See https://web.archive.org/web/20151214111935/http://msdn.microsoft.com/en-us/library/1kt27hek(v=vs.80).aspx */ memset(s, 0, n); va_copy(ap_copy, ap); ret = _vsnprintf(s, n - 1, fmt, ap_copy); diff --git a/compat/os2threads.h b/compat/os2threads.h index 2177a033..a061eaa6 100644 --- a/compat/os2threads.h +++ b/compat/os2threads.h @@ -27,15 +27,19 @@ #define COMPAT_OS2THREADS_H #define INCL_DOS +#define INCL_DOSERRORS #include #undef __STRICT_ANSI__ /* for _beginthread() */ #include +#include #include #include #include "libavutil/attributes.h" +#include "libavutil/common.h" +#include "libavutil/time.h" typedef struct { TID tid; @@ -163,6 +167,28 @@ static av_always_inline int pthread_cond_broadcast(pthread_cond_t *cond) return 0; } +static av_always_inline int pthread_cond_timedwait(pthread_cond_t *cond, + pthread_mutex_t *mutex, + const struct timespec *abstime) +{ + int64_t abs_milli = abstime->tv_sec * 1000LL + abstime->tv_nsec / 1000000; + ULONG t = av_clip64(abs_milli - av_gettime() / 1000, 0, ULONG_MAX); + + __atomic_increment(&cond->wait_count); + + pthread_mutex_unlock(mutex); + + APIRET ret = DosWaitEventSem(cond->event_sem, t); + + __atomic_decrement(&cond->wait_count); + + DosPostEventSem(cond->ack_sem); + + pthread_mutex_lock(mutex); + + return (ret == ERROR_TIMEOUT) ? ETIMEDOUT : 0; +} + static av_always_inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) { diff --git a/compat/w32dlfcn.h b/compat/w32dlfcn.h index c83bdc93..fb1aa1b7 100644 --- a/compat/w32dlfcn.h +++ b/compat/w32dlfcn.h @@ -20,11 +20,40 @@ #define COMPAT_W32DLFCN_H #ifdef _WIN32 +#include + #include + #include "config.h" -#if (_WIN32_WINNT < 0x0602) || HAVE_WINRT +#include "libavutil/macros.h" #include "libavutil/wchar_filename.h" -#endif + +static inline wchar_t *get_module_filename(HMODULE module) +{ + wchar_t *path = NULL, *new_path; + DWORD path_size = 0, path_len; + + do { + path_size = path_size ? FFMIN(2 * path_size, INT16_MAX + 1) : MAX_PATH; + new_path = av_realloc_array(path, path_size, sizeof *path); + if (!new_path) { + av_free(path); + return NULL; + } + path = new_path; + // Returns path_size in case of insufficient buffer. + // Whether the error is set or not and whether the output + // is null-terminated or not depends on the version of Windows. + path_len = GetModuleFileNameW(module, path, path_size); + } while (path_len && path_size <= INT16_MAX && path_size <= path_len); + + if (!path_len) { + av_free(path); + return NULL; + } + return path; +} + /** * Safe function used to open dynamic libs. This attempts to improve program security * by removing the current directory from the dll search path. Only dll's found in the @@ -34,29 +63,53 @@ */ static inline HMODULE win32_dlopen(const char *name) { + wchar_t *name_w; + HMODULE module = NULL; + if (utf8towchar(name, &name_w)) + name_w = NULL; #if _WIN32_WINNT < 0x0602 - // Need to check if KB2533623 is available + // On Win7 and earlier we check if KB2533623 is available if (!GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "SetDefaultDllDirectories")) { - HMODULE module = NULL; - wchar_t *path = NULL, *name_w = NULL; - DWORD pathlen; - if (utf8towchar(name, &name_w)) + wchar_t *path = NULL, *new_path; + DWORD pathlen, pathsize, namelen; + if (!name_w) goto exit; - path = (wchar_t *)av_mallocz_array(MAX_PATH, sizeof(wchar_t)); + namelen = wcslen(name_w); // Try local directory first - pathlen = GetModuleFileNameW(NULL, path, MAX_PATH); - pathlen = wcsrchr(path, '\\') - path; - if (pathlen == 0 || pathlen + wcslen(name_w) + 2 > MAX_PATH) + path = get_module_filename(NULL); + if (!path) goto exit; - path[pathlen] = '\\'; + new_path = wcsrchr(path, '\\'); + if (!new_path) + goto exit; + pathlen = new_path - path; + pathsize = pathlen + namelen + 2; + new_path = av_realloc_array(path, pathsize, sizeof *path); + if (!new_path) + goto exit; + path = new_path; wcscpy(path + pathlen + 1, name_w); module = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); if (module == NULL) { // Next try System32 directory - pathlen = GetSystemDirectoryW(path, MAX_PATH); - if (pathlen == 0 || pathlen + wcslen(name_w) + 2 > MAX_PATH) + pathlen = GetSystemDirectoryW(path, pathsize); + if (!pathlen) goto exit; - path[pathlen] = '\\'; + // Buffer is not enough in two cases: + // 1. system directory + \ + module name + // 2. system directory even without the module name. + if (pathlen + namelen + 2 > pathsize) { + pathsize = pathlen + namelen + 2; + new_path = av_realloc_array(path, pathsize, sizeof *path); + if (!new_path) + goto exit; + path = new_path; + // Query again to handle the case #2. + pathlen = GetSystemDirectoryW(path, pathsize); + if (!pathlen) + goto exit; + } + path[pathlen] = L'\\'; wcscpy(path + pathlen + 1, name_w); module = LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); } @@ -73,16 +126,19 @@ exit: # define LOAD_LIBRARY_SEARCH_SYSTEM32 0x00000800 #endif #if HAVE_WINRT - wchar_t *name_w = NULL; - int ret; - if (utf8towchar(name, &name_w)) + if (!name_w) return NULL; - ret = LoadPackagedLibrary(name_w, 0); - av_free(name_w); - return ret; + module = LoadPackagedLibrary(name_w, 0); #else - return LoadLibraryExA(name, NULL, LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32); +#define LOAD_FLAGS (LOAD_LIBRARY_SEARCH_APPLICATION_DIR | LOAD_LIBRARY_SEARCH_SYSTEM32) + /* filename may be be in CP_ACP */ + if (!name_w) + return LoadLibraryExA(name, NULL, LOAD_FLAGS); + module = LoadLibraryExW(name_w, NULL, LOAD_FLAGS); +#undef LOAD_FLAGS #endif + av_free(name_w); + return module; } #define dlopen(name, flags) win32_dlopen(name) #define dlclose FreeLibrary diff --git a/compat/w32pthreads.h b/compat/w32pthreads.h index 21acfd2b..6405e72b 100644 --- a/compat/w32pthreads.h +++ b/compat/w32pthreads.h @@ -38,11 +38,13 @@ #define WIN32_LEAN_AND_MEAN #include #include +#include #include "libavutil/attributes.h" #include "libavutil/common.h" #include "libavutil/internal.h" #include "libavutil/mem.h" +#include "libavutil/time.h" typedef struct pthread_t { void *handle; @@ -61,6 +63,9 @@ typedef CONDITION_VARIABLE pthread_cond_t; #define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0) #define WaitForSingleObject(a, b) WaitForSingleObjectEx(a, b, FALSE) +#define PTHREAD_CANCEL_ENABLE 1 +#define PTHREAD_CANCEL_DISABLE 0 + static av_unused unsigned __stdcall attribute_align_arg win32thread_worker(void *arg) { pthread_t *h = (pthread_t*)arg; @@ -156,10 +161,31 @@ static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex return 0; } +static inline int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, + const struct timespec *abstime) +{ + int64_t abs_milli = abstime->tv_sec * 1000LL + abstime->tv_nsec / 1000000; + DWORD t = av_clip64(abs_milli - av_gettime() / 1000, 0, UINT32_MAX); + + if (!SleepConditionVariableSRW(cond, mutex, t, 0)) { + DWORD err = GetLastError(); + if (err == ERROR_TIMEOUT) + return ETIMEDOUT; + else + return EINVAL; + } + return 0; +} + static inline int pthread_cond_signal(pthread_cond_t *cond) { WakeConditionVariable(cond); return 0; } +static inline int pthread_setcancelstate(int state, int *oldstate) +{ + return 0; +} + #endif /* COMPAT_W32PTHREADS_H */ diff --git a/configure b/configure index 34c2adb4..ba5793b2 100755 --- a/configure +++ b/configure @@ -132,7 +132,6 @@ Component options: --disable-swscale disable libswscale build --disable-postproc disable libpostproc build --disable-avfilter disable libavfilter build - --enable-avresample enable libavresample build (deprecated) [no] --disable-pthreads disable pthreads [autodetect] --disable-w32threads disable Win32 threads [autodetect] --disable-os2threads disable OS/2 threads [autodetect] @@ -141,7 +140,6 @@ Component options: --disable-dwt disable DWT code --disable-error-resilience disable error resilience code --disable-lsp disable LSP code - --disable-lzo disable LZO decoder code --disable-mdct disable MDCT code --disable-rdft disable RDFT code --disable-fft disable FFT code @@ -190,9 +188,9 @@ External library support: Using any of the following switches will allow FFmpeg to link to the corresponding external library. All the components depending on that library will become enabled, if all their other dependencies are met and they are not - explicitly disabled. E.g. --enable-libwavpack will enable linking to - libwavpack and allow the libwavpack encoder to be built, unless it is - specifically disabled with --disable-encoder=libwavpack. + explicitly disabled. E.g. --enable-libopus will enable linking to + libopus and allow the libopus encoder to be built, unless it is + specifically disabled with --disable-encoder=libopus. Note that only the system libraries are auto-detected. All the other external libraries must be explicitly enabled. @@ -217,6 +215,7 @@ External library support: --disable-iconv disable iconv [autodetect] --enable-jni enable JNI support [no] --enable-ladspa enable LADSPA audio filtering [no] + --enable-lcms2 enable ICC profile support via LittleCMS 2 [no] --enable-libaom enable AV1 video encoding/decoding via libaom [no] --enable-libaribb24 enable ARIB text and caption decoding via libaribb24 [no] --enable-libass enable libass subtitles rendering, @@ -236,11 +235,13 @@ External library support: --enable-libfontconfig enable libfontconfig, useful for drawtext filter [no] --enable-libfreetype enable libfreetype, needed for drawtext filter [no] --enable-libfribidi enable libfribidi, improves drawtext filter [no] + --enable-libglslang enable GLSL->SPIRV compilation via libglslang [no] --enable-libgme enable Game Music Emu via libgme [no] --enable-libgsm enable GSM de/encoding via libgsm [no] --enable-libiec61883 enable iec61883 via libiec61883 [no] --enable-libilbc enable iLBC de/encoding via libilbc [no] --enable-libjack enable JACK audio sound server [no] + --enable-libjxl enable JPEG XL de/encoding via libjxl [no] --enable-libklvanc enable Kernel Labs VANC processing [no] --enable-libkvazaar enable HEVC encoding via libkvazaar [no] --enable-liblensfun enable lensfun lens correction [no] @@ -252,11 +253,18 @@ External library support: --enable-libopenh264 enable H.264 encoding via OpenH264 [no] --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no] --enable-libopenmpt enable decoding tracked files via libopenmpt [no] + --enable-libopenvino enable OpenVINO as a DNN module backend + for DNN based filters like dnn_processing [no] --enable-libopus enable Opus de/encoding via libopus [no] + --enable-libplacebo enable libplacebo library [no] --enable-libpulse enable Pulseaudio input via libpulse [no] + --enable-librabbitmq enable RabbitMQ library [no] + --enable-librav1e enable AV1 encoding via rav1e [no] + --enable-librist enable RIST via librist [no] --enable-librsvg enable SVG rasterization via librsvg [no] --enable-librubberband enable rubberband needed for rubberband filter [no] --enable-librtmp enable RTMP[E] support via librtmp [no] + --enable-libshaderc enable GLSL->SPIRV compilation via libshaderc [no] --enable-libshine enable fixed-point MP3 encoding via libshine [no] --enable-libsmbclient enable Samba protocol via libsmbclient [no] --enable-libsnappy enable Snappy compression, needed for hap encoding [no] @@ -264,6 +272,7 @@ External library support: --enable-libspeex enable Speex de/encoding via libspeex [no] --enable-libsrt enable Haivision SRT protocol via libsrt [no] --enable-libssh enable SFTP protocol via libssh [no] + --enable-libsvtav1 enable AV1 encoding via SVT [no] --enable-libtensorflow enable TensorFlow as a DNN module backend for DNN based filters like sr [no] --enable-libtesseract enable Tesseract, needed for ocr filter [no] @@ -271,6 +280,7 @@ External library support: --enable-libtls enable LibreSSL (via libtls), needed for https support if openssl, gnutls or mbedtls is not used [no] --enable-libtwolame enable MP2 encoding via libtwolame [no] + --enable-libuavs3d enable AVS3 decoding via libuavs3d [no] --enable-libv4l2 enable libv4l2/v4l-utils [no] --enable-libvidstab enable video stabilization using vid.stab [no] --enable-libvmaf enable vmaf filter via libvmaf [no] @@ -278,7 +288,6 @@ External library support: --enable-libvorbis enable Vorbis en/decoding via libvorbis, native implementation exists [no] --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no] - --enable-libwavpack enable wavpack encoding via libwavpack [no] --enable-libwebp enable WebP encoding via libwebp [no] --enable-libx264 enable H.264 encoding via x264 [no] --enable-libx265 enable HEVC encoding via x265 [no] @@ -291,7 +300,7 @@ External library support: --enable-libxvid enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] --enable-libxml2 enable XML parsing using the C library libxml2, needed - for dash demuxing support [no] + for dash and imf demuxing support [no] --enable-libzimg enable z.lib, needed for zscale filter [no] --enable-libzmq enable message passing via libzmq [no] --enable-libzvbi enable teletext support via libzvbi [no] @@ -301,6 +310,8 @@ External library support: --enable-mbedtls enable mbedTLS, needed for https support if openssl, gnutls or libtls is not used [no] --enable-mediacodec enable Android MediaCodec support [no] + --enable-mediafoundation enable encoding via MediaFoundation [auto] + --disable-metal disable Apple Metal framework [autodetect] --enable-libmysofa enable libmysofa, needed for sofalizer filter [no] --enable-openal enable OpenAL 1.1 capture support [no] --enable-opencl enable OpenCL processing [no] @@ -315,6 +326,7 @@ External library support: --disable-securetransport disable Secure Transport, needed for TLS support on OSX if openssl and gnutls are not used [autodetect] --enable-vapoursynth enable VapourSynth demuxer [no] + --disable-vulkan disable Vulkan code [autodetect] --disable-xlib disable xlib [autodetect] --disable-zlib disable zlib [autodetect] @@ -373,6 +385,8 @@ Toolchain options: --dep-cc=DEPCC use dependency generator DEPCC [$cc_default] --nvcc=NVCC use Nvidia CUDA compiler NVCC or clang [$nvcc_default] --ld=LD use linker LD [$ld_default] + --metalcc=METALCC use metal compiler METALCC [$metalcc_default] + --metallib=METALLIB use metal linker METALLIB [$metallib_default] --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default] --pkg-config-flags=FLAGS pass additional flags to pkgconf [] --ranlib=RANLIB use ranlib RANLIB [$ranlib_default] @@ -431,6 +445,7 @@ Optimization options (experts only): --disable-fma4 disable FMA4 optimizations --disable-avx2 disable AVX2 optimizations --disable-avx512 disable AVX-512 optimizations + --disable-avx512icl disable AVX-512ICL optimizations --disable-aesni disable AESNI optimizations --disable-armv5te disable armv5te optimizations --disable-armv6 disable armv6 optimizations @@ -442,9 +457,10 @@ Optimization options (experts only): --disable-mipsdsp disable MIPS DSP ASE R1 optimizations --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations --disable-msa disable MSA optimizations - --disable-msa2 disable MSA2 optimizations --disable-mipsfpu disable floating point MIPS optimizations - --disable-mmi disable Loongson SIMD optimizations + --disable-mmi disable Loongson MMI optimizations + --disable-lsx disable Loongson LSX optimizations + --disable-lasx disable Loongson LASX optimizations --disable-fast-unaligned consider unaligned accesses slow Developer options (useful when working on FFmpeg itself): @@ -481,6 +497,9 @@ Developer options (useful when working on FFmpeg itself): --ignore-tests=TESTS comma-separated list (without "fate-" prefix in the name) of tests whose result is ignored --enable-linux-perf enable Linux Performance Monitor API + --enable-macos-kperf enable macOS kperf (private) API + --disable-large-tests disable tests that use a large amount of memory + --disable-ptx-compression don't compress CUDA PTX code even when possible NOTE: Object files are built at the place where configure is launched. EOF @@ -526,7 +545,7 @@ die(){ If you think configure made a mistake, make sure you are using the latest version from Git. If the latest version fails, report the problem to the -ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net. +ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat. EOF if disabled logging; then cat <> $logfile 2>&1; } } @@ -1547,11 +1602,11 @@ require_cc(){ } require_cpp(){ - name="$1" - headers="$2" - classes="$3" - shift 3 - check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found" + log require_cpp "$@" + name_version="$1" + name="${1%% *}" + shift + check_lib_cpp "$name" "$@" || die "ERROR: $name_version not found" } require_headers(){ @@ -1572,6 +1627,12 @@ require_pkg_config(){ check_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message" } +require_pkg_config_cpp(){ + log require_pkg_config_cpp "$@" + pkg_version="$2" + check_pkg_config_cpp "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message" +} + test_host_cc(){ log test_host_cc "$@" cat > $TMPC @@ -1662,7 +1723,7 @@ COMPONENT_LIST=" " EXAMPLE_LIST=" - avio_dir_cmd_example + avio_list_dir_example avio_reading_example decode_audio_example decode_video_example @@ -1699,6 +1760,8 @@ EXTERNAL_AUTODETECT_LIBRARY_LIST=" libxcb_shape libxcb_xfixes lzma + mediafoundation + metal schannel sdl2 securetransport @@ -1724,7 +1787,6 @@ EXTERNAL_LIBRARY_GPL_LIST=" EXTERNAL_LIBRARY_NONFREE_LIST=" decklink libfdk_aac - openssl libtls " @@ -1734,7 +1796,6 @@ EXTERNAL_LIBRARY_VERSION3_LIST=" liblensfun libopencore_amrnb libopencore_amrwb - libvmaf libvo_amrwbenc mbedtls rkmpp @@ -1754,6 +1815,7 @@ EXTERNAL_LIBRARY_LIST=" gnutls jni ladspa + lcms2 libaom libass libbluray @@ -1768,11 +1830,13 @@ EXTERNAL_LIBRARY_LIST=" libfontconfig libfreetype libfribidi + libglslang libgme libgsm libiec61883 libilbc libjack + libjxl libklvanc libkvazaar libmodplug @@ -1782,10 +1846,16 @@ EXTERNAL_LIBRARY_LIST=" libopenh264 libopenjpeg libopenmpt + libopenvino libopus + libplacebo libpulse + librabbitmq + librav1e + librist librsvg librtmp + libshaderc libshine libsmbclient libsnappy @@ -1793,14 +1863,16 @@ EXTERNAL_LIBRARY_LIST=" libspeex libsrt libssh + libsvtav1 libtensorflow libtesseract libtheora libtwolame + libuavs3d libv4l2 + libvmaf libvorbis libvpx - libwavpack libwebp libxml2 libzimg @@ -1810,6 +1882,7 @@ EXTERNAL_LIBRARY_LIST=" mediacodec openal opengl + openssl pocketsphinx vapoursynth " @@ -1829,8 +1902,8 @@ HWACCEL_AUTODETECT_LIBRARY_LIST=" vaapi vdpau videotoolbox + vulkan v4l2_m2m - xvmc " # catchall list of things that require external libs to link @@ -1883,7 +1956,6 @@ LIBRARY_LIST=" avformat avcodec swresample - avresample avutil " @@ -1907,7 +1979,6 @@ SUBSYSTEM_LIST=" fast_unaligned fft lsp - lzo mdct pixelutils network @@ -1929,11 +2000,14 @@ CONFIG_LIST=" $SUBSYSTEM_LIST autodetect fontconfig + large_tests linux_perf + macos_kperf memory_poisoning neon_clobber_test ossfuzz pic + ptx_compression thumb valgrind_backtrace xmm_clobber_test @@ -1967,12 +2041,16 @@ ARCH_LIST=" avr32_uc bfin ia64 + loongarch + loongarch32 + loongarch64 m68k mips mips64 parisc ppc ppc64 + riscv s390 sh4 sparc @@ -2006,13 +2084,14 @@ ARCH_EXT_LIST_MIPS=" mipsdsp mipsdspr2 msa - msa2 " ARCH_EXT_LIST_LOONGSON=" loongson2 loongson3 mmi + lsx + lasx " ARCH_EXT_LIST_X86_SIMD=" @@ -2022,6 +2101,7 @@ ARCH_EXT_LIST_X86_SIMD=" avx avx2 avx512 + avx512icl fma3 fma4 mmx @@ -2108,6 +2188,7 @@ HEADERS_LIST=" ES2_gl_h gsm_h io_h + linux_dma_buf_h linux_perf_event_h machine_ioctl_bt848_h machine_ioctl_meteor_h @@ -2190,12 +2271,16 @@ SYSTEM_FUNCS=" CommandLineToArgvW fcntl getaddrinfo + getauxval + getenv gethrtime getopt + GetModuleHandle GetProcessAffinityMask GetProcessMemoryInfo GetProcessTimes getrusage + GetStdHandle GetSystemTimeAsFileTime gettimeofday glob @@ -2221,6 +2306,7 @@ SYSTEM_FUNCS=" SecItemImport SetConsoleTextAttribute SetConsoleCtrlHandler + SetDllDirectory setmode setrlimit Sleep @@ -2267,7 +2353,22 @@ TOOLCHAIN_FEATURES=" TYPES_LIST=" kCMVideoCodecType_HEVC + kCMVideoCodecType_HEVCWithAlpha + kCMVideoCodecType_VP9 kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange + kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange + kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange + kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange + kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange + kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange + kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange + kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ + kCVImageBufferTransferFunction_ITU_R_2100_HLG + kCVImageBufferTransferFunction_Linear + kCVImageBufferYCbCrMatrix_ITU_R_2020 + kCVImageBufferColorPrimaries_ITU_R_2020 + kCVImageBufferTransferFunction_ITU_R_2020 + kCVImageBufferTransferFunction_SMPTE_ST_428_1 socklen_t struct_addrinfo struct_group_source_req @@ -2302,6 +2403,8 @@ HAVE_LIST=" $THREADS_LIST $TOOLCHAIN_FEATURES $TYPES_LIST + gzip + libdrm_getfb2 makeinfo makeinfo_html opencl_d3d11 @@ -2313,6 +2416,8 @@ HAVE_LIST=" perl pod2man texi2html + xmllint + zlib_gzip " # options emitted with CONFIG_ prefix but not available on the command line @@ -2320,6 +2425,7 @@ CONFIG_EXTRA=" aandcttables ac3dsp adts_header + atsc_a53 audio_frame_queue audiodsp blockdsp @@ -2332,8 +2438,10 @@ CONFIG_EXTRA=" cbs_jpeg cbs_mpeg2 cbs_vp9 + deflate_wrapper dirac_parse dnn + dovi_rpu dvprofile exif faandct @@ -2359,6 +2467,7 @@ CONFIG_EXTRA=" idctdsp iirfilter mdct15 + inflate_wrapper intrax8 iso_media ividsp @@ -2375,7 +2484,9 @@ CONFIG_EXTRA=" mpegaudio mpegaudiodsp mpegaudioheader + mpeg4audio mpegvideo + mpegvideodec mpegvideoenc mss34dsp pixblockdsp @@ -2468,6 +2579,8 @@ CMDLINE_SET=" ln_s logfile malloc_prefix + metalcc + metallib nm optflags nvcc @@ -2525,6 +2638,10 @@ power8_deps="vsx" loongson2_deps="mips" loongson3_deps="mips" +mmi_deps_any="loongson2 loongson3" +lsx_deps="loongarch" +lasx_deps="lsx" + mips32r2_deps="mips" mips32r5_deps="mips" mips32r6_deps="mips" @@ -2533,9 +2650,7 @@ mips64r6_deps="mips" mipsfpu_deps="mips" mipsdsp_deps="mips" mipsdspr2_deps="mips" -mmi_deps="mips" msa_deps="mipsfpu" -msa2_deps="msa" cpunop_deps="i686" x86_64_select="i686" @@ -2559,6 +2674,7 @@ fma3_deps="avx" fma4_deps="avx" avx2_deps="avx" avx512_deps="avx2" +avx512icl_deps="avx512" mmx_external_deps="x86asm" mmx_inline_deps="inline_asm x86" @@ -2572,7 +2688,7 @@ for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do done aligned_stack_if_any="aarch64 ppc x86" -fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64" +fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64" fast_clz_if_any="aarch64 alpha avr32 mips ppc x86" fast_unaligned_if_any="aarch64 ppc x86" simd_align_16_if_any="altivec neon sse" @@ -2601,50 +2717,56 @@ cbs_jpeg_select="cbs" cbs_mpeg2_select="cbs" cbs_vp9_select="cbs" dct_select="rdft" +deflate_wrapper_deps="zlib" dirac_parse_select="golomb" -dnn_suggest="libtensorflow" +dovi_rpu_select="golomb" +dnn_suggest="libtensorflow libopenvino" +dnn_deps="avformat swscale" error_resilience_select="me_cmp" faandct_deps="faan" faandct_select="fdctdsp" faanidct_deps="faan" faanidct_select="idctdsp" h264dsp_select="startcode" -hevcparse_select="golomb" +hevcparse_select="atsc_a53 golomb" frame_thread_encoder_deps="encoders threads" +inflate_wrapper_deps="zlib" intrax8_select="blockdsp idctdsp" +iso_media_select="mpeg4audio" mdct_select="fft" mdct15_select="fft" me_cmp_select="fdctdsp idctdsp pixblockdsp" mpeg_er_select="error_resilience" mpegaudio_select="mpegaudiodsp mpegaudioheader" mpegaudiodsp_select="dct" -mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp me_cmp mpeg_er videodsp" +mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp videodsp" +mpegvideodec_select="mpegvideo mpeg_er" mpegvideoenc_select="aandcttables me_cmp mpegvideo pixblockdsp qpeldsp" vc1dsp_select="h264chroma qpeldsp startcode" rdft_select="fft" # decoders / encoders -aac_decoder_select="adts_header mdct15 mdct sinewin" -aac_fixed_decoder_select="adts_header mdct sinewin" +aac_decoder_select="adts_header mdct15 mdct mpeg4audio sinewin" +aac_fixed_decoder_select="adts_header mdct mpeg4audio" aac_encoder_select="audio_frame_queue iirfilter lpc mdct sinewin" aac_latm_decoder_select="aac_decoder aac_latm_parser" ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct" ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp mdct" ac3_encoder_select="ac3dsp audiodsp mdct me_cmp" ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp" +acelp_kelvin_decoder_select="audiodsp" adpcm_g722_decoder_select="g722dsp" adpcm_g722_encoder_select="g722dsp" aic_decoder_select="golomb idctdsp" alac_encoder_select="lpc" -als_decoder_select="bswapdsp" +als_decoder_select="bswapdsp mpeg4audio" amrnb_decoder_select="lsp" amrwb_decoder_select="lsp" amv_decoder_select="sp5x_decoder exif" amv_encoder_select="jpegtables mpegvideoenc" ape_decoder_select="bswapdsp llauddsp" -apng_decoder_deps="zlib" -apng_encoder_deps="zlib" -apng_encoder_select="llvidencdsp" +apng_decoder_select="inflate_wrapper" +apng_encoder_select="deflate_wrapper llvidencdsp" aptx_decoder_select="audio_frame_queue" aptx_encoder_select="audio_frame_queue" aptx_hd_decoder_select="audio_frame_queue" @@ -2655,9 +2777,11 @@ asv2_decoder_select="blockdsp bswapdsp idctdsp" asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp" atrac1_decoder_select="mdct sinewin" atrac3_decoder_select="mdct" +atrac3al_decoder_select="mdct" atrac3p_decoder_select="mdct sinewin" +atrac3pal_decoder_select="mdct sinewin" atrac9_decoder_select="mdct" -avrn_decoder_select="exif jpegtables" +av1_decoder_select="av1_frame_split_bsf cbs_av1" bink_decoder_select="blockdsp hpeldsp" binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs" binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs" @@ -2666,9 +2790,10 @@ clearvideo_decoder_select="idctdsp" cllc_decoder_select="bswapdsp" comfortnoise_encoder_select="lpc" cook_decoder_select="audiodsp mdct sinewin" -cscd_decoder_select="lzo" +cri_decoder_select="mjpeg_decoder" cscd_decoder_suggest="zlib" dca_decoder_select="mdct" +dca_encoder_select="mdct" dds_decoder_select="texturedsp" dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc" dnxhd_decoder_select="blockdsp idctdsp" @@ -2684,6 +2809,7 @@ eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo" eatgq_decoder_select="aandcttables" eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp" exr_decoder_deps="zlib" +exr_encoder_deps="zlib" ffv1_decoder_select="rangecoder" ffv1_encoder_select="rangecoder" ffvhuff_decoder_select="huffyuv_decoder" @@ -2691,9 +2817,9 @@ ffvhuff_encoder_select="huffyuv_encoder" fic_decoder_select="golomb" flac_decoder_select="flacdsp" flac_encoder_select="bswapdsp flacdsp lpc" -flashsv2_decoder_deps="zlib" -flashsv2_encoder_deps="zlib" -flashsv_decoder_deps="zlib" +flashsv2_decoder_select="inflate_wrapper" +flashsv2_encoder_select="deflate_wrapper" +flashsv_decoder_select="inflate_wrapper" flashsv_encoder_deps="zlib" flv_decoder_select="h263_decoder" flv_encoder_select="h263_encoder" @@ -2702,36 +2828,39 @@ fraps_decoder_select="bswapdsp huffman" g2m_decoder_deps="zlib" g2m_decoder_select="blockdsp idctdsp jpegtables" g729_decoder_select="audiodsp" -h261_decoder_select="mpegvideo" +h261_decoder_select="mpegvideodec" h261_encoder_select="mpegvideoenc" -h263_decoder_select="h263_parser h263dsp mpegvideo qpeldsp" +h263_decoder_select="h263_parser h263dsp mpegvideodec qpeldsp" h263_encoder_select="h263dsp mpegvideoenc" h263i_decoder_select="h263_decoder" h263p_decoder_select="h263_decoder" h263p_encoder_select="h263_encoder" -h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel videodsp" +h264_decoder_select="atsc_a53 cabac golomb h264chroma h264dsp h264parse h264pred h264qpel videodsp" h264_decoder_suggest="error_resilience" hap_decoder_select="snappy texturedsp" hap_encoder_deps="libsnappy" hap_encoder_select="texturedspenc" -hevc_decoder_select="bswapdsp cabac golomb hevcparse videodsp" +hevc_decoder_select="atsc_a53 bswapdsp cabac dovi_rpu golomb hevcparse videodsp" huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp" huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp" hymt_decoder_select="huffyuv_decoder" iac_decoder_select="imc_decoder" imc_decoder_select="bswapdsp fft mdct sinewin" +imm4_decoder_select="bswapdsp" +imm5_decoder_select="h264_decoder hevc_decoder" indeo3_decoder_select="hpeldsp" indeo4_decoder_select="ividsp" indeo5_decoder_select="ividsp" interplay_video_decoder_select="hpeldsp" +ipu_decoder_select="mpegvideodec" jpegls_decoder_select="mjpeg_decoder" jv_decoder_select="blockdsp" lagarith_decoder_select="llviddsp" -ljpeg_encoder_select="idctdsp jpegtables mpegvideoenc" -lscr_decoder_deps="zlib" +ljpeg_encoder_select="idctdsp jpegtables" +lscr_decoder_select="inflate_wrapper" magicyuv_decoder_select="llviddsp" magicyuv_encoder_select="llvidencdsp" -mdec_decoder_select="blockdsp idctdsp mpegvideo" +mdec_decoder_select="blockdsp bswapdsp idctdsp mpegvideo" metasound_decoder_select="lsp mdct sinewin" mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp" mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables" @@ -2739,6 +2868,7 @@ mjpeg_encoder_select="jpegtables mpegvideoenc" mjpegb_decoder_select="mjpeg_decoder" mlp_decoder_select="mlp_parser" mlp_encoder_select="lpc audio_frame_queue" +mobiclip_decoder_select="bswapdsp golomb" motionpixels_decoder_select="bswapdsp" mp1_decoder_select="mpegaudio" mp1float_decoder_select="mpegaudio" @@ -2748,38 +2878,40 @@ mp3_decoder_select="mpegaudio" mp3adu_decoder_select="mpegaudio" mp3adufloat_decoder_select="mpegaudio" mp3float_decoder_select="mpegaudio" -mp3on4_decoder_select="mpegaudio" -mp3on4float_decoder_select="mpegaudio" +mp3on4_decoder_select="mpegaudio mpeg4audio" +mp3on4float_decoder_select="mpegaudio mpeg4audio" mpc7_decoder_select="bswapdsp mpegaudiodsp" mpc8_decoder_select="mpegaudiodsp" -mpegvideo_decoder_select="mpegvideo" -mpeg1video_decoder_select="mpegvideo" +mpegvideo_decoder_select="mpegvideodec" +mpeg1video_decoder_select="mpegvideodec" mpeg1video_encoder_select="mpegvideoenc h263dsp" -mpeg2video_decoder_select="mpegvideo" +mpeg2video_decoder_select="mpegvideodec" mpeg2video_encoder_select="mpegvideoenc h263dsp" mpeg4_decoder_select="h263_decoder mpeg4video_parser" mpeg4_encoder_select="h263_encoder" msa1_decoder_select="mss34dsp" -mscc_decoder_deps="zlib" +mscc_decoder_select="inflate_wrapper" msmpeg4v1_decoder_select="h263_decoder" msmpeg4v2_decoder_select="h263_decoder" msmpeg4v2_encoder_select="h263_encoder" msmpeg4v3_decoder_select="h263_decoder" msmpeg4v3_encoder_select="h263_encoder" -mss2_decoder_select="mpegvideo qpeldsp vc1_decoder" -mts2_decoder_select="mss34dsp" -mwsc_decoder_deps="zlib" +mss2_decoder_select="mpegvideodec qpeldsp vc1_decoder" +mts2_decoder_select="jpegtables mss34dsp" +mv30_decoder_select="aandcttables blockdsp" +mvha_decoder_select="inflate_wrapper llviddsp" +mwsc_decoder_select="inflate_wrapper" mxpeg_decoder_select="mjpeg_decoder" nellymoser_decoder_select="mdct sinewin" nellymoser_encoder_select="audio_frame_queue mdct sinewin" -nuv_decoder_select="idctdsp lzo" +notchlc_decoder_select="lzf" +nuv_decoder_select="idctdsp" on2avc_decoder_select="mdct" opus_decoder_deps="swresample" opus_decoder_select="mdct15" opus_encoder_select="audio_frame_queue mdct15" -png_decoder_deps="zlib" -png_encoder_deps="zlib" -png_encoder_select="llvidencdsp" +png_decoder_select="inflate_wrapper" +png_encoder_select="deflate_wrapper llvidencdsp" prores_decoder_select="blockdsp idctdsp" prores_encoder_select="fdctdsp" qcelp_decoder_select="lsp" @@ -2787,7 +2919,7 @@ qdm2_decoder_select="mdct rdft mpegaudiodsp" ra_144_decoder_select="audiodsp" ra_144_encoder_select="audio_frame_queue lpc audiodsp" ralf_decoder_select="golomb" -rasc_decoder_deps="zlib" +rasc_decoder_select="inflate_wrapper" rawvideo_decoder_select="bswapdsp" rscc_decoder_deps="zlib" rtjpeg_decoder_select="me_cmp" @@ -2795,11 +2927,12 @@ rv10_decoder_select="h263_decoder" rv10_encoder_select="h263_encoder" rv20_decoder_select="h263_decoder" rv20_encoder_select="h263_encoder" -rv30_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp" -rv40_decoder_select="golomb h264pred h264qpel mpegvideo rv34dsp" +rv30_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp" +rv40_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp" screenpresso_decoder_deps="zlib" shorten_decoder_select="bswapdsp" sipr_decoder_select="lsp" +smvjpeg_decoder_select="mjpeg_decoder" snow_decoder_select="dwt h264qpel hpeldsp me_cmp rangecoder videodsp" snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder" sonic_decoder_select="golomb rangecoder" @@ -2807,7 +2940,8 @@ sonic_encoder_select="golomb rangecoder" sonic_ls_encoder_select="golomb rangecoder" sp5x_decoder_select="mjpeg_decoder" speedhq_decoder_select="mpegvideo" -srgc_decoder_deps="zlib" +speedhq_encoder_select="mpegvideoenc" +srgc_decoder_select="inflate_wrapper" svq1_decoder_select="hpeldsp" svq1_encoder_select="hpeldsp me_cmp mpegvideoenc" svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp" @@ -2817,19 +2951,22 @@ tdsc_decoder_deps="zlib" tdsc_decoder_select="mjpeg_decoder" theora_decoder_select="vp3_decoder" thp_decoder_select="mjpeg_decoder" +tiff_decoder_select="mjpeg_decoder" tiff_decoder_suggest="zlib lzma" tiff_encoder_suggest="zlib" truehd_decoder_select="mlp_parser" truehd_encoder_select="lpc audio_frame_queue" truemotion2_decoder_select="bswapdsp" truespeech_decoder_select="bswapdsp" -tscc_decoder_deps="zlib" +tscc_decoder_select="inflate_wrapper" twinvq_decoder_select="mdct lsp sinewin" txd_decoder_select="texturedsp" utvideo_decoder_select="bswapdsp llviddsp" utvideo_encoder_select="bswapdsp huffman llvidencdsp" vble_decoder_select="llviddsp" -vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideo vc1dsp" +vbn_decoder_select="texturedsp" +vbn_encoder_select="texturedspenc" +vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideodec vc1dsp" vc1image_decoder_select="vc1_decoder" vorbis_decoder_select="mdct" vorbis_encoder_select="audio_frame_queue mdct" @@ -2842,7 +2979,7 @@ vp6f_decoder_select="vp6_decoder" vp7_decoder_select="h264pred videodsp vp8dsp" vp8_decoder_select="h264pred videodsp vp8dsp" vp9_decoder_select="videodsp vp9_parser vp9_superframe_split_bsf" -wcmv_decoder_deps="zlib" +wcmv_decoder_select="inflate_wrapper" webp_decoder_select="vp8_decoder exif" wmalossless_decoder_select="llauddsp" wmapro_decoder_select="mdct sinewin wma_freqs" @@ -2859,11 +2996,12 @@ wmv3_decoder_select="vc1_decoder" wmv3image_decoder_select="wmv3_decoder" xma1_decoder_select="wmapro_decoder" xma2_decoder_select="wmapro_decoder" -zerocodec_decoder_deps="zlib" -zlib_decoder_deps="zlib" -zlib_encoder_deps="zlib" -zmbv_decoder_deps="zlib" -zmbv_encoder_deps="zlib" +ylc_decoder_select="bswapdsp" +zerocodec_decoder_select="inflate_wrapper" +zlib_decoder_select="inflate_wrapper" +zlib_encoder_select="deflate_wrapper" +zmbv_decoder_select="inflate_wrapper" +zmbv_encoder_select="deflate_wrapper" # hardware accelerators crystalhd_deps="libcrystalhd_libcrystalhd_if_h" @@ -2873,11 +3011,23 @@ d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext" dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32" ffnvcodec_deps_any="libdl LoadLibrary" nvdec_deps="ffnvcodec" -vaapi_x11_deps="xlib" +vaapi_x11_deps="xlib_x11" videotoolbox_hwaccel_deps="videotoolbox pthreads" videotoolbox_hwaccel_extralibs="-framework QuartzCore" -xvmc_deps="X11_extensions_XvMClib_h" +vulkan_deps_any="libdl LoadLibrary" +av1_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_AV1" +av1_d3d11va_hwaccel_select="av1_decoder" +av1_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_AV1" +av1_d3d11va2_hwaccel_select="av1_decoder" +av1_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_AV1" +av1_dxva2_hwaccel_select="av1_decoder" +av1_nvdec_hwaccel_deps="nvdec CUVIDAV1PICPARAMS" +av1_nvdec_hwaccel_select="av1_decoder" +av1_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferAV1_bit_depth_idx" +av1_vaapi_hwaccel_select="av1_decoder" +av1_vdpau_hwaccel_deps="vdpau VdpPictureInfoAV1" +av1_vdpau_hwaccel_select="av1_decoder" h263_vaapi_hwaccel_deps="vaapi" h263_vaapi_hwaccel_select="h263_decoder" h263_videotoolbox_hwaccel_deps="videotoolbox" @@ -2914,16 +3064,12 @@ mjpeg_nvdec_hwaccel_deps="nvdec" mjpeg_nvdec_hwaccel_select="mjpeg_decoder" mjpeg_vaapi_hwaccel_deps="vaapi" mjpeg_vaapi_hwaccel_select="mjpeg_decoder" -mpeg_xvmc_hwaccel_deps="xvmc" -mpeg_xvmc_hwaccel_select="mpeg2video_decoder" mpeg1_nvdec_hwaccel_deps="nvdec" mpeg1_nvdec_hwaccel_select="mpeg1video_decoder" mpeg1_vdpau_hwaccel_deps="vdpau" mpeg1_vdpau_hwaccel_select="mpeg1video_decoder" mpeg1_videotoolbox_hwaccel_deps="videotoolbox" mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder" -mpeg1_xvmc_hwaccel_deps="xvmc" -mpeg1_xvmc_hwaccel_select="mpeg1video_decoder" mpeg2_d3d11va_hwaccel_deps="d3d11va" mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder" mpeg2_d3d11va2_hwaccel_deps="d3d11va" @@ -2938,8 +3084,6 @@ mpeg2_vdpau_hwaccel_deps="vdpau" mpeg2_vdpau_hwaccel_select="mpeg2video_decoder" mpeg2_videotoolbox_hwaccel_deps="videotoolbox" mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder" -mpeg2_xvmc_hwaccel_deps="xvmc" -mpeg2_xvmc_hwaccel_select="mpeg2video_decoder" mpeg4_nvdec_hwaccel_deps="nvdec" mpeg4_nvdec_hwaccel_select="mpeg4_decoder" mpeg4_vaapi_hwaccel_deps="vaapi" @@ -2948,6 +3092,8 @@ mpeg4_vdpau_hwaccel_deps="vdpau" mpeg4_vdpau_hwaccel_select="mpeg4_decoder" mpeg4_videotoolbox_hwaccel_deps="videotoolbox" mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder" +prores_videotoolbox_hwaccel_deps="videotoolbox" +prores_videotoolbox_hwaccel_select="prores_decoder" vc1_d3d11va_hwaccel_deps="d3d11va" vc1_d3d11va_hwaccel_select="vc1_decoder" vc1_d3d11va2_hwaccel_deps="d3d11va" @@ -2974,6 +3120,10 @@ vp9_nvdec_hwaccel_deps="nvdec" vp9_nvdec_hwaccel_select="vp9_decoder" vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth" vp9_vaapi_hwaccel_select="vp9_decoder" +vp9_vdpau_hwaccel_deps="vdpau VdpPictureInfoVP9" +vp9_vdpau_hwaccel_select="vp9_decoder" +vp9_videotoolbox_hwaccel_deps="videotoolbox" +vp9_videotoolbox_hwaccel_select="vp9_decoder" wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel" wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel" wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel" @@ -2982,6 +3132,7 @@ wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel" wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel" # hardware-accelerated codecs +mediafoundation_deps="mftransform_h MFCreateAlignedMemoryBuffer" omx_deps="libdl pthreads" omx_rpi_select="omx" qsv_deps="libmfx" @@ -2991,19 +3142,27 @@ qsvvpp_select="qsv" vaapi_encode_deps="vaapi" v4l2_m2m_deps="linux_videodev2_h sem_timedwait" +chromakey_cuda_filter_deps="ffnvcodec" +chromakey_cuda_filter_deps_any="cuda_nvcc cuda_llvm" hwupload_cuda_filter_deps="ffnvcodec" scale_npp_filter_deps="ffnvcodec libnpp" +scale2ref_npp_filter_deps="ffnvcodec libnpp" scale_cuda_filter_deps="ffnvcodec" scale_cuda_filter_deps_any="cuda_nvcc cuda_llvm" thumbnail_cuda_filter_deps="ffnvcodec" thumbnail_cuda_filter_deps_any="cuda_nvcc cuda_llvm" transpose_npp_filter_deps="ffnvcodec libnpp" +overlay_cuda_filter_deps="ffnvcodec" +overlay_cuda_filter_deps_any="cuda_nvcc cuda_llvm" +sharpen_npp_filter_deps="ffnvcodec libnpp" amf_deps_any="libdl LoadLibrary" nvenc_deps="ffnvcodec" nvenc_deps_any="libdl LoadLibrary" -nvenc_encoder_deps="nvenc" +aac_mf_encoder_deps="mediafoundation" +ac3_mf_encoder_deps="mediafoundation" +av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS" h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m" h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m" h264_amf_encoder_deps="amf" @@ -3012,11 +3171,13 @@ h264_cuvid_decoder_deps="cuvid" h264_cuvid_decoder_select="h264_mp4toannexb_bsf" h264_mediacodec_decoder_deps="mediacodec" h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser" +h264_mf_encoder_deps="mediafoundation" h264_mmal_decoder_deps="mmal" h264_nvenc_encoder_deps="nvenc" +h264_nvenc_encoder_select="atsc_a53" h264_omx_encoder_deps="omx" -h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec" -h264_qsv_encoder_select="qsvenc" +h264_qsv_decoder_select="h264_mp4toannexb_bsf qsvdec" +h264_qsv_encoder_select="atsc_a53 qsvenc" h264_rkmpp_decoder_deps="rkmpp" h264_rkmpp_decoder_select="h264_mp4toannexb_bsf" h264_vaapi_encoder_select="cbs_h264 vaapi_encode" @@ -3028,8 +3189,10 @@ hevc_cuvid_decoder_deps="cuvid" hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf" hevc_mediacodec_decoder_deps="mediacodec" hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser" +hevc_mf_encoder_deps="mediafoundation" hevc_nvenc_encoder_deps="nvenc" -hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser qsvdec" +hevc_nvenc_encoder_select="atsc_a53" +hevc_qsv_decoder_select="hevc_mp4toannexb_bsf qsvdec" hevc_qsv_encoder_select="hevcparse qsvenc" hevc_rkmpp_decoder_deps="rkmpp" hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf" @@ -3039,17 +3202,19 @@ hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m" hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf" hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m" mjpeg_cuvid_decoder_deps="cuvid" +mjpeg_qsv_decoder_select="qsvdec" mjpeg_qsv_encoder_deps="libmfx" mjpeg_qsv_encoder_select="qsvenc" mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG" mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode" +mp3_mf_encoder_deps="mediafoundation" mpeg1_cuvid_decoder_deps="cuvid" mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m" mpeg2_crystalhd_decoder_select="crystalhd" mpeg2_cuvid_decoder_deps="cuvid" mpeg2_mmal_decoder_deps="mmal" mpeg2_mediacodec_decoder_deps="mediacodec" -mpeg2_qsv_decoder_select="qsvdec mpegvideo_parser" +mpeg2_qsv_decoder_select="qsvdec" mpeg2_qsv_encoder_select="qsvenc" mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode" mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m" @@ -3061,16 +3226,14 @@ mpeg4_omx_encoder_deps="omx" mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m" mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m" msmpeg4_crystalhd_decoder_select="crystalhd" -nvenc_h264_encoder_select="h264_nvenc_encoder" -nvenc_hevc_encoder_select="hevc_nvenc_encoder" vc1_crystalhd_decoder_select="crystalhd" vc1_cuvid_decoder_deps="cuvid" vc1_mmal_decoder_deps="mmal" -vc1_qsv_decoder_select="qsvdec vc1_parser" +vc1_qsv_decoder_select="qsvdec" vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m" vp8_cuvid_decoder_deps="cuvid" vp8_mediacodec_decoder_deps="mediacodec" -vp8_qsv_decoder_select="qsvdec vp8_parser" +vp8_qsv_decoder_select="qsvdec" vp8_rkmpp_decoder_deps="rkmpp" vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8" vp8_vaapi_encoder_select="vaapi_encode" @@ -3078,24 +3241,29 @@ vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m" vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m" vp9_cuvid_decoder_deps="cuvid" vp9_mediacodec_decoder_deps="mediacodec" +vp9_qsv_decoder_select="qsvdec" vp9_rkmpp_decoder_deps="rkmpp" vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9" vp9_vaapi_encoder_select="vaapi_encode" +vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9" +vp9_qsv_encoder_select="qsvenc" vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m" wmv3_crystalhd_decoder_select="crystalhd" +av1_qsv_decoder_select="qsvdec" # parsers -aac_parser_select="adts_header" +aac_parser_select="adts_header mpeg4audio" av1_parser_select="cbs_av1" -h264_parser_select="golomb h264dsp h264parse" +h264_parser_select="atsc_a53 golomb h264dsp h264parse" hevc_parser_select="hevcparse" mpegaudio_parser_select="mpegaudioheader" mpegvideo_parser_select="mpegvideo" -mpeg4video_parser_select="h263dsp mpegvideo qpeldsp" +mpeg4video_parser_select="h263dsp mpegvideodec qpeldsp" vc1_parser_select="vc1dsp" # bitstream_filters -aac_adtstoasc_bsf_select="adts_header" +aac_adtstoasc_bsf_select="adts_header mpeg4audio" +av1_frame_merge_bsf_select="cbs_av1" av1_frame_split_bsf_select="cbs_av1" av1_metadata_bsf_select="cbs_av1" eac3_core_bsf_select="ac3_parser" @@ -3146,9 +3314,11 @@ pcm_mulaw_at_encoder_deps="audiotoolbox" pcm_mulaw_at_encoder_select="audio_frame_queue" chromaprint_muxer_deps="chromaprint" h264_videotoolbox_encoder_deps="pthreads" -h264_videotoolbox_encoder_select="videotoolbox_encoder" +h264_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder" hevc_videotoolbox_encoder_deps="pthreads" -hevc_videotoolbox_encoder_select="videotoolbox_encoder" +hevc_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder" +prores_videotoolbox_encoder_deps="pthreads" +prores_videotoolbox_encoder_select="videotoolbox_encoder" libaom_av1_decoder_deps="libaom" libaom_av1_encoder_deps="libaom" libaom_av1_encoder_select="extract_extradata_bsf" @@ -3157,7 +3327,9 @@ libcelt_decoder_deps="libcelt" libcodec2_decoder_deps="libcodec2" libcodec2_encoder_deps="libcodec2" libdav1d_decoder_deps="libdav1d" +libdav1d_decoder_select="atsc_a53" libdavs2_decoder_deps="libdavs2" +libdavs2_decoder_select="avs2_parser" libfdk_aac_decoder_deps="libfdk_aac" libfdk_aac_encoder_deps="libfdk_aac" libfdk_aac_encoder_select="audio_frame_queue" @@ -3168,6 +3340,8 @@ libgsm_ms_decoder_deps="libgsm" libgsm_ms_encoder_deps="libgsm" libilbc_decoder_deps="libilbc" libilbc_encoder_deps="libilbc" +libjxl_decoder_deps="libjxl libjxl_threads" +libjxl_encoder_deps="libjxl libjxl_threads" libkvazaar_encoder_deps="libkvazaar" libmodplug_demuxer_deps="libmodplug" libmp3lame_encoder_deps="libmp3lame" @@ -3185,14 +3359,18 @@ libopenmpt_demuxer_deps="libopenmpt" libopus_decoder_deps="libopus" libopus_encoder_deps="libopus" libopus_encoder_select="audio_frame_queue" +librav1e_encoder_deps="librav1e" +librav1e_encoder_select="extract_extradata_bsf" librsvg_decoder_deps="librsvg" libshine_encoder_deps="libshine" -libshine_encoder_select="audio_frame_queue" +libshine_encoder_select="audio_frame_queue mpegaudioheader" libspeex_decoder_deps="libspeex" libspeex_encoder_deps="libspeex" libspeex_encoder_select="audio_frame_queue" +libsvtav1_encoder_deps="libsvtav1" libtheora_encoder_deps="libtheora" libtwolame_encoder_deps="libtwolame" +libuavs3d_decoder_deps="libuavs3d" libvo_amrwbenc_encoder_deps="libvo_amrwbenc" libvorbis_decoder_deps="libvorbis" libvorbis_encoder_deps="libvorbis libvorbisenc" @@ -3201,13 +3379,12 @@ libvpx_vp8_decoder_deps="libvpx" libvpx_vp8_encoder_deps="libvpx" libvpx_vp9_decoder_deps="libvpx" libvpx_vp9_encoder_deps="libvpx" -libwavpack_encoder_deps="libwavpack" -libwavpack_encoder_select="audio_frame_queue" libwebp_encoder_deps="libwebp" libwebp_anim_encoder_deps="libwebp" libx262_encoder_deps="libx262" libx264_encoder_deps="libx264" -libx264rgb_encoder_deps="libx264 x264_csp_bgr" +libx264_encoder_select="atsc_a53" +libx264rgb_encoder_deps="libx264" libx264rgb_encoder_select="libx264_encoder" libx265_encoder_deps="libx265" libxavs_encoder_deps="libxavs" @@ -3221,14 +3398,19 @@ videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrame # demuxers / muxers ac3_demuxer_select="ac3_parser" +act_demuxer_select="riffdec" +adts_muxer_select="mpeg4audio" aiff_muxer_select="iso_media" +amv_muxer_select="riffenc" asf_demuxer_select="riffdec" asf_o_demuxer_select="riffdec" asf_muxer_select="riffenc" asf_stream_muxer_select="asf_muxer" -avi_demuxer_select="iso_media riffdec exif" +av1_demuxer_select="av1_frame_merge_bsf av1_parser" +avi_demuxer_select="riffdec exif" avi_muxer_select="riffenc" -caf_demuxer_select="iso_media riffdec" +avif_muxer_select="mov_muxer" +caf_demuxer_select="iso_media" caf_muxer_select="iso_media" dash_muxer_select="mp4_muxer" dash_demuxer_deps="libxml2" @@ -3242,40 +3424,50 @@ eac3_demuxer_select="ac3_parser" f4v_muxer_select="mov_muxer" fifo_muxer_deps="threads" flac_demuxer_select="flac_parser" +flv_muxer_select="aac_adtstoasc_bsf" +gxf_muxer_select="pcm_rechunk_bsf" hds_muxer_select="flv_muxer" +hls_demuxer_select="adts_header ac3_parser" hls_muxer_select="mpegts_muxer" hls_muxer_suggest="gcrypt openssl" image2_alias_pix_demuxer_select="image2_demuxer" image2_brender_pix_demuxer_select="image2_demuxer" +imf_demuxer_deps="libxml2" +imf_demuxer_select="mxf_demuxer" ipod_muxer_select="mov_muxer" ismv_muxer_select="mov_muxer" ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf" +latm_muxer_select="aac_adtstoasc_bsf mpeg4audio" matroska_audio_muxer_select="matroska_muxer" -matroska_demuxer_select="iso_media riffdec" -matroska_demuxer_suggest="bzlib lzo zlib" -matroska_muxer_select="iso_media riffenc" +matroska_demuxer_select="riffdec" +matroska_demuxer_suggest="bzlib zlib" +matroska_muxer_select="mpeg4audio riffenc aac_adtstoasc_bsf pgs_frame_merge_bsf vp9_superframe_bsf" +mlp_demuxer_select="mlp_parser" mmf_muxer_select="riffenc" mov_demuxer_select="iso_media riffdec" mov_demuxer_suggest="zlib" -mov_muxer_select="iso_media riffenc rtpenc_chain" +mov_muxer_select="iso_media riffenc rtpenc_chain vp9_superframe_bsf aac_adtstoasc_bsf ac3_parser" mp3_demuxer_select="mpegaudio_parser" mp3_muxer_select="mpegaudioheader" mp4_muxer_select="mov_muxer" mpegts_demuxer_select="iso_media" -mpegts_muxer_select="adts_muxer latm_muxer" +mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf hevc_mp4toannexb_bsf" mpegtsraw_demuxer_select="mpegts_demuxer" +mxf_muxer_select="pcm_rechunk_bsf" mxf_d10_muxer_select="mxf_muxer" mxf_opatom_muxer_select="mxf_muxer" nut_muxer_select="riffenc" nuv_demuxer_select="riffdec" +obu_demuxer_select="av1_frame_merge_bsf av1_parser" +obu_muxer_select="av1_metadata_bsf" oga_muxer_select="ogg_muxer" ogg_demuxer_select="dirac_parse" ogv_muxer_select="ogg_muxer" opus_muxer_select="ogg_muxer" psp_muxer_select="mov_muxer" rtp_demuxer_select="sdp_demuxer" -rtp_muxer_select="golomb" -rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp" +rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer" +rtpdec_select="asf_demuxer mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp" rtsp_demuxer_select="http_protocol rtpdec" rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain" sap_demuxer_select="sdp_demuxer" @@ -3287,6 +3479,7 @@ spdif_muxer_select="adts_header" spx_muxer_select="ogg_muxer" swf_demuxer_suggest="zlib" tak_demuxer_select="tak_parser" +truehd_demuxer_select="mlp_parser" tg2_muxer_select="mov_muxer" tgp_muxer_select="mov_muxer" vobsub_demuxer_select="mpegps_demuxer" @@ -3294,7 +3487,7 @@ w64_demuxer_select="wav_demuxer" w64_muxer_select="wav_muxer" wav_demuxer_select="riffdec" wav_muxer_select="riffenc" -webm_muxer_select="iso_media riffenc" +webm_chunk_muxer_select="webm_muxer" webm_dash_manifest_demuxer_select="matroska_demuxer" wtv_demuxer_select="mpegts_demuxer riffdec" wtv_muxer_select="mpegts_muxer riffenc" @@ -3309,11 +3502,14 @@ alsa_outdev_deps="alsa" avfoundation_indev_deps="avfoundation corevideo coremedia pthreads" avfoundation_indev_suggest="coregraphics applicationservices" avfoundation_indev_extralibs="-framework Foundation" +audiotoolbox_outdev_deps="audiotoolbox pthreads" +audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework CoreAudio" bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h" caca_outdev_deps="libcaca" decklink_deps_any="libdl LoadLibrary" decklink_indev_deps="decklink threads" decklink_indev_extralibs="-lstdc++" +decklink_indev_suggest="libzvbi" decklink_outdev_deps="decklink threads" decklink_outdev_suggest="libklvanc" decklink_outdev_extralibs="-lstdc++" @@ -3348,7 +3544,7 @@ v4l2_outdev_suggest="libv4l2" vfwcap_indev_deps="vfw32 vfwcap_defines" xcbgrab_indev_deps="libxcb" xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes" -xv_outdev_deps="xlib" +xv_outdev_deps="xlib_xv xlib_x11 xlib_xext" # protocols async_protocol_deps="threads" @@ -3359,7 +3555,8 @@ ffrtmpcrypt_protocol_select="tcp_protocol" ffrtmphttp_protocol_conflict="librtmp_protocol" ffrtmphttp_protocol_select="http_protocol" ftp_protocol_select="tcp_protocol" -gopher_protocol_select="network" +gopher_protocol_select="tcp_protocol" +gophers_protocol_select="tls_protocol" http_protocol_select="tcp_protocol" http_protocol_suggest="zlib" httpproxy_protocol_select="tcp_protocol" @@ -3396,8 +3593,14 @@ udp_protocol_select="network" udplite_protocol_select="network" unix_protocol_deps="sys_un_h" unix_protocol_select="network" +ipfs_protocol_select="https_protocol" +ipns_protocol_select="https_protocol" # external library protocols +libamqp_protocol_deps="librabbitmq" +libamqp_protocol_select="network" +librist_protocol_deps="librist" +librist_protocol_select="network" librtmp_protocol_deps="librtmp" librtmpe_protocol_deps="librtmp" librtmps_protocol_deps="librtmp" @@ -3408,75 +3611,76 @@ libsrt_protocol_deps="libsrt" libsrt_protocol_select="network" libssh_protocol_deps="libssh" libtls_conflict="openssl gnutls mbedtls" +libzmq_protocol_deps="libzmq" +libzmq_protocol_select="network" # filters -afftdn_filter_deps="avcodec" -afftdn_filter_select="fft" -afftfilt_filter_deps="avcodec" -afftfilt_filter_select="fft" -afir_filter_deps="avcodec" -afir_filter_select="fft" +ametadata_filter_deps="avformat" amovie_filter_deps="avcodec avformat" aresample_filter_deps="swresample" asr_filter_deps="pocketsphinx" ass_filter_deps="libass" -atempo_filter_deps="avcodec" -atempo_filter_select="rdft" avgblur_opencl_filter_deps="opencl" +avgblur_vulkan_filter_deps="vulkan spirv_compiler" azmq_filter_deps="libzmq" blackframe_filter_deps="gpl" +blend_vulkan_filter_deps="vulkan spirv_compiler" bm3d_filter_deps="avcodec" bm3d_filter_select="dct" boxblur_filter_deps="gpl" boxblur_opencl_filter_deps="opencl gpl" bs2b_filter_deps="libbs2b" +chromaber_vulkan_filter_deps="vulkan spirv_compiler" colorkey_opencl_filter_deps="opencl" colormatrix_filter_deps="gpl" convolution_opencl_filter_deps="opencl" -convolve_filter_deps="avcodec" -convolve_filter_select="fft" coreimage_filter_deps="coreimage appkit" coreimage_filter_extralibs="-framework OpenGL" coreimagesrc_filter_deps="coreimage appkit" coreimagesrc_filter_extralibs="-framework OpenGL" cover_rect_filter_deps="avcodec avformat gpl" cropdetect_filter_deps="gpl" -deconvolve_filter_deps="avcodec" -deconvolve_filter_select="fft" deinterlace_qsv_filter_deps="libmfx" deinterlace_vaapi_filter_deps="vaapi" delogo_filter_deps="gpl" denoise_vaapi_filter_deps="vaapi" derain_filter_select="dnn" deshake_filter_select="pixelutils" +deshake_opencl_filter_deps="opencl" dilation_opencl_filter_deps="opencl" +dnn_classify_filter_select="dnn" +dnn_detect_filter_select="dnn" +dnn_processing_filter_select="dnn" drawtext_filter_deps="libfreetype" drawtext_filter_suggest="libfontconfig libfribidi" elbg_filter_deps="avcodec" eq_filter_deps="gpl" erosion_opencl_filter_deps="opencl" -fftfilt_filter_deps="avcodec" -fftfilt_filter_select="rdft" -fftdnoiz_filter_deps="avcodec" -fftdnoiz_filter_select="fft" find_rect_filter_deps="avcodec avformat gpl" firequalizer_filter_deps="avcodec" firequalizer_filter_select="rdft" +flip_vulkan_filter_deps="vulkan spirv_compiler" flite_filter_deps="libflite" framerate_filter_select="scene_sad" freezedetect_filter_select="scene_sad" -frei0r_filter_deps="frei0r libdl" -frei0r_src_filter_deps="frei0r libdl" +frei0r_deps_any="libdl LoadLibrary" +frei0r_filter_deps="frei0r" +frei0r_src_filter_deps="frei0r" fspp_filter_deps="gpl" -geq_filter_deps="gpl" +gblur_vulkan_filter_deps="vulkan spirv_compiler" +hflip_vulkan_filter_deps="vulkan spirv_compiler" histeq_filter_deps="gpl" hqdn3d_filter_deps="gpl" +iccdetect_filter_deps="lcms2" +iccgen_filter_deps="lcms2" interlace_filter_deps="gpl" kerndeint_filter_deps="gpl" ladspa_filter_deps="ladspa libdl" lensfun_filter_deps="liblensfun version3" +libplacebo_filter_deps="libplacebo vulkan" lv2_filter_deps="lv2" mcdeint_filter_deps="avcodec gpl" +metadata_filter_deps="avformat" movie_filter_deps="avcodec avformat" mpdecimate_filter_deps="gpl" mpdecimate_filter_select="pixelutils" @@ -3491,7 +3695,10 @@ openclsrc_filter_deps="opencl" overlay_opencl_filter_deps="opencl" overlay_qsv_filter_deps="libmfx" overlay_qsv_filter_select="qsvvpp" +overlay_vaapi_filter_deps="vaapi VAProcPipelineCaps_blend_flags" +overlay_vulkan_filter_deps="vulkan spirv_compiler" owdenoise_filter_deps="gpl" +pad_opencl_filter_deps="opencl" pan_filter_deps="swresample" perspective_filter_deps="gpl" phase_filter_deps="gpl" @@ -3501,33 +3708,26 @@ prewitt_opencl_filter_deps="opencl" procamp_vaapi_filter_deps="vaapi" program_opencl_filter_deps="opencl" pullup_filter_deps="gpl" +remap_opencl_filter_deps="opencl" removelogo_filter_deps="avcodec avformat swscale" repeatfields_filter_deps="gpl" -resample_filter_deps="avresample" roberts_opencl_filter_deps="opencl" rubberband_filter_deps="librubberband" sab_filter_deps="gpl swscale" scale2ref_filter_deps="swscale" scale_filter_deps="swscale" scale_qsv_filter_deps="libmfx" +scdet_filter_select="scene_sad" select_filter_select="scene_sad" sharpness_vaapi_filter_deps="vaapi" -showcqt_filter_deps="avcodec avformat swscale" +showcqt_filter_deps="avformat swscale" showcqt_filter_suggest="libfontconfig libfreetype" -showcqt_filter_select="fft" -showfreqs_filter_deps="avcodec" -showfreqs_filter_select="fft" -showspectrum_filter_deps="avcodec" -showspectrum_filter_select="fft" -showspectrumpic_filter_deps="avcodec" -showspectrumpic_filter_select="fft" +showspatial_filter_deps="avcodec" +showspatial_filter_select="fft" signature_filter_deps="gpl avcodec avformat" smartblur_filter_deps="gpl swscale" sobel_opencl_filter_deps="opencl" -sofalizer_filter_deps="libmysofa avcodec" -sofalizer_filter_select="fft" -spectrumsynth_filter_deps="avcodec" -spectrumsynth_filter_select="fft" +sofalizer_filter_deps="libmysofa" spp_filter_deps="gpl avcodec" spp_filter_select="fft idctdsp fdctdsp me_cmp pixblockdsp" sr_filter_deps="avformat swscale" @@ -3540,26 +3740,32 @@ tinterlace_filter_deps="gpl" tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" tonemap_filter_deps="const_nan" +tonemap_vaapi_filter_deps="vaapi VAProcFilterParameterBufferHDRToneMapping" tonemap_opencl_filter_deps="opencl const_nan" transpose_opencl_filter_deps="opencl" transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags" +transpose_vulkan_filter_deps="vulkan spirv_compiler" unsharp_opencl_filter_deps="opencl" uspp_filter_deps="gpl avcodec" vaguedenoiser_filter_deps="gpl" +vflip_vulkan_filter_deps="vulkan spirv_compiler" vidstabdetect_filter_deps="libvidstab" vidstabtransform_filter_deps="libvidstab" -libvmaf_filter_deps="libvmaf pthreads" +libvmaf_filter_deps="libvmaf" zmq_filter_deps="libzmq" zoompan_filter_deps="swscale" zscale_filter_deps="libzimg const_nan" scale_vaapi_filter_deps="vaapi" +scale_vulkan_filter_deps="vulkan spirv_compiler" vpp_qsv_filter_deps="libmfx" vpp_qsv_filter_select="qsvvpp" +xfade_opencl_filter_deps="opencl" yadif_cuda_filter_deps="ffnvcodec" yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm" +yadif_videotoolbox_filter_deps="metal corevideo videotoolbox" # examples -avio_dir_cmd_deps="avformat avutil" +avio_list_dir_deps="avformat avutil" avio_reading_deps="avformat avcodec avutil" decode_audio_example_deps="avcodec avutil" decode_video_example_deps="avcodec avutil" @@ -3589,23 +3795,20 @@ cws2fws_extralibs="zlib_extralibs" # libraries, in any order avcodec_deps="avutil" -avcodec_suggest="libm" -avcodec_select="null_bsf" +avcodec_suggest="libm stdatomic" avdevice_deps="avformat avcodec avutil" -avdevice_suggest="libm" +avdevice_suggest="libm stdatomic" avfilter_deps="avutil" -avfilter_suggest="libm" +avfilter_suggest="libm stdatomic" avformat_deps="avcodec avutil" -avformat_suggest="libm network zlib" -avresample_deps="avutil" -avresample_suggest="libm" -avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi videotoolbox corefoundation corevideo coremedia bcrypt" +avformat_suggest="libm network zlib stdatomic" +avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic" postproc_deps="avutil gpl" -postproc_suggest="libm" +postproc_suggest="libm stdatomic" swresample_deps="avutil" -swresample_suggest="libm libsoxr" +swresample_suggest="libm libsoxr stdatomic" swscale_deps="avutil" -swscale_suggest="libm" +swscale_suggest="libm stdatomic" avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs" avfilter_extralibs="pthreads_extralibs" @@ -3652,6 +3855,8 @@ host_cc_default="gcc" doxygen_default="doxygen" install="install" ln_s_default="ln -s -f" +metalcc_default="xcrun -sdk macosx metal" +metallib_default="xcrun -sdk macosx metallib" nm_default="nm -g" pkg_config_default=pkg-config ranlib_default="ranlib" @@ -3681,14 +3886,16 @@ intrinsics="none" enable $PROGRAM_LIST enable $DOCUMENT_LIST enable $EXAMPLE_LIST -enable $(filter_out avresample $LIBRARY_LIST) +enable $LIBRARY_LIST enable stripping enable asm enable debug enable doc enable faan faandct faanidct +enable large_tests enable optimizations +enable ptx_compression enable runtime_cpudetect enable safe_bitstream_reader enable static @@ -3789,7 +3996,7 @@ find_things_extern(){ find_filters_extern(){ file=$source_path/$1 - sed -n 's/^extern AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file + sed -n 's/^extern const AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file } FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c) @@ -3797,14 +4004,14 @@ OUTDEV_LIST=$(find_things_extern muxer AVOutputFormat libavdevice/alldevices.c o INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev) MUXER_LIST=$(find_things_extern muxer AVOutputFormat libavformat/allformats.c) DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c) -ENCODER_LIST=$(find_things_extern encoder AVCodec libavcodec/allcodecs.c) -DECODER_LIST=$(find_things_extern decoder AVCodec libavcodec/allcodecs.c) +ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c) +DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c) CODEC_LIST=" $ENCODER_LIST $DECODER_LIST " PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c) -BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c) +BSF_LIST=$(find_things_extern bsf FFBitStreamFilter libavcodec/bitstream_filters.c) HWACCEL_LIST=$(find_things_extern hwaccel AVHWAccel libavcodec/hwaccels.h) PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c) @@ -4158,7 +4365,7 @@ case "$toolchain" in ld_default="$source_path/compat/windows/mslink" nm_default="dumpbin.exe -symbols" ar_default="lib.exe" - case "$arch" in + case "${arch:-$arch_default}" in aarch64|arm64) as_default="armasm64.exe" ;; @@ -4217,11 +4424,7 @@ cc_default="${cross_prefix}${cc_default}" cxx_default="${cross_prefix}${cxx_default}" nm_default="${cross_prefix}${nm_default}" pkg_config_default="${cross_prefix}${pkg_config_default}" -if ${cross_prefix}${ranlib_default} 2>&1 | grep -q "\-D "; then - ranlib_default="${cross_prefix}${ranlib_default} -D" -else - ranlib_default="${cross_prefix}${ranlib_default}" -fi +ranlib_default="${cross_prefix}${ranlib_default}" strip_default="${cross_prefix}${strip_default}" windres_default="${cross_prefix}${windres_default}" @@ -4241,11 +4444,23 @@ else NVCC_C="" fi +set_default nvcc + +if enabled cuda_nvcc; then + if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then + nvccflags_default="-gencode arch=compute_60,code=sm_60 -O2" + fi +fi + set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \ - target_exec x86asmexe nvcc + target_exec x86asmexe metalcc metallib enabled cross_compile || host_cc_default=$cc set_default host_cc +if ${ranlib} 2>&1 | grep -q "\-D "; then + ranlib="${ranlib} -D" +fi + pkg_config_fail_message="" if ! $pkg_config --version >/dev/null 2>&1; then warn "$pkg_config not found, library detection may fail." @@ -4262,7 +4477,7 @@ fi exesuf() { case $1 in - mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;; + mingw32*|mingw64*|msys*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;; esac } @@ -4363,7 +4578,7 @@ msvc_common_flags(){ # generic catch all at the bottom will print the original flag. -Wall) ;; -Wextra) ;; - -std=c99) ;; + -std=c*) ;; # Common flags -fomit-frame-pointer) ;; -g) echo -Z7 ;; @@ -4379,6 +4594,7 @@ msvc_common_flags(){ -l*) echo ${flag#-l}.lib ;; -LARGEADDRESSAWARE) echo $flag ;; -L*) echo -libpath:${flag#-L} ;; + -Wl,*) ;; *) echo $flag ;; esac done @@ -4606,7 +4822,11 @@ probe_cc(){ _ld_path='-libpath:' elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then _type=msvc - _ident=$($_cc 2>&1 | head -n1 | tr -d '\r') + if $_cc -nologo- 2>&1 | grep -q Microsoft; then + _ident=$($_cc 2>&1 | head -n1 | tr -d '\r') + else + _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r') + fi _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)' _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' _cflags_speed="-O2" @@ -4734,7 +4954,7 @@ fi if test "$cpu" = host; then enabled cross_compile && - die "--cpu=host makes no sense when cross-compiling." + warn "--cpu=host makes no sense when cross-compiling." case "$cc_type" in gcc|llvm_gcc) @@ -4773,6 +4993,9 @@ case "$arch" in arm*|iPad*|iPhone*) arch="arm" ;; + loongarch*) + arch="loongarch" + ;; mips*|IP*) case "$arch" in *el) @@ -4792,6 +5015,9 @@ case "$arch" in "Power Macintosh"|ppc*|powerpc*) arch="ppc" ;; + riscv*) + arch="riscv" + ;; s390|s390x) arch="s390" ;; @@ -4861,9 +5087,11 @@ elif enabled arm; then fi } - [ "$cpu" = generic ] && cpu=$(probe_arm_arch) case $cpu in + generic) + subarch=$(probe_arm_arch | sed 's/[^a-z0-9]//g') + ;; armv*) cpuflags="-march=$cpu" subarch=$(echo $cpu | sed 's/[^a-z0-9]//g') @@ -4915,9 +5143,19 @@ elif enabled bfin; then cpuflags="-mcpu=$cpu" -elif enabled mips; then +elif enabled loongarch; then - cpuflags="-march=$cpu" + enable local_aligned + enable simd_align_32 + enable fast_64bit + enable fast_clz + enable fast_unaligned + case $cpu in + la464) + cpuflags="-march=$cpu" + ;; + esac +elif enabled mips; then if [ "$cpu" != "generic" ]; then disable mips32r2 @@ -4927,81 +5165,40 @@ elif enabled mips; then disable mips64r6 disable loongson2 disable loongson3 + disable mipsdsp + disable mipsdspr2 + + cpuflags="-march=$cpu" case $cpu in - 24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf) + # General ISA levels + mips1|mips3) + ;; + mips32r2) enable mips32r2 - disable msa ;; - p5600|i6400|p6600) - disable mipsdsp - disable mipsdspr2 + mips32r5) + enable mips32r2 + enable mips32r5 ;; - loongson*) - enable loongson2 + mips64r2|mips64r5) + enable mips64r2 enable loongson3 - enable local_aligned - enable simd_align_16 - enable fast_64bit - enable fast_clz - enable fast_cmov - enable fast_unaligned - disable aligned_stack - disable mipsdsp - disable mipsdspr2 - # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag. - if [ $cc == gcc ]; then - gcc_version=$(gcc -dumpversion) - if [ "$(echo "$gcc_version 5.3.0" | tr " " "\n" | sort -rV | head -n 1)" == "$gcc_version" ]; then - expensive_optimization_flag="" - else - expensive_optimization_flag="-fno-expensive-optimizations" - fi - fi - case $cpu in - loongson3*) - cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag" - ;; - loongson2e) - cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag" - ;; - loongson2f) - cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag" - ;; - esac ;; - *) - # Unknown CPU. Disable everything. - warn "unknown CPU. Disabling all MIPS optimizations." - disable mipsfpu - disable mipsdsp - disable mipsdspr2 - disable msa - disable mmi - ;; - esac - - case $cpu in + # Cores from MIPS(MTI) 24kc) disable mipsfpu - disable mipsdsp - disable mipsdspr2 + enable mips32r2 ;; - 24kf*) - disable mipsdsp - disable mipsdspr2 - ;; - 24kec|34kc|1004kc) - disable mipsfpu - disable mipsdspr2 + 24kf*|24kec|34kc|74Kc|1004kc) + enable mips32r2 ;; 24kef*|34kf*|1004kf*) - disable mipsdspr2 - ;; - 74kc) - disable mipsfpu + enable mipsdsp + enable mips32r2 ;; p5600) + enable mips32r2 enable mips32r5 check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" ;; @@ -5013,9 +5210,51 @@ elif enabled mips; then enable mips64r6 check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64" ;; + # Cores from Loongson + loongson2e|loongson2f|loongson3*) + enable local_aligned + enable simd_align_16 + enable fast_64bit + enable fast_clz + enable fast_cmov + enable fast_unaligned + disable aligned_stack + # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag. + if test "$cc_type" = "gcc"; then + case $gcc_basever in + 2|2.*|3.*|4.*|5.0|5.1|5.2) + expensive_optimization_flag="-fno-expensive-optimizations" + ;; + *) + expensive_optimization_flag="" + ;; + esac + fi + + case $cpu in + loongson3*) + enable loongson3 + cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag" + ;; + loongson2e) + enable loongson2 + cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag" + ;; + loongson2f) + enable loongson2 + cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag" + ;; + esac + ;; + *) + warn "unknown MIPS CPU" + ;; esac + else - # We do not disable anything. Is up to the user to disable the unwanted features. + disable mipsdsp + disable mipsdspr2 + # Disable DSP stuff for generic CPU, it can't be detected at runtime. warn 'generic cpu selected' fi @@ -5172,6 +5411,11 @@ case "$arch" in aarch64|alpha|ia64) enabled shared && enable_weak pic ;; + loongarch) + check_64bit loongarch32 loongarch64 + enabled loongarch64 && disable loongarch32 + enabled shared && enable_weak pic + ;; mips) check_64bit mips mips64 '_MIPS_SIM > 1' enabled shared && enable_weak pic @@ -5184,6 +5428,10 @@ case "$arch" in check_64bit ppc ppc64 enabled shared && enable_weak pic ;; + riscv) + check_64bit riscv32 riscv64 + enabled shared && enable_weak pic + ;; s390) check_64bit s390 s390x enabled shared && enable_weak pic @@ -5253,6 +5501,7 @@ case $target_os in ;; openbsd|bitrig) disable symver + enable section_data_rel_ro striptype="" SHFLAGS='-shared' SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)' @@ -5291,6 +5540,11 @@ case $target_os in fi version_script='-exported_symbols_list' VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"' + # Workaround for Xcode 11 -fstack-check bug + if enabled clang; then + clang_version=$($cc -dumpversion) + test ${clang_version%%.*} -eq 11 && add_cflags -fno-stack-check + fi ;; msys*) die "Native MSYS builds are discouraged, please use the MINGW environment." @@ -5756,28 +6010,41 @@ EOF elif enabled mips; then - enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"' - enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' - enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"' - - # Enable minimum ISA based on selected options + # Check toolchain ISA level if enabled mips64; then - enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6' - enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2' - disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64' + enabled mips64r6 && check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' && + disable mips64r2 + + enabled mips64r2 && check_inline_asm mips64r2 '"dext $0, $0, 0, 1"' + + disable mips32r6 && disable mips32r5 && disable mips32r2 else - enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6' - enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5' - enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2' - disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32' + enabled mips32r6 && check_inline_asm mips32r6 '"aui $0, $0, 0"' && + disable mips32r5 && disable mips32r2 + + enabled mips32r5 && check_inline_asm mips32r5 '"eretnc"' + enabled mips32r2 && check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' + + disable mips64r6 && disable mips64r5 && disable mips64r2 fi - enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float' + enabled mipsfpu && check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"' enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64' - enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_headers msa.h || disable msa + enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp' enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2' - enabled msa && enabled msa2 && check_inline_asm_flags msa2 '"nxbits.any.b $w0, $w0"' '-mmsa2' && check_headers msa2.h || disable msa2 + + # MSA can be detected at runtime so we supply extra flags here + enabled mipsfpu && enabled msa && check_inline_asm msa '"addvi.b $w0, $w1, 1"' '-mmsa' && append MSAFLAGS '-mmsa' + + # loongson2 have no switch cflag so we can only probe toolchain ability + enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"' && disable loongson3 + + # loongson3 is paired with MMI + enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-mloongson-ext' && append MMIFLAGS '-mloongson-ext' + + # MMI can be detected at runtime too + enabled mmi && check_inline_asm mmi '"pxor $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi' if enabled bigendian && enabled msa; then disable msa @@ -5883,10 +6150,11 @@ EOF elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;; esac - check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0" - check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0" - check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3" - check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3" + enabled avx512 && check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0" + enabled avx512icl && check_x86asm avx512icl_external "vpdpwssds zmm31{k1}{z}, zmm29, zmm28" + enabled avx2 && check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0" + enabled xop && check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3" + enabled fma4 && check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3" check_x86asm cpunop "CPU amdnop" fi @@ -5896,6 +6164,9 @@ EOF ;; esac +elif enabled loongarch; then + enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr2"' '-mlsx' && append LSXFLAGS '-mlsx' + enabled lasx && check_inline_asm lasx '"xvadd.b $xr0, $xr1, $xr2"' '-mlasx' && append LASXFLAGS '-mlasx' fi check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)" @@ -5949,7 +6220,6 @@ check_builtin MemoryBarrier windows.h "MemoryBarrier()" check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)" check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)" check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)" -check_builtin x264_csp_bgr "stdint.h x264.h" "X264_CSP_BGR" case "$custom_allocator" in jemalloc) @@ -5995,20 +6265,36 @@ check_func_headers lzo/lzo1x.h lzo1x_999_compress check_func_headers mach/mach_time.h mach_absolute_time check_func_headers stdlib.h getenv check_func_headers sys/stat.h lstat +check_func_headers sys/auxv.h getauxval +check_func_headers windows.h GetModuleHandle check_func_headers windows.h GetProcessAffinityMask check_func_headers windows.h GetProcessTimes +check_func_headers windows.h GetStdHandle check_func_headers windows.h GetSystemTimeAsFileTime check_func_headers windows.h LoadLibrary check_func_headers windows.h MapViewOfFile check_func_headers windows.h PeekNamedPipe check_func_headers windows.h SetConsoleTextAttribute check_func_headers windows.h SetConsoleCtrlHandler +check_func_headers windows.h SetDllDirectory check_func_headers windows.h Sleep check_func_headers windows.h VirtualAlloc check_func_headers glob.h glob -enabled xlib && - check_lib xlib "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext + +if enabled xlib; then + check_pkg_config xlib_x11 x11 "X11/Xlib.h" XPending || + check_lib xlib_x11 "X11/Xlib.h" XPending -lX11 || + disable xlib + + check_pkg_config xlib_xext xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach || + check_lib xlib_xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach -lXext || + disable xlib + + check_pkg_config xlib_xv xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute || + check_lib xlib_xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv || + disable xlib +fi check_headers direct.h check_headers dirent.h @@ -6016,9 +6302,13 @@ check_headers dxgidebug.h check_headers dxva.h check_headers dxva2api.h -D_WIN32_WINNT=0x0600 check_headers io.h +enabled libdrm && + check_headers linux/dma-buf.h + check_headers linux/perf_event.h check_headers libcrystalhd/libcrystalhd_if.h check_headers malloc.h +check_headers mftransform.h check_headers net/udplite.h check_headers poll.h check_headers sys/param.h @@ -6031,13 +6321,19 @@ check_headers unistd.h check_headers valgrind/valgrind.h check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox check_headers windows.h -check_headers X11/extensions/XvMClib.h check_headers asm/types.h # it seems there are versions of clang in some distros that try to use the # gcc headers, which explodes for stdatomic # so we also check that atomics actually work here -check_builtin stdatomic stdatomic.h "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" +# +# some configurations also require linking to libatomic, so try +# both with -latomic and without +for LATOMIC in "-latomic" ""; do + check_builtin stdatomic stdatomic.h \ + "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" \ + $LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break +done check_lib advapi32 "windows.h" RegCloseKey -ladvapi32 check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt && @@ -6054,11 +6350,13 @@ enabled appkit && check_apple_framework AppKit enabled audiotoolbox && check_apple_framework AudioToolbox enabled avfoundation && check_apple_framework AVFoundation enabled coreimage && check_apple_framework CoreImage +enabled metal && check_apple_framework Metal enabled videotoolbox && check_apple_framework VideoToolbox check_apple_framework CoreFoundation check_apple_framework CoreMedia check_apple_framework CoreVideo +check_apple_framework CoreAudio enabled avfoundation && { disable coregraphics applicationservices @@ -6068,23 +6366,46 @@ enabled avfoundation && { enabled videotoolbox && { check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices" check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia" + check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVCWithAlpha "-framework CoreMedia" + check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_VP9 "-framework CoreMedia" check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange "-framework CoreVideo" + check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ "-framework CoreVideo" + check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2100_HLG "-framework CoreVideo" + check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_Linear "-framework CoreVideo" + check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferYCbCrMatrix_ITU_R_2020 "-framework CoreVideo" + check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 "-framework CoreVideo" + check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2020 "-framework CoreVideo" + check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_428_1 "-framework CoreVideo" } +enabled metal && test_cmd $metalcc -v || disable metal + check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss +check_type "windows.h dxva.h" "DXVA_PicParams_AV1" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0 check_type "windows.h d3d11.h" "ID3D11VideoDecoder" check_type "windows.h d3d11.h" "ID3D11VideoContext" check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602 +check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC" +check_type "vdpau/vdpau.h" "VdpPictureInfoVP9" +check_type "vdpau/vdpau.h" "VdpPictureInfoAV1" if [ -z "$nvccflags" ]; then nvccflags=$nvccflags_default fi +nvccflags="$nvccflags -std=c++11" + if enabled x86_64 || enabled ppc64 || enabled aarch64; then nvccflags="$nvccflags -m64" else @@ -6094,16 +6415,20 @@ fi if enabled cuda_nvcc; then nvccflags="$nvccflags -ptx" else - nvccflags="$nvccflags -S -nocudalib -nocudainc --cuda-device-only -include ${source_link}/compat/cuda/cuda_runtime.h" + nvccflags="$nvccflags -S -nocudalib -nocudainc --cuda-device-only -Wno-c++11-narrowing -include ${source_link}/compat/cuda/cuda_runtime.h" check_nvcc cuda_llvm fi if ! disabled ffnvcodec; then ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h" - check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.0" "$ffnv_hdr_list" "" || \ - check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.8 ffnvcodec < 8.3" "$ffnv_hdr_list" "" || \ - check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.9 ffnvcodec < 8.2" "$ffnv_hdr_list" "" || \ - check_pkg_config ffnvcodec "ffnvcodec >= 8.0.14.9 ffnvcodec < 8.1" "$ffnv_hdr_list" "" + check_pkg_config ffnvcodec "ffnvcodec >= 9.1.23.1" "$ffnv_hdr_list" "" || \ + check_pkg_config ffnvcodec "ffnvcodec >= 9.0.18.3 ffnvcodec < 9.1" "$ffnv_hdr_list" "" || \ + check_pkg_config ffnvcodec "ffnvcodec >= 8.2.15.10 ffnvcodec < 8.3" "$ffnv_hdr_list" "" || \ + check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.11 ffnvcodec < 8.2" "$ffnv_hdr_list" "" +fi + +if enabled_all libglslang libshaderc; then + die "ERROR: libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang" fi check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)" @@ -6153,6 +6478,18 @@ enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma +enabled zlib && test_exec $zlib_extralibs < +int main(void) { + if (zlibCompileFlags() & (1 << 17)) return 1; + return 0; +} +EOF + +[ -x "$(command -v gzip)" ] && enable gzip + +enabled zlib_gzip && enabled gzip || disable ptx_compression + # On some systems dynamic loading requires no extra linker flags check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl @@ -6173,22 +6510,26 @@ for func in $COMPLEX_FUNCS; do done # these are off by default, so fail if requested and not available +enabled avisynth && { require_headers "avisynth/avisynth_c.h avisynth/avs/version.h" && + { test_cpp_condition avisynth/avs/version.h "AVS_MAJOR_VER >= 3 && AVS_MINOR_VER >= 7 && AVS_BUGFIX_VER >= 1 || AVS_MAJOR_VER >= 3 && AVS_MINOR_VER > 7 || AVS_MAJOR_VER > 3" || + die "ERROR: AviSynth+ header version must be >= 3.7.1"; } } enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; } enabled chromaprint && require chromaprint chromaprint.h chromaprint_get_version -lchromaprint enabled decklink && { require_headers DeckLinkAPI.h && - { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a090500" || die "ERROR: Decklink API version must be >= 10.9.5."; } } -enabled frei0r && require_headers "frei0r.h dlfcn.h" + { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0000" || die "ERROR: Decklink API version must be >= 10.11"; } } +enabled frei0r && require_headers "frei0r.h" enabled gmp && require gmp gmp.h mpz_export -lgmp enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; } enabled ladspa && require_headers "ladspa.h dlfcn.h" +enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new || { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } || die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; } enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883 -enabled libass && require_pkg_config libass libass ass/ass.h ass_library_init +enabled libass && require_pkg_config libass "libass >= 0.11.0" ass/ass.h ass_library_init enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && @@ -6196,7 +6537,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 && die "ERROR: libcelt must be installed and version must be >= 0.11.0."; } enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2 -enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.2.1" "dav1d/dav1d.h" dav1d_version +enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d/dav1d.h" dav1d_version enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion @@ -6209,12 +6550,20 @@ enabled fontconfig && enable libfontconfig enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info +enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \ + -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen \ + -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm || + require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \ + -lglslang -lOSDependent -lHLSL -lOGLCompiler \ + -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm; } enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu || require libgme gme/gme.h gme_new_emu -lgme -lstdc++; } enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break; done || die "ERROR: libgsm not found"; } enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs +enabled libjxl && require_pkg_config libjxl "libjxl >= 0.7.0" jxl/decode.h JxlDecoderVersion && + require_pkg_config libjxl_threads "libjxl_threads >= 0.7.0" jxl/thread_parallel_runner.h JxlThreadParallelRunner enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new @@ -6224,14 +6573,21 @@ enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_ # Media SDK or Intel Media Server Studio, these don't come with # pkg-config support. Instead, users should make sure that the build # can find the libraries and headers through other means. -enabled libmfx && { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit || - { require libmfx "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } +enabled libmfx && { check_pkg_config libmfx "libmfx >= 1.28" "mfx/mfxvideo.h" MFXInit || + { require libmfx "mfx/mfxvideo.h mfx/mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" && + { test_cpp_condition mfx/mfxdefs.h "MFX_VERSION >= 1028" || die "ERROR: libmfx version must be >= 1.28"; } && + warn "using libmfx without pkg-config"; } } + +if enabled libmfx; then + check_cc MFX_CODEC_VP9 "mfx/mfxvp9.h mfx/mfxstructures.h" "MFX_CODEC_VP9" +fi + enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs -enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_load || - require libmysofa mysofa.h mysofa_load -lmysofa $zlib_extralibs; } -enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei || - check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppc -lnppidei || +enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine || + require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; } +enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif || + check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppif -lnppc -lnppidei || die "ERROR: libnpp not found"; } enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb @@ -6243,6 +6599,7 @@ enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_ enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version || { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } } enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++" +enabled libopenvino && require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api enabled libopus && { enabled libopus_decoder && { require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create @@ -6251,10 +6608,15 @@ enabled libopus && { require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create } } +enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new +enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection +enabled librav1e && require_pkg_config librav1e "rav1e >= 0.4.0" rav1e.h rav1e_context_new +enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_render_cairo enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++" +enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init || require libsmbclient libsmbclient.h smbc_init -lsmbclient; } @@ -6263,6 +6625,7 @@ enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket +enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg @@ -6270,9 +6633,10 @@ enabled libtls && require_pkg_config libtls libtls tls.h tls_configur enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame && { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame || die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; } +enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit -enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 1.3.9" libvmaf.h compute_vmaf +enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc enabled libvorbis && require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init && require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init @@ -6299,22 +6663,21 @@ enabled libvpx && { fi } -enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack enabled libwebp && { enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } -enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode || - { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && - warn "using libx264 without pkg-config"; } } && - require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && +enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && { + [ "$toolchain" != "msvc" ] || + require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } && check_cpp_condition libx262 x264.h "X264_MPEG2" enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && - require_cpp_condition libx265 x265.h "X265_BUILD >= 68" + require_cpp_condition libx265 x265.h "X265_BUILD >= 70" enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version -enabled libzmq && require_pkg_config libzmq libzmq zmq.h zmq_ctx_new +enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new && { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" || enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; } @@ -6349,12 +6712,19 @@ enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" || die "ERROR: opengl not found." } +enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame || + { ! enabled cross_compile && + add_cflags -isystem/opt/vc/include/IL && + test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } || + die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } && + enable omx enabled omx && require_headers OMX_Core.h -enabled omx_rpi && { check_headers OMX_Core.h || - { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_headers OMX_Core.h ; } || - die "ERROR: OpenMAX IL headers not found"; } && enable omx -enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl || +enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl && + { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } || + { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } || + check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl || check_pkg_config openssl openssl openssl/ssl.h SSL_library_init || + check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || @@ -6383,12 +6753,12 @@ fi if enabled sdl2; then SDL2_CONFIG="${cross_prefix}sdl2-config" - test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent + test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then sdl2_cflags=$("${SDL2_CONFIG}" --cflags) sdl2_extralibs=$("${SDL2_CONFIG}" --libs) test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags && - test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags && + test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x030000" $sdl2_cflags && check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags && enable sdl2 fi @@ -6428,21 +6798,24 @@ disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && perl -v > /dev/null 2>&1 && enable perl || disable perl pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout +xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint # check V4L2 codecs available in the API -check_headers linux/fb.h -check_headers linux/videodev2.h -test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete -check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;" -check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;" -check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;" -check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;" -check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;" -check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;" -check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;" -check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;" -check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;" -check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;" +if enabled v4l2_m2m; then + check_headers linux/fb.h + check_headers linux/videodev2.h + test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete + check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;" + check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;" + check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;" + check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;" + check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;" + check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;" + check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;" + check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;" + check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;" + check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;" +fi check_headers sys/videoio.h test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete @@ -6470,13 +6843,14 @@ else EOF fi -enabled alsa && check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp || - check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound +enabled alsa && { check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp || + check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound; } enabled libjack && require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range -enabled sndio && check_lib sndio sndio.h sio_open -lsndio +enabled sndio && { check_pkg_config sndio sndio "sndio.h" sio_open || + check_lib sndio sndio.h sio_open -lsndio; } if enabled libcdio; then check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open || @@ -6512,13 +6886,19 @@ test_cpp <= 0.35.0" "va/va.h" vaInitialize if enabled vaapi; then check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM - if enabled xlib; then + if enabled xlib_x11; then check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay fi @@ -6526,7 +6906,10 @@ if enabled vaapi; then check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC" check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth + check_struct "va/va.h" "VADecPictureParameterBufferAV1" bit_depth_idx + check_type "va/va.h va/va_vpp.h" "VAProcFilterParameterBufferHDRToneMapping" check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags + check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" blend_flags check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC" check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG" check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8" @@ -6567,6 +6950,11 @@ enabled vdpau && enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd +if enabled vulkan; then + check_pkg_config_header_only vulkan "vulkan >= 1.2.189" "vulkan/vulkan.h" "defined VK_VERSION_1_2" || + check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_3) || (defined(VK_VERSION_1_2) && VK_HEADER_VERSION >= 189)" +fi + if enabled x86; then case $target_os in mingw32*|mingw64*|win32|win64|linux|cygwin*) @@ -6575,7 +6963,7 @@ if enabled x86; then disable ffnvcodec cuvid nvdec nvenc ;; esac -elif enabled ppc64 && ! enabled bigendian; then +elif enabled_any aarch64 ppc64 && ! enabled bigendian; then case $target_os in linux) ;; @@ -6597,9 +6985,13 @@ void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_PRESET_HQ_GUID } }; int main(void) { return 0; } EOF +if enabled_any nvdec cuvid; then + check_type "ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h" "CUVIDAV1PICPARAMS" +fi + enabled amf && check_cpp_condition amf "AMF/core/Version.h" \ - "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400040001" + "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x0001000400090000" # Funny iconv installations are not unusual, so check it after all flags have been set if enabled libc_iconv; then @@ -6620,7 +7012,6 @@ check_cflags -Wwrite-strings check_cflags -Wtype-limits check_cflags -Wundef check_cflags -Wmissing-prototypes -check_cflags -Wno-pointer-to-int-cast check_cflags -Wstrict-prototypes check_cflags -Wempty-body @@ -6662,7 +7053,7 @@ EOF # add some linker flags check_ldflags -Wl,--warn-common -check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample +check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic @@ -6671,34 +7062,24 @@ check_stripflags -x enabled neon_clobber_test && check_ldflags -Wl,--wrap,avcodec_open2 \ - -Wl,--wrap,avcodec_decode_audio4 \ - -Wl,--wrap,avcodec_decode_video2 \ -Wl,--wrap,avcodec_decode_subtitle2 \ - -Wl,--wrap,avcodec_encode_audio2 \ - -Wl,--wrap,avcodec_encode_video2 \ -Wl,--wrap,avcodec_encode_subtitle \ -Wl,--wrap,avcodec_send_packet \ -Wl,--wrap,avcodec_receive_packet \ -Wl,--wrap,avcodec_send_frame \ -Wl,--wrap,avcodec_receive_frame \ - -Wl,--wrap,swr_convert \ - -Wl,--wrap,avresample_convert || + -Wl,--wrap,swr_convert || disable neon_clobber_test enabled xmm_clobber_test && check_ldflags -Wl,--wrap,avcodec_open2 \ - -Wl,--wrap,avcodec_decode_audio4 \ - -Wl,--wrap,avcodec_decode_video2 \ -Wl,--wrap,avcodec_decode_subtitle2 \ - -Wl,--wrap,avcodec_encode_audio2 \ - -Wl,--wrap,avcodec_encode_video2 \ -Wl,--wrap,avcodec_encode_subtitle \ -Wl,--wrap,avcodec_send_packet \ -Wl,--wrap,avcodec_receive_packet \ -Wl,--wrap,avcodec_send_frame \ -Wl,--wrap,avcodec_receive_frame \ -Wl,--wrap,swr_convert \ - -Wl,--wrap,avresample_convert \ -Wl,--wrap,sws_scale || disable xmm_clobber_test @@ -6909,6 +7290,12 @@ esac enable frame_thread_encoder +# these filters depend on removed avcodec APIs +# they are kept disabled for now, but will be removed if +# nobody updates and re-enables them +disable mcdeint_filter +disable uspp_filter + enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; } check_deps $CONFIG_LIST \ @@ -6917,7 +7304,6 @@ check_deps $CONFIG_LIST \ $ALL_COMPONENTS \ enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86" -enabled avresample && warn "Building with deprecated library libavresample" case $target_os in haiku) @@ -7013,19 +7399,12 @@ done enabled zlib && add_cppflags -DZLIB_CONST # conditional library dependencies, in any order -enabled afftdn_filter && prepend avfilter_deps "avcodec" -enabled afftfilt_filter && prepend avfilter_deps "avcodec" -enabled afir_filter && prepend avfilter_deps "avcodec" enabled amovie_filter && prepend avfilter_deps "avformat avcodec" enabled aresample_filter && prepend avfilter_deps "swresample" -enabled atempo_filter && prepend avfilter_deps "avcodec" enabled bm3d_filter && prepend avfilter_deps "avcodec" enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec" -enabled convolve_filter && prepend avfilter_deps "avcodec" -enabled deconvolve_filter && prepend avfilter_deps "avcodec" enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample" enabled elbg_filter && prepend avfilter_deps "avcodec" -enabled fftfilt_filter && prepend avfilter_deps "avcodec" enabled find_rect_filter && prepend avfilter_deps "avformat avcodec" enabled firequalizer_filter && prepend avfilter_deps "avcodec" enabled mcdeint_filter && prepend avfilter_deps "avcodec" @@ -7033,17 +7412,12 @@ enabled movie_filter && prepend avfilter_deps "avformat avcodec" enabled pan_filter && prepend avfilter_deps "swresample" enabled pp_filter && prepend avfilter_deps "postproc" enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale" -enabled resample_filter && prepend avfilter_deps "avresample" enabled sab_filter && prepend avfilter_deps "swscale" enabled scale_filter && prepend avfilter_deps "swscale" enabled scale2ref_filter && prepend avfilter_deps "swscale" -enabled sofalizer_filter && prepend avfilter_deps "avcodec" -enabled showcqt_filter && prepend avfilter_deps "avformat avcodec swscale" -enabled showfreqs_filter && prepend avfilter_deps "avcodec" -enabled showspectrum_filter && prepend avfilter_deps "avcodec" +enabled showcqt_filter && prepend avfilter_deps "avformat swscale" enabled signature_filter && prepend avfilter_deps "avcodec avformat" enabled smartblur_filter && prepend avfilter_deps "swscale" -enabled spectrumsynth_filter && prepend avfilter_deps "avcodec" enabled spp_filter && prepend avfilter_deps "avcodec" enabled sr_filter && prepend avfilter_deps "avformat swscale" enabled subtitles_filter && prepend avfilter_deps "avformat avcodec" @@ -7130,6 +7504,7 @@ if enabled x86; then echo "AVX enabled ${avx-no}" echo "AVX2 enabled ${avx2-no}" echo "AVX-512 enabled ${avx512-no}" + echo "AVX-512ICL enabled ${avx512icl-no}" echo "XOP enabled ${xop-no}" echo "FMA3 enabled ${fma3-no}" echo "FMA4 enabled ${fma4-no}" @@ -7155,7 +7530,6 @@ if enabled mips; then echo "MIPS DSP R1 enabled ${mipsdsp-no}" echo "MIPS DSP R2 enabled ${mipsdspr2-no}" echo "MIPS MSA enabled ${msa-no}" - echo "MIPS MSA2 enabled ${msa2-no}" echo "LOONGSON MMI enabled ${mmi-no}" fi if enabled ppc; then @@ -7165,6 +7539,10 @@ if enabled ppc; then echo "PPC 4xx optimizations ${ppc4xx-no}" echo "dcbzl available ${dcbzl-no}" fi +if enabled loongarch; then + echo "LSX enabled ${lsx-no}" + echo "LASX enabled ${lasx-no}" +fi echo "debug symbols ${debug-no}" echo "strip symbols ${stripping-no}" echo "optimize for size ${small-no}" @@ -7180,6 +7558,7 @@ echo "perl enabled ${perl-no}" echo "pod2man enabled ${pod2man-no}" echo "makeinfo enabled ${makeinfo-no}" echo "makeinfo supports HTML ${makeinfo_html-no}" +echo "xmllint enabled ${xmllint-no}" test -n "$random_seed" && echo "random seed ${random_seed}" echo @@ -7286,6 +7665,8 @@ ARFLAGS=$arflags AR_O=$ar_o AR_CMD=$ar NM_CMD=$nm +METALCC=$metalcc +METALLIB=$metallib RANLIB=$ranlib STRIP=$strip STRIPTYPE=$striptype @@ -7295,7 +7676,7 @@ LN_S=$ln_s CPPFLAGS=$CPPFLAGS CFLAGS=$CFLAGS CXXFLAGS=$CXXFLAGS -OBJCFLAGS=$OBJCFLAGS +OBJCCFLAGS=$OBJCFLAGS ASFLAGS=$ASFLAGS NVCCFLAGS=$nvccflags AS_C=$AS_C @@ -7316,7 +7697,6 @@ LD_LIB=$LD_LIB LD_PATH=$LD_PATH DLLTOOL=$dlltool WINDRES=$windres -DEPWINDRES=$dep_cc DOXYGEN=$doxygen LDFLAGS=$LDFLAGS LDEXEFLAGS=$LDEXEFLAGS @@ -7324,6 +7704,10 @@ LDSOFLAGS=$LDSOFLAGS SHFLAGS=$(echo $($ldflags_filter $SHFLAGS)) ASMSTRIPFLAGS=$ASMSTRIPFLAGS X86ASMFLAGS=$X86ASMFLAGS +MSAFLAGS=$MSAFLAGS +MMIFLAGS=$MMIFLAGS +LSXFLAGS=$LSXFLAGS +LASXFLAGS=$LASXFLAGS BUILDSUF=$build_suffix PROGSSUF=$progs_suffix FULLNAME=$FULLNAME @@ -7342,6 +7726,8 @@ ASDEP_FLAGS=$ASDEP_FLAGS X86ASMDEP=$X86ASMDEP X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS CC_DEPFLAGS=$CC_DEPFLAGS +CXX_DEPFLAGS=$CXX_DEPFLAGS +OBJCC_DEPFLAGS=$OBJC_DEPFLAGS AS_DEPFLAGS=$AS_DEPFLAGS X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS HOSTCC=$host_cc @@ -7397,10 +7783,11 @@ cat > $TMPH <> $TMPH -echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak # Do not overwrite an unchanged config.h to avoid superfluous rebuilds. cp_if_changed $TMPH config.h touch ffbuild/.config +# Copy config.asm before printing ALL_COMPONENTS; that's not needed in assembly. enabled x86asm && cp_if_changed $TMPASM config.asm +# Reopen a new TMPH for config_components.h. +cat > $TMPH <> $TMPH +echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak + +cp_if_changed $TMPH config_components.h + cat > $TMPH < Mon, 22 Aug 2022 13:53:40 +0800 + -- sufang Tue, 28 Mar 2023 10:11:44 +0800 ffmpeg (7:4.2.2-ok2) yangtze; urgency=medium diff --git a/debian/control b/debian/control index e46fdd0e..1285825d 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: ffmpeg Section: video Priority: optional -Maintainer: Openkylin Developers +Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Debian Multimedia Maintainers Uploaders: Andreas Cadhalpun , Alexander Strasser , diff --git a/debian/patches/0001-avcodec-arm-sbcenc-avoid-callee-preserved-vfp-regist.patch b/debian/patches/0001-avcodec-arm-sbcenc-avoid-callee-preserved-vfp-regist.patch new file mode 100644 index 00000000..c837e36c --- /dev/null +++ b/debian/patches/0001-avcodec-arm-sbcenc-avoid-callee-preserved-vfp-regist.patch @@ -0,0 +1,287 @@ +From: James Cowgill +Date: Sun, 11 Aug 2019 16:50:56 +0100 +Subject: [PATCH v2] avcodec/arm/sbcenc: avoid callee preserved vfp registers + +When compiling FFmpeg with GCC-9, some very random segfaults were +observed in code which had previously called down into the SBC encoder +NEON assembly routines. This was caused by these functions clobbering +some of the vfp callee saved registers (d8 - d15 aka q4 - q7). GCC was +using these registers to save local variables, but after these +functions returned, they would contain garbage. + +Fix by reallocating the registers in the two affected functions in +the following way: + ff_sbc_analyze_4_neon: q2-q5 => q8-q11, then q1-q4 => q8-q11 + ff_sbc_analyze_8_neon: q2-q9 => q8-q15 + +The reason for using these replacements is to keep closely related +sets of registers consecutively numbered which hopefully makes the +code more easy to follow. Since this commit only reallocates +registers, it should have no performance impact. + +Signed-off-by: James Cowgill +--- + libavcodec/arm/sbcdsp_neon.S | 220 +++++++++++++++++++++---------------------- + 1 file changed, 110 insertions(+), 110 deletions(-) + +diff --git a/libavcodec/arm/sbcdsp_neon.S b/libavcodec/arm/sbcdsp_neon.S +index d83d21d..914abfb 100644 +--- a/libavcodec/arm/sbcdsp_neon.S ++++ b/libavcodec/arm/sbcdsp_neon.S +@@ -38,49 +38,49 @@ function ff_sbc_analyze_4_neon, export=1 + /* TODO: merge even and odd cases (or even merge all four calls to this + * function) in order to have only aligned reads from 'in' array + * and reduce number of load instructions */ +- vld1.16 {d4, d5}, [r0, :64]! +- vld1.16 {d8, d9}, [r2, :128]! ++ vld1.16 {d16, d17}, [r0, :64]! ++ vld1.16 {d20, d21}, [r2, :128]! + +- vmull.s16 q0, d4, d8 +- vld1.16 {d6, d7}, [r0, :64]! +- vmull.s16 q1, d5, d9 +- vld1.16 {d10, d11}, [r2, :128]! ++ vmull.s16 q0, d16, d20 ++ vld1.16 {d18, d19}, [r0, :64]! ++ vmull.s16 q1, d17, d21 ++ vld1.16 {d22, d23}, [r2, :128]! + +- vmlal.s16 q0, d6, d10 +- vld1.16 {d4, d5}, [r0, :64]! +- vmlal.s16 q1, d7, d11 +- vld1.16 {d8, d9}, [r2, :128]! ++ vmlal.s16 q0, d18, d22 ++ vld1.16 {d16, d17}, [r0, :64]! ++ vmlal.s16 q1, d19, d23 ++ vld1.16 {d20, d21}, [r2, :128]! + +- vmlal.s16 q0, d4, d8 +- vld1.16 {d6, d7}, [r0, :64]! +- vmlal.s16 q1, d5, d9 +- vld1.16 {d10, d11}, [r2, :128]! ++ vmlal.s16 q0, d16, d20 ++ vld1.16 {d18, d19}, [r0, :64]! ++ vmlal.s16 q1, d17, d21 ++ vld1.16 {d22, d23}, [r2, :128]! + +- vmlal.s16 q0, d6, d10 +- vld1.16 {d4, d5}, [r0, :64]! +- vmlal.s16 q1, d7, d11 +- vld1.16 {d8, d9}, [r2, :128]! ++ vmlal.s16 q0, d18, d22 ++ vld1.16 {d16, d17}, [r0, :64]! ++ vmlal.s16 q1, d19, d23 ++ vld1.16 {d20, d21}, [r2, :128]! + +- vmlal.s16 q0, d4, d8 +- vmlal.s16 q1, d5, d9 ++ vmlal.s16 q0, d16, d20 ++ vmlal.s16 q1, d17, d21 + + vpadd.s32 d0, d0, d1 + vpadd.s32 d1, d2, d3 + + vrshrn.s32 d0, q0, SBC_PROTO_FIXED_SCALE + +- vld1.16 {d2, d3, d4, d5}, [r2, :128]! ++ vld1.16 {d16, d17, d18, d19}, [r2, :128]! + + vdup.i32 d1, d0[1] /* TODO: can be eliminated */ + vdup.i32 d0, d0[0] /* TODO: can be eliminated */ + +- vmull.s16 q3, d2, d0 +- vmull.s16 q4, d3, d0 +- vmlal.s16 q3, d4, d1 +- vmlal.s16 q4, d5, d1 ++ vmull.s16 q10, d16, d0 ++ vmull.s16 q11, d17, d0 ++ vmlal.s16 q10, d18, d1 ++ vmlal.s16 q11, d19, d1 + +- vpadd.s32 d0, d6, d7 /* TODO: can be eliminated */ +- vpadd.s32 d1, d8, d9 /* TODO: can be eliminated */ ++ vpadd.s32 d0, d20, d21 /* TODO: can be eliminated */ ++ vpadd.s32 d1, d22, d23 /* TODO: can be eliminated */ + + vst1.32 {d0, d1}, [r1, :128] + +@@ -91,57 +91,57 @@ function ff_sbc_analyze_8_neon, export=1 + /* TODO: merge even and odd cases (or even merge all four calls to this + * function) in order to have only aligned reads from 'in' array + * and reduce number of load instructions */ +- vld1.16 {d4, d5}, [r0, :64]! +- vld1.16 {d8, d9}, [r2, :128]! +- +- vmull.s16 q6, d4, d8 +- vld1.16 {d6, d7}, [r0, :64]! +- vmull.s16 q7, d5, d9 +- vld1.16 {d10, d11}, [r2, :128]! +- vmull.s16 q8, d6, d10 +- vld1.16 {d4, d5}, [r0, :64]! +- vmull.s16 q9, d7, d11 +- vld1.16 {d8, d9}, [r2, :128]! +- +- vmlal.s16 q6, d4, d8 +- vld1.16 {d6, d7}, [r0, :64]! +- vmlal.s16 q7, d5, d9 +- vld1.16 {d10, d11}, [r2, :128]! +- vmlal.s16 q8, d6, d10 +- vld1.16 {d4, d5}, [r0, :64]! +- vmlal.s16 q9, d7, d11 +- vld1.16 {d8, d9}, [r2, :128]! +- +- vmlal.s16 q6, d4, d8 +- vld1.16 {d6, d7}, [r0, :64]! +- vmlal.s16 q7, d5, d9 +- vld1.16 {d10, d11}, [r2, :128]! +- vmlal.s16 q8, d6, d10 +- vld1.16 {d4, d5}, [r0, :64]! +- vmlal.s16 q9, d7, d11 +- vld1.16 {d8, d9}, [r2, :128]! +- +- vmlal.s16 q6, d4, d8 +- vld1.16 {d6, d7}, [r0, :64]! +- vmlal.s16 q7, d5, d9 +- vld1.16 {d10, d11}, [r2, :128]! +- vmlal.s16 q8, d6, d10 +- vld1.16 {d4, d5}, [r0, :64]! +- vmlal.s16 q9, d7, d11 +- vld1.16 {d8, d9}, [r2, :128]! +- +- vmlal.s16 q6, d4, d8 +- vld1.16 {d6, d7}, [r0, :64]! +- vmlal.s16 q7, d5, d9 +- vld1.16 {d10, d11}, [r2, :128]! +- +- vmlal.s16 q8, d6, d10 +- vmlal.s16 q9, d7, d11 +- +- vpadd.s32 d0, d12, d13 +- vpadd.s32 d1, d14, d15 +- vpadd.s32 d2, d16, d17 +- vpadd.s32 d3, d18, d19 ++ vld1.16 {d16, d17}, [r0, :64]! ++ vld1.16 {d20, d21}, [r2, :128]! ++ ++ vmull.s16 q12, d16, d20 ++ vld1.16 {d18, d19}, [r0, :64]! ++ vmull.s16 q13, d17, d21 ++ vld1.16 {d22, d23}, [r2, :128]! ++ vmull.s16 q14, d18, d22 ++ vld1.16 {d16, d17}, [r0, :64]! ++ vmull.s16 q15, d19, d23 ++ vld1.16 {d20, d21}, [r2, :128]! ++ ++ vmlal.s16 q12, d16, d20 ++ vld1.16 {d18, d19}, [r0, :64]! ++ vmlal.s16 q13, d17, d21 ++ vld1.16 {d22, d23}, [r2, :128]! ++ vmlal.s16 q14, d18, d22 ++ vld1.16 {d16, d17}, [r0, :64]! ++ vmlal.s16 q15, d19, d23 ++ vld1.16 {d20, d21}, [r2, :128]! ++ ++ vmlal.s16 q12, d16, d20 ++ vld1.16 {d18, d19}, [r0, :64]! ++ vmlal.s16 q13, d17, d21 ++ vld1.16 {d22, d23}, [r2, :128]! ++ vmlal.s16 q14, d18, d22 ++ vld1.16 {d16, d17}, [r0, :64]! ++ vmlal.s16 q15, d19, d23 ++ vld1.16 {d20, d21}, [r2, :128]! ++ ++ vmlal.s16 q12, d16, d20 ++ vld1.16 {d18, d19}, [r0, :64]! ++ vmlal.s16 q13, d17, d21 ++ vld1.16 {d22, d23}, [r2, :128]! ++ vmlal.s16 q14, d18, d22 ++ vld1.16 {d16, d17}, [r0, :64]! ++ vmlal.s16 q15, d19, d23 ++ vld1.16 {d20, d21}, [r2, :128]! ++ ++ vmlal.s16 q12, d16, d20 ++ vld1.16 {d18, d19}, [r0, :64]! ++ vmlal.s16 q13, d17, d21 ++ vld1.16 {d22, d23}, [r2, :128]! ++ ++ vmlal.s16 q14, d18, d22 ++ vmlal.s16 q15, d19, d23 ++ ++ vpadd.s32 d0, d24, d25 ++ vpadd.s32 d1, d26, d27 ++ vpadd.s32 d2, d28, d29 ++ vpadd.s32 d3, d30, d31 + + vrshr.s32 q0, q0, SBC_PROTO_FIXED_SCALE + vrshr.s32 q1, q1, SBC_PROTO_FIXED_SCALE +@@ -153,38 +153,38 @@ function ff_sbc_analyze_8_neon, export=1 + vdup.i32 d1, d0[1] /* TODO: can be eliminated */ + vdup.i32 d0, d0[0] /* TODO: can be eliminated */ + +- vld1.16 {d4, d5}, [r2, :128]! +- vmull.s16 q6, d4, d0 +- vld1.16 {d6, d7}, [r2, :128]! +- vmull.s16 q7, d5, d0 +- vmull.s16 q8, d6, d0 +- vmull.s16 q9, d7, d0 +- +- vld1.16 {d4, d5}, [r2, :128]! +- vmlal.s16 q6, d4, d1 +- vld1.16 {d6, d7}, [r2, :128]! +- vmlal.s16 q7, d5, d1 +- vmlal.s16 q8, d6, d1 +- vmlal.s16 q9, d7, d1 +- +- vld1.16 {d4, d5}, [r2, :128]! +- vmlal.s16 q6, d4, d2 +- vld1.16 {d6, d7}, [r2, :128]! +- vmlal.s16 q7, d5, d2 +- vmlal.s16 q8, d6, d2 +- vmlal.s16 q9, d7, d2 +- +- vld1.16 {d4, d5}, [r2, :128]! +- vmlal.s16 q6, d4, d3 +- vld1.16 {d6, d7}, [r2, :128]! +- vmlal.s16 q7, d5, d3 +- vmlal.s16 q8, d6, d3 +- vmlal.s16 q9, d7, d3 +- +- vpadd.s32 d0, d12, d13 /* TODO: can be eliminated */ +- vpadd.s32 d1, d14, d15 /* TODO: can be eliminated */ +- vpadd.s32 d2, d16, d17 /* TODO: can be eliminated */ +- vpadd.s32 d3, d18, d19 /* TODO: can be eliminated */ ++ vld1.16 {d16, d17}, [r2, :128]! ++ vmull.s16 q12, d16, d0 ++ vld1.16 {d18, d19}, [r2, :128]! ++ vmull.s16 q13, d17, d0 ++ vmull.s16 q14, d18, d0 ++ vmull.s16 q15, d19, d0 ++ ++ vld1.16 {d16, d17}, [r2, :128]! ++ vmlal.s16 q12, d16, d1 ++ vld1.16 {d18, d19}, [r2, :128]! ++ vmlal.s16 q13, d17, d1 ++ vmlal.s16 q14, d18, d1 ++ vmlal.s16 q15, d19, d1 ++ ++ vld1.16 {d16, d17}, [r2, :128]! ++ vmlal.s16 q12, d16, d2 ++ vld1.16 {d18, d19}, [r2, :128]! ++ vmlal.s16 q13, d17, d2 ++ vmlal.s16 q14, d18, d2 ++ vmlal.s16 q15, d19, d2 ++ ++ vld1.16 {d16, d17}, [r2, :128]! ++ vmlal.s16 q12, d16, d3 ++ vld1.16 {d18, d19}, [r2, :128]! ++ vmlal.s16 q13, d17, d3 ++ vmlal.s16 q14, d18, d3 ++ vmlal.s16 q15, d19, d3 ++ ++ vpadd.s32 d0, d24, d25 /* TODO: can be eliminated */ ++ vpadd.s32 d1, d26, d27 /* TODO: can be eliminated */ ++ vpadd.s32 d2, d28, d29 /* TODO: can be eliminated */ ++ vpadd.s32 d3, d30, d31 /* TODO: can be eliminated */ + + vst1.32 {d0, d1, d2, d3}, [r1, :128] + diff --git a/debian/patches/0002-avcodec-libtwolame-fix-mono-default-bitrate.patch b/debian/patches/0002-avcodec-libtwolame-fix-mono-default-bitrate.patch new file mode 100644 index 00000000..8e955c46 --- /dev/null +++ b/debian/patches/0002-avcodec-libtwolame-fix-mono-default-bitrate.patch @@ -0,0 +1,36 @@ +From: James Cowgill +Date: Fri, 1 Nov 2019 08:51:07 +0000 +Subject: [PATCH] avcodec/libtwolame: fix mono default bitrate + +As of libtwolame 0.4.0, 384 kbps is not accepted as a valid bitrate +for encoding mono audio and the maximum bitrate is now halved to 192 +kbps to comply with the MP2 standard. Example error: + + twolame_init_params(): 384kbps is an invalid bitrate for mono encoding. + +Adjust the default bitrate calculation to take this into account. + +Signed-off-by: James Cowgill +--- + libavcodec/libtwolame.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/libavcodec/libtwolame.c b/libavcodec/libtwolame.c +index 030f888..5ceb3d9 100644 +--- a/libavcodec/libtwolame.c ++++ b/libavcodec/libtwolame.c +@@ -78,8 +78,12 @@ static av_cold int twolame_encode_init(AVCodecContext *avctx) + twolame_set_in_samplerate(s->glopts, avctx->sample_rate); + twolame_set_out_samplerate(s->glopts, avctx->sample_rate); + +- if (!avctx->bit_rate) +- avctx->bit_rate = avctx->sample_rate < 28000 ? 160000 : 384000; ++ if (!avctx->bit_rate) { ++ if ((s->mode == TWOLAME_AUTO_MODE && avctx->channels == 1) || s->mode == TWOLAME_MONO) ++ avctx->bit_rate = avctx->sample_rate < 28000 ? 80000 : 192000; ++ else ++ avctx->bit_rate = avctx->sample_rate < 28000 ? 160000 : 384000; ++ } + + if (avctx->flags & AV_CODEC_FLAG_QSCALE || !avctx->bit_rate) { + twolame_set_VBR(s->glopts, TRUE); diff --git a/doc/APIchanges b/doc/APIchanges index 07331b16..f9a1484b 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,19 +2,543 @@ Never assume the API of libav* to be stable unless at least 1 month has passed since the last major version increase or the API was added. The last version increases were: -libavcodec: 2017-10-21 -libavdevice: 2017-10-21 -libavfilter: 2017-10-21 -libavformat: 2017-10-21 -libavresample: 2017-10-21 -libpostproc: 2017-10-21 -libswresample: 2017-10-21 -libswscale: 2017-10-21 -libavutil: 2017-10-21 +libavcodec: 2021-04-27 +libavdevice: 2021-04-27 +libavfilter: 2021-04-27 +libavformat: 2021-04-27 +libpostproc: 2021-04-27 +libswresample: 2021-04-27 +libswscale: 2021-04-27 +libavutil: 2021-04-27 API changes, most recent first: +-------- 8< --------- FFmpeg 5.1 was cut here -------- 8< --------- + +2022-06-12 - 7cae3d8b76 - lavf 59.25.100 - avio.h + Add avio_vprintf(), similar to avio_printf() but allow to use it + from within a function taking a variable argument list as input. + +2022-06-12 - ff59ecc4de - lavu 57.27.100 - uuid.h + Add UUID handling functions. + Add av_uuid_parse(), av_uuid_urn_parse(), av_uuid_parse_range(), + av_uuid_parse_range(), av_uuid_equal(), av_uuid_copy(), and av_uuid_nil(). + +2022-06-01 - d42b410e05 - lavu 57.26.100 - csp.h + Add public API for colorspace structs. + Add av_csp_luma_coeffs_from_avcsp(), av_csp_primaries_desc_from_id(), + and av_csp_primaries_id_from_desc(). + +2022-05-23 - 4cdc14aa95 - lavu 57.25.100 - avutil.h + Deprecate av_fopen_utf8() without replacement. + +2022-03-16 - f3a0e2ee2b - all libraries - version_major.h + Add lib/version_major.h as new installed headers, which only + contain the major version number (and corresponding API deprecation + defines). + +2022-03-15 - cdba98bb80 - swr 4.5.100 - swresample.h + Add swr_alloc_set_opts2() and swr_build_matrix2(). + Deprecate swr_alloc_set_opts() and swr_build_matrix(). + +2022-03-15 - cdba98bb80 - lavfi 8.28.100 - avfilter.h buffersink.h buffersrc.h + Update AVFilterLink for the new channel layout API: add ch_layout, + deprecate channel_layout. + + Update the buffersink filter sink for the new channel layout API: + add av_buffersink_get_ch_layout() and the ch_layouts option, + deprecate av_buffersink_get_channel_layout() and the channel_layouts option. + + Update AVBufferSrcParameters for the new channel layout API: + add ch_layout, deprecate channel_layout. + +2022-03-15 - cdba98bb80 - lavf 59.19.100 - avformat.h + Add AV_DISPOSITION_NON_DIEGETIC. + +2022-03-15 - cdba98bb80 - lavc 59.24.100 - avcodec.h codec_par.h + Update AVCodecParameters for the new channel layout API: add ch_layout, + deprecate channels/channel_layout. + + Update AVCodecContext for the new channel layout API: add ch_layout, + deprecate channels/channel_layout. + + Update AVCodec for the new channel layout API: add ch_layouts, + deprecate channel_layouts. + +2022-03-15 - cdba98bb80 - lavu 57.24.100 - channel_layout.h frame.h opt.h + Add new channel layout API based on the AVChannelLayout struct. + Add support for Ambisonic audio. + Deprecate previous channel layout API based on uint64 bitmasks. + + Add AV_OPT_TYPE_CHLAYOUT option type, deprecate AV_OPT_TYPE_CHANNEL_LAYOUT. + Update AVFrame for the new channel layout API: add ch_layout, deprecate + channels/channel_layout. + +2022-03-10 - f629ea2e18 - lavu 57.23.100 - cpu.h + Add AV_CPU_FLAG_AVX512ICL. + +2022-02-07 - a10f1aec1f - lavu 57.21.100 - fifo.h + Deprecate AVFifoBuffer and the API around it, namely av_fifo_alloc(), + av_fifo_alloc_array(), av_fifo_free(), av_fifo_freep(), av_fifo_reset(), + av_fifo_size(), av_fifo_space(), av_fifo_generic_peek_at(), + av_fifo_generic_peek(), av_fifo_generic_read(), av_fifo_generic_write(), + av_fifo_realloc2(), av_fifo_grow(), av_fifo_drain() and av_fifo_peek2(). + Users should switch to the AVFifo-API. + +2022-02-07 - 7329b22c05 - lavu 57.20.100 - fifo.h + Add a new FIFO API, which allows setting a FIFO element size. + This API operates on these elements rather than on bytes. + Add av_fifo_alloc2(), av_fifo_elem_size(), av_fifo_can_read(), + av_fifo_can_write(), av_fifo_grow2(), av_fifo_drain2(), av_fifo_write(), + av_fifo_write_from_cb(), av_fifo_read(), av_fifo_read_to_cb(), + av_fifo_peek(), av_fifo_peek_to_cb(), av_fifo_drain2(), av_fifo_reset2(), + av_fifo_freep2(), av_fifo_auto_grow_limit(). + +2022-01-26 - af94ab7c7c0 - lavu 57.19.100 - tx.h + Add AV_TX_FLOAT_RDFT, AV_TX_DOUBLE_RDFT and AV_TX_INT32_RDFT. + +-------- 8< --------- FFmpeg 5.0 was cut here -------- 8< --------- + +2022-01-04 - 78dc21b123e - lavu 57.16.100 - frame.h + Add AV_FRAME_DATA_DOVI_METADATA. + +2022-01-03 - 70f318e6b6c - lavf 59.13.100 - avformat.h + Add AVFMT_EXPERIMENTAL flag. + +2021-12-22 - b7e1ec7bda9 - lavu 57.13.100 - hwcontext_videotoolbox.h + Add av_vt_pixbuf_set_attachments + +2021-12-22 - 69bd95dcd8d - lavu 57.13.100 - hwcontext_videotoolbox.h + Add av_map_videotoolbox_chroma_loc_from_av + Add av_map_videotoolbox_color_matrix_from_av + Add av_map_videotoolbox_color_primaries_from_av + Add av_map_videotoolbox_color_trc_from_av + +2021-12-21 - ffbab99f2c2 - lavu 57.12.100 - cpu.h + Add AV_CPU_FLAG_SLOW_GATHER. + +2021-12-20 - 278068dc60d - lavu 57.11.101 - display.h + Modified the documentation of av_display_rotation_set() + to match its longstanding actual behaviour of treating + the angle as directed clockwise. + +2021-12-12 - 64834bb86a1 - lavf 59.10.100 - avformat.h + Add AVFormatContext io_close2 which returns an int + +2021-12-10 - f45cbb775e4 - lavu 57.11.100 - hwcontext_vulkan.h + Add AVVkFrame.offset and AVVulkanFramesContext.flags. + +2021-12-04 - b9c928a486f - lavfi 8.19.100 - avfilter.h + Add AVFILTER_FLAG_METADATA_ONLY. + +2021-12-03 - b236ef0a594 - lavu 57.10.100 - frame.h + Add AVFrame.time_base + +2021-11-22 - b2cd1fb2ec6 - lavu 57.9.100 - pixfmt.h + Add AV_PIX_FMT_P210, AV_PIX_FMT_P410, AV_PIX_FMT_P216, and AV_PIX_FMT_P416. + +2021-11-17 - 54e65aa38ab - lavf 57.9.100 - frame.h + Add AV_FRAME_DATA_DOVI_RPU_BUFFER. + +2021-11-16 - ed75a08d36c - lavf 59.9.100 - avformat.h + Add av_stream_get_class(). Schedule adding AVStream.av_class at libavformat + major version 60. + Add av_disposition_to_string() and av_disposition_from_string(). + Add "disposition" AVOption to AVStream's class. + +2021-11-12 - 8478d60d5b5 - lavu 57.8.100 - hwcontext_vulkan.h + Added AVVkFrame.sem_value, AVVulkanDeviceContext.queue_family_encode_index, + nb_encode_queues, queue_family_decode_index, and nb_decode_queues. + +2021-10-18 - 682bafdb125 - lavf 59.8.100 - avio.h + Introduce public bytes_{read,written} statistic fields to AVIOContext. + +2021-10-13 - a5622ed16f8 - lavf 59.7.100 - avio.h + Deprecate AVIOContext.written. Originally added as a private entry in + commit 3f75e5116b900f1428aa13041fc7d6301bf1988a, its grouping with + the comment noting its private state was missed during merging of the field + from Libav (most likely due to an already existing field in between). + +2021-09-21 - 0760d9153c3 - lavu 57.7.100 - pixfmt.h + Add AV_PIX_FMT_X2BGR10. + +2021-09-20 - 8d5de914d31 - lavu 57.6.100 - mem.h + Deprecate av_mallocz_array() as it is identical to av_calloc(). + +2021-09-20 - 176b8d785bf - lavc 59.9.100 - avcodec.h + Deprecate AVCodecContext.sub_text_format and the corresponding + AVOptions. It is unused since the last major bump. + +2021-09-20 - dd846bc4a91 - lavc 59.8.100 - avcodec.h codec.h + Deprecate AV_CODEC_FLAG_TRUNCATED and AV_CODEC_CAP_TRUNCATED, + as they are redundant with parsers. + +2021-09-17 - ccfdef79b13 - lavu 57.5.101 - buffer.h + Constified the input parameters in av_buffer_replace(), av_buffer_ref(), + and av_buffer_pool_buffer_get_opaque(). + +2021-09-08 - 4f78711f9c2 - lavu 57.5.100 - hwcontext_d3d11va.h + Add AVD3D11VAFramesContext.texture_infos + +2021-09-06 - 42cd64c1826 - lsws 6.1.100 - swscale.h + Add AVFrame-based scaling API: + - sws_scale_frame() + - sws_frame_start() + - sws_frame_end() + - sws_send_slice() + - sws_receive_slice() + - sws_receive_slice_alignment() + +2021-09-02 - cbf111059d2 - lavc 59.7.100 - avcodec.h + Incremented the number of elements of AVCodecParser.codec_ids to seven. + +2021-08-24 - 590a7e02f04 - lavc 59.6.100 - avcodec.h + Add FF_CODEC_PROPERTY_FILM_GRAIN + +2021-08-20 - 7c5f998196d - lavfi 8.3.100 - avfilter.H + Add avfilter_filter_pad_count() as a replacement for avfilter_pad_count(). + Deprecate avfilter_pad_count(). + +2021-08-17 - 8c53b145993 - lavu 57.4.101 - opt.h + av_opt_copy() now guarantees that allocated src and dst options + don't alias each other even on error. + +2021-08-14 - d5de9965ef6 - lavu 57.4.100 - imgutils.h + Add av_image_copy_plane_uc_from() + +2021-08-02 - a1a0fddfd05 - lavc 59.4.100 - packet.h + Add AVPacket.opaque, AVPacket.opaque_ref, AVPacket.time_base. + +2021-07-23 - 2dd8acbe800 - lavu 57.3.100 - common.h macros.h + Move several macros (AV_NE, FFDIFFSIGN, FFMAX, FFMAX3, FFMIN, FFMIN3, + FFSWAP, FF_ARRAY_ELEMS, MKTAG, MKBETAG) from common.h to macros.h. + +2021-07-22 - e3b5ff17c2e - lavu 57.2.100 - film_grain_params.h + Add AV_FILM_GRAIN_PARAMS_H274, AVFilmGrainH274Params + +2021-07-19 - c1bf56a526f - lavu 57.1.100 - cpu.h + Add av_cpu_force_count() + +2021-06-17 - aca923b3653 - lavc 59.2.100 - packet.h + Add AV_PKT_DATA_DYNAMIC_HDR10_PLUS + +2021-06-09 - 2cccab96f6f - lavf 59.3.100 - avformat.h + Add pts_wrap_bits to AVStream + +2021-06-10 - 7c9763070d9 - lavc 59.1.100 - avcodec.h codec.h + Move av_get_profile_name() from avcodec.h to codec.h. + +2021-06-10 - bb3648e6766 - lavc 59.1.100 - avcodec.h codec_par.h + Move av_get_audio_frame_duration2() from avcodec.h to codec_par.h. + +2021-06-10 - 881db34f6a0 - lavc 59.1.100 - avcodec.h codec_id.h + Move av_get_bits_per_sample(), av_get_exact_bits_per_sample(), + avcodec_profile_name(), and av_get_pcm_codec() from avcodec.h + to codec_id.h. + +2021-06-10 - ff0a96046d8 - lavc 59.1.100 - avcodec.h defs.h + Add new installed header defs.h. The following definitions are moved + into it from avcodec.h: + - AVDiscard + - AVAudioServiceType + - AVPanScan + - AVCPBProperties and av_cpb_properties_alloc() + - AVProducerReferenceTime + - av_xiphlacing() + +2021-04-27 - cb3ac722f4 - lavc 59.0.100 - avcodec.h + Constified AVCodecParserContext.parser. + +2021-04-27 - 8b3e6ce5f4 - lavd 59.0.100 - avdevice.h + The av_*_device_next API functions now accept and return + pointers to const AVInputFormat resp. AVOutputFormat. + +2021-04-27 - d7e0d428fa - lavd 59.0.100 - avdevice.h + avdevice_list_input_sources and avdevice_list_output_sinks now accept + pointers to const AVInputFormat resp. const AVOutputFormat. + +2021-04-27 - 46dac8cf3d - lavf 59.0.100 - avformat.h + av_find_best_stream now uses a const AVCodec ** parameter + for the returned decoder. + +2021-04-27 - 626535f6a1 - lavc 59.0.100 - codec.h + avcodec_find_encoder_by_name(), avcodec_find_encoder(), + avcodec_find_decoder_by_name() and avcodec_find_decoder() + now return a pointer to const AVCodec. + +2021-04-27 - 14fa0a4efb - lavf 59.0.100 - avformat.h + Constified AVFormatContext.*_codec. + +2021-04-27 - 56450a0ee4 - lavf 59.0.100 - avformat.h + Constified the pointers to AVInputFormats and AVOutputFormats + in AVFormatContext, avformat_alloc_output_context2(), + av_find_input_format(), av_probe_input_format(), + av_probe_input_format2(), av_probe_input_format3(), + av_probe_input_buffer2(), av_probe_input_buffer(), + avformat_open_input(), av_guess_format() and av_guess_codec(). + Furthermore, constified the AVProbeData in av_probe_input_format(), + av_probe_input_format2() and av_probe_input_format3(). + +2021-04-19 - 18af1ea8d1 - lavu 56.74.100 - tx.h + Add AV_TX_FULL_IMDCT and AV_TX_UNALIGNED. + +2021-04-17 - f1bf465aa0 - lavu 56.73.100 - frame.h detection_bbox.h + Add AV_FRAME_DATA_DETECTION_BBOXES + +2021-04-06 - 557953a397 - lavf 58.78.100 - avformat.h + Add avformat_index_get_entries_count(), avformat_index_get_entry(), + and avformat_index_get_entry_from_timestamp(). + +2021-03-21 - a77beea6c8 - lavu 56.72.100 - frame.h + Deprecated av_get_colorspace_name(). + Use av_color_space_name() instead. + +-------- 8< --------- FFmpeg 4.4 was cut here -------- 8< --------- + +2021-03-19 - e8c0bca6bd - lavu 56.69.100 - adler32.h + Added a typedef for the type of the Adler-32 checksums + used by av_adler32_update(). It will be changed to uint32_t + at the next major bump. + The type of the parameter for the length of the input buffer + will also be changed to size_t at the next major bump. + +2021-03-19 - e318438f2f - lavf 58.75.100 - avformat.h + AVChapter.id will be changed from int to int64_t + on the next major version bump. + +2021-03-17 - f7db77bd87 - lavc 58.133.100 - codec.h + Deprecated av_init_packet(). Once removed, sizeof(AVPacket) will + no longer be a part of the public ABI. + Deprecated AVPacketList. + +2021-03-16 - 7d09579190 - lavc 58.132.100 - codec.h + Add AV_CODEC_CAP_OTHER_THREADS as a new name for + AV_CODEC_CAP_AUTO_THREADS. AV_CODEC_CAP_AUTO_THREADS + is now deprecated. + +2021-03-12 - 6e7e3a3820 - lavc 58.131.100 - avcodec.h codec.h + Add a get_encode_buffer callback to AVCodecContext, similar to + get_buffer2 but for encoders. + Add avcodec_default_get_encode_buffer(). + Add AV_GET_ENCODE_BUFFER_FLAG_REF. + Encoders may now be flagged as AV_CODEC_CAP_DR1 capable. + +2021-03-10 - 42e68fe015 - lavf 58.72.100 - avformat.h + Change AVBufferRef related AVStream function and struct size + parameter and fields type to size_t at next major bump. + +2021-03-10 - d79e0fe65c - lavc 58.130.100 - packet.h + Change AVBufferRef related AVPacket function and struct size + parameter and fields type to size_t at next major bump. + +2021-03-10 - 14040a1d91 - lavu 56.68.100 - buffer.h frame.h + Change AVBufferRef and relevant AVFrame function and struct size + parameter and fields type to size_t at next major bump. + +2021-03-04 - a0eec776b6 - lavc 58.128.101 - avcodec.h + Enable err_recognition to be set for encoders. + +2021-03-03 - 2ff40b98ec - lavf 58.70.100 - avformat.h + Deprecate AVFMT_FLAG_PRIV_OPT. It will do nothing + as soon as av_demuxer_open() is removed. + +2021-02-27 - dd9227e48f - lavc 58.126.100 - avcodec.h + Deprecated avcodec_get_frame_class(). + +2021-02-21 - 5ca40d6d94 - lavu 56.66.100 - tx.h + Add enum AVTXFlags and AVTXFlags.AV_TX_INPLACE + +2021-02-14 - 4f49ca7bbc - lavd 58.12.100 - avdevice.h + Deprecated avdevice_capabilities_create() and + avdevice_capabilities_free(). + +2021-02-10 - 1bda9bb68a - lavu 56.65.100 - common.h + Add FFABS64U() + +2021-01-26 - 5dd9567080 - lavu 56.64.100 - common.h + Add FFABSU() + +2021-01-25 - 56709ca8aa - lavc 58.119.100 - avcodec.h + Deprecate AVCodecContext.debug_mv, FF_DEBUG_VIS_MV_P_FOR, FF_DEBUG_VIS_MV_B_FOR, + FF_DEBUG_VIS_MV_B_BACK + +2021-01-11 - ebdd33086a - lavc 58.116.100 - avcodec.h + Add FF_PROFILE_VVC_MAIN_10 and FF_PROFILE_VVC_MAIN_10_444. + +2020-01-01 - baecaa16c1 - lavu 56.63.100 - video_enc_params.h + Add AV_VIDEO_ENC_PARAMS_MPEG2 + +2020-12-03 - eca12f4d5a - lavu 56.62.100 - timecode.h + Add av_timecode_init_from_components. + +2020-11-27 - a83098ab03 - lavc 58.114.100 - avcodec.h + Deprecate AVCodecContext.thread_safe_callbacks. Starting with + LIBAVCODEC_VERSION_MAJOR=60, user callbacks must always be + thread-safe when frame threading is used. + +2020-11-25 - d243dd540a - lavc 58.113.100 - avcodec.h + Adds a new flag AV_CODEC_EXPORT_DATA_FILM_GRAIN for export_side_data. + +2020-11-25 - 4f9ee87253 - lavu 56.61.100 - film_grain_params.h + Adds a new API for extracting codec film grain parameters as side data. + Adds a new AVFrameSideDataType entry AV_FRAME_DATA_FILM_GRAIN_PARAMS for it. + +2020-10-28 - f95d9510ff - lavf 58.64.100 - avformat.h + Add AVSTREAM_EVENT_FLAG_NEW_PACKETS. + +2020-09-28 - 68918d3b7f - lavu 56.60.100 - buffer.h + Add a av_buffer_replace() convenience function. + +2020-09-13 - 837b6eb90e - lavu 56.59.100 - timecode.h + Add av_timecode_make_smpte_tc_string2. + +2020-08-21 - 06f2651204 - lavu 56.58.100 - avstring.h + Deprecate av_d2str(). Use av_asprintf() instead. + +2020-08-04 - 34de0abbe7 - lavu 56.58.100 - channel_layout.h + Add AV_CH_LAYOUT_22POINT2 together with its newly required pieces: + AV_CH_TOP_SIDE_LEFT, AV_CH_TOP_SIDE_RIGHT, AV_CH_BOTTOM_FRONT_CENTER, + AV_CH_BOTTOM_FRONT_LEFT, AV_CH_BOTTOM_FRONT_RIGHT. + +2020-07-23 - 84655b7101 - lavu 56.57.100 - cpu.h + Add AV_CPU_FLAG_MMI and AV_CPU_FLAG_MSA. + +2020-07-22 - 3a8e927176 - lavu 56.56.100 - imgutils.h + Add av_image_fill_plane_sizes(). + +2020-07-15 - 448a9aaa78 - lavc 58.96.100 - packet.h + Add AV_PKT_DATA_S12M_TIMECODE. + +2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h + Add AV_PIX_FMT_X2RGB10. + +2020-06-11 - bc8ab084fb - lavu 56.54.100 - frame.h + Add AV_FRAME_DATA_SEI_UNREGISTERED. + +2020-06-10 - 1b4a98b029 - lavu 56.53.100 - log.h opt.h + Add av_opt_child_class_iterate() and AVClass.child_class_iterate(). + Deprecate av_opt_child_class_next() and AVClass.child_class_next(). + +-------- 8< --------- FFmpeg 4.3 was cut here -------- 8< --------- + +2020-06-05 - ec39c2276a - lavu 56.50.100 - buffer.h + Passing NULL as alloc argument to av_buffer_pool_init2() is now allowed. + +2020-05-27 - ba6cada92e - lavc 58.88.100 - avcodec.h codec.h + Move AVCodec-related public API to new header codec.h. + +2020-05-23 - 064b875e89 - lavu 56.49.100 - video_enc_params.h + Add AV_VIDEO_ENC_PARAMS_H264. + +2020-05-23 - 2e08b39444 - lavu 56.48.100 - hwcontext.h + Add av_hwdevice_ctx_create_derived_opts. + +2020-05-23 - 6b65c4ec54 - lavu 56.47.100 - rational.h + Add av_gcd_q(). + +2020-05-22 - af9e622776 - lavu 56.46.101 - opt.h + Add AV_OPT_FLAG_CHILD_CONSTS. + +2020-05-22 - 9d443c3e68 - lavc 58.87.100 - avcodec.h codec_par.h + Move AVBitstreamFilter-related public API to new header bsf.h. + Move AVCodecParameters-related public API to new header codec_par.h. + +2020-05-21 - 13b1bbff0b - lavc 58.86.101 - avcodec.h + Deprecated AV_CODEC_CAP_INTRA_ONLY and AV_CODEC_CAP_LOSSLESS. + +2020-05-17 - 84af196c65 - lavu 56.46.100 - common.h + Add av_sat_add64() and av_sat_sub64() + +2020-05-12 - 991d417692 - lavu 56.45.100 - video_enc_params.h + lavc 58.84.100 - avcodec.h + Add a new API for exporting video encoding information. + Replaces the deprecated API for exporting QP tables from decoders. + Add AV_CODEC_EXPORT_DATA_VIDEO_ENC_PARAMS to request this information from + decoders. + +2020-05-10 - dccd07f66d - lavu 56.44.100 - hwcontext_vulkan.h + Add enabled_inst_extensions, num_enabled_inst_extensions, enabled_dev_extensions + and num_enabled_dev_extensions fields to AVVulkanDeviceContext + +2020-04-22 - 0e1db79e37 - lavc 58.81.100 - packet.h + - lavu 56.43.100 - dovi_meta.h + Add AV_PKT_DATA_DOVI_CONF and AVDOVIDecoderConfigurationRecord. + +2020-04-15 - 22b25b3ea5 - lavc 58.79.100 - avcodec.h + Add formal support for calling avcodec_flush_buffers() on encoders. + Encoders that set the cap AV_CODEC_CAP_ENCODER_FLUSH will be flushed. + For all other encoders, the call is now a no-op rather than undefined + behaviour. + +2020-04-10 - 672946c7fe - lavc 58.78.100 - avcodec.h codec_desc.h codec_id.h packet.h + Move AVCodecDesc-related public API to new header codec_desc.h. + Move AVCodecID enum to new header codec_id.h. + Move AVPacket-related public API to new header packet.h. + +2020-03-29 - 4cb0dda555 - lavf 58.42.100 - avformat.h + av_read_frame() now guarantees to handle uninitialized input packets + and to return refcounted packets on success. + +2020-03-27 - c52ec0367d - lavc 58.77.100 - avcodec.h + av_packet_ref() now guarantees to return the destination packet + in a blank state on error. + +2020-03-10 - 05d27f342b - lavc 58.75.100 - avcodec.h + Add AV_PKT_DATA_ICC_PROFILE. + +2020-02-21 - d005a7cdfd - lavc 58.73.101 - avcodec.h + Add AV_CODEC_EXPORT_DATA_PRFT. + +2020-02-21 - c666689491 - lavc 58.73.100 - avcodec.h + Add AVCodecContext.export_side_data and AV_CODEC_EXPORT_DATA_MVS. + +2020-02-13 - e8f054b095 - lavu 56.41.100 - tx.h + Add AV_TX_INT32_FFT and AV_TX_INT32_MDCT + +2020-02-12 - 3182114f88 - lavu 56.40.100 - log.h + Add av_log_once(). + +2020-02-04 - a88449ffb2 - lavu 56.39.100 - hwcontext.h + Add AV_PIX_FMT_VULKAN + Add AV_HWDEVICE_TYPE_VULKAN and implementation. + +2020-01-30 - 27529eeb27 - lavf 58.37.100 - avio.h + Add avio_protocol_get_class(). + +2020-01-15 - 717b2074ec - lavc 58.66.100 - avcodec.h + Add AV_PKT_DATA_PRFT and AVProducerReferenceTime. + +2019-12-27 - 45259a0ee4 - lavu 56.38.100 - eval.h + Add av_expr_count_func(). + +2019-12-26 - 16685114d5 - lavu 56.37.100 - buffer.h + Add av_buffer_pool_buffer_get_opaque(). + +2019-11-17 - 1c23abc88f - lavu 56.36.100 - eval API + Add av_expr_count_vars(). + +2019-10-14 - f3746d31f9 - lavu 56.35.101 - opt.h + Add AV_OPT_FLAG_RUNTIME_PARAM. + +2019-09-25 - f8406ab4b9 - lavc 58.59.100 - avcodec.h + Add max_samples + +2019-09-04 - 2a9d461abc - lavu 56.35.100 - hwcontext_videotoolbox.h + Add av_map_videotoolbox_format_from_pixfmt2() for full range pixfmt + +2019-09-01 - 8821d1f56e - lavu 56.34.100 - pixfmt.h + Add EBU Tech. 3213-E AVColorPrimaries value + +2019-08-17 - 95fa73a2b4 - lavf 58.31.101 - avio.h + 4K limit removed from avio_printf. + +2019-08-17 - a82f8f2f10 - lavf 58.31.100 - avio.h + Add avio_print_string_array and avio_print. + +2019-07-27 - 42e2319ba9 - lavu 56.33.100 - tx.h + Add AV_TX_DOUBLE_FFT and AV_TX_DOUBLE_MDCT + -------- 8< --------- FFmpeg 4.2 was cut here -------- 8< --------- 2019-06-21 - a30e44098a - lavu 56.30.100 - frame.h @@ -1165,7 +1689,7 @@ API changes, most recent first: 2014-04-15 - ef818d8 - lavf 55.37.101 - avformat.h Add av_format_inject_global_side_data() -2014-04-12 - 4f698be - lavu 52.76.100 - log.h +2014-04-12 - 4f698be8f - lavu 52.76.100 - log.h Add av_log_get_flags() 2014-04-11 - 6db42a2b - lavd 55.12.100 - avdevice.h diff --git a/doc/Doxyfile b/doc/Doxyfile index 736032d8..4314fceb 100644 --- a/doc/Doxyfile +++ b/doc/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = FFmpeg # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 4.2.2 +PROJECT_NUMBER = 5.1.1 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/doc/Makefile b/doc/Makefile index fa4996b5..25774c7b 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -27,6 +27,9 @@ HTMLPAGES = $(AVPROGS-yes:%=doc/%.html) $(AVPROGS-yes:%=doc/%-all.html) $(COMP doc/mailing-list-faq.html \ doc/nut.html \ doc/platform.html \ + $(SRC_PATH)/doc/bootstrap.min.css \ + $(SRC_PATH)/doc/style.min.css \ + $(SRC_PATH)/doc/default.css \ TXTPAGES = doc/fate.txt \ @@ -102,7 +105,7 @@ DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak doc/doxy/html: TAG = DOXY doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS) - $(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT); + $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $$PWD/doc/doxy $(SRC_PATH) doc/Doxyfile $(DOXYGEN) $(DOXY_INPUT); install-doc: install-html install-man diff --git a/doc/bitstream_filters.texi b/doc/bitstream_filters.texi index 14f35893..50c95f03 100644 --- a/doc/bitstream_filters.texi +++ b/doc/bitstream_filters.texi @@ -81,7 +81,7 @@ Top-left position. @end table @item tick_rate -Set the tick rate (@emph{num_units_in_display_tick / time_scale}) in +Set the tick rate (@emph{time_scale / num_units_in_display_tick}) in the timing info in the sequence header. @item num_ticks_per_picture Set the number of ticks in each picture, to indicate that the stream @@ -132,6 +132,36 @@ the header stored in extradata to the key packets: ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts @end example +@section dv_error_marker + +Blocks in DV which are marked as damaged are replaced by blocks of the specified color. + +@table @option +@item color +The color to replace damaged blocks by +@item sta +A 16 bit mask which specifies which of the 16 possible error status values are +to be replaced by colored blocks. 0xFFFE is the default which replaces all non 0 +error status values. +@table @samp +@item ok +No error, no concealment +@item err +Error, No concealment +@item res +Reserved +@item notok +Error or concealment +@item notres +Not reserved +@item Aa, Ba, Ca, Ab, Bb, Cb, A, B, C, a, b, erri, erru +The specific error status code +@end table +see page 44-46 or section 5.5 of +@url{http://web.archive.org/web/20060927044735/http://www.smpte.org/smpte_store/standards/pdf/s314m.pdf} + +@end table + @section eac3_core Extract the core from a E-AC-3 stream, dropping extra channels. @@ -217,12 +247,20 @@ Modify metadata embedded in an H.264 stream. Insert or remove AUD NAL units in all access units of the stream. @table @samp +@item pass @item insert @item remove @end table +Default is pass. + @item sample_aspect_ratio Set the sample aspect ratio of the stream in the VUI parameters. +See H.264 table E-1. + +@item overscan_appropriate_flag +Set whether the stream is suitable for display using overscan +or not (see H.264 section E.2.1). @item video_format @item video_full_range_flag @@ -240,7 +278,7 @@ Set the chroma sample location in the stream (see H.264 section E.2.1 and figure E-1). @item tick_rate -Set the tick rate (num_units_in_tick / time_scale) in the VUI +Set the tick rate (time_scale / num_units_in_tick) in the VUI parameters. This is the smallest time unit representable in the stream, and in many cases represents the field rate of the stream (double the frame rate). @@ -249,6 +287,11 @@ Set whether the stream has fixed framerate - typically this indicates that the framerate is exactly half the tick rate, but the exact meaning is dependent on interlacing and the picture structure (see H.264 section E.2.1 and table E-6). +@item zero_new_constraint_set_flags +Zero constraint_set4_flag and constraint_set5_flag in the SPS. These +bits were reserved in a previous version of the H.264 spec, and thus +some hardware decoders require these to be zero. The result of zeroing +this is still a valid bitstream. @item crop_left @item crop_right @@ -272,6 +315,37 @@ insert the string ``hello'' associated with the given UUID. @item delete_filler Deletes both filler NAL units and filler SEI messages. +@item display_orientation +Insert, extract or remove Display orientation SEI messages. +See H.264 section D.1.27 and D.2.27 for syntax and semantics. + +@table @samp +@item pass +@item insert +@item remove +@item extract +@end table + +Default is pass. + +Insert mode works in conjunction with @code{rotate} and @code{flip} options. +Any pre-existing Display orientation messages will be removed in insert or remove mode. +Extract mode attaches the display matrix to the packet as side data. + +@item rotate +Set rotation in display orientation SEI (anticlockwise angle in degrees). +Range is -360 to +360. Default is NaN. + +@item flip +Set flip in display orientation SEI. + +@table @samp +@item horizontal +@item vertical +@end table + +Default is unset. + @item level Set the level in the SPS. Refer to H.264 section A.3 and tables A-1 to A-5. @@ -343,8 +417,8 @@ Set the chroma sample location in the stream (see H.265 section E.3.1 and figure E.1). @item tick_rate -Set the tick rate in the VPS and VUI parameters (num_units_in_tick / -time_scale). Combined with @option{num_ticks_poc_diff_one}, this can +Set the tick rate in the VPS and VUI parameters (time_scale / +num_units_in_tick). Combined with @option{num_ticks_poc_diff_one}, this can set a constant framerate in the stream. Note that it is likely to be overridden by container parameters when the stream is in a container. @@ -525,25 +599,110 @@ container. Can be used for fuzzing or testing error resilience/concealment. Parameters: @table @option @item amount -A numeral string, whose value is related to how often output bytes will -be modified. Therefore, values below or equal to 0 are forbidden, and -the lower the more frequent bytes will be modified, with 1 meaning -every byte is modified. +Accepts an expression whose evaluation per-packet determines how often bytes in that +packet will be modified. A value below 0 will result in a variable frequency. +Default is 0 which results in no modification. However, if neither amount nor drop is specified, +amount will be set to @var{-1}. See below for accepted variables. +@item drop +Accepts an expression evaluated per-packet whose value determines whether that packet is dropped. +Evaluation to a positive value results in the packet being dropped. Evaluation to a negative +value results in a variable chance of it being dropped, roughly inverse in proportion to the magnitude +of the value. Default is 0 which results in no drops. See below for accepted variables. @item dropamount -A numeral string, whose value is related to how often packets will be dropped. -Therefore, values below or equal to 0 are forbidden, and the lower the more -frequent packets will be dropped, with 1 meaning every packet is dropped. +Accepts a non-negative integer, which assigns a variable chance of it being dropped, roughly inverse +in proportion to the value. Default is 0 which results in no drops. This option is kept for backwards +compatibility and is equivalent to setting drop to a negative value with the same magnitude +i.e. @code{dropamount=4} is the same as @code{drop=-4}. Ignored if drop is also specified. @end table -The following example applies the modification to every byte but does not drop -any packets. +Both @code{amount} and @code{drop} accept expressions containing the following variables: + +@table @samp +@item n +The index of the packet, starting from zero. +@item tb +The timebase for packet timestamps. +@item pts +Packet presentation timestamp. +@item dts +Packet decoding timestamp. +@item nopts +Constant representing AV_NOPTS_VALUE. +@item startpts +First non-AV_NOPTS_VALUE PTS seen in the stream. +@item startdts +First non-AV_NOPTS_VALUE DTS seen in the stream. +@item duration +@itemx d +Packet duration, in timebase units. +@item pos +Packet position in input; may be -1 when unknown or not set. +@item size +Packet size, in bytes. +@item key +Whether packet is marked as a keyframe. +@item state +A pseudo random integer, primarily derived from the content of packet payload. +@end table + +@subsection Examples +Apply modification to every byte but don't drop any packets. @example -ffmpeg -i INPUT -c copy -bsf noise[=1] output.mkv +ffmpeg -i INPUT -c copy -bsf noise=1 output.mkv +@end example + +Drop every video packet not marked as a keyframe after timestamp 30s but do not +modify any of the remaining packets. +@example +ffmpeg -i INPUT -c copy -bsf:v noise=drop='gt(t\,30)*not(key)' output.mkv +@end example + +Drop one second of audio every 10 seconds and add some random noise to the rest. +@example +ffmpeg -i INPUT -c copy -bsf:a noise=amount=-1:drop='between(mod(t\,10)\,9\,10)' output.mkv @end example @section null This bitstream filter passes the packets through unchanged. +@section pcm_rechunk + +Repacketize PCM audio to a fixed number of samples per packet or a fixed packet +rate per second. This is similar to the @ref{asetnsamples,,asetnsamples audio +filter,ffmpeg-filters} but works on audio packets instead of audio frames. + +@table @option +@item nb_out_samples, n +Set the number of samples per each output audio packet. The number is intended +as the number of samples @emph{per each channel}. Default value is 1024. + +@item pad, p +If set to 1, the filter will pad the last audio packet with silence, so that it +will contain the same number of samples (or roughly the same number of samples, +see @option{frame_rate}) as the previous ones. Default value is 1. + +@item frame_rate, r +This option makes the filter output a fixed number of packets per second instead +of a fixed number of samples per packet. If the audio sample rate is not +divisible by the frame rate then the number of samples will not be constant but +will vary slightly so that each packet will start as close to the frame +boundary as possible. Using this option has precedence over @option{nb_out_samples}. +@end table + +You can generate the well known 1602-1601-1602-1601-1602 pattern of 48kHz audio +for NTSC frame rate using the @option{frame_rate} option. +@example +ffmpeg -f lavfi -i sine=r=48000:d=1 -c pcm_s16le -bsf pcm_rechunk=r=30000/1001 -f framecrc - +@end example + +@section pgs_frame_merge + +Merge a sequence of PGS Subtitle segments ending with an "end of display set" +segment into a single packet. + +This is required by some containers that support PGS subtitles +(muxer @code{matroska}). + @section prores_metadata Modify color property metadata embedded in prores stream. @@ -585,6 +744,10 @@ Keep the same transfer characteristics property (default). @item unknown @item bt709 BT 601, BT 709, BT 2020 +@item smpte2084 +SMPTE ST 2084 +@item arib-std-b67 +ARIB STD-B67 @end table @@ -594,7 +757,7 @@ Available values are: @table @samp @item auto -Keep the same transfer characteristics property (default). +Keep the same colorspace property (default). @item unknown @item bt709 @@ -610,6 +773,11 @@ Set Rec709 colorspace for each frame of the file ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt709:color_trc=bt709:colorspace=bt709 output.mov @end example +Set Hybrid Log-Gamma parameters for each frame of the file +@example +ffmpeg -i INPUT -c copy -bsf:v prores_metadata=color_primaries=bt2020:color_trc=arib-std-b67:colorspace=bt2020nc output.mov +@end example + @section remove_extra Remove extradata from packets. @@ -632,6 +800,91 @@ Remove extradata from all frames. @end table @end table +@section setts +Set PTS and DTS in packets. + +It accepts the following parameters: +@table @option +@item ts +@item pts +@item dts +Set expressions for PTS, DTS or both. +@item duration +Set expression for duration. +@item time_base +Set output time base. +@end table + +The expressions are evaluated through the eval API and can contain the following +constants: + +@table @option +@item N +The count of the input packet. Starting from 0. + +@item TS +The demux timestamp in input in case of @code{ts} or @code{dts} option or presentation +timestamp in case of @code{pts} option. + +@item POS +The original position in the file of the packet, or undefined if undefined +for the current packet + +@item DTS +The demux timestamp in input. + +@item PTS +The presentation timestamp in input. + +@item DURATION +The duration in input. + +@item STARTDTS +The DTS of the first packet. + +@item STARTPTS +The PTS of the first packet. + +@item PREV_INDTS +The previous input DTS. + +@item PREV_INPTS +The previous input PTS. + +@item PREV_INDURATION +The previous input duration. + +@item PREV_OUTDTS +The previous output DTS. + +@item PREV_OUTPTS +The previous output PTS. + +@item PREV_OUTDURATION +The previous output duration. + +@item NEXT_DTS +The next input DTS. + +@item NEXT_PTS +The next input PTS. + +@item NEXT_DURATION +The next input duration. + +@item TB +The timebase of stream packet belongs. + +@item TB_OUT +The output timebase. + +@item SR +The sample rate of stream packet belongs. + +@item NOPTS +The AV_NOPTS_VALUE constant. +@end table + @anchor{text2movsub} @section text2movsub @@ -659,7 +912,9 @@ Modify metadata embedded in a VP9 stream. @table @option @item color_space -Set the color space value in the frame header. +Set the color space value in the frame header. Note that any frame +set to RGB will be implicitly set to PC range and that RGB is +incompatible with profiles 0 and 2. @table @samp @item unknown @item bt601 @@ -671,8 +926,8 @@ Set the color space value in the frame header. @end table @item color_range -Set the color range value in the frame header. Note that this cannot -be set in RGB streams. +Set the color range value in the frame header. Note that any value +imposed by the color space will take precedence over this value. @table @samp @item tv @item pc diff --git a/doc/build_system.txt b/doc/build_system.txt index 3d6a21a9..0b1b0c20 100644 --- a/doc/build_system.txt +++ b/doc/build_system.txt @@ -48,6 +48,8 @@ config tools/target_dec__fuzzer Build fuzzer to fuzz the specified decoder. +tools/target_bsf__fuzzer + Build fuzzer to fuzz the specified bitstream filter. Useful standard make commands: make -t diff --git a/doc/codecs.texi b/doc/codecs.texi index 0d0de94c..5e100209 100644 --- a/doc/codecs.texi +++ b/doc/codecs.texi @@ -50,11 +50,10 @@ Use internal 2pass ratecontrol in first pass mode. Use internal 2pass ratecontrol in second pass mode. @item gray Only decode/encode grayscale. -@item emu_edge -Do not draw edges. @item psnr Set error[?] variables during encoding. @item truncated +Input bitstream might be randomly truncated. @item drop_changed Don't output frames whose parameters differ from first decoded frame in stream. Error AVERROR_INPUT_CHANGED is returned when a frame is dropped. @@ -71,50 +70,14 @@ This ensures that file and data checksums are reproducible and match between platforms. Its primary use is for regression testing. @item aic Apply H263 advanced intra coding / mpeg4 ac prediction. -@item cbp -Deprecated, use mpegvideo private options instead. -@item qprd -Deprecated, use mpegvideo private options instead. @item ilme Apply interlaced motion estimation. @item cgop Use closed gop. +@item output_corrupt +Output even potentially corrupted frames. @end table -@item me_method @var{integer} (@emph{encoding,video}) -Set motion estimation method. - -Possible values: -@table @samp -@item zero -zero motion estimation (fastest) -@item full -full motion estimation (slowest) -@item epzs -EPZS motion estimation (default) -@item esa -esa motion estimation (alias for full) -@item tesa -tesa motion estimation -@item dia -dia motion estimation (alias for epzs) -@item log -log motion estimation -@item phods -phods motion estimation -@item x1 -X1 motion estimation -@item hex -hex motion estimation -@item umh -umh motion estimation -@item iter -iter motion estimation -@end table - -@item extradata_size @var{integer} -Set extradata size. - @item time_base @var{rational number} Set codec time base. @@ -181,24 +144,6 @@ Default value is 0. @item b_qfactor @var{float} (@emph{encoding,video}) Set qp factor between P and B frames. -@item rc_strategy @var{integer} (@emph{encoding,video}) -Set ratecontrol method. - -@item b_strategy @var{integer} (@emph{encoding,video}) -Set strategy to choose between I/P/B-frames. - -@item ps @var{integer} (@emph{encoding,video}) -Set RTP payload size in bytes. - -@item mv_bits @var{integer} -@item header_bits @var{integer} -@item i_tex_bits @var{integer} -@item p_tex_bits @var{integer} -@item i_count @var{integer} -@item p_count @var{integer} -@item skip_count @var{integer} -@item misc_bits @var{integer} -@item frame_bits @var{integer} @item codec_tag @var{integer} @item bug @var{flags} (@emph{decoding,video}) Workaround not auto detected encoder bugs. @@ -207,8 +152,6 @@ Possible values: @table @samp @item autodetect -@item old_msmpeg4 -some old lavc generated msmpeg4v3 files (no autodetection) @item xvid_ilace Xvid interlacing bug (autodetected if fourcc==XVIX) @item ump4 @@ -217,8 +160,6 @@ Xvid interlacing bug (autodetected if fourcc==XVIX) padding bug (autodetected) @item amv -@item ac_vlc -illegal vlc bug (autodetected per fourcc) @item qpel_chroma @item std_qpel @@ -239,14 +180,6 @@ Workaround various bugs in microsoft broken decoders. trancated frames @end table -@item lelim @var{integer} (@emph{encoding,video}) -Set single coefficient elimination threshold for luminance (negative -values also consider DC coefficient). - -@item celim @var{integer} (@emph{encoding,video}) -Set single coefficient elimination threshold for chrominance (negative -values also consider dc coefficient) - @item strict @var{integer} (@emph{decoding/encoding,audio,video}) Specify how strictly to follow the standards. @@ -300,29 +233,8 @@ consider things that a sane encoder should not do as an error @item block_align @var{integer} -@item mpeg_quant @var{integer} (@emph{encoding,video}) -Use MPEG quantizers instead of H.263. - -@item qsquish @var{float} (@emph{encoding,video}) -How to keep quantizer between qmin and qmax (0 = clip, 1 = use -differentiable function). - -@item rc_qmod_amp @var{float} (@emph{encoding,video}) -Set experimental quantizer modulation. - -@item rc_qmod_freq @var{integer} (@emph{encoding,video}) -Set experimental quantizer modulation. - @item rc_override_count @var{integer} -@item rc_eq @var{string} (@emph{encoding,video}) -Set rate control equation. When computing the expression, besides the -standard functions defined in the section 'Expression Evaluation', the -following functions are available: bits2qp(bits), qp2bits(qp). Also -the following constants are available: iTex pTex tex mv fCode iCount -mcVar var isI isP isB avgQP qComp avgIITex avgPITex avgPPTex avgBPTex -avgTex. - @item maxrate @var{integer} (@emph{encoding,audio,video}) Set max bitrate tolerance (in bits/s). Requires bufsize to be set. @@ -333,18 +245,12 @@ encode. It is of little use elsewise. @item bufsize @var{integer} (@emph{encoding,audio,video}) Set ratecontrol buffer size (in bits). -@item rc_buf_aggressivity @var{float} (@emph{encoding,video}) -Currently useless. - @item i_qfactor @var{float} (@emph{encoding,video}) Set QP factor between P and I frames. @item i_qoffset @var{float} (@emph{encoding,video}) Set QP offset between P and I frames. -@item rc_init_cplx @var{float} (@emph{encoding,video}) -Set initial complexity for 1-pass encoding. - @item dct @var{integer} (@emph{encoding,video}) Set DCT algorithm. @@ -409,11 +315,7 @@ Automatically pick a IDCT compatible with the simple one @item simpleneon -@item simplealpha - -@item ipp - -@item xvidmmx +@item xvid @item faani floating point AAN IDCT @@ -436,19 +338,6 @@ favor predicting from the previous frame instead of the current @item bits_per_coded_sample @var{integer} -@item pred @var{integer} (@emph{encoding,video}) -Set prediction method. - -Possible values: -@table @samp -@item left - -@item plane - -@item median - -@end table - @item aspect @var{rational number} (@emph{encoding,video}) Set sample aspect ratio. @@ -643,13 +532,28 @@ noise preserving sum of squared differences @item dia_size @var{integer} (@emph{encoding,video}) Set diamond type & size for motion estimation. +@table @samp +@item (1024, INT_MAX) +full motion estimation(slowest) +@item (768, 1024] +umh motion estimation +@item (512, 768] +hex motion estimation +@item (256, 512] +l2s diamond motion estimation +@item [2,256] +var diamond motion estimation +@item (-1, 2) +small diamond motion estimation +@item -1 +funny diamond motion estimation +@item (INT_MIN, -1) +sab diamond motion estimation +@end table @item last_pred @var{integer} (@emph{encoding,video}) Set amount of motion predictors from the previous frame. -@item preme @var{integer} (@emph{encoding,video}) -Set pre motion estimation. - @item precmp @var{integer} (@emph{encoding,video}) Set pre motion estimation compare function. @@ -693,40 +597,11 @@ Set diamond type & size for motion estimation pre-pass. @item subq @var{integer} (@emph{encoding,video}) Set sub pel motion estimation quality. -@item dtg_active_format @var{integer} - @item me_range @var{integer} (@emph{encoding,video}) Set limit motion vectors range (1023 for DivX player). -@item ibias @var{integer} (@emph{encoding,video}) -Set intra quant bias. - -@item pbias @var{integer} (@emph{encoding,video}) -Set inter quant bias. - -@item color_table_id @var{integer} - @item global_quality @var{integer} (@emph{encoding,audio,video}) -@item coder @var{integer} (@emph{encoding,video}) - -Possible values: -@table @samp -@item vlc -variable length coder / huffman coder -@item ac -arithmetic coder -@item raw -raw (no encoding) -@item rle -run-length coder -@item deflate -deflate-based coder -@end table - -@item context @var{integer} (@emph{encoding,video}) -Set context model. - @item slice_flags @var{integer} @item mbd @var{integer} (@emph{encoding,video}) @@ -742,32 +617,16 @@ use fewest bits use best rate distortion @end table -@item stream_codec_tag @var{integer} - -@item sc_threshold @var{integer} (@emph{encoding,video}) -Set scene change threshold. - -@item lmin @var{integer} (@emph{encoding,video}) -Set min lagrange factor (VBR). - -@item lmax @var{integer} (@emph{encoding,video}) -Set max lagrange factor (VBR). - -@item nr @var{integer} (@emph{encoding,video}) -Set noise reduction. - @item rc_init_occupancy @var{integer} (@emph{encoding,video}) Set number of bits which should be loaded into the rc buffer before decoding starts. -@item flags2 @var{flags} (@emph{decoding/encoding,audio,video}) +@item flags2 @var{flags} (@emph{decoding/encoding,audio,video,subtitles}) Possible values: @table @samp @item fast Allow non spec compliant speedup tricks. -@item sgop -Deprecated, use mpegvideo private options instead. @item noout Skip bitstream encoding. @item ignorecrop @@ -781,12 +640,29 @@ Show all frames before the first keyframe. @item export_mvs Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS}) for codecs that support it. See also @file{doc/examples/export_mvs.c}. +@item skip_manual +Do not skip samples and export skip information as frame side data. +@item ass_ro_flush_noop +Do not reset ASS ReadOrder field on flush. @end table -@item error @var{integer} (@emph{encoding,video}) +@item export_side_data @var{flags} (@emph{decoding/encoding,audio,video,subtitles}) -@item qns @var{integer} (@emph{encoding,video}) -Deprecated, use mpegvideo private options instead. +Possible values: +@table @samp +@item mvs +Export motion vectors into frame side-data (see @code{AV_FRAME_DATA_MOTION_VECTORS}) +for codecs that support it. See also @file{doc/examples/export_mvs.c}. +@item prft +Export encoder Producer Reference Time into packet side-data (see @code{AV_PKT_DATA_PRFT}) +for codecs that support it. +@item venc_params +Export video encoding parameters through frame side data (see @code{AV_FRAME_DATA_VIDEO_ENC_PARAMS}) +for codecs that support it. At present, those are H.264 and VP9. +@item film_grain +Export film grain parameters through frame side data (see @code{AV_FRAME_DATA_FILM_GRAIN_PARAMS}). +Supported at present by AV1 decoders. +@end table @item threads @var{integer} (@emph{decoding/encoding,video}) Set the number of threads to be used, in case the selected codec @@ -800,12 +676,6 @@ automatically select the number of threads to set Default value is @samp{auto}. -@item me_threshold @var{integer} (@emph{encoding,video}) -Set motion estimation threshold. - -@item mb_threshold @var{integer} (@emph{encoding,video}) -Set macroblock threshold. - @item dc @var{integer} (@emph{encoding,video}) Set intra_dc_precision. @@ -820,49 +690,8 @@ Set number of macroblock rows at the bottom which are skipped. @item profile @var{integer} (@emph{encoding,audio,video}) -Possible values: -@table @samp -@item unknown - -@item aac_main - -@item aac_low - -@item aac_ssr - -@item aac_ltp - -@item aac_he - -@item aac_he_v2 - -@item aac_ld - -@item aac_eld - -@item mpeg2_aac_low - -@item mpeg2_aac_he - -@item mpeg4_sp - -@item mpeg4_core - -@item mpeg4_main - -@item mpeg4_asp - -@item dts - -@item dts_es - -@item dts_96_24 - -@item dts_hd_hra - -@item dts_hd_ma - -@end table +Set encoder codec profile. Default value is @samp{unknown}. Encoder specific +profiles are documented in the relevant encoder documentation. @item level @var{integer} (@emph{encoding,audio,video}) @@ -875,67 +704,12 @@ Possible values: @item lowres @var{integer} (@emph{decoding,audio,video}) Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions. -@item skip_threshold @var{integer} (@emph{encoding,video}) -Set frame skip threshold. - -@item skip_factor @var{integer} (@emph{encoding,video}) -Set frame skip factor. - -@item skip_exp @var{integer} (@emph{encoding,video}) -Set frame skip exponent. -Negative values behave identical to the corresponding positive ones, except -that the score is normalized. -Positive values exist primarily for compatibility reasons and are not so useful. - -@item skipcmp @var{integer} (@emph{encoding,video}) -Set frame skip compare function. - -Possible values: -@table @samp -@item sad -sum of absolute differences, fast (default) -@item sse -sum of squared errors -@item satd -sum of absolute Hadamard transformed differences -@item dct -sum of absolute DCT transformed differences -@item psnr -sum of squared quantization errors (avoid, low quality) -@item bit -number of bits needed for the block -@item rd -rate distortion optimal, slow -@item zero -0 -@item vsad -sum of absolute vertical differences -@item vsse -sum of squared vertical differences -@item nsse -noise preserving sum of squared differences -@item w53 -5/3 wavelet, only used in snow -@item w97 -9/7 wavelet, only used in snow -@item dctmax - -@item chroma - -@end table - -@item border_mask @var{float} (@emph{encoding,video}) -Increase the quantizer for macroblocks close to borders. - @item mblmin @var{integer} (@emph{encoding,video}) Set min macroblock lagrange factor (VBR). @item mblmax @var{integer} (@emph{encoding,video}) Set max macroblock lagrange factor (VBR). -@item mepc @var{integer} (@emph{encoding,video}) -Set motion estimation bitrate penalty compensation (1.0 = 256). - @item skip_loop_filter @var{integer} (@emph{decoding,video}) @item skip_idct @var{integer} (@emph{decoding,video}) @item skip_frame @var{integer} (@emph{decoding,video}) @@ -975,34 +749,17 @@ Default value is @samp{default}. @item bidir_refine @var{integer} (@emph{encoding,video}) Refine the two motion vectors used in bidirectional macroblocks. -@item brd_scale @var{integer} (@emph{encoding,video}) -Downscale frames for dynamic B-frame decision. - @item keyint_min @var{integer} (@emph{encoding,video}) Set minimum interval between IDR-frames. @item refs @var{integer} (@emph{encoding,video}) Set reference frames to consider for motion compensation. -@item chromaoffset @var{integer} (@emph{encoding,video}) -Set chroma qp offset from luma. - @item trellis @var{integer} (@emph{encoding,audio,video}) Set rate-distortion optimal quantization. @item mv0_threshold @var{integer} (@emph{encoding,video}) -@item b_sensitivity @var{integer} (@emph{encoding,video}) -Adjust sensitivity of b_frame_strategy 1. - @item compression_level @var{integer} (@emph{encoding,audio,video}) -@item min_prediction_order @var{integer} (@emph{encoding,audio}) -@item max_prediction_order @var{integer} (@emph{encoding,audio}) -@item timecode_frame_start @var{integer} (@emph{encoding,video}) -Set GOP timecode frame start number, in non drop frame format. - -@item request_channels @var{integer} (@emph{decoding,audio}) -Set desired number of audio channels. - @item bits_per_raw_sample @var{integer} @item channel_layout @var{integer} (@emph{decoding/encoding,audio}) @@ -1116,6 +873,12 @@ BT.2020 NCL BT.2020 CL @item smpte2085 SMPTE 2085 +@item chroma-derived-nc +Chroma-derived NCL +@item chroma-derived-c +Chroma-derived CL +@item ictcp +ICtCp @end table @item color_range @var{integer} (@emph{decoding/encoding,video}) diff --git a/doc/decoders.texi b/doc/decoders.texi index 0582b018..e2fcbf5d 100644 --- a/doc/decoders.texi +++ b/doc/decoders.texi @@ -25,6 +25,19 @@ enabled decoders. A description of some of the currently available video decoders follows. +@section av1 + +AOMedia Video 1 (AV1) decoder. + +@subsection Options + +@table @option + +@item operating_point +Select an operating point of a scalable AV1 bitstream (0 - 31). Default is 0. + +@end table + @section rawvideo Raw video decoder. @@ -57,19 +70,32 @@ You need to explicitly configure the build with @code{--enable-libdav1d}. @subsection Options -The following option is supported by the libdav1d wrapper. +The following options are supported by the libdav1d wrapper. @table @option @item framethreads Set amount of frame threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +global option @code{threads} instead. @item tilethreads Set amount of tile threads to use during decoding. The default value is 0 (autodetect). +This option is deprecated for libdav1d >= 1.0 and will be removed in the future. Use the +global option @code{threads} instead. @item filmgrain -Apply film grain to the decoded video if present in the bitstream. The default value -is true. +Apply film grain to the decoded video if present in the bitstream. Defaults to the +internal default of the library. +This option is deprecated and will be removed in the future. See the global option +@code{export_side_data} to export Film Grain parameters instead of applying it. + +@item oppoint +Select an operating point of a scalable AV1 bitstream (0 - 31). Defaults to the +internal default of the library. + +@item alllayers +Output all spatial layers of a scalable AV1 bitstream. The default value is false. @end table @@ -81,6 +107,84 @@ This decoder allows libavcodec to decode AVS2 streams with davs2 library. @c man end VIDEO DECODERS +@section libuavs3d + +AVS3-P2/IEEE1857.10 video decoder. + +libuavs3d allows libavcodec to decode AVS3 streams. +Requires the presence of the libuavs3d headers and library during configuration. +You need to explicitly configure the build with @code{--enable-libuavs3d}. + +@subsection Options + +The following option is supported by the libuavs3d wrapper. + +@table @option + +@item frame_threads +Set amount of frame threads to use during decoding. The default value is 0 (autodetect). + +@end table + +@section QSV Decoders + +The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC, +JPEG/MJPEG, VP8, VP9, AV1). + +@subsection Common Options + +The following options are supported by all qsv decoders. + +@table @option + +@item @var{async_depth} +Internal parallelization depth, the higher the value the higher the latency. + +@item @var{gpu_copy} +A GPU-accelerated copy between video and system memory +@table @samp +@item default +@item on +@item off +@end table + +@end table + +@subsection HEVC Options +Extra options for hevc_qsv. + +@table @option + +@item @var{load_plugin} +A user plugin to load in an internal session +@table @samp +@item none +@item hevc_sw +@item hevc_hw +@end table + +@item @var{load_plugins} +A :-separate list of hexadecimal plugin UIDs to load in an internal session + +@end table + +@section v210 + +Uncompressed 4:2:2 10-bit decoder. + +@subsection Options + +@table @option + +@item custom_stride +Set the line size of the v210 data in bytes. The default value is 0 +(autodetect). You can use the special -1 value for a strideless v210 as seen in +BOXX files. + +@end table + +@c man end VIDEO DECODERS + @chapter Audio Decoders @c man begin AUDIO DECODERS @@ -100,7 +204,7 @@ the undocumented RealAudio 3 (a.k.a. dnet). @item -drc_scale @var{value} Dynamic Range Scale Factor. The factor to apply to dynamic range values -from the AC-3 stream. This factor is applied exponentially. +from the AC-3 stream. This factor is applied exponentially. The default value is 1. There are 3 notable scale factor ranges: @table @option @item drc_scale == 0 @@ -252,6 +356,8 @@ Enabled by default. @table @option @item compute_clut @table @option +@item -2 +Compute clut once if no matching CLUT is in the stream. @item -1 Compute clut if no matching CLUT is in the stream. @item 0 @@ -280,7 +386,7 @@ palette is stored in the IFO file, and therefore not available when reading from dumped VOB files. The format for this option is a string containing 16 24-bits hexadecimal -numbers (without 0x prefix) separated by comas, for example @code{0d00ee, +numbers (without 0x prefix) separated by commas, for example @code{0d00ee, ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, 7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}. @@ -309,6 +415,11 @@ List of teletext page numbers to decode. Pages that do not match the specified list are dropped. You may use the special @code{*} string to match all pages, or @code{subtitle} to match all subtitle pages. Default value is *. +@item txt_default_region +Set default character set used for decoding, a value between 0 and 87 (see +ETS 300 706, Section 15, Table 32). Default value is -1, which does not +override the libzvbi default. This option is needed for some legacy level 1.0 +transmissions which cannot signal the proper charset. @item txt_chop_top Discards the top teletext line. Default value is 1. @item txt_format diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 57d15322..2b6dd86c 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -25,6 +25,13 @@ Audible Format 2, 3, and 4 demuxer. This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files. +@section aac + +Raw Audio Data Transport Stream AAC demuxer. + +This demuxer is used to demux an ADTS input containing a single AAC stream +alongwith any ID3v1/2 or APE tags in it. + @section apng Animated Portable Network Graphics demuxer. @@ -37,12 +44,15 @@ between the last fcTL and IEND chunks. @table @option @item -ignore_loop @var{bool} -Ignore the loop variable in the file if set. +Ignore the loop variable in the file if set. Default is enabled. + @item -max_fps @var{int} -Maximum framerate in frames per second (0 for no limit). +Maximum framerate in frames per second. Default of 0 imposes no limit. + @item -default_fps @var{int} Default framerate in frames per second when none is specified in the file -(0 meaning as fast as possible). +(0 meaning as fast as possible). Default is 15. + @end table @section asf @@ -93,8 +103,7 @@ backslash or single quotes. All subsequent file-related directives apply to that file. @item @code{ffconcat version 1.0} -Identify the script type and version. It also sets the @option{safe} option -to 1 if it was -1. +Identify the script type and version. To make FFmpeg recognize the format automatically, this directive must appear exactly as is (no extra space or byte-order-mark) on the very first @@ -148,6 +157,16 @@ directive) will be reduced based on their specified Out point. Metadata of the packets of the file. The specified metadata will be set for each file packet. You can specify this directive multiple times to add multiple metadata entries. +This directive is deprecated, use @code{file_packet_meta} instead. + +@item @code{file_packet_meta @var{key} @var{value}} +Metadata of the packets of the file. The specified metadata will be set for +each file packet. You can specify this directive multiple times to add multiple +metadata entries. + +@item @code{option @var{key} @var{value}} +Option to access, open and probe the file. +Can be present multiple times. @item @code{stream} Introduce a stream in the virtual file. @@ -165,6 +184,20 @@ subfiles will be used. This is especially useful for MPEG-PS (VOB) files, where the order of the streams is not reliable. +@item @code{stream_meta @var{key} @var{value}} +Metadata for the stream. +Can be present multiple times. + +@item @code{stream_codec @var{value}} +Codec for the stream. + +@item @code{stream_extradata @var{hex_string}} +Extradata for the string, encoded in hexadecimal. + +@item @code{chapter @var{id} @var{start} @var{end}} +Add a chapter. @var{id} is an unique identifier, possibly small and +consecutive. + @end table @subsection Options @@ -174,7 +207,8 @@ This demuxer accepts the following option: @table @option @item safe -If set to 1, reject unsafe file paths. A file path is considered safe if it +If set to 1, reject unsafe file paths and directives. +A file path is considered safe if it does not contain a protocol specification and is relative and all components only contain characters from the portable character set (letters, digits, period, underscore and hyphen) and have no period at the beginning of a @@ -184,9 +218,6 @@ If set to 0, any file name is accepted. The default is 1. --1 is equivalent to 1 if the format was automatically -probed and 0 otherwise. - @item auto_convert If set to 1, try to perform automatic conversions on packet data to make the streams concatenable. @@ -243,11 +274,29 @@ which streams to actually receive. Each stream mirrors the @code{id} and @code{bandwidth} properties from the @code{} as metadata keys named "id" and "variant_bitrate" respectively. -@section flv, live_flv +@subsection Options + +This demuxer accepts the following option: + +@table @option + +@item cenc_decryption_key +16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). + +@end table + +@section imf + +Interoperable Master Format demuxer. + +This demuxer presents audio and video streams found in an IMF Composition. + +@section flv, live_flv, kux Adobe Flash Video Format demuxer. This demuxer is used to demux FLV files and RTMP network streams. In case of live network streams, if you force format, you may use live_flv option instead of flv to survive timestamp discontinuities. +KUX is a flv variant used on the Youku platform. @example ffmpeg -f flv -i myfile.flv ... @@ -324,6 +373,9 @@ It accepts the following options: @item live_start_index segment index to start live streams at (negative values are from the end). +@item prefer_x_start +prefer to use #EXT-X-START if it's in playlist instead of live_start_index. + @item allowed_extensions ',' separated list of file extensions that hls is allowed to access. @@ -331,6 +383,10 @@ segment index to start live streams at (negative values are from the end). Maximum number of times a insufficient list is attempted to be reloaded. Default value is 1000. +@item m3u8_hold_counters +The maximum number of times to load m3u8 when it refreshes without new segments. +Default value is 1000. + @item http_persistent Use persistent HTTP connections. Applicable only for HTTP streams. Enabled by default. @@ -338,6 +394,13 @@ Enabled by default. @item http_multiple Use multiple HTTP connections for downloading HTTP segments. Enabled by default for HTTP/1.1 servers. + +@item http_seekable +Use HTTP partial requests for downloading HTTP segments. +0 = disable, 1 = enable, -1 = auto, Default is auto. + +@item seg_format_options +Set options for the demuxer of media segments using a list of key=value pairs separated by @code{:}. @end table @section image2 @@ -448,6 +511,17 @@ nanosecond precision. @item video_size Set the video size of the images to read. If not specified the video size is guessed from the first image file in the sequence. +@item export_path_metadata +If set to 1, will add two extra fields to the metadata found in input, making them +also available for other filters (see @var{drawtext} filter for examples). Default +value is 0. The extra fields are described below: +@table @option +@item lavf.image2dec.source_path +Corresponds to the full path to the input file being read. +@item lavf.image2dec.source_basename +Corresponds to the name of the file being read. +@end table + @end table @subsection Examples @@ -585,9 +659,13 @@ Set the sample rate for libopenmpt to output. Range is from 1000 to INT_MAX. The value default is 48000. @end table -@section mov/mp4/3gp/QuickTime +@section mov/mp4/3gp -QuickTime / MP4 demuxer. +Demuxer for Quicktime File Format & ISO/IEC Base Media File Format (ISO/IEC 14496-12 or MPEG-4 Part 12, ISO/IEC 15444-12 or JPEG 2000 Part 12). + +Registered extensions: mov, mp4, m4a, 3gp, 3g2, mj2, psp, m4b, ism, ismv, isma, f4v + +@subsection Options This demuxer accepts the following options: @table @option @@ -598,10 +676,88 @@ Enabling this can theoretically leak information in some use cases. @item use_absolute_path Allows loading of external tracks via absolute paths, disabled by default. Enabling this poses a security risk. It should only be enabled if the source -is known to be non malicious. +is known to be non-malicious. +@item seek_streams_individually +When seeking, identify the closest point in each stream individually and demux packets in +that stream from identified point. This can lead to a different sequence of packets compared +to demuxing linearly from the beginning. Default is true. + +@item ignore_editlist +Ignore any edit list atoms. The demuxer, by default, modifies the stream index to reflect the +timeline described by the edit list. Default is false. + +@item advanced_editlist +Modify the stream index to reflect the timeline described by the edit list. @code{ignore_editlist} +must be set to false for this option to be effective. +If both @code{ignore_editlist} and this option are set to false, then only the +start of the stream index is modified to reflect initial dwell time or starting timestamp +described by the edit list. Default is true. + +@item ignore_chapters +Don't parse chapters. This includes GoPro 'HiLight' tags/moments. Note that chapters are +only parsed when input is seekable. Default is false. + +@item use_mfra_for +For seekable fragmented input, set fragment's starting timestamp from media fragment random access box, if present. + +Following options are available: +@table @samp +@item auto +Auto-detect whether to set mfra timestamps as PTS or DTS @emph{(default)} + +@item dts +Set mfra timestamps as DTS + +@item pts +Set mfra timestamps as PTS + +@item 0 +Don't use mfra box to set timestamps @end table +@item use_tfdt +For fragmented input, set fragment's starting timestamp to @code{baseMediaDecodeTime} from the @code{tfdt} box. +Default is enabled, which will prefer to use the @code{tfdt} box to set DTS. Disable to use the @code{earliest_presentation_time} from the @code{sidx} box. +In either case, the timestamp from the @code{mfra} box will be used if it's available and @code{use_mfra_for} is +set to pts or dts. + +@item export_all +Export unrecognized boxes within the @var{udta} box as metadata entries. The first four +characters of the box type are set as the key. Default is false. + +@item export_xmp +Export entire contents of @var{XMP_} box and @var{uuid} box as a string with key @code{xmp}. Note that +if @code{export_all} is set and this option isn't, the contents of @var{XMP_} box are still exported +but with key @code{XMP_}. Default is false. + +@item activation_bytes +4-byte key required to decrypt Audible AAX and AAX+ files. See Audible AAX subsection below. + +@item audible_fixed_key +Fixed key used for handling Audible AAX/AAX+ files. It has been pre-set so should not be necessary to +specify. + +@item decryption_key +16-byte key, in hex, to decrypt files encrypted using ISO Common Encryption (CENC/AES-128 CTR; ISO/IEC 23001-7). + +@item max_stts_delta +Very high sample deltas written in a trak's stts box may occasionally be intended but usually they are written in +error or used to store a negative value for dts correction when treated as signed 32-bit integers. This option lets +the user set an upper limit, beyond which the delta is clamped to 1. Values greater than the limit if negative when +cast to int32 are used to adjust onward dts. + +Unit is the track time scale. Range is 0 to UINT_MAX. Default is @code{UINT_MAX - 48000*10} which allows upto +a 10 second dts correction for 48 kHz audio streams while accommodating 99.9% of @code{uint32} range. +@end table + +@subsection Audible AAX + +Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret. +@example +ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4 +@end example + @section mpegts MPEG-2 transport stream demuxer. @@ -633,6 +789,10 @@ disabled). Default value is -1. @item merge_pmt_versions Re-use existing streams when a PMT's version is updated and elementary streams move to different PIDs. Default value is 0. + +@item max_packet_size +Set maximum size, in bytes, of packet emitted by the demuxer. Payloads above this size +are split across multiple packets. Range is 1 to INT_MAX/2. Default is 204800 bytes. @end table @section mpjpeg diff --git a/doc/dev_community/community.md b/doc/dev_community/community.md new file mode 100644 index 00000000..21e08e20 --- /dev/null +++ b/doc/dev_community/community.md @@ -0,0 +1,79 @@ +# FFmpeg project + +## Organisation + +The FFmpeg project is organized through a community working on global consensus. + +Decisions are taken by the ensemble of active members, through voting and +are aided by two committees. + +## General Assembly + +The ensemble of active members is called the General Assembly (GA). + +The General Assembly is sovereign and legitimate for all its decisions +regarding the FFmpeg project. + +The General Assembly is made up of active contributors. + +Contributors are considered "active contributors" if they have pushed more +than 20 patches in the last 36 months in the main FFmpeg repository, or +if they have been voted in by the GA. + +Additional members are added to the General Assembly through a vote after +proposal by a member of the General Assembly. +They are part of the GA for two years, after which they need a confirmation by +the GA. + +## Voting + +Voting is done using a ranked voting system, currently running on https://vote.ffmpeg.org/ . + +Majority vote means more than 50% of the expressed ballots. + +## Technical Committee + +The Technical Committee (TC) is here to arbitrate and make decisions when +technical conflicts occur in the project. +They will consider the merits of all the positions, judge them and make a +decision. + +The TC resolves technical conflicts but is not a technical steering committee. + +Decisions by the TC are binding for all the contributors. + +Decisions made by the TC can be re-opened after 1 year or by a majority vote +of the General Assembly, requested by one of the member of the GA. + +The TC is elected by the General Assembly for a duration of 1 year, and +is composed of 5 members. +Members can be re-elected if they wish. A majority vote in the General Assembly +can trigger a new election of the TC. + +The members of the TC can be elected from outside of the GA. +Candidates for election can either be suggested or self-nominated. + +The conflict resolution process is detailed in the [resolution process](resolution_process.md) document. + +## Community committee + +The Community Committee (CC) is here to arbitrage and make decisions when +inter-personal conflicts occur in the project. It will decide quickly and +take actions, for the sake of the project. + +The CC can remove privileges of offending members, including removal of +commit access and temporary ban from the community. + +Decisions made by the CC can be re-opened after 1 year or by a majority vote +of the General Assembly. Indefinite bans from the community must be confirmed +by the General Assembly, in a majority vote. + +The CC is elected by the General Assembly for a duration of 1 year, and is +composed of 5 members. +Members can be re-elected if they wish. A majority vote in the General Assembly +can trigger a new election of the CC. + +The members of the CC can be elected from outside of the GA. +Candidates for election can either be suggested or self-nominated. + +The CC is governed by and responsible for enforcing the Code of Conduct. diff --git a/doc/dev_community/resolution_process.md b/doc/dev_community/resolution_process.md new file mode 100644 index 00000000..4ed0b63c --- /dev/null +++ b/doc/dev_community/resolution_process.md @@ -0,0 +1,91 @@ +# Technical Committee + +_This document only makes sense with the rules from [the community document](community)_. + +The Technical Committee (**TC**) is here to arbitrate and make decisions when +technical conflicts occur in the project. + +The TC main role is to resolve technical conflicts. +It is therefore not a technical steering committee, but it is understood that +some decisions might impact the future of the project. + +# Process + +## Seizing + +The TC can take possession of any technical matter that it sees fit. + +To involve the TC in a matter, email tc@ or CC them on an ongoing discussion. + +As members of TC are developers, they also can email tc@ to raise an issue. + +## Announcement + +The TC, once seized, must announce itself on the main mailing list, with a _[TC]_ tag. + +The TC has 2 modes of operation: a RFC one and an internal one. + +If the TC thinks it needs the input from the larger community, the TC can call +for a RFC. Else, it can decide by itself. + +If the disagreement involves a member of the TC, that member should recuse +themselves from the decision. + +The decision to use a RFC process or an internal discussion is a discretionary +decision of the TC. + +The TC can also reject a seizure for a few reasons such as: +the matter was not discussed enough previously; it lacks expertise to reach a +beneficial decision on the matter; or the matter is too trivial. + +### RFC call + +In the RFC mode, one person from the TC posts on the mailing list the +technical question and will request input from the community. + +The mail will have the following specification: +* a precise title +* a specific tag [TC RFC] +* a top-level email +* contain a precise question that does not exceed 100 words and that is answerable by developers +* may have an extra description, or a link to a previous discussion, if deemed necessary, +* contain a precise end date for the answers. + +The answers from the community must be on the main mailing list and must have +the following specification: +* keep the tag and the title unchanged +* limited to 400 words +* a first-level, answering directly to the main email +* answering to the question. + +Further replies to answers are permitted, as long as they conform to the +community standards of politeness, they are limited to 100 words, and are not +nested more than once. (max-depth=2) + +After the end-date, mails on the thread will be ignored. + +Violations of those rules will be escalated through the Community Committee. + +After all the emails are in, the TC has 96 hours to give its final decision. +Exceptionally, the TC can request an extra delay, that will be notified on the +mailing list. + +### Within TC + +In the internal case, the TC has 96 hours to give its final decision. +Exceptionally, the TC can request an extra delay. + + +## Decisions + +The decisions from the TC will be sent on the mailing list, with the _[TC]_ tag. + +Internally, the TC should take decisions with a majority, or using +ranked-choice voting. + +The decision from the TC should be published with a summary of the reasons that +lead to this decision. + +The decisions from the TC are final, until the matters are reopened after +no less than one year. + diff --git a/doc/developer.texi b/doc/developer.texi index 5c342c91..addee0d8 100644 --- a/doc/developer.texi +++ b/doc/developer.texi @@ -131,6 +131,9 @@ compound literals (@samp{x = (struct s) @{ 17, 23 @};}). @item for loops with variable definition (@samp{for (int i = 0; i < 8; i++)}); +@item +Variadic macros (@samp{#define ARRAY(nb, ...) (int[nb + 1])@{ nb, __VA_ARGS__ @}}); + @item Implementation defined behavior for signed integers is assumed to match the expected behavior for two's complement. Non representable values in integer @@ -491,6 +494,22 @@ patch is inline or attached per mail. You can check @url{https://patchwork.ffmpeg.org}, if your patch does not show up, its mime type likely was wrong. +@subheading Sending patches from email clients +Using @code{git send-email} might not be desirable for everyone. The +following trick allows to send patches via email clients in a safe +way. It has been tested with Outlook and Thunderbird (with X-Unsent +extension) and might work with other applications. + +Create your patch like this: + +@verbatim +git format-patch -s -o "outputfolder" --add-header "X-Unsent: 1" --suffix .eml --to ffmpeg-devel@ffmpeg.org -1 1a2b3c4d +@end verbatim + +Now you'll just need to open the eml file with the email application +and execute 'Send'. + +@subheading Reviews Your patch will be reviewed on the mailing list. You will likely be asked to make some changes and are expected to send in an improved version that incorporates the requests from the review. This process may go through @@ -622,7 +641,7 @@ If the patch fixes a bug, did you provide a verbose analysis of the bug? If the patch fixes a bug, did you provide enough information, including a sample, so the bug can be reproduced and the fix can be verified? Note please do not attach samples >100k to mails but rather provide a -URL, you can upload to ftp://upload.ffmpeg.org. +URL, you can upload to @url{https://streams.videolan.org/upload/}. @item Did you provide a verbose summary about what the patch does change? diff --git a/doc/doxy-wrapper.sh b/doc/doxy-wrapper.sh index fe0102b5..729caa63 100755 --- a/doc/doxy-wrapper.sh +++ b/doc/doxy-wrapper.sh @@ -1,10 +1,13 @@ #!/bin/sh OUT_DIR="${1}" -DOXYFILE="${2}" -DOXYGEN="${3}" +SRC_DIR="${2}" +DOXYFILE="${3}" +DOXYGEN="${4}" -shift 3 +shift 4 + +cd ${SRC_DIR} if [ -e "VERSION" ]; then VERSION=`cat "VERSION"` diff --git a/doc/encoders.texi b/doc/encoders.texi index eefd1247..02a91ffe 100644 --- a/doc/encoders.texi +++ b/doc/encoders.texi @@ -30,11 +30,7 @@ follows. Advanced Audio Coding (AAC) encoder. -This encoder is the default AAC encoder, natively implemented into FFmpeg. Its -quality is on par or better than libfdk_aac at the default bitrate of 128kbps. -This encoder also implements more options, profiles and samplerates than -other encoders (with only the AAC-HE profile pending to be implemented) so this -encoder has become the default and is the recommended choice. +This encoder is the default AAC encoder, natively implemented into FFmpeg. @subsection Options @@ -57,7 +53,7 @@ Set AAC encoder coding method. Possible values: @table @samp @item twoloop -Two loop searching (TLS) method. +Two loop searching (TLS) method. This is the default method. This method first sets quantizers depending on band thresholds and then tries to find an optimal combination by adding or subtracting a specific value from @@ -79,7 +75,6 @@ Constant quantizer method. Uses a cheaper version of twoloop algorithm that doesn't try to do as many clever adjustments. Worse with low bitrates (less than 64kbps), but is better and much faster at higher bitrates. -This is the default choice for a coder @end table @@ -155,10 +150,9 @@ the undocumented RealAudio 3 (a.k.a. dnet). The @var{ac3} encoder uses floating-point math, while the @var{ac3_fixed} encoder only uses fixed-point integer math. This does not mean that one is always faster, just that one or the other may be better suited to a -particular system. The floating-point encoder will generally produce better -quality audio for a given bitrate. The @var{ac3_fixed} encoder is not the -default codec for any of the output formats, so it must be specified explicitly -using the option @code{-acodec ac3_fixed} in order to use it. +particular system. The @var{ac3_fixed} encoder is not the default codec for +any of the output formats, so it must be specified explicitly using the option +@code{-acodec ac3_fixed} in order to use it. @subsection AC-3 Metadata @@ -651,10 +645,7 @@ configuration. You need to explicitly configure the build with so if you allow the use of GPL, you should configure with @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}. -This encoder is considered to produce output on par or worse at 128kbps to the -@ref{aacenc,,the native FFmpeg AAC encoder} but can often produce better -sounding audio at identical or lower bitrates and has support for the -AAC-HE profiles. +This encoder has support for the AAC-HE profiles. VBR encoding, enabled through the @option{vbr} or @option{flags +qscale} options, is experimental and only works with some @@ -960,6 +951,11 @@ The default is 20ms. @item packet_loss (@emph{expect-loss}) Set expected packet loss percentage. The default is 0. +@item fec (@emph{n/a}) +Enable inband forward error correction. @option{packet_loss} must be non-zero +to take advantage - frequency of FEC 'side-data' is proportional to expected packet loss. +Default is disabled. + @item application (N.A.) Set intended application type. Valid options are listed below: @@ -1187,53 +1183,6 @@ transient response is a higher bitrate. @end table -@anchor{libwavpack} -@section libwavpack - -A wrapper providing WavPack encoding through libwavpack. - -Only lossless mode using 32-bit integer samples is supported currently. - -Requires the presence of the libwavpack headers and library during -configuration. You need to explicitly configure the build with -@code{--enable-libwavpack}. - -Note that a libavcodec-native encoder for the WavPack codec exists so users can -encode audios with this codec without using this encoder. See @ref{wavpackenc}. - -@subsection Options - -@command{wavpack} command line utility's corresponding options are listed in -parentheses, if any. - -@table @option -@item frame_size (@emph{--blocksize}) -Default is 32768. - -@item compression_level -Set speed vs. compression tradeoff. Acceptable arguments are listed below: - -@table @samp -@item 0 (@emph{-f}) -Fast mode. - -@item 1 -Normal (default) settings. - -@item 2 (@emph{-h}) -High quality. - -@item 3 (@emph{-hh}) -Very high quality. - -@item 4-8 (@emph{-hh -x}@var{EXTRAPROC}) -Same as @samp{3}, but with extra processing enabled. - -@samp{4} is the same as @option{-x2} and @samp{8} is the same as @option{-x6}. - -@end table -@end table - @anchor{mjpegenc} @section mjpeg @@ -1260,11 +1209,6 @@ Compute and use optimal huffman tables. WavPack lossless audio encoder. -This is a libavcodec-native WavPack encoder. There is also an encoder based on -libwavpack, but there is virtually no reason to use that encoder. - -See also @ref{libwavpack}. - @subsection Options The equivalent options for @command{wavpack} command line utility are listed in @@ -1285,7 +1229,6 @@ For the complete formula of calculating default, see @file{libavcodec/wavpackenc.c}. @item compression_level (@emph{-f}, @emph{-h}, @emph{-hh}, and @emph{-x}) -This option's syntax is consistent with @ref{libwavpack}'s. @end table @subsubsection Private options @@ -1324,6 +1267,97 @@ disabled A description of some of the currently available video encoders follows. +@section a64_multi, a64_multi5 + +A64 / Commodore 64 multicolor charset encoder. @code{a64_multi5} is extended with 5th color (colram). + +@section Cinepak + +Cinepak aka CVID encoder. +Compatible with Windows 3.1 and vintage MacOS. + +@subsection Options + +@table @option +@item g @var{integer} +Keyframe interval. +A keyframe is inserted at least every @code{-g} frames, sometimes sooner. + +@item q:v @var{integer} +Quality factor. Lower is better. Higher gives lower bitrate. +The following table lists bitrates when encoding akiyo_cif.y4m for various values of @code{-q:v} with @code{-g 100}: + +@table @option +@item @code{-q:v 1} 1918 kb/s +@item @code{-q:v 2} 1735 kb/s +@item @code{-q:v 4} 1500 kb/s +@item @code{-q:v 10} 1041 kb/s +@item @code{-q:v 20} 826 kb/s +@item @code{-q:v 40} 553 kb/s +@item @code{-q:v 100} 394 kb/s +@item @code{-q:v 200} 312 kb/s +@item @code{-q:v 400} 266 kb/s +@item @code{-q:v 1000} 237 kb/s +@end table + +@item max_extra_cb_iterations @var{integer} +Max extra codebook recalculation passes, more is better and slower. + +@item skip_empty_cb @var{boolean} +Avoid wasting bytes, ignore vintage MacOS decoder. + +@item max_strips @var{integer} +@itemx min_strips @var{integer} +The minimum and maximum number of strips to use. +Wider range sometimes improves quality. +More strips is generally better quality but costs more bits. +Fewer strips tend to yield more keyframes. +Vintage compatible is 1..3. + +@item strip_number_adaptivity @var{integer} +How much number of strips is allowed to change between frames. +Higher is better but slower. + +@end table + +@section GIF + +GIF image/animation encoder. + +@subsection Options + +@table @option +@item gifflags @var{integer} +Sets the flags used for GIF encoding. + +@table @option +@item offsetting +Enables picture offsetting. + +Default is enabled. + +@item transdiff +Enables transparency detection between frames. + +Default is enabled. + +@end table + +@item gifimage @var{integer} +Enables encoding one full GIF image per frame, rather than an animated GIF. + +Default value is @option{0}. + +@item global_palette @var{integer} +Writes a palette to the global GIF header where feasible. + +If disabled, every frame will always have a palette written, even if there +is a global palette supplied. + +Default value is @option{1}. + +@end table + @section Hap Vidvox Hap video encoder. @@ -1372,10 +1406,101 @@ can be selected with @code{-pred 1}. @subsection Options @table @option -@item format +@item format @var{integer} Can be set to either @code{j2k} or @code{jp2} (the default) that makes it possible to store non-rgb pix_fmts. +@item tile_width @var{integer} +Sets tile width. Range is 1 to 1073741824. Default is 256. + +@item tile_height @var{integer} +Sets tile height. Range is 1 to 1073741824. Default is 256. + +@item pred @var{integer} +Allows setting the discrete wavelet transform (DWT) type +@table @option +@item dwt97int (Lossy) +@item dwt53 (Lossless) +@end table +Default is @code{dwt97int} + +@item sop @var{boolean} +Enable this to add SOP marker at the start of each packet. Disabled by default. + +@item eph @var{boolean} +Enable this to add EPH marker at the end of each packet header. Disabled by default. + +@item prog @var{integer} +Sets the progression order to be used by the encoder. +Possible values are: +@table @option +@item lrcp +@item rlcp +@item rpcl +@item pcrl +@item cprl +@end table +Set to @code{lrcp} by default. + +@item layer_rates @var{string} +By default, when this option is not used, compression is done using the quality metric. +This option allows for compression using compression ratio. The compression ratio for each +level could be specified. The compression ratio of a layer @code{l} species the what ratio of +total file size is contained in the first @code{l} layers. + +Example usage: + +@example +ffmpeg -i input.bmp -c:v jpeg2000 -layer_rates "100,10,1" output.j2k +@end example + +This would compress the image to contain 3 layers, where the data contained in the +first layer would be compressed by 1000 times, compressed by 100 in the first two layers, +and shall contain all data while using all 3 layers. + +@end table + +@section librav1e + +rav1e AV1 encoder wrapper. + +Requires the presence of the rav1e headers and library during configuration. +You need to explicitly configure the build with @code{--enable-librav1e}. + +@subsection Options + +@table @option +@item qmax +Sets the maximum quantizer to use when using bitrate mode. + +@item qmin +Sets the minimum quantizer to use when using bitrate mode. + +@item qp +Uses quantizer mode to encode at the given quantizer (0-255). + +@item speed +Selects the speed preset (0-10) to encode with. + +@item tiles +Selects how many tiles to encode with. + +@item tile-rows +Selects how many rows of tiles to encode with. + +@item tile-columns +Selects how many columns of tiles to encode with. + +@item rav1e-params +Set rav1e options using a list of @var{key}=@var{value} pairs separated +by ":". See @command{rav1e --help} for a list of options. + +For example to specify librav1e encoding options with @option{-rav1e-params}: + +@example +ffmpeg -i input -c:v librav1e -b:v 500K -rav1e-params speed=5:low_latency=true output.mp4 +@end example + @end table @section libaom-av1 @@ -1465,6 +1590,15 @@ Complexity-based. Cyclic refresh. @end table +@item tune (@emph{tune}) +Set the distortion metric the encoder is tuned with. Default is @code{psnr}. + +@table @samp +@item psnr (@emph{0}) + +@item ssim (@emph{1}) +@end table + @item lag-in-frames Set the maximum number of frames which the encoder may keep in flight at any one time for lookahead purposes. Defaults to the internal @@ -1544,6 +1678,9 @@ Enable row based multi-threading. Disabled by default. Enable Constrained Directional Enhancement Filter. The libaom-av1 encoder enables CDEF by default. +@item enable-restoration (@emph{boolean}) +Enable Loop Restoration Filter. Default is true for libaom-av1. + @item enable-global-motion (@emph{boolean}) Enable the use of global motion for block prediction. Default is true. @@ -1551,6 +1688,209 @@ Enable the use of global motion for block prediction. Default is true. Enable block copy mode for intra block prediction. This mode is useful for screen content. Default is true. +@item enable-rect-partitions (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable rectangular partitions. Default is true. + +@item enable-1to4-partitions (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable 1:4/4:1 partitions. Default is true. + +@item enable-ab-partitions (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable AB shape partitions. Default is true. + +@item enable-angle-delta (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable angle delta intra prediction. Default is true. + +@item enable-cfl-intra (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable chroma predicted from luma intra prediction. Default is true. + +@item enable-filter-intra (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable filter intra predictor. Default is true. + +@item enable-intra-edge-filter (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable intra edge filter. Default is true. + +@item enable-smooth-intra (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable smooth intra prediction mode. Default is true. + +@item enable-paeth-intra (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable paeth predictor in intra prediction. Default is true. + +@item enable-palette (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable palette prediction mode. Default is true. + +@item enable-flip-idtx (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable extended transform type, including FLIPADST_DCT, DCT_FLIPADST, +FLIPADST_FLIPADST, ADST_FLIPADST, FLIPADST_ADST, IDTX, V_DCT, H_DCT, +V_ADST, H_ADST, V_FLIPADST, H_FLIPADST. Default is true. + +@item enable-tx64 (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable 64-pt transform. Default is true. + +@item reduced-tx-type-set (@emph{boolean}) (Requires libaom >= v2.0.0) +Use reduced set of transform types. Default is false. + +@item use-intra-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0) +Use DCT only for INTRA modes. Default is false. + +@item use-inter-dct-only (@emph{boolean}) (Requires libaom >= v2.0.0) +Use DCT only for INTER modes. Default is false. + +@item use-intra-default-tx-only (@emph{boolean}) (Requires libaom >= v2.0.0) +Use Default-transform only for INTRA modes. Default is false. + +@item enable-ref-frame-mvs (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable temporal mv prediction. Default is true. + +@item enable-reduced-reference-set (@emph{boolean}) (Requires libaom >= v2.0.0) +Use reduced set of single and compound references. Default is false. + +@item enable-obmc (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable obmc. Default is true. + +@item enable-dual-filter (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable dual filter. Default is true. + +@item enable-diff-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable difference-weighted compound. Default is true. + +@item enable-dist-wtd-comp (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable distance-weighted compound. Default is true. + +@item enable-onesided-comp (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable one sided compound. Default is true. + +@item enable-interinter-wedge (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable interinter wedge compound. Default is true. + +@item enable-interintra-wedge (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable interintra wedge compound. Default is true. + +@item enable-masked-comp (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable masked compound. Default is true. + +@item enable-interintra-comp (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable interintra compound. Default is true. + +@item enable-smooth-interintra (@emph{boolean}) (Requires libaom >= v2.0.0) +Enable smooth interintra mode. Default is true. + +@item aom-params +Set libaom options using a list of @var{key}=@var{value} pairs separated +by ":". For a list of supported options, see @command{aomenc --help} under the +section "AV1 Specific Options". + +For example to specify libaom encoding options with @option{-aom-params}: + +@example +ffmpeg -i input -c:v libaom-av1 -b:v 500K -aom-params tune=psnr:enable-tpl-model=1 output.mp4 +@end example + +@end table + +@section libsvtav1 + +SVT-AV1 encoder wrapper. + +Requires the presence of the SVT-AV1 headers and library during configuration. +You need to explicitly configure the build with @code{--enable-libsvtav1}. + +@subsection Options + +@table @option +@item profile +Set the encoding profile. +@table @samp +@item main +@item high +@item professional +@end table + +@item level +Set the operating point level. For example: '4.0' + +@item hielevel +Set the Hierarchical prediction levels. +@table @samp +@item 3level +@item 4level +This is the default. +@end table + +@item tier +Set the operating point tier. +@table @samp +@item main +This is the default. +@item high +@end table + +@item qmax +Set the maximum quantizer to use when using a bitrate mode. + +@item qmin +Set the minimum quantizer to use when using a bitrate mode. + +@item crf +Constant rate factor value used in crf rate control mode (0-63). + +@item qp +Set the quantizer used in cqp rate control mode (0-63). + +@item sc_detection +Enable scene change detection. + +@item la_depth +Set number of frames to look ahead (0-120). + +@item preset +Set the quality-speed tradeoff, in the range 0 to 13. Higher values are +faster but lower quality. + +@item tile_rows +Set log2 of the number of rows of tiles to use (0-6). + +@item tile_columns +Set log2 of the number of columns of tiles to use (0-4). + +@item svtav1-params +Set SVT-AV1 options using a list of @var{key}=@var{value} pairs separated +by ":". See the SVT-AV1 encoder user guide for a list of accepted parameters. + +@end table + +@section libjxl + +libjxl JPEG XL encoder wrapper. + +Requires the presence of the libjxl headers and library during +configuration. You need to explicitly configure the build with +@code{--enable-libjxl}. + +@subsection Options + +The libjxl wrapper supports the following options: + +@table @option + +@item distance +Set the target Butteraugli distance. This is a quality setting: lower +distance yields higher quality, with distance=1.0 roughly comparable to +libjpeg Quality 90 for photographic content. Setting distance=0.0 yields +true lossless encoding. Valid values range between 0.0 and 15.0, and sane +values rarely exceed 5.0. Setting distance=0.1 usually attains +transparency for most input. The default is 1.0. + +@item effort +Set the encoding effort used. Higher effort values produce more consistent +quality and usually produces a better quality/bpp curve, at the cost of +more CPU time required. Valid values range from 1 to 9, and the default is 7. + +@item modular +Force the encoder to use Modular mode instead of choosing automatically. The +default is to use VarDCT for lossy encoding and Modular for lossless. VarDCT +is generally superior to Modular for lossy encoding but does not support +lossless encoding. + @end table @section libkvazaar @@ -1740,8 +2080,11 @@ kilobits/s. @item keyint_min (@emph{kf-min-dist}) @item qmin (@emph{min-q}) +Minimum (Best Quality) Quantizer. @item qmax (@emph{max-q}) +Maximum (Worst Quality) Quantizer. +Can be changed per-frame. @item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz}) Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are @@ -1842,16 +2185,14 @@ Enable error resiliency features. Increase sharpness at the expense of lower PSNR. The valid range is [0, 7]. -@item VP8-specific options -@table @option @item ts-parameters Sets the temporal scalability configuration using a :-separated list of key=value pairs. For example, to specify temporal scalability parameters with @code{ffmpeg}: @example ffmpeg -i INPUT -c:v libvpx -ts-parameters ts_number_layers=3:\ -ts_target_bitrate=250000,500000,1000000:ts_rate_decimator=4,2,1:\ -ts_periodicity=4:ts_layer_id=0,2,1,2 OUTPUT +ts_target_bitrate=250,500,1000:ts_rate_decimator=4,2,1:\ +ts_periodicity=4:ts_layer_id=0,2,1,2:ts_layering_mode=3 OUTPUT @end example Below is a brief explanation of each of the parameters, please refer to @code{struct vpx_codec_enc_cfg} in @code{vpx/vpx_encoder.h} for more @@ -1860,13 +2201,38 @@ details. @item ts_number_layers Number of temporal coding layers. @item ts_target_bitrate -Target bitrate for each temporal layer. +Target bitrate for each temporal layer (in kbps). +(bitrate should be inclusive of the lower temporal layer). @item ts_rate_decimator Frame rate decimation factor for each temporal layer. @item ts_periodicity Length of the sequence defining frame temporal layer membership. @item ts_layer_id Template defining the membership of frames to temporal layers. +@item ts_layering_mode +(optional) Selecting the temporal structure from a set of pre-defined temporal layering modes. +Currently supports the following options. +@table @option +@item 0 +No temporal layering flags are provided internally, +relies on flags being passed in using @code{metadata} field in @code{AVFrame} +with following keys. +@table @option +@item vp8-flags +Sets the flags passed into the encoder to indicate the referencing scheme for +the current frame. +Refer to function @code{vpx_codec_encode} in @code{vpx/vpx_encoder.h} for more +details. +@item temporal_id +Explicitly sets the temporal id of the current frame to encode. +@end table +@item 2 +Two temporal layers. 0-1... +@item 3 +Three temporal layers. 0-2-1-2...; with single reference frame. +@item 4 +Same as option "3", except there is a dependency between +the two temporal layer 2 frames within the temporal period. @end table @end table @@ -1910,6 +2276,38 @@ midpoint is passed in rather than calculated for a specific clip or chunk. The valid range is [0, 10000]. 0 (default) uses standard VBR. @item enable-tpl @var{boolean} Enable temporal dependency model. +@item ref-frame-config +Using per-frame metadata, set members of the structure @code{vpx_svc_ref_frame_config_t} in @code{vpx/vp8cx.h} to fine-control referencing schemes and frame buffer management. +@*Use a :-separated list of key=value pairs. +For example, +@example +av_dict_set(&av_frame->metadata, "ref-frame-config", \ +"rfc_update_buffer_slot=7:rfc_lst_fb_idx=0:rfc_gld_fb_idx=1:rfc_alt_fb_idx=2:rfc_reference_last=0:rfc_reference_golden=0:rfc_reference_alt_ref=0"); +@end example +@table @option +@item rfc_update_buffer_slot +Indicates the buffer slot number to update +@item rfc_update_last +Indicates whether to update the LAST frame +@item rfc_update_golden +Indicates whether to update GOLDEN frame +@item rfc_update_alt_ref +Indicates whether to update ALT_REF frame +@item rfc_lst_fb_idx +LAST frame buffer index +@item rfc_gld_fb_idx +GOLDEN frame buffer index +@item rfc_alt_fb_idx +ALT_REF frame buffer index +@item rfc_reference_last +Indicates whether to reference LAST frame +@item rfc_reference_golden +Indicates whether to reference GOLDEN frame +@item rfc_reference_alt_ref +Indicates whether to reference ALT_REF frame +@item rfc_reference_duration +Indicates frame duration +@end table @end table @end table @@ -1950,11 +2348,10 @@ and compression tools used, and varies the combination of these tools. This maps to the @var{method} option in libwebp. The valid range is 0 to 6. Default is 4. -@item -qscale @var{float} -For lossy encoding, this controls image quality, 0 to 100. For lossless -encoding, this controls the effort and time spent at compressing more. The -default value is 75. Note that for usage via libavcodec, this option is called -@var{global_quality} and must be multiplied by @var{FF_QP2LAMBDA}. +@item -quality @var{float} +For lossy encoding, this controls image quality. For lossless encoding, this +controls the effort and time spent in compression. +Range is 0 to 100. Default is 75. @item -preset @var{type} Configuration preset. This does some automatic settings based on the general @@ -2006,9 +2403,7 @@ pixel formats as input instead of YUV. @subsection Supported Pixel Formats x264 supports 8- to 10-bit color spaces. The exact bit depth is controlled at -x264's configure time. FFmpeg only supports one bit depth in one particular -build. In other words, it is not possible to build one FFmpeg with multiple -versions of x264 with different bit depths. +x264's configure time. @subsection Options @@ -2342,6 +2737,9 @@ ffmpeg -i foo.mpg -c:v libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv Import closed captions (which must be ATSC compatible format) into output. Only the mpeg2 and h264 decoders provide these. Default is 1 (on). +@item udu_sei @var{boolean} +Import user data unregistered SEI if available into output. Default is 0 (off). + @item x264-params (N.A.) Override the x264 configuration using a :-separated list of key=value parameters. @@ -2371,6 +2769,20 @@ during configuration. You need to explicitly configure the build with @subsection Options @table @option +@item b +Sets target video bitrate. + +@item bf + +@item g +Set the GOP size. + +@item keyint_min +Minimum GOP size. + +@item refs +Number of reference frames each P-frame can use. The range is from @var{1-16}. + @item preset Set the x265 preset. @@ -2383,10 +2795,35 @@ Set profile restrictions. @item crf Set the quality for constant quality mode. +@item qp +Set constant quantization rate control method parameter. + +@item qmin +Minimum quantizer scale. + +@item qmax +Maximum quantizer scale. + +@item qdiff +Maximum difference between quantizer scales. + +@item qblur +Quantizer curve blur + +@item qcomp +Quantizer curve compression factor + +@item i_qfactor + +@item b_qfactor + @item forced-idr Normally, when forcing a I-frame type, the encoder can select any type of I-frame. This option forces it to choose an IDR-frame. +@item udu_sei @var{boolean} +Import user data unregistered SEI if available into output. Default is 0 (off). + @item x265-params Set x265 options using a list of @var{key}=@var{value} couples separated by ":". See @command{x265 --help} for a list of options. @@ -2618,6 +3055,14 @@ fastest. @end table +@section MediaFoundation + +This provides wrappers to encoders (both audio and video) in the +MediaFoundation framework. It can access both SW and HW encoders. +Video encoders can take input in either of nv12 or yuv420p form +(some encoders support both, some support only either - in practice, +nv12 is the safer choice, especially among HW encoders). + @section mpeg2 MPEG-2 video encoder. @@ -2625,6 +3070,30 @@ MPEG-2 video encoder. @subsection Options @table @option +@item profile +Select the mpeg2 profile to encode: + +@table @samp +@item 422 +@item high +@item ss +Spatially Scalable +@item snr +SNR Scalable +@item main +@item simple +@end table + +@item level +Select the mpeg2 level to encode: + +@table @samp +@item high +@item high1440 +@item main +@item low +@end table + @item seq_disp_ext @var{integer} Specifies if the encoder should write a sequence_display_extension to the output. @@ -2731,12 +3200,13 @@ Setting a higher @option{bits_per_mb} limit will improve the speed. For the fastest encoding speed set the @option{qscale} parameter (4 is the recommended value) and do not set a size constraint. -@section QSV encoders +@section QSV Encoders -The family of Intel QuickSync Video encoders (MPEG-2, H.264 and HEVC) +The family of Intel QuickSync Video encoders (MPEG-2, H.264, HEVC, JPEG/MJPEG +and VP9) +@subsection Ratecontrol Method The ratecontrol method is selected as follows: - @itemize @bullet @item When @option{global_quality} is specified, a quality-based mode is used. @@ -2751,7 +3221,8 @@ also set (the @option{-qscale} ffmpeg option). @option{look_ahead} option is also set. @item -@var{ICQ} -- intelligent constant quality otherwise. +@var{ICQ} -- intelligent constant quality otherwise. For the ICQ modes, global +quality range is 1 to 51, with 1 being the best quality. @end itemize @item @@ -2783,6 +3254,7 @@ Note that depending on your system, a different mode than the one you specified may be selected by the encoder. Set the verbosity level to @var{verbose} or higher to see the actual settings used by the QSV runtime. +@subsection Global Options -> MSDK Options Additional libavcodec global options are mapped to MSDK options as follows: @itemize @@ -2819,6 +3291,389 @@ encoder use CAVLC instead of CABAC. @end itemize +@subsection Common Options +Following options are used by all qsv encoders. + +@table @option +@item @var{async_depth} +Specifies how many asynchronous operations an application performs +before the application explicitly synchronizes the result. If zero, +the value is not specified. + +@item @var{avbr_accuracy} +Accuracy of the AVBR ratecontrol (unit of tenth of percent). + +@item @var{avbr_convergence} +Convergence of the AVBR ratecontrol (unit of 100 frames) + +The parameters @var{avbr_accuracy} and @var{avbr_convergence} are for the +average variable bitrate control (AVBR) algorithm. +The algorithm focuses on overall encoding quality while meeting the specified +bitrate, @var{target_bitrate}, within the accuracy range @var{avbr_accuracy}, +after a @var{avbr_Convergence} period. This method does not follow HRD and the +instant bitrate is not capped or padded. + +@item @var{preset} +This option itemizes a range of choices from veryfast (best speed) to veryslow +(best quality). +@table @samp +@item veryfast +@item faster +@item fast +@item medium +@item slow +@item slower +@item veryslow +@end table + +@item @var{forced_idr} +Forcing I frames as IDR frames. + +@item @var{low_power} +For encoders set this flag to ON to reduce power consumption and GPU usage. +@end table + +@subsection Runtime Options +Following options can be used durning qsv encoding. + +@table @option +@item @var{qsv_config_qp} +Supported in h264_qsv and hevc_qsv. +This option can be set in per-frame metadata. QP parameter can be dynamically +changed when encoding in CQP mode. +@end table + +@subsection H264 options +These options are used by h264_qsv + +@table @option +@item @var{extbrc} +Extended bitrate control. + +@item @var{recovery_point_sei} +Set this flag to insert the recovery point SEI message at the beginning of every +intra refresh cycle. + +@item @var{rdo} +Enable rate distortion optimization. + +@item @var{max_frame_size} +Maximum encoded frame size in bytes. + +@item @var{max_frame_size_i} +Maximum encoded frame size for I frames in bytes. If this value is set as larger +than zero, then for I frames the value set by max_frame_size is ignored. + +@item @var{max_frame_size_p} +Maximum encoded frame size for P frames in bytes. If this value is set as larger +than zero, then for P frames the value set by max_frame_size is ignored. + +@item @var{max_slice_size} +Maximum encoded slice size in bytes. + +@item @var{bitrate_limit} +Toggle bitrate limitations. +Modifies bitrate to be in the range imposed by the QSV encoder. Setting this +flag off may lead to violation of HRD conformance. Mind that specifying bitrate +below the QSV encoder range might significantly affect quality. If on this +option takes effect in non CQP modes: if bitrate is not in the range imposed +by the QSV encoder, it will be changed to be in the range. + +@item @var{mbbrc} +Setting this flag enables macroblock level bitrate control that generally +improves subjective visual quality. Enabling this flag may have negative impact +on performance and objective visual quality metric. + +@item @var{low_delay_brc} +Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on + +@item @var{adaptive_i} +This flag controls insertion of I frames by the QSV encoder. Turn ON this flag +to allow changing of frame type from P and B to I. + +@item @var{adaptive_b} +This flag controls changing of frame type from B to P. + +@item @var{p_strategy} +Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0). + +@item @var{b_strategy} +This option controls usage of B frames as reference. + +@item @var{dblk_idc} +This option disable deblocking. It has value in range 0~2. + +@item @var{cavlc} +If set, CAVLC is used; if unset, CABAC is used for encoding. + +@item @var{vcm} +Video conferencing mode, please see ratecontrol method. + +@item @var{idr_interval} +Distance (in I-frames) between IDR frames. + +@item @var{pic_timing_sei} +Insert picture timing SEI with pic_struct_syntax element. + +@item @var{single_sei_nal_unit} +Put all the SEI messages into one NALU. + +@item @var{max_dec_frame_buffering} +Maximum number of frames buffered in the DPB. + +@item @var{look_ahead} +Use VBR algorithm with look ahead. + +@item @var{look_ahead_depth} +Depth of look ahead in number frames. + +@item @var{look_ahead_downsampling} +Downscaling factor for the frames saved for the lookahead analysis. +@table @samp +@item unknown +@item auto +@item off +@item 2x +@item 4x +@end table + +@item @var{int_ref_type} +Specifies intra refresh type. The major goal of intra refresh is improvement of +error resilience without significant impact on encoded bitstream size caused by +I frames. The SDK encoder achieves this by encoding part of each frame in +refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means +vertical refresh, by column of MBs. To enable intra refresh, B frame should be +set to 0. + +@item @var{int_ref_cycle_size} +Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are +invalid values. + +@item @var{int_ref_qp_delta} +Specifies QP difference for inserted intra MBs. This is signed value in +[-51, 51] range if target encoding bit-depth for luma samples is 8 and this +range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively. + +@item @var{int_ref_cycle_dist} +Distance between the beginnings of the intra-refresh cycles in frames. + +@item @var{profile} +@table @samp +@item unknown +@item baseline +@item main +@item high +@end table + +@item @var{a53cc} +Use A53 Closed Captions (if available). + +@item @var{aud} +Insert the Access Unit Delimiter NAL. + +@item @var{mfmode} +Multi-Frame Mode. +@table @samp +@item off +@item auto +@end table + +@item @var{repeat_pps} +Repeat pps for every frame. + +@item @var{max_qp_i} +Maximum video quantizer scale for I frame. + +@item @var{min_qp_i} +Minimum video quantizer scale for I frame. + +@item @var{max_qp_p} +Maximum video quantizer scale for P frame. + +@item @var{min_qp_p} +Minimum video quantizer scale for P frame. + +@item @var{max_qp_b} +Maximum video quantizer scale for B frame. + +@item @var{min_qp_b} +Minimum video quantizer scale for B frame. +@end table + +@subsection HEVC Options +These options are used by hevc_qsv + +@table @option +@item @var{extbrc} +Extended bitrate control. + +@item @var{recovery_point_sei} +Set this flag to insert the recovery point SEI message at the beginning of every +intra refresh cycle. + +@item @var{rdo} +Enable rate distortion optimization. + +@item @var{max_frame_size} +Maximum encoded frame size in bytes. + +@item @var{max_frame_size_i} +Maximum encoded frame size for I frames in bytes. If this value is set as larger +than zero, then for I frames the value set by max_frame_size is ignored. + +@item @var{max_frame_size_p} +Maximum encoded frame size for P frames in bytes. If this value is set as larger +than zero, then for P frames the value set by max_frame_size is ignored. + +@item @var{max_slice_size} +Maximum encoded slice size in bytes. + +@item @var{mbbrc} +Setting this flag enables macroblock level bitrate control that generally +improves subjective visual quality. Enabling this flag may have negative impact +on performance and objective visual quality metric. + +@item @var{low_delay_brc} +Setting this flag turns on or off LowDelayBRC feautre in qsv plugin, which provides +more accurate bitrate control to minimize the variance of bitstream size frame +by frame. Value: -1-default 0-off 1-on + +@item @var{p_strategy} +Enable P-pyramid: 0-default 1-simple 2-pyramid(bf need to be set to 0). + +@item @var{b_strategy} +This option controls usage of B frames as reference. + +@item @var{dblk_idc} +This option disable deblocking. It has value in range 0~2. + +@item @var{idr_interval} +Distance (in I-frames) between IDR frames. +@table @samp +@item begin_only +Output an IDR-frame only at the beginning of the stream. +@end table + +@item @var{load_plugin} +A user plugin to load in an internal session. +@table @samp +@item none +@item hevc_sw +@item hevc_hw +@end table + +@item @var{load_plugins} +A :-separate list of hexadecimal plugin UIDs to load in +an internal session. + +@item @var{look_ahead_depth} +Depth of look ahead in number frames, available when extbrc option is enabled. + +@item @var{profile} +Set the encoding profile (scc requires libmfx >= 1.32). + +@table @samp +@item unknown +@item main +@item main10 +@item mainsp +@item rext +@item scc +@end table + +@item @var{gpb} +1: GPB (generalized P/B frame) + +0: regular P frame. + +@item @var{tile_cols} +Number of columns for tiled encoding. + +@item @var{tile_rows} +Number of rows for tiled encoding. + +@item @var{aud} +Insert the Access Unit Delimiter NAL. + +@item @var{pic_timing_sei} +Insert picture timing SEI with pic_struct_syntax element. + +@item @var{transform_skip} +Turn this option ON to enable transformskip. It is supported on platform equal +or newer than ICL. + +@item @var{int_ref_type} +Specifies intra refresh type. The major goal of intra refresh is improvement of +error resilience without significant impact on encoded bitstream size caused by +I frames. The SDK encoder achieves this by encoding part of each frame in +refresh cycle using intra MBs. @var{none} means no refresh. @var{vertical} means +vertical refresh, by column of MBs. To enable intra refresh, B frame should be +set to 0. + +@item @var{int_ref_cycle_size} +Specifies number of pictures within refresh cycle starting from 2. 0 and 1 are +invalid values. + +@item @var{int_ref_qp_delta} +Specifies QP difference for inserted intra MBs. This is signed value in +[-51, 51] range if target encoding bit-depth for luma samples is 8 and this +range is [-63, 63] for 10 bit-depth or [-75, 75] for 12 bit-depth respectively. + +@item @var{int_ref_cycle_dist} +Distance between the beginnings of the intra-refresh cycles in frames. + +@item @var{max_qp_i} +Maximum video quantizer scale for I frame. + +@item @var{min_qp_i} +Minimum video quantizer scale for I frame. + +@item @var{max_qp_p} +Maximum video quantizer scale for P frame. + +@item @var{min_qp_p} +Minimum video quantizer scale for P frame. + +@item @var{max_qp_b} +Maximum video quantizer scale for B frame. + +@item @var{min_qp_b} +Minimum video quantizer scale for B frame. +@end table + +@subsection MPEG2 Options +These options are used by mpeg2_qsv +@table @option +@item @var{profile} +@table @samp +@item unknown +@item simple +@item main +@item high +@end table +@end table + +@subsection VP9 Options +These options are used by vp9_qsv +@table @option +@item @var{profile} +@table @samp +@item unknown +@item profile0 +@item profile1 +@item profile2 +@item profile3 +@end table + +@item @var{tile_cols} +Number of columns for tiled encoding (requires libmfx >= 1.29). + +@item @var{tile_rows} +Number of rows for tiled encoding (requires libmfx >= 1.29). +@end table + @section snow @subsection Options @@ -2899,6 +3754,17 @@ will refer only to P- or I-frames. When set to greater values multiple layers of B-frames will be present, frames in each layer only referring to frames in higher layers. +@item async_depth +Maximum processing parallelism. Increase this to improve single channel +performance. This option doesn't work if driver doesn't implement vaSyncBuffer +function. Please make sure there are enough hw_frames allocated if a large +number of async_depth is used. + +@item max_frame_size +Set the allowed max size in bytes for each frame. If the frame size exceeds +the limitation, encoder will adjust the QP value to control the frame size. +Invalid in CQP rate control mode. + @item rc_mode Set the rate control mode to use. A given driver may only support a subset of modes. @@ -2986,6 +3852,11 @@ Include HDR metadata if the input frames have it messages). @end table +@item tiles +Set the number of tiles to encode the input video with, as columns x rows. +Larger numbers allow greater parallelism in both encoding and decoding, but +may decrease coding efficiency. + @end table @item mjpeg_vaapi @@ -3037,6 +3908,22 @@ required to produce a stream usable with all decoders. @end table +@section vbn + +Vizrt Binary Image encoder. + +This format is used by the broadcast vendor Vizrt for quick texture streaming. +Advanced features of the format such as LZW compression of texture data or +generation of mipmaps are not supported. + +@subsection Options + +@table @option +@item format @var{string} +Sets the texture compression used by the VBN file. Can be @var{dxt1}, +@var{dxt5} or @var{raw}. Default is @var{dxt5}. +@end table + @section vc2 SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at @@ -3116,6 +4003,14 @@ and they can also be used in Matroska files. @subsection Options @table @option +@item palette +Specify the global palette used by the bitmaps. + +The format for this option is a string containing 16 24-bits hexadecimal +numbers (without 0x prefix) separated by commas, for example @code{0d00ee, +ee450d, 101010, eaeaea, 0ce60b, ec14ed, ebff0b, 0d617a, 7b7b7b, d1d1d1, +7b2a0e, 0d950c, 0f007b, cf0dec, cfa80c, 7c127b}. + @item even_rows_fix When set to 1, enable a work-around that makes the number of pixel rows even in all subtitles. This fixes a problem with some players that diff --git a/doc/examples/Makefile b/doc/examples/Makefile index 2935424e..81bfd34d 100644 --- a/doc/examples/Makefile +++ b/doc/examples/Makefile @@ -1,4 +1,4 @@ -EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE) += avio_dir_cmd +EXAMPLES-$(CONFIG_AVIO_LIST_DIR_EXAMPLE) += avio_list_dir EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE) += decode_video diff --git a/doc/examples/Makefile.example b/doc/examples/Makefile.example index 6428154c..a232d97f 100644 --- a/doc/examples/Makefile.example +++ b/doc/examples/Makefile.example @@ -11,7 +11,7 @@ CFLAGS += -Wall -g CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS) LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS) -EXAMPLES= avio_dir_cmd \ +EXAMPLES= avio_list_dir \ avio_reading \ decode_audio \ decode_video \ diff --git a/doc/examples/avio_dir_cmd.c b/doc/examples/avio_list_dir.c similarity index 69% rename from doc/examples/avio_dir_cmd.c rename to doc/examples/avio_list_dir.c index 0722bd9a..3073baae 100644 --- a/doc/examples/avio_dir_cmd.c +++ b/doc/examples/avio_list_dir.c @@ -102,38 +102,15 @@ static int list_op(const char *input_dir) return ret; } -static int del_op(const char *url) -{ - int ret = avpriv_io_delete(url); - if (ret < 0) - av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, av_err2str(ret)); - return ret; -} - -static int move_op(const char *src, const char *dst) -{ - int ret = avpriv_io_move(src, dst); - if (ret < 0) - av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, dst, av_err2str(ret)); - return ret; -} - - static void usage(const char *program_name) { - fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n" - "API example program to show how to manipulate resources " - "accessed through AVIOContext.\n" - "OPERATIONS:\n" - "list list content of the directory\n" - "move rename content in directory\n" - "del delete content in directory\n", - program_name); + fprintf(stderr, "usage: %s input_dir\n" + "API example program to show how to list files in directory " + "accessed through AVIOContext.\n", program_name); } int main(int argc, char *argv[]) { - const char *op = NULL; int ret; av_log_set_level(AV_LOG_DEBUG); @@ -145,32 +122,7 @@ int main(int argc, char *argv[]) avformat_network_init(); - op = argv[1]; - if (strcmp(op, "list") == 0) { - if (argc < 3) { - av_log(NULL, AV_LOG_INFO, "Missing argument for list operation.\n"); - ret = AVERROR(EINVAL); - } else { - ret = list_op(argv[2]); - } - } else if (strcmp(op, "del") == 0) { - if (argc < 3) { - av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n"); - ret = AVERROR(EINVAL); - } else { - ret = del_op(argv[2]); - } - } else if (strcmp(op, "move") == 0) { - if (argc < 4) { - av_log(NULL, AV_LOG_INFO, "Missing argument for move operation.\n"); - ret = AVERROR(EINVAL); - } else { - ret = move_op(argv[2], argv[3]); - } - } else { - av_log(NULL, AV_LOG_INFO, "Invalid operation %s\n", op); - ret = AVERROR(EINVAL); - } + ret = list_op(argv[1]); avformat_network_deinit(); diff --git a/doc/examples/decode_audio.c b/doc/examples/decode_audio.c index 19dcafd2..49ad22cb 100644 --- a/doc/examples/decode_audio.c +++ b/doc/examples/decode_audio.c @@ -39,6 +39,35 @@ #define AUDIO_INBUF_SIZE 20480 #define AUDIO_REFILL_THRESH 4096 +static int get_format_from_sample_fmt(const char **fmt, + enum AVSampleFormat sample_fmt) +{ + int i; + struct sample_fmt_entry { + enum AVSampleFormat sample_fmt; const char *fmt_be, *fmt_le; + } sample_fmt_entries[] = { + { AV_SAMPLE_FMT_U8, "u8", "u8" }, + { AV_SAMPLE_FMT_S16, "s16be", "s16le" }, + { AV_SAMPLE_FMT_S32, "s32be", "s32le" }, + { AV_SAMPLE_FMT_FLT, "f32be", "f32le" }, + { AV_SAMPLE_FMT_DBL, "f64be", "f64le" }, + }; + *fmt = NULL; + + for (i = 0; i < FF_ARRAY_ELEMS(sample_fmt_entries); i++) { + struct sample_fmt_entry *entry = &sample_fmt_entries[i]; + if (sample_fmt == entry->sample_fmt) { + *fmt = AV_NE(entry->fmt_be, entry->fmt_le); + return 0; + } + } + + fprintf(stderr, + "sample format %s is not supported as output format\n", + av_get_sample_fmt_name(sample_fmt)); + return -1; +} + static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile) { @@ -68,7 +97,7 @@ static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, exit(1); } for (i = 0; i < frame->nb_samples; i++) - for (ch = 0; ch < dec_ctx->channels; ch++) + for (ch = 0; ch < dec_ctx->ch_layout.nb_channels; ch++) fwrite(frame->data[ch] + data_size*i, 1, data_size, outfile); } } @@ -86,6 +115,9 @@ int main(int argc, char **argv) size_t data_size; AVPacket *pkt; AVFrame *decoded_frame = NULL; + enum AVSampleFormat sfmt; + int n_channels = 0; + const char *fmt; if (argc <= 2) { fprintf(stderr, "Usage: %s \n", argv[0]); @@ -172,6 +204,26 @@ int main(int argc, char **argv) pkt->size = 0; decode(c, pkt, decoded_frame, outfile); + /* print output pcm infomations, because there have no metadata of pcm */ + sfmt = c->sample_fmt; + + if (av_sample_fmt_is_planar(sfmt)) { + const char *packed = av_get_sample_fmt_name(sfmt); + printf("Warning: the sample format the decoder produced is planar " + "(%s). This example will output the first channel only.\n", + packed ? packed : "?"); + sfmt = av_get_packed_sample_fmt(sfmt); + } + + n_channels = c->ch_layout.nb_channels; + if ((ret = get_format_from_sample_fmt(&fmt, sfmt)) < 0) + goto end; + + printf("Play the output audio file with the command:\n" + "ffplay -f %s -ac %d -ar %d %s\n", + fmt, n_channels, c->sample_rate, + outfilename); +end: fclose(outfile); fclose(f); diff --git a/doc/examples/decode_video.c b/doc/examples/decode_video.c index 5a9d43f6..7238e381 100644 --- a/doc/examples/decode_video.c +++ b/doc/examples/decode_video.c @@ -41,7 +41,7 @@ static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize, FILE *f; int i; - f = fopen(filename,"w"); + f = fopen(filename,"wb"); fprintf(f, "P5\n%d %d\n%d\n", xsize, ysize, 255); for (i = 0; i < ysize; i++) fwrite(buf + i * wrap, 1, xsize, f); @@ -92,10 +92,12 @@ int main(int argc, char **argv) uint8_t *data; size_t data_size; int ret; + int eof; AVPacket *pkt; if (argc <= 2) { - fprintf(stderr, "Usage: %s \n", argv[0]); + fprintf(stderr, "Usage: %s \n" + "And check your input file is encoded by mpeg1video please.\n", argv[0]); exit(0); } filename = argv[1]; @@ -149,15 +151,16 @@ int main(int argc, char **argv) exit(1); } - while (!feof(f)) { + do { /* read raw data from the input file */ data_size = fread(inbuf, 1, INBUF_SIZE, f); - if (!data_size) + if (ferror(f)) break; + eof = !data_size; /* use the parser to split the data into frames */ data = inbuf; - while (data_size > 0) { + while (data_size > 0 || eof) { ret = av_parser_parse2(parser, c, &pkt->data, &pkt->size, data, data_size, AV_NOPTS_VALUE, AV_NOPTS_VALUE, 0); if (ret < 0) { @@ -169,8 +172,10 @@ int main(int argc, char **argv) if (pkt->size) decode(c, frame, pkt, outfilename); + else if (eof) + break; } - } + } while (!eof); /* flush the decoder */ decode(c, frame, NULL, outfilename); diff --git a/doc/examples/demuxing_decoding.c b/doc/examples/demuxing_decoding.c index 69a31a89..999a78db 100644 --- a/doc/examples/demuxing_decoding.c +++ b/doc/examples/demuxing_decoding.c @@ -32,6 +32,7 @@ #include #include #include +#include #include static AVFormatContext *fmt_ctx = NULL; @@ -51,99 +52,97 @@ static int video_dst_bufsize; static int video_stream_idx = -1, audio_stream_idx = -1; static AVFrame *frame = NULL; -static AVPacket pkt; +static AVPacket *pkt = NULL; static int video_frame_count = 0; static int audio_frame_count = 0; -/* Enable or disable frame reference counting. You are not supposed to support - * both paths in your application but pick the one most appropriate to your - * needs. Look for the use of refcount in this example to see what are the - * differences of API usage between them. */ -static int refcount = 0; - -static int decode_packet(int *got_frame, int cached) +static int output_video_frame(AVFrame *frame) { - int ret = 0; - int decoded = pkt.size; - - *got_frame = 0; - - if (pkt.stream_index == video_stream_idx) { - /* decode video frame */ - ret = avcodec_decode_video2(video_dec_ctx, frame, got_frame, &pkt); - if (ret < 0) { - fprintf(stderr, "Error decoding video frame (%s)\n", av_err2str(ret)); - return ret; - } - - if (*got_frame) { - - if (frame->width != width || frame->height != height || - frame->format != pix_fmt) { - /* To handle this change, one could call av_image_alloc again and - * decode the following frames into another rawvideo file. */ - fprintf(stderr, "Error: Width, height and pixel format have to be " - "constant in a rawvideo file, but the width, height or " - "pixel format of the input video changed:\n" - "old: width = %d, height = %d, format = %s\n" - "new: width = %d, height = %d, format = %s\n", - width, height, av_get_pix_fmt_name(pix_fmt), - frame->width, frame->height, - av_get_pix_fmt_name(frame->format)); - return -1; - } - - printf("video_frame%s n:%d coded_n:%d\n", - cached ? "(cached)" : "", - video_frame_count++, frame->coded_picture_number); - - /* copy decoded frame to destination buffer: - * this is required since rawvideo expects non aligned data */ - av_image_copy(video_dst_data, video_dst_linesize, - (const uint8_t **)(frame->data), frame->linesize, - pix_fmt, width, height); - - /* write to rawvideo file */ - fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file); - } - } else if (pkt.stream_index == audio_stream_idx) { - /* decode audio frame */ - ret = avcodec_decode_audio4(audio_dec_ctx, frame, got_frame, &pkt); - if (ret < 0) { - fprintf(stderr, "Error decoding audio frame (%s)\n", av_err2str(ret)); - return ret; - } - /* Some audio decoders decode only part of the packet, and have to be - * called again with the remainder of the packet data. - * Sample: fate-suite/lossless-audio/luckynight-partial.shn - * Also, some decoders might over-read the packet. */ - decoded = FFMIN(ret, pkt.size); - - if (*got_frame) { - size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format); - printf("audio_frame%s n:%d nb_samples:%d pts:%s\n", - cached ? "(cached)" : "", - audio_frame_count++, frame->nb_samples, - av_ts2timestr(frame->pts, &audio_dec_ctx->time_base)); - - /* Write the raw audio data samples of the first plane. This works - * fine for packed formats (e.g. AV_SAMPLE_FMT_S16). However, - * most audio decoders output planar audio, which uses a separate - * plane of audio samples for each channel (e.g. AV_SAMPLE_FMT_S16P). - * In other words, this code will write only the first audio channel - * in these cases. - * You should use libswresample or libavfilter to convert the frame - * to packed data. */ - fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file); - } + if (frame->width != width || frame->height != height || + frame->format != pix_fmt) { + /* To handle this change, one could call av_image_alloc again and + * decode the following frames into another rawvideo file. */ + fprintf(stderr, "Error: Width, height and pixel format have to be " + "constant in a rawvideo file, but the width, height or " + "pixel format of the input video changed:\n" + "old: width = %d, height = %d, format = %s\n" + "new: width = %d, height = %d, format = %s\n", + width, height, av_get_pix_fmt_name(pix_fmt), + frame->width, frame->height, + av_get_pix_fmt_name(frame->format)); + return -1; } - /* If we use frame reference counting, we own the data and need - * to de-reference it when we don't use it anymore */ - if (*got_frame && refcount) - av_frame_unref(frame); + printf("video_frame n:%d coded_n:%d\n", + video_frame_count++, frame->coded_picture_number); - return decoded; + /* copy decoded frame to destination buffer: + * this is required since rawvideo expects non aligned data */ + av_image_copy(video_dst_data, video_dst_linesize, + (const uint8_t **)(frame->data), frame->linesize, + pix_fmt, width, height); + + /* write to rawvideo file */ + fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file); + return 0; +} + +static int output_audio_frame(AVFrame *frame) +{ + size_t unpadded_linesize = frame->nb_samples * av_get_bytes_per_sample(frame->format); + printf("audio_frame n:%d nb_samples:%d pts:%s\n", + audio_frame_count++, frame->nb_samples, + av_ts2timestr(frame->pts, &audio_dec_ctx->time_base)); + + /* Write the raw audio data samples of the first plane. This works + * fine for packed formats (e.g. AV_SAMPLE_FMT_S16). However, + * most audio decoders output planar audio, which uses a separate + * plane of audio samples for each channel (e.g. AV_SAMPLE_FMT_S16P). + * In other words, this code will write only the first audio channel + * in these cases. + * You should use libswresample or libavfilter to convert the frame + * to packed data. */ + fwrite(frame->extended_data[0], 1, unpadded_linesize, audio_dst_file); + + return 0; +} + +static int decode_packet(AVCodecContext *dec, const AVPacket *pkt) +{ + int ret = 0; + + // submit the packet to the decoder + ret = avcodec_send_packet(dec, pkt); + if (ret < 0) { + fprintf(stderr, "Error submitting a packet for decoding (%s)\n", av_err2str(ret)); + return ret; + } + + // get all the available frames from the decoder + while (ret >= 0) { + ret = avcodec_receive_frame(dec, frame); + if (ret < 0) { + // those two return values are special and mean there is no output + // frame available, but there were no errors during decoding + if (ret == AVERROR_EOF || ret == AVERROR(EAGAIN)) + return 0; + + fprintf(stderr, "Error during decoding (%s)\n", av_err2str(ret)); + return ret; + } + + // write the frame data to output file + if (dec->codec->type == AVMEDIA_TYPE_VIDEO) + ret = output_video_frame(frame); + else + ret = output_audio_frame(frame); + + av_frame_unref(frame); + if (ret < 0) + return ret; + } + + return 0; } static int open_codec_context(int *stream_idx, @@ -151,8 +150,7 @@ static int open_codec_context(int *stream_idx, { int ret, stream_index; AVStream *st; - AVCodec *dec = NULL; - AVDictionary *opts = NULL; + const AVCodec *dec = NULL; ret = av_find_best_stream(fmt_ctx, type, -1, -1, NULL, 0); if (ret < 0) { @@ -186,9 +184,8 @@ static int open_codec_context(int *stream_idx, return ret; } - /* Init the decoders, with or without reference counting */ - av_dict_set(&opts, "refcounted_frames", refcount ? "1" : "0", 0); - if ((ret = avcodec_open2(*dec_ctx, dec, &opts)) < 0) { + /* Init the decoders */ + if ((ret = avcodec_open2(*dec_ctx, dec, NULL)) < 0) { fprintf(stderr, "Failed to open %s codec\n", av_get_media_type_string(type)); return ret; @@ -230,24 +227,17 @@ static int get_format_from_sample_fmt(const char **fmt, int main (int argc, char **argv) { - int ret = 0, got_frame; + int ret = 0; - if (argc != 4 && argc != 5) { - fprintf(stderr, "usage: %s [-refcount] input_file video_output_file audio_output_file\n" + if (argc != 4) { + fprintf(stderr, "usage: %s input_file video_output_file audio_output_file\n" "API example program to show how to read frames from an input file.\n" "This program reads frames from a file, decodes them, and writes decoded\n" "video frames to a rawvideo file named video_output_file, and decoded\n" - "audio frames to a rawaudio file named audio_output_file.\n\n" - "If the -refcount option is specified, the program use the\n" - "reference counting frame system which allows keeping a copy of\n" - "the data for longer than one decode call.\n" - "\n", argv[0]); + "audio frames to a rawaudio file named audio_output_file.\n", + argv[0]); exit(1); } - if (argc == 5 && !strcmp(argv[1], "-refcount")) { - refcount = 1; - argv++; - } src_filename = argv[1]; video_dst_filename = argv[2]; audio_dst_filename = argv[3]; @@ -313,10 +303,12 @@ int main (int argc, char **argv) goto end; } - /* initialize packet, set data to NULL, let the demuxer fill it */ - av_init_packet(&pkt); - pkt.data = NULL; - pkt.size = 0; + pkt = av_packet_alloc(); + if (!pkt) { + fprintf(stderr, "Could not allocate packet\n"); + ret = AVERROR(ENOMEM); + goto end; + } if (video_stream) printf("Demuxing video from file '%s' into '%s'\n", src_filename, video_dst_filename); @@ -324,24 +316,23 @@ int main (int argc, char **argv) printf("Demuxing audio from file '%s' into '%s'\n", src_filename, audio_dst_filename); /* read frames from the file */ - while (av_read_frame(fmt_ctx, &pkt) >= 0) { - AVPacket orig_pkt = pkt; - do { - ret = decode_packet(&got_frame, 0); - if (ret < 0) - break; - pkt.data += ret; - pkt.size -= ret; - } while (pkt.size > 0); - av_packet_unref(&orig_pkt); + while (av_read_frame(fmt_ctx, pkt) >= 0) { + // check if the packet belongs to a stream we are interested in, otherwise + // skip it + if (pkt->stream_index == video_stream_idx) + ret = decode_packet(video_dec_ctx, pkt); + else if (pkt->stream_index == audio_stream_idx) + ret = decode_packet(audio_dec_ctx, pkt); + av_packet_unref(pkt); + if (ret < 0) + break; } - /* flush cached frames */ - pkt.data = NULL; - pkt.size = 0; - do { - decode_packet(&got_frame, 1); - } while (got_frame); + /* flush the decoders */ + if (video_dec_ctx) + decode_packet(video_dec_ctx, NULL); + if (audio_dec_ctx) + decode_packet(audio_dec_ctx, NULL); printf("Demuxing succeeded.\n"); @@ -354,7 +345,7 @@ int main (int argc, char **argv) if (audio_stream) { enum AVSampleFormat sfmt = audio_dec_ctx->sample_fmt; - int n_channels = audio_dec_ctx->channels; + int n_channels = audio_dec_ctx->ch_layout.nb_channels; const char *fmt; if (av_sample_fmt_is_planar(sfmt)) { @@ -383,6 +374,7 @@ end: fclose(video_dst_file); if (audio_dst_file) fclose(audio_dst_file); + av_packet_free(&pkt); av_frame_free(&frame); av_free(video_dst_data[0]); diff --git a/doc/examples/encode_audio.c b/doc/examples/encode_audio.c index ab3586be..9a1792b7 100644 --- a/doc/examples/encode_audio.c +++ b/doc/examples/encode_audio.c @@ -70,26 +70,25 @@ static int select_sample_rate(const AVCodec *codec) } /* select layout with the highest channel count */ -static int select_channel_layout(const AVCodec *codec) +static int select_channel_layout(const AVCodec *codec, AVChannelLayout *dst) { - const uint64_t *p; - uint64_t best_ch_layout = 0; + const AVChannelLayout *p, *best_ch_layout; int best_nb_channels = 0; - if (!codec->channel_layouts) - return AV_CH_LAYOUT_STEREO; + if (!codec->ch_layouts) + return av_channel_layout_copy(dst, &(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO); - p = codec->channel_layouts; - while (*p) { - int nb_channels = av_get_channel_layout_nb_channels(*p); + p = codec->ch_layouts; + while (p->nb_channels) { + int nb_channels = p->nb_channels; if (nb_channels > best_nb_channels) { - best_ch_layout = *p; + best_ch_layout = p; best_nb_channels = nb_channels; } p++; } - return best_ch_layout; + return av_channel_layout_copy(dst, best_ch_layout); } static void encode(AVCodecContext *ctx, AVFrame *frame, AVPacket *pkt, @@ -164,8 +163,9 @@ int main(int argc, char **argv) /* select other audio parameters supported by the encoder */ c->sample_rate = select_sample_rate(codec); - c->channel_layout = select_channel_layout(codec); - c->channels = av_get_channel_layout_nb_channels(c->channel_layout); + ret = select_channel_layout(codec, &c->ch_layout); + if (ret < 0) + exit(1); /* open it */ if (avcodec_open2(c, codec, NULL) < 0) { @@ -195,7 +195,9 @@ int main(int argc, char **argv) frame->nb_samples = c->frame_size; frame->format = c->sample_fmt; - frame->channel_layout = c->channel_layout; + ret = av_channel_layout_copy(&frame->ch_layout, &c->ch_layout); + if (ret < 0) + exit(1); /* allocate the data buffers */ ret = av_frame_get_buffer(frame, 0); @@ -218,7 +220,7 @@ int main(int argc, char **argv) for (j = 0; j < c->frame_size; j++) { samples[2*j] = (int)(sin(t) * 10000); - for (k = 1; k < c->channels; k++) + for (k = 1; k < c->ch_layout.nb_channels; k++) samples[2*j + k] = samples[2*j]; t += tincr; } diff --git a/doc/examples/encode_video.c b/doc/examples/encode_video.c index 6731b2ad..939ed683 100644 --- a/doc/examples/encode_video.c +++ b/doc/examples/encode_video.c @@ -145,7 +145,7 @@ int main(int argc, char **argv) frame->width = c->width; frame->height = c->height; - ret = av_frame_get_buffer(frame, 32); + ret = av_frame_get_buffer(frame, 0); if (ret < 0) { fprintf(stderr, "Could not allocate the video frame data\n"); exit(1); @@ -155,12 +155,25 @@ int main(int argc, char **argv) for (i = 0; i < 25; i++) { fflush(stdout); - /* make sure the frame data is writable */ + /* Make sure the frame data is writable. + On the first round, the frame is fresh from av_frame_get_buffer() + and therefore we know it is writable. + But on the next rounds, encode() will have called + avcodec_send_frame(), and the codec may have kept a reference to + the frame in its internal structures, that makes the frame + unwritable. + av_frame_make_writable() checks that and allocates a new buffer + for the frame only if necessary. + */ ret = av_frame_make_writable(frame); if (ret < 0) exit(1); - /* prepare a dummy image */ + /* Prepare a dummy image. + In real code, this is where you would have your own logic for + filling the frame. FFmpeg does not care what you put in the + frame. + */ /* Y */ for (y = 0; y < c->height; y++) { for (x = 0; x < c->width; x++) { @@ -185,8 +198,14 @@ int main(int argc, char **argv) /* flush the encoder */ encode(c, NULL, pkt, f); - /* add sequence end code to have a real MPEG file */ - fwrite(endcode, 1, sizeof(endcode), f); + /* Add sequence end code to have a real MPEG file. + It makes only sense because this tiny examples writes packets + directly. This is called "elementary stream" and only works for some + codecs. To create a valid file, you usually need to write packets + into a proper file format or protocol; see muxing.c. + */ + if (codec->id == AV_CODEC_ID_MPEG1VIDEO || codec->id == AV_CODEC_ID_MPEG2VIDEO) + fwrite(endcode, 1, sizeof(endcode), f); fclose(f); avcodec_free_context(&c); diff --git a/doc/examples/extract_mvs.c b/doc/examples/extract_mvs.c index de31ccd2..cc1311da 100644 --- a/doc/examples/extract_mvs.c +++ b/doc/examples/extract_mvs.c @@ -22,6 +22,7 @@ */ #include +#include #include static AVFormatContext *fmt_ctx = NULL; @@ -78,7 +79,7 @@ static int open_codec_context(AVFormatContext *fmt_ctx, enum AVMediaType type) int ret; AVStream *st; AVCodecContext *dec_ctx = NULL; - AVCodec *dec = NULL; + const AVCodec *dec = NULL; AVDictionary *opts = NULL; ret = av_find_best_stream(fmt_ctx, type, -1, -1, &dec, 0); @@ -104,7 +105,9 @@ static int open_codec_context(AVFormatContext *fmt_ctx, enum AVMediaType type) /* Init the video decoder */ av_dict_set(&opts, "flags2", "+export_mvs", 0); - if ((ret = avcodec_open2(dec_ctx, dec, &opts)) < 0) { + ret = avcodec_open2(dec_ctx, dec, &opts); + av_dict_free(&opts); + if (ret < 0) { fprintf(stderr, "Failed to open %s codec\n", av_get_media_type_string(type)); return ret; @@ -121,7 +124,7 @@ static int open_codec_context(AVFormatContext *fmt_ctx, enum AVMediaType type) int main(int argc, char **argv) { int ret = 0; - AVPacket pkt = { 0 }; + AVPacket *pkt = NULL; if (argc != 2) { fprintf(stderr, "Usage: %s