Hydrogenaudio Forums

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: KihunJang on 20 October, 2005, 12:35:27 AM

Title: Pocket PC LAME Version
Post by: KihunJang on 20 October, 2005, 12:35:27 AM
Hi.

I am Pokcet PC Developer.
I porting PC Lame project.
But encording speed is very slow.
please let me know how to set lame parameter.

please help me.
Title: Pocket PC LAME Version
Post by: Gabriel on 20 October, 2005, 01:54:34 AM
As a pocket PC developer, you probably know that you do not have any floating point unit available on your platform, don't you?
Title: Pocket PC LAME Version
Post by: KihunJang on 20 October, 2005, 02:05:17 AM
Quote
As a pocket PC developer, you probably know that you do not have any floating point unit available on your platform, don't you?
[a href="index.php?act=findpost&pid=335865"][{POST_SNAPBACK}][/a]

Thank you for your answer.
Floating point is supported by in our system, but supported is very weak.
Myabe do you have other method change from floating point to integer or others?
Have a nice day!
Title: Pocket PC LAME Version
Post by: optimus on 20 October, 2005, 02:21:32 AM
How slow is the encoding and what's your platform's CPU ?
Title: Pocket PC LAME Version
Post by: KihunJang on 20 October, 2005, 02:28:42 AM
Quote
How slow is the encoding and what's your platform's CPU ?
[a href="index.php?act=findpost&pid=335867"][{POST_SNAPBACK}][/a]


Thank you for your question.

Our CPU is XSCALE255 processor.
Encording time is 5x slower  than PC.
Plese let me know method.

Have a nice day.
Title: Pocket PC LAME Version
Post by: Gabriel on 20 October, 2005, 05:23:23 AM
Quote
Floating point is supported by in our system, but supported is very weak.

Your platform DOESN'T HAVE any fpu, so floating points are used through software emulation, which is very slow.
This means that using Lame, you will have very bad performance.
You might want to try using an integer only encoder.

Quote
Our CPU is XSCALE255 processor.
Encording time is 5x slower than PC.

On the other hand, only a 5x speed decrease from a standard PC is very good, considering the speed difference between both platforms.
So what is your current encoding speed with Lame on PPC?

Encoding speed can be adjusted with the -qx parameter.
Title: Pocket PC LAME Version
Post by: KihunJang on 20 October, 2005, 07:14:45 AM
Thank you. Garvriel.

I set -q7. But Encording speed is very slow.
And I changed sample_t to interger.
And I setting always 'no psy model'.
So encording speed is a little up. But I do not know that method is good.

But I do not know how to fix at now.
I wonder how to real-time recording at 'RESCO Audio Recorder' program.

Thank you.
Have a nice day.
Title: Pocket PC LAME Version
Post by: KihunJang on 20 October, 2005, 08:51:11 AM
Quote
Thank you. Garvriel.

I set -q7. But Encording speed is very slow.
And I changed sample_t to interger.
And I setting always 'no psy model'.
So encording speed is a little up. But I do not know that method is good.

But I do not know how to fix at now.
I wonder how to real-time recording at 'RESCO Audio Recorder' program.

Thank you.
Have a nice day.
[a href="index.php?act=findpost&pid=335912"][{POST_SNAPBACK}][/a]


I wonder how to modify mdct algorithm.
Mdct algoritm of PPC version is very slow.

Please help me.
Have nice day.
Thank you.
Title: Pocket PC LAME Version
Post by: Gabriel on 20 October, 2005, 09:59:44 AM
First, you have to check if you can hope to have encoding in real time.
What is you current encoding speed, and what are the profiling results.

If you only have 0.1x encoding speed and profiling tell you that the time is equally split between many functions, then it is hopeless.
If you are not so far from real time and most of the time is from only a few parts, then it might be doable.
Title: Pocket PC LAME Version
Post by: KihunJang on 20 October, 2005, 07:47:09 PM
Thank you for your answer.

I am sorry.
In fact I want real time encording. Because, I make recording program.

So I effort to up speed.
But I do not know how to changed floating point to fixed point.

Thanks Gabriel.
Have a nice day.
Title: Pocket PC LAME Version
Post by: Gabriel on 21 October, 2005, 01:52:03 AM
First you have to know if real time encoding can be doable if you manage to speed up some parts.
For this, you have to know the current encoding speed, and have profiling data.
Please post those data, then we will know if we can think about real time encoding.
Title: Pocket PC LAME Version
Post by: KihunJang on 21 October, 2005, 03:20:41 AM
I setting q7 and MONO.

1th Test. -> No Modify
8000Khz 8bit Mono 10 seconds wav file(75.6KB) -> Encording time 14 seconds
11025Khz 8bit Mono 10 seconds wav file(115KB) -> Encording time 21 seconds
22050Khz 8bit Mono 10 seconds wav file(209KB) -> Encording time 36 seconds

2th Test -> Modify.
1) sample_t is change short.
2) PROTOTYPES set 0.
3) BRHIST set 0.
4) 'gfc->psymodel' set false.
5) 'gfc->l3_side.tt[gr][ch].block_type' set 'SHORT_TYPE'.
6) 'adjust_ATH' function delete.

8000Khz 8bit Mono 10 seconds wav file(75.6KB) -> Encording time 8 seconds
11025Khz 8bit Mono 10 seconds wav file(115KB) -> Encording time 11 seconds
22050Khz 8bit Mono 10 seconds wav file(209KB) -> Encording time 18 seconds

8000Khz  16bit Mono 10 seconds wav file(154KB) -> Encording time 8 seconds
11025Khz 16bit Mono 10 seconds wav file(211KB) -> Encording time 12 seconds
22050Khz 16bit Mono 10 seconds wav file(426KB) -> Encording time 20 seconds

----------------
I don't know how can i get the current encoding speed and profiling data.
Please let me know and i will post them on this forum.
Have a nice day
Thanks.
Title: Pocket PC LAME Version
Post by: Gabriel on 21 October, 2005, 03:44:07 AM
Quote
2th Test -> Modify.

You changed several things. How do we/you know which change increased speed?

Quote
'gfc->psymodel' set false.

You could have used -q9

Quote
'gfc->l3_side.tt[gr][ch].block_type' set 'SHORT_TYPE'.

Regarding quality, this is very bad. Using --noshort would have been a better idea.

Quote
I don't know how can i get the current encoding speed and profiling data.
Please let me know and i will post them on this forum.

Sorry, but I do not know your development environment/compiler.

It seems that real-time encoding of 22kHz mono data might be doable, considering that your current encoding speed is 0.5x. Once again, you have to use profiling, otherwise you are just doing blind modifications.
Title: Pocket PC LAME Version
Post by: KihunJang on 21 October, 2005, 04:31:33 AM
Thank you for your answer.

I set -q9. So I use '--noshort'.

Test result is alike.

8000Khz 8bit Mono 10 seconds wav file(75.6KB) -> Encording time 8 seconds
11025Khz 8bit Mono 10 seconds wav file(115KB) -> Encording time 11~12 seconds
22050Khz 8bit Mono 10 seconds wav file(209KB) -> Encording time 18 seconds

8000Khz 16bit Mono 10 seconds wav file(154KB) -> Encording time 8 seconds
11025Khz 16bit Mono 10 seconds wav file(211KB) -> Encording time 12 seconds
22050Khz 16bit Mono 10 seconds wav file(426KB) -> Encording time 18 ~ 19 seconds

---------------------
In my opinion, a cause of slow speed problem is occur from 'windows_subbands' fuction.
Do you have solve method?

Have a nice day!
Thanks.
Title: Pocket PC LAME Version
Post by: Gabriel on 21 October, 2005, 04:55:23 AM
Quote
In my opinion, a cause of slow speed problem is occur from 'windows_subbands' fuction.

Profiling data?
Title: Pocket PC LAME Version
Post by: KihunJang on 21 October, 2005, 05:42:29 AM
Gabriel.

I am sorry.
I do not know mean 'Pofiling data'.

Please explan it more detail.

Have a nice day!
Thanks.
Title: Pocket PC LAME Version
Post by: Gabriel on 21 October, 2005, 05:47:06 AM
http://en.wikipedia.org/wiki/Profiling (http://en.wikipedia.org/wiki/Profiling)
Title: Pocket PC LAME Version
Post by: KihunJang on 21 October, 2005, 06:23:36 AM
Actually, I don't understand profiling data not enough at the site.
What is include in profiling data file?
Just in profiling date, include list of step by step operation? or not.
I am sorry that not understand your explain about profiling data.
Can you post me profiling data example file?
Thank you very much.
Title: Pocket PC LAME Version
Post by: Gabriel on 21 October, 2005, 06:33:17 AM
Profiling will tell you how much time your program spent in functions, like:

*function A: 35%
*function B: 17%
*function C: 3%
....

This way you know what to optimize, instead of blindly trying to guess bottlenecks.

Some profilers can also give you the time repartition by line number inside functions.

This kind of data is critical to achieve speedups and to establish feasability of a port to a new architecture.
Title: Pocket PC LAME Version
Post by: KihunJang on 21 October, 2005, 08:13:47 AM
Hi. Gabriel.

I am sorry.
I don't know profiling data of PPC.
So I checked step by step. This method is very slow. ^^ .

I am sorry.
Plese let me know method.
So I can post.

Thank you very much.
Title: Pocket PC LAME Version
Post by: kjoonlee on 21 October, 2005, 08:38:38 AM
Can you use gcc? Then gprof is your answer. Try looking for info on gprof or other profilers, at kldp.org or bbs.kldp.org.

If you're on Windows, try devpia.

gpgstudy.com might have some info on programming for handheld devices.
Title: Pocket PC LAME Version
Post by: scjifeng on 28 October, 2005, 05:00:17 AM
hi all!

  I am Pokcet PC Developer,too
  I am do mp3 encode in MX1/MX21(ARM920T/ARM926EJ)+embedded linux ,I find the lame which is one of the best encode software.I rewrite the makefile ,so it can run in my target machine.NOW the problem is the time ,I encode a 100K WAV file take me about 45sec,with -q9,It is too long!
  originally,I want do a real-time record mp3 from mic or line in using the mpegrec(need lame) or sox|lame,but now it is impossible because encoding time is too long.
  Then I find another quite simple encode software  especially for ARM named shine.And it have a Fixed edition with an ARM assembler to solve the without FPU problem.But now I have not successful make it (I do not know how to make the .c and .s together,the .s always error when make),so I do not know how it work.unfortunately the message about shine in Internet is quite few,I even do not know if it can do real-time record mp3 from mic or line in by the sox|shine or something other way.In my PC ,I can not do that by now.
  I am a newbie and at a loss.If you can help me ,I will appreciate it.If you have something maybe usefull for me,please let me know.
Title: Pocket PC LAME Version
Post by: kritip on 28 October, 2005, 05:21:25 AM
http://www.rjamorim.com/rrw/shine.html (http://www.rjamorim.com/rrw/shine.html) took me to:

http://www.everett9981.freeserve.co.uk/pete.htm (http://www.everett9981.freeserve.co.uk/pete.htm)

where it states

Quote
This is a port of an MP3 encoder, optimised for speed. It's simple, small, and fast. Executes at speeds of just better than real time on a 233MHz SA RPC. One version for all machines, but it will be work best (fastest) with a StrongArm processor.

Please note. This is not a high quality encoder. At a 128k bitrate it may be acceptable to you. Try it and see. If not there are links to higher quality alternatives at RISCOS.org


is that device similar speed to what you are trying to use? IF you device is a lot slower, it may not be worth it.

Kristian
Title: Pocket PC LAME Version
Post by: Gabriel on 28 October, 2005, 05:32:01 AM
Quote
NOW the problem is the time ,I encode a 100K WAV file take me about 45sec,with -q9,It is too long!

How far are you from realtime? (the size of the wav file doesn't tell us its duration)





[span style='font-size:8pt;line-height:100%']
Reminder for all our Korean friends: Shine is GPL and LAME is LGPL. Theorically, you should respect their licences.[/span]
Title: Pocket PC LAME Version
Post by: HbG on 28 October, 2005, 10:32:53 AM
What about helix (http://www.hydrogenaudio.org/forums/index.php?showtopic=35531)? It's very fast (http://www.hydrogenaudio.org/forums/index.php?showtopic=35531&st=25#) too, and it's output is of acceptable quality.
Title: Pocket PC LAME Version
Post by: Gabriel on 28 October, 2005, 10:37:02 AM
Using it in a commercial application is not really possible, and going against its license would be quite risky, as there is company with attorneys behind it.
Title: Pocket PC LAME Version
Post by: scjifeng on 30 October, 2005, 08:02:04 PM
Quote
http://www.rjamorim.com/rrw/shine.html (http://www.rjamorim.com/rrw/shine.html) took me to:

http://www.everett9981.freeserve.co.uk/pete.htm (http://www.everett9981.freeserve.co.uk/pete.htm)

where it states

Quote
This is a port of an MP3 encoder, optimised for speed. It's simple, small, and fast. Executes at speeds of just better than real time on a 233MHz SA RPC. One version for all machines, but it will be work best (fastest) with a StrongArm processor.

Please note. This is not a high quality encoder. At a 128k bitrate it may be acceptable to you. Try it and see. If not there are links to higher quality alternatives at RISCOS.org


is that device similar speed to what you are trying to use? IF you device is a lot slower, it may not be worth it.

Kristian
[{POST_SNAPBACK}][/a]
(http://index.php?act=findpost&pid=337799")



first,Thank you for all!

To Kristian,yes ,my target machine is similar speed  with it.And I have go to the  that you said ,I have down souce code shine and shine fixed ,also down the binary file sh109. but I find sh109 can not run on my machine,I can compile the shine on my machine and run,but can not compile the shine fixed,can you tell me how to?
why I can not open the [a href="http://www.everett9981.freeserve.co.uk/pete.htm]http://www.everett9981.freeserve.co.uk/pete.htm (http://www.rjamorim.com/rrw/shine.html)  ?I am in china.it is so sad!

To Gabriel,this is 100K WAV enocde message.please help me!

LAME version 3.96.1 (http://lame.sourceforge.net/)

Using polyphase lowpass filter, transition band: 17249 Hz - 17782 Hz

Encoding testcase.wav to testcase.mp3

Encoding as 44.1 kHz 128 kbps j-stereo MPEG-1 Layer III (11x) qval=9


    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA

    0/      ( 0%)|    0:00/    :      |    0:00/    :      |              x|    :

    0/23    ( 0%)|    0:00/    0:00  |    0:00/    0:00  |  0.0000x |    0:00
    21/23    (91%)|    0:45/    0:50|    0:45/    0:50  |  0.0120x |    0:04

average: 128.0 kbps                    MS: 24 (100.0%)



Writing LAME Tag...done

ReplayGain: -1.6dB


Thanks for all again!
Title: Pocket PC LAME Version
Post by: KihunJang on 31 October, 2005, 07:21:27 AM
Quote
What about helix (http://www.hydrogenaudio.org/forums/index.php?showtopic=35531)? It's very fast (http://www.hydrogenaudio.org/forums/index.php?showtopic=35531&st=25#) too, and it's output is of acceptable quality.
[a href="index.php?act=findpost&pid=337857"][{POST_SNAPBACK}][/a]


Hi.
I could port Helix module. But speed is same.
So I port shinefixed. Shinefixed is very fast. But shinefixed supported olny 44100 Khz.
'Shinefixed' use ASM. So speed is very fast.

Who know method that mdct chane asm?

Thank you.
Title: Pocket PC LAME Version
Post by: scjifeng on 31 October, 2005, 07:24:35 PM
Quote
Quote
What about helix (http://www.hydrogenaudio.org/forums/index.php?showtopic=35531)? It's very fast (http://www.hydrogenaudio.org/forums/index.php?showtopic=35531&st=25#) too, and it's output is of acceptable quality.
[a href="index.php?act=findpost&pid=337857"][{POST_SNAPBACK}][/a]


Hi.
I could port Helix module. But speed is same.
So I port shinefixed. Shinefixed is very fast. But shinefixed supported olny 44100 Khz.
'Shinefixed' use ASM. So speed is very fast.

Who know method that mdct chane asm?

Thank you.
[a href="index.php?act=findpost&pid=338474"][{POST_SNAPBACK}][/a]



HI!we meet the same problem.we can help each other to solve it.
I now prepare to change the float to the fixed and optimize code with the profiling data .The result I will post here later.
How do you port shinefixed,I just only can port the shine,what is the edition ,I write lots of makefile,It is always make error when compile the .s file.
can you send the makefile? Then I can learn how to make the .c and .s together.
Thank you very much!
my E-mail: scmango@21cn.com
Title: Pocket PC LAME Version
Post by: scjifeng on 01 November, 2005, 08:29:31 PM
hi all!

  I have changed the float to the fixed,the lame can show it help menu,but it report "floating point exception" when encoding .I know it is the changes make the problem.but do anyone know a good tool or something else can help me find where or which code and define cause this .

Thank you!
Title: Pocket PC LAME Version
Post by: robert on 02 November, 2005, 04:52:40 AM
how about using a debugger?

if you don't know what a debugger is, but have some code pieces in mind, you can add some lines printing info of the current state. this way you can find the places where your code is broken.
Title: Pocket PC LAME Version
Post by: memomai on 02 November, 2005, 07:24:26 AM
On slow PCs I use GoGo encoder. For my opinion 128 kbps with psycho acoustics and lowpass filter the quality sounds ok. For me CDEx and GoGo 313 dll is very good for fast encodings....

Maybe you should try GoGo , too. I don't know if it's faster than Helix, but I think so...