nicer looking arrows for the motion vector vissualization
Originally committed as revision 2950 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
13d1512c43
commit
8100cab9c6
@ -815,9 +815,9 @@ void MPV_common_end(MpegEncContext *s)
|
|||||||
s->last_picture_ptr=
|
s->last_picture_ptr=
|
||||||
s->next_picture_ptr=
|
s->next_picture_ptr=
|
||||||
s->current_picture_ptr= NULL;
|
s->current_picture_ptr= NULL;
|
||||||
|
|
||||||
for(i=0; i<3; i++)
|
for(i=0; i<3; i++)
|
||||||
if (s->visualization_buffer[i])
|
av_freep(&s->visualization_buffer[i]);
|
||||||
av_free(s->visualization_buffer[i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_ENCODERS
|
#ifdef CONFIG_ENCODERS
|
||||||
@ -1486,7 +1486,7 @@ void MPV_frame_end(MpegEncContext *s)
|
|||||||
* @param color color of the arrow
|
* @param color color of the arrow
|
||||||
*/
|
*/
|
||||||
static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color){
|
static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h, int stride, int color){
|
||||||
int t, x, y, f;
|
int t, x, y, fr, f;
|
||||||
|
|
||||||
sx= clip(sx, 0, w-1);
|
sx= clip(sx, 0, w-1);
|
||||||
sy= clip(sy, 0, h-1);
|
sy= clip(sy, 0, h-1);
|
||||||
@ -1504,8 +1504,10 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h
|
|||||||
ex-= sx;
|
ex-= sx;
|
||||||
f= ((ey-sy)<<16)/ex;
|
f= ((ey-sy)<<16)/ex;
|
||||||
for(x= 0; x <= ex; x++){
|
for(x= 0; x <= ex; x++){
|
||||||
y= ((x*f) + (1<<15))>>16;
|
y = (x*f)>>16;
|
||||||
buf[y*stride + x]+= color;
|
fr= (x*f)&0xFFFF;
|
||||||
|
buf[ y *stride + x]+= (color*(0x10000-fr))>>16;
|
||||||
|
buf[(y+1)*stride + x]+= (color* fr )>>16;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(sy > ey){
|
if(sy > ey){
|
||||||
@ -1517,8 +1519,10 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey, int w, int h
|
|||||||
if(ey) f= ((ex-sx)<<16)/ey;
|
if(ey) f= ((ex-sx)<<16)/ey;
|
||||||
else f= 0;
|
else f= 0;
|
||||||
for(y= 0; y <= ey; y++){
|
for(y= 0; y <= ey; y++){
|
||||||
x= ((y*f) + (1<<15))>>16;
|
x = (y*f)>>16;
|
||||||
buf[y*stride + x]+= color;
|
fr= (y*f)&0xFFFF;
|
||||||
|
buf[y*stride + x ]+= (color*(0x10000-fr))>>16;;
|
||||||
|
buf[y*stride + x+1]+= (color* fr )>>16;;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user