Commit Graph

116 Commits

Author SHA1 Message Date
Michael Niedermayer 983c7f4015 Merge commit 'ee6280ca12696a67535ce2245c77190edc513794'
* commit 'ee6280ca12696a67535ce2245c77190edc513794':
  h264: parse two additional constraint flags

Conflicts:
	libavcodec/h264_ps.c

See: 9091ba9dfa
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-01 04:51:05 +01:00
Michael Niedermayer 3ec3f70ddb Merge commit 'e70ab7c1f5005041bba0e4efc1165410f83495b2'
* commit 'e70ab7c1f5005041bba0e4efc1165410f83495b2':
  h264: add MVCD to the list of High profiles in SPS

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-03-01 04:30:57 +01:00
Vittorio Giovara ee6280ca12 h264: parse two additional constraint flags 2014-02-28 18:14:34 +01:00
Vittorio Giovara e70ab7c1f5 h264: add MVCD to the list of High profiles in SPS
Also comment all previous profiles.
2014-02-28 18:14:33 +01:00
Michael Niedermayer 44b22bba42 avcodec/h264_ps: fix printed num_reorder_frames value
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-22 02:55:55 +01:00
Michael Niedermayer 27f55beba2 Merge commit '614b9e4db8f3d7c23fc0410fc04745a727a82f4e'
* commit '614b9e4db8f3d7c23fc0410fc04745a727a82f4e':
  h264: use avpriv_request_sample for chroma_format_idc

Conflicts:
	libavcodec/h264_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-17 20:59:51 +01:00
Vittorio Giovara 614b9e4db8 h264: use avpriv_request_sample for chroma_format_idc 2014-02-16 23:51:44 +01:00
Michael Niedermayer 99b12357f4 Merge commit '3a0576702825423abecb32627c530dbc4c0f73bc'
* commit '3a0576702825423abecb32627c530dbc4c0f73bc':
  h264: store current_sps_id inside the current sps

Conflicts:
	libavcodec/h264.c
	libavcodec/h264_ps.c

The current_sps_id is not removed as it used in security related code.

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-14 13:58:02 +01:00
Michael Niedermayer 60b46a00c6 Merge commit '73e8fab31dc19c4371499e612856accbc00b2820'
* commit '73e8fab31dc19c4371499e612856accbc00b2820':
  h264: print values in case of error

Conflicts:
	libavcodec/h264.c
	libavcodec/h264_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-14 13:35:45 +01:00
Vittorio Giovara 3a05767028 h264: store current_sps_id inside the current sps
In preparation for MVC support.
2014-02-14 05:05:46 +01:00
Vittorio Giovara 73e8fab31d h264: print values in case of error
Also make error style consistent and drop redundant information.
2014-02-14 05:05:35 +01:00
Michael Niedermayer 2510e820c4 Merge commit '9ecabd7892ff073ae60ded3fc0a1290f5914ed5c'
* commit '9ecabd7892ff073ae60ded3fc0a1290f5914ed5c':
  h264: reset num_reorder_frames if it is invalid

Note, num_reorder_frames is not used in the failure case

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-18 22:59:46 +01:00
Anton Khirnov 9ecabd7892 h264: reset num_reorder_frames if it is invalid
An invalid VUI is not considered a fatal error, so the SPS containing it
may still be used. Leaving an invalid value of num_reorder_frames there
can result in writing over the bounds of H264Context.delayed_pic.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-18 20:53:06 +01:00
Michael Niedermayer a60abb1ee0 Merge commit 'bfd26b7ce6efea594f2b99441d900419df3af638'
* commit 'bfd26b7ce6efea594f2b99441d900419df3af638':
  h264: reject mismatching luma/chroma bit depths during sps parsing

Conflicts:
	libavcodec/h264_ps.c

See: bdeb61ccc6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
2014-01-06 16:28:55 +01:00
Anton Khirnov bfd26b7ce6 h264: reject mismatching luma/chroma bit depths during sps parsing
There is no point in delaying the check and it avoids bugs with a
half-initialized context.

Fixes invalid reads.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
2014-01-06 08:23:45 +01:00
Michael Niedermayer ac3fa95e73 Merge commit '94603feb1b3ad01a821a1a1cef1570b13f471821'
* commit '94603feb1b3ad01a821a1a1cef1570b13f471821':
  h264_ps: when parsing a VUI fails, only abort when explode is set

Merge only for metadata, ignoring invalid data can put the context
into an invalid state and can possibly be used for remote code
execution exploits.
Also we support all non standard VUIs that have been reported so
ignoring parsing failure makes no sense for us unless theres
some issue that has not been reported

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-10-28 11:08:58 +01:00
Anton Khirnov 94603feb1b h264_ps: when parsing a VUI fails, only abort when explode is set
A VUI doesn't contain anything strictly necessary for decoding.
Apparently there are many samples with truncated VUIs in the wild, this
commit should allow decoding them.
2013-10-27 21:39:01 +01:00
Michael Niedermayer 70a73213b7 Merge commit 'c18838f5eb7d7001a9dc653f5162868c04c1b2a1'
* commit 'c18838f5eb7d7001a9dc653f5162868c04c1b2a1':
  h264_ps: Use more meaningful error values

Conflicts:
	libavcodec/h264_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-21 13:03:40 +02:00
Michael Niedermayer e853cf5325 Merge commit '330ad1f6a53a37dec228cb424ca57e1268fafc64'
* commit '330ad1f6a53a37dec228cb424ca57e1268fafc64':
  h264_ps: K&R formatting cosmetics

Conflicts:
	libavcodec/h264_ps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-21 12:56:37 +02:00
Michael Niedermayer 8299ed261a Merge commit '8fed466b0a7d636ae5035f9c6074fba9a621539b'
* commit '8fed466b0a7d636ae5035f9c6074fba9a621539b':
  h264_ps: Drop commented-out cruft

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-21 12:32:33 +02:00
Michael Niedermayer 58e12732db Merge commit '2a61592573d725956a4377641344afe263382648'
* commit '2a61592573d725956a4377641344afe263382648':
  avcodec: Remove some commented-out debug cruft

Conflicts:
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_mvpred.h
	libavcodec/mjpegdec.c
	libavcodec/mjpegenc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-08-21 11:18:43 +02:00
Diego Biurrun c18838f5eb h264_ps: Use more meaningful error values 2013-08-20 21:24:42 +02:00
Diego Biurrun 330ad1f6a5 h264_ps: K&R formatting cosmetics 2013-08-20 21:23:24 +02:00
Diego Biurrun 8fed466b0a h264_ps: Drop commented-out cruft 2013-08-20 21:09:05 +02:00
Diego Biurrun 2a61592573 avcodec: Remove some commented-out debug cruft 2013-08-20 19:59:50 +02:00
Michael Niedermayer 00b1401df6 avcodec/h264_ps: try to support Ambarella AVC
Fixes Ticket2763

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-07-09 05:21:26 +02:00
Michael Niedermayer 6952e2f82a h264_ps: fix memleak in ff_h264_decode_picture_parameter_set()
Fixes: CID1026763
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-06-03 14:09:12 +02:00
Michael Niedermayer edabbfbaf2 ff_h264_decode_seq_parameter_set: dont set h->sps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-06 00:37:47 +02:00
Michael Niedermayer ccdaa31d86 ff_h264_decode_picture_parameter_set: fix return code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-06 00:01:47 +02:00
Michael Niedermayer dc35b77b28 ff_h264_decode_picture_parameter_set: use the correct sps
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-05-06 00:01:05 +02:00
Michael Niedermayer c3bd306e78 h264_ps: check croping values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-30 23:48:53 +02:00
Michael Niedermayer f4b05cd841 Merge commit '5e83d9aced2fc2b2e1360452794c58aba55d497c'
* commit '5e83d9aced2fc2b2e1360452794c58aba55d497c':
  h264: fully support cropping.

Conflicts:
	doc/APIchanges
	libavcodec/h264.c
	libavcodec/h264_ps.c
	libavcodec/options_table.h
	libavcodec/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-04-19 22:46:51 +02:00
Anton Khirnov 5e83d9aced h264: fully support cropping.
Based on a patch by Vittorio Giovara <vittorio.giovara@gmail.com>

Fixes Bug 378.
2013-04-19 09:28:08 +02:00
Michael Niedermayer a984efd104 Merge commit 'c242bbd8b6939507a1a6fb64101b0553d92d303f'
* commit 'c242bbd8b6939507a1a6fb64101b0553d92d303f':
  Remove unnecessary dsputil.h #includes

Conflicts:
	libavcodec/ffv1.c
	libavcodec/h261dec.c
	libavcodec/h261enc.c
	libavcodec/h264pred.c
	libavcodec/lpc.h
	libavcodec/mjpegdec.c
	libavcodec/rectangle.h
	libavcodec/x86/idct_sse2_xvid.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-26 13:05:10 +01:00
Diego Biurrun c242bbd8b6 Remove unnecessary dsputil.h #includes 2013-02-26 00:51:34 +01:00
Michael Niedermayer bdeb61ccc6 h264: check that luma and chroma depth match
Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-21 15:02:09 +01:00
Michael Niedermayer b7fe35c9e5 Merge remote-tracking branch 'qatar/master'
* qatar/master:
  h264: deMpegEncContextize

Conflicts:
	libavcodec/dxva2_h264.c
	libavcodec/h264.c
	libavcodec/h264.h
	libavcodec/h264_cabac.c
	libavcodec/h264_cavlc.c
	libavcodec/h264_loopfilter.c
	libavcodec/h264_mb_template.c
	libavcodec/h264_parser.c
	libavcodec/h264_ps.c
	libavcodec/h264_refs.c
	libavcodec/h264_sei.c
	libavcodec/svq3.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-02-16 23:30:09 +01:00
Anton Khirnov 2c54155407 h264: deMpegEncContextize
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>
2013-02-15 16:35:16 +01:00
Michael Niedermayer 25be63005f Merge commit 'b85a5e87af4254b80913fe33591d96361f30832b'
* commit 'b85a5e87af4254b80913fe33591d96361f30832b':
  lavu: Add av_strnstr()
  h264: Allow discarding the cropping information from SPS

Conflicts:
	Changelog
	doc/APIchanges
	libavcodec/avcodec.h
	libavcodec/version.h
	libavutil/version.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2013-01-25 14:36:45 +01:00
Vittorio Giovara a84fb6e06f h264: Allow discarding the cropping information from SPS
Some 3D systems overload the meaning of the field for other purposes.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2013-01-25 07:50:35 +01:00
Michael Niedermayer 40ea343866 Merge commit 'c661cb6672af5ebcb900ec8766b24761bd2ab011'
* commit 'c661cb6672af5ebcb900ec8766b24761bd2ab011':
  cmdutils: pass number of groups to split_commandline().
  mov: handle h263 and flv1 for codec_tag 'H','2','6','3'
  h264: fix sps parsing for SVC and CAVLC 4:4:4 Intra profiles

Conflicts:
	libavcodec/h264_ps.c
	libavformat/isom.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-20 12:06:15 +01:00
Victor Lopez 1c8bf3bfed h264: fix sps parsing for SVC and CAVLC 4:4:4 Intra profiles
Fixes bug 396.

CC: libav-stable@libav.org
2012-12-19 13:40:48 +01:00
Janne Grunau a421bbfe83 h264: fix memleak on error during SPS parsing
Introduced in d7d6efe42b.
2012-12-15 19:16:39 +01:00
Michael Niedermayer b9d887c225 Merge commit '072be3e8969f24113d599444be4d6a0ed04a6602'
* commit '072be3e8969f24113d599444be4d6a0ed04a6602':
  h264: set parameters from SPS whenever it changes
  asyncts: cosmetics: reindent

Conflicts:
	libavcodec/h264.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-14 15:17:51 +01:00
Janne Grunau 072be3e896 h264: set parameters from SPS whenever it changes
Fixes a crash in the fuzzed sample sample_varPAR.avi_s26638 with
alternating bit depths.
2012-12-13 21:02:42 +01:00
Michael Niedermayer 7c425e4f2d Merge commit 'd7d6efe42b0d2057e67999b96b9a391f533d2333'
* commit 'd7d6efe42b0d2057e67999b96b9a391f533d2333':
  h264: check sps.log2_max_frame_num for validity
  mov: validate number of DataReferenceBox entries against box size
  mov: compute avg_frame_rate only if duration is known
  flac: change minimum and default of lpc_passes option to 1

Conflicts:
	libavcodec/h264_ps.c
	libavformat/mov.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
2012-12-07 15:52:43 +01:00
Janne Grunau d7d6efe42b h264: check sps.log2_max_frame_num for validity
Fixes infinite or long taking loop in frame num gap code in
the fuzzed sample bipbop234.ts_s223302.

CC: libav-stable@libav.org
2012-12-07 11:43:28 +01:00
Michael Niedermayer 039f4ff4c2 h264: 2nd try at getting sm2v working
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-11 12:50:03 +01:00
Michael Niedermayer 991f6bf93d h264: Support SMV2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-11-11 02:51:23 +01:00
Hendrik Leppkes 572781b25f h264: fix parsing of old lossless profile (profile_idc == 144)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2012-10-14 16:04:10 +02:00