diff options
| author | TSR Berry <20988865+TSRBerry@users.noreply.github.com> | 2023-04-08 01:22:00 +0200 |
|---|---|---|
| committer | Mary <thog@protonmail.com> | 2023-04-27 23:51:14 +0200 |
| commit | cee712105850ac3385cd0091a923438167433f9f (patch) | |
| tree | 4a5274b21d8b7f938c0d0ce18736d3f2993b11b1 /Ryujinx.Graphics.Nvdec.FFmpeg/Vp8 | |
| parent | cd124bda587ef09668a971fa1cac1c3f0cfc9f21 (diff) | |
Move solution and projects to src
Diffstat (limited to 'Ryujinx.Graphics.Nvdec.FFmpeg/Vp8')
| -rw-r--r-- | Ryujinx.Graphics.Nvdec.FFmpeg/Vp8/Decoder.cs | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/Ryujinx.Graphics.Nvdec.FFmpeg/Vp8/Decoder.cs b/Ryujinx.Graphics.Nvdec.FFmpeg/Vp8/Decoder.cs deleted file mode 100644 index 3570c3ec..00000000 --- a/Ryujinx.Graphics.Nvdec.FFmpeg/Vp8/Decoder.cs +++ /dev/null @@ -1,53 +0,0 @@ -using Ryujinx.Graphics.Nvdec.FFmpeg.Native; -using Ryujinx.Graphics.Video; -using System; - -namespace Ryujinx.Graphics.Nvdec.FFmpeg.Vp8 -{ - public sealed class Decoder : IDecoder - { - public bool IsHardwareAccelerated => false; - - private readonly FFmpegContext _context = new FFmpegContext(AVCodecID.AV_CODEC_ID_VP8); - - public ISurface CreateSurface(int width, int height) - { - return new Surface(width, height); - } - - public bool Decode(ref Vp8PictureInfo pictureInfo, ISurface output, ReadOnlySpan<byte> bitstream) - { - Surface outSurf = (Surface)output; - - int uncompHeaderSize = pictureInfo.KeyFrame ? 10 : 3; - - byte[] frame = new byte[bitstream.Length + uncompHeaderSize]; - - uint firstPartSizeShifted = pictureInfo.FirstPartSize << 5; - - frame[0] = (byte)(pictureInfo.KeyFrame ? 0 : 1); - frame[0] |= (byte)((pictureInfo.Version & 7) << 1); - frame[0] |= 1 << 4; - frame[0] |= (byte)firstPartSizeShifted; - frame[1] |= (byte)(firstPartSizeShifted >> 8); - frame[2] |= (byte)(firstPartSizeShifted >> 16); - - if (pictureInfo.KeyFrame) - { - frame[3] = 0x9d; - frame[4] = 0x01; - frame[5] = 0x2a; - frame[6] = (byte)pictureInfo.FrameWidth; - frame[7] = (byte)((pictureInfo.FrameWidth >> 8) & 0x3F); - frame[8] = (byte)pictureInfo.FrameHeight; - frame[9] = (byte)((pictureInfo.FrameHeight >> 8) & 0x3F); - } - - bitstream.CopyTo(new Span<byte>(frame).Slice(uncompHeaderSize)); - - return _context.DecodeFrame(outSurf, frame) == 0; - } - - public void Dispose() => _context.Dispose(); - } -}
\ No newline at end of file |
