Ignore:
Timestamp:
03/16/07 16:54:54 (17 years ago)
Author:
r2d
Message:
  • added sv8 options to mpcenc
  • some change in mpcdec to correctly display that there is no information
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/mpcenc/mpcenc.c

    r224 r226  
    4747unsigned int  verbose         = 0;      // more information during output
    4848unsigned 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
     49unsigned int  NoEncoderInfo   = 0;      // write encoder info block or not
     50unsigned int  NoSeekTable     = 0;      // write seek table block or not
     51unsigned int  FramesBlockPwr  = 6;      // must be even : frames_per_block = 1 << FramesBlockPwr
     52unsigned int  SeekDistance    = 1;      // keep a seek table entry every 2^SeekDistance block
     53mpc_uint64_t  SamplesInWAVE   = 0;      // number of samples per channel in the WAV file
    5054float         MaxOverFlow     = 0.f;    // maximum overflow
    5155float         ScalingFactorl  = 1.f;    // Scaling the input signal
     
    194198             "  above braindead  (--quality 10.00)  excellent quality     (~ 350 kbps)\n"
    195199             "\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" );
    196208
    197209    stderr_printf (
     
    10301042        else if ( 0 == strcmp ( arg, "unicode") ) {                                  // no tag conversion
    10311043            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                }
    10331059        else if ( 0 == strcmp ( arg, "lowdelay") ) {
    10341060            LowDelay = 1;
     
    15181544        Init_Psychoakustik (&m);
    15191545        Init_FPU ();
    1520         Init_SV8 (&e);
    15211546
    15221547    // initialize PCM-data
     
    15751600    }
    15761601
     1602        mpc_encoder_init (&e, SamplesInWAVE, FramesBlockPwr, SeekDistance);
    15771603    Init_Psychoakustiktabellen (&m);              // must be done AFTER decoding command line parameters
    15781604
     
    16101636        writeGainInfo ( &e, 0, 0, 0, 0);
    16111637        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        }
    16191648
    16201649
     
    17231752                writeBlock(&e, "AP", MPC_FALSE, 0);
    17241753        }
    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        }
    17271758        writeBlock(&e, "SE", MPC_FALSE, 0); // write end of stream block
    17281759
     
    17411772    fclose ( e.outputFile );
    17421773    fclose ( Wave.fp );
     1774        mpc_encoder_exit(&e);
    17431775
    17441776    if ( DelInput == 0xAFFEDEAD  &&  remove (InputName) == -1 )         // delete input file if DelInput is active
Note: See TracChangeset for help on using the changeset viewer.