hvirtual/quicktime/ffmpeg/libavcodec/utils.c File Reference

#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
#include "integer.h"
#include <stdarg.h>
#include <limits.h>

Include dependency graph for utils.c:

Go to the source code of this file.

Data Structures

struct  InternalBuffer

Defines

#define INTERNAL_BUFFER_SIZE   32
#define ALIGN(x, a)   (((x)+(a)-1)&~((a)-1))
#define fprintf   please_use_av_log

Functions

void avcodec_default_free_buffers (AVCodecContext *s)
void * av_mallocz (unsigned int size)
char * av_strdup (const char *s)
void * av_fast_realloc (void *ptr, unsigned int *size, unsigned int min_size)
void * av_mallocz_static (unsigned int size)
void * av_realloc_static (void *ptr, unsigned int size)
void av_free_static (void)
void av_freep (void *arg)
void register_avcodec (AVCodec *format)
void avcodec_set_dimensions (AVCodecContext *s, int width, int height)
void avcodec_align_dimensions (AVCodecContext *s, int *width, int *height)
int avcodec_check_dimensions (void *av_log_ctx, unsigned int w, unsigned int h)
int avcodec_default_get_buffer (AVCodecContext *s, AVFrame *pic)
void avcodec_default_release_buffer (AVCodecContext *s, AVFrame *pic)
int avcodec_default_reget_buffer (AVCodecContext *s, AVFrame *pic)
int avcodec_default_execute (AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2), void **arg, int *ret, int count)
enum PixelFormat avcodec_default_get_format (struct AVCodecContext *s, const enum PixelFormat *fmt)
static const char * context_to_name (void *ptr)
void avcodec_get_context_defaults (AVCodecContext *s)
AVCodecContextavcodec_alloc_context (void)
void avcodec_get_frame_defaults (AVFrame *pic)
AVFrameavcodec_alloc_frame (void)
int avcodec_open (AVCodecContext *avctx, AVCodec *codec)
int avcodec_encode_audio (AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples)
int avcodec_encode_video (AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVFrame *pict)
int avcodec_encode_subtitle (AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub)
int avcodec_decode_video (AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, uint8_t *buf, int buf_size)
int avcodec_decode_audio (AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, uint8_t *buf, int buf_size)
int avcodec_decode_subtitle (AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const uint8_t *buf, int buf_size)
int avcodec_close (AVCodecContext *avctx)
AVCodecavcodec_find_encoder (enum CodecID id)
AVCodecavcodec_find_encoder_by_name (const char *name)
AVCodecavcodec_find_decoder (enum CodecID id)
AVCodecavcodec_find_decoder_by_name (const char *name)
void avcodec_string (char *buf, int buf_size, AVCodecContext *enc, int encode)
unsigned avcodec_version (void)
unsigned avcodec_build (void)
void avcodec_init (void)
void avcodec_flush_buffers (AVCodecContext *avctx)
char av_get_pict_type_char (int pict_type)
int av_reduce (int *dst_nom, int *dst_den, int64_t nom, int64_t den, int64_t max)
int64_t av_rescale_rnd (int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
int64_t av_rescale (int64_t a, int64_t b, int64_t c)
int64_t av_rescale_q (int64_t a, AVRational bq, AVRational cq)
int64_t ff_gcd (int64_t a, int64_t b)
double av_int2dbl (int64_t v)
float av_int2flt (int32_t v)
int64_t av_dbl2int (double d)
int32_t av_flt2int (float d)
static void av_log_default_callback (void *ptr, int level, const char *fmt, va_list vl)
void av_log (void *avcl, int level, const char *fmt,...)
void av_vlog (void *avcl, int level, const char *fmt, va_list vl)
int av_log_get_level (void)
void av_log_set_level (int level)
void av_log_set_callback (void(*callback)(void *, int, const char *, va_list))
int avcodec_thread_init (AVCodecContext *s, int thread_count)
unsigned int av_xiphlacing (unsigned char *s, unsigned int v)

Variables

const uint8_t ff_sqrt_tab [128]
const uint8_t ff_log2_tab [256]
const uint8_t ff_reverse [256]
static int volatile entangled_thread_counter = 0
static unsigned int last_static = 0
static unsigned int allocated_static = 0
static void ** array_static = NULL
AVCodecfirst_avcodec = NULL
static AVClass av_codec_context_class = { "AVCodecContext", context_to_name }
static int av_log_level = AV_LOG_INFO
static void(* av_log_callback )(void *, int, const char *, va_list) = av_log_default_callback


Detailed Description

utils.

Definition in file utils.c.


Define Documentation

#define ALIGN ( x,
a   )     (((x)+(a)-1)&~((a)-1))

Definition at line 203 of file utils.c.

Referenced by avcodec_align_dimensions(), and avcodec_default_get_buffer().

#define fprintf   please_use_av_log

Referenced by a52_decode_init(), a_bit_allocation(), ac3_decode_frame(), add_audio_stream(), add_frame_hooker(), add_video_stream(), ahd_interpolate(), aiff_check(), audio_decode_example(), audio_encode_example(), FileDV::audio_samples_copy(), av_encode(), av_log_default_callback(), bad_pixels(), bilateral_filter(), Bits_CountMB_combined(), build_feed_streams(), byte_ali_putbits(), CodeCoeff(), compute_MAD(), convert_to_rgb(), dcraw_main(), decode(), decode_slice(), decode_thread(), do_audio_out(), do_subtitle_out(), do_video_out(), do_video_stats(), TitleMain::draw_glyphs(), dump_stream_info(), encode(), encode_init(), encore(), error(), event_loop(), ExportEDLAsset::export_it(), ff_h263_decode_frame(), find_pmvs(), FindCBP(), flip_image(), foveon_camf_matrix(), foveon_decoder(), foveon_interpolate(), foveon_thumb(), fuji_rotate(), get_chroma_factor(), BC_Theme::get_image_data(), get_pes_packet(), get_side_info(), get_transport_payload(), getreal(), h263p_decode_umotion(), handle_child_exit(), handle_scrambling(), hputbuf(), identify(), init_motion(), MWindow::init_plugins(), init_predict_hv(), init_quantizer_hv(), MWindow::init_shm(), MWindow::init_theme(), init_transform_hv(), AVC1394Control::initialize(), js_bound(), kodak_jpeg_load_raw(), layer_thumb(), limit_samples(), lin_interpolate(), TitleMain::load_freetype_face(), main(), main_bit_allocation(), main_bit_allocation_new(), RenderFarmClient::main_loop(), make_decoder(), MB_CodeCoeff(), MBMotionEstimation(), mem_alloc(), merror(), mpeg2enc(), mpeg3_generate_toc(), mpeg3_get_file_type(), mpeg3_mmx_test(), mpeg3_read_ifo(), mpeg3_read_toc(), mpeg3_stop_toc(), mpeg3demux_open_title(), mpeg3demux_print_cells(), mpeg3demux_print_streams(), mpeg3io_open_file(), mpeg3video_ext_user_data(), mpeg3video_picture_temporal_scalable_extension(), mpeg3video_sequence_scalable_extension(), mpeg3video_toc_error(), mpeg4_decode_block(), msmpeg4_decode_block(), new_acodec(), new_audio_stream(), new_vcodec(), new_video_stream(), open_audio(), open_bit_stream_w(), RenderFarmServerThread::open_client(), VDeviceBUZ::open_input_core(), PluginServer::open_plugin(), DVBTune::open_tuner(), open_video(), opt_b_frames(), opt_celim(), opt_codec(), opt_format(), opt_frame_aspect_ratio(), opt_frame_crop_bottom(), opt_frame_crop_left(), opt_frame_crop_right(), opt_frame_crop_top(), opt_frame_pad_bottom(), opt_frame_pad_left(), opt_frame_pad_right(), opt_frame_pad_top(), opt_frame_rate(), opt_frame_size(), opt_image_format(), opt_input_file(), opt_lelim(), opt_mb_lmax(), opt_mb_lmin(), opt_motion_estimation(), opt_new_audio_stream(), opt_new_subtitle_stream(), opt_new_video_stream(), opt_output_file(), opt_pass(), opt_qdiff(), opt_qmax(), opt_qmin(), opt_qscale(), opt_qsquish(), opt_target(), opt_thread_count(), output_packet(), parse_args(), parse_external_jpeg(), parse_ffconfig(), parse_input_file(), parse_matrix_coeffs(), parse_options(), pgm_save(), pp_get_mode_by_name_and_quality(), ppm_thumb(), predict_mb(), prepare_grab(), print_config(), print_error(), print_report(), ShapeWipeMain::process_realtime(), proginfo(), psycho_1_dump(), psycho_2_init(), psycho_3_dump(), psycho_3_init(), psycho_4_init(), putmv(), putseq(), quicktime_decode_video(), quicktime_ffmpeg_decode(), quicktime_new_riff(), quicktime_open(), quicktime_set_audio_position(), quicktime_set_framerate(), quicktime_set_video_position(), RateCtlInit(), RateCtlUpdate(), read_cmov(), read_old_huffman_tables(), read_samples(), readcmdline(), ArrayList< TYPE >::remove_object(), ArrayList< TYPE >::remove_object_number(), VDeviceLML::reopen_input(), rollei_thumb(), RTjpeg_init_mcompress(), FileMPEGVideo::run(), DV1394Input::run(), scale_colors(), RotateScan::scan_frame(), MotionScan::scan_frame(), short_usage(), show_banner(), show_version(), smr_dump(), sp5x_decode_frame(), start_children(), start_multicast(), stop_status(), stream_component_open(), subband_quantization(), BatchRenderThread::test_edl_files(), VFrame::to_texture(), toc_error(), toolame(), toolame_BitrateIndex(), toolame_send_buffer(), toolame_SmpFrqIndex(), update_status(), usage(), video_decode_example(), video_encode_example(), vng_interpolate(), VopCode(), VopCodeShapeTextIntraCom(), write_audio_frame(), write_ppm(), write_ppm16(), FileXML::write_to_file(), and write_video_frame().

#define INTERNAL_BUFFER_SIZE   32

Definition at line 201 of file utils.c.

Referenced by avcodec_default_free_buffers(), and avcodec_default_get_buffer().


Function Documentation

int64_t av_dbl2int ( double  d  ) 

Definition at line 1035 of file utils.c.

References e, and LL.

void* av_fast_realloc ( void *  ptr,
unsigned int *  size,
unsigned int  min_size 
)

realloc which does nothing if the block is large enough

Definition at line 101 of file utils.c.

References av_realloc().

Referenced by allocate_buffers(), av_mallocz_static(), avcodec_default_get_buffer(), decode_frame(), decode_i_frame(), decode_nal(), decode_p_frame(), ff_combine_frame(), ff_h263_decode_frame(), flac_decode_frame(), output_packet(), and shorten_decode_frame().

Here is the call graph for this function:

int32_t av_flt2int ( float  d  ) 

Definition at line 1043 of file utils.c.

References e.

void av_free_static ( void   ) 

free all static arrays and reset pointers to 0.

Definition at line 156 of file utils.c.

References array_static, av_freep(), and last_static.

Referenced by main().

Here is the call graph for this function:

void av_freep ( void *  arg  ) 

char av_get_pict_type_char ( int  pict_type  ) 

returns a single letter to describe the picture type

Definition at line 938 of file utils.c.

References B_TYPE, I_TYPE, P_TYPE, S_TYPE, SI_TYPE, and SP_TYPE.

Referenced by decode_mb_cavlc(), decode_slice_header(), do_video_stats(), ff_rate_estimate_qscale(), flv_h263_decode_picture_header(), h263_decode_picture_header(), and svq3_decode_frame().

double av_int2dbl ( int64_t  v  ) 

Definition at line 1023 of file utils.c.

References LL.

float av_int2flt ( int32_t  v  ) 

Definition at line 1029 of file utils.c.

void av_log ( void *  avcl,
int  level,
const char *  fmt,
  ... 
)

Definition at line 1074 of file utils.c.

References av_vlog().

Referenced by a52_decode_frame(), a52_resample_init(), aasc_decode_frame(), adpcm_decode_frame(), alac_decode_frame(), alloc_picture(), amr_nb_decode_init(), amr_nb_encode_init(), asv1_decode_block(), audio_resample_init(), av_resample(), avcodec_check_dimensions(), avcodec_close(), avcodec_encode_audio(), avcodec_encode_video(), avcodec_open(), bitplane_decoding(), bits2qp(), build_table(), check_diff(), check_input_motion(), check_intra4x4_pred_mode(), check_intra_pred_mode(), check_marker(), cinepak_decode_frame(), compute_bit_allocation(), compute_exp_strategy(), copy_picture_attributes(), cyuv_decode_frame(), decode_b_picture_primary_header(), decode_b_picture_secondary_header(), decode_dc(), decode_dvd_subtitles(), decode_ext_header(), decode_format80(), decode_frame(), decode_header(), decode_i_block(), decode_i_frame(), decode_i_picture_primary_header(), decode_i_picture_secondary_header(), decode_init(), decode_init_mp3on4(), decode_mb_cabac(), decode_mb_cavlc(), decode_nal_units(), decode_p_frame(), decode_p_picture_primary_header(), decode_p_picture_secondary_header(), decode_picture_parameter_set(), decode_ref_pic_list_reordering(), decode_ref_pic_marking(), decode_residual(), decode_residuals(), decode_rle(), decode_seq_parameter_set(), decode_sequence_header(), decode_slice(), decode_slice_header(), decode_subframe(), decode_subframe_fixed(), decode_subframe_lpc(), decode_vol_header(), decode_vop_header(), decode_vui_parameters(), decode_wave_header(), delete_state(), dpcm_decode_init(), dsputil_init(), dsputil_init_mmx(), dts_decode_frame(), dump_headers(), dv_decode_video_segment(), dvbsub_decode(), dvbsub_parse(), dvbsub_parse_clut_segment(), dvbsub_parse_object_segment(), dvbsub_parse_page_segment(), dvbsub_parse_pixel_data_block(), dvbsub_parse_region_segment(), dvbsub_read_2bit_string(), dvbsub_read_4bit_string(), dvbsub_read_8bit_string(), dvdsub_decode(), dvvideo_decode_frame(), encode_422_bitstream(), encode_blocks(), encode_exp(), encode_frame(), encode_gray_bitstream(), encode_init(), encode_line(), encode_mb(), encode_subband_c0run(), evalPrimary(), execute_ref_pic_marking(), faac_decode_frame(), faac_decode_init(), Faac_encode_init(), faac_init_mp4(), ff_build_rac_states(), ff_er_frame_end(), ff_h263_decode_frame(), ff_h263_decode_mb(), ff_mpeg4_decode_mb(), ff_mpeg4_decode_partitions(), ff_mpeg4_decode_picture_header(), ff_mpeg4_pred_dc(), ff_print_debug_info(), ff_rate_control_init(), ff_rate_estimate_qscale(), ff_set_cmp(), ff_spatial_idwt_buffered_init(), ff_vbv_update(), ff_wmv2_decode_picture_header(), ff_wmv2_decode_secondary_picture_header(), ff_xvid_encode_frame(), ff_xvid_encode_init(), flac_decode_frame(), flic_decode_frame(), flic_decode_init(), flv_h263_decode_picture_header(), frame_start(), g726_init(), generate_bits_table(), get_level_prefix(), h261_decode_block(), h261_decode_frame(), h261_decode_gob(), h261_decode_mb(), h261_decode_picture_header(), h263_decode_block(), h263_decode_picture_header(), help(), idcin_decode_frame(), idcin_decode_init(), idcin_decode_vlcs(), indeo3_decode_frame(), init_offset(), init_pass2(), intel_h263_decode_picture_header(), ipvideo_decode_block_opcode_0x6(), ipvideo_decode_frame(), ipvideo_decode_init(), ipvideo_decode_opcodes(), ir2_decode_frame(), iv_Decode_Chunk(), main(), mdec_decode_block_intra(), mjpeg_decode_app(), mjpeg_decode_com(), mjpeg_decode_frame(), mjpeg_decode_init(), mjpeg_decode_sof(), mjpeg_decode_sos(), mjpegb_decode_frame(), mm_support(), modify_qscale(), MP3lame_encode_frame(), MPA_encode_init(), mpeg1_decode_block_inter(), mpeg1_decode_block_intra(), mpeg1_decode_picture(), mpeg1_decode_sequence(), mpeg2_decode_block_intra(), mpeg2_decode_block_non_intra(), mpeg4_decode_block(), mpeg4_decode_dc(), mpeg4_decode_partition_a(), mpeg4_decode_partition_b(), mpeg4_decode_partitioned_mb(), mpeg4_decode_video_packet_header(), mpeg_decode_frame(), mpeg_decode_gop(), mpeg_decode_mb(), mpeg_decode_picture_display_extension(), mpeg_decode_sequence_display_extension(), mpeg_decode_sequence_extension(), mpeg_decode_slice(), mpeg_field_start(), mpeg_motion(), MPV_common_init(), MPV_common_init_ppc(), MPV_frame_start(), msmpeg4_decode_block(), msmpeg4_decode_dc(), msmpeg4_decode_ext_header(), msmpeg4_decode_motion(), msmpeg4_decode_picture_header(), msmpeg4v12_decode_mb(), msmpeg4v34_decode_mb(), msrle_decode_frame(), msrle_decode_pal4(), msrle_decode_pal8(), msvideo1_decode_frame(), oggvorbis_decode_init(), oggvorbis_encode_init(), output_audio_block(), pam_encode_frame(), pnm_decode_frame(), pnm_encode_frame(), print_long_term(), print_short_term(), qp2bits(), qtrle_decode_frame(), qtrle_decode_init(), ra288_decode_frame(), read_header(), read_huffman_tables(), read_huffman_tree(), remove_short(), render_fragments(), render_slice(), roq_decode_frame(), roqvideo_decode_frame(), rpza_decode_frame(), rpza_decode_stream(), rv10_decode_init(), rv10_decode_packet(), rv10_decode_picture_header(), rv20_decode_picture_header(), rv_decode_dc(), shorten_decode_frame(), smc_decode_frame(), smc_decode_stream(), sonic_decode_init(), standard_decode_picture_primary_header(), svq1_decode_block_intra(), svq1_decode_block_non_intra(), svq1_decode_delta_block(), svq1_decode_frame(), svq1_decode_frame_header(), svq1_motion_inter_4v_block(), svq1_motion_inter_block(), svq3_decode_frame(), svq3_decode_mb(), svq3_decode_slice_header(), svq3_mc_dir(), theora_decode_header(), Theora_decode_init(), theora_decode_tables(), truemotion1_decode_frame(), truemotion1_decode_header(), ulti_decode_frame(), unpack_modes(), unpack_superblocks(), unpack_token(), unpack_vectors(), unpack_vlcs(), vc9_decode_block(), vc9_decode_frame(), vc9_decode_i_mb(), vc9_decode_init(), vc9_init_common(), vmd_decode(), vmdaudio_decode_init(), vmdaudio_loadsound(), vmdvideo_decode_frame(), vmdvideo_decode_init(), vorbis_decode_init(), vorbis_len2vlc(), vorbis_parse_audio_packet(), vorbis_parse_id_hdr(), vorbis_parse_setup_hdr(), vorbis_parse_setup_hdr_codebooks(), vorbis_parse_setup_hdr_floors(), vorbis_parse_setup_hdr_mappings(), vorbis_parse_setup_hdr_tdtransforms(), vorbis_residue_decode(), vp3_decode_frame(), vqa_decode_chunk(), vqa_decode_frame(), vqa_decode_init(), wmv2_add_block(), wmv2_decode_mb(), xan_decode_frame(), xan_decode_init(), xan_wc3_build_palette(), xan_wc3_copy_pixel_run(), xan_wc3_output_pixel_run(), and xvid_correct_framerate().

Here is the call graph for this function:

static void av_log_default_callback ( void *  ptr,
int  level,
const char *  fmt,
va_list  vl 
) [static]

Definition at line 1055 of file utils.c.

References fprintf, AVCLASS::item_name, and NULL.

int av_log_get_level ( void   ) 

Definition at line 1087 of file utils.c.

void av_log_set_callback ( void(*)(void *, int, const char *, va_list)  callback  ) 

Definition at line 1097 of file utils.c.

References av_log_callback.

void av_log_set_level ( int  level  ) 

Definition at line 1092 of file utils.c.

Referenced by opt_debug(), opt_verbose(), and stream_component_open().

void* av_mallocz ( unsigned int  size  ) 

void* av_mallocz_static ( unsigned int  size  ) 

allocation of static arrays - do not use for normal allocation.

Definition at line 119 of file utils.c.

References allocated_static, array_static, av_fast_realloc(), av_mallocz(), last_static, and NULL.

Referenced by av_realloc_static(), decode_init(), init_2d_vlc_rl(), init_rl(), and init_vlc_rl().

Here is the call graph for this function:

void* av_realloc_static ( void *  ptr,
unsigned int  size 
)

same as above, but does realloc

Definition at line 137 of file utils.c.

References array_static, av_mallocz_static(), av_realloc(), last_static, and NULL.

Referenced by alloc_table().

Here is the call graph for this function:

int av_reduce ( int *  dst_nom,
int *  dst_den,
int64_t  nom,
int64_t  den,
int64_t  max 
)

reduce a fraction. this is usefull for framerate calculations

Parameters:
max the maximum allowed for dst_nom & dst_den
Returns:
1 if exact, 0 otherwise

Definition at line 950 of file utils.c.

References a0, a1, ABS, AVRational::den, ff_gcd(), and AVRational::num.

Referenced by av_add_q(), av_d2q(), av_div_q(), av_mul_q(), av_sub_q(), and mpeg_decode_postinit().

Here is the call graph for this function:

int64_t av_rescale ( int64_t  a,
int64_t  b,
int64_t  c 
)

rescale a 64bit integer with rounding to nearest. a simple a*b/c isn't possible as it can overflow

Definition at line 1008 of file utils.c.

References av_rescale_rnd(), and AV_ROUND_NEAR_INF.

Referenced by output_packet().

Here is the call graph for this function:

int64_t av_rescale_q ( int64_t  a,
AVRational  bq,
AVRational  cq 
)

rescale a 64bit integer by 2 rational numbers.

Definition at line 1012 of file utils.c.

References av_rescale_rnd(), AV_ROUND_NEAR_INF, b, AVRational::den, and AVRational::num.

Referenced by av_encode(), do_audio_out(), do_subtitle_out(), do_video_out(), http_prepare_data(), output_packet(), write_audio_frame(), and write_video_frame().

Here is the call graph for this function:

int64_t av_rescale_rnd ( int64_t  a,
int64_t  b,
int64_t  c,
enum  AVRounding 
)

rescale a 64bit integer with specified rounding. a simple a*b/c isn't possible as it can overflow

Definition at line 983 of file utils.c.

References av_add_i(), av_div_i(), av_i2int(), av_int2i(), av_mul_i(), av_rescale_rnd(), AV_ROUND_NEAR_INF, INT64_MIN, and r.

Referenced by av_rescale(), av_rescale_q(), and av_rescale_rnd().

Here is the call graph for this function:

char* av_strdup ( const char *  s  ) 

Definition at line 86 of file utils.c.

References av_malloc(), memcpy, and NULL.

Referenced by add_frame_hooker(), opt_audio_device(), opt_grab_device(), opt_video_device(), opt_video_standard(), and parse_options().

Here is the call graph for this function:

void av_vlog ( void *  avcl,
int  level,
const char *  fmt,
va_list  vl 
)

Definition at line 1082 of file utils.c.

References av_log_callback.

Referenced by av_log(), and X264_log().

unsigned int av_xiphlacing ( unsigned char *  s,
unsigned int  v 
)

Definition at line 1108 of file utils.c.

Referenced by oggvorbis_encode_init().

void avcodec_align_dimensions ( AVCodecContext s,
int *  width,
int *  height 
)

AVCodecContext* avcodec_alloc_context ( void   ) 

allocates a AVCodecContext and set it to defaults. this can be deallocated by simply calling free()

Definition at line 503 of file utils.c.

References av_malloc(), avcodec_get_context_defaults(), and NULL.

Referenced by add_av_stream1(), add_codec(), audio_decode_example(), audio_encode_example(), encode(), http_prepare_data(), FFMPEG::init(), init_codec(), init_decode(), FileAC3::open_file(), quicktime_new_ffmpeg(), rtp_new_av_stream(), video_decode_example(), and video_encode_example().

Here is the call graph for this function:

AVFrame* avcodec_alloc_frame ( void   ) 

allocates a AVPFrame and set it to defaults. this can be deallocated by simply calling free()

Definition at line 524 of file utils.c.

References av_malloc(), avcodec_get_frame_defaults(), and NULL.

Referenced by AC3_encode_init(), alloc_picture(), amr_nb_encode_init(), Faac_encode_init(), g726_init(), FFMPEG::init(), libgsm_init(), MP3lame_encode_init(), MPA_encode_init(), oggvorbis_encode_init(), pcm_encode_init(), video_decode_example(), video_encode_example(), and video_thread().

Here is the call graph for this function:

unsigned avcodec_build ( void   ) 

Definition at line 895 of file utils.c.

References LIBAVCODEC_BUILD.

Referenced by show_version().

int avcodec_check_dimensions ( void *  av_log_ctx,
unsigned int  w,
unsigned int  h 
)

int avcodec_close ( AVCodecContext avctx  ) 

int avcodec_decode_audio ( AVCodecContext avctx,
int16_t *  samples,
int *  frame_size_ptr,
uint8_t *  buf,
int  buf_size 
)

int avcodec_decode_subtitle ( AVCodecContext avctx,
AVSubtitle sub,
int *  got_sub_ptr,
const uint8_t *  buf,
int  buf_size 
)

Definition at line 677 of file utils.c.

References AVCodecContext::codec, AVCodec::decode, and AVCodecContext::frame_number.

Referenced by output_packet().

int avcodec_decode_video ( AVCodecContext avctx,
AVFrame picture,
int *  got_picture_ptr,
uint8_t *  buf,
int  buf_size 
)

decode a frame.

Parameters:
buf bitstream buffer, must be FF_INPUT_BUFFER_PADDING_SIZE larger then the actual read bytes because some optimized bitstream readers read 32 or 64 bit at once and could read over the end
buf_size the size of the buffer in bytes
got_picture_ptr zero if no frame could be decompressed, Otherwise, it is non zero
Returns:
-1 if error, otherwise return the number of bytes used.

Definition at line 631 of file utils.c.

References avcodec_check_dimensions(), AVCodec::capabilities, AVCodecContext::codec, CODEC_CAP_DELAY, AVCodecContext::coded_height, AVCodecContext::coded_width, AVCodec::decode, emms_c, and AVCodecContext::frame_number.

Referenced by FFMPEG::decode(), decode_wrapper(), output_packet(), video_decode_example(), and video_thread().

Here is the call graph for this function:

int avcodec_default_execute ( AVCodecContext c,
int(*)(AVCodecContext *c2, void *arg2)  func,
void **  arg,
int *  ret,
int  count 
)

Definition at line 430 of file utils.c.

References r.

Referenced by avcodec_get_context_defaults().

void avcodec_default_free_buffers ( AVCodecContext s  ) 

int avcodec_default_get_buffer ( AVCodecContext s,
AVFrame pic 
)

enum PixelFormat avcodec_default_get_format ( struct AVCodecContext s,
const enum PixelFormat fmt 
)

Definition at line 440 of file utils.c.

Referenced by avcodec_get_context_defaults().

int avcodec_default_reget_buffer ( AVCodecContext s,
AVFrame pic 
)

void avcodec_default_release_buffer ( AVCodecContext s,
AVFrame pic 
)

int avcodec_encode_audio ( AVCodecContext avctx,
uint8_t *  buf,
int  buf_size,
const short *  samples 
)

int avcodec_encode_subtitle ( AVCodecContext avctx,
uint8_t *  buf,
int  buf_size,
const AVSubtitle sub 
)

Definition at line 613 of file utils.c.

References AVCodecContext::codec, AVCodec::encode, and AVCodecContext::frame_number.

Referenced by do_subtitle_out().

int avcodec_encode_video ( AVCodecContext avctx,
uint8_t *  buf,
int  buf_size,
const AVFrame pict 
)

AVCodec* avcodec_find_decoder ( enum CodecID  id  ) 

AVCodec* avcodec_find_decoder_by_name ( const char *  name  ) 

Definition at line 745 of file utils.c.

References AVCodec::decode, AVCodec::name, AVCodec::next, and NULL.

AVCodec* avcodec_find_encoder ( enum CodecID  id  ) 

AVCodec* avcodec_find_encoder_by_name ( const char *  name  ) 

Definition at line 721 of file utils.c.

References AVCodec::encode, AVCodec::name, AVCodec::next, and NULL.

void avcodec_flush_buffers ( AVCodecContext avctx  ) 

Flush buffers, should be called when seeking or when swicthing to a different stream.

Definition at line 915 of file utils.c.

References AVCodecContext::codec, and AVCodec::flush.

Referenced by decode_thread().

void avcodec_get_context_defaults ( AVCodecContext s  ) 

Definition at line 455 of file utils.c.

References AVCodecContext::av_class, avcodec_default_execute(), avcodec_default_get_buffer(), avcodec_default_get_format(), avcodec_default_reget_buffer(), avcodec_default_release_buffer(), AVCodecContext::b_quant_factor, AVCodecContext::b_quant_offset, AVCodecContext::bit_rate, AVCodecContext::bit_rate_tolerance, AVCodecContext::error_concealment, AVCodecContext::error_resilience, AVCodecContext::execute, FF_BUG_AUTODETECT, FF_CMP_VSAD, FF_DEFAULT_QUANT_BIAS, FF_LEVEL_UNKNOWN, FF_PROFILE_UNKNOWN, FF_QP2LAMBDA, AVCodecContext::get_buffer, AVCodecContext::get_format, AVCodecContext::gop_size, AVCodecContext::i_quant_factor, AVCodecContext::i_quant_offset, AVCodecContext::ildct_cmp, AVCodecContext::inter_quant_bias, AVCodecContext::intra_quant_bias, AVCodecContext::level, AVCodecContext::lmax, AVCodecContext::lmin, AVCodecContext::max_qdiff, AVCodecContext::mb_lmax, AVCodecContext::mb_lmin, ME_EPZS, AVCodecContext::me_method, AVCodecContext::me_penalty_compensation, AVCodecContext::me_subpel_quality, NULL, AVCodecContext::palctrl, AVCodecContext::pix_fmt, PIX_FMT_NONE, AVCodecContext::profile, AVCodecContext::qcompress, AVCodecContext::qmax, AVCodecContext::qmin, AVCodecContext::rc_eq, AVCodecContext::reget_buffer, AVCodecContext::release_buffer, AVCodecContext::sample_aspect_ratio, AVCodecContext::thread_count, AVCodecContext::time_base, and AVCodecContext::workaround_bugs.

Referenced by avcodec_alloc_context().

Here is the call graph for this function:

void avcodec_get_frame_defaults ( AVFrame pic  ) 

Definition at line 513 of file utils.c.

References AV_NOPTS_VALUE.

Referenced by av_encode(), avcodec_alloc_frame(), common_init(), do_video_out(), encode(), and output_packet().

void avcodec_init ( void   ) 

Definition at line 901 of file utils.c.

References dsputil_static_init().

Referenced by encode(), FFMPEG::init(), init_codec(), init_decode(), main(), FileAC3::open_file(), and quicktime_new_ffmpeg().

Here is the call graph for this function:

int avcodec_open ( AVCodecContext avctx,
AVCodec codec 
)

void avcodec_set_dimensions ( AVCodecContext s,
int  width,
int  height 
)

void avcodec_string ( char *  buf,
int  buf_size,
AVCodecContext enc,
int  encode 
)

int avcodec_thread_init ( AVCodecContext s,
int  thread_count 
)

Definition at line 1103 of file utils.c.

unsigned avcodec_version ( void   ) 

Definition at line 890 of file utils.c.

References LIBAVCODEC_VERSION_INT.

static const char* context_to_name ( void *  ptr  )  [static]

Definition at line 444 of file utils.c.

References AVCodecContext::codec, and AVCodec::name.

int64_t ff_gcd ( int64_t  a,
int64_t  b 
)

Definition at line 1018 of file utils.c.

Referenced by av_reduce(), h263_decode_picture_header(), and xvid_correct_framerate().

void register_avcodec ( AVCodec format  ) 

Definition at line 178 of file utils.c.

References AVCodec::next, and NULL.

Referenced by avcodec_register_all().


Variable Documentation

unsigned int allocated_static = 0 [static]

Definition at line 113 of file utils.c.

Referenced by av_mallocz_static().

void** array_static = NULL [static]

Definition at line 114 of file utils.c.

Referenced by av_free_static(), av_mallocz_static(), and av_realloc_static().

AVClass av_codec_context_class = { "AVCodecContext", context_to_name } [static]

Definition at line 453 of file utils.c.

void(* av_log_callback)(void *, int, const char *, va_list) = av_log_default_callback [static]

Referenced by av_log_set_callback(), and av_vlog().

int av_log_level = AV_LOG_INFO [static]

Definition at line 1053 of file utils.c.

int volatile entangled_thread_counter = 0 [static]

Definition at line 71 of file utils.c.

Referenced by avcodec_close(), and avcodec_open().

const uint8_t ff_log2_tab[256]

Initial value:

{
        0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,
        5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
        6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
        6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
        7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
}

Definition at line 41 of file utils.c.

const uint8_t ff_reverse[256]

Initial value:

{
0x00,0x80,0x40,0xC0,0x20,0xA0,0x60,0xE0,0x10,0x90,0x50,0xD0,0x30,0xB0,0x70,0xF0,
0x08,0x88,0x48,0xC8,0x28,0xA8,0x68,0xE8,0x18,0x98,0x58,0xD8,0x38,0xB8,0x78,0xF8,
0x04,0x84,0x44,0xC4,0x24,0xA4,0x64,0xE4,0x14,0x94,0x54,0xD4,0x34,0xB4,0x74,0xF4,
0x0C,0x8C,0x4C,0xCC,0x2C,0xAC,0x6C,0xEC,0x1C,0x9C,0x5C,0xDC,0x3C,0xBC,0x7C,0xFC,
0x02,0x82,0x42,0xC2,0x22,0xA2,0x62,0xE2,0x12,0x92,0x52,0xD2,0x32,0xB2,0x72,0xF2,
0x0A,0x8A,0x4A,0xCA,0x2A,0xAA,0x6A,0xEA,0x1A,0x9A,0x5A,0xDA,0x3A,0xBA,0x7A,0xFA,
0x06,0x86,0x46,0xC6,0x26,0xA6,0x66,0xE6,0x16,0x96,0x56,0xD6,0x36,0xB6,0x76,0xF6,
0x0E,0x8E,0x4E,0xCE,0x2E,0xAE,0x6E,0xEE,0x1E,0x9E,0x5E,0xDE,0x3E,0xBE,0x7E,0xFE,
0x01,0x81,0x41,0xC1,0x21,0xA1,0x61,0xE1,0x11,0x91,0x51,0xD1,0x31,0xB1,0x71,0xF1,
0x09,0x89,0x49,0xC9,0x29,0xA9,0x69,0xE9,0x19,0x99,0x59,0xD9,0x39,0xB9,0x79,0xF9,
0x05,0x85,0x45,0xC5,0x25,0xA5,0x65,0xE5,0x15,0x95,0x55,0xD5,0x35,0xB5,0x75,0xF5,
0x0D,0x8D,0x4D,0xCD,0x2D,0xAD,0x6D,0xED,0x1D,0x9D,0x5D,0xDD,0x3D,0xBD,0x7D,0xFD,
0x03,0x83,0x43,0xC3,0x23,0xA3,0x63,0xE3,0x13,0x93,0x53,0xD3,0x33,0xB3,0x73,0xF3,
0x0B,0x8B,0x4B,0xCB,0x2B,0xAB,0x6B,0xEB,0x1B,0x9B,0x5B,0xDB,0x3B,0xBB,0x7B,0xFB,
0x07,0x87,0x47,0xC7,0x27,0xA7,0x67,0xE7,0x17,0x97,0x57,0xD7,0x37,0xB7,0x77,0xF7,
0x0F,0x8F,0x4F,0xCF,0x2F,0xAF,0x6F,0xEF,0x1F,0x9F,0x5F,0xDF,0x3F,0xBF,0x7F,0xFF,
}

Definition at line 52 of file utils.c.

Referenced by asv2_get_bits(), asv2_put_bits(), decode_frame(), encode_frame(), ir2_decode_frame(), and wnv1_get_code().

const uint8_t ff_sqrt_tab[128]

Initial value:

{
        0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
        5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
        8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
        9, 9, 9, 9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,11,11,11
}

Definition at line 34 of file utils.c.

Definition at line 176 of file utils.c.

Referenced by opt_audio_codec(), opt_codec(), opt_video_codec(), and show_formats().

unsigned int last_static = 0 [static]

Definition at line 112 of file utils.c.

Referenced by av_free_static(), av_mallocz_static(), and av_realloc_static().


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