Giter Site home page Giter Site logo

ihmcrobotics / ihmc-video-codecs Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 5.0 4.3 MB

This library provides a Java library for H264 and MJPEG encoding and decoding as well as support for MP4.

License: Apache License 2.0

CMake 0.86% C++ 16.83% Java 81.51% SWIG 0.65% Kotlin 0.16%

ihmc-video-codecs's People

Contributors

calvertdw avatar ds58 avatar jerrypratt avatar jespersmith avatar nathanphilliber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ihmc-video-codecs's Issues

Optimize for YUV420

@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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.