Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-09-25avcodec/h264_redundant_pps_bsf: Don't remove PPSAndreas Rheinhardt
There is no check for whether these supposedly redundant PPS are actually redundant. One could check via memcmp which would work in practice* (because all content buffers are initially zero-allocated), but this is not portable as compilers may trash padding inside structures as they wish. In case the PPS is not really redundant the output is garbage. This happens with several files from the FATE-suite. E.g. h264-conformance/CVCANLMA2_Sony_C.jsv doesn't decode correctly any more, whereas h264-conformance/CABA3_TOSHIBA_E.264 even fails in ff_cbs_write_packet(), because the inferred value of num_ref_idx_l0_active_minus1 mismatches with the value set in the slice (this happens when num_ref_idx_l0_default_active_minus1 changes in the PPS; the value in the slice header is inferred from the original PPS's num_ref_idx_l0_default_active_minus1). *: Unless slice_group_id is used, i.e. unless slice_group_map_type is six. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-03-24avcodec/bsf: Add FFBitStreamFilter, hide internals of BSFsAndreas Rheinhardt
This patch is analogous to 20f972701806be20a77f808db332d9489343bb78: It hides the internal part of AVBitStreamFilter by adding a new internal structure FFBitStreamFilter (declared in bsf_internal.h) that has an AVBitStreamFilter as its first member; the internal part of AVBitStreamFilter is moved to this new structure. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-02-24Remove unnecessary libavutil/(avutil|common|internal).h inclusionsAndreas Rheinhardt
Some of these were made possible by moving several common macros to libavutil/macros.h. While just at it, also improve the other headers a bit. Reviewed-by: Martin Storsjö <martin@martin.st> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-03avcodec/h264_redundant_pps_bsf: Inline constantAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-03avcodec/h264_redundant_pps_bsf: Support multiple input PPSAndreas Rheinhardt
Up until now, the h264_redundant_pps_bsf stored the initial value of pic_init_qp_minus26 of the most recently encountered PPS; it also modified the slices based upon to assumption that the most recent PPS is the PPS the slice belongs to. Yet this assumption is flawed, as there can be several PPS with different IDs that are visible at any given time. If these have different pic_init_qp_minus26 values, the output can be invalid. Fix this by directly using the pic_init_qp_minus26 value of the input PPS. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-12-03avcodec/h264_redundant_pps_bsf: Remove flush callbackAndreas Rheinhardt
extradata_pic_init_qp is unset since fa75e438756f159a667080dcba58ea2e3b190001 (and resetting current_pic_init_qp to the value it had in extradata never made much sense). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-22Remove unnecessary mem.h inclusionsAndreas Rheinhardt
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-01-21h264_redundant_pps_bsf: Use common cbs bsf implementationMark Thompson
2020-09-02h264_redundant_pps: Make it reference-compatibleAndreas Rheinhardt
Since c6a63e11092c975b89d824f08682fe31948d3686, the parameter sets modified as content of PPS units were references shared with the CodedBitstreamH264Context, so modifying them alters the parsing process of future access units which meant that frames often got discarded because invalid values were parsed. This patch makes h264_redundant_pps compatible with the reality of reference-counted parameter sets. Fixes #7807. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: Mark Thompson <sw@jkqxz.net>
2020-07-07avcodec/cbs: Remove unused function parametersAndreas Rheinhardt
Several cbs-functions had an unused CodedBitstreamContext parameter. This commit removes these. Reviewed-by: Mark Thompson <sw@jkqxz.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
2020-05-22avcodec.h: split bitstream filters API into its own headerAnton Khirnov
2020-05-22lavc: rename bsf.h to bsf_internal.hAnton Khirnov
This will allow adding a public header named bsf.h
2019-07-09cbs: ff_cbs_delete_unit: Replace return value with assertAndreas Rheinhardt
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>
2019-07-08h264_redundant_pps: Fix looping over an access unit's unitsAndreas Rheinhardt
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>
2019-07-08h264_redundant_pps: Avoid allocations and copies of packet structuresAndreas Rheinhardt
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>
2019-02-26libavcodec/cbs: Stop needlessly reallocating the units arrayAndreas Rheinhardt
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>
2018-11-19h264_redundant_pps: Fix memleak in case of errorsAndreas Rheinhardt
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>
2018-11-11h264_redundant_pps: Fix logging contextAndreas Rheinhardt
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>
2018-08-17avcodec/h264_redundant_pps_bsf: implement a AVBSFContext.flush() callbackJames Almer
Signed-off-by: James Almer <jamrial@gmail.com>
2017-10-17lavc: Add h264_redundant_pps bitstream filterMark Thompson
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)