On 29/06/17 02:16, Jun Zhao wrote: > On 2017/6/28 5:50, Mark Thompson wrote: >> --- >> libavfilter/Makefile | 6 + >> libavfilter/opencl.c | 285 >> +++++++++++++++++++++++++++++++++++++++++++ >> libavfilter/opencl.h | 74 +++++++++++ >> libavfilter/opencl/rgbyuv.cl | 117 ++++++++++++++++++ >> libavfilter/opencl_source.h | 24 ++++ >> tools/cl2c | 20 +++ >> 6 files changed, 526 insertions(+) > > I guess we can give a general Colour Space Conversions solution based on > OpenCL, now > I can think some case can't support in this patch. :) e,g: > > - 10bits <-> 8bits
This does actually work already by magic :) Both NV12 and P010 surfaces become UNORM R and RG planes, just with a different size of sample underneath. Use in OpenCL then sees them identically as planes of single-precision floating point values. (Technically it isn't quite right for P010 because the low bits don't necessarily do the right thing, but it's close enough for practical purposes.) > - YUV422 <-> 420P Trickier because the layouts are genuinely different: 4:2:2 planar formats will be fine as-is (though requiring different OpenCL code), but there is no straightforward representation for single-plane interleaved YUYV so it's unclear what to do there. (There are quite a lot of other holes in this as well - e.g. chroma siting and range aren't considered at all.) _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel