ihmcrobotics / ihmc-video-codecs Goto Github PK
View Code? Open in Web Editor NEWThis library provides a Java library for H264 and MJPEG encoding and decoding as well as support for MP4.
License: Apache License 2.0
This library provides a Java library for H264 and MJPEG encoding and decoding as well as support for MP4.
License: Apache License 2.0
@calvertdw, I am using your library to encode YUV420 to H264, really appreciate your effort.
Right now I am trying to optimize the performance for my encoder, and I noticed that I have to slice my YUV420 ByteBuffer into 3 ByteBuffer objects and copy the data from the buffer into U and V buffers (Tried to re-use the same ByteBuffer but couldn't figure out a way, could be due to my lack of experience), I wonder whether we could add a new constructor like this one which takes a single YUV420 buffer:
`// Constructor dedicated for YUV420
YUVPicture::YUVPicture(int width, int height, int yStride, int uStride, int vStride, uint8 *in) :
type(type), width(width), height(height), yStride(yStride), uStride(uStride), vStride(vStride) {
int ySize = yStride * height;
int uSize = uStride * YUVPicture::divideByTwoRoundUp(height);
int vSize = vStride * YUVPicture::divideByTwoRoundUp(height);
Y = (uint8*) malloc(ySize);
U = (uint8*) malloc(uSize);
V = (uint8*) malloc(vSize);
memcpy(Y, in, ySize);
memcpy(U, in + width, uSize);
memcpy(V, in + (width / 4), vSize);
}
`
I did some profiling in my Java code, it takes around 100ms to slice YUV buffer into 3 for 30 full HD frames, so the performance improvement is not trivial. And since it's YUV420 frame, so we may be able to simplify the above constructor to derive yuvStride from width and height.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.