Compare commits

..

1 Commits

Author SHA1 Message Date
Michael Niedermayer 38e224c2ba */version.h: bump after release/7.1 branch
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2024-09-24 17:10:35 +02:00
613 changed files with 4403 additions and 8170 deletions
-23
View File
@@ -1,23 +0,0 @@
exclude: ^tests/ref/
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-illegal-windows-names
- id: check-shebang-scripts-are-executable
- id: check-yaml
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: trailing-whitespace
- repo: local
hooks:
- id: aarch64-asm-indent
name: fix aarch64 assembly indentation
files: ^.*/aarch64/.*\.S$
language: script
entry: ./tools/check_arm_indent.sh --apply
pass_filenames: false
-29
View File
@@ -1,29 +0,0 @@
name: Lint
on:
push:
branches:
- release/7.1
pull_request:
jobs:
lint:
name: Pre-Commit
runs-on: utilities
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install pre-commit CI
id: install
run: |
python3 -m venv ~/pre-commit
~/pre-commit/bin/pip install --upgrade pip setuptools
~/pre-commit/bin/pip install pre-commit
echo "envhash=$({ python3 --version && cat .forgejo/pre-commit/config.yaml; } | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
- name: Cache
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ steps.install.outputs.envhash }}
- name: Run pre-commit CI
run: ~/pre-commit/bin/pre-commit run -c .forgejo/pre-commit/config.yaml --show-diff-on-failure --color=always --all-files
-80
View File
@@ -1,80 +0,0 @@
name: Test
on:
push:
branches:
- release/7.1
pull_request:
jobs:
run_fate:
name: Fate (${{ matrix.runner }}, ${{ matrix.shared }}, ${{ matrix.bits }} bit)
strategy:
fail-fast: false
matrix:
runner: [linux-aarch64]
shared: ['static']
bits: ['64']
include:
- runner: linux-amd64
shared: 'static'
bits: '32'
- runner: linux-amd64
shared: 'shared'
bits: '64'
runs-on: ${{ matrix.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: |
./configure --enable-gpl --enable-nonfree --enable-memory-poisoning --assert-level=2 \
$([ "${{ matrix.bits }}" != "32" ] || echo --arch=x86_32 --extra-cflags=-m32 --extra-cxxflags=-m32 --extra-ldflags=-m32) \
$([ "${{ matrix.shared }}" != "shared" ] || echo --enable-shared --disable-static) \
|| CFGRES=$? && CFGRES=$?
cat ffbuild/config.log
exit $CFGRES
- name: Build
run: make -j$(nproc)
- name: Restore Cached Fate-Suite
id: cache
uses: actions/cache/restore@v4
with:
path: fate-suite
key: fate-suite
restore-keys: |
fate-suite-
- name: Sync Fate-Suite
id: fate
run: |
make fate-rsync SAMPLES=$PWD/fate-suite
echo "hash=$(find fate-suite -type f -printf "%P %s %T@\n" | sort | sha256sum | cut -d' ' -f1)" >> $FORGEJO_OUTPUT
- name: Cache Fate-Suite
uses: actions/cache/save@v4
if: ${{ format('fate-suite-{0}', steps.fate.outputs.hash) != steps.cache.outputs.cache-matched-key }}
with:
path: fate-suite
key: fate-suite-${{ steps.fate.outputs.hash }}
- name: Run Fate
run: LD_LIBRARY_PATH="$(printf "%s:" "$PWD"/lib*)$PWD" make fate fate-build SAMPLES=$PWD/fate-suite -j$(nproc)
compile_only:
name: Fate (Win64, Build-Only)
strategy:
fail-fast: false
matrix:
image: ["ghcr.io/btbn/ffmpeg-builds/win64-gpl-7.1:latest"]
runs-on: linux-amd64
container: ${{ matrix.image }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Configure
run: |
./configure --pkg-config-flags="--static" $FFBUILD_TARGET_FLAGS $FF_CONFIGURE \
--cc="$CC" --cxx="$CXX" --ar="$AR" --ranlib="$RANLIB" --nm="$NM" \
--extra-cflags="$FF_CFLAGS" --extra-cxxflags="$FF_CXXFLAGS" \
--extra-libs="$FF_LIBS" --extra-ldflags="$FF_LDFLAGS" --extra-ldexeflags="$FF_LDEXEFLAGS"
- name: Build
run: make -j$(nproc)
- name: Run Fate
run: make -j$(nproc) fate-build
+9 -9
View File
@@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
@@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
@@ -158,7 +158,7 @@ Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
@@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
@@ -267,7 +267,7 @@ Library will still fall under Section 6.)
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
@@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
@@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
@@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
@@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
-808
View File
@@ -1,805 +1,6 @@
Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest.
version 7.1.5:
tests/checkasm/sw_rgb: don't write random data past the end of the buffer
swscale/alphablend: don't overread alpha plane on subsampled odd size
avcodec/vp8: Maintain consistency of frame pointers
avcodec/jpeg2000dec: clear array length when freeing it
av1dec: Don't crash if decoding of some frames have failed
avcodec/tdsc: propagate max_pixels to the JPEG tile decoder
avcodec/imm5: propagate max_pixels to the H264/HEVC sub-decoders
avcodec/cri: propagate max_pixels to the JPEG tile decoder
swscale: Fix out-of-bounds write errors in yuv2rgb_lasx.c file.
update for 7.1.5
avformat/mov: fix crash when stsz_sample_size is zero and sample_sizes is null
avformat/dashdec: Fail with any inner stream count being 0
swscale/x86/rgb_2_rgb: fix uyvytoyuv422 overwrite on odd width
avcodec/snowenc: fix SIGFPE in get_dc() when a block lies outside the plane
avcodec/snowenc: fix out-of-bounds OBMC read in get_dc() for narrow planes
avcodec/snowenc: fix out-of-bounds memcpy in get_block_rd() for narrow planes
avformat/icecast: reject CR/LF in metadata header values
avfilter/avf_showspectrum: Fix allocation check
avformat/sctp: add size check in sctp_read() matching sctp_write()
avcodec/cbs_av1_syntax_template: reset seen_frame_header on sequence headers
avfilter/convolution: compute user matrix products in unsigned
avformat/mpegts: use av_fast_realloc() for prg
avfilter/avf_showcwt: fix DIRECTION_DU EOF fill clearing the wrong rows
avfilter/avf_showcwt: fix DIRECTION_RL EOF fill clearing the wrong columns
avfilter/avf_showcwt: avoid undefined float to int conversion of nb_consumed_samples
avfilter/avf_showcwt: fix out of array read in compute_kernel
avfilter/v360: compute remap table offsets in 64bit
avfilter/v360: reject out-of-range dimensions
swresample/x86/resample: write only int16 in the int16 resampler
avformat/rtpenc_amr: Check input size
swscale/ppc: fix ASAN stack-buffer-overflow in yuv2planeX
swscale/ppc: fix LOAD_FILTER overread in VSX path
avfilter: use ff_slice_pos() for per-slice boundary computation
avfilter: add ff_slice_pos() helper for slice boundaries
avfilter/estdif: avoid signed overflow in slice boundary calculation
avformat/rtspdec: bound Content-Length in the ANNOUNCE handler to SDP_MAX_SIZE
avcodec/cbs_h266_syntax_template: reject subpic info with res_change_in_clvs
avcodec/misc4: Check nb channels
avcodec/rv10, rv34: check init_get_bits8() before RealVideo bit access
avformat/http: reject request-line tokens not terminated by whitespace
avformat/mov: reject out of range ispe dimensions, avoid overflow summing HEIF tile dimensions
avcodec/agm: validate actual src_y against prev plane in decode_inter_plane
fftools/ffmpeg_dec: deep-copy subtitle_header to fix use-after-free
avcodec/hevc/ps: Check window parameters
avcodec/hevc/ps: Factor window reading out
avcodec/truespeech: reject iterations count whose * 240 product overflows 32-bit
libavcodec/options_table: gamma22 and gamma28 aliases
avcodec/on2avc: reject subframe count whose * SUBFRAME_SIZE product overflows 32-bit
avfilter/zmq: initialize send_buf before shared cleanup on parse failure
avcodec/adpcm: fix signed integer overflow in get_nb_samples()
avformat/matroskadec: avoid signed overflow in DASH cue time differences
avcodec/fastaudio: reject subframes count whose * 256 product overflows 32-bit
avcodec/vc2enc_dwt: avoid signed overflow in the 9/7 DWT lifting
avcodec/vc2enc_dwt: avoid signed overflow in the 5/3 and Haar DWT
avcodec/mwsc: do not dereference a missing reference frame
avcodec/misc4: reject invalid sample rate
tools/target_dem_fuzzer: do not exit on io_buffer allocation failure
avformat/gxfenc: Check timecode and propagate error
swscale/rgb2rgb_template: use unsigned for <<24
avformat/iamf_parse: bound substream count by remaining OBU size
avformat/matroskadec: bound TRACKENTRY parsing by max_streams
avcodec/diracdec: fix heap buffer overflow in edge_emu_buffer
avformat/rtmppkt: Check recursion depth
avcodec/jpeglsdec: only apply color transform to decoded rows
avfilter/avf_showcwt: fix out-of-bounds read in du scroll
avcodec/aac/aacdec_usac: reject explicit usacSamplingFrequency of 0
avcodec/aac/aacdec: reject decoded frame without a valid sample rate
avformat/iff: check av_get_packet() result in ANIM branch
avfilter/vf_drawtext: Avoid double free in glyph_enu_border_free()
avfilter/vf_drawtext: plug error-path leaks in measure_text/draw_text
avfilter/vf_drawtext: avoid double-free of aliased FT_Glyph in glyph_enu_free
avfilter/vf_drawtext: don't double-free glyph that has been cached in tree
avfilter/vf_drawtext: always check pixel_mode == FT_PIXEL_MODE_MONO
avcodec/cook: bound subpacket channel sum against channel count
avformat/mxfdec: Remove unneeded check
avformat/ftp: Check string used for RNTO
avformat/ftp: Check for Telnet IAC characters and other non printable ASCII chars
avformat/ftp: reject CR/LF in the URL path to prevent FTP command injection
avcodec/jpeg2000dec: Clear header derived variables
avformat/avc: Adjust get_ue_golomb() to handle 32 bit
avcodec/x86/vorbisdsp: change cmpleps to cmpltps in inverse coupling
avfilter/af_join: fix wrong loop bound in buffer dedup (use-after-free)
avcodec/h264_slice: guard color_frame() against chroma-width underflow
avcodec/magicyuv: reject slice_height misaligned with chroma vshift
avcodec/magicyuv: Expand the s->interlaced slice-height sanity check
avcodec/magicyuv: Fix 1 line MEDIAN slices
avformat/mxfdec: zero-init Sony MPEG-4 extradata and add padding
avformat/soxdec: Check sample_rate for nan
tests/tiny_ssim: fixed mistake in ssim_c1 calculation
avformat/hls: Check TIME-OFFSET value
avformat/hls: Check url_offset and size
avformat/ty: check rec_size
avformat/rtpenc_xiph: bail out when the max payload size underflows
avformat/rtpenc_aac: reject packets smaller than the ADTS header
avcodec/jpeg2000dec: compute mask in decode_clnpass() like in decode_sigpass()
avformat/vividas: fix misaligned access
avcodec/g2meet: The stack is EPIC_PIX_STACK_SIZE
avcodec/h2645_sei: Initialize side data before deallocation
avfilter/boxblur: Fix off by one errors
avformat/assenc: Add the missing parentheses
avcodec/diracdec: Enlarge `mctmp` to cover the worst-case `blheight·ybsep + yblen` rows, and break the MC loop when no output rows remain
tools/zmqsend: free the AVBprint buffer after using it
[Wave] Fix issues with unaligned metadata chunks.
avcodec/hevc: limit missing-ref fill to coded planes
avformat/mov: Fix negative index given to can_seek_to_key_sample()
avcodec/hdrdec: fix pixel count decrement in RLE decompress loop
(fforge/pr/21328) avcodec/cbs_h266_syntax_template: Fix pps_exp_slice_height_in_ctus_minus1 range
lavc/vvc: Stricter bound on pps_exp_slice_height_in_ctus_minus1
avcodec/cbs_h266_syntax_template: tighten sh_num_tiles_in_slice_minus1 upper bound
lavc/vvc: Use second definition of MinQtLog2SizeIntraC if relevant
avcodec/cbs_h266: fix wrong condition for chroma MTT depth in PH
lavc/vvc: Fix unchecked error codes from add_reconstructed_area
lavc/vvc: Fix unchecked error codes from set_qp_y
lavc/vvc: Error on inter slice with no reference pics
lavc/vvc: Mark SPS used if multiple CLVSSs use it
lavc/vvc: Fix divide-by-zero in LMCS param derivation
lavc/vvc: Detect subpic overlaps at CTU level
lavc/vvc: Fix pps_single_slice_picture
lavc/vvc: Ensure subpictures don't overlap
lavc/vvc: Fix slice map construction for small subpics
lavc/vvc: Fix derivation of inverse LMCS idx
lavc/vvc: Set fc->ref to NULL at top of decode_nal_units
lavc/vvcdec: ensure slices contain nonzero CTUs
avcodec/vvc: Add support for output_corrupt/showall flags
lavc/vvc: Check slice structure
avcodec/vvc decode: ALF filtering without CC-ALF
avcodec/cbs_h266: Fix typo
avcodec/vvcdec: return error if CTU size > 128
avcodec/cbs_h266: stricter validation for subpicture's max width and height
avcodec/cbs_h266: improve readability in subpicture parser
avcodec/vvcdec: schedule next stage only if the current stage reports no error
avcodec/vvcdec: inter_data, check the return value from hls_merge_data
avcodec/vvcdec: ensure every CTU belongs to a slice
lavc/vvc_refs: Define VVC_FRAME_FLAG* to h header
avcodec/vvc/thread: Check frame to be non NULL
avcodec/vvc: Don't use large array on stack
(fforge/pr/23305) avformat/mov: don't abort on unsupported or invalid chnl boxes
avformat/mov_chan: keep the layout untouched on chan/chnl box failure
(fforge/pr/23242) avformat/oggparsevorbis.c: Prevent integer overflow when summing header lengths; add bounds check.
(fforge/pr/23189) avformat/oggparsecelt: bound extra_headers to avoid an effectively infinite loop
(fforge/pr/23113) avformat/demux: use correct close function for custom io
avformat/hlsenc: use correct close function for custom io
avformat/hlsenc: respect io_open set in AVFormatContext
avformat/dashenc: respect io_open set in AVFormatContext
avformat/dashdec: respect io_open set in AVFormatContext
version 7.1.4:
avcodec/dfpwmdec: Check nb_samples
avcodec/alsdec: do not set nbits invalidly
swscale/swscale_unscaled: adjust last line copy
avformat/avidec: check LIST size in avi_load_index()
avformat/avidec: validate INFO list size before parsing
avformat/matroskadec: Check audio.sub_packet_h * audio.frame_size
libavformat/xwma: fix overflow in seek position
avformat/pcm: Use 64bit for byte_rate
avcodec/hevc/ps: validate rep_format dimensions in multi-layer SPS
avfilter/vf_kerndeint: Check for minimum height
avcodec/ralf: Add the missing return statement after the error log
avfilter/vf_codecview: Clamp block to the visible frame region
avcodec/zmbv: reject XOR data that overruns the decompression buffer
avcodec/rasc: fix heap use-after-free in decode_move()
avformat/rtpdec_mpeg4: reject zero-length AU header sections
avcodec/hevc/refs: Check multiplication in alloc_frame()
fftools/ffmpeg_opt: validate stream index in negative map handling
avformat/rtmpproto: prevent integer overflow accumulating FLV buffer size
avformat/rtmpproto: validate compressed SWF header length
avformat/rtsp: Fix out-of-bounds read in SDP parser when control_url is empty
avformat/rtpdec_latm: avoid integer overflow in LATM length parsing
avcodec/h264: recompute per-slice direct mode state for every slice
avcodec/h264_refs: Clear stale pointers from ref_list
avcodec/pdvdec: Check input space before buffer allocation
avformat/concat: guard total_size overflow
avformat/iamf_parse.c: Fix potential integer overflow in opus_decoder_config()
avcodec/wmaenc: Fix missing padding in extradata
avformat: Fix various extradata padding issues
avcodec/tdsc: remove double stride adjustment
avformat/cafdec: fix negative index use in read_seek
avcodec/notchlc: Check 255 loops
avformat/rtpdec_jpeg: check qtable_len
avformat/vividas: use-of-uninitialized-value in keybuffer
avcodec/tdsc: Check jpeg size
avcodec/tdsc: Better input size check
avcodec/tdsc: Check tile_size
avcodec/decode: Better documentation for ff_set_dimensions()
avformat/mov: Limit maximum box size for mov_read_lhvc()
avformat/mov: reject dimg references with zero entries
avformat/mov: check extradata in mov_read_dops()
avformat/mov: Check read size for opus extradata
avformat/rtspdec: reject non-positive ANNOUNCE Content-Length
avformat/wavdec: Fix use-of-uninitialized-value in find_guid()
lavfi: vf_drawtext: check memory allocation
avcodec/svq1dec: Check input space for minimum
avcodec/vp9: Rollback dimensions when format is rejected
avformat/rtpdec_qdm2: Check block_size
avfilter/vf_ssim360: fix integer overflow in tape_length allocation
avcodec/escape130: Initialize old_y_avg
avutil/samplefmt: Dont claim that av_get_sample_fmt_string checks sample_fmt
avformat: check avio_read() return values in dss/dtshd/mlv
avcodec/aac/aacdec_usac: Implement missing bits of otts_bands_phase and residual_bands computation
avcodec/alsdec: preserve full float value in zero-truncated samples
avcodec/alsdec: propagate read_diff_float_data() errors in read_frame_data()
avcodec/alsdec: fix mantissa unpacking in compressed Part A path
avfilter/vf_drawtext: fix newline rendered as .notdef glyph
libavfilter/vf_v360: fix operator precedence in stereo loop condition
avcodec/alsdec: fix abs(INT_MIN) UB in read_diff_float_data()
avformat/rsd: reject short ADPCM_THP extradata reads
avformat/mov: Handle integer overflow in MOV parser
avcodec/dvdsub_parser: Fix buf_size check
avfilter/af_pan: fix sscanf() return value checks in parse_channel_name
avutil/bswap: fix implicit conversion warning in av_bswap64
avcodec/h2645_sei: don't use provider_code uninitialized
avformat/mpegts: fix descriptor accounting across multiple IOD descriptors
avcodec/xxan: zero-initialize y_buffer
avcodec/exr: Check input space before reverse_lut()
avcodec/cbs_h266_syntax_template: Check tile_y
avcodec/h264_slice: reject slice_num >= 0xFFFF
lavfi/bwdif: fix heap-buffer-overflow with small height videos
avcodec/cbs_h266_syntax_template: Fix w/h typo
aacdec_usac: skip FD-specific decoding for LPD channels
avutil/timecode: Check for integer overflow in av_timecode_init_from_components()
avcodec/cbs_h266_syntax_template: Fix rows vs columns
avformat/mov: do not allocate out-of-range buffers
avfilter/af_lv2: call lilv_instance_activate before lilv_instance_run
avformat/rtmpproto: fix listen_timeout conversion for special negative values
avcodec/aom_film_grain: Remove impossible check
avcodec/aom_film_grain: avoid duplicate indexes in ff_aom_parse_film_grain_sets()
swscale/output: fix integer overflows in chroma in yuv2rgba64_X_c_template()
avcodec/lcldec: Fixes uqvq overflow
fftools/ffmpeg_demux: Check metadata provided filename
avcodec/av1dec: sync frame header and tile group behavior with CBS
avformat/mlvdec: avoid uninitialized read in read_string()
avcodec/magicyuv: fix small median images
swscale/output: Fix integer overflow in alpha in yuv2rgba64_1_c_template()
swscale/utils: Check *Inc
avfilter/vf_scale: Fix integer overflow in config_props()
swscale/output: Fixes integer overflow in yuv2planeX_8_c
swscale/utils: initialize chroma when luma switched to cascade
avcodec/utils: fix duration computation based on frame_bytes
avcodec/cbs_h266_syntax_template: bound slice width/height by remaining tiles
avformat/rtsp: Pass blacklist
avformat/rtsp: Explicitly check protocol
avfilter/vf_convolution: Use avpriv_mirror
avfilter/vf_convolution: Handle corner cases with small frames
avcodec/pnmdec: Check input size against width*height assuming at least 1bit per pixel
avformat/mov: Fix multiple issues related to mov_read_iref_dimg()
avcodec/snowenc: avoid NULL ptr arithmetic
avformat/mov: use 64bit in CENC subsample bounds checks
avutil/eval: Check depth of AVExpr
avformat/vividas: Reset n_audio_subpackets on error
avformat/matroskadec: Check that end_time_ns >= start_time_ns
avcodec/vp3: Sanity check cropping
avformat/dhav: Check avio_seek() return
avformat/segafilm: dont read uninitialized value
avcodec/mpegvideo_enc: Restructure ff_h263_encode_gob_header() relation to update_mb_info()
avcodec/exr: check tile_attr.x/ySize
avformat/demux: Fix integer overflows in select_from_pts_buffer()
avcodec/golomb: Fix get_ur_golomb_jpegls() with esclen = 0
swresample/resample_template: add casts to avoid undefined overflows
avcodec/h264_parser: Check pts for overflow
avformat/rtpenc: use unsigned type for ssrc option
avformat/wtvdec: Check that language is fully read
avcodec/imm5: Dont pass EAGAIN on as is
avcodec/interplayacm: Check input for fill_block()
avcodec/hdrdec: Check input size before buffer allocation
avcodec/tmv: Move space check before buffer allocation
avcodec/flashsv: Check for input space before (re)allocating frame
avcodec/mdec: Check input space vs minimal block size
avcodec/h264_parser: Check remaining input length in loop in scan_mmco_reset()
avcodec/exr: fix AVERROR typo
avcodec/jpeg2000htdec: Check Lcup and Lref
avcodec/cfhd: Check transform type before continuing
avcodec/cfhd: Add CFHDSegment enum and named identifiers
avcodec/hevc/ps: Check bit_depth_cm in/out relation
avformat/icodec: Check size
avformat/lrcdec: Check ss for finiteness
avformat/http: Also count redirects from the cache
avformat/http: allow adjusting the redirect limit
fftools/ffmpeg_opt: limit recursion of presets
swscale/rgb2rgb_template: fix signed shift into sign bit
swresample: Check ch layouts in swr_alloc_set_opts2()
swresample: Check user chlayout in swr_set_matrix()
avcodec/bmp: fix indention
avcodec/exr: Handle axmax like bxmin in 04d7a6d3db56ea1a93908ff2d3d312e3fc40a58c
avformat/flvdec: Check *size in cts parsing
avformat/cafdec: Check nb_entries in read_info_chunk()
avcodec/vp9: Reallocate on resolution change which does not change tile_cols
avformat/img2dec: Check avio_size() for failure
avformat/mpegtsenc: Check remaining space in SDT
avformat/img2enc: Check split planes packet size
avformat/yuv4mpegen: Sanity check input packet frame dimensions
avformat/iff: Error out with 0 channel loudspeaker configuration
Fix overflow in STSD parser
avcodec/adpcm: Check input buffer size
avformat/scd: Use ffio_read_size()
avcodec/hevc/sei: Use get_bits64() in decode_nal_sei_3d_reference_displays_info()
avformat/hls: Check for integer overflow with #EXTINF:
avcodec/dca_xll: Clear padding in ff_dca_xll_parse()
vfilter/vf_find_rect: Clamp x/y min/max to valid values
avcodec/lzf: Remove size messing from ff_lzf_uncompress()
avcodec/dxv: Clear tex_data padding on reallocation
avcodec/dca_xll: Check get_rice_array()
avutil/dovi_meta: Document valid range for index of av_dovi_get_ext()
avformat/mpegts: Check program_info_length
avformat/mpegts: Check IOD_DESCRIPTOR len
avcodec/qdm2: fix heap-use-after-free in qdm2_decode_frame
avcodec/jpeg2000dec: Print bpno level when erroring out
avcodec/jpeg2000dec: allow M_b == 31
avcodec/jpeg2000dec: Print M_b value when asking for a sample
avformat/dashdec: check value valid after read value from mpd xml
swscale/utils: zero init filter memory as before
libavfilter/showcwt: fix OOB write for DU/RL position init
lavc/j2kdec: Do not ignore colour association for packed formats
swscale/utils: Sanity check sizeFactor
swscale/utils: Avoid FF_ALLOC_TYPED_ARRAY() and use av_malloc_array() directly
avcodec/mjpegdec: fix segfault on extern_huff and no extradata
avcodec/exr: use av_realloc_array()
avcodec/omx: Check extradata size and nFilledLen
lavc/aacdec_usac: fix CPE channel index in ff_aac_usac_reset_state()
avfilter/scale_eval: Use 64bit for factor_w/h
avfilter/scale_eval: Avoid undefined behavior with double to int cast
avformat/http: Check that the protocol of redirects is http or https
doc/mailing-list-faq.texi: Fix typo in link anchor
avfilter/vf_find_rect: Fix handling odd sized images
avcodec/notchlc: zero-initialize history buffer
avfilter/vf_stack: add checks for the final canvas dimensions
lavc/vvc: Prevent OOB write to slice_top_left_ctu_x in PPS CBS
avcodec/mjpegdec: only test the size bound in sequential mjpeg
avcodec/jpeg2000htdec: Check pLSB
avformat/hls: fix double space
avformat/hls: Check seg size and offset for overflow
avcodec/jpeg2000dec: Make M_b check broader
swscale/output: Use 64bit in addition in yuv2gbrp16_full_X_c() for RGB + Y
avformat/flac_picture: Correct check
avformat/demux: ensure avformat_find_stream_info updates internal stream contexts
avfilter/vf_neighbor_opencl: add error condition when filter name doesn't match
avfilter/vf_libopencv: make sure there is space for null-terminator in shape_str
avcodec/aacdec: Fix heap-use-after-free in USAC decoding
avdevice/gdigrab: suppress int to pointer cast warning
avutil/hwcontext_d3d12va: use hwdev context for logging
fate: add missing options in config template
avformat/hls_sample_encryption: add missing padding for audio setup buffer
(fforge/pr/22824) lavc/videotoolbox_vp9: fix vpcC flags offset
lavc/videotoolboxenc: return SEI parse errors
(fforge/pr/22407) aarch64/hpeldsp_neon: fix out-of-bounds read
(fforge/pr/22406, fforge/pr/22313) avformat/mov: fix cases where we discard iamf packets from enabled streams
avformat/mov: fix setting iamf stream id offsets
(fforge/pr/21698) avcodec/tableprint_vlc: Unbreak hardcoded tables
tests: Fix fate-run.sh to handle busybox-w32 absolute paths
configure: Recognize uname "Windows_NT" as using an .exe suffix
avformat/tests/movenc: Make objects static
(fforge/pr/21626) avcodec/libsvtav1: rename aq_mode for v4.0.0
(fforge/pr/21563) avformat/mov: add an offset to IAMF streams
(fforge/pr/21443) avfilter/vf_lcevc: attach a reference to the source frame to each passed in base picture
avfilter/vf_lcevc: support LCEVCdec version 4
avcodec/lcevc: attach a reference to the source frame to each passed in base picture
avcodec/lcevcdec: free pictures on error
avcodec/lcevcdec: fix input dimensions for the base picture
avcodec/lcevcdec: avoid copying the input frame
avcodec/decode: Optimize lcevc away if disabled
avcodec/decode: Put lcevc fields into structure of their own
avcodec/decode: Don't allocate LCEVC context for non-video
avcodec/lcevcdec: support LCEVCdec version 4
forgejo: backport CI job names
(fforge/pr/21337) avformat/img2dec: reject input images too big to fit into a single packet
(fforge/pr/21331) avformat/iamf_writer: check that stream count is consistent for ambisonic Audio Elements
avformat/iamf_writer: fix writting some ambisonics fields in Audio Elements
avformat/iamf_parse: fix setting denominator in AVIAMFLayer.demixing_matrix
(fforge/pr/21219) fate/ffmpeg: remove comparison against ref from fix_sub_duration_heartbeat
(fforge/pr/21146) configure: Lower libdvdnav and libdvdread minimum versions for EL9
(fforge/pr/20943) avformat/rtsp: fix leading space in RTSP reason
avformat/rtsp: do not log invalid values
avformat/http: Handle IPv6 Zone ID in hostname
avfilter/af_amerge: fix possible crash with custom layouts
avfilter/stack_internal: fix checkheaders test
all: apply linter fixes
forgejo: apply needed CI changes for 7.1
forgejo: backport CI to release/7.1
(fforge/pr/21089) avcodec/vp3: Sync VLCs once during init, fix crash
configure: unbreak glslang build
avformat/iamf_parse: fix compilation error
avfilter/vf_scale: don't attempt to rescale AV_NOPTS_VALUE
avfilter/framesync: don't attempt to rescale AV_NOPTS_VALUE
avformat/iamf_parse: ensure the stream count in a scalable channel representation is equal to the audio element's stream count
avformat/iamf_parse: ensure each layout in an scalable channel representation has an increasing number of channels
fftools/ffmpeg_filter: close all no-longer needed inputs
avfilter/buffersrc: add av_buffersrc_get_status()
version 7.1.3:
avutil/common: cast GET_BYTE/GET_16BIT returned value
avfilter/vf_drawtext: fix call GET_UTF8 with invalid argument
avfilter/vf_drawtext: fix incorrect text length
avformat/avformat: also clear FFFormatContext packet queue when closing a muxer
avfilter/vf_drawtext: Account for bbox text seperator
avcodec/mediacodecdec_common: Check that the input to mediacodec_wrap_sw_audio_buffer() contains channel * sample_size
avcodec/utvideodec: Set B for the width= 1 case in restore_median_planar_il()
avcodec/osq: Fix 32bit sample overflow
avformat/rtpdec_rfc4175: Only change PayloadContext on success
avformat/rtpdec_rfc4175: Check dimensions
avformat/rtpdec_rfc4175: Fix memleak of sampling
avformat/http: Fix off by 1 error
avcodec/exr: spelling
avcodec/exr: use tile dimensions in pxr24 UINT case
avcodec/exr: Simple check for available channels
avformat/sctp: Check size in sctp_write()
avformat/rtmpproto: consider command line argument lengths
avformat/rtmpproto_ Check tcurl and flashver length
avcodec/g723_1enc: Make min_err 64bit
avcodec/vlc: Clear val8/16 in vlc_multi_gen() by av_mallocz()
avformat/rtpenc_h264_hevc: Check space for nal_length_size in ff_rtp_send_h264_hevc()
swscale/output: Fix integer overflow in yuv2ya16_X_c_template()
avcodec/hevc/sei: prevent storing a potentially bogus num_ref_displays value in HEVCSEITDRDI
avcodec/exr: Check that DWA has 3 channels
avcodec/exr: check ac_size
avcodec/exr: Round dc_w/h up
avcodec/mjpegdec: Explain buf_size/width/height check
avformat/aviobuf: Keep checksum_ptr consistent in avio_seek()
fftools/ffmpeg_sched: prevent demuxers from getting stuck
lavc/aarch64: Fix addp overflow in ff_pred16x16_plane_neon_10
avcodec/mlpdec: don't depend on context channel layout when setting substream masks
avformat/demux: pass new extradata to the parser
avcodec/svq1enc: restrict Altivec acceleration to big-endian POWER configurations
libavutil/arm: Rename the HWCAP defines
libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
avcodec/decode: sync initial_pict_type and intra_only_flag with thread worker's avctx
avcodec/x86/pngdsp: add missing emms at the end of add_png_paeth_prediction
version 7.1.2:
doc/examples/vaapi_encode: fix invalid check on fwrite
avcodec/librsvgdec: fix compilation with librsvg 2.50.3
fftools/ffmpeg: fix gracefully shutdown
fftools/ffmpeg_demux: ensure the display_rotation option is honored
avcodec/mjpegdec: use ff_frame_new_side_data() to export display matrix
aacdec_usac: use RefStruct to track unfinished extension buffers
avcode: Use av_fast_realloc() in ff_lzf_uncompress()
avcodec/dxv: Check coded_height, to avoid invalid av_clip()
avcodec/aac/aacdec: dont allow ff_aac_output_configure() allocating a new frame if it has no frame
avformat/lrcdec: Fix fate-sub-lrc-ms-remux on x86-32
avcodec/sanm: Check w,h,left,top
avcodec/utvideodec: Clear plane_start array
fftools/ffmpeg_mux_init: Use 64bit for score computation in map_auto_video()
libavfilter/dnn/dnn_backend_tf: Remove redundant av_freep() to avoid double free
avcodec/dxv: Use av_fast_realloc() for op_data
avcodec/dxv: Use av_fast_realloc() and clear all new space
avcodec/dxv: Clear ctex
avcodec/dxv: Check that we initialize op_data
avcodec/exr: Check for pixel type consistency in DWA
avcodec/d3d12va_encode: fix label followed by a declaration warning
avcodec/libvorbisdec: avoid overflow when assinging sample rate from long to int
avcodec/g726: init missing sample rate
avformat/lrcdec: limit input timestamp range to avoid overflows
avcodec/scpr3: Clear clr
avcodec/ilbcdec: Clear cbvec when used with create_augmented_vector()
avcodec/jpeg2000dec: Make sure the 4 extra bytes allocated are initialized
avfilter/avf_showcqt: fix unbounded index when copying to fft_data
avcodec/aac/aacdec_usac: Limit sfo from noise offset to be above -200
avcodec/aacsbr_template: Check ilb
avcodec/utvideodec: Set B for the width= 1 case
avcodec/ffv1: Clear state on alloc
avcodec/jpeg2000dec: implement cdef remapping during pixel format matching
avcodec/jpeg2000dec: move cdef default check into get_siz()
avcodec/exr: Check rle_raw_data and surroundings
avcodec/exr: Dont access outside xsize/ysize
examples: Add check and replace av_free() to avoid potential memory errors
libavcodec/tests/snowenc: Add av_free() to avoid memory leak
libavfilter/af_firequalizer: Add check for av_malloc_array()
libavcodec/videotoolbox_vp9: Move av_malloc() to avoid memory leak
avcodec/mpc8: init avctx->sample_rate
avcodec/cbs_h266_syntax_template: fix out of bounds access
avformat/libopenmpt: fix seeking weirdness
avformat/hls: add cmfv/cmfa exceptions
avformat/lrcdec: support arbitrary precision timestamp
libavcodec/tests/motion: Add check for avcodec_alloc_context3()
avcodec/tests/avpacket: Add av_free() to avoid memory leak
examples: Add av_freep to avoid potential memory leak
avcodec/tests/avpacket: Add av_packet_free() to avoid memory leak
avcodec/fits: Clear naxis
avcodec/vqavideo; Check bytestream2_get_buffer() reading next_codebook_buffer
avcodec/lzf: Check for input space
avcodec/imc: Clear padding of buf16
avcodec/iff: Clear ham_buf
avcodec/cri: Check bytestream2_get_buffer() for end
avcodec/cri: Factor read_len out
avformat/dashdec: Allocate space for appended "/"
avcodec/mpegvideo_dec: Fix lowres=3 field select interlaced mpeg4 frame
avformat/mxg: clear AV_INPUT_BUFFER_PADDING_SIZE
avcodec/shorten: Clear the additionally allocated space on realloc
avformat/vqf: Ensure that comm_chunk is fully read
avformat/mov: make sure file_checksum is fully initialized
avcodec/hevc/hevcdec: Clean sao_pixel_buffer_v on allocation
avformat/asfdec_f: Check amount of value read
avcodec/jpegxl_parser: add sanity check for frame size
avcodec/ffv1dec: don't check chroma_planes for f->colorspace > 0
avcodec/ffv1dec: don't add offsets to more NULL pointers
avformat/concatdec: Clip duration in one more case in get_best_effort_duration()
avcodec/ffv1dec: Check k in get_vlc_symbol()
avcodec/cfhd: Check idwt_buf size before allocation
avcodec/ivi: Check luma/chroma mb_size
avfilter/vaf_spectrumsynth: don't use uninitialized variable as scale
avcodec/motion_est: don't add offsets to NULL pointers
swscale/swscale_unscaled: don't add offsets to NULL pointers
avcodec/ffv1dec: don't add offsets to NULL pointers
libavcodec/alsdec.c: Add check for av_malloc_array() and av_calloc()
avcodec/psd: Move frame allocation after RLE processing
avcodec/smacker: Move buffer allocation to later
fftools/cmdutils: don't try to load arguments from file if not needed
avcodec/opus: don't materialize buf pointer from null
avfilter/avfilter: fix forwarding EOF for simple API filters in filter_activate_default
avcodec/speexdec: consider differing frame sizes in remaining space check
lavc/vvc: Fix condition for using default scaling factor
avformat/mov: Check that sample_count is allocated in mov_parse_heif_items()
avformat/iff: Check nb_channels == 0 in CHNL
avcodec/osq: Request a coding mode 2 sample
avcodec/osq: Switch back to av_ceil_log2()
avcodec/osq: Add note about update_stats() count
avcodec/osq: Fix signed integer overflow in update_stats()
avcodec/mss2dsp: use FF_PTR_ADD to add offsets to a pointer
avformat/movenc: fix writing reserved bits in EC3SpecificBox
avcodec/hevc/hevcdec: Check num_entry_point_offsets
avcodec/speexdec: Pass and check remaining packets to decode functions
swscale/swscale_unscaled: use 8 line alignment for planarCopyWrapper with dithering
aacenc_tns: clamp filter direction energy measurement
fftools/ffmpeg_demux: don't flag timestamps as unreliable if they are generated
avformat/iamf_parse: prevent overreads in update_extradata
avformat/iamf_parse: increase PutBytes buffer when writing AAC extradata
avformat/matroskadec: check that channels fit in signed 32bit int
avcodec/takdec: Check remaining space for first predictors
avcodec/svq3: Check there are bits left before decompression
avcodec/sonic: Check num_taps
avformat/imf_cpl: fix indention after previous commit
avformat/imf_cpl: do not continue looping forever
avformat/mov: reject negative ELST durations
avformat/avidec: Ignore duplicate GAB2
MAINTAINERS: Add entry for samples-request
avcodec/h264_mb: Fix tmp_cr for arm
avcodec/vorbisdec: Dont treat overread as error
avcodec/hevc/ps: Fix dependant layer id check
avformat/iff: Check nb_channels == 0 in MHDR
tests/fate/filter-video: Fix dependancy for codecview
postproc/postprocess_template: fix dering with a 16x16 image
libpostproc: check minimum size
avformat/hls: Fix flash1.bogulus.cfd support
avformat/hls: Split allowed_segment_extensions off allowed_extensions
avformat/hls: Fix Youtube AAC
avformat/hls: add fmp4 to allowed_extensions
avformat/hls: Add ec3 to allowed_extensions
avformat/hls: Add cmfv and cmfa to allowed_extensions
postproc/postprocess_template: fix handling of first row of dering_C
postproc/postprocess_template: Fix reading uninitialized pixels in dering_C()
configure: Clearer documentation for "disable-safe-bitstream-reader"
avcodec/osq: avoid undefined negation
swscale/output: Fix integer overflow in yuv2gbrp_full_X_c()
avcodec/libtheora: fix setting keyframe_mask
doc: replace http/git by https urls
Revert "avformat/mpegts: update stream info when PMT ES stream_type changes"
avformat/matroska: Support JPEG2000 for demuxing
avformat/matroskadec: Fix VfW extradata size
configure: Use MSYSTEM_CARCH for default arch on msys2
avcodec/lcevcdec: don't try to write to output frames directly
avfilter/avfiltergraph: fix regression in picking channel layout
avformat/mpegts: update stream info when PMT ES stream_type changes
avcodec/libzvbi-teletextdec: change new lines to \n in ASS header
avformat/wavdec: increase requested probe score for codec probe
avcodec/h264_slice: insert LCEVC side data before get_buffer() call
avformat/hls: Fix get key file error
avcodec/bsf/h264_mp4toannexb: Fix mixed bitstream format
avformat/mov: Reduce seek when interleaved_read is disabled
avfilter/vf_setparams: Fix chroma_location being cleared
configure: Enable -fno-common for Darwin targets, avoid linker warnings
configure: Only try to use the -no_warn_duplicate_libraries flag on Darwin
configure: Silence Xcode warnings about duplicate libraries
avcodec/mediacodecdec_common: Workaround MTK broken crop implementation
avcodec/Makefile: include aom_film_grain.o file for h264_sei component
lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang v2
lsws/ppc/yuv2rgb_altivec: Fix build in non-VSX environments with Clang
avcodec/libsvtav1: unbreak build with latest svtav1
fftools/ffmpeg_filter: also remove display matrix side data from buffered frames
version 7.1.1:
avformat/hls: Partially revert "reduce default max reload to 3"
avformat/mov: (v4) fix get_eia608_packet
avformat/iff: Check that we have a stream in read_dst_frame()
avcodec/aac/aacdec_lpd: Limit get_unary()
avcodec/aac/aacdec_usac: Simplify decode_usac_scale_factors()
avcodec/aac/aacdec: Clear SFO on error
avformat/mlvdec: fix size checks
avformat/wavdec: Fix overflow of intermediate in block_align check
avformat/mxfdec: Check edit unit for overflow in mxf_set_current_edit_unit()
avformat/hls: Fix twitter
avcodec/vvc/refs: fix negative pps_scaling_win offsets
libavformat/hls: Be more restrictive on mpegts extensions
avformat/hls: .ts is always ok even if its a mov/mp4
avcodec/h263dec: Check against previous dimensions instead of coded
avformat/hls: Print input format in error message
avformat/hls: Be more picky on extensions
avformat/iamf_parse: ensure there's at most one of each parameter types in audio elements
avformat/iamf_parse: add missing constrains for num_parameters in audio_element_oub()
avformat/iamf_parse: add missing av_free() call on failure path
lavc/hevcdec: unbreak WPP/progress2 code
fate: Add a dependency on ffprobe for fate-flcl1905
checkasm: aacencdsp: Actually test nonzero values in quant_bands
x86: aacencdsp: Fix negating signed values in aac_quantize_bands
rtmpproto: Avoid rare crashes in the fail: codepath in rtmp_open
configure: Improve the check for the rsync --contimeout option
avutil/downmix_info: add missing semicolon
doc/t2h: Support texinfo 7.1 and 7.2 pretest
avfilter/drawtext: fix memory leak when using "reinit" runtime command
avutil/downmix_info: zero the allocated buffer
avformat/mov: fix overflow in drift timestamp calculation
Changelog: update
avformat/mxfdec: Check avio_read() success in mxf_decrypt_triplet()
avcodec/huffyuvdec: Initialize whole output for decode_gray_bitstream()
avformat/iamf_reader: Initialize padding and check read in ff_iamf_read_packet()
avformat/ipmovie: Check signature_buffer read
avformat/wtvdec: Initialize buf
avcodec/cbs_vp9: Initialize VP9RawSuperframeIndex
avformat/vqf: Propagate errors from add_metadata()
avformat/vqf: Check avio_read() in add_metadata()
avcodec/ffv1enc: Fix RCT for GBR colorspace
avformat/dashdec: Check whitelist
avutil/avstring: dont mess with NULL pointers in av_match_list()
avfilter/vf_v360: Fix NULL pointer use
avcodec/mpegvideo_enc: Check FLV1 resolution limits
avcodec/ffv1enc: Fix handling of 32bit unsigned symbols
avformat/mov: perform sanity checks for heif before index building
avformat/mov: Factorize sanity check out
avcodec/vc1dec: Clear block_index in vc1_decode_reset()
avcodec/aacsbr_template: Clear n_q on error
avformat/iamf_parse: Check output_channel_count
avcodec/osq: Fixes several undefined overflows in do_decode()
swscale/output: Fix undefined overflow in yuv2rgba64_full_X_c_template()
avfilter/af_pan: Fix sscanf() use
avfilter/vf_grayworld: Use the correct pointer for av_log()
avfilter/vf_addroi: Add missing NULL termination to addroi_var_names[]()
avcodec/get_buffer: Use av_buffer_mallocz() for audio same as its done for video
avformat/jpegxl_anim_dec: clear buffer padding
avformat/rmdec: check that buf if completely filled
avcodec/cfhdenc: Clear dwt_tmp
avcodec/hapdec: Clear tex buffer
avformat/mxfdec: Check that key was read sucessfull
avformat/hevc: fix writing hvcC when no arrays are provided in hvcC-formatted input
avformat/rtpdec: int overflow in start_time_realtime
avcodec/decode: Fix incorrect enum type used in side_data_map()
avformat/mov: fix crash when trying to get a fragment time for a non-existing fragment
avformat/libssh: fix credential variables typo
avformat/hlsenc: check return value of avcodec_parameters_copy()
avformat/dashdec: format open_demux_for_component()
avformat/dashdec: check return code of avcodec_parameters_copy()
avformat/dashdec: return ret directly in open_demux_for_component()
avformat/smoothstreamingenc: check return value of avcodec_parameters_copy()
avcodec/cbs_av1: fix variable shadowing in cbs_av1_split_fragment()
doc/demuxers/dvdvideo: seeking is supported, remove outdated statement
avformat/dvdvideodec: check return code of ff_dvdclut_yuv_to_rgb()
avformat/dvdvideodec: fix missing last chapter marker due to off-by-one
avformat/dvdvideodec: don't allow seeking beyond dvdnav reported duration
avformat/dvdvideodec: discard duplicate or partial AC3 samples
avformat/dvdvideodec: drop packets with unset PTS or DTS
avformat/dvdvideodec: remove unnecessary need_parsing argument
avformat/dvdvideodec: open subdemuxer after initializing IFO headers
avformat/dvdvideodec: remove auto value for menu_lu option
avformat/dvdvideodec: default menu_vts option to 1 and clarify description
avformat/dvdvideodec: check the length of a NAV packet when reading titles
avformat/dvdvideodec: reset the subdemuxer on discontinuity instead of flushing
avformat/dvdvideodec: simplify dvdvideo_read_packet()
avformat/dvdvideodec: enable chapter calculation for menus
avformat/dvdvideodec: standardize the NAV packet event signal
avformat/dvdvideodec: move memcpy below missed NAV packet warning
avformat/dvdvideodec: remove "auto" value for -pg option, default to 1
avformat/dvdvideodec: measure duration of the current menu VOBU in state
avformat/dvdvideodec: fix menu PGC number off-by-one in state
avformat/dvdvideodec: remove unused headers
lavc/aarch64: Fix ff_pred16x16_plane_neon_10
lavc/aarch64: Fix ff_pred8x8_plane_neon_10
aarch64/vvc: Fix clip in alf
vp9: recon: Use emulated edge to prevent buffer overflows
arm: vp9mc: Load only 12 pixels in the 4 pixel wide horizontal filter
aarch64: vp9mc: Load only 12 pixels in the 4 pixel wide horizontal filter
avformat/rpl: Fix check for negative values
avformat/mlvdec: Check avio_read()
avcodec/aac/aacdec: Free channel layout
avformat/mov: dereference pointer after null check
avcodec/utils: Fix block align overflow for ADPCM_IMA_WAV
avformat/matroskadec: Check pre_ns for overflow
tools/target_dec_fuzzer: Adjust threshold for EACMV
tools/target_dec_fuzzer: Adjust threshold for MVC1
tools/target_dec_fuzzer: Adjust Threshold for indeo5
avutil/timecode: Avoid fps overflow in av_timecode_get_smpte_from_framenum()
avcodec/aac/aacdec_usac: Dont leave type at a invalid value
avcodec/aac/aacdec_usac: Clean ics2->max_sfb when first SCE fails
avcodec/webp: Check ref_x/y
avcodec/ilbcdec: Initialize tempbuff2
swscale/swscale_unscaled: Fix odd height with nv24_to_yuv420p_chroma()
avcodec/hevc/hevcdec: initialize qp_y_tab
avformat/qcp: Check for read failure in header
avcodec/eatgq: Check bytestream2_get_buffer() for failure
avformat/dxa: check bpc
swscale/slice: clear allocated memory in alloc_lines()
avcodec/h2645_parse: Ignore NAL with nuh_layer_id == 63
MAINTAINERS: Lauri is still available but is really low on time nowadays
MAINTAINERS: Remove Guillaume Poirier and Romain Dolbeau
avcodec/mjpegdec: Disallow progressive bayer images
avformat/icodec: fix integer overflow with nb_pal
doc/developer: Document relationship between git accounts and MAINTAINERS
doc/infra: Document trac backup system
doc/infra: Document gitolite
avformat/vividas: Check avio_read() for failure
avformat/ilbc: Check avio_read() for failure
avformat/nistspheredec: Clear buffer
avformat/mccdec: Initialize and check rate.den
avformat/rpl: check channels
INSTALL: explain the circular dependency issue and solution
avformat/mpegts: Initialize predefined_SLConfigDescriptor_seen
avformat/mxfdec: Fix overflow in midpoint computation
swscale/output: used unsigned for bit accumulation
swscale/rgb2rgb_template: Fix ff_rgb24toyv12_c() with odd height
avcodec/rangecoder: only perform renorm check/loop for callers that need it
avcodec/ffv1: add a named constant for the quant table size
avcodec/ffv1: RCT is only possible with RGB
avcodec/ffv1enc: Fix RCT with RGB64
avcodec/ffv1dec: Fix end computation with ec=2
avcodec/ffv1enc: Move slice termination into threads
avcodec/ffv1enc: Prevent generation of files with broken slices
avformat/matroskadec: Check desc_bytes so bits fit in 64bit
avformat/mov: Avoid overflow in dts
avcodec/ffv1enc: Correct error message about unsupported version
avcodec/ffv1: Store and reuse sx/sy
avcodec/ffv1enc: Slice combination is unsupported
avcodec/ffv1enc: 2Pass mode is not possible with golomb coding
avfilter/buffersrc: check for valid sample rate
avcodec/libdav1d: clear the buffered Dav1dData on decoding failure
avformat/iamf_writer: ensure the stream groups are not empty
avformat/iamf_writer: fix setting num_samples_per_frame for OPUS
avformat/iamf_parse: fix setting duration for the last subblock in a parameter definition
avformat/iamf_parse: add checks to parameter definition durations
avformat/iamf_parse: reject ambisonics mode > 1
checkasm: Print benchmarks of C-only functions
avcodec/ac3dec: fix downmix logic for eac3
avcodec/codec_desc: remove Intra Only prop for AAC
avcodec/mediacodecdec: set set keyframe flag in output frames
avcodec/libfdk-aacenc: set keyframe in output packets
avcodec/libfdk-aacdec: set keyframe flag and profile in output frames
avcodec/audiotoolboxnec: set set keyframe flag in output packets
avcodec/audiotoolboxdec: set set keyframe flag in output frames
avcodec/aacenc: set keyframe flag in output packets
avcodec/aac/aacdec: set keyframe flag in output frames
avcodec/aac_parser: set key_frame and profile
avformat/mov: don't unconditionally set all audio packets in fragments as key frames
avformat/matroskadec: set all frames in a keyframe simple box as keyframes
avformat/test/movenc: set audio packets as key frames
avformat/movenc: write stss boxes for xHE-AAC
avformat/spdifdec: parse headers for audio codecs
avformat/movenc: don't disable edit lists when writing CMAF output
avcodec/libfdk-aacenc: export CPB properties
avformat/movenc: don't write a calculated avgBitrate when the provided one is unset
libavutil/riscv: Make use of elf_aux_info() on FreeBSD / OpenBSD riscv
libavutil/ppc: defines involving bit shifts should be unsigned
libavutil/ppc: Include the hardware feature flags like the other archs
lavu/riscv: fix compilation without Vector support
avfilter/f_loop: fix aloop activate logic
avfilter/f_loop: fix length of aloop leftover buffer
avfilter/vf_zscale: align the frame buffers
lavfi/vf_zscale: fix call to av_pix_fmt_count_planes
lavfi/vf_zscale: fix tmp buffer ptr alignment for zimg_filter_graph_process
avfilter/framepool: align the frame buffers
avcodec/h2645_sei: use the RefStruct API for film_grain_characteristics
avcodec/aom_film_grain: allocate film grain metadata dynamically
avformat/mov: use an array of pointers for heif_item
avformat/mov: split off heif item initialization to its own function
avformat/mov: factorize getting the current item
lavc/h264idct: fix RISC-V group multiplier
lavc/h264dsp: move RISC-V fn pointers to .data.rel.ro
avcodec/jpegxl_parser: fix reading lz77-pair as initial entropy symbol
avcodec/jpegxl_parser: check entropy_decoder_read_symbol return value
avcodec/cbs_h266: Fix regression in DVB clip introduced by 93281630a71c06642adfebebb0d4b105a4e02e91
avcodec/x86/vvc: add prototypes for OF functions
Document stream specifier syntax change from 46cbe4ab5c
fftools/ffplay: fix crash when vk renderer is null
avutil/wchar_filename: re-introduce explicit cast of void* to char*
fate/ffmpeg: add samples dependency to fate-ffmpeg-spec-disposition
fftools/ffmpeg_filter: treat apad filter as a source
lavc/avcodec: fix global/private option precendence
avfilter/framesync: fix forward EOF pts
avcodec/vaapi_encode: fix compilation without CONFIG_VAAPI_1
libavcodec: x86: Remove an explicit include of config.asm
checkasm: lls: Use relative tolerances rather than absolute ones
arm: Consistently use proper interworking function returns
avcodec/libx265: unbreak build for X265_BUILD >= 213
fftools: log unconnected filter output label
fftools: do not access out of bounds filtergraph
avcodec/mediacodecenc: Fix access of uninitialized value
avformat/img2enc: Fix integer truncation when frame_pts is enabled
avformat/internal: Add ff_get_frame_filename
avformat/mov: don't return the latest stream when an item stream is expected
version 7.1:
- Raw Captions with Time (RCWT) closed caption demuxer
- LC3/LC3plus decoding/encoding using external library liblc3
@@ -826,15 +27,6 @@ version 7.1:
- LCEVC enhancement data exporting in H.26x and MP4/ISOBMFF
- LCEVC filter
- MV-HEVC decoding
- minor stream specifier syntax changes:
- when matching by metadata (:m:<key>:<val>), the colon character
in keys or values now has to be backslash-escaped
- in optional maps (-map ....?) with a metadata-matching stream specifier,
the value has to be separated from the question mark by a colon, i.e.
-map ....:m:<key>:<val>:? (otherwise it would be ambiguous whether the
question mark is a part of <val> or not)
- multiple stream types in a single specifier (e.g. :s:s:0) now cause an
error, as such a specifier makes no sense
version 7.0:
-8
View File
@@ -15,11 +15,3 @@ NOTICE
------
- Non system dependencies (e.g. libx264, libvpx) are disabled by default.
NOTICE for Package Maintainers
------------------------------
- It is recommended to build FFmpeg twice, first with minimal external dependencies so
that 3rd party packages, which depend on FFmpegs libavutil/libavfilter/libavcodec/libavformat
can then be built. And last build FFmpeg with full dependancies (which may in turn depend on
some of these 3rd party packages). This avoids circular dependencies during build.
+2 -3
View File
@@ -56,7 +56,6 @@ presets [0]
metadata subsystem Aurelien Jacobs
release management Michael Niedermayer
API tests [0]
samples-request [2] Thilo Borgmann, James Almer, Ben Littler
Communication
@@ -512,9 +511,9 @@ Operating systems / CPU architectures
Alpha [0]
MIPS Manojkumar Bhosale, Shiyou Yin
LoongArch [2] Shiyou Yin
Mac OS X / PowerPC [0]
Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier
Amiga / PowerPC Colin Ward
Linux / PowerPC [1] Lauri Kasanen
Linux / PowerPC Lauri Kasanen
RISC-V [2] Rémi Denis-Courmont
Windows MinGW Alex Beregszaszi, Ramiro Polla
Windows Cygwin Victor Paesa
+1 -1
View File
@@ -1 +1 @@
7.1.5
7.0.git
-15
View File
@@ -1,15 +0,0 @@
┌──────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 7.1 "Péter" │
└──────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 7.1 "Péter", about 6
months after the release of FFmpeg 7.0.
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.libera.chat) or ask
on the mailing-lists.
Vendored
+9 -35
View File
@@ -434,9 +434,7 @@ Advanced options (experts only):
--enable-hardcoded-tables use hardcoded tables instead of runtime generation
--disable-safe-bitstream-reader
disable buffer boundary checking in bitreaders
(This disables some security checks and can cause undefined behavior,
crashes and arbitrary code execution, it may be faster, but
should only be used with trusted input)
(faster, but may crash)
--sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
Optimization options (experts only):
@@ -2214,7 +2212,6 @@ ARCH_EXT_LIST_PPC="
ldbrx
power8
ppc4xx
vec_xl
vsx
"
@@ -2762,7 +2759,6 @@ altivec_deps="ppc"
dcbzl_deps="ppc"
ldbrx_deps="ppc"
ppc4xx_deps="ppc"
vec_xl_deps="altivec"
vsx_deps="altivec"
power8_deps="vsx"
@@ -4114,8 +4110,6 @@ if test "$target_os_default" = aix; then
arch_default=$(uname -p)
strip_default="strip -X32_64"
nm_default="nm -g -X32_64"
elif test "$MSYSTEM_CARCH" != ""; then
arch_default="$MSYSTEM_CARCH"
else
arch_default=$(uname -m)
fi
@@ -4734,7 +4728,7 @@ fi
exesuf() {
case $1 in
mingw32*|mingw64*|msys*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian|windows_nt) echo .exe ;;
mingw32*|mingw64*|msys*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
esac
}
@@ -5811,13 +5805,6 @@ case $target_os in
clang_version=$($cc -dumpversion)
test ${clang_version%%.*} -eq 11 && add_cflags -fno-stack-check
fi
# Xcode Clang doesn't default to -fno-common while upstream llvm.org
# Clang (and GCC) do. This avoids linker warnings on Xcode 16.3 about
# "reducing alignment of section __DATA,__common from 0x8000 to 0x4000
# because it exceeds segment maximum alignment".
check_cflags -fno-common
;;
msys*)
die "Native MSYS builds are discouraged, please use the MINGW environment."
@@ -6402,11 +6389,6 @@ elif enabled ppc; then
check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
fi
if enabled altivec; then
check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
vector unsigned char y0 = vec_xl(0, y1i);"
fi
elif enabled riscv; then
enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
@@ -6498,9 +6480,6 @@ check_cc intrinsics_sse2 emmintrin.h "__m128i test = _mm_setzero_si128()"
check_ldflags -Wl,--as-needed
check_ldflags -Wl,-z,noexecstack
if [ $target_os = "darwin" ]; then
check_ldflags -Wl,-no_warn_duplicate_libraries
fi
if ! disabled network; then
check_func getaddrinfo $network_extralibs
@@ -6905,8 +6884,8 @@ enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d
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 && check_pkg_config libdrm libdrm xf86drm.h drmGetVersion
enabled libdvdnav && require_pkg_config libdvdnav "dvdnav >= 6.1.0" dvdnav/dvdnav.h dvdnav_open2
enabled libdvdread && require_pkg_config libdvdread "dvdread >= 6.1.1" dvdread/dvd_reader.h DVDOpen2
enabled libdvdnav && require_pkg_config libdvdnav "dvdnav >= 6.1.1" dvdnav/dvdnav.h dvdnav_open2
enabled libdvdread && require_pkg_config libdvdread "dvdread >= 6.1.2" dvdread/dvd_reader.h DVDOpen2
enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
{ require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
warn "using libfdk without pkg-config"; } }
@@ -6917,16 +6896,12 @@ enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontco
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 libharfbuzz && require_pkg_config libharfbuzz harfbuzz hb.h hb_buffer_create
if enabled libglslang; then
spvremap="-lSPVRemapper"
require_headers "glslang/build_info.h" && { test_cpp_condition glslang/build_info.h "GLSLANG_VERSION_MAJOR >= 16" && spvremap="" ; }
check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
-lglslang -lMachineIndependent -lGenericCodeGen \
${spvremap} -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ||
-lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ||
require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
-lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen \
${spvremap} -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ;
fi
-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
@@ -7200,7 +7175,7 @@ enabled makeinfo \
disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
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
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_headers linux/fb.h
@@ -7966,7 +7941,6 @@ if enabled ppc; then
echo "POWER8 enabled ${power8-no}"
echo "PPC 4xx optimizations ${ppc4xx-no}"
echo "dcbzl available ${dcbzl-no}"
echo "vec_xl available ${vec_xl-no}"
fi
if enabled loongarch; then
echo "LSX enabled ${lsx-no}"
@@ -8217,7 +8191,7 @@ cat > $TMPH <<EOF
#define FFMPEG_CONFIG_H
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
#define FFMPEG_LICENSE "$(c_escape $license)"
#define CONFIG_THIS_YEAR 2026
#define CONFIG_THIS_YEAR 2024
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
-3
View File
@@ -2,9 +2,6 @@ The last version increases of all libraries were on 2024-03-07
API changes, most recent first:
2025-09-xx - xxxxxxxxxx - lavfi 10.5.100 - buffersrc.h
Add av_buffersrc_get_status().
2024-09-23 - 6940a6de2f0 - lavu 59.38.100 - frame.h
Add AV_FRAME_DATA_VIEW_ID.
+1 -1
View File
@@ -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 = 7.1.5
PROJECT_NUMBER =
# 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
+1
View File
@@ -63,3 +63,4 @@ make -j<num>
make -k
Continue build in case of errors, this is useful for the regression tests
sometimes but note that it will still not run all reg tests.
+6 -10
View File
@@ -292,6 +292,7 @@ DVD-Video demuxer, powered by libdvdnav and libdvdread.
Can directly ingest DVD titles, specifically sequential PGCs, into
a conversion pipeline. Menu assets, such as background video or audio,
can also be demuxed given the menu's coordinates (at best effort).
Seeking is not supported at this time.
Block devices (DVD drives), ISO files, and directory structures are accepted.
Activate with @code{-f dvdvideo} in front of one of these inputs.
@@ -379,11 +380,11 @@ Default is false.
@item menu_lu @var{int}
The menu language to demux. In DVD, menus are grouped by language.
Default is 1, the first language unit.
Default is 0, the first language unit.
@item menu_vts @var{int}
The VTS where the menu lives, or 0 if it is a VMG menu (root-level).
Default is 1, menu of the first VTS.
Default is 0, VMG menu.
@item pgc @var{int}
The entry PGC to start playback, in conjunction with @option{pg}.
@@ -396,7 +397,8 @@ Default is 0, automatically resolve from value of @option{title}.
The entry PG to start playback, in conjunction with @option{pgc}.
Alternative to setting @option{title}.
Chapter markers are not supported at this time.
Default is 1, the first PG of the PGC.
Default is 0, automatically resolve from value of @option{title}, or
start from the beginning (PG 1) of the menu.
@item preindex @var{bool}
Enable this to have accurate chapter (PTT) markers and duration measurement,
@@ -404,6 +406,7 @@ which requires a slow second pass read in order to index the chapter marker
timestamps from NAV packets. This is non-ideal extra work for real optical drives.
It is recommended and faster to use this option with a backup of the DVD structure
stored on a hard drive. Not compatible with @option{pgc} and @option{pg}.
Not applicable to menus.
Default is 0, false.
@item trim @var{bool}
@@ -564,13 +567,6 @@ 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.
@item extension_picky
This blocks disallowed extensions from probing
It also requires all available segments to have matching extensions to the format
except mpegts, which is always allowed.
It is recommended to set the whitelists correctly instead of depending on extensions
Enabled by default.
@item max_reload
Maximum number of times a insufficient list is attempted to be reloaded.
Default value is 1000.
-19
View File
@@ -927,25 +927,6 @@ In case you need finer control over how valgrind is invoked, use the
@code{--target-exec='valgrind <your_custom_valgrind_options>} option in
your configure line instead.
@anchor{Maintenance}
@chapter Maintenance process
@anchor{MAINTAINERS}
@section MAINTAINERS
The developers maintaining each part of the codebase are listed in @file{MAINTAINERS}.
Being listed in @file{MAINTAINERS}, gives one the right to have git write access to
the specific repository.
@anchor{Becoming a maintainer}
@section Becoming a maintainer
People add themselves to @file{MAINTAINERS} by sending a patch like any other code
change. These get reviewed by the community like any other patch. It is expected
that, if someone has an objection to a new maintainer, she is willing to object
in public with her full name and is willing to take over maintainership for the area.
@anchor{Release process}
@chapter Release process
-1
View File
@@ -96,7 +96,6 @@ int main(int argc, char *argv[])
avio_ctx = avio_alloc_context(avio_ctx_buffer, avio_ctx_buffer_size,
0, &bd, &read_packet, NULL, NULL);
if (!avio_ctx) {
av_freep(&avio_ctx_buffer);
ret = AVERROR(ENOMEM);
goto end;
}
+1 -5
View File
@@ -128,10 +128,6 @@ int main(int argc, char **argv)
outfilename = argv[2];
pkt = av_packet_alloc();
if (!pkt) {
fprintf(stderr, "Could not allocate AVPacket\n");
exit(1); /* or proper cleanup and returning */
}
/* find the MPEG audio decoder */
codec = avcodec_find_decoder(AV_CODEC_ID_MP2);
@@ -165,7 +161,7 @@ int main(int argc, char **argv)
}
outfile = fopen(outfilename, "wb");
if (!outfile) {
fprintf(stderr, "Could not open %s\n", outfilename);
av_free(c);
exit(1);
}
+1 -1
View File
@@ -88,7 +88,7 @@ static int encode_write(AVCodecContext *avctx, AVFrame *frame, FILE *fout)
enc_pkt->stream_index = 0;
ret = fwrite(enc_pkt->data, enc_pkt->size, 1, fout);
av_packet_unref(enc_pkt);
if (!ret) {
if (ret != enc_pkt->size) {
ret = AVERROR(errno);
break;
}
+1 -6
View File
@@ -1,5 +1,5 @@
slot= # some unique identifier
repo=https://git.ffmpeg.org/ffmpeg.git # the source repository
repo=git://source.ffmpeg.org/ffmpeg.git # the source repository
#branch=release/2.6 # the branch to test
samples= # path to samples directory
workdir= # directory in which to do all the work
@@ -11,21 +11,16 @@ ignore_tests=
# the following are optional and map to configure options
arch=
cpu=
toolchain=
cross_prefix=
as=
cc=
cxx=
ld=
nm=
target_os=
sysroot=
target_exec=
target_path=
target_samples=
extra_cflags=
extra_cxxflags=
extra_objcflags=
extra_ldflags=
extra_libs=
extra_conf= # extra configure options not covered above
+1 -1
View File
@@ -1799,7 +1799,7 @@ Set the size of the canvas used to render subtitles.
@section Advanced options
@table @option
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][:@var{view_specifier}][:?] | @var{[linklabel]} (@emph{output})
@item -map [-]@var{input_file_id}[:@var{stream_specifier}][:@var{view_specifier}][?] | @var{[linklabel]} (@emph{output})
Create one or more streams in the output file. This option has two forms for
specifying the data source(s): the first selects one or more streams from some
+1 -2
View File
@@ -78,8 +78,7 @@ Match the stream by stream id (e.g. PID in MPEG-TS container).
@item m:@var{key}[:@var{value}]
Matches streams with the metadata tag @var{key} having the specified value. If
@var{value} is not given, matches streams that contain the given tag with any
value. The colon character ':' in @var{key} or @var{value} needs to be
backslash-escaped.
value.
@item disp:@var{dispositions}[:@var{additional_stream_specifier}]
Matches streams with the given disposition(s). @var{dispositions} is a list of
one or more dispositions (as printed by the @option{-dispositions} option)
+1 -1
View File
@@ -143,7 +143,7 @@ git log <filename(s)>
@end example
You may also use the graphical tools like @command{gitview} or @command{gitk}
or the web interface available at @url{https://git.ffmpeg.org/ffmpeg.git}.
or the web interface available at @url{http://source.ffmpeg.org/}.
@section Checking source tree status
+1 -5
View File
@@ -23,8 +23,6 @@ Web, mail, and public facing git, also website git
fftrac VM:
----------
trac.ffmpeg.org Issue tracking
gpg encrypted backups of the trac repositories are created once a day
and can be downloaded by any of the admins.
ffaux VM:
@@ -67,9 +65,6 @@ Github mirrors are redundantly synced by multiple people
You need a new git repository related to FFmpeg ? contact root at ffmpeg.org
git repositories are managed by gitolite, every change to permissions is
logged, including when, what and by whom
Fate:
~~~~~
@@ -96,3 +91,4 @@ IRC:
~~~~
irc channels are at https://libera.chat/
irc channel archives are at https://libera.irclog.whitequark.org
+1 -1
View File
@@ -341,7 +341,7 @@ recommended.
Avoid sending the same message to multiple mailing lists.
@item
Please follow our @url{https://ffmpeg.org/community.html#Code-of-Conduct, Code of Conduct}.
Please follow our @url{https://ffmpeg.org/community.html#Code-of-conduct, Code of Conduct}.
@end itemize
@chapter Help
+1
View File
@@ -157,3 +157,4 @@ PFD[32] would for example be signed 32 bit little-endian IEEE float
@item XVID @tab non-compliant MPEG-4 generated by old Xvid
@item XVIX @tab non-compliant MPEG-4 generated by old Xvid with interlacing bug
@end multitable
+40 -129
View File
@@ -54,24 +54,12 @@ sub get_formatting_function($$) {
}
# determine texinfo version
my $package_version = ff_get_conf('PACKAGE_VERSION');
$package_version =~ s/\+dev$//;
my $program_version_num = version->declare($package_version)->numify;
my $program_version_num = version->declare(ff_get_conf('PACKAGE_VERSION'))->numify;
my $program_version_6_8 = $program_version_num >= 6.008000;
# no navigation elements
ff_set_from_init_file('HEADERS', 0);
my %sectioning_commands = %Texinfo::Common::sectioning_commands;
if (scalar(keys(%sectioning_commands)) == 0) {
%sectioning_commands = %Texinfo::Commands::sectioning_heading_commands;
}
my %root_commands = %Texinfo::Common::root_commands;
if (scalar(keys(%root_commands)) == 0) {
%root_commands = %Texinfo::Commands::root_commands;
}
sub ffmpeg_heading_command($$$$$)
{
my $self = shift;
@@ -89,9 +77,6 @@ sub ffmpeg_heading_command($$$$$)
return $result;
}
# no need to set it as the $element_id is output unconditionally
my $heading_id;
my $element_id = $self->command_id($command);
$result .= "<a name=\"$element_id\"></a>\n"
if (defined($element_id) and $element_id ne '');
@@ -99,40 +84,24 @@ sub ffmpeg_heading_command($$$$$)
print STDERR "Process $command "
.Texinfo::Structuring::_print_root_command_texi($command)."\n"
if ($self->get_conf('DEBUG'));
my $output_unit;
if ($root_commands{$command->{'cmdname'}}) {
if ($command->{'associated_unit'}) {
$output_unit = $command->{'associated_unit'};
} elsif ($command->{'structure'}
and $command->{'structure'}->{'associated_unit'}) {
$output_unit = $command->{'structure'}->{'associated_unit'};
} elsif ($command->{'parent'}
and $command->{'parent'}->{'type'}
and $command->{'parent'}->{'type'} eq 'element') {
$output_unit = $command->{'parent'};
}
my $element;
if ($Texinfo::Common::root_commands{$command->{'cmdname'}}
and $command->{'parent'}
and $command->{'parent'}->{'type'}
and $command->{'parent'}->{'type'} eq 'element') {
$element = $command->{'parent'};
}
if ($output_unit) {
if ($element) {
$result .= &{get_formatting_function($self, 'format_element_header')}($self, $cmdname,
$command, $output_unit);
$command, $element);
}
my $heading_level;
# node is used as heading if there is nothing else.
if ($cmdname eq 'node') {
if (!$output_unit or
(((!$output_unit->{'extra'}->{'section'}
and $output_unit->{'extra'}->{'node'}
and $output_unit->{'extra'}->{'node'} eq $command)
or
((($output_unit->{'extra'}->{'unit_command'}
and $output_unit->{'extra'}->{'unit_command'} eq $command)
or
($output_unit->{'unit_command'}
and $output_unit->{'unit_command'} eq $command))
and $command->{'extra'}
and not $command->{'extra'}->{'associated_section'}))
if (!$element or (!$element->{'extra'}->{'section'}
and $element->{'extra'}->{'node'}
and $element->{'extra'}->{'node'} eq $command
# bogus node may not have been normalized
and defined($command->{'extra'}->{'normalized'}))) {
if ($command->{'extra'}->{'normalized'} eq 'Top') {
@@ -142,15 +111,7 @@ sub ffmpeg_heading_command($$$$$)
}
}
} else {
if (defined($command->{'extra'})
and defined($command->{'extra'}->{'section_level'})) {
$heading_level = $command->{'extra'}->{'section_level'};
} elsif ($command->{'structure'}
and defined($command->{'structure'}->{'section_level'})) {
$heading_level = $command->{'structure'}->{'section_level'};
} else {
$heading_level = $command->{'level'};
}
$heading_level = $command->{'level'};
}
my $heading = $self->command_text($command);
@@ -158,8 +119,8 @@ sub ffmpeg_heading_command($$$$$)
# if there is an error in the node.
if (defined($heading) and $heading ne '' and defined($heading_level)) {
if ($root_commands{$cmdname}
and $sectioning_commands{$cmdname}) {
if ($Texinfo::Common::root_commands{$cmdname}
and $Texinfo::Common::sectioning_commands{$cmdname}) {
my $content_href = $self->command_contents_href($command, 'contents',
$self->{'current_filename'});
if ($content_href) {
@@ -179,13 +140,7 @@ sub ffmpeg_heading_command($$$$$)
}
}
my $in_preformatted;
if ($program_version_num >= 7.001090) {
$in_preformatted = $self->in_preformatted_context();
} else {
$in_preformatted = $self->in_preformatted();
}
if ($in_preformatted) {
if ($self->in_preformatted()) {
$result .= $heading."\n";
} else {
# if the level was changed, set the command name right
@@ -194,25 +149,21 @@ sub ffmpeg_heading_command($$$$$)
$cmdname
= $Texinfo::Common::level_to_structuring_command{$cmdname}->[$heading_level];
}
# format_heading_text expects an array of headings for texinfo >= 7.0
if ($program_version_num >= 7.000000) {
$result .= &{get_formatting_function($self,'format_heading_text')}($self,
$cmdname, [$cmdname], $heading,
$heading_level +$self->get_conf('CHAPTER_HEADER_LEVEL') -1,
$heading_id, $command);
} else {
$result .= &{get_formatting_function($self,'format_heading_text')}(
$heading = [$heading];
}
$result .= &{get_formatting_function($self,'format_heading_text')}(
$self, $cmdname, $heading,
$heading_level +
$self->get_conf('CHAPTER_HEADER_LEVEL') - 1, $command);
}
}
}
$result .= $content if (defined($content));
return $result;
}
foreach my $command (keys(%sectioning_commands), 'node') {
foreach my $command (keys(%Texinfo::Common::sectioning_commands), 'node') {
texinfo_register_command_formatting($command, \&ffmpeg_heading_command);
}
@@ -237,56 +188,28 @@ sub ffmpeg_begin_file($$$)
my $filename = shift;
my $element = shift;
my ($element_command, $node_command, $command_for_title);
if ($element) {
if ($element->{'unit_command'}) {
$element_command = $element->{'unit_command'};
} elsif ($self->can('tree_unit_element_command')) {
$element_command = $self->tree_unit_element_command($element);
} elsif ($self->can('tree_unit_element_command')) {
$element_command = $self->element_command($element);
}
$node_command = $element_command;
if ($element_command and $element_command->{'cmdname'}
and $element_command->{'cmdname'} ne 'node'
and $element_command->{'extra'}
and $element_command->{'extra'}->{'associated_node'}) {
$node_command = $element_command->{'extra'}->{'associated_node'};
}
$command_for_title = $element_command if ($self->get_conf('SPLIT'));
my $command;
if ($element and $self->get_conf('SPLIT')) {
$command = $self->element_command($element);
}
my ($title, $description, $keywords, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $body_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
my ($title, $description, $encoding, $date, $css_lines,
$doctype, $bodytext, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
$program, $generator);
if ($program_version_num >= 7.001090) {
($title, $description, $keywords, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $body_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_information($command_for_title,
$filename);
} elsif ($program_version_num >= 7.000000) {
($title, $description, $encoding, $date, $css_lines, $doctype,
$root_html_element_attributes, $copying_comment, $after_body_open,
if ($program_version_num >= 7.000000) {
($title, $description, $encoding, $date, $css_lines,
$doctype, $bodytext, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_information($command_for_title,
$filename);
$program, $generator) = $self->_file_header_information($command);
} else {
($title, $description, $encoding, $date, $css_lines,
$doctype, $root_html_element_attributes, $copying_comment,
$after_body_open, $extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_informations($command_for_title);
$doctype, $bodytext, $copying_comment, $after_body_open,
$extra_head, $program_and_version, $program_homepage,
$program, $generator) = $self->_file_header_informations($command);
}
my $links;
if ($program_version_num >= 7.000000) {
$links = $self->_get_links($filename, $element, $node_command);
} else {
$links = $self->_get_links ($filename, $element);
}
my $links = $self->_get_links ($filename, $element);
my $head1 = $ENV{"FFMPEG_HEADER1"} || <<EOT;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
@@ -329,25 +252,13 @@ sub ffmpeg_program_string($)
if (defined($self->get_conf('PROGRAM'))
and $self->get_conf('PROGRAM') ne ''
and defined($self->get_conf('PACKAGE_URL'))) {
if ($program_version_num >= 7.001090) {
return $self->convert_tree(
$self->cdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.',
{ 'program_homepage' => {'text' => $self->get_conf('PACKAGE_URL')},
'program' => {'text' => $self->get_conf('PROGRAM') }}));
} else {
return $self->convert_tree(
return $self->convert_tree(
$self->gdt('This document was generated using @uref{{program_homepage}, @emph{{program}}}.',
{ 'program_homepage' => {'text' => $self->get_conf('PACKAGE_URL')},
'program' => {'text' => $self->get_conf('PROGRAM') }}));
}
{ 'program_homepage' => $self->get_conf('PACKAGE_URL'),
'program' => $self->get_conf('PROGRAM') }));
} else {
if ($program_version_num >= 7.001090) {
return $self->convert_tree(
$self->cdt('This document was generated automatically.'));
} else {
return $self->convert_tree(
$self->gdt('This document was generated automatically.'));
}
return $self->convert_tree(
$self->gdt('This document was generated automatically.'));
}
}
if ($program_version_6_8) {
Executable → Regular
View File
Executable → Regular
View File
+1
View File
@@ -44,3 +44,4 @@ a+b*c;
here the reader knows that a,b,c are meant to be signed integers but for C
standard compliance / to avoid undefined behavior they are stored in unsigned
ints.
+2 -3
View File
@@ -255,10 +255,9 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
if (*opt == '/') {
opt++;
if (!opt_has_arg(po)) {
if (po->type == OPT_TYPE_BOOL) {
av_log(NULL, AV_LOG_FATAL,
"Requested to load an argument from file for an option '%s'"
" which does not take an argument\n",
"Requested to load an argument from file for a bool option '%s'\n",
po->name);
return AVERROR(EINVAL);
}
+2 -3
View File
@@ -789,6 +789,8 @@ static int check_keyboard_interaction(int64_t cur_time)
{
int i, key;
static int64_t last_time;
if (received_nb_signals)
return AVERROR_EXIT;
/* read_key() returns 0 on EOF */
if (cur_time - last_time >= 100000) {
key = read_key();
@@ -872,9 +874,6 @@ static int transcode(Scheduler *sch)
while (!sch_wait(sch, stats_period, &transcode_ts)) {
int64_t cur_time= av_gettime_relative();
if (received_nb_signals)
break;
/* if 'q' pressed, exits */
if (stdin_interaction)
if (check_keyboard_interaction(cur_time) < 0)
+1 -3
View File
@@ -254,8 +254,6 @@ typedef struct OptionsContext {
SpecifierOptList enc_stats_pre_fmt;
SpecifierOptList enc_stats_post_fmt;
SpecifierOptList mux_stats_fmt;
int depth;
} OptionsContext;
enum IFilterFlags {
@@ -422,7 +420,7 @@ typedef struct Decoder {
enum AVMediaType type;
uint8_t *subtitle_header;
const uint8_t *subtitle_header;
int subtitle_header_size;
// number of frames/samples retrieved from the decoder
+2 -11
View File
@@ -136,8 +136,6 @@ void dec_free(Decoder **pdec)
av_frame_free(&dp->sub_prev[i]);
av_frame_free(&dp->sub_heartbeat);
av_freep(&dp->dec.subtitle_header);
av_freep(&dp->parent_name);
av_freep(&dp->views_requested);
@@ -1620,15 +1618,8 @@ static int dec_open(DecoderPriv *dp, AVDictionary **dec_opts,
dp->dec_ctx->extra_hw_frames = extra_frames;
}
if (dp->dec_ctx->subtitle_header) {
/* ASS code assumes this buffer is null terminated so add extra byte. */
dp->dec.subtitle_header = av_mallocz(dp->dec_ctx->subtitle_header_size + 1);
if (!dp->dec.subtitle_header)
return AVERROR(ENOMEM);
memcpy(dp->dec.subtitle_header, dp->dec_ctx->subtitle_header,
dp->dec_ctx->subtitle_header_size);
dp->dec.subtitle_header_size = dp->dec_ctx->subtitle_header_size;
}
dp->dec.subtitle_header = dp->dec_ctx->subtitle_header;
dp->dec.subtitle_header_size = dp->dec_ctx->subtitle_header_size;
if (param_out) {
if (dp->dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
+2 -79
View File
@@ -67,7 +67,6 @@ typedef struct DemuxStream {
int reinit_filters;
int autorotate;
int apply_cropping;
int force_display_matrix;
int wrap_correction_done;
@@ -913,18 +912,9 @@ static int ist_use(InputStream *ist, int decoding_needed,
if (decoding_needed && ds->sch_idx_dec < 0) {
int is_audio = ist->st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO;
int is_unreliable = !!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS);
int64_t use_wallclock_as_timestamps;
ret = av_opt_get_int(d->f.ctx, "use_wallclock_as_timestamps", 0, &use_wallclock_as_timestamps);
if (ret < 0)
return ret;
if (use_wallclock_as_timestamps)
is_unreliable = 0;
ds->dec_opts.flags |= (!!ist->fix_sub_duration * DECODER_FLAG_FIX_SUB_DURATION) |
(!!is_unreliable * DECODER_FLAG_TS_UNRELIABLE) |
(!!(d->f.ctx->iformat->flags & AVFMT_NOTIMESTAMPS) * DECODER_FLAG_TS_UNRELIABLE) |
(!!(d->loop && is_audio) * DECODER_FLAG_SEND_END_TS)
#if FFMPEG_OPT_TOP
| ((ist->top_field_first >= 0) * DECODER_FLAG_TOP_FIELD_FIRST)
@@ -1169,7 +1159,6 @@ static int add_display_matrix_to_stream(const OptionsContext *o,
AVFormatContext *ctx, InputStream *ist)
{
AVStream *st = ist->st;
DemuxStream *ds = ds_from_ist(ist);
AVPacketSideData *sd;
double rotation = DBL_MAX;
int hflip = -1, vflip = -1;
@@ -1204,8 +1193,6 @@ static int add_display_matrix_to_stream(const OptionsContext *o,
hflip_set ? hflip : 0,
vflip_set ? vflip : 0);
ds->force_display_matrix = 1;
return 0;
}
@@ -1433,15 +1420,6 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
av_dict_set_int(&ds->decoder_opts, "apply_cropping",
ds->apply_cropping && ds->apply_cropping != CROP_CONTAINER, 0);
if (ds->force_display_matrix) {
char buf[32];
if (av_dict_get(ds->decoder_opts, "side_data_prefer_packet", NULL, 0))
buf[0] = ',';
else
buf[0] = '\0';
av_strlcat(buf, "displaymatrix", sizeof(buf));
av_dict_set(&ds->decoder_opts, "side_data_prefer_packet", buf, AV_DICT_APPEND);
}
/* Attached pics are sparse, therefore we would not want to delay their decoding
* till EOF. */
if (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC)
@@ -1560,56 +1538,6 @@ static int ist_add(const OptionsContext *o, Demuxer *d, AVStream *st, AVDictiona
return 0;
}
static int is_windows_reserved_device_name(const char *f)
{
#if HAVE_DOS_PATHS
for (const char *p = f; p && *p; ) {
char stem[6], *s;
av_strlcpy(stem, p, sizeof(stem));
if ((s = strchr(stem, '.')))
*s = 0;
if ((s = strpbrk(stem, "123456789")))
*s = '1';
if( !av_strcasecmp(stem, "AUX") ||
!av_strcasecmp(stem, "CON") ||
!av_strcasecmp(stem, "NUL") ||
!av_strcasecmp(stem, "PRN") ||
!av_strcasecmp(stem, "COM1") ||
!av_strcasecmp(stem, "LPT1")
)
return 1;
p = strchr(p, '/');
if (p)
p++;
}
#endif
return 0;
}
static int safe_filename(const char *f, int allow_subdir)
{
const char *start = f;
if (!*f || is_windows_reserved_device_name(f))
return 0;
for (; *f; f++) {
/* A-Za-z0-9_- */
if (!((unsigned)((*f | 32) - 'a') < 26 ||
(unsigned)(*f - '0') < 10 || *f == '_' || *f == '-')) {
if (f == start)
return 0;
else if (allow_subdir && *f == '/')
start = f + 1;
else if (*f != '.')
return 0;
}
}
return 1;
}
static int dump_attachment(InputStream *ist, const char *filename)
{
AVStream *st = ist->st;
@@ -1621,13 +1549,8 @@ static int dump_attachment(InputStream *ist, const char *filename)
av_log(ist, AV_LOG_WARNING, "No extradata to dump.\n");
return 0;
}
if (!*filename && (e = av_dict_get(st->metadata, "filename", NULL, 0))) {
if (!*filename && (e = av_dict_get(st->metadata, "filename", NULL, 0)))
filename = e->value;
if (!safe_filename(filename, 0)) {
av_log(ist, AV_LOG_ERROR, "Filename %s is unsafe\n", filename);
return AVERROR(EINVAL);
}
}
if (!*filename) {
av_log(ist, AV_LOG_FATAL, "No filename specified and no 'filename' tag");
return AVERROR(EINVAL);
+12 -40
View File
@@ -1101,9 +1101,8 @@ int fg_create(FilterGraph **pfg, char *graph_desc, Scheduler *sch)
for (unsigned i = 0; i < graph->nb_filters; i++) {
const AVFilter *f = graph->filters[i]->filter;
if ((!avfilter_filter_pad_count(f, 0) &&
!(f->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) ||
!strcmp(f->name, "apad")) {
if (!avfilter_filter_pad_count(f, 0) &&
!(f->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) {
fgp->have_sources = 1;
break;
}
@@ -1409,10 +1408,8 @@ int fg_finalise_bindings(void)
for (int j = 0; j < fg->nb_outputs; j++) {
OutputFilter *output = fg->outputs[j];
if (!output->bound) {
av_log(fg, AV_LOG_FATAL,
"Filter '%s' has output %d (%s) unconnected\n",
output->name, j,
output->linklabel ? (const char *)output->linklabel : "unlabeled");
av_log(filtergraphs[j], AV_LOG_FATAL,
"Filter %s has an unconnected output\n", output->name);
return AVERROR(EINVAL);
}
}
@@ -1498,7 +1495,7 @@ static int insert_filter(AVFilterContext **last_filter, int *pad_idx,
return 0;
}
static int configure_output_video_filter(FilterGraphPriv *fgp, AVFilterGraph *graph,
static int configure_output_video_filter(FilterGraph *fg, AVFilterGraph *graph,
OutputFilter *ofilter, AVFilterInOut *out)
{
OutputFilterPriv *ofp = ofp_from_ofilter(ofilter);
@@ -1577,7 +1574,7 @@ static int configure_output_video_filter(FilterGraphPriv *fgp, AVFilterGraph *gr
return 0;
}
static int configure_output_audio_filter(FilterGraphPriv *fgp, AVFilterGraph *graph,
static int configure_output_audio_filter(FilterGraph *fg, AVFilterGraph *graph,
OutputFilter *ofilter, AVFilterInOut *out)
{
OutputFilterPriv *ofp = ofp_from_ofilter(ofilter);
@@ -1642,10 +1639,8 @@ static int configure_output_audio_filter(FilterGraphPriv *fgp, AVFilterGraph *gr
pad_idx = 0;
}
if (ofilter->apad) {
if (ofilter->apad)
AUTO_INSERT_FILTER("-apad", "apad", ofilter->apad);
fgp->have_sources = 1;
}
snprintf(name, sizeof(name), "trim for output %s", ofp->name);
ret = insert_trim(ofp->trim_start_us, ofp->trim_duration_us,
@@ -1661,12 +1656,12 @@ fail:
return ret;
}
static int configure_output_filter(FilterGraphPriv *fgp, AVFilterGraph *graph,
static int configure_output_filter(FilterGraph *fg, AVFilterGraph *graph,
OutputFilter *ofilter, AVFilterInOut *out)
{
switch (ofilter->type) {
case AVMEDIA_TYPE_VIDEO: return configure_output_video_filter(fgp, graph, ofilter, out);
case AVMEDIA_TYPE_AUDIO: return configure_output_audio_filter(fgp, graph, ofilter, out);
case AVMEDIA_TYPE_VIDEO: return configure_output_video_filter(fg, graph, ofilter, out);
case AVMEDIA_TYPE_AUDIO: return configure_output_audio_filter(fg, graph, ofilter, out);
default: av_assert0(0); return 0;
}
}
@@ -1943,7 +1938,7 @@ static int configure_filtergraph(FilterGraph *fg, FilterGraphThread *fgt)
avfilter_inout_free(&inputs);
for (cur = outputs, i = 0; cur; cur = cur->next, i++) {
ret = configure_output_filter(fgp, fgt->graph, fg->outputs[i], cur);
ret = configure_output_filter(fg, fgt->graph, fg->outputs[i], cur);
if (ret < 0) {
avfilter_inout_free(&outputs);
goto fail;
@@ -1998,10 +1993,6 @@ static int configure_filtergraph(FilterGraph *fg, FilterGraphThread *fgt)
if (ifp->type_src == AVMEDIA_TYPE_SUBTITLE) {
sub2video_frame(&ifp->ifilter, tmp, !fgt->graph);
} else {
if (ifp->type_src == AVMEDIA_TYPE_VIDEO) {
if (ifp->displaymatrix_applied)
av_frame_remove_side_data(tmp, AV_FRAME_DATA_DISPLAYMATRIX);
}
ret = av_buffersrc_add_frame(ifp->filter, tmp);
}
av_frame_free(&tmp);
@@ -2365,18 +2356,6 @@ finish:
fps->dropped_keyframe |= fps->last_dropped && (frame->flags & AV_FRAME_FLAG_KEY);
}
static void close_input(FilterGraph *fg, int input_idx)
{
InputFilterPriv *ifp = ifp_from_ifilter(fg->inputs[input_idx]);
FilterGraphPriv *fgp = fgp_from_fg(ifp->ifilter.graph);
if (!ifp->eof) {
sch_filter_receive_finish(fgp->sch, fgp->sch_idx, input_idx);
ifp->eof = 1;
}
}
static int close_output(OutputFilterPriv *ofp, FilterGraphThread *fgt)
{
FilterGraphPriv *fgp = fgp_from_fg(ofp->ofilter.graph);
@@ -3047,7 +3026,7 @@ static int filter_thread(void *arg)
if (ret == AVERROR_EOF) {
av_log(fg, AV_LOG_VERBOSE, "Input %u no longer accepts new data\n",
input_idx);
close_input(fg, input_idx);
sch_filter_receive_finish(fgp->sch, fgp->sch_idx, input_idx);
continue;
}
if (ret < 0)
@@ -3064,13 +3043,6 @@ read_frames:
av_err2str(ret));
goto finish;
}
// ensure all inputs no longer accepting data are closed
for (int i = 0; fgt.graph && i < fg->nb_inputs; i++) {
InputFilterPriv *ifp = ifp_from_ifilter(fg->inputs[i]);
if (av_buffersrc_get_status(ifp->filter))
close_input(fg, i);
}
}
for (unsigned i = 0; i < fg->nb_outputs; i++) {
+4 -4
View File
@@ -1557,7 +1557,7 @@ static int map_auto_video(Muxer *mux, const OptionsContext *o)
{
AVFormatContext *oc = mux->fc;
InputStream *best_ist = NULL;
int64_t best_score = 0;
int best_score = 0;
int qcr;
/* video: highest resolution */
@@ -1568,16 +1568,16 @@ static int map_auto_video(Muxer *mux, const OptionsContext *o)
for (int j = 0; j < nb_input_files; j++) {
InputFile *ifile = input_files[j];
InputStream *file_best_ist = NULL;
int64_t file_best_score = 0;
int file_best_score = 0;
for (int i = 0; i < ifile->nb_streams; i++) {
InputStream *ist = ifile->streams[i];
int64_t score;
int score;
if (ist->user_set_discard == AVDISCARD_ALL ||
ist->st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
continue;
score = ist->st->codecpar->width * (int64_t)ist->st->codecpar->height
score = ist->st->codecpar->width * ist->st->codecpar->height
+ 100000000 * !!(ist->st->event_flags & AVSTREAM_EVENT_FLAG_NEW_PACKETS)
+ 5000000*!!(ist->st->disposition & AV_DISPOSITION_DEFAULT);
if((qcr!=MKTAG('A', 'P', 'I', 'C')) && (ist->st->disposition & AV_DISPOSITION_ATTACHED_PIC))
-10
View File
@@ -545,8 +545,6 @@ static int opt_map(void *optctx, const char *opt, const char *arg)
for (i = 0; i < o->nb_stream_maps; i++) {
m = &o->stream_maps[i];
if (file_idx == m->file_index &&
m->stream_index >= 0 &&
m->stream_index < input_files[m->file_index]->nb_streams &&
stream_specifier_match(&ss,
input_files[m->file_index]->ctx,
input_files[m->file_index]->ctx->streams[m->stream_index],
@@ -1010,12 +1008,6 @@ static int opt_preset(void *optctx, const char *opt, const char *arg)
char filename[1000], line[1000], tmp_line[1000];
const char *codec_name = NULL;
int ret = 0;
int depth = o->depth;
if (depth > 2) {
av_log(NULL, AV_LOG_ERROR, "too deep recursion\n");
return AVERROR(EINVAL);
}
codec_name = opt_match_per_type_str(&o->codec_names, *opt);
@@ -1027,7 +1019,6 @@ static int opt_preset(void *optctx, const char *opt, const char *arg)
return AVERROR(ENOENT);
}
o->depth ++;
while (fgets(line, sizeof(line), f)) {
char *key = tmp_line, *value, *endptr;
@@ -1055,7 +1046,6 @@ static int opt_preset(void *optctx, const char *opt, const char *arg)
}
fail:
o->depth = depth;
fclose(f);
return ret;
+1 -45
View File
@@ -1242,45 +1242,6 @@ int sch_mux_sub_heartbeat_add(Scheduler *sch, unsigned mux_idx, unsigned stream_
return 0;
}
static void unchoke_for_stream(Scheduler *sch, SchedulerNode src);
// Unchoke any filter graphs that are downstream of this node, to prevent it
// from getting stuck trying to push data to a full queue
static void unchoke_downstream(Scheduler *sch, SchedulerNode *dst)
{
SchFilterGraph *fg;
SchDec *dec;
SchEnc *enc;
switch (dst->type) {
case SCH_NODE_TYPE_DEC:
dec = &sch->dec[dst->idx];
for (int i = 0; i < dec->nb_outputs; i++)
unchoke_downstream(sch, dec->outputs[i].dst);
break;
case SCH_NODE_TYPE_ENC:
enc = &sch->enc[dst->idx];
for (int i = 0; i < enc->nb_dst; i++)
unchoke_downstream(sch, &enc->dst[i]);
break;
case SCH_NODE_TYPE_MUX:
// muxers are never choked
break;
case SCH_NODE_TYPE_FILTER_IN:
fg = &sch->filters[dst->idx];
if (fg->best_input == fg->nb_inputs) {
fg->waiter.choked_next = 0;
} else {
// ensure that this filter graph is not stuck waiting for
// input from a different upstream demuxer
unchoke_for_stream(sch, fg->inputs[fg->best_input].src_sched);
}
break;
default:
av_assert0(!"Invalid destination node type?");
break;
}
}
static void unchoke_for_stream(Scheduler *sch, SchedulerNode src)
{
while (1) {
@@ -1288,12 +1249,7 @@ static void unchoke_for_stream(Scheduler *sch, SchedulerNode src)
// fed directly by a demuxer (i.e. not through a filtergraph)
if (src.type == SCH_NODE_TYPE_DEMUX) {
SchDemux *demux = &sch->demux[src.idx];
if (demux->waiter.choked_next == 0)
return; // prevent infinite loop
demux->waiter.choked_next = 0;
for (int i = 0; i < demux->nb_streams; i++)
unchoke_downstream(sch, demux->streams[i].dst);
sch->demux[src.idx].waiter.choked_next = 0;
return;
}
-5
View File
@@ -2607,11 +2607,6 @@ static int create_hwaccel(AVBufferRef **device_ctx)
if (type == AV_HWDEVICE_TYPE_NONE)
return AVERROR(ENOTSUP);
if (!vk_renderer) {
av_log(NULL, AV_LOG_ERROR, "Vulkan renderer is not available\n");
return AVERROR(ENOTSUP);
}
ret = vk_renderer_get_hw_dev(vk_renderer, &vk_dev);
if (ret < 0)
return ret;
+2 -2
View File
@@ -46,6 +46,7 @@ OBJS = ac3_parser.o \
get_buffer.o \
imgconvert.o \
jni.o \
lcevcdec.o \
mathtables.o \
mediacodec.o \
mpeg12framerate.o \
@@ -107,7 +108,7 @@ OBJS-$(CONFIG_H264PARSE) += h264_parse.o h264_ps.o h264data.o \
h2645data.o h2645_parse.o h2645_vui.o
OBJS-$(CONFIG_H264PRED) += h264pred.o
OBJS-$(CONFIG_H264QPEL) += h264qpel.o
OBJS-$(CONFIG_H264_SEI) += h264_sei.o h2645_sei.o aom_film_grain.o
OBJS-$(CONFIG_H264_SEI) += h264_sei.o h2645_sei.o
OBJS-$(CONFIG_HEVCPARSE) += h2645data.o h2645_parse.o h2645_vui.o
OBJS-$(CONFIG_HEVC_SEI) += h2645_sei.o aom_film_grain.o \
dynamic_hdr_vivid.o
@@ -123,7 +124,6 @@ OBJS-$(CONFIG_IVIDSP) += ivi_dsp.o
OBJS-$(CONFIG_JNI) += ffjni.o jni.o
OBJS-$(CONFIG_JPEGTABLES) += jpegtables.o
OBJS-$(CONFIG_LCMS2) += fflcms2.o
OBJS-$(CONFIG_LIBLCEVC_DEC) += lcevcdec.o
OBJS-$(CONFIG_LLAUDDSP) += lossless_audiodsp.o
OBJS-$(CONFIG_LLVIDDSP) += lossless_videodsp.o
OBJS-$(CONFIG_LLVIDENCDSP) += lossless_videoencdsp.o
+3 -45
View File
@@ -62,7 +62,6 @@
#include "libavutil/opt.h"
#include "libavutil/tx.h"
#include "libavutil/version.h"
#include "libavcodec/refstruct.h"
/*
* supported tools
@@ -164,12 +163,6 @@ static av_cold int che_configure(AACDecContext *ac,
}
} else {
if (ac->che[type][id]) {
for (int i = 0; i < FF_ARRAY_ELEMS(ac->tag_che_map); i++) {
for (int j = 0; j < MAX_ELEM_ID; j++) {
if (ac->tag_che_map[i][j] == ac->che[type][id])
ac->tag_che_map[i][j] = NULL;
}
}
ac->proc.sbr_ctx_close(ac->che[type][id]);
}
av_freep(&ac->che[type][id]);
@@ -428,26 +421,6 @@ static uint64_t sniff_channel_order(uint8_t (*layout_map)[3], int tags)
return layout;
}
static void copy_oc(OutputConfiguration *dst, OutputConfiguration *src)
{
int i;
for (i = 0; i < src->usac.nb_elems; i++) {
AACUsacElemConfig *src_e = &src->usac.elems[i];
AACUsacElemConfig *dst_e = &dst->usac.elems[i];
/* dst_e->ext.pl_buf is guaranteed to be set to src_e->ext.pl_buf
* upon this function's return */
ff_refstruct_replace(&dst_e->ext.pl_buf, src_e->ext.pl_buf);
}
/* Unref all additional buffers to close leaks */
for (; i < dst->usac.nb_elems; i++)
ff_refstruct_unref(&dst->usac.elems[i].ext.pl_buf);
/* Set all other properties */
*dst = *src;
}
/**
* Save current output configuration if and only if it has been locked.
*/
@@ -456,7 +429,7 @@ static int push_output_configuration(AACDecContext *ac)
int pushed = 0;
if (ac->oc[1].status == OC_LOCKED || ac->oc[0].status == OC_NONE) {
copy_oc(&ac->oc[0], &ac->oc[1]);
ac->oc[0] = ac->oc[1];
pushed = 1;
}
ac->oc[1].status = OC_NONE;
@@ -470,8 +443,7 @@ static int push_output_configuration(AACDecContext *ac)
static void pop_output_configuration(AACDecContext *ac)
{
if (ac->oc[1].status != OC_LOCKED && ac->oc[0].status != OC_NONE) {
copy_oc(&ac->oc[1], &ac->oc[0]);
ac->oc[1] = ac->oc[0];
ac->avctx->ch_layout = ac->oc[1].ch_layout;
ff_aac_output_configure(ac, ac->oc[1].layout_map, ac->oc[1].layout_map_tags,
ac->oc[1].status, 0);
@@ -494,9 +466,6 @@ int ff_aac_output_configure(AACDecContext *ac,
uint8_t id_map[TYPE_END][MAX_ELEM_ID] = {{ 0 }};
uint8_t type_counts[TYPE_END] = { 0 };
if (get_new_frame && !ac->frame)
return AVERROR_INVALIDDATA;
if (ac->oc[1].layout_map != layout_map) {
memcpy(ac->oc[1].layout_map, layout_map, tags * sizeof(layout_map[0]));
ac->oc[1].layout_map_tags = tags;
@@ -1133,12 +1102,10 @@ static av_cold int decode_close(AVCodecContext *avctx)
for (int i = 0; i < 2; i++) {
OutputConfiguration *oc = &ac->oc[i];
av_channel_layout_uninit(&ac->oc[i].ch_layout);
AACUSACConfig *usac = &oc->usac;
for (int j = 0; j < usac->nb_elems; j++) {
AACUsacElemConfig *ec = &usac->elems[j];
ff_refstruct_unref(&ec->ext.pl_buf);
av_freep(&ec->ext.pl_data);
}
}
@@ -1776,7 +1743,6 @@ int ff_aac_decode_ics(AACDecContext *ac, SingleChannelElement *sce,
return 0;
fail:
memset(sce->sfo, 0, sizeof(sce->sfo));
tns->present = 0;
return ret;
}
@@ -2228,7 +2194,6 @@ static int aac_decode_er_frame(AVCodecContext *avctx, AVFrame *frame,
ac->frame->nb_samples = samples;
ac->frame->sample_rate = avctx->sample_rate;
ac->frame->flags |= AV_FRAME_FLAG_KEY;
*got_frame_ptr = 1;
skip_bits_long(gb, get_bits_left(gb));
@@ -2381,12 +2346,6 @@ static int decode_frame_ga(AVCodecContext *avctx, AACDecContext *ac,
ac->oc[1].status = OC_LOCKED;
}
if (samples && avctx->sample_rate <= 0) {
av_log(avctx, AV_LOG_ERROR,
"Cannot output a frame without a valid sample rate\n");
return AVERROR_INVALIDDATA;
}
if (!ac->frame->data[0] && samples) {
av_log(avctx, AV_LOG_ERROR, "no frame data found\n");
return AVERROR_INVALIDDATA;
@@ -2395,7 +2354,6 @@ static int decode_frame_ga(AVCodecContext *avctx, AACDecContext *ac,
if (samples) {
ac->frame->nb_samples = samples;
ac->frame->sample_rate = avctx->sample_rate;
ac->frame->flags |= AV_FRAME_FLAG_KEY;
*got_frame_ptr = 1;
} else {
av_frame_unref(ac->frame);
+2 -2
View File
@@ -344,7 +344,7 @@ typedef struct AACUsacElemConfig {
uint8_t payload_frag;
uint32_t default_len;
uint32_t pl_data_offset;
uint8_t *pl_buf;
uint8_t *pl_data;
} ext;
} AACUsacElemConfig;
@@ -353,7 +353,7 @@ typedef struct AACUSACConfig {
uint16_t core_frame_len;
uint16_t stream_identifier;
AACUsacElemConfig elems[MAX_ELEM_ID];
AACUsacElemConfig elems[64];
int nb_elems;
struct {
+3 -6
View File
@@ -62,7 +62,7 @@ static void parse_qn(GetBitContext *gb, int *qn, int nk_mode, int no_qn)
{
if (nk_mode == 1) {
for (int k = 0; k < no_qn; k++) {
qn[k] = get_unary(gb, 0, 68); // TODO: find proper ranges
qn[k] = get_unary(gb, 0, INT32_MAX); // TODO: find proper ranges
if (qn[k])
qn[k]++;
}
@@ -75,7 +75,7 @@ static void parse_qn(GetBitContext *gb, int *qn, int nk_mode, int no_qn)
if (nk_mode == 2) {
for (int k = 0; k < no_qn; k++) {
if (qn[k] > 4) {
qn[k] = get_unary(gb, 0, 65);
qn[k] = get_unary(gb, 0, INT32_MAX);;
if (qn[k])
qn[k] += 4;
}
@@ -85,7 +85,7 @@ static void parse_qn(GetBitContext *gb, int *qn, int nk_mode, int no_qn)
for (int k = 0; k < no_qn; k++) {
if (qn[k] > 4) {
int qn_ext = get_unary(gb, 0, 65);
int qn_ext = get_unary(gb, 0, INT32_MAX);;
switch (qn_ext) {
case 0: qn[k] = 5; break;
case 1: qn[k] = 6; break;
@@ -114,9 +114,6 @@ static int parse_codebook_idx(GetBitContext *gb, uint32_t *kv,
}
}
if (nk > 25)
return AVERROR_PATCHWELCOME;
skip_bits(gb, 4*n);
if (nk > 0)
+31 -55
View File
@@ -24,13 +24,12 @@
#include "aacdec_ac.h"
#include "libavcodec/aacsbr.h"
#include "libavcodec/aactab.h"
#include "libavutil/mem.h"
#include "libavcodec/mpeg4audio.h"
#include "libavcodec/unary.h"
#include "libavutil/mem.h"
#include "libavcodec/refstruct.h"
/* Number of scalefactor bands per complex prediction band, equal to 2. */
#define SFB_PER_PRED_BAND 2
@@ -213,33 +212,18 @@ static int decode_usac_element_pair(AACDecContext *ac,
if (e->stereo_config_index) {
e->mps.freq_res = get_bits(gb, 3); /* bsFreqRes */
if (!e->mps.freq_res)
return AVERROR_INVALIDDATA; /* value 0 is reserved */
int numBands = ((int[]){0,28,20,14,10,7,5,4})[e->mps.freq_res]; // ISO/IEC 23003-1:2007, 5.2, Table 39
e->mps.fixed_gain = get_bits(gb, 3); /* bsFixedGainDMX */
e->mps.temp_shape_config = get_bits(gb, 2); /* bsTempShapeConfig */
e->mps.decorr_config = get_bits(gb, 2); /* bsDecorrConfig */
e->mps.high_rate_mode = get_bits1(gb); /* bsHighRateMode */
e->mps.phase_coding = get_bits1(gb); /* bsPhaseCoding */
int otts_bands_phase = ((int[]){0,10,10,7,5,3,2,2})[e->mps.freq_res]; // Table 109 — Default value of bsOttBandsPhase
if (get_bits1(gb)) { /* bsOttBandsPhasePresent */
otts_bands_phase = get_bits(gb, 5); /* bsOttBandsPhase */
if (otts_bands_phase > numBands)
return AVERROR_INVALIDDATA;
}
e->mps.otts_bands_phase = otts_bands_phase;
if (get_bits1(gb)) /* bsOttBandsPhasePresent */
e->mps.otts_bands_phase = get_bits(gb, 5); /* bsOttBandsPhase */
e->mps.residual_coding = e->stereo_config_index >= 2; /* bsResidualCoding */
if (e->mps.residual_coding) {
int residual_bands = get_bits(gb, 5); /* bsResidualBands */
if (residual_bands > numBands)
return AVERROR_INVALIDDATA;
e->mps.residual_bands = residual_bands;
e->mps.otts_bands_phase = FFMAX(e->mps.otts_bands_phase,
e->mps.residual_bands);
e->mps.residual_bands = get_bits(gb, 5); /* bsResidualBands */
e->mps.pseudo_lr = get_bits1(gb); /* bsPseudoLr */
}
if (e->mps.temp_shape_config == 2)
@@ -281,7 +265,6 @@ static int decode_usac_extension(AACDecContext *ac, AACUsacElemConfig *e,
/* No configuration needed - fallthrough (len should be 0) */
default:
skip_bits(gb, 8*ext_config_len);
e->ext.type = ID_EXT_ELE_FILL;
break;
};
@@ -330,7 +313,7 @@ int ff_aac_usac_reset_state(AACDecContext *ac, OutputConfiguration *oc)
ff_aac_sbr_config_usac(ac, che, e);
for (int j = 0; j < ch; j++) {
SingleChannelElement *sce = &che->ch[j];
SingleChannelElement *sce = &che->ch[ch];
AACUsacElemData *ue = &sce->ue;
memset(ue, 0, sizeof(*ue));
@@ -373,8 +356,6 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx,
freq_idx = get_bits(gb, 5); /* usacSamplingFrequencyIndex */
if (freq_idx == 0x1f) {
samplerate = get_bits(gb, 24); /* usacSamplingFrequency */
if (samplerate == 0)
return AVERROR(EINVAL);
} else {
samplerate = ff_aac_usac_samplerate[freq_idx];
if (samplerate < 0)
@@ -585,8 +566,15 @@ static int decode_usac_scale_factors(AACDecContext *ac,
int offset_sf = global_gain;
for (int g = 0; g < ics->num_window_groups; g++) {
for (int sfb = 0; sfb < ics->max_sfb; sfb++) {
if (g || sfb)
offset_sf += get_vlc2(gb, ff_vlc_scalefactors, 7, 3) - SCALE_DIFF_ZERO;
/* First coefficient is just the global gain */
if (!g && !sfb) {
/* The cannonical representation of quantized scalefactors
* in the spec is with 100 subtracted. */
sce->sfo[0] = offset_sf - 100;
continue;
}
offset_sf += get_vlc2(gb, ff_vlc_scalefactors, 7, 3) - SCALE_DIFF_ZERO;
if (offset_sf > 255U) {
av_log(ac->avctx, AV_LOG_ERROR,
"Scalefactor (%d) out of range.\n", offset_sf);
@@ -929,10 +917,8 @@ static int decode_usac_stereo_info(AACDecContext *ac, AACUSACConfig *usac,
}
ret = setup_sce(ac, sce1, usac);
if (ret < 0) {
ics2->max_sfb = 0;
if (ret < 0)
return ret;
}
ret = setup_sce(ac, sce2, usac);
if (ret < 0)
@@ -1041,9 +1027,8 @@ static void apply_noise_fill(AACDecContext *ac, SingleChannelElement *sce,
}
}
if (band_quantized_to_zero) {
sce->sfo[g*ics->max_sfb + sfb] = FFMAX(sce->sfo[g*ics->max_sfb + sfb] + noise_offset, -200);
}
if (band_quantized_to_zero)
sce->sfo[g*ics->max_sfb + sfb] += noise_offset;
}
coef += g_len << 7;
}
@@ -1305,8 +1290,7 @@ static void spectrum_decode(AACDecContext *ac, AACUSACConfig *usac,
SingleChannelElement *sce = &cpe->ch[ch];
AACUsacElemData *ue = &sce->ue;
if (!ue->core_mode)
spectrum_scale(ac, sce, ue);
spectrum_scale(ac, sce, ue);
}
if (nb_channels > 1 && us->common_window) {
@@ -1356,9 +1340,8 @@ static void spectrum_decode(AACDecContext *ac, AACUSACConfig *usac,
if (sce->tns.present && ((nb_channels == 1) || (us->tns_on_lr)))
ac->dsp.apply_tns(sce->coeffs, &sce->tns, &sce->ics, 1);
if (!sce->ue.core_mode)
ac->oc[1].m4ac.frame_length_short ? ac->dsp.imdct_and_windowing_768(ac, sce) :
ac->dsp.imdct_and_windowing(ac, sce);
ac->oc[1].m4ac.frame_length_short ? ac->dsp.imdct_and_windowing_768(ac, sce) :
ac->dsp.imdct_and_windowing(ac, sce);
}
}
@@ -1594,6 +1577,7 @@ static int parse_audio_preroll(AACDecContext *ac, GetBitContext *gb)
static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
GetBitContext *gb)
{
uint8_t *tmp;
uint8_t pl_frag_start = 1;
uint8_t pl_frag_end = 1;
uint32_t len;
@@ -1620,26 +1604,18 @@ static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
if (pl_frag_start)
e->ext.pl_data_offset = 0;
/* If an extension starts and ends this packet, we can directly use it below.
* Otherwise, we have to copy it to a buffer and accumulate it. */
/* If an extension starts and ends this packet, we can directly use it */
if (!(pl_frag_start && pl_frag_end)) {
/* Reallocate the data */
uint8_t *tmp_buf = ff_refstruct_alloc_ext(e->ext.pl_data_offset + len,
FF_REFSTRUCT_FLAG_NO_ZEROING,
NULL, NULL);
if (!tmp_buf)
tmp = av_realloc(e->ext.pl_data, e->ext.pl_data_offset + len);
if (!tmp) {
av_free(e->ext.pl_data);
return AVERROR(ENOMEM);
/* Copy the data over only if we had saved data to begin with */
if (e->ext.pl_buf)
memcpy(tmp_buf, e->ext.pl_buf, e->ext.pl_data_offset);
ff_refstruct_unref(&e->ext.pl_buf);
e->ext.pl_buf = tmp_buf;
}
e->ext.pl_data = tmp;
/* Readout data to a buffer */
for (int i = 0; i < len; i++)
e->ext.pl_buf[e->ext.pl_data_offset + i] = get_bits(gb, 8);
e->ext.pl_data[e->ext.pl_data_offset + i] = get_bits(gb, 8);
}
e->ext.pl_data_offset += len;
@@ -1651,7 +1627,7 @@ static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
GetBitContext *gb2 = gb;
GetBitContext gbc;
if (!(pl_frag_start && pl_frag_end)) {
ret = init_get_bits8(&gbc, e->ext.pl_buf, pl_len);
ret = init_get_bits8(&gbc, e->ext.pl_data, pl_len);
if (ret < 0)
return ret;
@@ -1669,7 +1645,7 @@ static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
/* This should never happen */
av_assert0(0);
}
ff_refstruct_unref(&e->ext.pl_buf);
av_freep(&e->ext.pl_data);
if (ret < 0)
return ret;
+1 -8
View File
@@ -40,8 +40,6 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1,
int new_frame_start;
int got_frame = 0;
s1->key_frame = -1;
if (s1->flags & PARSER_FLAG_COMPLETE_FRAMES) {
i = buf_size;
got_frame = 1;
@@ -147,15 +145,10 @@ get_next:
} else {
#if CONFIG_AAC_PARSER
AACADTSHeaderInfo hdr;
GetBitContext gb;
int profile;
init_get_bits8(&gb, buf, buf_size);
if (buf_size < AV_AAC_ADTS_HEADER_SIZE ||
ff_adts_header_parse(&gb, &hdr) < 0)
ff_adts_header_parse_buf(buf, &hdr) < 0)
return i;
avctx->profile = hdr.object_type - 1;
s1->key_frame = (avctx->profile == AV_PROFILE_AAC_USAC) ? get_bits1(&gb) : 1;
bit_rate = hdr.bit_rate;
#endif
}
-2
View File
@@ -1177,8 +1177,6 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
ff_af_queue_remove(&s->afq, avctx->frame_size, &avpkt->pts,
&avpkt->duration);
avpkt->flags |= AV_PKT_FLAG_KEY;
*got_packet_ptr = 1;
return 0;
}
+9 -24
View File
@@ -173,7 +173,6 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
sce->ics.window_sequence[0] == LONG_START_SEQUENCE ? 0 : 2;
const int sfb_len = sfb_end - sfb_start;
const int coef_len = sce->ics.swb_offset[sfb_end] - sce->ics.swb_offset[sfb_start];
const int n_filt = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
if (coef_len <= 0 || sfb_len <= 0) {
sce->tns.present = 0;
@@ -181,30 +180,16 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
}
for (w = 0; w < sce->ics.num_windows; w++) {
float en[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float en[2] = {0.0f, 0.0f};
int oc_start = 0;
int coef_start = sce->ics.swb_offset[sfb_start];
if (n_filt == 2) {
for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[w*16+g];
if (g > sfb_start + (sfb_len/2))
en[1] += band->energy; /* End */
else
en[0] += band->energy; /* Start */
}
en[2] = en[0];
} else {
for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[w*16+g];
if (g > sfb_start + (sfb_len/2) + (sfb_len/4))
en[2] += band->energy; /* End */
else if (g > sfb_start + (sfb_len/2) - (sfb_len/4))
en[1] += band->energy; /* Middle */
else
en[0] += band->energy; /* Start */
}
en[3] = en[0];
for (g = sfb_start; g < sce->ics.num_swb && g <= sfb_end; g++) {
FFPsyBand *band = &s->psy.ch[s->cur_channel].psy_bands[w*16+g];
if (g > sfb_start + (sfb_len/2))
en[1] += band->energy;
else
en[0] += band->energy;
}
/* LPC */
@@ -214,9 +199,9 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
if (!order || !isfinite(gain) || gain < TNS_GAIN_THRESHOLD_LOW || gain > TNS_GAIN_THRESHOLD_HIGH)
continue;
tns->n_filt[w] = n_filt;
tns->n_filt[w] = is8 ? 1 : order != TNS_MAX_ORDER ? 2 : 3;
for (g = 0; g < tns->n_filt[w]; g++) {
tns->direction[w][g] = slant != 2 ? slant : en[g] < en[g + 1];
tns->direction[w][g] = slant != 2 ? slant : en[g] < en[!g];
tns->order[w][g] = order/tns->n_filt[w];
tns->length[w][g] = sfb_len/tns->n_filt[w];
quantize_coefs(&coefs[oc_start], tns->coef_idx[w][g], tns->coef[w][g],
+1 -1
View File
@@ -49,7 +49,7 @@ static inline void quantize_bands(int *out, const float *in, const float *scaled
{
for (int i = 0; i < size; i++) {
float qc = scaled[i] * Q34;
int tmp = (int)FFMIN((float)(qc + rounding), (float)maxval);
int tmp = (int)FFMIN(qc + rounding, (float)maxval);
if (is_signed && in[i] < 0.0f) {
tmp = -tmp;
}
-7
View File
@@ -599,7 +599,6 @@ static int sbr_make_f_derived(AACDecContext *ac, SpectralBandReplication *sbr)
if (sbr->n_q > 5) {
av_log(ac->avctx, AV_LOG_ERROR, "Too many noise floor scale factors: %d\n", sbr->n_q);
sbr->n_q = 1;
return -1;
}
@@ -1626,9 +1625,6 @@ static void sbr_env_estimate(AAC_FLOAT (*e_curr)[48], INTFLOAT X_high[64][40][2]
int ilb = ch_data->t_env[e] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
if (ilb >= 40)
return;
for (m = 0; m < sbr->m[1]; m++) {
AAC_FLOAT sum = sbr->dsp.sum_square(X_high[m+kx1] + ilb, iub - ilb);
#if USE_FIXED
@@ -1647,9 +1643,6 @@ static void sbr_env_estimate(AAC_FLOAT (*e_curr)[48], INTFLOAT X_high[64][40][2]
int iub = ch_data->t_env[e + 1] * 2 + ENVELOPE_ADJUSTMENT_OFFSET;
const uint16_t *table = ch_data->bs_freq_res[e + 1] ? sbr->f_tablehigh : sbr->f_tablelow;
if (ilb >= 40)
return;
for (p = 0; p < sbr->n[ch_data->bs_freq_res[e + 1]]; p++) {
#if USE_FIXED
SoftFloat sum = FLOAT_0;
+18 -15
View File
@@ -489,10 +489,10 @@ function ff_pred16x16_plane_neon_10, export=1
mul v2.8h, v2.8h, v0.8h
mul v3.8h, v3.8h, v0.8h
addp v2.8h, v2.8h, v3.8h
saddlp v2.4s, v2.8h
addp v2.4s, v2.4s, v2.4s
shl v3.4s, v2.4s, #2
add v2.4s, v3.4s, v2.4s
addp v2.8h, v2.8h, v2.8h
addp v2.4h, v2.4h, v2.4h
sshll v3.4s, v2.4h, #2
saddw v2.4s, v3.4s, v2.4h
rshrn v4.4h, v2.4s, #6
trn2 v5.4h, v4.4h, v4.4h
add v2.4h, v4.4h, v5.4h
@@ -502,26 +502,28 @@ function ff_pred16x16_plane_neon_10, export=1
add v7.4h, v7.4h, v0.4h
shl v2.4h, v7.4h, #4
ssubl v2.4s, v2.4h, v3.4h
shl v3.4h, v4.4h, #4
ext v0.16b, v0.16b, v0.16b, #14
sxtl v6.4s, v5.4h // c
ssubl v6.4s, v5.4h, v3.4h
mov v0.h[0], wzr
mul v0.8h, v0.8h, v4.h[0]
dup v16.4s, v2.s[0]
dup v17.4s, v2.s[0]
dup v2.8h, v4.h[0] // b
dup v3.4s, v6.s[0] // c
sshll v2.4s, v2.4h, #3 // b * 8
smlal v16.4s, v0.4h, v4.h[0]
smlal2 v17.4s, v0.8h, v4.h[0]
sub v3.4s, v3.4s, v2.4s
dup v2.8h, v4.h[0]
dup v3.4s, v6.s[0]
shl v2.8h, v2.8h, #3
saddw v16.4s, v16.4s, v0.4h
saddw2 v17.4s, v17.4s, v0.8h
saddw v3.4s, v3.4s, v2.4h
mov w3, #16
mvni v4.8h, #0xFC, lsl #8 // 1023 for clipping
1:
sqshrun v0.4h, v16.4s, #5
sqshrun2 v0.8h, v17.4s, #5
add v16.4s, v16.4s, v2.4s
add v17.4s, v17.4s, v2.4s
saddw v16.4s, v16.4s, v2.4h
saddw v17.4s, v17.4s, v2.4h
sqshrun v1.4h, v16.4s, #5
sqshrun2 v1.8h, v17.4s, #5
add v16.4s, v16.4s, v3.4s
@@ -593,11 +595,12 @@ function ff_pred8x8_plane_neon_10, export=1
ssubl v2.4s, v2.4h, v3.4h
ext v0.16b, v0.16b, v0.16b, #14
mov v0.h[0], wzr
mul v0.8h, v0.8h, v5.h[0]
dup v1.4s, v2.s[0]
dup v2.4s, v2.s[0]
dup v3.8h, v5.h[1]
smlal v1.4s, v0.4h, v5.h[0]
smlal2 v2.4s, v0.8h, v5.h[0]
saddw v1.4s, v1.4s, v0.4h
saddw2 v2.4s, v2.4s, v0.8h
mov w3, #8
mvni v4.8h, #0xFC, lsl #8 // 1023 for clipping
1:
+28 -30
View File
@@ -50,13 +50,12 @@
.endm
.macro pixels16_x2 rnd=1, avg=0
1:
ldur q1, [x1, #1]
ld1 {v0.16b}, [x1], x2
1: ld1 {v0.16b, v1.16b}, [x1], x2
ld1 {v2.16b, v3.16b}, [x1], x2
subs w3, w3, #2
ldur q3, [x1, #1]
ld1 {v2.16b}, [x1], x2
ext v1.16b, v0.16b, v1.16b, #1
avg v0.16b, v0.16b, v1.16b
ext v3.16b, v2.16b, v3.16b, #1
avg v2.16b, v2.16b, v3.16b
.if \avg
ld1 {v1.16b}, [x0], x2
@@ -109,20 +108,20 @@
.macro pixels16_xy2 rnd=1, avg=0
sub w3, w3, #2
ldur q1, [x1, #1]
ld1 {v0.16b}, [x1], x2
ld1 {v0.16b, v1.16b}, [x1], x2
ld1 {v4.16b, v5.16b}, [x1], x2
NRND movi v26.8H, #1
ldur q5, [x1, #1]
ld1 {v4.16b}, [x1], x2
ext v1.16b, v0.16b, v1.16b, #1
ext v5.16b, v4.16b, v5.16b, #1
uaddl v16.8h, v0.8b, v1.8b
uaddl2 v20.8h, v0.16b, v1.16b
uaddl v18.8h, v4.8b, v5.8b
uaddl2 v22.8h, v4.16b, v5.16b
1: subs w3, w3, #2
ldur q30, [x1, #1]
ld1 {v0.16b}, [x1], x2
ld1 {v0.16b, v1.16b}, [x1], x2
add v24.8h, v16.8h, v18.8h
NRND add v24.8H, v24.8H, v26.8H
ext v30.16b, v0.16b, v1.16b, #1
add v1.8h, v20.8h, v22.8h
mshrn v28.8b, v24.8h, #2
NRND add v1.8H, v1.8H, v26.8H
@@ -132,12 +131,12 @@ NRND add v1.8H, v1.8H, v26.8H
urhadd v28.16b, v28.16b, v16.16b
.endif
uaddl v16.8h, v0.8b, v30.8b
ldur q3, [x1, #1]
ld1 {v2.16b}, [x1], x2
ld1 {v2.16b, v3.16b}, [x1], x2
uaddl2 v20.8h, v0.16b, v30.16b
st1 {v28.16b}, [x0], x2
add v24.8h, v16.8h, v18.8h
NRND add v24.8H, v24.8H, v26.8H
ext v3.16b, v2.16b, v3.16b, #1
add v0.8h, v20.8h, v22.8h
mshrn v30.8b, v24.8h, #2
NRND add v0.8H, v0.8H, v26.8H
@@ -151,10 +150,10 @@ NRND add v0.8H, v0.8H, v26.8H
st1 {v30.16b}, [x0], x2
b.gt 1b
ldur q30, [x1, #1]
ld1 {v0.16b}, [x1], x2
ld1 {v0.16b, v1.16b}, [x1], x2
add v24.8h, v16.8h, v18.8h
NRND add v24.8H, v24.8H, v26.8H
ext v30.16b, v0.16b, v1.16b, #1
add v1.8h, v20.8h, v22.8h
mshrn v28.8b, v24.8h, #2
NRND add v1.8H, v1.8H, v26.8H
@@ -207,11 +206,10 @@ NRND add v0.8H, v0.8H, v26.8H
.endm
.macro pixels8_x2 rnd=1, avg=0
1:
ldur d1, [x1, #1]
ld1 {v0.8b}, [x1], x2
ldur d3, [x1, #1]
ld1 {v2.8b}, [x1], x2
1: ld1 {v0.8b, v1.8b}, [x1], x2
ext v1.8b, v0.8b, v1.8b, #1
ld1 {v2.8b, v3.8b}, [x1], x2
ext v3.8b, v2.8b, v3.8b, #1
subs w3, w3, #2
avg v0.8b, v0.8b, v1.8b
avg v2.8b, v2.8b, v3.8b
@@ -265,23 +263,22 @@ NRND add v0.8H, v0.8H, v26.8H
.endm
.macro pixels8_xy2 rnd=1, avg=0
ldur d4, [x1, #1]
sub w3, w3, #2
ld1 {v0.8b}, [x1], x2
ld1 {v0.16b}, [x1], x2
ld1 {v1.16b}, [x1], x2
NRND movi v19.8H, #1
ldur d6, [x1, #1]
ld1 {v1.8b}, [x1], x2
ext v4.16b, v0.16b, v4.16b, #1
ext v6.16b, v1.16b, v6.16b, #1
uaddl v16.8h, v0.8b, v4.8b
uaddl v17.8h, v1.8b, v6.8b
1: subs w3, w3, #2
ldur d4, [x1, #1]
ld1 {v0.8b}, [x1], x2
ld1 {v0.16b}, [x1], x2
add v18.8h, v16.8h, v17.8h
ext v4.16b, v0.16b, v4.16b, #1
NRND add v18.8H, v18.8H, v19.8H
uaddl v16.8h, v0.8b, v4.8b
mshrn v5.8b, v18.8h, #2
ldur d6, [x1, #1]
ld1 {v1.8b}, [x1], x2
ld1 {v1.16b}, [x1], x2
add v18.8h, v16.8h, v17.8h
.if \avg
ld1 {v7.8b}, [x0]
@@ -294,13 +291,14 @@ NRND add v18.8H, v18.8H, v19.8H
ld1 {v5.8b}, [x0]
urhadd v7.8b, v7.8b, v5.8b
.endif
ext v6.16b, v1.16b, v6.16b, #1
uaddl v17.8h, v1.8b, v6.8b
st1 {v7.8b}, [x0], x2
b.gt 1b
ldur d4, [x1, #1]
ld1 {v0.8b}, [x1], x2
ld1 {v0.16b}, [x1], x2
add v18.8h, v16.8h, v17.8h
ext v4.16b, v0.16b, v4.16b, #1
NRND add v18.8H, v18.8H, v19.8H
uaddl v16.8h, v0.8b, v4.8b
mshrn v5.8b, v18.8h, #2
+1 -9
View File
@@ -230,9 +230,6 @@ function \type\()_8tap_\size\()h_\idx1\idx2
// reduced dst stride
.if \size >= 16
sub x1, x1, x5
.elseif \size == 4
add x12, x2, #8
add x13, x7, #8
.endif
// size >= 16 loads two qwords and increments x2,
// for size 4/8 it's enough with one qword and no
@@ -251,14 +248,9 @@ function \type\()_8tap_\size\()h_\idx1\idx2
.if \size >= 16
ld1 {v4.8b, v5.8b, v6.8b}, [x2], #24
ld1 {v16.8b, v17.8b, v18.8b}, [x7], #24
.elseif \size == 8
.else
ld1 {v4.8b, v5.8b}, [x2]
ld1 {v16.8b, v17.8b}, [x7]
.else // \size == 4
ld1 {v4.8b}, [x2]
ld1 {v16.8b}, [x7]
ld1 {v5.s}[0], [x12], x3
ld1 {v17.s}[0], [x13], x3
.endif
uxtl v4.8h, v4.8b
uxtl v5.8h, v5.8b
+2 -2
View File
@@ -148,7 +148,7 @@
sqxtun v20.8b, v20.8h
str d20, [dst]
.else
umin v20.8h, v20.8h, v25.8h
smin v20.8h, v20.8h, v25.8h
str q20, [dst]
.endif
ret
@@ -249,7 +249,7 @@
sqxtun v20.8b, v20.8h
str s20, [dst]
.else
umin v20.4h, v20.4h, v25.4h
smin v20.4h, v20.4h, v25.4h
str d20, [dst]
.endif
ret
+1 -1
View File
@@ -199,6 +199,7 @@ static void ac3_downmix(AVCodecContext *avctx)
av_channel_layout_uninit(&avctx->ch_layout);
avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO;
}
s->downmixed = 1;
}
/**
@@ -240,7 +241,6 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
ac3_downmix(avctx);
s->downmixed = 1;
for (i = 0; i < AC3_MAX_CHANNELS; i++) {
s->xcfptr[i] = s->transform_coeffs[i];
-2
View File
@@ -857,8 +857,6 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
if(ch <= 0)
return 0;
if (buf_size > INT_MAX / 14)
return 0;
switch (avctx->codec->id) {
/* constant, only check buf_size */
+6 -10
View File
@@ -408,14 +408,12 @@ static int decode_inter_plane(AGMContext *s, GetBitContext *gb, int size,
int map = s->map[x];
if (orig_mv_x >= -32) {
int src_y = (s->blocks_h - 1 - y) * 8 - mv_y;
int src_x = x * 8 + mv_x;
if (src_y < 0 || src_y + 8 > h ||
src_x < 0 || src_x + 8 > w)
if (y * 8 + mv_y < 0 || y * 8 + mv_y + 8 > h ||
x * 8 + mv_x < 0 || x * 8 + mv_x + 8 > w)
return AVERROR_INVALIDDATA;
copy_block8(frame->data[plane] + (s->blocks_h - 1 - y) * 8 * frame->linesize[plane] + x * 8,
prev->data[plane] + src_y * prev->linesize[plane] + src_x,
prev->data[plane] + ((s->blocks_h - 1 - y) * 8 - mv_y) * prev->linesize[plane] + (x * 8 + mv_x),
frame->linesize[plane], prev->linesize[plane], 8);
if (map) {
s->idsp.idct(s->wblocks + x * 64);
@@ -447,14 +445,12 @@ static int decode_inter_plane(AGMContext *s, GetBitContext *gb, int size,
return ret;
if (orig_mv_x >= -32) {
int src_y = (s->blocks_h - 1 - y) * 8 - mv_y;
int src_x = x * 8 + mv_x;
if (src_y < 0 || src_y + 8 > h ||
src_x < 0 || src_x + 8 > w)
if (y * 8 + mv_y < 0 || y * 8 + mv_y + 8 > h ||
x * 8 + mv_x < 0 || x * 8 + mv_x + 8 > w)
return AVERROR_INVALIDDATA;
copy_block8(frame->data[plane] + (s->blocks_h - 1 - y) * 8 * frame->linesize[plane] + x * 8,
prev->data[plane] + src_y * prev->linesize[plane] + src_x,
prev->data[plane] + ((s->blocks_h - 1 - y) * 8 - mv_y) * prev->linesize[plane] + (x * 8 + mv_x),
frame->linesize[plane], prev->linesize[plane], 8);
if (map) {
s->idsp.idct(s->block);
+6 -19
View File
@@ -1540,12 +1540,8 @@ static int read_diff_float_data(ALSDecContext *ctx, unsigned int ra_frame) {
return AVERROR_INVALIDDATA;
}
j = 0;
for (i = 0; i < frame_length; ++i) {
if (ctx->raw_samples[c][i] == 0) {
ctx->raw_mantissa[c][i] = AV_RB32(larray + j);
j += 4;
}
ctx->raw_mantissa[c][i] = AV_RB32(larray);
}
}
}
@@ -1556,10 +1552,7 @@ static int read_diff_float_data(ALSDecContext *ctx, unsigned int ra_frame) {
if (ctx->raw_samples[c][i] != 0) {
//The following logic is taken from Tabel 14.45 and 14.46 from the ISO spec
if (av_cmp_sf_ieee754(acf[c], FLOAT_1)) {
int nbit = av_log2(FFABSU(ctx->raw_samples[c][i]));
if (nbit > 23)
return AVERROR_INVALIDDATA;
nbits[i] = 23 - nbit;
nbits[i] = 23 - av_log2(abs(ctx->raw_samples[c][i]));
} else {
nbits[i] = 23;
}
@@ -1633,7 +1626,7 @@ static int read_diff_float_data(ALSDecContext *ctx, unsigned int ra_frame) {
tmp_32 = (sign << 31) | ((e + EXP_BIAS) << 23) | (mantissa);
ctx->raw_samples[c][i] = tmp_32;
} else {
ctx->raw_samples[c][i] = raw_mantissa[c][i];
ctx->raw_samples[c][i] = raw_mantissa[c][i] & 0x007fffffUL;
}
}
align_get_bits(gb);
@@ -1789,9 +1782,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
}
if (sconf->floating) {
ret = read_diff_float_data(ctx, ra_frame);
if (ret < 0)
return ret;
read_diff_float_data(ctx, ra_frame);
}
if (get_bits_left(gb) < 0) {
@@ -2128,8 +2119,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx->nbits = av_malloc_array(ctx->cur_frame_length, sizeof(*ctx->nbits));
ctx->mlz = av_mallocz(sizeof(*ctx->mlz));
if (!ctx->larray || !ctx->nbits || !ctx->mlz || !ctx->acf || !ctx->shift_value
|| !ctx->last_shift_value || !ctx->last_acf_mantissa || !ctx->raw_mantissa) {
if (!ctx->mlz || !ctx->acf || !ctx->shift_value || !ctx->last_shift_value
|| !ctx->last_acf_mantissa || !ctx->raw_mantissa) {
av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
return AVERROR(ENOMEM);
}
@@ -2141,10 +2132,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
for (c = 0; c < channels; ++c) {
ctx->raw_mantissa[c] = av_calloc(ctx->cur_frame_length, sizeof(**ctx->raw_mantissa));
if (!ctx->raw_mantissa[c]) {
av_log(avctx, AV_LOG_ERROR, "Allocating buffer memory failed.\n");
return AVERROR(ENOMEM);
}
}
}
+11 -41
View File
@@ -26,9 +26,7 @@
*/
#include "libavutil/avassert.h"
#include "libavutil/buffer.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "aom_film_grain.h"
#include "get_bits.h"
@@ -126,7 +124,7 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
{
GetBitContext gbc, *gb = &gbc;
AVFilmGrainAOMParams *aom;
AVFilmGrainParams *fgp = NULL, *ref = NULL;
AVFilmGrainParams *fgp, *ref = NULL;
int ret, num_sets, n, i, uv, num_y_coeffs, update_grain, luma_only;
ret = init_get_bits8(gb, payload, payload_size);
@@ -137,39 +135,28 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
if (!s->enable)
return 0;
for (int i = 0; i < FF_ARRAY_ELEMS(s->sets); i++)
av_buffer_unref(&s->sets[i]);
skip_bits(gb, 4); // reserved
num_sets = get_bits(gb, 3) + 1;
for (n = 0; n < num_sets; n++) {
int payload_4byte, payload_size, set_idx, apply_units_log2, vsc_flag;
int predict_scaling, predict_y_scaling, predict_uv_scaling[2];
int payload_bits, start_position;
size_t fgp_size;
start_position = get_bits_count(gb);
payload_4byte = get_bits1(gb);
payload_size = get_bits(gb, payload_4byte ? 2 : 8);
set_idx = get_bits(gb, 3);
fgp = av_film_grain_params_alloc(&fgp_size);
if (!fgp || s->sets[set_idx])
goto error;
fgp = &s->sets[set_idx];
aom = &fgp->codec.aom;
fgp->type = get_bits1(gb) ? AV_FILM_GRAIN_PARAMS_AV1 : AV_FILM_GRAIN_PARAMS_NONE;
if (!fgp->type) {
av_freep(&fgp);
if (!fgp->type)
continue;
}
fgp->seed = get_bits(gb, 16);
update_grain = get_bits1(gb);
if (!update_grain) {
av_freep(&fgp);
if (!update_grain)
continue;
}
apply_units_log2 = get_bits(gb, 4);
fgp->width = get_bits(gb, 12) << apply_units_log2;
@@ -213,7 +200,7 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
}
predict_scaling = get_bits1(gb);
if (predict_scaling && !ref)
if (predict_scaling && (!ref || ref == fgp))
goto error; // prediction must be from valid, different set
predict_y_scaling = predict_scaling ? get_bits1(gb) : 0;
@@ -343,49 +330,32 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
if (payload_bits > payload_size * 8)
goto error;
skip_bits(gb, payload_size * 8 - payload_bits);
av_buffer_unref(&s->sets[set_idx]);
s->sets[set_idx] = av_buffer_create((uint8_t *)fgp, fgp_size, NULL, NULL, 0);
if (!s->sets[set_idx])
goto error;
}
return 0;
error:
av_free(fgp);
ff_aom_uninit_film_grain_params(s);
memset(s, 0, sizeof(*s));
return AVERROR_INVALIDDATA;
}
int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *frame)
{
AVFilmGrainParams *fgp;
if (!s->enable)
return 0;
for (int i = 0; i < FF_ARRAY_ELEMS(s->sets); i++) {
AVBufferRef *buf;
if (!s->sets[i])
if (s->sets[i].type != AV_FILM_GRAIN_PARAMS_AV1)
continue;
buf = av_buffer_ref(s->sets[i]);
if (!buf || !av_frame_new_side_data_from_buf(frame,
AV_FRAME_DATA_FILM_GRAIN_PARAMS, buf)) {
av_buffer_unref(&buf);
fgp = av_film_grain_params_create_side_data(frame);
if (!fgp)
return AVERROR(ENOMEM);
}
memcpy(fgp, &s->sets[i], sizeof(*fgp));
}
return 0;
}
void ff_aom_uninit_film_grain_params(AVFilmGrainAFGS1Params *s)
{
for (int i = 0; i < FF_ARRAY_ELEMS(s->sets); i++)
av_buffer_unref(&s->sets[i]);
s->enable = 0;
}
// Taken from the AV1 spec. Range is [-2048, 2047], mean is 0 and stddev is 512
static const int16_t gaussian_sequence[2048] = {
56, 568, -180, 172, 124, -84, 172, -64, -900, 24, 820,
+1 -5
View File
@@ -28,12 +28,11 @@
#ifndef AVCODEC_AOM_FILM_GRAIN_H
#define AVCODEC_AOM_FILM_GRAIN_H
#include "libavutil/buffer.h"
#include "libavutil/film_grain_params.h"
typedef struct AVFilmGrainAFGS1Params {
int enable;
AVBufferRef *sets[8];
AVFilmGrainParams sets[8];
} AVFilmGrainAFGS1Params;
// Synthesizes film grain on top of `in` and stores the result to `out`. `out`
@@ -49,7 +48,4 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
// Attach all valid film grain param sets to `frame`.
int ff_aom_attach_film_grain_sets(const AVFilmGrainAFGS1Params *s, AVFrame *frame);
// Free all allocations in `s` and zero the entire struct.
void ff_aom_uninit_film_grain_params(AVFilmGrainAFGS1Params *s);
#endif /* AVCODEC_AOM_FILM_GRAIN_H */
+1
View File
@@ -48,3 +48,4 @@ function ff_scalarproduct_int16_neon, export=1
vmov.32 r0, d3[0]
bx lr
endfunc
+3 -10
View File
@@ -279,13 +279,11 @@ function \type\()_8tap_\size\()h_\idx1\idx2
sub r1, r1, r5
.endif
@ size >= 16 loads two qwords and increments r2,
@ size 4 loads 1 d word, increments r2 and loads 1 32-bit lane
@ for size 8 it's enough with one qword and no postincrement
@ for size 4/8 it's enough with one qword and no
@ postincrement
.if \size >= 16
sub r3, r3, r5
sub r3, r3, #8
.elseif \size == 4
sub r3, r3, #8
.endif
@ Load the filter vector
vld1.16 {q0}, [r12,:128]
@@ -297,14 +295,9 @@ function \type\()_8tap_\size\()h_\idx1\idx2
.if \size >= 16
vld1.8 {d18, d19, d20}, [r2]!
vld1.8 {d24, d25, d26}, [r7]!
.elseif \size == 8
.else
vld1.8 {q9}, [r2]
vld1.8 {q12}, [r7]
.else @ size == 4
vld1.8 {d18}, [r2]!
vld1.8 {d24}, [r7]!
vld1.32 {d19[0]}, [r2]
vld1.32 {d25[0]}, [r7]
.endif
vmovl.u8 q8, d18
vmovl.u8 q9, d19
-2
View File
@@ -542,8 +542,6 @@ static int ffat_decode(AVCodecContext *avctx, AVFrame *frame,
frame->nb_samples = avctx->frame_size;
frame->flags |= AV_FRAME_FLAG_KEY;
out_buffers.mBuffers[0].mData = at->decoded_data;
ret = AudioConverterFillComplexBuffer(at->converter, ffat_decode_callback, avctx,
-1
View File
@@ -576,7 +576,6 @@ static int ffat_encode(AVCodecContext *avctx, AVPacket *avpkt,
avctx->frame_size,
&avpkt->pts,
&avpkt->duration);
avpkt->flags |= AV_PKT_FLAG_KEY;
} else if (ret && ret != 1) {
av_log(avctx, AV_LOG_ERROR, "Encode error: %i\n", ret);
return AVERROR_EXTERNAL;
+4 -14
View File
@@ -98,11 +98,12 @@ static int32_t decode_signed_subexp_with_ref(uint32_t sub_exp, int low,
static void read_global_param(AV1DecContext *s, int type, int ref, int idx)
{
int primary_frame;
uint8_t primary_frame, prev_frame;
uint32_t abs_bits, prec_bits, round, prec_diff, sub, mx;
int32_t r, prev_gm_param;
primary_frame = s->raw_frame_header->primary_ref_frame;
prev_frame = s->raw_frame_header->ref_frame_idx[primary_frame];
abs_bits = AV1_GM_ABS_ALPHA_BITS;
prec_bits = AV1_GM_ALPHA_PREC_BITS;
@@ -112,10 +113,8 @@ static void read_global_param(AV1DecContext *s, int type, int ref, int idx)
*/
if (s->raw_frame_header->primary_ref_frame == AV1_PRIMARY_REF_NONE)
prev_gm_param = s->cur_frame.gm_params[ref][idx];
else {
int prev_frame = s->raw_frame_header->ref_frame_idx[primary_frame];
else
prev_gm_param = s->ref[prev_frame].gm_params[ref][idx];
}
if (idx < 2) {
if (type == AV1_WARP_MODEL_TRANSLATION) {
@@ -282,8 +281,6 @@ static void skip_mode_params(AV1DecContext *s)
forward_idx = -1;
backward_idx = -1;
for (i = 0; i < AV1_REFS_PER_FRAME; i++) {
if (!s->ref[header->ref_frame_idx[i]].raw_frame_header)
return;
ref_hint = s->ref[header->ref_frame_idx[i]].raw_frame_header->order_hint;
dist = get_relative_dist(seq, ref_hint, header->order_hint);
if (dist < 0) {
@@ -1303,8 +1300,6 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
ff_refstruct_replace(&s->seq_ref, unit->content_ref);
s->raw_seq = &obu->obu.sequence_header;
s->raw_frame_header = NULL;
raw_tile_group = NULL;
ret = set_context_with_sequence(avctx, s->raw_seq);
if (ret < 0) {
@@ -1332,8 +1327,6 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
ff_refstruct_replace(&s->header_ref, unit->content_ref);
raw_tile_group = NULL;
if (unit->type == AV1_OBU_FRAME)
s->raw_frame_header = &obu->obu.frame.header;
else
@@ -1405,11 +1398,8 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
}
}
break;
case AV1_OBU_TEMPORAL_DELIMITER:
s->raw_frame_header = NULL;
raw_tile_group = NULL;
// fall-through
case AV1_OBU_TILE_LIST:
case AV1_OBU_TEMPORAL_DELIMITER:
case AV1_OBU_PADDING:
break;
case AV1_OBU_METADATA:
+4 -13
View File
@@ -145,7 +145,6 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
int ret = 0;
AVCodecInternal *avci;
const FFCodec *codec2;
const AVDictionaryEntry *e;
if (avcodec_is_open(avctx))
return 0;
@@ -176,14 +175,8 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
if (avctx->extradata_size < 0 || avctx->extradata_size >= FF_MAX_EXTRADATA_SIZE)
return AVERROR(EINVAL);
// set the whitelist from provided options dict,
// so we can check it immediately
e = options ? av_dict_get(*options, "codec_whitelist", NULL, 0) : NULL;
if (e) {
ret = av_opt_set(avctx, e->key, e->value, 0);
if (ret < 0)
return ret;
}
if ((ret = av_opt_set_dict(avctx, options)) < 0)
return ret;
if (avctx->codec_whitelist && av_match_list(codec->name, avctx->codec_whitelist, ',') <= 0) {
av_log(avctx, AV_LOG_ERROR, "Codec (%s) not on whitelist \'%s\'\n", codec->name, avctx->codec_whitelist);
@@ -218,14 +211,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code
av_opt_set_defaults(avctx->priv_data);
}
}
if (codec->priv_class && (ret = av_opt_set_dict(avctx->priv_data, options)) < 0)
goto free_and_end;
} else {
avctx->priv_data = NULL;
}
ret = av_opt_set_dict2(avctx, options, AV_OPT_SEARCH_CHILDREN);
if (ret < 0)
goto free_and_end;
// only call ff_set_dimensions() for non H.264/VP6F/DXV codecs so as not to overwrite previously setup dimensions
if (!(avctx->coded_width && avctx->coded_height && avctx->width && avctx->height &&
(avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id == AV_CODEC_ID_VP6F || avctx->codec_id == AV_CODEC_ID_DXV))) {
+1 -1
View File
@@ -129,7 +129,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, AVFrame *p,
rgb[1] = bytestream_get_le32(&buf);
rgb[2] = bytestream_get_le32(&buf);
if (ihsize > 40)
alpha = bytestream_get_le32(&buf);
alpha = bytestream_get_le32(&buf);
}
ret = ff_set_dimensions(avctx, width, height > 0 ? height : -(unsigned)height);
+10 -12
View File
@@ -93,11 +93,6 @@ static int h264_extradata_to_annexb(AVBSFContext *ctx,
const int padding = AV_INPUT_BUFFER_PADDING_SIZE;
int length_size, pps_offset = 0;
if (extradata_size < 7) {
av_log(ctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", extradata_size);
return AVERROR_INVALIDDATA;
}
bytestream2_init(gb, extradata, extradata_size);
bytestream2_skipu(gb, 4);
@@ -267,11 +262,16 @@ static int h264_mp4toannexb_init(AVBSFContext *ctx)
(extra_size >= 4 && AV_RB32(ctx->par_in->extradata) == 1)) {
av_log(ctx, AV_LOG_VERBOSE,
"The input looks like it is Annex B already\n");
return 0;
} else if (extra_size >= 7) {
return h264_extradata_to_annexb(ctx,
ctx->par_in->extradata,
ctx->par_in->extradata_size);
} else {
av_log(ctx, AV_LOG_ERROR, "Invalid extradata size: %d\n", extra_size);
return AVERROR_INVALIDDATA;
}
return h264_extradata_to_annexb(ctx,
ctx->par_in->extradata,
ctx->par_in->extradata_size);
return 0;
}
static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *opkt)
@@ -293,12 +293,10 @@ static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *opkt)
extradata = av_packet_get_side_data(in, AV_PKT_DATA_NEW_EXTRADATA,
&extradata_size);
if (extradata && extradata[0] == 1) {
if (extradata) {
ret = h264_extradata_to_annexb(ctx, extradata, extradata_size);
if (ret < 0)
goto fail;
av_packet_side_data_remove(in->side_data, &in->side_data_elems,
AV_PKT_DATA_NEW_EXTRADATA);
}
/* nothing to filter */
+5 -5
View File
@@ -728,16 +728,16 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx,
}
while (size > 0) {
AV1RawOBUHeader obu_header;
AV1RawOBUHeader header;
uint64_t obu_size;
init_get_bits(&gbc, data, 8 * size);
err = cbs_av1_read_obu_header(ctx, &gbc, &obu_header);
err = cbs_av1_read_obu_header(ctx, &gbc, &header);
if (err < 0)
goto fail;
if (obu_header.obu_has_size_field) {
if (header.obu_has_size_field) {
if (get_bits_left(&gbc) < 8) {
av_log(ctx->log_ctx, AV_LOG_ERROR, "Invalid OBU: fragment "
"too short (%"SIZE_SPECIFIER" bytes).\n", size);
@@ -748,7 +748,7 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx,
if (err < 0)
goto fail;
} else
obu_size = size - 1 - obu_header.obu_extension_flag;
obu_size = size - 1 - header.obu_extension_flag;
pos = get_bits_count(&gbc);
av_assert0(pos % 8 == 0 && pos / 8 <= size);
@@ -763,7 +763,7 @@ static int cbs_av1_split_fragment(CodedBitstreamContext *ctx,
goto fail;
}
err = ff_cbs_append_unit_data(frag, obu_header.obu_type,
err = ff_cbs_append_unit_data(frag, header.obu_type,
data, obu_length, frag->data_ref);
if (err < 0)
goto fail;
-3
View File
@@ -186,13 +186,10 @@ static int FUNC(decoder_model_info)(CodedBitstreamContext *ctx, RWContext *rw,
static int FUNC(sequence_header_obu)(CodedBitstreamContext *ctx, RWContext *rw,
AV1RawSequenceHeader *current)
{
CodedBitstreamAV1Context *priv = ctx->priv_data;
int i, err;
HEADER("Sequence Header");
priv->seen_frame_header = 0;
fc(3, seq_profile, AV_PROFILE_AV1_MAIN,
AV_PROFILE_AV1_PROFESSIONAL);
flag(still_picture);
+8 -8
View File
@@ -725,14 +725,14 @@ typedef struct H265RawSEI3DReferenceDisplaysInfo {
uint8_t ref_viewing_distance_flag;
uint8_t prec_ref_viewing_dist;
uint8_t num_ref_displays_minus1;
uint16_t left_view_id[32];
uint16_t right_view_id[32];
uint8_t exponent_ref_display_width[32];
uint8_t mantissa_ref_display_width[32];
uint8_t exponent_ref_viewing_distance[32];
uint8_t mantissa_ref_viewing_distance[32];
uint8_t additional_shift_present_flag[32];
uint16_t num_sample_shift_plus512[32];
uint8_t left_view_id[31];
uint8_t right_view_id[31];
uint8_t exponent_ref_display_width[31];
uint8_t mantissa_ref_display_width[31];
uint8_t exponent_ref_viewing_distance[31];
uint8_t mantissa_ref_viewing_distance[31];
uint8_t additional_shift_present_flag[31];
uint16_t num_sample_shift_plus512[31];
uint8_t three_dimensional_reference_displays_extension_flag;
} H265RawSEI3DReferenceDisplaysInfo;
+2 -2
View File
@@ -2299,8 +2299,8 @@ SEI_FUNC(sei_3d_reference_displays_info, (CodedBitstreamContext *ctx, RWContext
ue(prec_ref_viewing_dist, 0, 31);
ue(num_ref_displays_minus1, 0, 31);
for (i = 0; i <= current->num_ref_displays_minus1; i++) {
ues(left_view_id[i], 0, MAX_UINT_BITS(15), 1, i);
ues(right_view_id[i], 0, MAX_UINT_BITS(15), 1, i);
ues(left_view_id[i], 0, UINT8_MAX, 1, i);
ues(right_view_id[i], 0, UINT8_MAX, 1, i);
us(6, exponent_ref_display_width[i], 0, 62, 1, i);
if (!current->exponent_ref_display_width[i])
length = FFMAX(0, (int)current->prec_ref_display_width - 30);
+78 -91
View File
@@ -1057,7 +1057,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
H266RawSPS *current)
{
CodedBitstreamH266Context *h266 = ctx->priv_data;
int err, i, j, max_width_minus1, max_height_minus1;
int err, i, j;
unsigned int ctb_log2_size_y, min_cb_log2_size_y,
min_qt_log2_size_intra_y, min_qt_log2_size_inter_y,
ctb_size_y, max_num_merge_cand, tmp_width_val, tmp_height_val;
@@ -1130,10 +1130,8 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
ctb_log2_size_y);
tmp_height_val = AV_CEIL_RSHIFT(current->sps_pic_height_max_in_luma_samples,
ctb_log2_size_y);
max_width_minus1 = tmp_width_val - 1;
max_height_minus1 = tmp_height_val - 1;
u(1, sps_subpic_info_present_flag, 0, !current->sps_res_change_in_clvs_allowed_flag);
flag(sps_subpic_info_present_flag);
if (current->sps_subpic_info_present_flag) {
ue(sps_num_subpics_minus1, 0, VVC_MAX_SLICES - 1);
if (current->sps_num_subpics_minus1 > 0) {
@@ -1147,13 +1145,13 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
infer(sps_subpic_ctu_top_left_x[0], 0);
infer(sps_subpic_ctu_top_left_y[0], 0);
if (current->sps_pic_width_max_in_luma_samples > ctb_size_y)
us(wlen, sps_subpic_width_minus1[0], 0, max_width_minus1, 1, 0);
ubs(wlen, sps_subpic_width_minus1[0], 1, 0);
else
infer(sps_subpic_width_minus1[0], max_width_minus1);
infer(sps_subpic_width_minus1[0], tmp_width_val - 1);
if (current->sps_pic_height_max_in_luma_samples > ctb_size_y)
us(hlen, sps_subpic_height_minus1[0], 0, max_height_minus1, 1, 0);
ubs(hlen, sps_subpic_height_minus1[0], 1, 0);
else
infer(sps_subpic_height_minus1[0], max_height_minus1);
infer(sps_subpic_height_minus1[0], tmp_height_val - 1);
if (!current->sps_independent_subpics_flag) {
flags(sps_subpic_treated_as_pic_flag[0], 1, 0);
flags(sps_loop_filter_across_subpic_enabled_flag[0], 1, 0);
@@ -1163,60 +1161,64 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
}
for (i = 1; i <= current->sps_num_subpics_minus1; i++) {
if (!current->sps_subpic_same_size_flag) {
const int win_right_edge =
current->sps_pic_width_max_in_luma_samples -
current->sps_conf_win_right_offset * sub_width_c;
const int win_bottom_edge =
current->sps_pic_height_max_in_luma_samples -
current->sps_conf_win_bottom_offset * sub_height_c;
const int win_left_edge =
current->sps_conf_win_left_offset * sub_width_c;
const int win_top_edge =
current->sps_conf_win_top_offset * sub_height_c;
const int win_left_edge_ctus =
AV_CEIL_RSHIFT(win_left_edge, ctb_log2_size_y);
const int win_right_edge_ctus =
AV_CEIL_RSHIFT(win_right_edge, ctb_log2_size_y);
const int win_top_edge_ctus =
AV_CEIL_RSHIFT(win_top_edge, ctb_log2_size_y);
const int win_bottom_edge_ctus =
AV_CEIL_RSHIFT(win_bottom_edge, ctb_log2_size_y);
const int min_width =
FFMAX(win_left_edge_ctus - current->sps_subpic_ctu_top_left_x[i], 0);
const int min_height =
FFMAX(win_top_edge_ctus - current->sps_subpic_ctu_top_left_y[i], 0);
if (current->sps_pic_width_max_in_luma_samples > ctb_size_y)
us(wlen, sps_subpic_ctu_top_left_x[i], 0, win_right_edge_ctus - 1, 1, i);
else
if (current->sps_pic_width_max_in_luma_samples > ctb_size_y) {
const unsigned int win_right_edge =
current->sps_pic_width_max_in_luma_samples
- current->sps_conf_win_right_offset * sub_width_c;
us(wlen, sps_subpic_ctu_top_left_x[i], 0,
AV_CEIL_RSHIFT(win_right_edge, ctb_log2_size_y) - 1,
1, i);
} else
infer(sps_subpic_ctu_top_left_x[i], 0);
if (current->sps_pic_height_max_in_luma_samples > ctb_size_y)
us(hlen, sps_subpic_ctu_top_left_y[i], 0, win_bottom_edge_ctus - 1, 1, i);
else
if (current->sps_pic_height_max_in_luma_samples >
ctb_size_y) {
const unsigned int win_bottom_edge =
current->sps_pic_height_max_in_luma_samples
- current->sps_conf_win_bottom_offset * sub_height_c;
us(hlen, sps_subpic_ctu_top_left_y[i], 0,
AV_CEIL_RSHIFT(win_bottom_edge, ctb_log2_size_y) - 1,
1, i);
} else
infer(sps_subpic_ctu_top_left_y[i], 0);
max_width_minus1 = tmp_width_val - current->sps_subpic_ctu_top_left_x[i] - 1;
max_height_minus1 = tmp_height_val - current->sps_subpic_ctu_top_left_y[i] - 1;
if (i < current->sps_num_subpics_minus1 &&
current->sps_pic_width_max_in_luma_samples > ctb_size_y) {
us(wlen, sps_subpic_width_minus1[i], min_width, max_width_minus1, 1, i);
current->sps_pic_width_max_in_luma_samples >
ctb_size_y) {
const unsigned int win_left_edge =
current->sps_conf_win_left_offset * sub_width_c;
const unsigned int win_left_edge_ctus =
AV_CEIL_RSHIFT(win_left_edge, ctb_log2_size_y);
us(wlen, sps_subpic_width_minus1[i],
win_left_edge_ctus > current->sps_subpic_ctu_top_left_x[i]
? win_left_edge_ctus - current->sps_subpic_ctu_top_left_x[i]
: 0,
MAX_UINT_BITS(wlen), 1, i);
} else {
infer(sps_subpic_width_minus1[i], max_width_minus1);
infer(sps_subpic_width_minus1[i],
tmp_width_val -
current->sps_subpic_ctu_top_left_x[i] - 1);
}
if (i < current->sps_num_subpics_minus1 &&
current->sps_pic_height_max_in_luma_samples > ctb_size_y) {
us(hlen, sps_subpic_height_minus1[i], min_height, max_height_minus1, 1, i);
current->sps_pic_height_max_in_luma_samples >
ctb_size_y) {
const unsigned int win_top_edge =
current->sps_conf_win_top_offset * sub_height_c;
const unsigned int win_top_edge_ctus =
AV_CEIL_RSHIFT(win_top_edge, ctb_log2_size_y);
us(hlen, sps_subpic_height_minus1[i],
win_top_edge_ctus > current->sps_subpic_ctu_top_left_y[i]
? win_top_edge_ctus - current->sps_subpic_ctu_top_left_y[i]
: 0,
MAX_UINT_BITS(hlen), 1, i);
} else {
infer(sps_subpic_height_minus1[i], max_height_minus1);
infer(sps_subpic_height_minus1[i],
tmp_height_val -
current->sps_subpic_ctu_top_left_y[i] - 1);
}
} else {
int num_subpic_cols = tmp_width_val /
(current->sps_subpic_width_minus1[0] + 1);
if (tmp_width_val % (current->sps_subpic_width_minus1[0] + 1) ||
tmp_height_val % (current->sps_subpic_height_minus1[0] + 1) ||
tmp_height_val % (current->sps_subpic_width_minus1[0] + 1) ||
current->sps_num_subpics_minus1 !=
(num_subpic_cols * tmp_height_val /
(current->sps_subpic_height_minus1[0] + 1) - 1))
@@ -1243,8 +1245,8 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
} else {
infer(sps_subpic_ctu_top_left_x[0], 0);
infer(sps_subpic_ctu_top_left_y[0], 0);
infer(sps_subpic_width_minus1[0], max_width_minus1);
infer(sps_subpic_height_minus1[0], max_height_minus1);
infer(sps_subpic_width_minus1[0], tmp_width_val - 1);
infer(sps_subpic_height_minus1[0], tmp_height_val - 1);
}
ue(sps_subpic_id_len_minus1, 0, 15);
if ((1 << (current->sps_subpic_id_len_minus1 + 1)) <
@@ -1271,8 +1273,8 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
infer(sps_subpic_id_mapping_explicitly_signalled_flag, 0);
infer(sps_subpic_ctu_top_left_x[0], 0);
infer(sps_subpic_ctu_top_left_y[0], 0);
infer(sps_subpic_width_minus1[0], max_width_minus1);
infer(sps_subpic_height_minus1[0], max_height_minus1);
infer(sps_subpic_width_minus1[0], tmp_width_val - 1);
infer(sps_subpic_height_minus1[0], tmp_height_val - 1);
}
@@ -1897,10 +1899,10 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
}
unified_size = current->pps_tile_column_width_minus1[i - 1] + 1;
while (remaining_size > 0) {
if (i == VVC_MAX_TILE_COLUMNS) {
if (current->num_tile_columns > VVC_MAX_TILE_COLUMNS) {
av_log(ctx->log_ctx, AV_LOG_ERROR,
"Exceeded maximum tile columns (%d) (remaining size: %u)\n",
VVC_MAX_TILE_COLUMNS, remaining_size);
"NumTileColumns(%d) > than VVC_MAX_TILE_COLUMNS(%d)\n",
current->num_tile_columns, VVC_MAX_TILE_COLUMNS);
return AVERROR_INVALIDDATA;
}
unified_size = FFMIN(remaining_size, unified_size);
@@ -1909,6 +1911,12 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
i++;
}
current->num_tile_columns = i;
if (current->num_tile_columns > VVC_MAX_TILE_COLUMNS) {
av_log(ctx->log_ctx, AV_LOG_ERROR,
"NumTileColumns(%d) > than VVC_MAX_TILE_COLUMNS(%d)\n",
current->num_tile_columns, VVC_MAX_TILE_COLUMNS);
return AVERROR_INVALIDDATA;
}
remaining_size = pic_height_in_ctbs_y;
for (i = 0; i <= current->pps_num_exp_tile_rows_minus1; i++) {
@@ -1923,18 +1931,18 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
unified_size = current->pps_tile_row_height_minus1[i - 1] + 1;
while (remaining_size > 0) {
if (i == VVC_MAX_TILE_ROWS) {
av_log(ctx->log_ctx, AV_LOG_ERROR,
"Exceeded maximum tile rows (%d) (remaining size: %u)\n",
VVC_MAX_TILE_ROWS, remaining_size);
return AVERROR_INVALIDDATA;
}
unified_size = FFMIN(remaining_size, unified_size);
current->row_height_val[i] = unified_size;
remaining_size -= unified_size;
i++;
}
current->num_tile_rows=i;
if (current->num_tile_rows > VVC_MAX_TILE_ROWS) {
av_log(ctx->log_ctx, AV_LOG_ERROR,
"NumTileRows(%d) > than VVC_MAX_TILE_ROWS(%d)\n",
current->num_tile_rows, VVC_MAX_TILE_ROWS);
return AVERROR_INVALIDDATA;
}
current->num_tiles_in_pic = current->num_tile_columns *
current->num_tile_rows;
@@ -1970,18 +1978,16 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
for (i = 0; i < current->pps_num_slices_in_pic_minus1; i++) {
tile_x = tile_idx % current->num_tile_columns;
tile_y = tile_idx / current->num_tile_columns;
if (tile_y >= current->num_tile_rows)
return AVERROR_INVALIDDATA;
if (tile_x != current->num_tile_columns - 1) {
ues(pps_slice_width_in_tiles_minus1[i],
0, current->num_tile_columns - 1 - tile_x, 1, i);
0, current->num_tile_columns - 1, 1, i);
} else {
infer(pps_slice_width_in_tiles_minus1[i], 0);
}
if (tile_y != current->num_tile_rows - 1 &&
(current->pps_tile_idx_delta_present_flag || tile_x == 0)) {
ues(pps_slice_height_in_tiles_minus1[i],
0, current->num_tile_rows - 1 - tile_y, 1, i);
0, current->num_tile_rows - 1, 1, i);
} else {
if (tile_y == current->num_tile_rows - 1)
infer(pps_slice_height_in_tiles_minus1[i], 0);
@@ -2013,16 +2019,10 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
slice_top_left_ctu_y[i] = ctu_y;
} else {
uint16_t slice_height_in_ctus;
int num_uniform_slices;
if (i + current->pps_num_exp_slices_in_tile[i] >
current->pps_num_slices_in_pic_minus1 + 1)
return AVERROR_INVALIDDATA;
for (j = 0; j < current->pps_num_exp_slices_in_tile[i];
j++) {
ues(pps_exp_slice_height_in_ctus_minus1[i][j], 0,
remaining_height_in_ctbs_y - (current->pps_num_exp_slices_in_tile[i] - j), 2,
current->row_height_val[tile_y] - 1, 2,
i, j);
slice_height_in_ctus =
current->
@@ -2039,13 +2039,6 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
uniform_slice_height = 1 +
(j == 0 ? current->row_height_val[tile_y] - 1:
current->pps_exp_slice_height_in_ctus_minus1[i][j-1]);
num_uniform_slices = (remaining_height_in_ctbs_y + uniform_slice_height - 1)
/ uniform_slice_height;
if (i + current->pps_num_exp_slices_in_tile[i] + num_uniform_slices >
current->pps_num_slices_in_pic_minus1 + 1)
return AVERROR_INVALIDDATA;
while (remaining_height_in_ctbs_y > uniform_slice_height) {
current->slice_height_in_ctus[i + j] =
uniform_slice_height;
@@ -2808,9 +2801,9 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw,
0, FFMIN(6, ctb_log2_size_y) - min_cb_log2_size_y);
ue(ph_max_mtt_hierarchy_depth_intra_slice_chroma,
0, 2 * (ctb_log2_size_y - min_cb_log2_size_y));
if (current->ph_max_mtt_hierarchy_depth_intra_slice_chroma != 0) {
if (sps->sps_max_mtt_hierarchy_depth_intra_slice_chroma != 0) {
unsigned int min_qt_log2_size_intra_c =
current->ph_log2_diff_min_qt_min_cb_intra_slice_chroma +
sps->sps_log2_diff_min_qt_min_cb_intra_slice_chroma +
min_cb_log2_size_y;
ue(ph_log2_diff_max_bt_min_qt_intra_slice_chroma,
0, FFMIN(6, ctb_log2_size_y) - min_qt_log2_size_intra_c);
@@ -3134,7 +3127,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
if (!pps->pps_rect_slice_flag &&
pps->num_tiles_in_pic - current->sh_slice_address > 1)
ue(sh_num_tiles_in_slice_minus1, 0, pps->num_tiles_in_pic - 1 - current->sh_slice_address);
ue(sh_num_tiles_in_slice_minus1, 0, pps->num_tiles_in_pic - 1);
else
infer(sh_num_tiles_in_slice_minus1, 0);
@@ -3252,12 +3245,6 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
FFMIN(ref_pic_lists->rpl_ref_list[i].num_ref_entries,
pps->pps_num_ref_idx_default_active_minus1[i] + 1);
}
if (current->num_ref_idx_active[i] <= 0) {
av_log(ctx->log_ctx, AV_LOG_ERROR,
"Inter slice but no reference pictures available for RPL%d.\n", i);
return AVERROR_INVALIDDATA;
}
} else {
current->num_ref_idx_active[i] = 0;
}
@@ -3460,7 +3447,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
tile_idx <=
current->sh_slice_address +
current->sh_num_tiles_in_slice_minus1; tile_idx++) {
tile_y = tile_idx / pps->num_tile_columns;
tile_y = tile_idx / pps->num_tile_rows;
height = pps->row_height_val[tile_y];
current->num_entry_points += (entropy_sync ? height : 1);
}
+1 -1
View File
@@ -375,7 +375,7 @@ static int cbs_vp9_split_fragment(CodedBitstreamContext *ctx,
superframe_header = frag->data[frag->data_size - 1];
if ((superframe_header & 0xe0) == 0xc0) {
VP9RawSuperframeIndex sfi = {0};
VP9RawSuperframeIndex sfi;
GetBitContext gbc;
size_t index_size, pos;
int i;
+2 -11
View File
@@ -25,7 +25,6 @@
#include "libavutil/attributes.h"
#include "libavutil/common.h"
#include "libavutil/imgutils.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
@@ -276,9 +275,6 @@ static int alloc_buffers(AVCodecContext *avctx)
int height = (i || bayer) ? s->coded_height >> chroma_y_shift : s->coded_height;
ptrdiff_t stride = (FFALIGN(width / 8, 8) + 64) * 8;
if ((ret = av_image_check_size2(stride, height, avctx->max_pixels, s->coded_format, 0, avctx)) < 0)
return ret;
if (chroma_y_shift && !bayer)
height = FFALIGN(height / 8, 2) * 8;
s->plane[i].width = width;
@@ -639,7 +635,7 @@ static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic,
} else
av_log(avctx, AV_LOG_DEBUG, "Unknown tag %i data %x\n", tag, data);
if (tag == BitstreamMarker && data == CoefficientSegment &&
if (tag == BitstreamMarker && data == 0xf0f &&
s->coded_format != AV_PIX_FMT_NONE) {
int lowpass_height = s->plane[s->channel_num].band[0][0].height;
int lowpass_width = s->plane[s->channel_num].band[0][0].width;
@@ -706,15 +702,10 @@ static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic,
if (s->subband_num_actual == 255)
goto finish;
if (tag == BitstreamMarker && data == CoefficientSegment || tag == BandHeader || tag == BandSecondPass || s->peak.level)
if (s->transform_type != s->a_transform_type)
return AVERROR_PATCHWELCOME;
coeff_data = s->plane[s->channel_num].subband[s->subband_num_actual];
/* Lowpass coefficients */
if (tag == BitstreamMarker && data == CoefficientSegment) {
if (tag == BitstreamMarker && data == 0xf0f) {
int lowpass_height, lowpass_width, lowpass_a_height, lowpass_a_width;
if (!s->a_width || !s->a_height) {
-9
View File
@@ -92,15 +92,6 @@ enum CFHDParam {
ChannelHeight = 105,
};
enum CFHDSegment {
LowPassSegment = 0x1a4a,
LowPassEndSegment = 0x1b4b,
HighPassSegment = 0x0d0d,
BandSegment = 0x0e0e,
HighPassEndSegment = 0x0c0c,
CoefficientSegment = 0x0f0f,
};
#define VLC_BITS 9
#define SUBBAND_COUNT 10
#define SUBBAND_COUNT_3D 17
+7 -7
View File
@@ -285,7 +285,7 @@ static av_cold int cfhd_encode_init(AVCodecContext *avctx)
s->plane[i].dwt_buf =
av_calloc(h8 * 8 * w8 * 8, sizeof(*s->plane[i].dwt_buf));
s->plane[i].dwt_tmp =
av_calloc(h8 * 8 * w8 * 8, sizeof(*s->plane[i].dwt_tmp));
av_malloc_array(h8 * 8 * w8 * 8, sizeof(*s->plane[i].dwt_tmp));
if (!s->plane[i].dwt_buf || !s->plane[i].dwt_tmp)
return AVERROR(ENOMEM);
@@ -627,7 +627,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
bytestream2_put_be16(pby, BitstreamMarker);
bytestream2_put_be16(pby, LowPassSegment);
bytestream2_put_be16(pby, 0x1a4a);
pos = bytestream2_tell_p(pby);
@@ -653,7 +653,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
bytestream2_put_be16(pby, 16);
bytestream2_put_be16(pby, BitstreamMarker);
bytestream2_put_be16(pby, CoefficientSegment);
bytestream2_put_be16(pby, 0x0f0f);
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++)
@@ -662,7 +662,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
bytestream2_put_be16(pby, BitstreamMarker);
bytestream2_put_be16(pby, LowPassEndSegment);
bytestream2_put_be16(pby, 0x1b4b);
for (int l = 0; l < 3; l++) {
for (int i = 0; i < 3; i++) {
@@ -677,7 +677,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int height = s->plane[p].band[l][0].height;
bytestream2_put_be16(pby, BitstreamMarker);
bytestream2_put_be16(pby, HighPassSegment);
bytestream2_put_be16(pby, 0x0d0d);
bytestream2_put_be16(pby, WaveletType);
bytestream2_put_be16(pby, 3 + 2 * (l == 2));
@@ -714,7 +714,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
int count = 0, padd = 0;
bytestream2_put_be16(pby, BitstreamMarker);
bytestream2_put_be16(pby, BandSegment);
bytestream2_put_be16(pby, 0x0e0e);
bytestream2_put_be16(pby, SubbandNumber);
bytestream2_put_be16(pby, i + 1);
@@ -783,7 +783,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
}
bytestream2_put_be16(pby, BitstreamMarker);
bytestream2_put_be16(pby, HighPassEndSegment);
bytestream2_put_be16(pby, 0x0c0c);
}
s->plane[p].size = bytestream2_tell_p(pby) - pos;
+1
View File
@@ -88,3 +88,4 @@ const FFCodec ff_cljr_decoder = {
FF_CODEC_DECODE_CB(decode_frame),
.p.capabilities = AV_CODEC_CAP_DR1,
};
+2 -2
View File
@@ -2697,7 +2697,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.type = AVMEDIA_TYPE_AUDIO,
.name = "aac",
.long_name = NULL_IF_CONFIG_SMALL("AAC (Advanced Audio Coding)"),
.props = AV_CODEC_PROP_LOSSY,
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
},
{
@@ -3031,7 +3031,7 @@ static const AVCodecDescriptor codec_descriptors[] = {
.type = AVMEDIA_TYPE_AUDIO,
.name = "aac_latm",
.long_name = NULL_IF_CONFIG_SMALL("AAC LATM (Advanced Audio Coding LATM syntax)"),
.props = AV_CODEC_PROP_LOSSY,
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY,
.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles),
},
{
+2 -5
View File
@@ -1080,7 +1080,6 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
int s = 0;
unsigned int channel_mask = 0;
int samples_per_frame = 0;
int total_channels = 0;
int ret;
int channels = avctx->ch_layout.nb_channels;
@@ -1238,12 +1237,10 @@ static av_cold int cook_decode_init(AVCodecContext *avctx)
q->subpacket[s].gains2.now = q->subpacket[s].gain_3;
q->subpacket[s].gains2.previous = q->subpacket[s].gain_4;
if (total_channels + q->subpacket[s].num_channels > channels) {
av_log(avctx, AV_LOG_ERROR, "Too many subpacket channels %d for channels %d\n",
total_channels + q->subpacket[s].num_channels, channels);
if (q->num_subpackets + q->subpacket[s].num_channels > channels) {
av_log(avctx, AV_LOG_ERROR, "Too many subpackets %d for channels %d\n", q->num_subpackets, channels);
return AVERROR_INVALIDDATA;
}
total_channels += q->subpacket[s].num_channels;
q->num_subpackets++;
s++;
+4 -7
View File
@@ -71,7 +71,6 @@ static av_cold int cri_decode_init(AVCodecContext *avctx)
s->jpeg_avctx->flags = avctx->flags;
s->jpeg_avctx->flags2 = avctx->flags2;
s->jpeg_avctx->idct_algo = avctx->idct_algo;
s->jpeg_avctx->max_pixels = avctx->max_pixels;
ret = avcodec_open2(s->jpeg_avctx, codec, NULL);
if (ret < 0)
return ret;
@@ -221,12 +220,10 @@ static int cri_decode_frame(AVCodecContext *avctx, AVFrame *p,
if (bytestream2_get_le32(gb) != 0)
return AVERROR_INVALIDDATA;
break;
case 102:;
int read_len = FFMIN(length, sizeof(codec_name) - 1);
if (read_len != bytestream2_get_buffer(gb, codec_name, read_len))
return AVERROR_INVALIDDATA;
length -= read_len;
if (strncmp(codec_name, "cintel_craw", read_len))
case 102:
bytestream2_get_buffer(gb, codec_name, FFMIN(length, sizeof(codec_name) - 1));
length -= FFMIN(length, sizeof(codec_name) - 1);
if (strncmp(codec_name, "cintel_craw", FFMIN(length, sizeof(codec_name) - 1)))
return AVERROR_INVALIDDATA;
compressed = 1;
goto skip;
+7 -6
View File
@@ -974,7 +974,8 @@ rc_mode_found:
case RC_MODE_CQP:
// cqp ConfigParams will be updated in ctx->codec->configure.
break;
case RC_MODE_CBR: {
case RC_MODE_CBR:
D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR *cbr_ctl;
ctx->rc.ConfigParams.DataSize = sizeof(D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR);
@@ -995,8 +996,8 @@ rc_mode_found:
ctx->rc.ConfigParams.pConfiguration_CBR = cbr_ctl;
break;
}
case RC_MODE_VBR: {
case RC_MODE_VBR:
D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR *vbr_ctl;
ctx->rc.ConfigParams.DataSize = sizeof(D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR);
@@ -1018,8 +1019,8 @@ rc_mode_found:
ctx->rc.ConfigParams.pConfiguration_VBR = vbr_ctl;
break;
}
case RC_MODE_QVBR: {
case RC_MODE_QVBR:
D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR *qvbr_ctl;
ctx->rc.ConfigParams.DataSize = sizeof(D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR);
@@ -1039,7 +1040,7 @@ rc_mode_found:
ctx->rc.ConfigParams.pConfiguration_QVBR = qvbr_ctl;
break;
}
default:
break;
}
+5 -15
View File
@@ -64,16 +64,12 @@ static void get_linear_array(GetBitContext *gb, int32_t *array, int size, int n)
array[i] = get_linear(gb, n);
}
static int get_rice_array(GetBitContext *gb, int32_t *array, int size, int k)
static void get_rice_array(GetBitContext *gb, int32_t *array, int size, int k)
{
int i;
for (i = 0; i < size && get_bits_left(gb) > k; i++)
for (i = 0; i < size; i++)
array[i] = get_rice(gb, k);
if (i < size)
return AVERROR_INVALIDDATA;
return 0;
}
static int parse_dmix_coeffs(DCAXllDecoder *s, DCAXllChSet *c)
@@ -533,10 +529,8 @@ static int chs_parse_band_data(DCAXllDecoder *s, DCAXllChSet *c, int band, int s
} else {
// Rice codes
// Unpack all residuals of part A of segment 0
int ret = get_rice_array(&s->gb, part_a, c->nsamples_part_a[k],
c->bitalloc_part_a[k]);
if (ret < 0)
return ret;
get_rice_array(&s->gb, part_a, c->nsamples_part_a[k],
c->bitalloc_part_a[k]);
if (c->bitalloc_hybrid_linear[k]) {
// Hybrid Rice codes
@@ -566,9 +560,7 @@ static int chs_parse_band_data(DCAXllDecoder *s, DCAXllChSet *c, int band, int s
} else {
// Rice codes
// Unpack all residuals of part B of segment 0 and others
ret = get_rice_array(&s->gb, part_b, nsamples_part_b, c->bitalloc_part_b[k]);
if (ret < 0)
return ret;
get_rice_array(&s->gb, part_b, nsamples_part_b, c->bitalloc_part_b[k]);
}
}
}
@@ -1102,7 +1094,6 @@ static int copy_to_pbr(DCAXllDecoder *s, const uint8_t *data, int size, int dela
return AVERROR(ENOMEM);
memcpy(s->pbr_buffer, data, size);
memset(s->pbr_buffer + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
s->pbr_length = size;
s->pbr_delay = delay;
return 0;
@@ -1157,7 +1148,6 @@ static int parse_frame_pbr(DCAXllDecoder *s, const uint8_t *data, int size, DCAE
memcpy(s->pbr_buffer + s->pbr_length, data, size);
s->pbr_length += size;
memset(s->pbr_buffer + s->pbr_length, 0, AV_INPUT_BUFFER_PADDING_SIZE);
// Respect decoding delay after synchronization error
if (s->pbr_delay > 0 && --s->pbr_delay)
+23 -70
View File
@@ -92,14 +92,10 @@ typedef struct DecodeContext {
*/
uint64_t side_data_pref_mask;
#if CONFIG_LIBLCEVC_DEC
struct {
FFLCEVCContext *ctx;
int frame;
int width;
int height;
} lcevc;
#endif
FFLCEVCContext *lcevc;
int lcevc_frame;
int width;
int height;
} DecodeContext;
static DecodeContext *decode_ctx(AVCodecInternal *avci)
@@ -1470,8 +1466,8 @@ static int side_data_map(AVFrame *dst,
{
for (int i = 0; map[i].packet < AV_PKT_DATA_NB; i++) {
const enum AVPacketSideDataType type_pkt = map[i].packet;
const enum AVFrameSideDataType type_frame = map[i].frame;
const enum AVFrameSideDataType type_pkt = map[i].packet;
const enum AVFrameSideDataType type_frame = map[i].frame;
const AVPacketSideData *sd_pkt;
AVFrameSideData *sd_frame;
@@ -1661,67 +1657,36 @@ int ff_attach_decode_data(AVFrame *frame)
static void update_frame_props(AVCodecContext *avctx, AVFrame *frame)
{
#if CONFIG_LIBLCEVC_DEC
AVCodecInternal *avci = avctx->internal;
DecodeContext *dc = decode_ctx(avci);
dc->lcevc.frame = dc->lcevc.ctx && avctx->codec_type == AVMEDIA_TYPE_VIDEO &&
dc->lcevc_frame = dc->lcevc && avctx->codec_type == AVMEDIA_TYPE_VIDEO &&
av_frame_get_side_data(frame, AV_FRAME_DATA_LCEVC);
if (dc->lcevc.frame) {
dc->lcevc.width = frame->width;
dc->lcevc.height = frame->height;
if (dc->lcevc_frame) {
dc->width = frame->width;
dc->height = frame->height;
frame->width = frame->width * 2 / FFMAX(frame->sample_aspect_ratio.den, 1);
frame->height = frame->height * 2 / FFMAX(frame->sample_aspect_ratio.num, 1);
}
#endif
}
static int attach_post_process_data(AVCodecContext *avctx, AVFrame *frame)
static void attach_post_process_data(AVCodecContext *avctx, AVFrame *frame)
{
#if CONFIG_LIBLCEVC_DEC
AVCodecInternal *avci = avctx->internal;
DecodeContext *dc = decode_ctx(avci);
if (dc->lcevc.frame) {
if (dc->lcevc_frame) {
FrameDecodeData *fdd = (FrameDecodeData*)frame->private_ref->data;
FFLCEVCFrame *frame_ctx;
int ret;
frame_ctx = av_mallocz(sizeof(*frame_ctx));
if (!frame_ctx)
return AVERROR(ENOMEM);
frame_ctx->frame = av_frame_alloc();
if (!frame_ctx->frame) {
av_free(frame_ctx);
return AVERROR(ENOMEM);
}
frame_ctx->lcevc = ff_refstruct_ref(dc->lcevc.ctx);
frame_ctx->frame->width = frame->width;
frame_ctx->frame->height = frame->height;
frame_ctx->frame->format = frame->format;
frame->width = dc->lcevc.width;
frame->height = dc->lcevc.height;
ret = avctx->get_buffer2(avctx, frame_ctx->frame, 0);
if (ret < 0) {
ff_lcevc_unref(frame_ctx);
return ret;
}
validate_avframe_allocation(avctx, frame_ctx->frame);
fdd->post_process_opaque = frame_ctx;
fdd->post_process_opaque = ff_refstruct_ref(dc->lcevc);
fdd->post_process_opaque_free = ff_lcevc_unref;
fdd->post_process = ff_lcevc_process;
}
dc->lcevc.frame = 0;
#endif
return 0;
frame->width = dc->width;
frame->height = dc->height;
}
dc->lcevc_frame = 0;
}
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
@@ -1782,9 +1747,7 @@ int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
if (ret < 0)
goto fail;
ret = attach_post_process_data(avctx, frame);
if (ret < 0)
goto fail;
attach_post_process_data(avctx, frame);
end:
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO && !override_dimensions &&
@@ -2092,13 +2055,9 @@ int ff_decode_preinit(AVCodecContext *avctx)
return ret;
if (!(avctx->export_side_data & AV_CODEC_EXPORT_DATA_ENHANCEMENTS)) {
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
#if CONFIG_LIBLCEVC_DEC
ret = ff_lcevc_alloc(&dc->lcevc.ctx);
if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
#endif
}
ret = ff_lcevc_alloc(&dc->lcevc);
if (ret < 0 && (avctx->err_recognition & AV_EF_EXPLODE))
return ret;
}
#if FF_API_DROPCHANGED
@@ -2341,19 +2300,13 @@ void ff_decode_internal_sync(AVCodecContext *dst, const AVCodecContext *src)
const DecodeContext *src_dc = decode_ctx(src->internal);
DecodeContext *dst_dc = decode_ctx(dst->internal);
dst_dc->initial_pict_type = src_dc->initial_pict_type;
dst_dc->intra_only_flag = src_dc->intra_only_flag;
#if CONFIG_LIBLCEVC_DEC
ff_refstruct_replace(&dst_dc->lcevc.ctx, src_dc->lcevc.ctx);
#endif
ff_refstruct_replace(&dst_dc->lcevc, src_dc->lcevc);
}
void ff_decode_internal_uninit(AVCodecContext *avctx)
{
#if CONFIG_LIBLCEVC_DEC
AVCodecInternal *avci = avctx->internal;
DecodeContext *dc = decode_ctx(avci);
ff_refstruct_unref(&dc->lcevc.ctx);
#endif
ff_refstruct_unref(&dc->lcevc);
}
+3 -7
View File
@@ -93,13 +93,9 @@ int ff_attach_decode_data(AVFrame *frame);
*/
int ff_copy_palette(void *dst, const AVPacket *src, void *logctx);
/*
* Validate and set video frame dimensions on AVCodecContext.
*
* Dimensions accepted here satisfy FFmpeg's generic image-size validation
* (see av_image_check_size2()). Decoder code normally should not duplicate
* generic width/height overflow checks before ff_get_buffer(); add local
* checks only for codec-specific derived sizes or complexity bounds.
/**
* Check that the provided frame dimensions are valid and set them on the codec
* context.
*/
int ff_set_dimensions(AVCodecContext *s, int width, int height);
+2 -3
View File
@@ -101,16 +101,15 @@ static int dfpwm_dec_frame(struct AVCodecContext *ctx, AVFrame *frame,
{
DFPWMState *state = ctx->priv_data;
int ret;
uint64_t nb_samples = packet->size * 8LL / ctx->ch_layout.nb_channels;
if (packet->size * 8LL % ctx->ch_layout.nb_channels)
return AVERROR_PATCHWELCOME;
if (nb_samples > INT_MAX || !nb_samples) {
frame->nb_samples = packet->size * 8LL / ctx->ch_layout.nb_channels;
if (frame->nb_samples <= 0) {
av_log(ctx, AV_LOG_ERROR, "invalid number of samples in packet\n");
return AVERROR_INVALIDDATA;
}
frame->nb_samples = nb_samples;
if ((ret = ff_get_buffer(ctx, frame, 0)) < 0)
return ret;
+4 -4
View File
@@ -339,9 +339,9 @@ static int alloc_buffers(DiracContext *s, int stride)
av_freep(&s->mctmp);
av_freep(&s->mcscratch);
s->edge_emu_buffer_base = av_malloc_array(stride, 4 * MAX_BLOCKSIZE);
s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE);
s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h + 5*MAX_BLOCKSIZE) * sizeof(*s->mctmp));
s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE);
if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch)
@@ -1895,7 +1895,7 @@ static int dirac_decode_frame_internal(DiracContext *s)
/* FIXME: small resolutions */
for (i = 0; i < 4; i++)
s->edge_emu_buffer[i] = s->edge_emu_buffer_base + i*s->buffer_stride*MAX_BLOCKSIZE;
s->edge_emu_buffer[i] = s->edge_emu_buffer_base + i*FFALIGN(p->width, 16);
if (!s->zero_res && !s->low_delay)
{
@@ -1944,7 +1944,7 @@ static int dirac_decode_frame_internal(DiracContext *s)
h = p->height - start;
else
h = p->ybsep - (start - dsty);
if (h <= 0)
if (h < 0)
break;
memset(mctmp+2*p->yoffset*p->stride, 0, 2*rowheight);
+1
View File
@@ -337,3 +337,4 @@ const AVDVProfile *av_dv_codec_profile2(int width, int height,
return p;
}
+1 -1
View File
@@ -59,7 +59,7 @@ static int dvdsub_parse(AVCodecParserContext *s,
pc->packet = av_malloc(pc->packet_len + AV_INPUT_BUFFER_PADDING_SIZE);
}
if (pc->packet) {
if (buf_size <= pc->packet_len - pc->packet_index) {
if (pc->packet_index + buf_size <= pc->packet_len) {
memcpy(pc->packet + pc->packet_index, buf, buf_size);
pc->packet_index += buf_size;
if (pc->packet_index >= pc->packet_len) {
+12 -41
View File
@@ -38,15 +38,12 @@ typedef struct DXVContext {
GetByteContext gbc;
uint8_t *tex_data; // Compressed texture
unsigned tex_data_size;
uint8_t *ctex_data; // Compressed chroma texture
unsigned ctex_data_size;
size_t tex_size; // Texture size
int64_t tex_size; // Texture size
int64_t ctex_size; // Chroma texture size
uint8_t *op_data[4]; // Opcodes
unsigned op_data_size[4];
int64_t op_size[4]; // Opcodes size
} DXVContext;
@@ -277,9 +274,7 @@ static int dxv_decompress_opcodes(GetByteContext *gb, void *dstp, size_t op_size
if ((flag & 3) == 0) {
bytestream2_skip(gb, 1);
int read_size = bytestream2_get_buffer(gb, dstp, op_size);
if (read_size != op_size)
return AVERROR_INVALIDDATA;
bytestream2_get_buffer(gb, dstp, op_size);
} else if ((flag & 3) == 1) {
bytestream2_skip(gb, 1);
memset(dstp, bytestream2_get_byte(gb), op_size);
@@ -828,12 +823,7 @@ static int dxv_decompress_dxt5(AVCodecContext *avctx)
static int dxv_decompress_lzf(AVCodecContext *avctx)
{
DXVContext *ctx = avctx->priv_data;
unsigned old_size = ctx->tex_data_size;
int ret = ff_lzf_uncompress(&ctx->gbc, &ctx->tex_data, &ctx->tex_size, &ctx->tex_data_size);
old_size = FFMAX(old_size, ctx->tex_size);
if (ctx->tex_data_size > old_size)
memset(ctx->tex_data + old_size, 0, ctx->tex_data_size - old_size);
return ret;
return ff_lzf_uncompress(&ctx->gbc, &ctx->tex_data, &ctx->tex_size);
}
static int dxv_decompress_raw(AVCodecContext *avctx)
@@ -945,8 +935,6 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame,
}
break;
}
if (avctx->coded_height / 2 / TEXTURE_BLOCK_H < 1)
return AVERROR_INVALIDDATA;
texdsp_ctx.slice_count = av_clip(avctx->thread_count, 1,
avctx->coded_height / TEXTURE_BLOCK_H);
@@ -981,14 +969,9 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame,
ctx->tex_size = avctx->coded_width / (texdsp_ctx.raw_ratio / (avctx->pix_fmt == AV_PIX_FMT_RGBA ? 4 : 1)) *
avctx->coded_height / TEXTURE_BLOCK_H *
texdsp_ctx.tex_ratio;
unsigned old_size = ctx->tex_data_size;
void *ptr = av_fast_realloc(ctx->tex_data, &ctx->tex_data_size, ctx->tex_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!ptr)
return AVERROR(ENOMEM);
ctx->tex_data = ptr;
if (ctx->tex_data_size > old_size)
memset(ctx->tex_data + old_size, 0, ctx->tex_data_size - old_size);
ret = av_reallocp(&ctx->tex_data, ctx->tex_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret < 0)
return ret;
if (avctx->pix_fmt != AV_PIX_FMT_RGBA) {
int i;
@@ -1002,20 +985,13 @@ static int dxv_decode(AVCodecContext *avctx, AVFrame *frame,
ctx->op_size[2] = avctx->coded_width * avctx->coded_height / 32;
ctx->op_size[3] = avctx->coded_width * avctx->coded_height / 16;
old_size = ctx->ctex_data_size;
ptr = av_fast_realloc(ctx->ctex_data, &ctx->ctex_data_size, ctx->ctex_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!ptr)
return AVERROR(ENOMEM);
ctx->ctex_data = ptr;
if (old_size < ctx->ctex_data_size)
memset(ctx->ctex_data + old_size, 0, ctx->ctex_data_size - old_size);
ret = av_reallocp(&ctx->ctex_data, ctx->ctex_size + AV_INPUT_BUFFER_PADDING_SIZE);
if (ret < 0)
return ret;
for (i = 0; i < 4; i++) {
old_size = ctx->op_data_size[i];
ptr = av_fast_realloc(ctx->op_data[i], &ctx->op_data_size[i], ctx->op_size[i]);
if (!ptr)
return AVERROR(ENOMEM);
ctx->op_data[i] = ptr;
ret = av_reallocp(&ctx->op_data[i], ctx->op_size[i]);
if (ret < 0)
return ret;
}
}
@@ -1102,16 +1078,11 @@ static int dxv_close(AVCodecContext *avctx)
DXVContext *ctx = avctx->priv_data;
av_freep(&ctx->tex_data);
ctx->tex_data_size = 0;
av_freep(&ctx->ctex_data);
ctx->ctex_data_size = 0;
av_freep(&ctx->op_data[0]);
av_freep(&ctx->op_data[1]);
av_freep(&ctx->op_data[2]);
av_freep(&ctx->op_data[3]);
memset(ctx->op_data_size, 0, sizeof(ctx->op_data_size));
return 0;
}
+1 -2
View File
@@ -178,8 +178,7 @@ static int tgq_decode_mb(TgqContext *s, GetByteContext *gbyte,
dc[4] = bytestream2_get_byte(gbyte);
dc[5] = bytestream2_get_byte(gbyte);
} else if (mode == 6) {
if (bytestream2_get_buffer(gbyte, dc, 6) != 6)
return AVERROR_INVALIDDATA;
bytestream2_get_buffer(gbyte, dc, 6);
} else if (mode == 12) {
for (i = 0; i < 6; i++) {
dc[i] = bytestream2_get_byte(gbyte);
+1 -1
View File
@@ -125,7 +125,7 @@ static av_cold int escape130_decode_init(AVCodecContext *avctx)
return AVERROR_INVALIDDATA;
}
s->old_y_avg = av_mallocz(avctx->width * avctx->height / 4);
s->old_y_avg = av_malloc(avctx->width * avctx->height / 4);
s->buf1 = av_malloc(avctx->width * avctx->height * 3 / 2);
s->buf2 = av_malloc(avctx->width * avctx->height * 3 / 2);
if (!s->old_y_avg || !s->buf1 || !s->buf2) {
+18 -88
View File
@@ -174,9 +174,6 @@ typedef struct EXRContext {
int is_luma;/* 1 if there is an Y plane */
#define M(chr) (1<<chr - 'A')
int has_channel; ///< combination of flags representing the channel codes A-Z
GetByteContext gb;
const uint8_t *buf;
int buf_size;
@@ -632,9 +629,6 @@ static int piz_uncompress(const EXRContext *s, const uint8_t *src, int ssize,
max_non_zero - min_non_zero + 1);
memset(td->bitmap + max_non_zero + 1, 0, BITMAP_SIZE - max_non_zero - 1);
if (bytestream2_get_bytes_left(&gb) < 4)
return AVERROR_INVALIDDATA;
maxval = reverse_lut(td->bitmap, td->lut);
bytestream2_skip(&gb, 4);
@@ -746,12 +740,12 @@ static int pxr24_uncompress(const EXRContext *s, const uint8_t *src,
break;
case EXR_UINT:
ptr[0] = in;
ptr[1] = ptr[0] + td->xsize;
ptr[2] = ptr[1] + td->xsize;
ptr[3] = ptr[2] + td->xsize;
in = ptr[3] + td->xsize;
ptr[1] = ptr[0] + s->xdelta;
ptr[2] = ptr[1] + s->xdelta;
ptr[3] = ptr[2] + s->xdelta;
in = ptr[3] + s->xdelta;
for (j = 0; j < td->xsize; ++j) {
for (j = 0; j < s->xdelta; ++j) {
uint32_t diff = ((uint32_t)*(ptr[0]++) << 24) |
(*(ptr[1]++) << 16) |
(*(ptr[2]++) << 8 ) |
@@ -993,11 +987,10 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
int64_t version, lo_usize, lo_size;
int64_t ac_size, dc_size, rle_usize, rle_csize, rle_raw_size;
int64_t ac_count, dc_count, ac_compression;
const int dc_w = (td->xsize + 7) >> 3;
const int dc_h = (td->ysize + 7) >> 3;
const int dc_w = td->xsize >> 3;
const int dc_h = td->ysize >> 3;
GetByteContext gb, agb;
int skip, ret;
int have_rle = 0;
if (compressed_size <= 88)
return AVERROR_INVALIDDATA;
@@ -1006,11 +999,6 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
if (version != 2)
return AVERROR_INVALIDDATA;
if (s->nb_channels < 3) {
avpriv_request_sample(s->avctx, "Gray DWA");
return AVERROR_PATCHWELCOME;
}
lo_usize = AV_RL64(src + 8);
lo_size = AV_RL64(src + 16);
ac_size = AV_RL64(src + 24);
@@ -1027,20 +1015,6 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
)
return AVERROR_INVALIDDATA;
if (ac_size <= 0) {
avpriv_request_sample(s->avctx, "Zero ac_size");
return AVERROR_INVALIDDATA;
}
if ((uint64_t)rle_raw_size > INT_MAX) {
avpriv_request_sample(s->avctx, "Too big rle_raw_size");
return AVERROR_INVALIDDATA;
}
if (td->xsize % 8 || td->ysize % 8) {
avpriv_request_sample(s->avctx, "odd dimensions DWA");
}
bytestream2_init(&gb, src + 88, compressed_size - 88);
skip = bytestream2_get_le16(&gb);
if (skip < 2)
@@ -1111,9 +1085,6 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
if (rle_raw_size > 0 && rle_csize > 0 && rle_usize > 0) {
unsigned long dest_len = rle_usize;
if (2LL * td->xsize * td->ysize > rle_raw_size)
return AVERROR_INVALIDDATA;
av_fast_padded_malloc(&td->rle_data, &td->rle_size, rle_usize);
if (!td->rle_data)
return AVERROR(ENOMEM);
@@ -1130,17 +1101,12 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
if (ret < 0)
return ret;
bytestream2_skip(&gb, rle_csize);
have_rle = 1;
}
bytestream2_init(&agb, td->ac_data, ac_count * 2);
for (int y = 0; y < td->ysize; y += 8) {
for (int x = 0; x < td->xsize; x += 8) {
int bw = FFMIN(8, td->xsize - x);
int bh = FFMIN(8, td->ysize - y);
memset(td->block, 0, sizeof(td->block));
for (int j = 0; j < 3; j++) {
@@ -1168,8 +1134,8 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
float *ub = td->block[1];
float *vb = td->block[2];
for (int yy = 0; yy < bh; yy++) {
for (int xx = 0; xx < bw; xx++) {
for (int yy = 0; yy < 8; yy++) {
for (int xx = 0; xx < 8; xx++) {
const int idx = xx + yy * 8;
convert(yb[idx], ub[idx], vb[idx], &bo[xx], &go[xx], &ro[xx]);
@@ -1190,7 +1156,7 @@ static int dwa_uncompress(const EXRContext *s, const uint8_t *src, int compresse
if (s->nb_channels < 4)
return 0;
for (int y = 0; y < td->ysize && have_rle; y++) {
for (int y = 0; y < td->ysize && td->rle_raw_data; y++) {
uint32_t *ao = ((uint32_t *)td->uncompressed_data) + y * td->xsize * s->nb_channels;
uint8_t *ai0 = td->rle_raw_data + y * td->xsize;
uint8_t *ai1 = td->rle_raw_data + y * td->xsize + rle_raw_size / 2;
@@ -1461,8 +1427,7 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
}
// Zero out the end if xmax+1 is not w
if (s->desc->flags & AV_PIX_FMT_FLAG_PLANAR || !c)
memset(ptr_x, 0, axmax);
memset(ptr_x, 0, axmax);
channel_buffer[c] += td->channel_line_size;
}
}
@@ -1602,7 +1567,6 @@ static int decode_header(EXRContext *s, AVFrame *frame)
s->is_tile = 0;
s->is_multipart = 0;
s->is_luma = 0;
s->has_channel = 0;
s->current_part = 0;
if (bytestream2_get_bytes_left(gb) < 10) {
@@ -1706,26 +1670,23 @@ static int decode_header(EXRContext *s, AVFrame *frame)
}
if (layer_match) { /* only search channel if the layer match is valid */
if (strlen(ch_gb.buffer) == 1) {
int ch_chr = av_toupper(*ch_gb.buffer);
if (ch_chr >= 'A' && ch_chr <= 'Z')
s->has_channel |= M(ch_chr);
av_log(s->avctx, AV_LOG_DEBUG, "%c\n", ch_chr);
}
if (!av_strcasecmp(ch_gb.buffer, "R") ||
!av_strcasecmp(ch_gb.buffer, "X") ||
!av_strcasecmp(ch_gb.buffer, "U")) {
channel_index = 0;
s->is_luma = 0;
} else if (!av_strcasecmp(ch_gb.buffer, "G") ||
!av_strcasecmp(ch_gb.buffer, "V")) {
channel_index = 1;
s->is_luma = 0;
} else if (!av_strcasecmp(ch_gb.buffer, "Y")) {
channel_index = 1;
s->is_luma = 1;
} else if (!av_strcasecmp(ch_gb.buffer, "B") ||
!av_strcasecmp(ch_gb.buffer, "Z") ||
!av_strcasecmp(ch_gb.buffer, "W")) {
channel_index = 2;
s->is_luma = 0;
} else if (!av_strcasecmp(ch_gb.buffer, "A")) {
channel_index = 3;
} else {
@@ -1784,17 +1745,12 @@ static int decode_header(EXRContext *s, AVFrame *frame)
}
}
av_assert0(s->nb_channels < INT_MAX); // Impossible due to size of the bitstream
EXRChannel *new_channels = av_realloc_array(s->channels,
s->nb_channels + 1,
sizeof(EXRChannel));
if (!new_channels) {
s->channels = av_realloc(s->channels,
++s->nb_channels * sizeof(EXRChannel));
if (!s->channels) {
ret = AVERROR(ENOMEM);
goto fail;
}
s->nb_channels ++;
s->channels = new_channels;
channel = &s->channels[s->nb_channels - 1];
channel->pixel_type = current_pixel_type;
channel->xsub = xsub;
@@ -1806,20 +1762,6 @@ static int decode_header(EXRContext *s, AVFrame *frame)
s->current_channel_offset += 4;
}
}
if (!((M('R') + M('G') + M('B')) & ~s->has_channel)) {
s->is_luma = 0;
} else if (!((M('X') + M('Y') + M('Z')) & ~s->has_channel)) {
s->is_luma = 0;
} else if (!((M('Y') + M('U') + M('V')) & ~s->has_channel)) {
s->is_luma = 0;
} else if (!((M('Y') ) & ~s->has_channel) &&
!((M('R') + M('G') + M('B') + M('U') + M('V') + M('X') + M('Z')) & s->has_channel)) {
s->is_luma = 1;
} else {
avpriv_request_sample(s->avctx, "Uncommon channel combination");
ret = AVERROR_PATCHWELCOME;
goto fail;
}
/* Check if all channels are set with an offset or if the channels
* are causing an overflow */
@@ -2109,16 +2051,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
for (int i = 0; i < 4; i++)
s->channel_offsets[i] *= 2;
}
if (s->compression == EXR_DWAA ||
s->compression == EXR_DWAB) {
for (int i = 0; i<s->nb_channels; i++) {
EXRChannel *channel = &s->channels[i];
if (channel->pixel_type != s->pixel_type) {
avpriv_request_sample(s->avctx, "mixed pixel type DWA");
return AVERROR_PATCHWELCOME;
}
}
}
switch (s->pixel_type) {
case EXR_FLOAT:
@@ -2216,8 +2148,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
}
if (s->is_tile) {
if (s->tile_attr.ySize <= 0 || s->tile_attr.xSize <= 0)
return AVERROR_INVALIDDATA;
nb_blocks = ((s->xdelta + s->tile_attr.xSize - 1) / s->tile_attr.xSize) *
((s->ydelta + s->tile_attr.ySize - 1) / s->tile_attr.ySize);
} else { /* scanline */
-2
View File
@@ -112,8 +112,6 @@ static int fastaudio_decode(AVCodecContext *avctx, AVFrame *frame,
int ret;
subframes = pkt->size / (40 * avctx->ch_layout.nb_channels);
if (subframes <= 0 || subframes > INT_MAX / 256)
return AVERROR_INVALIDDATA;
frame->nb_samples = subframes * 256;
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
return ret;
+1 -10
View File
@@ -81,7 +81,7 @@ av_cold int ff_ffv1_init_slice_state(const FFV1Context *f,
if (f->ac != AC_GOLOMB_RICE) {
if (!p->state)
p->state = av_calloc(p->context_count, CONTEXT_SIZE *
p->state = av_malloc_array(p->context_count, CONTEXT_SIZE *
sizeof(uint8_t));
if (!p->state)
return AVERROR(ENOMEM);
@@ -119,13 +119,6 @@ av_cold int ff_ffv1_init_slices_state(FFV1Context *f)
return 0;
}
int ff_need_new_slices(int width, int num_h_slices, int chroma_shift) {
int mpw = 1<<chroma_shift;
int i = width * (int64_t)(num_h_slices - 1) / num_h_slices;
return width % mpw && (width - i) % mpw == 0;
}
av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
{
int max_slice_count = f->num_h_slices * f->num_v_slices;
@@ -151,8 +144,6 @@ av_cold int ff_ffv1_init_slice_contexts(FFV1Context *f)
sc->slice_height = sye - sys;
sc->slice_x = sxs;
sc->slice_y = sys;
sc->sx = sx;
sc->sy = sy;
sc->sample_buffer = av_malloc_array((f->width + 6), 3 * MAX_PLANES *
sizeof(*sc->sample_buffer));
+1 -5
View File
@@ -44,8 +44,6 @@
#define CONTEXT_SIZE 32
#define MAX_QUANT_TABLES 8
#define MAX_QUANT_TABLE_SIZE 256
#define MAX_QUANT_TABLE_MASK (MAX_QUANT_TABLE_SIZE - 1)
#define MAX_CONTEXT_INPUTS 5
#define AC_GOLOMB_RICE 0
@@ -77,7 +75,6 @@ typedef struct FFV1SliceContext {
int slice_height;
int slice_x;
int slice_y;
int sx, sy;
int run_index;
int slice_coding_mode;
@@ -125,7 +122,7 @@ typedef struct FFV1Context {
const AVFrame *cur_enc_frame;
int plane_count;
int ac; ///< 1=range coder <-> 0=golomb rice
int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][MAX_QUANT_TABLE_SIZE];
int16_t quant_tables[MAX_QUANT_TABLES][MAX_CONTEXT_INPUTS][256];
int context_count[MAX_QUANT_TABLES];
uint8_t state_transition[256];
uint8_t (*initial_states[MAX_QUANT_TABLES])[32];
@@ -173,7 +170,6 @@ PlaneContext *ff_ffv1_planes_alloc(void);
int ff_ffv1_allocate_initial_states(FFV1Context *f);
void ff_ffv1_clear_slice_state(const FFV1Context *f, FFV1SliceContext *sc);
int ff_ffv1_close(AVCodecContext *avctx);
int ff_need_new_slices(int width, int num_h_slices, int chroma_shift);
static av_always_inline int fold(int diff, int bits)
{
+10 -9
View File
@@ -29,7 +29,7 @@ static inline int RENAME(predict)(TYPE *src, TYPE *last)
return mid_pred(L, L + T - LT, T);
}
static inline int RENAME(get_context)(const int16_t quant_table[MAX_CONTEXT_INPUTS][MAX_QUANT_TABLE_SIZE],
static inline int RENAME(get_context)(const int16_t quant_table[MAX_CONTEXT_INPUTS][256],
TYPE *src, TYPE *last, TYPE *last2)
{
const int LT = last[-1];
@@ -40,13 +40,14 @@ static inline int RENAME(get_context)(const int16_t quant_table[MAX_CONTEXT_INPU
if (quant_table[3][127] || quant_table[4][127]) {
const int TT = last2[0];
const int LL = src[-2];
return quant_table[0][(L - LT) & MAX_QUANT_TABLE_MASK] +
quant_table[1][(LT - T) & MAX_QUANT_TABLE_MASK] +
quant_table[2][(T - RT) & MAX_QUANT_TABLE_MASK] +
quant_table[3][(LL - L) & MAX_QUANT_TABLE_MASK] +
quant_table[4][(TT - T) & MAX_QUANT_TABLE_MASK];
return quant_table[0][(L - LT) & 0xFF] +
quant_table[1][(LT - T) & 0xFF] +
quant_table[2][(T - RT) & 0xFF] +
quant_table[3][(LL - L) & 0xFF] +
quant_table[4][(TT - T) & 0xFF];
} else
return quant_table[0][(L - LT) & MAX_QUANT_TABLE_MASK] +
quant_table[1][(LT - T) & MAX_QUANT_TABLE_MASK] +
quant_table[2][(T - RT) & MAX_QUANT_TABLE_MASK];
return quant_table[0][(L - LT) & 0xFF] +
quant_table[1][(LT - T) & 0xFF] +
quant_table[2][(T - RT) & 0xFF];
}
+8 -17
View File
@@ -81,11 +81,6 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState *const state,
k++;
i += i;
}
if (k > bits) {
ff_dlog(NULL, "k-overflow bias:%d error:%d drift:%d count:%d k:%d",
state->bias, state->error_sum, state->drift, state->count, k);
k = bits;
}
v = get_sr_golomb(gb, k, 12, bits);
ff_dlog(NULL, "v:%d bias:%d error:%d drift:%d count:%d k:%d",
@@ -246,7 +241,7 @@ static int decode_slice_header(const FFV1Context *f,
if (f->version > 3) {
sc->slice_reset_contexts = get_rac(c, state);
sc->slice_coding_mode = get_symbol(c, state, 0);
if (sc->slice_coding_mode != 1 && f->colorspace == 1) {
if (sc->slice_coding_mode != 1) {
sc->slice_rct_by_coef = get_symbol(c, state, 0);
sc->slice_rct_ry_coef = get_symbol(c, state, 0);
if ((uint64_t)sc->slice_rct_by_coef + (uint64_t)sc->slice_rct_ry_coef > 4) {
@@ -339,24 +334,20 @@ static int decode_slice(AVCodecContext *c, void *arg)
} else if (f->use32bit) {
uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0],
p->data[1] + ps * x + y * p->linesize[1],
p->data[2] + ps * x + y * p->linesize[2] };
if (f->transparency)
planes[3] = p->data[3] + ps * x + y * p->linesize[3];
p->data[2] + ps * x + y * p->linesize[2],
p->data[3] + ps * x + y * p->linesize[3] };
decode_rgb_frame32(f, sc, &gb, planes, width, height, p->linesize);
} else {
uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0] };
if (f->avctx->bits_per_raw_sample > 8) {
planes[1] = p->data[1] + ps * x + y * p->linesize[1];
planes[2] = p->data[2] + ps * x + y * p->linesize[2];
if (f->transparency)
planes[3] = p->data[3] + ps * x + y * p->linesize[3];
}
uint8_t *planes[4] = { p->data[0] + ps * x + y * p->linesize[0],
p->data[1] + ps * x + y * p->linesize[1],
p->data[2] + ps * x + y * p->linesize[2],
p->data[3] + ps * x + y * p->linesize[3] };
decode_rgb_frame(f, sc, &gb, planes, width, height, p->linesize);
}
if (f->ac != AC_GOLOMB_RICE && f->version > 2) {
int v;
get_rac(&sc->c, (uint8_t[]) { 129 });
v = sc->c.bytestream_end - sc->c.bytestream - 2 - 5*!!f->ec;
v = sc->c.bytestream_end - sc->c.bytestream - 2 - 5*f->ec;
if (v) {
av_log(f->avctx, AV_LOG_ERROR, "bytestream end mismatching by %d\n", v);
slice_set_damaged(f, sc);
+27 -50
View File
@@ -198,7 +198,7 @@ static av_always_inline av_flatten void put_symbol_inline(RangeCoder *c,
} while (0)
if (v) {
const unsigned a = is_signed ? FFABS(v) : v;
const int a = FFABS(v);
const int e = av_log2(a);
put_rac(c, state + 0, 0);
if (e <= 9) {
@@ -317,7 +317,7 @@ static void write_quant_table(RangeCoder *c, int16_t *quant_table)
uint8_t state[CONTEXT_SIZE];
memset(state, 128, sizeof(state));
for (i = 1; i < MAX_QUANT_TABLE_SIZE/2; i++)
for (i = 1; i < 128; i++)
if (quant_table[i] != quant_table[i - 1]) {
put_symbol(c, state, i - last - 1, 0);
last = i;
@@ -326,7 +326,7 @@ static void write_quant_table(RangeCoder *c, int16_t *quant_table)
}
static void write_quant_tables(RangeCoder *c,
int16_t quant_table[MAX_CONTEXT_INPUTS][MAX_QUANT_TABLE_SIZE])
int16_t quant_table[MAX_CONTEXT_INPUTS][256])
{
int i;
for (i = 0; i < 5; i++)
@@ -528,11 +528,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
avctx->slices > 1)
s->version = FFMAX(s->version, 2);
if ((avctx->flags & (AV_CODEC_FLAG_PASS1 | AV_CODEC_FLAG_PASS2)) && s->ac == AC_GOLOMB_RICE) {
av_log(avctx, AV_LOG_ERROR, "2 Pass mode is not possible with golomb coding\n");
return AVERROR(EINVAL);
}
// Unspecified level & slices, we choose version 1.2+ to ensure multithreaded decodability
if (avctx->slices == 0 && avctx->level < 0 && avctx->width * avctx->height > 720*576)
s->version = FFMAX(s->version, 2);
@@ -557,7 +552,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->version = FFMAX(s->version, 3);
if ((s->version == 2 || s->version>3) && avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
av_log(avctx, AV_LOG_ERROR, "Version 2 or 4 needed for requested features but version 2 or 4 is experimental and not enabled\n");
av_log(avctx, AV_LOG_ERROR, "Version 2 needed for requested features but version 2 is experimental and not enabled\n");
return AVERROR_INVALIDDATA;
}
@@ -718,7 +713,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->state_transition[i] = c.one_state[i];
}
for (i = 0; i < MAX_QUANT_TABLE_SIZE; i++) {
for (i = 0; i < 256; i++) {
s->quant_table_count = 2;
if (s->bits_per_raw_sample <= 8) {
s->quant_tables[0][0][i]= quant11[i];
@@ -729,21 +724,19 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->quant_tables[1][2][i]= 11*11*quant5 [i];
s->quant_tables[1][3][i]= 5*11*11*quant5 [i];
s->quant_tables[1][4][i]= 5*5*11*11*quant5 [i];
s->context_count[0] = (11 * 11 * 11 + 1) / 2;
s->context_count[1] = (11 * 11 * 5 * 5 * 5 + 1) / 2;
} else {
s->quant_tables[0][0][i]= quant9_10bit[i];
s->quant_tables[0][1][i]= 9*quant9_10bit[i];
s->quant_tables[0][2][i]= 9*9*quant9_10bit[i];
s->quant_tables[0][1][i]= 11*quant9_10bit[i];
s->quant_tables[0][2][i]= 11*11*quant9_10bit[i];
s->quant_tables[1][0][i]= quant9_10bit[i];
s->quant_tables[1][1][i]= 9*quant9_10bit[i];
s->quant_tables[1][2][i]= 9*9*quant5_10bit[i];
s->quant_tables[1][3][i]= 5*9*9*quant5_10bit[i];
s->quant_tables[1][4][i]= 5*5*9*9*quant5_10bit[i];
s->context_count[0] = (9 * 9 * 9 + 1) / 2;
s->context_count[1] = (9 * 9 * 5 * 5 * 5 + 1) / 2;
s->quant_tables[1][1][i]= 11*quant9_10bit[i];
s->quant_tables[1][2][i]= 11*11*quant5_10bit[i];
s->quant_tables[1][3][i]= 5*11*11*quant5_10bit[i];
s->quant_tables[1][4][i]= 5*5*11*11*quant5_10bit[i];
}
}
s->context_count[0] = (11 * 11 * 11 + 1) / 2;
s->context_count[1] = (11 * 11 * 5 * 5 * 5 + 1) / 2;
if ((ret = ff_ffv1_allocate_initial_states(s)) < 0)
return ret;
@@ -865,10 +858,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
continue;
if (maxw * maxh * (int64_t)(s->bits_per_raw_sample+1) * plane_count > 8<<24)
continue;
if (s->version < 4)
if ( ff_need_new_slices(avctx->width , s->num_h_slices, s->chroma_h_shift)
||ff_need_new_slices(avctx->height, s->num_v_slices, s->chroma_v_shift))
continue;
if (avctx->slices == s->num_h_slices * s->num_v_slices && avctx->slices <= MAX_SLICES || !avctx->slices)
goto slices_ok;
}
@@ -927,10 +916,10 @@ static void encode_slice_header(FFV1Context *f, FFV1SliceContext *sc)
int j;
memset(state, 128, sizeof(state));
put_symbol(c, state, sc->sx, 0);
put_symbol(c, state, sc->sy, 0);
put_symbol(c, state, 0, 0);
put_symbol(c, state, 0, 0);
put_symbol(c, state, (sc->slice_x +1)*f->num_h_slices / f->width , 0);
put_symbol(c, state, (sc->slice_y +1)*f->num_v_slices / f->height , 0);
put_symbol(c, state, (sc->slice_width +1)*f->num_h_slices / f->width -1, 0);
put_symbol(c, state, (sc->slice_height+1)*f->num_v_slices / f->height-1, 0);
for (j=0; j<f->plane_count; j++) {
put_symbol(c, state, sc->plane[j].quant_table_index, 0);
av_assert0(sc->plane[j].quant_table_index == f->context_model);
@@ -946,7 +935,7 @@ static void encode_slice_header(FFV1Context *f, FFV1SliceContext *sc)
if (sc->slice_coding_mode == 1)
ff_ffv1_clear_slice_state(f, sc);
put_symbol(c, state, sc->slice_coding_mode, 0);
if (sc->slice_coding_mode != 1 && f->colorspace == 1) {
if (sc->slice_coding_mode != 1) {
put_symbol(c, state, sc->slice_rct_by_coef, 0);
put_symbol(c, state, sc->slice_rct_ry_coef, 0);
}
@@ -980,9 +969,6 @@ static void choose_rct_params(const FFV1Context *f, FFV1SliceContext *sc,
int x, y, i, p, best;
int16_t *sample[3];
int lbd = f->bits_per_raw_sample <= 8;
int packed = !src[1];
int transparency = f->transparency;
int packed_size = (3 + transparency)*2;
for (y = 0; y < h; y++) {
int lastr=0, lastg=0, lastb=0;
@@ -997,15 +983,6 @@ static void choose_rct_params(const FFV1Context *f, FFV1SliceContext *sc,
b = v & 0xFF;
g = (v >> 8) & 0xFF;
r = (v >> 16) & 0xFF;
} else if (packed) {
const uint16_t *p = ((const uint16_t*)(src[0] + x*packed_size + stride[0]*y));
r = p[0];
g = p[1];
b = p[2];
} else if (f->use32bit || transparency) {
g = *((const uint16_t *)(src[0] + x*2 + stride[0]*y));
b = *((const uint16_t *)(src[1] + x*2 + stride[1]*y));
r = *((const uint16_t *)(src[2] + x*2 + stride[2]*y));
} else {
b = *((const uint16_t*)(src[0] + x*2 + stride[0]*y));
g = *((const uint16_t*)(src[1] + x*2 + stride[1]*y));
@@ -1066,7 +1043,7 @@ static int encode_slice(AVCodecContext *c, void *arg)
p->data[3] ? p->data[3] + ps*x + y*p->linesize[3] : NULL};
sc->slice_coding_mode = 0;
if (f->version > 3 && f->colorspace == 1) {
if (f->version > 3) {
choose_rct_params(f, sc, planes, p->linesize, width, height);
} else {
sc->slice_rct_by_coef = 1;
@@ -1109,13 +1086,6 @@ retry:
ret = encode_rgb_frame(f, sc, planes, width, height, p->linesize);
}
if (f->ac != AC_GOLOMB_RICE) {
sc->ac_byte_count = ff_rac_terminate(&sc->c, 1);
} else {
flush_put_bits(&sc->pb); // FIXME: nicer padding
sc->ac_byte_count += put_bytes_output(&sc->pb);
}
if (ret < 0) {
av_assert0(sc->slice_coding_mode == 0);
if (f->version < 4 || !f->ac) {
@@ -1240,7 +1210,14 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
buf_p = pkt->data;
for (i = 0; i < f->slice_count; i++) {
FFV1SliceContext *sc = &f->slices[i];
int bytes = sc->ac_byte_count;
int bytes;
if (f->ac != AC_GOLOMB_RICE) {
bytes = ff_rac_terminate(&sc->c, 1);
} else {
flush_put_bits(&sc->pb); // FIXME: nicer padding
bytes = sc->ac_byte_count + put_bytes_output(&sc->pb);
}
if (i > 0 || f->version > 2) {
av_assert0(bytes < pkt->size / f->slice_count);
memmove(buf_p, sc->c.bytestream_start, bytes);
+1
View File
@@ -208,3 +208,4 @@ static int RENAME(encode_rgb_frame)(FFV1Context *f, FFV1SliceContext *sc,
}
return 0;
}
-2
View File
@@ -32,8 +32,6 @@ int avpriv_fits_header_init(FITSHeader *header, FITSHeaderState state)
{
header->state = state;
header->naxis_index = 0;
header->naxis = 0;
memset(header->naxisn, 0, sizeof(header->naxisn));
header->blank_found = 0;
header->pcount = 0;
header->gcount = 1;

Some files were not shown because too many files have changed in this diff Show More