avcodec/elbg: Keep buffers to avoid allocations and frees