Changeset 226 for libmpc/branches/r2d/mpcenc/mpcenc.c
- Timestamp:
- 03/16/07 16:54:54 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libmpc/branches/r2d/mpcenc/mpcenc.c
r224 r226 47 47 unsigned int verbose = 0; // more information during output 48 48 unsigned int NoUnicode = 1; // console is unicode or not (tag translation) 49 mpc_uint64_t SamplesInWAVE = 0; // number of samples per channel in the WAV file 49 unsigned int NoEncoderInfo = 0; // write encoder info block or not 50 unsigned int NoSeekTable = 0; // write seek table block or not 51 unsigned int FramesBlockPwr = 6; // must be even : frames_per_block = 1 << FramesBlockPwr 52 unsigned int SeekDistance = 1; // keep a seek table entry every 2^SeekDistance block 53 mpc_uint64_t SamplesInWAVE = 0; // number of samples per channel in the WAV file 50 54 float MaxOverFlow = 0.f; // maximum overflow 51 55 float ScalingFactorl = 1.f; // Scaling the input signal … … 194 198 " above braindead (--quality 10.00) excellent quality (~ 350 kbps)\n" 195 199 "\n" ); 200 201 stderr_printf ( 202 "\033[1m\rBitstream formating:\033[0m\n" 203 " --no_ei do not write encoder information packet (dflt: off)\n" 204 " --no_st do not write the seek table (dflt: off)\n" 205 " --num_frames x x = 0..7 number of frames in packet = 4^x (dflt: 3)\n" 206 " --seek_distance x x = 0..15 keep a seek table entry every 2^x audio packet (dflt: 1)\n" 207 "\n" ); 196 208 197 209 stderr_printf ( … … 1030 1042 else if ( 0 == strcmp ( arg, "unicode") ) { // no tag conversion 1031 1043 NoUnicode = 0; 1032 } 1044 } 1045 else if ( 0 == strcmp ( arg, "no_ei") ) { // no encoder info block 1046 NoEncoderInfo = 1; 1047 } 1048 else if ( 0 == strcmp ( arg, "no_st") ) { // no seek table 1049 NoSeekTable = 1; 1050 } 1051 else if ( 0 == strcmp ( arg, "num_frames") ) { 1052 if ( ++k >= argc ) { stderr_printf ( errmsg, arg ); return -1; } 1053 FramesBlockPwr = atoi (argv[k]) * 2; 1054 } 1055 else if ( 0 == strcmp ( arg, "seek_distance") ) { 1056 if ( ++k >= argc ) { stderr_printf ( errmsg, arg ); return -1; } 1057 SeekDistance = atoi (argv[k]); 1058 } 1033 1059 else if ( 0 == strcmp ( arg, "lowdelay") ) { 1034 1060 LowDelay = 1; … … 1518 1544 Init_Psychoakustik (&m); 1519 1545 Init_FPU (); 1520 Init_SV8 (&e);1521 1546 1522 1547 // initialize PCM-data … … 1575 1600 } 1576 1601 1602 mpc_encoder_init (&e, SamplesInWAVE, FramesBlockPwr, SeekDistance); 1577 1603 Init_Psychoakustiktabellen (&m); // must be done AFTER decoding command line parameters 1578 1604 … … 1610 1636 writeGainInfo ( &e, 0, 0, 0, 0); 1611 1637 writeBlock(&e, "RG", MPC_FALSE, 0); 1612 writeEncoderInfo(&e, m.FullQual, m.PNS > 0, MPCENC_MAJOR, MPCENC_MINOR, 1613 MPCENC_BUILD); 1614 writeBlock(&e, "EI", MPC_FALSE, 0); 1615 e.seek_ptr = ftell(e.outputFile); 1616 writeBits (&e, 0, 8); 1617 writeBits (&e, 0, 32); // jump 40 bits for seek table pointer 1618 writeBlock(&e, "SO", MPC_FALSE, 0); // reserve space for seek offset 1638 if (NoEncoderInfo == 0) { 1639 writeEncoderInfo(&e, m.FullQual, m.PNS > 0, MPCENC_MAJOR, MPCENC_MINOR, MPCENC_BUILD); 1640 writeBlock(&e, "EI", MPC_FALSE, 0); 1641 } 1642 if (NoSeekTable == 0) { 1643 e.seek_ptr = ftell(e.outputFile); 1644 writeBits (&e, 0, 8); 1645 writeBits (&e, 0, 32); // jump 40 bits for seek table pointer 1646 writeBlock(&e, "SO", MPC_FALSE, 0); // reserve space for seek offset 1647 } 1619 1648 1620 1649 … … 1723 1752 writeBlock(&e, "AP", MPC_FALSE, 0); 1724 1753 } 1725 writeSeekTable(&e); 1726 writeBlock(&e, "ST", MPC_FALSE, 0); // write seek table block 1754 if (NoSeekTable == 0) { 1755 writeSeekTable(&e); 1756 writeBlock(&e, "ST", MPC_FALSE, 0); // write seek table block 1757 } 1727 1758 writeBlock(&e, "SE", MPC_FALSE, 0); // write end of stream block 1728 1759 … … 1741 1772 fclose ( e.outputFile ); 1742 1773 fclose ( Wave.fp ); 1774 mpc_encoder_exit(&e); 1743 1775 1744 1776 if ( DelInput == 0xAFFEDEAD && remove (InputName) == -1 ) // delete input file if DelInput is active
Note: See TracChangeset
for help on using the changeset viewer.