[MPlayer-dev-eng] {PATCH]:Patch for vo_tga.c on big endian systems
danny
guru at digitalfantasy.it
Sat Jun 12 15:46:28 CEST 2004
I receive this patch for the tga output on big endian systems.
Someone can apply this ?
Thanks
Daniele Forghieri
---------- Messaggio inoltrato ----------
Subject: Patch for vo_tga.c on big endian systems
Date: 18:29, martedì 8 giugno 2004
From: Jean-Francois Panisset <panisset at comcast.net>
To: guru at digitalfantasy.it
Cc: panisset at comcast.net
Dear Mr. Forghieri,
Here is a patch to libvo/vo_tga.c (applied against the latest version in
the mplayer cvs repository) which fixes MPlayer output of Targa files on
big endian platforms such as OS X. The patch is fairly simple, it would
be great if you could apply it to the CVS version of the code. Note that
in the case of little endian systems, the extra right shift will be by a
value of 0, which should be optimized away by the compiler.
Thanks!
JF Panisset
-------------------------------------------------------
-------------- next part --------------
*** vo_tga.c.orig 2004-06-08 09:24:40.000000000 -0700
--- vo_tga.c 2004-06-08 09:25:10.000000000 -0700
***************
*** 11,18 ****
* The 16 bit file are loaded without problem from Gimp and ImageMagick but give an error
* with entice (a visualizer from the enlightenment package that use the imlib2 package).
*
! * In 32 bit mode the alpha channel is set to 255 (0xff). I may not work with big endian
! * machine (is probably enought to change the TGA_ALPHA32 from 0xff000000 to 0x000000ff).
*
* I need to fill the alpha channel because entice consider that alpha channel (and displays
* nothing, only the background!), but ImageMacick (the program display) or gimp doesn't
--- 11,18 ----
* The 16 bit file are loaded without problem from Gimp and ImageMagick but give an error
* with entice (a visualizer from the enlightenment package that use the imlib2 package).
*
! * In 32 bit mode the alpha channel is set to 255 (0xff). For big endian
! * machines, TGA_ALPHA32 changes from 0xff000000 to 0x000000ff, and TGA_SHIFT32 from 0 to 8.
*
* I need to fill the alpha channel because entice consider that alpha channel (and displays
* nothing, only the background!), but ImageMacick (the program display) or gimp doesn't
***************
*** 35,42 ****
#include "video_out.h"
#include "video_out_internal.h"
! /* This must be changed for Motorola type processor ? */
#define TGA_ALPHA32 0xff000000
static vo_info_t info =
{
--- 35,47 ----
#include "video_out.h"
#include "video_out_internal.h"
! #ifdef WORDS_BIGENDIAN
! #define TGA_ALPHA32 0x000000ff
! #define TGA_SHIFT32 8
! #else
#define TGA_ALPHA32 0xff000000
+ #define TGA_SHIFT32 0
+ #endif
static vo_info_t info =
{
***************
*** 121,127 ****
s = (uint32_t *)buf;
d = line_buff;
for(x = 0; x < dx; x++) {
! *d++ = *s++ | TGA_ALPHA32;
}
if (fwrite(line_buff, wb, 1, fo) != 1) {
er = 4;
--- 126,132 ----
s = (uint32_t *)buf;
d = line_buff;
for(x = 0; x < dx; x++) {
! *d++ = ((*s++) << TGA_SHIFT32) | TGA_ALPHA32;
}
if (fwrite(line_buff, wb, 1, fo) != 1) {
er = 4;
More information about the MPlayer-dev-eng
mailing list