summaryrefslogtreecommitdiffstats
path: root/src/video_core/host1x
diff options
context:
space:
mode:
authorFengChen <vonchenplus@gmail.com>2023-02-11 15:18:54 +0100
committerFengChen <vonchenplus@gmail.com>2023-02-11 15:18:54 +0100
commit4adf39edf20189831343242a9268b8c1c59d3ab5 (patch)
treeba6773e06ff609f6dae854a6611a5780baec98ae /src/video_core/host1x
parentMerge pull request #9761 from Morph1984/oops (diff)
downloadyuzu-4adf39edf20189831343242a9268b8c1c59d3ab5.tar
yuzu-4adf39edf20189831343242a9268b8c1c59d3ab5.tar.gz
yuzu-4adf39edf20189831343242a9268b8c1c59d3ab5.tar.bz2
yuzu-4adf39edf20189831343242a9268b8c1c59d3ab5.tar.lz
yuzu-4adf39edf20189831343242a9268b8c1c59d3ab5.tar.xz
yuzu-4adf39edf20189831343242a9268b8c1c59d3ab5.tar.zst
yuzu-4adf39edf20189831343242a9268b8c1c59d3ab5.zip
Diffstat (limited to '')
-rw-r--r--src/video_core/host1x/vic.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/video_core/host1x/vic.cpp b/src/video_core/host1x/vic.cpp
index 36a04e4e0..10d7ef884 100644
--- a/src/video_core/host1x/vic.cpp
+++ b/src/video_core/host1x/vic.cpp
@@ -189,9 +189,7 @@ void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) {
for (std::size_t y = 0; y < frame_height; ++y) {
const std::size_t src = y * stride;
const std::size_t dst = y * aligned_width;
- for (std::size_t x = 0; x < frame_width; ++x) {
- luma_buffer[dst + x] = luma_src[src + x];
- }
+ std::memcpy(luma_buffer.data() + dst, luma_src + src, frame_width);
}
host1x.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(),
luma_buffer.size());
@@ -205,15 +203,15 @@ void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) {
// Frame from FFmpeg software
// Populate chroma buffer from both channels with interleaving.
const std::size_t half_width = frame_width / 2;
+ u8* chroma_buffer_data = chroma_buffer.data();
const u8* chroma_b_src = frame->data[1];
const u8* chroma_r_src = frame->data[2];
for (std::size_t y = 0; y < half_height; ++y) {
const std::size_t src = y * half_stride;
const std::size_t dst = y * aligned_width;
-
for (std::size_t x = 0; x < half_width; ++x) {
- chroma_buffer[dst + x * 2] = chroma_b_src[src + x];
- chroma_buffer[dst + x * 2 + 1] = chroma_r_src[src + x];
+ chroma_buffer_data[dst + x * 2] = chroma_b_src[src + x];
+ chroma_buffer_data[dst + x * 2 + 1] = chroma_r_src[src + x];
}
}
break;
@@ -225,9 +223,7 @@ void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) {
for (std::size_t y = 0; y < half_height; ++y) {
const std::size_t src = y * stride;
const std::size_t dst = y * aligned_width;
- for (std::size_t x = 0; x < frame_width; ++x) {
- chroma_buffer[dst + x] = chroma_src[src + x];
- }
+ std::memcpy(chroma_buffer.data() + dst, chroma_src + src, frame_width);
}
break;
}