diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/host1x/vic.cpp | 14 |
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) { | |||
| 189 | for (std::size_t y = 0; y < frame_height; ++y) { | 189 | for (std::size_t y = 0; y < frame_height; ++y) { |
| 190 | const std::size_t src = y * stride; | 190 | const std::size_t src = y * stride; |
| 191 | const std::size_t dst = y * aligned_width; | 191 | const std::size_t dst = y * aligned_width; |
| 192 | for (std::size_t x = 0; x < frame_width; ++x) { | 192 | std::memcpy(luma_buffer.data() + dst, luma_src + src, frame_width); |
| 193 | luma_buffer[dst + x] = luma_src[src + x]; | ||
| 194 | } | ||
| 195 | } | 193 | } |
| 196 | host1x.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), | 194 | host1x.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), |
| 197 | luma_buffer.size()); | 195 | luma_buffer.size()); |
| @@ -205,15 +203,15 @@ void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) { | |||
| 205 | // Frame from FFmpeg software | 203 | // Frame from FFmpeg software |
| 206 | // Populate chroma buffer from both channels with interleaving. | 204 | // Populate chroma buffer from both channels with interleaving. |
| 207 | const std::size_t half_width = frame_width / 2; | 205 | const std::size_t half_width = frame_width / 2; |
| 206 | u8* chroma_buffer_data = chroma_buffer.data(); | ||
| 208 | const u8* chroma_b_src = frame->data[1]; | 207 | const u8* chroma_b_src = frame->data[1]; |
| 209 | const u8* chroma_r_src = frame->data[2]; | 208 | const u8* chroma_r_src = frame->data[2]; |
| 210 | for (std::size_t y = 0; y < half_height; ++y) { | 209 | for (std::size_t y = 0; y < half_height; ++y) { |
| 211 | const std::size_t src = y * half_stride; | 210 | const std::size_t src = y * half_stride; |
| 212 | const std::size_t dst = y * aligned_width; | 211 | const std::size_t dst = y * aligned_width; |
| 213 | |||
| 214 | for (std::size_t x = 0; x < half_width; ++x) { | 212 | for (std::size_t x = 0; x < half_width; ++x) { |
| 215 | chroma_buffer[dst + x * 2] = chroma_b_src[src + x]; | 213 | chroma_buffer_data[dst + x * 2] = chroma_b_src[src + x]; |
| 216 | chroma_buffer[dst + x * 2 + 1] = chroma_r_src[src + x]; | 214 | chroma_buffer_data[dst + x * 2 + 1] = chroma_r_src[src + x]; |
| 217 | } | 215 | } |
| 218 | } | 216 | } |
| 219 | break; | 217 | break; |
| @@ -225,9 +223,7 @@ void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) { | |||
| 225 | for (std::size_t y = 0; y < half_height; ++y) { | 223 | for (std::size_t y = 0; y < half_height; ++y) { |
| 226 | const std::size_t src = y * stride; | 224 | const std::size_t src = y * stride; |
| 227 | const std::size_t dst = y * aligned_width; | 225 | const std::size_t dst = y * aligned_width; |
| 228 | for (std::size_t x = 0; x < frame_width; ++x) { | 226 | std::memcpy(chroma_buffer.data() + dst, chroma_src + src, frame_width); |
| 229 | chroma_buffer[dst + x] = chroma_src[src + x]; | ||
| 230 | } | ||
| 231 | } | 227 | } |
| 232 | break; | 228 | break; |
| 233 | } | 229 | } |