mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-08-01 18:49:05 -06:00
Support NVDEC H264 interlaced video decoding and VIC deinterlacing (#3225)
* Support NVDEC H264 interlaced video decoding and VIC deinterlacing * Remove unused code
This commit is contained in:
12
Ryujinx.Graphics.Vic/Types/DeinterlaceMode.cs
Normal file
12
Ryujinx.Graphics.Vic/Types/DeinterlaceMode.cs
Normal file
@ -0,0 +1,12 @@
|
||||
namespace Ryujinx.Graphics.Vic.Types
|
||||
{
|
||||
enum DeinterlaceMode
|
||||
{
|
||||
Weave,
|
||||
BobField,
|
||||
Bob,
|
||||
NewBob,
|
||||
Disi1,
|
||||
WeaveLumaBobFieldChroma
|
||||
}
|
||||
}
|
79
Ryujinx.Graphics.Vic/Types/FrameFormat.cs
Normal file
79
Ryujinx.Graphics.Vic/Types/FrameFormat.cs
Normal file
@ -0,0 +1,79 @@
|
||||
namespace Ryujinx.Graphics.Vic.Types
|
||||
{
|
||||
enum FrameFormat
|
||||
{
|
||||
Progressive,
|
||||
InterlacedTopFieldFirst,
|
||||
InterlacedBottomFieldFirst,
|
||||
TopField,
|
||||
BottomField,
|
||||
SubPicProgressive,
|
||||
SubPicInterlacedTopFieldFirst,
|
||||
SubPicInterlacedBottomFieldFirst,
|
||||
SubPicTopField,
|
||||
SubPicBottomField,
|
||||
TopFieldChromaBottom,
|
||||
BottomFieldChromaTop,
|
||||
SubPicTopFieldChromaBottom,
|
||||
SubPicBottomFieldChromaTop
|
||||
}
|
||||
|
||||
static class FrameFormatExtensions
|
||||
{
|
||||
public static bool IsField(this FrameFormat frameFormat)
|
||||
{
|
||||
switch (frameFormat)
|
||||
{
|
||||
case FrameFormat.TopField:
|
||||
case FrameFormat.BottomField:
|
||||
case FrameFormat.SubPicTopField:
|
||||
case FrameFormat.SubPicBottomField:
|
||||
case FrameFormat.TopFieldChromaBottom:
|
||||
case FrameFormat.BottomFieldChromaTop:
|
||||
case FrameFormat.SubPicTopFieldChromaBottom:
|
||||
case FrameFormat.SubPicBottomFieldChromaTop:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsInterlaced(this FrameFormat frameFormat)
|
||||
{
|
||||
switch (frameFormat)
|
||||
{
|
||||
case FrameFormat.InterlacedTopFieldFirst:
|
||||
case FrameFormat.InterlacedBottomFieldFirst:
|
||||
case FrameFormat.SubPicInterlacedTopFieldFirst:
|
||||
case FrameFormat.SubPicInterlacedBottomFieldFirst:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool IsInterlacedBottomFirst(this FrameFormat frameFormat)
|
||||
{
|
||||
return frameFormat == FrameFormat.InterlacedBottomFieldFirst ||
|
||||
frameFormat == FrameFormat.SubPicInterlacedBottomFieldFirst;
|
||||
}
|
||||
|
||||
public static bool IsTopField(this FrameFormat frameFormat, bool isLuma)
|
||||
{
|
||||
switch (frameFormat)
|
||||
{
|
||||
case FrameFormat.TopField:
|
||||
case FrameFormat.SubPicTopField:
|
||||
return true;
|
||||
case FrameFormat.TopFieldChromaBottom:
|
||||
case FrameFormat.SubPicTopFieldChromaBottom:
|
||||
return isLuma;
|
||||
case FrameFormat.BottomFieldChromaTop:
|
||||
case FrameFormat.SubPicBottomFieldChromaTop:
|
||||
return !isLuma;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
@ -27,7 +27,7 @@
|
||||
public bool PrevMotionFieldEnable => _word0.Extract(13);
|
||||
public bool PpMotionFieldEnable => _word0.Extract(14);
|
||||
public bool CombMotionFieldEnable => _word0.Extract(15);
|
||||
public int FrameFormat => _word0.Extract(16, 4);
|
||||
public FrameFormat FrameFormat => (FrameFormat)_word0.Extract(16, 4);
|
||||
public int FilterLengthY => _word0.Extract(20, 2);
|
||||
public int FilterLengthX => _word0.Extract(22, 2);
|
||||
public int Panoramic => _word0.Extract(24, 12);
|
||||
@ -36,7 +36,7 @@
|
||||
public int FilterDetail => _word1.Extract(74, 10);
|
||||
public int ChromaNoise => _word1.Extract(84, 10);
|
||||
public int ChromaDetail => _word1.Extract(94, 10);
|
||||
public int DeinterlaceMode => _word1.Extract(104, 4);
|
||||
public DeinterlaceMode DeinterlaceMode => (DeinterlaceMode)_word1.Extract(104, 4);
|
||||
public int MotionAccumWeight => _word1.Extract(108, 3);
|
||||
public int NoiseIir => _word1.Extract(111, 11);
|
||||
public int LightLevel => _word1.Extract(122, 4);
|
||||
|
Reference in New Issue
Block a user