summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_slice.c
Commit message (Collapse)AuthorAgeFilesLines
* h264: pass just the PPS to get_chroma_qp()Anton Khirnov2016-06-121-6/+6
| | | | | It does not need the whole context. This will simplify the following commit.
* h264: merge the two reinit blocks in slice_header_parse()Anton Khirnov2016-06-121-19/+2
| | | | | | | | | The only difference is that the first of them contains a ff_h264_flush_change() call. While that is not necessary in the second block, it should cause no problems either. Reduce the verbosity of the reinit log message from info to verbose, since now it will be displayed during every decode session.
* h264: factor starting a new field out of parsing the slice headerAnton Khirnov2016-06-121-169/+188
|
* h264: postpone generating the implicit MMCOsAnton Khirnov2016-06-121-6/+6
| | | | | | Do it right before the MMCOs are applied to the DPB. This will allow moving the frame_start() call out of the slice header parsing, since generating the implicit MMCOs needs to be done after frame_start().
* h264: decode the MMCOs into per-slice contextsAnton Khirnov2016-06-121-11/+10
| | | | | | They are stored in the slice header, so technically they are per-slice (though they must be the same in every slice). This will simplify the following commits.
* h264: rename mmco_index to nb_mmcoAnton Khirnov2016-06-121-4/+4
| | | | | The variable stores the number of mmco entries, so the current name is misleading.
* h264: move initializing the slice start out of h264_slice_header_parse()Anton Khirnov2016-06-121-17/+16
|
* h264: move calculating the POC out of h264_slice_header_parse()Anton Khirnov2016-06-121-4/+4
| | | | | | This function does not do any bitstream parsing and it depends on the current frame being allocated, so this will allow the frame_start() to be moved out eventually.
* h264: move building the reference list out of h264_slice_header_parse()Anton Khirnov2016-06-121-3/+4
| | | | | This does not do any bitstream parsing and will allow moving out other code in later commits.
* h264: move initing the implicit pred weight table out of ↵Anton Khirnov2016-06-121-14/+14
| | | | | | | h264_slice_header_parse() It depends on the reference list, so this will allow moving out the reference list construction and consequently other code it depends on.
* h264: split reading the ref list modifications and actually building the ref ↵Anton Khirnov2016-06-121-0/+3
| | | | | | | | list This will allow postponing the reference list construction (and by consequence some other functions, like frame_start) until the whole slice header has been parsed.
* h264: move initialising the implicit pred weight table for MBAFFAnton Khirnov2016-06-121-7/+4
| | | | Do it where the normal implicit table is initialised.
* h264: call ff_h264_fill_mbaff_ref_list() when constructing the normal ref listAnton Khirnov2016-06-121-2/+0
| | | | There is no real reason to call it separately.
* h264: move direct mode inits out of h264_slice_header_parse()Anton Khirnov2016-06-121-4/+4
| | | | | This code does not do any bitstream parsing, it just initializes some internal state.
* h264: start splitting decode_slice_header()Anton Khirnov2016-06-121-16/+27
| | | | | | | | | That function is currently very long and entangles bitstream parsing and decoder configuration. This makes the code much harder to read than necessary. Begin splitting the code that configures the decoder state based on the slice header information from the parsing of the slice header.
* cosmetics: Fix spelling mistakesVittorio Giovara2016-05-041-3/+3
| | | | Signed-off-by: Diego Biurrun <diego@biurrun.de>
* h264: eliminate max_contextsAnton Khirnov2016-04-241-1/+1
| | | | It is always equal to nb_slice_ctx.
* h264: remove an artificial restriction on the number of slice threadsAnton Khirnov2016-04-241-16/+1
| | | | | This limit is now unnecessary, we can easily support an arbitrary number of threads.
* h264: remove pointless setting of some variables in loop_filterAnton Khirnov2016-04-241-2/+0
| | | | Those should already be set to the correct values.
* h264: remove a pointless commentAnton Khirnov2016-04-241-3/+0
|
* h264: make slice threading work with deblocking_filter=1Anton Khirnov2016-04-241-20/+42
| | | | | | | | | | | | In such a case, decode the MBs in parallel without the loop filter, then execute the filter serially. The ref2frm array was previously moved to H264SliceContext. That was incorrect, since it applies to all the slices and should properly be in H264Context (it did not actually break decoding, since this distinction only becomes relevant with slice threading and deblocking_filter=1, which was not implemented before this commit). The ref2frm array is thus moved back to H264Context.
* h264: remove H264Context.pict_typeAnton Khirnov2016-04-241-4/+2
| | | | | It is not used for anything internally, just exported in the output frames. So remove the indirection and set it directly in frame_start().
* h264: drop a pointless indirectionAnton Khirnov2016-04-241-3/+0
|
* h264: eliminate low_delayAnton Khirnov2016-04-241-16/+0
| | | | | | It is always unconditionally initialized in decode_postinit() and then immediately used in one place further below. All the other places where it is accessed are just useless fluff.
* h264_refs: remove an unused parameter from ff_h264_fill_mbaff_ref_list()Anton Khirnov2016-04-241-1/+1
|
* h264: eliminate copy_fieldsAnton Khirnov2016-04-241-6/+18
| | | | | It is very fragile against fields being moved and hides what is actually being copied. Copy all the fields explicitly instead.
* h264: decouple h264_sei from the h264 decoderAnton Khirnov2016-04-241-1/+1
| | | | | Make the SEI parsing independent of the H264Context, to allow decoupling the parser from the decoder.
* h264: factor out calculating the POC count into a separate fileAnton Khirnov2016-04-241-30/+31
| | | | This will allow decoupling the parser from the decoder.
* h264: decouple h264_ps from the h264 decoderAnton Khirnov2016-04-241-209/+116
| | | | | | | | | Make the SPS/PPS parsing independent of the H264Context, to allow decoupling the parser from the decoder. The change is modelled after the one done earlier for HEVC. Move the dequant buffers to the PPS to avoid complex checks whether they changed and an expensive copy for frame threads.
* h264: factor out parsing the reference count into a separate fileAnton Khirnov2016-04-241-1/+3
| | | | This will allow decoupling the parser from the decoder.
* h264: move reading direct_spatial_mv_pred out of ff_set_ref_count()Anton Khirnov2016-04-241-0/+3
| | | | | It has nothing to do with the reference count and so does not belong in this function.
* h264: Add missing ff_ prefix to internally visible h264_init_dequant_tables()Diego Biurrun2016-03-301-2/+2
|
* svq3: move the dequant buffer to SVQ3ContextAnton Khirnov2016-03-281-42/+6
| | | | Remove now unnecesary call to ff_h264_alloc_tables()
* h264: factor out pred weight table parsing into a separate fileAnton Khirnov2016-03-281-17/+18
| | | | This will allow decoupling the parser from the decoder.
* h264data: Move all data tables from a header to a .c fileDiego Biurrun2016-03-251-1/+1
|
* lavc: Deduplicate zigzag_scan tableDiego Biurrun2016-03-251-2/+2
|
* lavu: deprecate AV_PIX_FMT_VAAPI_*, replace with AV_PIX_FMT_VAAPIMark Thompson2016-03-191-1/+1
| | | | Signed-off-by: Anton Khirnov <anton@khirnov.net>
* cosmetics: Drop empty comment linesDiego Biurrun2016-02-181-1/+0
|
* h264: do not call frame_start() for missing framesAnton Khirnov2015-12-071-18/+32
| | | | | We do not need to do a full setup like for a real frame, just allocate a buffer and set cur_pic(_ptr).
* h264: set frame_num in start_frame(), not decode_slice_header()Anton Khirnov2015-12-061-3/+1
| | | | | That is a more appropriate place for it, since it is not allowed to change between slices.
* h264: eliminate default_ref_listAnton Khirnov2015-12-061-17/+1
| | | | | | | | | | | | | 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.
* lavc: AV-prefix all codec flagsVittorio Giovara2015-07-271-5/+5
| | | | | | Convert doxygen to multiline and express bitfields more simply. Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
* h264: Allow stream and container cropping at the same timeVittorio Giovara2015-06-301-5/+2
| | | | | | | | 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>
* h264: do not update the context fields copied between threads after ↵Anton Khirnov2015-06-271-47/+78
| | | | | | finish_setup() Should fix a large number of possible races with frame threading.
* h264: make sure the slices do not overlap during slice threadingAnton Khirnov2015-06-271-6/+40
| | | | | | Based on a patch by Michael Niedermayer <michaelni@gmx.at>. CC: libav-stable@libav.org Found-by: Kieran Kunhya <kierank@obe.tv>
* h264: er: Copy from the previous reference only if compatibleAndreas Cadhalpun2015-06-151-2/+5
| | | | | | | | 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>
* h264: Fix HWACCEL_MAX for D3D11Michael Niedermayer2015-06-011-0/+1
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* h264: Make sure reinit failures mark the context as not initializedLuca Barbato2015-05-301-0/+1
| | | | | Bug-Id: CVE-2015-3417 CC: libav-stable@libav.org
* D3D11va: add a Direct3D11 video decoder similar to DXVA2Steve Lhomme2015-05-251-0/+3
| | | | Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* h264: use properly allocated AVFramesAnton Khirnov2015-04-291-27/+27
|
OpenPOWER on IntegriCloud