Michael Niedermayer
bc48c88918
avcodec/h264: Do not fail with randomly truncated VUIs
...
Fixes Ticket4445
Tested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7be2d2a70c
avcodec/h264: Use only one ERContext
...
This fixes slice threads with error concealment
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
98d0c4236c
avcodec/h264: Be more tolerant to changing pps id between slices
...
Fixes Ticket4446
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
c4b2017ba6
avcodec/h264: finish previous slices before switching to single thread mode
...
Fixes null pointer dereference
Fixes Ticket4438
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
bd737b5178
h264: reset the private data in init_thread_copy()
...
The generic code copies the main context's private data to all the
others. However that is quite dangerous, as it might end up copying some
pointers that are or will become invalid.
Since everything we actually need will be copied later in
update_thread_context(), it's safest to zero the private data in
init_thread_copy(), so it works the same way as init for the main
context.
10 years ago
Anton Khirnov
a939e5b252
h264: remove a commented out nonsense line
10 years ago
Anton Khirnov
65afa65e73
h264: drop redundant initialization of the scaling matrices
...
It will always be initialized when actually parsing the PPS.
10 years ago
Anton Khirnov
e1f907711a
h264: factor out common code from init() and init_thread_copy()
10 years ago
Anton Khirnov
43fd3dd80c
h264: drop redundant initialization in init()
...
There is no real advantage to initializing any of those in init,
assuming yuv420, before the real stream parameters are known.
10 years ago
Anton Khirnov
050324d020
h264: initialize cur_chroma_format_idc
...
This makes sure the various DSP contexts get properly initialized in
ff_h264_set_parameter_from_sps() whatever the value of
raw_bits_per_sample.
10 years ago
Michael Niedermayer
fc58d5c43b
avcodec/h264: Fail for invalid mixed IDR / non IDR frames in slice threading mode
...
Fixes Ticket4408
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
514d9bb55d
avcodec/h264: use goto end instead of return for hwaccel fails as well
...
This is more correct
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
333eb37a96
avcodec/h264: silence ER warning when no slice threads are used
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
4b7356ce8f
avcodec/h264: reenable ER except with slice threads by default
...
ER with slice threads is buggy and since the merge of the libav cleanup broken
as the ER context which is supposed to be per frame has been placed in
the slice context, so there are multiple per frame which does not work as is.
Theres no bug report about ER with frame threads. If someone knows of a
case where it crashes / fails without slice threads please mail me and
open a ticket on trac.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
a4d34e218f
h264: disable ER by default
...
The way it is currently designed is fundamentally unsafe and cannot be
reasonably fixed without completely rewriting it.
10 years ago
Rainer Hochecker
3e53211a57
vda: fix h264 decoding for avcC,vda wants the entire buffer
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
354db19ff4
avcodec/h264: Remove bits_per_raw_sample hacks
...
Fixes assertion failure
Fixes: f12c79769501ee471a5c731b8304ffcb/signal_sigabrt_7ffff6ac8cc9_3766_cov_4267830138_undemuxable_h264.ts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
2b4c38d3c6
h264: drop some mpegvideo remnants from draw_horiz_band()
...
This code makes no sense for h.264.
10 years ago
Anton Khirnov
5bf3c0fa49
h264: drop the now unused per-slice H264Contexts
10 years ago
Anton Khirnov
51d8725a6e
h264: use the main H264Context as the parent for all slice contexts
...
There is now no need to have per-slice copies of the H264Context.
10 years ago
Anton Khirnov
3178f4d33f
h264: move rbsp_buffer into the per-slice context
10 years ago
Anton Khirnov
582683b6ac
h264: move remaining ER stuff into the per-slice context
10 years ago
Anton Khirnov
5bc69f38c1
error_resilience: do not require mbintra/skip tables
...
h264dec does not use them at all and only allocates them for ER.
10 years ago
Anton Khirnov
c377e04d8a
h264: move top_borders into the per-slice context
...
Also change the method for allocating to the same one as used by
edge_emu_buffer.
10 years ago
Anton Khirnov
36d04801ba
h264: move the scratch buffers into the per-slice context
...
Also change the method for allocating them. Instead of two possible
alloc calls from different places, just ensure they are allocated at the
start of each slice. This should be simpler and less bug-prone than the
previous method.
10 years ago
Anton Khirnov
5c4b98de4d
h264.c: constify all uses of H264Context in slice and lower-level functions
...
All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context
10 years ago
Anton Khirnov
f42485dbce
h264: use a separate GetBitContext for slice data
10 years ago
Anton Khirnov
2ea00e35e4
h264: do not abuse the context as a temporary storage in get_last_needed_nal()
...
Use a local variable instead.
10 years ago
Anton Khirnov
404a416d4b
h264: remove some remnants of data partitioning
10 years ago
Anton Khirnov
d4d9068cdf
h264: move mb_{x,y} into the per-slice context
10 years ago
Anton Khirnov
0edbe6faa7
h264: move mb_xy into the per-slice context
10 years ago
Anton Khirnov
9951907f6f
h264: move redundant_pic_count into the per-slice context
10 years ago
Anton Khirnov
a67f8ae9a2
h264: move mvd_table into the per-slice context
10 years ago
Anton Khirnov
95eb35f305
h264: move the ref lists variables into the per-slice context
10 years ago
Anton Khirnov
066aafced4
h264: move direct_spatial_mv_pred into the per-slice context
10 years ago
Anton Khirnov
56febc993b
h264: move the slice type variables into the per-slice context
10 years ago
Anton Khirnov
e6287f077c
h264: move {mv,ref}_cache into the per-slice context
10 years ago
Anton Khirnov
f69574cf7a
h264: move non_zero_count_cache into the per-slice context
10 years ago
Anton Khirnov
64c81b2cd0
h264: move *_samples_available into the per-slice context
10 years ago
Anton Khirnov
7d8154edd5
h264: move intra4x4_pred_mode[_cache] into the per-slice context
10 years ago
Anton Khirnov
92c6c2a605
h264: split weighted pred-related vars into per-slice context
10 years ago
Michael Niedermayer
b37c3396cd
avcodec/h264: Add ff_ prefix to the shared h264_init_dequant_tables() function
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7296716e35
avcodec/h264: Clear last_pic_for_ec on seeks and reinits
...
Fixes out of array read
Fixes: asan_heap-oob_2ff30d2_3479_cov_3803648058_src13_hrc7_525_420_2.264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Anton Khirnov
a06b0b1295
h264: initialize H264Context.avctx in init_thread_copy
...
This prevents using a wrong (first thread's) AVCodecContext if decoding
a frame in the first pass over all threads fails.
10 years ago
Michael Niedermayer
31cc9c04ca
avcodec/h264: Be more strict on rejecting pps_id changes
...
Fixes race condition
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
f5722ba276
libavcodec/h264: replace assert() by av_assert0()
...
also remove the now unneeded #include <assert.h>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
61928b68dc
h264: Do not share rbsp_buffer across threads
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
CC: libav-stable@libav.org
10 years ago
Anton Khirnov
167e004e1a
h264: drop any pretense of support for data partitioning
...
It does not work correctly and apparently never did. There is no
indication that this (mis)feature is ever used in the wild or even that
any software other than the reference supports it.
Since the code that attempts to support it adds some nontrivial
complexity and has resulted in several bugs in the past, it is better to
just drop it.
10 years ago
Anton Khirnov
ecab21ac47
h264: do not reset the ref lists in flush_change()
...
They are always constructed anew when needed, so there is no need to
reset them explicitly.
10 years ago
Anton Khirnov
9404a47a2d
h264: move parser-only variables to their own context
10 years ago