summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* aarch64: vp8: Move the vp8dsp makefile entries to the right placesMartin Storsjö2019-02-19
| | | | | | | | | | | | Even if NEON would be disabled, the init functions should be built as they are called as long as ARCH_AARCH64 is set. These functions are part of a generic DSP subsytem, not tied directly to one decoder. (They should be built if the vp7 decoder is enabled, even if the vp8 decoder is disabled.) Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit b4b27dce95a6d40bfcd78043d3abec7d80dae143)
* aarch64: vp8: Remove superfluous includesMartin Storsjö2019-02-19
| | | | | | | This fixes building with MSVC, which lacks unistd.h. Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit ad32f7b1264dbc614f0db1c443d5361420e9e07e)
* aarch64: vp8: Fix assembling with armasm64Martin Storsjö2019-02-19
| | | | | Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit 2eeac79936e83c4495cbe5905064ab797e9b45ff)
* aarch64: vp8: Fix assembling with clangMartin Storsjö2019-02-19
| | | | | | | | | | | | | | | | This also partially fixes assembling with MS armasm64 (via gas-preprocessor). The movrel macro invocations need to pass the offset via a separate parameter. Mach-o and COFF relocations don't allow a negative offset to a symbol, which is handled properly if the offset is passed via the parameter. If no offset parameter is given, the macro evaluates to something like "adrp x17, subpel_filters-16+(0)", which older clang versions also fail to parse (the older clang versions only support one single offset term, although it can be a parenthesis. Signed-off-by: Martin Storsjö <martin@martin.st> (cherry picked from commit 26d7af4c381ee3c7b13b032b3817168b84b98ca6)
* libavcodec/zmbvenc: motion estimation improvements/bug fixes:Matthew Fearnley2019-02-19
| | | | | | | | - Clamp ME range to -64..63 (prevents corruption when me_range is too high) - Allow MV's up to *and including* the positive range limit - Allow out-of-edge ME by padding the prev buffer with a border of 0's - Try previous MV before checking the rest (improves speed in some cases) - More robust logic in code - ensure *mx,*my,*xored are updated together
* libavcodec/zmbvenc: block scoring improvements/bug fixesMatthew Fearnley2019-02-19
| | | | | | | | - Improve block choices by counting 0-bytes in the entropy score - Make histogram use uint16_t type, to allow byte counts from 16*16 (current block size) up to 255*255 (maximum allowed 8bpp block size) - Make sure score table is big enough for a full block's worth of bytes - Calculate *xored without using code in inner loop
* lavc/libdavs2: fix parameter setting errorhwren2019-02-19
| | | | Signed-off-by: hwrenx <hwrenx@126.com>
* lavc/libxavs2: use upper layer qp parameters firsthwren2019-02-19
| | | | Signed-off-by: hwrenx <hwrenx@126.com>
* lavc/libxavs2: remove unused context parameterhwren2019-02-19
| | | | Signed-off-by: hwrenx <hwrenx@126.com>
* avcodec/htmlsubtitles: Fixes denial of service due to use of sscanf in inner ↵Kevin Backhouse via RT2019-02-17
| | | | | | | | | loop for handling braces Fixes: [Semmle Security Reports #19439] Fixes: dos_sscanf2.mkv Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/htmlsubtitles: Fixes denial of service due to use of sscanf in inner ↵Kevin Backhouse via RT2019-02-17
| | | | | | | | | loop for tag scaning Fixes: [Semmle Security Reports #19438] Fixes: dos_sscanf1.mkv Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegvideo_enc: Use av_assert1() instead of assert()Michael Niedermayer2019-02-17
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/libgsmenc: Force mono and use 13k as default bitrate.Carl Eugen Hoyos2019-02-17
|
* avcodec/mips: [loongson] optimize theora decoding with mmi.gxw2019-02-16
| | | | | | | | | | | | | Optimize theora decoding with mmi in functions: 1. ff_vp3_idct_add_mmi 2. ff_vp3_idct_put_mmi 3. ff_vp3_idct_dc_add_mmi 4. ff_put_no_rnd_pixels_l2_mmi Theora decoding speed improved about 32%(from 88fps to 116fps, Tested on loongson 3A3000). Reviewed-by: Shiyou Yin <yinshiyou-hf@loongson.cn> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4videodec: Clear interlaced_dct for studio profileMichael Niedermayer2019-02-16
| | | | | | | | | Fixes: Out of array access Fixes: 13090/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-5408668986638336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Kieran Kunhya <kierank@obe.tv> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/version: Bump micro-version for nvdec/cuviddec changesPhilip Langdale2019-02-16
| | | | I forgot to add the version bump and changelog within the changes.
* avcodec/cuviddec: Add support for decoding HEVC 4:4:4 contentPhilip Langdale2019-02-16
| | | | | | | | | | | This is the equivalent change for cuviddec after the previous change for nvdec. I made similar changes to the copying routines to handle pixel formats in a more generic way. Note that unlike with nvdec, there is no confusion about the ability of a codec to output 444 formats. This is because the cuvid parser is used, meaning that 444 JPEG content is still indicated as using a 420 output format.
* avcodec/nvdec: Explicitly mark codecs that support 444 output formatsPhilip Langdale2019-02-16
| | | | | | | | | With the introduction of HEVC 444 support, we technically have two codecs that can handle 444 - HEVC and MJPEG. In the case of MJPEG, it can decode, but can only output one of the semi-planar formats. That means we need additional logic to decide whether to use a 444 output format or not.
* avcodec/nvdec: Add support for decoding HEVC 4:4:4 contentPhilip Langdale2019-02-16
| | | | | | | | | | | | | The latest generation video decoder on the Turing chips supports decoding HEVC 4:4:4. Supporting this is relatively straight-forward; we need to account for the different chroma format and pick the right output and sw formats at the right times. There was one bug which was the hard-coded assumption that the first chroma plane would be half-height; I fixed this to use the actual shift value on the plane. We also need to pass the SPS and PPS range extension flags.
* avcodec/hevc_ps: Expose all SPS and PPS range extension flagsPhilip Langdale2019-02-16
| | | | | | | We need all the flags to be exposed to be able to pass them on to HW decoders. I did not attempt to nuance any of the warnings about flags being unsupported as there's no way, at the point we extract flags, to say whether an HW decoder is being used.
* avcodec/nvenc: add b_as_ref support for HEVCRoman Arzumanyan2019-02-14
| | | | Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avutil/cuda_check: avoid pointlessly exporting same symbol from two librariesTimo Rothenpieler2019-02-14
|
* lavc/libaribb24: use integer math to calculate font scalingJan Ekström2019-02-12
|
* lavc/libaribb24: add missing type struct members to AVOptionsJan Ekström2019-02-12
|
* lavc/libaribb24: protect handled value with parenthesis in RGB_TO_BGRJan Ekström2019-02-12
|
* lavc/libaribb24: add error handling to region handlingJan Ekström2019-02-12
| | | | | | | | | | | Fixes some rather embarrassing mistakes that somehow passed my eyes. * Now catches if memory allocation has failed during bprint usage by checking av_bprint_is_complete(). * Now catches if adding an ASS rectangle into an AVSubtitle failed. * Returns AVERROR_INVALIDDATA if we get an invalid region buffer length.
* avcodec/cbs_av1: don't call cbs_av1_read_trailing_bits() when no bits remain ↵James Almer2019-02-10
| | | | | | | in the OBU Reviewed-by: jkqxz Signed-off-by: James Almer <jamrial@gmail.com>
* add libaribb24 ARIB STD-B24 caption decoderJan Ekström2019-02-10
| | | | | | | | | | | | | | | | | | | | | | | | * Outputs ASS lines with basic coloring and font scaling for each given region. * Sets the default style to the resolution of the subtitle plane (for example, 960x540 / 36pt font for profile A). * Has options to: * Disable ruby text (which is coded as regions which have half-height text in libaribb24). Enabled by default as without positioning ruby text only confuses as it is usually coded in the beginning of the decoded subtitle line. * Set the working directory, in which libaribb24 will read configuration as well as into which it may save broadcast extra symbols as PNG. Unset by default. The unconventional library check can be explained by the library's current master branch being licensed as LGPLv3, but at the time of writing the latest official release is still licensed under GPLv3. Thus, one either has to wait for the following release, or enable GPLv3.
* avcodec/sbrdsp_fixed.c: remove input value limit for sbr_sum_square_c()Michael Niedermayer2019-02-09
| | | | | | | Fixes: 1377/clusterfuzz-testcase-minimized-5487049807233024 Fixes: assertion failure in sbr_sum_square_c() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_parse: Clear ref_list[1] if only [0] is usedMichael Niedermayer2019-02-08
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_parse: no need check ref list1 for P slices.Decai Lin2019-02-08
| | | | | | | | This is robust for some corner case there is incorrect list1 count in pps header, but it's a P slice and can be decoded well. Signed-off-by: Decai Lin <decai.lin@intel.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpegvideo_enc: Use av_assert1() instead of assert() in ↵Michael Niedermayer2019-02-07
| | | | | | merge_context_after_encode() Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3: Explicitly return to discard large amounts of nonsense bytesMichael Niedermayer2019-02-07
| | | | | | | | | | | Changes 19sec to 10ms (12559) runtime, 17sec to 177ms (12570) Fixes: Timeout Fixes: 12559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_fuzzer-5666516266123264 Fixes: 12561/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AC3_FIXED_fuzzer-5682923041193984 Fixes: 12570/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EAC3_fuzzer-5194734308425728 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mpeg4_unpack_bframes_bsf: Use avpriv_find_start_codeAndreas Rheinhardt2019-02-04
| | | | | | | | | | | instead of an ad-hoc function to search for start codes in order to remove code duplication and to improve performance. Improved performance of finding startcodes from 52606 decicycles to 9543 decicycles based upon 262144 runs for a 1 Mb/s MPEG4 video. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pgssubdec: Check for duplicate display segmentsMichael Niedermayer2019-02-03
| | | | | | | | | | In such a duplication the previous gets overwritten and leaks Fixes: memleak Fixes: 12510/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGSSUB_fuzzer-5694439226343424 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: [loongson] optimize put_hevc_qpel_h_8 with mmi.Shiyou Yin2019-02-02
| | | | | | | Optimize put_hevc_qpel_h_8 with mmi in the case width=4/8/12/16/24/32/48/64. This optimization improved HEVC decoding performance 2%(2.39x to 2.44x, tested on loongson 3A3000). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: [loongson] optimize put_hevc_qpel_bi_h_8 with mmi.Shiyou Yin2019-02-02
| | | | | | | Optimize put_hevc_qpel_bi_h_8 with mmi in the case width=4/8/12/16/24/32/48/64. This optimization improved HEVC decoding performance 2.1%(2.34x to 2.39x, tested on loongson 3A3000). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: [loongson] optimize put_hevc_epel_bi_hv_8 with mmi.Shiyou Yin2019-02-02
| | | | | | | Optimize put_hevc_epel_bi_hv_8 with mmi in the case width=4/8/12/16/24/32. This optimization improved HEVC decoding performance 1.7%(2.30x to 2.34x, tested on loongson 3A3000). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/mips: [loongson] optimize put_hevc_qpel_uni_hv_8 with mmi.Shiyou Yin2019-02-02
| | | | | | | Optimize put_hevc_qpel_uni_hv_8 with mmi in the case width=4/8/12/16/24/32/48/64. This optimization improved HEVC decoding performance 2.7%(2.24x to 2.30x, tested on loongson 3A3000). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/aarch64/vp8dsp: Fix the include guard.Carl Eugen Hoyos2019-01-31
| | | | Fixes fate-source.
* libavcodec: vp8 neon optimizations for aarch64Magnus Röös2019-01-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partial port of the ARM Neon for aarch64. Benchmarks from fate: benchmarking with Linux Perf Monitoring API nop: 58.6 checkasm: using random seed 1760970128 NEON: - vp8dsp.idct [OK] - vp8dsp.mc [OK] - vp8dsp.loopfilter [OK] checkasm: all 21 tests passed vp8_idct_add_c: 201.6 vp8_idct_add_neon: 83.1 vp8_idct_dc_add_c: 107.6 vp8_idct_dc_add_neon: 33.8 vp8_idct_dc_add4y_c: 426.4 vp8_idct_dc_add4y_neon: 59.4 vp8_loop_filter8uv_h_c: 688.1 vp8_loop_filter8uv_h_neon: 216.3 vp8_loop_filter8uv_inner_h_c: 649.3 vp8_loop_filter8uv_inner_h_neon: 195.3 vp8_loop_filter8uv_inner_v_c: 544.8 vp8_loop_filter8uv_inner_v_neon: 131.3 vp8_loop_filter8uv_v_c: 706.1 vp8_loop_filter8uv_v_neon: 141.1 vp8_loop_filter16y_h_c: 668.8 vp8_loop_filter16y_h_neon: 242.8 vp8_loop_filter16y_inner_h_c: 647.3 vp8_loop_filter16y_inner_h_neon: 224.6 vp8_loop_filter16y_inner_v_c: 647.8 vp8_loop_filter16y_inner_v_neon: 128.8 vp8_loop_filter16y_v_c: 721.8 vp8_loop_filter16y_v_neon: 154.3 vp8_loop_filter_simple_h_c: 387.8 vp8_loop_filter_simple_h_neon: 187.6 vp8_loop_filter_simple_v_c: 384.1 vp8_loop_filter_simple_v_neon: 78.6 vp8_put_epel8_h4v4_c: 3971.1 vp8_put_epel8_h4v4_neon: 855.1 vp8_put_epel8_h4v6_c: 5060.1 vp8_put_epel8_h4v6_neon: 989.6 vp8_put_epel8_h6v4_c: 4320.8 vp8_put_epel8_h6v4_neon: 1007.3 vp8_put_epel8_h6v6_c: 5449.3 vp8_put_epel8_h6v6_neon: 1158.1 vp8_put_epel16_h6_c: 6683.8 vp8_put_epel16_h6_neon: 831.8 vp8_put_epel16_h6v6_c: 11110.8 vp8_put_epel16_h6v6_neon: 2214.8 vp8_put_epel16_v6_c: 7024.8 vp8_put_epel16_v6_neon: 799.6 vp8_put_pixels8_c: 112.8 vp8_put_pixels8_neon: 78.1 vp8_put_pixels16_c: 131.3 vp8_put_pixels16_neon: 129.8 Signed-off-by: Magnus Röös <mla2.roos@gmail.com>
* avcodec/ffv1: Simplify update_vlc_state()Michael Niedermayer2019-01-31
| | | | | | About 0.5% faster Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ffv1: Simplify fold()Michael Niedermayer2019-01-31
| | | | | | | No speed difference, or slightly faster (the difference is too small so it may be noise that this appears faster) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libavcodec/rscc.c: add missing semicolonMateusz2019-01-31
| | | | | | Signed-off-by: Mateusz Brzostek <mateuszb@poczta.onet.pl> Reviewed-by: James Almer <jamrial@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rasc: Move ff_get_buffer() after frame checksMichael Niedermayer2019-01-31
| | | | | | If the frame1/2 checks fail this avoids doing the allocation of a new frame Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/rasc: Check uncompressed dlta sizeMichael Niedermayer2019-01-31
| | | | | | | | | | | We assume that if the compressed size is bigger than if each byte is encoded in a single raw packet that the data is invalid. Fixes: Out of memory Fixes: 12208/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5648916473708544 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/fic: Check that there is input left in fic_decode_block()Michael Niedermayer2019-01-31
| | | | | | | | Fixes: Timeout Fixes: 12450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5661984622641152 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/arbc: clear decoder state when seekingJames Almer2019-01-28
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/motion_est: remove duplicate functionMarton Balint2019-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* avcodec/rscc: Avoid returning frames that have nearly no undamaged pixels in ↵Michael Niedermayer2019-01-28
| | | | | | | | | | | | | them Fixes: Timeout Fixes: 12192/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264 Before: clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264 in 15423 ms After: clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RSCC_fuzzer-6279038004363264 in 190 ms Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>