static void conv444to422 _ANSI_ARGS_((unsigned char *src, unsigned char *dst));
static void conv422to420 _ANSI_ARGS_((unsigned char *src, unsigned char *dst));
-int pbm_getint(FILE *file); //forward declaration
+int pbm_getint(FILE *file); /*forward declaration */
void readframe(fname,frame)
char *fname;
y = cr*r + cg*g + cb*b;
u = cu*(b-y);
v = cv*(r-y);
- yp[j] = (219.0/256.0)*y + 16.5; /* nominal range: 16..235 */
- up[j] = (224.0/256.0)*u + 128.5; /* 16..240 */
- vp[j] = (224.0/256.0)*v + 128.5; /* 16..240 */
+ yp[j] = (unsigned char)((219.0/256.0)*y + 16.5); /* nominal range: 16..235 */
+ up[j] = (unsigned char)((224.0/256.0)*u + 128.5); /* 16..240 */
+ vp[j] = (unsigned char)((224.0/256.0)*v + 128.5); /* 16..240 */
}
}
fclose(fd);
ip3 = (i<width-3) ? i+3 : width-1;
ip4 = (i<width-4) ? i+4 : width-1;
ip5 = (i<width-5) ? i+5 : width-1;
- ip6 = (i<width-5) ? i+6 : width-1;
+ ip6 = (i<width-6) ? i+6 : width-1;
/* FIR filter with 0.5 sample interval phase shift */
dst[i>>1] = clp[(int)(228*(src[i]+src[ip1])