summaryrefslogtreecommitdiffstats
path: root/src/video_core/command_classes/codecs
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-11-13 01:52:51 +0100
committerameerj <52414509+ameerj@users.noreply.github.com>2021-11-13 05:52:19 +0100
commitc50f17059730dc0566e1355fead9ac00d3b60e02 (patch)
treec2ecd768c64bf84ef63c11b5d13715e98a9056af /src/video_core/command_classes/codecs
parentCMake: Enable VP8 ffmpeg decoders (diff)
downloadyuzu-c50f17059730dc0566e1355fead9ac00d3b60e02.tar
yuzu-c50f17059730dc0566e1355fead9ac00d3b60e02.tar.gz
yuzu-c50f17059730dc0566e1355fead9ac00d3b60e02.tar.bz2
yuzu-c50f17059730dc0566e1355fead9ac00d3b60e02.tar.lz
yuzu-c50f17059730dc0566e1355fead9ac00d3b60e02.tar.xz
yuzu-c50f17059730dc0566e1355fead9ac00d3b60e02.tar.zst
yuzu-c50f17059730dc0566e1355fead9ac00d3b60e02.zip
Diffstat (limited to 'src/video_core/command_classes/codecs')
-rw-r--r--src/video_core/command_classes/codecs/codec.cpp6
-rw-r--r--src/video_core/command_classes/codecs/h264.cpp4
-rw-r--r--src/video_core/command_classes/codecs/h264.h6
-rw-r--r--src/video_core/command_classes/codecs/vp8.cpp2
-rw-r--r--src/video_core/command_classes/codecs/vp8.h5
-rw-r--r--src/video_core/command_classes/codecs/vp9.cpp2
-rw-r--r--src/video_core/command_classes/codecs/vp9.h3
7 files changed, 14 insertions, 14 deletions
diff --git a/src/video_core/command_classes/codecs/codec.cpp b/src/video_core/command_classes/codecs/codec.cpp
index cf5ede204..916277811 100644
--- a/src/video_core/command_classes/codecs/codec.cpp
+++ b/src/video_core/command_classes/codecs/codec.cpp
@@ -183,11 +183,11 @@ void Codec::Decode() {
const auto& frame_data = [&]() {
switch (current_codec) {
case Tegra::NvdecCommon::VideoCodec::H264:
- return h264_decoder->ComposeFrameHeader(state, is_first_frame);
+ return h264_decoder->ComposeFrame(state, is_first_frame);
case Tegra::NvdecCommon::VideoCodec::VP8:
- return vp8_decoder->ComposeFrameHeader(state);
+ return vp8_decoder->ComposeFrame(state);
case Tegra::NvdecCommon::VideoCodec::VP9:
- vp9_decoder->ComposeFrameHeader(state);
+ vp9_decoder->ComposeFrame(state);
vp9_hidden_frame = vp9_decoder->WasFrameHidden();
return vp9_decoder->GetFrameBytes();
default:
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp
index 5519c4705..84f1fa938 100644
--- a/src/video_core/command_classes/codecs/h264.cpp
+++ b/src/video_core/command_classes/codecs/h264.cpp
@@ -45,8 +45,8 @@ H264::H264(GPU& gpu_) : gpu(gpu_) {}
H264::~H264() = default;
-const std::vector<u8>& H264::ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state,
- bool is_first_frame) {
+const std::vector<u8>& H264::ComposeFrame(const NvdecCommon::NvdecRegisters& state,
+ bool is_first_frame) {
H264DecoderContext context;
gpu.MemoryManager().ReadBlock(state.picture_info_offset, &context, sizeof(H264DecoderContext));
diff --git a/src/video_core/command_classes/codecs/h264.h b/src/video_core/command_classes/codecs/h264.h
index bfe84a472..1899d8e7f 100644
--- a/src/video_core/command_classes/codecs/h264.h
+++ b/src/video_core/command_classes/codecs/h264.h
@@ -75,9 +75,9 @@ public:
explicit H264(GPU& gpu);
~H264();
- /// Compose the H264 header of the frame for FFmpeg decoding
- [[nodiscard]] const std::vector<u8>& ComposeFrameHeader(
- const NvdecCommon::NvdecRegisters& state, bool is_first_frame = false);
+ /// Compose the H264 frame for FFmpeg decoding
+ [[nodiscard]] const std::vector<u8>& ComposeFrame(const NvdecCommon::NvdecRegisters& state,
+ bool is_first_frame = false);
private:
std::vector<u8> frame;
diff --git a/src/video_core/command_classes/codecs/vp8.cpp b/src/video_core/command_classes/codecs/vp8.cpp
index 3ee269948..32ad0ec16 100644
--- a/src/video_core/command_classes/codecs/vp8.cpp
+++ b/src/video_core/command_classes/codecs/vp8.cpp
@@ -14,7 +14,7 @@ VP8::VP8(GPU& gpu_) : gpu(gpu_) {}
VP8::~VP8() = default;
-const std::vector<u8>& VP8::ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state) {
+const std::vector<u8>& VP8::ComposeFrame(const NvdecCommon::NvdecRegisters& state) {
VP8PictureInfo info;
gpu.MemoryManager().ReadBlock(state.picture_info_offset, &info, sizeof(VP8PictureInfo));
diff --git a/src/video_core/command_classes/codecs/vp8.h b/src/video_core/command_classes/codecs/vp8.h
index d71917596..41fc7b403 100644
--- a/src/video_core/command_classes/codecs/vp8.h
+++ b/src/video_core/command_classes/codecs/vp8.h
@@ -20,9 +20,8 @@ public:
explicit VP8(GPU& gpu);
~VP8();
- /// Compose the VP8 header of the frame for FFmpeg decoding
- [[nodiscard]] const std::vector<u8>& ComposeFrameHeader(
- const NvdecCommon::NvdecRegisters& state);
+ /// Compose the VP8 frame for FFmpeg decoding
+ [[nodiscard]] const std::vector<u8>& ComposeFrame(const NvdecCommon::NvdecRegisters& state);
private:
std::vector<u8> frame;
diff --git a/src/video_core/command_classes/codecs/vp9.cpp b/src/video_core/command_classes/codecs/vp9.cpp
index 269adc3f1..2c00181fa 100644
--- a/src/video_core/command_classes/codecs/vp9.cpp
+++ b/src/video_core/command_classes/codecs/vp9.cpp
@@ -770,7 +770,7 @@ VpxBitStreamWriter VP9::ComposeUncompressedHeader() {
return uncomp_writer;
}
-void VP9::ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state) {
+void VP9::ComposeFrame(const NvdecCommon::NvdecRegisters& state) {
std::vector<u8> bitstream;
{
Vp9FrameContainer curr_frame = GetCurrentFrame(state);
diff --git a/src/video_core/command_classes/codecs/vp9.h b/src/video_core/command_classes/codecs/vp9.h
index 6ab9ef5b5..2e735c792 100644
--- a/src/video_core/command_classes/codecs/vp9.h
+++ b/src/video_core/command_classes/codecs/vp9.h
@@ -118,13 +118,14 @@ public:
/// Composes the VP9 frame from the GPU state information.
/// Based on the official VP9 spec documentation
- void ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state);
+ void ComposeFrame(const NvdecCommon::NvdecRegisters& state);
/// Returns true if the most recent frame was a hidden frame.
[[nodiscard]] bool WasFrameHidden() const {
return !current_frame_info.show_frame;
}
+ /// Returns a const reference to the composed frame data.
[[nodiscard]] const std::vector<u8>& GetFrameBytes() const {
return frame;
}