• Andreas Rheinhardt's avatar
    libavcodec/cbs: Stop needlessly reallocating the units array · b8c45bbc
    Andreas Rheinhardt authored
    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: 's avatarAndreas Rheinhardt <andreas.rheinhardt@googlemail.com>
    b8c45bbc
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...