From cf9767c608dfb49b77708966d8d07354930d150c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Thu, 3 Dec 2020 12:33:05 -0500 Subject: vp9/vic: Resolve pessimizing moves Removes the usage of moves that don't result in behavior different from a copy, or otherwise would prevent copy elision from occurring. --- src/video_core/command_classes/codecs/vp9.cpp | 20 ++++++++++---------- src/video_core/command_classes/vic.cpp | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src/video_core/command_classes') diff --git a/src/video_core/command_classes/codecs/vp9.cpp b/src/video_core/command_classes/codecs/vp9.cpp index b1d675cdb..7d8d6ee3c 100644 --- a/src/video_core/command_classes/codecs/vp9.cpp +++ b/src/video_core/command_classes/codecs/vp9.cpp @@ -355,7 +355,7 @@ void VP9::WriteMvProbabilityUpdate(VpxRangeEncoder& writer, u8 new_prob, u8 old_ Vp9PictureInfo VP9::GetVp9PictureInfo(const NvdecCommon::NvdecRegisters& state) { PictureInfo picture_info{}; gpu.MemoryManager().ReadBlock(state.picture_info_offset, &picture_info, sizeof(PictureInfo)); - Vp9PictureInfo vp9_info = std::move(picture_info.Convert()); + Vp9PictureInfo vp9_info = picture_info.Convert(); InsertEntropy(state.vp9_entropy_probs_offset, vp9_info.entropy); @@ -377,7 +377,7 @@ Vp9FrameContainer VP9::GetCurrentFrame(const NvdecCommon::NvdecRegisters& state) Vp9FrameContainer frame{}; { gpu.SyncGuestHost(); - frame.info = std::move(GetVp9PictureInfo(state)); + frame.info = GetVp9PictureInfo(state); frame.bit_stream.resize(frame.info.bitstream_size); gpu.MemoryManager().ReadBlock(state.frame_bitstream_offset, frame.bit_stream.data(), frame.info.bitstream_size); @@ -385,29 +385,29 @@ Vp9FrameContainer VP9::GetCurrentFrame(const NvdecCommon::NvdecRegisters& state) // Buffer two frames, saving the last show frame info if (!next_next_frame.bit_stream.empty()) { Vp9FrameContainer temp{ - .info = std::move(frame.info), + .info = frame.info, .bit_stream = std::move(frame.bit_stream), }; next_next_frame.info.show_frame = frame.info.last_frame_shown; - frame.info = std::move(next_next_frame.info); + frame.info = next_next_frame.info; frame.bit_stream = std::move(next_next_frame.bit_stream); next_next_frame = std::move(temp); if (!next_frame.bit_stream.empty()) { Vp9FrameContainer temp2{ - .info = std::move(frame.info), + .info = frame.info, .bit_stream = std::move(frame.bit_stream), }; next_frame.info.show_frame = frame.info.last_frame_shown; - frame.info = std::move(next_frame.info); + frame.info = next_frame.info; frame.bit_stream = std::move(next_frame.bit_stream); next_frame = std::move(temp2); } else { - next_frame.info = std::move(frame.info); + next_frame.info = frame.info; next_frame.bit_stream = std::move(frame.bit_stream); } } else { - next_next_frame.info = std::move(frame.info); + next_next_frame.info = frame.info; next_next_frame.bit_stream = std::move(frame.bit_stream); } return frame; @@ -806,8 +806,8 @@ VpxBitStreamWriter VP9::ComposeUncompressedHeader() { const std::vector& VP9::ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state) { std::vector bitstream; { - Vp9FrameContainer curr_frame = std::move(GetCurrentFrame(state)); - current_frame_info = std::move(curr_frame.info); + Vp9FrameContainer curr_frame = GetCurrentFrame(state); + current_frame_info = curr_frame.info; bitstream = std::move(curr_frame.bit_stream); } diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp index 248443027..6cfc193fa 100644 --- a/src/video_core/command_classes/vic.cpp +++ b/src/video_core/command_classes/vic.cpp @@ -58,7 +58,7 @@ void Vic::Execute() { return; } const VicConfig config{gpu.MemoryManager().Read(config_struct_address + 0x20)}; - const AVFramePtr frame_ptr = std::move(nvdec_processor->GetFrame()); + const AVFramePtr frame_ptr = nvdec_processor->GetFrame(); const auto* frame = frame_ptr.get(); if (!frame || frame->width == 0 || frame->height == 0) { return; -- cgit v1.2.3