Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: new Open Source mp3 Encoder from Helix Community (Read 223848 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

new Open Source mp3 Encoder from Helix Community

Reply #75
Quote
I (easily) managed to compile the c(++) code in Linux and the bin works in a quick test. But is there an easy way to get the asm files converted to nasm style?
[{POST_SNAPBACK}][/a]


intel2gas, 1.3.3, A converter between the NASM and GAS asm format (Intel/AT&T)
[a href="http://freshmeat.net/projects/intel2gas/]http://freshmeat.net/projects/intel2gas/[/url]

homepage:
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/

new Open Source mp3 Encoder from Helix Community

Reply #76
CML's rev10

Length bug fixed, thank level


Comment: At first, I only wan't to make a compile of this encoder. Later on, it becomes work of a lot of tweaks, bug fixes and adding of new features.

So don't blame me much if I make you confused by frequent updates. I just want to help. It's another choice of available mp3 encoder with good speed. So you guys just enjoy encoding. You don't have to keep pace with all the minor updats because there's no quality improvement.

new Open Source mp3 Encoder from Helix Community

Reply #77
Quote
CML's rev10
1). Length bug fixed, thank level

Yes, this works now; thanks to you  .

new Open Source mp3 Encoder from Helix Community

Reply #78
Quote
Quote
I (easily) managed to compile the c(++) code in Linux and the bin works in a quick test. But is there an easy way to get the asm files converted to nasm style?
[{POST_SNAPBACK}][/a]


intel2gas, 1.3.3, A converter between the NASM and GAS asm format (Intel/AT&T)
[a href="http://freshmeat.net/projects/intel2gas/]http://freshmeat.net/projects/intel2gas/[/url]

homepage:
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/
[a href="index.php?act=findpost&pid=315009"][{POST_SNAPBACK}][/a]


Maybe I haven't been too clear. I don't intend to use the inline assembler of gcc. Merely I want to use NASM, which is able to understand intel syntax. The problem is the assembler files are written for MASM (intel syntax, as well). It seems MASM uses (slightly?) different style than NASM, but as I am not a big assembler coder, I don't exactly know how to convert the files.

Converting the asm files to NASM would make the code a lot more portable (*hint* *hint*).

new Open Source mp3 Encoder from Helix Community

Reply #79
Quote
Quote
Quote
I (easily) managed to compile the c(++) code in Linux and the bin works in a quick test. But is there an easy way to get the asm files converted to nasm style?
[{POST_SNAPBACK}][/a]


intel2gas, 1.3.3, A converter between the NASM and GAS asm format (Intel/AT&T)
[a href="http://freshmeat.net/projects/intel2gas/]http://freshmeat.net/projects/intel2gas/[/url]

homepage:
http://www.niksula.cs.hut.fi/~mtiihone/intel2gas/
[a href="index.php?act=findpost&pid=315009"][{POST_SNAPBACK}][/a]


Maybe I haven't been too clear. I don't intend to use the inline assembler of gcc. Merely I want to use NASM, which is able to understand intel syntax. The problem is the assembler files are written for MASM (intel syntax, as well). It seems MASM uses (slightly?) different style than NASM, but as I am not a big assembler coder, I don't exactly know how to convert the files.

Converting the asm files to NASM would make the code a lot more portable (*hint* *hint*).
[a href="index.php?act=findpost&pid=315051"][{POST_SNAPBACK}][/a]

intel2gas actually works both ways, but it will only compile under **nix. There isn't a win32 binary that I could find.

new Open Source mp3 Encoder from Helix Community

Reply #80
I believe I have found the answer to the problem regarding the encoding of 11025Hz and 22050Hz samples. The problem is in the default setting on line #204 of tomp3.cpp:
Code: [Select]
//    mpeg_select = 0;
    mpeg_select = 1;    // default to mpeg1
    XingHeadFlag = 0;

/****** process command line args */
By changing the default, as above, all sample rates seem to encode quite happily, with upsampling working as I believe was intended.

new Open Source mp3 Encoder from Helix Community

Reply #81
Quote
[/code] By changing the default, as above, all sample rates seem to encode quite happily, with upsampling working as I believe was intended.
[a href="index.php?act=findpost&pid=315186"][{POST_SNAPBACK}][/a]


Is there a way not to upsample, just output 22050/11025 Hz mp3?

new Open Source mp3 Encoder from Helix Community

Reply #82
With the patch below, the code compiles fine on Mac OS X using 'gcc -O3 -lstdc++ -o ../hmp3-mac -Ipub **/*.c **/*.cpp'. Didn't actually test it, though

Code: [Select]
diff -Naur --exclude hmp3-mac ../helix_mp3enc_cml10/src/test/tomp3.cpp ./src/test/tomp3.cpp
--- ../helix_mp3enc_cml10/src/test/tomp3.cpp    2005-07-21 21:23:08.000000000 +0000
+++ ./src/test/tomp3.cpp    2005-07-22 03:31:22.000000000 +0000
@@ -487,7 +487,9 @@
 if(strcmp(filename,"-")==0)
 {
     handle=stdin;
+#ifdef _WIN32
     setmode( fileno( handle ), O_BINARY );
+#endif
 }
 else
     handle = fopen ( filename, "rb" );
@@ -547,7 +549,9 @@
 if(strcmp(fileout,"-")==0)
 {
     handout=stdout;
+#ifdef _WIN32
     setmode( fileno( handout ), O_BINARY );
+#endif
 }
 else
     handout = fopen ( fileout, "w+b" );

new Open Source mp3 Encoder from Helix Community

Reply #83
I've been googling around for something you can use.

http://www.blah.ch/att2intel/
Converts ASM code in AT&T syntax (GNU Assembler) to Intel syntax (TASM, NASM & Co.).


http://membres.lycos.fr/placr/a2i.html
A2I is an utility which can translate assembly files in AT&T syntax (.S files produces by gcc for example) to NASM syntax. Dos binaries available.

http://www.bumba.net/~hmaon/a2i/
Att2Intl will convert gcc's AT&T syntax assembly output (.s) into Intel syntax (.asm), intended for compilation with NASM or Tasm.

m2nasm:  A perl script that handles some of the tedious parts of masm to nasm translation. Remember to always check the output.

internet archive, newest version:
http://web.archive.org/web/20030216031517/...lf99/m2nasm.txt

# Masm to nasm translation attempt
# still at an early stage...
# 28/06/2002, written by Alexandros Frantzis
# alf82@freemail.gr
# usage: m2nasm.pl < input_file > output_file

I haven't used any of these, hope one of them works,


Further, the first bitrate it the overall average bitrate, whereas the second bitrate is the current bitrate, correct?

new Open Source mp3 Encoder from Helix Community

Reply #84
It should mean
Code: [Select]
frames: 1281,  bytes in: 5902848( 47%),  bytes out: 990509,  br 243.81 236.95

and the first br is current bitrate, second is averaged bitrate.

new Open Source mp3 Encoder from Helix Community

Reply #85
Quote
Quote
By changing the default, as above, all sample rates seem to encode quite happily, with upsampling working as I believe was intended.
[a href="index.php?act=findpost&pid=315186"][{POST_SNAPBACK}][/a]


Is there a way not to upsample, just output 22050/11025 Hz mp3?
[a href="index.php?act=findpost&pid=315233"][{POST_SNAPBACK}][/a]

For low sample rates, it would appear that upsampling is the way the encoder is written to function.

In the file mp3enc.cpp, function MP3_audio_encode_init, lines 2691 - 2737, the encoding sample rate is determined according to 'mpeg' output type. Sample rate output below 16000Hz is not supported and input is upsampled. If the default switch is left as 0, then the 11025 input is upsampled to 22050 and is passed to the function L3_audio_encode_vbr_MPEG2. The 11025 and 22050 inputs fail in this function within the principal loop contained therein. It also fails at CBR with these sample rates.

By setting the default switch to 1 (mpeg 1 layer III), the 11025 and 22050 samples are upsampled to 44100 and processed correctly.

This is, therefore, a way of circumventing the problem, but does not resolve it.

new Open Source mp3 Encoder from Helix Community

Reply #86
I have established that the point at which the program falls over when using the the 0 default, referred to above is in the 'window' junction in sbt.c, sbt.asm and xsbt.asm.

To illustrate, in sbt.c:
Code: [Select]
void
window ( const float vbuf[] )
{
   int i, j, k;
   const float *si, *bx;
   const float *coef;
   float sum1, sum2;

/*-- output to dct ping-pong buf b --*/
   si = vbuf + 16;
   bx = vbuf + 15;

   k = 0;
   coef = wincoef;

/*-- first 1 --*/
   sum1 = 0.0f;
   for ( j = 0; j < 512; j += 64 )
   {
fprintf(stderr, "\nHere - window - before j");
       sum1 += ( *coef++ ) * si[j];
fprintf(stderr, "\nHere - window - j = %d", j);
   }
   si++;
   b[k++] = sum1;

/*-- 16 --*/
I added the fprintfs, they're not in the code!! 

When the program is executed, the data loops through here once and on the second time through, the expression between the two fprintfs causes the crash. I fear to progress any further in this is beyond me!!

new Open Source mp3 Encoder from Helix Community

Reply #87
@Synaptic Line Noise

intel2gas doesn't like the files. m2nasm doesn't do anything here and I didn't try the others as they don't state they could to opposite direction (which I need).

I found this though:

http://www.programmersheaven.com/zone5/cat461/1349.htm

WINE can't hanlde this. (16bit exe?) So could someone alse try this? And then maybe run intel2gas over the result?

new Open Source mp3 Encoder from Helix Community

Reply #88
Yeah. CML have fixed the 22050 samplerate bug.

Now the latest version CML (r11 for now) be put on top of
http://www.hydrogenaudio.org/forums/index....t=0#entry313298


NOTE: This encoder only support mpeg-1&2, not 2.5, so it will never output mp3 with 11025 samplerate (22050 instead).

new Open Source mp3 Encoder from Helix Community

Reply #89
Quote
Yeah. CML have fixed the 22050 samplerate bug.

Now the latest version CML (r11 for now) be put on top of
http://www.hydrogenaudio.org/forums/index....t=0#entry313298


NOTE: This encoder only support mpeg-1&2, not 2.5, so it will never output mp3 with 11025 samplerate (22050 instead).
[a href="index.php?act=findpost&pid=315453"][{POST_SNAPBACK}][/a]

Hmmm, the bug is obvious when you look in the right place, huh?!?!?

new Open Source mp3 Encoder from Helix Community

Reply #90
Quote
Hmmm, the bug is obvious when you look in the right place, huh?!?!?


Nope, there's really a crash bug with 22050 samplerate. After being fixed, this encoder can output mp3 with 22050 samplerate now, which belongs to mpeg-2.

You can check the sourcecode to verify this. There's a place typing "200" as "2100" in the original code.

new Open Source mp3 Encoder from Helix Community

Reply #91
Quote
There's a place typing "200" as "2100" in the original code.
[a href="index.php?act=findpost&pid=315484"][{POST_SNAPBACK}][/a]

That's what I was referring to.

new Open Source mp3 Encoder from Helix Community

Reply #92
As a newbie here, first let me congratulate everyone with the effort put in this coder.
It's been a ball watching everyone contribute.

Frequency analysis (cooledit) seems to show lowpass at approx 16 khz.
Can anyone confirm this as a general outcome ?
Is there an option in the code to change lowpass to something around 19-20 khz ?

Dirk.

new Open Source mp3 Encoder from Helix Community

Reply #93
Quote
Is there an option in the code to change lowpass to something around 19-20 khz?
See post #51 in this thread. It would appear that the -F switch now does this.

Regards,
Madrigal

new Open Source mp3 Encoder from Helix Community

Reply #94
Quote
Frequency analysis (cooledit) seems to show lowpass at approx 16 khz.
Can anyone confirm this as a general outcome ?
Is there an option in the code to change lowpass to something around 19-20 khz ?

Dirk.
[a href="index.php?act=findpost&pid=315580"][{POST_SNAPBACK}][/a]


Yeah. With -B >= 96 and -V >= 80, you can use -HF -F19000 or -HF2 -F19000 to achieve 19000 Hz lowpass.

new Open Source mp3 Encoder from Helix Community

Reply #95
Thanx guys. This setting just made my day.

Dirk.

new Open Source mp3 Encoder from Helix Community

Reply #96
I've added this post as a separate post here.

With this encoder, it's not very clear which number is what, in the progress text.

Please patch the program. I now know what what it's saying, but everytime I look at it still takes awhile to read it.
Code: [Select]
 frames   1281 bytes in  5902848( 47%)  bytes out   990509 br 243.81 236.95

This looks like "1281 bytes in"      "5902848( 47%)  bytes out  "

Please add a LAME style progress text.

Code: [Select]
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
  150/302    (50%)|    0:05/    0:10|    0:05/    0:10|   0.7506x|    0:05
-------------------------------------00:03-------------------------------------
  kbps        LR    MS  %     long  %
  64.0       27.3  72.7       100.0


Especially since now we are just making cosmetic/interface changes.
Also in the latest ICL9 compile, doing a
"hmp3enc -help | more" command doesn't work anymore.
Similar to here:
http://www.hydrogenaudio.org/forums/lofive...php/t30160.html

new Open Source mp3 Encoder from Helix Community

Reply #97
How does:
Code: [Select]
  Frame/Bytes Processed |Bytes Written|Current Bitrate|Average Bitrate
---------------------------------------------------------------------
 14184/65319788  (100%)|   7080630   |   31.85kbps   |   152.89kbps

Compression Ratio 9.23:1
Elapsed time =    8.046secs       Time per frame =    0.567msecs
grab you?

new Open Source mp3 Encoder from Helix Community

Reply #98
Quote
"hmp3enc -help | more" command doesn't work anymore.

If it sends it to stderr, you can usually do it like this:
> hmp3enc -help 2>&1 | more

new Open Source mp3 Encoder from Helix Community

Reply #99
n00b alert: I'm kind of lost in all this code. Can someone post a good commandline for VBR ~80kbps and ~128kbps?

thanks in advance
kindofblue
WavPack 4.31 / LAME 3.98 alpha 3 -V9 -vbr-new