Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 638b521c7b |
@@ -53,6 +53,7 @@ libavutil/.*d3d12va.* @jianhuaw
|
||||
libavutil/eval.* @michaelni
|
||||
libavutil/iamf.* @jamrial
|
||||
libavutil/integer.* @michaelni
|
||||
libavutil/kiss99.* @michaelni
|
||||
libavutil/lfg.* @michaelni
|
||||
libavutil/lls.* @michaelni
|
||||
libavutil/md5.* @michaelni
|
||||
|
||||
@@ -18,14 +18,6 @@ repos:
|
||||
- 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
|
||||
- repo: https://github.com/codespell-project/codespell
|
||||
rev: v2.4.1
|
||||
hooks:
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
name: Autolabel
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, edited, synchronize]
|
||||
@@ -8,7 +6,6 @@ on:
|
||||
|
||||
jobs:
|
||||
pr_labeler:
|
||||
name: Labeler
|
||||
runs-on: utilities
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -1,14 +1,11 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release/8.0
|
||||
- master
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: Pre-Commit
|
||||
runs-on: utilities
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -1,39 +1,21 @@
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- release/8.0
|
||||
- master
|
||||
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'
|
||||
runner: [linux-amd64,linux-aarch64]
|
||||
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
|
||||
run: ./configure --enable-gpl --enable-nonfree --enable-memory-poisoning --assert-level=2
|
||||
- name: Build
|
||||
run: make -j$(nproc)
|
||||
- name: Restore Cached Fate-Suite
|
||||
@@ -48,7 +30,7 @@ jobs:
|
||||
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
|
||||
echo "hash=$(find fate-suite -type f | 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 }}
|
||||
@@ -56,13 +38,12 @@ jobs:
|
||||
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)
|
||||
run: make fate 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-8.0:latest"]
|
||||
image: ["ghcr.io/btbn/ffmpeg-builds/win64-gpl:latest"]
|
||||
runs-on: linux-amd64
|
||||
container: ${{ matrix.image }}
|
||||
steps:
|
||||
@@ -76,5 +57,3 @@ jobs:
|
||||
--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
|
||||
|
||||
@@ -1,383 +1,13 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version 8.0.2:
|
||||
avcodec/dfpwmdec: Check nb_samples
|
||||
avcodec/alsdec: do not set nbits invalidly
|
||||
swscale/swscale_unscaled: adjust last line copy
|
||||
swscale/swscale: Check srcSliceY and srcSliceH
|
||||
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
|
||||
swscale: fix signed integer overflow in color conversion arithmetic
|
||||
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
|
||||
avcodec/vp9: fix cbs fragment leak on error
|
||||
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/wmv2dec: More Checks about reading skip bits
|
||||
avcodec/cbs_h266_syntax_template: Fix w/h typo
|
||||
aacdec_usac: skip FD-specific decoding for LPD channels
|
||||
avformat/dhav: Fix handling or slightly larger files
|
||||
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
|
||||
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
|
||||
avcodec/jpeg2000dec: fix integer overflow in dequantization_int_97()
|
||||
avformat/demux: Fix integer overflows in select_from_pts_buffer()
|
||||
avcodec/golomb: Fix get_ur_golomb_jpegls() with esclen = 0
|
||||
avcodec/jpeg2000dec: Handle M_b = -1
|
||||
swresample/resample_template: add casts to avoid undefined overflows
|
||||
avcodec/h264_parser: Check pts for overflow
|
||||
avformat/rtpenc: use unsigned type for ssrc option
|
||||
swscale/output: Fix some integer overflows in yuv2rgba64_full*()
|
||||
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/libtheoraenc: make keyframe mask unsigned and handle its larger range
|
||||
avcodec/rv60dec: check last_size
|
||||
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
|
||||
avcodec/prores_raw: Tiles of width less than 16 result in undefined behavior
|
||||
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()
|
||||
avformat/flvdec: Check need_context_update when audio codec changes
|
||||
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/ffv1enc: refine end condition
|
||||
avcodec/dca_xll: Check get_rice_array()
|
||||
libavformat/argo_brp: fix incorrect ASF chunk header read
|
||||
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: allow bpno of -1
|
||||
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/hlsenc: fix format string vulnerability in parse_playlist
|
||||
lavc/vvc: Fix unchecked error codes from set_qp_y
|
||||
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
|
||||
avformat/iamf_parse: stop trying to parse files that report an unknown layout
|
||||
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
|
||||
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
|
||||
avformat/iamf_parse: fix parsing of Scalable layouts with Mono and Stereo layers
|
||||
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
|
||||
libavcodec/prores_raw: Fix heap-buffer-overflow in decode_frame
|
||||
avutil/hwcontext_d3d12va: use hwdev context for logging
|
||||
avfilter/x86/f_ebur128: only use filter_channels_avx for >= 2 channels
|
||||
fate: add missing options in config template
|
||||
avformat/hls_sample_encryption: add missing padding for audio setup buffer
|
||||
(fforge/pr/22931) avformat/mov: Merge tts after building index for old-style uncompressed PCM
|
||||
(fforge/pr/22825) lavc/videotoolbox_vp9: fix vpcC flags offset
|
||||
lavc/videotoolboxenc: return SEI parse errors
|
||||
(fforge-npc/release/8.0) aarch64/hpeldsp_neon: fix out-of-bounds read
|
||||
(fforge/pr/22415) avformat/mov: check return value of mov_read_iref_thmb()
|
||||
avformat/mov: Fix multiple issues related to mov_read_iref_dimg()
|
||||
avformat/mov: free item_name on infe entry parsing failure
|
||||
avformat/mov: check for EOF in more loops
|
||||
avformat/mov: abort if the queried item doesn't exist instead of overwriting it
|
||||
avformat/mov: add overflow checks to item offset values
|
||||
avformat/mov: reindent after the previous change
|
||||
avformat/mov: don't parse reserved ISOBMFF fields as if they were QT
|
||||
avformat/mov: make items referencing items generic
|
||||
(fforge/pr/22312) avformat/mov: fix cases where we discard iamf packets from enabled streams
|
||||
avformat/mov: fix setting iamf stream id offsets
|
||||
(fforge/pr/20965) avformat/whip: remove the confused option buffer_size
|
||||
avformat/whip: add new option ts_buffer_size to deprecate buffer_size
|
||||
avformat/whip: remind user increase -buffer_size
|
||||
avformat/whip: pass through buffer_size option to udp
|
||||
avformat/whip: fix potential 8bit overflow for profile_idc
|
||||
avformat/whip: fix 8 bits overflow and map constraint_set bits for H264
|
||||
avformat/whip: fix SDP ICE candidates parsing
|
||||
avformat/whip: fix ssrc might be same
|
||||
(fforge/pr/21699) 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/21638) checkasm/hevc_pel: rename loop variable 'size' to 'idx' to avoid confusion
|
||||
checkasm/hevc_pel: fix typo size[sizes] -> sizes[size]
|
||||
(fforge/pr/21625) avcodec/libsvtav1: rename aq_mode for v4.0.0
|
||||
(fforge/pr/21624) vulkan_vp9: fix subsampling source and show_frame flag
|
||||
(fforge/pr/21433) avfilter/vf_lcevc: attach a reference to the source frame to each passed in base picture
|
||||
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
|
||||
hwcontext_vulkan: add support for implict DRM sync for export
|
||||
(fforge/pr/21329) lavc/vvc: Prevent OOB write to slice_top_left_ctu_x in PPS CBS
|
||||
lavc/vvc: Error on inter slice with no reference pics
|
||||
forgejo: backport CI job names
|
||||
avformat/img2dec: reject input images too big to fit into a single packet
|
||||
(fforge/pr/21350) cbs_vp9: Always update loop filter and segmentation from current frame
|
||||
(fforge/pr/21330) 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
|
||||
tests/fate/filter-video: add two feedback tests
|
||||
avfilter/vf_feedback: fix feedback block
|
||||
(fforge/pr/21218) fate/ffmpeg: remove comparison against ref from fix_sub_duration_heartbeat
|
||||
configure: Lower libdvdnav and libdvdread minimum versions for EL9
|
||||
(fforge/pr/21158) avcodec/aac_ac3_parser: do not override the profile set by the decoder
|
||||
avcodec/aac_ac3_parser: simplify
|
||||
avcodec/aac_ac3_parser: remove unused USAC/ADTS code
|
||||
avfilter/af_amerge: fix possible crash with custom layouts
|
||||
(fforge/pr/21091) avcodec/vp3: Sync VLCs once during init, fix crash
|
||||
(fforge/pr/21066) avcodec/prores_raw: add missing includes
|
||||
avfilter/stack_internal: fix checkheaders test
|
||||
forgejo: apply needed CI changes for 8.0
|
||||
forgejo/workflows: run tests on correct release branch
|
||||
forgejo: backport CI changes to release/8.0
|
||||
configure: replace openssl header check with 1.1.1 API
|
||||
configure: require at least OpenSSL 1.1.1 (LTS)
|
||||
configure: remove openssl version check for whip
|
||||
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
|
||||
avfilter/vf_scale: don't attempt to rescale AV_NOPTS_VALUE
|
||||
avfilter/framesync: don't attempt to rescale AV_NOPTS_VALUE
|
||||
avutil/hwcontext_d3d12va: fix buf size when call av_buffer_create
|
||||
avfilter/f_select: Added activate for aselect
|
||||
avcodec/videotoolboxenc: fix crash with negative linesize
|
||||
avcodec/videotoolboxenc: improve Lock/Unlock BaseAddress error handling
|
||||
doc/filters: add section for VideoToolbox filter
|
||||
avformat/mov: fix missing video size when some decoders are disabled
|
||||
avformat/mov: relax check on proj box size
|
||||
(fforge/pr/20976) tests/fate/hevc: add a mv-hevc sample using long term ref
|
||||
avcodec/hevc: reset long_term_rps.nb_refs for IDR
|
||||
(fforge/pr/20987) Changelog: fix spell and remove redundant descriptions
|
||||
version <next>:
|
||||
|
||||
|
||||
version 8.0.1:
|
||||
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
|
||||
avfilter/vf_drawtext: Account for bbox text separator
|
||||
avcodec/mediacodecdec_common: Check that the input to mediacodec_wrap_sw_audio_buffer() contains channel * sample_size
|
||||
avcodec/rv60dec: Clear blk_info
|
||||
avformat/whip: Fix rtp_ctx->streams access
|
||||
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/rv60dec: add upper bound check for qp
|
||||
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()
|
||||
avcodec/ffv1enc: Consider variation in slice sizes
|
||||
libavcodec/cbs_apv_syntax_template: limit tile to 2gb
|
||||
swscale/output: Fix unsigned cast position in yuv2*
|
||||
swscale/output: Fix integer overflow in yuv2ya16_X_c_template()
|
||||
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
|
||||
configure: strip non numeric trailer from gcc version
|
||||
avformat/dhav: Fix off by length of read element error
|
||||
avformat/aviobuf: Keep checksum_ptr consistent in avio_seek()
|
||||
doc/examples/vaapi_encode: fix invalid check on fwrite
|
||||
avcodec/librsvgdec: fix compilation with librsvg 2.50.3
|
||||
avcodec/mfenc: fix memory leak with D3D11 input surfaces
|
||||
swscale/graph: fix double-free when legacy pass fails initializing
|
||||
libavformat/udp: Fix call to recvfrom(2)
|
||||
avfilter/f_ebur128: Fix incorrect ebur128 peak calculation.
|
||||
avformat/udp: fix warning about unused variable
|
||||
avdevice/lavfi: stop setting deprecated buffersink options
|
||||
configure: unbreak glslang build
|
||||
swscale/range_convert: fix truncation bias in range conversion
|
||||
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
|
||||
avfilter/af_whisper: fix srt index
|
||||
avfilter/af_whisper: fix int64 printf format
|
||||
avfilter/af_whisper: fix srt file format
|
||||
avfilter/whisper: correct option formatting
|
||||
avfilter/af_whisper: fix broken output for multibyte character
|
||||
avformat/rtsp: fix leading space in RTSP reason
|
||||
avformat/rtsp: do not log invalid values
|
||||
avformat/http: Handle IPv6 Zone ID in hostname
|
||||
avformat/dump: fix log level passed to av_log when printing stream group side data
|
||||
avcodec/hevc/sei: don't attempt to use stale values in HEVCSEITDRDI
|
||||
avcodec/hevc/sei: prevent storing a potentially bogus num_ref_displays value in HEVCSEITDRDI
|
||||
avcodec/hevc/refs: don't unconditionally discard non-IRAP frames if no IRAP frame was seen before
|
||||
libavutil/arm: Rename the HWCAP defines
|
||||
libavutil/arm: Make use of elf_aux_info() on FreeBSD/OpenBSD
|
||||
fftools/ffmpeg: fix gracefully shutdown
|
||||
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
|
||||
avcodec/videotoolboxenc: ensure bitrate is set in low_delay mode
|
||||
avcodec/videotoolboxenc: allow low latency RC with HEVC
|
||||
avcodec/videotoolboxenc: support global_quality without qscale
|
||||
avcodec/videotoolboxenc: fix the loss of precision when calculating quality
|
||||
fftools/ffmpeg_demux: ensure the display_rotation option is honored
|
||||
avcodec/mjpegdec: use ff_frame_new_side_data() to export display matrix
|
||||
avutil/tests/aes_ctr: extend the test to cover payloads smaller than a block
|
||||
avutil/aes_ctr: reintroduce the block offset state
|
||||
avfilter/vf_lcevc: support LCEVCdec version 4
|
||||
avcodec/lcevcdec: support LCEVCdec version 4
|
||||
movenc: ensure chapters track extradata is not null and populated
|
||||
|
||||
version 8.0:
|
||||
- Whisper filter
|
||||
- Drop support for OpenSSL < 1.1.0
|
||||
- Enable TLS peer certificate verification by default (on next major version bump)
|
||||
- Drop support for OpenSSL < 1.1.1
|
||||
- yasm support dropped, users need to use nasm
|
||||
- VVC VAAPI decoder
|
||||
- RealVideo 6.0 decoder
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
|
||||
┌────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 8.0 "Huffman" │
|
||||
└────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 8.0 "Huffman", about 11
|
||||
months after the release of FFmpeg 7.1.
|
||||
|
||||
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.
|
||||
@@ -4827,7 +4827,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
|
||||
}
|
||||
|
||||
@@ -5174,7 +5174,7 @@ probe_cc(){
|
||||
# but we can force it back to gnu mode and get the version from there.
|
||||
_ident=$($_cc -flavor gnu --version 2>/dev/null)
|
||||
_ld_o='-out:$@'
|
||||
_flags_filter=msvc_flags_link
|
||||
_flags_filter=msvc_flags
|
||||
_ld_lib='lib%.a'
|
||||
_ld_path='-libpath:'
|
||||
elif VSLANG=1033 $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
|
||||
@@ -7037,8 +7037,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"; } }
|
||||
@@ -7049,16 +7049,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
|
||||
@@ -7262,13 +7258,13 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR
|
||||
enabled omx && require_headers OMX_Core.h && \
|
||||
warn "The OpenMAX encoders are deprecated and will be removed in future versions"
|
||||
|
||||
enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h DTLS_get_data_mtu &&
|
||||
enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
|
||||
{ enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
|
||||
{ enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
|
||||
check_pkg_config openssl "openssl >= 1.1.1" openssl/ssl.h DTLS_get_data_mtu ||
|
||||
check_lib openssl openssl/ssl.h DTLS_get_data_mtu -lssl -lcrypto ||
|
||||
check_lib openssl openssl/ssl.h DTLS_get_data_mtu -lssl -lcrypto -lws2_32 -lgdi32 ||
|
||||
die "ERROR: openssl (>= 1.1.1) not found"; }
|
||||
check_pkg_config openssl "openssl >= 1.1.0" openssl/ssl.h OPENSSL_init_ssl ||
|
||||
check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
|
||||
check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto -lws2_32 -lgdi32 ||
|
||||
die "ERROR: openssl (>= 1.1.0) not found"; }
|
||||
enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
|
||||
enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
|
||||
require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
|
||||
@@ -7277,6 +7273,15 @@ enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/r
|
||||
}
|
||||
enabled vapoursynth && require_headers "vapoursynth/VSScript4.h vapoursynth/VapourSynth4.h"
|
||||
|
||||
enabled openssl && {
|
||||
enabled whip_muxer && {
|
||||
$pkg_config --exists --print-errors "openssl >= 1.0.1k" ||
|
||||
require_pkg_config openssl "openssl >= 1.0.1k" openssl/ssl.h SSL_library_init ||
|
||||
require_pkg_config openssl "openssl >= 1.0.1k" openssl/ssl.h OPENSSL_init_ssl
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if enabled gcrypt; then
|
||||
GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
|
||||
if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
|
||||
@@ -7749,7 +7754,7 @@ if enabled icc; then
|
||||
fi
|
||||
elif enabled gcc; then
|
||||
gcc_version=$($cc -dumpversion)
|
||||
major_version=${gcc_version%%[!0-9]*}
|
||||
major_version=${gcc_version%%.*}
|
||||
if [ $major_version -lt 13 ]; then
|
||||
# Disable tree-vectorize for GCC <13 - it has historically been buggy.
|
||||
check_optflags -fno-tree-vectorize
|
||||
|
||||
+1
-1
@@ -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 = 8.0.2
|
||||
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
-1
@@ -123,7 +123,7 @@ Internally, the TC should take decisions with a majority, or using ranked-choice
|
||||
|
||||
Each TC member must vote on such decision according to what is, in their view, best for the project.
|
||||
|
||||
If a TC member feels they are affected by a conflict of interest with regards to the case, they should announce it and recuse themselves from the TC
|
||||
If a TC member feels they are affected by a conflict of interest with regards to the case, they should announce it and recurse themselves from the TC
|
||||
discussion and vote.
|
||||
|
||||
A conflict of interest is presumed to occur when a TC member has a personal interest (e.g. financial) in a specific outcome of the case.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
+69
-100
@@ -21294,6 +21294,27 @@ If the specified expression is not valid, it is kept at its current
|
||||
value.
|
||||
@end table
|
||||
|
||||
@section scale_vt
|
||||
|
||||
Scale and convert the color parameters using VTPixelTransferSession.
|
||||
|
||||
The filter accepts the following options:
|
||||
@table @option
|
||||
@item w
|
||||
@item h
|
||||
Set the output video dimension expression. Default value is the input dimension.
|
||||
|
||||
@item color_matrix
|
||||
Set the output colorspace matrix.
|
||||
|
||||
@item color_primaries
|
||||
Set the output color primaries.
|
||||
|
||||
@item color_transfer
|
||||
Set the output transfer characteristics.
|
||||
|
||||
@end table
|
||||
|
||||
@section scharr
|
||||
Apply scharr operator to input video stream.
|
||||
|
||||
@@ -28709,106 +28730,6 @@ drawbox=x=-t:y=0.5*(ih-iw/2.4)-t:w=iw+t*2:h=iw/2.4+t*2:t=2:c=red
|
||||
|
||||
@c man end VAAPI VIDEO FILTERS
|
||||
|
||||
@chapter VideoToolbox Video Filters
|
||||
@c man begin VIDEOTOOLBOX VIDEO FILTERS
|
||||
|
||||
Below is a description of the currently available VideoToolbox video filters.
|
||||
|
||||
VideoToolbox filter depends on VideoToolbox framework, and is auto detected
|
||||
when building ffmpeg for an Apple platform such as macOS. Add
|
||||
@code{--enable-videotoolbox} to configure if autodetect is disabled.
|
||||
|
||||
@section scale_vt
|
||||
|
||||
Scale and convert the color parameters using VTPixelTransferSession.
|
||||
|
||||
The filter accepts the following options:
|
||||
@table @option
|
||||
@item w
|
||||
@item h
|
||||
Set the output video dimension expression. Default value is the input dimension.
|
||||
|
||||
@item color_matrix
|
||||
Set the output colorspace matrix.
|
||||
|
||||
@item color_primaries
|
||||
Set the output color primaries.
|
||||
|
||||
@item color_transfer
|
||||
Set the output transfer characteristics.
|
||||
|
||||
@end table
|
||||
|
||||
@subsection Examples
|
||||
|
||||
@itemize
|
||||
@item
|
||||
Perform HDR to SDR conversion, and scale to half size of input
|
||||
@example
|
||||
ffmpeg -hwaccel videotoolbox \
|
||||
-hwaccel_output_format videotoolbox_vld \
|
||||
-i hdr.mov \
|
||||
-c:v hevc_videotoolbox \
|
||||
-profile:v main \
|
||||
-b:v 3M \
|
||||
-vf scale_vt=w=iw/2:h=ih/2:color_matrix=bt709:color_primaries=bt709:color_transfer=bt709 \
|
||||
-c:a copy \
|
||||
-tag:v hvc1 \
|
||||
sdr.mp4
|
||||
@end example
|
||||
|
||||
@end itemize
|
||||
|
||||
@section transpose_vt
|
||||
|
||||
Transpose rows with columns in the input video and optionally flip it.
|
||||
For more in depth examples see the @ref{transpose} video filter, which shares mostly the same options.
|
||||
|
||||
It accepts the following parameters:
|
||||
|
||||
@table @option
|
||||
|
||||
@item dir
|
||||
Specify the transposition direction.
|
||||
|
||||
Can assume the following values:
|
||||
@table @samp
|
||||
@item cclock_flip
|
||||
Rotate by 90 degrees counterclockwise and vertically flip. (default)
|
||||
|
||||
@item clock
|
||||
Rotate by 90 degrees clockwise.
|
||||
|
||||
@item cclock
|
||||
Rotate by 90 degrees counterclockwise.
|
||||
|
||||
@item clock_flip
|
||||
Rotate by 90 degrees clockwise and vertically flip.
|
||||
|
||||
@item hflip
|
||||
Flip the input video horizontally.
|
||||
|
||||
@item vflip
|
||||
Flip the input video vertically.
|
||||
|
||||
@end table
|
||||
|
||||
@item passthrough
|
||||
Do not apply the transposition if the input geometry matches the one
|
||||
specified by the specified value. It accepts the following values:
|
||||
@table @samp
|
||||
@item none
|
||||
Always apply transposition. (default)
|
||||
@item portrait
|
||||
Preserve portrait geometry (when @var{height} >= @var{width}).
|
||||
@item landscape
|
||||
Preserve landscape geometry (when @var{width} >= @var{height}).
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@c man end VIDEOTOOLBOX VIDEO FILTERS
|
||||
|
||||
@chapter Vulkan Video Filters
|
||||
@c man begin VULKAN VIDEO FILTERS
|
||||
|
||||
@@ -29110,6 +29031,54 @@ Default value is @code{0}.
|
||||
|
||||
@end table
|
||||
|
||||
@section transpose_vt
|
||||
|
||||
Transpose rows with columns in the input video and optionally flip it.
|
||||
For more in depth examples see the @ref{transpose} video filter, which shares mostly the same options.
|
||||
|
||||
It accepts the following parameters:
|
||||
|
||||
@table @option
|
||||
|
||||
@item dir
|
||||
Specify the transposition direction.
|
||||
|
||||
Can assume the following values:
|
||||
@table @samp
|
||||
@item cclock_flip
|
||||
Rotate by 90 degrees counterclockwise and vertically flip. (default)
|
||||
|
||||
@item clock
|
||||
Rotate by 90 degrees clockwise.
|
||||
|
||||
@item cclock
|
||||
Rotate by 90 degrees counterclockwise.
|
||||
|
||||
@item clock_flip
|
||||
Rotate by 90 degrees clockwise and vertically flip.
|
||||
|
||||
@item hflip
|
||||
Flip the input video horizontally.
|
||||
|
||||
@item vflip
|
||||
Flip the input video vertically.
|
||||
|
||||
@end table
|
||||
|
||||
@item passthrough
|
||||
Do not apply the transposition if the input geometry matches the one
|
||||
specified by the specified value. It accepts the following values:
|
||||
@table @samp
|
||||
@item none
|
||||
Always apply transposition. (default)
|
||||
@item portrait
|
||||
Preserve portrait geometry (when @var{height} >= @var{width}).
|
||||
@item landscape
|
||||
Preserve landscape geometry (when @var{width} >= @var{height}).
|
||||
@end table
|
||||
|
||||
@end table
|
||||
|
||||
@section transpose_vulkan
|
||||
|
||||
Transpose rows with columns in the input video and optionally flip it.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3955,10 +3955,6 @@ Default value is 5000.
|
||||
Set the maximum size, in bytes, of RTP packets that send out.
|
||||
Default value is 1500.
|
||||
|
||||
@item ts_buffer_size @var{integer}
|
||||
Set the buffer size, in bytes, of underlying protocol.
|
||||
Default value is -1(auto). The UDP auto selects a reasonable value.
|
||||
|
||||
@item authorization @var{string}
|
||||
The optional Bearer token for WHIP Authorization.
|
||||
|
||||
|
||||
+2
-3
@@ -806,6 +806,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();
|
||||
@@ -889,9 +891,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)
|
||||
|
||||
@@ -257,8 +257,6 @@ typedef struct OptionsContext {
|
||||
SpecifierOptList enc_stats_pre_fmt;
|
||||
SpecifierOptList enc_stats_post_fmt;
|
||||
SpecifierOptList mux_stats_fmt;
|
||||
|
||||
int depth;
|
||||
} OptionsContext;
|
||||
|
||||
enum IFilterFlags {
|
||||
|
||||
+1
-69
@@ -67,7 +67,6 @@ typedef struct DemuxStream {
|
||||
int reinit_filters;
|
||||
int autorotate;
|
||||
int apply_cropping;
|
||||
int force_display_matrix;
|
||||
int drop_changed;
|
||||
|
||||
|
||||
@@ -1184,7 +1183,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;
|
||||
@@ -1219,8 +1217,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;
|
||||
}
|
||||
|
||||
@@ -1459,15 +1455,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)
|
||||
@@ -1586,56 +1573,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;
|
||||
@@ -1647,13 +1584,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);
|
||||
|
||||
@@ -1593,7 +1593,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 */
|
||||
@@ -1604,16 +1604,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))
|
||||
|
||||
@@ -558,8 +558,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],
|
||||
@@ -1023,12 +1021,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);
|
||||
|
||||
@@ -1040,7 +1032,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;
|
||||
|
||||
@@ -1068,7 +1059,6 @@ static int opt_preset(void *optctx, const char *opt, const char *arg)
|
||||
}
|
||||
|
||||
fail:
|
||||
o->depth = depth;
|
||||
fclose(f);
|
||||
|
||||
return ret;
|
||||
|
||||
+2
-2
@@ -45,6 +45,7 @@ OBJS = ac3_parser.o \
|
||||
get_buffer.o \
|
||||
imgconvert.o \
|
||||
jni.o \
|
||||
lcevcdec.o \
|
||||
mathtables.o \
|
||||
mediacodec.o \
|
||||
mpeg12framerate.o \
|
||||
@@ -127,7 +128,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
|
||||
@@ -637,7 +637,7 @@ OBJS-$(CONFIG_PRORES_DECODER) += proresdec.o proresdsp.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_AW_ENCODER) += proresenc_anatoliy.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_KS_ENCODER) += proresenc_kostya.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_RAW_DECODER) += prores_raw.o proresdsp.o proresdata.o
|
||||
OBJS-$(CONFIG_PRORES_RAW_DECODER) += prores_raw.o
|
||||
OBJS-$(CONFIG_PRORES_VIDEOTOOLBOX_ENCODER) += videotoolboxenc.o
|
||||
OBJS-$(CONFIG_PROSUMER_DECODER) += prosumer.o
|
||||
OBJS-$(CONFIG_PSD_DECODER) += psd.o
|
||||
|
||||
+3
-34
@@ -62,7 +62,6 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/tx.h"
|
||||
#include "libavutil/version.h"
|
||||
#include "libavutil/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 */
|
||||
av_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++)
|
||||
av_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;
|
||||
@@ -1138,7 +1107,7 @@ static av_cold int decode_close(AVCodecContext *avctx)
|
||||
AACUSACConfig *usac = &oc->usac;
|
||||
for (int j = 0; j < usac->nb_elems; j++) {
|
||||
AACUsacElemConfig *ec = &usac->elems[j];
|
||||
av_refstruct_unref(&ec->ext.pl_buf);
|
||||
av_freep(&ec->ext.pl_data);
|
||||
}
|
||||
|
||||
av_channel_layout_uninit(&ac->oc[i].ch_layout);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 "libavutil/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)
|
||||
@@ -330,7 +314,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));
|
||||
@@ -1303,8 +1287,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) {
|
||||
@@ -1354,9 +1337,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1592,6 +1574,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;
|
||||
@@ -1618,26 +1601,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 = av_refstruct_alloc_ext(e->ext.pl_data_offset + len,
|
||||
AV_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);
|
||||
|
||||
av_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;
|
||||
@@ -1649,7 +1624,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;
|
||||
|
||||
@@ -1667,7 +1642,7 @@ static int parse_ext_ele(AACDecContext *ac, AACUsacElemConfig *e,
|
||||
/* This should never happen */
|
||||
av_assert0(0);
|
||||
}
|
||||
av_refstruct_unref(&e->ext.pl_buf);
|
||||
av_freep(&e->ext.pl_data);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -147,15 +147,15 @@ get_next:
|
||||
} else {
|
||||
#if CONFIG_AAC_PARSER
|
||||
AACADTSHeaderInfo hdr;
|
||||
GetBitContext gb;
|
||||
|
||||
init_get_bits8(&gb, buf, buf_size);
|
||||
if (buf_size < AV_AAC_ADTS_HEADER_SIZE ||
|
||||
ff_adts_header_parse_buf(buf, &hdr) < 0)
|
||||
ff_adts_header_parse(&gb, &hdr) < 0)
|
||||
return i;
|
||||
|
||||
if (avctx->profile == AV_PROFILE_UNKNOWN)
|
||||
avctx->profile = hdr.object_type - 1;
|
||||
/* ADTS does not support USAC */
|
||||
s1->key_frame = 1;
|
||||
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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -506,13 +506,14 @@ function ff_pred16x16_plane_neon_10, export=1
|
||||
sxtl v6.4s, v5.4h // c
|
||||
|
||||
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]
|
||||
saddw v16.4s, v16.4s, v0.4h
|
||||
saddw2 v17.4s, v17.4s, v0.8h
|
||||
sub v3.4s, v3.4s, v2.4s
|
||||
|
||||
mov w3, #16
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1037,8 +1037,6 @@ static int get_nb_samples(AVCodecContext *avctx, GetByteContext *gb,
|
||||
|
||||
if(ch <= 0)
|
||||
return 0;
|
||||
if (buf_size > INT_MAX / 2)
|
||||
return 0;
|
||||
|
||||
switch (avctx->codec->id) {
|
||||
/* constant, only check buf_size */
|
||||
|
||||
+4
-13
@@ -1548,12 +1548,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1564,10 +1560,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 Table 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;
|
||||
}
|
||||
@@ -1641,7 +1634,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);
|
||||
@@ -1797,9 +1790,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) {
|
||||
|
||||
@@ -152,9 +152,8 @@ int ff_aom_parse_film_grain_sets(AVFilmGrainAFGS1Params *s,
|
||||
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])
|
||||
if (!fgp)
|
||||
goto error;
|
||||
aom = &fgp->codec.aom;
|
||||
|
||||
@@ -213,7 +212,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;
|
||||
|
||||
+7
-53
@@ -35,16 +35,6 @@
|
||||
#include "thread.h"
|
||||
|
||||
|
||||
typedef struct APVDerivedTileInfo {
|
||||
uint8_t tile_cols;
|
||||
uint8_t tile_rows;
|
||||
uint16_t num_tiles;
|
||||
// The spec uses an extra element on the end of these arrays
|
||||
// not corresponding to any tile.
|
||||
uint16_t col_starts[APV_MAX_TILE_COLS + 1];
|
||||
uint16_t row_starts[APV_MAX_TILE_ROWS + 1];
|
||||
} APVDerivedTileInfo;
|
||||
|
||||
typedef struct APVDecodeContext {
|
||||
CodedBitstreamContext *cbc;
|
||||
APVDSPContext dsp;
|
||||
@@ -62,9 +52,9 @@ typedef struct APVDecodeContext {
|
||||
static const enum AVPixelFormat apv_format_table[5][5] = {
|
||||
{ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16 },
|
||||
{ 0 }, // 4:2:0 is not valid.
|
||||
{ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV422P16 },
|
||||
{ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_YUV444P14, AV_PIX_FMT_YUV444P16 },
|
||||
{ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P12, 0 ,AV_PIX_FMT_YUVA444P16 },
|
||||
{ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUV422P16 },
|
||||
{ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUV444P16 },
|
||||
{ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_YUVA444P16 },
|
||||
};
|
||||
|
||||
static APVVLCLUT decode_lut;
|
||||
@@ -85,11 +75,6 @@ static int apv_decode_check_format(AVCodecContext *avctx,
|
||||
avctx->pix_fmt =
|
||||
apv_format_table[header->frame_info.chroma_format_idc][bit_depth - 4 >> 2];
|
||||
|
||||
if (!avctx->pix_fmt) {
|
||||
avpriv_request_sample(avctx, "YUVA444P14");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
err = ff_set_dimensions(avctx,
|
||||
FFALIGN(header->frame_info.frame_width, 16),
|
||||
FFALIGN(header->frame_info.frame_height, 16));
|
||||
@@ -194,7 +179,7 @@ static int apv_decode_tile_component(AVCodecContext *avctx, void *data,
|
||||
APVRawFrame *input = data;
|
||||
APVDecodeContext *apv = avctx->priv_data;
|
||||
const CodedBitstreamAPVContext *apv_cbc = apv->cbc->priv_data;
|
||||
const APVDerivedTileInfo *tile_info = &apv->tile_info;
|
||||
const APVDerivedTileInfo *tile_info = &apv_cbc->tile_info;
|
||||
|
||||
int tile_index = job / apv_cbc->num_comp;
|
||||
int comp_index = job % apv_cbc->num_comp;
|
||||
@@ -307,38 +292,12 @@ fail:
|
||||
return err;
|
||||
}
|
||||
|
||||
static void apv_derive_tile_info(APVDerivedTileInfo *ti,
|
||||
const APVRawFrameHeader *fh)
|
||||
{
|
||||
int frame_width_in_mbs = (fh->frame_info.frame_width + (APV_MB_WIDTH - 1)) >> 4;
|
||||
int frame_height_in_mbs = (fh->frame_info.frame_height + (APV_MB_HEIGHT - 1)) >> 4;
|
||||
int start_mb, i;
|
||||
|
||||
start_mb = 0;
|
||||
for (i = 0; start_mb < frame_width_in_mbs; i++) {
|
||||
ti->col_starts[i] = start_mb * APV_MB_WIDTH;
|
||||
start_mb += fh->tile_info.tile_width_in_mbs;
|
||||
}
|
||||
ti->col_starts[i] = frame_width_in_mbs * APV_MB_WIDTH;
|
||||
ti->tile_cols = i;
|
||||
|
||||
start_mb = 0;
|
||||
for (i = 0; start_mb < frame_height_in_mbs; i++) {
|
||||
ti->row_starts[i] = start_mb * APV_MB_HEIGHT;
|
||||
start_mb += fh->tile_info.tile_height_in_mbs;
|
||||
}
|
||||
ti->row_starts[i] = frame_height_in_mbs * APV_MB_HEIGHT;
|
||||
ti->tile_rows = i;
|
||||
|
||||
ti->num_tiles = ti->tile_cols * ti->tile_rows;
|
||||
}
|
||||
|
||||
static int apv_decode(AVCodecContext *avctx, AVFrame *output,
|
||||
APVRawFrame *input)
|
||||
{
|
||||
APVDecodeContext *apv = avctx->priv_data;
|
||||
const AVPixFmtDescriptor *desc = NULL;
|
||||
APVDerivedTileInfo *tile_info = &apv->tile_info;
|
||||
const CodedBitstreamAPVContext *apv_cbc = apv->cbc->priv_data;
|
||||
const APVDerivedTileInfo *tile_info = &apv_cbc->tile_info;
|
||||
int err, job_count;
|
||||
|
||||
err = apv_decode_check_format(avctx, &input->frame_header);
|
||||
@@ -347,9 +306,6 @@ static int apv_decode(AVCodecContext *avctx, AVFrame *output,
|
||||
return err;
|
||||
}
|
||||
|
||||
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
av_assert0(desc);
|
||||
|
||||
err = ff_thread_get_buffer(avctx, output, 0);
|
||||
if (err < 0)
|
||||
return err;
|
||||
@@ -357,11 +313,9 @@ static int apv_decode(AVCodecContext *avctx, AVFrame *output,
|
||||
apv->output_frame = output;
|
||||
atomic_store_explicit(&apv->tile_errors, 0, memory_order_relaxed);
|
||||
|
||||
apv_derive_tile_info(tile_info, &input->frame_header);
|
||||
|
||||
// Each component within a tile is independent of every other,
|
||||
// so we can decode all in parallel.
|
||||
job_count = tile_info->num_tiles * desc->nb_components;
|
||||
job_count = tile_info->num_tiles * apv_cbc->num_comp;
|
||||
|
||||
avctx->execute2(avctx, apv_decode_tile_component,
|
||||
input, NULL, job_count);
|
||||
|
||||
+4
-12
@@ -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) {
|
||||
@@ -1304,8 +1303,6 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
|
||||
av_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) {
|
||||
@@ -1342,8 +1339,6 @@ static int av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
|
||||
|
||||
av_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
|
||||
@@ -1416,11 +1411,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:
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -236,7 +236,7 @@ static int ff_eia608_to_smpte436m_filter(AVBSFContext *ctx, AVPacket *out)
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
ret = 0;
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
if (ret < 0)
|
||||
|
||||
@@ -68,8 +68,6 @@ static int ff_smpte436m_to_eia608_filter(AVBSFContext *ctx, AVPacket *out)
|
||||
// verified it won't fail by running it above
|
||||
av_smpte_291m_anc_8bit_extract_cta_708(&anc, out->data, ctx);
|
||||
|
||||
av_packet_free(&in);
|
||||
|
||||
return 0;
|
||||
}
|
||||
if (ret != AVERROR_EOF)
|
||||
|
||||
+21
-6
@@ -37,18 +37,33 @@ static int cbs_apv_get_num_comp(const APVRawFrameHeader *fh)
|
||||
}
|
||||
}
|
||||
|
||||
static void cbs_apv_derive_tile_info(CodedBitstreamContext *ctx,
|
||||
static void cbs_apv_derive_tile_info(APVDerivedTileInfo *ti,
|
||||
const APVRawFrameHeader *fh)
|
||||
{
|
||||
CodedBitstreamAPVContext *priv = ctx->priv_data;
|
||||
int frame_width_in_mbs = (fh->frame_info.frame_width + 15) / 16;
|
||||
int frame_height_in_mbs = (fh->frame_info.frame_height + 15) / 16;
|
||||
int tile_cols = (frame_width_in_mbs + fh->tile_info.tile_width_in_mbs - 1) / fh->tile_info.tile_width_in_mbs;
|
||||
int tile_rows = (frame_height_in_mbs + fh->tile_info.tile_height_in_mbs - 1) / fh->tile_info.tile_height_in_mbs;
|
||||
int start_mb, i;
|
||||
|
||||
av_assert0(tile_cols <= APV_MAX_TILE_COLS && tile_rows <= APV_MAX_TILE_ROWS);
|
||||
start_mb = 0;
|
||||
for (i = 0; start_mb < frame_width_in_mbs; i++) {
|
||||
ti->col_starts[i] = start_mb * APV_MB_WIDTH;
|
||||
start_mb += fh->tile_info.tile_width_in_mbs;
|
||||
}
|
||||
av_assert0(i <= APV_MAX_TILE_COLS);
|
||||
ti->col_starts[i] = frame_width_in_mbs * APV_MB_WIDTH;
|
||||
ti->tile_cols = i;
|
||||
|
||||
priv->num_tiles = tile_cols * tile_rows;
|
||||
start_mb = 0;
|
||||
for (i = 0; start_mb < frame_height_in_mbs; i++) {
|
||||
av_assert0(i < APV_MAX_TILE_ROWS);
|
||||
ti->row_starts[i] = start_mb * APV_MB_HEIGHT;
|
||||
start_mb += fh->tile_info.tile_height_in_mbs;
|
||||
}
|
||||
av_assert0(i <= APV_MAX_TILE_ROWS);
|
||||
ti->row_starts[i] = frame_height_in_mbs * APV_MB_HEIGHT;
|
||||
ti->tile_rows = i;
|
||||
|
||||
ti->num_tiles = ti->tile_cols * ti->tile_rows;
|
||||
}
|
||||
|
||||
|
||||
|
||||
+11
-1
@@ -187,11 +187,21 @@ typedef struct APVRawMetadata {
|
||||
} APVRawMetadata;
|
||||
|
||||
|
||||
typedef struct APVDerivedTileInfo {
|
||||
uint8_t tile_cols;
|
||||
uint8_t tile_rows;
|
||||
uint16_t num_tiles;
|
||||
// The spec uses an extra element on the end of these arrays
|
||||
// not corresponding to any tile.
|
||||
uint16_t col_starts[APV_MAX_TILE_COLS + 1];
|
||||
uint16_t row_starts[APV_MAX_TILE_ROWS + 1];
|
||||
} APVDerivedTileInfo;
|
||||
|
||||
typedef struct CodedBitstreamAPVContext {
|
||||
int bit_depth;
|
||||
int num_comp;
|
||||
|
||||
uint16_t num_tiles;
|
||||
APVDerivedTileInfo tile_info;
|
||||
} CodedBitstreamAPVContext;
|
||||
|
||||
#endif /* AVCODEC_CBS_APV_H */
|
||||
|
||||
@@ -128,10 +128,10 @@ static int FUNC(tile_info)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
|
||||
ub(1, tile_size_present_in_fh_flag);
|
||||
|
||||
cbs_apv_derive_tile_info(ctx, fh);
|
||||
cbs_apv_derive_tile_info(&priv->tile_info, fh);
|
||||
|
||||
if (current->tile_size_present_in_fh_flag) {
|
||||
for (int t = 0; t < priv->num_tiles; t++) {
|
||||
for (int t = 0; t < priv->tile_info.num_tiles; t++) {
|
||||
us(32, tile_size_in_fh[t], 10, MAX_UINT_BITS(32), 1, t);
|
||||
}
|
||||
}
|
||||
@@ -262,8 +262,8 @@ static int FUNC(frame)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
|
||||
CHECK(FUNC(frame_header)(ctx, rw, ¤t->frame_header));
|
||||
|
||||
for (int t = 0; t < priv->num_tiles; t++) {
|
||||
us(32, tile_size[t], 10, MAX_INT_BITS(32), 1, t);
|
||||
for (int t = 0; t < priv->tile_info.num_tiles; t++) {
|
||||
us(32, tile_size[t], 10, MAX_UINT_BITS(32), 1, t);
|
||||
|
||||
CHECK(FUNC(tile)(ctx, rw, ¤t->tile[t],
|
||||
t, current->tile_size[t]));
|
||||
|
||||
@@ -1216,7 +1216,7 @@ static int FUNC(sps)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
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))
|
||||
@@ -1971,18 +1971,16 @@ static int FUNC(pps) (CodedBitstreamContext *ctx, RWContext *rw,
|
||||
current->slice_top_left_tile_idx[i] = tile_idx;
|
||||
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,12 +2011,6 @@ 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,
|
||||
@@ -2039,13 +2031,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;
|
||||
@@ -3263,12 +3248,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;
|
||||
}
|
||||
@@ -3508,7 +3487,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);
|
||||
}
|
||||
|
||||
@@ -152,6 +152,7 @@ static int FUNC(interpolation_filter)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
static int FUNC(loop_filter_params)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
VP9RawFrameHeader *current)
|
||||
{
|
||||
CodedBitstreamVP9Context *vp9 = ctx->priv_data;
|
||||
int err, i;
|
||||
|
||||
f(6, loop_filter_level);
|
||||
@@ -159,6 +160,8 @@ static int FUNC(loop_filter_params)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
|
||||
f(1, loop_filter_delta_enabled);
|
||||
if (current->loop_filter_delta_enabled) {
|
||||
memcpy(current->loop_filter_ref_deltas, vp9->loop_filter_ref_deltas, sizeof(vp9->loop_filter_ref_deltas));
|
||||
memcpy(current->loop_filter_mode_deltas, vp9->loop_filter_mode_deltas, sizeof(vp9->loop_filter_mode_deltas));
|
||||
f(1, loop_filter_delta_update);
|
||||
if (current->loop_filter_delta_update) {
|
||||
for (i = 0; i < VP9_MAX_REF_FRAMES; i++) {
|
||||
@@ -171,9 +174,9 @@ static int FUNC(loop_filter_params)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
if (current->update_mode_delta[i])
|
||||
ss(6, loop_filter_mode_deltas[i], 1, i);
|
||||
}
|
||||
memcpy(vp9->loop_filter_ref_deltas, current->loop_filter_ref_deltas, sizeof(vp9->loop_filter_ref_deltas));
|
||||
memcpy(vp9->loop_filter_mode_deltas, current->loop_filter_mode_deltas, sizeof(vp9->loop_filter_mode_deltas));
|
||||
}
|
||||
} else {
|
||||
infer(loop_filter_delta_update, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -198,11 +201,18 @@ static int FUNC(segmentation_params)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
{
|
||||
static const uint8_t segmentation_feature_bits[VP9_SEG_LVL_MAX] = { 8, 6, 2, 0 };
|
||||
static const uint8_t segmentation_feature_signed[VP9_SEG_LVL_MAX] = { 1, 1, 0, 0 };
|
||||
|
||||
CodedBitstreamVP9Context *vp9 = ctx->priv_data;
|
||||
int err, i, j;
|
||||
|
||||
f(1, segmentation_enabled);
|
||||
|
||||
if (current->segmentation_enabled) {
|
||||
memcpy(current->segmentation_tree_probs, vp9->segmentation_tree_probs, sizeof(vp9->segmentation_tree_probs));
|
||||
memcpy(current->segmentation_pred_prob, vp9->segmentation_pred_prob, sizeof(vp9->segmentation_pred_prob));
|
||||
memcpy(current->feature_enabled, vp9->feature_enabled, sizeof(vp9->feature_enabled));
|
||||
memcpy(current->feature_value, vp9->feature_value, sizeof(vp9->feature_value));
|
||||
memcpy(current->feature_sign, vp9->feature_sign, sizeof(vp9->feature_sign));
|
||||
f(1, segmentation_update_map);
|
||||
if (current->segmentation_update_map) {
|
||||
for (i = 0; i < 7; i++)
|
||||
@@ -214,6 +224,8 @@ static int FUNC(segmentation_params)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
else
|
||||
infer(segmentation_pred_prob[i], 255);
|
||||
}
|
||||
memcpy(vp9->segmentation_tree_probs, current->segmentation_tree_probs, sizeof(vp9->segmentation_tree_probs));
|
||||
memcpy(vp9->segmentation_pred_prob, current->segmentation_pred_prob, sizeof(vp9->segmentation_pred_prob));
|
||||
}
|
||||
|
||||
f(1, segmentation_update_data);
|
||||
@@ -236,9 +248,10 @@ static int FUNC(segmentation_params)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
}
|
||||
}
|
||||
}
|
||||
memcpy(vp9->feature_enabled, current->feature_enabled, sizeof(vp9->feature_enabled));
|
||||
memcpy(vp9->feature_value, current->feature_value, sizeof(vp9->feature_value));
|
||||
memcpy(vp9->feature_sign, current->feature_sign, sizeof(vp9->feature_sign));
|
||||
}
|
||||
} else {
|
||||
infer(segmentation_update_data, 0);
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -355,6 +368,18 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
|
||||
f(2, frame_context_idx);
|
||||
|
||||
if (current->frame_type == VP9_KEY_FRAME || current->error_resilient_mode || current->intra_only) {
|
||||
infer(update_ref_delta[0], 1);
|
||||
infer(update_ref_delta[1], 0);
|
||||
infer(update_ref_delta[2], -1);
|
||||
infer(update_ref_delta[3], -1);
|
||||
infer(loop_filter_mode_deltas[0], 0);
|
||||
infer(loop_filter_mode_deltas[1], 0);
|
||||
memset(vp9->feature_enabled, 0, sizeof(current->feature_enabled));
|
||||
memset(vp9->feature_value, 0, sizeof(current->feature_value));
|
||||
memset(vp9->feature_sign, 0, sizeof(current->feature_sign));
|
||||
}
|
||||
|
||||
CHECK(FUNC(loop_filter_params)(ctx, rw, current));
|
||||
CHECK(FUNC(quantization_params)(ctx, rw, current));
|
||||
CHECK(FUNC(segmentation_params)(ctx, rw, current));
|
||||
@@ -374,58 +399,6 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw,
|
||||
}
|
||||
}
|
||||
|
||||
// Update top-level loop filter and segmentation state with changes
|
||||
// from this frame.
|
||||
if (current->frame_type == VP9_KEY_FRAME ||
|
||||
current->intra_only ||
|
||||
current->error_resilient_mode) {
|
||||
// setup_past_independence() - fill with the initial values.
|
||||
|
||||
vp9->loop_filter_ref_deltas[VP9_INTRA_FRAME] = 1;
|
||||
vp9->loop_filter_ref_deltas[VP9_LAST_FRAME] = 0;
|
||||
vp9->loop_filter_ref_deltas[VP9_GOLDEN_FRAME] = -1;
|
||||
vp9->loop_filter_ref_deltas[VP9_ALTREF_FRAME] = -1;
|
||||
|
||||
vp9->loop_filter_mode_deltas[0] = 0;
|
||||
vp9->loop_filter_mode_deltas[1] = 0;
|
||||
|
||||
memset(vp9->feature_enabled, 0, sizeof(vp9->feature_enabled));
|
||||
memset(vp9->feature_value, 0, sizeof(vp9->feature_value));
|
||||
memset(vp9->feature_sign, 0, sizeof(vp9->feature_sign));
|
||||
}
|
||||
|
||||
// Modify previous state based on updates in this frame.
|
||||
if (current->loop_filter_delta_update) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (current->update_ref_delta[i])
|
||||
vp9->loop_filter_ref_deltas[i] =
|
||||
current->loop_filter_ref_deltas[i];
|
||||
}
|
||||
for (i = 0; i < 2; i++) {
|
||||
if (current->update_mode_delta[i])
|
||||
vp9->loop_filter_mode_deltas[i] =
|
||||
current->loop_filter_mode_deltas[i];
|
||||
}
|
||||
}
|
||||
|
||||
if (current->segmentation_update_data) {
|
||||
memcpy(vp9->feature_enabled, current->feature_enabled,
|
||||
sizeof(vp9->feature_enabled));
|
||||
memcpy(vp9->feature_value, current->feature_value,
|
||||
sizeof(vp9->feature_value));
|
||||
memcpy(vp9->feature_sign, current->feature_sign,
|
||||
sizeof(vp9->feature_sign));
|
||||
|
||||
if (current->segmentation_update_map) {
|
||||
memcpy(vp9->segmentation_tree_probs,
|
||||
current->segmentation_tree_probs,
|
||||
sizeof(vp9->segmentation_tree_probs));
|
||||
memcpy(vp9->segmentation_pred_prob,
|
||||
current->segmentation_pred_prob,
|
||||
sizeof(vp9->segmentation_pred_prob));
|
||||
}
|
||||
}
|
||||
|
||||
av_log(ctx->log_ctx, AV_LOG_DEBUG, "Frame: size %dx%d "
|
||||
"subsample %dx%d bit_depth %d tiles %dx%d.\n",
|
||||
vp9->frame_width, vp9->frame_height,
|
||||
|
||||
+2
-7
@@ -631,7 +631,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;
|
||||
@@ -698,15 +698,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) {
|
||||
|
||||
@@ -91,15 +91,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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -973,7 +973,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);
|
||||
@@ -994,8 +995,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);
|
||||
@@ -1017,8 +1018,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);
|
||||
@@ -1038,7 +1039,7 @@ rc_mode_found:
|
||||
|
||||
ctx->rc.ConfigParams.pConfiguration_QVBR = qvbr_ctl;
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
+5
-15
@@ -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)
|
||||
|
||||
+18
-36
@@ -93,14 +93,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)
|
||||
@@ -1577,29 +1573,26 @@ 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)
|
||||
{
|
||||
#if CONFIG_LIBLCEVC_DEC
|
||||
AVCodecInternal *avci = avctx->internal;
|
||||
DecodeContext *dc = decode_ctx(avci);
|
||||
|
||||
if (dc->lcevc.frame) {
|
||||
if (dc->lcevc_frame) {
|
||||
FrameDecodeData *fdd = frame->private_ref;
|
||||
FFLCEVCFrame *frame_ctx;
|
||||
int ret;
|
||||
@@ -1614,13 +1607,13 @@ static int attach_post_process_data(AVCodecContext *avctx, AVFrame *frame)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
frame_ctx->lcevc = av_refstruct_ref(dc->lcevc.ctx);
|
||||
frame_ctx->lcevc = av_refstruct_ref(dc->lcevc);
|
||||
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;
|
||||
frame->width = dc->width;
|
||||
frame->height = dc->height;
|
||||
|
||||
ret = avctx->get_buffer2(avctx, frame_ctx->frame, 0);
|
||||
if (ret < 0) {
|
||||
@@ -1634,8 +1627,7 @@ static int attach_post_process_data(AVCodecContext *avctx, AVFrame *frame)
|
||||
fdd->post_process_opaque_free = ff_lcevc_unref;
|
||||
fdd->post_process = ff_lcevc_process;
|
||||
}
|
||||
dc->lcevc.frame = 0;
|
||||
#endif
|
||||
dc->lcevc_frame = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2003,13 +1995,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;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -2247,19 +2235,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
|
||||
av_refstruct_replace(&dst_dc->lcevc.ctx, src_dc->lcevc.ctx);
|
||||
#endif
|
||||
av_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);
|
||||
|
||||
av_refstruct_unref(&dc->lcevc.ctx);
|
||||
#endif
|
||||
av_refstruct_unref(&dc->lcevc);
|
||||
}
|
||||
|
||||
+3
-7
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
@@ -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 av_cold 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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
+15
-72
@@ -175,9 +175,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;
|
||||
@@ -637,9 +634,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);
|
||||
@@ -751,12 +745,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 ) |
|
||||
@@ -998,8 +992,8 @@ 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;
|
||||
@@ -1011,11 +1005,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);
|
||||
@@ -1032,20 +1021,11 @@ 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)
|
||||
@@ -1488,8 +1468,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;
|
||||
}
|
||||
}
|
||||
@@ -1629,7 +1608,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) {
|
||||
@@ -1733,26 +1711,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 {
|
||||
@@ -1811,17 +1786,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;
|
||||
@@ -1833,20 +1803,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 */
|
||||
@@ -2130,17 +2086,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
|
||||
if ((ret = decode_header(s, picture)) < 0)
|
||||
return ret;
|
||||
|
||||
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_HALF:
|
||||
if (s->channel_offsets[3] >= 0) {
|
||||
@@ -2247,8 +2192,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *picture,
|
||||
out_line_size = avctx->width * s->desc->comp[0].step;
|
||||
|
||||
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 */
|
||||
|
||||
@@ -435,7 +435,7 @@ static void set_micro_version(FFV1Context *f)
|
||||
if (f->version == 3) {
|
||||
f->micro_version = 4;
|
||||
} else if (f->version == 4) {
|
||||
f->micro_version = 9;
|
||||
f->micro_version = 8;
|
||||
} else
|
||||
av_assert0(0);
|
||||
|
||||
@@ -1310,7 +1310,7 @@ static int encode_float32_remap_segment(FFV1SliceContext *sc,
|
||||
int current_mul = current_mul_index < 0 ? 1 : FFABS(mul[current_mul_index]);
|
||||
int64_t val;
|
||||
if (i == pixel_num) {
|
||||
if (last_val == 0xFFFFFFFF && (!run || run1final)) {
|
||||
if (last_val == 0xFFFFFFFF) {
|
||||
break;
|
||||
} else {
|
||||
val = last_val + ((1LL<<32) - last_val + current_mul - 1) / current_mul * current_mul;
|
||||
@@ -1684,11 +1684,9 @@ size_t ff_ffv1_encode_buffer_size(AVCodecContext *avctx)
|
||||
{
|
||||
FFV1Context *f = avctx->priv_data;
|
||||
|
||||
int w = avctx->width + f->num_h_slices;
|
||||
int h = avctx->height + f->num_v_slices;
|
||||
size_t maxsize = w*h * (1 + f->transparency);
|
||||
size_t maxsize = avctx->width*avctx->height * (1 + f->transparency);
|
||||
if (f->chroma_planes)
|
||||
maxsize += AV_CEIL_RSHIFT(w, f->chroma_h_shift) * AV_CEIL_RSHIFT(h, f->chroma_v_shift) * 2;
|
||||
maxsize += AV_CEIL_RSHIFT(avctx->width, f->chroma_h_shift) * AV_CEIL_RSHIFT(f->height, f->chroma_v_shift) * 2;
|
||||
maxsize += f->slice_count * 800; //for slice header
|
||||
if (f->version > 3) {
|
||||
maxsize *= f->bits_per_raw_sample + 1;
|
||||
|
||||
@@ -314,9 +314,6 @@ static int flashsv_decode_frame(AVCodecContext *avctx, AVFrame *rframe,
|
||||
v_blocks = s->image_height / s->block_height;
|
||||
v_part = s->image_height % s->block_height;
|
||||
|
||||
if (h_blocks * v_blocks * 16 > get_bits_left(&gb))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
/* the block size could change between frames, make sure the buffer
|
||||
* is large enough, if not, get a larger one */
|
||||
if (s->block_size < s->block_width * s->block_height) {
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@ typedef struct HFParam {
|
||||
* Optimized fixed codebook excitation parameters
|
||||
*/
|
||||
typedef struct FCBParam {
|
||||
int64_t min_err;
|
||||
int min_err;
|
||||
int amp_index;
|
||||
int grid_index;
|
||||
int dirac_train;
|
||||
|
||||
@@ -1013,7 +1013,7 @@ static void fcb_search(G723_1_ChannelContext *p, int16_t *impulse_resp,
|
||||
int pulse_cnt = pulses[index];
|
||||
int i;
|
||||
|
||||
optim.min_err = 1LL << 31;
|
||||
optim.min_err = 1 << 30;
|
||||
get_fcb_param(&optim, impulse_resp, buf, pulse_cnt, SUBFRAME_LEN);
|
||||
|
||||
if (p->pitch_lag[index >> 1] < SUBFRAME_LEN - 2) {
|
||||
|
||||
@@ -455,8 +455,6 @@ static av_cold int g726_decode_init(AVCodecContext *avctx)
|
||||
g726_reset(c);
|
||||
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||
if (!avctx->sample_rate)
|
||||
avctx->sample_rate = 8000;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -455,7 +455,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
|
||||
buf = get_bits_long(gb, k);
|
||||
|
||||
return buf + (i << k);
|
||||
} else if (esc_len && i == limit - 1) {
|
||||
} else if (i == limit - 1) {
|
||||
buf = get_bits_long(gb, esc_len);
|
||||
|
||||
return buf + 1;
|
||||
@@ -512,7 +512,7 @@ static inline int get_ur_golomb_jpegls(GetBitContext *gb, int k, int limit,
|
||||
}
|
||||
|
||||
buf += ((SUINT)i << k);
|
||||
} else if (esc_len && i == limit - 1) {
|
||||
} else if (i == limit - 1) {
|
||||
buf = SHOW_UBITS(re, gb, esc_len);
|
||||
LAST_SKIP_BITS(re, gb, esc_len);
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ static int decode_registered_user_data_closed_caption(H2645SEIA53Caption *h,
|
||||
static int decode_registered_user_data(H2645SEI *h, GetByteContext *gb,
|
||||
enum AVCodecID codec_id, void *logctx)
|
||||
{
|
||||
int country_code, provider_code = -1;
|
||||
int country_code, provider_code;
|
||||
|
||||
if (bytestream2_get_bytes_left(gb) < 3)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
+15
-19
@@ -121,30 +121,26 @@ void ff_h264_direct_ref_list_init(const H264Context *const h, H264SliceContext *
|
||||
{
|
||||
H264Ref *const ref1 = &sl->ref_list[1][0];
|
||||
H264Picture *const cur = h->cur_pic_ptr;
|
||||
int list, field;
|
||||
int list, j, field;
|
||||
int sidx = (h->picture_structure & 1) ^ 1;
|
||||
int ref1sidx = (ref1->reference & 1) ^ 1;
|
||||
|
||||
/* Updates to cur_pic are not safe once ff_thread_finish_setup() has been
|
||||
* called (other threads may already be reading these fields). */
|
||||
if (!h->setup_finished) {
|
||||
for (list = 0; list < sl->list_count; list++) {
|
||||
cur->ref_count[sidx][list] = sl->ref_count[list];
|
||||
for (int j = 0; j < sl->ref_count[list]; j++)
|
||||
cur->ref_poc[sidx][list][j] = 4 * sl->ref_list[list][j].parent->frame_num +
|
||||
(sl->ref_list[list][j].reference & 3);
|
||||
}
|
||||
for (list = 0; list < sl->list_count; list++) {
|
||||
cur->ref_count[sidx][list] = sl->ref_count[list];
|
||||
for (j = 0; j < sl->ref_count[list]; j++)
|
||||
cur->ref_poc[sidx][list][j] = 4 * sl->ref_list[list][j].parent->frame_num +
|
||||
(sl->ref_list[list][j].reference & 3);
|
||||
}
|
||||
|
||||
if (h->picture_structure == PICT_FRAME) {
|
||||
memcpy(cur->ref_count[1], cur->ref_count[0], sizeof(cur->ref_count[0]));
|
||||
memcpy(cur->ref_poc[1], cur->ref_poc[0], sizeof(cur->ref_poc[0]));
|
||||
}
|
||||
if (h->picture_structure == PICT_FRAME) {
|
||||
memcpy(cur->ref_count[1], cur->ref_count[0], sizeof(cur->ref_count[0]));
|
||||
memcpy(cur->ref_poc[1], cur->ref_poc[0], sizeof(cur->ref_poc[0]));
|
||||
}
|
||||
|
||||
if (h->current_slice == 0) {
|
||||
cur->mbaff = FRAME_MBAFF(h);
|
||||
} else {
|
||||
av_assert0(cur->mbaff == FRAME_MBAFF(h));
|
||||
}
|
||||
if (h->current_slice == 0) {
|
||||
cur->mbaff = FRAME_MBAFF(h);
|
||||
} else {
|
||||
av_assert0(cur->mbaff == FRAME_MBAFF(h));
|
||||
}
|
||||
|
||||
sl->col_fieldoff = 0;
|
||||
|
||||
@@ -223,9 +223,6 @@ static int scan_mmco_reset(AVCodecParserContext *s, GetBitContext *gb,
|
||||
if (get_bits1(gb)) { // adaptive_ref_pic_marking_mode_flag
|
||||
int i;
|
||||
for (i = 0; i < H264_MAX_MMCO_COUNT; i++) {
|
||||
if (get_bits_left(gb) < 1)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
MMCOOpcode opcode = get_ue_golomb_31(gb);
|
||||
if (opcode > (unsigned) MMCO_LONG) {
|
||||
av_log(logctx, AV_LOG_ERROR,
|
||||
@@ -650,12 +647,8 @@ static int h264_parse(AVCodecParserContext *s,
|
||||
s->dts = av_sat_add64(p->reference_dts, av_rescale(s->dts_ref_dts_delta, num, den));
|
||||
}
|
||||
|
||||
if (p->reference_dts != AV_NOPTS_VALUE && s->pts == AV_NOPTS_VALUE) {
|
||||
int64_t pts_dts_delta = av_rescale(s->pts_dts_delta, num, den);
|
||||
uint64_t pts = (uint64_t)s->dts + pts_dts_delta;
|
||||
if (pts == av_sat_add64(s->dts, pts_dts_delta))
|
||||
s->pts = pts;
|
||||
}
|
||||
if (p->reference_dts != AV_NOPTS_VALUE && s->pts == AV_NOPTS_VALUE)
|
||||
s->pts = s->dts + av_rescale(s->pts_dts_delta, num, den);
|
||||
|
||||
if (s->dts_sync_point > 0)
|
||||
p->reference_dts = s->dts; // new reference
|
||||
|
||||
@@ -156,7 +156,8 @@ static void h264_initialise_ref_list(H264Context *h, H264SliceContext *sl)
|
||||
h->long_ref, 16, 1, h->picture_structure);
|
||||
av_assert0(len <= 32);
|
||||
|
||||
memset(&sl->ref_list[list][len], 0, sizeof(H264Ref) * (32 - len));
|
||||
if (len < sl->ref_count[list])
|
||||
memset(&sl->ref_list[list][len], 0, sizeof(H264Ref) * (sl->ref_count[list] - len));
|
||||
lens[list] = len;
|
||||
}
|
||||
|
||||
@@ -177,7 +178,8 @@ static void h264_initialise_ref_list(H264Context *h, H264SliceContext *sl)
|
||||
h-> long_ref, 16, 1, h->picture_structure);
|
||||
av_assert0(len <= 32);
|
||||
|
||||
memset(&sl->ref_list[0][len], 0, sizeof(H264Ref) * (32 - len));
|
||||
if (len < sl->ref_count[0])
|
||||
memset(&sl->ref_list[0][len], 0, sizeof(H264Ref) * (sl->ref_count[0] - len));
|
||||
}
|
||||
#ifdef TRACE
|
||||
for (int i = 0; i < sl->ref_count[0]; i++) {
|
||||
|
||||
@@ -1949,7 +1949,8 @@ static int h264_slice_init(H264Context *h, H264SliceContext *sl,
|
||||
|
||||
if (sl->slice_type_nos == AV_PICTURE_TYPE_B && !sl->direct_spatial_mv_pred)
|
||||
ff_h264_direct_dist_scale_factor(h, sl);
|
||||
ff_h264_direct_ref_list_init(h, sl);
|
||||
if (!h->setup_finished)
|
||||
ff_h264_direct_ref_list_init(h, sl);
|
||||
|
||||
if (h->avctx->skip_loop_filter >= AVDISCARD_ALL ||
|
||||
(h->avctx->skip_loop_filter >= AVDISCARD_NONKEY &&
|
||||
@@ -1978,12 +1979,6 @@ static int h264_slice_init(H264Context *h, H264SliceContext *sl,
|
||||
h->ps.pps->chroma_qp_index_offset[1]) +
|
||||
6 * (h->ps.sps->bit_depth_luma - 8);
|
||||
|
||||
// slice_table is uint16_t initialized to 0xFFFF as a sentinel.
|
||||
if (h->current_slice >= 0xFFFE) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "Too many slices (%d)\n", h->current_slice + 1);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
sl->slice_num = ++h->current_slice;
|
||||
|
||||
if (sl->slice_num)
|
||||
|
||||
@@ -126,9 +126,6 @@ static int hdr_decode_frame(AVCodecContext *avctx, AVFrame *p,
|
||||
;
|
||||
}
|
||||
|
||||
if (bytestream2_get_bytes_left(&gb) < height * 4)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_set_dimensions(avctx, width, height)) < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -916,7 +916,6 @@ static int hls_slice_header(SliceHeader *sh, const HEVCContext *s, GetBitContext
|
||||
sh->short_term_ref_pic_set_size = 0;
|
||||
sh->short_term_rps = NULL;
|
||||
sh->long_term_ref_pic_set_size = 0;
|
||||
sh->long_term_rps.nb_refs = 0;
|
||||
sh->slice_temporal_mvp_enabled_flag = 0;
|
||||
}
|
||||
|
||||
@@ -4107,7 +4106,7 @@ static int hevc_sei_to_context(AVCodecContext *avctx, HEVCSEI *sei)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (sei->tdrdi.present) {
|
||||
if (sei->tdrdi.num_ref_displays) {
|
||||
AVBufferRef *buf;
|
||||
size_t size;
|
||||
AV3DReferenceDisplaysInfo *tdrdi = av_tdrdi_alloc(sei->tdrdi.num_ref_displays, &size);
|
||||
|
||||
@@ -1279,9 +1279,6 @@ int ff_hevc_parse_sps(HEVCSPS *sps, GetBitContext *gb, unsigned int *sps_id,
|
||||
sps->bit_depth = rf->bit_depth_luma;
|
||||
sps->width = rf->pic_width_in_luma_samples;
|
||||
sps->height = rf->pic_height_in_luma_samples;
|
||||
if ((ret = av_image_check_size(sps->width,
|
||||
sps->height, 0, avctx)) < 0)
|
||||
return ret;
|
||||
|
||||
sps->pic_conf_win.left_offset = rf->conf_win_left_offset;
|
||||
sps->pic_conf_win.right_offset = rf->conf_win_right_offset;
|
||||
@@ -1828,10 +1825,6 @@ static int colour_mapping_table(GetBitContext *gb, AVCodecContext *avctx, HEVCPP
|
||||
pps->luma_bit_depth_cm_output = get_ue_golomb(gb) + 8;
|
||||
pps->chroma_bit_depth_cm_output = get_ue_golomb(gb) + 8;
|
||||
|
||||
if ( pps-> luma_bit_depth_cm_output < pps-> luma_bit_depth_cm_input
|
||||
|| pps->chroma_bit_depth_cm_output < pps->chroma_bit_depth_cm_input)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
pps->cm_res_quant_bits = get_bits(gb, 2);
|
||||
pps->cm_delta_flc_bits = get_bits(gb, 2) + 1;
|
||||
|
||||
|
||||
@@ -162,10 +162,7 @@ static HEVCFrame *alloc_frame(HEVCContext *s, HEVCLayerContext *l)
|
||||
if (ret < 0)
|
||||
goto fail;
|
||||
|
||||
size_t rpl_bytes;
|
||||
if (av_size_mult(s->pkt.nb_nals, sizeof(*frame->rpl), &rpl_bytes) < 0)
|
||||
goto fail;
|
||||
frame->rpl = av_refstruct_allocz(rpl_bytes);
|
||||
frame->rpl = av_refstruct_allocz(s->pkt.nb_nals * sizeof(*frame->rpl));
|
||||
if (!frame->rpl)
|
||||
goto fail;
|
||||
frame->nb_rpl_elems = s->pkt.nb_nals;
|
||||
@@ -238,7 +235,6 @@ int ff_hevc_set_new_ref(HEVCContext *s, HEVCLayerContext *l, int poc)
|
||||
s->layers[0].cur_frame - s->layers[0].DPB : -1;
|
||||
|
||||
no_output = !IS_IRAP(s) && (s->poc < s->recovery_poc) &&
|
||||
HEVC_IS_RECOVERING(s) &&
|
||||
!(s->avctx->flags & AV_CODEC_FLAG_OUTPUT_CORRUPT) &&
|
||||
!(s->avctx->flags2 & AV_CODEC_FLAG2_SHOW_ALL);
|
||||
if (s->sh.pic_output_flag && !no_output)
|
||||
|
||||
@@ -167,8 +167,6 @@ static int decode_nal_sei_timecode(HEVCSEITimeCode *s, GetBitContext *gb)
|
||||
|
||||
static int decode_nal_sei_3d_reference_displays_info(HEVCSEITDRDI *s, GetBitContext *gb)
|
||||
{
|
||||
unsigned num_ref_displays;
|
||||
|
||||
s->prec_ref_display_width = get_ue_golomb(gb);
|
||||
if (s->prec_ref_display_width > 31)
|
||||
return AVERROR_INVALIDDATA;
|
||||
@@ -178,10 +176,10 @@ static int decode_nal_sei_3d_reference_displays_info(HEVCSEITDRDI *s, GetBitCont
|
||||
if (s->prec_ref_viewing_dist > 31)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
num_ref_displays = get_ue_golomb(gb);
|
||||
if (num_ref_displays > 31)
|
||||
s->num_ref_displays = get_ue_golomb(gb);
|
||||
if (s->num_ref_displays > 31)
|
||||
return AVERROR_INVALIDDATA;
|
||||
s->num_ref_displays = num_ref_displays + 1;
|
||||
s->num_ref_displays += 1;
|
||||
|
||||
for (int i = 0; i < s->num_ref_displays; i++) {
|
||||
int length;
|
||||
@@ -195,7 +193,7 @@ static int decode_nal_sei_3d_reference_displays_info(HEVCSEITDRDI *s, GetBitCont
|
||||
else
|
||||
length = FFMAX(0, (int)s->exponent_ref_display_width[i] +
|
||||
(int)s->prec_ref_display_width - 31);
|
||||
s->mantissa_ref_display_width[i] = get_bits64(gb, length);
|
||||
s->mantissa_ref_display_width[i] = get_bits_long(gb, length);
|
||||
if (s->ref_viewing_distance_flag) {
|
||||
s->exponent_ref_viewing_distance[i] = get_bits(gb, 6);
|
||||
if (s->exponent_ref_viewing_distance[i] > 62)
|
||||
@@ -205,7 +203,7 @@ static int decode_nal_sei_3d_reference_displays_info(HEVCSEITDRDI *s, GetBitCont
|
||||
else
|
||||
length = FFMAX(0, (int)s->exponent_ref_viewing_distance[i] +
|
||||
(int)s->prec_ref_viewing_dist - 31);
|
||||
s->mantissa_ref_viewing_distance[i] = get_bits64(gb, length);
|
||||
s->mantissa_ref_viewing_distance[i] = get_bits_long(gb, length);
|
||||
}
|
||||
s->additional_shift_present_flag[i] = get_bits1(gb);
|
||||
if (s->additional_shift_present_flag[i]) {
|
||||
@@ -217,8 +215,6 @@ static int decode_nal_sei_3d_reference_displays_info(HEVCSEITDRDI *s, GetBitCont
|
||||
}
|
||||
s->three_dimensional_reference_displays_extension_flag = get_bits1(gb);
|
||||
|
||||
s->present = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,13 +87,12 @@ typedef struct HEVCSEITDRDI {
|
||||
uint16_t left_view_id[32];
|
||||
uint16_t right_view_id[32];
|
||||
uint8_t exponent_ref_display_width[32];
|
||||
uint64_t mantissa_ref_display_width[32];
|
||||
uint8_t mantissa_ref_display_width[32];
|
||||
uint8_t exponent_ref_viewing_distance[32];
|
||||
uint64_t mantissa_ref_viewing_distance[32];
|
||||
uint8_t mantissa_ref_viewing_distance[32];
|
||||
uint8_t additional_shift_present_flag[32];
|
||||
int16_t num_sample_shift[32];
|
||||
uint8_t three_dimensional_reference_displays_extension_flag;
|
||||
int present;
|
||||
} HEVCSEITDRDI;
|
||||
|
||||
typedef struct HEVCSEIRecoveryPoint {
|
||||
@@ -127,7 +126,6 @@ int ff_hevc_decode_nal_sei(GetBitContext *gb, void *logctx, HEVCSEI *s,
|
||||
*/
|
||||
static inline void ff_hevc_reset_sei(HEVCSEI *sei)
|
||||
{
|
||||
sei->tdrdi.present = 0;
|
||||
ff_h2645_sei_reset(&sei->common);
|
||||
}
|
||||
|
||||
|
||||
@@ -675,7 +675,6 @@ static void get_codebook(int16_t * cbvec, /* (o) Constructed codebook vector *
|
||||
/* get vector */
|
||||
memcpy(cbvec, mem + lMem - k, cbveclen * 2);
|
||||
} else if (index < base_size) {
|
||||
memset(cbvec, 0, cbveclen * 2);
|
||||
|
||||
/* Calculate lag */
|
||||
|
||||
@@ -702,7 +701,6 @@ static void get_codebook(int16_t * cbvec, /* (o) Constructed codebook vector *
|
||||
|
||||
filter_mafq12(&mem[memIndTest + 4], cbvec, kCbFiltersRev, CB_FILTERLEN, cbveclen);
|
||||
} else {
|
||||
memset(cbvec, 0, cbveclen * 2);
|
||||
/* interpolated vectors */
|
||||
/* Stuff zeros outside memory buffer */
|
||||
memIndTest = lMem - cbveclen - CB_FILTERLEN;
|
||||
|
||||
@@ -135,8 +135,6 @@ static int imm5_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
}
|
||||
|
||||
ret = avcodec_receive_frame(codec_avctx, frame);
|
||||
if (ret == AVERROR(EAGAIN))
|
||||
return avpkt->size;
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -437,9 +437,6 @@ static int fill_block(InterplayACMContext *s)
|
||||
unsigned i, ind;
|
||||
int ret;
|
||||
|
||||
if (get_bits_left(gb) < s->cols * 5)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
for (i = 0; i < s->cols; i++) {
|
||||
ind = get_bits(gb, 5);
|
||||
ret = filler_list[ind](s, ind, i);
|
||||
|
||||
+15
-18
@@ -1900,7 +1900,7 @@ static void decode_sigpass(Jpeg2000T1Context *t1, int width, int height,
|
||||
int bpno, int bandno,
|
||||
int vert_causal_ctx_csty_symbol)
|
||||
{
|
||||
int mask = (3u << bpno)>>1, y0, x, y;
|
||||
int mask = 3 << (bpno - 1), y0, x, y;
|
||||
|
||||
for (y0 = 0; y0 < height; y0 += 4)
|
||||
for (x = 0; x < width; x++)
|
||||
@@ -1933,7 +1933,7 @@ static void decode_refpass(Jpeg2000T1Context *t1, int width, int height,
|
||||
int phalf;
|
||||
int y0, x, y;
|
||||
|
||||
phalf = 1 << bpno;
|
||||
phalf = 1 << (bpno - 1);
|
||||
|
||||
for (y0 = 0; y0 < height; y0 += 4)
|
||||
for (x = 0; x < width; x++)
|
||||
@@ -1942,11 +1942,11 @@ static void decode_refpass(Jpeg2000T1Context *t1, int width, int height,
|
||||
int flags_mask = (vert_causal_ctx_csty_symbol && y == y0 + 3) ?
|
||||
~(JPEG2000_T1_SIG_S | JPEG2000_T1_SIG_SW | JPEG2000_T1_SIG_SE | JPEG2000_T1_SGN_S) : -1;
|
||||
int ctxno = ff_jpeg2000_getrefctxno(t1->flags[(y + 1) * t1->stride + x + 1] & flags_mask);
|
||||
t1->data[(y) * t1->stride + x] |= phalf >> 1;
|
||||
t1->data[(y) * t1->stride + x] |= phalf;
|
||||
if (ff_mqc_decode(&t1->mqc, t1->mqc.cx_states + ctxno))
|
||||
t1->data[(y) * t1->stride + x] |= phalf;
|
||||
t1->data[(y) * t1->stride + x] |= phalf << 1;
|
||||
else {
|
||||
t1->data[(y) * t1->stride + x] &= ~(phalf);
|
||||
t1->data[(y) * t1->stride + x] &= ~(phalf << 1);
|
||||
|
||||
}
|
||||
t1->flags[(y + 1) * t1->stride + x + 1] |= JPEG2000_T1_REF;
|
||||
@@ -2043,8 +2043,8 @@ static int decode_cblk(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *cod
|
||||
ff_mqc_initdec(&t1->mqc, cblk->data, 0, 1);
|
||||
|
||||
while (passno--) {
|
||||
if (bpno < -1 || bpno > 29) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "bpno (%d) became invalid\n", bpno);
|
||||
if (bpno < 0 || bpno > 29) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "bpno became invalid\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
switch(pass_t) {
|
||||
@@ -2100,7 +2100,7 @@ static int decode_cblk(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *cod
|
||||
for (int y = 0; y < height; y++) {
|
||||
for (int x = 0; x < width; x++) {
|
||||
int32_t sign, n, val;
|
||||
const uint32_t mask = (int64_t)UINT32_MAX >> (M_b + 1); // bit mask for ROI detection
|
||||
const uint32_t mask = UINT32_MAX >> (M_b + 1); // bit mask for ROI detection
|
||||
|
||||
n = x + (y * t1->stride);
|
||||
val = t1->data[n];
|
||||
@@ -2130,7 +2130,7 @@ static void dequantization_float(int x, int y, Jpeg2000Cblk *cblk,
|
||||
int w = cblk->coord[0][1] - cblk->coord[0][0];
|
||||
const int downshift = 31 - M_b;
|
||||
float fscale = band->f_stepsize;
|
||||
fscale /= (float)(1LL << downshift);
|
||||
fscale /= (float)(1 << downshift);
|
||||
for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
|
||||
float *datap = &comp->f_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
|
||||
int *src = t1->data + j*t1->stride;
|
||||
@@ -2149,7 +2149,7 @@ static void dequantization_int(int x, int y, Jpeg2000Cblk *cblk,
|
||||
Jpeg2000T1Context *t1, Jpeg2000Band *band, const int M_b)
|
||||
{
|
||||
int i, j;
|
||||
const int downshift = FFMIN(31 - M_b, 31);
|
||||
const int downshift = 31 - M_b;
|
||||
int w = cblk->coord[0][1] - cblk->coord[0][0];
|
||||
for (j = 0; j < (cblk->coord[1][1] - cblk->coord[1][0]); ++j) {
|
||||
int32_t *datap = &comp->i_data[(comp->coord[0][1] - comp->coord[0][0]) * (y + j) + x];
|
||||
@@ -2188,7 +2188,7 @@ static void dequantization_int_97(int x, int y, Jpeg2000Cblk *cblk,
|
||||
const int PRESCALE = 6; // At least 6 is required to pass the conformance tests in ISO/IEC 15444-4
|
||||
int scale;
|
||||
|
||||
fscale /= (float)(1LL << downshift);
|
||||
fscale /= (float)(1 << downshift);
|
||||
fscale *= (float)(1 << PRESCALE);
|
||||
fscale *= (float)(1 << (16 + I_PRESHIFT));
|
||||
scale = (int)(fscale + 0.5);
|
||||
@@ -2201,7 +2201,7 @@ static void dequantization_int_97(int x, int y, Jpeg2000Cblk *cblk,
|
||||
if (val < 0) // Convert sign-magnitude to two's complement
|
||||
val = -(val & INT32_MAX);
|
||||
// Shifting down to prevent overflow in dequantization
|
||||
val = (val + (1LL << (PRESCALE - 1))) >> PRESCALE;
|
||||
val = (val + (1 << (PRESCALE - 1))) >> PRESCALE;
|
||||
datap[i] = RSHIFT(val * (int64_t)band->i_stepsize, 16);
|
||||
}
|
||||
}
|
||||
@@ -2270,8 +2270,8 @@ static inline int tile_codeblocks(const Jpeg2000DecoderContext *s, Jpeg2000Tile
|
||||
band->coord[1][0] == band->coord[1][1])
|
||||
continue;
|
||||
|
||||
if (M_b > 31) {
|
||||
avpriv_request_sample(s->avctx, "M_b (%d) > 31", M_b);
|
||||
if ((codsty->cblk_style & JPEG2000_CTSY_HTJ2K_F) && M_b >= 31) {
|
||||
avpriv_request_sample(s->avctx, "JPEG2000_CTSY_HTJ2K_F and M_b >= 31");
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
@@ -2348,12 +2348,9 @@ static inline int tile_codeblocks(const Jpeg2000DecoderContext *s, Jpeg2000Tile
|
||||
int h = tile->comp[compno].coord[1][1] - \
|
||||
ff_jpeg2000_ceildiv(s->image_offset_y, s->cdy[compno]); \
|
||||
int plane = 0; \
|
||||
ptrdiff_t dstoffset = 0; \
|
||||
\
|
||||
if (planar) \
|
||||
plane = s->cdef[compno] ? s->cdef[compno]-1 : (s->ncomponents-1); \
|
||||
else \
|
||||
dstoffset = s->cdef[compno] ? s->cdef[compno] - 1 : compno; \
|
||||
\
|
||||
y = tile->comp[compno].coord[1][0] - \
|
||||
ff_jpeg2000_ceildiv(s->image_offset_y, s->cdy[compno]); \
|
||||
@@ -2363,7 +2360,7 @@ static inline int tile_codeblocks(const Jpeg2000DecoderContext *s, Jpeg2000Tile
|
||||
\
|
||||
x = tile->comp[compno].coord[0][0] - \
|
||||
ff_jpeg2000_ceildiv(s->image_offset_x, s->cdx[compno]); \
|
||||
dst = line + x * pixelsize + dstoffset; \
|
||||
dst = line + x * pixelsize + compno*!planar; \
|
||||
\
|
||||
if (codsty->transform == FF_DWT97) { \
|
||||
for (; x < w; x++) { \
|
||||
|
||||
@@ -1219,7 +1219,7 @@ ff_jpeg2000_decode_htj2k(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c
|
||||
uint8_t *block_states = NULL;
|
||||
|
||||
int32_t n, val; // Post-processing
|
||||
const uint32_t mask = (int64_t)UINT32_MAX >> (M_b + 1); // bit mask for ROI detection
|
||||
const uint32_t mask = UINT32_MAX >> (M_b + 1); // bit mask for ROI detection
|
||||
|
||||
uint8_t num_rempass;
|
||||
|
||||
@@ -1254,11 +1254,6 @@ ff_jpeg2000_decode_htj2k(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c
|
||||
"Cleanup pass length must be at least 2 bytes in length\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
// this might arise either if the codestream is corrupted; or contains multiple HT Sets
|
||||
// (see Rec. ITU-T T.814, Annex B.1), which the parser does not currently support
|
||||
if (Lcup + Lref != cblk->length)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
Dcup = cblk->data;
|
||||
Dref = cblk->data + Lcup; // Dref comes after the refinement segment
|
||||
|
||||
@@ -1268,11 +1263,6 @@ ff_jpeg2000_decode_htj2k(const Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *c
|
||||
cblk->zbp = S_blk - 1;
|
||||
pLSB = 30 - S_blk;
|
||||
|
||||
if (pLSB <= 1 || pLSB >= 31) {
|
||||
avpriv_request_sample(s->avctx, "pLSB %d", pLSB);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
|
||||
Scup = (Dcup[Lcup - 1] << 4) + (Dcup[Lcup - 2] & 0x0F);
|
||||
|
||||
if (Scup < 2 || Scup > Lcup || Scup > 4079) {
|
||||
|
||||
+59
-69
@@ -16,6 +16,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "config_components.h"
|
||||
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/frame.h"
|
||||
#include "libavutil/imgutils.h"
|
||||
@@ -26,6 +28,7 @@
|
||||
#include "decode.h"
|
||||
#include "lcevcdec.h"
|
||||
|
||||
#if CONFIG_LIBLCEVC_DEC
|
||||
static LCEVC_ColorFormat map_format(int format)
|
||||
{
|
||||
switch (format) {
|
||||
@@ -49,12 +52,13 @@ static int alloc_base_frame(void *logctx, FFLCEVCContext *lcevc,
|
||||
{
|
||||
LCEVC_PictureDesc desc;
|
||||
LCEVC_ColorFormat fmt = map_format(frame->format);
|
||||
LCEVC_PicturePlaneDesc planes[AV_VIDEO_MAX_PLANES] = { 0 };
|
||||
int width = frame->width - frame->crop_left - frame->crop_right;
|
||||
int height = frame->height - frame->crop_top - frame->crop_bottom;
|
||||
LCEVC_PictureLockHandle lock;
|
||||
uint8_t *data[4] = { NULL };
|
||||
int linesizes[4] = { 0 };
|
||||
uint32_t planes;
|
||||
LCEVC_ReturnCode res;
|
||||
|
||||
res = LCEVC_DefaultPictureDesc(&desc, fmt, width, height);
|
||||
res = LCEVC_DefaultPictureDesc(&desc, fmt, frame->width, frame->height);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
@@ -65,16 +69,36 @@ static int alloc_base_frame(void *logctx, FFLCEVCContext *lcevc,
|
||||
desc.sampleAspectRatioNum = frame->sample_aspect_ratio.num;
|
||||
desc.sampleAspectRatioDen = frame->sample_aspect_ratio.den;
|
||||
|
||||
for (int i = 0; i < AV_VIDEO_MAX_PLANES; i++) {
|
||||
planes[i].firstSample = frame->data[i];
|
||||
planes[i].rowByteStride = frame->linesize[i];
|
||||
}
|
||||
|
||||
/* Allocate LCEVC Picture */
|
||||
res = LCEVC_AllocPictureExternal(lcevc->decoder, &desc, NULL, planes, picture);
|
||||
res = LCEVC_AllocPicture(lcevc->decoder, &desc, picture);
|
||||
if (res != LCEVC_Success) {
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
res = LCEVC_LockPicture(lcevc->decoder, *picture, LCEVC_Access_Write, &lock);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
res = LCEVC_GetPicturePlaneCount(lcevc->decoder, *picture, &planes);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
for (unsigned i = 0; i < planes; i++) {
|
||||
LCEVC_PicturePlaneDesc plane;
|
||||
|
||||
res = LCEVC_GetPictureLockPlaneDesc(lcevc->decoder, lock, i, &plane);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
data[i] = plane.firstSample;
|
||||
linesizes[i] = plane.rowByteStride;
|
||||
}
|
||||
|
||||
av_image_copy2(data, linesizes, frame->data, frame->linesize,
|
||||
frame->format, frame->width, frame->height);
|
||||
|
||||
res = LCEVC_UnlockPicture(lcevc->decoder, lock);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -110,7 +134,6 @@ static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame
|
||||
{
|
||||
FFLCEVCContext *lcevc = frame_ctx->lcevc;
|
||||
const AVFrameSideData *sd = av_frame_get_side_data(in, AV_FRAME_DATA_LCEVC);
|
||||
AVFrame *opaque;
|
||||
LCEVC_PictureHandle picture;
|
||||
LCEVC_ReturnCode res;
|
||||
int ret = 0;
|
||||
@@ -118,11 +141,7 @@ static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame
|
||||
if (!sd)
|
||||
return 1;
|
||||
|
||||
#ifdef LCEVC_DEC_VERSION_MAJOR
|
||||
res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, sd->data, sd->size);
|
||||
#else
|
||||
res = LCEVC_SendDecoderEnhancementData(lcevc->decoder, in->pts, 0, sd->data, sd->size);
|
||||
#endif
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
@@ -130,29 +149,9 @@ static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
opaque = av_frame_clone(in);
|
||||
if (!opaque) {
|
||||
LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
res = LCEVC_SetPictureUserData(lcevc->decoder, picture, opaque);
|
||||
if (res != LCEVC_Success) {
|
||||
LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
av_frame_free(&opaque);
|
||||
res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, 0, picture, -1, NULL);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
#ifdef LCEVC_DEC_VERSION_MAJOR
|
||||
res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, picture, -1, opaque);
|
||||
#else
|
||||
res = LCEVC_SendDecoderBase(lcevc->decoder, in->pts, 0, picture, -1, opaque);
|
||||
#endif
|
||||
if (res != LCEVC_Success) {
|
||||
LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
av_frame_free(&opaque);
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
memset(&picture, 0, sizeof(picture));
|
||||
ret = alloc_enhanced_frame(logctx, frame_ctx, &picture);
|
||||
@@ -160,10 +159,8 @@ static int lcevc_send_frame(void *logctx, FFLCEVCFrame *frame_ctx, const AVFrame
|
||||
return ret;
|
||||
|
||||
res = LCEVC_SendDecoderPicture(lcevc->decoder, picture);
|
||||
if (res != LCEVC_Success) {
|
||||
LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -181,14 +178,8 @@ static int generate_output(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
|
||||
return AVERROR_EXTERNAL;
|
||||
|
||||
res = LCEVC_GetPictureDesc(lcevc->decoder, picture, &desc);
|
||||
if (res != LCEVC_Success) {
|
||||
LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
av_frame_unref(out);
|
||||
av_frame_copy_props(frame_ctx->frame, (AVFrame *)info.baseUserData);
|
||||
av_frame_move_ref(out, frame_ctx->frame);
|
||||
|
||||
out->crop_top = desc.cropTop;
|
||||
out->crop_bottom = desc.cropBottom;
|
||||
@@ -196,6 +187,11 @@ static int generate_output(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
|
||||
out->crop_right = desc.cropRight;
|
||||
out->sample_aspect_ratio.num = desc.sampleAspectRatioNum;
|
||||
out->sample_aspect_ratio.den = desc.sampleAspectRatioDen;
|
||||
|
||||
av_frame_copy_props(frame_ctx->frame, out);
|
||||
av_frame_unref(out);
|
||||
av_frame_move_ref(out, frame_ctx->frame);
|
||||
|
||||
out->width = desc.width + out->crop_left + out->crop_right;
|
||||
out->height = desc.height + out->crop_top + out->crop_bottom;
|
||||
|
||||
@@ -206,13 +202,18 @@ static int generate_output(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lcevc_flush_pictures(FFLCEVCContext *lcevc)
|
||||
static int lcevc_receive_frame(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
|
||||
{
|
||||
FFLCEVCContext *lcevc = frame_ctx->lcevc;
|
||||
LCEVC_PictureHandle picture;
|
||||
LCEVC_ReturnCode res;
|
||||
int ret;
|
||||
|
||||
ret = generate_output(logctx, frame_ctx, out);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
while (1) {
|
||||
AVFrame *base = NULL;
|
||||
res = LCEVC_ReceiveDecoderBase (lcevc->decoder, &picture);
|
||||
if (res != LCEVC_Success && res != LCEVC_Again)
|
||||
return AVERROR_EXTERNAL;
|
||||
@@ -220,9 +221,6 @@ static int lcevc_flush_pictures(FFLCEVCContext *lcevc)
|
||||
if (res == LCEVC_Again)
|
||||
break;
|
||||
|
||||
LCEVC_GetPictureUserData(lcevc->decoder, picture, (void **)&base);
|
||||
av_frame_free(&base);
|
||||
|
||||
res = LCEVC_FreePicture(lcevc->decoder, picture);
|
||||
if (res != LCEVC_Success)
|
||||
return AVERROR_EXTERNAL;
|
||||
@@ -231,18 +229,6 @@ static int lcevc_flush_pictures(FFLCEVCContext *lcevc)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int lcevc_receive_frame(void *logctx, FFLCEVCFrame *frame_ctx, AVFrame *out)
|
||||
{
|
||||
FFLCEVCContext *lcevc = frame_ctx->lcevc;
|
||||
int ret;
|
||||
|
||||
ret = generate_output(logctx, frame_ctx, out);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return lcevc_flush_pictures(lcevc);
|
||||
}
|
||||
|
||||
static void event_callback(LCEVC_DecoderHandle dec, LCEVC_Event event,
|
||||
LCEVC_PictureHandle pic, const LCEVC_DecodeInformation *info,
|
||||
const uint8_t *data, uint32_t size, void *logctx)
|
||||
@@ -259,16 +245,15 @@ static void event_callback(LCEVC_DecoderHandle dec, LCEVC_Event event,
|
||||
static void lcevc_free(AVRefStructOpaque unused, void *obj)
|
||||
{
|
||||
FFLCEVCContext *lcevc = obj;
|
||||
if (lcevc->initialized) {
|
||||
LCEVC_FlushDecoder(lcevc->decoder);
|
||||
lcevc_flush_pictures(lcevc);
|
||||
if (lcevc->initialized)
|
||||
LCEVC_DestroyDecoder(lcevc->decoder);
|
||||
}
|
||||
memset(lcevc, 0, sizeof(*lcevc));
|
||||
}
|
||||
#endif
|
||||
|
||||
static int lcevc_init(FFLCEVCContext *lcevc, void *logctx)
|
||||
{
|
||||
#if CONFIG_LIBLCEVC_DEC
|
||||
LCEVC_AccelContextHandle dummy = { 0 };
|
||||
const int32_t event = LCEVC_Log;
|
||||
|
||||
@@ -287,6 +272,7 @@ static int lcevc_init(FFLCEVCContext *lcevc, void *logctx)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
#endif
|
||||
lcevc->initialized = 1;
|
||||
|
||||
return 0;
|
||||
@@ -305,6 +291,7 @@ int ff_lcevc_process(void *logctx, AVFrame *frame)
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if CONFIG_LIBLCEVC_DEC
|
||||
av_assert0(frame_ctx->frame);
|
||||
|
||||
|
||||
@@ -312,11 +299,12 @@ int ff_lcevc_process(void *logctx, AVFrame *frame)
|
||||
if (ret)
|
||||
return ret < 0 ? ret : 0;
|
||||
|
||||
ret = lcevc_receive_frame(logctx, frame_ctx, frame);
|
||||
lcevc_receive_frame(logctx, frame_ctx, frame);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
av_frame_remove_side_data(frame, AV_FRAME_DATA_LCEVC);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -324,9 +312,11 @@ int ff_lcevc_process(void *logctx, AVFrame *frame)
|
||||
int ff_lcevc_alloc(FFLCEVCContext **plcevc)
|
||||
{
|
||||
FFLCEVCContext *lcevc = NULL;
|
||||
#if CONFIG_LIBLCEVC_DEC
|
||||
lcevc = av_refstruct_alloc_ext(sizeof(*lcevc), 0, NULL, lcevc_free);
|
||||
if (!lcevc)
|
||||
return AVERROR(ENOMEM);
|
||||
#endif
|
||||
*plcevc = lcevc;
|
||||
return 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -175,7 +175,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
int height = avctx->height; // Real image height
|
||||
unsigned int mszh_dlen;
|
||||
unsigned char yq, y1q, uq, vq;
|
||||
int ret;
|
||||
int uqvq, ret;
|
||||
unsigned int mthread_inlen, mthread_outlen;
|
||||
unsigned int len = buf_size;
|
||||
int linesize, offset;
|
||||
@@ -306,7 +306,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
for (row = 0; row < height; row++) {
|
||||
pixel_ptr = row * width * 3;
|
||||
yq = encoded[pixel_ptr++];
|
||||
unsigned uqvq = AV_RL16(encoded+pixel_ptr);
|
||||
uqvq = AV_RL16(encoded+pixel_ptr);
|
||||
pixel_ptr += 2;
|
||||
for (col = 1; col < width; col++) {
|
||||
encoded[pixel_ptr] = yq -= encoded[pixel_ptr];
|
||||
|
||||
@@ -90,6 +90,8 @@ static int librsvg_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
goto end;
|
||||
|
||||
avctx->pix_fmt = AV_PIX_FMT_RGB32;
|
||||
viewport.width = dimensions.width;
|
||||
viewport.height = dimensions.height;
|
||||
|
||||
ret = ff_get_buffer(avctx, frame, 0);
|
||||
if (ret < 0)
|
||||
@@ -114,8 +116,6 @@ static int librsvg_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
cairo_restore(crender);
|
||||
|
||||
#if LIBRSVG_MAJOR_VERSION > 2 || LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION >= 52
|
||||
viewport.width = dimensions.width;
|
||||
viewport.height = dimensions.height;
|
||||
gret = rsvg_handle_render_document(handle, crender, &viewport, &error);
|
||||
#else
|
||||
cairo_scale(crender, dimensions.width / (double)unscaled_dimensions.width,
|
||||
|
||||
@@ -238,11 +238,7 @@ static int config_enc_params(EbSvtAv1EncConfiguration *param,
|
||||
} else if (svt_enc->qp > 0) {
|
||||
param->qp = svt_enc->qp;
|
||||
param->rate_control_mode = 0;
|
||||
#if SVT_AV1_CHECK_VERSION(4, 0, 0)
|
||||
param->aq_mode = 0;
|
||||
#else
|
||||
param->enable_adaptive_quantization = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
|
||||
@@ -53,7 +53,7 @@ typedef struct TheoraContext {
|
||||
int stats_offset;
|
||||
int uv_hshift;
|
||||
int uv_vshift;
|
||||
unsigned keyframe_mask;
|
||||
int keyframe_mask;
|
||||
int speed_level;
|
||||
} TheoraContext;
|
||||
|
||||
@@ -249,7 +249,7 @@ static av_cold int encode_init(AVCodecContext* avc_context)
|
||||
return AVERROR_EXTERNAL;
|
||||
}
|
||||
|
||||
h->keyframe_mask = (1U << av_ceil_log2(avc_context->gop_size)) - 1;
|
||||
h->keyframe_mask = (1 << av_ceil_log2(avc_context->gop_size)) - 1;
|
||||
/* Clear up theora_info struct */
|
||||
th_info_clear(&t_info);
|
||||
|
||||
|
||||
@@ -114,12 +114,6 @@ static av_cold int oggvorbis_decode_init(AVCodecContext *avccontext)
|
||||
}
|
||||
}
|
||||
|
||||
if (context->vi.rate <= 0 || context->vi.rate > INT_MAX) {
|
||||
av_log(avccontext, AV_LOG_ERROR, "vorbis rate is invalid\n");
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto error;
|
||||
}
|
||||
|
||||
av_channel_layout_uninit(&avccontext->ch_layout);
|
||||
avccontext->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC;
|
||||
avccontext->ch_layout.nb_channels = context->vi.channels;
|
||||
|
||||
+7
-19
@@ -37,21 +37,7 @@
|
||||
#define LZF_LITERAL_MAX (1 << 5)
|
||||
#define LZF_LONG_BACKREF 7 + 2
|
||||
|
||||
|
||||
static inline int lzf_realloc(uint8_t **buf, size_t new_size, unsigned *allocated_size)
|
||||
{
|
||||
void *ptr = av_fast_realloc(*buf, allocated_size, new_size);
|
||||
|
||||
if (!ptr) {
|
||||
av_freep(buf); //probably not needed
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
*buf = ptr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, size_t *size, unsigned *allocated_size)
|
||||
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size)
|
||||
{
|
||||
int ret = 0;
|
||||
uint8_t *p = *buf;
|
||||
@@ -62,8 +48,9 @@ int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, size_t *size, unsigned
|
||||
|
||||
if (s < LZF_LITERAL_MAX) {
|
||||
s++;
|
||||
if (s > *allocated_size - len) {
|
||||
ret = lzf_realloc(buf, len + s, allocated_size);
|
||||
if (s > *size - len) {
|
||||
*size += s + *size /2;
|
||||
ret = av_reallocp(buf, *size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
p = *buf + len;
|
||||
@@ -87,8 +74,9 @@ int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, size_t *size, unsigned
|
||||
if (off > len)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (l > *allocated_size - len) {
|
||||
ret = lzf_realloc(buf, len + l, allocated_size);
|
||||
if (l > *size - len) {
|
||||
*size += l + *size / 2;
|
||||
ret = av_reallocp(buf, *size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
p = *buf + len;
|
||||
|
||||
+1
-1
@@ -24,6 +24,6 @@
|
||||
|
||||
#include "bytestream.h"
|
||||
|
||||
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, size_t *size, unsigned *allocated_size);
|
||||
int ff_lzf_uncompress(GetByteContext *gb, uint8_t **buf, int64_t *size);
|
||||
|
||||
#endif /* AVCODEC_LZF_H */
|
||||
|
||||
@@ -348,8 +348,7 @@ static int magy_decode_slice(AVCodecContext *avctx, void *tdata,
|
||||
s->llviddsp.add_left_pred(dst, dst, width, 0);
|
||||
dst += stride;
|
||||
}
|
||||
if (1 + interlaced < height)
|
||||
lefttop = left = dst[0];
|
||||
lefttop = left = dst[0];
|
||||
for (k = 1 + interlaced; k < height; k++) {
|
||||
s->llviddsp.add_median_pred(dst, dst - fake_stride,
|
||||
dst, width, &left, &lefttop);
|
||||
|
||||
@@ -174,9 +174,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
int buf_size = avpkt->size;
|
||||
int ret;
|
||||
|
||||
if (a->mb_width * a->mb_height * 3 > buf_size)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_thread_get_buffer(avctx, frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -385,12 +385,6 @@ static int mediacodec_wrap_sw_audio_buffer(AVCodecContext *avctx,
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (info->size % (sample_size * avctx->ch_layout.nb_channels)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "input is not a multiple of channels * sample_size\n");
|
||||
ret = AVERROR(EINVAL);
|
||||
goto done;
|
||||
}
|
||||
|
||||
frame->format = avctx->sample_fmt;
|
||||
frame->sample_rate = avctx->sample_rate;
|
||||
frame->nb_samples = info->size / (sample_size * avctx->ch_layout.nb_channels);
|
||||
|
||||
@@ -1356,9 +1356,6 @@ static int mf_close(AVCodecContext *avctx)
|
||||
if (c->async_events)
|
||||
IMFMediaEventGenerator_Release(c->async_events);
|
||||
|
||||
if (c->dxgiManager)
|
||||
IMFDXGIDeviceManager_Release(c->dxgiManager);
|
||||
|
||||
#if !HAVE_UWP
|
||||
if (c->library)
|
||||
ff_free_mf(&c->functions, &c->mft);
|
||||
|
||||
+11
-15
@@ -150,7 +150,7 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx)
|
||||
if ((ret = init_default_huffman_tables(s)) < 0)
|
||||
return ret;
|
||||
|
||||
if (s->extern_huff && avctx->extradata) {
|
||||
if (s->extern_huff) {
|
||||
av_log(avctx, AV_LOG_INFO, "using external huffman table\n");
|
||||
if ((ret = init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size * 8)) < 0)
|
||||
return ret;
|
||||
@@ -343,12 +343,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
av_log(s->avctx, AV_LOG_DEBUG, "sof0: picture: %dx%d\n", width, height);
|
||||
if (av_image_check_size(width, height, 0, s->avctx) < 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if (!s->progressive && !s->ls) {
|
||||
// A valid frame requires at least 1 bit for DC + 1 bit for AC for each 8x8 block.
|
||||
if (s->buf_size && (width + 7) / 8 * ((height + 7) / 8) > s->buf_size * 4LL)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->buf_size && (width + 7) / 8 * ((height + 7) / 8) > s->buf_size * 4LL)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
nb_components = get_bits(&s->gb, 8);
|
||||
if (nb_components <= 0 ||
|
||||
@@ -2879,15 +2875,15 @@ the_end:
|
||||
AVFrameSideData *sd = NULL;
|
||||
|
||||
if (orientation >= 2 && orientation <= 8) {
|
||||
ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9, &sd);
|
||||
if (ret < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
int32_t *matrix;
|
||||
|
||||
if (sd) {
|
||||
int32_t *matrix = (int32_t *)sd->data;
|
||||
sd = av_frame_new_side_data(frame, AV_FRAME_DATA_DISPLAYMATRIX, sizeof(int32_t) * 9);
|
||||
if (!sd) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Could not allocate frame side data\n");
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
matrix = (int32_t *)sd->data;
|
||||
|
||||
switch (orientation) {
|
||||
case 2:
|
||||
|
||||
+10
-8
@@ -318,10 +318,8 @@ static av_cold int mlp_decode_init(AVCodecContext *avctx)
|
||||
av_channel_layout_uninit(&avctx->ch_layout);
|
||||
avctx->ch_layout = (AVChannelLayout)AV_CHANNEL_LAYOUT_5POINT1;
|
||||
}
|
||||
else {
|
||||
else
|
||||
av_log(avctx, AV_LOG_WARNING, "Invalid downmix layout\n");
|
||||
av_channel_layout_uninit(&m->downmix_layout);
|
||||
}
|
||||
}
|
||||
|
||||
ff_thread_once(&init_static_once, init_static);
|
||||
@@ -454,22 +452,26 @@ static int read_major_sync(MLPDecodeContext *m, GetBitContext *gb)
|
||||
}
|
||||
m->substream[1].mask = mh.channel_layout_thd_stream1;
|
||||
if (mh.channels_thd_stream1 == 2 &&
|
||||
mh.channels_thd_stream2 == 2)
|
||||
mh.channels_thd_stream2 == 2 &&
|
||||
m->avctx->ch_layout.nb_channels == 2)
|
||||
m->substream[0].mask = AV_CH_LAYOUT_STEREO;
|
||||
if ((substr = (mh.num_substreams > 1)))
|
||||
m->substream[0].mask = AV_CH_LAYOUT_STEREO;
|
||||
if (mh.num_substreams == 1 &&
|
||||
mh.channels_thd_stream1 == 1 &&
|
||||
mh.channels_thd_stream2 == 1)
|
||||
mh.channels_thd_stream2 == 1 &&
|
||||
m->avctx->ch_layout.nb_channels == 1)
|
||||
m->substream[0].mask = AV_CH_LAYOUT_MONO;
|
||||
if (mh.num_substreams > 2)
|
||||
if (mh.channel_layout_thd_stream2)
|
||||
m->substream[2].mask = mh.channel_layout_thd_stream2;
|
||||
else
|
||||
m->substream[2].mask = mh.channel_layout_thd_stream1;
|
||||
if (mh.num_substreams == 2 && (!m->downmix_layout.nb_channels ||
|
||||
m->downmix_layout.nb_channels > 2))
|
||||
m->substream[1].mask = mh.channel_layout_thd_stream2;
|
||||
if (m->avctx->ch_layout.nb_channels > 2)
|
||||
if (mh.num_substreams > 2)
|
||||
m->substream[1].mask = mh.channel_layout_thd_stream1;
|
||||
else
|
||||
m->substream[mh.num_substreams > 1].mask = mh.channel_layout_thd_stream2;
|
||||
}
|
||||
|
||||
m->needs_reordering = mh.channel_arrangement >= 18 && mh.channel_arrangement <= 20;
|
||||
|
||||
@@ -2931,7 +2931,7 @@ static void write_mb_info(MPVEncContext *const s)
|
||||
bytestream_put_byte(&ptr, 0); /* vmv2 */
|
||||
}
|
||||
|
||||
static void update_mb_info(MPVEncContext *const s)
|
||||
static void update_mb_info(MPVEncContext *const s, int startcode)
|
||||
{
|
||||
if (!s->mb_info)
|
||||
return;
|
||||
@@ -2939,6 +2939,14 @@ static void update_mb_info(MPVEncContext *const s)
|
||||
s->mb_info_size += 12;
|
||||
s->prev_mb_info = s->last_mb_info;
|
||||
}
|
||||
if (startcode) {
|
||||
s->prev_mb_info = put_bytes_count(&s->pb, 0);
|
||||
/* This might have incremented mb_info_size above, and we return without
|
||||
* actually writing any info into that slot yet. But in that case,
|
||||
* this will be called again at the start of the after writing the
|
||||
* start code, actually writing the mb info. */
|
||||
return;
|
||||
}
|
||||
|
||||
s->last_mb_info = put_bytes_count(&s->pb, 0);
|
||||
if (!s->mb_info_size)
|
||||
@@ -3152,11 +3160,8 @@ static int encode_thread(AVCodecContext *c, void *arg){
|
||||
#endif
|
||||
case AV_CODEC_ID_H263:
|
||||
if (CONFIG_H263_ENCODER) {
|
||||
if (s->mb_info && put_bytes_count(&s->pb, 0) - s->prev_mb_info >= s->mb_info)
|
||||
s->mb_info_size += 12;
|
||||
|
||||
update_mb_info(s, 1);
|
||||
ff_h263_encode_gob_header(s, mb_y);
|
||||
s->prev_mb_info = put_bits_count(&s->pb)/8;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -3181,7 +3186,7 @@ static int encode_thread(AVCodecContext *c, void *arg){
|
||||
s->c.mb_skipped = 0;
|
||||
s->dquant=0; //only for QP_RD
|
||||
|
||||
update_mb_info(s);
|
||||
update_mb_info(s, 0);
|
||||
|
||||
if (mb_type & (mb_type-1) || (s->mpv_flags & FF_MPV_FLAG_QP_RD)) { // more than 1 MB type possible or FF_MPV_FLAG_QP_RD
|
||||
int next_block=0;
|
||||
|
||||
@@ -40,8 +40,7 @@ typedef struct NotchLCContext {
|
||||
unsigned uncompressed_size;
|
||||
|
||||
uint8_t *lzf_buffer;
|
||||
size_t lzf_size;
|
||||
unsigned lzf_alloc_size;
|
||||
int64_t lzf_size;
|
||||
|
||||
unsigned texture_size_x;
|
||||
unsigned texture_size_y;
|
||||
@@ -79,7 +78,7 @@ static int lz4_decompress(AVCodecContext *avctx,
|
||||
PutByteContext *pb)
|
||||
{
|
||||
unsigned reference_pos, delta, pos = 0;
|
||||
uint8_t history[64 * 1024] = { 0 };
|
||||
uint8_t history[64 * 1024];
|
||||
int match_length;
|
||||
|
||||
while (bytestream2_get_bytes_left(gb) > 0) {
|
||||
@@ -90,8 +89,6 @@ static int lz4_decompress(AVCodecContext *avctx,
|
||||
unsigned char current;
|
||||
do {
|
||||
current = bytestream2_get_byte(gb);
|
||||
if (current > INT_MAX - num_literals)
|
||||
return AVERROR_INVALIDDATA;
|
||||
num_literals += current;
|
||||
} while (current == 255);
|
||||
}
|
||||
@@ -124,8 +121,6 @@ static int lz4_decompress(AVCodecContext *avctx,
|
||||
|
||||
do {
|
||||
current = bytestream2_get_byte(gb);
|
||||
if (current > INT_MAX - match_length)
|
||||
return AVERROR_INVALIDDATA;
|
||||
match_length += current;
|
||||
} while (current == 255);
|
||||
}
|
||||
@@ -495,7 +490,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *p,
|
||||
return AVERROR_PATCHWELCOME;
|
||||
|
||||
if (s->format == 0) {
|
||||
ret = ff_lzf_uncompress(gb, &s->lzf_buffer, &s->lzf_size, &s->lzf_alloc_size);
|
||||
ret = ff_lzf_uncompress(gb, &s->lzf_buffer, &s->lzf_size);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -688,11 +688,6 @@ static av_cold int omx_encode_init(AVCodecContext *avctx)
|
||||
buffer = get_buffer(&s->output_mutex, &s->output_cond,
|
||||
&s->num_done_out_buffers, s->done_out_buffers, 1);
|
||||
if (buffer->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
|
||||
if (buffer->nFilledLen > INT32_MAX - AV_INPUT_BUFFER_PADDING_SIZE - avctx->extradata_size) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if ((ret = av_reallocp(&avctx->extradata, avctx->extradata_size + buffer->nFilledLen + AV_INPUT_BUFFER_PADDING_SIZE)) < 0) {
|
||||
avctx->extradata_size = 0;
|
||||
goto fail;
|
||||
|
||||
+1
-1
@@ -390,7 +390,7 @@ static int osq_decode_block(AVCodecContext *avctx, AVFrame *frame)
|
||||
int32_t *src = s->decode_buffer[ch] + OFFSET;
|
||||
|
||||
for (int n = 0; n < nb_samples; n++)
|
||||
dst[n] = av_clip_uint8(src[n] + 0x80ll);
|
||||
dst[n] = av_clip_uint8(src[n] + 0x80);
|
||||
}
|
||||
break;
|
||||
case AV_SAMPLE_FMT_S16P:
|
||||
|
||||
@@ -75,9 +75,6 @@ static int decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (avpkt->size * 1032LL < ((avctx->width + 7) >> 3) * avctx->height) //Asymptotic max compression of deflate
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, frame, AV_GET_BUFFER_FLAG_REF)) < 0)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -63,9 +63,6 @@ static int pnm_decode_frame(AVCodecContext *avctx, AVFrame *p,
|
||||
if (avctx->skip_frame >= AVDISCARD_ALL)
|
||||
return avpkt->size;
|
||||
|
||||
if (avctx->width * avctx->height / 8 > s->bytestream_end - s->bytestream)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
if ((ret = ff_get_buffer(avctx, p, 0)) < 0)
|
||||
return ret;
|
||||
avctx->bits_per_raw_sample = av_log2(s->maxval) + 1;
|
||||
|
||||
@@ -344,7 +344,7 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
int header_len = bytestream2_get_be16(&gb);
|
||||
if (header_len < 62 || bytestream2_get_bytes_left(&gb) < header_len - 2)
|
||||
if (header_len < 62)
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
GetByteContext gb_hdr;
|
||||
@@ -367,6 +367,9 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
if ((w & 1) || (h & 1))
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
||||
avctx->coded_width = FFALIGN(w, 16);
|
||||
avctx->coded_height = FFALIGN(h, 16);
|
||||
|
||||
if (w != avctx->width || h != avctx->height) {
|
||||
av_log(avctx, AV_LOG_WARNING, "picture resolution change: %ix%i -> %ix%i\n",
|
||||
avctx->width, avctx->height, w, h);
|
||||
@@ -374,9 +377,6 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
return ret;
|
||||
}
|
||||
|
||||
avctx->coded_width = FFALIGN(w, 16);
|
||||
avctx->coded_height = FFALIGN(h, 16);
|
||||
|
||||
enum AVPixelFormat pix_fmt = AV_PIX_FMT_BAYER_RGGB16;
|
||||
if (pix_fmt != s->pix_fmt) {
|
||||
s->pix_fmt = pix_fmt;
|
||||
@@ -447,9 +447,6 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
tile->y = (n / s->nb_tw) * s->th;
|
||||
tile->x = (n % s->nb_tw) * s->tw;
|
||||
|
||||
if (avctx->width - tile->x < 16)
|
||||
return AVERROR_PATCHWELCOME;
|
||||
|
||||
offset += size;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,9 +22,7 @@
|
||||
#ifndef AVCODEC_PRORES_RAW_H
|
||||
#define AVCODEC_PRORES_RAW_H
|
||||
|
||||
#include "libavutil/frame.h"
|
||||
#include "libavutil/mem_internal.h"
|
||||
#include "libavutil/pixfmt.h"
|
||||
|
||||
#include "bytestream.h"
|
||||
#include "blockdsp.h"
|
||||
|
||||
@@ -115,6 +115,10 @@ typedef struct PerThreadContext {
|
||||
int hwaccel_threadsafe;
|
||||
|
||||
atomic_int debug_threads; ///< Set if the FF_DEBUG_THREADS option is set.
|
||||
|
||||
/// The following two fields have the same semantics as the DecodeContext field
|
||||
int intra_only_flag;
|
||||
enum AVPictureType initial_pict_type;
|
||||
} PerThreadContext;
|
||||
|
||||
/**
|
||||
@@ -816,6 +820,13 @@ static av_cold int init_thread(PerThreadContext *p, int *threads_to_free,
|
||||
AVCodecContext *copy;
|
||||
int err;
|
||||
|
||||
p->initial_pict_type = AV_PICTURE_TYPE_NONE;
|
||||
if (avctx->codec_descriptor->props & AV_CODEC_PROP_INTRA_ONLY) {
|
||||
p->intra_only_flag = AV_FRAME_FLAG_KEY;
|
||||
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO)
|
||||
p->initial_pict_type = AV_PICTURE_TYPE_I;
|
||||
}
|
||||
|
||||
atomic_init(&p->state, STATE_INPUT_READY);
|
||||
|
||||
copy = av_memdup(avctx, sizeof(*avctx));
|
||||
|
||||
@@ -1857,8 +1857,6 @@ static int qdm2_decode_frame(AVCodecContext *avctx, AVFrame *frame,
|
||||
if(buf_size < s->checksum_size)
|
||||
return -1;
|
||||
|
||||
s->sub_packet = 0;
|
||||
|
||||
/* get output buffer */
|
||||
frame->nb_samples = 16 * s->frame_size;
|
||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||
|
||||
@@ -157,7 +157,6 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
||||
if (ctx->max_frame_size > (1 << 20) || !ctx->max_frame_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "invalid frame size %d\n",
|
||||
ctx->max_frame_size);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
ctx->max_frame_size = FFMAX(ctx->max_frame_size, avctx->sample_rate);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user