summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
Commit message (Collapse)AuthorAge
* Replace all CODEC_ID_* with AV_CODEC_ID_*Anton Khirnov2012-08-07
|
* h264: refactor NAL decode loopRonald S. Bultje2012-07-23
| | | | | | | | | | Write out the NAL decoding loops in full so that they are easier to parse for a preprocessor without it having to be aware of macros or other such things in C code. This also makes the code more readable. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* h264: use templates to avoid excessive inliningMans Rullgard2012-07-05
| | | | | | | | | | | | | Instead of inlining everything into ff_h264_hl_decode_mb(), use explicit templating to create versions of the called functions with constant parameters filled in. This greatly speeds up compilation of h264.c and reduces the code size without any measurable impact on performance. Compilation time for h264.c on an i7 goes from 30s to 5.5s. Code size is reduced by 430kB. Signed-off-by: Mans Rullgard <mans@mansr.com>
* misc typo and wording fixesDiego Biurrun2012-07-03
|
* h264: allow cropping to AVCodecContext.width/heightMans Rullgard2012-06-09
| | | | | | | | Override the frame size from the SPS with AVCodecContext values if the latter specify a size smaller by less than one macroblock. This is required for correct cropping of MOV files from Canon cameras. Signed-off-by: Mans Rullgard <mans@mansr.com>
* h264: additional protection against unsupported size/bitdepth changes.Ronald S. Bultje2012-05-02
| | | | | | | Fixes crashes in codepaths not covered by original checks. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* h264: Factorize declaration of mb_sizes array.Diego Biurrun2012-04-05
|
* h264: fix 4:2:2 PCM-macroblocks decodingAnton Mitrofanov2012-04-04
| | | | | | Fixes bug 239. Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
* cosmetics: Consistently place static, inline and av_cold attributes/keywords.Diego Biurrun2012-04-04
|
* h264: drop ff_h264_ prefix from static function ff_h264_decode_rbsp_trailing()Diego Biurrun2012-03-30
|
* 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: fix deadlocks on incomplete reference frame decoding.Ronald S. Bultje2012-03-16
| | | | | | | | | | | | | | | | If decoding a second complementary field, and the first was decoded in our thread, mark decoding of that field as complete. If decoding fails, mark the decoded field/frame as complete. Do not allow switching between field modes or field/frame mode between slices within the same field/frame. Ensure that two subsequent fields cover top/bottom (rather than top/frame, bottom/frame or such nonsense situations). Fixes various deadlocks when decoding samples with errors in reference frames. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* h264: K&R formatting cosmeticsDiego Biurrun2012-03-16
| | | | Also remove some disabled code and fix a few comment typos.
* h264: stricter reference limit enforcement.Ronald S. Bultje2012-03-14
| | | | | | | | | Progressive images can have only 16 references, error out if there are more, since the data is almost certainly corrupt, and the invalid value will lead to random crashes or invalid writes later on. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* h264: improve parsing of broken AVC SPSMichael Niedermayer2012-03-13
| | | | | | | | | | | | Parsing the entire NAL as SPS fixes decoding of some AVC bitstreams with broken escaping. Since the size of the NAL unit is known and checked against the buffer end we can parse it entirely without buffer overreads. Fixes playback of http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4 Signed-off-by: Janne Grunau <janne-libav@jannau.net>
* Revert "h264: clear trailing bits in partially parsed NAL units"Janne Grunau2012-03-12
| | | | | | | | | | | | | This reverts commit 729ebb2f185244b0ff06d48edbbbbb02ceb4ed4e. There was an off-by-one error in the bit mask calculation clearing actually the last valid bit and causing http://bugzilla.libav.org/show_bug.cgi?id=227 The broken sample (Mr_MrsSmith-h264_aac.mp4) the commit was fixing does not work after correcting the off-by-one error. CC: libav-stable@libav.org
* Replace computations of remaining bits with calls to get_bits_left().Alex Converse2012-03-05
|
* Replace AVFrame pointer type punning by proper struct member assignments.Diego Biurrun2012-03-01
|
* Replace AVFrame pointer casts by proper struct member accesses.Diego Biurrun2012-03-01
|
* h264: error out on invalid bitdepth.Ronald S. Bultje2012-03-01
| | | | | | | | Fixes invalid reads while initializing the dequant tables, which uses the bit depth to determine the QP table size. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
* mpegvideo: Add ff_ prefix to nonstatic functionsMartin Storsjö2012-02-15
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* dsputil: Add ff_ prefix to the dsputil*_init* functionsMartin Storsjö2012-02-15
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* 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
* h264: Split h264-test off into a separate file - golomb-test.c.Diego Biurrun2012-01-31
| | | | The new name is more appropriate as only golomb functions are tested.
* h264-test: cleanup: drop timer invocations, commented out code and other cruftDiego Biurrun2012-01-31
|
* h264-test: Remove unused DSP and AVCodec contexts and related init calls.Diego Biurrun2012-01-31
| | | | This also avoids a segfault on startup.
* 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.
* h264-test: Initialize AVCodecContext.av_class.Diego Biurrun2012-01-07
| | | | | | This fixes a segfault on startup. Also remove a commented-out and completely unused variable.
* h264: Only use symbols from the SVQ3 decoder under proper conditionals.Diego Biurrun2012-01-06
| | | | Fixes --disable-everything --enable-decoder=h264 --disable-optimizations.
* h264: return index in buffer on end-of-sequence.Ronald S. Bultje2012-01-03
| | | | | Fixes hangs if the last packet contains an end-of-sequence NAL unit, bug 158.
* Merge some declarations and initializations.Diego Biurrun2012-01-04
| | | | | | This fixes compilation failures related to START_TIMER/STOP_TIMER macros and -Werror=declaration-after-statement. START_TIMER declares variables and thus may not be placed after statements outside of a new block.
* mpegenc: use avctx->slices as number of slicesJanne Grunau2012-01-02
| | | | | | Adds a new member to MpegEncContext to hold the number of used slice contexts. Fixes segfaults with '-threads 17 -thread_type slice' and fate-vsynth{1,2}-mpeg{2,4}thread{,_ilace} with --disable-pthreads.
* h264: Fix a possible overread in decode_nal_units()Alexander Strange2011-12-23
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* h264: clear trailing bits in partially parsed NAL unitsJanne Grunau2011-12-19
| | | | | | | | Trailing bits are likely to be non-zero if the NAL unit is truncated. Clearing the bits make overreads of the bitstream less likely in this case. Fixes playback of http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4 which has a forbidden byte sequence of 0x00 0x00 0x00 in it SPS.
* 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.
* h264: don't drop B-frames after next keyframe on POC reset.Ronald S. Bultje2011-12-16
| | | | | | | The keyframe after a POC reset may not be the first to be returned to the user. Therefore, don't reset the expected next POC once we return a keyframe to the user, but once we know that the next frame in the return-queue is a keyframe.
* lavc: introduce ER_MB_END and ER_MB_ERRORLuca Barbato2011-12-13
| | | | | | Simplify a little error resilience calls Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* 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
|
* lavc: convert error_recognition to err_recognition.Dustin Brody2011-12-12
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* h264: remove useless castMans Rullgard2011-12-12
| | | | Signed-off-by: Mans Rullgard <mans@mansr.com>
* Remove extraneous semicolonsMans Rullgard2011-12-11
| | | | | | These semicolons cause invalid empty top-level declarations. Signed-off-by: Mans Rullgard <mans@mansr.com>
* Fix a bunch of common typos.Diego Biurrun2011-12-11
|
* 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: cap max has_b_frames at MAX_DELAYED_PIC_COUNT - 1.Ronald S. Bultje2011-12-01
| | | | | This prevents frame allocation overflows, and fixed fate-h264-conformance-mr3_tandberg_b with 2 threads.
* h264: add support for decoding planar RGB images.Ronald S. Bultje2011-11-24
|
* avcodec: move some AVCodecContext fields to an internal struct.Justin Ruggles2011-11-19
| | | | | | | | A new field, AVCodecContext.internal is used to hold a new struct AVCodecInternal, which has private fields that are not codec-specific and are used by general libavcodec functions. Moved internal_buffer, internal_buffer_count, and is_copy.
* hwaccel: OS X Video Decoder Acceleration (VDA) support.Sebastien Zwickert2011-11-14
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* 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)