summaryrefslogtreecommitdiff
path: root/libavcodec
Commit message (Collapse)AuthorAge
* avcodec/cuviddec: improve progressive frame detectionSergey Svechnikov2019-04-23
| | | | | | | | | | | | | There are 2 types of problems when using adaptive deinterlace with cuvid: 1. Sometimes, in the middle of transcoding, cuvid outputs frames with visible horizontal lines (as though weave deinterlace method was chosen); 2. Occasionally, on scene changes, cuvid outputs a wrong frame, which should have been shown several seconds before (as if the frame was assigned some wrong PTS value). The reason is that sometimes CUVIDPARSERDISPINFO has property progressive_frame equal to 1 with interlaced videos. In order to fix the problem we should check if the video is interlaced or progressive in the beginning of a video sequence (cuvid_handle_video_sequence). And then we just use this information instead of the property progressive_frame in CUVIDPARSERDISPINFO (which is unreliable). Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
* avcodec/agm: remove ;;Michael Niedermayer2019-04-21
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/agm: Check for too many too short codes in make_new_tree()Michael Niedermayer2019-04-21
| | | | | | | | | Fixes: SEGV on unknown address Fixes: 14198/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5723579234123776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/agm: Do not crash on invalid codesMichael Niedermayer2019-04-21
| | | | | | | | | | | | | I do not know if such vlc trees are allowed in agm, I have no specification So i do not know if these should be treated as error, or not. But the code does contain a check for idx < 0 already ... Fixes: Stack-buffer-overflow in get_tree_codes Fixes: 14189/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5745747003179008 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ccaption_dec: Add a blank like at the end to avoid rollup reading ↵Michael Niedermayer2019-04-21
| | | | | | | | | | | from outside Fixes: index 20 out of bounds for type 'const char *[4][128]' Fixes: 14367/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CCAPTION_fuzzer-5718819672162304 Reviewed-by: Paul B Mahol <onemda@gmail.com> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdec: add frame threadsPaul B Mahol2019-04-21
|
* avcodec: add AV_CODEC_FLAG_DROPCHANGED to flagsGyan Doshi2019-04-20
| | | | Discard decoded frames which differ from first decoded frame in stream.
* avcodec/pictordec: Only recalculate d when y changes in picmemset()Michael Niedermayer2019-04-19
| | | | | | | | Fixes: Timeout (21->18sec) Fixes: 14124/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5633887734071296 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pictordec: avoid pointers in picmemset()Michael Niedermayer2019-04-19
| | | | | | | Improves overall speed by about 3% Testcase: 14124/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5633887734071296 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wmv2dec: Check that the P frame secondary header fit in the inputMichael Niedermayer2019-04-19
| | | | | | | | Fixes: Timeout (64sec ->2 sec) Fixes: 14131/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5719879556005888 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ivi: Move buffer/block end check to caller of ivi_dc_transform()Michael Niedermayer2019-04-19
| | | | | | | | Fixes: assertion failure Fixes: 14078/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO5_fuzzer-5760571284127744 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/diracdec: Use 64bit in intermediate of global motion vector field ↵Michael Niedermayer2019-04-19
| | | | | | | | | | | generation It seems the specification does not limit the value to 32bit Fixes: signed integer overflow: -109611143 * 24 cannot be represented in type 'int' Fixes: 13477/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5648337460527104 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/alac: Make a variable unsigned.Carl Eugen Hoyos2019-04-19
| | | | | | Fixes a bogus compiler warning (max_samples_per_frame is checked): libavcodec/alac.c: In function ‘allocate_buffers’: ./libavutil/internal.h:142:9: warning: argument 1 value ‘18446744073709551552’ exceeds maximum object size 9223372036854775807
* avcodec/get_bits: unbreak get_bits_le() with cached readerPaul B Mahol2019-04-19
|
* avcodec/cbs_av1: use the new signed value read/write functionsJames Almer2019-04-16
| | | | | Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h265: fix storage type for time_offset_value in Time Code SEIJames Almer2019-04-16
| | | | | | | | The spec defines it as an array of signed values, inferred to 0 when not present. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h264: fix storage type for time_offset in Pic Timing SEIJames Almer2019-04-16
| | | | | | | The spec defines it as a signed value. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_h2645: add helper macros for signed valuesJames Almer2019-04-16
| | | | | Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs: add helper functions and macros to read and write signed valuesJames Almer2019-04-16
| | | | | Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add support for Scalability MetadataJames Almer2019-04-16
| | | | | Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/libaomenc: Mark a potentially unused variable as av_unused.Carl Eugen Hoyos2019-04-16
| | | | | Fixes a warning: libavcodec/libaomenc.c:816:9: warning: unused variable ‘pict_type’
* avcodec/videotoolbox: add support for 10bit pixel formatfumoboy0072019-04-16
| | | | | this patch was originally posted on issue #7704 and was slightly adjusted to check for the availability of the pixel format.
* avcodec/cbs_av1: add support for Padding OBUsJames Almer2019-04-14
| | | | | | | Based on itut_t35 Matadata OBU parsing code. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: add a function to strip trailing zeroes from a buffer sizeJames Almer2019-04-14
| | | | | | | Factor it out from cbs_av1_read_metadata_itut_t35() Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/truemotion2: Fix integer overflow in tm2_decode_blocks()Michael Niedermayer2019-04-13
| | | | | | | | Fixes: signed integer overflow: 255 + 2147483634 cannot be represented in type 'int' Fixes: 13472/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TRUEMOTION2_fuzzer-5712444142387200 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/imm4: flush prev_frame after seekingPaul B Mahol2019-04-13
|
* avcodec: add LSCR decoderPaul B Mahol2019-04-13
| | | | Fixes #4711.
* avcodec: add an AV1 frame split bitstream filterJames Almer2019-04-11
| | | | | | This will be needed by the eventual native AV1 decoder. Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/agm: Check frame dimensionsMichael Niedermayer2019-04-11
| | | | | | | | | Fixes: out of array access Fixes: 14110/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5649184864075776 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec: add ADPCM AGM decoderPaul B Mahol2019-04-11
|
* avcodec/agm: add support for non-dct codingPaul B Mahol2019-04-11
|
* avcodec/agm: add support for higher compressionPaul B Mahol2019-04-11
|
* avcodec/pnm_parser: Factor out next/index compensationMichael Niedermayer2019-04-10
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pnm_parser: Factor next initialization outMichael Niedermayer2019-04-10
| | | | | Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pnm_parser: Support concatenated ASCII imagesMichael Niedermayer2019-04-10
| | | | | | | | Fixes: Timeout (8sec -> 0.1sec) Fixes: 13864/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAM_fuzzer-5737860621139968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* aarch64/opusdsp: implement NEON accelerated postfilter and deemphasisLynne2019-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 153372 UNITS in postfilter_c, 65536 runs, 0 skips 73164 UNITS in postfilter_neon, 65536 runs, 0 skips -> 2.1x speedup 80591 UNITS in deemphasis_c, 131072 runs, 0 skips 43969 UNITS in deemphasis_neon, 131072 runs, 0 skips -> 1.83x speedup Total decoder speedup: ~15% on a Raspberry Pi 3 (from 28.1x to 33.5x realtime) Deemphasis SIMD based on the following unrolling: const float c1 = CELT_EMPH_COEFF, c2 = c1*c1, c3 = c2*c1, c4 = c3*c1; float state = coeff; for (int i = 0; i < len; i += 4) { y[0] = x[0] + c1*state; y[1] = x[1] + c2*state + c1*x[0]; y[2] = x[2] + c3*state + c1*x[1] + c2*x[0]; y[3] = x[3] + c4*state + c1*x[2] + c2*x[1] + c3*x[0]; state = y[3]; y += 4; x += 4; } Unlike the x86 version, duplication is used instead of pslldq so the structure and tables are different.
* avcodec/agm: Fix integer overflow with w/hMichael Niedermayer2019-04-05
| | | | | | | | | Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself Fixes: 13999/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5644405991538688 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/agm: More completely check size before using itMichael Niedermayer2019-04-04
| | | | | | | | | Fixes: out of array access Fixes: 13997/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AGM_fuzzer-5701427252428800 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/av1_metadata: add an option to remove Padding OBUsJames Almer2019-04-03
| | | | | Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/qsvenc: enable hevc gpb optionZhong Li2019-04-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | GPB is the default type, just contains forward references but the slice_type is B slice with higher encoding efficiency than regular P slice, but lower performance. Add an option to allow user to set regular P slice. Fix ticket#6870 Test data on Intel Kabylake (i7-7567U CPU @ 3.50GHz): 1. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vsync passthrough -vframes 1000 -c:v hevc_qsv -gpb 0 -bf 0 -q 25 test_gpb_off_bf0_kbl.mp4 transcoding fps: 85 encoded file size of test_gpb_off_bf0_kbl.mp4: 21960100 (bytes) 2. ffmpeg -hwaccel qsv -c:v h264_qsv -i bbb_sunflower_1080p_30fps_normal.mp4 -vsync passthrough -vframes 1000 -c:v hevc_qsv -gpb 1 -bf 0 -q 25 test_gpb_on_bf0_kbl.mp4 transcoding fps: 79 encoded file size oftest_gpb_on_bf0_kbl.mp4: 21211449 (bytes) In this case, enable gpb can bring about 7% performance drop but 3.4% encoding efficiency improvment. Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsvenc: enable hevc coding options configurationZhong Li2019-04-03
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* lavc/qsvenc: no need to include h264.h for jpeg encoderZhong Li2019-04-03
| | | | Signed-off-by: Zhong Li <zhong.li@intel.com>
* avcodec/libaomenc: fix range of values for enable-intrabc optionJames Almer2019-04-02
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec/cbs_av1: fix parsing spatial_idJames Almer2019-04-02
| | | | | Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: James Almer <jamrial@gmail.com>
* libavcodec/zmbvenc: add support for 24-bit encoding, using pix_fmt BGR24.Matthew Fearnley2019-04-02
| | | | | Support is #ifdef'd out at this stage, using ZMBV_ENABLE_24BPP (like in the zmbv.c decoder)
* libavcodec/zmbv: change 24-bit decoder channel order, from RGB24 to BGR24Matthew Fearnley2019-04-02
| | | | | | | | | | | | This brings the channel order in line with that used in 32-bit mode (BGR0). 24-bit decoding is disabled by default (#ifdef ZMBV_ENABLE_24BPP), and no prior encoders or sample videos are known to exist for this bit depth, so I consider this change in implementation is unlikely to affect anyone. The decision has been made in agreement with the DOSBox Development Team (dosbox.crew@gmail.com), specifically with harekiet, who wrote the original codec.
* libavcodec/zmbv: use PTRDIFF_SPECIFIER for `src - c->decomp_buf`.Matthew Fearnley2019-04-02
| | | | | Other bit depths saw this change in ced0d6c14d, but this instance was presumably missed because of the #ifdef block.
* avcodec/opus: make redundancy_buf 32 byte alignedJames Almer2019-04-02
| | | | | | Fixes ff_opus_deemphasis_fma3 segmentation fault crashes on x86_32. Signed-off-by: James Almer <jamrial@gmail.com>
* x86/opusdsp: fix WIN64 return valueLynne2019-04-01
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc/qsvenc: get vps extradata from MSDKZhong Li2019-04-01
| | | | | Signed-off-by: Zhong Li <zhong.li@intel.com> Reviewed-by: Mark Thompson <sw@jkqxz.net>