Commit Graph

936 Commits

Author SHA1 Message Date
Ronald S. Bultje 45b7bd7c53 h264: disallow constrained intra prediction modes for luma.
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
2012-02-09 22:57:01 -08:00
Diego Biurrun 631f96f959 h264: Split h264-test off into a separate file - golomb-test.c.
The new name is more appropriate as only golomb functions are tested.
2012-01-31 19:56:12 +01:00
Diego Biurrun 4ff46af039 h264-test: cleanup: drop timer invocations, commented out code and other cruft 2012-01-31 19:56:11 +01:00
Diego Biurrun 3856a2aaa6 h264-test: Remove unused DSP and AVCodec contexts and related init calls.
This also avoids a segfault on startup.
2012-01-31 19:56:09 +01:00
Diego Biurrun 55b9ef18e4 cabac: split cabac.h into declarations and function definitions
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.
2012-01-12 23:08:23 +01:00
Diego Biurrun a7e3cb9d32 h264-test: Initialize AVCodecContext.av_class.
This fixes a segfault on startup.

Also remove a commented-out and completely unused variable.
2012-01-07 22:13:10 +01:00
Diego Biurrun 301fb92131 h264: Only use symbols from the SVQ3 decoder under proper conditionals.
Fixes --disable-everything --enable-decoder=h264 --disable-optimizations.
2012-01-06 13:37:53 +01:00
Ronald S. Bultje 400ba1d735 h264: return index in buffer on end-of-sequence.
Fixes hangs if the last packet contains an end-of-sequence NAL unit,
bug 158.
2012-01-03 19:50:22 -08:00
Diego Biurrun 54e68fb3b8 Merge some declarations and initializations.
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.
2012-01-04 01:28:28 +01:00
Janne Grunau 881a5e047d mpegenc: use avctx->slices as number of slices
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.
2012-01-02 19:20:23 +01:00
Alexander Strange bc6a3bd4a5 h264: Fix a possible overread in decode_nal_units()
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-12-23 08:32:18 +01:00
Janne Grunau 729ebb2f18 h264: clear trailing bits in partially parsed NAL units
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.
2011-12-19 23:14:21 +01:00
Janne Grunau 358ea75e9e Revert "h264: skip start code search if the size of the nal unit is known"
This reverts commit 87eebb3454.
2011-12-19 03:24:32 +01:00
Janne Grunau 87eebb3454 h264: skip start code search if the size of the nal unit is known
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.
2011-12-18 23:52:53 +01:00
Ronald S. Bultje 0b4c323213 h264: don't drop B-frames after next keyframe on POC reset.
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.
2011-12-16 11:24:18 -08:00
Luca Barbato 63ccd46687 lavc: introduce ER_MB_END and ER_MB_ERROR
Simplify a little error resilience calls

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-13 16:20:58 +01:00
Luca Barbato 5bf2ac2b37 error_resilience: use the ER_ namespace
Add the namespace to {AC_,DC_,MV_}{END,ERROR} macros

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-12-13 16:20:58 +01:00
Diego Biurrun 58c42af722 doxygen: misc consistency, spelling and wording fixes 2011-12-12 23:06:23 +01:00
Dustin Brody 5b22d6e132 lavc: convert error_recognition to err_recognition.
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-12-12 19:42:50 +01:00
Mans Rullgard 5695ae46f8 h264: remove useless cast
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-12 00:02:48 +00:00
Mans Rullgard 373211d828 Remove extraneous semicolons
These semicolons cause invalid empty top-level declarations.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-12-11 17:23:24 +00:00
Diego Biurrun da9cea77e3 Fix a bunch of common typos. 2011-12-11 00:32:25 +01:00
Ronald S. Bultje adedd840e2 h264: fix frame reordering code.
Fixes fate-h264-conformance-{mr2_tandberg_e,mr3_tandberg_b} without
requiring -strict 1.
2011-12-03 08:24:27 -08:00
Ronald S. Bultje 2574f08d4c h264: cap max has_b_frames at MAX_DELAYED_PIC_COUNT - 1.
This prevents frame allocation overflows, and fixed
fate-h264-conformance-mr3_tandberg_b with 2 threads.
2011-12-01 12:46:28 -08:00
Ronald S. Bultje db431f7efe h264: add support for decoding planar RGB images. 2011-11-24 08:25:36 -08:00
Justin Ruggles f3a29b750a avcodec: move some AVCodecContext fields to an internal struct.
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.
2011-11-19 10:01:05 -05:00
Sebastien Zwickert ac3dbb4d58 hwaccel: OS X Video Decoder Acceleration (VDA) support.
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2011-11-14 16:07:32 +01:00
Ronald S. Bultje ea2bb12e3e h264: improve calculation of codec delay.
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)
2011-11-05 06:58:52 -07:00
Anton Mitrofanov 640d5f1c80 Fix decoding of lossless 4:2:2 H.264
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-10-28 23:37:30 -07:00
Anton Mitrofanov fdb5314ea7 Fix decoding of lossless 10-bit 4:4:4 H.264
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-10-28 23:37:30 -07:00
Anton Khirnov acffe45732 mpegvideo: remove some unused variables from MpegEncContext. 2011-10-23 14:13:40 +02:00
Dustin Brody 9abc98737f lavc: replace references to deprecated AVCodecContext.error_recognition to use AVCodecContext.err_recognition
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-22 14:49:55 +02:00
Ronald S. Bultje 27209bb108 h264: mark some MC functions with av_always_inline instead of inline.
This actually causes them to be inlined, leading to a significant
speedup (1-1.5% in my measurements).
2011-10-21 01:05:10 -07:00
Ronald S. Bultje 05fb63f5a0 H264: have hl_motion() and its callees take a chroma_idc argument. 2011-10-21 01:05:07 -07:00
Ronald S. Bultje c2d337429c H264: change weight/biweight functions to take a height argument.
Neon parts by Mans Rullgard <mans@mansr.com>.
2011-10-21 01:00:45 -07:00
Ronald S. Bultje 229d263cc9 Support for lossless and inter H264 4:2:2. 2011-10-21 01:00:45 -07:00
Baptiste Coudurier 76741b0e56 h264: 4:2:2 intra decoding support
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-10-21 01:00:41 -07:00
Steven Walters 27237d524e w32threads: support for frame multithreading
Replace our incomplete w32threads implementation with x264's pthreads
w32threads wrapper.
Relicensed to LGPL with kind permission by Pegasys Inc.

Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-16 21:45:16 +02:00
Mans Rullgard 318efbfc10 h264: change unsupported bit depth message to error level
Unsupported bit depth is certainly an error the user will
want to know about.

Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-12 12:39:52 +01:00
Laurent Aimar 4c7a232fc8 h264: reset h->ref_count in case of errors in ff_h264_decode_ref_pic_list_reordering()
Signed-off-by: Janne Grunau <janne-libav@jannau.net>
2011-10-10 21:37:36 +02:00
Mans Rullgard 4d1418cd4f h264: fix signed overflows in x*0x01010101 expressions
Signed-off-by: Mans Rullgard <mans@mansr.com>
2011-10-09 12:27:19 +01:00
Michael Niedermayer 14c21c1ff5 H264: Only wait before triggering ff_thread_setup_complete() until the next slice that contains a start-of-field/frame macroblock
This allows concurrent decoding of the last field/frame, rather than
only the last slice, of data packets with multiple NAL units packed
together.

This will fix the slowdown reported in e.g. bug 52.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-10-07 14:23:26 +02:00
Ronald S. Bultje 4418aa9cb3 h264: correct implicit_weight for field-interlaced pictures. 2011-10-05 04:01:23 -07:00
Laurent Aimar d1186ff72d h264: check for out of bounds reads in ff_h264_decode_extradata().
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2011-09-25 15:04:58 +02:00
Diego Biurrun 95a06eb4d5 Fix assert() calls that need updates after FF_COMMON_FRAME macro elimination.
This fixes build failures with -DDEBUG in CPPFLAGS.
2011-09-21 09:57:32 +02:00
Luca Barbato 22141917a9 Revert "h264: Properly set coded_{width, height} when parsing H.264."
This reverts commit b47904d158.

coded_{width, height} overwrites width and height in avcodec_open and
it currently just report the non-lowres size.
2011-08-29 18:32:31 +02:00
Jeff Downs 6581e161c5 h264: fix PCM intra-coded blocks in monochrome case
Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-08-19 16:02:33 +02:00
Jeff Downs 87cf70eb23 h264: correct implicit weight table computation for long ref pics
Correct computation of implicit weight tables when referencing pictures
that are marked for long reference.

Signed-off-by: Diego Biurrun <diego@biurrun.de>
2011-08-19 14:36:52 +02:00
Dustin Brody bac3ab13ea h264: notice memory allocation failure
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-08-11 15:59:07 -07:00
Dustin Brody 12fe759423 h264: propagate error return values for AV_LOG_ERROR-triggering events
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2011-08-09 12:29:13 -07:00