libavcodec/h264pred_template.c File Reference

H.264 / AVC / MPEG4 part10 prediction functions. More...

#include "mathops.h"
#include "high_bit_depth.h"

Go to the source code of this file.

Defines

#define LOAD_TOP_RIGHT_EDGE
#define LOAD_DOWN_LEFT_EDGE
#define LOAD_LEFT_EDGE
#define LOAD_TOP_EDGE
#define PREDICT_16x16_DC(v)
#define PRED16x16_X(n, v)
#define PRED8x8_X(n, v)
#define SRC(x, y)   src[(x)+(y)*stride]
#define PL(y)   const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
#define PREDICT_8x8_LOAD_LEFT
#define PT(x)   const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
#define PREDICT_8x8_LOAD_TOP
#define PTR(x)   t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
#define PREDICT_8x8_LOAD_TOPRIGHT
#define PREDICT_8x8_LOAD_TOPLEFT   const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2
#define PREDICT_8x8_DC(v)
#define ROW(y)

Functions

static void FUNCC() pred4x4_vertical (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_horizontal (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_dc (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_left_dc (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_top_dc (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_128_dc (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_127_dc (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_129_dc (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_down_right (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_down_left (uint8_t *_src, const uint8_t *_topright, int _stride)
static void FUNCC() pred4x4_vertical_right (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_vertical_left (uint8_t *_src, const uint8_t *_topright, int _stride)
static void FUNCC() pred4x4_horizontal_up (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred4x4_horizontal_down (uint8_t *_src, const uint8_t *topright, int _stride)
static void FUNCC() pred16x16_vertical (uint8_t *_src, int _stride)
static void FUNCC() pred16x16_horizontal (uint8_t *_src, int stride)
static void FUNCC() pred16x16_dc (uint8_t *_src, int stride)
static void FUNCC() pred16x16_left_dc (uint8_t *_src, int stride)
static void FUNCC() pred16x16_top_dc (uint8_t *_src, int stride)
 PRED16x16_X (127,(1<<(BIT_DEPTH-1))-1)
 PRED16x16_X (128,(1<<(BIT_DEPTH-1))+0)
 PRED16x16_X (129,(1<<(BIT_DEPTH-1))+1)
static void FUNCC() pred16x16_plane_compat (uint8_t *p_src, int p_stride, const int svq3, const int rv40)
static void FUNCC() pred16x16_plane (uint8_t *src, int stride)
static void FUNCC() pred8x8_vertical (uint8_t *_src, int _stride)
static void FUNCC() pred8x8_horizontal (uint8_t *_src, int stride)
 PRED8x8_X (127,(1<<(BIT_DEPTH-1))-1)
 PRED8x8_X (128,(1<<(BIT_DEPTH-1))+0)
 PRED8x8_X (129,(1<<(BIT_DEPTH-1))+1)
static void FUNCC() pred8x8_left_dc (uint8_t *_src, int stride)
static void FUNCC() pred8x8_top_dc (uint8_t *_src, int stride)
static void FUNCC() pred8x8_dc (uint8_t *_src, int stride)
static void FUNC() pred8x8_mad_cow_dc_l0t (uint8_t *src, int stride)
static void FUNC() pred8x8_mad_cow_dc_0lt (uint8_t *src, int stride)
static void FUNC() pred8x8_mad_cow_dc_l00 (uint8_t *src, int stride)
static void FUNC() pred8x8_mad_cow_dc_0l0 (uint8_t *src, int stride)
static void FUNCC() pred8x8_plane (uint8_t *_src, int _stride)
static void FUNCC() pred8x8l_128_dc (uint8_t *_src, int has_topleft, int has_topright, int _stride)
static void FUNCC() pred8x8l_left_dc (uint8_t *_src, int has_topleft, int has_topright, int _stride)
static void FUNCC() pred8x8l_top_dc (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred8x8l_dc (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred8x8l_horizontal (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred8x8l_vertical (uint8_t *_src, int has_topleft, int has_topright, int _stride)
static void FUNCC() pred8x8l_down_left (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred8x8l_down_right (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred8x8l_vertical_right (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred8x8l_horizontal_down (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred8x8l_vertical_left (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred8x8l_horizontal_up (uint8_t *p_src, int has_topleft, int has_topright, int p_stride)
static void FUNCC() pred4x4_vertical_add (uint8_t *p_pix, const DCTELEM *p_block, int stride)
static void FUNCC() pred4x4_horizontal_add (uint8_t *p_pix, const DCTELEM *p_block, int stride)
static void FUNCC() pred8x8l_vertical_add (uint8_t *p_pix, const DCTELEM *p_block, int stride)
static void FUNCC() pred8x8l_horizontal_add (uint8_t *p_pix, const DCTELEM *p_block, int stride)
static void FUNCC() pred16x16_vertical_add (uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride)
static void FUNCC() pred16x16_horizontal_add (uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride)
static void FUNCC() pred8x8_vertical_add (uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride)
static void FUNCC() pred8x8_horizontal_add (uint8_t *pix, const int *block_offset, const DCTELEM *block, int stride)


Detailed Description

H.264 / AVC / MPEG4 part10 prediction functions.

Author:
Michael Niedermayer <michaelni@gmx.at>

Definition in file h264pred_template.c.


Define Documentation

#define LOAD_DOWN_LEFT_EDGE

Value:

const unsigned av_unused l4 = src[-1+4*stride];\
    const unsigned av_unused l5 = src[-1+5*stride];\
    const unsigned av_unused l6 = src[-1+6*stride];\
    const unsigned av_unused l7 = src[-1+7*stride];\

Definition at line 128 of file h264pred_template.c.

Referenced by pred4x4_down_left_rv40_c(), pred4x4_horizontal_up_rv40_c(), and pred4x4_vertical_left_rv40_c().

#define LOAD_LEFT_EDGE

#define LOAD_TOP_EDGE

#define LOAD_TOP_RIGHT_EDGE

#define PL (  )     const int l##y = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;

Definition at line 621 of file h264pred_template.c.

Referenced by reverse_dc_prediction().

#define PRED16x16_X ( n,
 ) 

Value:

static void FUNCC(pred16x16_##n##_dc)(uint8_t *_src, int stride){\
    int i;\
    pixel *src = (pixel*)_src;\
    stride >>= sizeof(pixel)-1;\
    PREDICT_16x16_DC(PIXEL_SPLAT_X4(v));\
}

Definition at line 382 of file h264pred_template.c.

#define PRED8x8_X ( n,
 ) 

Value:

static void FUNCC(pred8x8_##n##_dc)(uint8_t *_src, int stride){\
    int i;\
    const pixel4 a = PIXEL_SPLAT_X4(v);\
    pixel *src = (pixel*)_src;\
    stride >>= sizeof(pixel)-1;\
    for(i=0; i<8; i++){\
        AV_WN4PA(((pixel4*)(src+i*stride))+0, a);\
        AV_WN4PA(((pixel4*)(src+i*stride))+1, a);\
    }\
}

Definition at line 468 of file h264pred_template.c.

#define PREDICT_16x16_DC (  ) 

Value:

for(i=0; i<16; i++){\
        AV_WN4PA(src+ 0, v);\
        AV_WN4PA(src+ 4, v);\
        AV_WN4PA(src+ 8, v);\
        AV_WN4PA(src+12, v);\
        src += stride;\
    }

Definition at line 327 of file h264pred_template.c.

Referenced by pred16x16_dc(), pred16x16_left_dc(), and pred16x16_top_dc().

#define PREDICT_8x8_DC (  ) 

Value:

int y; \
    for( y = 0; y < 8; y++ ) { \
        AV_WN4PA(((pixel4*)src)+0, v); \
        AV_WN4PA(((pixel4*)src)+1, v); \
        src += stride; \
    }

Definition at line 650 of file h264pred_template.c.

Referenced by pred8x8l_128_dc(), pred8x8l_dc(), pred8x8l_left_dc(), and pred8x8l_top_dc().

#define PREDICT_8x8_LOAD_LEFT

Value:

const int l0 = ((has_topleft ? SRC(-1,-1) : SRC(-1,0)) \
                     + 2*SRC(-1,0) + SRC(-1,1) + 2) >> 2; \
    PL(1) PL(2) PL(3) PL(4) PL(5) PL(6) \
    const int l7 av_unused = (SRC(-1,6) + 3*SRC(-1,7) + 2) >> 2

Definition at line 623 of file h264pred_template.c.

Referenced by pred8x8l_dc(), pred8x8l_down_right(), pred8x8l_horizontal(), pred8x8l_horizontal_down(), pred8x8l_horizontal_up(), pred8x8l_left_dc(), and pred8x8l_vertical_right().

#define PREDICT_8x8_LOAD_TOP

Value:

const int t0 = ((has_topleft ? SRC(-1,-1) : SRC(0,-1)) \
                     + 2*SRC(0,-1) + SRC(1,-1) + 2) >> 2; \
    PT(1) PT(2) PT(3) PT(4) PT(5) PT(6) \
    const int t7 av_unused = ((has_topright ? SRC(8,-1) : SRC(7,-1)) \
                     + 2*SRC(7,-1) + SRC(6,-1) + 2) >> 2

Definition at line 631 of file h264pred_template.c.

Referenced by pred8x8l_dc(), pred8x8l_down_left(), pred8x8l_down_right(), pred8x8l_horizontal_down(), pred8x8l_top_dc(), pred8x8l_vertical(), pred8x8l_vertical_left(), and pred8x8l_vertical_right().

#define PREDICT_8x8_LOAD_TOPLEFT   const int lt = (SRC(-1,0) + 2*SRC(-1,-1) + SRC(0,-1) + 2) >> 2

#define PREDICT_8x8_LOAD_TOPRIGHT

Value:

int t8, t9, t10, t11, t12, t13, t14, t15; \
    if(has_topright) { \
        PTR(8) PTR(9) PTR(10) PTR(11) PTR(12) PTR(13) PTR(14) \
        t15 = (SRC(14,-1) + 3*SRC(15,-1) + 2) >> 2; \
    } else t8=t9=t10=t11=t12=t13=t14=t15= SRC(7,-1);

Definition at line 640 of file h264pred_template.c.

Referenced by pred8x8l_down_left(), and pred8x8l_vertical_left().

#define PT (  )     const int t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;

Definition at line 629 of file h264pred_template.c.

#define PTR (  )     t##x = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;

Definition at line 638 of file h264pred_template.c.

#define ROW (  ) 

Value:

a = PIXEL_SPLAT_X4(l##y); \
               AV_WN4PA(src+y*stride, a); \
               AV_WN4PA(src+y*stride+4, a);

Referenced by pred8x8l_horizontal().

#define SRC ( x,
 )     src[(x)+(y)*stride]


Function Documentation

static void FUNCC() pred16x16_dc ( uint8_t *  _src,
int  stride 
) [static]

Definition at line 336 of file h264pred_template.c.

static void FUNCC() pred16x16_horizontal ( uint8_t *  _src,
int  stride 
) [static]

Definition at line 312 of file h264pred_template.c.

static void FUNCC() pred16x16_horizontal_add ( uint8_t *  pix,
const int *  block_offset,
const DCTELEM block,
int  stride 
) [static]

Definition at line 978 of file h264pred_template.c.

static void FUNCC() pred16x16_left_dc ( uint8_t *  _src,
int  stride 
) [static]

Definition at line 354 of file h264pred_template.c.

static void FUNCC() pred16x16_plane ( uint8_t *  src,
int  stride 
) [static]

Definition at line 439 of file h264pred_template.c.

static void FUNCC() pred16x16_plane_compat ( uint8_t *  p_src,
int  p_stride,
const int  svq3,
const int  rv40 
) [inline, static]

Definition at line 394 of file h264pred_template.c.

Referenced by pred16x16_plane().

static void FUNCC() pred16x16_top_dc ( uint8_t *  _src,
int  stride 
) [static]

Definition at line 368 of file h264pred_template.c.

static void FUNCC() pred16x16_vertical ( uint8_t *  _src,
int  _stride 
) [static]

Definition at line 295 of file h264pred_template.c.

static void FUNCC() pred16x16_vertical_add ( uint8_t *  pix,
const int *  block_offset,
const DCTELEM block,
int  stride 
) [static]

Definition at line 972 of file h264pred_template.c.

PRED16x16_X ( 129  ,
(1<<(BIT_DEPTH-1))+  1 
)

PRED16x16_X ( 128  ,
(1<<(BIT_DEPTH-1))+  0 
)

PRED16x16_X ( 127  ,
(1<<(BIT_DEPTH-1))-  1 
)

static void FUNCC() pred4x4_127_dc ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 99 of file h264pred_template.c.

static void FUNCC() pred4x4_128_dc ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 88 of file h264pred_template.c.

Referenced by pred8x8_mad_cow_dc_0l0(), and pred8x8_mad_cow_dc_l00().

static void FUNCC() pred4x4_129_dc ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 110 of file h264pred_template.c.

static void FUNCC() pred4x4_dc ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 51 of file h264pred_template.c.

Referenced by pred8x8_mad_cow_dc_l0t().

static void FUNCC() pred4x4_down_left ( uint8_t *  _src,
const uint8_t *  _topright,
int  _stride 
) [static]

Definition at line 171 of file h264pred_template.c.

static void FUNCC() pred4x4_down_right ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 146 of file h264pred_template.c.

static void FUNCC() pred4x4_horizontal ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 42 of file h264pred_template.c.

static void FUNCC() pred4x4_horizontal_add ( uint8_t *  p_pix,
const DCTELEM p_block,
int  stride 
) [static]

Definition at line 915 of file h264pred_template.c.

Referenced by pred16x16_horizontal_add(), and pred8x8_horizontal_add().

static void FUNCC() pred4x4_horizontal_down ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 270 of file h264pred_template.c.

static void FUNCC() pred4x4_horizontal_up ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 247 of file h264pred_template.c.

static void FUNCC() pred4x4_left_dc ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 64 of file h264pred_template.c.

static void FUNCC() pred4x4_top_dc ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 76 of file h264pred_template.c.

Referenced by pred8x8_mad_cow_dc_0lt().

static void FUNCC() pred4x4_vertical ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 31 of file h264pred_template.c.

static void FUNCC() pred4x4_vertical_add ( uint8_t *  p_pix,
const DCTELEM p_block,
int  stride 
) [static]

Definition at line 898 of file h264pred_template.c.

Referenced by pred16x16_vertical_add(), and pred8x8_vertical_add().

static void FUNCC() pred4x4_vertical_left ( uint8_t *  _src,
const uint8_t *  _topright,
int  _stride 
) [static]

Definition at line 222 of file h264pred_template.c.

static void FUNCC() pred4x4_vertical_right ( uint8_t *  _src,
const uint8_t *  topright,
int  _stride 
) [static]

Definition at line 197 of file h264pred_template.c.

static void FUNCC() pred8x8_dc ( uint8_t *  _src,
int  stride 
) [static]

Definition at line 534 of file h264pred_template.c.

Referenced by pred8x8_mad_cow_dc_0lt().

static void FUNCC() pred8x8_horizontal ( uint8_t *  _src,
int  stride 
) [static]

Definition at line 456 of file h264pred_template.c.

static void FUNCC() pred8x8_horizontal_add ( uint8_t *  pix,
const int *  block_offset,
const DCTELEM block,
int  stride 
) [static]

Definition at line 990 of file h264pred_template.c.

static void FUNCC() pred8x8_left_dc ( uint8_t *  _src,
int  stride 
) [static]

Definition at line 484 of file h264pred_template.c.

Referenced by pred8x8_mad_cow_dc_0l0(), and pred8x8_mad_cow_dc_l00().

static void FUNC() pred8x8_mad_cow_dc_0l0 ( uint8_t *  src,
int  stride 
) [static]

Definition at line 579 of file h264pred_template.c.

static void FUNC() pred8x8_mad_cow_dc_0lt ( uint8_t *  src,
int  stride 
) [static]

Definition at line 568 of file h264pred_template.c.

static void FUNC() pred8x8_mad_cow_dc_l00 ( uint8_t *  src,
int  stride 
) [static]

Definition at line 573 of file h264pred_template.c.

static void FUNC() pred8x8_mad_cow_dc_l0t ( uint8_t *  src,
int  stride 
) [static]

Definition at line 563 of file h264pred_template.c.

static void FUNCC() pred8x8_plane ( uint8_t *  _src,
int  _stride 
) [static]

Definition at line 585 of file h264pred_template.c.

static void FUNCC() pred8x8_top_dc ( uint8_t *  _src,
int  stride 
) [static]

Definition at line 509 of file h264pred_template.c.

Referenced by pred8x8_mad_cow_dc_l0t().

static void FUNCC() pred8x8_vertical ( uint8_t *  _src,
int  _stride 
) [static]

Definition at line 443 of file h264pred_template.c.

static void FUNCC() pred8x8_vertical_add ( uint8_t *  pix,
const int *  block_offset,
const DCTELEM block,
int  stride 
) [static]

Definition at line 984 of file h264pred_template.c.

PRED8x8_X ( 129  ,
(1<<(BIT_DEPTH-1))+  1 
)

PRED8x8_X ( 128  ,
(1<<(BIT_DEPTH-1))+  0 
)

PRED8x8_X ( 127  ,
(1<<(BIT_DEPTH-1))-  1 
)

static void FUNCC() pred8x8l_128_dc ( uint8_t *  _src,
int  has_topleft,
int  has_topright,
int  _stride 
) [static]

Definition at line 658 of file h264pred_template.c.

static void FUNCC() pred8x8l_dc ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 683 of file h264pred_template.c.

static void FUNCC() pred8x8l_down_left ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 730 of file h264pred_template.c.

static void FUNCC() pred8x8l_down_right ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 752 of file h264pred_template.c.

static void FUNCC() pred8x8l_horizontal ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 694 of file h264pred_template.c.

static void FUNCC() pred8x8l_horizontal_add ( uint8_t *  p_pix,
const DCTELEM p_block,
int  stride 
) [static]

Definition at line 952 of file h264pred_template.c.

static void FUNCC() pred8x8l_horizontal_down ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 805 of file h264pred_template.c.

static void FUNCC() pred8x8l_horizontal_up ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 864 of file h264pred_template.c.

static void FUNCC() pred8x8l_left_dc ( uint8_t *  _src,
int  has_topleft,
int  has_topright,
int  _stride 
) [static]

Definition at line 665 of file h264pred_template.c.

static void FUNCC() pred8x8l_top_dc ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 674 of file h264pred_template.c.

static void FUNCC() pred8x8l_vertical ( uint8_t *  _src,
int  has_topleft,
int  has_topright,
int  _stride 
) [static]

Definition at line 707 of file h264pred_template.c.

static void FUNCC() pred8x8l_vertical_add ( uint8_t *  p_pix,
const DCTELEM p_block,
int  stride 
) [static]

Definition at line 931 of file h264pred_template.c.

static void FUNCC() pred8x8l_vertical_left ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 835 of file h264pred_template.c.

static void FUNCC() pred8x8l_vertical_right ( uint8_t *  p_src,
int  has_topleft,
int  has_topright,
int  p_stride 
) [static]

Definition at line 775 of file h264pred_template.c.


Generated on Fri Oct 26 02:38:16 2012 for FFmpeg by  doxygen 1.5.8