FFmpeg
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
dsputil_align.c File Reference
#include "libavutil/attributes.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/dsputil.h"
#include "libavcodec/rnd_avg.h"
#include "dsputil_sh4.h"
#include "qpel.c"

Go to the source code of this file.

Macros

#define LP(p)   *(uint32_t*)(p)
 
#define LPC(p)   *(const uint32_t*)(p)
 
#define UNPACK(ph, pl, tt0, tt1)
 
#define rnd_PACK(ph, pl, nph, npl)   ph + nph + (((pl + npl + BYTE_VEC32(0x02))>>2) & BYTE_VEC32(0x03))
 
#define no_rnd_PACK(ph, pl, nph, npl)   ph + nph + (((pl + npl + BYTE_VEC32(0x01))>>2) & BYTE_VEC32(0x03))
 
#define MERGE1(a, b, ofs)   (ofs==0)?a:( ((a)>>(8*ofs))|((b)<<(32-8*ofs)) )
 
#define MERGE2(a, b, ofs)   (ofs==3)?b:( ((a)>>(8*(ofs+1)))|((b)<<(32-8*(ofs+1))) )
 
#define put(d, s)   d = s
 
#define avg(d, s)   d = rnd_avg32(s,d)
 
#define OP_C4(ofs)
 
#define OP_C40()
 
#define OP_C(ofs, sz, avg2)
 
#define OP_C0(sz, avg2)
 
#define OP_X(ofs, sz, avg2)
 
#define OP_Y0(sz, avg2)
 
#define OP_Y(ofs, sz, avg2)
 
#define OP_X0(sz, avg2)   OP_X(0,sz,avg2)
 
#define OP_XY0(sz, PACK)   OP_XY(0,sz,PACK)
 
#define OP_XY(ofs, sz, PACK)
 
#define DEFFUNC(op, rnd, xy, sz, OP_N, avgfunc)
 
#define OP   put
 
#define OP   avg
 
#define put_no_rnd_pixels8_o   put_rnd_pixels8_o
 
#define put_no_rnd_pixels16_o   put_rnd_pixels16_o
 
#define avg_no_rnd_pixels16_o   avg_rnd_pixels16_o
 
#define put_pixels8_c   put_rnd_pixels8_o
 
#define put_pixels16_c   put_rnd_pixels16_o
 
#define avg_pixels8_c   avg_rnd_pixels8_o
 
#define avg_pixels16_c   avg_rnd_pixels16_o
 
#define put_no_rnd_pixels8_c   put_rnd_pixels8_o
 
#define put_no_rnd_pixels16_c   put_rnd_pixels16_o
 
#define avg_no_rnd_pixels16_c   avg_rnd_pixels16_o
 
#define QPEL
 
#define dspfunc(PFX, IDX, NUM)
 

Functions

av_cold void ff_dsputil_init_align (DSPContext *c, AVCodecContext *avctx)
 

Macro Definition Documentation

#define LP (   p)    *(uint32_t*)(p)

Definition at line 30 of file dsputil_align.c.

#define LPC (   p)    *(const uint32_t*)(p)

Definition at line 31 of file dsputil_align.c.

#define UNPACK (   ph,
  pl,
  tt0,
  tt1 
)
Value:
do { \
uint32_t t0,t1; t0=tt0;t1=tt1; \
ph = ( (t0 & ~BYTE_VEC32(0x03))>>2) + ( (t1 & ~BYTE_VEC32(0x03))>>2); \
pl = (t0 & BYTE_VEC32(0x03)) + (t1 & BYTE_VEC32(0x03)); } while(0)

Definition at line 34 of file dsputil_align.c.

#define rnd_PACK (   ph,
  pl,
  nph,
  npl 
)    ph + nph + (((pl + npl + BYTE_VEC32(0x02))>>2) & BYTE_VEC32(0x03))

Definition at line 39 of file dsputil_align.c.

#define no_rnd_PACK (   ph,
  pl,
  nph,
  npl 
)    ph + nph + (((pl + npl + BYTE_VEC32(0x01))>>2) & BYTE_VEC32(0x03))

Definition at line 40 of file dsputil_align.c.

#define MERGE1 (   a,
  b,
  ofs 
)    (ofs==0)?a:( ((a)>>(8*ofs))|((b)<<(32-8*ofs)) )

Definition at line 43 of file dsputil_align.c.

#define MERGE2 (   a,
  b,
  ofs 
)    (ofs==3)?b:( ((a)>>(8*(ofs+1)))|((b)<<(32-8*(ofs+1))) )

Definition at line 44 of file dsputil_align.c.

#define put (   d,
 
)    d = s
#define avg (   d,
 
)    d = rnd_avg32(s,d)
#define OP_C4 (   ofs)
Value:
ref-=ofs; \
do { \
OP(LP(dest),MERGE1(LPC(ref),LPC(ref+4),ofs)); \
ref+=stride; \
dest+=stride; \
} while(--height)

Definition at line 54 of file dsputil_align.c.

#define OP_C40 ( )
Value:
do { \
OP(LP(dest),LPC(ref)); \
ref+=stride; \
dest+=stride; \
} while(--height)

Definition at line 62 of file dsputil_align.c.

#define OP_C (   ofs,
  sz,
  avg2 
)
Value:
{ \
ref-=ofs; \
do { \
uint32_t t0,t1; \
t0 = LPC(ref+0); \
t1 = LPC(ref+4); \
OP(LP(dest+0), MERGE1(t0,t1,ofs)); \
t0 = LPC(ref+8); \
OP(LP(dest+4), MERGE1(t1,t0,ofs)); \
if (sz==16) { \
t1 = LPC(ref+12); \
OP(LP(dest+8), MERGE1(t0,t1,ofs)); \
t0 = LPC(ref+16); \
OP(LP(dest+12), MERGE1(t1,t0,ofs)); \
} \
ref+=stride; \
dest+= stride; \
} while(--height); \
}

Definition at line 69 of file dsputil_align.c.

#define OP_C0 (   sz,
  avg2 
)
Value:
{ \
do { \
OP(LP(dest+0), LPC(ref+0)); \
OP(LP(dest+4), LPC(ref+4)); \
if (sz==16) { \
OP(LP(dest+8), LPC(ref+8)); \
OP(LP(dest+12), LPC(ref+12)); \
} \
ref+=stride; \
dest+= stride; \
} while(--height); \
}

Definition at line 91 of file dsputil_align.c.

#define OP_X (   ofs,
  sz,
  avg2 
)
Value:
{ \
ref-=ofs; \
do { \
uint32_t t0,t1; \
t0 = LPC(ref+0); \
t1 = LPC(ref+4); \
OP(LP(dest+0), avg2(MERGE1(t0,t1,ofs),MERGE2(t0,t1,ofs))); \
t0 = LPC(ref+8); \
OP(LP(dest+4), avg2(MERGE1(t1,t0,ofs),MERGE2(t1,t0,ofs))); \
if (sz==16) { \
t1 = LPC(ref+12); \
OP(LP(dest+8), avg2(MERGE1(t0,t1,ofs),MERGE2(t0,t1,ofs))); \
t0 = LPC(ref+16); \
OP(LP(dest+12), avg2(MERGE1(t1,t0,ofs),MERGE2(t1,t0,ofs))); \
} \
ref+=stride; \
dest+= stride; \
} while(--height); \
}

Definition at line 105 of file dsputil_align.c.

#define OP_Y0 (   sz,
  avg2 
)
Value:
{ \
uint32_t t0,t1,t2,t3,t; \
\
t0 = LPC(ref+0); \
t1 = LPC(ref+4); \
if (sz==16) { \
t2 = LPC(ref+8); \
t3 = LPC(ref+12); \
} \
do { \
ref += stride; \
\
t = LPC(ref+0); \
OP(LP(dest+0), avg2(t0,t)); t0 = t; \
t = LPC(ref+4); \
OP(LP(dest+4), avg2(t1,t)); t1 = t; \
if (sz==16) { \
t = LPC(ref+8); \
OP(LP(dest+8), avg2(t2,t)); t2 = t; \
t = LPC(ref+12); \
OP(LP(dest+12), avg2(t3,t)); t3 = t; \
} \
dest+= stride; \
} while(--height); \
}

Definition at line 127 of file dsputil_align.c.

#define OP_Y (   ofs,
  sz,
  avg2 
)

Definition at line 154 of file dsputil_align.c.

#define OP_X0 (   sz,
  avg2 
)    OP_X(0,sz,avg2)

Definition at line 192 of file dsputil_align.c.

#define OP_XY0 (   sz,
  PACK 
)    OP_XY(0,sz,PACK)

Definition at line 193 of file dsputil_align.c.

#define OP_XY (   ofs,
  sz,
  PACK 
)

Definition at line 194 of file dsputil_align.c.

#define DEFFUNC (   op,
  rnd,
  xy,
  sz,
  OP_N,
  avgfunc 
)
Value:
static void op##_##rnd##_pixels##sz##_##xy (uint8_t * dest, const uint8_t * ref, \
const ptrdiff_t stride, int height) \
{ \
switch((int)ref&3) { \
case 0:OP_N##0(sz,rnd##_##avgfunc); return; \
case 1:OP_N(1,sz,rnd##_##avgfunc); return; \
case 2:OP_N(2,sz,rnd##_##avgfunc); return; \
case 3:OP_N(3,sz,rnd##_##avgfunc); return; \
} \
}

Definition at line 236 of file dsputil_align.c.

#define OP   put

Definition at line 266 of file dsputil_align.c.

#define OP   avg

Definition at line 266 of file dsputil_align.c.

#define put_no_rnd_pixels8_o   put_rnd_pixels8_o

Definition at line 282 of file dsputil_align.c.

Referenced by ff_dsputil_init_align().

#define put_no_rnd_pixels16_o   put_rnd_pixels16_o

Definition at line 283 of file dsputil_align.c.

Referenced by ff_dsputil_init_align().

#define avg_no_rnd_pixels16_o   avg_rnd_pixels16_o

Definition at line 284 of file dsputil_align.c.

Referenced by ff_dsputil_init_align().

#define put_pixels8_c   put_rnd_pixels8_o

Definition at line 286 of file dsputil_align.c.

Referenced by put_mspel8_mc00_sh4().

#define put_pixels16_c   put_rnd_pixels16_o

Definition at line 287 of file dsputil_align.c.

#define avg_pixels8_c   avg_rnd_pixels8_o

Definition at line 288 of file dsputil_align.c.

#define avg_pixels16_c   avg_rnd_pixels16_o

Definition at line 289 of file dsputil_align.c.

#define put_no_rnd_pixels8_c   put_rnd_pixels8_o

Definition at line 290 of file dsputil_align.c.

#define put_no_rnd_pixels16_c   put_rnd_pixels16_o

Definition at line 291 of file dsputil_align.c.

#define avg_no_rnd_pixels16_c   avg_rnd_pixels16_o

Definition at line 292 of file dsputil_align.c.

#define QPEL

Definition at line 294 of file dsputil_align.c.

#define dspfunc (   PFX,
  IDX,
  NUM 
)
Value:
c->PFX ## _pixels_tab[IDX][ 0] = PFX ## NUM ## _mc00_sh4; \
c->PFX ## _pixels_tab[IDX][ 1] = PFX ## NUM ## _mc10_sh4; \
c->PFX ## _pixels_tab[IDX][ 2] = PFX ## NUM ## _mc20_sh4; \
c->PFX ## _pixels_tab[IDX][ 3] = PFX ## NUM ## _mc30_sh4; \
c->PFX ## _pixels_tab[IDX][ 4] = PFX ## NUM ## _mc01_sh4; \
c->PFX ## _pixels_tab[IDX][ 5] = PFX ## NUM ## _mc11_sh4; \
c->PFX ## _pixels_tab[IDX][ 6] = PFX ## NUM ## _mc21_sh4; \
c->PFX ## _pixels_tab[IDX][ 7] = PFX ## NUM ## _mc31_sh4; \
c->PFX ## _pixels_tab[IDX][ 8] = PFX ## NUM ## _mc02_sh4; \
c->PFX ## _pixels_tab[IDX][ 9] = PFX ## NUM ## _mc12_sh4; \
c->PFX ## _pixels_tab[IDX][10] = PFX ## NUM ## _mc22_sh4; \
c->PFX ## _pixels_tab[IDX][11] = PFX ## NUM ## _mc32_sh4; \
c->PFX ## _pixels_tab[IDX][12] = PFX ## NUM ## _mc03_sh4; \
c->PFX ## _pixels_tab[IDX][13] = PFX ## NUM ## _mc13_sh4; \
c->PFX ## _pixels_tab[IDX][14] = PFX ## NUM ## _mc23_sh4; \
c->PFX ## _pixels_tab[IDX][15] = PFX ## NUM ## _mc33_sh4

Function Documentation

av_cold void ff_dsputil_init_align ( DSPContext c,
AVCodecContext avctx 
)

Definition at line 302 of file dsputil_align.c.

Referenced by ff_dsputil_init_sh4().