diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-02-02 02:13:26 +0300 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-02-02 14:42:12 +0300 |
commit | 1549ff82a944c18f8eec33ac79e6f1ecb6b4825c (patch) | |
tree | e78488095bbd08e63cfc6f0135a5823ca50f4643 /decoder | |
parent | 2de73ea7c3b524f03837e06fbd40095aa1fac23b (diff) |
P010 support in subtitle blending
Diffstat (limited to 'decoder')
-rw-r--r-- | decoder/LAVVideo/subtitles/LAVSubtitleConsumer.cpp | 8 | ||||
-rw-r--r-- | decoder/LAVVideo/subtitles/blend/blend_generic.cpp | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/decoder/LAVVideo/subtitles/LAVSubtitleConsumer.cpp b/decoder/LAVVideo/subtitles/LAVSubtitleConsumer.cpp index e1b47928..9b723b8d 100644 --- a/decoder/LAVVideo/subtitles/LAVSubtitleConsumer.cpp +++ b/decoder/LAVVideo/subtitles/LAVSubtitleConsumer.cpp @@ -212,6 +212,7 @@ static struct { { LAVPixFmt_YUV444, AV_PIX_FMT_YUVA444P }, { LAVPixFmt_YUV444bX, AV_PIX_FMT_YUVA444P }, { LAVPixFmt_NV12, AV_PIX_FMT_YUVA420P }, + { LAVPixFmt_P010, AV_PIX_FMT_YUVA420P }, { LAVPixFmt_YUY2, AV_PIX_FMT_YUVA422P }, { LAVPixFmt_RGB24, AV_PIX_FMT_BGRA }, { LAVPixFmt_RGB32, AV_PIX_FMT_BGRA }, @@ -269,6 +270,9 @@ STDMETHODIMP CLAVSubtitleConsumer::SelectBlendFunction() case LAVPixFmt_NV12: blend = &CLAVSubtitleConsumer::blend_yuv_c<uint8_t,1>; break; + case LAVPixFmt_P010: + blend = &CLAVSubtitleConsumer::blend_yuv_c<uint16_t, 1>; + break; case LAVPixFmt_YUV420: case LAVPixFmt_YUV422: case LAVPixFmt_YUV444: @@ -309,6 +313,10 @@ STDMETHODIMP CLAVSubtitleConsumer::ProcessSubtitleBitmap(LAVPixelFormat pixFmt, SelectBlendFunction(); } + // P010 is handled like its 16 bpp to compensate for having the data in the high bits + if (pixFmt == LAVPixFmt_P010) + bpp = 16; + BYTE *subData[4] = { nullptr, nullptr, nullptr, nullptr }; ptrdiff_t subStride[4] = { 0, 0, 0, 0 }; diff --git a/decoder/LAVVideo/subtitles/blend/blend_generic.cpp b/decoder/LAVVideo/subtitles/blend/blend_generic.cpp index 0e6f6285..b3286a75 100644 --- a/decoder/LAVVideo/subtitles/blend/blend_generic.cpp +++ b/decoder/LAVVideo/subtitles/blend/blend_generic.cpp @@ -64,7 +64,7 @@ DECLARE_BLEND_FUNC_IMPL(blend_rgb_c) template <class pixT, int nv12> DECLARE_BLEND_FUNC_IMPL(blend_yuv_c) { - ASSERT(pixFmt == LAVPixFmt_YUV420 || pixFmt == LAVPixFmt_NV12 || pixFmt == LAVPixFmt_YUV422 || pixFmt == LAVPixFmt_YUV444 || pixFmt == LAVPixFmt_YUV420bX || pixFmt == LAVPixFmt_YUV422bX || pixFmt == LAVPixFmt_YUV444bX); + ASSERT(pixFmt == LAVPixFmt_YUV420 || pixFmt == LAVPixFmt_NV12 || pixFmt == LAVPixFmt_YUV422 || pixFmt == LAVPixFmt_YUV444 || pixFmt == LAVPixFmt_YUV420bX || pixFmt == LAVPixFmt_YUV422bX || pixFmt == LAVPixFmt_YUV444bX || pixFmt == LAVPixFmt_P010); BYTE *y = video[0]; BYTE *u = video[1]; @@ -175,3 +175,4 @@ DECLARE_BLEND_FUNC_IMPL(blend_yuv_c) template HRESULT CLAVSubtitleConsumer::blend_yuv_c<uint8_t,1>BLEND_FUNC_PARAMS; template HRESULT CLAVSubtitleConsumer::blend_yuv_c<uint8_t,0>BLEND_FUNC_PARAMS; template HRESULT CLAVSubtitleConsumer::blend_yuv_c<uint16_t,0>BLEND_FUNC_PARAMS; +template HRESULT CLAVSubtitleConsumer::blend_yuv_c<uint16_t,1>BLEND_FUNC_PARAMS; |