I420转RGB
http://blog.csdn.net/huiguixian/article/details/17288909
- public class YuvToRGB {
- private static int R = 0;
- private static int G = 1;
- private static int B = 2;
- public static int[] I420ToRGB(byte[] src, int width, int height){
- int numOfPixel = width * height;
- int positionOfV = numOfPixel;
- int positionOfU = numOfPixel/4 + numOfPixel;
- int[] rgb = new int[numOfPixel*3];
- for(int i=0; i<height; i++){
- int startY = i*width;
- int step = (i/2)*(width/2);
- int startV = positionOfV + step;
- int startU = positionOfU + step;
- for(int j = 0; j < width; j++){
- int Y = startY + j;
- int V = startV + j/2;
- int U = startU + j/2;
- int index = Y*3;
- rgb[index+B] = (int)((src[Y]&0xff) + 1.4075 * ((src[V]&0xff)-128));
- rgb[index+G] = (int)((src[Y]&0xff) - 0.3455 * ((src[U]&0xff)-128) - 0.7169*((src[V]&0xff)-128));
- rgb[index+R] = (int)((src[Y]&0xff) + 1.779 * ((src[U]&0xff)-128));
- }
- }
- return rgb;
- }
- }
I420转RGB的更多相关文章
- libyuv 编译 for android
libyuv is an open source project that includes is an instrumentation framework for building dynamic ...
- webrtc 源码结构
api WebRTC 接口层.包括 DataChannel, MediaStream, SDP相关的接口.各浏览器都是通过该接口层调用的 WebRTC. call 存放的是 WebRTC “呼叫(Ca ...
- 谈谈“色彩空间表示方法”——RGB、YUY2、YUYV、YVYU、UYVY、AYUV
转自:http://bbs.chinavideo.org/viewthread.php?tid=4143 还可参考http://www.fourcc.org/yuv.php 小知识:RGB与YUV-- ...
- yuv rgb 像素格式1
===========大小============= 一般,直接采集到的视频数据是RGB24的格式 RGB24一帧的大小size=width×heigth×3 Byte, RGB32的size=wid ...
- 转:YUV RGB 常见视频格式解析
转: http://www.cnblogs.com/qinjunni/archive/2012/02/23/2364446.html YUV RGB 常见视频格式解析 I420是YUV格式的一种,而Y ...
- 常用YUV转RGB代码
常用YUV转RGB [java] view plaincopyprint? public class YuvToRGB { private static int R = 0; private stat ...
- YUV数据YUY2到I420
/* 主要的采样格式有YCbCr 4:2:0.YCbCr 4:2:2.YCbCr 4:1:1和 YCbCr 4:4:4.其中YCbCr 4:1:1 比较常用,其含义为:每个点保存一个 8bit 的亮度 ...
- YUV转为RGB24及IplImage格式(I420和YV12)及Java版实现
http://blog.csdn.net/xy365/article/details/18735849 ———————————————————————————————————————————————— ...
- YUV与RGB互转各种公式 (YUV与RGB的转换公式有很多种,请注意区别!!!)
一. 公式:基于BT.601-6 BT601 UV 的坐标图(量化后): (横坐标为u,纵坐标为v,左下角为原点) 通过坐标图我们可以看到UV并不会包含整个坐标系,而是呈一个旋转了一定角度的八边形, ...
随机推荐
- React 组件通讯
React 父→子组件通讯 在父组件中子组件上 绑定一个 变量名={要传递的数据}:走我们去子组件中接收.... 直接用 this.props.刚刚起的变量名就ok了 上代 ...
- Channel详解
复制自:http://www.cnblogs.com/youngKen/p/4921092.html java.nio.channels.FileChannel封装了一个文件通道和一个FileChan ...
- springboot 自定义错误jsp页面
1.总览 2.application.properties spring.mvc.view.prefix=/WEB-INF/pages/ spring.mvc.view.suffix=.jsp#关闭w ...
- UVA - 294 Divisors (约数)(数论)
题意:输入两个整数L,U(1<=L<=U<=109,U-L<=10000),统计区间[L,U]的整数中哪一个的正约数最多.如果有多个,输出最小值. 分析: 1.求一个数的约数, ...
- sping--事务
事务的四大特性(ACID): 原子性(Atomicity) 一致性(Consistency) 隔离性(Isolation) 持久性(Durability) 事务属性: 1. propagation : ...
- grep -q
grep -q用于if逻辑判断 安静模式,不打印任何标准输出.如果有匹配的内容则立即返回状态值0. grep -q的用法 # if grep -q hello a.txt ; then ...
- python格式字符
- gogs 小团队使用
最近小团队开始使用 gogs 来保存手头的项目.具体的使用流程如下: 由 root 用户新建 organization, 比如说建立 hardware,然后把团队的 技术负责人拉到 owners 这个 ...
- 七牛云存储javascript-sdk和java-sdk的使用
自己做项目使用的是一台阿里云最便宜的服务器,存储空间只有40G,静态资源和动态资源都放在一起.听说七牛云存储注册认证即送10G的免费存储,想着把静态资源放在七牛云上,分担一下阿里云服务器的存储压力. ...
- 吴裕雄--天生自然 JAVASCRIPT开发学习:语句
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...