Ignore:
Timestamp:
10/27/06 18:42:05 (18 years ago)
Author:
r2d
Message:
  • added crc32
  • first sv8 encodes, main changes in bitstream.c
File:
1 edited

Legend:

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

    r71 r78  
    2020
    2121#include "config_types.h"
     22#include <stdio.h>
    2223
    2324// FIXME : define this somewhere else
     
    3233
    3334// bitstream.c
    34 #define BUFFER_ALMOST_FULL  8192
    35 #define BUFFER_FULL         (BUFFER_ALMOST_FULL + 4352)         // 34490 bit/frame  1320.3 kbps
    36 
    37 #ifndef ENDIAN
    38 #define HAVE_LITTLE_ENDIAN  1234
    39 #define HAVE_BIG_ENDIAN     4321
    40 
    41 #define ENDIAN              HAVE_LITTLE_ENDIAN
    42 #endif
    43 
    44 // bitstream.c
    45 typedef struct {
    46         mpc_uint32_t*   ptr;
    47         unsigned int    bit;
    48 } BitstreamPos;
     35#define FRAMES_PER_BLOCK_PWR 6
     36#define FRAMES_PER_BLOCK (1 << FRAMES_PER_BLOCK_PWR)
     37#define BUFFER_FULL         (4352 * FRAMES_PER_BLOCK)         // 34490 bit/frame  1320.3 kbps
    4938
    5039typedef struct {
     
    5544// TODO : enc/dec common struct
    5645// just the same struct as below, dup ?
    57 typedef struct {
    58         mpc_uint16_t    Code;  // >= 14 bit
    59         mpc_uint16_t    Length;  // >=  4 bit
    60 } HuffSrc_t ;
    6146
    6247typedef struct {
    6348        mpc_uint16_t    Code;        // >= 14 bit
    6449        mpc_uint16_t    Length;      // >=  4 bit
    65 } Huffman_t ;
     50} Huffman_t;
    6651
    67 // TODO : match with mpc_decoder_t
    68 // FIXME : add init code
    6952typedef struct {
    70         mpc_uint32_t    Buffer [BUFFER_FULL];    // Buffer for bitstream-file
    71         mpc_uint32_t    dword; //         =  0;      // 32-bit-Word for Bitstream-I/O
    72         mpc_int32_t             filled; //        = 32;      // Position in the the 32-bit-word that's currently about to be filled
    73         mpc_uint32_t    Zaehler; //       =  0;      // Position pointer for the processed bitstream-word (32 bit)
    74         mpc_uint64_t    BufferedBits; //  =  0;      // Counter for the number of written bits in the bitstream
     53        mpc_uint_t pos; // next free byte position in the buffer
     54        mpc_uint_t bitsCount; // number of used bits in bitsBuff
     55        mpc_uint64_t outputBits; // Counter for the number of written bits in the bitstream
     56        mpc_uint32_t bitsBuff; // bits buffer
     57        mpc_uint8_t buffer [BUFFER_FULL]; // Buffer for bitstream-file
     58        mpc_uint_t framesInBlock;
     59
     60        FILE * outputFile; // ouput file
    7561
    7662        unsigned int  MS_Channelmode;
    7763        unsigned int  Overflows; //       = 0;      // number of internal (filterbank) clippings
    78 } mpc_encoder_t;
     64 } mpc_encoder_t;
    7965
Note: See TracChangeset for help on using the changeset viewer.