[vlc-commits] dxgi_fmt: set chroma sampling information
Steve Lhomme
git at videolan.org
Mon Aug 1 09:55:21 CEST 2016
vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Fri Jul 29 14:55:22 2016 +0200| [29ac1f5275bca3499bd895d74708de6bda9c0ddf] | committer: Jean-Baptiste Kempf
dxgi_fmt: set chroma sampling information
so we can pick the best candidate based on the source
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=29ac1f5275bca3499bd895d74708de6bda9c0ddf
---
modules/video_chroma/dxgi_fmt.c | 34 +++++++++++++++++-----------------
modules/video_chroma/dxgi_fmt.h | 2 ++
2 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/modules/video_chroma/dxgi_fmt.c b/modules/video_chroma/dxgi_fmt.c
index a8a9d41..27e989c 100644
--- a/modules/video_chroma/dxgi_fmt.c
+++ b/modules/video_chroma/dxgi_fmt.c
@@ -58,28 +58,28 @@ static const dxgi_format_t dxgi_formats[] = {
};
static const d3d_format_t d3d_formats[] = {
- { "NV12", DXGI_FORMAT_NV12, VLC_CODEC_NV12, 8, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM },
- { "VA_NV12", DXGI_FORMAT_NV12, VLC_CODEC_D3D11_OPAQUE, 8, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM },
- { "P010", DXGI_FORMAT_P010, VLC_CODEC_P010, 10, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16_UNORM },
- { "VA_P010", DXGI_FORMAT_P010, VLC_CODEC_D3D11_OPAQUE_10B, 10, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16_UNORM },
- { "YUY2", DXGI_FORMAT_YUY2, VLC_CODEC_YUYV, 8, DXGI_FORMAT_R8G8B8A8_UNORM, 0 },
+ { "NV12", DXGI_FORMAT_NV12, VLC_CODEC_NV12, 8, 2, 2, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM },
+ { "VA_NV12", DXGI_FORMAT_NV12, VLC_CODEC_D3D11_OPAQUE, 8, 2, 2, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM },
+ { "P010", DXGI_FORMAT_P010, VLC_CODEC_P010, 10, 2, 2, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16_UNORM },
+ { "VA_P010", DXGI_FORMAT_P010, VLC_CODEC_D3D11_OPAQUE_10B, 10, 2, 2, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16G16_UNORM },
+ { "YUY2", DXGI_FORMAT_YUY2, VLC_CODEC_YUYV, 8, 2, 2, DXGI_FORMAT_R8G8B8A8_UNORM, 0 },
#ifdef BROKEN_PIXEL
- { "AYUV", DXGI_FORMAT_AYUV, VLC_CODEC_YUVA, 8, DXGI_FORMAT_R8G8B8A8_UNORM, 0 },
- { "Y416", DXGI_FORMAT_Y416, VLC_CODEC_I444_16L, 16, DXGI_FORMAT_R16G16B16A16_UINT, 0 },
+ { "AYUV", DXGI_FORMAT_AYUV, VLC_CODEC_YUVA, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 0 },
+ { "Y416", DXGI_FORMAT_Y416, VLC_CODEC_I444_16L, 16, 1, 1, DXGI_FORMAT_R16G16B16A16_UINT, 0 },
#endif
#ifdef UNTESTED
- { "Y210", DXGI_FORMAT_Y210, VLC_CODEC_I422_10L, 10, DXGI_FORMAT_R16G16B16A16_UNORM, 0 },
- { "Y410", DXGI_FORMAT_Y410, VLC_CODEC_I444, 10, DXGI_FORMAT_R10G10B10A2_UNORM, 0 },
- { "NV11", DXGI_FORMAT_NV11, VLC_CODEC_I411, 8, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM },
+ { "Y210", DXGI_FORMAT_Y210, VLC_CODEC_I422_10L, 10, 2, 1, DXGI_FORMAT_R16G16B16A16_UNORM, 0 },
+ { "Y410", DXGI_FORMAT_Y410, VLC_CODEC_I444, 10, 1, 1, DXGI_FORMAT_R10G10B10A2_UNORM, 0 },
+ { "NV11", DXGI_FORMAT_NV11, VLC_CODEC_I411, 8, 4, 1, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8G8_UNORM },
#endif
- { "R8G8B8A8", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_RGBA, 8, DXGI_FORMAT_R8G8B8A8_UNORM, 0 },
- { "VA_RGBA", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_D3D11_OPAQUE, 8, DXGI_FORMAT_R8G8B8A8_UNORM, 0 },
- { "B8G8R8A8", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_BGRA, 8, DXGI_FORMAT_B8G8R8A8_UNORM, 0 },
- { "VA_BGRA", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_D3D11_OPAQUE, 8, DXGI_FORMAT_B8G8R8A8_UNORM, 0 },
- { "R8G8B8X8", DXGI_FORMAT_B8G8R8X8_UNORM, VLC_CODEC_RGB32, 8, DXGI_FORMAT_B8G8R8X8_UNORM, 0 },
- { "B5G6R5", DXGI_FORMAT_B5G6R5_UNORM, VLC_CODEC_RGB16, 5, DXGI_FORMAT_B5G6R5_UNORM, 0 },
+ { "R8G8B8A8", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_RGBA, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 0 },
+ { "VA_RGBA", DXGI_FORMAT_R8G8B8A8_UNORM, VLC_CODEC_D3D11_OPAQUE, 8, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, 0 },
+ { "B8G8R8A8", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_BGRA, 8, 1, 1, DXGI_FORMAT_B8G8R8A8_UNORM, 0 },
+ { "VA_BGRA", DXGI_FORMAT_B8G8R8A8_UNORM, VLC_CODEC_D3D11_OPAQUE, 8, 1, 1, DXGI_FORMAT_B8G8R8A8_UNORM, 0 },
+ { "R8G8B8X8", DXGI_FORMAT_B8G8R8X8_UNORM, VLC_CODEC_RGB32, 8, 1, 1, DXGI_FORMAT_B8G8R8X8_UNORM, 0 },
+ { "B5G6R5", DXGI_FORMAT_B5G6R5_UNORM, VLC_CODEC_RGB16, 5, 1, 1, DXGI_FORMAT_B5G6R5_UNORM, 0 },
- { NULL, 0, 0, 0, 0, 0}
+ { NULL, 0, 0, 0, 0, 0, 0, 0}
};
const char *DxgiFormatToStr(DXGI_FORMAT format)
diff --git a/modules/video_chroma/dxgi_fmt.h b/modules/video_chroma/dxgi_fmt.h
index a70274f..a95af63 100644
--- a/modules/video_chroma/dxgi_fmt.h
+++ b/modules/video_chroma/dxgi_fmt.h
@@ -34,6 +34,8 @@ typedef struct
DXGI_FORMAT formatTexture;
vlc_fourcc_t fourcc;
uint8_t bitsPerChannel;
+ uint8_t widthDenominator;
+ uint8_t heightDenominator;
DXGI_FORMAT formatY;
DXGI_FORMAT formatUV;
} d3d_format_t;
More information about the vlc-commits
mailing list