44 int block_w = plane_index ? block_size/2 : block_size;
46 int obmc_stride= plane_index ? block_size : 2*block_size;
57 for(y=block_w*mb_y; y<
FFMIN(h,block_w*(mb_y+1)); y++){
64 if(v&(~255)) v= ~(v>>31);
65 dst8[x + y*ref_stride]=
v;
69 for(y=block_w*mb_y; y<
FFMIN(h,block_w*(mb_y+1)); y++){
82 for(mb_x=0; mb_x<=mb_w; mb_x++){
84 block_w*mb_x - block_w/2,
85 block_w*mb_y - block_w/2,
88 w, ref_stride, obmc_stride,
95 const int w= b->
width;
109 new_index = save_state[0];
112 for(y=start_y; y<h; y++){
120 register int t= ( (v>>1)*qmul + qadd)>>
QEXPSHIFT;
121 register int u= -(v&1);
130 save_state[0] = new_index;
138 const int index= (x + y*w) << rem_depth;
139 int trx= (x+1)<<rem_depth;
143 const BlockNode *tr = y && trx<w && ((x&1)==0 || level==0) ? &s->
block[index-w+(1<<rem_depth)] : tl;
148 set_blocks(s, level, x, y,
null_block.
color[0],
null_block.
color[1],
null_block.
color[2],
null_block.
mx,
null_block.
my,
null_block.
ref,
BLOCK_INTRA);
154 int l = left->
color[0];
155 int cb= left->
color[1];
156 int cr= left->
color[2];
158 int ref_context= av_log2(2*left->
ref) + av_log2(2*top->
ref);
159 int mx_context= av_log2(2*
FFABS(left->
mx - top->
mx)) + 0*av_log2(2*
FFABS(tr->
mx - top->
mx));
160 int my_context= av_log2(2*
FFABS(left->
my - top->
my)) + 0*av_log2(2*
FFABS(tr->
my - top->
my));
165 pred_mv(s, &mx, &my, 0, left, top, tr);
176 pred_mv(s, &mx, &my, ref, left, top, tr);
180 set_blocks(s, level, x, y, l, cb, cr, mx, my, ref, type);
192 const int w= b->
width;
200 for(y=start_y; y<end_y; y++){
206 line[x]= -((-i*qmul + qadd)>>(
QEXPSHIFT));
208 line[x]= (( i*qmul + qadd)>>(
QEXPSHIFT));
215 const int w= b->
width;
224 for(y=start_y; y<end_y; y++){
231 if(y && x+1<w) line[x] +=
mid_pred(line[x - 1], prev[x], prev[x + 1]);
232 else line[x] += line[x - 1];
234 if(y) line[x] +=
mid_pred(line[x - 1], prev[x], line[x - 1] + prev[x] - prev[x - 1]);
235 else line[x] += line[x - 1];
238 if(y) line[x] += prev[x];
245 int plane_index,
level, orientation;
247 for(plane_index=0; plane_index<3; plane_index++){
249 for(orientation=level ? 1:0; orientation<4; orientation++){
260 #define GET_S(dst, check) \
261 tmp= get_symbol(&s->c, s->header_state, 0);\
263 av_log(s->avctx, AV_LOG_ERROR, "Error " #dst " is %d\n", tmp);\
269 int plane_index, tmp;
272 memset(kstate,
MID_STATE,
sizeof(kstate));
302 for(plane_index=0; plane_index<2; plane_index++){
307 if((
unsigned)htaps >
HTAPS_MAX || htaps==0)
310 for(i= htaps/2; i; i--){
385 const uint8_t *buf = avpkt->
data;
386 int buf_size = avpkt->
size;
391 int level, orientation, plane_index;
406 for(plane_index=0; plane_index<3; plane_index++){
424 for(plane_index=0; plane_index<3; plane_index++){
445 for(orientation=level ? 1 : 0; orientation<4; orientation++){
455 const int block_w = plane_index ? block_size/2 : block_size;
463 for(mb_y=0; mb_y<=mb_h; mb_y++){
465 int slice_starty = block_w*mb_y;
466 int slice_h = block_w*(mb_y+1);
468 slice_starty =
FFMAX(0, slice_starty - (block_w >> 1));
469 slice_h -= (block_w >> 1);
473 for(orientation=level ? 1 : 0; orientation<4; orientation++){
477 int our_mb_start = mb_y;
478 int our_mb_end = (mb_y + 1);
489 if (start_y != end_y){
490 if (orientation == 0){
493 int correlate_start_y =
FFMIN(b->
height, (start_y ? start_y + 1 : 0));
504 for(; yd<slice_h; yd+=4){
509 for(; yq<slice_h && yq<h; yq++){