aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
Commit message (Collapse)AuthorAgeFilesLines
* avcodec/wmaenc: Check input for finitenessMichael Niedermayer2016-01-161-2/+11
| | | | | | | | Fixes out of array read Fixes: 1b79b985cdf860ffa228c00ee5497051/signal_sigsegv_1f99d24_315_f0f1fdb451264b1138e9c24eb7d49181.wv Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: Check both channels for finitenessMichael Niedermayer2016-01-161-8/+8
| | | | | | | | Fixes null pointer dereference Fixes: 10412fc52ecc6eab40ed67f82ca7b372/signal_sigsegv_2618c99_2129_f808373959e46afb165593332799ffbc.aif Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/motion_est: Attempt to fix "short data segment overflowed" on IA64Michael Niedermayer2016-01-161-0/+4
| | | | | | | This decreases the MV related encoding table sizes This should have little effect on real world video encoding performance Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* mpeg4videodec: silence ubsan warningAndreas Cadhalpun2016-01-151-1/+1
| | | | | | | | | | | | | | | s->ac_val[0][0] is of type 'int16_t [16]', but points into a larger buffer. Here it is used as base pointer to find the correct position in the larger buffer by adding 's->block_index[n] * 16' and thus as 'int16_t *'. This fixes clang's ubsan runtime error: index out of bounds for type 'int16_t [16]' Fixes: test_case.mp4 Found-by: Tyson Smith <twsmith@mozilla.com> Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avformat/riff: add YUYV FourCC (Drastic YUYV)Piotr Bandurski2016-01-151-0/+1
|
* avcodec/x86/fmtconvert: Add emms to int32_to_float_fmul_array8_sse()Michael Niedermayer2016-01-151-1/+8
| | | | | | this should fix checkasm on x86_64-archlinux-gcc-valgrind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngenc: Fix mixed up linesizesMichael Niedermayer2016-01-151-2/+2
| | | | | | | | Fixes out of array accesses Fixes: 0cf176e6d3ab9fe924f39738e513f547/asan_generic_4a54aa_3431_aaa28be1cb32e307a9890cad06f84fba.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/pngenc: Replace memcpy by av_image_copy()Michael Niedermayer2016-01-151-6/+3
| | | | | | | | Fixes out of array access Fixes: 0cf176e6d3ab9fe924f39738e513f547/asan_generic_4a54aa_3431_aaa28be1cb32e307a9890cad06f84fba.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/aacenc: use isfinite to simplify isnan/isinf logicGanesh Ajjanagadde2016-01-141-8/+9
| | | | | Reviewed-by: Claudio Freire <klaussfreire@gmail.com> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* lavc/ccaption_dec: clear all unused rows during rollupAman Gupta2016-01-141-1/+4
| | | | | | Sometimes rollup captions can move around the screen. This fixes "ghost" captions from below the current rollup area from continuing to be captured when a rollup moves higher up on the screen.
* lavc/ccaption_dec: clean up whitespaceAman Gupta2016-01-141-2/+1
|
* lavc/ccaption_dec: implement real_time optionAman Gupta2016-01-141-8/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This new mode is useful for realtime decoding of closed captions so they can be display along with mpeg2 frames. Closed caption streams contain two major types of captions: - POPON captions, which are buffered off-screen and displayed only after EOC (end of caption, aka display buffer) - PAINTON/ROLLUP captions, which are written to the display as soon as they arrive. In a typical real-time eia608 decoder, commands like EOC (end of caption; display buffer), EDM (erase display memory) and EBM (erase buffered memory) perform their expected functions as soon as the commands are processed. This is implemented in the real_time branches added in this commit. Before this commit, and in the !real_time branches after this commit, the decoder cleverly implements its own version of the decoder which is specifically geared towards buffered decoding. It does so by actively ignoring commands like EBM (erase buffered memory), and then re-using the non-display buffer to hold the previous caption while the new one is received. This is the opposite of the real-time decoder, which uses the non-display buffer to hold the new caption while the display buffer is still showing the current caption. In addition to ignoring EBM, the buffered decoder also has custom implementations for EDM and EOC. An EDM (erase display memory) command flushes the existing contents before clearing the screen, and EOC similarly always flushes the active buffer (the previous subtitle) before flipping buffers.
* lavc/ccaption_dec: flush context on seekAman Gupta2016-01-141-0/+19
|
* avcodec/aacenc_is: replace pow(x, 0.75) by x/sqrtf(sqrtf(x))Claudio Freire2016-01-142-1/+6
| | | | | | | | | | | | | | | This is quite an accurate approximation; testing shows ~ 2ulp error in the floating point result. Tested with FATE. Alternatively, if one wants "full accuracy", one can use powf, or sqrt instead of sqrtf. With powf, one gets 1 ulp error (theoretically should be 0, as 0.75 is exactly representable) on GNU libm, with sqrt, 0 ulp error. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com> Abstracted into pos_pow34 utility function Signed-off-by: Claudio Freire <klaussfreire@gmail.com>
* dca: fix misaligned access in avpriv_dca_convert_bitstreamAndreas Cadhalpun2016-01-141-4/+5
| | | | | | | | | | | src and dst are only 8-bit-aligned, so accessing them as uint16_t causes SIGBUS crashes on architectures like sparc. This fixes ubsan runtime error: load of misaligned address for type 'const uint16_t', which requires 2 byte alignment Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avcodec/aacenc: Check for +-Inf tooMichael Niedermayer2016-01-131-9/+9
| | | | | | | | Fixes out of array read Fixes: 04442da73d935b776d2236282588d4f9/signal_sigsegv_2625a69_8790_ae85ffc889070663319b3417ede777b0.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpackenc: print channel count in av_log callJames Almer2016-01-131-1/+1
| | | | Fixes a warning with -Wformat-extra-args
* avcodec/diracdec: Handle the 0 vlc case at the top of coeff_unpack_golomb()Michael Niedermayer2016-01-131-6/+12
| | | | | | | decoding changes from 17 to 20 fps Reviewed-by; Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/diracdec: Factor +2 out of the inner loopMichael Niedermayer2016-01-131-5/+5
| | | | | Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/diracdec: Inline svq3_get_ue_golomb() and merge the sign bit ↵Michael Niedermayer2016-01-131-3/+34
| | | | | | | | | decoding into it This avoids closing and opening the bit reader Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: mark output as const as its not written toMichael Niedermayer2016-01-131-1/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacenc: Fix NAN checkMichael Niedermayer2016-01-131-1/+9
| | | | | | | | | All MDCT outputs must be checked in case of 128point MDCTs Fixes: out of array read Fixes: 04442da73d935b776d2236282588d4f9/signal_sigsegv_2625a69_351_52ca6226eb83547a2d26e322ce84ed84.mov Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* diracdec: Add slice threading to HQ profileKieran Kunhya2016-01-131-8/+30
|
* AAC encoder: encode out-of-phase I/S efficientlyClaudio Freire2016-01-131-1/+8
| | | | | | | | | | | Use the ability to invert phase with ms_mask instead of changing the codebook when possible, to avoid having to switch codebooks if some bands are INTENSTY_BT and others are INTENSITY_BT2, since usually a set ms_mask uses less bits that a codebook change. While it may not always be a win (ie: if it causes an ms_mask bitmap to be sent when it wouldn't have been otherwise), it's unlikely since the ms_mask bitmap will almost always be there already for M/S itself.
* AAC encoder: fix I/S relative error evaluationClaudio Freire2016-01-131-1/+1
| | | | | | | The relative error between two encoding strategies is the simple difference of rate-distortion values, and not the absolute difference. An absolute measure would allow worsening of the quantization error as well as improving.
* AAC encoder: various fixes in M/S codingClaudio Freire2016-01-132-30/+36
| | | | | | | | | | | | | | | | | | | | 1. Fix sf_idx and band_type addressing to address only the first subwindow in the group (others could hold garbage values) 2. Don't step on ms_mask when is_mask is set. I/S selection already sets the ms_mask properly and shouldn't be overridden. 3. Use mid/sid cb/sf when computing coding error, as should be since those are the cb/sfs that will eventually be set. 4. Fix distortion computation on multi-subwindow groups (was subtracting the bits terms multiple times) 5. Clear ms_mask when one side uses PNS and the other doesn't. When using PNS, ms_mask signals correlated noise, which can be detected just like regular M/S detection, so we don't skip noise bands, but when only one side uses PNS setting the flag can confuse some encoders, so avoid that.
* AAC encoder: in IS, fix index of sf_idx, band_typeClaudio Freire2016-01-131-10/+5
| | | | | | | | | | Correct addressing of sf_idx and band_type arrays in I/S code. Both arrays don't guarantee valid values for subwindows at all times, depending on which coder is being used, which could result in reading of garbage values. Instead, only the first subwindow in the window group has to be used, ie: use w*16+g instead of (w+w2)*16+g
* AAC encoder: don't apply MS on special bandsClaudio Freire2016-01-131-2/+2
| | | | | | | | | Change the condition for application of the M/S transform to match that of the decoder. Namely, that no special coding books must be in use in either channel. While the condition ought to be equivalent to the current one when the invariant of is_mask is kept, matching the decoder's condition is safer and easier to maintain.
* AAC encoder: avoid assertion failure on PNSClaudio Freire2016-01-131-1/+4
| | | | | In rare corner cases it could still fail an assert on sf_diff due to failure to update prev_sf in some code paths. Fix that case.
* AAC encoder: fix assertion error with predictionClaudio Freire2016-01-131-3/+5
| | | | | | | | | | | | Fixes an assertion error reported in #2686 that happens when using prediction (either explicitly or implicitly by setting the AAC main profile), since prediction code would allow creating new zeroes or removing existing ones, without properly checking for SF delta violations. This patch forbids creating/removing zeroes, perhaps an overly conservative approach, but a safe one. More permissive and sophisticated approaches may be attempted in the future.
* lavc/mjpeg2jpeg: Accept more mjpeg streams as input.Carl Eugen Hoyos2016-01-131-4/+5
| | | | Fixes ticket #5151.
* libvpxdec: fix 'ISO C90 forbids mixed declarations and code' warningJames Zern2016-01-121-1/+1
| | | | | | | | since: cbcc88c libvpx: Support setting color range for vp9. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: James Zern <jzern@google.com>
* avcodec/truemotion2: Cleanup in case of tm2_read_stream() failureMichael Niedermayer2016-01-121-10/+18
| | | | | | | | Fixes memleaks Fixes: 245dae71bc28fe8f3f454300277e575a/signal_sigabrt_7ffff6ae7cb7_5062_f7d9dfa385454806586076f9db48c0bf.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/mjpeg2jpeg: Check for jpeg file header.Carl Eugen Hoyos2016-01-121-0/+5
|
* avcodec/mpeg4video: Check time_incrMichael Niedermayer2016-01-123-5/+15
| | | | | | | | | | Fixes assertion failure Fixes out of memory access Fixes: test_casex.ivf Found-by: Tyson Smith <twsmith@mozilla.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* diracdec: fix idwt_stride calculation in bytesAndreas Cadhalpun2016-01-121-1/+1
| | | | | | | | | | | | The transformation to bytes must happen after alignment to get the same resulting pointers as before. This fixes segmentation faults in the assembler code. The regression was introduced in commit 9553689. Reviewed-by: Kieran Kunhya <kierank@obe.tv> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* lavc/cbrt_tablegen: speed up tablegenGanesh Ajjanagadde2016-01-111-10/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This exploits an approach based on the sieve of Eratosthenes, a popular method for generating prime numbers. Tables are identical to previous ones. Tested with FATE with/without --enable-hardcoded-tables. Sample benchmark (Haswell, GNU/Linux+gcc): prev: 7860100 decicycles in cbrt_tableinit, 1 runs, 0 skips 7777490 decicycles in cbrt_tableinit, 2 runs, 0 skips [...] 7582339 decicycles in cbrt_tableinit, 256 runs, 0 skips 7563556 decicycles in cbrt_tableinit, 512 runs, 0 skips new: 2099480 decicycles in cbrt_tableinit, 1 runs, 0 skips 2044470 decicycles in cbrt_tableinit, 2 runs, 0 skips [...] 1796544 decicycles in cbrt_tableinit, 256 runs, 0 skips 1791631 decicycles in cbrt_tableinit, 512 runs, 0 skips Both small and large run count given as this is called once so small run count may give a better picture, small numbers are fairly consistent, and there is a consistent downward trend from small to large runs, at which point it stabilizes to a new value. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* avcodec/wavpackenc: Check the number of channelsMichael Niedermayer2016-01-111-0/+5
| | | | | | They are stored in a byte, thus more than 255 is not possible Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/wavpackenc: Headers are per channelMichael Niedermayer2016-01-111-1/+1
| | | | | | | | Fixes: 1b8b83a53bfa751f01b1daa65a4758db/signal_sigabrt_7ffff6ae7cb7_7488_403f71d1a2565b598d01b6cb110fac8f.aiff Fixes: assertion failure Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/ac3enc: Remove duplicate #includeMichael Niedermayer2016-01-111-1/+0
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/aacdec_template: Check id_mapMichael Niedermayer2016-01-101-0/+4
| | | | | | | | Fixes index out of bounds error Fixes: aac_index_out_of_bounds.wmv Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dvdec: Fix "left shift of negative value -254"Michael Niedermayer2016-01-101-1/+1
| | | | | | | Fixes: dvdec_left_shift.avi Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/g2meet: Check for ff_els_decode_bit() failure in ↵Michael Niedermayer2016-01-101-1/+6
| | | | | | | | | | epic_decode_run_length() Fixes invalid shift Fixes: g2m_left_shift_2.wmv Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/ccaption_dec: improve default styleClément Bœsch2016-01-105-7/+19
| | | | Use monospaced font, and a black box outline.
* avcodec/mjpegdec: Fix negative shiftMichael Niedermayer2016-01-101-1/+1
| | | | | | | Fixes: mjpeg_left_shift.avi Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* lavc/x264: Add compatibility values for coder options.Carl Eugen Hoyos2016-01-101-0/+2
| | | | Fixes ticket #5142.
* lavc/ccaption_dec: fix ASS tagsClément Bœsch2016-01-101-6/+6
|
* avcodec/mss2: Check for repeat overflowMichael Niedermayer2016-01-101-1/+6
| | | | | | | Fixes: mss2_left_shift.wmv Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/codec_desc: Add ff_aac_profiles to aac_latmMichael Niedermayer2016-01-101-0/+1
| | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* libvpx: Support setting color range for vp9.Sasi Inguva2016-01-092-0/+30
| | | | | | | | Pass through color range to vp9 encoder. Parse color range in libvpxdec.c. Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Sasi Inguva <isasi@google.com> Signed-off-by: James Almer <jamrial@gmail.com>