Ignore:
Timestamp:
10/07/06 02:49:28 (18 years ago)
Author:
r2d
Message:
  • fixed a LOT of bugs
  • fixed a bug that took me 2 days to find :)
  • remember to ALWAYS use -Wall with a C compiler (C++ is great !!!)
  • files can be played, but are not bit identical with the 1.15w encoder (the last digits of floats are not the same) - must be fixed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • mppenc/branches/r2d/libmpcenc/tools.c

    r65 r71  
    4040#if defined HAVE_INCOMPLETE_READ  &&  FILEIO != 1
    4141
    42 size_t
    43 complete_read ( int fd, void* dest, size_t bytes )
    44 {
    45     size_t  bytesread = 0;
    46     size_t  ret;
     42mpc_size_t
     43complete_read ( int fd, void* dest, mpc_size_t bytes )
     44{
     45    mpc_size_t  bytesread = 0;
     46    mpc_size_t  ret;
    4747
    4848    while ( bytes > 0 ) {
     
    5252        ret = read ( fd, dest, bytes );
    5353#endif
    54         if ( ret == 0  ||  ret == (size_t)-1 )
     54        if ( ret == 0  ||  ret == (mpc_size_t)-1 )
    5555            break;
    5656        dest       = (void*)(((char*)dest) + ret);
     
    7575
    7676static void
    77 Change_Endian32 ( mpc_uint32_t* dst, size_t words32bit )
     77Change_Endian32 ( mpc_uint32_t* dst, mpc_size_t words32bit )
    7878{
    7979
     
    107107 */
    108108
    109 size_t
    110 Read_LittleEndians ( FILE* fp, mpc_uint32_t* dst, size_t words32bit )
    111 {
    112     size_t  wordsread;
     109mpc_size_t
     110Read_LittleEndians ( FILE* fp, mpc_uint32_t* dst, mpc_size_t words32bit )
     111{
     112    mpc_size_t  wordsread;
    113113    wordsread = READ ( fp, dst, words32bit * sizeof(*dst) ) / sizeof(*dst);
    114114
     
    195195
    196196void
    197 Requantize_MidSideStereo ( Int Stop_Band, const Bool_t* used_MS )
    198 {
    199     Int    Band;  // 0...Stop_Band
     197Requantize_MidSideStereo ( mpc_int_t Stop_Band, const mpc_bool_t* used_MS )
     198{
     199    mpc_int_t    Band;  // 0...Stop_Band
    200200    Uint   k;     // 0...35
    201201    Float  ML;
     
    412412
    413413void
    414 Requantize_IntensityStereo ( Int Start_Band, Int Stop_Band )
    415 {
    416     Int    Band;  // Start_Band...Stop_Band
     414Requantize_IntensityStereo ( mpc_int_t Start_Band, mpc_int_t Stop_Band )
     415{
     416    mpc_int_t    Band;  // Start_Band...Stop_Band
    417417    Uint   k;     // 0...35
    418418    Float  ML;
     
    479479
    480480void
    481 Resort_HuffTable ( Huffman_t* const Table, const size_t elements, Int offset )
    482 {
    483     size_t  i;
     481Resort_HuffTable ( Huffman_t* const Table, const mpc_size_t elements, mpc_int_t offset )
     482{
     483    mpc_size_t  i;
    484484
    485485    for ( i = 0; i < elements; i++ ) {
     
    505505
    506506void
    507 Make_HuffTable ( Huffman_t* dst, const HuffSrc_t* src, size_t len )
    508 {
    509     size_t  i;
     507Make_HuffTable ( Huffman_t* dst, const HuffSrc_t* src, mpc_size_t len )
     508{
     509    mpc_size_t  i;
    510510
    511511    for ( i = 0; i < len; i++,src++,dst++ ) {
     
    530530
    531531void
    532 Make_LookupTable ( mpc_uint8_t* LUT, size_t LUT_len, const Huffman_t* const Table, const size_t elements )
    533 {
    534     size_t    i;
    535     size_t    idx  = elements;
     532Make_LookupTable ( mpc_uint8_t* LUT, mpc_size_t LUT_len, const Huffman_t* const Table, const mpc_size_t elements )
     533{
     534    mpc_size_t    i;
     535    mpc_size_t    idx  = elements;
    536536    mpc_uint32_t  dval = (mpc_uint32_t)0x80000000L / LUT_len * 2;
    537537    mpc_uint32_t  val  = dval - 1;
Note: See TracChangeset for help on using the changeset viewer.