summaryrefslogtreecommitdiff
path: root/libavcodec/h264_cabac.c
Commit message (Collapse)AuthorAge
...
* h264: Don't store intra pcm samples in h->mbRonald S. Bultje2013-02-19
| | | | | | | | | Instead, keep them in the bitstream buffer until we read them verbatim, this saves a memcpy() and a subsequent clearing of the target buffer. decode_cabac+decode_mb for a sample file (CAPM3_Sony_D.jsv) goes from 6121.4 to 6095.5 cycles, i.e. 26 cycles faster. Signed-off-by: Martin Storsjö <martin@martin.st>
* h264: deMpegEncContextizeAnton Khirnov2013-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Most of the changes are just trivial are just trivial replacements of fields from MpegEncContext with equivalent fields in H264Context. Everything in h264* other than h264.c are those trivial changes. The nontrivial parts are: 1) extracting a simplified version of the frame management code from mpegvideo.c. We don't need last/next_picture anymore, since h264 uses its own more complex system already and those were set only to appease the mpegvideo parts. 2) some tables that need to be allocated/freed in appropriate places. 3) hwaccels -- mostly trivial replacements. for dxva, the draw_horiz_band() call is moved from ff_dxva2_common_end_frame() to per-codec end_frame() callbacks, because it's now different for h264 and MpegEncContext-based decoders. 4) svq3 -- it does not use h264 complex reference system, so I just added some very simplistic frame management instead and dropped the use of ff_h264_frame_start(). Because of this I also had to move some initialization code to svq3. Additional fixes for chroma format and bit depth changes by Janne Grunau <janne-libav@jannau.net> Signed-off-by: Anton Khirnov <anton@khirnov.net>
* Drop DCTELEM typedefDiego Biurrun2013-01-22
| | | | | | It does not help as an abstraction and adds dsputil dependencies. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* h264: don't touch H264Context->ref_count[] during MB decodingRonald S. Bultje2012-10-05
| | | | | | | | | The variable is copied to subsequent threads at the same time, so this may cause wrong ref_count[] values to be copied to subsequent threads. This bug was found using TSAN. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* avcodec: Convert some commented-out printf/av_log instances to av_dlogDiego Biurrun2012-10-01
|
* avcodec: Drop some silly commented-out av_log() invocationsDiego Biurrun2012-10-01
|
* h264: use asm cabac reader under a generic conditionMans Rullgard2012-06-23
| | | | | | | | This removes a dependency on implementation details from generic code and allows easy addition of the equivalent optimisation for other architectures than x86. Signed-off-by: Mans Rullgard <mans@mansr.com>
* h264: new assembly version of get_cabac for x86_64 with PICRoland Scheidegger2012-04-28
| | | | | | | | | | This adds a hand-optimized assembly version for get_cabac much like the existing one, but it works if the table offsets are RIP-relative. Compared to the non-RIP-relative version this adds 2 lea instructions and it needs one extra register. get_cabac() gets about 40% faster, for an overall speedup of about 5%. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* h264: use one table instead of several for cabac functionsRoland Scheidegger2012-04-28
| | | | | | | | | | | | | The reason is this is easier for PIC code (in particular on darwin...). Keep the old names as pointers (static in cabac_functions.h so gcc knows these are just immediate offsets) so the c code can nicely stay the same (alternatively could use offsets directly in the functions needing the tables). This should produce the same code as before with non-pic and better code (confirmed) with pic. The assembly uses the new table but still won't work for PIC case. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* h264: Factorize declaration of mb_sizes array.Diego Biurrun2012-04-05
|
* h264: fix cabac-on-stack after safe cabac reader.Ronald S. Bultje2012-03-28
|
* h264: prevent overreads in intra PCM decoding.Ronald S. Bultje2012-02-29
| | | | | Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* h264: disallow constrained intra prediction modes for luma.Ronald S. Bultje2012-02-09
| | | | | | | | | | | Conversion of the luma intra prediction mode to one of the constrained ("alzheimer") ones can happen by crafting special bitstreams, causing a crash because we'll call a NULL function pointer for 16x16 block intra prediction, since constrained intra prediction functions are only implemented for chroma (8x8 blocks). Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* cabac: split cabac.h into declarations and function definitionsDiego Biurrun2012-01-12
| | | | | | | | | | | This fixes standalone compilation of some decoders with --disable-optimizations. cabac.h defines some inline functions that use symbols from cabac.c. Without optimizations these inline functions are not eliminated and linking fails with references to non-existing symbols. Splitting the inline functions off into their own header and only #including it in the places where the inline functions are used allows #including cabac.h from anywhere without ill effects.
* x86: Fix constraints for decode_significance*_x86Martin Storsjö2011-12-27
| | | | | | | | | | | | | | | | | | | Originally, prior to 8742a4ff8, the caller code was compiled within this condition: ARCH_X86 && HAVE_7REGS && HAVE_EBX_AVAILABLE && !defined(BROKEN_RELOCATIONS) Since HAVE_7REGS is defined as (ARCH_X86_64 || (HAVE_EBX_AVAILABLE && HAVE_EBP_AVAILABLE)) the subcondition HAVE_7REGS && HAVE_EBX_AVAILABLE is equal to HAVE_7REGS (for 32 bit at least). The correct simplification of the original condition thus is HAVE_7REGS, not HAVE_EBX_AVAILABLE. This fixes compilation in some cases where HAVE_EBP_AVAILABLE = 0 and HAVE_EBX_AVAILABLE = 1. Signed-off-by: Martin Storsjö <martin@martin.st>
* x86: Tighten register constraints for decode_significance*_x86.Diego Biurrun2011-12-21
| | | | | | | On 32-bit OS X with gcc 4.0/4.2 and shared libraries enabled, the ebx register is not available, but required to assemble the functions. This reverts commit 8742a4f to a simplified version of the original constraints.
* h264_cabac: synchronize decode_significance_*_x86 conditionalsDiego Biurrun2011-12-21
| | | | The definition and the call site where under different #ifdefs.
* error_resilience: use the ER_ namespaceLuca Barbato2011-12-13
| | | | | | Add the namespace to {AC_,DC_,MV_}{END,ERROR} macros Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* doxygen: misc consistency, spelling and wording fixesDiego Biurrun2011-12-12
|
* h264: 4:2:2 intra decoding supportBaptiste Coudurier2011-10-21
| | | | | Signed-off-by: Diego Biurrun <diego@biurrun.de> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* H.264: optimize CABAC x86 asm for AtomJason Garrett-Glaser2011-07-28
|
* Eliminate FF_COMMON_FRAME macro.Diego Biurrun2011-07-11
| | | | | FF_COMMON_FRAME holds the contents of the AVFrame structure and is also copied to struct Picture. Replace by an embedded AVFrame structure in struct Picture.
* H.264: use fill_rectangle in CABAC decodingJason Garrett-Glaser2011-07-08
|
* H.264: template left MB handlingJason Garrett-Glaser2011-07-03
| | | | Faster H.264 decoding with ALLOW_INTERLACE off.
* H.264: faster write_back_*Jason Garrett-Glaser2011-07-03
| | | | Avoid aliasing, unroll loops, and inline more functions.
* 4:4:4 H.264 decoding supportJason Garrett-Glaser2011-06-13
| | | | Note: this is 4:4:4 from the 2007 spec revision, not the previous (now deprecated) 4:4:4 mode in H.264.
* Roll back 4:4:4 H.264 for nowJason Garrett-Glaser2011-06-13
| | | | Needs some ARM/PPC asm modifications.
* 4:4:4 H.264 decoding supportJason Garrett-Glaser2011-06-13
| | | | Note: this is 4:4:4 from the 2007 spec revision, not the previous (now deprecated) 4:4:4 mode in H.264.
* Add support for higher QP values in h264.Oskar Arvidsson2011-05-10
| | | | | | | | In high bit depth, the QP values may now be up to (51 + 6*(bit_depth-8)). Preparatory patch for high bit depth h264 decoding support. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Add the notion of pixel size in h264 related functions.Oskar Arvidsson2011-05-10
| | | | | | | | | | In high bit depth the pixels will not be stored in uint8_t like in the normal case, but in uint16_t. The pixel size is thus 1 in normal bit depth and 2 in high bit depth. Preparatory patch for high bit depth h264 decoding support. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* Replace deprecated FF_*_TYPE symbols with AV_PICTURE_TYPE_*.Stefano Sabatini2011-05-02
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Revert 2a1f431d38ea9c05abb215d70c7dc09cdb6888ab, it broke H264 lossless.Ronald S. Bultje2011-01-20
|
* Set gray (128) U/V planes for chroma-less samples. Fixes two fate samplesRonald S. Bultje2011-01-20
| | | | when played with -flags emu_edge.
* Remove evil timers that snuck their way into r26375.Jason Garrett-Glaser2011-01-15
| | | | Originally committed as revision 26377 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Fix r26375 on non-x86.Jason Garrett-Glaser2011-01-15
| | | | Originally committed as revision 26376 to svn://svn.ffmpeg.org/ffmpeg/trunk
* H.264: Partially inline CABAC residual decodingJason Garrett-Glaser2011-01-15
| | | | | | | | | | Improves CABAC performance about ~1.2%. Trick originates from x264 and has also been used in ffvp8. It's useful because coded block flags are usually zero, so it helps to have the early termination inlined into the main function. Originally committed as revision 26375 to svn://svn.ffmpeg.org/ffmpeg/trunk
* H.264/SVQ3: make chroma DC work the same way as luma DCJason Garrett-Glaser2011-01-15
| | | | | | | No speed improvement, but necessary for some future stuff. Also opens up the possibility of asm chroma dc idct/dequant. Originally committed as revision 26349 to svn://svn.ffmpeg.org/ffmpeg/trunk
* H.264: switch to x264-style tracking of luma/chroma DC NNZJason Garrett-Glaser2011-01-14
| | | | | | | Useful so that we don't have to run the hierarchical DC iDCT if there aren't any coefficients. Opens up some future opportunities for optimization as well. Originally committed as revision 26337 to svn://svn.ffmpeg.org/ffmpeg/trunk
* H.264: split luma dc idct out and implement MMX/SSE2 versionsJason Garrett-Glaser2011-01-14
| | | | | | | | | | About 2.5x the speed. NOTE: the way that the asm code handles large qmuls is a bit suboptimal. If x264-style dequant was used (separate shift and qmul values), it might be possible to get some extra speed. Originally committed as revision 26336 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove explicit filename from Doxygen @file commands.Diego Biurrun2010-04-20
| | | | | | | | Passing an explicit filename to this command is only necessary if the documentation in the @file block refers to a file different from the one the block resides in. Originally committed as revision 22921 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Replace @returns by @return.Benoit Fouet2010-03-30
| | | | Originally committed as revision 22729 to svn://svn.ffmpeg.org/ffmpeg/trunk
* h264: Use + instead of | in some placesAlexander Strange2010-03-26
| | | | | | 6 insns less on x86-64/gcc 4.2. Originally committed as revision 22692 to svn://svn.ffmpeg.org/ffmpeg/trunk
* h264: Remove unused function argumentAlexander Strange2010-03-26
| | | | Originally committed as revision 22690 to svn://svn.ffmpeg.org/ffmpeg/trunk
* h264: Simplify decode_cabac_residual() specializationAlexander Strange2010-03-26
| | | | | | Gives more consistent inlining with some compilers (such as llvm). Originally committed as revision 22689 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Remove some unneeded fill_rectangle() for 16x16 blocks.Michael Niedermayer2010-02-28
| | | | Originally committed as revision 22124 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Optimize (amvd>2)+(amvd>32), about 1 cpu cycles faster.Zhou Zongyi2010-02-26
| | | | | | patch by Zhou Zongyi @ zhouzy () os punkt pku dot edu speck cn Originally committed as revision 22084 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Change mvd_cache & mvd_table to 8bit, this is overall a bit fasterMichael Niedermayer2010-02-24
| | | | | | | for high resolution videos. about 20cycles faster per MB for cathederal. Originally committed as revision 22038 to svn://svn.ffmpeg.org/ffmpeg/trunk
* Calculate mvd without abs()Michael Niedermayer2010-02-24
| | | | | | same speed (ask gcc why, i dont know) Originally committed as revision 22035 to svn://svn.ffmpeg.org/ffmpeg/trunk
* switch back to (amvd>2)+(amvd>32), its 5 cpu cycles faster now.Michael Niedermayer2010-02-24
| | | | Originally committed as revision 22032 to svn://svn.ffmpeg.org/ffmpeg/trunk