Anton Khirnov
f1ccd07680
h264: do not call frame_start() for missing frames
...
We do not need to do a full setup like for a real frame, just allocate a
buffer and set cur_pic(_ptr).
2015-12-07 11:42:26 +01:00
Anton Khirnov
792b9c9dfc
h264: set frame_num in start_frame(), not decode_slice_header()
...
That is a more appropriate place for it, since it is not allowed to
change between slices.
2015-12-06 09:43:45 +01:00
Anton Khirnov
741b494fa8
h264: eliminate default_ref_list
...
According to the spec, the reference list for a slice should be
constructed by first generating an initial (what we now call "default")
reference list and then optionally applying modifications to it.
Our code has an optimization where the initial reference list is
constructed for the first inter slice and then rebuilt for other slices
if needed. This, however, adds complexity to the code, requires an extra
2.5kB array in the codec context and there is no reason to think that it
has any positive effect on performance. Therefore, simplify the code by
generating the reference list from scratch for each slice.
2015-12-06 09:42:39 +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
Vittorio Giovara
3e3056f2a0
h264: Allow stream and container cropping at the same time
...
The container cropping is applied only when difference is within 16
pixels, and the smallest value between the two is chosen.
Bug-Id: 383
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2015-06-30 15:34:37 +02:00
Anton Khirnov
5ec0bdf2c5
h264: do not update the context fields copied between threads after finish_setup()
...
Should fix a large number of possible races with frame threading.
2015-06-27 16:48:48 +02:00
Anton Khirnov
e49e0f58e2
h264: make sure the slices do not overlap during slice threading
...
Based on a patch by Michael Niedermayer <michaelni@gmx.at>.
CC: libav-stable@libav.org
Found-by: Kieran Kunhya <kierank@obe.tv>
2015-06-27 16:43:22 +02:00
Andreas Cadhalpun
a4fbd55d6e
h264: er: Copy from the previous reference only if compatible
...
Also use the frame pixel format instead of the one from the codec
context, which is more robust.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-06-15 13:39:07 +02:00
Michael Niedermayer
08d006f5a8
h264: Fix HWACCEL_MAX for D3D11
...
Signed-off-by: Martin Storsjö <martin@martin.st>
2015-06-01 11:36:30 +03:00
Luca Barbato
0181ae9af2
h264: Make sure reinit failures mark the context as not initialized
...
Bug-Id: CVE-2015-3417
CC: libav-stable@libav.org
2015-05-30 16:28:32 +02:00
Steve Lhomme
d8039ef8d2
D3D11va: add a Direct3D11 video decoder similar to DXVA2
...
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
2015-05-25 11:47:08 +02:00
Anton Khirnov
a0f2946068
h264: use properly allocated AVFrames
2015-04-29 05:52:58 +02:00
Anton Khirnov
88c612e3a4
h264: merge the init and reinit paths in update_thread_context()
...
There is no real need to handle the init case specially, everything
necessary is initialized in the reinit code as well.
2015-04-29 05:52:58 +02:00
Anton Khirnov
8a66fd4026
h264: drop the reinit parameter from init_slice_header()
...
It is only used to decide whether to call free_tables(), but that
function is safe to call on an uninitialized context as well.
2015-04-29 05:52:58 +02:00
Anton Khirnov
c9ccbc7333
h264: update the current bit depth/chroma type in init_slice_header()
...
With frame threading, it is currently only updated in the context where
the change occurs, but not in any other contexts.
2015-04-29 05:52:58 +02:00
Anton Khirnov
29dcde2b87
h264: copy nal_length_size in update_thread_context
...
It does not make sense to copy is_avc without copying this as well. This
patch should not change anything for now, but will have an effect in
later commits.
2015-04-29 05:52:58 +02:00
Anton Khirnov
11f024ef0a
h264: move freeing the escaped RBSP buffer to free_context()
...
It does not logically belong in free_tables(), since it's not allocated
in alloc_tables() and its size has nothing to do with the frame size.
2015-04-29 05:52:58 +02:00
Anton Khirnov
ee62b364be
h264: eliminate ff_h264_set_parameter_from_sps()
...
That function currently does two things -- reinitializing the DSP
contexts and setting low_delay based on the SPS values.
The former more appropriately belongs in h264_slice_header_init(), while
the latter only really makes sense in decode_slice_header().
The third call to ff_h264_set_parameter_from_sps(), done immediately
after parsing a new SPS, appears to serve no useful purpose, so it is
just dropped.
Also, drop now unneeded H264Context.cur_chroma_format_idc.
2015-04-29 05:52:57 +02:00
Anton Khirnov
54986d6db9
h264: move context reinit lower down in update_thread_context()
...
It uses some fields from the SPS, which is not yet set where the reinit
is called currently.
2015-04-29 05:52:57 +02:00
Anton Khirnov
a6cd154463
h264: move the DPB init/uninit to init_context()/free_context()
...
Currently, the DPB is initialized in alloc_tables() and uninitialized in
free_tables(), but those functions manage frame size-dependent
variables, so DPB management does not logically belong in there.
Since we want the init/uninit to happen exactly once per the context
lifetime, init_context()/free_context() are the proper place for this
code.
2015-04-29 05:52:57 +02:00
Anton Khirnov
9d33bab583
h264: drop H264Context.ouputed_poc
...
It is only set, but never used for anything.
2015-04-29 05:52:57 +02:00
Anton Khirnov
27b0e6ebfd
h264: drop needs_realloc
...
It is not needed anymore since switching to refcounted frames.
2015-04-29 05:52:57 +02:00
Vittorio Giovara
6a85dfc830
lavc: Replace av_dlog and tprintf with internal macros
2015-04-19 12:41:59 +01:00
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.
2015-04-03 13:14:43 +02:00
Anton Khirnov
c28ed1d743
h264: move [uv]linesize to the per-slice context
...
While it is a per-frame variable, it is only really used in the
low-level decoding code, so it is more efficient to store it in the
slice context.
2015-03-21 11:27:16 +01:00
Anton Khirnov
a12d3188cb
h264: use a smaller struct for the ref lists
...
There is no need to store a whole H264Picture, with a full AVFrame
embedded in it. This should allow getting rid of the embedded AVFrame
later.
2015-03-21 11:27:16 +01:00
Anton Khirnov
5bf3c0fa49
h264: drop the now unused per-slice H264Contexts
2015-03-21 11:27:16 +01:00
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.
2015-03-21 11:27:15 +01:00
Anton Khirnov
92e0b7342c
h264_slice: constify all the uses of H264Context during slice decoding
...
All the variables modified by this code are either per-MB arrays or have
been moved to the per-slice context
2015-03-21 11:27:15 +01:00
Anton Khirnov
3178f4d33f
h264: move rbsp_buffer into the per-slice context
2015-03-21 11:27:15 +01:00
Anton Khirnov
582683b6ac
h264: move remaining ER stuff into the per-slice context
2015-03-21 11:27:15 +01:00
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.
2015-03-21 11:27:15 +01:00
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.
2015-03-21 11:27:15 +01:00
Anton Khirnov
e9b2383bf8
h264: move mb_mbaff into the per-slice context
2015-03-21 11:27:15 +01:00
Anton Khirnov
bc98e8c0e0
h264: move mb_field_decoding_flag into the per-slice context
2015-03-21 11:27:15 +01:00
Anton Khirnov
f42485dbce
h264: use a separate GetBitContext for slice data
2015-03-21 11:27:14 +01:00
Anton Khirnov
404a416d4b
h264: remove some remnants of data partitioning
2015-03-21 11:27:14 +01:00
Anton Khirnov
7bbc254d64
h264: move resync_mb_{x,y} into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
d4d9068cdf
h264: move mb_{x,y} into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
0edbe6faa7
h264: move mb_xy into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
07c5ca551b
h264: move is_complex into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
47a0d39350
h264: move mb_skip_run into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
9951907f6f
h264: move redundant_pic_count into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
a9b201cacf
h264: move cabac_init_idc into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
e6c90ce94f
h264: move loopfilter parameters into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
a67f8ae9a2
h264: move mvd_table into the per-slice context
2015-03-21 11:27:14 +01:00
Anton Khirnov
5c8280c307
h264: move last_qscale_diff into the per-slice context
2015-03-21 11:27:13 +01:00
Anton Khirnov
e7226984ac
h264: move [{top,left}_]cbp into the per-slice context
2015-03-21 11:27:13 +01:00
Anton Khirnov
30da98adbd
h264: move cabac[_state] into the per-slice context
2015-03-21 11:27:13 +01:00
Anton Khirnov
bf03a878a7
h264: move mb[_{padding,luma_dc}] into the per-slice context
2015-03-21 11:27:13 +01:00