FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
imgconvert.c File Reference

misc image conversion routines More...

#include "avcodec.h"
#include "dsputil.h"
#include "imgconvert.h"
#include "internal.h"
#include "libavutil/avassert.h"
#include "libavutil/colorspace.h"
#include "libavutil/common.h"
#include "libavutil/pixdesc.h"
#include "libavutil/imgutils.h"

Go to the source code of this file.

Macros

#define FF_COLOR_NA   -1
 
#define FF_COLOR_RGB   0
 RGB color space.
 
#define FF_COLOR_GRAY   1
 gray color space
 
#define FF_COLOR_YUV   2
 YUV color space.
 
#define FF_COLOR_YUV_JPEG   3
 YUV color space.
 
#define deinterlace_line_inplace   deinterlace_line_inplace_c
 
#define deinterlace_line   deinterlace_line_c
 
#define pixdesc_has_alpha(pixdesc)   ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
 

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.
 
static int get_color_type (const AVPixFmtDescriptor *desc)
 
static int get_pix_fmt_depth (int *min, int *max, enum AVPixelFormat pix_fmt)
 
static int get_pix_fmt_score (enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, unsigned *lossp, unsigned consider)
 
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.
 
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)
 Find the best pixel format to convert to given a certain source pixel format and a selection of two destination pixel formats.
 
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_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.
 
void ff_shrink22 (uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height)
 
void ff_shrink44 (uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height)
 
void ff_shrink88 (uint8_t *dst, int dst_wrap, const uint8_t *src, int src_wrap, int width, int height)
 
static int is_yuv_planar (const AVPixFmtDescriptor *desc)
 
int av_picture_crop (AVPicture *dst, const AVPicture *src, enum AVPixelFormat pix_fmt, int top_band, int left_band)
 Crop image top and left side.
 
int av_picture_pad (AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color)
 Pad image.
 

Detailed Description

misc image conversion routines

Definition in file imgconvert.c.

Macro Definition Documentation

#define FF_COLOR_NA   -1

Definition at line 47 of file imgconvert.c.

Referenced by get_color_type().

#define FF_COLOR_RGB   0

RGB color space.

Definition at line 48 of file imgconvert.c.

Referenced by get_color_type(), and get_pix_fmt_score().

#define FF_COLOR_GRAY   1

gray color space

Definition at line 49 of file imgconvert.c.

Referenced by get_color_type(), and get_pix_fmt_score().

#define FF_COLOR_YUV   2

YUV color space.

16 <= Y <= 235, 16 <= U, V <= 240

Definition at line 50 of file imgconvert.c.

Referenced by get_color_type(), and get_pix_fmt_score().

#define FF_COLOR_YUV_JPEG   3

YUV color space.

0 <= Y <= 255, 0 <= U, V <= 255

Definition at line 51 of file imgconvert.c.

Referenced by get_color_type(), and get_pix_fmt_score().

#define deinterlace_line_inplace   deinterlace_line_inplace_c

Definition at line 57 of file imgconvert.c.

#define deinterlace_line   deinterlace_line_c

Definition at line 58 of file imgconvert.c.

#define pixdesc_has_alpha (   pixdesc)    ((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)

Definition at line 61 of file imgconvert.c.

Referenced by get_pix_fmt_score().

Function Documentation

static int get_color_type ( const AVPixFmtDescriptor desc)
static

Definition at line 73 of file imgconvert.c.

Referenced by get_pix_fmt_score().

static int get_pix_fmt_depth ( int *  min,
int *  max,
enum AVPixelFormat  pix_fmt 
)
static

Definition at line 92 of file imgconvert.c.

Referenced by get_pix_fmt_score().

static int get_pix_fmt_score ( enum AVPixelFormat  dst_pix_fmt,
enum AVPixelFormat  src_pix_fmt,
unsigned *  lossp,
unsigned  consider 
)
static

Definition at line 110 of file imgconvert.c.

Referenced by avcodec_find_best_pix_fmt_of_2(), and avcodec_get_pix_fmt_loss().

void ff_shrink22 ( uint8_t dst,
int  dst_wrap,
const uint8_t src,
int  src_wrap,
int  width,
int  height 
)

Definition at line 281 of file imgconvert.c.

Referenced by ff_dsputil_init().

void ff_shrink44 ( uint8_t dst,
int  dst_wrap,
const uint8_t src,
int  src_wrap,
int  width,
int  height 
)

Definition at line 314 of file imgconvert.c.

Referenced by ff_dsputil_init().

void ff_shrink88 ( uint8_t dst,
int  dst_wrap,
const uint8_t src,
int  src_wrap,
int  width,
int  height 
)

Definition at line 345 of file imgconvert.c.

Referenced by ff_dsputil_init().

static int is_yuv_planar ( const AVPixFmtDescriptor desc)
inlinestatic

Definition at line 367 of file imgconvert.c.

Referenced by av_picture_crop(), and av_picture_pad().