Index: libmpc/branches/r2d/mpcenc/mpcenc.c
===================================================================
--- libmpc/branches/r2d/mpcenc/mpcenc.c	(revision 224)
+++ libmpc/branches/r2d/mpcenc/mpcenc.c	(revision 226)
@@ -47,5 +47,9 @@
 unsigned int  verbose         = 0;      // more information during output
 unsigned int  NoUnicode       = 1;      // console is unicode or not (tag translation)
-mpc_uint64_t    SamplesInWAVE   = 0;      // number of samples per channel in the WAV file
+unsigned int  NoEncoderInfo   = 0;      // write encoder info block or not
+unsigned int  NoSeekTable     = 0;      // write seek table block or not
+unsigned int  FramesBlockPwr  = 6;      // must be even : frames_per_block = 1 << FramesBlockPwr
+unsigned int  SeekDistance    = 1;      // keep a seek table entry every 2^SeekDistance block
+mpc_uint64_t  SamplesInWAVE   = 0;      // number of samples per channel in the WAV file
 float         MaxOverFlow     = 0.f;    // maximum overflow
 float         ScalingFactorl  = 1.f;    // Scaling the input signal
@@ -194,4 +198,12 @@
              "  above braindead  (--quality 10.00)  excellent quality     (~ 350 kbps)\n"
              "\n" );
+
+	stderr_printf (
+			"\033[1m\rBitstream formating:\033[0m\n"
+			"  --no_ei           do not write encoder information packet   (dflt: off)\n"
+			"  --no_st           do not write the seek table               (dflt: off)\n"
+			"  --num_frames x    x = 0..7 number of frames in packet = 4^x (dflt: 3)\n"
+			"  --seek_distance x x = 0..15 keep a seek table entry every 2^x audio packet (dflt: 1)\n"
+			"\n" );
 
     stderr_printf (
@@ -1030,5 +1042,19 @@
         else if ( 0 == strcmp ( arg, "unicode") ) {                                  // no tag conversion
             NoUnicode = 0;
-        }
+		}
+		else if ( 0 == strcmp ( arg, "no_ei") ) {                                  // no encoder info block
+			NoEncoderInfo = 1;
+		}
+		else if ( 0 == strcmp ( arg, "no_st") ) {                                  // no seek table
+			NoSeekTable = 1;
+		}
+		else if ( 0 == strcmp ( arg, "num_frames") ) {
+			if ( ++k >= argc ) { stderr_printf ( errmsg, arg ); return -1; }
+			FramesBlockPwr = atoi (argv[k]) * 2;
+		}
+		else if ( 0 == strcmp ( arg, "seek_distance") ) {
+			if ( ++k >= argc ) { stderr_printf ( errmsg, arg ); return -1; }
+			SeekDistance = atoi (argv[k]);
+		}
         else if ( 0 == strcmp ( arg, "lowdelay") ) {
             LowDelay = 1;
@@ -1518,5 +1544,4 @@
 	Init_Psychoakustik (&m);
 	Init_FPU ();
-	Init_SV8 (&e);
 
     // initialize PCM-data
@@ -1575,4 +1600,5 @@
     }
 
+	mpc_encoder_init (&e, SamplesInWAVE, FramesBlockPwr, SeekDistance);
     Init_Psychoakustiktabellen (&m);              // must be done AFTER decoding command line parameters
 
@@ -1610,11 +1636,14 @@
 	writeGainInfo ( &e, 0, 0, 0, 0);
 	writeBlock(&e, "RG", MPC_FALSE, 0);
-	writeEncoderInfo(&e, m.FullQual, m.PNS > 0, MPCENC_MAJOR, MPCENC_MINOR,
-					  MPCENC_BUILD);
-	writeBlock(&e, "EI", MPC_FALSE, 0);
-	e.seek_ptr = ftell(e.outputFile);
-	writeBits (&e, 0, 8);
-	writeBits (&e, 0, 32); // jump 40 bits for seek table pointer
-	writeBlock(&e, "SO", MPC_FALSE, 0); // reserve space for seek offset
+	if (NoEncoderInfo == 0) {
+		writeEncoderInfo(&e, m.FullQual, m.PNS > 0, MPCENC_MAJOR, MPCENC_MINOR, MPCENC_BUILD);
+		writeBlock(&e, "EI", MPC_FALSE, 0);
+	}
+	if (NoSeekTable == 0) {
+		e.seek_ptr = ftell(e.outputFile);
+		writeBits (&e, 0, 8);
+		writeBits (&e, 0, 32); // jump 40 bits for seek table pointer
+		writeBlock(&e, "SO", MPC_FALSE, 0); // reserve space for seek offset
+	}
 
 
@@ -1723,6 +1752,8 @@
 		writeBlock(&e, "AP", MPC_FALSE, 0);
 	}
-	writeSeekTable(&e);
-	writeBlock(&e, "ST", MPC_FALSE, 0); // write seek table block
+	if (NoSeekTable == 0) {
+		writeSeekTable(&e);
+		writeBlock(&e, "ST", MPC_FALSE, 0); // write seek table block
+	}
 	writeBlock(&e, "SE", MPC_FALSE, 0); // write end of stream block
 
@@ -1741,4 +1772,5 @@
     fclose ( e.outputFile );
     fclose ( Wave.fp );
+	mpc_encoder_exit(&e);
 
     if ( DelInput == 0xAFFEDEAD  &&  remove (InputName) == -1 )         // delete input file if DelInput is active
