FFmpeg
Data Structures | Macros | Functions
internal.h File Reference
#include <stdint.h>
#include "libavutil/buffer.h"
#include "libavutil/channel_layout.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "config.h"

Go to the source code of this file.

Data Structures

struct  AVCodecInternal
 

Macros

#define FF_SANE_NB_CHANNELS   512U
 
#define STRIDE_ALIGN   8
 
#define FF_MAX_EXTRADATA_SIZE   ((1 << 28) - AV_INPUT_BUFFER_PADDING_SIZE)
 Maximum size in bytes of extradata. More...
 

Functions

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...
 
unsigned int ff_toupper4 (unsigned int x)
 
void ff_color_frame (AVFrame *frame, const int color[4])
 
static av_always_inline float ff_exp2fi (int x)
 2^(x) for integer x More...
 
int avpriv_h264_has_num_reorder_frames (AVCodecContext *avctx)
 
int avpriv_codec_get_cap_skip_frame_fill_param (const AVCodec *codec)
 
AVCPBPropertiesff_add_cpb_side_data (AVCodecContext *avctx)
 Add a CPB properties side data to an encoding context. More...
 
int ff_alloc_timecode_sei (const AVFrame *frame, AVRational rate, size_t prefix_len, void **data, size_t *sei_size)
 Check AVFrame for S12M timecode side data and allocate and fill TC SEI message with timecode info. More...
 
int64_t ff_guess_coded_bitrate (AVCodecContext *avctx)
 Get an estimated video bitrate based on frame size, frame rate and coded bits per pixel. More...
 
int ff_int_from_list_or_default (void *ctx, const char *val_name, int val, const int *array_valid_values, int default_value)
 Check if a value is in the list. More...
 

Detailed Description

common internal api header.

Definition in file internal.h.

Macro Definition Documentation

◆ FF_SANE_NB_CHANNELS

#define FF_SANE_NB_CHANNELS   512U

Definition at line 40 of file internal.h.

◆ STRIDE_ALIGN

#define STRIDE_ALIGN   8

Definition at line 49 of file internal.h.

◆ FF_MAX_EXTRADATA_SIZE

#define FF_MAX_EXTRADATA_SIZE   ((1 << 28) - AV_INPUT_BUFFER_PADDING_SIZE)

Maximum size in bytes of extradata.

This value was chosen such that every bit of the buffer is addressable by a 32-bit signed integer as used by get_bits.

Definition at line 184 of file internal.h.

Function Documentation

◆ ff_match_2uint16()

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 866 of file utils.c.

Referenced by ff_h263_encode_picture_header(), ff_mpv_encode_init(), and svq1_write_header().

◆ ff_toupper4()

unsigned int ff_toupper4 ( unsigned int  x)

Definition at line 29 of file to_upper4.h.

Referenced by ff_codec_get_id(), ff_mpv_decode_init(), and validate_codec_tag().

◆ ff_color_frame()

void ff_color_frame ( AVFrame frame,
const int  color[4] 
)

Definition at line 403 of file utils.c.

Referenced by h264_field_start().

◆ ff_exp2fi()

static av_always_inline float ff_exp2fi ( int  x)
static

2^(x) for integer x

Returns
correctly rounded float

Definition at line 190 of file internal.h.

Referenced by init_band_stepsize(), and sbr_dequant().

◆ avpriv_h264_has_num_reorder_frames()

int avpriv_h264_has_num_reorder_frames ( AVCodecContext avctx)

Definition at line 57 of file h264dec.c.

Referenced by has_decode_delay_been_guessed().

◆ avpriv_codec_get_cap_skip_frame_fill_param()

int avpriv_codec_get_cap_skip_frame_fill_param ( const AVCodec codec)

Definition at line 432 of file utils.c.

Referenced by try_decode_frame().

◆ ff_add_cpb_side_data()

AVCPBProperties* ff_add_cpb_side_data ( AVCodecContext avctx)

◆ ff_alloc_timecode_sei()

int ff_alloc_timecode_sei ( const AVFrame frame,
AVRational  rate,
size_t  prefix_len,
void **  data,
size_t *  sei_size 
)

Check AVFrame for S12M timecode side data and allocate and fill TC SEI message with timecode info.

Parameters
frameRaw frame to get S12M timecode side data from
rateThe frame rate
prefix_lenNumber of bytes to allocate before SEI message
dataPointer to a variable to store allocated memory Upon return the variable will hold NULL on error or if frame has no S12M timecode info. Otherwise it will point to prefix_len uninitialized bytes followed by *sei_size SEI message
sei_sizePointer to a variable to store generated SEI message length
Returns
Zero on success, negative error code on failure

Definition at line 1062 of file utils.c.

Referenced by prepare_sei_data_array().

◆ ff_guess_coded_bitrate()

int64_t ff_guess_coded_bitrate ( AVCodecContext avctx)

Get an estimated video bitrate based on frame size, frame rate and coded bits per pixel.

Definition at line 1126 of file utils.c.

Referenced by encode_init(), raw_encode_init(), v308_encode_init(), v408_encode_init(), v410_encode_init(), and y41p_encode_init().

◆ ff_int_from_list_or_default()

int ff_int_from_list_or_default ( void *  ctx,
const char *  val_name,
int  val,
const int array_valid_values,
int  default_value 
)

Check if a value is in the list.

If not, return the default value

Parameters
ctxContext for the log msg
val_nameName of the checked value, for log msg
array_valid_valuesArray of valid int, ended with INT_MAX
default_valueValue return if checked value is not in the array
Returns
Value or default_value.

Definition at line 1147 of file utils.c.

Referenced by prores_encode_frame().