libavcodec/h264pred.c File Reference

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

#include "avcodec.h"
#include "mpegvideo.h"
#include "h264pred.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 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 pred4x4_vertical_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_horizontal_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_dc_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_left_dc_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_top_dc_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_128_dc_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_down_right_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_down_left_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_down_left_svq3_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_down_left_rv40_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_down_left_rv40_notop_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_down_left_rv40_nodown_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_vertical_right_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_vertical_left_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_vertical_left_rv40 (uint8_t *src, uint8_t *topright, int stride, const int l0, const int l1, const int l2, const int l3, const int l4)
static void pred4x4_vertical_left_rv40_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_vertical_left_rv40_nodown_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_horizontal_up_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_horizontal_up_rv40_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_horizontal_up_rv40_nodown_c (uint8_t *src, uint8_t *topright, int stride)
static void pred4x4_horizontal_down_c (uint8_t *src, uint8_t *topright, int stride)
static void pred16x16_vertical_c (uint8_t *src, int stride)
static void pred16x16_horizontal_c (uint8_t *src, int stride)
static void pred16x16_dc_c (uint8_t *src, int stride)
static void pred16x16_left_dc_c (uint8_t *src, int stride)
static void pred16x16_top_dc_c (uint8_t *src, int stride)
static void pred16x16_128_dc_c (uint8_t *src, int stride)
static void pred16x16_plane_compat_c (uint8_t *src, int stride, const int svq3, const int rv40)
static void pred16x16_plane_c (uint8_t *src, int stride)
static void pred16x16_plane_svq3_c (uint8_t *src, int stride)
static void pred16x16_plane_rv40_c (uint8_t *src, int stride)
static void pred8x8_vertical_c (uint8_t *src, int stride)
static void pred8x8_horizontal_c (uint8_t *src, int stride)
static void pred8x8_128_dc_c (uint8_t *src, int stride)
static void pred8x8_left_dc_c (uint8_t *src, int stride)
static void pred8x8_left_dc_rv40_c (uint8_t *src, int stride)
static void pred8x8_top_dc_c (uint8_t *src, int stride)
static void pred8x8_top_dc_rv40_c (uint8_t *src, int stride)
static void pred8x8_dc_c (uint8_t *src, int stride)
static void pred8x8_dc_rv40_c (uint8_t *src, int stride)
static void pred8x8_plane_c (uint8_t *src, int stride)
static void pred8x8l_128_dc_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_left_dc_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_top_dc_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_dc_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_horizontal_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_vertical_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_down_left_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_down_right_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_vertical_right_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_horizontal_down_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_vertical_left_c (uint8_t *src, int has_topleft, int has_topright, int stride)
static void pred8x8l_horizontal_up_c (uint8_t *src, int has_topleft, int has_topright, int stride)
void ff_h264_pred_init (H264PredContext *h, int codec_id)
 Sets the intra prediction function pointers.


Detailed Description

H.264 / AVC / MPEG4 part10 prediction functions.

Author:
Michael Niedermayer <michaelni@gmx.at>

Definition in file h264pred.c.


Define Documentation

#define LOAD_DOWN_LEFT_EDGE

Value:

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

Definition at line 89 of file h264pred.c.

Referenced by pred4x4_down_left_rv40_c(), pred4x4_down_left_rv40_notop_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

Value:

const int av_unused t4= topright[0];\
    const int av_unused t5= topright[1];\
    const int av_unused t6= topright[2];\
    const int av_unused t7= topright[3];\

Definition at line 83 of file h264pred.c.

Referenced by pred4x4_down_left_c(), pred4x4_down_left_rv40_c(), pred4x4_down_left_rv40_nodown_c(), pred4x4_horizontal_up_rv40_c(), pred4x4_horizontal_up_rv40_nodown_c(), pred4x4_vertical_left_c(), and pred4x4_vertical_left_rv40().

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

Definition at line 748 of file h264pred.c.

Referenced by reverse_dc_prediction().

#define PREDICT_8x8_DC (  ) 

Value:

int y; \
    for( y = 0; y < 8; y++ ) { \
        ((uint32_t*)src)[0] = \
        ((uint32_t*)src)[1] = v; \
        src += stride; \
    }

Definition at line 777 of file h264pred.c.

Referenced by pred8x8l_128_dc_c(), pred8x8l_dc_c(), pred8x8l_left_dc_c(), and pred8x8l_top_dc_c().

#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 750 of file h264pred.c.

Referenced by pred8x8l_dc_c(), pred8x8l_down_right_c(), pred8x8l_horizontal_c(), pred8x8l_horizontal_down_c(), pred8x8l_horizontal_up_c(), pred8x8l_left_dc_c(), and pred8x8l_vertical_right_c().

#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 758 of file h264pred.c.

Referenced by pred8x8l_dc_c(), pred8x8l_down_left_c(), pred8x8l_down_right_c(), pred8x8l_horizontal_down_c(), pred8x8l_top_dc_c(), pred8x8l_vertical_c(), pred8x8l_vertical_left_c(), and pred8x8l_vertical_right_c().

#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 767 of file h264pred.c.

Referenced by pred8x8l_down_left_c(), and pred8x8l_vertical_left_c().

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

Definition at line 756 of file h264pred.c.

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

Definition at line 765 of file h264pred.c.

#define ROW (  ) 

Value:

((uint32_t*)(src+y*stride))[0] =\
               ((uint32_t*)(src+y*stride))[1] = 0x01010101 * l##y

Referenced by pred8x8l_horizontal_c().

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


Function Documentation

void ff_h264_pred_init ( H264PredContext h,
int  codec_id 
)

Sets the intra prediction function pointers.

Definition at line 992 of file h264pred.c.

Referenced by clone_tables(), common_init(), and ff_rv34_decode_init().

static void pred16x16_128_dc_c ( uint8_t src,
int  stride 
) [static]

Definition at line 498 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred16x16_dc_c ( uint8_t src,
int  stride 
) [static]

Definition at line 444 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred16x16_horizontal_c ( uint8_t src,
int  stride 
) [static]

Definition at line 433 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred16x16_left_dc_c ( uint8_t src,
int  stride 
) [static]

Definition at line 465 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred16x16_plane_c ( uint8_t src,
int  stride 
) [static]

Definition at line 552 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred16x16_plane_compat_c ( uint8_t src,
int  stride,
const int  svq3,
const int  rv40 
) [inline, static]

Definition at line 509 of file h264pred.c.

Referenced by pred16x16_plane_c(), pred16x16_plane_rv40_c(), and pred16x16_plane_svq3_c().

static void pred16x16_plane_rv40_c ( uint8_t src,
int  stride 
) [static]

Definition at line 560 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred16x16_plane_svq3_c ( uint8_t src,
int  stride 
) [static]

Definition at line 556 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred16x16_top_dc_c ( uint8_t src,
int  stride 
) [static]

Definition at line 482 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred16x16_vertical_c ( uint8_t src,
int  stride 
) [static]

Definition at line 418 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_128_dc_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 75 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_dc_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 47 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_down_left_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 130 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_down_left_rv40_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 177 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_down_left_rv40_nodown_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 223 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_down_left_rv40_notop_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 201 of file h264pred.c.

static void pred4x4_down_left_svq3_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 153 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_down_right_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 107 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_horizontal_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 40 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_horizontal_down_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 395 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_horizontal_up_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 327 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_horizontal_up_rv40_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 348 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_horizontal_up_rv40_nodown_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 372 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_left_dc_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 57 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_top_dc_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 66 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_vertical_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 32 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_vertical_left_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 269 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_vertical_left_rv40 ( uint8_t src,
uint8_t topright,
int  stride,
const int  l0,
const int  l1,
const int  l2,
const int  l3,
const int  l4 
) [static]

static void pred4x4_vertical_left_rv40_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 314 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_vertical_left_rv40_nodown_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 321 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred4x4_vertical_right_c ( uint8_t src,
uint8_t topright,
int  stride 
) [static]

Definition at line 246 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_128_dc_c ( uint8_t src,
int  stride 
) [static]

Definition at line 584 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_dc_c ( uint8_t src,
int  stride 
) [static]

Definition at line 668 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_dc_rv40_c ( uint8_t src,
int  stride 
) [static]

Definition at line 693 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_horizontal_c ( uint8_t src,
int  stride 
) [static]

Definition at line 575 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_left_dc_c ( uint8_t src,
int  stride 
) [static]

Definition at line 593 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_left_dc_rv40_c ( uint8_t src,
int  stride 
) [static]

Definition at line 615 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_plane_c ( uint8_t src,
int  stride 
) [static]

Definition at line 714 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_top_dc_c ( uint8_t src,
int  stride 
) [static]

Definition at line 630 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_top_dc_rv40_c ( uint8_t src,
int  stride 
) [static]

Definition at line 652 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8_vertical_c ( uint8_t src,
int  stride 
) [static]

Definition at line 564 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_128_dc_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 785 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_dc_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 801 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_down_left_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 832 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_down_right_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 852 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_horizontal_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 809 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_horizontal_down_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 902 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_horizontal_up_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 957 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_left_dc_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 789 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_top_dc_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 795 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_vertical_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 817 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_vertical_left_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 930 of file h264pred.c.

Referenced by ff_h264_pred_init().

static void pred8x8l_vertical_right_c ( uint8_t src,
int  has_topleft,
int  has_topright,
int  stride 
) [static]

Definition at line 874 of file h264pred.c.

Referenced by ff_h264_pred_init().


Generated on Fri Oct 3 22:46:56 2008 for ffmpeg by  doxygen 1.5.6