summaryrefslogtreecommitdiff
path: root/libavcodec/dnxhddec.c
Commit message (Collapse)AuthorAge
* avcodec/dnxhddec: Fix runtime error: left shift of negative valueMichael Niedermayer2015-12-04
| | | | | | | Fixes: 2abd25478c62a675f335fac00b467023/asan_static-oob_10aff98_1227_8811480c6ef1e970a7977ceb7e5a9958.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dnxhddec: Disable 12bit by defaultMichael Niedermayer2015-11-29
| | | | | | | | | | | | | The DC VLC table used is too small, fixing this requires a sample, thus request a sample. Some samples are said to work even though the table has the wrong size, thus this is left enabled if the user enables experimental features. Fixes: 2abd25478c62a675f335fac00b467023/asan_static-oob_10aff98_1227_8811480c6ef1e970a7977ceb7e5a9958.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Approved-by: kurosu Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/dnxhddec: Make mb_scan_index a fixed length arrayMichael Niedermayer2015-11-06
| | | | | | | | Fixes null pointer dereference Fixes: 5c9d1a6f74a12763fc7c9dd7834022b9/signal_sigsegv_11f78d9_1461_ecee3c5e7205457498e79b3ffaf21d0c.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhd: interleave AC levels and flagsChristophe Gisquet2015-10-15
| | | | | | | This allows more efficient access to the array as the level and flags are contiguous. Around 4% faster coefficient decoding. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhddec: better support for 4:4:4Christophe Gisquet2015-10-07
| | | | | | | | | | | | | | | | Profiles 1256 & 1270 (currently) signal at the frame header and MB levels the colorspace used, either RGB or YUV. While a MB-level varying colorspace is not supported, whether it is constant can be tracked so as to determine the exact colorspace. This requires having bitdepth and the ACT and 4:4:4 flags, in turn needing the CID. Because setting those before having validated enough things may result in invalid/unset DSP fucntions, setting the bitdepth in the context is delayed. It is not tested against a true RGB sequence, though. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhd: add better support for CIDs 1270 to 1274Jeremy James2015-10-05
| | | | | | | | | | | These are DNxHR profiles with the following properties: - Variable size in a profile (property added in a previous commit), requiring variable-sized macroblock table; - Variable bitdepth, up to 12 bits. - Better validation of buffer sizes and positions Signed-off-by: Christophe Gisquet <christophe.gisquet@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhd: add CID 1270Christophe Gisquet2015-10-05
| | | | | | | | | | This a 4:4:4 10 bits profile, where image size is not fixed by the profile, and which strays a bit outside the old frame header parsing code. Fixes ticket #4581 (DNxHR is not stricly supported, but that sequence is). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhd: add decoder support for DNxHRJeremy James2015-10-05
| | | | | Signed-off-by: Christophe Gisquet <christophe.gisquet@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhddec: Introduce DNXHD_VARIABLEChristophe Gisquet2015-10-05
| | | | | | | Currently not used, but will be used to indicate that a CIDEntry field is not set, because it is variable, and that checks should be adapted. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhddec: cleanup frame header parsingChristophe Gisquet2015-10-05
| | | | | | | Rely more on the actual syntax from the specs (also seen in the encoder code). Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhddec: init scantable once permutation is setChristophe Gisquet2015-10-02
| | | | | | Otherwise, the dsp may change without its permuation being applied. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhddec: use dequantization formula from specsChristophe Gisquet2015-10-02
| | | | | | | | | The current one, while correct, does not yield the best possible results. The specificiations suggest another formula, which results in quality gains in the decoded output from fate tests. This justifies changing said formula. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* dnxhddec: initialize with mb-aligned dimensionsChristophe Gisquet2015-10-02
| | | | | | The coded size is a multiple of the macroblock size, which is 16. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* Merge commit 'c49cbecbae5a42f4ca004197b0118cc50aaaca2e'Hendrik Leppkes2015-09-29
|\ | | | | | | | | | | | | * commit 'c49cbecbae5a42f4ca004197b0118cc50aaaca2e': dnxhddec: Decode and use interlace mb flag Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
| * dnxhddec: Decode and use interlace mb flagChristophe Gisquet2015-09-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bit is 1 in some samples, and seems to coincide with interlaced mbs and CID1260. 2008 specs do not know about it, and maintain qscale is 11 bits. This looks oversized, but may help larger bitdepths. Currently, it leads to an obviously incorrect qscale value, meaning its syntax is shifted by 1. However, reading 11 bits also leads to obviously incorrect decoding: qscale seems to be 10 bits. However, as most profiles still have 11bits qscale, the feature is restricted to the CID1260 profile (this flag is dependent on a higher-level flag located in the header). The encoder writes 12 bits of syntax, last and first bits always 0, which is now somewhat inconsistent with the decoder, but ends up with the same effect (progressive + reserved bit). Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | dnxhddec: add my contributionsChristophe Gisquet2015-09-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: reindent/cosmeticsChristophe Gisquet2015-09-28
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: use unsafe bitstream readerChristophe Gisquet2015-09-28
| | | | | | | | | | | | | | Each line is padded by the format, and errors are now reported and stop the decoding. Around 5% speedup. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: check and report bitstream errorsChristophe Gisquet2015-09-27
| | | | | | | | | | | | | | This only occur when an overrun in coefficient decoding is detected. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: simplify block parsing callsChristophe Gisquet2015-09-27
| | | | | | | | | | | | Fewer arguments, less duplicated code. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: remove unused qscale parameterChristophe Gisquet2015-09-27
| | | | | | | | Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: implement slice multithreadingChristophe Gisquet2015-09-27
| | | | | | | | | | | | | | Around 3x speedup with 4 threads. Maybe more mb lines should be batched per thread, but that's good enough for a first try. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: parse and print adaptive color transformChristophe Gisquet2015-09-26
| | | | | | | | | | | | | | | | | | | | | | | | Indicates a YCbCr->RGB transform at the block level. Although nothing explicitly states it, this would assume the actual content is planar RGB. Currently unsupported, but the one sequence I found using it flagged every mb that way, actually meaning the content was YCbCr, and thus best left to the output format to decide what to do of it. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: proper rule for interlaced mb flagChristophe Gisquet2015-09-26
| | | | | | | | | | | | | | It currently only applies to CID 1260, but this flag is dependent on a higher-level flag located in the header. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: indicate colorspaceChristophe Gisquet2015-09-26
| | | | | | | | | | | | It is supposed to only old BT.709 colorspaces. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | dnxhddec: decode and use interlace mb flagChristophe Gisquet2015-09-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This bit is 1 in some samples, and seems to coincide with interlaced mbs and CID1260. 2008 specs do not know about it, and maintain qscale is 11 bits. This looks oversized, but may help larger bitdepths. Currently, it leads to an obviously incorrect qscale value, meaning its syntax is shifted by 1. However, reading 11 bits also leads to obviously incorrect decoding: qscale seems to be 10 bits. However, as most profiles still have 11bits qscale, the feature is restricted to the CID1260 profile. The encoder writes 12 bits of syntax, last and first bits always 0, which is now somewhat inconsistent with the decoder, but ends up with the same effect (progressive + reserved bit). Partially fixes ticket #4876. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'def97856de6021965db86c25a732d78689bd6bb0'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-27
| | | | | | | | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '7c6eb0a1b7bf1aac7f033a7ec6d8cacc3b5c2615'Michael Niedermayer2015-07-27
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-27
| | | | | | | | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit 'd84429d41e24437536907af1e6b73197ecf3f6db'Michael Niedermayer2015-05-13
|\| | | | | | | | | | | | | * commit 'd84429d41e24437536907af1e6b73197ecf3f6db': dnxhd: Print unknown header when found Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dnxhd: Print unknown header when foundVittorio Giovara2015-05-12
| |
| * dnxhddec: Fix pixel format changeCarl Eugen Hoyos2015-05-01
| | | | | | | | | | | | Regression introduced in 598f7d046cbf306706623210c5baafa3b7cd1df3. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25'Michael Niedermayer2015-04-20
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '6a85dfc830f51f1f5c2d36d4182d265c1ea3ba25': lavc: Replace av_dlog and tprintf with internal macros Conflicts: libavcodec/aacdec.c libavcodec/audio_frame_queue.c libavcodec/bitstream.c libavcodec/dcadec.c libavcodec/dnxhddec.c libavcodec/dvbsubdec.c libavcodec/dvdec.c libavcodec/dvdsubdec.c libavcodec/get_bits.h libavcodec/gifdec.c libavcodec/h264.h libavcodec/h264_cabac.c libavcodec/h264_cavlc.c libavcodec/h264_loopfilter.c libavcodec/h264_refs.c libavcodec/imc.c libavcodec/interplayvideo.c libavcodec/jpeglsdec.c libavcodec/libopencore-amr.c libavcodec/mjpegdec.c libavcodec/mpeg12dec.c libavcodec/mpegvideo_enc.c libavcodec/mpegvideo_parser.c libavcodec/pngdec.c libavcodec/ratecontrol.c libavcodec/rv10.c libavcodec/svq1dec.c libavcodec/vqavideo.c libavcodec/wmadec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-19
| |
* | Merge commit '5980c924e309ae1dde8bd52d9938f94ff02602eb'Michael Niedermayer2015-04-09
|\| | | | | | | | | | | | | * commit '5980c924e309ae1dde8bd52d9938f94ff02602eb': dnxhd: Log the selected profile id Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dnxhd: Log the selected profile idVittorio Giovara2015-04-09
| |
* | lavc/dnxhd: Fix pix_fmt change.Carl Eugen Hoyos2015-03-28
| | | | | | | | Fixes ticket #4400.
* | avcodec/dnxhddec: reset cur_field for non interlaced framesMichael Niedermayer2015-03-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dnxhddec: Reset is_444 if format is not 444Michael Niedermayer2015-03-19
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avcodec/dnxhddec: Check that the frame is interlaced before using cur_fieldMichael Niedermayer2015-03-19
| | | | | | | | | | | | Fixes Ticket4227 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit '1a07df31128da3a0020b66502399989b91770d44'Michael Niedermayer2015-01-29
|\| | | | | | | | | | | | | | | | | | | | | * commit '1a07df31128da3a0020b66502399989b91770d44': DNxHD: Add support for id 1258 (DNx100 960x720@8) Conflicts: Changelog libavcodec/dnxhddata.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * DNxHD: Add support for id 1258 (DNx100 960x720@8)Vittorio Giovara2015-01-29
| | | | | | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* | Merge commit '598f7d046cbf306706623210c5baafa3b7cd1df3'Michael Niedermayer2015-01-29
|\| | | | | | | | | | | | | | | | | | | * commit '598f7d046cbf306706623210c5baafa3b7cd1df3': DNxHD: Simplify pixel format detection Conflicts: libavcodec/dnxhddec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * DNxHD: Simplify pixel format detectionVittorio Giovara2015-01-29
| | | | | | | | Error out in case of unknown values.
* | Merge commit '41e03e284ee7b0d4caa3a5d28681ad46e3105d65'Michael Niedermayer2015-01-29
|\| | | | | | | | | | | | | | | | | | | * commit '41e03e284ee7b0d4caa3a5d28681ad46e3105d65': DNxHD: More verbose error messages Conflicts: libavcodec/dnxhddec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * DNxHD: More verbose error messagesVittorio Giovara2015-01-29
| |
* | avcodec/dnxhddec: treat pix_fmt like width/heightMichael Niedermayer2014-10-29
| | | | | | | | | | | | | | Fixes out of array accesses Fixes: asan_heap-oob_22c9a39_16_015.mxf Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Merge commit 'e3fcb14347466095839c2a3c47ebecff02da891e'Michael Niedermayer2014-07-01
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e3fcb14347466095839c2a3c47ebecff02da891e': dsputil: Split off IDCT bits into their own context Conflicts: configure libavcodec/aic.c libavcodec/arm/Makefile libavcodec/arm/dsputil_init_arm.c libavcodec/arm/dsputil_init_armv6.c libavcodec/asvdec.c libavcodec/dnxhdenc.c libavcodec/dsputil.c libavcodec/dvdec.c libavcodec/dxva2_mpeg2.c libavcodec/intrax8.c libavcodec/mdec.c libavcodec/mjpegdec.c libavcodec/mjpegenc_common.h libavcodec/mpegvideo.c libavcodec/ppc/dsputil_altivec.h libavcodec/ppc/dsputil_ppc.c libavcodec/ppc/idctdsp.c libavcodec/x86/Makefile libavcodec/x86/dsputil_init.c libavcodec/x86/dsputil_mmx.c libavcodec/x86/dsputil_x86.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * dsputil: Split off IDCT bits into their own contextDiego Biurrun2014-06-30
| |