diff options
Diffstat (limited to 'media/libjpeg/jccolor.c')
-rw-r--r-- | media/libjpeg/jccolor.c | 389 |
1 files changed, 190 insertions, 199 deletions
diff --git a/media/libjpeg/jccolor.c b/media/libjpeg/jccolor.c index b973d101d6..bdc563c723 100644 --- a/media/libjpeg/jccolor.c +++ b/media/libjpeg/jccolor.c @@ -63,9 +63,9 @@ typedef my_color_converter *my_cconvert_ptr; */ #define SCALEBITS 16 /* speediest right-shift on some machines */ -#define CBCR_OFFSET ((JLONG) CENTERJSAMPLE << SCALEBITS) -#define ONE_HALF ((JLONG) 1 << (SCALEBITS-1)) -#define FIX(x) ((JLONG) ((x) * (1L<<SCALEBITS) + 0.5)) +#define CBCR_OFFSET ((JLONG)CENTERJSAMPLE << SCALEBITS) +#define ONE_HALF ((JLONG)1 << (SCALEBITS - 1)) +#define FIX(x) ((JLONG)((x) * (1L << SCALEBITS) + 0.5)) /* We allocate one big table and divide it up into eight parts, instead of * doing eight alloc_small requests. This lets us use a single table base @@ -74,15 +74,15 @@ typedef my_color_converter *my_cconvert_ptr; */ #define R_Y_OFF 0 /* offset to R => Y section */ -#define G_Y_OFF (1*(MAXJSAMPLE+1)) /* offset to G => Y section */ -#define B_Y_OFF (2*(MAXJSAMPLE+1)) /* etc. */ -#define R_CB_OFF (3*(MAXJSAMPLE+1)) -#define G_CB_OFF (4*(MAXJSAMPLE+1)) -#define B_CB_OFF (5*(MAXJSAMPLE+1)) +#define G_Y_OFF (1 * (MAXJSAMPLE + 1)) /* offset to G => Y section */ +#define B_Y_OFF (2 * (MAXJSAMPLE + 1)) /* etc. */ +#define R_CB_OFF (3 * (MAXJSAMPLE + 1)) +#define G_CB_OFF (4 * (MAXJSAMPLE + 1)) +#define B_CB_OFF (5 * (MAXJSAMPLE + 1)) #define R_CR_OFF B_CB_OFF /* B=>Cb, R=>Cr are the same */ -#define G_CR_OFF (6*(MAXJSAMPLE+1)) -#define B_CR_OFF (7*(MAXJSAMPLE+1)) -#define TABLE_SIZE (8*(MAXJSAMPLE+1)) +#define G_CR_OFF (6 * (MAXJSAMPLE + 1)) +#define B_CR_OFF (7 * (MAXJSAMPLE + 1)) +#define TABLE_SIZE (8 * (MAXJSAMPLE + 1)) /* Include inline routines for colorspace extensions */ @@ -93,13 +93,13 @@ typedef my_color_converter *my_cconvert_ptr; #undef RGB_BLUE #undef RGB_PIXELSIZE -#define RGB_RED EXT_RGB_RED -#define RGB_GREEN EXT_RGB_GREEN -#define RGB_BLUE EXT_RGB_BLUE -#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE -#define rgb_ycc_convert_internal extrgb_ycc_convert_internal -#define rgb_gray_convert_internal extrgb_gray_convert_internal -#define rgb_rgb_convert_internal extrgb_rgb_convert_internal +#define RGB_RED EXT_RGB_RED +#define RGB_GREEN EXT_RGB_GREEN +#define RGB_BLUE EXT_RGB_BLUE +#define RGB_PIXELSIZE EXT_RGB_PIXELSIZE +#define rgb_ycc_convert_internal extrgb_ycc_convert_internal +#define rgb_gray_convert_internal extrgb_gray_convert_internal +#define rgb_rgb_convert_internal extrgb_rgb_convert_internal #include "jccolext.c" #undef RGB_RED #undef RGB_GREEN @@ -109,13 +109,13 @@ typedef my_color_converter *my_cconvert_ptr; #undef rgb_gray_convert_internal #undef rgb_rgb_convert_internal -#define RGB_RED EXT_RGBX_RED -#define RGB_GREEN EXT_RGBX_GREEN -#define RGB_BLUE EXT_RGBX_BLUE -#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE -#define rgb_ycc_convert_internal extrgbx_ycc_convert_internal -#define rgb_gray_convert_internal extrgbx_gray_convert_internal -#define rgb_rgb_convert_internal extrgbx_rgb_convert_internal +#define RGB_RED EXT_RGBX_RED +#define RGB_GREEN EXT_RGBX_GREEN +#define RGB_BLUE EXT_RGBX_BLUE +#define RGB_PIXELSIZE EXT_RGBX_PIXELSIZE +#define rgb_ycc_convert_internal extrgbx_ycc_convert_internal +#define rgb_gray_convert_internal extrgbx_gray_convert_internal +#define rgb_rgb_convert_internal extrgbx_rgb_convert_internal #include "jccolext.c" #undef RGB_RED #undef RGB_GREEN @@ -125,13 +125,13 @@ typedef my_color_converter *my_cconvert_ptr; #undef rgb_gray_convert_internal #undef rgb_rgb_convert_internal -#define RGB_RED EXT_BGR_RED -#define RGB_GREEN EXT_BGR_GREEN -#define RGB_BLUE EXT_BGR_BLUE -#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE -#define rgb_ycc_convert_internal extbgr_ycc_convert_internal -#define rgb_gray_convert_internal extbgr_gray_convert_internal -#define rgb_rgb_convert_internal extbgr_rgb_convert_internal +#define RGB_RED EXT_BGR_RED +#define RGB_GREEN EXT_BGR_GREEN +#define RGB_BLUE EXT_BGR_BLUE +#define RGB_PIXELSIZE EXT_BGR_PIXELSIZE +#define rgb_ycc_convert_internal extbgr_ycc_convert_internal +#define rgb_gray_convert_internal extbgr_gray_convert_internal +#define rgb_rgb_convert_internal extbgr_rgb_convert_internal #include "jccolext.c" #undef RGB_RED #undef RGB_GREEN @@ -141,13 +141,13 @@ typedef my_color_converter *my_cconvert_ptr; #undef rgb_gray_convert_internal #undef rgb_rgb_convert_internal -#define RGB_RED EXT_BGRX_RED -#define RGB_GREEN EXT_BGRX_GREEN -#define RGB_BLUE EXT_BGRX_BLUE -#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE -#define rgb_ycc_convert_internal extbgrx_ycc_convert_internal -#define rgb_gray_convert_internal extbgrx_gray_convert_internal -#define rgb_rgb_convert_internal extbgrx_rgb_convert_internal +#define RGB_RED EXT_BGRX_RED +#define RGB_GREEN EXT_BGRX_GREEN +#define RGB_BLUE EXT_BGRX_BLUE +#define RGB_PIXELSIZE EXT_BGRX_PIXELSIZE +#define rgb_ycc_convert_internal extbgrx_ycc_convert_internal +#define rgb_gray_convert_internal extbgrx_gray_convert_internal +#define rgb_rgb_convert_internal extbgrx_rgb_convert_internal #include "jccolext.c" #undef RGB_RED #undef RGB_GREEN @@ -157,13 +157,13 @@ typedef my_color_converter *my_cconvert_ptr; #undef rgb_gray_convert_internal #undef rgb_rgb_convert_internal -#define RGB_RED EXT_XBGR_RED -#define RGB_GREEN EXT_XBGR_GREEN -#define RGB_BLUE EXT_XBGR_BLUE -#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE -#define rgb_ycc_convert_internal extxbgr_ycc_convert_internal -#define rgb_gray_convert_internal extxbgr_gray_convert_internal -#define rgb_rgb_convert_internal extxbgr_rgb_convert_internal +#define RGB_RED EXT_XBGR_RED +#define RGB_GREEN EXT_XBGR_GREEN +#define RGB_BLUE EXT_XBGR_BLUE +#define RGB_PIXELSIZE EXT_XBGR_PIXELSIZE +#define rgb_ycc_convert_internal extxbgr_ycc_convert_internal +#define rgb_gray_convert_internal extxbgr_gray_convert_internal +#define rgb_rgb_convert_internal extxbgr_rgb_convert_internal #include "jccolext.c" #undef RGB_RED #undef RGB_GREEN @@ -173,13 +173,13 @@ typedef my_color_converter *my_cconvert_ptr; #undef rgb_gray_convert_internal #undef rgb_rgb_convert_internal -#define RGB_RED EXT_XRGB_RED -#define RGB_GREEN EXT_XRGB_GREEN -#define RGB_BLUE EXT_XRGB_BLUE -#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE -#define rgb_ycc_convert_internal extxrgb_ycc_convert_internal -#define rgb_gray_convert_internal extxrgb_gray_convert_internal -#define rgb_rgb_convert_internal extxrgb_rgb_convert_internal +#define RGB_RED EXT_XRGB_RED +#define RGB_GREEN EXT_XRGB_GREEN +#define RGB_BLUE EXT_XRGB_BLUE +#define RGB_PIXELSIZE EXT_XRGB_PIXELSIZE +#define rgb_ycc_convert_internal extxrgb_ycc_convert_internal +#define rgb_gray_convert_internal extxrgb_gray_convert_internal +#define rgb_rgb_convert_internal extxrgb_rgb_convert_internal #include "jccolext.c" #undef RGB_RED #undef RGB_GREEN @@ -195,33 +195,33 @@ typedef my_color_converter *my_cconvert_ptr; */ METHODDEF(void) -rgb_ycc_start (j_compress_ptr cinfo) +rgb_ycc_start(j_compress_ptr cinfo) { - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; JLONG *rgb_ycc_tab; JLONG i; /* Allocate and fill in the conversion tables. */ cconvert->rgb_ycc_tab = rgb_ycc_tab = (JLONG *) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, (TABLE_SIZE * sizeof(JLONG))); for (i = 0; i <= MAXJSAMPLE; i++) { - rgb_ycc_tab[i+R_Y_OFF] = FIX(0.29900) * i; - rgb_ycc_tab[i+G_Y_OFF] = FIX(0.58700) * i; - rgb_ycc_tab[i+B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; - rgb_ycc_tab[i+R_CB_OFF] = (-FIX(0.16874)) * i; - rgb_ycc_tab[i+G_CB_OFF] = (-FIX(0.33126)) * i; + rgb_ycc_tab[i + R_Y_OFF] = FIX(0.29900) * i; + rgb_ycc_tab[i + G_Y_OFF] = FIX(0.58700) * i; + rgb_ycc_tab[i + B_Y_OFF] = FIX(0.11400) * i + ONE_HALF; + rgb_ycc_tab[i + R_CB_OFF] = (-FIX(0.16874)) * i; + rgb_ycc_tab[i + G_CB_OFF] = (-FIX(0.33126)) * i; /* We use a rounding fudge-factor of 0.5-epsilon for Cb and Cr. * This ensures that the maximum output will round to MAXJSAMPLE * not MAXJSAMPLE+1, and thus that we don't have to range-limit. */ - rgb_ycc_tab[i+B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; + rgb_ycc_tab[i + B_CB_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF - 1; /* B=>Cb and R=>Cr tables are the same - rgb_ycc_tab[i+R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF-1; + rgb_ycc_tab[i + R_CR_OFF] = FIX(0.50000) * i + CBCR_OFFSET + ONE_HALF - 1; */ - rgb_ycc_tab[i+G_CR_OFF] = (-FIX(0.41869)) * i; - rgb_ycc_tab[i+B_CR_OFF] = (-FIX(0.08131)) * i; + rgb_ycc_tab[i + G_CR_OFF] = (-FIX(0.41869)) * i; + rgb_ycc_tab[i + B_CR_OFF] = (-FIX(0.08131)) * i; } } @@ -231,43 +231,42 @@ rgb_ycc_start (j_compress_ptr cinfo) */ METHODDEF(void) -rgb_ycc_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) +rgb_ycc_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { switch (cinfo->in_color_space) { - case JCS_EXT_RGB: - extrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_RGBX: - case JCS_EXT_RGBA: - extrgbx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_BGR: - extbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_BGRX: - case JCS_EXT_BGRA: - extbgrx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_XBGR: - case JCS_EXT_ABGR: - extxbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_XRGB: - case JCS_EXT_ARGB: - extxrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - default: - rgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; + case JCS_EXT_RGB: + extrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + extrgbx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_BGR: + extbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + extbgrx_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + extxbgr_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + extxrgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + default: + rgb_ycc_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; } } @@ -280,43 +279,42 @@ rgb_ycc_convert (j_compress_ptr cinfo, */ METHODDEF(void) -rgb_gray_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) +rgb_gray_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { switch (cinfo->in_color_space) { - case JCS_EXT_RGB: - extrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_RGBX: - case JCS_EXT_RGBA: - extrgbx_gray_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_BGR: - extbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_BGRX: - case JCS_EXT_BGRA: - extbgrx_gray_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_XBGR: - case JCS_EXT_ABGR: - extxbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_XRGB: - case JCS_EXT_ARGB: - extxrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - default: - rgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; + case JCS_EXT_RGB: + extrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + extrgbx_gray_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_BGR: + extbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + extbgrx_gray_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + extxbgr_gray_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + extxrgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + default: + rgb_gray_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; } } @@ -326,43 +324,42 @@ rgb_gray_convert (j_compress_ptr cinfo, */ METHODDEF(void) -rgb_rgb_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) +rgb_rgb_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { switch (cinfo->in_color_space) { - case JCS_EXT_RGB: - extrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_RGBX: - case JCS_EXT_RGBA: - extrgbx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_BGR: - extbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_BGRX: - case JCS_EXT_BGRA: - extbgrx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_XBGR: - case JCS_EXT_ABGR: - extxbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - case JCS_EXT_XRGB: - case JCS_EXT_ARGB: - extxrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; - default: - rgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, - num_rows); - break; + case JCS_EXT_RGB: + extrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_RGBX: + case JCS_EXT_RGBA: + extrgbx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_BGR: + extbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_BGRX: + case JCS_EXT_BGRA: + extbgrx_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_XBGR: + case JCS_EXT_ABGR: + extxbgr_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + case JCS_EXT_XRGB: + case JCS_EXT_ARGB: + extxrgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; + default: + rgb_rgb_convert_internal(cinfo, input_buf, output_buf, output_row, + num_rows); + break; } } @@ -376,11 +373,10 @@ rgb_rgb_convert (j_compress_ptr cinfo, */ METHODDEF(void) -cmyk_ycck_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) +cmyk_ycck_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { - my_cconvert_ptr cconvert = (my_cconvert_ptr) cinfo->cconvert; + my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; register int r, g, b; register JLONG *ctab = cconvert->rgb_ycc_tab; register JSAMPROW inptr; @@ -396,11 +392,11 @@ cmyk_ycck_convert (j_compress_ptr cinfo, outptr3 = output_buf[3][output_row]; output_row++; for (col = 0; col < num_cols; col++) { - r = MAXJSAMPLE - GETJSAMPLE(inptr[0]); - g = MAXJSAMPLE - GETJSAMPLE(inptr[1]); - b = MAXJSAMPLE - GETJSAMPLE(inptr[2]); + r = MAXJSAMPLE - inptr[0]; + g = MAXJSAMPLE - inptr[1]; + b = MAXJSAMPLE - inptr[2]; /* K passes through as-is */ - outptr3[col] = inptr[3]; /* don't need GETJSAMPLE here */ + outptr3[col] = inptr[3]; inptr += 4; /* If the inputs are 0..MAXJSAMPLE, the outputs of these equations * must be too; we do not need an explicit range-limiting operation. @@ -408,17 +404,14 @@ cmyk_ycck_convert (j_compress_ptr cinfo, * need the general RIGHT_SHIFT macro. */ /* Y */ - outptr0[col] = (JSAMPLE) - ((ctab[r+R_Y_OFF] + ctab[g+G_Y_OFF] + ctab[b+B_Y_OFF]) - >> SCALEBITS); + outptr0[col] = (JSAMPLE)((ctab[r + R_Y_OFF] + ctab[g + G_Y_OFF] + + ctab[b + B_Y_OFF]) >> SCALEBITS); /* Cb */ - outptr1[col] = (JSAMPLE) - ((ctab[r+R_CB_OFF] + ctab[g+G_CB_OFF] + ctab[b+B_CB_OFF]) - >> SCALEBITS); + outptr1[col] = (JSAMPLE)((ctab[r + R_CB_OFF] + ctab[g + G_CB_OFF] + + ctab[b + B_CB_OFF]) >> SCALEBITS); /* Cr */ - outptr2[col] = (JSAMPLE) - ((ctab[r+R_CR_OFF] + ctab[g+G_CR_OFF] + ctab[b+B_CR_OFF]) - >> SCALEBITS); + outptr2[col] = (JSAMPLE)((ctab[r + R_CR_OFF] + ctab[g + G_CR_OFF] + + ctab[b + B_CR_OFF]) >> SCALEBITS); } } } @@ -431,9 +424,8 @@ cmyk_ycck_convert (j_compress_ptr cinfo, */ METHODDEF(void) -grayscale_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) +grayscale_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, + JSAMPIMAGE output_buf, JDIMENSION output_row, int num_rows) { register JSAMPROW inptr; register JSAMPROW outptr; @@ -446,7 +438,7 @@ grayscale_convert (j_compress_ptr cinfo, outptr = output_buf[0][output_row]; output_row++; for (col = 0; col < num_cols; col++) { - outptr[col] = inptr[0]; /* don't need GETJSAMPLE() here */ + outptr[col] = inptr[0]; inptr += instride; } } @@ -460,9 +452,8 @@ grayscale_convert (j_compress_ptr cinfo, */ METHODDEF(void) -null_convert (j_compress_ptr cinfo, - JSAMPARRAY input_buf, JSAMPIMAGE output_buf, - JDIMENSION output_row, int num_rows) +null_convert(j_compress_ptr cinfo, JSAMPARRAY input_buf, JSAMPIMAGE output_buf, + JDIMENSION output_row, int num_rows) { register JSAMPROW inptr; register JSAMPROW outptr, outptr0, outptr1, outptr2, outptr3; @@ -506,7 +497,7 @@ null_convert (j_compress_ptr cinfo, inptr = *input_buf; outptr = output_buf[ci][output_row]; for (col = 0; col < num_cols; col++) { - outptr[col] = inptr[ci]; /* don't need GETJSAMPLE() here */ + outptr[col] = inptr[ci]; inptr += nc; } } @@ -522,7 +513,7 @@ null_convert (j_compress_ptr cinfo, */ METHODDEF(void) -null_method (j_compress_ptr cinfo) +null_method(j_compress_ptr cinfo) { /* no work needed */ } @@ -533,14 +524,14 @@ null_method (j_compress_ptr cinfo) */ GLOBAL(void) -jinit_color_converter (j_compress_ptr cinfo) +jinit_color_converter(j_compress_ptr cinfo) { my_cconvert_ptr cconvert; cconvert = (my_cconvert_ptr) - (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_IMAGE, + (*cinfo->mem->alloc_small) ((j_common_ptr)cinfo, JPOOL_IMAGE, sizeof(my_color_converter)); - cinfo->cconvert = (struct jpeg_color_converter *) cconvert; + cinfo->cconvert = (struct jpeg_color_converter *)cconvert; /* set start_pass to null method until we find out differently */ cconvert->pub.start_pass = null_method; |