Converting RGB8888 to ARGB32_Premultiplied (for performance reasons)

This commit is contained in:
Jonathan Thomas
2020-10-13 18:18:10 -05:00
parent 91945f03dc
commit 94059828d5
9 changed files with 22 additions and 27 deletions

View File

@@ -1363,7 +1363,7 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) {
scale_mode = SWS_BICUBIC;
}
SwsContext *img_convert_ctx = sws_getContext(info.width, info.height, AV_GET_CODEC_PIXEL_FORMAT(pStream, pCodecCtx), width,
height, PIX_FMT_RGBA, scale_mode, NULL, NULL, NULL);
height, AV_PIX_FMT_RGB32, scale_mode, NULL, NULL, NULL);
// Resize / Convert to RGB
sws_scale(img_convert_ctx, my_frame->data, my_frame->linesize, 0,
@@ -1373,7 +1373,7 @@ void FFmpegReader::ProcessVideoPacket(int64_t requested_frame) {
std::shared_ptr<Frame> f = CreateFrame(current_frame);
// Add Image data to frame
f->AddImage(width, height, 4, QImage::Format_RGBA8888, buffer);
f->AddImage(width, height, 4, QImage::Format_ARGB32_Premultiplied, buffer);
// Update working cache
working_cache.Add(f);