summaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_redundant_pps_bsf.c
Commit message (Collapse)AuthorAgeFilesLines
* cbs: ff_cbs_delete_unit: Replace return value with assertAndreas Rheinhardt2019-07-081-3/+1
| | | | | | | | | | ff_cbs_delete_unit never fails if the index of the unit to delete is valid, as it is with all current callers of the function. So just assert in ff_cbs_delete_unit that the index is valid and change the return value to void in order to remove the callers' checks for whether ff_cbs_delete_unit failed. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* h264_redundant_pps: Fix looping over an access unit's unitsAndreas Rheinhardt2019-07-071-0/+2
| | | | | | | | When looping over an access unit's units in positive direction and deleting some of them, one needs to make sure that a unit that is at the position of a unit that just got deleted gets checked, too. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* h264_redundant_pps: Avoid allocations and copies of packet structuresAndreas Rheinhardt2019-07-071-13/+6
| | | | | | | | | | | This commit changes h264_redundant_pps to (a) use ff_bsf_get_packet_ref instead of ff_bsf_get_packet (thereby avoiding one malloc and free per filtered packet) and (b) to use only one packet structure at all, thereby avoiding a call to av_packet_copy_props. (b) has been made possible by the recent changes to ff_cbs_write_packet. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* libavcodec/cbs: Stop needlessly reallocating the units arrayAndreas Rheinhardt2019-02-251-2/+4
| | | | | | | | | | | | | | | | | Currently, a fragment's unit array is constantly reallocated during splitting of a packet. This commit changes this: One can keep the units array by distinguishing between the number of allocated and the number of valid units in the units array. The more units a packet is split into, the bigger the benefit. So MPEG-2 benefits the most; for a video coming from an NTSC-DVD (usually 32 units per frame) the average cost of cbs_insert_unit (for a single unit) went down from 6717 decicycles to 450 decicycles (based upon 10 runs with 4194304 runs each); if each packet consists of only one unit, it went down from 2425 to 448; for a H.264 video where most packets contain nine units, it went from 4431 to 450. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com>
* h264_redundant_pps: Fix memleak in case of errorsAndreas Rheinhardt2018-11-181-14/+26
| | | | | | | | Now the fragment is uninitialized and the input packet freed in case of errors. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
* h264_redundant_pps: Fix logging contextAndreas Rheinhardt2018-11-101-1/+1
| | | | | | | | The first element of H264RedundantPPSContext is not a pointer to an AVClass as required. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avcodec/h264_redundant_pps_bsf: implement a AVBSFContext.flush() callbackJames Almer2018-08-161-0/+9
| | | | Signed-off-by: James Almer <jamrial@gmail.com>
* lavc: Add h264_redundant_pps bitstream filterMark Thompson2017-10-171-0/+178
This applies a specific fixup to some Blu-ray streams which contain redundant PPSs modifying irrelevant parameters of the stream which confuse other transformations which require correct extradata. A new single global PPS is created, and all of the redundant PPSs within the stream are removed. (cherry picked from commit e6874bc3af2f09af39b5d91b9c5f9ded67459696)
OpenPOWER on IntegriCloud