summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmeer J <52414509+ameerj@users.noreply.github.com>2021-10-12 20:08:37 +0200
committerGitHub <noreply@github.com>2021-10-12 20:08:37 +0200
commit018cf3853eac463ac3ca4a7231197349c45f91ae (patch)
tree79a5f1956cb80a96cf1062ebe71e446d235b2e96 /src
parentMerge pull request #7166 from FearlessTobi/port-5811 (diff)
parenth264: Use max allowed max_num_ref_frames when using CPU decoding (diff)
downloadyuzu-018cf3853eac463ac3ca4a7231197349c45f91ae.tar
yuzu-018cf3853eac463ac3ca4a7231197349c45f91ae.tar.gz
yuzu-018cf3853eac463ac3ca4a7231197349c45f91ae.tar.bz2
yuzu-018cf3853eac463ac3ca4a7231197349c45f91ae.tar.lz
yuzu-018cf3853eac463ac3ca4a7231197349c45f91ae.tar.xz
yuzu-018cf3853eac463ac3ca4a7231197349c45f91ae.tar.zst
yuzu-018cf3853eac463ac3ca4a7231197349c45f91ae.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/command_classes/codecs/h264.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp
index 51ee14c13..5519c4705 100644
--- a/src/video_core/command_classes/codecs/h264.cpp
+++ b/src/video_core/command_classes/codecs/h264.cpp
@@ -20,6 +20,8 @@
#include <array>
#include <bit>
+
+#include "common/settings.h"
#include "video_core/command_classes/codecs/h264.h"
#include "video_core/gpu.h"
#include "video_core/memory_manager.h"
@@ -96,7 +98,10 @@ const std::vector<u8>& H264::ComposeFrameHeader(const NvdecCommon::NvdecRegister
(context.h264_parameter_set.frame_mbs_only_flag ? 1 : 2);
// TODO (ameerj): Where do we get this number, it seems to be particular for each stream
- writer.WriteUe(6); // Max number of reference frames
+ const auto nvdec_decoding = Settings::values.nvdec_emulation.GetValue();
+ const bool uses_gpu_decoding = nvdec_decoding == Settings::NvdecEmulation::GPU;
+ const u32 max_num_ref_frames = uses_gpu_decoding ? 6u : 16u;
+ writer.WriteUe(max_num_ref_frames);
writer.WriteBit(false);
writer.WriteUe(context.h264_parameter_set.pic_width_in_mbs - 1);
writer.WriteUe(pic_height - 1);