#include "avcodec.h"
#include "dsputil.h"
#include "imgconvert.h"
#include "libswscale/swscale.h"
#include "x86/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) |
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) |
ImgReSampleContext * | img_resample_init (int owidth, int oheight, int iwidth, int iheight) |
void | img_resample (ImgReSampleContext *s, AVPicture *output, const AVPicture *input) |
void | img_resample_close (ImgReSampleContext *s) |
static const char * | context_to_name (void *ptr) |
struct SwsContext * | sws_getContext (int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param) |
void | sws_freeContext (struct SwsContext *ctx) |
struct SwsContext * | sws_getCachedContext (struct SwsContext *ctx, int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, double *param) |
Checks if context is valid or reallocs a new one instead. | |
int | sws_scale (struct SwsContext *ctx, uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) |
Scales the image slice in srcSlice and puts the resulting scaled slice in the image in dst . | |
Variables | |
static const AVClass | context_class = { "imgresample", context_to_name, NULL } |
WARNING: This file is deprecated and will be removed after FFmpeg 0.5 release, do not lose your time improving it!
Definition in file imgresample.c.
#define DUMP | ( | reg | ) | movq_r2m(reg, tmp); printf(#reg "=%016"PRIx64"\n", tmp.uq); |
Definition at line 179 of file imgresample.c.
#define FCENTER 1 |
#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 163 of file imgresample.c.
Referenced by h_resample_fast4_mmx().
#define FILTER_BITS 8 |
Definition at line 50 of file imgresample.c.
Referenced by component_resample(), h_resample_fast(), h_resample_slow(), img_resample_full_init(), v_resample(), v_resample16_altivec(), and v_resample4_mmx().
#define LINE_BUF_HEIGHT (NB_TAPS * 4) |
Definition at line 52 of file imgresample.c.
Referenced by component_resample(), and img_resample_full_init().
#define NB_COMPONENTS 3 |
Definition at line 39 of file imgresample.c.
#define NB_PHASES (1 << PHASE_BITS) |
#define NB_TAPS 4 |
Definition at line 43 of file imgresample.c.
Referenced by component_resample(), h_resample(), h_resample_fast(), h_resample_slow(), img_resample_full_init(), and v_resample().
#define PHASE_BITS 4 |
#define POS_FRAC (1 << POS_FRAC_BITS) |
Definition at line 48 of file imgresample.c.
Referenced by component_resample(), and img_resample_full_init().
#define POS_FRAC_BITS 16 |
Definition at line 47 of file imgresample.c.
Referenced by component_resample(), get_phase(), h_resample(), h_resample_fast(), and h_resample_slow().
void av_build_filter | ( | int16_t * | filter, | |
double | factor, | |||
int | tap_count, | |||
int | phase_count, | |||
int | scale, | |||
int | type | |||
) |
Referenced by av_resample_init(), and img_resample_full_init().
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] |
static const char* context_to_name | ( | void * | ptr | ) | [static] |
Definition at line 516 of file imgresample.c.
static int get_phase | ( | int | pos | ) | [inline, static] |
Definition at line 73 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] |
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] |
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] |
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 img_resample | ( | ImgReSampleContext * | s, | |
AVPicture * | output, | |||
const AVPicture * | input | |||
) |
void img_resample_close | ( | ImgReSampleContext * | s | ) |
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 | |||
) |
ImgReSampleContext* img_resample_init | ( | int | owidth, | |
int | oheight, | |||
int | iwidth, | |||
int | iheight | |||
) |
void sws_freeContext | ( | struct SwsContext * | ctx | ) |
Definition at line 556 of file imgresample.c.
Referenced by av_encode(), doTest(), Release(), and sws_getCachedContext().
struct SwsContext* sws_getCachedContext | ( | struct SwsContext * | ctx, | |
int | srcW, | |||
int | srcH, | |||
int | srcFormat, | |||
int | dstW, | |||
int | dstH, | |||
int | dstFormat, | |||
int | flags, | |||
SwsFilter * | srcFilter, | |||
SwsFilter * | dstFilter, | |||
double * | param | |||
) | [read] |
Checks if context is valid or reallocs a new one instead.
If context is NULL, just calls sws_getContext() to get a new one. Otherwise, checks if the parameters are the same already saved in context. If that is the case, returns the current context. Otherwise, frees context and gets a new one.
Be warned that srcFilter, dstFilter are not checked, they are assumed to remain valid.
Definition at line 580 of file imgresample.c.
Referenced by get_watermark_picture(), Process(), Process0(), Process1(), and queue_picture().
struct SwsContext* sws_getContext | ( | int | srcW, | |
int | srcH, | |||
int | srcFormat, | |||
int | dstW, | |||
int | dstH, | |||
int | dstFormat, | |||
int | flags, | |||
SwsFilter * | srcFilter, | |||
SwsFilter * | dstFilter, | |||
double * | param | |||
) | [read] |
Definition at line 523 of file imgresample.c.
Referenced by av_encode(), doTest(), main(), sws_getCachedContext(), and write_video_frame().
int sws_scale | ( | struct SwsContext * | context, | |
uint8_t * | srcSlice[], | |||
int | srcStride[], | |||
int | srcSliceY, | |||
int | srcSliceH, | |||
uint8_t * | dst[], | |||
int | dstStride[] | |||
) |
Scales the image slice in srcSlice
and puts the resulting scaled slice in the image in dst
.
A slice is a sequence of consecutive rows in an image.
context | the scaling context previously created with sws_getContext() | |
srcSlice | the array containing the pointers to the planes of the source slice | |
srcStride | the array containing the strides for each plane of the source image | |
srcSliceY | the position in the source image of the slice to process, that is the number (counted starting from zero) in the image of the first row of the slice | |
srcSliceH | the height of the source slice, that is the number of rows in the slice | |
dst | the array containing the pointers to the planes of the destination image | |
dstStride | the array containing the strides for each plane of the destination image |
Definition at line 605 of file imgresample.c.
Referenced by do_video_out(), doTest(), get_watermark_picture(), main(), Process(), Process0(), Process1(), queue_picture(), sws_scale_ordered(), and write_video_frame().
static void v_resample | ( | uint8_t * | dst, | |
int | dst_width, | |||
const uint8_t * | src, | |||
int | wrap, | |||
int16_t * | filter | |||
) | [static] |
static void v_resample4_mmx | ( | uint8_t * | dst, | |
int | dst_width, | |||
const uint8_t * | src, | |||
int | wrap, | |||
int16_t * | filter | |||
) | [static] |
const AVClass context_class = { "imgresample", context_to_name, NULL } [static] |
Definition at line 521 of file imgresample.c.