[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.12, Thu Nov 7 15:21:31 2002 UTC revision 1.33.2.13, Fri Nov 8 10:10:48 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 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.12  
changed lines
  Added in v.1.33.2.13

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