[svn] / branches / dev-api-4 / xvidcore / examples / xvid_decraw.c Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/examples/xvid_decraw.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

trunk/xvidcore/examples/xvid_decraw.c revision 551, Fri Sep 27 20:58:30 2002 UTC branches/dev-api-4/xvidcore/examples/xvid_decraw.c revision 945, Wed Mar 26 10:29:51 2003 UTC
# Line 3  Line 3 
3   *  XVID MPEG-4 VIDEO CODEC   *  XVID MPEG-4 VIDEO CODEC
4   *  - Console based decoding test application  -   *  - Console based decoding test application  -
5   *   *
6   *  Copyright(C) 2002 Christoph Lampert   *  Copyright(C) 2002-2003 Christoph Lampert
7   *   *
8   *  This program is free software; you can redistribute it and/or modify   *  This program is free software; you can redistribute it and/or modify
9   *  it under the terms of the GNU General Public License as published by   *  it under the terms of the GNU General Public License as published by
# Line 19  Line 19 
19   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: xvid_decraw.c,v 1.3 2002-09-27 20:58:30 edgomez Exp $   * $Id: xvid_decraw.c,v 1.7.2.2 2003-03-26 10:29:10 suxen_drol Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 41  Line 41 
41   * Usage : xvid_decraw <-w width> <-h height> [OPTIONS]   * Usage : xvid_decraw <-w width> <-h height> [OPTIONS]
42   * Options :   * Options :
43   *  -asm           : use assembly optimizations (default=disabled)   *  -asm           : use assembly optimizations (default=disabled)
  *  -w integer     : frame width ([1.2048])  
  *  -h integer     : frame height ([1.2048])  
44   *  -i string      : input filename (default=stdin)   *  -i string      : input filename (default=stdin)
45   *  -t integer     : input data type (raw=0, mp4u=1)   *  -t integer     : input data type (raw=0, mp4u=1)
46   *  -d boolean     : save decoder output (0 False*, !=0 True)   *  -d             : save decoder output (0 False*, !=0 True)
47   *  -m boolean     : save mpeg4 raw stream to single files (0 False*, !=0 True)   *  -m             : save mpeg4 raw stream to single files (0 False*, !=0 True)
48   *  -help          : This help message   *  -help          : This help message
49   * (* means default)   * (* means default)
50   *   *
# Line 56  Line 54 
54  #include <stdlib.h>  #include <stdlib.h>
55  #include <string.h>  #include <string.h>
56  #include <math.h>  #include <math.h>
57  #ifndef _MSC_VER  #ifndef WIN32
58  #include <sys/time.h>  #include <sys/time.h>
59  #else  #else
60  #include <time.h>  #include <time.h>
# Line 75  Line 73 
73  static int YDIM = 0;  static int YDIM = 0;
74  static int ARG_SAVEDECOUTPUT = 0;  static int ARG_SAVEDECOUTPUT = 0;
75  static int ARG_SAVEMPEGSTREAM = 0;  static int ARG_SAVEMPEGSTREAM = 0;
 static int ARG_STREAMTYPE = 0;  
76  static char *ARG_INPUTFILE = NULL;  static char *ARG_INPUTFILE = NULL;
77    
78    
79  static char filepath[256] = "./";  static char filepath[256] = "./";
80  static void *dec_handle = NULL;  static void *dec_handle = NULL;
81    
82  # define BUFFER_SIZE 10*XDIM*YDIM  # define BUFFER_SIZE (2*1024*1024)
   
 #define LONG_PACK(a,b,c,d) ((long) (((long)(a))<<24) | (((long)(b))<<16) | \  
                                    (((long)(c))<<8)  |((long)(d)))  
   
 #define SWAP(a) ( (((a)&0x000000ff)<<24) | (((a)&0x0000ff00)<<8) | \  
                   (((a)&0x00ff0000)>>8)  | (((a)&0xff000000)>>24) )  
83    
84  /*****************************************************************************  /*****************************************************************************
85   *               Local prototypes   *               Local prototypes
# Line 101  Line 92 
92  static int dec_main(unsigned char *istream,  static int dec_main(unsigned char *istream,
93                      unsigned char *ostream,                      unsigned char *ostream,
94                      int istream_size,                      int istream_size,
95                      int *ostream_size);                                          xvid_dec_stats_t *xvid_dec_stats);
96  static int dec_stop();  static int dec_stop();
97  static void usage();  static void usage();
98    
99    
100    const char * type2str(int type)
101    {
102        if (type==XVID_TYPE_IVOP)
103            return "I";
104        if (type==XVID_TYPE_PVOP)
105            return "P";
106        if (type==XVID_TYPE_BVOP)
107            return "B";
108        return "S";
109    }
110    
111  /*****************************************************************************  /*****************************************************************************
112   *        Main program   *        Main program
113   ****************************************************************************/   ****************************************************************************/
# Line 114  Line 117 
117          unsigned char *mp4_buffer = NULL;          unsigned char *mp4_buffer = NULL;
118          unsigned char *mp4_ptr    = NULL;          unsigned char *mp4_ptr    = NULL;
119          unsigned char *out_buffer = NULL;          unsigned char *out_buffer = NULL;
120          int bigendian = 0;          int still_left_in_buffer;
121            xvid_dec_stats_t xvid_dec_stats;
122    
123          double totaldectime;          double totaldectime;
124    
# Line 130  Line 134 
134          int i;          int i;
135    
136          printf("xvid_decraw - raw mpeg4 bitstream decoder ");          printf("xvid_decraw - raw mpeg4 bitstream decoder ");
137          printf("written by Christoph Lampert 2002\n\n");          printf("written by Christoph Lampert 2002-2003\n\n");
138    
139  /*****************************************************************************  /*****************************************************************************
140   * Command line parsing   * Command line parsing
# Line 141  Line 145 
145                  if (strcmp("-asm", argv[i]) == 0 ) {                  if (strcmp("-asm", argv[i]) == 0 ) {
146                          use_assembler = 1;                          use_assembler = 1;
147                  }                  }
148                  else if (strcmp("-w", argv[i]) == 0 && i < argc - 1 ) {                  else if (strcmp("-d", argv[i]) == 0) {
149                          i++;                          ARG_SAVEDECOUTPUT = 1;
                         XDIM = atoi(argv[i]);  
                 }  
                 else if (strcmp("-h", argv[i]) == 0 && i < argc - 1 ) {  
                         i++;  
                         YDIM = atoi(argv[i]);  
                 }  
                 else if (strcmp("-d", argv[i]) == 0 && i < argc - 1 ) {  
                         i++;  
                         ARG_SAVEDECOUTPUT = atoi(argv[i]);  
150                  }                  }
151                  else if (strcmp("-i", argv[i]) == 0 && i < argc - 1 ) {                  else if (strcmp("-i", argv[i]) == 0 && i < argc - 1 ) {
152                          i++;                          i++;
153                          ARG_INPUTFILE = argv[i];                          ARG_INPUTFILE = argv[i];
154                  }                  }
155                  else if (strcmp("-m", argv[i]) == 0 && i < argc - 1 ) {                  else if (strcmp("-m", argv[i]) == 0) {
156                          i++;                          ARG_SAVEMPEGSTREAM = 1;
                         ARG_SAVEMPEGSTREAM = atoi(argv[i]);  
                 }  
                 else if (strcmp("-t", argv[i]) == 0 && i < argc - 1 ) {  
                         i++;  
                         ARG_STREAMTYPE = atoi(argv[i]);  
157                  }                  }
158                  else if (strcmp("-help", argv[i])) {                  else if (strcmp("-help", argv[i])) {
159                          usage();                          usage();
# Line 180  Line 170 
170   * Values checking   * Values checking
171   ****************************************************************************/   ****************************************************************************/
172    
         if(XDIM <= 0 || XDIM > 2048 || YDIM <= 0 || YDIM > 2048) {  
                 usage();  
                 return -1;  
         }  
   
173          if ( ARG_INPUTFILE == NULL || strcmp(ARG_INPUTFILE, "stdin") == 0) {          if ( ARG_INPUTFILE == NULL || strcmp(ARG_INPUTFILE, "stdin") == 0) {
174                  in_file = stdin;                  in_file = stdin;
175          }          }
# Line 193  Line 178 
178                  in_file = fopen(ARG_INPUTFILE, "rb");                  in_file = fopen(ARG_INPUTFILE, "rb");
179                  if (in_file == NULL) {                  if (in_file == NULL) {
180                          fprintf(stderr, "Error opening input file %s\n", ARG_INPUTFILE);                          fprintf(stderr, "Error opening input file %s\n", ARG_INPUTFILE);
181                          return -1;                          return(-1);
182                  }                  }
183          }          }
184    
# Line 207  Line 192 
192          if (!mp4_buffer)          if (!mp4_buffer)
193                  goto free_all_memory;                  goto free_all_memory;
194    
         /* Memory for frame output */  
         out_buffer = (unsigned char *) malloc(XDIM*YDIM*4);  
         if (!out_buffer)  
                 goto free_all_memory;  
   
   
195  /*****************************************************************************  /*****************************************************************************
196   *        XviD PART  Start   *        XviD PART  Start
197   ****************************************************************************/   ****************************************************************************/
# Line 229  Line 208 
208   *                               Main loop   *                               Main loop
209   ****************************************************************************/   ****************************************************************************/
210    
211          if(ARG_STREAMTYPE) {          /* Fill the buffer */
212            still_left_in_buffer = fread(mp4_buffer, 1, BUFFER_SIZE, in_file);
                 unsigned char header[4];  
   
                 /* MP4U format  : read header */  
                 if(feof(in_file))  
                         goto release_all;  
                 fread(header, 4, 1, in_file);  
   
                 if(header[0] != '2' || header[1] != 'M' ||  
                    header[2] != 'O' || header[3] != 'G') {  
                         fprintf(stderr, "Error, this not a mp4u container file\n");  
                         goto release_all;  
                 }  
   
         }  
   
         totalsize = LONG_PACK('M','P','4','U');  
         mp4_ptr = (unsigned char *)&totalsize;  
         if(*mp4_ptr == 'M')  
                 bigendian = 1;  
         else  
                 bigendian = 0;  
213    
214          totaldectime = 0;          totaldectime = 0;
215          totalsize = 0;          totalsize = 0;
# Line 264  Line 222 
222                  int used_bytes = 0;                  int used_bytes = 0;
223                  double dectime;                  double dectime;
224    
                 /* Read data from input file */  
                 if(ARG_STREAMTYPE) {  
   
                         /* MP4U container */  
   
                         /* Read stream size first */  
                         if(feof(in_file))  
                                 break;  
                         fread(&mp4_size, sizeof(long), 1, in_file);  
   
                         if(bigendian)  
                                 mp4_size = SWAP(mp4_size);  
   
                         /* Read mp4_size_bytes */  
                         if(feof(in_file))  
                                 break;  
                         fread(mp4_buffer, mp4_size, 1, in_file);  
   
225                          /*                          /*
226                           * When reading mp4u, we don't have to care about buffer                   * If the buffer is half empty or there are no more bytes in it
227                           * filling as we know exactly how much bytes there are in                   * then fill it.
                          * next frame  
228                           */                           */
229                          mp4_ptr = mp4_buffer;                  if (mp4_ptr > mp4_buffer + BUFFER_SIZE/2 ||
230                            still_left_in_buffer <= 0) {
                 }  
                 else {  
   
                         /* Real raw stream */  
   
                         /* buffer more than half empty -> Fill it */  
                         if (mp4_ptr > mp4_buffer + BUFFER_SIZE/2) {  
231                                  int rest = (mp4_buffer + BUFFER_SIZE - mp4_ptr);                                  int rest = (mp4_buffer + BUFFER_SIZE - mp4_ptr);
232    
233                                  /* Move data if needed */                                  /* Move data if needed */
# Line 308  Line 240 
240                                  /* read new data */                                  /* read new data */
241                                  if(feof(in_file))                                  if(feof(in_file))
242                                          break;                                          break;
243                                  fread(mp4_buffer + rest, BUFFER_SIZE - rest, 1, in_file);  
244                          }                          still_left_in_buffer = fread(mp4_buffer + rest,
245                                                                                     1,
246                                                                                     BUFFER_SIZE - rest,
247                                                                                     in_file);
248    
249                  }                  }
250    
251    
252                    /* This loop is needed to handle VOL/NVOP reading */
253                    do {
254    
255                  /* Decode frame */                  /* Decode frame */
256                  dectime = msecond();                  dectime = msecond();
257                  status = dec_main(mp4_ptr, out_buffer, mp4_size, &used_bytes);                          used_bytes = dec_main(mp4_ptr, out_buffer, mp4_size, &xvid_dec_stats);
258                  dectime = msecond() - dectime;                  dectime = msecond() - dectime;
259    
260                  if (status) {                          /* Resize image buffer if needed */
261                          break;                          if(xvid_dec_stats.type == XVID_TYPE_VOL) {
262    
263                                    /* Free old output buffer*/
264                                    if(out_buffer) free(out_buffer);
265    
266                                    /* Copy witdh and height from the vol structure */
267                                    XDIM = xvid_dec_stats.data.vol.width;
268                                    YDIM = xvid_dec_stats.data.vol.height;
269    
270                                    /* Allocate the new buffer */
271                                    if((out_buffer = (unsigned char*)malloc(XDIM*YDIM*4)) == NULL)
272                                            goto free_all_memory;
273                  }                  }
274    
275                  /*                          /* Update buffer pointers */
276                   * Only needed for real raw stream, mp4u uses                          if(used_bytes > 0) {
                  * mp4_ptr = mp4_buffer for each frame  
                  */  
277                  mp4_ptr += used_bytes;                  mp4_ptr += used_bytes;
278                                    still_left_in_buffer -= used_bytes;
279    
280                  /* Updated data */                                  /* Total size */
281                  totalsize += used_bytes;                  totalsize += used_bytes;
282                            }
283    
284                    }while(xvid_dec_stats.type <= 0 && still_left_in_buffer > 0);
285    
286                    /* Negative buffer would mean we went too far */
287            if(still_left_in_buffer <= 0)
288                break;
289    
290            /* Updated data - Count only usefull decode time */
291                  totaldectime += dectime;                  totaldectime += dectime;
292    
                 /* Prints some decoding stats */  
                 printf("Frame %5d: dectime =%6.1f ms length=%7d bytes \n",  
                        filenr, dectime, used_bytes);  
293    
294                  /* Save individual mpeg4 strean if required */          printf("Frame %5d: type = %s, dectime(ms) =%6.1f, length(bytes) =%7d\n",
295                               filenr, type2str(xvid_dec_stats.type), dectime, used_bytes);
296    
297                    /* Save individual mpeg4 stream if required */
298                  if (ARG_SAVEMPEGSTREAM) {                  if (ARG_SAVEMPEGSTREAM) {
299                          FILE *filehandle = NULL;                          FILE *filehandle = NULL;
300    
# Line 348  Line 306 
306                                          filename);                                          filename);
307                          }                          }
308                          else {                          else {
309                                  fwrite(mp4_buffer, used_bytes, 1, filehandle);                                  fwrite(mp4_buffer, 1, used_bytes, filehandle);
310                                  fclose(filehandle);                                  fclose(filehandle);
311                          }                          }
312                  }                  }
313    
   
314                  /* Save output frame if required */                  /* Save output frame if required */
315                  if (ARG_SAVEDECOUTPUT) {                  if (ARG_SAVEDECOUTPUT) {
316                          sprintf(filename, "%sdec%05d.pgm", filepath, filenr);                          sprintf(filename, "%sdec%05d.pgm", filepath, filenr);
# Line 368  Line 325 
325    
326          } while ( (status>=0) && (filenr<ABS_MAXFRAMENR) );          } while ( (status>=0) && (filenr<ABS_MAXFRAMENR) );
327    
328    /*****************************************************************************
329     *     Flush decoder buffers
330     ****************************************************************************/
331    
332            do {
333    
334                    /* Fake vars */
335                    int used_bytes;
336                    double dectime;
337    
338            do {
339                        dectime = msecond();
340                        used_bytes = dec_main(NULL, out_buffer, -1, &xvid_dec_stats);
341                        dectime = msecond() - dectime;
342            }while(used_bytes>=0 && xvid_dec_stats.type <= 0);
343    
344            if (used_bytes < 0) {   /* XVID_ERR_END */
345                break;
346            }
347    
348                    /* Updated data - Count only usefull decode time */
349                    totaldectime += dectime;
350    
351                    /* Prints some decoding stats */
352            printf("Frame %5d: type = %s, dectime(ms) =%6.1f, length(bytes) =%7d\n",
353                               filenr, type2str(xvid_dec_stats.type), dectime, used_bytes);
354    
355                    /* Save output frame if required */
356                    if (ARG_SAVEDECOUTPUT) {
357                            sprintf(filename, "%sdec%05d.pgm", filepath, filenr);
358                            if(write_pgm(filename, out_buffer)) {
359                                    fprintf(stderr,
360                                                    "Error writing decoded PGM frame %s\n",
361                                                    filename);
362                            }
363                    }
364    
365                    filenr++;
366    
367            }while(1);
368    
369  /*****************************************************************************  /*****************************************************************************
370   *     Calculate totals and averages for output, print results   *     Calculate totals and averages for output, print results
# Line 376  Line 373 
373          totalsize    /= filenr;          totalsize    /= filenr;
374          totaldectime /= filenr;          totaldectime /= filenr;
375    
376          printf("Avg: dectime %5.2f ms, %5.2f fps, mp4 stream size =%d\n",          printf("Avg: dectime(ms) =%7.2f, fps =%7.2f, length(bytes) =%7d\n",
377                  totaldectime, 1000/totaldectime, totalsize);                     totaldectime, 1000/totaldectime, (int)totalsize);
378    
379  /*****************************************************************************  /*****************************************************************************
380   *      XviD PART  Stop   *      XviD PART  Stop
381  /****************************************************************************/   ****************************************************************************/
382    
383   release_all:   release_all:
384          if (dec_handle) {          if (dec_handle) {
# Line 394  Line 391 
391          free(out_buffer);          free(out_buffer);
392          free(mp4_buffer);          free(mp4_buffer);
393    
394          return 0;          return(0);
395  }  }
396    
397  /*****************************************************************************  /*****************************************************************************
# Line 407  Line 404 
404          fprintf(stderr, "Usage : xvid_decraw <-w width> <-h height> [OPTIONS]\n");          fprintf(stderr, "Usage : xvid_decraw <-w width> <-h height> [OPTIONS]\n");
405          fprintf(stderr, "Options :\n");          fprintf(stderr, "Options :\n");
406          fprintf(stderr, " -asm           : use assembly optimizations (default=disabled)\n");          fprintf(stderr, " -asm           : use assembly optimizations (default=disabled)\n");
         fprintf(stderr, " -w integer     : frame width ([1.2048])\n");  
         fprintf(stderr, " -h integer     : frame height ([1.2048])\n");  
407          fprintf(stderr, " -i string      : input filename (default=stdin)\n");          fprintf(stderr, " -i string      : input filename (default=stdin)\n");
408          fprintf(stderr, " -t integer     : input data type (raw=0, mp4u=1)\n");          fprintf(stderr, " -t integer     : input data type (raw=0, mp4u=1)\n");
409          fprintf(stderr, " -d boolean     : save decoder output (0 False*, !=0 True)\n");          fprintf(stderr, " -d             : save decoder output\n");
410          fprintf(stderr, " -m boolean     : save mpeg4 raw stream to individual files (0 False*, !=0 True)\n");          fprintf(stderr, " -m             : save mpeg4 raw stream to individual files\n");
411          fprintf(stderr, " -help          : This help message\n");          fprintf(stderr, " -help          : This help message\n");
412          fprintf(stderr, " (* means default)\n");          fprintf(stderr, " (* means default)\n");
413    
# Line 426  Line 421 
421  static double  static double
422  msecond()  msecond()
423  {  {
424  #ifndef _MSC_VER  #ifndef WIN32
425          struct timeval  tv;          struct timeval  tv;
426          gettimeofday(&tv, 0);          gettimeofday(&tv, 0);
427          return (double)tv.tv_sec*1.0e3 + (double)tv.tv_usec*1.0e-3;          return((double)tv.tv_sec*1.0e3 + (double)tv.tv_usec*1.0e-3);
428  #else  #else
429          clock_t clk;          clock_t clk;
430          clk = clock();          clk = clock();
431          return clk * 1000 / CLOCKS_PER_SEC;          return(clk * 1000 / CLOCKS_PER_SEC);
432  #endif  #endif
433  }  }
434    
   
435  /*****************************************************************************  /*****************************************************************************
436   *              output functions   *              output functions
437   ****************************************************************************/   ****************************************************************************/
# Line 479  Line 473 
473                  /* Close file */                  /* Close file */
474                  fclose(filehandle);                  fclose(filehandle);
475    
476                  return 0;                  return(0);
477          }          }
478          else          else
479                  return 1;                  return(1);
480  }  }
481    
482  /*****************************************************************************  /*****************************************************************************
# Line 493  Line 487 
487  static int  static int
488  dec_init(int use_assembler)  dec_init(int use_assembler)
489  {  {
490          int xerr;          int ret;
491    
492            xvid_gbl_init_t   xvid_gbl_init;
493            xvid_dec_create_t xvid_dec_create;
494    
495          XVID_INIT_PARAM xinit;          /*------------------------------------------------------------------------
496          XVID_DEC_PARAM xparam;           * XviD core initialization
497             *----------------------------------------------------------------------*/
498    
499            /* Version */
500            xvid_gbl_init.version = XVID_VERSION;
501    
502            /* Assembly setting */
503                  if(use_assembler)                  if(use_assembler)
504  #ifdef ARCH_IA64  #ifdef ARCH_IS_IA64
505                          xinit.cpu_flags = XVID_CPU_FORCE | XVID_CPU_IA64;                  xvid_gbl_init.cpu_flags = XVID_CPU_FORCE | XVID_CPU_IA64;
506  #else  #else
507                          xinit.cpu_flags = 0;          xvid_gbl_init.cpu_flags = 0;
508  #endif  #endif
509                  else                  else
510                          xinit.cpu_flags = XVID_CPU_FORCE;                  xvid_gbl_init.cpu_flags = XVID_CPU_FORCE;
511    
512            xvid_global(NULL, 0, &xvid_gbl_init, NULL);
513    
514            /*------------------------------------------------------------------------
515             * XviD encoder initialization
516             *----------------------------------------------------------------------*/
517    
518          xvid_init(NULL, 0, &xinit, NULL);          /* Version */
519          xparam.width = XDIM;          xvid_dec_create.version = XVID_VERSION;
         xparam.height = YDIM;  
520    
521          xerr = xvid_decore(NULL, XVID_DEC_CREATE, &xparam, NULL);          /*
522          dec_handle = xparam.handle;           * Image dimensions -- set to 0, xvidcore will resize when ever it is
523             * needed
524             */
525            xvid_dec_create.width = 0;
526            xvid_dec_create.height = 0;
527    
528            ret = xvid_decore(NULL, XVID_DEC_CREATE, &xvid_dec_create, NULL);
529    
530            dec_handle = xvid_dec_create.handle;
531    
532          return xerr;          return(ret);
533  }  }
534    
535  /* decode one frame  */  /* decode one frame  */
# Line 522  Line 537 
537  dec_main(unsigned char *istream,  dec_main(unsigned char *istream,
538           unsigned char *ostream,           unsigned char *ostream,
539           int istream_size,           int istream_size,
540           int *ostream_size)                   xvid_dec_stats_t *xvid_dec_stats)
541  {  {
542    
543          int xerr;          int ret;
544          XVID_DEC_FRAME xframe;  
545            xvid_dec_frame_t xvid_dec_frame;
546    
547            /* Set version */
548            xvid_dec_frame.version = XVID_VERSION;
549            xvid_dec_stats->version = XVID_VERSION;
550    
551            /* No general flags to set */
552            xvid_dec_frame.general          = 0;
553    
554          xframe.bitstream = istream;          /* Input stream */
555          xframe.length = istream_size;          xvid_dec_frame.bitstream        = istream;
556          xframe.image = ostream;          xvid_dec_frame.length           = istream_size;
         xframe.stride = XDIM;  
         xframe.colorspace = XVID_CSP_YV12;  
557    
558          xerr = xvid_decore(dec_handle, XVID_DEC_DECODE, &xframe, NULL);          /* Output frame structure */
559            xvid_dec_frame.output.plane[0]  = ostream;
560            xvid_dec_frame.output.stride[0] = XDIM;
561            xvid_dec_frame.output.csp       = XVID_CSP_I420;
562    
563          *ostream_size = xframe.length;          ret = xvid_decore(dec_handle, XVID_DEC_DECODE, &xvid_dec_frame, xvid_dec_stats);
564    
565          return xerr;          return(ret);
566  }  }
567    
568  /* close decoder to release resources */  /* close decoder to release resources */
569  static int  static int
570  dec_stop()  dec_stop()
571  {  {
572          int xerr;          int ret;
573    
574          xerr = xvid_decore(dec_handle, XVID_DEC_DESTROY, NULL, NULL);          ret = xvid_decore(dec_handle, XVID_DEC_DESTROY, NULL, NULL);
575    
576          return xerr;          return(ret);
577  }  }

Legend:
Removed from v.551  
changed lines
  Added in v.945

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4