diff options
-rw-r--r-- | jpeg/jpeg-6b.patch | 117 | ||||
-rw-r--r-- | moz/makefile.mk | 2 |
2 files changed, 1 insertions, 118 deletions
diff --git a/jpeg/jpeg-6b.patch b/jpeg/jpeg-6b.patch index c1a0f8010669..1180e7a63115 100644 --- a/jpeg/jpeg-6b.patch +++ b/jpeg/jpeg-6b.patch @@ -18,111 +18,6 @@ +#undef RIGHT_SHIFT_IS_UNSIGNED +#define NO_GETENV +#endif ---- misc/jpeg-6b/jdcolor.c 1997-08-04 01:39:16.000000000 +0200 -+++ misc/build/jpeg-6b/jdcolor.c 2009-03-19 11:30:30.000000000 +0100 -@@ -284,6 +284,90 @@ - } - } - -+METHODDEF(void) -+ycck_rgb_convert (j_decompress_ptr cinfo, -+ JSAMPIMAGE input_buf, JDIMENSION input_row, -+ JSAMPARRAY output_buf, int num_rows) -+{ -+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; -+ JDIMENSION num_cols = cinfo->output_width; -+ long cc, cm, cy, ck; -+ long y, cb, cr; -+ register JSAMPROW outptr; -+ register JSAMPROW inptr0, inptr1, inptr2, inptr3; -+ register JDIMENSION col; -+ register JSAMPLE* range_limit = cinfo->sample_range_limit; -+ register int* Crrtab = cconvert->Cr_r_tab; -+ register int* Cbbtab = cconvert->Cb_b_tab; -+ register INT32* Crgtab = cconvert->Cr_g_tab; -+ register INT32* Cbgtab = cconvert->Cb_g_tab; -+ SHIFT_TEMPS -+ -+ while( --num_rows >= 0 ) -+ { -+ inptr0 = input_buf[0][input_row]; -+ inptr1 = input_buf[1][input_row]; -+ inptr2 = input_buf[2][input_row]; -+ inptr3 = input_buf[3][input_row++]; -+ -+ for( col = 0, outptr = *output_buf++; col < num_cols; col++ ) -+ { -+ y = GETJSAMPLE(inptr0[col]); -+ cb = GETJSAMPLE(inptr1[col]); -+ cr = GETJSAMPLE(inptr2[col]); -+ -+ // YCCK => CMYK -+ cc = 255L - range_limit[MAXJSAMPLE - (y + Crrtab[cr])]; -+ cm = 255L - range_limit[MAXJSAMPLE - (y + ((int) RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], SCALEBITS)))]; -+ cy = 255L - range_limit[MAXJSAMPLE - (y + Cbbtab[cb])]; -+ ck = 255L - inptr3[col]; -+ -+ // CMYK => RGB -+ outptr[ RGB_RED ] = range_limit[ 255L - ( cc + ck ) ]; -+ outptr[ RGB_GREEN ] = range_limit[ 255L - ( cm + ck ) ]; -+ outptr[ RGB_BLUE ] = range_limit[ 255L - ( cy + ck ) ]; -+ outptr += RGB_PIXELSIZE; -+ } -+ } -+} -+ -+METHODDEF(void) -+cmyk_rgb_convert (j_decompress_ptr cinfo, -+ JSAMPIMAGE input_buf, JDIMENSION input_row, -+ JSAMPARRAY output_buf, int num_rows) -+{ -+ my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; -+ JDIMENSION num_cols = cinfo->output_width; -+ long cc, cm, cy, ck; -+ long y, cb, cr; -+ register JSAMPROW outptr; -+ register JSAMPROW inptr0, inptr1, inptr2, inptr3; -+ register JDIMENSION col; -+ register JSAMPLE* range_limit = cinfo->sample_range_limit; -+ SHIFT_TEMPS -+ -+ while( --num_rows >= 0 ) -+ { -+ inptr0 = input_buf[0][input_row]; -+ inptr1 = input_buf[1][input_row]; -+ inptr2 = input_buf[2][input_row]; -+ inptr3 = input_buf[3][input_row++]; -+ -+ for( col = 0, outptr = *output_buf++; col < num_cols; col++ ) -+ { -+ cc = 255 - GETJSAMPLE(inptr0[col]); -+ cm = 255 - GETJSAMPLE(inptr1[col]); -+ cy = 255 - GETJSAMPLE(inptr2[col]); -+ ck = 255 - GETJSAMPLE(inptr3[col]); -+ -+ // CMYK => RGB -+ outptr[ RGB_RED ] = range_limit[ 255L - ( cc + ck ) ]; -+ outptr[ RGB_GREEN ] = range_limit[ 255L - ( cm + ck ) ]; -+ outptr[ RGB_BLUE ] = range_limit[ 255L - ( cy + ck ) ]; -+ outptr += RGB_PIXELSIZE; -+ } -+ } -+} - - /* - * Empty method for start_pass. -@@ -364,6 +448,11 @@ - cconvert->pub.color_convert = gray_rgb_convert; - } else if (cinfo->jpeg_color_space == JCS_RGB && RGB_PIXELSIZE == 3) { - cconvert->pub.color_convert = null_convert; -+ } else if (cinfo->jpeg_color_space == JCS_YCCK) { -+ cconvert->pub.color_convert = ycck_rgb_convert; -+ build_ycc_rgb_table(cinfo); -+ } else if (cinfo->jpeg_color_space == JCS_CMYK) { -+ cconvert->pub.color_convert = cmyk_rgb_convert; - } else - ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); - break; --- misc/jpeg-6b/jmorecfg.h 1997-08-10 01:58:56.000000000 +0200 +++ misc/build/jpeg-6b/jmorecfg.h 2009-03-19 11:30:30.000000000 +0100 @@ -157,8 +157,8 @@ @@ -136,18 +31,6 @@ #endif /* Datatype used for image dimensions. The JPEG standard only supports -@@ -311,9 +311,9 @@ - * can't use color quantization if you change that value. - */ - --#define RGB_RED 0 /* Offset of Red in an RGB scanline element */ -+#define RGB_RED 2 /* Offset of Red in an RGB scanline element */ - #define RGB_GREEN 1 /* Offset of Green */ --#define RGB_BLUE 2 /* Offset of Blue */ -+#define RGB_BLUE 0 /* Offset of Blue */ - #define RGB_PIXELSIZE 3 /* JSAMPLEs per RGB scanline element */ - - --- misc/jpeg-6b/makefile.mk 2009-03-19 11:30:46.000000000 +0100 +++ misc/build/jpeg-6b/makefile.mk 2009-03-19 11:30:30.000000000 +0100 @@ -1 +1,76 @@ diff --git a/moz/makefile.mk b/moz/makefile.mk index 0c30efe9535c..2eeda8c08928 100644 --- a/moz/makefile.mk +++ b/moz/makefile.mk @@ -164,7 +164,7 @@ MOZILLA_CONFIGURE_FLAGS+= --enable-default-toolkit=$(DEFAULT_MOZILLA_TOOLKIT) # create a objdir build = build files in a seperate directory, not in the sourcetree directly CONFIGURE_DIR=$(CPU)_objdir BUILD_DIR=$(CONFIGURE_DIR) -MOZ_CROSSCOMPILE=CROSS_COMPILE=1 CC="gcc -arch $(MOZ_ARCH)" CXX="g++ -arch $(MOZ_ARCH)" AR=ar +MOZ_CROSSCOMPILE=CROSS_COMPILE=1 CC="$(CC) -arch $(MOZ_ARCH)" CXX="$(CXX) -arch $(MOZ_ARCH)" AR=ar CONFIGURE_ACTION=$(null,$(MOZ_ARCH) $(NULL) $(MOZ_CROSSCOMPILE)) ../configure $(MOZILLA_CONFIGURE_FLAGS) |