• Andreas Rheinhardt's avatar
    mpeg4_unpack_bframes: Avoid allocations and copies of packet structures · eb17bf6f
    Andreas Rheinhardt authored
    1. Since bd90a2ec, mpeg4_unpack_bframes caches whole packets instead of
    just the pointer to the buffer and the buffer's size in order to be able
    to make use of refcounting to avoid copying of data; this unfortunately
    introduced copies of packet structures and side data (if existing),
    although the only fields that are needed are the buffer-related ones
    (data, size and buf). This can be changed without compromising the
    advantages of refcounting by storing a reference to the buffer.
    
    2. This change also makes it easy to use only one packet throughout
    so that an allocation and free of an AVPacket structure per filtered
    packet can be saved by switching to ff_bsf_get_packet_ref.
    
    3. Furthermore, this commit also fixes a memleak introduced in bd90a2ec:
    If a stored b_frame with side data was used for a later frame, the side
    data would leak when the input frame's properties were copied into the
    output frame.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
    Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    eb17bf6f
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...