FFmpeg
|
utils. More...
#include "config.h"
#include "libavutil/avassert.h"
#include "libavutil/avstring.h"
#include "libavutil/bprint.h"
#include "libavutil/channel_layout.h"
#include "libavutil/crc.h"
#include "libavutil/frame.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"
#include "libavutil/samplefmt.h"
#include "libavutil/dict.h"
#include "avcodec.h"
#include "dsputil.h"
#include "libavutil/opt.h"
#include "thread.h"
#include "frame_thread_encoder.h"
#include "internal.h"
#include "bytestream.h"
#include "version.h"
#include <stdlib.h>
#include <stdarg.h>
#include <limits.h>
#include <float.h>
Go to the source code of this file.
Data Structures | |
struct | CompatReleaseBufPriv |
Macros | |
#define | STRIDE_ALIGN 8 |
#define | WRAP_PLANE(ref_out, data, data_size) |
#define | MAKE_ACCESSORS(str, name, type, field) |
#define | UTF8_MAX_BYTES 4 /* 5 and 6 bytes sequences should not be used */ |
#define | TAG_PRINT(x) |
#define | LICENSE_PREFIX "libavcodec license: " |
Typedefs | |
typedef struct CompatReleaseBufPriv | CompatReleaseBufPriv |
Functions | |
void * | av_fast_realloc (void *ptr, unsigned int *size, size_t min_size) |
Reallocate the given block if it is not large enough, otherwise do nothing. More... | |
static int | ff_fast_malloc (void *ptr, unsigned int *size, size_t min_size, int zero_realloc) |
void | av_fast_malloc (void *ptr, unsigned int *size, size_t min_size) |
Allocate a buffer, reusing the given one if large enough. More... | |
void | av_fast_padded_malloc (void *ptr, unsigned int *size, size_t min_size) |
Same behaviour av_fast_malloc but the buffer has additional FF_INPUT_BUFFER_PADDING_SIZE at the end which will will always be 0. More... | |
void | av_fast_padded_mallocz (void *ptr, unsigned int *size, size_t min_size) |
Same behaviour av_fast_padded_malloc except that buffer will always be 0-initialized after call. More... | |
AVCodec * | av_codec_next (const AVCodec *c) |
If c is NULL, returns the first registered codec, if c is non-NULL, returns the next registered codec after c, or NULL if c is the last one. More... | |
static void | avcodec_init (void) |
int | av_codec_is_encoder (const AVCodec *codec) |
int | av_codec_is_decoder (const AVCodec *codec) |
void | avcodec_register (AVCodec *codec) |
Register the codec codec and initialize libavcodec. More... | |
unsigned | avcodec_get_edge_width (void) |
Return the amount of padding in pixels which the get_buffer callback must provide around the edge of the image for codecs which do not have the CODEC_FLAG_EMU_EDGE flag. More... | |
void | avcodec_set_dimensions (AVCodecContext *s, int width, int height) |
void | avcodec_align_dimensions2 (AVCodecContext *s, int *width, int *height, int linesize_align[AV_NUM_DATA_POINTERS]) |
Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you also ensure that all line sizes are a multiple of the respective linesize_align[i]. More... | |
void | avcodec_align_dimensions (AVCodecContext *s, int *width, int *height) |
Modify width and height values so that they will result in a memory buffer that is acceptable for the codec if you do not use any horizontal padding. More... | |
int | avcodec_fill_audio_frame (AVFrame *frame, int nb_channels, enum AVSampleFormat sample_fmt, const uint8_t *buf, int buf_size, int align) |
Fill AVFrame audio data and linesize pointers. More... | |
static int | update_frame_pool (AVCodecContext *avctx, AVFrame *frame) |
static int | audio_get_buffer (AVCodecContext *avctx, AVFrame *frame) |
static int | video_get_buffer (AVCodecContext *s, AVFrame *pic) |
void | avpriv_color_frame (AVFrame *frame, const int c[4]) |
int | avcodec_default_get_buffer2 (AVCodecContext *avctx, AVFrame *frame, int flags) |
The default callback for AVCodecContext.get_buffer2(). More... | |
int | ff_init_buffer_info (AVCodecContext *avctx, AVFrame *frame) |
does needed setup of pkt_pts/pos and such for (re)get_buffer(); More... | |
int | avcodec_default_get_buffer (AVCodecContext *avctx, AVFrame *frame) |
static void | compat_free_buffer (void *opaque, uint8_t *data) |
static void | compat_release_buffer (void *opaque, uint8_t *data) |
static int | get_buffer_internal (AVCodecContext *avctx, AVFrame *frame, int flags) |
int | ff_get_buffer (AVCodecContext *avctx, AVFrame *frame, int flags) |
Get a buffer for a frame. More... | |
static int | reget_buffer_internal (AVCodecContext *avctx, AVFrame *frame) |
int | ff_reget_buffer (AVCodecContext *avctx, AVFrame *frame) |
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buffer when needed. More... | |
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, int size) |
int | avcodec_default_execute2 (AVCodecContext *c, int(*func)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr), void *arg, int *ret, int count) |
static int | is_hwaccel_pix_fmt (enum AVPixelFormat pix_fmt) |
enum AVPixelFormat | avcodec_default_get_format (struct AVCodecContext *s, const enum AVPixelFormat *fmt) |
void | avcodec_get_frame_defaults (AVFrame *frame) |
Set the fields of the given AVFrame to default values. More... | |
AVFrame * | avcodec_alloc_frame (void) |
Allocate an AVFrame and set its fields to default values. More... | |
void | avcodec_free_frame (AVFrame **frame) |
Free the frame and any dynamically allocated objects in it, e.g. More... | |
static void | avcodec_get_subtitle_defaults (AVSubtitle *sub) |
static int | get_bit_rate (AVCodecContext *ctx) |
int attribute_align_arg | ff_codec_open2_recursive (AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) |
Call avcodec_open2 recursively by decrementing counter, unlocking mutex, calling the function and then restoring again. More... | |
int attribute_align_arg | avcodec_open2 (AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options) |
Initialize the AVCodecContext to use the given AVCodec. More... | |
int | ff_alloc_packet2 (AVCodecContext *avctx, AVPacket *avpkt, int size) |
Check AVPacket size and/or allocate data. More... | |
int | ff_alloc_packet (AVPacket *avpkt, int size) |
static int | pad_last_frame (AVCodecContext *s, AVFrame **dst, const AVFrame *src) |
Pad last frame with silence. More... | |
int attribute_align_arg | avcodec_encode_audio2 (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) |
Encode a frame of audio. More... | |
int attribute_align_arg | avcodec_encode_audio (AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples) |
int attribute_align_arg | avcodec_encode_video (AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVFrame *pict) |
int attribute_align_arg | avcodec_encode_video2 (AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame, int *got_packet_ptr) |
Encode a frame of video. More... | |
int | avcodec_encode_subtitle (AVCodecContext *avctx, uint8_t *buf, int buf_size, const AVSubtitle *sub) |
static int64_t | guess_correct_pts (AVCodecContext *ctx, int64_t reordered_pts, int64_t dts) |
Attempt to guess proper monotonic timestamps for decoded video frames which might have incorrect times. More... | |
static void | apply_param_change (AVCodecContext *avctx, AVPacket *avpkt) |
static int | add_metadata_from_side_data (AVCodecContext *avctx, AVFrame *frame) |
int attribute_align_arg | avcodec_decode_video2 (AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, const AVPacket *avpkt) |
Decode the video frame of size avpkt->size from avpkt->data into picture. More... | |
int attribute_align_arg | avcodec_decode_audio3 (AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) |
int attribute_align_arg | avcodec_decode_audio4 (AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, const AVPacket *avpkt) |
Decode the audio frame of size avpkt->size from avpkt->data into frame. More... | |
static int | recode_subtitle (AVCodecContext *avctx, AVPacket *outpkt, const AVPacket *inpkt) |
int | avcodec_decode_subtitle2 (AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) |
Decode a subtitle message. More... | |
void | avsubtitle_free (AVSubtitle *sub) |
Free all allocated data in the given subtitle struct. More... | |
av_cold int | ff_codec_close_recursive (AVCodecContext *avctx) |
Call avcodec_close recursively, counterpart to avcodec_open2_recursive. More... | |
av_cold int | avcodec_close (AVCodecContext *avctx) |
Close a given AVCodecContext and free all the data associated with it (but not the AVCodecContext itself). More... | |
static enum AVCodecID | remap_deprecated_codec_id (enum AVCodecID id) |
static AVCodec * | find_encdec (enum AVCodecID id, int encoder) |
AVCodec * | avcodec_find_encoder (enum AVCodecID id) |
Find a registered encoder with a matching codec ID. More... | |
AVCodec * | avcodec_find_encoder_by_name (const char *name) |
Find a registered encoder with the specified name. More... | |
AVCodec * | avcodec_find_decoder (enum AVCodecID id) |
Find a registered decoder with a matching codec ID. More... | |
AVCodec * | avcodec_find_decoder_by_name (const char *name) |
Find a registered decoder with the specified name. More... | |
const char * | avcodec_get_name (enum AVCodecID id) |
Get the name of a codec. More... | |
size_t | av_get_codec_tag_string (char *buf, size_t buf_size, unsigned int codec_tag) |
Put a string representing the codec tag codec_tag in buf. More... | |
void | avcodec_string (char *buf, int buf_size, AVCodecContext *enc, int encode) |
const char * | av_get_profile_name (const AVCodec *codec, int profile) |
Return a name for the specified profile, if available. More... | |
unsigned | avcodec_version (void) |
Return the LIBAVCODEC_VERSION_INT constant. More... | |
const char * | avcodec_configuration (void) |
Return the libavcodec build-time configuration. More... | |
const char * | avcodec_license (void) |
Return the libavcodec license. More... | |
void | avcodec_flush_buffers (AVCodecContext *avctx) |
Flush buffers, should be called when seeking or when switching to a different stream. More... | |
int | av_get_exact_bits_per_sample (enum AVCodecID codec_id) |
Return codec bits per sample. More... | |
enum AVCodecID | av_get_pcm_codec (enum AVSampleFormat fmt, int be) |
Return the PCM codec associated with a sample format. More... | |
int | av_get_bits_per_sample (enum AVCodecID codec_id) |
Return codec bits per sample. More... | |
int | av_get_audio_frame_duration (AVCodecContext *avctx, int frame_bytes) |
Return audio frame duration. More... | |
int | ff_thread_init (AVCodecContext *s) |
unsigned int | av_xiphlacing (unsigned char *s, unsigned int v) |
Encode extradata length to a buffer. More... | |
int | ff_match_2uint16 (const uint16_t(*tab)[2], int size, int a, int b) |
Return the index into tab at which {a,b} match elements {[0],[1]} of tab. More... | |
void | av_log_missing_feature (void *avc, const char *feature, int want_sample) |
void | av_log_ask_for_sample (void *avc, const char *msg,...) |
void | av_register_hwaccel (AVHWAccel *hwaccel) |
Register the hardware accelerator hwaccel. More... | |
AVHWAccel * | av_hwaccel_next (AVHWAccel *hwaccel) |
If hwaccel is NULL, returns the first registered hardware accelerator, if hwaccel is non-NULL, returns the next registered hardware accelerator after hwaccel, or NULL if hwaccel is the last one. More... | |
AVHWAccel * | ff_find_hwaccel (enum AVCodecID codec_id, enum AVPixelFormat pix_fmt) |
Return the hardware accelerated codec for codec codec_id and pixel format pix_fmt. More... | |
int | av_lockmgr_register (int(*cb)(void **mutex, enum AVLockOp op)) |
Register a user provided lock manager supporting the operations specified by AVLockOp. More... | |
int | ff_lock_avcodec (AVCodecContext *log_ctx) |
int | ff_unlock_avcodec (void) |
int | avpriv_lock_avformat (void) |
int | avpriv_unlock_avformat (void) |
unsigned int | avpriv_toupper4 (unsigned int x) |
int | ff_thread_ref_frame (ThreadFrame *dst, ThreadFrame *src) |
enum AVPixelFormat | ff_thread_get_format (AVCodecContext *avctx, const enum AVPixelFormat *fmt) |
Wrapper around get_format() for frame-multithreaded codecs. More... | |
int | ff_thread_get_buffer (AVCodecContext *avctx, ThreadFrame *f, int flags) |
Wrapper around get_buffer() for frame-multithreaded codecs. More... | |
void | ff_thread_release_buffer (AVCodecContext *avctx, ThreadFrame *f) |
Wrapper around release_buffer() frame-for multithreaded codecs. More... | |
void | ff_thread_finish_setup (AVCodecContext *avctx) |
If the codec defines update_thread_context(), call this when they are ready for the next thread to start decoding the next frame. More... | |
void | ff_thread_report_progress (ThreadFrame *f, int progress, int field) |
Notify later decoding threads when part of their reference picture is ready. More... | |
void | ff_thread_await_progress (ThreadFrame *f, int progress, int field) |
Wait for earlier decoding threads to finish reference pictures. More... | |
int | ff_thread_can_start_frame (AVCodecContext *avctx) |
enum AVMediaType | avcodec_get_type (enum AVCodecID codec_id) |
Get the type of the given codec. More... | |
int | avcodec_is_open (AVCodecContext *s) |
int | avpriv_bprint_to_extradata (AVCodecContext *avctx, struct AVBPrint *buf) |
Finalize buf into extradata and set its size appropriately. More... | |
const uint8_t * | avpriv_find_start_code (const uint8_t *av_restrict p, const uint8_t *end, uint32_t *av_restrict state) |
Variables | |
volatile int | ff_avcodec_locked |
static int volatile | entangled_thread_counter = 0 |
static int(* | ff_lockmgr_cb )(void **mutex, enum AVLockOp op) |
static void * | codec_mutex |
static void * | avformat_mutex |
static AVCodec * | first_avcodec = NULL |
static AVHWAccel * | first_hwaccel = NULL |
Detailed Description
utils.
Definition in file libavcodec/utils.c.
Macro Definition Documentation
#define LICENSE_PREFIX "libavcodec license: " |
Referenced by avcodec_license().
Definition at line 979 of file libavcodec/utils.c.
#define STRIDE_ALIGN 8 |
Definition at line 188 of file libavcodec/utils.c.
Referenced by avcodec_align_dimensions2().
#define TAG_PRINT | ( | x | ) |
Definition at line 2151 of file libavcodec/utils.c.
Referenced by recode_subtitle().
#define WRAP_PLANE | ( | ref_out, | |
data, | |||
data_size | |||
) |
Referenced by av_buffersrc_add_frame_internal(), and get_buffer_internal().
Typedef Documentation
typedef struct CompatReleaseBufPriv CompatReleaseBufPriv |
Function Documentation
|
static |
Definition at line 1878 of file libavcodec/utils.c.
Referenced by avcodec_decode_audio4(), and avcodec_decode_video2().
|
static |
Definition at line 1836 of file libavcodec/utils.c.
Referenced by avcodec_decode_audio4(), and avcodec_decode_video2().
|
static |
Definition at line 466 of file libavcodec/utils.c.
Referenced by avcodec_default_get_buffer2().
Definition at line 2907 of file libavcodec/utils.c.
Referenced by av_log_missing_feature().
Definition at line 2897 of file libavcodec/utils.c.
int attribute_align_arg avcodec_decode_audio3 | ( | AVCodecContext * | avctx, |
int16_t * | samples, | ||
int * | frame_size_ptr, | ||
AVPacket * | avpkt | ||
) |
Definition at line 1985 of file libavcodec/utils.c.
int avcodec_default_execute2 | ( | AVCodecContext * | c, |
int(*)(AVCodecContext *c2, void *arg2, int jobnr, int threadnr) | func, | ||
void * | arg, | ||
int * | ret, | ||
int | count | ||
) |
Definition at line 902 of file libavcodec/utils.c.
int avcodec_default_get_buffer | ( | AVCodecContext * | avctx, |
AVFrame * | frame | ||
) |
Definition at line 661 of file libavcodec/utils.c.
Referenced by avcodec_decode_audio3().
int avcodec_default_reget_buffer | ( | AVCodecContext * | s, |
AVFrame * | pic | ||
) |
Definition at line 884 of file libavcodec/utils.c.
void avcodec_default_release_buffer | ( | AVCodecContext * | s, |
AVFrame * | pic | ||
) |
Definition at line 877 of file libavcodec/utils.c.
Referenced by avcodec_decode_audio3().
int attribute_align_arg avcodec_encode_audio | ( | AVCodecContext * | avctx, |
uint8_t * | buf, | ||
int | buf_size, | ||
const short * | samples | ||
) |
Definition at line 1600 of file libavcodec/utils.c.
int attribute_align_arg avcodec_encode_video | ( | AVCodecContext * | avctx, |
uint8_t * | buf, | ||
int | buf_size, | ||
const AVFrame * | pict | ||
) |
Definition at line 1678 of file libavcodec/utils.c.
|
static |
Definition at line 986 of file libavcodec/utils.c.
Referenced by avcodec_decode_subtitle2().
Definition at line 136 of file libavcodec/utils.c.
Referenced by avcodec_register().
int avpriv_bprint_to_extradata | ( | AVCodecContext * | avctx, |
struct AVBPrint * | buf | ||
) |
Finalize buf into extradata and set its size appropriately.
Definition at line 3107 of file libavcodec/utils.c.
Referenced by ass_read_header(), dvdsub_init(), ff_samples_to_time_base(), jacosub_read_header(), sami_read_header(), and subviewer_read_header().
Definition at line 564 of file libavcodec/utils.c.
Referenced by h264_frame_start().
const uint8_t* avpriv_find_start_code | ( | const uint8_t *av_restrict | p, |
const uint8_t * | end, | ||
uint32_t *av_restrict | state | ||
) |
Definition at line 3125 of file libavcodec/utils.c.
int avpriv_lock_avformat | ( | void | ) |
Definition at line 3000 of file libavcodec/utils.c.
Referenced by avisynth_read_close(), avisynth_read_header(), ff_tls_deinit(), and ff_tls_init().
unsigned int avpriv_toupper4 | ( | unsigned int | x | ) |
Definition at line 3018 of file libavcodec/utils.c.
Referenced by ff_codec_get_id(), ff_MPV_common_init(), mpeg_decode_frame(), and validate_codec_tag().
int avpriv_unlock_avformat | ( | void | ) |
Definition at line 3009 of file libavcodec/utils.c.
Referenced by avisynth_read_close(), avisynth_read_header(), ff_tls_deinit(), and ff_tls_init().
Definition at line 671 of file libavcodec/utils.c.
Referenced by av_buffersink_set_frame_size(), av_buffersrc_add_frame_internal(), and get_buffer_internal().
Definition at line 679 of file libavcodec/utils.c.
int ff_alloc_packet | ( | AVPacket * | avpkt, |
int | size | ||
) |
Definition at line 1420 of file libavcodec/utils.c.
Referenced by cng_encode_frame().
int ff_alloc_packet2 | ( | AVCodecContext * | avctx, |
AVPacket * | avpkt, | ||
int | size | ||
) |
Check AVPacket size and/or allocate data.
Encoders supporting AVCodec.encode2() can use this as a convenience to ensure the output packet data is large enough, whether provided by the user or allocated in this function.
- Parameters
-
avctx the AVCodecContext of the encoder avpkt the AVPacket If avpkt->data is already set, avpkt->size is checked to ensure it is large enough. If avpkt->data is NULL, a new buffer is allocated. avpkt->size is set to the specified size. All other AVPacket fields will be reset with av_init_packet(). size the minimum required packet size
- Returns
- 0 on success, negative error code on failure
Definition at line 1377 of file libavcodec/utils.c.
Referenced by a64multi_encode_frame(), aac_encode_frame(), aacPlus_encode_frame(), adpcm_encode_frame(), adx_encode_frame(), alac_encode_frame(), amr_decode_fix_avctx(), amr_wb_encode_frame(), avui_encode_frame(), bmp_encode_frame(), dnxhd_encode_picture(), dv_write_pack(), encode_frame(), encode_nals(), encode_picture_lossless(), encode_picture_ls(), encode_superframe(), Faac_encode_frame(), ff_alloc_packet(), ff_MPV_encode_picture(), flac_encode_frame(), flashsv2_encode_frame(), flashsv_encode_frame(), g722_encode_frame(), g726_reset(), gif_encode_frame(), ilbc_encode_frame(), libgsm_encode_frame(), libopenjpeg_encode_frame(), libopus_encode(), libschroedinger_encode_frame(), libshine_encode_frame(), mp3lame_encode_frame(), MPA_encode_frame(), oggvorbis_encode_frame(), pam_encode_frame(), pcm_encode_frame(), pcx_encode_frame(), pnm_encode_frame(), predictor_calc_error(), prores_encode_frame(), qtrle_encode_frame(), ra144_encode_frame(), raw_encode(), roq_dpcm_encode_frame(), roq_encode_frame(), storeframe(), sunrast_encode_frame(), svq1_encode_frame(), targa_encode_frame(), twolame_encode_frame(), utvideo_encode_frame(), v308_encode_frame(), v408_encode_frame(), v410_encode_frame(), vorbis_encode_frame(), XAVS_frame(), xbm_encode_frame(), xface_encode_frame(), xvid_encode_frame(), xwd_encode_frame(), y41p_encode_frame(), and yuv4_encode_frame().
av_cold int ff_codec_close_recursive | ( | AVCodecContext * | avctx | ) |
Call avcodec_close recursively, counterpart to avcodec_open2_recursive.
Definition at line 2293 of file libavcodec/utils.c.
Referenced by ff_samples_to_time_base().
int attribute_align_arg ff_codec_open2_recursive | ( | AVCodecContext * | avctx, |
const AVCodec * | codec, | ||
AVDictionary ** | options | ||
) |
Call avcodec_open2 recursively by decrementing counter, unlocking mutex, calling the function and then restoring again.
Assumes the mutex is already locked
Definition at line 1022 of file libavcodec/utils.c.
Referenced by ff_samples_to_time_base().
|
inlinestatic |
Definition at line 82 of file libavcodec/utils.c.
Referenced by av_fast_malloc(), av_fast_padded_malloc(), and av_fast_padded_mallocz().
AVHWAccel* ff_find_hwaccel | ( | enum AVCodecID | codec_id, |
enum AVPixelFormat | pix_fmt | ||
) |
Return the hardware accelerated codec for codec codec_id and pixel format pix_fmt.
- Parameters
-
codec_id the codec to match pix_fmt the pixel format to match
- Returns
- the hardware accelerated codec, or NULL if none was found.
Definition at line 2939 of file libavcodec/utils.c.
Referenced by ff_h263_decode_init(), h264_slice_header_init(), setup_hwaccel_for_pixfmt(), and vc1_decode_init().
int ff_get_buffer | ( | AVCodecContext * | avctx, |
AVFrame * | frame, | ||
int | flags | ||
) |
Get a buffer for a frame.
This is a wrapper around AVCodecContext.get_buffer() and should be used instead calling get_buffer() directly.
Definition at line 823 of file libavcodec/utils.c.
Referenced by ac3_decode_frame(), adpcm_decode_frame(), adx_decode_frame(), amr_decode_fix_avctx(), amrnb_decode_frame(), amrwb_decode_frame(), ape_decode_frame(), atrac1_decode_frame(), atrac3_decode_frame(), aura_decode_frame(), avui_decode_frame(), bfi_decode_frame(), bmp_decode_frame(), bmv_aud_decode_frame(), brpix_decode_frame(), cdg_decode_frame(), cdxl_decode_frame(), cinaudio_decode_frame(), cllc_decode_frame(), cmv_decode_frame(), cng_decode_frame(), cook_decode_frame(), copy_frame(), copy_output(), cyuv_decode_frame(), dca_decode_frame(), decode_element(), decode_frame(), decode_pic(), decode_tag(), decode_thread(), dfa_decode_frame(), dirac_decode_data_unit(), dirac_decode_picture_header(), dpcm_decode_frame(), dvvideo_decode_frame(), eightsvx_decode_frame(), encode_init(), escape124_decode_frame(), escape130_decode_frame(), evrc_decode_frame(), execute_code(), ff_ivi_decode_frame(), ff_mjpeg_decode_sof(), ff_samples_to_time_base(), ff_snow_common_init_after_header(), ff_snow_frame_start(), ff_thread_get_buffer(), ff_thread_video_encode_frame(), ff_vc1_decode_blocks(), ff_vp56_decode_frame(), flac_decode_frame(), flush(), frame_configure_elements(), g722_decode_frame(), g723_1_decode_frame(), g726_reset(), get_buffer(), get_siz(), gif_decode_frame(), gsm_decode_frame(), idcin_decode_frame(), ilbc_decode_frame(), imc_decode_frame(), init_image(), ipvideo_decode_frame(), libcelt_dec_decode(), libgsm_decode_frame(), libopus_decode(), libschroedinger_decode_frame(), libspeex_decode_frame(), mace_decode_frame(), mp_decode_frame(), mpc7_decode_frame(), mpc8_decode_frame(), mss2_decode_frame(), mxpeg_decode_frame(), oggvorbis_decode_frame(), output_data(), paf_aud_decode(), pcm_bluray_decode_frame(), pcm_decode_frame(), pcx_decode_frame(), pnm_decode_frame(), predictor_calc_error(), ptx_decode_frame(), qcelp_decode_frame(), qdm2_decode_frame(), ra144_decode_frame(), ra288_decode_frame(), reget_buffer_internal(), rl2_decode_frame(), roq_encode_frame(), s302m_decode_frame(), shorten_decode_frame(), sipr_decode_frame(), smka_decode_frame(), submit_packet(), sunrast_decode_frame(), svq1_decode_frame(), svq1_encode_frame(), synth_superframe(), tak_decode_frame(), tgq_decode_frame(), tgv_decode_frame(), thread_get_buffer_internal(), tmv_decode_frame(), tqi_decode_frame(), truespeech_decode_frame(), tta_decode_frame(), twin_decode_frame(), txd_decode_frame(), v308_decode_frame(), v408_decode_frame(), v410_decode_frame(), vble_decode_frame(), vcr1_decode_frame(), vmdaudio_decode_frame(), vmdvideo_decode_frame(), vorbis_decode_frame(), vp8_decode(), vqa_decode_frame(), wavesynth_decode(), wavpack_decode_frame(), wma_decode_superframe(), ws_snd_decode_frame(), xan_decode_frame(), xbm_decode_frame(), xface_decode_frame(), xwd_decode_frame(), y216_decode_frame(), y41p_decode_frame(), yuv4_decode_frame(), zero12v_decode_frame(), and zerocodec_decode_frame().
int ff_init_buffer_info | ( | AVCodecContext * | avctx, |
AVFrame * | frame | ||
) |
does needed setup of pkt_pts/pos and such for (re)get_buffer();
Definition at line 607 of file libavcodec/utils.c.
Referenced by get_buffer_internal(), reget_buffer_internal(), and thread_get_buffer_internal().
int ff_lock_avcodec | ( | AVCodecContext * | log_ctx | ) |
Definition at line 2970 of file libavcodec/utils.c.
Referenced by avcodec_close(), avcodec_open2(), ff_codec_close_recursive(), and ff_codec_open2_recursive().
int ff_match_2uint16 | ( | const uint16_t(*) | tab[2], |
int | size, | ||
int | a, | ||
int | b | ||
) |
Return the index into tab at which {a,b} match elements {[0],[1]} of tab.
If there is no such matching pair then size is returned.
Definition at line 2889 of file libavcodec/utils.c.
Referenced by ff_h263_encode_picture_header(), ff_MPV_encode_init(), and svq1_write_header().
int ff_reget_buffer | ( | AVCodecContext * | avctx, |
AVFrame * | frame | ||
) |
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buffer when needed.
Definition at line 868 of file libavcodec/utils.c.
Referenced by aasc_decode_frame(), avs_decode_frame(), bethsoftvid_decode_frame(), cdg_decode_frame(), cinepak_decode_frame(), cinvideo_decode_frame(), cpia_decode_frame(), decode_frame(), ff_samples_to_time_base(), flashsv_decode_frame(), flic_decode_frame_15_16BPP(), flic_decode_frame_8BPP(), gif_decode_frame(), ir2_decode_frame(), mm_decode_frame(), mp_decode_frame(), msrle_decode_frame(), mss1_decode_frame(), mss2_decode_frame(), mss3_decode_frame(), mss4_decode_frame(), msvideo1_decode_frame(), mvc_decode_frame(), paf_vid_decode(), qtrle_decode_frame(), roq_decode_frame(), rpza_decode_frame(), seqvideo_decode_frame(), sgirle_decode_frame(), smc_decode_frame(), truemotion1_decode_frame(), tscc2_decode_frame(), ulti_decode_frame(), xan_decode_frame(), and yop_decode_frame().
void ff_thread_await_progress | ( | ThreadFrame * | f, |
int | progress, | ||
int | field | ||
) |
Wait for earlier decoding threads to finish reference pictures.
Call this before accessing some part of a picture, with a given value for progress, and it will return after the responsible decoding thread calls ff_thread_report_progress() with the same or higher value for progress.
- Parameters
-
f The picture being referenced. progress Value, in arbitrary units, to wait for. field The field being referenced, for field-picture codecs. 0 for top field or frame pictures, 1 for bottom field.
Definition at line 3071 of file libavcodec/utils.c.
int ff_thread_can_start_frame | ( | AVCodecContext * | avctx | ) |
Definition at line 3075 of file libavcodec/utils.c.
Referenced by ff_MPV_frame_start(), ff_samples_to_time_base(), and h264_frame_start().
void ff_thread_finish_setup | ( | AVCodecContext * | avctx | ) |
If the codec defines update_thread_context(), call this when they are ready for the next thread to start decoding the next frame.
After calling it, do not change any variables read by the update_thread_context() method, or call ff_thread_get_buffer().
- Parameters
-
avctx The context.
Definition at line 3063 of file libavcodec/utils.c.
int ff_thread_get_buffer | ( | AVCodecContext * | avctx, |
ThreadFrame * | f, | ||
int | flags | ||
) |
Wrapper around get_buffer() for frame-multithreaded codecs.
Call this function instead of ff_get_buffer(f). Cannot be called after the codec has called ff_thread_finish_setup().
- Parameters
-
avctx The current context. f The frame to write into.
Definition at line 3052 of file libavcodec/utils.c.
enum AVPixelFormat ff_thread_get_format | ( | AVCodecContext * | avctx, |
const enum AVPixelFormat * | fmt | ||
) |
Wrapper around get_format() for frame-multithreaded codecs.
Call this function instead of avctx->get_format(). Cannot be called after the codec has called ff_thread_finish_setup().
- Parameters
-
avctx The current context. fmt The list of available formats.
Definition at line 3047 of file libavcodec/utils.c.
int ff_thread_init | ( | AVCodecContext * | s | ) |
Definition at line 2868 of file libavcodec/utils.c.
Referenced by avcodec_open2().
int ff_thread_ref_frame | ( | ThreadFrame * | dst, |
ThreadFrame * | src | ||
) |
Definition at line 3026 of file libavcodec/utils.c.
Referenced by ff_mpeg_ref_picture(), mimic_decode_update_thread_context(), ref_frame(), ref_picture(), update_frames(), vp3_decode_frame(), and vp8_ref_frame().
void ff_thread_release_buffer | ( | AVCodecContext * | avctx, |
ThreadFrame * | f | ||
) |
Wrapper around release_buffer() frame-for multithreaded codecs.
Call this function instead of avctx->release_buffer(f). The AVFrame will be copied and the actual release_buffer() call will be performed later. The contents of data pointed to by the AVFrame should not be changed until ff_thread_get_buffer() is called on it.
- Parameters
-
avctx The current context. f The picture being released.
Definition at line 3058 of file libavcodec/utils.c.
Referenced by ff_thread_ref_frame().
void ff_thread_report_progress | ( | ThreadFrame * | f, |
int | progress, | ||
int | field | ||
) |
Notify later decoding threads when part of their reference picture is ready.
Call this when some part of the picture is finished decoding. Later calls with lower values of progress have no effect.
- Parameters
-
f The picture being decoded. progress Value, in arbitrary units, of how much of the picture has decoded. field The field being decoded, for field-picture codecs. 0 for top field or frame pictures, 1 for bottom field.
Definition at line 3067 of file libavcodec/utils.c.
int ff_unlock_avcodec | ( | void | ) |
Definition at line 2988 of file libavcodec/utils.c.
Referenced by avcodec_close(), avcodec_open2(), ff_codec_close_recursive(), ff_codec_open2_recursive(), and ff_lock_avcodec().
Definition at line 2360 of file libavcodec/utils.c.
Referenced by avcodec_find_decoder(), and avcodec_find_encoder().
|
static |
Definition at line 992 of file libavcodec/utils.c.
Referenced by avcodec_open2(), and avcodec_string().
|
static |
Definition at line 686 of file libavcodec/utils.c.
Referenced by ff_get_buffer().
|
static |
Attempt to guess proper monotonic timestamps for decoded video frames which might have incorrect times.
Input timestamps may wrap around, in which case the output will as well.
- Parameters
-
pts the pts field of the decoded AVPacket, as passed through AVFrame.pkt_pts dts the dts field of the decoded AVPacket
- Returns
- one of the input values, may be AV_NOPTS_VALUE
Definition at line 1814 of file libavcodec/utils.c.
Referenced by avcodec_decode_audio4(), and avcodec_decode_video2().
|
static |
Definition at line 914 of file libavcodec/utils.c.
Referenced by avcodec_default_get_format().
|
static |
Pad last frame with silence.
Definition at line 1428 of file libavcodec/utils.c.
Referenced by avcodec_encode_audio2().
|
static |
Definition at line 2152 of file libavcodec/utils.c.
Referenced by avcodec_decode_subtitle2().
|
static |
Definition at line 831 of file libavcodec/utils.c.
Referenced by ff_reget_buffer().
Definition at line 2348 of file libavcodec/utils.c.
Referenced by find_encdec().
|
static |
Definition at line 362 of file libavcodec/utils.c.
Referenced by avcodec_default_get_buffer2().
|
static |
Definition at line 511 of file libavcodec/utils.c.
Referenced by avcodec_default_get_buffer2().
Variable Documentation
|
static |
Definition at line 61 of file libavcodec/utils.c.
Referenced by av_lockmgr_register(), avpriv_lock_avformat(), and avpriv_unlock_avformat().
|
static |
Definition at line 60 of file libavcodec/utils.c.
Referenced by av_lockmgr_register(), ff_lock_avcodec(), and ff_unlock_avcodec().
|
static |
Definition at line 58 of file libavcodec/utils.c.
Referenced by ff_lock_avcodec(), and ff_unlock_avcodec().
volatile int ff_avcodec_locked |
Definition at line 57 of file libavcodec/utils.c.
Referenced by ff_lock_avcodec(), and ff_unlock_avcodec().
Definition at line 59 of file libavcodec/utils.c.
Referenced by av_lockmgr_register(), avpriv_lock_avformat(), avpriv_unlock_avformat(), ff_lock_avcodec(), and ff_unlock_avcodec().
Definition at line 126 of file libavcodec/utils.c.
Referenced by av_codec_next(), avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), avcodec_register(), and find_encdec().
Definition at line 2923 of file libavcodec/utils.c.
Referenced by av_hwaccel_next(), and av_register_hwaccel().
Generated on Fri Dec 20 2024 06:56:16 for FFmpeg by 1.8.11