home *** CD-ROM | disk | FTP | other *** search
/ Dream 44 / Amiga_Dream_44.iso / Linux / Apps / xanim.tgz / xanim / xanim27064 / xa_jmov.c < prev    next >
C/C++ Source or Header  |  1997-01-26  |  14KB  |  506 lines

  1.  
  2. /*
  3.  * xa_jmov.c
  4.  *
  5.  * Copyright (C) 1995,1996,1997 by Mark Podlipec. 
  6.  * All rights reserved.
  7.  *
  8.  * This software may be freely copied, modified and redistributed without
  9.  * fee for non-commerical purposes provided that this copyright notice is
  10.  * preserved intact on all copies and modified copies.
  11.  * 
  12.  * There is no warranty or other guarantee of fitness of this software.
  13.  * It is provided solely "as is". The author(s) disclaim(s) all
  14.  * responsibility and liability with respect to this software's usage
  15.  * or its effect upon hardware or computer systems.
  16.  *
  17.  */
  18.  
  19. /*******************************
  20.  * Revision
  21.  *
  22.  *
  23.  ********************************/
  24.  
  25.  
  26. #include "xa_jmov.h" 
  27.  
  28. xaULONG JMOV_Read_File();
  29. JMOV_FRAME *JMOV_Add_Frame();
  30. void JMOV_Free_Frame_List();
  31. void ACT_Setup_Delta();
  32. xaULONG JMOV_Read_Header();
  33. void JMOV_Read_Index();
  34. void JMOV_Read_Frame();
  35.  
  36.  
  37. /* CODEC ROUTINES */
  38. xaULONG JFIF_Decode_JPEG();
  39. void JFIF_Read_IJPG_Tables();
  40. extern void XA_Gen_YUV_Tabs();
  41. extern JPG_Alloc_MCU_Bufs();
  42. extern jpg_search_marker();
  43. extern IJPG_Tab1[64];
  44. extern IJPG_Tab2[64];
  45. extern JFIF_Init_IJPG_Tables();
  46.  
  47. void CMAP_Cache_Clear();
  48. void CMAP_Cache_Init();
  49.  
  50. XA_ACTION *ACT_Get_Action();
  51. XA_CHDR *ACT_Get_CMAP();
  52. XA_CHDR *CMAP_Create_332();
  53. XA_CHDR *CMAP_Create_422();
  54. XA_CHDR *CMAP_Create_Gray();
  55. void ACT_Add_CHDR_To_Action();
  56. void ACT_Setup_Mapped();
  57. void ACT_Get_CCMAP();
  58. XA_CHDR *CMAP_Create_CHDR_From_True();
  59. xaULONG CMAP_Find_Closest();
  60. xaUBYTE *UTIL_RGB_To_FS_Map();
  61. xaUBYTE *UTIL_RGB_To_Map();
  62.  
  63. void  UTIL_FPS_2_Time();
  64. extern XA_ANIM_SETUP *XA_Get_Anim_Setup();
  65. void XA_Free_Anim_Setup();
  66.  
  67.  
  68. xaULONG jmov_audio_attempt;
  69. xaULONG jmov_audio_type;
  70. xaULONG jmov_audio_freq;
  71. xaULONG jmov_audio_chans;
  72. xaULONG jmov_audio_bps;
  73. xaULONG XA_Add_Sound();
  74.  
  75.  
  76. xaULONG jmov_frame_cnt;
  77. JMOV_FRAME *jmov_frame_start,*jmov_frame_cur;
  78.  
  79. JMOV_FRAME *JMOV_Add_Frame(time,timelo,act)
  80. xaULONG time,timelo;
  81. XA_ACTION *act;
  82. {
  83.   JMOV_FRAME *fframe;
  84.  
  85.   fframe = (JMOV_FRAME *) malloc(sizeof(JMOV_FRAME));
  86.   if (fframe == 0) TheEnd1("JMOV_Add_Frame: malloc err");
  87.  
  88.   fframe->time   = time;
  89.   fframe->timelo = timelo;
  90.   fframe->act = act;
  91.   fframe->next = 0;
  92.  
  93.   if (jmov_frame_start == 0) jmov_frame_start = fframe;
  94.   else jmov_frame_cur->next = fframe;
  95.  
  96.   jmov_frame_cur = fframe;
  97.   jmov_frame_cnt++;
  98.   return(fframe);
  99. }
  100.  
  101. void JMOV_Free_Frame_List(fframes)
  102. JMOV_FRAME *fframes;
  103. {
  104.   JMOV_FRAME *ftmp;
  105.   while(fframes != 0)
  106.   {
  107.     ftmp = fframes;
  108.     fframes = fframes->next;
  109.     FREE(ftmp,0xA000);
  110.   }
  111. }
  112.  
  113.  
  114. xaULONG JMOV_Read_File(fname,anim_hdr,audio_attempt)
  115. char *fname;
  116. XA_ANIM_HDR *anim_hdr;
  117. xaULONG audio_attempt;    /* xaTRUE if audio is to be attempted */
  118. { XA_INPUT *xin = anim_hdr->xin;
  119.   xaLONG i,t_time;
  120.   xaULONG t_timelo;
  121.   XA_ANIM_SETUP *jmov;
  122.   JMOV_HDR   jmov_hdr;
  123.  
  124.   jmov = XA_Get_Anim_Setup();
  125.   jmov->vid_time = XA_GET_TIME( 100 ); /* default */
  126.  
  127.   jmov_frame_cnt    = 0;
  128.   jmov_frame_start    = 0;
  129.   jmov_frame_cur    = 0;
  130.   jmov_audio_attempt    = audio_attempt;
  131.  
  132.   if (JMOV_Read_Header(xin,anim_hdr,jmov,&jmov_hdr) == xaFALSE)
  133.   {
  134.     fprintf(stderr,"JMOV: read header error\n");
  135.     xin->Close_File(xin);
  136.     return(xaFALSE);
  137.   }
  138.  
  139.   JMOV_Read_Index(xin,anim_hdr,jmov,&jmov_hdr);
  140.  
  141.  
  142.   if (xa_verbose) 
  143.   {
  144.     fprintf(stderr,"JMOV %dx%dx%d frames %d\n",
  145.         jmov->imagex,jmov->imagey,jmov->imagec,jmov_frame_cnt);
  146.   }
  147.   if (jmov_frame_cnt == 0)
  148.   { 
  149.     fprintf(stderr,"JMOV: No supported video frames exist in this file.\n");
  150.     return(xaFALSE);
  151.   }
  152.  
  153.   anim_hdr->frame_lst = (XA_FRAME *)
  154.                 malloc( sizeof(XA_FRAME) * (jmov_frame_cnt+1));
  155.   if (anim_hdr->frame_lst == NULL) TheEnd1("JMOV_Read_File: frame malloc err");
  156.  
  157.   jmov_frame_cur = jmov_frame_start;
  158.   i = 0;
  159.   t_time = 0;
  160.   t_timelo = 0;
  161.   while(jmov_frame_cur != 0)
  162.   {
  163.     if (i > jmov_frame_cnt)
  164.     {
  165.       fprintf(stderr,"JMOV_Read_Anim: frame inconsistency %d %d\n",
  166.                 i,jmov_frame_cnt);
  167.       break;
  168.     }
  169.     anim_hdr->frame_lst[i].time_dur = jmov_frame_cur->time;
  170.     anim_hdr->frame_lst[i].zztime = t_time;
  171.     t_time += jmov_frame_cur->time;
  172.     t_timelo += jmov_frame_cur->timelo;
  173.     while(t_timelo > (1<<24)) {t_time++; t_timelo -= (1<<24);}
  174.     anim_hdr->frame_lst[i].act = jmov_frame_cur->act;
  175.     jmov_frame_cur = jmov_frame_cur->next;
  176.     i++;
  177.   }
  178.   anim_hdr->imagex = jmov->imagex;
  179.   anim_hdr->imagey = jmov->imagey;
  180.   anim_hdr->imagec = jmov->imagec;
  181.   anim_hdr->imaged = 8; /* nop */
  182.   anim_hdr->frame_lst[i].time_dur = 0;
  183.   anim_hdr->frame_lst[i].zztime = -1;
  184.   anim_hdr->frame_lst[i].act  = 0;
  185.   anim_hdr->loop_frame = 0;
  186.   if (!(xin->load_flag & XA_IN_LOAD_BUF)) anim_hdr->anim_flags |= ANIM_SNG_BUF;
  187.   if (xin->load_flag & XA_IN_LOAD_FILE) anim_hdr->anim_flags |= ANIM_USE_FILE;
  188.   anim_hdr->anim_flags |= ANIM_FULL_IM;
  189.   anim_hdr->max_fvid_size = jmov->max_fvid_size;
  190.   anim_hdr->max_faud_size = jmov->max_faud_size;
  191.   anim_hdr->fname = anim_hdr->name;
  192.   if (i > 0) 
  193.   {
  194.     anim_hdr->last_frame = i - 1;
  195.     anim_hdr->total_time = anim_hdr->frame_lst[i-1].zztime
  196.                 + anim_hdr->frame_lst[i-1].time_dur;
  197.   }
  198.   else
  199.   {
  200.     anim_hdr->last_frame = 0;
  201.     anim_hdr->total_time = 0;
  202.   }
  203.   JMOV_Free_Frame_List(jmov_frame_start);
  204.   XA_Free_Anim_Setup(jmov);
  205.   return(xaTRUE);
  206. } /* end of read file */
  207.  
  208.  
  209. xaULONG JMOV_Read_Header(xin,anim_hdr,jmov,jmov_hdr)
  210. XA_INPUT *xin;
  211. XA_ANIM_HDR *anim_hdr;
  212. XA_ANIM_SETUP *jmov;
  213. JMOV_HDR *jmov_hdr;
  214. { xaULONG t;
  215.   char *audio_desc;
  216.   t             = xin->Read_MSB_U32(xin); /* skip 8 bytes of header */
  217.   t             = xin->Read_MSB_U32(xin); 
  218.   jmov_hdr->version    = xin->Read_MSB_U32(xin);
  219.   jmov_hdr->fps        = xin->Read_MSB_U32(xin);
  220.   jmov_hdr->frames    = xin->Read_MSB_U32(xin);
  221.   jmov_hdr->width    = xin->Read_MSB_U32(xin);  
  222.   jmov_hdr->height    = xin->Read_MSB_U32(xin);
  223.   jmov_hdr->bandwidth    = xin->Read_MSB_U32(xin);
  224.   jmov_hdr->qfactor    = xin->Read_MSB_U32(xin);
  225.   jmov_hdr->mapsize    = xin->Read_MSB_U32(xin);
  226.   jmov_hdr->indexbuf    = xin->Read_MSB_U32(xin);
  227.   jmov_hdr->tracks    = xin->Read_MSB_U32(xin);
  228.   jmov_hdr->volbase     = xin->Read_MSB_U32(xin); 
  229.   jmov_hdr->audioslice    = xin->Read_MSB_U32(xin);
  230. /* Sun's Audio_hdr */
  231.   jmov_hdr->freq    = xin->Read_MSB_U32(xin);
  232.   xin->Read_MSB_U32(xin); /* sja throw away samples per unit */
  233.   jmov_hdr->prec    = xin->Read_MSB_U32(xin);
  234.   jmov_hdr->chans    = xin->Read_MSB_U32(xin);
  235.   jmov_hdr->codec    = xin->Read_MSB_U32(xin);
  236.  
  237.   UTIL_FPS_2_Time(jmov, ((double)(jmov_hdr->fps)) );
  238.  
  239.   jmov_audio_freq = jmov_hdr->freq;
  240.   jmov_audio_chans = jmov_hdr->chans;
  241.   jmov_audio_bps   = jmov_hdr->prec;
  242.  
  243.   jmov_audio_type = XA_AUDIO_INVALID;
  244.   switch(jmov_hdr->codec)
  245.   {
  246.     case JMOV_AUDIO_ENC_NONE:
  247.     case JMOV_AUDIO_ENC_PCM:
  248.     if (jmov_audio_bps == 1) jmov_audio_type = XA_AUDIO_LINEAR;
  249.     else             jmov_audio_type = XA_AUDIO_SIGNED;
  250.         audio_desc = "PCM";
  251.     break;
  252.     case JMOV_AUDIO_ENC_ULAW:
  253.     jmov_audio_type = XA_AUDIO_ULAW;
  254.         audio_desc = "ULAW";
  255.     break;
  256.   }
  257.   if ( (jmov_audio_chans > 2) || (jmov_audio_chans == 0) )
  258.                     jmov_audio_type = XA_AUDIO_INVALID;
  259.   if ( (jmov_audio_bps > 2) || (jmov_audio_bps == 0) )
  260.                     jmov_audio_type = XA_AUDIO_INVALID;
  261.  
  262.   if (jmov_audio_chans == 2) jmov_audio_type |= XA_AUDIO_STEREO_MSK;
  263.   if (jmov_audio_bps == 2)   
  264.   {
  265.     jmov_audio_type |= XA_AUDIO_BPS_2_MSK;
  266.     jmov_audio_type |= XA_AUDIO_BIGEND_MSK;
  267.   }
  268.  
  269.   if (jmov_hdr->audioslice)
  270.   { if (jmov_audio_type == XA_AUDIO_INVALID)
  271.     { if (jmov_audio_attempt == xaTRUE) 
  272.     fprintf(stderr,"JMOV: Audio Type unsupported %d \n",jmov_hdr->codec);
  273.       jmov_audio_attempt = xaFALSE;
  274.     }
  275.     else
  276.     { if (xa_verbose) 
  277.       { fprintf(stderr,"  Audio Codec: %s Rate=%d Chans=%d bps=%d\n",
  278.     audio_desc,jmov_audio_freq,jmov_audio_chans,
  279.             (jmov_audio_bps==1)?(8):(16) );
  280.       }
  281.     }
  282.   }
  283.  
  284.   /* JFIF_Init_IJPG_Tables( jmov_hdr->qfactor ); */
  285.   JFIF_Init_IJPG_Tables( 1 );
  286.  
  287. DEBUG_LEVEL1
  288. {
  289.   fprintf(stderr,"JMOV: ver %d  fps %d frame %d  res %dx%d\n",
  290.     jmov_hdr->version, jmov_hdr->fps, jmov_hdr->frames,
  291.     jmov_hdr->width, jmov_hdr->height);
  292.   fprintf(stderr,"      qf %d mapsize %d indx %x tracks %d audsz %x\n",
  293.     jmov_hdr->qfactor, jmov_hdr->mapsize, jmov_hdr->indexbuf,
  294.     jmov_hdr->tracks, jmov_hdr->audioslice);
  295. }
  296.  
  297.   jmov->depth = 24;
  298.   jmov->imagex = jmov_hdr->width;
  299.   jmov->imagey = jmov_hdr->height;
  300.   jmov->imagex = 4 * ((jmov->imagex + 3)/4);
  301.   jmov->imagey = 4 * ((jmov->imagey + 3)/4);
  302.   XA_Gen_YUV_Tabs(anim_hdr);
  303.   JPG_Alloc_MCU_Bufs(anim_hdr,jmov->imagex,0,xaFALSE);
  304.  
  305.   if (   (cmap_true_map_flag == xaFALSE) /* depth 16 and not true_map */
  306.       || (!(xin->load_flag & XA_IN_LOAD_BUF)) )
  307.   {
  308.      if (cmap_true_to_332 == xaTRUE)
  309.              jmov->chdr = CMAP_Create_332(jmov->cmap,&jmov->imagec);
  310.      else    jmov->chdr = CMAP_Create_Gray(jmov->cmap,&jmov->imagec);
  311.   }
  312.   if ( (jmov->pic==0) && (xin->load_flag & XA_IN_LOAD_BUF))
  313.   {
  314.     jmov->pic_size = jmov->imagex * jmov->imagey;
  315.     if ( (cmap_true_map_flag == xaTRUE) && (jmov->depth > 8) )
  316.                 jmov->pic = (xaUBYTE *) malloc( 3 * jmov->pic_size );
  317.     else jmov->pic = (xaUBYTE *) malloc( XA_PIC_SIZE(jmov->pic_size) );
  318.     if (jmov->pic == 0) TheEnd1("JMOV_Buffer_Action: malloc failed");
  319.   }
  320.   return(xaTRUE);
  321. }
  322.  
  323.  
  324. void JMOV_Read_Index(xin,anim_hdr,jmov,jmov_hdr)
  325. XA_INPUT *xin;
  326. XA_ANIM_HDR *anim_hdr;
  327. XA_ANIM_SETUP *jmov;
  328. JMOV_HDR *jmov_hdr;
  329. { xaLONG ret;
  330.   xaULONG idx_off = jmov_hdr->indexbuf;
  331.   xaULONG idx_cnt = jmov_hdr->frames;
  332.   xaULONG i,*index;
  333.  
  334.  
  335.   index = (xaULONG *)malloc( (idx_cnt + 1) * sizeof(xaULONG) );
  336.  
  337.   ret = xin->Seek_FPos(xin,idx_off,0);
  338.   for(i=0; i<idx_cnt; i++)
  339.   {
  340.     if (xin->At_EOF(xin,-1))
  341.     {
  342.       fprintf(stderr,"JMOV: index truncated cur %d tot %d\n",i,idx_cnt);
  343.       idx_cnt = i;
  344.       break;
  345.     }
  346.     index[i] = xin->Read_MSB_U32(xin);
  347.   }
  348.   index[idx_cnt] = 0;
  349.  
  350.   for(i=0; i<idx_cnt; i++)
  351.   { xaULONG offset = index[i];
  352.     xin->Seek_FPos(xin,offset,0);
  353.     JMOV_Read_Frame(xin,anim_hdr,jmov,jmov_hdr); 
  354.   } 
  355. }
  356.  
  357. #define JMOV_END_FRAME  0xed
  358. #define JMOV_CLR_FRAME  0xee
  359. #define JMOV_AUDIO_0    0xe5
  360. #define JMOV_AUDIO_1    0xe4
  361. #define JMOV_AUDIO_2    0xe3
  362. #define JMOV_AUDIO_3    0xe2
  363. #define JMOV_CMAP       0xd9
  364. #define JMOV_MMAP       0xf8
  365. #define JMOV_FPS        0xdb
  366. #define JMOV_JPEG       0xec
  367.  
  368.  
  369. void JMOV_Read_Frame(xin,anim_hdr,jmov,jmov_hdr)
  370. XA_INPUT *xin;
  371. XA_ANIM_HDR *anim_hdr;
  372. XA_ANIM_SETUP *jmov;
  373. JMOV_HDR *jmov_hdr;
  374. { xaULONG exit_flag;
  375.  
  376.   exit_flag = xaFALSE;
  377.   while( (!xin->At_EOF(xin,-1)) & (exit_flag == xaFALSE))
  378.   { xaULONG type;
  379.     type = xin->Read_U8(xin);
  380.     switch(type)
  381.     {
  382.       case JMOV_END_FRAME:
  383.     DEBUG_LEVEL1 fprintf(stderr,"JMOV: END_FRAME\n");
  384.     exit_flag = xaTRUE;
  385.     break;
  386.       case JMOV_CLR_FRAME:
  387.     DEBUG_LEVEL1 fprintf(stderr,"JMOV: CLR_FRAME\n");
  388.     break;
  389.       case JMOV_AUDIO_0:
  390.       case JMOV_AUDIO_1:
  391.       case JMOV_AUDIO_2:
  392.       case JMOV_AUDIO_3:
  393.     { xaULONG snd_size = jmov_hdr->audioslice;
  394.     DEBUG_LEVEL1 fprintf(stderr,"JMOV: AUDIO %x\n",type);
  395.  
  396.       if (jmov_audio_attempt==xaTRUE)
  397.       { xaLONG ret;
  398.         if (xin->load_flag & XA_IN_LOAD_FILE)
  399.         { xaLONG rets, cur_fpos = xin->Get_FPos(xin);
  400.           rets = XA_Add_Sound(anim_hdr,0,jmov_audio_type, cur_fpos,
  401.             jmov_audio_freq, snd_size, 
  402.             &jmov->aud_time,&jmov->aud_timelo, 0, 0);
  403.           if (rets==xaFALSE) jmov_audio_attempt = xaFALSE;
  404.           xin->Seek_FPos(xin,snd_size,1); /* move past this chunk */
  405.           if (snd_size > jmov->max_faud_size) 
  406.                 jmov->max_faud_size = snd_size;
  407.  
  408.         }
  409.         else
  410.         { xaUBYTE *snd = (xaUBYTE *)malloc(snd_size);
  411.           if (snd==0) TheEnd1("JMOV: snd malloc err");
  412.           ret = xin->Read_Block(xin, snd, snd_size);
  413.           if (ret < snd_size) fprintf(stderr,"JMOV: snd rd err\n");
  414.           else
  415.           { int rets;
  416.             rets = XA_Add_Sound(anim_hdr,snd,jmov_audio_type, -1,
  417.                                         jmov_audio_freq, snd_size,
  418.                                         &jmov->aud_time, &jmov->aud_timelo, 0, 0);
  419.             if (rets==xaFALSE) jmov_audio_attempt = xaFALSE;
  420.           }
  421.         }
  422.       }
  423.       else xin->Seek_FPos(xin,snd_size,1); /* skip over */
  424.     }
  425.     break;
  426.       case JMOV_CMAP:
  427.     { xaULONG size = jmov_hdr->mapsize * 3;
  428.       DEBUG_LEVEL1 fprintf(stderr,"JMOV: CMAP - ignored\n");
  429.           if (jmov_hdr->mapsize > (16*1024) )
  430.       {
  431.         fprintf(stderr,"JMOV: CMAP just too big %d\n",jmov_hdr->mapsize);
  432.         return;
  433.       }
  434.           xin->Seek_FPos(xin,size,1);  /* skip over */
  435.     }
  436.     break;
  437.       case JMOV_MMAP:
  438.     { xaULONG cnt;
  439.       DEBUG_LEVEL1 fprintf(stderr,"JMOV: MMAP - ignored\n");
  440.  
  441.           cnt = xin->Read_U8(xin);
  442.       while(cnt--)
  443.           { xaULONG slot,r,g,b;
  444.         slot = xin->Read_MSB_U16();
  445.         r = xin->Read_U8(xin); g = xin->Read_U8(xin); b = xin->Read_U8(xin);
  446.           }
  447.         }
  448.     break;
  449.       case JMOV_FPS:
  450.         { xaULONG fps;
  451.       DEBUG_LEVEL1 fprintf(stderr,"JMOV: FPS\n");
  452.       fps = xin->Read_MSB_U32(xin);
  453.       UTIL_FPS_2_Time(jmov, ((double)(fps)) );
  454.         }
  455.     break;
  456.       case JMOV_JPEG:
  457.         { xaULONG dlta_len;
  458.       XA_ACTION *act;
  459.           ACT_DLTA_HDR *dlta_hdr;
  460.  
  461.       DEBUG_LEVEL1 fprintf(stderr,"JMOV: JPEG\n");
  462.       dlta_len = xin->Read_MSB_U32(xin);
  463.  
  464.       act = ACT_Get_Action(anim_hdr,ACT_DELTA);
  465.       if (xin->load_flag & XA_IN_LOAD_FILE)
  466.       {
  467.         dlta_hdr = (ACT_DLTA_HDR *) malloc(sizeof(ACT_DLTA_HDR));
  468.         if (dlta_hdr == 0) TheEnd1("JMOV: dlta malloc err");
  469.         act->data = (xaUBYTE *)dlta_hdr;
  470.         dlta_hdr->flags = ACT_SNGL_BUF;
  471.         dlta_hdr->fsize = dlta_len;
  472.         dlta_hdr->fpos  = xin->Get_FPos(xin);
  473.         if (dlta_len > jmov->max_fvid_size) jmov->max_fvid_size = dlta_len;
  474.         xin->Seek_FPos(xin,dlta_len,1);
  475.       }
  476.       else
  477.       { xaULONG d; xaLONG ret;
  478.         d = dlta_len + (sizeof(ACT_DLTA_HDR));
  479.         dlta_hdr = (ACT_DLTA_HDR *) malloc( d );
  480.         if (dlta_hdr == 0) TheEnd1("QT rle: malloc failed");
  481.         act->data = (xaUBYTE *)dlta_hdr;
  482.         dlta_hdr->flags = ACT_SNGL_BUF | DLTA_DATA;
  483.         dlta_hdr->fpos = 0; dlta_hdr->fsize = dlta_len;
  484.         ret = xin->Read_Block(xin, dlta_hdr->data, dlta_len);
  485.         if (ret < dlta_len) { fprintf(stderr,"JMOV: read err\n"); return; }
  486.       }
  487.       JMOV_Add_Frame(jmov->vid_time,jmov->vid_timelo,act);
  488.       dlta_hdr->xpos = dlta_hdr->ypos = 0;
  489.       dlta_hdr->xsize = jmov->imagex;
  490.       dlta_hdr->ysize = jmov->imagey;
  491.       dlta_hdr->special = 0;
  492.       dlta_hdr->extra = (void *)(0x10);
  493.       dlta_hdr->xapi_rev = 0x0002;
  494.       dlta_hdr->delta = JFIF_Decode_JPEG;
  495.       ACT_Setup_Delta(jmov,act,dlta_hdr,xin);
  496.         }
  497.     break;
  498.       default:
  499.     fprintf(stderr,"JMOV: Unknown type %x - aborting\n",type);
  500.     return;
  501.     break;
  502.     } /* end of switch */
  503.   } /* end of while */
  504. }
  505.  
  506.