How to replace JPEG codec with our own hw codec?

1,003 views
Skip to first unread message

liang ming-chuan

unread,
Dec 29, 2009, 3:26:57 AM12/29/09
to android...@googlegroups.com
hi,
 
I would like to replace the android jpeg codec with our own hw codec,
would anybody tell me where to start from?
Thanks in advance for your help.
 
Robert

Jim Huang

unread,
Dec 29, 2009, 3:37:11 AM12/29/09
to android...@googlegroups.com
2009/12/29 liang ming-chuan <lmc8...@gmail.com>:

> I would like to replace the android jpeg codec with our own hw codec,
> would anybody tell me where to start from?
> Thanks in advance for your help.
>

hi Robert,

Please check the wiki:
https://gforge.ti.com/gf/project/omapandroid/wiki/?pagename=Package+and+Release+Notes

Audio Decoder, Audio Encoder, Video Encoder, Audio/Video Decoder and
JPEG Decoder
Change list:

/hardware/ti/omap3/libskiahw/Android.mk
/hardware/ti/omap3/libskiahw/SkImageDecoderTest?.cpp
/hardware/ti/omap3/libskiahw/SkImageDecoder?_libtijpeg.cpp
/hardware/ti/omap3/libskiahw/SkImageDecoder?_libtijpeg.h
/hardware/ti/omap3/libskiahw/SkImageEncoderTest?.cpp
/hardware/ti/omap3/libskiahw/SkImageEncoder?_libtijpeg.cpp
/hardware/ti/omap3/libskiahw/SkImageEncoder?_libtijpeg.h

You can refer to the modifications from OMAPZoom Android.

Sincerely,
Jim Huang (jserv)
http://0xlab.org/

liang ming-chuan

unread,
Dec 29, 2009, 4:59:17 AM12/29/09
to android...@googlegroups.com
Thanks for your quickly response..^_^

On Tue, Dec 29, 2009 at 4:37 PM, Jim Huang <jserv.tw@gmail.com> wrote:

liang ming-chuan

unread,
Jan 10, 2010, 10:10:47 PM1/10/10
to android...@googlegroups.com
hi,
I'm studying how the JPEG codec register with android system.
The sw JPEG codec seems register with android system by following code:
 
    static SkTRegistry<SkImageDecoder*, SkStream*> gDReg(DFactory);
but I couldn't found how OMAP register with android system, I found the code in omap android:
    SkImageDecoder_HWJPEG_Factory();
but doesn't found any body call this function.
do you known how the OMAP register jpeg codec with android system?
and, how the generated libskiahw.so is link with android system?
 
Besides, I found the code in OMAP hw jpeg codec seems link to OpenMax:
    eError = TIOMX_GetHandle(&pOMXHandle, strTIJpegDec, (void *)this, &JPEGCallBack);
    ....
Why OMAP hw jpeg codec link to OpenMAX? does it has any advantage? Could I just replace the code in sw jpeg with some code calling hw directly?
Does any one who want to write a hw jpeg codec should follow the sample in OMAP to write a correct one?
 
The OMAP hw jpeg codec is too complex for me, and I even not familiar with OpenMAX..>_<
 
Thanks in andvance for your help.

liang ming-chuan

unread,
Jan 10, 2010, 10:26:56 PM1/10/10
to android...@googlegroups.com
>and, how the generated libskiahw.so is link with android system?
I just found the TIOMX_GetHandle() will call dlopen() to load .so

Gary Wang

unread,
Apr 1, 2010, 2:12:56 AM4/1/10
to android...@googlegroups.com
Dear all,

Any advice on following this question?

I also have the same question: how the TI own hw jpeg codec (i.e. libskiahw.so) be resisted when using following 

SkImageDecoder* decoder = SkImageDecoder::Factory(stream);

I can't found any part related to its codec registration.

static SkTRegistry<SkImageDecoder*, SkStream*> gDReg(DFactory);
static SkTRegistry<SkImageEncoder*, SkImageEncoder::Type> gEReg(EFactory);

Thanks!
On Mon, Jan 11, 2010 at 11:26 AM, liang ming-chuan <lmc83.tw@gmail.com> wrote:
>and, how the generated libskiahw.so is link with android system?
I just found the TIOMX_GetHandle() will call dlopen() to load .so

Deva R

unread,
Apr 1, 2010, 3:10:40 AM4/1/10
to zcw...@gmail.com, android...@googlegroups.com
codec component lists are prepared from /etc/<omx-componets>.cfg files..
make sure you rename yours as 0001_<my-omx>.cfg, so as to be picked first.

PS.
this thread talks about multiple OMX codecs
http://groups.google.com/group/android-porting/browse_thread/thread/04f3060352c1d1af/4dc14413d98a6b95


On Thu, Apr 1, 2010 at 11:42 AM, Gary Wang <zcw...@gmail.com> wrote:
> Dear all,
> Any advice on following this question?
> I also have the same question: how the TI own hw jpeg codec
> (i.e. libskiahw.so) be resisted when using following
> SkImageDecoder* decoder = SkImageDecoder::Factory(stream);
> I can't found any part related to its codec registration.
> static SkTRegistry<SkImageDecoder*, SkStream*> gDReg(DFactory);
> static SkTRegistry<SkImageEncoder*, SkImageEncoder::Type> gEReg(EFactory);
> Thanks!
> Sincerely, ~Gary Wang~
> Facebook: http://www.facebook.com/crazygary
> Albums: www.flickr.com/photos/garywang2007/, photo.xuite.net/zcwang
> Twitter: http://twitter.com/garywang
> Plurk: http://www.plurk.com/garywang
>
>

> On Mon, Jan 11, 2010 at 11:26 AM, liang ming-chuan <lmc8...@gmail.com>

Chih-Wei

unread,
Apr 1, 2010, 10:19:35 PM4/1/10
to android-porting
I checked my nexus one and found a file
$ cat /etc/01_qcomm_omx.cfg
(0xa054369c,0x22c5,0x412e,0x19,0x17,0x87,0x4c,0x1a,
0x19,0xd4,0x5f),"libqcomm_omx.so"

Could you explain what does it mean? Thank you.

On 4月1日, 下午3時10分, Deva R <r.deva...@gmail.com> wrote:
> codec component lists are prepared from /etc/<omx-componets>.cfg files..
> make sure you rename yours as 0001_<my-omx>.cfg, so as to be picked first.
> PS.

> this thread talks about multiple OMX codecshttp://groups.google.com/group/android-porting/browse_thread/thread/0...

Deva R

unread,
Apr 2, 2010, 4:02:12 AM4/2/10
to cwh...@linux.org.tw, android-porting
Hi,

> $ cat /etc/01_qcomm_omx.cfg
> (0xa054369c,0x22c5,0x412e,0x19,0x17,0x87,0x4c,0x1a,
> 0x19,0xd4,0x5f),"libqcomm_omx.so"
> Could you explain what does it mean? Thank you.

The .cfg file contrains ('api id for OMX interface', 'library name')..
More details can be found in PV Core OMX integartion guide..
Link: http://git.omapzoom.org/?p=patch/platform/external/opencore.git;a=tree;f=doc
->omx_core_integration_guide.pdf
it will be handy for u, provided that u work on adding a new codec

>>I also have the same question: how the TI own hw jpeg codec (i.e. libskiahw.so) be resisted when using following

> $ cat /etc/01_qcomm_omx.cfg
> (0xa054369c,0x22c5,0x412e,0x19,0x17,0x87,0x4c,0x1a,
> 0x19,0xd4,0x5f),"libqcomm_omx.so"

Are you sure about qcomm OMX libraries, provided you are working on TI
h/w codec??

TI OMX libraries are available at
http://android.git.kernel.org/?p=platform/hardware/ti/omap3.git;a=tree;f=omx

and probably the config parser u should have is,
http://android.git.kernel.org/?p=platform/hardware/ti/omap3.git;a=blob;f=omx/core_plugin/01_Vendor_ti_omx.cfg

> To unsubscribe, reply using "remove me" as the subject.
>

Deva R

unread,
Apr 2, 2010, 4:05:33 AM4/2/10
to cwh...@linux.org.tw, android-porting
>>>I also have the same question: how the TI own hw jpeg codec (i.e. libskiahw.so) be resisted when using following
>> $ cat /etc/01_qcomm_omx.cfg
>> (0xa054369c,0x22c5,0x412e,0x19,0x17,0x87,0x4c,0x1a,
>> 0x19,0xd4,0x5f),"libqcomm_omx.so"
> Are you sure about qcomm OMX libraries, provided you are working on TI
> h/w codec??
my bad.. they're from different authors!!! i just wish no one's blocked :-)
Reply all
Reply to author
Forward
0 new messages