Libav
Macros | Functions | Variables
swscale.c File Reference
#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/avutil.h"
#include "libavutil/bswap.h"
#include "libavutil/cpu.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/pixdesc.h"
#include "config.h"
#include "rgb2rgb.h"
#include "swscale_internal.h"
#include "swscale.h"

Go to the source code of this file.

Macros

#define FILL8TO9_OR_10(wfunc)
 
#define DEBUG_SWSCALE_BUFFERS   0
 
#define DEBUG_BUFFERS(...)
 

Functions

static av_always_inline void fillPlane (uint8_t *plane, int stride, int width, int height, int y, uint8_t val)
 
static void fill_plane9or10 (uint8_t *plane, int stride, int width, int height, int y, uint8_t val, const int dst_depth, const int big_endian)
 
static void hScale16To19_c (SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
 
static void hScale16To15_c (SwsContext *c, int16_t *dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize)
 
static void hScale8To15_c (SwsContext *c, int16_t *dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
 
static void hScale8To19_c (SwsContext *c, int16_t *_dst, int dstW, const uint8_t *src, const int16_t *filter, const int32_t *filterPos, int filterSize)
 
static void chrRangeToJpeg_c (int16_t *dstU, int16_t *dstV, int width)
 
static void chrRangeFromJpeg_c (int16_t *dstU, int16_t *dstV, int width)
 
static void lumRangeToJpeg_c (int16_t *dst, int width)
 
static void lumRangeFromJpeg_c (int16_t *dst, int width)
 
static void chrRangeToJpeg16_c (int16_t *_dstU, int16_t *_dstV, int width)
 
static void chrRangeFromJpeg16_c (int16_t *_dstU, int16_t *_dstV, int width)
 
static void lumRangeToJpeg16_c (int16_t *_dst, int width)
 
static void lumRangeFromJpeg16_c (int16_t *_dst, int width)
 
static void hyscale_fast_c (SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, int srcW, int xInc)
 
static av_always_inline void hyscale (SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src_in[4], int srcW, int xInc, const int16_t *hLumFilter, const int32_t *hLumFilterPos, int hLumFilterSize, uint8_t *formatConvBuffer, uint32_t *pal, int isAlpha)
 
static void hcscale_fast_c (SwsContext *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src1, const uint8_t *src2, int srcW, int xInc)
 
static av_always_inline void hcscale (SwsContext *c, int16_t *dst1, int16_t *dst2, int dstWidth, const uint8_t *src_in[4], int srcW, int xInc, const int16_t *hChrFilter, const int32_t *hChrFilterPos, int hChrFilterSize, uint8_t *formatConvBuffer, uint32_t *pal)
 
static int swscale (SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[])
 
static av_cold void sws_init_swscale (SwsContext *c)
 
SwsFunc ff_getSwsFunc (SwsContext *c)
 Return function pointer to fastest main scaler path function depending on architecture and available optimizations. More...
 

Variables

const uint8_t ff_dither_8x8_128 [8][8]
 
static const uint8_t sws_pb_64 [8]
 

Macro Definition Documentation

#define FILL8TO9_OR_10 (   wfunc)
Value:
for (i = 0; i < height; i++) { \
for (j = 0; j < width; j++) { \
wfunc(&dst[j], (val << (dst_depth - 8)) | \
(val >> (16 - dst_depth))); \
} \
dst += stride / 2; \
}
int stride
Definition: mace.c:144
static int width
Definition: utils.c:156
int height
Definition: gxfenc.c:72
for(j=16;j >0;--j)

Referenced by fill_plane9or10().

#define DEBUG_SWSCALE_BUFFERS   0

Definition at line 335 of file swscale.c.

#define DEBUG_BUFFERS (   ...)
Value:
av_log(c, AV_LOG_DEBUG, __VA_ARGS__)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition: log.h:144
void av_log(void *avcl, int level, const char *fmt,...)
Definition: log.c:168
#define DEBUG_SWSCALE_BUFFERS
Definition: swscale.c:335

Definition at line 336 of file swscale.c.

Referenced by swscale().

Function Documentation

static av_always_inline void fillPlane ( uint8_t plane,
int  stride,
int  width,
int  height,
int  y,
uint8_t  val 
)
static

Definition at line 53 of file swscale.c.

Referenced by swscale().

static void fill_plane9or10 ( uint8_t plane,
int  stride,
int  width,
int  height,
int  y,
uint8_t  val,
const int  dst_depth,
const int  big_endian 
)
static

Definition at line 64 of file swscale.c.

Referenced by swscale().

static void hScale16To19_c ( SwsContext c,
int16_t *  _dst,
int  dstW,
const uint8_t _src,
const int16_t *  filter,
const int32_t filterPos,
int  filterSize 
)
static

Definition at line 86 of file swscale.c.

Referenced by sws_init_swscale().

static void hScale16To15_c ( SwsContext c,
int16_t *  dst,
int  dstW,
const uint8_t _src,
const int16_t *  filter,
const int32_t filterPos,
int  filterSize 
)
static

Definition at line 110 of file swscale.c.

Referenced by sws_init_swscale().

static void hScale8To15_c ( SwsContext c,
int16_t *  dst,
int  dstW,
const uint8_t src,
const int16_t *  filter,
const int32_t filterPos,
int  filterSize 
)
static

Definition at line 133 of file swscale.c.

Referenced by sws_init_swscale().

static void hScale8To19_c ( SwsContext c,
int16_t *  _dst,
int  dstW,
const uint8_t src,
const int16_t *  filter,
const int32_t filterPos,
int  filterSize 
)
static

Definition at line 149 of file swscale.c.

Referenced by sws_init_swscale().

static void chrRangeToJpeg_c ( int16_t *  dstU,
int16_t *  dstV,
int  width 
)
static

Definition at line 168 of file swscale.c.

Referenced by sws_init_swscale().

static void chrRangeFromJpeg_c ( int16_t *  dstU,
int16_t *  dstV,
int  width 
)
static

Definition at line 177 of file swscale.c.

Referenced by sws_init_swscale().

static void lumRangeToJpeg_c ( int16_t *  dst,
int  width 
)
static

Definition at line 186 of file swscale.c.

Referenced by sws_init_swscale().

static void lumRangeFromJpeg_c ( int16_t *  dst,
int  width 
)
static

Definition at line 193 of file swscale.c.

Referenced by sws_init_swscale().

static void chrRangeToJpeg16_c ( int16_t *  _dstU,
int16_t *  _dstV,
int  width 
)
static

Definition at line 200 of file swscale.c.

Referenced by sws_init_swscale().

static void chrRangeFromJpeg16_c ( int16_t *  _dstU,
int16_t *  _dstV,
int  width 
)
static

Definition at line 211 of file swscale.c.

Referenced by sws_init_swscale().

static void lumRangeToJpeg16_c ( int16_t *  _dst,
int  width 
)
static

Definition at line 222 of file swscale.c.

Referenced by sws_init_swscale().

static void lumRangeFromJpeg16_c ( int16_t *  _dst,
int  width 
)
static

Definition at line 230 of file swscale.c.

Referenced by sws_init_swscale().

static void hyscale_fast_c ( SwsContext c,
int16_t *  dst,
int  dstWidth,
const uint8_t src,
int  srcW,
int  xInc 
)
static

Definition at line 238 of file swscale.c.

Referenced by sws_init_swscale().

static av_always_inline void hyscale ( SwsContext c,
int16_t *  dst,
int  dstWidth,
const uint8_t src_in[4],
int  srcW,
int  xInc,
const int16_t *  hLumFilter,
const int32_t hLumFilterPos,
int  hLumFilterSize,
uint8_t formatConvBuffer,
uint32_t *  pal,
int  isAlpha 
)
static

Definition at line 252 of file swscale.c.

Referenced by swscale().

static void hcscale_fast_c ( SwsContext c,
int16_t *  dst1,
int16_t *  dst2,
int  dstWidth,
const uint8_t src1,
const uint8_t src2,
int  srcW,
int  xInc 
)
static

Definition at line 285 of file swscale.c.

Referenced by sws_init_swscale().

static av_always_inline void hcscale ( SwsContext c,
int16_t *  dst1,
int16_t *  dst2,
int  dstWidth,
const uint8_t src_in[4],
int  srcW,
int  xInc,
const int16_t *  hChrFilter,
const int32_t hChrFilterPos,
int  hChrFilterSize,
uint8_t formatConvBuffer,
uint32_t *  pal 
)
static

Definition at line 300 of file swscale.c.

Referenced by swscale().

static int swscale ( SwsContext c,
const uint8_t src[],
int  srcStride[],
int  srcSliceY,
int  srcSliceH,
uint8_t dst[],
int  dstStride[] 
)
static

Definition at line 340 of file swscale.c.

Referenced by ff_getSwsFunc(), and print_all_libs_info().

static av_cold void sws_init_swscale ( SwsContext c)
static

Definition at line 721 of file swscale.c.

Referenced by ff_getSwsFunc().

SwsFunc ff_getSwsFunc ( SwsContext c)

Return function pointer to fastest main scaler path function depending on architecture and available optimizations.

Definition at line 771 of file swscale.c.

Referenced by sws_init_context().

Variable Documentation

const uint8_t ff_dither_8x8_128[8][8]
Initial value:
= {
{ 36, 68, 60, 92, 34, 66, 58, 90, },
{ 100, 4, 124, 28, 98, 2, 122, 26, },
{ 52, 84, 44, 76, 50, 82, 42, 74, },
{ 116, 20, 108, 12, 114, 18, 106, 10, },
{ 32, 64, 56, 88, 38, 70, 62, 94, },
{ 96, 0, 120, 24, 102, 6, 126, 30, },
{ 48, 80, 40, 72, 54, 86, 46, 78, },
{ 112, 16, 104, 8, 118, 22, 110, 14, },
}

Definition at line 38 of file swscale.c.

Referenced by swscale().

const uint8_t sws_pb_64[8]
static
Initial value:
= {
64, 64, 64, 64, 64, 64, 64, 64
}

Definition at line 49 of file swscale.c.

Referenced by swscale().