History

libavutil/hwcontext_{d3d11va, dxva2}: Support Y212/XV36 pixel format

Use DXGI/D3DFMT 16bit pixel format to compatible with 12bit Y212/XV36 since there is no 12bit pixel defined in D3D11/D3D9. Fix cmdline on Windows: $ ffmpeg.exe -hwaccel qsv -init_hw_device qsv:hw,child_device_type= {d3d11, dxva2} -i input_12bit.bin -f null -

Fei Wang committed 2 years ago

Commit c845a071 parent df007052 files · +8 −0Browse files

Unified · Split

2 files
  1. libavutil/hwcontext_d3d11va.c +4 −0
  2. libavutil/hwcontext_dxva2.c +4 −0
libavutil/hwcontext_d3d11va.c+4−0
@@ -104,6 +104,10 @@ static const struct { · 103 unmodified lines
104 { DXGI_FORMAT_P016, AV_PIX_FMT_P012 },104 { DXGI_FORMAT_P016, AV_PIX_FMT_P012 },
105 { DXGI_FORMAT_Y216, AV_PIX_FMT_Y216 },105 { DXGI_FORMAT_Y216, AV_PIX_FMT_Y216 },
106 { DXGI_FORMAT_Y416, AV_PIX_FMT_XV48 },106 { DXGI_FORMAT_Y416, AV_PIX_FMT_XV48 },
107 // There is no 12bit pixel format defined in DXGI_FORMAT*, use 16bit to compatible
108 // with 12 bit AV_PIX_FMT* formats.
109 { DXGI_FORMAT_Y216, AV_PIX_FMT_Y212 },
110 { DXGI_FORMAT_Y416, AV_PIX_FMT_XV36 },
107 // Special opaque formats. The pix_fmt is merely a place holder, as the111 // Special opaque formats. The pix_fmt is merely a place holder, as the
108 // opaque format cannot be accessed directly.112 // opaque format cannot be accessed directly.
109 { DXGI_FORMAT_420_OPAQUE, AV_PIX_FMT_YUV420P },113 { DXGI_FORMAT_420_OPAQUE, AV_PIX_FMT_YUV420P },
libavutil/hwcontext_dxva2.c+4−0
@@ -95,6 +95,10 @@ static const struct { · 94 unmodified lines
95 { MKTAG('P', '0', '1', '6'), AV_PIX_FMT_P012 },95 { MKTAG('P', '0', '1', '6'), AV_PIX_FMT_P012 },
96 { MKTAG('Y', '2', '1', '6'), AV_PIX_FMT_Y216 },96 { MKTAG('Y', '2', '1', '6'), AV_PIX_FMT_Y216 },
97 { MKTAG('Y', '4', '1', '6'), AV_PIX_FMT_XV48 },97 { MKTAG('Y', '4', '1', '6'), AV_PIX_FMT_XV48 },
98 // There is no 12bit pixel format defined in D3DFMT*, use 16bit to compatible
99 // with 12 bit AV_PIX_FMT* formats.
100 { MKTAG('Y', '2', '1', '6'), AV_PIX_FMT_Y212 },
101 { MKTAG('Y', '4', '1', '6'), AV_PIX_FMT_XV36 },
98 { D3DFMT_P8, AV_PIX_FMT_PAL8 },102 { D3DFMT_P8, AV_PIX_FMT_PAL8 },
99 { D3DFMT_A8R8G8B8, AV_PIX_FMT_BGRA },103 { D3DFMT_A8R8G8B8, AV_PIX_FMT_BGRA },
100};104};

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t