ffmpeg/avframe-queue: Set AVFrame buffer alignment to 32-byte

This is twice the required alignment for modern SSE, but it has a clear reason. On both Intel and AMD systems, a 32-byte alignment was ~15% faster than a 16-byte alignment when used with memcpy, which just so happens to be one of the main uses for these frames. Unless the encoder internally keeps its own queue of AVFrames and copies them itself, this will result in a massive speed up across all encoders.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks
2019-07-21 10:18:17 +02:00
parent 9552d12ee8
commit f744b1e9cb
+1 -1
View File
@@ -26,7 +26,7 @@ std::shared_ptr<AVFrame> ffmpeg::avframe_queue::create_frame()
frame->height = this->resolution.second;
frame->format = this->format;
int res = av_frame_get_buffer(frame.get(), 0);
int res = av_frame_get_buffer(frame.get(), 32);
if (res < 0) {
throw std::exception(ffmpeg::tools::get_error_description(res));
}