X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2Fgdcmmpeg2%2Fsrc%2Fmpeg2enc%2Freadpic.c;h=c65e7e75c16fcb76808ed0982055f0dd90a0b378;hb=315440762bb5f22f9f2e39a4b2993ce585e1e320;hp=3247e670e3a2a89e686df144f00424ca8e840d76;hpb=0ec502a63fffce3a48caef921a04c5b3eb917799;p=gdcm.git diff --git a/src/gdcmmpeg2/src/mpeg2enc/readpic.c b/src/gdcmmpeg2/src/mpeg2enc/readpic.c index 3247e670..c65e7e75 100644 --- a/src/gdcmmpeg2/src/mpeg2enc/readpic.c +++ b/src/gdcmmpeg2/src/mpeg2enc/readpic.c @@ -41,6 +41,8 @@ static void border_extend _ANSI_ARGS_((unsigned char *frame, int w1, int h1, 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 */ + void readframe(fname,frame) char *fname; unsigned char *frame[]; @@ -227,9 +229,9 @@ unsigned char *frame[]; 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);