VbrTag.c File Reference

#include <config.h>
#include "lame.h"
#include "machine.h"
#include "encoder.h"
#include "util.h"
#include "bitstream.h"
#include "VbrTag.h"
#include "lame_global_flags.h"

Include dependency graph for VbrTag.c:

Go to the source code of this file.

Defines

#define VBRHEADERSIZE   (NUMTOCENTRIES+4+4+4+4+4)
#define LAMEHEADERSIZE   (VBRHEADERSIZE + 9 + 1 + 1 + 8 + 1 + 1 + 3 + 1 + 1 + 2 + 4 + 2 + 2)
#define XING_BITRATE1   128
#define XING_BITRATE2   64
#define XING_BITRATE25   32
#define MAXFRAMESIZE   2880

Functions

static void addVbr (VBR_seek_info_t *v, int bitrate)
static void Xing_seek_table (VBR_seek_info_t *v, unsigned char *t)
void AddVbrFrame (lame_global_flags *gfp)
static int ExtractI4 (unsigned char *buf)
static void CreateI4 (unsigned char *buf, int nValue)
static void CreateI2 (unsigned char *buf, int nValue)
static int IsVbrTag (const unsigned char *buf)
int CheckVbrTag (unsigned char *buf)
int GetVbrTag (VBRTAGDATA *pTagData, unsigned char *buf)
int InitVbrTag (lame_global_flags *gfp)
static int CRC_update_lookup (int value, int crc)
void UpdateMusicCRC (uint16_t *crc, unsigned char *buffer, int size)
int PutLameVBR (lame_global_flags const *gfp, FILE *fpStream, uint8_t *pbtStreamBuffer, uint32_t id3v2size, uint16_t crc)
int PutVbrTag (lame_global_flags const *gfp, FILE *fpStream)

Variables

static const char VBRTag0 [] = { "Xing" }
static const char VBRTag1 [] = { "Info" }
static const unsigned int crc16_lookup [256]


Define Documentation

#define LAMEHEADERSIZE   (VBRHEADERSIZE + 9 + 1 + 1 + 8 + 1 + 1 + 3 + 1 + 1 + 2 + 4 + 2 + 2)

Definition at line 60 of file VbrTag.c.

Referenced by InitVbrTag().

#define MAXFRAMESIZE   2880

#define VBRHEADERSIZE   (NUMTOCENTRIES+4+4+4+4+4)

Definition at line 58 of file VbrTag.c.

#define XING_BITRATE1   128

Definition at line 63 of file VbrTag.c.

Referenced by InitVbrTag(), and PutVbrTag().

#define XING_BITRATE2   64

Definition at line 64 of file VbrTag.c.

Referenced by InitVbrTag(), and PutVbrTag().

#define XING_BITRATE25   32

Definition at line 65 of file VbrTag.c.

Referenced by InitVbrTag(), and PutVbrTag().


Function Documentation

static void addVbr ( VBR_seek_info_t v,
int  bitrate 
) [static]

Definition at line 123 of file VbrTag.c.

References VBR_seek_info_t::bag, i, VBR_seek_info_t::nVbrNumFrames, VBR_seek_info_t::pos, VBR_seek_info_t::seen, VBR_seek_info_t::size, VBR_seek_info_t::sum, and VBR_seek_info_t::want.

Referenced by AddVbrFrame().

void AddVbrFrame ( lame_global_flags gfp  ) 

Definition at line 195 of file VbrTag.c.

References addVbr(), VBR_seek_info_t::bag, lame_internal_flags::bitrate_index, bitrate_table, gfc, gfp, lame_global_struct::internal_flags, lame_internal_flags::VBR_seek_table, and lame_global_struct::version.

Here is the call graph for this function:

int CheckVbrTag ( unsigned char *  buf  ) 

Definition at line 261 of file VbrTag.c.

References IsVbrTag().

Here is the call graph for this function:

static int CRC_update_lookup ( int  value,
int  crc 
) [static]

Definition at line 504 of file VbrTag.c.

References crc16_lookup.

Referenced by PutLameVBR(), PutVbrTag(), and UpdateMusicCRC().

static void CreateI2 ( unsigned char *  buf,
int  nValue 
) [static]

Definition at line 234 of file VbrTag.c.

Referenced by PutLameVBR().

static void CreateI4 ( unsigned char *  buf,
int  nValue 
) [static]

Definition at line 222 of file VbrTag.c.

Referenced by PutLameVBR(), and PutVbrTag().

static int ExtractI4 ( unsigned char *  buf  )  [static]

Definition at line 207 of file VbrTag.c.

Referenced by GetVbrTag().

int GetVbrTag ( VBRTAGDATA pTagData,
unsigned char *  buf 
)

Definition at line 290 of file VbrTag.c.

References bitrate_table, VBRTAGDATA::bytes, BYTES_FLAG, VBRTAGDATA::enc_delay, VBRTAGDATA::enc_padding, ExtractI4(), VBRTAGDATA::flags, VBRTAGDATA::frames, FRAMES_FLAG, VBRTAGDATA::h_id, VBRTAGDATA::headersize, IsVbrTag(), samplerate_table, VBRTAGDATA::samprate, VBRTAGDATA::toc, TOC_FLAG, VBRTAGDATA::vbr_scale, and VBR_SCALE_FLAG.

Referenced by PutVbrTag().

Here is the call graph for this function:

int InitVbrTag ( lame_global_flags gfp  ) 

make sure LAME Header fits into Frame

Definition at line 415 of file VbrTag.c.

References add_dummy_byte(), VBR_seek_info_t::bag, lame_global_struct::brate, lame_global_struct::bWriteVbrTag, ERRORF, gfc, gfp, lame_global_struct::internal_flags, LAMEHEADERSIZE, MAXFRAMESIZE, lame_global_struct::mode, VBR_seek_info_t::nBytesWritten, VBR_seek_info_t::nVbrNumFrames, lame_global_struct::out_samplerate, VBR_seek_info_t::pos, lame_internal_flags::samplerate_index, VBR_seek_info_t::seen, lame_internal_flags::sideinfo_len, VBR_seek_info_t::size, VBR_seek_info_t::sum, VBR_seek_info_t::TotalFrameSize, lame_global_struct::VBR, vbr_off, lame_internal_flags::VBR_seek_table, lame_global_struct::version, VBR_seek_info_t::want, XING_BITRATE1, XING_BITRATE2, and XING_BITRATE25.

Referenced by lame_init_bitstream().

Here is the call graph for this function:

static int IsVbrTag ( const unsigned char *  buf  )  [static]

Definition at line 243 of file VbrTag.c.

References VBRTag0, and VBRTag1.

Referenced by CheckVbrTag(), and GetVbrTag().

int PutLameVBR ( lame_global_flags const *  gfp,
FILE *  fpStream,
uint8_t *  pbtStreamBuffer,
uint32_t  id3v2size,
uint16_t  crc 
)

Definition at line 536 of file VbrTag.c.

References lame_global_struct::ATHonly, lame_global_struct::ATHtype, lame_global_struct::brate, CHANGED_FLAG, CRC_update_lookup(), CreateI2(), CreateI4(), lame_global_struct::disable_reservoir, DUAL_CHANNEL, lame_global_struct::exp_nspsytune, lame_internal_flags::findPeakSample, lame_internal_flags::findReplayGain, id3tag_spec::flags, lame_global_struct::force_ms, get_lame_very_short_version(), gfc, gfp, lame_global_struct::highpassfreq, lame_global_struct::in_samplerate, lame_global_struct::internal_flags, JOINT_STEREO, lame_get_encoder_delay(), lame_get_encoder_padding(), lame_global_struct::lowpassfreq, lame_global_struct::mode, MONO, lame_internal_flags::nMusicCRC, lame_global_struct::noATH, lame_internal_flags::nogap_current, lame_internal_flags::nogap_total, lame_internal_flags::noise_shaping, NOT_SET, lame_internal_flags::PeakSample, lame_global_struct::preset, lame_global_struct::quality, lame_internal_flags::RadioGain, lame_global_struct::scale_left, lame_global_struct::scale_right, short_block_dispensed, short_block_forced, lame_global_struct::short_blocks, STEREO, lame_internal_flags::tag_spec, V2_ONLY_FLAG, lame_global_struct::VBR, vbr_abr, lame_global_struct::VBR_mean_bitrate_kbps, lame_global_struct::VBR_min_bitrate_kbps, vbr_off, and lame_global_struct::VBR_q.

Referenced by PutVbrTag().

Here is the call graph for this function:

int PutVbrTag ( lame_global_flags const *  gfp,
FILE *  fpStream 
)

Definition at line 797 of file VbrTag.c.

References BitrateIndex(), lame_global_struct::brate, BYTES_FLAG, CRC_update_lookup(), CRC_writeheader(), CreateI4(), lame_global_struct::error_protection, FRAMES_FLAG, lame_global_struct::free_format, GetVbrTag(), gfc, gfp, lame_global_struct::internal_flags, MAXFRAMESIZE, memcpy, VBR_seek_info_t::nBytesWritten, VBR_seek_info_t::nVbrNumFrames, lame_global_struct::out_samplerate, VBR_seek_info_t::pos, PutLameVBR(), lame_internal_flags::sideinfo_len, TOC_FLAG, VBR_seek_info_t::TotalFrameSize, lame_global_struct::VBR, vbr_off, VBR_SCALE_FLAG, lame_internal_flags::VBR_seek_table, VBRTag0, VBRTag1, lame_global_struct::version, XING_BITRATE1, XING_BITRATE2, XING_BITRATE25, and Xing_seek_table().

Referenced by lame_mp3_tags_fid().

Here is the call graph for this function:

void UpdateMusicCRC ( uint16_t *  crc,
unsigned char *  buffer,
int  size 
)

Definition at line 513 of file VbrTag.c.

References CRC_update_lookup().

Referenced by copy_buffer().

Here is the call graph for this function:

static void Xing_seek_table ( VBR_seek_info_t v,
unsigned char *  t 
) [static]

Definition at line 150 of file VbrTag.c.

References VBR_seek_info_t::bag, i, NUMTOCENTRIES, VBR_seek_info_t::pos, and VBR_seek_info_t::sum.

Referenced by PutVbrTag().


Variable Documentation

const unsigned int crc16_lookup[256] [static]

Definition at line 79 of file VbrTag.c.

Referenced by CRC_update_lookup().

const char VBRTag0[] = { "Xing" } [static]

Definition at line 69 of file VbrTag.c.

Referenced by IsVbrTag(), and PutVbrTag().

const char VBRTag1[] = { "Info" } [static]

Definition at line 70 of file VbrTag.c.

Referenced by IsVbrTag(), and PutVbrTag().


Generated on Sun Dec 2 11:37:14 2007 for LAME by  doxygen 1.5.2