Adding 32 bit alignment for simd into our AV_ALLOCATE_IMAGE macro, and some code cleanup

This commit is contained in:
Jonathan Thomas
2025-05-23 18:35:03 -05:00
parent 4983a45f74
commit 68b885ee77
2 changed files with 5 additions and 6 deletions

View File

@@ -1307,10 +1307,9 @@ bool FFmpegReader::GetAVFrame() {
frameFinished = 1;
packet_status.video_decoded++;
// align 32 for simd
if (av_image_alloc(pFrame->data, pFrame->linesize, info.width,
info.height, (AVPixelFormat)(pStream->codecpar->format), 32) <= 0) {
throw OutOfMemory("Failed to allocate image buffer", path);
// Allocate image (align 32 for simd)
if (AV_ALLOCATE_IMAGE(pFrame, (AVPixelFormat)(pStream->codecpar->format), info.width, info.height) <= 0) {
throw OutOfMemory("Failed to allocate image buffer", path);
}
av_image_copy(pFrame->data, pFrame->linesize, (const uint8_t**)next_frame->data, next_frame->linesize,
(AVPixelFormat)(pStream->codecpar->format), info.width, info.height);