39 #define MV_P_FOR (1<<0)
40 #define MV_B_FOR (1<<1)
41 #define MV_B_BACK (1<<2)
48 #define OFFSET(x) offsetof(CodecViewContext, x)
49 #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
69 static int clip_line(
int *sx,
int *sy,
int *ex,
int *ey,
int maxx)
77 *sy = *ey + (*sy - *ey) * (int64_t)*ex / (*ex - *sx);
84 *ey = *sy + (*ey - *sy) * (int64_t)(maxx - *sx) / (*ex - *sx);
102 if (
clip_line(&sx, &sy, &ex, &ey, w - 1))
104 if (
clip_line(&sy, &sx, &ey, &ex, h - 1))
107 sx = av_clip(sx, 0, w - 1);
108 sy = av_clip(sy, 0, h - 1);
109 ex = av_clip(ex, 0, w - 1);
110 ey = av_clip(ey, 0, h - 1);
112 buf[sy * stride + sx] +=
color;
119 buf += sx + sy * stride;
121 f = ((ey - sy) << 16) / ex;
122 for (x = 0; x <= ex; x++) {
124 fr = (x * f) & 0xFFFF;
125 buf[ y * stride + x] += (color * (0x10000 - fr)) >> 16;
126 if(fr) buf[(y + 1) * stride + x] += (color * fr ) >> 16;
133 buf += sx + sy * stride;
136 f = ((ex - sx) << 16) / ey;
139 for(y= 0; y <= ey; y++){
142 buf[y * stride + x ] += (color * (0x10000 - fr)) >> 16;
143 if(fr) buf[y * stride + x + 1] += (color * fr ) >> 16;
156 int ey,
int w,
int h,
int stride,
int color,
int tail,
int direction)
165 sx = av_clip(sx, -100, w + 100);
166 sy = av_clip(sy, -100, h + 100);
167 ex = av_clip(ex, -100, w + 100);
168 ey = av_clip(ey, -100, h + 100);
173 if (dx * dx + dy * dy > 3 * 3) {
176 int length = sqrt((rx * rx + ry * ry) << 8);
187 draw_line(buf, sx, sy, sx + rx, sy + ry, w, h, stride, color);
188 draw_line(buf, sx, sy, sx - ry, sy + rx, w, h, stride, color);
190 draw_line(buf, sx, sy, ex, ey, w, h, stride, color);
203 for (i = 0; i < sd->
size /
sizeof(*mvs); i++) {
205 const int direction = mv->
source > 0;
240 .
inputs = codecview_inputs,
242 .priv_class = &codecview_class,