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.23 by greg, Wed Jan 24 04:39:52 2018 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 330 | Line 329 | setmotion(             /* compute motion vector for this pixel */
329                  multp3(ovp, wpos, obj_move[moi].bxfm);
330                  wpos = ovp;
331          }
332 <        viewloc(ovp, &vwprev, wpos);
334 <        if (ovp[2] <= FTINY)
332 >        if (viewloc(ovp, &vwprev, wpos) <= 0)
333                  return;
334          xp = (int)(ovp[0]*hres);
335          yp = (int)(ovp[1]*vres);
# Line 363 | Line 361 | init_frame_sample(void)                /* sample our initial frame *
361              for (x = hres; x--; ) {
362                  double  hv[2];
363                  n = fndx(x, y);
364 <                xmbuffer[n] = MO_UNK;
367 <                ymbuffer[n] = MO_UNK;
364 >                xmbuffer[n] = ymbuffer[n] = MO_UNK;
365                  sample_pos(hv, x, y, 0);
366                  ir.rmax = viewray(ir.rorg, ir.rdir, &vw, hv[0], hv[1]);
367                  if (ir.rmax < -FTINY) {
# Line 739 | Line 736 | filter_frame(void)                     /* interpolation, motion-blur, an
736                  free((void *)ebuf);
737          }
738   #endif
742
739          if (!silent) {
740                  printf("\tFiltering frame\n");
741                  fflush(stdout);
# Line 957 | Line 953 | send_frame(void)                       /* send frame to destination */
953          if (vdef(MNAME)) {              /* output motion buffer */
954                  unsigned short  *mbuffer = (unsigned short *)malloc(
955                                                  sizeof(unsigned short)*3*hres);
956 <                int             x;
956 >                int             x, n;
957                  if (mbuffer == NULL)
958 <                        error(SYSTEM, "out of memory in send_frame()");
958 >                        error(SYSTEM, "out of memory in send_frame");
959                  sprintf(fname, vval(MNAME), fcur);
960                  strcat(fname, ".mvo");
961                  fp = fopen(fname, "w");
# Line 975 | Line 971 | send_frame(void)                       /* send frame to destination */
971                  }
972                  for (y = vres; y--; ) {
973                          for (x = hres; x--; ) {
974 <                                mbuffer[3*x] = xmbuffer[fndx(x,y)] + 0x8000;
975 <                                mbuffer[3*x+1] = ymbuffer[fndx(x,y)] + 0x8000;
976 <                                mbuffer[3*x+2] = (oprev[fndx(x,y)]!=OVOID)*0x8000;
974 >                                n = fndx(x,y);
975 >                                mbuffer[3*x] = xmbuffer[n] + 0x8000;
976 >                                mbuffer[3*x+1] = ymbuffer[n] + 0x8000;
977 >                                mbuffer[3*x+2] = (oprev[n]!=OVOID)*0x8000;
978                          }
979                          if (fwrite(mbuffer, sizeof(*mbuffer),
980                                                  3*hres, fp) != 3*hres)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines