yuv420_to_nv21
来源:互联网 发布:职场社交软件 编辑:程序博客网 时间:2024/06/14 03:57
#include <string.h>
void convert_yuv420_to_nv21(unsigned char * dest, const unsigned char * source, int width, int height)
{
int area = height * width;
int sqarea = area >> 3;
int qarea = area >> 2;
int count = sqarea;
const unsigned short * su = (const unsigned short *) (source + area);
const unsigned short * sv = (const unsigned short *) (source + area + qarea);
unsigned int * uv = (unsigned int *)(dest + area);
/* copy y as is */
memcpy(dest, source, area);
do
{
unsigned int u = *su++;
unsigned int v = *sv++;
*uv++ = ( ( (u & 0x00FF) << 8 ) |
( (u & 0xFF00) << 16) |
( (v & 0x00FF) ) |
( (v & 0xFF00) << 8) );
} while (--count);
}
注:这种转换是小端法机器上的转换
- yuv420_to_nv21
- 使用UI Automation实现自动化测试--4.6.1
- 《partner4java 讲述jBPM4》之第一步:jBPM4概念 & helloworld
- MySQL修改默认字符集
- js回调函数、父画面与子画面之间的js回调函数(含参数传递)
- 使用UI Automation实现自动化测试--4.6.2
- yuv420_to_nv21
- 查询数据库当前连接数(session),进程数等操作
- 卸载jdk并重装后NetBeans启动时提示您使用默认Java_home设置的解决办法
- windows server 2008 R1/R2添加无线网络
- Android ListView 几个重要属性
- oracle日期相减
- 2013年春运 火车票 订购全攻略 利用FireFox及FireBug扩展15秒快速预定火车票教程
- ORACLE GROUPING函数的使用
- EXT tree 事件