androidlibyuv's People
Forkers
uniquekenzhang liubing35088 audio-video-books zhangshunhua liheng2016 zyjiang08 chenwdong meyejack msqljj haoyaogang time1992 344717871 onexuan yanleilei zhougangwei lukemouse herenxue decide15 androidjym liucy2007975 bobdeng1974 huoweian jefth nocky sinianyutian gb1025049030 iamzhongjian fengchuxiaodai xiejifu jinghao666 karima931212 gauravssnl fertalizerandroidlibyuv's Issues
指针函数数组排序问题
rgbaToI420Func 与 i420ToRgbaFunc 这两个指针函数数组中,函数指针的排序与 Key 对应不上
请教一下 RGBA 如何转换为 YUV
用 OpenGl Es glReadPixels
读取的像素数据 , GLES30.GL_RGBA
, 怎么才能转换成 yuv 呢
我用 YuvUtils.RgbaToI420(Key.RGBA_TO_I420 ,...)
转换出来的图像是乱的
NV21转I420 Jni_NV21ToI420 函数参数定义错误
nv21 yyyyVUVU 转 I420 YYYYUUVV
调用下面函数是没有做数据格式变换
//若根据输入参数第一个源数据,第二个输出数据
//而函数本身把第二个输出作为源,第一个参数被作为输出,导致真正的源数据没有被处理
int Jni_NV21ToI420(JNIEnv * env,jclass clazz,jbyteArray yuv420p,jbyteArray yuv420sp,jint width,jint height,jboolean swapUV){
size_t ySize=(size_t) (width * height);
size_t uSize=(size_t) (width * height >> 2);
size_t stride[]={0,uSize};
jbyte * yuv420pData=env->GetByteArrayElements(yuv420p,JNI_FALSE);
jbyte * yuv420spData=env->GetByteArrayElements(yuv420sp,JNI_FALSE);
int ret=libyuv::NV21ToI420((const uint8 *) yuv420spData, width, (const uint8 *) (yuv420spData + ySize), width,
(uint8 *) yuv420pData, width,
(uint8 *) (yuv420pData + ySize + stride[swapUV]), width >> 1,
(uint8 *) (yuv420pData + ySize + stride[1-swapUV]), width >> 1, width, height);
env->ReleaseByteArrayElements(yuv420p,yuv420pData,JNI_OK);
env->ReleaseByteArrayElements(yuv420sp,yuv420spData,JNI_OK);
return ret;
}
将两个参数调换位置如下即可:
int Jni_NV21ToI420(JNIEnv * env,jclass clazz,jbyteArray yuv420sp,jbyteArray yuv420p,jint width,jint height,jboolean swapUV){
//...
}
因为 NV21 格式是 YUV420sp ,I420 格式 YUV420,根据这两个格式也可说明是函数参数写错,不是我传参错误导致输出错误
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.