forked from bartvdbraak/blender
replace WORDS_BIGENDIAN with __BIG_ENDIAN__
This commit is contained in:
parent
83a2f02a78
commit
4e9ab6d04c
@ -42,11 +42,6 @@
|
|||||||
#include "MEM_guardedalloc.h"
|
#include "MEM_guardedalloc.h"
|
||||||
#include "avirgb.h"
|
#include "avirgb.h"
|
||||||
|
|
||||||
#ifdef __BIG_ENDIAN__
|
|
||||||
# define WORDS_BIGENDIAN
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* implementation */
|
/* implementation */
|
||||||
|
|
||||||
void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
|
void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *buffer, int *size) {
|
||||||
@ -63,9 +58,9 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu
|
|||||||
if (bits==16) {
|
if (bits==16) {
|
||||||
unsigned short *pxl;
|
unsigned short *pxl;
|
||||||
unsigned char *to;
|
unsigned char *to;
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef __BIG_ENDIAN__
|
||||||
unsigned char *pxla;
|
unsigned char *pxla;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromavirgbbuf");
|
buf = MEM_mallocN (movie->header->Height * movie->header->Width * 3, "fromavirgbbuf");
|
||||||
|
|
||||||
@ -75,19 +70,19 @@ void *avi_converter_from_avi_rgb (AviMovie *movie, int stream, unsigned char *bu
|
|||||||
while (y--) {
|
while (y--) {
|
||||||
pxl= (unsigned short *) (buffer + y * movie->header->Width * 2);
|
pxl= (unsigned short *) (buffer + y * movie->header->Width * 2);
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef __BIG_ENDIAN__
|
||||||
pxla= (unsigned char *)pxl;
|
pxla= (unsigned char *)pxl;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
x= movie->header->Width;
|
x= movie->header->Width;
|
||||||
while (x--) {
|
while (x--) {
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef __BIG_ENDIAN__
|
||||||
i= pxla[0];
|
i= pxla[0];
|
||||||
pxla[0]= pxla[1];
|
pxla[0]= pxla[1];
|
||||||
pxla[1]= i;
|
pxla[1]= i;
|
||||||
|
|
||||||
pxla+=2;
|
pxla+=2;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
*(to++)= ((*pxl>>10)&0x1f)*8;
|
*(to++)= ((*pxl>>10)&0x1f)*8;
|
||||||
*(to++)= ((*pxl>>5)&0x1f)*8;
|
*(to++)= ((*pxl>>5)&0x1f)*8;
|
||||||
|
@ -28,11 +28,11 @@
|
|||||||
|
|
||||||
#include "md5.h"
|
#include "md5.h"
|
||||||
|
|
||||||
#ifdef WORDS_BIGENDIAN
|
#ifdef __BIG_ENDIAN__
|
||||||
# define SWAP(n) \
|
# define SWAP(n) \
|
||||||
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
|
||||||
#else
|
#else
|
||||||
# define SWAP(n) (n)
|
# define SWAP(n) (n)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user