summaryrefslogtreecommitdiff
path: root/libavcodec/h264.h
Commit message (Collapse)AuthorAge
* h264/svq3: Stop using draw_edgesRonald S. Bultje2013-02-19
| | | | | | | | | | | Instead, only extend edges on-demand when the motion vector actually crosses the visible decoded area using ff_emulated_edge_mc(). This changes decoding time for cathedral from 8.722sec to 8.706sec, i.e. 0.2% faster overall. More generally (VP8 uses this also), low-motion content gets significant speed improvements, whereas high-motion content tends to decode in approximately the same time. Signed-off-by: Martin Storsjö <martin@martin.st>
* 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>
* h264: remove silly macrosAnton Khirnov2013-02-06
| | | | | They serve no useful purpose and wreak all kind of havoc when h264.h is included elsewhere.
* dsputil: Separate h264chromaDiego Biurrun2013-02-06
|
* dsputil: Separate h264 qpelMans Rullgard2013-01-24
| | | | | | | | | | The sh4 optimizations are removed, because the code is 100% identical to the C code, so it is unlikely to provide any real practical benefit. Signed-off-by: Diego Biurrun <diego@biurrun.de> Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* 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: avoid pointless copying of ref listsAnton Khirnov2013-01-18
| | | | | | | | ref_list is constructed from other fields per slice when needed, so do not copy it for both frame and slice threading. default_ref_list is constructed per frame and still needs to be copied to per-slice contexts for slice threading, but a copy is not needed for frame threading.
* h264: fix ff_generate_sliding_window_mmcos() prototype.Anton Khirnov2013-01-14
| | | | | | | It's been returning an error value since bad446e251405dc250c3cbee199072e083a1e4b9 Also check for the errors it returns.
* h264: don't clobber mmco opcode tables for non-first slice headers.Ronald S. Bultje2013-01-14
| | | | | | | | | | | | | | | | | | | | | Clobbering these tables will temporarily clobber the template used as a basis for other threads to start decoding from. If the other decoding thread updates from the template right at that moment, subsequent threads will get invalid (or, usually, none at all) mmco tables. This leads to invalid reference lists and subsequent decode failures. Therefore, instead, decode the mmco tables only for the first slice in a field or frame. For other slices, decode the bits and ensure they are identical to the mmco tables in the first slice, but don't ever clobber the context state. This prevents other threads from using a clobbered/invalid template as starting point for decoding, and thus fixes decoding in these cases. This fixes occasional (~1%) failures of h264-conformance-mr1_bt_a with frame-multithreading enabled. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* h264: support frame parameter changes during frame-mtJanne Grunau2012-12-18
| | | | Fixes CVE-2012-2782.
* h264: increase dist_scale_factor for up to 32 referencesJanne Grunau2012-12-18
| | | | | Compute dist_scale_factor_field only for MBAFF since that is the only case in which it is used.
* h264: prevent decoding of slice NALs in extradataJanne Grunau2012-12-18
| | | | | | | | It is not posible to call get_buffer during frame-mt codec initialization. Libavformat might pass huge amounts of data as extradata after parsing broken files. The 'extradata' for the fuzzed sample sample_varPAR_s5374_r001-02.avi is 2.8M large and contains multiple slices.
* mpegvideo: treat delayed pictures as usedJanne Grunau2012-12-13
| | | | | | This requires to move the avcodec_default_free_buffers() call to ff_MPV_common_end() since otherwise delayed pictures would get freed during a size change.
* h264: set parameters from SPS whenever it changesJanne Grunau2012-12-13
| | | | | Fixes a crash in the fuzzed sample sample_varPAR.avi_s26638 with alternating bit depths.
* h264: add a pointer for weighted prediction temporary bufferJanne Grunau2012-12-07
| | | | | Reusing MpegEncContext's obmc_scratchpad for this becomes a mess with adaptive frame-mt.
* h264: K&R formatting cosmetics for header files (part I/II)Diego Biurrun2012-05-10
|
* h264: Factorize declaration of mb_sizes array.Diego Biurrun2012-04-05
|
* h264: Make ff_h264_decode_end() static, it is not used externally.Diego Biurrun2012-03-30
| | | | Also drop the now unnecessary ff_ prefix from its name.
* 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
* Revert "h264: skip start code search if the size of the nal unit is known"Janne Grunau2011-12-19
| | | | This reverts commit 87eebb3454ff0cd6af6ebf9e1d31bdfd1c3b601b.
* h264: skip start code search if the size of the nal unit is knownJanne Grunau2011-12-18
| | | | | | | | Start code emulation prevention is only required in Annex B bytestream packed NAL units. For other coding formats the size is already known. Looking for a start code prefix can result in false positives like in http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4 which has a false positive in the SPS.
* 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: fix frame reordering code.Ronald S. Bultje2011-12-03
| | | | | Fixes fate-h264-conformance-{mr2_tandberg_e,mr3_tandberg_b} without requiring -strict 1.
* h264: improve calculation of codec delay.Ronald S. Bultje2011-11-05
| | | | | | Fixes the following conformance suite samples: HCBP1_HHI_A.264, HCBP2_HHI_A.264, HCMP1_HHI_A.264 (main) HCHP1_HHI_B.264, HCHP2_HHI_A.264, HCHP3_HHI_A.264 (frext)
* 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>
* h264: move fill_decode_neighbors()/fill_decode_caches() to h264_mvpred.hDiego Biurrun2011-07-14
| | | | This fixes a bunch of unused function warnings.
* h264: move decode_mb_skip() from h264.h to h.264_mvpred.hDiego Biurrun2011-07-12
| | | | This resolves a circular dependency between the headers.
* h264: move h264_mvpred.h include.Ronald S. Bultje2011-07-12
| | | | | | | | Fixes the following compile error with darwin/gcc-4.2.1: In file included from libavcodec/error_resilience.c:33: libavcodec/h264.h: In function ‘decode_mb_skip’: libavcodec/h264.h:773: error: ‘always_inline’ function could not be inlined in call to ‘pred_pskip_motion’: the function body must appear before caller libavcodec/h264.h:1334: error: called from here
* 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: merge fill_rectangle into P-SKIP MV prediction, to match B-SKIPJason Garrett-Glaser2011-07-08
|
* H.264: faster P-SKIP decodingJason Garrett-Glaser2011-07-08
| | | | | Inline the relevant parts of fill_decode_caches into P-SKIP mv prediction to avoid calling the whole thing.
* H.264: av_always_inline some more functionsJason Garrett-Glaser2011-07-08
| | | | These weren't getting inlined all the time in all gcc versions.
* H.264: template left MB handlingJason Garrett-Glaser2011-07-03
| | | | Faster H.264 decoding with ALLOW_INTERLACE off.
* H.264: faster fill_decode_cachesJason Garrett-Glaser2011-07-03
| | | | Aliasing avoidance and general cleanup.
* H.264: faster write_back_*Jason Garrett-Glaser2011-07-03
| | | | Avoid aliasing, unroll loops, and inline more functions.
* doxygen: Prefer member groups over grouping into modulesReinhard Tartler2011-07-02
| | | | | | | | | Before this, almost all module groups have been used for grouping functions and fields in structures semantically. This causes them to not appear properly in the file documentation and needlessly clutters up the "Modules" index. Additionally, this commit streamlines some spelling and appearances.
* 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.
* svq3: Move svq3-specific fields to their own context.Baptiste Coudurier2011-06-03
| | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Diego Biurrun <diego@biurrun.de>
* H264/MPEG frame-level multi-threading.Alexander Strange2011-06-02
| | | | Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* 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>
* Eliminate pointless '#if 1' statements without matching '#else'.Diego Biurrun2011-04-26
|
* Replace FFmpeg with Libav in licence headersMans Rullgard2011-03-19
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* h264: Add Intra and Constrained Baseline profiles to avctx.profileJanne Grunau2011-02-01
|
* Make ff_h264_decode_rbsp_trailing static to h264.cDiego Elio Pettenò2011-01-25
| | | | Signed-off-by: Janne Grunau <janne-ffmpeg@jannau.net>