Commit Graph

1006 Commits

Author SHA1 Message Date
Michael Niedermayer 2ed7e353bd h264: Workaround invalid flag combinations of 8x8 inference.
Fixes Ticket555

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-15 15:38:10 +02:00
Michael Niedermayer 0a23067ab4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  mpeg4dec: use unsigned type for startcode in ff_mpeg4_decode_picture_header
  mpeg124: use sign_extend() function
  ac3dec: use get_sbits() instead of manually sign-extending
  4xm: fix signed overflow
  wmavoice: fix a signed overflow
  mpegvideo_enc: fix a signed overflow
  crc: fix signed overflow
  fate: run avconv with -nostats flag
  avtools: add -v as alias for -loglevel
  avconv: always print stats with AV_LOG_INFO
  doc/avconv: add forgotten output/per-stream info to -filter
  avconv: add -stats option to enable/disable printing encoding progress
  avconv: in output_packet() don't set decoded_data_size for video.
  avconv: remove pointless always true condition
  avconv: factorize common code in transcode_init()
  zmbv: remove memcpy() of decoded frame
  mpeg12enc: use sign_extend() function
  h264pred: use unsigned types for pixel values, fix signed overflows
  h264: fix signed overflows in x*0x01010101 expressions
  h264pred: remove unused variables

Conflicts:
	avconv.c
	tests/fate-run.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-10 03:50:58 +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
Themaister a3e11fa43c Start adding pixel definitions for planar rgb. 2011-10-08 23:19:14 +02:00
Michael Niedermayer 9b47173545 Merge remote-tracking branch 'qatar/master'
* qatar/master: (24 commits)
  mpegps: Use av_get_packet() instead of poorly emulating it.
  motionpixels: decode only the 111 complete frames for fate
  mpc8: Check out of bound bands limit
  xan: Prevent NULL dereference with missing palette
  xan: Check for out of bound reads in xan_huffman_decode()
  xan: Fixed out of bound accesses in xan_unpack()
  motionpixels: Prevent calling init_vlc() with invalid parameters
  shorten: Fix out of bound writes in fix_bitshift()
  dsicinav: Check for out of bounds writes
  tiertexseqv: Check for out of bound reads
  quickdraw: Check for out of bound reads
  dsicinav: Check for out of bounds reads
  motionpixels: Fix the size of workspace buffers
  motionpixels: Clear FF_INPUT_BUFFER_PADDING_SIZE bytes at the end of the temporary buffer
  wmavoice: Check for corrupted extra data
  wmavoice: Check for out of bound writes
  xan: Prevent NULL dereferences with missing reference frame
  bink: Prevent NULL dereferences with missing reference frame
  wavpack: Reset internal state on corrupted blocks
  wmapro: Validate the number of audio channels before using it
  ...

Conflicts:
	libavcodec/h264.c
	libavcodec/xan.c
	tests/ref/fate/motionpixels

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-08 03:39:01 +02:00
Michael Niedermayer 74f77eb048 H264: set colorspace and full range to values indicating unspecified by default
Code based on ffdshow
Author unknown

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-08 03:13:21 +02: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
Michael Niedermayer 86602d1c79 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  vp6: Reset the internal state when aborting key frames header parsing
  vp56: Release old pictures after a resolution changes
  vp6: Check for huffman tree build errors
  vp56: Check for missing reference frame data
  cinepak: Fix invalid read access on extra data
  vmd: fix segfaults on corruped streams
  cook: Fix js_vlc_bits value validation for joint stereo
  segafilm: Check for memory allocation failures in segafilm demuxer.
  segafilm: Fix potential division by 0 on corrupted streams in the demuxer
  Fixed segfault on corrupted sega streams in the demuxer.
  Fixed deference of NULL pointer in motionpixels decoder.
  libx264: support 9- and 10-bit output.
  h264: correct implicit_weight for field-interlaced pictures.
  mpegvideo: set correct offset for edge emulation buffer.
  mpegvideo: fix position of bottom edge.

Conflicts:
	libavcodec/motionpixels.c
	libavcodec/mpegvideo.c
	libavcodec/version.h
	libavcodec/vmdav.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-07 03:38:50 +02:00
Laurent Aimar 5ec55d216e h264: reject unsupported 422 9 bit streams
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-07 00:57:05 +02:00
Ronald S. Bultje 4418aa9cb3 h264: correct implicit_weight for field-interlaced pictures. 2011-10-05 04:01:23 -07:00
Laurent Aimar 0333d234b0 h264: do not let invalid values in h->ref_count after a decoder reset.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-05 00:07:39 +02:00
Laurent Aimar 253d18b352 h264: bit depth/chroma idc changes must go through a full format negociation.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-05 00:07:39 +02:00
Laurent Aimar a51fbb56bb h254: explicitly initialize bit depth/chroma idc
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-05 00:07:39 +02:00
Michael Niedermayer eaa21b6870 H264: hotfix for speedloss on frame threading and h264 files with slices.
This fix is not ideal as it still limits the multithreading on field pictures
to the 2nd field only.
Ill try to fix it properly to allow both fields to decode concurrently but this
needs more work.

This bug exists since and was caused by:
commit ea6331f8bb
Author: Ronald S. Bultje <rsbultje@gmail.com>
Date:   Mon Jun 20 10:24:33 2011 -0400

    h264-mt: fix deadlock in packets with multiple slices (e.g. MP4).
2011-10-04 00:26:18 +02:00
Laurent Aimar a4fd95b5d5 h264: fix intra 16x16 mode check when using mbaff and constrained_intra_pred.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-02 21:20:57 +02:00
Laurent Aimar 2428b53f6d h264: do not let invalid values in h->ref_count on ff_h264_decode_ref_pic_list_reordering() errors.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-02 16:48:58 +02:00
Michael Niedermayer 3af2de76ac h264: set unused ref_counts to 0 as a precautionary meassure.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-02 00:45:41 +02:00
Michael Niedermayer c9c7a776db h264: try reading SPS with wrong escaping, it sometimes works better
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-10-01 17:59:27 +02:00
Michael Niedermayer dc9ce40069 h264: More correct ref_count check in decode_slice_header()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-28 22:28:47 +02:00
Michael Niedermayer 5a6e7771ed h264: dont set key_frame when the frame is not a real keyframe.
Fixes Ticket514

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-28 03:47:39 +02:00
Michael Niedermayer f85c9b7771 h264dec: fix decoding problems introduced with baad01d8b4.
This affected cases where extradata was not set.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-25 23:51:32 +02:00
Alexander Strasser baad01d8b4 h264: improve checks before calling ff_h264_decode_extradata
The ff_h264_decode_extradata routine now checks for the buffer size
and pointer internally. This makes it possible to remove the external
checks in ff_h264_decode_init.

  In decode_frame there was a size check missing because the buffer
gets tested prior to the invocation of ff_h264_decode_extradata().

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2011-09-25 17:16:44 +02:00
Alexander Strasser 715f259bf9 h264: ff_h264_decode_extradata: check buffer args
The buffer size and pointer were not checked prior to testing the first
byte of the buffer. These were sometimes checked before calling, but it is
better to add it inside the function as it takes buf and size arguments.

Signed-off-by: Alexander Strasser <eclipse7@gmx.net>
2011-09-25 17:16:44 +02: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
Laurent Aimar 57764c6996 h264: Check for out of bounds reads in ff_h264_decode_extradata().
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-24 16:54:16 +02:00
Michael Niedermayer 9b73fbcff6 h264dec: Decode in stream avc extradata.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-23 06:01:45 +02:00
Michael Niedermayer 4ba396834d h264: pass buffer & size to ff_h264_decode_extradata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-23 06:01:45 +02:00
Michael Niedermayer 3e1a7ae44a Merge remote-tracking branch 'qatar/master'
* qatar/master:
  swfdec: Add support for sample_rate_code 0 (5512 Hz)
  dct-test: factor out some common code and do whas was likely intended
  doc: library versions need to be bumped in version.h
  Revert "ffmpeg: get rid of useless AVInputStream.nb_streams."
  Remove some forgotten AVCodecContext.palctrl usage.
  lavc/utils: move avcodec_init() higher in the file.
  lavc: replace some deprecated FF_*_TYPE with AV_PICTURE_TYPE_*
  ac3dec: actually use drc_scale private option
  lavc: undeprecate AVPALETTE_SIZE and AVPALETTE_COUNT macros
  alsa: add missing header
  msmpeg4: remove leftover unused debug variable declaration
  Fix assert() calls that need updates after FF_COMMON_FRAME macro elimination.
  Fix av_dlog invocations with wrong or missing logging context.
  vf_yadif: add support to yuva420p
  vf_yadif: correct documentation on the parity parameter
  vf_yadif: copy buffer properties like aspect for second frame as well
  oma: support for encrypted files
  id3v2: add support for non-text and GEOB type tag frames
  des: add possibility to calculate DES-CBC-MAC with small buffer

Conflicts:
	ffmpeg.c
	libavcodec/dct-test.c
	libavformat/mpegts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-21 21:25:43 +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
Michael Niedermayer 4832ed4c62 h264: do not increase recovery frame which would lead to endless moving away of the recovery point.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-20 02:52:17 +02:00
Michael Niedermayer a8a9844a3c h264: reset recovery frame on seeks.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-20 02:52:17 +02:00
John Stebbins 53e37840bf calculate frame_num for recovery point "keyframe"
recovery points that have non-zero recovery_frame_cnt resulted in
flagging incomplete frames as keyframes. This delays setting the
keyframe flag till the frame has been fully constructed.
2011-09-18 23:13:50 +02:00
Michael Niedermayer ba5ff1b31e h264dec: add forgotten copying of h->sync
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-18 21:53:30 +02:00
Michael Niedermayer 0812ad01c8 h264dec: Support CODEC_FLAG2_SHOW_ALL.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-18 15:33:50 +02:00
Michael Niedermayer a64b028aeb h264dec: Dont display trash before a keyframe.
Fixes Ticket472
This may (or may not) cause problems with files that have no keyframes.
Plese open a bugreport or mail me if you have a file for which this fails.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-17 21:20:44 +02:00
Michael Niedermayer 205c13685f h264: allow disabling bitstream overread protection by using the fast flag.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-14 20:48:00 +02:00
Michael Niedermayer 716c1f7b2a h264: improve MAX_SLICES too small check so it gives less false positives.
Fixes Ticket273

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-12 06:07:58 +02:00
Michael Niedermayer ea0ac11e52 h264: prevent an out of array read in decode_nal_units()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-11 07:23:00 +02:00
Michael Niedermayer 23f5cff92c h264dec: Prevent CABAC and CAVLC bitsteram overreading
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-09-11 04:57:46 +02:00
Michael Niedermayer 66ce282df5 h264: clean all non null elements of delayed_pic[]
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-31 05:04:14 +02:00
Michael Niedermayer b955ab2f49 h264: change MAX_DELAYED_PIC_COUNT check to av_assert0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-31 05:00:39 +02:00
Michael Niedermayer db5effe1a4 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  Revert "h264: Properly set coded_{width, height} when parsing H.264."
  isom: add missing AVC-Intra tags, rearrange list and update comments
  avconv: remove stubs of crop* and pad* options
  avconv: re-add nb_streams to InputFile.

Conflicts:
	avconv.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-29 22:24:01 +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
Michael Niedermayer 13e9a0fbfb h264: fixup indention
issue spoted in last merge (probably indention fixed there by diego)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-20 00:38:26 +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
Michael Niedermayer ada49f936e Merge remote-tracking branch 'qatar/master'
* qatar/master:
  h264: correct implicit weight table computation for long ref pics
  h264: correct the check for invalid long term frame index in MMCO decode

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-19 15:07:12 +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
Baptiste Coudurier 231a6df9ea h264dec: h264: 4:2:2 intra decoding
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-15 00:39:55 +02:00
Michael Niedermayer 0cb233cf46 Merge commit 'b2c087871dafc7d030b2d48457ddff597dfd4925'
* commit 'b2c087871dafc7d030b2d48457ddff597dfd4925':
  Move x86util.asm from libavcodec/ to libavutil/.
  Move x86inc.asm to libavutil/.
  APIchanges: note error_recognition in lavf
  lavf: add support for error_recognition, use it in avidec, and bump minor API version
  avconv: change semantics of -map
  avconv: get rid of new* options.
  cmdutils: allow precisely specifying a stream for AVOptions.
  configure: add missing CFLAGS to fix building on the HURD
  libx264: Include hint for possible values for configuring libx264
  cmdutils: allow ':'-separated modifiers in option names.
  avconv: make -map_metadata work consistently with the other options
  avconv: remove deprecated options.
  avconv: make -map_chapters accept only the input file index.
  Make a copy of ffmpeg under a new name -- avconv.
  ffmpeg: add a warning stating that the program is deprecated.
  Add weighted motion compensation for RV40 B-frames
  RV3/4: calculate B-frame motion weights once per frame
  Move RV3/4-specific DSP functions into their own context
  mjpeg: propagate decode errors from ff_mjpeg_decode_sos and ff_mjpeg_decode_dqt
  h264: notice memory allocation failure

Conflicts:
	.gitignore
	Makefile
	cmdutils.c
	configure
	doc/ffplay.texi
	doc/ffprobe.texi
	doc/ffserver.texi
	libavcodec/libx264.c
	libavformat/avformat.h
	libavformat/avidec.c
	libavformat/version.h
	tests/lavf-regression.sh
	tests/lavfi-regression.sh

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2011-08-13 02:56:08 +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