views:

95

answers:

2

I work on the task of porting a video codec written to perform on a PC, onto a mobile platform (in my case OMAP3430 MDK). Though my question is not related to a specific platform or language.

I ask for specific clues/ideas to bear in mind when porting a codec onto a Mobile Platform. What are the main differences of the PC and mobile environments. What are the common bottlenecks in Mobile platforms?

I would also appreciate any references to the academic publications related with such a task.

A: 

If all you're porting is a codec, then you have a pretty well defined task that's limited in scope - the code you're working on can be expected to be pretty well contained with relatively few dependencies on OS idiosyncrasies.

Things you want to find out ahead of time include:

  • Does your codec require a floating point unit? Does your target platform have one?
  • Is your codec heavily optimized for the Intel instruction set? Does it include assembly language routines? MMX code? SSE? If it does, can you build it with C routines that perform the same functions, just to get started, or will you have to write them from scratch?
  • Is the target platform bit endian or small endian? Can the code you're porting handle both?
Ori Pessach
Actually the code I have is not any platform specific. It can easily be compiled and run under Windows, Linux (both for PC and OMAP). My main concern is the performance since it becomes too heavy for OMAP when the code is compiled without any change.
Can Bal
Have you done any profiling? And how heavy is "too heavy"? Can it even run in real time? How much faster does it need to be?
Ori Pessach
Yes I did profiling, and the most demanding function consumes about 8% of the total execution time, so I don't expect to reduce the execution time very significantly. With the video resolution I use and for 2 views, the result is unfortunately not more than 1 fps. So I wonder if there is a special point that I miss while programming for mobile platforms. Are there any commonly known bottlenecks? What kind of operations consume more time on mobile architectures?
Can Bal
It really depends on the architecture you're targeting. Mobile CPUs tend to run at a lower clock speed than desktop CPUs, have fewer computetional resources (single core, no FPU, possibly no vector units) so optimizing for them can be a challenge. Without knowing more about your specific CPU and code, it's really hard to make general recommendations. Which compiler are you using? Are you sure you've turned on all the relevant optimizations in the compiler? Is the code you're using based on a well known codec? (ffmpeg or something similar) - knowing which codec you're trying to port might help.
Ori Pessach
By the way, if this (http://support.logicpd.com/products/som/ti/omap3430) is the platform you're targeting, I would guess that the CPU is a bit underpowered and that you'd want to look at utilizing the DSP cores, which would take some work.
Ori Pessach
A: 

Depending on the resolution and frame rate, real time requirements, and what video processing is actually required, you will probably want to implement the codec on the DSP processor of the omap soc.

Porting to from a standard PC application to TI DSP might be a fairly significant task.

simon