Skip to content
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

Patch for optimized YUV->RGB ARM transcoding taken from Theorarm #21

Open
GoogleCodeExporter opened this issue Apr 17, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

Hello! I've spent some time and implemented the YUV2RGB conversion 
library(http://wss.co.uk/pinknoise/yuv2rgb) port from the Theorarm code, it 
gives some sensible performance boost on my devices, although I lack the good 
instruments to calculate the exact value of it. Anyway, it can be switched on 
and off using the USE_ASM_YUV2RGB debug switch. Attached is the patch for 469 
revision of doubango although I doubt much has changed since that moment so I 
think it would be applicable with small to no changes to the current trunk. 
Check it out.

Original issue reported on code.google.com by [email protected] on 12 Oct 2010 at 12:33

Attachments:

@GoogleCodeExporter
Copy link
Author

Original comment by [email protected] on 13 Oct 2010 at 11:04

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Thanks for your patch. Good job!
It helped me a lot to have an idea about how to integrate theorarm.
Does this work on iOS, Windows Mobile and Symbian?
Is it possible to have more information about the perfs?

My suggestion for the integration:
You can build "theorarm" as a shared library e.g. "libconvert.so". When 
IMSDroid starts, check if "libconvert.so" exist or not. If yes: "static boolean 
hasTheoraARM=true;"

In both IMSDroid and iDoubs you can set which chroma the video consumer 
supports. For IMSDroid, in "VideoConsumer.java" change MyProxyVideoConsumer 
constructor like this:
From:
{{{
private MyProxyVideoConsumer(VideoConsumer consumer){
    super(tmedia_chroma_t.tmedia_rgb565le);
    this.consumer = consumer;
}
}}}
To:
{{{
private MyProxyVideoConsumer(VideoConsumer consumer){
super(hasTheoraARM ? tmedia_chroma_t.tmedia_yuv420p : 
tmedia_chroma_t.tmedia_rgb565le);
    this.consumer = consumer;
}
}}}
This will tell "doubango" that the consumer support YUV420 (if "libconvert.so" 
is present) and that we don't need a converter ==> Will disable YUV2RGB 
functions. This means that VideoConsumer::consume(ProxyVideoFrame _frame) will 
receive YUV420 frames. In this function ("consume") you can call yuv2rgb() to 
convert the buffer.

Any feedback is welcome.

Original comment by [email protected] on 19 Oct 2010 at 6:01

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Any news?

Original comment by [email protected] on 9 Nov 2010 at 6:45

@GoogleCodeExporter
Copy link
Author

Sorry for a lack of answer on my side - I've currently got a load of other work 
so I was unable to implement your way of optimization, but this does not mean I 
haven't spent time on reading your post, be sure of that 8) Was going to 
implement then answer - but as you see was not able to do it in a decent 
timeframe. As I see, your offered way is safer doubango-wise since you shift 
the optimization to the client code although it's going to be a little bit 
slower due to the intercode function calls between Dalvik and compiled asm 
code. So yes it could be done and as soon as I have spare time I might 
implement it. Please keep this issue open for a while in case someone else 
wants to do something useful before I have time 8)

Original comment by [email protected] on 12 Nov 2010 at 3:17

@GoogleCodeExporter
Copy link
Author

Can i make it to a single *.so or *.a ?

Original comment by [email protected] on 25 Oct 2011 at 3:09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant