Ticket #1024: endian.diff

File endian.diff, 5.2 KB (added by roltman@…, 20 years ago)

svn diff of my patch for big endian playback

  • configure

     
    2525vcdsupport="no"
    2626exif="no"
    2727festival="no"
     28bigendian="no"
    2829
    2930for opt do
    3031  case "$opt" in
     
    7273  ;;
    7374  --disable-fftw) fftw_lib="no"
    7475  ;;
     76  --enable-bigendian) bigendian="yes"
     77  ;;
     78  --disable-bigendian) bigendian="no"
     79  ;;
    7580  --enable-sdl) sdl="yes"
    7681  ;;
    7782  --disable-sdl) sdl="no"
     
    166171  --enable-fftw            enable fftw visualizers [default=no]
    167172  --enable-sdl             use SDL for the synaesthesia output [default=no]
    168173  --enable-aac             enable AAC/MP4 audio file decompression [default=no]
     174  --enable-bigendian       enable bigendian support (PowerPC) [default=no]
    169175
    170176MythNews related options:
    171177  --enable-mythnews        build the mythnews plugin [default=yes]
     
    409415    echo "#    Automatically generated by configure - modify only under penalty of death" >> ./mythmusic/mythmusic/config.pro
    410416    echo "#" >> ./mythmusic/mythmusic/config.pro
    411417
     418    if test "$bigendian" = "yes" ; then
     419        echo "        BigEndian    support will be included in MythMusic"
     420        echo "#define BIGENDIAN 1" >> ./mythmusic/mythmusic/config.h
     421    fi
     422
     423    if test "$bigendian" = "no" ; then
     424        echo "        BigEndian    support will not be included in MythMusic"
     425    fi
     426
    412427    if test "$opengl" = "yes" ; then
    413428        echo "        OpenGL        support will be included in MythMusic"
    414429        echo "#define OPENGL_SUPPORT 1" >> ./mythmusic/mythmusic/config.h
  • mythmusic/mythmusic/vorbisdecoder.cpp

     
    1  #include <stdio.h>
     1#include <stdio.h>
    22#include <stdlib.h>
    33#include <iostream>
    44#include <string>
     
    240240            seekTime = -1.0;
    241241        }
    242242
     243#ifdef BIGENDIAN
     244        len = ov_read(&oggfile, (char *) (output_buf + output_at), bks, 1, 2, 1,
     245                      &section);
     246#else
    243247        len = ov_read(&oggfile, (char *) (output_buf + output_at), bks, 0, 2, 1,
    244248                      &section);
     249#endif
    245250
     251
    246252        if (len > 0) {
    247253            bitrate = ov_bitrate_instant(&oggfile) / 1000;
    248254
  • mythmusic/mythmusic/flacdecoder.cpp

     
    102102            for (channel = 0; channel < chan; channel++)
    103103            {
    104104               sample = (FLAC__int8)buffer[channel][cursamp];
     105#ifdef BIGENDIAN
     106               *(output_buf + output_at++) = ((sample >> 8) & 0xff);
     107#else
    105108               *(output_buf + output_at++) = ((sample >> 0) & 0xff);
     109#endif
    106110               output_bytes += 1;
    107111            }
    108112        }   
     
    113117        {
    114118            for (channel = 0; channel < chan; channel++)
    115119            {
    116                sample = (FLAC__int16)buffer[channel][cursamp];             
     120               sample = (FLAC__int16)buffer[channel][cursamp];
     121#ifdef BIGENDIAN
    117122               *(output_buf + output_at++) = ((sample >> 0) & 0xff);
    118123               *(output_buf + output_at++) = ((sample >> 8) & 0xff);
     124#else
     125               *(output_buf + output_at++) = ((sample >> 8) & 0xff);
     126               *(output_buf + output_at++) = ((sample >> 0) & 0xff);
     127#endif
    119128               output_bytes += 2;
    120129            }
    121130        }
  • mythmusic/mythmusic/maddecoder.cpp

     
    483483            flush();
    484484        }
    485485        sample = fix_sample(16, *left++);
     486#ifdef BIGENDIAN
     487        *(output_buf + output_at++) = ((sample >> 8) & 0xff);
    486488        *(output_buf + output_at++) = ((sample >> 0) & 0xff);
     489#else
     490        *(output_buf + output_at++) = ((sample >> 0) & 0xff);
    487491        *(output_buf + output_at++) = ((sample >> 8) & 0xff);
     492#endif
    488493        output_bytes += 2;
    489494
    490495        if (channels == 2)
    491496        {
    492497            sample = fix_sample(16, *right++);
     498#ifdef BIGENDIAN
     499            *(output_buf + output_at++) = ((sample >> 8) & 0xff);
    493500            *(output_buf + output_at++) = ((sample >> 0) & 0xff);
     501#else
     502            *(output_buf + output_at++) = ((sample >> 0) & 0xff);
    494503            *(output_buf + output_at++) = ((sample >> 8) & 0xff);
     504#endif
    495505            output_bytes += 2;
    496506        }
    497507    }
  • settings.pro

     
    22CONFIG += release
    33
    44isEmpty( PREFIX ) {
    5     PREFIX = /usr/local
     5    PREFIX = /usr
    66}
    77
    88LIBVERSION = 0.18.2
     
    1717DEFINES += PREFIX=\"$${PREFIX}\"
    1818
    1919# Remove for x86-64
    20 DEFINES += HAVE_MMX
     20#DEFINES += HAVE_MMX
     21DEFINES += FPM_PPC
    2122
    2223release {
    23     QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentiumpro -fomit-frame-pointer
     24    QMAKE_CXXFLAGS_RELEASE = -O3 -fomit-frame-pointer
    2425    macx {
    2526        # Don't use -O3, it causes some Qt moc methods to go missing
    2627        QMAKE_CXXFLAGS_RELEASE = -O2