summaryrefslogtreecommitdiff
path: root/src/video_core/host1x/codecs
diff options
context:
space:
mode:
authorGravatar Kelebek12023-05-23 14:45:54 +0100
committerGravatar Kelebek12023-06-22 08:05:10 +0100
commit5da70f719703084482933e103e561cc98163f370 (patch)
tree1926842ed2b90bf92b89cec6a314bb28c7287fe9 /src/video_core/host1x/codecs
parentMerge pull request #10086 from Morph1984/coretiming-ng-1 (diff)
downloadyuzu-5da70f719703084482933e103e561cc98163f370.tar.gz
yuzu-5da70f719703084482933e103e561cc98163f370.tar.xz
yuzu-5da70f719703084482933e103e561cc98163f370.zip
Remove memory allocations in some hot paths
Diffstat (limited to 'src/video_core/host1x/codecs')
-rw-r--r--src/video_core/host1x/codecs/h264.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/video_core/host1x/codecs/h264.cpp b/src/video_core/host1x/codecs/h264.cpp
index 6ce179167..ce827eb6c 100644
--- a/src/video_core/host1x/codecs/h264.cpp
+++ b/src/video_core/host1x/codecs/h264.cpp
@@ -4,6 +4,7 @@
4#include <array> 4#include <array>
5#include <bit> 5#include <bit>
6 6
7#include "common/scratch_buffer.h"
7#include "common/settings.h" 8#include "common/settings.h"
8#include "video_core/host1x/codecs/h264.h" 9#include "video_core/host1x/codecs/h264.h"
9#include "video_core/host1x/host1x.h" 10#include "video_core/host1x/host1x.h"
@@ -188,7 +189,8 @@ void H264BitWriter::WriteBit(bool state) {
188} 189}
189 190
190void H264BitWriter::WriteScalingList(std::span<const u8> list, s32 start, s32 count) { 191void H264BitWriter::WriteScalingList(std::span<const u8> list, s32 start, s32 count) {
191 std::vector<u8> scan(count); 192 static Common::ScratchBuffer<u8> scan{};
193 scan.resize_destructive(count);
192 if (count == 16) { 194 if (count == 16) {
193 std::memcpy(scan.data(), zig_zag_scan.data(), scan.size()); 195 std::memcpy(scan.data(), zig_zag_scan.data(), scan.size());
194 } else { 196 } else {