- Main Page
- Modules
- Data Structures
- Files
- Directories
- Related Pages

# gavl.h File Reference

`#include <inttypes.h>`
`#include <gavlconfig.h>`
`#include "gavltime.h"`

Go to the source code of this file.

## Data Structures
struct | gavl_audio_format_t
| Audio Format. More...
union | gavl_audio_samples_t
| Container for interleaved audio samples. More...
union | gavl_audio_channels_t
| Container for noninterleaved audio samples. More...
struct | gavl_audio_frame_t
| Generic container for audio samples. More...
struct | gavl_rectangle_i_t
struct | gavl_rectangle_f_t
struct | gavl_video_format_s
| Video format. More...
struct | gavl_video_frame_t
struct | gavl_overlay_t
| Overlay structure. More...
## Defines
#define | GAVL_QUALITY_FASTEST 1
| Fastest processing.
#define | GAVL_QUALITY_BEST 5
| Highest quality.
#define | GAVL_QUALITY_DEFAULT 2
| Default quality.
#define | GAVL_ACCEL_MMX (1<<0)
| MMX.
#define | GAVL_ACCEL_MMXEXT (1<<1)
| Extended MMX (a.k.a MMX2).
#define | GAVL_ACCEL_SSE (1<<2)
| Intel SSE.
#define | GAVL_ACCEL_SSE2 (1<<3)
| Intel SSE2.
#define | GAVL_ACCEL_SSE3 (1<<4)
| Intel SSE3.
#define | GAVL_ACCEL_3DNOW (1<<5)
| AMD 3Dnow.
#define | GAVL_ACCEL_3DNOWEXT (1<<6)
| AMD 3Dnow ext.
#define | GAVL_ACCEL_SSSE3 (1<<7)
| Intel SSSE3.
#define | GAVL_MAX_CHANNELS 128
| Maximum number of audio channels.
#define | GAVL_AUDIO_FRONT_TO_REAR_COPY (1<<0)
#define | GAVL_AUDIO_FRONT_TO_REAR_MUTE (1<<1)
#define | GAVL_AUDIO_FRONT_TO_REAR_DIFF (1<<2)
#define | GAVL_AUDIO_FRONT_TO_REAR_MASK
#define | GAVL_AUDIO_STEREO_TO_MONO_LEFT (1<<3)
#define | GAVL_AUDIO_STEREO_TO_MONO_RIGHT (1<<4)
#define | GAVL_AUDIO_STEREO_TO_MONO_MIX (1<<5)
#define | GAVL_AUDIO_STEREO_TO_MONO_MASK
#define | GAVL_MAX_PLANES 4
#define | GAVL_PIXFMT_PLANAR (1<<8)
#define | GAVL_PIXFMT_RGB (1<<9)
#define | GAVL_PIXFMT_YUV (1<<10)
#define | GAVL_PIXFMT_YUVJ (1<<11)
#define | GAVL_PIXFMT_ALPHA (1<<12)
#define | GAVL_PIXFMT_GRAY (1<<13)
#define | GAVL_PIXELFORMAT_1D_8 GAVL_GRAY_8
| Pixelformat for storing 1-dimensional integer data with 8 bits each.
#define | GAVL_PIXELFORMAT_2D_8 GAVL_GRAYA_16
| Pixelformat for storing 2-dimensional integer data with 8 bits each.
#define | GAVL_PIXELFORMAT_3D_8 GAVL_RGB_24
| Pixelformat for storing 3-dimensional integer data with 8 bits each.
#define | GAVL_PIXELFORMAT_4D_8 GAVL_RGBA_32
| Pixelformat for storing 4-dimensional integer data with 8 bits each.
#define | GAVL_PIXELFORMAT_1D_16 GAVL_GRAY_16
| Pixelformat for storing 1-dimensional integer data with 16 bits each.
#define | GAVL_PIXELFORMAT_2D_16 GAVL_GRAYA_32
| Pixelformat for storing 2-dimensional integer data with 16 bits each.
#define | GAVL_PIXELFORMAT_3D_16 GAVL_RGB_48
| Pixelformat for storing 3-dimensional integer data with 16 bits each.
#define | GAVL_PIXELFORMAT_4D_16 GAVL_RGBA_64
| Pixelformat for storing 4-dimensional integer data with 16 bits each.
#define | GAVL_PIXELFORMAT_1D_FLOAT GAVL_GRAY_FLOAT
| Pixelformat for storing 1-dimensional FLOAT data.
#define | GAVL_PIXELFORMAT_2D_FLOAT GAVL_GRAYA_FLOAT
| Pixelformat for storing 2-dimensional FLOAT data.
#define | GAVL_PIXELFORMAT_3D_FLOAT GAVL_RGB_FLOAT
| Pixelformat for storing 3-dimensional FLOAT data.
#define | GAVL_PIXELFORMAT_4D_FLOAT GAVL_RGBA_FLOAT
| Pixelformat for storing 4-dimensional FLOAT data.
#define | gavl_pixelformat_is_gray(fmt) ((fmt) & GAVL_PIXFMT_GRAY)
| Check if a pixelformat is grayscale.
#define | gavl_pixelformat_is_rgb(fmt) ((fmt) & GAVL_PIXFMT_RGB)
| Check if a pixelformat is RGB based.
#define | gavl_pixelformat_is_yuv(fmt) ((fmt) & GAVL_PIXFMT_YUV)
| Check if a pixelformat is YUV based.
#define | gavl_pixelformat_is_jpeg_scaled(fmt) ((fmt) & GAVL_PIXFMT_YUVJ)
| Check if a pixelformat is jpeg (full range) scaled.
#define | gavl_pixelformat_has_alpha(fmt) ((fmt) & GAVL_PIXFMT_ALPHA)
| Check if a pixelformat has a transparency channel.
#define | gavl_pixelformat_is_planar(fmt) ((fmt) & GAVL_PIXFMT_PLANAR)
| Check if a pixelformat is planar.
#define | GAVL_FORCE_DEINTERLACE (1<<0)
| Force deinterlacing.
#define | GAVL_CONVOLVE_CHROMA (1<<1)
| Pass chroma planes to the convolver.
#define | GAVL_CONVOLVE_NORMALIZE (1<<2)
| Normalize convolution matrices passed to the scaler.
#define | GAVL_RESAMPLE_CHROMA (1<<3)
| Force chroma placement correction.
## Typedefs
typedef struct gavl_video_format_s | gavl_video_format_t
| Video format.
typedef struct gavl_audio_options_s | gavl_audio_options_t
| Opaque container for audio conversion options.
typedef struct gavl_audio_converter_s | gavl_audio_converter_t
| Opaque audio converter structure.
typedef struct gavl_volume_control_s | gavl_volume_control_t
| Opaque structure for a volume control.
typedef struct gavl_peak_detector_s | gavl_peak_detector_t
| Opaque structure for peak detector.
typedef struct gavl_video_options_s | gavl_video_options_t
typedef struct gavl_video_converter_s | gavl_video_converter_t
| Opaque video converter structure.
typedef struct gavl_video_scaler_s | gavl_video_scaler_t
| Opaque scaler structure.
typedef struct gavl_video_deinterlacer_s | gavl_video_deinterlacer_t
| Opaque deinterlacer structure.
typedef struct gavl_overlay_blend_context_s | gavl_overlay_blend_context_t
| Opaque blend context.
## Enumerations
enum | gavl_sample_format_t { GAVL_SAMPLE_NONE = 0, GAVL_SAMPLE_U8 = 1, GAVL_SAMPLE_S8 = 2, GAVL_SAMPLE_U16 = 3, GAVL_SAMPLE_S16 = 4, GAVL_SAMPLE_S32 = 5, GAVL_SAMPLE_FLOAT = 6, GAVL_SAMPLE_DOUBLE = 7 }
| Format of one audio sample. More...
enum | gavl_interleave_mode_t { GAVL_INTERLEAVE_NONE = 0, GAVL_INTERLEAVE_2 = 1, GAVL_INTERLEAVE_ALL = 2 }
enum | gavl_channel_id_t { GAVL_CHID_NONE = 0, GAVL_CHID_FRONT_CENTER, GAVL_CHID_FRONT_LEFT, GAVL_CHID_FRONT_RIGHT, GAVL_CHID_FRONT_CENTER_LEFT, GAVL_CHID_FRONT_CENTER_RIGHT, GAVL_CHID_REAR_LEFT, GAVL_CHID_REAR_RIGHT, GAVL_CHID_REAR_CENTER, GAVL_CHID_SIDE_LEFT, GAVL_CHID_SIDE_RIGHT, GAVL_CHID_LFE, GAVL_CHID_AUX }
| Audio channel setup. More...
enum | gavl_audio_dither_mode_t { GAVL_AUDIO_DITHER_NONE = 0, GAVL_AUDIO_DITHER_AUTO = 1, GAVL_AUDIO_DITHER_RECT = 2, GAVL_AUDIO_DITHER_TRI = 3, GAVL_AUDIO_DITHER_SHAPED = 4 }
| Dither mode. More...
enum | gavl_resample_mode_t { GAVL_RESAMPLE_AUTO = 0, GAVL_RESAMPLE_ZOH = 1, GAVL_RESAMPLE_LINEAR = 2, GAVL_RESAMPLE_SINC_FAST = 3, GAVL_RESAMPLE_SINC_MEDIUM = 4, GAVL_RESAMPLE_SINC_BEST = 5 }
| Resample mode. More...
enum | gavl_pixelformat_t { GAVL_PIXELFORMAT_NONE = 0, GAVL_GRAY_8 = 1 | GAVL_PIXFMT_GRAY, GAVL_GRAY_16 = 2 | GAVL_PIXFMT_GRAY, GAVL_GRAY_FLOAT = 3 | GAVL_PIXFMT_GRAY, GAVL_GRAYA_16 = 1 | GAVL_PIXFMT_GRAY | GAVL_PIXFMT_ALPHA, GAVL_GRAYA_32 = 2 | GAVL_PIXFMT_GRAY | GAVL_PIXFMT_ALPHA, GAVL_GRAYA_FLOAT = 3 | GAVL_PIXFMT_GRAY | GAVL_PIXFMT_ALPHA, GAVL_RGB_15 = 1 | GAVL_PIXFMT_RGB, GAVL_BGR_15 = 2 | GAVL_PIXFMT_RGB, GAVL_RGB_16 = 3 | GAVL_PIXFMT_RGB, GAVL_BGR_16 = 4 | GAVL_PIXFMT_RGB, GAVL_RGB_24 = 5 | GAVL_PIXFMT_RGB, GAVL_BGR_24 = 6 | GAVL_PIXFMT_RGB, GAVL_RGB_32 = 7 | GAVL_PIXFMT_RGB, GAVL_BGR_32 = 8 | GAVL_PIXFMT_RGB, GAVL_RGBA_32 = 9 | GAVL_PIXFMT_RGB | GAVL_PIXFMT_ALPHA, GAVL_RGB_48 = 10 | GAVL_PIXFMT_RGB, GAVL_RGBA_64 = 11 | GAVL_PIXFMT_RGB | GAVL_PIXFMT_ALPHA, GAVL_RGB_FLOAT = 12 | GAVL_PIXFMT_RGB, GAVL_RGBA_FLOAT = 13 | GAVL_PIXFMT_RGB | GAVL_PIXFMT_ALPHA, GAVL_YUY2 = 1 | GAVL_PIXFMT_YUV, GAVL_UYVY = 2 | GAVL_PIXFMT_YUV, GAVL_YUVA_32 = 3 | GAVL_PIXFMT_YUV | GAVL_PIXFMT_ALPHA, GAVL_YUVA_64 = 4 | GAVL_PIXFMT_YUV | GAVL_PIXFMT_ALPHA, GAVL_YUV_FLOAT = 5 | GAVL_PIXFMT_YUV, GAVL_YUVA_FLOAT = 6 | GAVL_PIXFMT_YUV | GAVL_PIXFMT_ALPHA, GAVL_YUV_420_P = 1 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV, GAVL_YUV_422_P = 2 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV, GAVL_YUV_444_P = 3 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV, GAVL_YUV_411_P = 4 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV, GAVL_YUV_410_P = 5 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV, GAVL_YUVJ_420_P = 6 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV | GAVL_PIXFMT_YUVJ, GAVL_YUVJ_422_P = 7 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV | GAVL_PIXFMT_YUVJ, GAVL_YUVJ_444_P = 8 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV | GAVL_PIXFMT_YUVJ, GAVL_YUV_444_P_16 = 9 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV, GAVL_YUV_422_P_16 = 10 | GAVL_PIXFMT_PLANAR | GAVL_PIXFMT_YUV }
| Pixelformat definition. More...
enum | gavl_chroma_placement_t { GAVL_CHROMA_PLACEMENT_DEFAULT = 0, GAVL_CHROMA_PLACEMENT_MPEG2, GAVL_CHROMA_PLACEMENT_DVPAL }
| Chroma placement. More...
enum | gavl_framerate_mode_t { GAVL_FRAMERATE_CONSTANT = 0, GAVL_FRAMERATE_VARIABLE = 1, GAVL_FRAMERATE_STILL = 2 }
| Framerate mode. More...
enum | gavl_interlace_mode_t { GAVL_INTERLACE_NONE = 0, GAVL_INTERLACE_TOP_FIRST, GAVL_INTERLACE_BOTTOM_FIRST, GAVL_INTERLACE_MIXED }
| Interlace mode. More...
enum | gavl_alpha_mode_t { GAVL_ALPHA_IGNORE = 0, GAVL_ALPHA_BLEND_COLOR }
enum | gavl_deinterlace_mode_t { GAVL_DEINTERLACE_NONE = 0, GAVL_DEINTERLACE_COPY = 1, GAVL_DEINTERLACE_SCALE = 2, GAVL_DEINTERLACE_BLEND = 3 }
enum | gavl_deinterlace_drop_mode_t { GAVL_DEINTERLACE_DROP_TOP, GAVL_DEINTERLACE_DROP_BOTTOM }
| Specifies which field to drop when deinterlacing. More...
enum | gavl_scale_mode_t { GAVL_SCALE_AUTO, GAVL_SCALE_NEAREST, GAVL_SCALE_BILINEAR, GAVL_SCALE_QUADRATIC, GAVL_SCALE_CUBIC_BSPLINE, GAVL_SCALE_CUBIC_MITCHELL, GAVL_SCALE_CUBIC_CATMULL, GAVL_SCALE_SINC_LANCZOS, GAVL_SCALE_NONE }
## Functions
int | gavl_accel_supported ()
| Get the supported acceleration flags.
const char * | gavl_sample_format_to_string (gavl_sample_format_t format)
| Convert a gavl_sample_format_t to a human readable string.
gavl_sample_format_t | gavl_string_to_sample_format (const char *str)
| Convert a string to a sample format.
int | gavl_num_sample_formats ()
| Get total number of supported sample formats.
gavl_sample_format_t | gavl_get_sample_format (int index)
| Get the sample format from index.
const char * | gavl_channel_id_to_string (gavl_channel_id_t id)
| Convert a gavl_channel_id_t to a human readable string.
const char * | gavl_interleave_mode_to_string (gavl_interleave_mode_t mode)
| Convert a gavl_interleave_mode_t to a human readable string.
void | gavl_audio_format_dump (const gavl_audio_format_t *format)
| Dump an audio format to stderr.
int | gavl_channel_index (const gavl_audio_format_t *format, gavl_channel_id_t id)
| Get the index of a particular channel for a given format.
int | gavl_front_channels (const gavl_audio_format_t *format)
| Get number of front channels for a given format.
int | gavl_rear_channels (const gavl_audio_format_t *format)
| Get number of rear channels for a given format.
int | gavl_side_channels (const gavl_audio_format_t *format)
| Get number of side channels for a given format.
int | gavl_aux_channels (const gavl_audio_format_t *format)
| Get number of aux channels for a given format.
int | gavl_lfe_channels (const gavl_audio_format_t *format)
| Get number of LFE channels for a given format.
void | gavl_audio_format_copy (gavl_audio_format_t *dst, const gavl_audio_format_t *src)
| Copy one audio format to another.
int | gavl_audio_formats_equal (const gavl_audio_format_t *format_1, const gavl_audio_format_t *format_2)
| Compare 2 audio formats.
void | gavl_set_channel_setup (gavl_audio_format_t *format)
| Set the default channel setup and indices.
int | gavl_bytes_per_sample (gavl_sample_format_t format)
| Get the number of bytes per sample for a given sample format.
gavl_audio_frame_t * | gavl_audio_frame_create (const gavl_audio_format_t *format)
| Create audio frame.
void | gavl_audio_frame_null (gavl_audio_frame_t *frame)
| Zero all pointers in the audio frame.
void | gavl_audio_frame_destroy (gavl_audio_frame_t *frame)
| Destroy an audio frame.
void | gavl_audio_frame_mute (gavl_audio_frame_t *frame, const gavl_audio_format_t *format)
| Mute an audio frame.
void | gavl_audio_frame_mute_samples (gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int num_samples)
| Mute a number of samples at the start of an audio frame.
void | gavl_audio_frame_mute_channel (gavl_audio_frame_t *frame, const gavl_audio_format_t *format, int channel)
| Mute a single channel of an audio frame.
int | gavl_audio_frame_copy (const gavl_audio_format_t *format, gavl_audio_frame_t *dst, const gavl_audio_frame_t *src, int dst_pos, int src_pos, int dst_size, int src_size)
| Copy audio data from one frame to another.
void | gavl_audio_options_set_quality (gavl_audio_options_t *opt, int quality)
| Set the quality level for the converter.
int | gavl_audio_options_get_quality (gavl_audio_options_t *opt)
| Get the quality level for a converter.
void | gavl_audio_options_set_dither_mode (gavl_audio_options_t *opt, gavl_audio_dither_mode_t mode)
| Set the dither mode for the converter.
gavl_audio_dither_mode_t | gavl_audio_options_get_dither_mode (gavl_audio_options_t *opt)
| Get the dither mode for the converter.
void | gavl_audio_options_set_resample_mode (gavl_audio_options_t *opt, gavl_resample_mode_t mode)
| Set the resample mode for the converter.
gavl_resample_mode_t | gavl_audio_options_get_resample_mode (gavl_audio_options_t *opt)
| Get the resample mode for the converter.
void | gavl_audio_options_set_conversion_flags (gavl_audio_options_t *opt, int flags)
| Set the conversion flags.
int | gavl_audio_options_get_conversion_flags (gavl_audio_options_t *opt)
| Get the conversion flags.
void | gavl_audio_options_set_defaults (gavl_audio_options_t *opt)
| Set all options to their defaults.
gavl_audio_options_t * | gavl_audio_options_create ()
| Create an options container.
void | gavl_audio_options_copy (gavl_audio_options_t *dst, const gavl_audio_options_t *src)
| Copy audio options.
void | gavl_audio_options_destroy (gavl_audio_options_t *opt)
| Destroy audio options.
gavl_audio_converter_t * | gavl_audio_converter_create ()
| Creates an audio converter.
void | gavl_audio_converter_destroy (gavl_audio_converter_t *cnv)
| Destroys an audio converter and frees all associated memory.
gavl_audio_options_t * | gavl_audio_converter_get_options (gavl_audio_converter_t *cnv)
| gets options of an audio converter
int | gavl_audio_converter_init (gavl_audio_converter_t *cnv, const gavl_audio_format_t *input_format, const gavl_audio_format_t *output_format)
| Initialize an audio converter.
int | gavl_audio_converter_reinit (gavl_audio_converter_t *cnv)
| Reinitialize an audio converter.
void | gavl_audio_convert (gavl_audio_converter_t *cnv, const gavl_audio_frame_t *input_frame, gavl_audio_frame_t *output_frame)
| Convert audio.
gavl_volume_control_t * | gavl_volume_control_create ()
| Create volume control.
void | gavl_volume_control_destroy (gavl_volume_control_t *ctrl)
| Destroys a volume control and frees all associated memory.
void | gavl_volume_control_set_format (gavl_volume_control_t *ctrl, const gavl_audio_format_t *format)
| Set format for a volume control.
void | gavl_volume_control_set_volume (gavl_volume_control_t *ctrl, float volume)
| Set volume for a volume control.
void | gavl_volume_control_apply (gavl_volume_control_t *ctrl, gavl_audio_frame_t *frame)
| Apply a volume control for an audio frame.
gavl_peak_detector_t * | gavl_peak_detector_create ()
| Create peak detector.
void | gavl_peak_detector_destroy (gavl_peak_detector_t *pd)
| Destroys a peak detector and frees all associated memory.
void | gavl_peak_detector_set_format (gavl_peak_detector_t *pd, const gavl_audio_format_t *format)
| Set format for a peak detector.
void | gavl_peak_detector_update (gavl_peak_detector_t *pd, gavl_audio_frame_t *frame)
| Feed the peak detector with a new frame.
void | gavl_peak_detector_get_peak (gavl_peak_detector_t *pd, double *min, double *max, double *abs)
| Get the peak volume across all channels.
void | gavl_peak_detector_get_peaks (gavl_peak_detector_t *pd, double *min, double *max, double *abs)
| Get the peak volume for all channels separate.
void | gavl_peak_detector_reset (gavl_peak_detector_t *pd)
| Reset a peak detector.
void | gavl_rectangle_i_crop_to_format (gavl_rectangle_i_t *r, const gavl_video_format_t *format)
| Crop an integer rectangle so it fits into the image size of a video format.
void | gavl_rectangle_f_crop_to_format (gavl_rectangle_f_t *r, const gavl_video_format_t *format)
| Crop a floating point rectangle so it fits into the image size of a video format.
void | gavl_rectangle_crop_to_format_noscale (gavl_rectangle_i_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
| Set 2 rectangles as source and destination when no scaling is available.
void | gavl_rectangle_crop_to_format_scale (gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
| Crop 2 rectangles to their formats when scaling is available.
void | gavl_rectangle_i_set_all (gavl_rectangle_i_t *r, const gavl_video_format_t *format)
| Let an integer rectangle span the whole image size of a video format.
void | gavl_rectangle_f_set_all (gavl_rectangle_f_t *r, const gavl_video_format_t *format)
| Let a float rectangle span the whole image size of a video format.
void | gavl_rectangle_i_crop_left (gavl_rectangle_i_t *r, int num_pixels)
| Crop an integer rectangle by some pixels from the left border.
void | gavl_rectangle_i_crop_right (gavl_rectangle_i_t *r, int num_pixels)
| Crop an integer rectangle by some pixels from the right border.
void | gavl_rectangle_i_crop_top (gavl_rectangle_i_t *r, int num_pixels)
| Crop an integer rectangle by some pixels from the top border.
void | gavl_rectangle_i_crop_bottom (gavl_rectangle_i_t *r, int num_pixels)
| Crop an integer rectangle by some pixels from the bottom border.
void | gavl_rectangle_f_crop_left (gavl_rectangle_f_t *r, double num_pixels)
| Crop a float rectangle by some pixels from the left border.
void | gavl_rectangle_f_crop_right (gavl_rectangle_f_t *r, double num_pixels)
| Crop a float rectangle by some pixels from the right border.
void | gavl_rectangle_f_crop_top (gavl_rectangle_f_t *r, double num_pixels)
| Crop a float rectangle by some pixels from the top border.
void | gavl_rectangle_f_crop_bottom (gavl_rectangle_f_t *r, double num_pixels)
| Crop a float rectangle by some pixels from the bottom border.
void | gavl_rectangle_i_align (gavl_rectangle_i_t *r, int h_align, int v_align)
| Align a rectangle.
void | gavl_rectangle_i_align_to_format (gavl_rectangle_i_t *r, const gavl_video_format_t *format)
| Align a rectangle to a format.
void | gavl_rectangle_i_copy (gavl_rectangle_i_t *dst, const gavl_rectangle_i_t *src)
| Copy an integer rectangle.
void | gavl_rectangle_f_copy (gavl_rectangle_f_t *dst, const gavl_rectangle_f_t *src)
| Copy a float rectangle.
void | gavl_rectangle_i_to_f (gavl_rectangle_f_t *dst, const gavl_rectangle_i_t *src)
| Convert an integer rectangle to a floating point rectangle.
void | gavl_rectangle_f_to_i (gavl_rectangle_i_t *dst, const gavl_rectangle_f_t *src)
| Convert a floating point rectangle to an integer rectangle.
int | gavl_rectangle_i_is_empty (const gavl_rectangle_i_t *r)
| Check if an integer rectangle is empty.
int | gavl_rectangle_f_is_empty (const gavl_rectangle_f_t *r)
| Check if a float rectangle is empty.
void | gavl_rectangle_fit_aspect (gavl_rectangle_i_t *dst_rect, const gavl_video_format_t *src_format, const gavl_rectangle_f_t *src_rect, const gavl_video_format_t *dst_format, float zoom, float squeeze)
| Calculate a destination rectangle for scaling.
void | gavl_rectangle_i_dump (const gavl_rectangle_i_t *r)
| Dump a rectangle to stderr.
void | gavl_rectangle_f_dump (const gavl_rectangle_f_t *r)
| Dump a floating point rectangle to stderr.
int | gavl_pixelformat_num_planes (gavl_pixelformat_t pixelformat)
| Get the number of planes.
void | gavl_pixelformat_chroma_sub (gavl_pixelformat_t pixelformat, int *sub_h, int *sub_v)
| Get the horizontal and vertical subsampling factors.
int | gavl_pixelformat_bytes_per_component (gavl_pixelformat_t pixelformat)
| Get bytes per component for planar formats.
int | gavl_pixelformat_bytes_per_pixel (gavl_pixelformat_t pixelformat)
| Get bytes per pixel for packed formats.
int | gavl_pixelformat_bits_per_pixel (gavl_pixelformat_t pixelformat)
| Get the effective number of bits for one pixel.
int | gavl_pixelformat_conversion_penalty (gavl_pixelformat_t src, gavl_pixelformat_t dst)
| Get the conversion penalty for pixelformat conversions.
gavl_pixelformat_t | gavl_pixelformat_get_best (gavl_pixelformat_t src, const gavl_pixelformat_t *dst_supported, int *penalty)
| Get the best destination format for a given source format.
const char * | gavl_pixelformat_to_string (gavl_pixelformat_t pixelformat)
| Translate a pixelformat into a human readable string.
gavl_pixelformat_t | gavl_string_to_pixelformat (const char *name)
| Translate a pixelformat name into a pixelformat.
int | gavl_num_pixelformats ()
| Get total number of supported pixelformats.
gavl_pixelformat_t | gavl_get_pixelformat (int index)
| Get the pixelformat from index.
const char * | gavl_chroma_placement_to_string (gavl_chroma_placement_t mode)
| Translate a chroma placement into a human readable string.
const char * | gavl_interlace_mode_to_string (gavl_interlace_mode_t mode)
| Translate an interlace mode into a human readable string.
void | gavl_video_format_copy (gavl_video_format_t *dst, const gavl_video_format_t *src)
| Copy one video format to another.
int | gavl_video_formats_equal (const gavl_video_format_t *format_1, const gavl_video_format_t *format_2)
| Compare 2 video formats.
void | gavl_video_format_get_chroma_offset (const gavl_video_format_t *format, int field, int plane, float *off_x, float *off_y)
| Get the chroma offsets relative to the luma samples.
void | gavl_video_format_dump (const gavl_video_format_t *format)
| Dump a video format to stderr.
void | gavl_video_format_fit_to_source (gavl_video_format_t *dst, const gavl_video_format_t *src)
| Set the image size of a destination format from a source format.
gavl_video_frame_t * | gavl_video_frame_create (const gavl_video_format_t *format)
| Create video frame.
gavl_video_frame_t * | gavl_video_frame_create_nopad (const gavl_video_format_t *format)
| Create video frame without padding.
void | gavl_video_frame_destroy (gavl_video_frame_t *frame)
| Destroy a video frame.
void | gavl_video_frame_null (gavl_video_frame_t *frame)
| Zero all pointers in the video frame.
void | gavl_video_frame_clear (gavl_video_frame_t *frame, const gavl_video_format_t *format)
| Fill the frame with black color.
void | gavl_video_frame_fill (gavl_video_frame_t *frame, const gavl_video_format_t *format, float *color)
| Fill the frame with a user spefified color.
void | gavl_video_frame_copy (const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
| Copy one video frame to another.
void | gavl_video_frame_copy_plane (const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src, int plane)
| Copy a single plane from one video frame to another.
void | gavl_video_frame_copy_flip_x (const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
| Copy one video frame to another with horizontal flipping.
void | gavl_video_frame_copy_flip_y (const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
| Copy one video frame to another with vertical flipping.
void | gavl_video_frame_copy_flip_xy (const gavl_video_format_t *format, gavl_video_frame_t *dst, const gavl_video_frame_t *src)
| Copy one video frame to another with horizontal and vertical flipping.
void | gavl_video_frame_get_subframe (gavl_pixelformat_t pixelformat, const gavl_video_frame_t *src, gavl_video_frame_t *dst, gavl_rectangle_i_t *src_rect)
| Get a subframe of another frame.
void | gavl_video_frame_get_field (gavl_pixelformat_t pixelformat, const gavl_video_frame_t *src, gavl_video_frame_t *dst, int field)
| Get a field from a frame.
void | gavl_video_frame_dump (gavl_video_frame_t *frame, const gavl_video_format_t *format, const char *namebase)
| Dump a video frame to files.
void | gavl_video_options_set_defaults (gavl_video_options_t *opt)
| Set all options to their defaults.
gavl_video_options_t * | gavl_video_options_create ()
| Create an options container.
void | gavl_video_options_copy (gavl_video_options_t *dst, const gavl_video_options_t *src)
| Copy video options.
void | gavl_video_options_destroy (gavl_video_options_t *opt)
| Destroy video options.
void | gavl_video_options_set_rectangles (gavl_video_options_t *opt, const gavl_rectangle_f_t *src_rect, const gavl_rectangle_i_t *dst_rect)
| Set source and destination rectangles.
void | gavl_video_options_get_rectangles (gavl_video_options_t *opt, gavl_rectangle_f_t *src_rect, gavl_rectangle_i_t *dst_rect)
| Get source and destination rectangles.
void | gavl_video_options_set_quality (gavl_video_options_t *opt, int quality)
| Set the quality level for the converter.
int | gavl_video_options_get_quality (gavl_video_options_t *opt)
| Get the quality level for the converter.
void | gavl_video_options_set_conversion_flags (gavl_video_options_t *opt, int conversion_flags)
| Set the conversion flags.
int | gavl_video_options_get_conversion_flags (gavl_video_options_t *opt)
| Get the conversion flags.
void | gavl_video_options_set_alpha_mode (gavl_video_options_t *opt, gavl_alpha_mode_t alpha_mode)
| Set the alpha mode.
gavl_alpha_mode_t | gavl_video_options_get_alpha_mode (gavl_video_options_t *opt)
| Get the alpha mode.
void | gavl_video_options_set_scale_mode (gavl_video_options_t *opt, gavl_scale_mode_t scale_mode)
| Set the scale mode.
gavl_scale_mode_t | gavl_video_options_get_scale_mode (gavl_video_options_t *opt)
| Get the scale mode.
void | gavl_video_options_set_scale_order (gavl_video_options_t *opt, int order)
| Set the scale order for GAVL_SCALE_SINC_LANCZOS.
int | gavl_video_options_get_scale_order (gavl_video_options_t *opt)
| Get the scale order for GAVL_SCALE_SINC_LANCZOS.
void | gavl_video_options_set_background_color (gavl_video_options_t *opt, const float *color)
| Set the background color for alpha blending.
void | gavl_video_options_get_background_color (gavl_video_options_t *opt, float *color)
| Get the background color for alpha blending.
void | gavl_video_options_set_deinterlace_mode (gavl_video_options_t *opt, gavl_deinterlace_mode_t deinterlace_mode)
| Set the deinterlace mode.
gavl_deinterlace_mode_t | gavl_video_options_get_deinterlace_mode (gavl_video_options_t *opt)
| Get the deinterlace mode.
void | gavl_video_options_set_deinterlace_drop_mode (gavl_video_options_t *opt, gavl_deinterlace_drop_mode_t deinterlace_drop_mode)
| Set the deinterlace drop mode.
gavl_deinterlace_drop_mode_t | gavl_video_options_get_deinterlace_drop_mode (gavl_video_options_t *opt)
| Get the deinterlace drop mode.
gavl_video_converter_t * | gavl_video_converter_create ()
| Creates a video converter.
void | gavl_video_converter_destroy (gavl_video_converter_t *cnv)
| Destroys a video converter and frees all associated memory.
gavl_video_options_t * | gavl_video_converter_get_options (gavl_video_converter_t *cnv)
| gets options of a video converter
int | gavl_video_converter_init (gavl_video_converter_t *cnv, const gavl_video_format_t *input_format, const gavl_video_format_t *output_format)
| Initialize a video converter.
int | gavl_video_converter_reinit (gavl_video_converter_t *cnv)
| Reinitialize a video converter.
void | gavl_video_convert (gavl_video_converter_t *cnv, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
| Convert video.
gavl_video_scaler_t * | gavl_video_scaler_create ()
| Create a video scaler.
void | gavl_video_scaler_destroy (gavl_video_scaler_t *scaler)
| Destroy a video scaler.
gavl_video_options_t * | gavl_video_scaler_get_options (gavl_video_scaler_t *scaler)
| gets options of a scaler
int | gavl_video_scaler_init (gavl_video_scaler_t *scaler, const gavl_video_format_t *src_format, const gavl_video_format_t *dst_format)
| Initialize a video scaler.
int | gavl_video_scaler_init_convolve (gavl_video_scaler_t *scaler, const gavl_video_format_t *format, int h_radius, float *h_coeffs, int v_radius, float *v_coeffs)
| Initialize a video scaler as a generic convolver.
void | gavl_video_scaler_scale (gavl_video_scaler_t *scaler, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
| Scale video.
gavl_video_deinterlacer_t * | gavl_video_deinterlacer_create ()
| Create a video deinterlacer.
void | gavl_video_deinterlacer_destroy (gavl_video_deinterlacer_t *deinterlacer)
| Destroy a video deinterlacer.
gavl_video_options_t * | gavl_video_deinterlacer_get_options (gavl_video_deinterlacer_t *deinterlacer)
| gets options of a deinterlacer
int | gavl_video_deinterlacer_init (gavl_video_deinterlacer_t *deinterlacer, const gavl_video_format_t *src_format)
| Initialize a video deinterlacer.
void | gavl_video_deinterlacer_deinterlace (gavl_video_deinterlacer_t *deinterlacer, const gavl_video_frame_t *input_frame, gavl_video_frame_t *output_frame)
| Deinterlace video.
gavl_overlay_blend_context_t * | gavl_overlay_blend_context_create ()
| Create a blend context.
void | gavl_overlay_blend_context_destroy (gavl_overlay_blend_context_t *ctx)
| Destroy a blend context and free all associated memory.
gavl_video_options_t * | gavl_overlay_blend_context_get_options (gavl_overlay_blend_context_t *ctx)
| Get options from a blend context.
int | gavl_overlay_blend_context_init (gavl_overlay_blend_context_t *ctx, const gavl_video_format_t *frame_format, gavl_video_format_t *overlay_format)
| Initialize the blend context.
void | gavl_overlay_blend_context_set_overlay (gavl_overlay_blend_context_t *ctx, gavl_overlay_t *ovl)
| Set a new overlay.
void | gavl_overlay_blend (gavl_overlay_blend_context_t *ctx, gavl_video_frame_t *dst_frame)
| Blend overlay onto video frame.

## Detailed Description

external api header.

## Function Documentation

void gavl_video_options_set_deinterlace_mode | ( | gavl_video_options_t * | opt,
|  | gavl_deinterlace_mode_t | deinterlace_mode |
| ) |  |  |

Set the deinterlace mode.

Parameters:

  | opt | Video options
  | deinterlace_mode | Deinterlace mode

gavl_deinterlace_mode_t gavl_video_options_get_deinterlace_mode | ( | gavl_video_options_t * | opt | ) |

Get the deinterlace mode.

Parameters:

  | opt | Video options

Returns:
  Deinterlace mode