summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264.c
Commit message (Collapse)AuthorAgeFilesLines
* h264: derive the delay from the level when it's not presentAnton Khirnov2015-12-061-11/+4
| | | | | | | | | | | Fall back to maximum DPB size if the level is unknown. This should be more spec-compliant and does not depend on the caller setting has_b_frames before opening the decoder. The old behaviour, when the delay is supplied by the caller setting has_b_frames, can still be obtained by setting strict_std_compliance below normal.
* h264: Run VLC init under pthread_onceDerek Buitenhuis2015-10-141-1/+8
| | | | | | | This makes the h.264 decoder threadsafe to initialize. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* cabac: Make CABAC states hardcodedAnton Khirnov2015-10-081-2/+0
| | | | | | | There is not much reason to generate such a small table at runtime. Signed-off-by: Derek Buitenhuis <derekb@vimeo.com> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* h264: Do not print an error when the buffer has to be refilledLuca Barbato2015-08-061-5/+2
| | | | Partially amends 9469370fb32679352e66826daf77bdd2e6f067b5
* h264: Use AVERROR return codes instead of -1Jake Sebastian-Jones2015-08-051-3/+8
| | | | | | And report why it fails. Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* h264: fix AVDISCARD_NONKEY for some interlaced contentJohn Högberg2015-07-271-1/+1
| | | | | | | | | When skip_frame is set to _NONKEY the decoder skips everything except intra slices, which breaks frames that consist of an intra field together with any other field type; half the frame becomes garbage. This patch fixes the issue by letting non-intra slices through if they're part of a keyframe. Signed-off-by: Anton Khirnov <anton@khirnov.net>
* lavc: Consistently prefix input buffer definesVittorio Giovara2015-07-271-2/+2
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavc: AV-prefix all codec capabilitiesVittorio Giovara2015-07-271-3/+3
| | | | | | Express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* lavc: AV-prefix all codec flagsVittorio Giovara2015-07-271-6/+6
| | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* h264: Add support for Closed Caption exportKieran Kunhya2015-07-171-0/+12
| | | | Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* h264: Parse registered data SEI message and AFD valueVittorio Giovara2015-06-301-0/+10
| | | | | | Partially based on code by Marton Balint and Kieran Kunhya. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* h264: do not update the context fields copied between threads after ↵Anton Khirnov2015-06-271-1/+6
| | | | | | finish_setup() Should fix a large number of possible races with frame threading.
* h264: use properly allocated AVFramesAnton Khirnov2015-04-291-36/+45
|
* h264: embed the DPB in the contextAnton Khirnov2015-04-291-11/+4
| | | | | It now has a fixed size and is initialized only once, so there is no point in allocating it separately.
* h264: drop a comment that carries no useful informationAnton Khirnov2015-04-291-1/+1
|
* h264: move freeing the escaped RBSP buffer to free_context()Anton Khirnov2015-04-291-9/+6
| | | | | 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.
* h264: eliminate ff_h264_set_parameter_from_sps()Anton Khirnov2015-04-291-43/+0
| | | | | | | | | | | | | | 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.
* h264: move the DPB init/uninit to init_context()/free_context()Anton Khirnov2015-04-291-18/+16
| | | | | | | | | | 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.
* h264: drop H264Context.ouputed_pocAnton Khirnov2015-04-291-2/+2
| | | | It is only set, but never used for anything.
* h264: drop needs_reallocAnton Khirnov2015-04-291-3/+0
| | | | It is not needed anymore since switching to refcounted frames.
* lavc: Replace av_dlog and tprintf with internal macrosVittorio Giovara2015-04-191-1/+1
|
* h264: reset the private data in init_thread_copy()Anton Khirnov2015-04-051-2/+2
| | | | | | | | | | | 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.
* h264: remove a commented out nonsense lineAnton Khirnov2015-04-051-1/+0
|
* h264: drop redundant initialization of the scaling matricesAnton Khirnov2015-04-051-3/+0
| | | | It will always be initialized when actually parsing the PPS.
* h264: factor out common code from init() and init_thread_copy()Anton Khirnov2015-04-051-39/+43
|
* h264: drop redundant initialization in init()Anton Khirnov2015-04-051-14/+0
| | | | | There is no real advantage to initializing any of those in init, assuming yuv420, before the real stream parameters are known.
* h264: initialize cur_chroma_format_idcAnton Khirnov2015-04-051-0/+1
| | | | | | 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.
* h264: disable ER by defaultAnton Khirnov2015-04-031-0/+22
| | | | | The way it is currently designed is fundamentally unsafe and cannot be reasonably fixed without completely rewriting it.
* h264: drop some mpegvideo remnants from draw_horiz_band()Anton Khirnov2015-03-211-11/+1
| | | | This code makes no sense for h.264.
* h264: drop the now unused per-slice H264ContextsAnton Khirnov2015-03-211-11/+0
|
* h264: use the main H264Context as the parent for all slice contextsAnton Khirnov2015-03-211-24/+18
| | | | There is now no need to have per-slice copies of the H264Context.
* h264: move rbsp_buffer into the per-slice contextAnton Khirnov2015-03-211-11/+11
|
* h264: move remaining ER stuff into the per-slice contextAnton Khirnov2015-03-211-18/+17
|
* error_resilience: do not require mbintra/skip tablesAnton Khirnov2015-03-211-7/+0
| | | | h264dec does not use them at all and only allocates them for ER.
* h264: move top_borders into the per-slice contextAnton Khirnov2015-03-211-7/+4
| | | | | Also change the method for allocating to the same one as used by edge_emu_buffer.
* h264: move the scratch buffers into the per-slice contextAnton Khirnov2015-03-211-2/+10
| | | | | | | 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.
* h264.c: constify all uses of H264Context in slice and lower-level functionsAnton Khirnov2015-03-211-5/+5
| | | | | All the variables modified by this code are either per-MB arrays or have been moved to the per-slice context
* h264: use a separate GetBitContext for slice dataAnton Khirnov2015-03-211-13/+13
|
* h264: do not abuse the context as a temporary storage in get_last_needed_nal()Anton Khirnov2015-03-211-2/+3
| | | | Use a local variable instead.
* h264: remove some remnants of data partitioningAnton Khirnov2015-03-211-15/+6
|
* h264: move mb_{x,y} into the per-slice contextAnton Khirnov2015-03-211-8/+8
|
* h264: move mb_xy into the per-slice contextAnton Khirnov2015-03-211-2/+2
|
* h264: move redundant_pic_count into the per-slice contextAnton Khirnov2015-03-211-1/+1
|
* h264: move mvd_table into the per-slice contextAnton Khirnov2015-03-211-0/+3
|
* h264: move the ref lists variables into the per-slice contextAnton Khirnov2015-03-211-13/+14
|
* h264: move direct_spatial_mv_pred into the per-slice contextAnton Khirnov2015-03-211-1/+1
|
* h264: move the slice type variables into the per-slice contextAnton Khirnov2015-03-211-8/+8
|
* h264: move {mv,ref}_cache into the per-slice contextAnton Khirnov2015-03-211-8/+10
|
* h264: move non_zero_count_cache into the per-slice contextAnton Khirnov2015-03-211-1/+2
|
* h264: move *_samples_available into the per-slice contextAnton Khirnov2015-03-211-8/+9
|
OpenPOWER on IntegriCloud