Libav
|
Functions for working with pixel formats. More...
Macros | |
#define | FF_LOSS_RESOLUTION 0x0001 |
loss due to resolution change More... | |
#define | FF_LOSS_DEPTH 0x0002 |
loss due to color depth change More... | |
#define | FF_LOSS_COLORSPACE 0x0004 |
loss due to color space conversion More... | |
#define | FF_LOSS_ALPHA 0x0008 |
loss of alpha bits More... | |
#define | FF_LOSS_COLORQUANT 0x0010 |
loss due to color quantization More... | |
#define | FF_LOSS_CHROMA 0x0020 |
loss of chroma (e.g. More... | |
Functions | |
void attribute_deprecated | avcodec_get_chroma_sub_sample (enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift) |
unsigned int | avcodec_pix_fmt_to_codec_tag (enum AVPixelFormat pix_fmt) |
Return a value representing the fourCC code associated to the pixel format pix_fmt, or 0 if no associated fourCC code can be found. More... | |
int | avcodec_get_pix_fmt_loss (enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, int has_alpha) |
Compute what kind of losses will occur when converting from one specific pixel format to another. More... | |
enum AVPixelFormat | avcodec_find_best_pix_fmt2 (enum AVPixelFormat *pix_fmt_list, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr) |
Find the best pixel format to convert to given a certain source pixel format. More... | |
enum AVPixelFormat | avcodec_default_get_format (struct AVCodecContext *s, const enum AVPixelFormat *fmt) |
Functions for working with pixel formats.
#define FF_LOSS_RESOLUTION 0x0001 |
loss due to resolution change
Definition at line 4046 of file avcodec.h.
Referenced by avcodec_find_best_pix_fmt2(), and avcodec_get_pix_fmt_loss().
#define FF_LOSS_DEPTH 0x0002 |
loss due to color depth change
Definition at line 4047 of file avcodec.h.
Referenced by avcodec_find_best_pix_fmt2(), and avcodec_get_pix_fmt_loss().
#define FF_LOSS_COLORSPACE 0x0004 |
loss due to color space conversion
Definition at line 4048 of file avcodec.h.
Referenced by avcodec_find_best_pix_fmt2(), and avcodec_get_pix_fmt_loss().
#define FF_LOSS_ALPHA 0x0008 |
loss of alpha bits
Definition at line 4049 of file avcodec.h.
Referenced by avcodec_find_best_pix_fmt2(), and avcodec_get_pix_fmt_loss().
#define FF_LOSS_COLORQUANT 0x0010 |
loss due to color quantization
Definition at line 4050 of file avcodec.h.
Referenced by avcodec_find_best_pix_fmt2(), and avcodec_get_pix_fmt_loss().
#define FF_LOSS_CHROMA 0x0020 |
loss of chroma (e.g.
RGB to gray conversion)
Definition at line 4051 of file avcodec.h.
Referenced by avcodec_get_pix_fmt_loss().
void attribute_deprecated avcodec_get_chroma_sub_sample | ( | enum AVPixelFormat | pix_fmt, |
int * | h_shift, | ||
int * | v_shift | ||
) |
Definition at line 54 of file imgconvert.c.
unsigned int avcodec_pix_fmt_to_codec_tag | ( | enum AVPixelFormat | pix_fmt) |
Return a value representing the fourCC code associated to the pixel format pix_fmt, or 0 if no associated fourCC code can be found.
Definition at line 170 of file raw.c.
Referenced by raw_init_encoder(), and v4l2_read_header().
int avcodec_get_pix_fmt_loss | ( | enum AVPixelFormat | dst_pix_fmt, |
enum AVPixelFormat | src_pix_fmt, | ||
int | has_alpha | ||
) |
Compute what kind of losses will occur when converting from one specific pixel format to another.
When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. These losses can involve loss of chroma, but also loss of resolution, loss of color depth, loss due to the color space conversion, loss of the alpha bits or loss due to color quantization. avcodec_get_fix_fmt_loss() informs you about the various types of losses which will occur when converting from one pixel format to another.
[in] | dst_pix_fmt | destination pixel format |
[in] | src_pix_fmt | source pixel format |
[in] | has_alpha | Whether the source pixel format alpha channel is used. |
Definition at line 66 of file imgconvert.c.
Referenced by avcodec_find_best_pix_fmt1(), and avcodec_find_best_pix_fmt2().
enum AVPixelFormat avcodec_find_best_pix_fmt2 | ( | enum AVPixelFormat * | pix_fmt_list, |
enum AVPixelFormat | src_pix_fmt, | ||
int | has_alpha, | ||
int * | loss_ptr | ||
) |
Find the best pixel format to convert to given a certain source pixel format.
When converting from one pixel format to another, information loss may occur. For example, when converting from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when converting from some formats to other formats. avcodec_find_best_pix_fmt2() searches which of the given pixel formats should be used to suffer the least amount of loss. The pixel formats from which it chooses one, are determined by the pix_fmt_list parameter.
[in] | pix_fmt_list | AV_PIX_FMT_NONE terminated array of pixel formats to choose from |
[in] | src_pix_fmt | source pixel format |
[in] | has_alpha | Whether the source pixel format alpha channel is used. |
[out] | loss_ptr | Combination of flags informing you what kind of losses will occur. |
Definition at line 140 of file imgconvert.c.
enum AVPixelFormat avcodec_default_get_format | ( | struct AVCodecContext * | s, |
const enum AVPixelFormat * | fmt | ||
) |
Definition at line 830 of file utils.c.
Referenced by avcodec_get_context_defaults3().