41 int block_w = plane_index ? block_size>>s->
chroma_h_shift : block_size;
42 int block_h = plane_index ? block_size>>s->
chroma_v_shift : block_size;
44 int obmc_stride= plane_index ? (2*block_size)>>s->
chroma_h_shift : 2*block_size;
55 for(y=block_h*mb_y; y<
FFMIN(h,block_h*(mb_y+1)); y++){
62 if(v&(~255)) v= ~(v>>31);
63 dst8[x + y*ref_stride]=
v;
67 for(y=block_h*mb_y; y<
FFMIN(h,block_h*(mb_y+1)); y++){
80 for(mb_x=0; mb_x<=mb_w; mb_x++){
82 block_w*mb_x - block_w/2,
83 block_h*mb_y - block_h/2,
86 w, ref_stride, obmc_stride,
91 if(s->
avmv && mb_y < mb_h && plane_index == 0)
92 for(mb_x=0; mb_x<mb_w; mb_x++){
95 const int b_stride= b_width;
105 avmv->
dst_x = block_w*mb_x - block_w/2;
106 avmv->
dst_y = block_h*mb_y - block_h/2;
115 const int w= b->
width;
129 new_index = save_state[0];
132 for(y=start_y; y<h; y++){
140 register int t= ( (v>>1)*qmul + qadd)>>
QEXPSHIFT;
141 register int u= -(v&1);
150 save_state[0] = new_index;
158 const int index= (x + y*w) << rem_depth;
159 int trx= (x+1)<<rem_depth;
163 const BlockNode *tr = y && trx<w && ((x&1)==0 || level==0) ? &s->
block[index-w+(1<<rem_depth)] : tl;
168 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);
174 int l = left->
color[0];
185 pred_mv(s, &mx, &my, 0, left, top, tr);
198 pred_mv(s, &mx, &my, ref, left, top, tr);
202 set_blocks(s, level, x, y, l, cb, cr, mx, my, ref, type);
214 const int w= b->
width;
222 for(y=start_y; y<end_y; y++){
228 line[x]= -((-i*qmul + qadd)>>(
QEXPSHIFT));
230 line[x]= (( i*qmul + qadd)>>(
QEXPSHIFT));
237 const int w= b->
width;
246 for(y=start_y; y<end_y; y++){
253 if(y && x+1<w) line[x] +=
mid_pred(line[x - 1], prev[x], prev[x + 1]);
254 else line[x] += line[x - 1];
256 if(y) line[x] +=
mid_pred(line[x - 1], prev[x], line[x - 1] + prev[x] - prev[x - 1]);
257 else line[x] += line[x - 1];
260 if(y) line[x] += prev[x];
267 int plane_index,
level, orientation;
269 for(plane_index=0; plane_index < s->
nb_planes; plane_index++){
271 for(orientation=level ? 1:0; orientation<4; orientation++){
282 #define GET_S(dst, check) \
283 tmp= get_symbol(&s->c, s->header_state, 0);\
285 av_log(s->avctx, AV_LOG_ERROR, "Error " #dst " is %d\n", tmp);\
286 return AVERROR_INVALIDDATA;\
291 int plane_index, tmp;
294 memset(kstate,
MID_STATE,
sizeof(kstate));
350 for(plane_index=0; plane_index<
FFMIN(s->
nb_planes, 2); plane_index++){
355 if((
unsigned)htaps >
HTAPS_MAX || htaps==0)
358 for(i= htaps/2; i; i--){
430 int buf_size = avpkt->
size;
435 int level, orientation, plane_index;
456 for(plane_index=0; plane_index < s->
nb_planes; plane_index++){
473 "keyframe:%d qlog:%d qbias: %d mvscale: %d "
474 "decomposition_type:%d decomposition_count:%d\n",
489 for(plane_index=0; plane_index < s->
nb_planes; plane_index++){
510 for(orientation=level ? 1 : 0; orientation<4; orientation++){
520 const int block_h = plane_index ? block_size>>s->
chroma_v_shift : block_size;
528 for(mb_y=0; mb_y<=mb_h; mb_y++){
530 int slice_starty = block_h*mb_y;
531 int slice_h = block_h*(mb_y+1);
534 slice_starty =
FFMAX(0, slice_starty - (block_h >> 1));
535 slice_h -= (block_h >> 1);
539 for(orientation=level ? 1 : 0; orientation<4; orientation++){
543 int our_mb_start = mb_y;
544 int our_mb_end = (mb_y + 1);
555 if (start_y != end_y){
556 if (orientation == 0){
559 int correlate_start_y =
FFMIN(b->
height, (start_y ? start_y + 1 : 0));
570 for(; yd<slice_h; yd+=4){
575 for(; yq<slice_h && yq<h; yq++){