Matthieu Bouron
bf011695fd
lavc/hevc: store VPS/SPS/PPS data
8 years ago
Hendrik Leppkes
6eb1b40ad8
hevc: fix size condition in ptl parsing
...
When only one sublayer is present, no information is coded. Only when at least two
are present, all 8 sublayers are written.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
9 years ago
Carl Eugen Hoyos
4405ff2cae
lavc/hevc_ps: Fix default display window offsets for yuv422 and yuv444.
9 years ago
Carl Eugen Hoyos
db4786f1cf
lavc/hevc_ps: Support GBR decoding.
9 years ago
Carl Eugen Hoyos
a6a52ef29a
lavc/hevc_ps: Fix offset for yuv422 and yuv444.
...
Fixes ticket #4980 .
Analyzed-by: kurosu and Hendrik
Reviewed-by: Ronald
9 years ago
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>
9 years ago
Hendrik Leppkes
f85cc3bf12
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.
9 years ago
Michael Niedermayer
93f30f825c
avcodec/hevc_ps: Check chroma_format_idc
...
Fixes out of array access
Fixes: 24d05e8b84676799c735c9e27d97895e/asan_heap-oob_1b70f6a_2955_7c3652a7f370f9f3ef40642bc2c99bb2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Hendrik Leppkes
5d324dae11
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
9 years ago
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>
9 years ago
Michael Niedermayer
f8e4d37983
avcodec/hevc_ps: Also print depth in failure path of map_pixel_format()
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Luca Barbato
c88c5eef53
hevc: Split the struct setup from the pps parsing
9 years ago
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>
9 years ago
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>
9 years ago
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.
9 years ago
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.
9 years ago
Michael Niedermayer
15893adbdb
avcodec/hevc_ps: Remove gotos from ff_hevc_parse_sps()
...
They are currently unnecessary
Found-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years ago
Michael Niedermayer
1dacf26964
avcodec/hevc_ps: Do not return success on failures in ff_hevc_parse_sps()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
9 years ago
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.
10 years ago
Michael Niedermayer
57078e4d25
avcodec/hevc_ps: Only discard overread VPS if a previous is available
...
Fixes Ticket4621
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
04da0d2586
avcodec/hevc_ps: Move log2_ctb_size checks up to prevent undefined shift operations
...
Fixes CID1292293
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
65e5032955
avcodec/hevc_ps: Explicitly check num_tile_* for negative values
...
This fixes nothing but maybe helps coverity which does not see that this is failing later
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
b195aa5d52
avcodec/hevc_ps: Check vps_num_hrd_parameters
...
Fix CID1239052 part2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
16c95b1073
avcodec/hevc_ps: More completely check vps_num_layer_sets
...
Fixes CID1239052 part1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0e7444f6e4
avcodec/hevc: Remove current_sps
...
The variable should not be needed anymore
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
James Almer
ba625dd8a1
avcodec: use av_mod_uintp2() where useful
...
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
10 years ago
Anton Khirnov
df528b11ac
hevc: make sure no dangling pointers remain around on VPS/SPS change
10 years ago
Anton Khirnov
ce0bc09ee2
hevc: do not change the VPS if its contents are the same
...
This is the same as is done for SPS.
10 years ago
Michael Niedermayer
06c70d4537
avcodec/hevc_ps: Check cropping parameters more correctly
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
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
10 years ago
Michael Niedermayer
701c965a76
avcodec/hevc_ps: Check that log2_ctb_size is not smaller than the bounds of all profiles
...
Fixes: unaligned memory access
Fixes: signal_sigsegv_3344165_576_cov_3406448105_DBLK_A_MAIN10_VIXS_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Suggested-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
205b2ba3d6
avcodec/hevc_ps: Sanity checks for some log2_* values
...
log2 values which imply numeric overflow are not supported
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
7cf6a67ef9
avcodec/hevc: adding support for monochrome sequences in hevc
...
cherry picked from commit 8e50557707d2ec11ccad657470b2e140f314348e
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
3281fa8925
avcodec/hevc_ps: Check diff_cu_qp_delta_depth
...
Fixes undefined behavior
Fixes: asan_static-oob_17aa046_582_cov_1577759978_DBLK_G_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
1adc1b97e1
avcodec/hevc_ps: Add context to av_log() call
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ea38e5a6b7
avcodec/hevc_ps: Check num_long_term_ref_pics_sps
...
Fixes out of array access
Fixes: signal_sigsegv_35bd0f0_1182_cov_791726764_STRUCT_B_Samsung_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
57e5812198
avcodec/hevc_ps: More complete window reset
...
Fixes out of array read
Fixes: signal_sigsegv_35bcf26_471_cov_2806540268_CAINIT_A_SHARP_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
9f9440bd81
avcodec/hevc_ps: Check return code from pps_range_extensions()
...
Fixes out of array read
Fixes: asan_heap-oob_177e222_885_cov_1532528832_MERGE_D_TI_3.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
852aaead1f
avcodec/hevc_ps: Check default display window bitstream and skip if invalid
...
Fixes Ticket4035
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
cbb277988a
avcodec/hevc_ps: Always initialize backup in decode_vui()
...
Fixes CID1237283
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
aaaf7261b7
avcodec/hevc_ps: fix 1 vs. 0 typo
...
Found-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
0625a38066
hevc_ps: check overflow and test alternate syntax
...
Some streams were found to have what appeared to be truncated SPS.
Their syntax seem to be valid at least until the end of the VUI, so
try that syntax if the parsing would overflow the SPS in the
conforming syntax.
Fixes ticket #3872 .
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7caacc50ae
avcodec/hevc_ps: do cleanup in case of unsupported bit depth
...
Fixes memleak
Fixes CID1231989
Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Reviewed-by: Mickaël Raulet <mraulet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
5ec85c9750
hevc: do generic validation of bitstream
...
After finishing parsing VPS/SPS/PPS/slice header, check remaining bits,
and if an overconsumption occurred, report invalid data.
Liked-by: BBB
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Christophe Gisquet
0d0d24af01
hevc_ps: verify P/T/L information
...
This makes the SPS parsing a little, but barely, safer.
Reviewed-by: Mickaël Raulet <mraulet@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
37822a566f
hevc/rext: remove warning for cross component prediction
...
cherry picked from commit fb595102593c94179502bb1967f978a1d99cc7cb
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
627c044f50
hevc/rext: fixing rdpcm and scaling list for Range Extension
...
-new rext bitstreams:
PERSIST_RPARAM_A_RExt_Sony_1.bit ok =
QMATRIX_A_RExt_Sony_1.bit ok =
SAO_A_RExt_MediaTek_1.bit ok =
(cherry picked from commit cdea029d452c521f8e5bcbe589f44b13a4011604)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
d13a731fc1
avcodec/hevc_ps: Check abs_delta_rps
...
Fixes integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ba80b8d29b
avcodec/hevc: check nb_cpb
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
fdb20db642
hevc/rext: put a warning log message instead of an error log message
...
cherry picked from commit 243cb99cff727d6a14c32cdff2748f6c255dbaf4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago