filter_units: Avoid allocations and copies of packet structures
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 17 Jun 2019 03:42:11 +0000 (05:42 +0200)
committerMark Thompson <sw@jkqxz.net>
Sun, 7 Jul 2019 21:17:07 +0000 (22:17 +0100)
commitb0810454e473dd321a27c43de2d0e9d02fdba556
tree4564345d67710217c4476d22ce9ebe05307a10e4
parent57f9bc90ae0993768c3ee70c5d9041aecc8593ed
filter_units: Avoid allocations and copies of packet structures

This commit changes filter_units 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 (or, in case of
passthrough, to av_packet_move_ref).

(b) has been made possible by the recent changes to ff_cbs_write_packet.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/filter_units_bsf.c