ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimove1.c
(Generate patch)

Comparing ray/src/util/ranimove1.c (file contents):
Revision 3.19 by greg, Sun Sep 30 19:18:41 2012 UTC vs.
Revision 3.20 by greg, Tue Oct 2 21:56:20 2012 UTC

# Line 48 | Line 48 | double         hlsmax;         /* maximum high-level saliency this f
48  
49  
50   static void next_frame(void);
51 < static int sample_here(int      x, int  y);
52 < static int offset_cmp(const void        *p1, const void *p2);
53 < static void setmotion(int       n, FVECT        wpos);
51 > static int sample_here(int x, int y);
52 > static int offset_cmp(const void *p1, const void *p2);
53 > static void setmotion(int n, FVECT wpos);
54   static void init_frame_sample(void);
55  
56  
# Line 145 | Line 145 | next_frame(void)                       /* prepare next frame buffer */
145                          error(SYSTEM, "out of memory in init_frame");
146                  for (n = hres*vres; n--; ) {
147                          zprev[n] = -1.f;
148 <                        xmbuffer[n] = ymbuffer[n] = MO_UNK;
149 <                        oprev[n] = OVOID;
148 >                        oprev[n] = OVOID;
149                  }
150                  frm_stop = getTime() + rtperfrm;
151          } else {
# Line 363 | Line 362 | init_frame_sample(void)                /* sample our initial frame *
362              for (x = hres; x--; ) {
363                  double  hv[2];
364                  n = fndx(x, y);
365 <                xmbuffer[n] = MO_UNK;
367 <                ymbuffer[n] = MO_UNK;
365 >                xmbuffer[n] = ymbuffer[n] = MO_UNK;
366                  sample_pos(hv, x, y, 0);
367                  ir.rmax = viewray(ir.rorg, ir.rdir, &vw, hv[0], hv[1]);
368                  if (ir.rmax < -FTINY) {
# Line 739 | Line 737 | filter_frame(void)                     /* interpolation, motion-blur, an
737                  free((void *)ebuf);
738          }
739   #endif
742
740          if (!silent) {
741                  printf("\tFiltering frame\n");
742                  fflush(stdout);
# Line 957 | Line 954 | send_frame(void)                       /* send frame to destination */
954          if (vdef(MNAME)) {              /* output motion buffer */
955                  unsigned short  *mbuffer = (unsigned short *)malloc(
956                                                  sizeof(unsigned short)*3*hres);
957 <                int             x;
957 >                int             x, n;
958                  if (mbuffer == NULL)
959 <                        error(SYSTEM, "out of memory in send_frame()");
959 >                        error(SYSTEM, "out of memory in send_frame");
960                  sprintf(fname, vval(MNAME), fcur);
961                  strcat(fname, ".mvo");
962                  fp = fopen(fname, "w");
# Line 975 | Line 972 | send_frame(void)                       /* send frame to destination */
972                  }
973                  for (y = vres; y--; ) {
974                          for (x = hres; x--; ) {
975 <                                mbuffer[3*x] = xmbuffer[fndx(x,y)] + 0x8000;
976 <                                mbuffer[3*x+1] = ymbuffer[fndx(x,y)] + 0x8000;
977 <                                mbuffer[3*x+2] = (oprev[fndx(x,y)]!=OVOID)*0x8000;
975 >                                n = fndx(x,y);
976 >                                mbuffer[3*x] = xmbuffer[n] + 0x8000;
977 >                                mbuffer[3*x+1] = ymbuffer[n] + 0x8000;
978 >                                mbuffer[3*x+2] = (oprev[n]!=OVOID)*0x8000;
979                          }
980                          if (fwrite(mbuffer, sizeof(*mbuffer),
981                                                  3*hres, fp) != 3*hres)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines