Blame mpglib/mpglib.h

Packit 47f805
/*
Packit 47f805
 * Copyright (C) 1999-2010 The L.A.M.E. project
Packit 47f805
 *
Packit 47f805
 * Initially written by Michael Hipp, see also AUTHORS and README.
Packit 47f805
 *  
Packit 47f805
 * This library is free software; you can redistribute it and/or
Packit 47f805
 * modify it under the terms of the GNU Library General Public
Packit 47f805
 * License as published by the Free Software Foundation; either
Packit 47f805
 * version 2 of the License, or (at your option) any later version.
Packit 47f805
 *
Packit 47f805
 * This library is distributed in the hope that it will be useful,
Packit 47f805
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 47f805
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
Packit 47f805
 * Library General Public License for more details.
Packit 47f805
 *
Packit 47f805
 * You should have received a copy of the GNU Library General Public
Packit 47f805
 * License along with this library; if not, write to the
Packit 47f805
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 47f805
 * Boston, MA 02111-1307, USA.
Packit 47f805
 */
Packit 47f805
#ifndef _MPGLIB_H_
Packit 47f805
#define _MPGLIB_H_
Packit 47f805
Packit 47f805
#include "lame.h"
Packit 47f805
Packit 47f805
#ifndef plotting_data_defined
Packit 47f805
#define plotting_data_defined
Packit 47f805
struct plotting_data;
Packit 47f805
typedef struct plotting_data plotting_data;
Packit 47f805
#endif
Packit 47f805
Packit 47f805
Packit 47f805
extern void lame_report_fnc(lame_report_function f, const char *format, ...);
Packit 47f805
Packit 47f805
struct buf {
Packit 47f805
    unsigned char *pnt;
Packit 47f805
    long    size;
Packit 47f805
    long    pos;
Packit 47f805
    struct buf *next;
Packit 47f805
    struct buf *prev;
Packit 47f805
};
Packit 47f805
Packit 47f805
struct framebuf {
Packit 47f805
    struct buf *buf;
Packit 47f805
    long    pos;
Packit 47f805
    struct frame *next;
Packit 47f805
    struct frame *prev;
Packit 47f805
};
Packit 47f805
Packit 47f805
typedef struct mpstr_tag {
Packit 47f805
    struct buf *head, *tail; /* buffer linked list pointers, tail points to oldest buffer */
Packit 47f805
    int     vbr_header;      /* 1 if valid Xing vbr header detected */
Packit 47f805
    int     num_frames;      /* set if vbr header present */
Packit 47f805
    int     enc_delay;       /* set if vbr header present */
Packit 47f805
    int     enc_padding;     /* set if vbr header present */
Packit 47f805
    /* header_parsed, side_parsed and data_parsed must be all set 1
Packit 47f805
       before the full frame has been parsed */
Packit 47f805
    int     header_parsed;   /* 1 = header of current frame has been parsed */
Packit 47f805
    int     side_parsed;     /* 1 = header of sideinfo of current frame has been parsed */
Packit 47f805
    int     data_parsed;
Packit 47f805
    int     free_format;     /* 1 = free format frame */
Packit 47f805
    int     old_free_format; /* 1 = last frame was free format */
Packit 47f805
    int     bsize;
Packit 47f805
    int     framesize;
Packit 47f805
    int     ssize;           /* number of bytes used for side information, including 2 bytes for CRC-16 if present */
Packit 47f805
    int     dsize;
Packit 47f805
    int     fsizeold;        /* size of previous frame, -1 for first */
Packit 47f805
    int     fsizeold_nopadding;
Packit 47f805
    struct frame fr;         /* holds the parameters decoded from the header */
Packit 47f805
    struct III_sideinfo sideinfo;
Packit 47f805
    unsigned char bsspace[2][MAXFRAMESIZE + 1024]; /* bit stream space used ???? */ /* MAXFRAMESIZE */
Packit 47f805
    real    hybrid_block[2][2][SBLIMIT * SSLIMIT];
Packit 47f805
    int     hybrid_blc[2];
Packit 47f805
    unsigned long header;
Packit 47f805
    int     bsnum;
Packit 47f805
    real    synth_buffs[2][2][0x110];
Packit 47f805
    int     synth_bo;
Packit 47f805
    int     sync_bitstream;  /* 1 = bitstream is yet to be synchronized */
Packit 47f805
Packit 47f805
    int     bitindex;
Packit 47f805
    unsigned char *wordpointer;
Packit 47f805
    plotting_data *pinfo;
Packit 47f805
Packit 47f805
    lame_report_function report_msg;
Packit 47f805
    lame_report_function report_dbg;
Packit 47f805
    lame_report_function report_err;
Packit 47f805
} MPSTR, *PMPSTR;
Packit 47f805
Packit 47f805
Packit 47f805
#define MP3_ERR -1
Packit 47f805
#define MP3_OK  0
Packit 47f805
#define MP3_NEED_MORE 1
Packit 47f805
Packit 47f805
Packit 47f805
Packit 47f805
#endif /* _MPGLIB_H_ */