Diego Biurrun
cba4e6062a
More correct printf format specifiers
...
This avoids compiler warnings about argument and specifier type mismatch.
11 years ago
Diego Biurrun
cc8163e1a3
avcodec: more correct printf specifiers
11 years ago
Vittorio Giovara
5d1c2e53ab
h264: Replace mpegvideo-specific MAX_PICTURE_COUNT by private define
11 years ago
Vittorio Giovara
ee6280ca12
h264: parse two additional constraint flags
11 years ago
Vittorio Giovara
e70ab7c1f5
h264: add MVCD to the list of High profiles in SPS
...
Also comment all previous profiles.
11 years ago
Michael Niedermayer
44b22bba42
avcodec/h264_ps: fix printed num_reorder_frames value
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Vittorio Giovara
614b9e4db8
h264: use avpriv_request_sample for chroma_format_idc
11 years ago
Vittorio Giovara
3a05767028
h264: store current_sps_id inside the current sps
...
In preparation for MVC support.
11 years ago
Vittorio Giovara
73e8fab31d
h264: print values in case of error
...
Also make error style consistent and drop redundant information.
11 years ago
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
11 years ago
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
11 years ago
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.
11 years ago
Diego Biurrun
c18838f5eb
h264_ps: Use more meaningful error values
11 years ago
Diego Biurrun
330ad1f6a5
h264_ps: K&R formatting cosmetics
11 years ago
Diego Biurrun
8fed466b0a
h264_ps: Drop commented-out cruft
11 years ago
Diego Biurrun
2a61592573
avcodec: Remove some commented-out debug cruft
11 years ago
Michael Niedermayer
00b1401df6
avcodec/h264_ps: try to support Ambarella AVC
...
Fixes Ticket2763
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
6952e2f82a
h264_ps: fix memleak in ff_h264_decode_picture_parameter_set()
...
Fixes: CID1026763
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
edabbfbaf2
ff_h264_decode_seq_parameter_set: dont set h->sps
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ccdaa31d86
ff_h264_decode_picture_parameter_set: fix return code
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
dc35b77b28
ff_h264_decode_picture_parameter_set: use the correct sps
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
c3bd306e78
h264_ps: check croping values
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Anton Khirnov
5e83d9aced
h264: fully support cropping.
...
Based on a patch by Vittorio Giovara <vittorio.giovara@gmail.com>
Fixes Bug 378.
12 years ago
Diego Biurrun
c242bbd8b6
Remove unnecessary dsputil.h #includes
12 years ago
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>
12 years ago
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>
12 years ago
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>
12 years ago
Victor Lopez
1c8bf3bfed
h264: fix sps parsing for SVC and CAVLC 4:4:4 Intra profiles
...
Fixes bug 396.
CC: libav-stable@libav.org
12 years ago
Janne Grunau
a421bbfe83
h264: fix memleak on error during SPS parsing
...
Introduced in d7d6efe42b
.
12 years ago
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.
12 years ago
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
12 years ago
Michael Niedermayer
039f4ff4c2
h264: 2nd try at getting sm2v working
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
991f6bf93d
h264: Support SMV2
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Hendrik Leppkes
572781b25f
h264: fix parsing of old lossless profile (profile_idc == 144)
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Michael Niedermayer
ae0312ab2e
h264: print num_reorder_frames in debug output
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
12 years ago
Ronald S. Bultje
be391fb6df
h264_ps: declare array of colorspace strings on its own line.
12 years ago
Michael Niedermayer
1d890ec849
h264/decode_scaling_matrices: fix coding order of 8x8 matrixes.
...
This fixes decoding of PPCV444I3_Thomson_A.bits
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
e162733dcd
h264: 12 and 14 bit support
...
This works with I, P and B frames
CAVLC and CABAC
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
acb52d3228
h264: print error on unsupported seperate color planes
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
4330b8bba2
h264: sps: handle more profiles
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
9091ba9dfa
h264: add support for constraint_set4_flag / constraint_set5_flag
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
0c9283a03f
h264: check log2_max_poc_lsb for validity
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Ronald S. Bultje
732f9fcfe5
h264: additional protection against unsupported size/bitdepth changes.
...
Fixes crashes in codepaths not covered by original checks.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
13 years ago
Michael Niedermayer
192efcf768
h264_ps: check log2_max_frame_num for validity.
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Alexander Strange
cb34867780
h264: fix memleak in error path.
...
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
13 years ago
Alexander Strange
6ef4063957
h264: Add check for invalid chroma_format_idc
...
Fixes a crash when FF_DEBUG_PICT_INFO is used.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
13 years ago
Michael Niedermayer
3aa661ec56
h264: improve parsing of broken AVC SPS
...
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>
13 years ago
Alex Converse
3574a85ce5
Replace computations of remaining bits with calls to get_bits_left().
13 years ago
Michael Niedermayer
ae7a6441df
h264: Decode short VUI without error
...
Fixes 47j9R7PXBep.mov
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago
Michael Niedermayer
7fff64e00d
h264: check chroma_format_idc range.
...
Fixes Ticket758
Bug found by: Diana Elena Muscalu
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
13 years ago