utils. More...
#include "config.h"#include "libavutil/atomic.h"#include "libavutil/attributes.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/internal.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.
utils.
Definition in file utils.c.
Definition at line 243 of file utils.c.
Referenced by avcodec_align_dimensions2(), and update_frame_pool().
Definition at line 2316 of file utils.c.
Referenced by recode_subtitle().
Referenced by av_get_codec_tag_string().
Definition at line 139 of file utils.c.
Referenced by av_fast_malloc(), av_fast_padded_malloc(), and av_fast_padded_mallocz().
Definition at line 193 of file utils.c.
Referenced by avcodec_register().
Definition at line 468 of file utils.c.
Referenced by avcodec_default_get_buffer2().
Definition at line 572 of file utils.c.
Referenced by avcodec_default_get_buffer2().
Definition at line 617 of file utils.c.
Referenced by avcodec_default_get_buffer2().
Definition at line 671 of file utils.c.
Referenced by h264_frame_start().
does needed setup of pkt_pts/pos and such for (re)get_buffer();
Definition at line 717 of file utils.c.
Referenced by get_buffer_internal(), reget_buffer_internal(), and thread_get_buffer_internal().
Definition at line 802 of file utils.c.
Referenced by ff_get_buffer().
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 942 of file utils.c.
Referenced by ac3_decode_frame(), adpcm_decode_frame(), adx_decode_frame(), aic_decode_frame(), 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_frame(), decode_p_frame(), decode_pic(), decode_tag(), decode_thread(), dfa_decode_frame(), dirac_decode_data_unit(), dirac_decode_picture_header(), dpcm_decode_frame(), dvvideo_decode_frame(), dxtory_decode_v1(), dxtory_decode_v2(), eightsvx_decode_frame(), encode_init(), escape124_decode_frame(), escape130_decode_frame(), evrc_decode_frame(), execute_code(), fdk_aac_decode_frame(), ff_ivi_decode_frame(), ff_mjpeg_decode_sof(), ff_snow_common_init_after_header(), ff_snow_frame_start(), ff_thread_get_buffer(), ff_thread_video_encode_frame(), ff_twinvq_decode_frame(), ff_vp56_decode_frame(), frame_configure_elements(), g2m_decode_frame(), g722_decode_frame(), g723_1_decode_frame(), get_buffer(), gif_decode_frame(), gsm_decode_frame(), hls_slice_header(), idcin_decode_frame(), ilbc_decode_frame(), imc_decode_frame(), 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(), pcm_dvd_decode_frame(), pcx_decode_frame(), pnm_decode_frame(), 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(), tgq_decode_frame(), tgv_decode_frame(), thread_get_buffer_internal(), tmv_decode_frame(), tqi_decode_frame(), truespeech_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(), vp9_decode_frame(), vqa_decode_frame(), wavesynth_decode(), 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().
Definition at line 950 of file utils.c.
Referenced by ff_reget_buffer().
Identical in function to av_frame_make_writable(), except it uses ff_get_buffer() to allocate the buffer when needed.
Definition at line 987 of file 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(), 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().
Definition at line 1034 of file utils.c.
Referenced by avcodec_default_get_format().
Definition at line 1102 of file utils.c.
Referenced by avcodec_decode_subtitle2().
Definition at line 1108 of file utils.c.
Referenced by avcodec_open2(), and avcodec_string().
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 1138 of file utils.c.
Referenced by smvjpeg_decode_init().
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.
Definition at line 1493 of file utils.c.
Referenced by a64multi_encode_frame(), aac_encode_frame(), aacPlus_encode_frame(), adx_encode_frame(), alac_encode_frame(), amr_wb_encode_frame(), avui_encode_frame(), bmp_encode_frame(), dnxhd_encode_picture(), 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(), 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(), prores_encode_frame(), qtrle_encode_frame(), ra144_encode_frame(), raw_encode(), roq_dpcm_encode_frame(), roq_encode_frame(), s302m_encode2_frame(), storeframe(), sunrast_encode_frame(), svq1_encode_frame(), targa_encode_frame(), tta_encode_frame(), twolame_encode_frame(), utvideo_encode_frame(), v308_encode_frame(), v408_encode_frame(), v410_encode_frame(), vorbis_encode_frame(), wavpack_encode_frame(), XAVS_frame(), xbm_encode_frame(), xface_encode_frame(), xvid_encode_frame(), xwd_encode_frame(), y41p_encode_frame(), and yuv4_encode_frame().
Definition at line 1545 of file utils.c.
Referenced by cng_encode_frame().
Pad last frame with silence.
Definition at line 1553 of file utils.c.
Referenced by avcodec_encode_audio2().
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.
Definition at line 1934 of file utils.c.
Referenced by avcodec_decode_audio4(), and avcodec_decode_video2().
Definition at line 1956 of file utils.c.
Referenced by avcodec_decode_audio4(), and avcodec_decode_video2().
Definition at line 1998 of file utils.c.
Referenced by avcodec_decode_audio4(), and avcodec_decode_video2().
Definition at line 2317 of file utils.c.
Referenced by avcodec_decode_subtitle2().
Definition at line 2374 of file utils.c.
Referenced by avcodec_decode_subtitle2().
Call avcodec_close recursively, counterpart to avcodec_open2_recursive.
Definition at line 2506 of file utils.c.
Referenced by smvjpeg_decode_end().
Definition at line 2566 of file utils.c.
Referenced by find_encdec().
Definition at line 2583 of file utils.c.
Referenced by avcodec_find_decoder(), and avcodec_find_encoder().
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 3146 of file utils.c.
Referenced by ff_h263_encode_picture_header(), ff_MPV_encode_init(), and svq1_write_header().
Return the hardware accelerated codec for codec codec_id and pixel format pix_fmt.
Definition at line 3197 of file utils.c.
Referenced by ff_h263_decode_init(), h264_slice_header_init(), setup_hwaccel_for_pixfmt(), and vc1_decode_init().
Definition at line 3228 of file utils.c.
Referenced by avcodec_close(), avcodec_open2(), ff_codec_close_recursive(), and ff_codec_open2_recursive().
Definition at line 3248 of file utils.c.
Referenced by avcodec_close(), avcodec_open2(), ff_codec_close_recursive(), ff_codec_open2_recursive(), and ff_lock_avcodec().
Definition at line 3260 of file utils.c.
Referenced by avisynth_read_close(), avisynth_read_header(), ff_tls_deinit(), and ff_tls_init().
Definition at line 3269 of file utils.c.
Referenced by avisynth_read_close(), avisynth_read_header(), ff_tls_deinit(), and ff_tls_init().
Definition at line 3278 of file utils.c.
Referenced by ff_codec_get_id(), ff_MPV_common_init(), mpeg_decode_frame(), and validate_codec_tag().
Definition at line 3286 of file utils.c.
Referenced by ff_mpeg_ref_picture(), hevc_ref_frame(), mimic_decode_update_thread_context(), ref_frame(), ref_picture(), update_frames(), update_thread_context(), and vp8_ref_frame().
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().
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().
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.
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().
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.
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.
Definition at line 3335 of file utils.c.
Referenced by ff_MPV_frame_start(), and h264_frame_start().
Finalize buf into extradata and set its size appropriately.
Definition at line 3384 of file utils.c.
Referenced by ass_read_header(), dvdsub_init(), jacosub_read_header(), sami_read_header(), and subviewer_read_header().
Definition at line 111 of file utils.c.
Referenced by av_lockmgr_register(), avpriv_lock_avformat(), avpriv_unlock_avformat(), ff_lock_avcodec(), and ff_unlock_avcodec().
Definition at line 183 of file 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 3182 of file utils.c.
Referenced by av_hwaccel_next(), and av_register_hwaccel().