[cvs] / xvidcore / src / divx4.c Repository:
ViewVC logotype

Diff of /xvidcore/src/divx4.c

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

revision 1.19, Sat Sep 21 03:07:56 2002 UTC revision 1.21.2.2, Mon Jun 9 13:50:12 2003 UTC
# Line 1  Line 1 
1  /**************************************************************************  /*****************************************************************************
2   *   *
3   *  XVID MPEG-4 VIDEO CODEC   *  XVID MPEG-4 VIDEO CODEC
4   *  - OpenDivx API wrapper -   *  - DivX 4.x compatibility layer (Deprecated and not up2date code) -
5   *   *
6   *  Copyright(C) 2001-2002 Peter Ross <pross@xvid.org>   *  Copyright(C) 2001-2003 Peter Ross <pross@xvid.org>
7   *   *               2002-2003 Edouard Gomez <ed.gomez@free.fr>
  *  This program is an implementation of a part of one or more MPEG-4  
  *  Video tools as specified in ISO/IEC 14496-2 standard.  Those intending  
  *  to use this software module in hardware or software products are  
  *  advised that its use may infringe existing patents or copyrights, and  
  *  any such use would be at such party's own risk.  The original  
  *  developer of this software module and his/her company, and subsequent  
  *  editors and their companies, will have no liability for use of this  
  *  software or modifications or derivatives thereof.  
8   *   *
9   *  This program is free software; you can redistribute it and/or modify   *  This program is free software; you can redistribute it and/or modify
10   *  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 26  Line 18 
18   *   *
19   *  You should have received a copy of the GNU General Public License   *  You should have received a copy of the GNU General Public License
20   *  along with this program; if not, write to the Free Software   *  along with this program; if not, write to the Free Software
21   *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22     *
23     * $Id$
24   *   *
25   *************************************************************************/   ****************************************************************************/
26    
27  #include <stdlib.h>  #include <stdlib.h>
28  #include <string.h>  #include <string.h>
# Line 41  Line 35 
35    
36  #define EMULATED_DIVX_VERSION 20011001  #define EMULATED_DIVX_VERSION 20011001
37    
38  /**************************************************************************  /*****************************************************************************
39   * Divx Instance Structure   * Divx Instance Structure
40   *   *
41   * This chain list datatype allows XviD do instanciate multiples divx4   * This chain list datatype allows XviD do instanciate multiples divx4
# Line 51  Line 45 
45   *        because they are not protected by any kind of mutex to allow   *        because they are not protected by any kind of mutex to allow
46   *        only one modifier. We should add a mutex for each element in   *        only one modifier. We should add a mutex for each element in
47   *        the chainlist.   *        the chainlist.
48   *************************************************************************/   ****************************************************************************/
49    
50    
51  typedef struct DINST  typedef struct DINST
# Line 75  Line 69 
69  }  }
70  EINST;  EINST;
71    
72  /**************************************************************************  /*****************************************************************************
73   * Global data (needed to emulate correctly exported symbols from divx4)   * Global data (needed to emulate correctly exported symbols from divx4)
74   *************************************************************************/   ****************************************************************************/
75    
76  /* This is not used in this module but is required by some divx4 encoders*/  /* This is not used in this module but is required by some divx4 encoders*/
77  int quiet_encore = 1;  int quiet_encore = 1;
78    
79  /**************************************************************************  /*****************************************************************************
80   * Local data   * Local data
81   *************************************************************************/   ****************************************************************************/
82    
83  /* The Divx4 instance chainlist */  /* The Divx4 instance chainlist */
84  static DINST *dhead = NULL;  static DINST *dhead = NULL;
# Line 94  Line 88 
88  static int const divx4_motion_presets[7] = {  static int const divx4_motion_presets[7] = {
89          0,          0,
90    
91          PMV_EARLYSTOP16,          0,
92    
93          PMV_EARLYSTOP16 | PMV_ADVANCEDDIAMOND16,          XVID_ME_ADVANCEDDIAMOND16,
94    
95          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16,          XVID_ME_HALFPELREFINE16,
96    
97          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 |          XVID_ME_HALFPELREFINE16 | XVID_ME_HALFPELREFINE8,
                 PMV_HALFPELREFINE8,  
98    
99          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EARLYSTOP8 |          XVID_ME_HALFPELREFINE16 | XVID_ME_HALFPELREFINE8,
                 PMV_HALFPELREFINE8,  
100    
101          PMV_EARLYSTOP16 | PMV_HALFPELREFINE16 | PMV_EXTSEARCH16 | PMV_EARLYSTOP8 |          XVID_ME_HALFPELREFINE16 | XVID_ME_EXTSEARCH16 | XVID_ME_HALFPELREFINE8
                 PMV_HALFPELREFINE8  
102  };  };
103    
104    
# Line 116  Line 107 
107          0,          0,
108          XVID_H263QUANT,          XVID_H263QUANT,
109          XVID_H263QUANT,          XVID_H263QUANT,
110          XVID_H263QUANT | XVID_HALFPEL,          XVID_H263QUANT | XVID_VOP_HALFPEL,
111          XVID_H263QUANT | XVID_INTER4V | XVID_HALFPEL,          XVID_H263QUANT | XVID_VOP_INTER4V | XVID_VOP_HALFPEL,
112          XVID_H263QUANT | XVID_INTER4V | XVID_HALFPEL,          XVID_H263QUANT | XVID_VOP_INTER4V | XVID_VOP_HALFPEL,
113          XVID_H263QUANT | XVID_INTER4V | XVID_HALFPEL          XVID_H263QUANT | XVID_VOP_INTER4V | XVID_VOP_HALFPEL
114  };  };
115    
116  /**************************************************************************  /*****************************************************************************
117   * Local Prototypes   * Local Prototypes
118   *************************************************************************/   ****************************************************************************/
119    
120  /* Chain list helper functions */  /* Chain list helper functions */
121  static DINST *dinst_find(unsigned long key);  static DINST *dinst_find(unsigned long key);
# Line 139  Line 130 
130  static int xvid_to_opendivx_dec_csp(int csp);  static int xvid_to_opendivx_dec_csp(int csp);
131  static int xvid_to_opendivx_enc_csp(int csp);  static int xvid_to_opendivx_enc_csp(int csp);
132    
133  /**************************************************************************  /*****************************************************************************
134   * decore part   * decore part
135   *   *
136   * decore is the divx4 entry point used to decompress the mpeg4 bitstream   * decore is the divx4 entry point used to decompress the mpeg4 bitstream
137   * into a user defined image format.   * into a user defined image format.
138   *************************************************************************/   ****************************************************************************/
139    
140  int  int
141  decore(unsigned long key,  decore(unsigned long key,
# Line 275  Line 266 
266                          }                          }
267    
268                          /* Decode the bitstream */                          /* Decode the bitstream */
269                          xerr = decoder_decode(dcur->handle, &dcur->xframe);                          xerr = decoder_decode(dcur->handle, &dcur->xframe, NULL);
270    
271                          /* Restore the real colorspace for this instance */                          /* Restore the real colorspace for this instance */
272                          if (!dframe->render_flag) {                          if (!dframe->render_flag) {
# Line 310  Line 301 
301          }          }
302  }  }
303    
304  /**************************************************************************  /*****************************************************************************
305   * Encore Part   * Encore Part
306   *   *
307   * encore is the divx4 entry point used to compress a frame to a mpeg4   * encore is the divx4 entry point used to compress a frame to a mpeg4
308   * bitstream.   * bitstream.
309   *************************************************************************/   ****************************************************************************/
310    
311  #define FRAMERATE_INCR          1001  #define FRAMERATE_INCR          1001
312    
# Line 358  Line 349 
349                          xparam.max_quantizer = eparam->max_quantizer;                          xparam.max_quantizer = eparam->max_quantizer;
350                          xparam.max_key_interval = eparam->max_key_interval;                          xparam.max_key_interval = eparam->max_key_interval;
351    
352                            xparam.global = 0;
353                            xparam.max_bframes = -1;        /* use "original" IP-frame encoder */
354                            xparam.bquant_ratio = 200;
355                            xparam.frame_drop_ratio = 0;    /* dont drop frames */
356    
357                          /* Create the encoder session */                          /* Create the encoder session */
358                          xerr = encoder_create(&xparam);                          xerr = encoder_create(&xparam);
359    
# Line 465  Line 461 
461          }          }
462  }  }
463    
464  /**************************************************************************  /*****************************************************************************
465   * Local Functions   * Local Functions
466   *************************************************************************/   ****************************************************************************/
467    
468  /***************************************  /***************************************
469   * DINST chainlist helper functions    *   * DINST chainlist helper functions    *

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.21.2.2

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