summaryrefslogtreecommitdiff
path: root/libfame/libfame-0.9.1-mmx.patch
blob: 6d20bc9e8496fc43e866136b93743a87a38ced39 (plain)
    1 diff -pruN libfame-0.9.1.orig/src/fame_decoder_mpeg.c libfame-0.9.1/src/fame_decoder_mpeg.c
    2 --- libfame-0.9.1.orig/src/fame_decoder_mpeg.c	2008-08-02 22:44:06.860141435 +1000
    3 +++ libfame-0.9.1/src/fame_decoder_mpeg.c	2008-08-02 22:55:42.516142586 +1000
    4 @@ -78,7 +78,9 @@ static void mpeg_pad(fame_decoder_t *dec
    5  		     fame_box_t *box);
    6  static void mpeg_interpolate(fame_decoder_t *decoder, int rounding);
    7  static void mpeg_leave(fame_decoder_t *decoder);
    8 +#ifdef HAS_MMX
    9  static void mpeg_close(fame_decoder_t *decoder);
   10 +#endif
   11  
   12  FAME_CONSTRUCTOR(fame_decoder_mpeg_t)
   13  {
   14 @@ -90,7 +92,11 @@ FAME_CONSTRUCTOR(fame_decoder_mpeg_t)
   15    FAME_DECODER(this)->pad = mpeg_pad;
   16    FAME_DECODER(this)->interpolate = mpeg_interpolate;
   17    FAME_DECODER(this)->leave = mpeg_leave;
   18 +#ifdef HAS_MMX
   19    FAME_DECODER(this)->close = mpeg_close;
   20 +#else
   21 +  FAME_DECODER(this)->close = NULL;
   22 +#endif
   23    return(this);
   24  }
   25  
   26 @@ -603,6 +609,7 @@ static void mpeg_leave(fame_decoder_t *d
   27    arch_leave_state();
   28  }
   29  
   30 +#ifdef HAS_MMX
   31  /*  mpeg_close                                                              */
   32  /*                                                                           */
   33  /*  Description:                                                             */
   34 @@ -618,7 +625,6 @@ static void mpeg_close(fame_decoder_t *d
   35  {
   36    fame_decoder_mpeg_t *decoder_mpeg = FAME_DECODER_MPEG(decoder);
   37  
   38 -#ifdef HAS_MMX
   39    /* free mismatch accumulator */
   40    { 
   41      int i;
   42 @@ -626,5 +632,5 @@ static void mpeg_close(fame_decoder_t *d
   43        for(i = 0; i < 6; i++)
   44  	fame_free(decoder_mpeg->mismatch_accumulator[i]); 
   45    }
   46 -#endif
   47  }
   48 +#endif
   49 diff -pruN libfame-0.9.1.orig/src/half_mmx.h libfame-0.9.1/src/half_mmx.h
   50 --- libfame-0.9.1.orig/src/half_mmx.h	2008-08-02 22:44:06.856141130 +1000
   51 +++ libfame-0.9.1/src/half_mmx.h	2008-08-02 22:51:49.078142536 +1000
   52 @@ -28,10 +28,10 @@ static void inline mmx_interpolate(unsig
   53    short _mmx_rc[4]; /* rounding control */
   54    register short *rc = _mmx_rc;
   55  
   56 -  _mmx_rc[0] = 1 - rounding;
   57 -  _mmx_rc[1] = 1 - rounding;
   58 -  _mmx_rc[2] = 1 - rounding;
   59 -  _mmx_rc[3] = 1 - rounding;
   60 +  _mmx_rc[0] = _mmx_one[0] - rounding;
   61 +  _mmx_rc[1] = _mmx_one[1] - rounding;
   62 +  _mmx_rc[2] = _mmx_one[2] - rounding;
   63 +  _mmx_rc[3] = _mmx_one[3] - rounding;
   64  
   65    asm volatile ("movl (%0), %3\n"          /* %3 = ref[0] */
   66  		"pxor %%mm7, %%mm7\n"      /* mm7 = 0 */
   67 diff -pruN libfame-0.9.1.orig/src/mae_int.h libfame-0.9.1/src/mae_int.h
   68 --- libfame-0.9.1.orig/src/mae_int.h	2008-08-02 22:44:06.862141891 +1000
   69 +++ libfame-0.9.1/src/mae_int.h	2008-08-02 22:55:42.517140304 +1000
   70 @@ -18,10 +18,10 @@
   71      Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   72  */
   73  
   74 -static unsigned int MAE8x8_withmask(unsigned char *ref,
   75 -				    unsigned char *input,
   76 -				    unsigned char *shape,
   77 -				    int pitch)
   78 +static inline unsigned int
   79 +MAE8x8_withmask(unsigned char *ref, unsigned char *input,
   80 +    unsigned char *shape,
   81 +    int pitch)
   82  {
   83    int j,i;
   84  
   85 @@ -41,10 +41,11 @@ static unsigned int MAE8x8_withmask(unsi
   86    return error;
   87  }
   88  
   89 -static unsigned int MAE8x8_withoutmask(unsigned char *ref,
   90 -				       unsigned char *input,
   91 -				       unsigned char *shape,
   92 -				       int pitch)
   93 +static inline unsigned int
   94 +MAE8x8_withoutmask(unsigned char *ref,
   95 +    unsigned char *input,
   96 +    unsigned char *shape,
   97 +    int pitch)
   98  {
   99    int j,i;
  100  
  101 diff -pruN libfame-0.9.1.orig/src/mae_mmx.h libfame-0.9.1/src/mae_mmx.h
  102 --- libfame-0.9.1.orig/src/mae_mmx.h	2008-08-02 22:44:06.855143632 +1000
  103 +++ libfame-0.9.1/src/mae_mmx.h	2008-08-02 22:55:42.517140304 +1000
  104 @@ -18,10 +18,10 @@
  105      Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  106  */
  107  
  108 -static unsigned int MAE8x8_withmask(unsigned char *ref,
  109 -				    unsigned char *input,
  110 -				    unsigned char *shape,
  111 -				    int pitch)
  112 +static inline unsigned int
  113 +MAE8x8_withmask(unsigned char *ref, unsigned char *input,
  114 +    unsigned char *shape,
  115 +    int pitch)
  116  {
  117    int dummy;
  118    unsigned long retval;
  119 @@ -70,10 +70,10 @@ static unsigned int MAE8x8_withmask(unsi
  120    return (retval&65535);
  121  }
  122  
  123 -static unsigned int MAE8x8_withoutmask(unsigned char *ref,
  124 -				       unsigned char *input,
  125 -				       unsigned char *shape,
  126 -				       int pitch)
  127 +static inline unsigned int
  128 +MAE8x8_withoutmask(unsigned char *ref, unsigned char *input,
  129 +    unsigned char *shape,
  130 +    int pitch)
  131  {
  132    int dummy;
  133    unsigned long retval;

Generated by cgit