[svn] / trunk / xvidcore / examples / ex1 / ex1.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/examples/ex1/ex1.c

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

revision 183, Mon May 27 01:10:37 2002 UTC revision 185, Tue May 28 01:16:06 2002 UTC
# Line 1  Line 1 
1  /*******************************************************************************  /*******************************************************************************
2  * This file is a example for how to use the xvid core to compress YUV file  * This file is a example for how to use the xvid core to compress YUV file
3  *  *
4  *  * 0.01b   28.05.2002    chenm001<chenm001@163.com>
5    *                       fix a little bug for encode only codec I frame
6  * 0.01a   27.05.2002    chenm001<chenm001@163.com>  * 0.01a   27.05.2002    chenm001<chenm001@163.com>
7  *                       fix a little bug for BFRAMES define locate  *                       fix a little bug for BFRAMES define locate
8  * 0.01    23.05.2002    chenm001<chenm001@163.com>  * 0.01    23.05.2002    chenm001<chenm001@163.com>
# Line 118  Line 119 
119          // Encode Frame          // Encode Frame
120          temp=fread(inBuf, 1, width*height*3/2, fpi);    // Read YUV data          temp=fread(inBuf, 1, width*height*3/2, fpi);    // Read YUV data
121          while(temp == width*height*3/2){          while(temp == width*height*3/2){
122                    //printf("Frames=%d\n",num);
123                  set_enc_frame(&frame);                  set_enc_frame(&frame);
124                  if (!(num%param.max_key_interval))                  if (!(num%param.max_key_interval))
125                          frame.intra = 1;        // Encode as I-frame                          frame.intra = 1;        // Encode as I-frame
# Line 126  Line 128 
128                  xvid_encore(param.handle, XVID_ENC_ENCODE, &frame, &stats);                  xvid_encore(param.handle, XVID_ENC_ENCODE, &frame, &stats);
129                  fwrite(outBuf, 1, frame.length, fpo);                  fwrite(outBuf, 1, frame.length, fpo);
130                  temp=fread(inBuf, 1, width*height*3/2, fpi);    // Read next YUV data                  temp=fread(inBuf, 1, width*height*3/2, fpi);    // Read next YUV data
131                    num++;
132          }          }
133    
134          // Free Encode Core          // Free Encode Core

Legend:
Removed from v.183  
changed lines
  Added in v.185

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