|
gavl
|
Definitions for several variations of video data. More...
Data Structures | |
| struct | gavl_video_format_s |
| Video format. More... | |
Macros | |
| #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) |
| Check if a pixelformat is grayscale. | |
| #define | gavl_pixelformat_is_rgb(fmt) |
| Check if a pixelformat is RGB based. | |
| #define | gavl_pixelformat_is_yuv(fmt) |
| Check if a pixelformat is YUV based. | |
| #define | gavl_pixelformat_is_jpeg_scaled(fmt) |
| Check if a pixelformat is jpeg (full range) scaled. | |
| #define | gavl_pixelformat_has_alpha(fmt) |
| Check if a pixelformat has a transparency channel. | |
| #define | gavl_pixelformat_is_planar(fmt) |
| Check if a pixelformat is planar. | |
Typedefs | |
| typedef struct gavl_video_format_s | gavl_video_format_t |
| Video format. | |
| typedef enum gavl_pixelformat_e | gavl_pixelformat_t |
| Pixelformat. | |
Enumerations | |
| enum | gavl_pixelformat_e { 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_color_channel_t { GAVL_CCH_NONE = 0 , GAVL_CCH_RED , GAVL_CCH_GREEN , GAVL_CCH_BLUE , GAVL_CCH_Y , GAVL_CCH_CB , GAVL_CCH_CR , GAVL_CCH_ALPHA } |
| Color channel definitions. 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_UNKNOWN = -1 , GAVL_FRAMERATE_CONSTANT = 0 , GAVL_FRAMERATE_VARIABLE = 1 , GAVL_FRAMERATE_STILL = 2 } |
| Framerate mode. More... | |
| enum | gavl_interlace_mode_t { GAVL_INTERLACE_UNKNOWN = -1 , GAVL_INTERLACE_NONE = 0 , GAVL_INTERLACE_TOP_FIRST = 1 , GAVL_INTERLACE_BOTTOM_FIRST = 2 , GAVL_INTERLACE_MIXED = (0x10 | 1) , GAVL_INTERLACE_MIXED_TOP = (0x10 | 2) , GAVL_INTERLACE_MIXED_BOTTOM = (0x10 | 3) } |
| Interlace mode. More... | |
Functions | |
| GAVL_PUBLIC int | gavl_pixelformat_num_channels (gavl_pixelformat_t pixelformat) |
| Get the number of channels. | |
| GAVL_PUBLIC gavl_color_channel_t | gavl_pixelformat_get_channel (gavl_pixelformat_t pixelformat, int index) |
| Get the color channel. | |
| GAVL_PUBLIC int | gavl_pixelformat_num_planes (gavl_pixelformat_t pixelformat) |
| Get the number of planes. | |
| GAVL_PUBLIC void | gavl_pixelformat_chroma_sub (gavl_pixelformat_t pixelformat, int *sub_h, int *sub_v) |
| Get the horizontal and vertical subsampling factors. | |
| GAVL_PUBLIC int | gavl_pixelformat_bytes_per_component (gavl_pixelformat_t pixelformat) |
| Get bytes per component for planar formats. | |
| GAVL_PUBLIC int | gavl_pixelformat_bytes_per_pixel (gavl_pixelformat_t pixelformat) |
| Get bytes per pixel for packed formats. | |
| GAVL_PUBLIC int | gavl_pixelformat_bits_per_pixel (gavl_pixelformat_t pixelformat) |
| Get the effective number of bits for one pixel. | |
| GAVL_PUBLIC int | gavl_pixelformat_conversion_penalty (gavl_pixelformat_t src, gavl_pixelformat_t dst) |
| Get the conversion penalty for pixelformat conversions. | |
| GAVL_PUBLIC 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. | |
| GAVL_PUBLIC const char * | gavl_pixelformat_to_string (gavl_pixelformat_t pixelformat) |
| Translate a pixelformat into a human readable string. | |
| GAVL_PUBLIC const char * | gavl_pixelformat_to_short_string (gavl_pixelformat_t pixelformat) |
| Translate a pixelformat into a short string. | |
| GAVL_PUBLIC gavl_pixelformat_t | gavl_string_to_pixelformat (const char *name) |
| Translate a pixelformat name into a pixelformat. | |
| GAVL_PUBLIC gavl_pixelformat_t | gavl_short_string_to_pixelformat (const char *name) |
| Translate a short pixelformat name into a pixelformat. | |
| GAVL_PUBLIC const uint32_t * | gavl_pixelformat_get_masks (gavl_pixelformat_t pixelformat) |
| Get the masks for the components. | |
| GAVL_PUBLIC int | gavl_num_pixelformats (void) |
| Get total number of supported pixelformats. | |
| GAVL_PUBLIC gavl_pixelformat_t | gavl_get_pixelformat (int index) |
| Get the pixelformat from index. | |
| GAVL_PUBLIC const char * | gavl_chroma_placement_to_string (gavl_chroma_placement_t mode) |
| Translate a chroma placement into a human readable string. | |
| GAVL_PUBLIC const char * | gavl_chroma_placement_to_short_string (gavl_chroma_placement_t mode) |
| Translate a chroma placement into a short string. | |
| GAVL_PUBLIC gavl_chroma_placement_t | gavl_short_string_to_chroma_placement (const char *mode) |
| Translate a short string into a chroma placement. | |
| GAVL_PUBLIC const char * | gavl_framerate_mode_to_string (gavl_framerate_mode_t mode) |
| Translate a framerate mode into a human readable string. | |
| GAVL_PUBLIC const char * | gavl_framerate_mode_to_short_string (gavl_framerate_mode_t mode) |
| Translate a framerate mode into a short string. | |
| GAVL_PUBLIC gavl_framerate_mode_t | gavl_short_string_to_framerate_mode (const char *mode) |
| Translate a short string into a framerate mode. | |
| GAVL_PUBLIC const char * | gavl_interlace_mode_to_string (gavl_interlace_mode_t mode) |
| Translate an interlace mode into a human readable string. | |
| GAVL_PUBLIC const char * | gavl_interlace_mode_to_short_string (gavl_interlace_mode_t mode) |
| Translate an interlace mode into a short string. | |
| GAVL_PUBLIC gavl_interlace_mode_t | gavl_short_string_to_interlace_mode (const char *mode) |
| Translate a short string to an interlace mode. | |
| GAVL_PUBLIC int | gavl_interlace_mode_is_mixed (gavl_interlace_mode_t mode) |
| Check if an interlace mode is mixed. | |
| GAVL_PUBLIC void | gavl_video_format_copy (gavl_video_format_t *dst, const gavl_video_format_t *src) |
| Copy one video format to another. | |
| GAVL_PUBLIC int | gavl_video_formats_equal (const gavl_video_format_t *format_1, const gavl_video_format_t *format_2) |
| Compare 2 video formats. | |
| GAVL_PUBLIC 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. | |
| GAVL_PUBLIC 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_PUBLIC int | gavl_video_format_get_image_size (const gavl_video_format_t *format) |
| Get the unpadded image size. | |
| GAVL_PUBLIC void | gavl_video_format_set_frame_size (gavl_video_format_t *format, int pad_h, int pad_v) |
| Set the frame size from the image size. | |
| GAVL_PUBLIC int | gavl_get_color_channel_format (const gavl_video_format_t *frame_format, gavl_video_format_t *channel_format, gavl_color_channel_t ch) |
| Get the video format for extracting/merging one channel. | |
| GAVL_PUBLIC void | gavl_get_field_format (const gavl_video_format_t *frame_format, gavl_video_format_t *field_format, int field) |
| Get the video format of one field. | |
| GAVL_PUBLIC void | gavl_video_format_dump (const gavl_video_format_t *format) |
| Dump a video format to stderr. | |
| GAVL_PUBLIC void | gavl_video_format_dumpi (const gavl_video_format_t *format, int indent) |
| Dump a video format to stderr. | |
Definitions for several variations of video data.
| #define GAVL_PIXFMT_PLANAR (1<<8) |
Flag for planar pixelformats
| #define GAVL_PIXFMT_RGB (1<<9) |
Flag for rgb pixelformats
| #define GAVL_PIXFMT_YUV (1<<10) |
Flag for yuv pixelformats
| #define GAVL_PIXFMT_YUVJ (1<<11) |
Flag for yuvj pixelformats
| #define GAVL_PIXFMT_ALPHA (1<<12) |
Alpha flag
| #define GAVL_PIXFMT_GRAY (1<<13) |
Flag for grayscale pixelformats
| #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 | ) |
Check if a pixelformat is grayscale.
| fmt | A pixelformat |
| #define gavl_pixelformat_is_rgb | ( | fmt | ) |
Check if a pixelformat is RGB based.
| fmt | A pixelformat |
| #define gavl_pixelformat_is_yuv | ( | fmt | ) |
Check if a pixelformat is YUV based.
| fmt | A pixelformat |
| #define gavl_pixelformat_is_jpeg_scaled | ( | fmt | ) |
Check if a pixelformat is jpeg (full range) scaled.
| fmt | A pixelformat |
| #define gavl_pixelformat_has_alpha | ( | fmt | ) |
Check if a pixelformat has a transparency channel.
| fmt | A pixelformat |
| #define gavl_pixelformat_is_planar | ( | fmt | ) |
Check if a pixelformat is planar.
| fmt | A pixelformat |
| typedef struct gavl_video_format_s gavl_video_format_t |
Video format.
| typedef enum gavl_pixelformat_e gavl_pixelformat_t |
Pixelformat.
| enum gavl_pixelformat_e |
Pixelformat definition.
| enum gavl_color_channel_t |
Color channel definitions.
Enum definitions for color channels
Chroma placement.
Specification of the 3 variants of 4:2:0 YCbCr as described at http://www.mir.com/DMG/chroma.html . For other pixelformats, it's meaningless and should be set to GAVL_CHROMA_PLACEMENT_DEFAULT.
| Enumerator | |
|---|---|
| GAVL_CHROMA_PLACEMENT_DEFAULT | MPEG-1/JPEG |
| GAVL_CHROMA_PLACEMENT_MPEG2 | MPEG-2 |
| GAVL_CHROMA_PLACEMENT_DVPAL | DV PAL |
Interlace mode.
| GAVL_PUBLIC int gavl_pixelformat_num_channels | ( | gavl_pixelformat_t | pixelformat | ) |
Get the number of channels.
| pixelformat | A pixelformat |
References gavl_pixelformat_num_channels().
Referenced by gavl_pixelformat_num_channels().
| GAVL_PUBLIC gavl_color_channel_t gavl_pixelformat_get_channel | ( | gavl_pixelformat_t | pixelformat, |
| int | index ) |
Get the color channel.
| pixelformat | A pixelformat |
| index | Index (starting with 0) |
References gavl_pixelformat_get_channel().
Referenced by gavl_pixelformat_get_channel().
| GAVL_PUBLIC int gavl_pixelformat_num_planes | ( | gavl_pixelformat_t | pixelformat | ) |
Get the number of planes.
| pixelformat | A pixelformat |
References gavl_pixelformat_num_planes().
Referenced by gavl_pixelformat_num_planes().
| GAVL_PUBLIC void gavl_pixelformat_chroma_sub | ( | gavl_pixelformat_t | pixelformat, |
| int * | sub_h, | ||
| int * | sub_v ) |
Get the horizontal and vertical subsampling factors.
| pixelformat | A pixelformat |
| sub_h | returns the horizontal subsampling factor |
| sub_v | returns the vertical subsampling factor |
E.g. for 4:2:0 subsampling: sub_h = 2, sub_v = 2
References gavl_pixelformat_chroma_sub().
Referenced by gavl_pixelformat_chroma_sub().
| GAVL_PUBLIC int gavl_pixelformat_bytes_per_component | ( | gavl_pixelformat_t | pixelformat | ) |
Get bytes per component for planar formats.
| pixelformat | A pixelformat |
References gavl_pixelformat_bytes_per_component().
Referenced by gavl_pixelformat_bytes_per_component().
| GAVL_PUBLIC int gavl_pixelformat_bytes_per_pixel | ( | gavl_pixelformat_t | pixelformat | ) |
Get bytes per pixel for packed formats.
| pixelformat | A pixelformat |
References gavl_pixelformat_bytes_per_pixel().
Referenced by gavl_pixelformat_bytes_per_pixel().
| GAVL_PUBLIC int gavl_pixelformat_bits_per_pixel | ( | gavl_pixelformat_t | pixelformat | ) |
Get the effective number of bits for one pixel.
| pixelformat | A pixelformat |
References gavl_pixelformat_bits_per_pixel().
Referenced by gavl_pixelformat_bits_per_pixel().
| GAVL_PUBLIC int gavl_pixelformat_conversion_penalty | ( | gavl_pixelformat_t | src, |
| gavl_pixelformat_t | dst ) |
Get the conversion penalty for pixelformat conversions.
| src | Source pixelformat |
| dst | Destination pixelformat |
The number (the larger the worse) is calculated from several criteria and considers both speed and quality issues. Don't ever rely on specific absolute values, since they can change from version to version (except 0, which is returned when and only when src and dst are equal). Instead, only compare values returned for different combinations among each other.
References gavl_pixelformat_conversion_penalty().
Referenced by gavl_pixelformat_conversion_penalty().
| GAVL_PUBLIC 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.
| src | Source pixelformat |
| dst_supported | List of supported destination format |
| penalty | If non-null, returns the conversion penalty |
This function takes a source format and a list of supported destination formats (terminated with GAVL_PIXELFORMAT_NONE) and returns the format, which will result in the cheapest conversion (see gavl_pixelformat_conversion_penalty).
References gavl_pixelformat_get_best().
Referenced by gavl_pixelformat_get_best().
| GAVL_PUBLIC const char * gavl_pixelformat_to_string | ( | gavl_pixelformat_t | pixelformat | ) |
Translate a pixelformat into a human readable string.
| pixelformat | A pixelformat |
References gavl_pixelformat_to_string().
Referenced by gavl_pixelformat_to_string().
| GAVL_PUBLIC const char * gavl_pixelformat_to_short_string | ( | gavl_pixelformat_t | pixelformat | ) |
Translate a pixelformat into a short string.
| pixelformat | A pixelformat |
Short strings are guaranteed to contain no spaces and are more suitable for commandline arguments.
References gavl_pixelformat_to_short_string().
Referenced by gavl_pixelformat_to_short_string().
| GAVL_PUBLIC gavl_pixelformat_t gavl_string_to_pixelformat | ( | const char * | name | ) |
Translate a pixelformat name into a pixelformat.
| name | A string describing the pixelformat (returned by gavl_pixelformat_to_string) |
References gavl_string_to_pixelformat().
Referenced by gavl_string_to_pixelformat().
| GAVL_PUBLIC gavl_pixelformat_t gavl_short_string_to_pixelformat | ( | const char * | name | ) |
Translate a short pixelformat name into a pixelformat.
| name | A string describing the pixelformat (returned by gavl_pixelformat_to_short_string) |
References gavl_short_string_to_pixelformat().
Referenced by gavl_short_string_to_pixelformat().
| GAVL_PUBLIC const uint32_t * gavl_pixelformat_get_masks | ( | gavl_pixelformat_t | pixelformat | ) |
Get the masks for the components.
| pixelformat | A pixelformat |
References gavl_pixelformat_get_masks().
Referenced by gavl_pixelformat_get_masks().
| GAVL_PUBLIC int gavl_num_pixelformats | ( | void | ) |
Get total number of supported pixelformats.
References gavl_num_pixelformats().
Referenced by gavl_num_pixelformats().
| GAVL_PUBLIC gavl_pixelformat_t gavl_get_pixelformat | ( | int | index | ) |
Get the pixelformat from index.
| index | index (must be between 0 and the result of gavl_num_pixelformats) |
References gavl_get_pixelformat().
Referenced by gavl_get_pixelformat().
| GAVL_PUBLIC const char * gavl_chroma_placement_to_string | ( | gavl_chroma_placement_t | mode | ) |
Translate a chroma placement into a human readable string.
| mode | A chroma placement |
References gavl_chroma_placement_to_string().
Referenced by gavl_chroma_placement_to_string().
| GAVL_PUBLIC const char * gavl_chroma_placement_to_short_string | ( | gavl_chroma_placement_t | mode | ) |
Translate a chroma placement into a short string.
| mode | A chroma placement |
References gavl_chroma_placement_to_short_string().
Referenced by gavl_chroma_placement_to_short_string().
| GAVL_PUBLIC gavl_chroma_placement_t gavl_short_string_to_chroma_placement | ( | const char * | mode | ) |
Translate a short string into a chroma placement.
| mode | A short string describing the chroma placement |
References gavl_short_string_to_chroma_placement().
Referenced by gavl_short_string_to_chroma_placement().
| GAVL_PUBLIC const char * gavl_framerate_mode_to_string | ( | gavl_framerate_mode_t | mode | ) |
Translate a framerate mode into a human readable string.
| mode | A framerate mode |
References gavl_framerate_mode_to_string().
Referenced by gavl_framerate_mode_to_string().
| GAVL_PUBLIC const char * gavl_framerate_mode_to_short_string | ( | gavl_framerate_mode_t | mode | ) |
Translate a framerate mode into a short string.
| mode | A framerate mode |
References gavl_framerate_mode_to_short_string().
Referenced by gavl_framerate_mode_to_short_string().
| GAVL_PUBLIC gavl_framerate_mode_t gavl_short_string_to_framerate_mode | ( | const char * | mode | ) |
Translate a short string into a framerate mode.
| mode | A short string describing the framerate mode |
References gavl_short_string_to_framerate_mode().
Referenced by gavl_short_string_to_framerate_mode().
| GAVL_PUBLIC const char * gavl_interlace_mode_to_string | ( | gavl_interlace_mode_t | mode | ) |
Translate an interlace mode into a human readable string.
| mode | An interlace mode |
References gavl_interlace_mode_to_string().
Referenced by gavl_interlace_mode_to_string().
| GAVL_PUBLIC const char * gavl_interlace_mode_to_short_string | ( | gavl_interlace_mode_t | mode | ) |
Translate an interlace mode into a short string.
| mode | An interlace mode |
References gavl_interlace_mode_to_short_string().
Referenced by gavl_interlace_mode_to_short_string().
| GAVL_PUBLIC gavl_interlace_mode_t gavl_short_string_to_interlace_mode | ( | const char * | mode | ) |
Translate a short string to an interlace mode.
| mode | A short string describing the interlace mode |
References gavl_short_string_to_interlace_mode().
Referenced by gavl_short_string_to_interlace_mode().
| GAVL_PUBLIC int gavl_interlace_mode_is_mixed | ( | gavl_interlace_mode_t | mode | ) |
Check if an interlace mode is mixed.
| mode | An interlace mode |
Since 1.5.0
References gavl_interlace_mode_is_mixed().
Referenced by gavl_interlace_mode_is_mixed().
| GAVL_PUBLIC void gavl_video_format_copy | ( | gavl_video_format_t * | dst, |
| const gavl_video_format_t * | src ) |
Copy one video format to another.
| dst | Destination format |
| src | Source format |
References gavl_video_format_copy().
Referenced by gavl_video_format_copy().
| GAVL_PUBLIC int gavl_video_formats_equal | ( | const gavl_video_format_t * | format_1, |
| const gavl_video_format_t * | format_2 ) |
Compare 2 video formats.
| format_1 | First format |
| format_2 | Second format |
References gavl_video_formats_equal().
Referenced by gavl_video_formats_equal().
| GAVL_PUBLIC 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.
| format | A video format |
| field | Index of the field (0 = top, 1 = bottom). For progressive format, this is unused |
| plane | Index of the plane (1 = Cb, 2 = Cr) |
| off_x | Returns the offset in x-direction |
| off_y | Returns the offset in y-direction |
References gavl_video_format_get_chroma_offset().
Referenced by gavl_video_format_get_chroma_offset().
| GAVL_PUBLIC 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.
| dst | Destination format |
| src | Source format |
Sets the image size of dst according src. Before you call this function, you must set the pixel_width and pixel_height of dst. This function will preserve the display aspect ratio, i.e. when the pixel aspect ratios are different in source and destination, the images will be scaled.
References gavl_video_format_fit_to_source().
Referenced by gavl_video_format_fit_to_source().
| GAVL_PUBLIC int gavl_video_format_get_image_size | ( | const gavl_video_format_t * | format | ) |
Get the unpadded image size.
| format | A video format |
References gavl_video_format_get_image_size().
Referenced by gavl_video_format_get_image_size().
| GAVL_PUBLIC void gavl_video_format_set_frame_size | ( | gavl_video_format_t * | format, |
| int | pad_h, | ||
| int | pad_v ) |
Set the frame size from the image size.
| format | A video format |
| align_h | Horizontal alignment value |
| align_v | Vertical alignment value |
Set the frame_width and frame_height of the format from the image_width and image_height. Pad them to multiples of align_v and align_h pixels.
If pad_h or pad_v is zero or less, use the chroma subsampling factors (e.g. a 4:1:1 format will have width as a multiple of 4 and the height as a multiple of 1).
References gavl_video_format_set_frame_size().
Referenced by gavl_video_format_set_frame_size().
| GAVL_PUBLIC int gavl_get_color_channel_format | ( | const gavl_video_format_t * | frame_format, |
| gavl_video_format_t * | channel_format, | ||
| gavl_color_channel_t | ch ) |
Get the video format for extracting/merging one channel.
| frame_format | The video format of the full frame |
| channel_format | Format of the extracted channel (grayscale) |
| ch | Channel |
Use this function in conjunction with gavl_video_frame_extract_channel and gavl_video_frame_insert_channel
Since 1.1.2
References gavl_get_color_channel_format().
Referenced by gavl_get_color_channel_format().
| GAVL_PUBLIC void gavl_get_field_format | ( | const gavl_video_format_t * | frame_format, |
| gavl_video_format_t * | field_format, | ||
| int | field ) |
Get the video format of one field.
| frame_format | The video format of the full frame |
| field_format | Format of the field |
| field | Field (0 or 1) |
Use this function if you need to split a frame into fields. It handles odd heights correctly
Since 1.2.1
References gavl_get_field_format().
Referenced by gavl_get_field_format().
| GAVL_PUBLIC void gavl_video_format_dump | ( | const gavl_video_format_t * | format | ) |
Dump a video format to stderr.
| format | A video format |
References gavl_video_format_dump().
Referenced by gavl_video_format_dump().
| GAVL_PUBLIC void gavl_video_format_dumpi | ( | const gavl_video_format_t * | format, |
| int | indent ) |
Dump a video format to stderr.
| format | A video format |
| indent | Indentation |
Like gavl_video_format_dump but it places indent whitespaces in front of each line
Since 1.5.0
References gavl_video_format_dumpi().
Referenced by gavl_video_format_dumpi().