Commit Graph

40 Commits

Author SHA1 Message Date
Mark Thompson
1329c08ad6 hevc: Validate the number of long term reference pictures
This would overflow if the stream contained a value greater than the
maximum allowed by the standard (32).
2017-08-05 23:54:35 +01:00
Mark Thompson
b88da98b34 hevc: Improve stream constraint values in common header
Add comments to describe the sources of the constraint values expressed here,
and add some more related values which will be used in following patches.

Fix the incorrect values for SPS and PPS count (they are not the same as those
used for H.264), and remove HEVC_MAX_CU_SIZE because it is not used anywhere.
2017-08-05 23:54:35 +01:00
Diego Biurrun
d4c2103bd3 golomb: Convert to the new bitstream reader 2017-01-31 17:46:19 +01:00
Anton Khirnov
a02ae1c683 hevcdec: export cropping information instead of handling it internally 2017-01-12 16:27:56 +01:00
Vittorio Giovara
ff9db5cfd1 lavc: Use a stricter check for the color properties values
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2016-12-02 11:36:42 -05:00
Diego Biurrun
67deba8a41 Use avpriv_report_missing_feature() where appropriate 2016-11-08 17:54:34 +01:00
Anton Khirnov
f6e2f8a9ff hevcdec: move parameter set parsing into a separate header
This code is independent from the decoder, so it makes more sense for it
to to have its own header.
2016-10-16 20:26:47 +02:00
Anton Khirnov
150c896a9e hevcdec: split ff_hevc_diag_scan* declarations into a separate header
This will be useful in the following commits.
2016-10-16 20:26:40 +02:00
Anton Khirnov
c359d624d3 hevcdec: move decoder-independent declarations into a separate header
This way they can be reused by other code without including the whole
decoder-specific hevcdec.h
Also, add the HEVC_ prefix to them, since similarly named values exist
for H.264 as well and are sometimes used in the same code.
2016-10-16 20:26:28 +02:00
Anton Khirnov
4abe3b049d hevc: rename hevc.[ch] to hevcdec.[ch]
This is more consistent with the rest of libav and frees up the hevc.h
name for decoder-independent shared declarations.
2016-10-16 20:26:17 +02:00
Hendrik Leppkes
1ecb63cd1c hevc: set profile based on the profile compatibility flags if needed
This fixes retrieving a valid profile for many of the FATE conformance samples,
allowing them to be properly decoded by the HWAccel after adding a profile check.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2016-07-20 16:33:09 +02:00
Hendrik Leppkes
8c399bd5ce dxva2_hevc: properly signal the num_delta_pocs from the SPS RPS
ucNumDeltaPocsOfRefRpsIdx needs to contain the flat value from the SPS RPS,
and not the final computed value from the slice header RPS, as this calculation
is done internally by the driver again.

Sample-Id: http://trailers.divx.com/hevc/Sintel_4k_27qp_24fps_1aud_9subs.mkvi
Signed-off-by: Rémi Denis-Courmont <remi@remlab.net>
2016-02-13 14:19:54 +01:00
Vittorio Giovara
7c6eb0a1b7 lavc: AV-prefix all codec flags
Convert doxygen to multiline and express bitfields more simply.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-07-27 15:24:58 +01:00
Luca Barbato
c88c5eef53 hevc: Split the struct setup from the pps parsing 2015-07-15 19:39:44 +02:00
Luca Barbato
32c8d89c03 hevc: Print the non-supported chroma_format_idc
And drop the spurious newline.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-07-13 21:59:53 +02:00
Luca Barbato
8e373fe048 hevc: Factor out the pixel format mapping from the sps parser
The function will grow larger as more formats are supported.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-07-13 21:59:53 +02:00
Anton Khirnov
b9f76d19d8 hevc_ps: make sure failing to decode an SPS always returns an error
Some of the goto err clauses do not set the error code. It seems better
to fall back on INVALIDDATA instead of adding it everywhere explicitly.
2015-07-13 07:49:03 +02:00
Anton Khirnov
b11acd5732 hevc: remove HEVCContext usage from hevc_ps
Factor out the parameter sets into a separate struct and use it instead.

This will allow us to reuse this code in the parser.
2015-07-12 18:15:39 +02:00
Anton Khirnov
fd124d8357 hevc_ps: split the code for parsing the SPS and exporting it into the context
This will be useful in the later commits, where we want to parse an SPS
without having a whole decoding context.
2015-07-08 23:36:22 +02:00
Anton Khirnov
df528b11ac hevc: make sure no dangling pointers remain around on VPS/SPS change 2015-04-03 13:10:03 +02:00
Anton Khirnov
ce0bc09ee2 hevc: do not change the VPS if its contents are the same
This is the same as is done for SPS.
2015-04-03 13:10:03 +02:00
Anton Khirnov
5127c00b97 hevc: zero the correct variables on invalid crop parameters
It's the output_window that is applied to the output frame, not
pic_conf_win
2015-03-21 09:35:19 +01:00
Anton Khirnov
17e9d52c8c hevc_ps: remove a write-only variable 2014-07-11 08:38:51 +00:00
Gildas Cocherel
a0e1c3517a hevc: remove unused array min_cb_addr_zs
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-26 15:51:54 +02:00
Kieran Kunhya
9b60d91979 hevc: Allow out of bound values for num_reorder_pics
This fixes decoding for a sample that cannot be shared

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2014-06-26 07:14:57 +02:00
Vittorio Giovara
4d33873c29 hevc: make pps/sps ids unsigned where necessary
Fixes integer overflow and out of array accesses.
Found-by: Mateusz j00ru Jurczyk and Gynvael Coldwind
2014-03-09 17:23:08 +01:00
Michael Niedermayer
920c01adce hevc: Use get_bits_long() in decode_vui()
Fix assertion failure.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
2014-03-09 08:25:39 +01:00
Luca Barbato
175e506332 hevc: Mention the missing SPS in the error message 2014-02-19 16:59:40 +01:00
Luca Barbato
838740e642 hevc: Prevent some integer overflows
get_ue_golomb_long() returns an unsigned.

Sample-Id: 00001541-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-01-21 11:59:18 +01:00
Luca Barbato
b37e796082 hevc: Use uint64 to check for tile dimensions
And use unsigned datatypes.

Otherwise it would overflow.

Sample-Id: 00001315-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
2014-01-21 11:57:51 +01:00
Michael Niedermayer
a7a07cc98a hevc: check that VPS referenced from SPS exists
This matches how its done for SPS/PPS.
Fixes null pointer dereference.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2014-01-21 11:57:36 +01:00
Mickaël Raulet
5c3fa74b94 hevc: support luma bit depth != chroma bit depth for PCM coding units
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:39:53 +01:00
Guillaume Martres
78d0b7f36e hevc: warn when an unknown profile is used
Bitstreams conforming to the spec should not use profiles not defined
in it.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:39:38 +01:00
Gildas Cocherel
259cddb137 hevc_ps: fix indentation
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:39:10 +01:00
Gildas Cocherel
2d18aaa14b hevc: refactor Profile Tier Level
Also store a few PTL flags which were skipped before

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:38:59 +01:00
Guillaume Martres
67bbaed5c4 hevc: don't check for errors in PTL code
According to the spec, the value of XXX_reserved_zero_44bits should be
ignored, so don't report an error when it's not zero.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-20 19:36:44 +01:00
Gildas Cocherel
33452aede6 hevc: store the VPS list as an AVBufferRef, just like the others *PS
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-12-11 20:39:54 +01:00
Yusuke Nakamura
3ef9b7ab95 hevc_ps: Use AV_PIX_FMT_YUVJ420P if YUV 4:2:0 8-bit full scale
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2013-11-04 16:19:53 +01:00
Jan Ekström
885ec92425 hevc: Use parsed VUI colorimetry in avcodec
Also limit the parsed VUI values to known valid ones.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2013-11-04 16:03:11 +01:00
Guillaume Martres
064698d381 Add HEVC decoder
Initially written by Guillaume Martres <smarter@ubuntu.com> as a GSoC
project. Further contributions by the OpenHEVC project and other
developers, namely:

Mickaël Raulet <mraulet@insa-rennes.fr>
Seppo Tomperi <seppo.tomperi@vtt.fi>
Gildas Cocherel <gildas.cocherel@laposte.net>
Khaled Jerbi <khaled_jerbi@yahoo.fr>
Wassim Hamidouche <wassim.hamidouche@insa-rennes.fr>
Vittorio Giovara <vittorio.giovara@gmail.com>
Jan Ekström <jeebjp@gmail.com>
Anton Khirnov <anton@khirnov.net>
Martin Storsjö <martin@martin.st>
Luca Barbato <lu_zero@gentoo.org>
Yusuke Nakamura <muken.the.vfrmaniac@gmail.com>
Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diego Biurrun <diego@biurrun.de>

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2013-10-31 20:19:59 +01:00