FileBase Class Reference

#include <filebase.h>

Inherited by FileAC3, FileAVI, FileCR2, FileDV, FileGIF, FileList, FileMOV, FileMPEG, FileOGG, FileSndFile, FileVorbis, and FileYUV.

Collaboration diagram for FileBase:

Collaboration graph
[legend]

Public Member Functions

 FileBase (Asset *asset, File *file)
virtual ~FileBase ()
int get_mode (char *mode, int rd, int wr)
int reset_parameters ()
virtual void get_parameters (BC_WindowBase *parent_window, Asset *asset, BC_WindowBase **format_window, int audio_options, int video_options, int lock_compressor)
virtual int get_index (char *index_path)
virtual int check_header ()
virtual int reset_parameters_derived ()
virtual int read_header ()
virtual int open_file (int rd, int wr)
virtual int close_file ()
virtual int close_file_derived ()
int set_dither ()
virtual int seek_end ()
virtual int seek_start ()
virtual int64_t get_video_position ()
virtual int64_t get_audio_position ()
virtual int set_video_position (int64_t x)
virtual int set_audio_position (int64_t x)
virtual int64_t get_memory_usage ()
virtual int write_samples (double **buffer, int64_t len)
virtual int write_frames (VFrame ***frames, int len)
virtual int read_compressed_frame (VFrame *buffer)
virtual int write_compressed_frame (VFrame *buffers)
virtual int64_t compressed_frame_size ()
virtual int read_samples (double *buffer, int64_t len)
virtual int prefer_samples_float ()
virtual int read_samples_float (float *buffer, int64_t len)
virtual int read_frame (VFrame *frame)
virtual int colormodel_supported (int colormodel)
virtual int can_copy_from (Edit *edit, int64_t position)
virtual int get_render_strategy (ArrayList< int > *render_strategies)

Protected Member Functions

int64_t samples_to_raw (char *out_buffer, float **in_buffer, int64_t input_len, int bits, int channels, int byte_order, int signed_)
int raw_to_samples (float *out_buffer, char *in_buffer, int64_t samples, int bits, int channels, int channel, int feather, float lfeather_len, float lfeather_gain, float lfeather_slope)
int overlay_float_buffer (float *out_buffer, float *in_buffer, int64_t samples, float lfeather_len, float lfeather_gain, float lfeather_slope)
int64_t frame_to_raw (unsigned char *out_buffer, VFrame *in_frame, int w, int h, int use_alpha, int use_float, int color_model)
int get_audio_buffer (char **buffer, int64_t len, int64_t bits, int64_t channels)
int get_float_buffer (float **buffer, int64_t len)
int get_video_buffer (unsigned char **buffer, int depth)
int get_row_pointers (unsigned char *buffer, unsigned char ***pointers, int depth)
int64_t ima4_samples_to_bytes (int64_t samples, int channels)
int64_t ima4_bytes_to_samples (int64_t bytes, int channels)

Static Protected Member Functions

static int search_render_strategies (ArrayList< int > *render_strategies, int render_strategy)
static int match4 (char *in, char *out)

Protected Attributes

char * audio_buffer_in
char * audio_buffer_out
float * float_buffer
unsigned char * video_buffer_in
unsigned char * video_buffer_out
unsigned char ** row_pointers_in
unsigned char ** row_pointers_out
int64_t prev_buffer_position
int64_t prev_frame_position
int64_t prev_bytes
int64_t prev_len
int prev_track
int prev_layer
Assetasset
int wr
int rd
int dither
int internal_byte_order
Filefile

Private Member Functions

float ulawtofloat (char ulaw)
char floattoulaw (float value)
int generate_ulaw_tables ()
int delete_ulaw_tables ()
int init_ima4 ()
int delete_ima4 ()
int ima4_decode_block (int16_t *output, unsigned char *input)
int ima4_decode_sample (int *predictor, int nibble, int *index, int *step)
int ima4_encode_block (unsigned char *output, int16_t *input, int step, int channel)
int ima4_encode_sample (int *last_sample, int *last_index, int *nibble, int next_sample)

Private Attributes

float * ulawtofloat_table
float * ulawtofloat_ptr
unsigned char * floattoulaw_table
unsigned char * floattoulaw_ptr
int * last_ima4_samples
int * last_ima4_indexes
int ima4_block_size
int ima4_block_samples
OverlayFrameoverlayer

Static Private Attributes

static int ima4_step [89]
static int ima4_index [16]

Friends

class File
class FileList
class FrameWriter

Detailed Description

Definition at line 18 of file filebase.h.


Constructor & Destructor Documentation

FileBase::FileBase ( Asset asset,
File file 
)

Definition at line 12 of file filebase.C.

References get_byte_order(), init_ima4(), internal_byte_order, overlayer, and reset_parameters().

Here is the call graph for this function:

FileBase::~FileBase (  )  [virtual]

Definition at line 22 of file filebase.C.

References audio_buffer_in, audio_buffer_out, delete_ima4(), float_buffer, overlayer, row_pointers_in, row_pointers_out, video_buffer_in, and video_buffer_out.

Here is the call graph for this function:


Member Function Documentation

int FileBase::get_mode ( char *  mode,
int  rd,
int  wr 
)

Definition at line 79 of file filebase.C.

References asset, fclose(), fopen(), and Asset::path.

Here is the call graph for this function:

int FileBase::reset_parameters (  ) 

virtual void FileBase::get_parameters ( BC_WindowBase parent_window,
Asset asset,
BC_WindowBase **  format_window,
int  audio_options,
int  video_options,
int  lock_compressor 
) [inline, virtual]

Definition at line 37 of file filebase.h.

virtual int FileBase::get_index ( char *  index_path  )  [inline, virtual]

Reimplemented in FileMPEG.

Definition at line 46 of file filebase.h.

Referenced by File::get_index().

virtual int FileBase::check_header (  )  [inline, virtual]

Definition at line 47 of file filebase.h.

virtual int FileBase::reset_parameters_derived (  )  [inline, virtual]

Reimplemented in FileAC3, FileDV, FileGIF, FileList, FileMOV, FileMPEG, FileOGG, and FileVorbis.

Definition at line 48 of file filebase.h.

Referenced by reset_parameters().

virtual int FileBase::read_header (  )  [inline, virtual]

Reimplemented in FileGIF.

Definition at line 49 of file filebase.h.

virtual int FileBase::open_file ( int  rd,
int  wr 
) [inline, virtual]

Reimplemented in FileAC3, FileAVI, FileCR2, FileDV, FileGIF, FileList, FileMOV, FileMPEG, FileOGG, FileSndFile, FileVorbis, and FileYUV.

Definition at line 50 of file filebase.h.

Referenced by File::open_file().

int FileBase::close_file (  )  [virtual]

virtual int FileBase::close_file_derived (  )  [inline, virtual]

Reimplemented in FileDV, FileGIF, and FileOGG.

Definition at line 52 of file filebase.h.

Referenced by close_file().

int FileBase::set_dither (  ) 

Definition at line 49 of file filebase.C.

References dither.

Referenced by File::open_file().

virtual int FileBase::seek_end (  )  [inline, virtual]

Definition at line 54 of file filebase.h.

virtual int FileBase::seek_start (  )  [inline, virtual]

Definition at line 55 of file filebase.h.

virtual int64_t FileBase::get_video_position (  )  [inline, virtual]

Reimplemented in FileDV, and FileOGG.

Definition at line 56 of file filebase.h.

virtual int64_t FileBase::get_audio_position (  )  [inline, virtual]

Reimplemented in FileDV, and FileOGG.

Definition at line 57 of file filebase.h.

virtual int FileBase::set_video_position ( int64_t  x  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, FileMOV, FileMPEG, FileOGG, and FileYUV.

Definition at line 58 of file filebase.h.

Referenced by File::set_video_position().

virtual int FileBase::set_audio_position ( int64_t  x  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, FileMOV, FileMPEG, FileOGG, and FileSndFile.

Definition at line 59 of file filebase.h.

Referenced by File::set_audio_position().

virtual int64_t FileBase::get_memory_usage (  )  [inline, virtual]

Reimplemented in FileEXR, FileGIF, FileList, FileMOV, FileMPEG, and FileTGA.

Definition at line 63 of file filebase.h.

Referenced by File::get_memory_usage().

virtual int FileBase::write_samples ( double **  buffer,
int64_t  len 
) [inline, virtual]

Reimplemented in FileAC3, FileAVI, FileDV, FileMOV, FileMPEG, FileOGG, FileSndFile, and FileVorbis.

Definition at line 65 of file filebase.h.

Referenced by File::write_samples().

virtual int FileBase::write_frames ( VFrame ***  frames,
int  len 
) [inline, virtual]

Reimplemented in FileAVI, FileDV, FileList, FileMOV, FileMPEG, FileOGG, and FileYUV.

Definition at line 67 of file filebase.h.

Referenced by File::write_frames().

virtual int FileBase::read_compressed_frame ( VFrame buffer  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, and FileMOV.

Definition at line 68 of file filebase.h.

Referenced by File::read_compressed_frame().

virtual int FileBase::write_compressed_frame ( VFrame buffers  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, and FileMOV.

Definition at line 69 of file filebase.h.

Referenced by File::write_compressed_frame().

virtual int64_t FileBase::compressed_frame_size (  )  [inline, virtual]

Reimplemented in FileAVI, FileDV, and FileMOV.

Definition at line 70 of file filebase.h.

Referenced by File::compressed_frame_size().

virtual int FileBase::read_samples ( double *  buffer,
int64_t  len 
) [inline, virtual]

Reimplemented in FileAVI, FileDV, FileMOV, FileMPEG, FileOGG, FileSndFile, and FileVorbis.

Definition at line 72 of file filebase.h.

Referenced by File::read_samples().

virtual int FileBase::prefer_samples_float (  )  [inline, virtual]

Reimplemented in FileMPEG, and FileVorbis.

Definition at line 75 of file filebase.h.

Referenced by File::read_samples().

virtual int FileBase::read_samples_float ( float *  buffer,
int64_t  len 
) [inline, virtual]

Reimplemented in FileMPEG, and FileVorbis.

Definition at line 76 of file filebase.h.

Referenced by File::read_samples().

virtual int FileBase::read_frame ( VFrame frame  )  [inline, virtual]

Reimplemented in FileAVI, FileCR2, FileDV, FileList, FileMOV, FileMPEG, FileOGG, and FileYUV.

Definition at line 78 of file filebase.h.

Referenced by File::read_frame().

virtual int FileBase::colormodel_supported ( int  colormodel  )  [inline, virtual]

Reimplemented in FileCR2, FileDV, FileEXR, FileJPEG, FileMOV, FileMPEG, FileOGG, FilePNG, FileTGA, FileTIFF, and FileYUV.

Definition at line 82 of file filebase.h.

References BC_RGB888.

Referenced by File::colormodel_supported().

virtual int FileBase::can_copy_from ( Edit edit,
int64_t  position 
) [inline, virtual]

Reimplemented in FileDV, FileJPEG, FileMOV, FileMPEG, FilePNG, FileTGA, FileTIFF, and FileYUV.

Definition at line 84 of file filebase.h.

Referenced by File::can_copy_from().

virtual int FileBase::get_render_strategy ( ArrayList< int > *  render_strategies  )  [inline, virtual]

Definition at line 85 of file filebase.h.

int FileBase::search_render_strategies ( ArrayList< int > *  render_strategies,
int  render_strategy 
) [static, protected]

Definition at line 155 of file filebase.C.

References ArrayList< TYPE >::total, and ArrayList< TYPE >::values.

int64_t FileBase::samples_to_raw ( char *  out_buffer,
float **  in_buffer,
int64_t  input_len,
int  bits,
int  channels,
int  byte_order,
int  signed_ 
) [protected]

Definition at line 7 of file filebaseaudio.C.

References asset, bytes, File::bytes_per_sample(), Asset::channels, dither, file, floattoulaw(), generate_ulaw_tables(), get_byte_order(), and swap_bytes().

Here is the call graph for this function:

int FileBase::raw_to_samples ( float *  out_buffer,
char *  in_buffer,
int64_t  samples,
int  bits,
int  channels,
int  channel,
int  feather,
float  lfeather_len,
float  lfeather_gain,
float  lfeather_slope 
) [protected]

int FileBase::overlay_float_buffer ( float *  out_buffer,
float *  in_buffer,
int64_t  samples,
float  lfeather_len,
float  lfeather_gain,
float  lfeather_slope 
) [protected]

Definition at line 349 of file filebaseaudio.C.

References CENTER_MACRO1, CENTER_MACRO2, LFEATHER_MACRO1, and LFEATHER_MACRO2.

int64_t FileBase::frame_to_raw ( unsigned char *  out_buffer,
VFrame in_frame,
int  w,
int  h,
int  use_alpha,
int  use_float,
int  color_model 
) [protected]

int FileBase::get_audio_buffer ( char **  buffer,
int64_t  len,
int64_t  bits,
int64_t  channels 
) [protected]

Definition at line 369 of file filebaseaudio.C.

References bytes, File::bytes_per_sample(), file, and prev_bytes.

Here is the call graph for this function:

int FileBase::get_float_buffer ( float **  buffer,
int64_t  len 
) [protected]

Definition at line 382 of file filebaseaudio.C.

References prev_len.

int FileBase::get_video_buffer ( unsigned char **  buffer,
int  depth 
) [protected]

Definition at line 113 of file filebase.C.

References asset, bytes, Asset::height, and Asset::width.

int FileBase::get_row_pointers ( unsigned char *  buffer,
unsigned char ***  pointers,
int  depth 
) [protected]

Definition at line 125 of file filebase.C.

References asset, Asset::height, and Asset::width.

int FileBase::match4 ( char *  in,
char *  out 
) [static, protected]

int64_t FileBase::ima4_samples_to_bytes ( int64_t  samples,
int  channels 
) [protected]

Definition at line 235 of file filebaseima4.C.

References bytes, ima4_block_samples, and ima4_block_size.

int64_t FileBase::ima4_bytes_to_samples ( int64_t  bytes,
int  channels 
) [protected]

Definition at line 241 of file filebaseima4.C.

References ima4_block_samples, ima4_block_size, and samples.

float FileBase::ulawtofloat ( char  ulaw  )  [private]

Definition at line 9 of file filebaseulaw.C.

References ulawtofloat_ptr.

char FileBase::floattoulaw ( float  value  )  [private]

Definition at line 15 of file filebaseulaw.C.

References floattoulaw_ptr.

Referenced by samples_to_raw().

int FileBase::generate_ulaw_tables (  )  [private]

int FileBase::delete_ulaw_tables (  )  [private]

Definition at line 101 of file filebaseulaw.C.

References floattoulaw_table, and ulawtofloat_table.

Referenced by reset_parameters().

int FileBase::init_ima4 (  )  [private]

int FileBase::delete_ima4 (  )  [private]

Definition at line 36 of file filebaseima4.C.

References last_ima4_indexes, and last_ima4_samples.

Referenced by close_file(), and ~FileBase().

int FileBase::ima4_decode_block ( int16_t *  output,
unsigned char *  input 
) [private]

Definition at line 44 of file filebaseima4.C.

int FileBase::ima4_decode_sample ( int *  predictor,
int  nibble,
int *  index,
int *  step 
) [private]

Definition at line 91 of file filebaseima4.C.

References ima4_index, and ima4_step.

int FileBase::ima4_encode_block ( unsigned char *  output,
int16_t *  input,
int  step,
int  channel 
) [private]

Definition at line 129 of file filebaseima4.C.

References asset, Asset::channels, ima4_block_size, ima4_encode_sample(), last_ima4_indexes, and last_ima4_samples.

Here is the call graph for this function:

int FileBase::ima4_encode_sample ( int *  last_sample,
int *  last_index,
int *  nibble,
int  next_sample 
) [private]

Definition at line 186 of file filebaseima4.C.

References ima4_index, ima4_step, and step.

Referenced by ima4_encode_block().


Friends And Related Function Documentation

friend class File [friend]

Definition at line 25 of file filebase.h.

friend class FileList [friend]

Definition at line 26 of file filebase.h.

friend class FrameWriter [friend]

Definition at line 27 of file filebase.h.

Referenced by FileList::open_file().


Field Documentation

char* FileBase::audio_buffer_in [protected]

Definition at line 134 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

char * FileBase::audio_buffer_out [protected]

Definition at line 134 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

float* FileBase::float_buffer [protected]

Definition at line 135 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

unsigned char* FileBase::video_buffer_in [protected]

Definition at line 136 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

unsigned char * FileBase::video_buffer_out [protected]

Definition at line 136 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

unsigned char** FileBase::row_pointers_in [protected]

Definition at line 137 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

unsigned char ** FileBase::row_pointers_out [protected]

Definition at line 137 of file filebase.h.

Referenced by close_file(), reset_parameters(), and ~FileBase().

int64_t FileBase::prev_buffer_position [protected]

Definition at line 138 of file filebase.h.

Referenced by reset_parameters().

int64_t FileBase::prev_frame_position [protected]

Definition at line 139 of file filebase.h.

Referenced by reset_parameters().

int64_t FileBase::prev_bytes [protected]

Definition at line 140 of file filebase.h.

Referenced by get_audio_buffer(), and reset_parameters().

int64_t FileBase::prev_len [protected]

Definition at line 141 of file filebase.h.

Referenced by get_float_buffer(), and reset_parameters().

int FileBase::prev_track [protected]

int FileBase::prev_layer [protected]

Definition at line 143 of file filebase.h.

Referenced by reset_parameters().

Asset* FileBase::asset [protected]

Definition at line 144 of file filebase.h.

Referenced by FileSndFile::asset_to_format(), FileMOV::asset_to_format(), FileDV::audio_samples_copy(), FileList::calculate_path(), FileMOV::can_copy_from(), FileVorbis::close_file(), FileOGG::close_file(), FileMOV::close_file(), FileList::close_file(), FileTIFF::colormodel_supported(), FileMPEG::create_index(), FileList::create_path(), FileMPEGVideo::FileMPEGVideo(), FileOGG::flush_ogg(), FileSndFile::format_to_asset(), FileMOV::format_to_asset(), FileCR2::format_to_asset(), FileDV::get_audio_frame(), FileDV::get_audio_offset(), FileMPEG::get_index(), FileGIF::get_memory_usage(), FileEXR::get_memory_usage(), get_mode(), get_row_pointers(), get_video_buffer(), ima4_encode_block(), FileGIF::import_row(), init_ima4(), FileOGG::move_history(), FileMOV::new_audio_temp(), FileOGG::ogg_get_page_of_frame(), FileOGG::ogg_get_page_of_sample(), FileYUV::open_file(), FileVorbis::open_file(), FileSndFile::open_file(), FileOGG::open_file(), FileMPEG::open_file(), FileMOV::open_file(), FileList::open_file(), FileDV::open_file(), FileCR2::open_file(), FileAVI::open_file(), FileAC3::open_file(), FileTIFF::read_frame(), FileTGA::read_frame(), FileMPEG::read_frame(), FileList::read_frame(), FileJPEGList::read_frame(), FileJPEG::read_frame(), FileEXR::read_frame(), FileDV::read_frame(), FileCR2::read_frame(), FileAVI::read_frame(), FileTIFF::read_frame_header(), FileTGA::read_frame_header(), FilePNG::read_frame_header(), FileJPEG::read_frame_header(), FileEXR::read_frame_header(), FileGIF::read_header(), FileList::read_list_header(), FileGIF::read_raw(), FileVorbis::read_samples(), FileSndFile::read_samples(), FileOGG::read_samples(), FileDV::read_samples(), FileAVI::read_samples(), FileVorbis::read_samples_float(), FileDV::reset_parameters_derived(), FileMPEGVideo::run(), FileMOVThread::run(), samples_to_raw(), FileMOVThread::start_encoding(), FileTIFF::write_frame(), FileTGA::write_frame(), FilePNG::write_frame(), FileJPEGList::write_frame(), FileJPEG::write_frame(), FileEXR::write_frame(), FileYUV::write_frames(), FileMPEG::write_frames(), FileMOV::write_frames(), FrameWriter::write_frames(), FileList::write_frames(), FileDV::write_frames(), FileList::write_list_header(), FileVorbis::write_samples(), FileSndFile::write_samples(), FileMPEG::write_samples(), FileMOV::write_samples(), FileDV::write_samples(), FileAC3::write_samples(), FileOGG::write_samples_vorbis(), FileDV::~FileDV(), and FileOGG::~FileOGG().

int FileBase::wr [protected]

int FileBase::rd [protected]

int FileBase::dither [protected]

Definition at line 146 of file filebase.h.

Referenced by reset_parameters(), samples_to_raw(), and set_dither().

Definition at line 147 of file filebase.h.

Referenced by FileBase().

File* FileBase::file [protected]

float* FileBase::ulawtofloat_table [private]

Definition at line 160 of file filebase.h.

Referenced by delete_ulaw_tables(), generate_ulaw_tables(), and reset_parameters().

float * FileBase::ulawtofloat_ptr [private]

Definition at line 160 of file filebase.h.

Referenced by generate_ulaw_tables(), and ulawtofloat().

unsigned char* FileBase::floattoulaw_table [private]

Definition at line 161 of file filebase.h.

Referenced by delete_ulaw_tables(), generate_ulaw_tables(), and reset_parameters().

unsigned char * FileBase::floattoulaw_ptr [private]

Definition at line 161 of file filebase.h.

Referenced by floattoulaw(), and generate_ulaw_tables().

int FileBase::ima4_step [static, private]

Initial value:

 
{
    7, 8, 9, 10, 11, 12, 13, 14, 16, 17,
    19, 21, 23, 25, 28, 31, 34, 37, 41, 45,
    50, 55, 60, 66, 73, 80, 88, 97, 107, 118,
    130, 143, 157, 173, 190, 209, 230, 253, 279, 307,
    337, 371, 408, 449, 494, 544, 598, 658, 724, 796,
    876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066,
    2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358,
    5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899,
    15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767
}

Definition at line 171 of file filebase.h.

Referenced by ima4_decode_sample(), and ima4_encode_sample().

int FileBase::ima4_index [static, private]

Initial value:

 
{
    -1, -1, -1, -1, 2, 4, 6, 8,
    -1, -1, -1, -1, 2, 4, 6, 8
}

Definition at line 172 of file filebase.h.

Referenced by ima4_decode_sample(), and ima4_encode_sample().

Definition at line 173 of file filebase.h.

Referenced by delete_ima4(), ima4_encode_block(), and init_ima4().

Definition at line 174 of file filebase.h.

Referenced by delete_ima4(), ima4_encode_block(), and init_ima4().

Definition at line 176 of file filebase.h.

Referenced by ima4_bytes_to_samples(), ima4_samples_to_bytes(), and init_ima4().

Definition at line 177 of file filebase.h.

Referenced by FileBase(), and ~FileBase().


The documentation for this class was generated from the following files:

Generated on Mon Apr 28 14:24:53 2008 for Cinelerra by  doxygen 1.5.5