rpms/jpgalleg/devel jpgalleg-2.5-64bit.patch, NONE, 1.1 jpgalleg.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

Hans de Goede (jwrdegoede) fedora-extras-commits at redhat.com
Wed Mar 14 12:51:53 UTC 2007


Author: jwrdegoede

Update of /cvs/extras/rpms/jpgalleg/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv28568/devel

Modified Files:
	.cvsignore sources 
Added Files:
	jpgalleg-2.5-64bit.patch jpgalleg.spec 
Log Message:
auto-import jpgalleg-2.5-1.fc7 on branch devel from jpgalleg-2.5-1.fc7.src.rpm

jpgalleg-2.5-64bit.patch:

--- NEW FILE jpgalleg-2.5-64bit.patch ---
--- jpgalleg-2.5/src/encode.c.64bit	2004-07-06 17:37:24.000000000 +0200
+++ jpgalleg-2.5/src/encode.c	2007-02-02 21:31:41.000000000 +0100
@@ -122,7 +122,7 @@
 static int current_pass, progress_counter, progress_total;
 static int sampling, greyscale, mcu_w, mcu_h, pitch;
 static BITMAP *fixed_bmp;
-static void (*rgb2ycbcr)(int address, short *y1, short *cb1, short *cr1, short *y2, short *cb2, short *cr2);
+static void (*rgb2ycbcr)(unsigned int *ptr, short *y1, short *cb1, short *cr1, short *y2, short *cb2, short *cr2);
 static void (*progress_cb)(int percentage);
 
 
@@ -746,10 +746,9 @@
  *  at a time.
  */
 static void
-_jpeg_c_rgb2ycbcr(int addr, short *y1, short *cb1, short *cr1, short *y2, short *cb2, short *cr2)
+_jpeg_c_rgb2ycbcr(unsigned int *ptr, short *y1, short *cb1, short *cr1, short *y2, short *cb2, short *cr2)
 {
 	int r, g, b;
-	unsigned int *ptr = (unsigned int *)addr;
 	
 	r = getr32(ptr[0]);
 	g = getg32(ptr[0]);
@@ -779,7 +778,8 @@
 	short y4[256], cb[64], cr[64], y_blocks_per_mcu;
 	short *y_ptr, *cb_ptr, *cr_ptr;
 	int dc_y, dc_cb, dc_cr;
-	int block_x, block_y, x, y, i, addr;
+	int block_x, block_y, x, y, i;
+	unsigned char *addr;
 	
 	_jpeg_io.buffer = _jpeg_io.buffer_start;
 	
@@ -790,13 +790,13 @@
 	
 	for (block_y = 0; block_y < bmp->h; block_y += mcu_h) {
 		for (block_x = 0; block_x < bmp->w; block_x += mcu_w) {
-			addr = (int)fixed_bmp->line[block_y] + (block_x * 4);
+			addr = fixed_bmp->line[block_y] + (block_x * 4);
 			y_ptr = y_buf;
 			cb_ptr = cb_buf;
 			cr_ptr = cr_buf;
 			for (y = 0; y < mcu_h; y++) {
 				for (x = 0; x < mcu_w; x += 2) {
-					rgb2ycbcr(addr, y_ptr, cb_ptr, cr_ptr, y_ptr + 1, cb_ptr + 1, cr_ptr + 1);
+					rgb2ycbcr((unsigned int *)addr, y_ptr, cb_ptr, cr_ptr, y_ptr + 1, cb_ptr + 1, cr_ptr + 1);
 					y_ptr += 2;
 					cb_ptr += 2;
 					cr_ptr += 2;
--- jpgalleg-2.5/src/decode.c.64bit	2004-07-06 17:37:18.000000000 +0200
+++ jpgalleg-2.5/src/decode.c	2007-02-02 21:29:43.000000000 +0100
@@ -32,8 +32,8 @@
 static int scan_components, component[3];
 static int progress_counter, progress_total;
 static void (*idct)(short *block, short *dequant, short *output, short *workspace);
-static void (*ycbcr2rgb)(int address, int y1, int cb1, int cr1, int y2, int cb2, int cr2, int y3, int cb3, int cr3, int y4, int cb4, int cr4);
-static void (*plot)(int addr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr);
+static void (*ycbcr2rgb)(unsigned int *ptr, int y1, int cb1, int cr1, int y2, int cb2, int cr2, int y3, int cb3, int cr3, int y4, int cb4, int cr4);
+static void (*plot)(unsigned int *ptr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr);
 static void (*progress_cb)(int percentage);
 
 
@@ -610,10 +610,9 @@
  *  progressive mode decoding.
  */
 static int
-decode_progressive_block(int addr, int type, int *old_dc)
+decode_progressive_block(short *block, int type, int *old_dc)
 {
 	HUFFMAN_TABLE *dc_table, *ac_table;
-	short *block = (short *)addr;
 	int data, index, value;
 	int num_zeroes, category;
 	int p_bit, n_bit;
@@ -800,10 +799,10 @@
  *  at a time.
  */
 static void
-_jpeg_c_ycbcr2rgb(int addr, int y1, int cb1, int cr1, int y2, int cb2, int cr2, int y3, int cb3, int cr3, int y4, int cb4, int cr4)
+_jpeg_c_ycbcr2rgb(unsigned int *ptr, int y1, int cb1, int cr1, int y2, int cb2, int cr2, int y3, int cb3, int cr3, int y4, int cb4, int cr4)
 {
 	int r, g, b;
-	unsigned int *ptr = (unsigned int *)addr, temp, p0, p1, p2;
+	unsigned int temp, p0, p1, p2;
 
 #ifdef ALLEGRO_LITTLE_ENDIAN
 	r = MID(0, ((y1 << 8)                       + (359 * (cr1 - 128))) >> 8, 255);
@@ -858,10 +857,11 @@
  *  Plots an 8x8 MCU block for 444 mode. Also used to plot greyscale MCUs.
  */
 static void
-plot_444(int addr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr)
+plot_444(unsigned int *ptr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr)
 {
 	int x, y;
 	short *y1_ptr = y1, *cb_ptr = cb, *cr_ptr = cr, v;
+	unsigned char *addr = (unsigned char *)ptr;
 	
 	(void)y2;
 	(void)y3;
@@ -871,7 +871,7 @@
 		for (y = 0; y < 8; y++) {
 			for (x = 0; x < 8; x++) {
 				v = *y1_ptr++;
-				*(unsigned char *)addr = MID(0, v, 255);
+				*addr = MID(0, v, 255);
 				addr++;
 			}
 			addr += (pitch - 8);
@@ -880,7 +880,7 @@
 	else {
 		for (y = 0; y < 8; y++) {
 			for (x = 0; x < 8; x += 4) {
-				ycbcr2rgb(addr, *y1_ptr, *cb_ptr, *cr_ptr, *(y1_ptr + 1), *(cb_ptr + 1), *(cr_ptr + 1), *(y1_ptr + 2), *(cb_ptr + 2), *(cr_ptr + 2), *(y1_ptr + 3), *(cb_ptr + 3), *(cr_ptr + 3));
+				ycbcr2rgb((unsigned int *)addr, *y1_ptr, *cb_ptr, *cr_ptr, *(y1_ptr + 1), *(cb_ptr + 1), *(cr_ptr + 1), *(y1_ptr + 2), *(cb_ptr + 2), *(cr_ptr + 2), *(y1_ptr + 3), *(cb_ptr + 3), *(cr_ptr + 3));
 				y1_ptr += 4;
 				cb_ptr += 4;
 				cr_ptr += 4;
@@ -896,7 +896,7 @@
  *  Plots a 16x8 MCU block for 422 mode.
  */
 static void
-plot_422_h(int addr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr)
+plot_422_h(unsigned int *addr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr)
 {
 	int x, y;
 	short *y1_ptr = y1, *y2_ptr = y2, *cb_ptr = cb, *cr_ptr = cr;
@@ -907,16 +907,16 @@
 	for (y = 0; y < 8; y++) {
 		for (x = 0; x < 8; x += 4) {
 			ycbcr2rgb(addr, *y1_ptr, *cb_ptr, *cr_ptr, *(y1_ptr + 1), *cb_ptr, *cr_ptr, *(y1_ptr + 2), *(cb_ptr + 1), *(cr_ptr + 1), *(y1_ptr + 3), *(cb_ptr + 1), *(cr_ptr + 1));
-			ycbcr2rgb(addr + 24, *y2_ptr, *(cb_ptr + 4), *(cr_ptr + 4), *(y2_ptr + 1), *(cb_ptr + 4), *(cr_ptr + 4), *(y2_ptr + 2), *(cb_ptr + 5), *(cr_ptr + 5), *(y2_ptr + 3), *(cb_ptr + 5), *(cr_ptr + 5));
+			ycbcr2rgb(addr + 6, *y2_ptr, *(cb_ptr + 4), *(cr_ptr + 4), *(y2_ptr + 1), *(cb_ptr + 4), *(cr_ptr + 4), *(y2_ptr + 2), *(cb_ptr + 5), *(cr_ptr + 5), *(y2_ptr + 3), *(cb_ptr + 5), *(cr_ptr + 5));
 			y1_ptr += 4;
 			y2_ptr += 4;
 			cb_ptr += 2;
 			cr_ptr += 2;
-			addr += 12;
+			addr += 3;
 		}
 		cb_ptr += 4;
 		cr_ptr += 4;
-		addr += (pitch - 24);
+		addr += pitch/4 - 6;
 	}
 }
 
@@ -925,7 +925,7 @@
  *  Plots a 8x16 MCU block for 422 mode.
  */
 static void
-plot_422_v(int addr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr)
+plot_422_v(unsigned int *addr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr)
 {
 	int x, y, d;
 	short *y1_ptr = y1, *y2_ptr = y2, *cb_ptr = cb, *cr_ptr = cr;
@@ -936,17 +936,17 @@
 	for (y = 0; y < 8; y++) {
 		for (x = 0; x < 8; x += 4) {
 			ycbcr2rgb(addr, *y1_ptr, *cb_ptr, *cr_ptr, *(y1_ptr + 1), *(cb_ptr + 1), *(cr_ptr + 1), *(y1_ptr + 2), *(cb_ptr + 2), *(cr_ptr + 2), *(y1_ptr + 3), *(cb_ptr + 3), *(cr_ptr + 3));
-			ycbcr2rgb(addr + (pitch * 8), *y2_ptr, *(cb_ptr + 32), *(cr_ptr + 32), *(y2_ptr + 1), *(cb_ptr + 33), *(cr_ptr + 33), *(y2_ptr + 2), *(cb_ptr + 34), *(cr_ptr + 34), *(y2_ptr + 3), *(cb_ptr + 35), *(cr_ptr + 35));
+			ycbcr2rgb(addr + (pitch * 2), *y2_ptr, *(cb_ptr + 32), *(cr_ptr + 32), *(y2_ptr + 1), *(cb_ptr + 33), *(cr_ptr + 33), *(y2_ptr + 2), *(cb_ptr + 34), *(cr_ptr + 34), *(y2_ptr + 3), *(cb_ptr + 35), *(cr_ptr + 35));
 			y1_ptr += 4;
 			y2_ptr += 4;
 			cb_ptr += 4;
 			cr_ptr += 4;
-			addr += 12;
+			addr += 3;
 		}
 		d = (!(y & 1)) * 8;
 		cb_ptr -= d;
 		cr_ptr -= d;
-		addr += (pitch - 24);
+		addr += pitch/4 - 6;
 	}
 }
 
@@ -955,7 +955,7 @@
  *  Plots a 16x16 MCU block for 411 mode.
  */
 static void
-plot_411(int addr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr)
+plot_411(unsigned int *addr, int pitch, short *y1, short *y2, short *y3, short *y4, short *cb, short *cr)
 {
 	int x, y, d;
 	short *y1_ptr = y1, *y2_ptr = y2, *y3_ptr = y3, *y4_ptr = y4, *cb_ptr = cb, *cr_ptr = cr;
@@ -963,21 +963,21 @@
 	for (y = 0; y < 8; y++) {
 		for (x = 0; x < 8; x += 4) {
 			ycbcr2rgb(addr, *y1_ptr, *cb_ptr, *cr_ptr, *(y1_ptr + 1), *cb_ptr, *cr_ptr, *(y1_ptr + 2), *(cb_ptr + 1), *(cr_ptr + 1), *(y1_ptr + 3), *(cb_ptr + 1), *(cr_ptr + 1));
-			ycbcr2rgb(addr + 24, *y2_ptr, *(cb_ptr + 4), *(cr_ptr + 4), *(y2_ptr + 1), *(cb_ptr + 4), *(cr_ptr + 4), *(y2_ptr + 2), *(cb_ptr + 5), *(cr_ptr + 5), *(y2_ptr + 3), *(cb_ptr + 5), *(cr_ptr + 5));
-			ycbcr2rgb(addr + (pitch * 8), *y3_ptr, *(cb_ptr + 32), *(cr_ptr + 32), *(y3_ptr + 1), *(cb_ptr + 32), *(cr_ptr + 32), *(y3_ptr + 2), *(cb_ptr + 33), *(cr_ptr + 33), *(y3_ptr + 3), *(cb_ptr + 33), *(cr_ptr + 33));
-			ycbcr2rgb(addr + (pitch * 8) + 24, *y4_ptr, *(cb_ptr + 36), *(cr_ptr + 36), *(y4_ptr + 1), *(cb_ptr + 36), *(cr_ptr + 36), *(y4_ptr + 2), *(cb_ptr + 37), *(cr_ptr + 37), *(y4_ptr + 3), *(cb_ptr + 37), *(cr_ptr + 37));
+			ycbcr2rgb(addr + 6, *y2_ptr, *(cb_ptr + 4), *(cr_ptr + 4), *(y2_ptr + 1), *(cb_ptr + 4), *(cr_ptr + 4), *(y2_ptr + 2), *(cb_ptr + 5), *(cr_ptr + 5), *(y2_ptr + 3), *(cb_ptr + 5), *(cr_ptr + 5));
+			ycbcr2rgb(addr + (pitch * 2), *y3_ptr, *(cb_ptr + 32), *(cr_ptr + 32), *(y3_ptr + 1), *(cb_ptr + 32), *(cr_ptr + 32), *(y3_ptr + 2), *(cb_ptr + 33), *(cr_ptr + 33), *(y3_ptr + 3), *(cb_ptr + 33), *(cr_ptr + 33));
+			ycbcr2rgb(addr + (pitch * 2) + 6, *y4_ptr, *(cb_ptr + 36), *(cr_ptr + 36), *(y4_ptr + 1), *(cb_ptr + 36), *(cr_ptr + 36), *(y4_ptr + 2), *(cb_ptr + 37), *(cr_ptr + 37), *(y4_ptr + 3), *(cb_ptr + 37), *(cr_ptr + 37));
 			y1_ptr += 4;
 			y2_ptr += 4;
 			y3_ptr += 4;
 			y4_ptr += 4;
 			cb_ptr += 2;
 			cr_ptr += 2;
-			addr += 12;
+			addr += 3;
 		}
 		d = ((y & 1) * 8) - 4;
 		cb_ptr += d;
 		cr_ptr += d;
-		addr += (pitch - 24);
+		addr += pitch/4 - 6;
 	}
 }
 
@@ -1008,7 +1008,7 @@
 	short coefs_buffer[384], coefs[64], *coefs_ptr, *temp_ptr;
 	short *y1, *y2, *y3, *y4, *cb, *cr;
 	short workspace[130];
-	int addr, pitch, i, j;
+	int pitch, i, j;
 	int block_x, block_y, block_max_x, block_max_y;
 	int blocks_per_row[3];
 	int blocks_in_mcu, block_component[6];
@@ -1020,6 +1020,7 @@
 	int data, flags = 0;
 	int restart_count;
 	int depth;
+	unsigned char *addr;
 	
 	jpgalleg_error = JPG_ERROR_NONE;
 	
@@ -1254,8 +1255,8 @@
 				if (decode_baseline_block(block_ptr[i], (block_component[i] == 0) ? LUMINANCE : CHROMINANCE, &old_dc[block_component[i]]))
 					goto exit_error;
 			}
-			addr = (int)bmp->line[block_y] + (block_x * (jpeg_components == 1 ? 1 : 3));
-			plot(addr, pitch, y1, y2, y3, y4, cb, cr);
+			addr = bmp->line[block_y] + (block_x * (jpeg_components == 1 ? 1 : 3));
+			plot((unsigned int *)addr, pitch, y1, y2, y3, y4, cb, cr);
 			block_x += mcu_w;
 			if (block_x >= jpeg_w) {
 				block_x = 0;
@@ -1373,8 +1374,8 @@
 				}
 				for (i = 0; i < blocks_in_mcu; i++) {
 					c = block_component[i];
-					addr = (int)(data_buffer[c][((block_y * component_h[c]) * blocks_per_row[c]) + (block_y_ofs[i] * blocks_per_row[c]) + (block_x * component_w[c]) + block_x_ofs[i]].data);
-					if (decode_progressive_block(addr, (c == 0) ? LUMINANCE : CHROMINANCE, &old_dc[c]))
+					addr = (unsigned char *)(data_buffer[c][((block_y * component_h[c]) * blocks_per_row[c]) + (block_y_ofs[i] * blocks_per_row[c]) + (block_x * component_w[c]) + block_x_ofs[i]].data);
+					if (decode_progressive_block((short *)addr, (c == 0) ? LUMINANCE : CHROMINANCE, &old_dc[c]))
 						goto exit_error;
 				}
 				block_x++;
@@ -1465,8 +1466,8 @@
 					idct(coefs, coefs_ptr, (c == 0) ? luminance_quantization_table : chrominance_quantization_table, workspace);
 					coefs_ptr += 64;
 				}
-				addr = (int)bmp->line[block_y * mcu_h] + (block_x * mcu_w * (jpeg_components == 1 ? 1 : 3));
-				plot(addr, pitch, y1, y2, y3, y4, cb, cr);
+				addr = bmp->line[block_y * mcu_h] + (block_x * mcu_w * (jpeg_components == 1 ? 1 : 3));
+				plot((unsigned int *)addr, pitch, y1, y2, y3, y4, cb, cr);
 			}
 		}
 	}


--- NEW FILE jpgalleg.spec ---
Name:           jpgalleg
Version:        2.5
Release:        1%{?dist}
Summary:        JPEG library for the Allegro game library
Group:          System Environment/Libraries
License:        zlib/libpng License
URL:            http://www.ecplusplus.com/index.php?page=projects&pid=1
Source0:        http://www.ecplusplus.com/files/%{name}-%{version}.tar.gz
Patch0:         jpgalleg-2.5-64bit.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  allegro-devel

%description
jpgalleg is a jpeg library for use with the Allegro game library. It allows
using jpeg's as Allegro bitmaps.


%package        devel
Summary:        Development files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}
Requires:       allegro-devel

%description    devel
The %{name}-devel package contains libraries and header files for
developing applications that use %{name}.


%prep
%setup -q
./fix.sh unix
%patch0 -p1 -z .64bit
# upstreams mmx support is non PIC, fixing this is not worth the trouble IMHO
touch include/mmx.h


%build
make lib OFLAGS="$RPM_OPT_FLAGS -fPIC -DPIC" NO_ASSEMBLER=1
# Upstreams makefile creates a static lib, create a dynamic one ourselves
gcc -shared -Wl,-soname,libjpgal.so.2 -o libjpgal.so.%{version} \
  obj/unix/*.o `allegro-config --libs | sed 's/-lalleg_unsharable//'`


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_includedir}
install -m 755 libjpgal.so.%{version} $RPM_BUILD_ROOT%{_libdir}
ln -s libjpgal.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libjpgal.so.2
ln -s libjpgal.so.%{version} $RPM_BUILD_ROOT%{_libdir}/libjpgal.so
install -m 644 include/%{name}.h $RPM_BUILD_ROOT%{_includedir}


%clean
rm -rf $RPM_BUILD_ROOT


%post -p /sbin/ldconfig

%postun -p /sbin/ldconfig


%files
%defattr(-,root,root,-)
%doc license.txt readme.txt
%{_libdir}/libjpgal.so.*

%files devel
%defattr(-,root,root,-)
%{_includedir}/%{name}.h
%{_libdir}/libjpgal.so


%changelog
* Fri Feb  2 2007 Hans de Goede <j.w.r.degoede at hhs.nl> 2.5-1
- Initial FE package


Index: .cvsignore
===================================================================
RCS file: /cvs/extras/rpms/jpgalleg/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	14 Mar 2007 12:07:08 -0000	1.1
+++ .cvsignore	14 Mar 2007 12:51:20 -0000	1.2
@@ -0,0 +1 @@
+jpgalleg-2.5.tar.gz


Index: sources
===================================================================
RCS file: /cvs/extras/rpms/jpgalleg/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources	14 Mar 2007 12:07:08 -0000	1.1
+++ sources	14 Mar 2007 12:51:20 -0000	1.2
@@ -0,0 +1 @@
+4bdd12fc3c1afb06f4ec23b4cb200559  jpgalleg-2.5.tar.gz




More information about the fedora-extras-commits mailing list