diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2002-05-05 01:39:07 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2002-05-05 01:39:07 +0000 |
commit | 3649cfd9b37430859b9b11b4b60449da24f0683a (patch) | |
tree | ffed57b534db2509b405530c2e8b8092593104b9 | |
parent | 3d1d9b2c37a839dbabcce07a8bb42cda2f4fc494 (diff) | |
download | ffmpeg-3649cfd9b37430859b9b11b4b60449da24f0683a.tar.gz |
MV visualisation support
Originally committed as revision 442 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h263dec.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 1f8ef678b8..b18753b0da 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -260,7 +260,40 @@ static int h263_decode_frame(AVCodecContext *avctx, } MPV_frame_end(s); - +#if 0 //dirty show MVs, we should export the MV tables and write a filter to show them +{ + int mb_y; + s->has_b_frames=1; + for(mb_y=0; mb_y<s->mb_height; mb_y++){ + int mb_x; + int y= mb_y*16; + for(mb_x=0; mb_x<s->mb_width; mb_x++){ + int x= mb_x*16; + uint8_t *ptr= s->last_picture[0]; + int xy= 1 + mb_x*2 + (mb_y*2 + 1)*(s->mb_width*2 + 2); + int mx= (s->motion_val[xy][0]>>1) + x; + int my= (s->motion_val[xy][1]>>1) + y; + int i; + int max; + + if(mx<0) mx=0; + if(my<0) my=0; + if(mx>=s->width) mx= s->width -1; + if(my>=s->height) my= s->height-1; + max= ABS(mx-x); + if(ABS(my-y) > max) max= ABS(my-y); + /* the ugliest linedrawing routine ... */ + for(i=0; i<max; i++){ + int x1= x + (mx-x)*i/max; + int y1= y + (my-y)*i/max; + ptr[y1*s->linesize + x1]+=100; + } + s->mbskip_table[mb_x + mb_y*s->mb_width]=0; + } + } + +} +#endif if(s->pict_type==B_TYPE || (!s->has_b_frames)){ pict->data[0] = s->current_picture[0]; pict->data[1] = s->current_picture[1]; |