<div dir="ltr"><div>Hello everyone,<br><br></div><div>A few months ago there was a patch by "prof" to benchmark vlc using gprof through <a href="https://code.google.com/p/android-ndk-profiler/" target="_blank">https://code.google.com/p/android-ndk-profiler/</a><br>


</div><div>Recently I've tried to reapply his patch to benchmark again but it didn't work, I had undefined symbols for mcount (used by gprof). I've modified his patch and it now works for me, you might also be interested in trying yourself so I've enclosed both patches (vlc and vlc-android). I had to disable some contribs that were causing some build issues. If you still encounter build errors, please tell me.<br>

<br>
</div><div>The results<i> </i>I got are attached, they still look a bit suspicious since total time reported by gprof changes a lot between different runs with the same video.<br></div><div>- With SW the video freezes immediately, I don't know why yet.<br>


</div><div>- With HW decoding, it's difficult to benchmark since MediaCodec is an async API. However we can see the execution time is dominated by chroma conversion routines: depending on the vout format, it's either yuv_rgb_neon or deinterleave_chroma_neon. There could be room for improvement here.<br>


</div><div>- With full HW acceleration, we don't have the chroma conversion functions. We only have a handful of small functions left, most of the time is now spent in audio decoding according to gprof.<br><br></div>

<div>
I've also tried to use callgrind but since we are not a fully native app, it seems valgrind was analyzing all the Java part of our app, making the app extremely slow. Given the architecture of valgrind I don't think it's possible to only target libvlcjni.so. But I can help if you want to try and have issues trying to make it work.<br>


</div><div><br></div><div>One last thing, if you have a Snapdragon processor you should consider using Trepn (standalone APK and also an eclipse plugin) to get information like power consumption, CPU frequency, CPU load, GPU frequency, etc.<br>

<a href="https://developer.qualcomm.com/mobile-development/increase-app-performance/trepn-profiler">https://developer.qualcomm.com/mobile-development/increase-app-performance/trepn-profiler</a><br></div><div>I've done some quick tests with this app and noticed power consumption with full HW acceleration was approximately 65% of the power consumption with SW decoding, so this is good news.<br>

<br></div><div>Let me know if you have an idea why SW decoding freezes with gprof.<br></div><div><br></div><div>-- <br>Félix Abecassis<div><a href="http://felix.abecassis.me" target="_blank">http://felix.abecassis.me</a></div>


</div><div></div></div>