libavcodec/imgresample.c File Reference

High quality image resampling with polyphase filters . More...

#include "avcodec.h"
#include "swscale.h"
#include "dsputil.h"
#include "i386/mmx.h"

Go to the source code of this file.

Data Structures

struct  SwsContext
struct  ImgReSampleContext

Defines

#define NB_COMPONENTS   3
#define PHASE_BITS   4
#define NB_PHASES   (1 << PHASE_BITS)
#define NB_TAPS   4
#define FCENTER   1
#define POS_FRAC_BITS   16
#define POS_FRAC   (1 << POS_FRAC_BITS)
#define FILTER_BITS   8
#define LINE_BUF_HEIGHT   (NB_TAPS * 4)
#define FILTER4(reg)
#define DUMP(reg)   movq_r2m(reg, tmp); printf(#reg "=%016"PRIx64"\n", tmp.uq);

Functions

void av_build_filter (int16_t *filter, double factor, int tap_count, int phase_count, int scale, int type)
static int get_phase (int pos)
static void h_resample_fast (uint8_t *dst, int dst_width, const uint8_t *src, int src_width, int src_start, int src_incr, int16_t *filters)
static void v_resample (uint8_t *dst, int dst_width, const uint8_t *src, int wrap, int16_t *filter)
static void h_resample_fast4_mmx (uint8_t *dst, int dst_width, const uint8_t *src, int src_width, int src_start, int src_incr, int16_t *filters)
static void v_resample4_mmx (uint8_t *dst, int dst_width, const uint8_t *src, int wrap, int16_t *filter)
static void h_resample_slow (uint8_t *dst, int dst_width, const uint8_t *src, int src_width, int src_start, int src_incr, int16_t *filters)
static void h_resample (uint8_t *dst, int dst_width, const uint8_t *src, int src_width, int src_start, int src_incr, int16_t *filters)
static void component_resample (ImgReSampleContext *s, uint8_t *output, int owrap, int owidth, int oheight, uint8_t *input, int iwrap, int iwidth, int iheight)
ImgReSampleContextimg_resample_init (int owidth, int oheight, int iwidth, int iheight)
ImgReSampleContextimg_resample_full_init (int owidth, int oheight, int iwidth, int iheight, int topBand, int bottomBand, int leftBand, int rightBand, int padtop, int padbottom, int padleft, int padright)
void img_resample (ImgReSampleContext *s, AVPicture *output, const AVPicture *input)
void img_resample_close (ImgReSampleContext *s)


Detailed Description

High quality image resampling with polyphase filters .

Definition in file imgresample.c.


Define Documentation

#define DUMP ( reg   )     movq_r2m(reg, tmp); printf(#reg "=%016"PRIx64"\n", tmp.uq);

Definition at line 175 of file imgresample.c.

#define FCENTER   1

Definition at line 40 of file imgresample.c.

Referenced by component_resample().

#define FILTER4 ( reg   ) 

Value:

{\
        s = src + (src_pos >> POS_FRAC_BITS);\
        phase = get_phase(src_pos);\
        filter = filters + phase * NB_TAPS;\
        movq_m2r(*s, reg);\
        punpcklbw_r2r(mm7, reg);\
        movq_m2r(*filter, mm6);\
        pmaddwd_r2r(reg, mm6);\
        movq_r2r(mm6, reg);\
        psrlq_i2r(32, reg);\
        paddd_r2r(mm6, reg);\
        psrad_i2r(FILTER_BITS, reg);\
        src_pos += src_incr;\
}

Definition at line 159 of file imgresample.c.

Referenced by h_resample_fast4_mmx().

#define FILTER_BITS   8

#define LINE_BUF_HEIGHT   (NB_TAPS * 4)

Definition at line 48 of file imgresample.c.

Referenced by component_resample(), and img_resample_full_init().

#define NB_COMPONENTS   3

Definition at line 35 of file imgresample.c.

#define NB_PHASES   (1 << PHASE_BITS)

Definition at line 38 of file imgresample.c.

Referenced by img_resample_full_init().

#define NB_TAPS   4

#define PHASE_BITS   4

Definition at line 37 of file imgresample.c.

Referenced by get_phase().

#define POS_FRAC   (1 << POS_FRAC_BITS)

Definition at line 44 of file imgresample.c.

Referenced by component_resample(), and img_resample_full_init().

#define POS_FRAC_BITS   16


Function Documentation

void av_build_filter ( int16_t *  filter,
double  factor,
int  tap_count,
int  phase_count,
int  scale,
int  type 
)

static void component_resample ( ImgReSampleContext s,
uint8_t output,
int  owrap,
int  owidth,
int  oheight,
uint8_t input,
int  iwrap,
int  iwidth,
int  iheight 
) [static]

Definition at line 362 of file imgresample.c.

Referenced by img_resample().

static int get_phase ( int  pos  )  [inline, static]

Definition at line 69 of file imgresample.c.

Referenced by component_resample(), h_resample_fast(), and h_resample_slow().

static void h_resample ( uint8_t dst,
int  dst_width,
const uint8_t src,
int  src_width,
int  src_start,
int  src_incr,
int16_t *  filters 
) [static]

Definition at line 325 of file imgresample.c.

Referenced by component_resample().

static void h_resample_fast ( uint8_t dst,
int  dst_width,
const uint8_t src,
int  src_width,
int  src_start,
int  src_incr,
int16_t *  filters 
) [static]

Definition at line 75 of file imgresample.c.

Referenced by h_resample().

static void h_resample_fast4_mmx ( uint8_t dst,
int  dst_width,
const uint8_t src,
int  src_width,
int  src_start,
int  src_incr,
int16_t *  filters 
) [static]

Definition at line 178 of file imgresample.c.

Referenced by h_resample().

static void h_resample_slow ( uint8_t dst,
int  dst_width,
const uint8_t src,
int  src_width,
int  src_start,
int  src_incr,
int16_t *  filters 
) [static]

Definition at line 289 of file imgresample.c.

Referenced by h_resample().

void img_resample ( struct ImgReSampleContext s,
AVPicture output,
const AVPicture input 
)

Deprecated:
Use the software scaler (swscale) instead.

Definition at line 487 of file imgresample.c.

void img_resample_close ( struct ImgReSampleContext s  ) 

Deprecated:
Use the software scaler (swscale) instead.

Definition at line 509 of file imgresample.c.

ImgReSampleContext* img_resample_full_init ( int  owidth,
int  oheight,
int  iwidth,
int  iheight,
int  topBand,
int  bottomBand,
int  leftBand,
int  rightBand,
int  padtop,
int  padbottom,
int  padleft,
int  padright 
)

Deprecated:
Use the software scaler (swscale) instead.

Definition at line 434 of file imgresample.c.

Referenced by img_resample_init().

ImgReSampleContext* img_resample_init ( int  output_width,
int  output_height,
int  input_width,
int  input_height 
)

Deprecated:
Use the software scaler (swscale) instead.

Definition at line 427 of file imgresample.c.

static void v_resample ( uint8_t dst,
int  dst_width,
const uint8_t src,
int  wrap,
int16_t *  filter 
) [static]

Definition at line 119 of file imgresample.c.

Referenced by component_resample().

static void v_resample4_mmx ( uint8_t dst,
int  dst_width,
const uint8_t src,
int  wrap,
int16_t *  filter 
) [static]

Definition at line 223 of file imgresample.c.

Referenced by component_resample().


Generated on Thu Apr 2 07:15:41 2009 for ffmpeg by  doxygen 1.5.6