FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Pixel formats

Functions for working with pixel formats. More...

Functions

void avcodec_get_chroma_sub_sample (enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift)
 Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor. More...
 
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)
 
enum AVPixelFormat avcodec_find_best_pix_fmt_of_list (const 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_find_best_pix_fmt_of_2 (enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
 
attribute_deprecated enum
AVPixelFormat 
avcodec_find_best_pix_fmt2 (enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr)
 
enum AVPixelFormat avcodec_default_get_format (struct AVCodecContext *s, const enum AVPixelFormat *fmt)
 

Detailed Description

Functions for working with pixel formats.

Function Documentation

void avcodec_get_chroma_sub_sample ( enum AVPixelFormat  pix_fmt,
int *  h_shift,
int *  v_shift 
)

Utility function to access log2_chroma_w log2_chroma_h from the pixel format AVPixFmtDescriptor.

This function asserts that pix_fmt is valid. See av_pix_fmt_get_chroma_sub_sample for one that returns a failure code and continues in case of invalid pix_fmts.

Parameters
[in]pix_fmtthe pixel format
[out]h_shiftstore log2_chroma_w
[out]v_shiftstore log2_chroma_h
See Also
av_pix_fmt_get_chroma_sub_sample

Definition at line 43 of file imgconvert.c.

Referenced by dirac_decode_data_unit(), encode_init(), ff_mjpeg_decode_frame(), ff_mpv_common_init(), ff_print_debug_info2(), get_buffer_with_edge(), j2kenc_init(), parse_source_parameters(), and vp3_decode_init().

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 232 of file raw.c.

Referenced by avformat_find_stream_info(), raw_encode_init(), and v4l2_read_header().

int avcodec_get_pix_fmt_loss ( enum AVPixelFormat  dst_pix_fmt,
enum AVPixelFormat  src_pix_fmt,
int  has_alpha 
)
Deprecated:
see av_get_pix_fmt_loss()

Definition at line 51 of file imgconvert.c.

enum AVPixelFormat avcodec_find_best_pix_fmt_of_list ( const 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_fmt_of_2() 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.

Parameters
[in]pix_fmt_listAV_PIX_FMT_NONE terminated array of pixel formats to choose from
[in]src_pix_fmtsource pixel format
[in]has_alphaWhether the source pixel format alpha channel is used.
[out]loss_ptrCombination of flags informing you what kind of losses will occur.
Returns
The best pixel format to convert to or -1 if none was found.

Definition at line 78 of file imgconvert.c.

enum AVPixelFormat avcodec_find_best_pix_fmt_of_2 ( enum AVPixelFormat  dst_pix_fmt1,
enum AVPixelFormat  dst_pix_fmt2,
enum AVPixelFormat  src_pix_fmt,
int  has_alpha,
int *  loss_ptr 
)
attribute_deprecated enum AVPixelFormat avcodec_find_best_pix_fmt2 ( enum AVPixelFormat  dst_pix_fmt1,
enum AVPixelFormat  dst_pix_fmt2,
enum AVPixelFormat  src_pix_fmt,
int  has_alpha,
int *  loss_ptr 
)

Definition at line 71 of file imgconvert.c.

enum AVPixelFormat avcodec_default_get_format ( struct AVCodecContext s,
const enum AVPixelFormat fmt 
)

Definition at line 1146 of file utils.c.

Referenced by avcodec_get_context_defaults3(), ff_thread_get_format(), and submit_packet().