summaryrefslogtreecommitdiffstats
path: root/libavcodec/huffyuvdec.c
Commit message (Collapse)AuthorAgeFilesLines
* avcodec: use HAVE_THREADS header guards to silence -Wunused-functionGanesh Ajjanagadde2015-10-041-0/+2
| | | | | | | | | | When compiled with --disable-pthreads, e.g http://fate.ffmpeg.org/report.cgi?time=20150917015044&slot=alpha-debian-qemu-gcc-4.7, a bunch of -Wunused-functions are reported due to missing header guards around threading related functions. This patch should silence such warnings. Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
* Merge commit '059a934806d61f7af9ab3fd9f74994b838ea5eba'Michael Niedermayer2015-07-271-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '059a934806d61f7af9ab3fd9f74994b838ea5eba': lavc: Consistently prefix input buffer defines Conflicts: doc/examples/decoding_encoding.c libavcodec/4xm.c libavcodec/aac_adtstoasc_bsf.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.h libavcodec/asvenc.c libavcodec/avcodec.h libavcodec/avpacket.c libavcodec/dvdec.c libavcodec/ffv1enc.c libavcodec/g2meet.c libavcodec/gif.c libavcodec/h264.c libavcodec/h264_mp4toannexb_bsf.c libavcodec/huffyuvdec.c libavcodec/huffyuvenc.c libavcodec/jpeglsenc.c libavcodec/libxvid.c libavcodec/mdec.c libavcodec/motionpixels.c libavcodec/mpeg4videodec.c libavcodec/mpegvideo.c libavcodec/noise_bsf.c libavcodec/nuv.c libavcodec/nvenc.c libavcodec/options.c libavcodec/parser.c libavcodec/pngenc.c libavcodec/proresenc_kostya.c libavcodec/qsvdec.c libavcodec/svq1enc.c libavcodec/tiffenc.c libavcodec/truemotion2.c libavcodec/utils.c libavcodec/utvideoenc.c libavcodec/vc1dec.c libavcodec/wmalosslessdec.c libavformat/adxdec.c libavformat/aiffdec.c libavformat/apc.c libavformat/apetag.c libavformat/avidec.c libavformat/bink.c libavformat/cafdec.c libavformat/flvdec.c libavformat/id3v2.c libavformat/isom.c libavformat/matroskadec.c libavformat/mov.c libavformat/mpc.c libavformat/mpc8.c libavformat/mpegts.c libavformat/mvi.c libavformat/mxfdec.c libavformat/mxg.c libavformat/nutdec.c libavformat/oggdec.c libavformat/oggparsecelt.c libavformat/oggparseflac.c libavformat/oggparseopus.c libavformat/oggparsespeex.c libavformat/omadec.c libavformat/rawdec.c libavformat/riffdec.c libavformat/rl2.c libavformat/rmdec.c libavformat/rtpdec_latm.c libavformat/rtpdec_mpeg4.c libavformat/rtpdec_qdm2.c libavformat/rtpdec_svq3.c libavformat/sierravmd.c libavformat/smacker.c libavformat/smush.c libavformat/spdifenc.c libavformat/takdec.c libavformat/tta.c libavformat/utils.c libavformat/vqf.c libavformat/westwood_vqa.c libavformat/xmv.c libavformat/xwma.c libavformat/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-271-4/+4
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-271-4/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'def97856de6021965db86c25a732d78689bd6bb0': lavc: AV-prefix all codec capabilities Conflicts: cmdutils.c ffmpeg.c ffplay.c libavcodec/8svx.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/adpcm.c libavcodec/alac.c libavcodec/atrac3plusdec.c libavcodec/bink.c libavcodec/dnxhddec.c libavcodec/dvdec.c libavcodec/dvenc.c libavcodec/ffv1dec.c libavcodec/ffv1enc.c libavcodec/fic.c libavcodec/flacdec.c libavcodec/flacenc.c libavcodec/flvdec.c libavcodec/fraps.c libavcodec/frwu.c libavcodec/gifdec.c libavcodec/h261dec.c libavcodec/hevc.c libavcodec/iff.c libavcodec/imc.c libavcodec/libopenjpegdec.c libavcodec/libvo-aacenc.c libavcodec/libvorbisenc.c libavcodec/libvpxdec.c libavcodec/libvpxenc.c libavcodec/libx264.c libavcodec/mjpegbdec.c libavcodec/mjpegdec.c libavcodec/mpegaudiodec_float.c libavcodec/msmpeg4dec.c libavcodec/mxpegdec.c libavcodec/nvenc_h264.c libavcodec/nvenc_hevc.c libavcodec/pngdec.c libavcodec/qpeg.c libavcodec/ra288.c libavcodec/rv10.c libavcodec/s302m.c libavcodec/sp5xdec.c libavcodec/takdec.c libavcodec/tiff.c libavcodec/tta.c libavcodec/utils.c libavcodec/v210dec.c libavcodec/vp6.c libavcodec/vp9.c libavcodec/wavpack.c libavcodec/yop.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-4/+4
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-271-8/+8
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615': lavc: AV-prefix all codec flags Conflicts: doc/examples/muxing.c ffmpeg.c ffmpeg_opt.c ffplay.c libavcodec/aacdec.c libavcodec/aacenc.c libavcodec/ac3dec.c libavcodec/ac3enc_float.c libavcodec/atrac1.c libavcodec/atrac3.c libavcodec/atrac3plusdec.c libavcodec/dcadec.c libavcodec/ffv1enc.c libavcodec/h264.c libavcodec/h264_loopfilter.c libavcodec/h264_mb.c libavcodec/imc.c libavcodec/libmp3lame.c libavcodec/libtheoraenc.c libavcodec/libtwolame.c libavcodec/libvpxenc.c libavcodec/libxavs.c libavcodec/libxvid.c libavcodec/mpeg12dec.c libavcodec/mpeg12enc.c libavcodec/mpegaudiodec_template.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_motion.c libavcodec/nellymoserdec.c libavcodec/nellymoserenc.c libavcodec/nvenc.c libavcodec/on2avc.c libavcodec/options_table.h libavcodec/opus_celt.c libavcodec/pngenc.c libavcodec/ra288.c libavcodec/ratecontrol.c libavcodec/twinvq.c libavcodec/vc1_block.c libavcodec/vc1_loopfilter.c libavcodec/vc1_mc.c libavcodec/vc1dec.c libavcodec/vorbisdec.c libavcodec/vp3.c libavcodec/wma.c libavcodec/wmaprodec.c libavcodec/x86/hpeldsp_init.c libavcodec/x86/me_cmp_init.c Merged-by: Michael Niedermayer <michael@niedermayer.cc>
| * lavc: AV-prefix all codec flagsVittorio Giovara2015-07-271-8/+8
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | huffyuvdec: validate image sizeAndreas Cadhalpun2015-06-281-0/+5
| | | | | | | | | | Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* | avcodec/huffyuvdec: apply vertical filter in steps of 1 line for interlaced BGRAMichael Niedermayer2014-11-251-3/+2
| | | | | | | | | | | | | | Fixes out of array read Fixes: signal_sigsegv_3287332_2301_cov_2994954934_huffyuv.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | lavc/huffyuvdec: fix mem leak in case of init failureLukasz Marek2014-11-241-21/+28
| | | | | | | | Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
* | huffyuvdec: avoid large stack use.Reimar Döffinger2014-09-061-6/+13
| | | | | | | | Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
* | huffyuvdec: decode the last odd sampleChristophe Gisquet2014-08-251-4/+22
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: fix old (v1) rgbaChristophe Gisquet2014-08-211-9/+8
| | | | | | | | | | | | | | | | Commit deadcf5e misplaced a hunk. Fixes ticket #3877. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39'Michael Niedermayer2014-08-151-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'f929ab0569ff31ed5a59b0b0adb7ce09df3fca39': cosmetics: Write NULL pointer equality checks more compactly Conflicts: cmdutils.c ffmpeg_opt.c ffplay.c libavcodec/dvbsub.c libavcodec/dvdsubdec.c libavcodec/dvdsubenc.c libavcodec/dxa.c libavcodec/libxvid_rc.c libavcodec/mpegvideo.c libavcodec/mpegvideo_enc.c libavcodec/rv10.c libavcodec/tiffenc.c libavcodec/utils.c libavcodec/vc1dec.c libavcodec/zmbv.c libavdevice/v4l2.c libavformat/matroskadec.c libavformat/movenc.c libavformat/sdp.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * cosmetics: Write NULL pointer equality checks more compactlyGabriel Dume2014-08-151-1/+1
| | | | | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* | avcodec/huffyuvdec: fix overread checksMichael Niedermayer2014-08-111-6/+6
| | | | | | | | | | | | Fixes: ffvhuff_f.avi Found-by: Piotr Bandurski <ami_stuff@o2.pl> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'a7153444df9040bf6ae103e0bbf6104b66f974cb'Michael Niedermayer2014-08-061-2/+5
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'a7153444df9040bf6ae103e0bbf6104b66f974cb': huffyuvdec: check width size for yuv422p Conflicts: libavcodec/huffyuvdec.c See: 6abb9a901fca27da14d4fffbb01948288b5da3ba Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * huffyuvdec: check width size for yuv422pMichael Niedermayer2014-08-051-0/+7
| | | | | | | | | | | | | | | | | | Avoid out of array accesses. CC: libav-stable@libav.org Bug-Id: CVE-2013-0848 Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* | Merge commit 'd0393d79bc3d61c9f2ff832c0e273b7774ff0269'Michael Niedermayer2014-08-041-32/+34
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit 'd0393d79bc3d61c9f2ff832c0e273b7774ff0269': huffyuv: Check and propagate function return values Conflicts: libavcodec/huffyuvdec.c See: f67a0d115254461649470452058fa3c28c0df294 Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * huffyuv: Check and propagate function return valuesDiego Biurrun2014-08-031-44/+61
| | | | | | | | | | | | | | | | | | | | Bug-Id: CVE-2013-0868 inspired by a patch from Michael Niedermayer <michaelni@gmx.at> Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Diego Biurrun <diego@biurrun.de> CC: libav-stable@libav.org
* | Merge commit '6234058148d6e1ee765913b678a22385a87bffac'Michael Niedermayer2014-08-041-2/+2
|\ \ | |/ | | | | | | | | | | * commit '6234058148d6e1ee765913b678a22385a87bffac': huffyuv: Return proper error codes Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * huffyuv: Return proper error codesDiego Biurrun2014-08-031-3/+3
| |
| * huffyuv: Use avpriv_report_missing_feature() where appropriateDiego Biurrun2014-08-031-6/+4
| |
* | Merge commit 'b7616f5716dce68c749d5dfeab19cf595a11807c'Michael Niedermayer2014-08-041-9/+9
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'b7616f5716dce68c749d5dfeab19cf595a11807c': huffyuv: Eliminate some pointless casts Conflicts: libavcodec/huffyuvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * huffyuv: Eliminate some pointless castsDiego Biurrun2014-08-031-6/+6
| |
* | Merge commit 'c065f4a0c652cc569c927c95148111b3aa2962dc'Michael Niedermayer2014-08-041-154/+172
|\ \ | |/ | | | | | | | | | | | | | | | | * commit 'c065f4a0c652cc569c927c95148111b3aa2962dc': huffyuv: K&R formatting cosmetics Conflicts: libavcodec/huffyuvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * huffyuv: K&R formatting cosmeticsDiego Biurrun2014-08-031-156/+178
| |
* | Merge commit 'c67b449bebbe0b35c73b203683e77a0a649bc765'Michael Niedermayer2014-06-231-2/+2
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'c67b449bebbe0b35c73b203683e77a0a649bc765': dsputil: Split bswap*_buf() off into a separate context Conflicts: configure libavcodec/4xm.c libavcodec/ac3dec.c libavcodec/ac3dec.h libavcodec/apedec.c libavcodec/eamad.c libavcodec/flacenc.c libavcodec/fraps.c libavcodec/huffyuv.c libavcodec/huffyuvdec.c libavcodec/motionpixels.c libavcodec/truemotion2.c libavcodec/x86/Makefile libavcodec/x86/dsputil_init.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Split bswap*_buf() off into a separate contextDiego Biurrun2014-06-221-2/+2
| |
* | avcodec/huffyuvdec: do not leave alpha values uninitializedMichael Niedermayer2014-06-181-1/+2
| | | | | | | | | | | | fixes fate failure under valgrind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/huffyuvdec: Fix fill value for truncated bitstreamsMichael Niedermayer2014-06-161-1/+1
| | | | | | | | | | Found-by: Christophe Gisquet <christophe.gisquet@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: use unsafe bitstream readerChristophe Gisquet2014-06-161-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | The reader reads in chunks of 11 bits at most, and at most 3 times. The unsafe reader therefore may read 6 chunks instead of 1 in worst case, ie 8 bytes, which is within the padding tolerance. The reader ends up being ~10% faster. Cumulative effect of unsafe reading and code block swapping on 3 sequences is for 1 thread, decoding time goes from 23.3s to 19.0s. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: remove somewhat deprecated codeChristophe Gisquet2014-06-151-1/+0
| | | | | | | | | | | | | | | | | | | | The old code was reserving the 0xFFFF entry to represent an inexisting entry/codeword. These entries are now detected through their length being <= 0. As this entry is often used for the residuals (-1,-1), which should be among the most frequent, it is particularly important to not reserve it. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/huffyuvdec: assume vlcs can be 32 instead of 31 bits maxMichael Niedermayer2014-06-151-5/+5
| | | | | | | | | | | | This should avoid a division as well Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: swap code blocksChristophe Gisquet2014-06-151-5/+5
| | | | | | | | | | | | | | | | | | | | The effect is not really deterministic, as it seems to be a combination on x86_64 of fewer registers used, different jump offsets and, for all archs, of likely branches. Speedup is around 15%. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: trick for plane decoding <= 14bitsChristophe Gisquet2014-06-061-23/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor the code to minimize code duplication. Before: 130870 decicycles in g, 1048139 runs, 437 skips 10bits: 9.048 12bits: 10.733 After: 126960 decicycles in g, 1048136 runs, 440 skips 10bits: 8.642 12bits: 9.656 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: remove superfluous check in BGR codeChristophe Gisquet2014-06-051-2/+2
| | | | | | | | | | | | | | Before: 154861 decicycles After: 152912 decicycles Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: remove superfluous checkChristophe Gisquet2014-06-051-8/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An invalid entry already has the property of having a negative number of bits, so remove the check on the reserved value, and rearrange the code as a consequence. 346800 decicycles in 422, 262079 runs, 65 skips 168197 decicycles in gray, 262077 runs, 67 skips Overall time: 7.878s 319076 decicycles in 422, 262096 runs, 48 skips 159875 decicycles in gray, 262057 runs, 87 skips Overall time: 7.394s Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: trick for plane decoding, 8bitsChristophe Gisquet2014-06-051-10/+8
| | | | | | | | | | | | 10496 -> 9105 cycles. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: clean up macroChristophe Gisquet2014-06-041-42/+16
| | | | | | | | | | | | | | It's no longer used inside another specific macro, so rename it. Also remove duplicated definition and realign code. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: implement trick for BGRChristophe Gisquet2014-06-041-12/+73
| | | | | | | | | | | | | | | | | | | | | | | | Before: 179436 decicycles in rgb, 32735 runs, 33 skips Stripped object size: 23188 After: 154861 decicycles in rgb, 32738 runs, 30 skips Stripped object size: 22736 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuvdec: implement trickChristophe Gisquet2014-06-041-14/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the joint table does not contain a valid entry, the decoding restarts from scratch. By implementing the trick of jumping to the 2nd level of the individual table (and inlining the whole), a speed improvement of 5-10% is possible. On a 1000-frames YUV4:2:0 video, before: 362851 decicycles in 422, 262094 runs, 50 skips 182488 decicycles in gray, 262087 runs, 57 skips Object size: 23584 Overall time: 8.377 After: 346800 decicycles in 422, 262079 runs, 65 skips 168197 decicycles in gray, 262077 runs, 67 skips Object size: 23188 Overall time: 7.878 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | rename add_hfyu_left_prediction_int16 to add_hfyu_left_pred_int16Michael Niedermayer2014-05-291-1/+1
| | | | | | | | | | | | This makes the naming more consistent with the 8bit variant Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | rename add_hfyu_median_prediction_int16 to add_hfyu_median_pred_int16Michael Niedermayer2014-05-291-1/+1
| | | | | | | | | | | | This makes the naming more consistent with the 8bit variant Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | huffyuv: change left prediction access in BGRAChristophe Gisquet2014-05-291-12/+12
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '0d439fbede03854eac8a978cccf21a3425a3c82d'Michael Niedermayer2014-05-271-35/+37
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '0d439fbede03854eac8a978cccf21a3425a3c82d': dsputil: Split off HuffYUV decoding bits into their own context Conflicts: configure libavcodec/dsputil.c libavcodec/dsputil.h libavcodec/huffyuv.h libavcodec/huffyuvdec.c libavcodec/lagarith.c libavcodec/vble.c libavcodec/x86/Makefile libavcodec/x86/dsputil.asm libavcodec/x86/dsputil_init.c libavcodec/x86/dsputil_mmx.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Split off HuffYUV decoding bits into their own contextDiego Biurrun2014-05-271-32/+34
| | | | | | | | Also shorten HuffYUV context member names to avoid clutter.
* | Merge commit '2f02bbcca050936686482453078e83dc25493da0'Michael Niedermayer2014-03-011-2/+0
|\ \ | |/ | | | | | | | | | | | | | | | | | | * commit '2f02bbcca050936686482453078e83dc25493da0': build: Let the ffvhuff decoder/encoder depend on the huffyuv decoder/encoder Conflicts: configure libavcodec/Makefile Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * build: Let the ffvhuff decoder/encoder depend on the huffyuv decoder/encoderDiego Biurrun2014-02-281-2/+0
| | | | | | | | | | Almost all of the code is shared so there is little point in enabling one decoder/encoder without the other.
* | avcodec/huffyuvdec: use RGB0 for 24bit rgb output instead of BGRAMichael Niedermayer2014-02-181-3/+6
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
OpenPOWER on IntegriCloud