62 |
const IMAGE * const refv, |
const IMAGE * const refv, |
63 |
const IMAGE * const refhv, |
const IMAGE * const refhv, |
64 |
IMAGE * const cur, |
IMAGE * const cur, |
65 |
int16_t dct_codes[][64], |
int16_t *dct_codes, |
66 |
const uint32_t width, |
const uint32_t width, |
67 |
const uint32_t height, |
const uint32_t height, |
68 |
const uint32_t edged_width, |
const uint32_t edged_width, |
77 |
int32_t dx = mb->mvs[0].x; |
int32_t dx = mb->mvs[0].x; |
78 |
int32_t dy = mb->mvs[0].y; |
int32_t dy = mb->mvs[0].y; |
79 |
|
|
80 |
compensate8x8_halfpel(dct_codes[0], cur->y, ref->y, refh->y, refv->y, refhv->y, |
compensate8x8_halfpel(&dct_codes[0*64], cur->y, ref->y, refh->y, refv->y, refhv->y, |
81 |
16*i, 16*j, dx, dy, edged_width); |
16*i, 16*j, dx, dy, edged_width); |
82 |
compensate8x8_halfpel(dct_codes[1], cur->y, ref->y, refh->y, refv->y, refhv->y, |
compensate8x8_halfpel(&dct_codes[1*64], cur->y, ref->y, refh->y, refv->y, refhv->y, |
83 |
16*i + 8, 16*j, dx, dy, edged_width); |
16*i + 8, 16*j, dx, dy, edged_width); |
84 |
compensate8x8_halfpel(dct_codes[2], cur->y, ref->y, refh->y, refv->y, refhv->y, |
compensate8x8_halfpel(&dct_codes[2*64], cur->y, ref->y, refh->y, refv->y, refhv->y, |
85 |
16*i, 16*j + 8, dx, dy, edged_width); |
16*i, 16*j + 8, dx, dy, edged_width); |
86 |
compensate8x8_halfpel(dct_codes[3], cur->y, ref->y, refh->y, refv->y, refhv->y, |
compensate8x8_halfpel(&dct_codes[3*64], cur->y, ref->y, refh->y, refv->y, refhv->y, |
87 |
16*i + 8, 16*j + 8, dx, dy, edged_width); |
16*i + 8, 16*j + 8, dx, dy, edged_width); |
88 |
|
|
89 |
dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2; |
dx = (dx & 3) ? (dx >> 1) | 1 : dx / 2; |
97 |
|
|
98 |
/* uv-block-based compensation */ |
/* uv-block-based compensation */ |
99 |
interpolate8x8_switch(refv->u, ref->u, 8*i, 8*j, dx, dy, edged_width/2, rounding); |
interpolate8x8_switch(refv->u, ref->u, 8*i, 8*j, dx, dy, edged_width/2, rounding); |
100 |
transfer_8to16sub(dct_codes[4], |
transfer_8to16sub(&dct_codes[4*64], |
101 |
cur->u + 8*j*edged_width/2 + 8*i, |
cur->u + 8*j*edged_width/2 + 8*i, |
102 |
refv->u + 8*j*edged_width/2 + 8*i, edged_width/2); |
refv->u + 8*j*edged_width/2 + 8*i, edged_width/2); |
103 |
|
|
104 |
interpolate8x8_switch(refv->v, ref->v, 8*i, 8*j, dx, dy, edged_width/2, rounding); |
interpolate8x8_switch(refv->v, ref->v, 8*i, 8*j, dx, dy, edged_width/2, rounding); |
105 |
transfer_8to16sub(dct_codes[5], |
transfer_8to16sub(&dct_codes[5*64], |
106 |
cur->v + 8*j*edged_width/2 + 8*i, |
cur->v + 8*j*edged_width/2 + 8*i, |
107 |
refv->v + 8*j*edged_width/2 + 8*i, edged_width/2); |
refv->v + 8*j*edged_width/2 + 8*i, edged_width/2); |
108 |
|
|
111 |
{ |
{ |
112 |
int32_t sum, dx, dy; |
int32_t sum, dx, dy; |
113 |
|
|
114 |
compensate8x8_halfpel(dct_codes[0], cur->y, ref->y, refh->y, refv->y, refhv->y, |
compensate8x8_halfpel(&dct_codes[0*64], cur->y, ref->y, refh->y, refv->y, refhv->y, |
115 |
16*i, 16*j, mb->mvs[0].x, mb->mvs[0].y, edged_width); |
16*i, 16*j, mb->mvs[0].x, mb->mvs[0].y, edged_width); |
116 |
compensate8x8_halfpel(dct_codes[1], cur->y, ref->y, refh->y, refv->y, refhv->y, |
compensate8x8_halfpel(&dct_codes[1*64], cur->y, ref->y, refh->y, refv->y, refhv->y, |
117 |
16*i + 8, 16*j, mb->mvs[1].x, mb->mvs[1].y, edged_width); |
16*i + 8, 16*j, mb->mvs[1].x, mb->mvs[1].y, edged_width); |
118 |
compensate8x8_halfpel(dct_codes[2], cur->y, ref->y, refh->y, refv->y, refhv->y, |
compensate8x8_halfpel(&dct_codes[2*64], cur->y, ref->y, refh->y, refv->y, refhv->y, |
119 |
16*i, 16*j + 8, mb->mvs[2].x, mb->mvs[2].y, edged_width); |
16*i, 16*j + 8, mb->mvs[2].x, mb->mvs[2].y, edged_width); |
120 |
compensate8x8_halfpel(dct_codes[3], cur->y, ref->y, refh->y, refv->y, refhv->y, |
compensate8x8_halfpel(&dct_codes[3*64], cur->y, ref->y, refh->y, refv->y, refhv->y, |
121 |
16*i + 8, 16*j + 8, mb->mvs[3].x, mb->mvs[3].y, edged_width); |
16*i + 8, 16*j + 8, mb->mvs[3].x, mb->mvs[3].y, edged_width); |
122 |
|
|
123 |
sum = mb->mvs[0].x + mb->mvs[1].x + mb->mvs[2].x + mb->mvs[3].x; |
sum = mb->mvs[0].x + mb->mvs[1].x + mb->mvs[2].x + mb->mvs[3].x; |
134 |
|
|
135 |
/* uv-block-based compensation */ |
/* uv-block-based compensation */ |
136 |
interpolate8x8_switch(refv->u, ref->u, 8*i, 8*j, dx, dy, edged_width/2, rounding); |
interpolate8x8_switch(refv->u, ref->u, 8*i, 8*j, dx, dy, edged_width/2, rounding); |
137 |
transfer_8to16sub(dct_codes[4], |
transfer_8to16sub(&dct_codes[4*64], |
138 |
cur->u + 8*j*edged_width/2 + 8*i, |
cur->u + 8*j*edged_width/2 + 8*i, |
139 |
refv->u + 8*j*edged_width/2 + 8*i, edged_width/2); |
refv->u + 8*j*edged_width/2 + 8*i, edged_width/2); |
140 |
|
|
141 |
interpolate8x8_switch(refv->v, ref->v, 8*i, 8*j, dx, dy, edged_width/2, rounding); |
interpolate8x8_switch(refv->v, ref->v, 8*i, 8*j, dx, dy, edged_width/2, rounding); |
142 |
transfer_8to16sub(dct_codes[5], |
transfer_8to16sub(&dct_codes[5*64], |
143 |
cur->v + 8*j*edged_width/2 + 8*i, |
cur->v + 8*j*edged_width/2 + 8*i, |
144 |
refv->v + 8*j*edged_width/2 + 8*i, edged_width/2); |
refv->v + 8*j*edged_width/2 + 8*i, edged_width/2); |
145 |
|
|