Commit ac49761a authored by Loren Merritt's avatar Loren Merritt

cosmetics in intra predict

parent 5442dafd
......@@ -360,13 +360,11 @@ static void predict_8x8c_p( uint8_t *src )
* 4x4 prediction for intra luma block
****************************************************************************/
#define PREDICT_4x4_DC(v) \
{\
*(uint32_t*)&src[0*FDEC_STRIDE] =\
*(uint32_t*)&src[1*FDEC_STRIDE] =\
*(uint32_t*)&src[2*FDEC_STRIDE] =\
*(uint32_t*)&src[3*FDEC_STRIDE] = v;\
}
#define SRC(x,y) src[(x)+(y)*FDEC_STRIDE]
#define SRC32(x,y) *(uint32_t*)&SRC(x,y)
#define PREDICT_4x4_DC(v)\
SRC32(0,0) = SRC32(0,1) = SRC32(0,2) = SRC32(0,3) = v;
static void predict_4x4_dc_128( uint8_t *src )
{
......@@ -374,228 +372,150 @@ static void predict_4x4_dc_128( uint8_t *src )
}
static void predict_4x4_dc_left( uint8_t *src )
{
uint32_t dc = (( src[-1+0*FDEC_STRIDE] + src[-1+FDEC_STRIDE]+
src[-1+2*FDEC_STRIDE] + src[-1+3*FDEC_STRIDE] + 2 ) >> 2)*0x01010101;
uint32_t dc = ((SRC(-1,0) + SRC(-1,1) + SRC(-1,2) + SRC(-1,3) + 2) >> 2) * 0x01010101;
PREDICT_4x4_DC(dc);
}
static void predict_4x4_dc_top( uint8_t *src )
{
uint32_t dc = (( src[0 - FDEC_STRIDE] + src[1 - FDEC_STRIDE] +
src[2 - FDEC_STRIDE] + src[3 - FDEC_STRIDE] + 2 ) >> 2)*0x01010101;
uint32_t dc = ((SRC(0,-1) + SRC(1,-1) + SRC(2,-1) + SRC(3,-1) + 2) >> 2) * 0x01010101;
PREDICT_4x4_DC(dc);
}
static void predict_4x4_dc( uint8_t *src )
{
uint32_t dc = (( src[-1+0*FDEC_STRIDE] + src[-1+FDEC_STRIDE] +
src[-1+2*FDEC_STRIDE] + src[-1+3*FDEC_STRIDE] +
src[0 - FDEC_STRIDE] + src[1 - FDEC_STRIDE] +
src[2 - FDEC_STRIDE] + src[3 - FDEC_STRIDE] + 4 ) >> 3)*0x01010101;
uint32_t dc = ((SRC(-1,0) + SRC(-1,1) + SRC(-1,2) + SRC(-1,3) +
SRC(0,-1) + SRC(1,-1) + SRC(2,-1) + SRC(3,-1) + 4) >> 3) * 0x01010101;
PREDICT_4x4_DC(dc);
}
static void predict_4x4_h( uint8_t *src )
{
*(uint32_t*)&src[0*FDEC_STRIDE] = src[0*FDEC_STRIDE-1] * 0x01010101;
*(uint32_t*)&src[1*FDEC_STRIDE] = src[1*FDEC_STRIDE-1] * 0x01010101;
*(uint32_t*)&src[2*FDEC_STRIDE] = src[2*FDEC_STRIDE-1] * 0x01010101;
*(uint32_t*)&src[3*FDEC_STRIDE] = src[3*FDEC_STRIDE-1] * 0x01010101;
SRC32(0,0) = SRC(-1,0) * 0x01010101;
SRC32(0,1) = SRC(-1,1) * 0x01010101;
SRC32(0,2) = SRC(-1,2) * 0x01010101;
SRC32(0,3) = SRC(-1,3) * 0x01010101;
}
static void predict_4x4_v( uint8_t *src )
{
uint32_t top = *((uint32_t*)&src[-FDEC_STRIDE]);
PREDICT_4x4_DC(top);
PREDICT_4x4_DC(SRC32(0,-1));
}
#define PREDICT_4x4_LOAD_LEFT \
const int l0 = src[-1+0*FDEC_STRIDE]; \
const int l1 = src[-1+1*FDEC_STRIDE]; \
const int l2 = src[-1+2*FDEC_STRIDE]; \
UNUSED const int l3 = src[-1+3*FDEC_STRIDE];
#define PREDICT_4x4_LOAD_LEFT\
const int l0 = SRC(-1,0);\
const int l1 = SRC(-1,1);\
const int l2 = SRC(-1,2);\
UNUSED const int l3 = SRC(-1,3);
#define PREDICT_4x4_LOAD_TOP\
const int t0 = SRC(0,-1);\
const int t1 = SRC(1,-1);\
const int t2 = SRC(2,-1);\
UNUSED const int t3 = SRC(3,-1);
#define PREDICT_4x4_LOAD_TOP \
const int t0 = src[0-1*FDEC_STRIDE]; \
const int t1 = src[1-1*FDEC_STRIDE]; \
const int t2 = src[2-1*FDEC_STRIDE]; \
UNUSED const int t3 = src[3-1*FDEC_STRIDE];
#define PREDICT_4x4_LOAD_TOP_RIGHT\
const int t4 = SRC(4,-1);\
const int t5 = SRC(5,-1);\
const int t6 = SRC(6,-1);\
UNUSED const int t7 = SRC(7,-1);
#define PREDICT_4x4_LOAD_TOP_RIGHT \
const int t4 = src[4-1*FDEC_STRIDE]; \
const int t5 = src[5-1*FDEC_STRIDE]; \
const int t6 = src[6-1*FDEC_STRIDE]; \
UNUSED const int t7 = src[7-1*FDEC_STRIDE];
#define F1(a,b) (((a)+(b)+1)>>1)
#define F2(a,b,c) (((a)+2*(b)+(c)+2)>>2)
static void predict_4x4_ddl( uint8_t *src )
{
PREDICT_4x4_LOAD_TOP
PREDICT_4x4_LOAD_TOP_RIGHT
src[0*FDEC_STRIDE+0] = ( t0 + 2*t1 + t2 + 2 ) >> 2;
src[0*FDEC_STRIDE+1] =
src[1*FDEC_STRIDE+0] = ( t1 + 2*t2 + t3 + 2 ) >> 2;
src[0*FDEC_STRIDE+2] =
src[1*FDEC_STRIDE+1] =
src[2*FDEC_STRIDE+0] = ( t2 + 2*t3 + t4 + 2 ) >> 2;
src[0*FDEC_STRIDE+3] =
src[1*FDEC_STRIDE+2] =
src[2*FDEC_STRIDE+1] =
src[3*FDEC_STRIDE+0] = ( t3 + 2*t4 + t5 + 2 ) >> 2;
src[1*FDEC_STRIDE+3] =
src[2*FDEC_STRIDE+2] =
src[3*FDEC_STRIDE+1] = ( t4 + 2*t5 + t6 + 2 ) >> 2;
src[2*FDEC_STRIDE+3] =
src[3*FDEC_STRIDE+2] = ( t5 + 2*t6 + t7 + 2 ) >> 2;
src[3*FDEC_STRIDE+3] = ( t6 + 3*t7 + 2 ) >> 2;
SRC(0,0)= F2(t0,t1,t2);
SRC(1,0)=SRC(0,1)= F2(t1,t2,t3);
SRC(2,0)=SRC(1,1)=SRC(0,2)= F2(t2,t3,t4);
SRC(3,0)=SRC(2,1)=SRC(1,2)=SRC(0,3)= F2(t3,t4,t5);
SRC(3,1)=SRC(2,2)=SRC(1,3)= F2(t4,t5,t6);
SRC(3,2)=SRC(2,3)= F2(t5,t6,t7);
SRC(3,3)= F2(t6,t7,t7);
}
static void predict_4x4_ddr( uint8_t *src )
{
const int lt = src[-1-FDEC_STRIDE];
const int lt = SRC(-1,-1);
PREDICT_4x4_LOAD_LEFT
PREDICT_4x4_LOAD_TOP
src[0*FDEC_STRIDE+0] =
src[1*FDEC_STRIDE+1] =
src[2*FDEC_STRIDE+2] =
src[3*FDEC_STRIDE+3] = ( t0 + 2 * lt + l0 + 2 ) >> 2;
src[0*FDEC_STRIDE+1] =
src[1*FDEC_STRIDE+2] =
src[2*FDEC_STRIDE+3] = ( lt + 2 * t0 + t1 + 2 ) >> 2;
src[0*FDEC_STRIDE+2] =
src[1*FDEC_STRIDE+3] = ( t0 + 2 * t1 + t2 + 2 ) >> 2;
src[0*FDEC_STRIDE+3] = ( t1 + 2 * t2 + t3 + 2 ) >> 2;
src[1*FDEC_STRIDE+0] =
src[2*FDEC_STRIDE+1] =
src[3*FDEC_STRIDE+2] = ( lt + 2 * l0 + l1 + 2 ) >> 2;
src[2*FDEC_STRIDE+0] =
src[3*FDEC_STRIDE+1] = ( l0 + 2 * l1 + l2 + 2 ) >> 2;
src[3*FDEC_STRIDE+0] = ( l1 + 2 * l2 + l3 + 2 ) >> 2;
SRC(3,0)= F2(t3,t2,t1);
SRC(2,0)=SRC(3,1)= F2(t2,t1,t0);
SRC(1,0)=SRC(2,1)=SRC(3,2)= F2(t1,t0,lt);
SRC(0,0)=SRC(1,1)=SRC(2,2)=SRC(3,3)= F2(t0,lt,l0);
SRC(0,1)=SRC(1,2)=SRC(2,3)= F2(lt,l0,l1);
SRC(0,2)=SRC(1,3)= F2(l0,l1,l2);
SRC(0,3)= F2(l1,l2,l3);
}
static void predict_4x4_vr( uint8_t *src )
{
const int lt = src[-1-FDEC_STRIDE];
const int lt = SRC(-1,-1);
PREDICT_4x4_LOAD_LEFT
PREDICT_4x4_LOAD_TOP
src[0*FDEC_STRIDE+0]=
src[2*FDEC_STRIDE+1]= ( lt + t0 + 1 ) >> 1;
src[0*FDEC_STRIDE+1]=
src[2*FDEC_STRIDE+2]= ( t0 + t1 + 1 ) >> 1;
src[0*FDEC_STRIDE+2]=
src[2*FDEC_STRIDE+3]= ( t1 + t2 + 1 ) >> 1;
src[0*FDEC_STRIDE+3]= ( t2 + t3 + 1 ) >> 1;
src[1*FDEC_STRIDE+0]=
src[3*FDEC_STRIDE+1]= ( l0 + 2 * lt + t0 + 2 ) >> 2;
src[1*FDEC_STRIDE+1]=
src[3*FDEC_STRIDE+2]= ( lt + 2 * t0 + t1 + 2 ) >> 2;
src[1*FDEC_STRIDE+2]=
src[3*FDEC_STRIDE+3]= ( t0 + 2 * t1 + t2 + 2) >> 2;
src[1*FDEC_STRIDE+3]= ( t1 + 2 * t2 + t3 + 2 ) >> 2;
src[2*FDEC_STRIDE+0]= ( lt + 2 * l0 + l1 + 2 ) >> 2;
src[3*FDEC_STRIDE+0]= ( l0 + 2 * l1 + l2 + 2 ) >> 2;
SRC(0,3)= F2(l2,l1,l0);
SRC(0,2)= F2(l1,l0,lt);
SRC(0,1)=SRC(1,3)= F2(l0,lt,t0);
SRC(0,0)=SRC(1,2)= F1(lt,t0);
SRC(1,1)=SRC(2,3)= F2(lt,t0,t1);
SRC(1,0)=SRC(2,2)= F1(t0,t1);
SRC(2,1)=SRC(3,3)= F2(t0,t1,t2);
SRC(2,0)=SRC(3,2)= F1(t1,t2);
SRC(3,1)= F2(t1,t2,t3);
SRC(3,0)= F1(t2,t3);
}
static void predict_4x4_hd( uint8_t *src )
{
const int lt= src[-1-1*FDEC_STRIDE];
const int lt= SRC(-1,-1);
PREDICT_4x4_LOAD_LEFT
PREDICT_4x4_LOAD_TOP
src[0*FDEC_STRIDE+0]=
src[1*FDEC_STRIDE+2]= ( lt + l0 + 1 ) >> 1;
src[0*FDEC_STRIDE+1]=
src[1*FDEC_STRIDE+3]= ( l0 + 2 * lt + t0 + 2 ) >> 2;
src[0*FDEC_STRIDE+2]= ( lt + 2 * t0 + t1 + 2 ) >> 2;
src[0*FDEC_STRIDE+3]= ( t0 + 2 * t1 + t2 + 2 ) >> 2;
src[1*FDEC_STRIDE+0]=
src[2*FDEC_STRIDE+2]= ( l0 + l1 + 1 ) >> 1;
src[1*FDEC_STRIDE+1]=
src[2*FDEC_STRIDE+3]= ( lt + 2 * l0 + l1 + 2 ) >> 2;
src[2*FDEC_STRIDE+0]=
src[3*FDEC_STRIDE+2]= ( l1 + l2+ 1 ) >> 1;
src[2*FDEC_STRIDE+1]=
src[3*FDEC_STRIDE+3]= ( l0 + 2 * l1 + l2 + 2 ) >> 2;
src[3*FDEC_STRIDE+0]= ( l2 + l3 + 1 ) >> 1;
src[3*FDEC_STRIDE+1]= ( l1 + 2 * l2 + l3 + 2 ) >> 2;
SRC(0,3)= F1(l2,l3);
SRC(1,3)= F2(l1,l2,l3);
SRC(0,2)=SRC(2,3)= F1(l1,l2);
SRC(1,2)=SRC(3,3)= F2(l0,l1,l2);
SRC(0,1)=SRC(2,2)= F1(l0,l1);
SRC(1,1)=SRC(3,2)= F2(lt,l0,l1);
SRC(0,0)=SRC(2,1)= F1(lt,l0);
SRC(1,0)=SRC(3,1)= F2(t0,lt,l0);
SRC(2,0)= F2(t1,t0,lt);
SRC(3,0)= F2(t2,t1,t0);
}
static void predict_4x4_vl( uint8_t *src )
{
PREDICT_4x4_LOAD_TOP
PREDICT_4x4_LOAD_TOP_RIGHT
src[0*FDEC_STRIDE+0]= ( t0 + t1 + 1 ) >> 1;
src[0*FDEC_STRIDE+1]=
src[2*FDEC_STRIDE+0]= ( t1 + t2 + 1 ) >> 1;
src[0*FDEC_STRIDE+2]=
src[2*FDEC_STRIDE+1]= ( t2 + t3 + 1 ) >> 1;
src[0*FDEC_STRIDE+3]=
src[2*FDEC_STRIDE+2]= ( t3 + t4 + 1 ) >> 1;
src[2*FDEC_STRIDE+3]= ( t4 + t5 + 1 ) >> 1;
src[1*FDEC_STRIDE+0]= ( t0 + 2 * t1 + t2 + 2 ) >> 2;
src[1*FDEC_STRIDE+1]=
src[3*FDEC_STRIDE+0]= ( t1 + 2 * t2 + t3 + 2 ) >> 2;
src[1*FDEC_STRIDE+2]=
src[3*FDEC_STRIDE+1]= ( t2 + 2 * t3 + t4 + 2 ) >> 2;
src[1*FDEC_STRIDE+3]=
src[3*FDEC_STRIDE+2]= ( t3 + 2 * t4 + t5 + 2 ) >> 2;
src[3*FDEC_STRIDE+3]= ( t4 + 2 * t5 + t6 + 2 ) >> 2;
SRC(0,0)= F1(t0,t1);
SRC(0,1)= F2(t0,t1,t2);
SRC(1,0)=SRC(0,2)= F1(t1,t2);
SRC(1,1)=SRC(0,3)= F2(t1,t2,t3);
SRC(2,0)=SRC(1,2)= F1(t2,t3);
SRC(2,1)=SRC(1,3)= F2(t2,t3,t4);
SRC(3,0)=SRC(2,2)= F1(t3,t4);
SRC(3,1)=SRC(2,3)= F2(t3,t4,t5);
SRC(3,2)= F1(t4,t5);
SRC(3,3)= F2(t4,t5,t6);
}
static void predict_4x4_hu( uint8_t *src )
{
PREDICT_4x4_LOAD_LEFT
src[0*FDEC_STRIDE+0]= ( l0 + l1 + 1 ) >> 1;
src[0*FDEC_STRIDE+1]= ( l0 + 2 * l1 + l2 + 2 ) >> 2;
src[0*FDEC_STRIDE+2]=
src[1*FDEC_STRIDE+0]= ( l1 + l2 + 1 ) >> 1;
src[0*FDEC_STRIDE+3]=
src[1*FDEC_STRIDE+1]= ( l1 + 2*l2 + l3 + 2 ) >> 2;
src[1*FDEC_STRIDE+2]=
src[2*FDEC_STRIDE+0]= ( l2 + l3 + 1 ) >> 1;
src[1*FDEC_STRIDE+3]=
src[2*FDEC_STRIDE+1]= ( l2 + 2 * l3 + l3 + 2 ) >> 2;
src[2*FDEC_STRIDE+3]=
src[3*FDEC_STRIDE+1]=
src[3*FDEC_STRIDE+0]=
src[2*FDEC_STRIDE+2]=
src[3*FDEC_STRIDE+2]=
src[3*FDEC_STRIDE+3]= l3;
SRC(0,0)= F1(l0,l1);
SRC(1,0)= F2(l0,l1,l2);
SRC(2,0)=SRC(0,1)= F1(l1,l2);
SRC(3,0)=SRC(1,1)= F2(l1,l2,l3);
SRC(2,1)=SRC(0,2)= F1(l2,l3);
SRC(3,1)=SRC(1,2)= F2(l2,l3,l3);
SRC(3,2)=SRC(1,3)=SRC(0,3)=
SRC(2,2)=SRC(2,3)=SRC(3,3)= l3;
}
/****************************************************************************
* 8x8 prediction for intra luma block
****************************************************************************/
#define SRC(x,y) src[(x)+(y)*FDEC_STRIDE]
#define SRC32(x,y) *(uint32_t*)&SRC(x,y)
#define PL(y) \
edge[14-y] = (SRC(-1,y-1) + 2*SRC(-1,y) + SRC(-1,y+1) + 2) >> 2;
edge[14-y] = F2(SRC(-1,y-1), SRC(-1,y), SRC(-1,y+1));
#define PT(x) \
edge[16+x] = (SRC(x-1,-1) + 2*SRC(x,-1) + SRC(x+1,-1) + 2) >> 2;
edge[16+x] = F2(SRC(x-1,-1), SRC(x,-1), SRC(x+1,-1));
void x264_predict_8x8_filter( uint8_t *src, uint8_t edge[33], int i_neighbor, int i_filters )
{
......@@ -708,42 +628,42 @@ static void predict_8x8_ddl( uint8_t *src, uint8_t edge[33] )
{
PREDICT_8x8_LOAD_TOP
PREDICT_8x8_LOAD_TOPRIGHT
SRC(0,0)= (t0 + 2*t1 + t2 + 2) >> 2;
SRC(0,1)=SRC(1,0)= (t1 + 2*t2 + t3 + 2) >> 2;
SRC(0,2)=SRC(1,1)=SRC(2,0)= (t2 + 2*t3 + t4 + 2) >> 2;
SRC(0,3)=SRC(1,2)=SRC(2,1)=SRC(3,0)= (t3 + 2*t4 + t5 + 2) >> 2;
SRC(0,4)=SRC(1,3)=SRC(2,2)=SRC(3,1)=SRC(4,0)= (t4 + 2*t5 + t6 + 2) >> 2;
SRC(0,5)=SRC(1,4)=SRC(2,3)=SRC(3,2)=SRC(4,1)=SRC(5,0)= (t5 + 2*t6 + t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,0)=SRC(5,1)=SRC(6,2)=SRC(7,3)= F2(t2,t3,t4);
SRC(5,0)=SRC(6,1)=SRC(7,2)= F2(t3,t4,t5);
SRC(6,0)=SRC(7,1)= F2(t4,t5,t6);
SRC(7,0)= F2(t5,t6,t7);
}
static void predict_8x8_vr( uint8_t *src, uint8_t edge[33] )
......@@ -751,45 +671,45 @@ static void predict_8x8_vr( uint8_t *src, uint8_t edge[33] )
PREDICT_8x8_LOAD_TOP
PREDICT_8x8_LOAD_LEFT
PREDICT_8x8_LOAD_TOPLEFT
SRC(0,6)= (l5 + 2*l4 + l3 + 2) >> 2;
SRC(0,7)= (l6 + 2*l5 + l4 + 2) >> 2;
SRC(0,4)=SRC(1,6)= (l3 + 2*l2 + l1 + 2) >> 2;
SRC(0,5)=SRC(1,7)= (l4 + 2*l3 + l2 + 2) >> 2;
SRC(0,2)=SRC(1,4)=SRC(2,6)= (l1 + 2*l0 + lt + 2) >> 2;
SRC(0,3)=SRC(1,5)=SRC(2,7)= (l2 + 2*l1 + l0 + 2) >> 2;
SRC(0,1)=SRC(1,3)=SRC(2,5)=SRC(3,7)= (l0 + 2*lt + t0 + 2) >> 2;
SRC(0,0)=SRC(1,2)=SRC(2,4)=SRC(3,6)= (lt + t0 + 1) >> 1;
SRC(1,1)=SRC(2,3)=SRC(3,5)=SRC(4,7)= (lt + 2*t0 + t1 + 2) >> 2;
SRC(1,0)=SRC(2,2)=SRC(3,4)=SRC(4,6)= (t0 + t1 + 1) >> 1;
SRC(2,1)=SRC(3,3)=SRC(4,5)=SRC(5,7)= (t0 + 2*t1 + t2 + 2) >> 2;
SRC(2,0)=SRC(3,2)=SRC(4,4)=SRC(5,6)= (t1 + t2 + 1) >> 1;
SRC(3,1)=SRC(4,3)=SRC(5,5)=SRC(6,7)= (t1 + 2*t2 + t3 + 2) >> 2;
SRC(3,0)=SRC(4,2)=SRC(5,4)=SRC(6,6)= (t2 + t3 + 1) >> 1;
SRC(4,1)=SRC(5,3)=SRC(6,5)=S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
SRC(5,0)=SRC(6,2)=SRC(7,4)= F1(t4,t5);
SRC(6,1)=SRC(7,3)= F2(t4,t5,t6);
SRC(6,0)=SRC(7,2)= F1(t5,t6);
SRC(7,1)= F2(t5,t6,t7);
SRC(7,0)= F1(t6,t7);
}
static void predict_8x8_hd( uint8_t *src, uint8_t edge[33] )
{
PREDICT_8x8_LOAD_TOP
PREDICT_8x8_LOAD_LEFT
PREDICT_8x8_LOAD_TOPLEFT
int p1 = pack8to16((l6 + l7 + 1) >> 1, (l5 + 2*l6 + l7 + 2) >> 2);
int p2 = pack8to16((l5 + l6 + 1) >> 1, (l4 + 2*l5 + l6 + 2) >> 2);
int p3 = pack8to16((l4 + l5 + 1) >> 1, (l3 + 2*l4 + l5 + 2) >> 2);
int p4 = pack8to16((l3 + l4 + 1) >> 1, (l2 + 2*l3 + l4 + 2) >> 2);
int p5 = pack8to16((l2 + l3 + 1) >> 1, (l1 + 2*l2 + l3 + 2) >> 2);
int p6 = pack8to16((l1 + l2 + 1) >> 1, (l0 + 2*l1 + l2 + 2) >> 2);
int p7 = pack8to16((l0 + l1 + 1) >> 1, (lt + 2*l0 + l1 + 2) >> 2);
int p8 = pack8to16((lt + l0 + 1) >> 1, (l0 + 2*lt + t0 + 2) >> 2);
int p9 = pack8to16((t1 + 2*t0 + lt + 2) >> 2, (t2 + 2*t1 + t0 + 2) >> 2);
int p10 = pack8to16((t3 + 2*t2 + t1 + 2) >> 2, (t4 + 2*t3 + t2 + 2) >> 2);
int p11 = pack8to16((t5 + 2*t4 + t3 + 2) >> 2, (t6 + 2*t5 + t4 + 2) >> 2);
int p1 = pack8to16(F1(l6,l7), F2(l5,l6,l7));
int p2 = pack8to16(F1(l5,l6), F2(l4,l5,l6));
int p3 = pack8to16(F1(l4,l5), F2(l3,l4,l5));
int p4 = pack8to16(F1(l3,l4), F2(l2,l3,l4));
int p5 = pack8to16(F1(l2,l3), F2(l1,l2,l3));
int p6 = pack8to16(F1(l1,l2), F2(l0,l1,l2));
int p7 = pack8to16(F1(l0,l1), F2(lt,l0,l1));
int p8 = pack8to16(F1(lt,l0), F2(l0,lt,t0));
int p9 = pack8to16(F2(t1,t0,lt), F2(t2,t1,t0 ));
int p10 = pack8to16(F2(t3,t2,t1), F2(t4,t3,t2 ));
int p11 = pack8to16(F2(t5,t4,t3), F2(t6,t5,t4 ));
SRC32(0,7)= pack16to32(p1,p2);
SRC32(0,6)= pack16to32(p2,p3);
SRC32(4,7)=SRC32(0,5)= pack16to32(p3,p4);
......@@ -805,39 +725,39 @@ static void predict_8x8_vl( uint8_t *src, uint8_t edge[33] )
{
PREDICT_8x8_LOAD_TOP
PREDICT_8x8_LOAD_TOPRIGHT
SRC(0,0)= (t0 + t1 + 1) >> 1;
SRC(0,1)= (t0 + 2*t1 + t2 + 2) >> 2;
SRC(0,2)=SRC(1,0)= (t1 + t2 + 1) >> 1;
SRC(0,3)=SRC(1,1)= (t1 + 2*t2 + t3 + 2) >> 2;
SRC(0,4)=SRC(1,2)=SRC(2,0)= (t2 + t3 + 1) >> 1;
SRC(0,5)=SRC(1,3)=SRC(2,1)= (t2 + 2*t3 + t4 + 2) >> 2;
SRC(0,6)=SRC(1,4)=SRC(2,2)=SRC(3,0)= (t3 + t4 + 1) >> 1;
SRC(0,7)=SRC(1,5)=SRC(2,3)=SRC(3,1)= (t3 + 2*t4 + t5 + 2) >> 2;
SRC(1,6)=SRC(2,4)=SRC(3,2)=SRC(4,0)= (t4 + t5 + 1) >> 1;
SRC(1,7)=SRC(2,5)=SRC(3,3)=SRC(4,1)= (t4 + 2*t5 + t6 + 2) >> 2;
SRC(2,6)=SRC(3,4)=SRC(4,2)=SRC(5,0)= (t5 + t6 + 1) >> 1;