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

Diff of /xvidcore/src/xvid.c

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

revision 1.16, Thu Jun 13 13:18:57 2002 UTC revision 1.24, Sun Jul 7 09:38:13 2002 UTC
# Line 26  Line 26 
26  *  along with this program ; if not, write to the Free Software  *  along with this program ; if not, write to the Free Software
27  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
28  *  *
29  *****************************************************************************/   ****************************************************************************/
30    
31  /*****************************************************************************  /*****************************************************************************
32  *  *
33  *  History  *  History
34  *  *
35     *      - 23.06.2002    added XVID_CPU_CHKONLY
36  *  - 17.03.2002 Added interpolate8x8_halfpel_hv_xmm  *  - 17.03.2002 Added interpolate8x8_halfpel_hv_xmm
37  *  - 22.12.2001  API change: added xvid_init() - Isibaar  *  - 22.12.2001  API change: added xvid_init() - Isibaar
38  *  - 16.12.2001 inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>  *  - 16.12.2001 inital version; (c)2001 peter ross <pross@cs.rmit.edu.au>
39  *  *
40  *  $Id$  *  $Id$
41  *  *
42  *****************************************************************************/   ****************************************************************************/
43    
44  #include "xvid.h"  #include "xvid.h"
45  #include "decoder.h"  #include "decoder.h"
# Line 80  Line 82 
82    
83          init_param = (XVID_INIT_PARAM *) param1;          init_param = (XVID_INIT_PARAM *) param1;
84    
85            /* Inform the client the API version */
86            init_param->api_version = API_VERSION;
87    
88            /* Inform the client the core build - unused because we're still alpha */
89            init_param->core_build = 1000;
90    
91            if ((init_param->cpu_flags & XVID_CPU_CHKONLY))
92            {
93                    init_param->cpu_flags = check_cpu_features();
94                    return XVID_ERR_OK;
95            }
96    
97          /* Do we have to force CPU features  ? */          /* Do we have to force CPU features  ? */
98          if ((init_param->cpu_flags & XVID_CPU_FORCE) > 0) {          if ((init_param->cpu_flags & XVID_CPU_FORCE) > 0) {
99                  cpu_flags = init_param->cpu_flags;                  cpu_flags = init_param->cpu_flags;
100          } else {          } else {
101    
 #ifdef ARCH_X86  
102                  cpu_flags = check_cpu_features();                  cpu_flags = check_cpu_features();
 #else  
                 cpu_flags = 0;  
 #endif  
103                  init_param->cpu_flags = cpu_flags;                  init_param->cpu_flags = cpu_flags;
104          }          }
105    
# Line 184  Line 194 
194                  transfer_8to16copy = transfer_8to16copy_mmx;                  transfer_8to16copy = transfer_8to16copy_mmx;
195                  transfer_16to8copy = transfer_16to8copy_mmx;                  transfer_16to8copy = transfer_16to8copy_mmx;
196                  transfer_8to16sub  = transfer_8to16sub_mmx;                  transfer_8to16sub  = transfer_8to16sub_mmx;
197                    transfer_8to16sub2 = transfer_8to16sub2_mmx;
198                  transfer_16to8add  = transfer_16to8add_mmx;                  transfer_16to8add  = transfer_16to8add_mmx;
199                  transfer8x8_copy   = transfer8x8_copy_mmx;                  transfer8x8_copy   = transfer8x8_copy_mmx;
200    
201    
202                  /* Image Interpolation related functions */                  /* Image Interpolation related functions */
203                  interpolate8x8_halfpel_h  = interpolate8x8_halfpel_h_mmx;                  interpolate8x8_halfpel_h  = interpolate8x8_halfpel_h_mmx;
204                  interpolate8x8_halfpel_v  = interpolate8x8_halfpel_v_mmx;                  interpolate8x8_halfpel_v  = interpolate8x8_halfpel_v_mmx;
# Line 223  Line 235 
235                  interpolate8x8_halfpel_v  = interpolate8x8_halfpel_v_xmm;                  interpolate8x8_halfpel_v  = interpolate8x8_halfpel_v_xmm;
236                  interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_xmm;                  interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_xmm;
237    
238                    /* Buffer transfer */
239                    transfer_8to16sub2 = transfer_8to16sub2_xmm;
240    
241                  /* Colorspace transformation */                  /* Colorspace transformation */
242                  yuv_to_yv12 = yuv_to_yv12_xmm;                  yuv_to_yv12 = yuv_to_yv12_xmm;
243    
244                  /* ME functions */                  /* ME functions */
245                  sad16 = sad16_xmm;                  sad16 = sad16_xmm;
246                    sad16bi = sad16bi_xmm;
247                  sad8  = sad8_xmm;                  sad8  = sad8_xmm;
248                  dev16 = dev16_xmm;                  dev16 = dev16_xmm;
249    
# Line 244  Line 260 
260          if ((cpu_flags & XVID_CPU_SSE2) > 0) {          if ((cpu_flags & XVID_CPU_SSE2) > 0) {
261  #ifdef EXPERIMENTAL_SSE2_CODE  #ifdef EXPERIMENTAL_SSE2_CODE
262    
263                    calc_cbp = calc_cbp_sse2;
264    
265                  /* Quantization */                  /* Quantization */
266                  quant_intra   = quant_intra_sse2;                  quant_intra   = quant_intra_sse2;
267                  dequant_intra = dequant_intra_sse2;                  dequant_intra = dequant_intra_sse2;
# Line 251  Line 269 
269                  dequant_inter = dequant_inter_sse2;                  dequant_inter = dequant_inter_sse2;
270    
271                  /* ME */                  /* ME */
                 calc_cbp = calc_cbp_sse2;  
272                  sad16    = sad16_sse2;                  sad16    = sad16_sse2;
273                  dev16    = dev16_sse2;                  dev16    = dev16_sse2;
274    
# Line 263  Line 280 
280    
281  #endif  #endif
282    
283    #ifdef ARCH_IA64
284            if ((cpu_flags & XVID_CPU_IA64) > 0) { //use assembler routines?
285              idct_ia64_init();
286              fdct = fdct_ia64;
287              idct = idct_ia64;   //not yet working, crashes
288              interpolate8x8_halfpel_h = interpolate8x8_halfpel_h_ia64;
289              interpolate8x8_halfpel_v = interpolate8x8_halfpel_v_ia64;
290              interpolate8x8_halfpel_hv = interpolate8x8_halfpel_hv_ia64;
291              sad16 = sad16_ia64;
292              sad16bi = sad16bi_ia64;
293              sad8 = sad8_ia64;
294              dev16 = dev16_ia64;
295              quant_intra = quant_intra_ia64;
296              dequant_intra = dequant_intra_ia64;
297              quant_inter = quant_inter_ia64;
298              dequant_inter = dequant_inter_ia64;
299              transfer_8to16copy = transfer_8to16copy_ia64;
300              transfer_16to8copy = transfer_16to8copy_ia64;
301              transfer_8to16sub = transfer_8to16sub_ia64;
302              transfer_8to16sub2 = transfer_8to16sub2_ia64;
303              transfer_16to8add = transfer_16to8add_ia64;
304              transfer8x8_copy = transfer8x8_copy_ia64;
305              DEBUG("Using IA-64 assembler routines.\n");
306            }
307    #endif
308    
309  #ifdef ARCH_PPC  #ifdef ARCH_PPC
310  #ifdef ARCH_PPC_ALTIVEC  #ifdef ARCH_PPC_ALTIVEC
311          calc_cbp = calc_cbp_altivec;          calc_cbp = calc_cbp_altivec;
# Line 277  Line 320 
320  #endif  #endif
321  #endif  #endif
322    
         /* Inform the client the API version */  
         init_param->api_version = API_VERSION;  
   
         /* Inform the client the core build - unused because we're still alpha */  
         init_param->core_build = 1000;  
   
323          return XVID_ERR_OK;          return XVID_ERR_OK;
324  }  }
325    
# Line 336  Line 373 
373  {  {
374          switch (opt) {          switch (opt) {
375          case XVID_ENC_ENCODE:          case XVID_ENC_ENCODE:
376    #ifdef BFRAMES
377                    if (((Encoder *) handle)->mbParam.max_bframes >= 0)
378                    return encoder_encode_bframes((Encoder *) handle, (XVID_ENC_FRAME *) param1,
379                                                              (XVID_ENC_STATS *) param2);
380                    else
381    #endif
382                  return encoder_encode((Encoder *) handle, (XVID_ENC_FRAME *) param1,                  return encoder_encode((Encoder *) handle, (XVID_ENC_FRAME *) param1,
383                                                            (XVID_ENC_STATS *) param2);                                                            (XVID_ENC_STATS *) param2);
384    

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.24

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