diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-16 02:46:48 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-09-20 05:40:51 +0200 |
commit | 60ada0f5fa1b01e471f91115bd24d180ec74b6f8 (patch) | |
tree | 191ff59f335d1f02718163cea299eea626f59b1b /libavcodec/xvididct.h | |
parent | 5e01527330180c45da0921528ddd9f628193c157 (diff) | |
download | ffmpeg-60ada0f5fa1b01e471f91115bd24d180ec74b6f8.tar.gz |
avcodec/elbg: Keep buffers to avoid allocations and frees
Up until now, each call to avpriv_elbg_do() would result
in at least six allocations. And this function is called a lot:
A typical FATE run results in 52213653 calls to av_malloc; of these,
34974671 originate from av_malloc_array and from these 34783679
originate from avpriv_elbg_do; the msvideo1 encoder tests are behind
most of these.
This commit changes this by keeping the buffers and only reallocating
them when needed. E.g. for the encoding part of fate-vsynth1-msvideo1
total heap usage went down from 11,407,939 allocs and frees with
468,106,207 bytes allocated to 3,149 allocs and frees with 13,181,847
bytes allocated. The time for one encode2-call went down by 69%.
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/xvididct.h')
0 files changed, 0 insertions, 0 deletions