summaryrefslogtreecommitdiff
path: root/libavcodec/speedhq.c
Commit message (Collapse)AuthorAge
* libavcodec/blockdsp : add AVX versionMartin Vignali2017-10-03
| | | | | | | Also modify the required alignment, to 32 instead of 16 for several codecs Signed-off-by: James Almer <jamrial@gmail.com>
* speedhq: fix behavior of single-field decodingSteinar H. Gunderson2017-08-03
| | | | | | | | | | The height convention for decoding frames with only a single field made sense for compatibility with legacy decoders, but doesn't really match the convention used by NDI, which is the primary (only?) user. Thus, change it to simply assuming that if the two fields overlap, the frame is meant to be a single field and the frame height matches the field height. Signed-off-by: James Almer <jamrial@gmail.com>
* speedhq: fix decoding artifactsSteinar H. Gunderson2017-02-21
| | | | | | | | | | | | | | | | The quantization table is stored in the natural order, but when we access it, we use an index that's in zigzag order, causing us to read the wrong value. This causes artifacts, especially in areas with horizontal or vertical edges. The artifacts look a lot like the DCT ringing artifacts you'd expect to see from a low-bitrate file, but when comparing to NewTek's own decoder, it's obvious they're not supposed to be there. Fix by simply storing the scaled quantization table in zigzag order. Performance is unchanged. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* speedhq: fix out-of-bounds writeSteinar H. Gunderson2017-02-02
| | | | | | | | | | | | | Certain alpha run lengths (for SHQ1/SHQ3/SHQ5) could be stored in both long and short versions, and we would only accept the short version, returning -1 (invalid code) for the others. This could cause an out-of-bounds write on malicious input, as discovered by Andreas Cadhalpun during fuzzing. Fix by simply allowing both versions, leaving no invalid codes in the alpha VLC. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
* avcodec/speedhq: Fix warning about "initialization from incompatible pointer ↵Michael Niedermayer2017-01-19
| | | | | | type" Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* speedhq: Align blocks variable properly.Steinar H. Gunderson2017-01-13
| | | | | | | | | Seemingly ff_clear_block_sse assumed that the block array is aligned, so make sure it is. Fixes ticket #6079 Signed-off-by: James Almer <jamrial@gmail.com>
* avcodec: add Newtek SpeedHQ decoderSteinar H. Gunderson2017-01-11
This decoder can decode all existing SpeedHQ formats (SHQ0–5, 7, and 9), including correct decoding of the alpha channel. 1080p is decoded in 142 fps on one core of my i7-4600U (2.1 GHz Haswell), about evenly split between bitstream reader and IDCT. There is currently no attempt at slice or frame threading, even though the format trivially supports both. NewTek very helpfully provided a full set of SHQ samples, as well as source code for an SHQ2 encoder (not included) and assistance with understanding some details of the format.