Driect2D不支持YUV,必须转换成RGB32才能显示
来源:互联网 发布:数据库的存储过程 编辑:程序博客网 时间:2024/05/16 17:05
最近一直在想办法解决直接显示YUV的问题,比如说Vc中显示YUV,看了DirectX9.0 10.0等文档,发现它不支持显示YUV,但是通过cpu将YUV转换成RGB32,速度很慢,而且cpu占用率高,但是有一种好的办法,就是采用intel的ipp或者FFMPEG库的swscale(
swscale from the FFMPEG library.),这种方法降低cpu占用率,提高性能。
Color space conversion
Most video decoders output video frames in one of the YUV420 pixel formats. It is a planar format with sub sampled chrominance values. For more on that subject, visit the FOURCC web site. The filter in this code sample supports most common DirectShow pixel formats, both planar and packed:
- YV12 – 12 bits per pixel planar format with Y plane followed by V and U planes
- I420(IYUV) – same as YV12 but V and U are swapped
- NV12 – 12 bits per pixel planar format with Y plane and interleaved UV plane
- YUY2 – 16 bits per pixel packed YUYV array
- RGB555 – 16 bits per pixel with 1 bit unused and 5 bits for each RGB channel
- RGB565 – 16 bits per pixel with 5 bits Red, 6 bits Green, and 5 bits Blue
- RGB24 – 24 bits per pixel with 8 bits for each RGB channel
- RGB32 – 32 bits per pixel with 8 bits for Alpha and 8 bits for each RGB channel
All these formats, except the last one, needs conversion to be rendered by Direct2D since for now it does not support YUV images. Since this is an introduction level article, I am using simple C methods for this purpose – unfortunately, they are slow and CPU intensive, so in real world applications, you should consider more appropriate APIs and tools like IPP or swscale from the FFMPEG library.
- Driect2D不支持YUV,必须转换成RGB32才能显示
- Driect2D不支持YUV,必须转换成RGB32才能显示
- Driectx D2D不支持YUV,必须转换成RGB32才能显示
- YUV视频格式到RGB32格式转换的速度优化 上篇
- YUV视频格式到RGB32格式转换的速度优化 上篇
- YUV视频格式到RGB32格式转换的速度优化 中篇
- YUV视频格式到RGB32格式转换的速度优化 中篇
- YUV视频格式到RGB32格式转换的速度优化 下篇
- YUV视频格式到RGB32格式转换的速度优化 下篇
- YUV视频格式到RGB32格式转换的速度优化 上篇
- YUV视频格式到RGB32格式转换的速度优化 上篇
- YUV视频格式到RGB32格式转换的速度优化 中篇
- YUV视频格式到RGB32格式转换的速度优化 下篇
- YUV视频格式到RGB32格式转换的速度优化 上篇
- YUV视频格式到RGB32格式转换的速度优化 中篇
- YUV视频格式到RGB32格式转换的速度优化 上篇
- YUV视频格式到RGB32格式转换的速度优化 上篇
- YUV视频格式到RGB32格式转换的速度优化 中篇
- 阿里上市地敲定香港 投行估值700亿美元
- UpNp消息
- Win RT再遭宏碁唱衰 微软被迫调整策略
- win7下IIS搭建ftp服务器的方法
- 链接地址后面加flag=Math.random()的作用
- Driect2D不支持YUV,必须转换成RGB32才能显示
- HTML标签p和div的不同
- sql工具:一条sql语句,查询sql server某个指定表的所有列及其属性
- Ehcache缓存的使用
- xcode release屏蔽NSLog或者自定义NSLog
- ORACLE 常用命令行记录
- Java常用类
- oracle 创建用户、创建表空间并指定用户权限
- WTL对话框中添加背景图