hvirtual/quicktime/vorbis.c File Reference

#include "funcprotos.h"
#include "quicktime.h"
#include "qtvorbis.h"
#include <string.h>
#include "vorbis/vorbisenc.h"

Include dependency graph for vorbis.c:

Go to the source code of this file.

Data Structures

struct  quicktime_vorbis_codec_t

Defines

#define OUTPUT_ALLOCATION   0x100000
#define CLAMP(x, y, z)   ((x) = ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x))))
#define BUFFER_FRAGMENT   4096
#define SEGMENT_OFFSET   0x1a
#define LACE_OFFSET   0x1b
#define READ_CHUNK(chunk)
#define FLUSH_OGG1
#define FLUSH_OGG2

Functions

static int delete_codec (quicktime_audio_map_t *atrack)
static int chunk_len (quicktime_t *file, int64_t offset, int64_t next_chunk)
static int decode (quicktime_t *file, int16_t *output_i, float *output_f, long samples, int track, int channel)
static int encode (quicktime_t *file, int16_t **input_i, float **input_f, int track, long samples)
static int set_parameter (quicktime_t *file, int track, char *key, void *value)
static void flush (quicktime_t *file, int track)
void quicktime_init_codec_vorbis (quicktime_audio_map_t *atrack)


Define Documentation

#define BUFFER_FRAGMENT   4096

Definition at line 110 of file vorbis.c.

Referenced by chunk_len().

#define CLAMP ( x,
y,
 )     ((x) = ((x) < (y) ? (y) : ((x) > (z) ? (z) : (x))))

Definition at line 9 of file vorbis.c.

#define FLUSH_OGG1

Value:

while(1) \
{ \
        int eos = !ogg_stream_flush(&codec->enc_os, &codec->enc_og); \
        if(eos) break; \
 \
        if(!chunk_started) \
        { \
                chunk_started = 1; \
                quicktime_write_chunk_header(file, trak, &chunk_atom); \
        } \
 \
        result = !quicktime_write_data(file, codec->enc_og.header, codec->enc_og.header_len); \
        size += codec->enc_og.header_len; \
 \
        if(!result) \
        { \
                result = !quicktime_write_data(file, codec->enc_og.body, codec->enc_og.body_len); \
                size += codec->enc_og.body_len; \
        } \
 \
 \
        if(!result) break; \
}

Definition at line 596 of file vorbis.c.

Referenced by encode().

#define FLUSH_OGG2

Definition at line 623 of file vorbis.c.

Referenced by encode(), and flush().

#define LACE_OFFSET   0x1b

Definition at line 116 of file vorbis.c.

Referenced by chunk_len().

#define OUTPUT_ALLOCATION   0x100000

Definition at line 8 of file vorbis.c.

#define READ_CHUNK ( chunk   ) 

Value:

{ \
        int64_t offset1 = quicktime_chunk_to_offset(file, trak, (chunk)); \
        int64_t offset2 = quicktime_chunk_to_offset(file, trak, (chunk) + 1); \
        int size = 0; \
        if(offset2 == offset1) \
                result = 1; \
        else \
        { \
                size = chunk_len(file, offset1, \
                        offset2 > offset1 ? offset2 : offset1 + 0xfffff); \
 \
                buffer = ogg_sync_buffer(&codec->dec_oy, size); \
                quicktime_set_position(file, offset1); \
                result = !quicktime_read_data(file, buffer, size); \
                ogg_sync_wrote(&codec->dec_oy, size); \
        } \
/* printf("READ_CHUNK size=%d\n", size); */ \
/* printf("%llx %x: ", quicktime_chunk_to_offset(file, trak, (chunk)), size); */ \
/* for(i = 0; i < 16; i++) */ \
/*      printf("%02x ", buffer[i]); */ \
/* printf("result=%d\n", result); */ \
}

Definition at line 167 of file vorbis.c.

Referenced by decode().

#define SEGMENT_OFFSET   0x1a

Definition at line 115 of file vorbis.c.

Referenced by chunk_len().


Function Documentation

static int chunk_len ( quicktime_t file,
int64_t  offset,
int64_t  next_chunk 
) [static]

Definition at line 117 of file vorbis.c.

References BUFFER_FRAGMENT, LACE_OFFSET, memcmp, quicktime_read_data(), quicktime_set_position(), and SEGMENT_OFFSET.

Here is the call graph for this function:

static int decode ( quicktime_t file,
int16_t *  output_i,
float *  output_f,
long  samples,
int  track,
int  channel 
) [static]

static int delete_codec ( quicktime_audio_map_t atrack  )  [static]

static int encode ( quicktime_t file,
int16_t **  input_i,
float **  input_f,
int  track,
long  samples 
) [static]

static void flush ( quicktime_t file,
int  track 
) [static]

void quicktime_init_codec_vorbis ( quicktime_audio_map_t atrack  ) 

static int set_parameter ( quicktime_t file,
int  track,
char *  key,
void *  value 
) [static]


Generated on Mon Apr 28 14:06:33 2008 for Cinelerra by  doxygen 1.5.5