Improved video encoder memory releasing