Driectx D2D不支持YUV,必须转换成RGB32才能显示
来源:互联网 发布:免费网络硬盘 编辑:程序博客网 时间:2024/04/30 00:22
最近一直在想办法解决直接显示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.
- Driectx D2D不支持YUV,必须转换成RGB32才能显示
- Driect2D不支持YUV,必须转换成RGB32才能显示
- Driect2D不支持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格式转换的速度优化 中篇
- Adapter中notifyDataSetChanged的作用
- 借助生物学优化风电场
- WC命令
- 什么是列存储?
- C# 添加,修改,删除文件夹/文件集合
- Driectx D2D不支持YUV,必须转换成RGB32才能显示
- android widget--巴西世界杯倒计时实现?
- 释放VC++中资源文件包含的文件
- hosts文件配置,理DNS缓存
- 浅析usb转serial串口设备在linux内核中枚举创建及生成tty设备的全过程
- wxWidgets 界面编辑入门
- 在当 IDENTITY_Insert 设置为 OFF 时,不能向表 T_LOG 中的标识列插入显式值。错误
- 语音合成技术及国内外发展现状
- Firstblog