comparison h263dec.c @ 361:dc2fb310008d libavcodec

MV visualisation support
author michaelni
date Sun, 05 May 2002 01:39:07 +0000
parents 386f430e93f4
children d442918c4698
comparison
equal deleted inserted replaced
360:71792167020c 361:dc2fb310008d
258 s->bitstream_buffer_size= buf_size - current_pos; 258 s->bitstream_buffer_size= buf_size - current_pos;
259 } 259 }
260 } 260 }
261 261
262 MPV_frame_end(s); 262 MPV_frame_end(s);
263 263 #if 0 //dirty show MVs, we should export the MV tables and write a filter to show them
264 {
265 int mb_y;
266 s->has_b_frames=1;
267 for(mb_y=0; mb_y<s->mb_height; mb_y++){
268 int mb_x;
269 int y= mb_y*16;
270 for(mb_x=0; mb_x<s->mb_width; mb_x++){
271 int x= mb_x*16;
272 uint8_t *ptr= s->last_picture[0];
273 int xy= 1 + mb_x*2 + (mb_y*2 + 1)*(s->mb_width*2 + 2);
274 int mx= (s->motion_val[xy][0]>>1) + x;
275 int my= (s->motion_val[xy][1]>>1) + y;
276 int i;
277 int max;
278
279 if(mx<0) mx=0;
280 if(my<0) my=0;
281 if(mx>=s->width) mx= s->width -1;
282 if(my>=s->height) my= s->height-1;
283 max= ABS(mx-x);
284 if(ABS(my-y) > max) max= ABS(my-y);
285 /* the ugliest linedrawing routine ... */
286 for(i=0; i<max; i++){
287 int x1= x + (mx-x)*i/max;
288 int y1= y + (my-y)*i/max;
289 ptr[y1*s->linesize + x1]+=100;
290 }
291 s->mbskip_table[mb_x + mb_y*s->mb_width]=0;
292 }
293 }
294
295 }
296 #endif
264 if(s->pict_type==B_TYPE || (!s->has_b_frames)){ 297 if(s->pict_type==B_TYPE || (!s->has_b_frames)){
265 pict->data[0] = s->current_picture[0]; 298 pict->data[0] = s->current_picture[0];
266 pict->data[1] = s->current_picture[1]; 299 pict->data[1] = s->current_picture[1];
267 pict->data[2] = s->current_picture[2]; 300 pict->data[2] = s->current_picture[2];
268 } else { 301 } else {