-
Notifications
You must be signed in to change notification settings - Fork 770
New VideoToolbox rgb packet processor #365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
How is the CPU usage improvement? |
It's hard to measure, OS X creates a separate system process for decoding. Should I just throw in the %? I did a double check on it, and it's not using a hardware accelerated jpeg decoder contrary to what I thought. So, not sure if it's worth it. |
Ideally it should be using hardware acceleration. Even if not, an alternative is always good. Some users reported color corruption with custom compiled turbojpeg. Besides making it possible to remove the hard dependency on turbojpeg on Mac is also nice. |
275d7f9
to
f3d6e35
Compare
Now it replaces TurboJPEG for Mac OS X. |
OK it seems the above commit just makes turbojpeg optional for Mac OS. It is fine. |
Not sure what's the use of compiling TurboJPEG if it's not going to be used. In any case just updated the PR to build it anyways if it's available. |
Rebased |
Rebased |
Rebased |
0ba4ec9
to
1050caf
Compare
Just tested on my MacBook Air, and it's definitely faster than TurboJPEG by about 7-10Hz |
Can you rebase again? I took a look and it seems there is no major conflict. If you test OK, I'll merge it quickly. Also, can you add a paragraph saying "You are still able to build with optional TurboJPEG support with |
aa5fa87
to
73b8930
Compare
@xlz Rebased |
RgbPacketProcessor *rgb = new VTRgbPacketProcessor(); | ||
#else | ||
RgbPacketProcessor *rgb = new TurboJpegRgbPacketProcessor(); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you create a new function to do this?
static RgbPacketProcessor *getDefaultRgbPacketProcessor()
{
#ifdef LIBFREENECT2_WITH_VT_SUPPORT
return new VTRgbPacketProcessor();
#endif
//in the future
//#ifdef LIBFREENECT_WITH_VAAPI_SUPPORT
// return ...
//#endif
return new TurboJpegRgbPacketProcessor();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Had to change it a bit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think returning NULL is well intentioned. But the configuration in CMake makes it never return NULL, so I'm ok with this.
Mac OS X >= 10.8 has hardware accelerated jpeg decoding (a bit hidden)
New VideoToolbox rgb packet processor
There are things to consider for improvement:
|
I see a thing in your code: |
|
It seems you didn't pass some metadata as in https://github.com/OpenKinect/libfreenect2/blob/master/src/turbo_jpeg_rgb_packet_processor.cpp#L93 Can you create a new PR to fix this missing metadata, fix the nil, and fix returning NULL in |
Mac OS X >= 10.8 jpeg decoding (a bit hidden).
It's around the same speed as JpegTurbo but it's a lot gentler on the cpu:
vs