Ignore:
Timestamp:
02/17/07 21:18:35 (17 years ago)
Author:
r2d
Message:
  • speed optimizations
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libmpc/branches/r2d/libmpcenc/libmpcenc.h

    r220 r221  
    9494 mpc_uint32_t writeBlock ( mpc_encoder_t *, const char *, const mpc_bool_t, mpc_uint32_t);
    9595 void writeMagic (mpc_encoder_t * e);
    96  void writeBits (mpc_encoder_t * e, mpc_uint32_t input, unsigned int bits );
     96 void emptyBits(mpc_encoder_t * e);
     97 static mpc_inline void writeBits (mpc_encoder_t * e, mpc_uint32_t input, unsigned int bits )
     98 {
     99         e->outputBits += bits;
     100
     101         if (e->bitsCount + bits > sizeof(e->bitsBuff) * 8) {
     102                 int tmp = (sizeof(e->bitsBuff) * 8 - e->bitsCount);
     103                 bits -= tmp;
     104                 e->bitsBuff = (e->bitsBuff << tmp) | (input >> bits);
     105                 e->bitsCount = sizeof(e->bitsBuff) * 8;
     106                 emptyBits(e);
     107                 input &= (1 << bits) - 1;
     108         }
     109         e->bitsBuff = (e->bitsBuff << bits) | input;
     110         e->bitsCount += bits;
     111 }
    97112 void writeSeekTable (mpc_encoder_t * e);
    98113 void writeBitstream_SV8 ( mpc_encoder_t*, int);
Note: See TracChangeset for help on using the changeset viewer.