[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.33.2.11, Thu Nov 7 10:28:15 2002 UTC revision 1.33.2.14, Wed Nov 20 19:52:32 2002 UTC
# Line 140  Line 140 
140   *   *
141   ****************************************************************************/   ****************************************************************************/
142    
143  int  
144  xvid_init(void *handle,  static
145                    int opt,  int xvid_init_init(XVID_INIT_PARAM * init_param)
                   void *param1,  
                   void *param2)  
146  {  {
147          int cpu_flags;          int cpu_flags;
         XVID_INIT_PARAM *init_param;  
   
         init_param = (XVID_INIT_PARAM *) param1;  
148    
149          /* Inform the client the API version */          /* Inform the client the API version */
150          init_param->api_version = API_VERSION;          init_param->api_version = API_VERSION;
# Line 339  Line 334 
334                  interpolate8x8_6tap_lowpass_h = interpolate8x8_6tap_lowpass_h_mmx;                  interpolate8x8_6tap_lowpass_h = interpolate8x8_6tap_lowpass_h_mmx;
335                  interpolate8x8_6tap_lowpass_v = interpolate8x8_6tap_lowpass_v_mmx;                  interpolate8x8_6tap_lowpass_v = interpolate8x8_6tap_lowpass_v_mmx;
336    
337  //              interpolate8x8_avg2 = interpolate8x8_avg2_mmx;                  interpolate8x8_avg2 = interpolate8x8_avg2_mmx;
338                  interpolate8x8_avg4 = interpolate8x8_avg4_mmx;                  interpolate8x8_avg4 = interpolate8x8_avg4_mmx;
339    
340                  /* image input xxx_to_yv12 related functions */                  /* image input xxx_to_yv12 related functions */
# Line 401  Line 396 
396                  /* Colorspace transformation */                  /* Colorspace transformation */
397                  yv12_to_yv12  = yv12_to_yv12_xmm;                  yv12_to_yv12  = yv12_to_yv12_xmm;
398                  yuyv_to_yv12  = yuyv_to_yv12_xmm;                  yuyv_to_yv12  = yuyv_to_yv12_xmm;
399                  uyvy_to_yv12  = yuyv_to_yv12_xmm;                  uyvy_to_yv12  = uyvy_to_yv12_xmm;
400    
401                  /* ME functions */                  /* ME functions */
402                  sad16 = sad16_xmm;                  sad16 = sad16_xmm;
# Line 487  Line 482 
482          return XVID_ERR_OK;          return XVID_ERR_OK;
483  }  }
484    
485    
486    
487    static int
488    xvid_init_convert(XVID_INIT_CONVERTINFO* convert)
489    {
490            const int flip1 = (convert->input.colorspace & XVID_CSP_VFLIP) ^ (convert->output.colorspace & XVID_CSP_VFLIP);
491            const int width = convert->width;
492            const int height = convert->height;
493            const int width2 = convert->width/2;
494            const int height2 = convert->height/2;
495            IMAGE img;
496    
497            switch (convert->input.colorspace & ~XVID_CSP_VFLIP)
498            {
499                    case XVID_CSP_YV12 :
500                            img.y = convert->input.y;
501                            img.v = (uint8_t*)convert->input.y + width*height;
502                            img.u = (uint8_t*)convert->input.y + width*height + width2*height2;
503                            image_output(&img, width, height, width,
504                                                    convert->output.y, convert->output.y_stride,
505                                                    convert->output.colorspace, convert->interlacing);
506                            break;
507    
508                    default :
509                            return XVID_ERR_FORMAT;
510            }
511    
512    
513            emms();
514            return XVID_ERR_OK;
515    }
516    
517    
518    int
519    xvid_init(void *handle,
520                      int opt,
521                      void *param1,
522                      void *param2)
523    {
524            switch(opt)
525            {
526                    case XVID_INIT_INIT :
527                            return xvid_init_init((XVID_INIT_PARAM*)param1);
528    
529                    case XVID_INIT_CONVERT :
530                            return xvid_init_convert((XVID_INIT_CONVERTINFO*)param1);
531    
532                    default :
533                            return XVID_ERR_FAIL;
534            }
535    }
536    
537  /*****************************************************************************  /*****************************************************************************
538   * XviD Native decoder entry point   * XviD Native decoder entry point
539   *   *

Legend:
Removed from v.1.33.2.11  
changed lines
  Added in v.1.33.2.14

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