Christophe Gisquet
7a4a5515b0
hevc: use intreadwrite
...
When dealing with MVs, both components may be processed at a time.
On Win64, 560 to 539 cycles for derive_spatial_merge_candidates.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ffa0b510cd
avcodec/hevc: fix pict_type
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
d249e6828e
hevc/sao: optimze sao implementation
...
- adding one extra pixel all around the frame
- do not copy when SAO is not applied
5% improvement
cherry picked from commit 10fc29fc19a12c4d8168fbe1a954b76386db12d0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
cf92cc8751
avcodec/hevc: clear HEVClcList[i] on allocation
...
Fixes fate failure with --enable-memory-poisoning && make THREAD_TYPE=slice THREADS=7 fate-hevc-conformance-ENTP_C_Qualcomm_1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
880dbe43ca
avcodec/hevc: treat current_sps like sps_list
...
This simplifies the management of current_sps
Fixes Ticket3458
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
453f8eaee2
hevc/rext: add support for Range extension tools
...
SPS features/flags:
- transform_skip_rotation_enabled_flag
- transform_skip_context_enabled_flag
- implicit_rdpcm_enabled_flag
- explicit_rdpcm_enabled_flag
- intra_smoothing_disabled_flag
- persistent_rice_adaptation_enabled_flag
PPS features/flags:
- log2_max_transform_skip_block_size
- cross_component_prediction_enabled_flag
- chroma_qp_offset_list_enabled_flag
- diff_cu_chroma_qp_offset_depth
- chroma_qp_offset_list_len_minus1
- cb_qp_offset_list
- cr_qp_offset_list
- log2_sao_offset_scale_luma
- log2_sao_offset_scale_chroma
(cherry picked from commit 005294c5b939a23099871c6130c8a7cc331f73ee)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
5a41999d81
hevc/rext: basic infrastructure for supporting range extension
...
- support for 4:2:2 and 4:4:4 up to 12 bits
- add a new profile for range extension
(cherry picked from commit d3c067fa65bbc871758d28aa07f54123430ca346)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
255086a7e0
hevc: use local variable for split_cu_flag
...
(cherry picked from commit ee71e9e9c12fc47856c452efb278f9f593a923ee)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
f5beda3bfd
hevc: move restore_tqb where it should be.
...
(cherry picked from commit 8fafc96a9805d11bfe32537c8f78a294a5844065)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Mickaël Raulet
1241eb8870
hevc: simplify SAO computation, delay from one row its computation
...
(cherry picked from commit f2c5f647cec786df26f442a85e6d685a131a50c9)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
1db641cbd2
avcodec/hevc: more clearing to avoid stale pointers
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
ccd6911c18
avcodec/hevc_ps: do not loose all reference to pointers still in use
...
Fixes leaving a pointer to unreferenced memory
Fixes Ticket 3115
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
5d88e40093
avcodec/hevc: check slice_header_extension data length
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
c79acacd2e
avcodec/hevc: fix nb_sh / nb_sps check
...
fixes integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Gildas Cocherel
458e7c9483
hevc: implement pic_output_flag handling
...
Sample-Id: OPFLAG_B_Qualcomm_1.bit, OPFLAG_C_Qualcomm_1.bit
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Mickaël Raulet
f43789b76e
hevc: set the keyframe flag on output frames
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Mickaël Raulet
1493b237bd
hevc: Replace nal type chek with equivalent IS_IRAP macro
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Christophe Gisquet
eca1957c4c
hevc: reorder loops
...
iterate over memory in a more continuous order
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Vittorio Giovara
0569a7e0bd
hevc: parse display orientation SEI message
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
11 years ago
Luca Barbato
df949b645b
hevc: Use the local context variable when needed
11 years ago
Michael Niedermayer
7faa7d3d42
avcodec/hevc: Use av_malloc(z)_array()
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Diego Biurrun
c67b449beb
dsputil: Split bswap*_buf() off into a separate context
11 years ago
Justin Ruggles
9e500efdbe
Add av_image_check_sar() and use it to validate SAR
11 years ago
Anton Khirnov
a1c2b48018
hevc: templatize intra_pred
11 years ago
Mickaël Raulet
e2760de605
hevc: fix key_frame as an IRAP
...
it was always 1 before with ISOBMFF(cherry picked from commit fb1402b1ec78d80acd6ced76bf78d65560965c4c)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
2201d1a0f8
avcodec/hevc: Fix undefined shifts
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
84655bdaed
avcodec/hevc: remove unused variable
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Mickaël Raulet
83976e40e8
hevc: C code update for new motion compensation
...
pretty print C
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
gcocherel
2eddf3a6ef
avcodec/hevc: fix no output of prior pics and pic output flags(cherry picked from commit e99b96dff1d76d74cb5633aa9702828d863050e2)
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6795dcfa65
avcodec/hevc: Export picture type
...
This only uses the first slice, improvement here is welcome
analyzing all slices the trivial way would interfere with threads
Fixes Ticket3185
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
ed06e5d92b
hevc: Do not turn 32bit timebases into negative numbers
...
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
11 years ago
Michael Niedermayer
6cc94e9719
hevc: use av_mallocz() for allocating tab_ipm
...
Fixes use of uninitialized memory and out of stack array read.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
11 years ago
Luca Barbato
521726ff57
hevc: Always consider VLC NALU type mismatch fatal
...
Sample-Id: 00001667-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years ago
Michael Niedermayer
bf2ce19e51
avcodec/hevc: Dont turn 32bit timebases into negative numbers
...
Fixes assertion failure
Fixes: 499f6ecaeae8e3f79a115a72c61ffd15-asan_static-oob_124a175_2792_cov_1782273879_RPLM_A_qualcomm_4.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
3b6655ebff
avcodec/hevc: remove FFUMOD() in slice qp_y init
...
This has become redundant
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
1e263133cc
avcodec/hevc: remove unused variables
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
64278039e5
avcodec/hevc: Simplify get_qPy_pred()
...
Fixes use of uninitialized memory
Fixes: 93728afd9aa074ba14a09bfd93a632fd-asan_static-oob_124a17d_1445_cov_1021181966_DBLK_D_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
1a3ed056c5
avcodec/hevc: make check for previous slice segment tighter
...
This ensures the previous one is matching the curent and not just any
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
6ef57f4d9a
avcodec/hevc: hls_decode_entry: check that the previous slice segment is available before decoding the next
...
Fixes use of uninitialized memory
Fixes out of array read
Fixes assertion failure
Fixes part of cb307d24befbd109c6f054008d6777b5/asan_static-oob_124a175_1445_cov_2355279992_DBLK_D_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
a18f111582
avcodec/hevc: clear tab_slice_address of ctb on error.
...
This allows us to detect which areas have failed to decode
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
56985d26d7
avcodec/hevc: clear tab_slice_address in hevc_frame_start()
...
Fixes inconsistencies
Fixes use of uninitilaized memory
Fixes part of cb307d24befbd109c6f054008d6777b5/asan_static-oob_124a175_1445_cov_2355279992_DBLK_D_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Anton Khirnov
b25e84b739
hevc: check that the VCL NAL types are the same for all slice segments of a frame
...
Fixes possible invalid memory access for mismatching skipped/non-skipped
slice segments.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Sample-Id: 00001533-google
11 years ago
Michael Niedermayer
96c4ba2392
avcodec/hevc: propagate error code from hls_coding_quadtree()
...
Fixes use of uninitialized memory
Fixes out of array read
Fixes: asan_static-oob_123cee5_2630_cov_1869071233_PICSIZE_A_Bossen_1.bin
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
816e5b9970
hevc: Reject impossible slice segment
...
A dependent slice cannot have address 0.
Prevent an out of array bound load in ff_hevc_cabac_init().
Sample-Id: 00001406-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years ago
Luca Barbato
e22ebd04bc
hevc: Bound check cu_qp_delta
...
The T-REC-H.265-2013044 page 91 states it has to be in the range
[-(26 + s->sps->qp_bd_offset / 2), (25 + s->sps->qp_bd_offset / 2)].
11 years ago
Luca Barbato
0d999333f9
hevc: Bound check slice_qp
...
The T-REC-H.265-2013044 page 79 states it has to be in the range
[-s->sps->qp_bd_offset, 51].
Sample-Id: 00001386-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
11 years ago
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
11 years ago
Michael Niedermayer
d5c15ebeaf
hevc: Fix modulo operations
...
Keep qp fields within the range.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
11 years ago
Michael Niedermayer
22bfb4be28
avcodec/hevc: Check entry point arrays for malloc failure
...
Fixes null pointer dereference
Fixes: signal_sigsegv_e1d3b6_2192_DBLK_F_VIXS_2.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
aead772b58
hevc: Bound check slice_qp
...
The T-REC-H.265-2013044 page 79 states they have to be into the range
[-s->sps->qp_bd_offset, 51].
Fixes: asan_stack-oob_eae8e3_9522_WP_MAIN10_B_Toshiba_3.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago