/src/libjpeg-turbo.dev/src/jdcolext.c
Line | Count | Source |
1 | | /* |
2 | | * jdcolext.c |
3 | | * |
4 | | * This file was part of the Independent JPEG Group's software: |
5 | | * Copyright (C) 1991-1997, Thomas G. Lane. |
6 | | * libjpeg-turbo Modifications: |
7 | | * Copyright (C) 2009, 2011, 2015, 2022-2023, 2025, D. R. Commander. |
8 | | * For conditions of distribution and use, see the accompanying README.ijg |
9 | | * file. |
10 | | * |
11 | | * This file contains output colorspace conversion routines. |
12 | | */ |
13 | | |
14 | | |
15 | | /* This file is included by jdcolor.c */ |
16 | | |
17 | | |
18 | | /* |
19 | | * Convert some rows of samples to the output colorspace. |
20 | | * |
21 | | * Note that we change from noninterleaved, one-plane-per-component format |
22 | | * to interleaved-pixel format. The output buffer is therefore three times |
23 | | * as wide as the input buffer. |
24 | | * A starting row offset is provided only for the input buffer. The caller |
25 | | * can easily adjust the passed output_buf value to accommodate any row |
26 | | * offset required on that side. |
27 | | */ |
28 | | |
29 | | INLINE |
30 | | LOCAL(void) |
31 | | ycc_rgb_convert(j_decompress_ptr cinfo, _JSAMPIMAGE input_buf, |
32 | | JDIMENSION input_row, _JSAMPARRAY output_buf, int num_rows) |
33 | 1.40M | { |
34 | | #if BITS_IN_JSAMPLE != 16 |
35 | | my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; |
36 | | register int y, cb, cr; |
37 | | register _JSAMPROW outptr; |
38 | | register _JSAMPROW inptr0, inptr1, inptr2; |
39 | | register JDIMENSION col; |
40 | | JDIMENSION num_cols = cinfo->output_width; |
41 | | /* copy these pointers into registers if possible */ |
42 | | register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit; |
43 | | register int *Crrtab = cconvert->Cr_r_tab; |
44 | | register int *Cbbtab = cconvert->Cb_b_tab; |
45 | | register JLONG *Crgtab = cconvert->Cr_g_tab; |
46 | | register JLONG *Cbgtab = cconvert->Cb_g_tab; |
47 | | SHIFT_TEMPS |
48 | | |
49 | 3.82M | while (--num_rows >= 0) { |
50 | 2.41M | inptr0 = input_buf[0][input_row]; |
51 | 2.41M | inptr1 = input_buf[1][input_row]; |
52 | 2.41M | inptr2 = input_buf[2][input_row]; |
53 | 2.41M | input_row++; |
54 | 2.41M | outptr = *output_buf++; |
55 | 78.2M | for (col = 0; col < num_cols; col++) { |
56 | 75.8M | y = inptr0[col]; |
57 | 75.8M | cb = inptr1[col]; |
58 | 75.8M | cr = inptr2[col]; |
59 | | /* Range-limiting is essential due to noise introduced by DCT losses. */ |
60 | 75.8M | outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; |
61 | 75.8M | outptr[RGB_GREEN] = range_limit[y + |
62 | 75.8M | ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], |
63 | 75.8M | SCALEBITS))]; |
64 | 75.8M | outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; |
65 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ |
66 | | /* opaque alpha channel value */ |
67 | | #ifdef RGB_ALPHA |
68 | 18.8M | outptr[RGB_ALPHA] = _MAXJSAMPLE; |
69 | | #endif |
70 | 75.8M | outptr += RGB_PIXELSIZE; |
71 | 75.8M | } |
72 | 2.41M | } |
73 | | #else |
74 | 0 | ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); |
75 | | #endif |
76 | 1.40M | } Unexecuted instantiation: jdcolor-8.c:ycc_extrgb_convert Unexecuted instantiation: jdcolor-8.c:ycc_extrgbx_convert Unexecuted instantiation: jdcolor-8.c:ycc_extbgr_convert Unexecuted instantiation: jdcolor-8.c:ycc_extbgrx_convert Unexecuted instantiation: jdcolor-8.c:ycc_extxbgr_convert Unexecuted instantiation: jdcolor-8.c:ycc_extxrgb_convert Unexecuted instantiation: jdcolor-8.c:ycc_rgb_convert jdcolor-12.c:ycc_extrgb_convert Line | Count | Source | 33 | 615k | { | 34 | 615k | #if BITS_IN_JSAMPLE != 16 | 35 | 615k | my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; | 36 | 615k | register int y, cb, cr; | 37 | 615k | register _JSAMPROW outptr; | 38 | 615k | register _JSAMPROW inptr0, inptr1, inptr2; | 39 | 615k | register JDIMENSION col; | 40 | 615k | JDIMENSION num_cols = cinfo->output_width; | 41 | | /* copy these pointers into registers if possible */ | 42 | 615k | register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit; | 43 | 615k | register int *Crrtab = cconvert->Cr_r_tab; | 44 | 615k | register int *Cbbtab = cconvert->Cb_b_tab; | 45 | 615k | register JLONG *Crgtab = cconvert->Cr_g_tab; | 46 | 615k | register JLONG *Cbgtab = cconvert->Cb_g_tab; | 47 | 615k | SHIFT_TEMPS | 48 | | | 49 | 1.82M | while (--num_rows >= 0) { | 50 | 1.21M | inptr0 = input_buf[0][input_row]; | 51 | 1.21M | inptr1 = input_buf[1][input_row]; | 52 | 1.21M | inptr2 = input_buf[2][input_row]; | 53 | 1.21M | input_row++; | 54 | 1.21M | outptr = *output_buf++; | 55 | 58.2M | for (col = 0; col < num_cols; col++) { | 56 | 57.0M | y = inptr0[col]; | 57 | 57.0M | cb = inptr1[col]; | 58 | 57.0M | cr = inptr2[col]; | 59 | | /* Range-limiting is essential due to noise introduced by DCT losses. */ | 60 | 57.0M | outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; | 61 | 57.0M | outptr[RGB_GREEN] = range_limit[y + | 62 | 57.0M | ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], | 63 | 57.0M | SCALEBITS))]; | 64 | 57.0M | outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; | 65 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 66 | | /* opaque alpha channel value */ | 67 | | #ifdef RGB_ALPHA | 68 | | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 69 | | #endif | 70 | 57.0M | outptr += RGB_PIXELSIZE; | 71 | 57.0M | } | 72 | 1.21M | } | 73 | | #else | 74 | | ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); | 75 | | #endif | 76 | 615k | } |
Unexecuted instantiation: jdcolor-12.c:ycc_extrgbx_convert Unexecuted instantiation: jdcolor-12.c:ycc_extbgr_convert jdcolor-12.c:ycc_extbgrx_convert Line | Count | Source | 33 | 632k | { | 34 | 632k | #if BITS_IN_JSAMPLE != 16 | 35 | 632k | my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; | 36 | 632k | register int y, cb, cr; | 37 | 632k | register _JSAMPROW outptr; | 38 | 632k | register _JSAMPROW inptr0, inptr1, inptr2; | 39 | 632k | register JDIMENSION col; | 40 | 632k | JDIMENSION num_cols = cinfo->output_width; | 41 | | /* copy these pointers into registers if possible */ | 42 | 632k | register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit; | 43 | 632k | register int *Crrtab = cconvert->Cr_r_tab; | 44 | 632k | register int *Cbbtab = cconvert->Cb_b_tab; | 45 | 632k | register JLONG *Crgtab = cconvert->Cr_g_tab; | 46 | 632k | register JLONG *Cbgtab = cconvert->Cb_g_tab; | 47 | 632k | SHIFT_TEMPS | 48 | | | 49 | 1.59M | while (--num_rows >= 0) { | 50 | 962k | inptr0 = input_buf[0][input_row]; | 51 | 962k | inptr1 = input_buf[1][input_row]; | 52 | 962k | inptr2 = input_buf[2][input_row]; | 53 | 962k | input_row++; | 54 | 962k | outptr = *output_buf++; | 55 | 18.1M | for (col = 0; col < num_cols; col++) { | 56 | 17.2M | y = inptr0[col]; | 57 | 17.2M | cb = inptr1[col]; | 58 | 17.2M | cr = inptr2[col]; | 59 | | /* Range-limiting is essential due to noise introduced by DCT losses. */ | 60 | 17.2M | outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; | 61 | 17.2M | outptr[RGB_GREEN] = range_limit[y + | 62 | 17.2M | ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], | 63 | 17.2M | SCALEBITS))]; | 64 | 17.2M | outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; | 65 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 66 | | /* opaque alpha channel value */ | 67 | 17.2M | #ifdef RGB_ALPHA | 68 | 17.2M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 69 | 17.2M | #endif | 70 | 17.2M | outptr += RGB_PIXELSIZE; | 71 | 17.2M | } | 72 | 962k | } | 73 | | #else | 74 | | ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); | 75 | | #endif | 76 | 632k | } |
jdcolor-12.c:ycc_extxbgr_convert Line | Count | Source | 33 | 159k | { | 34 | 159k | #if BITS_IN_JSAMPLE != 16 | 35 | 159k | my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; | 36 | 159k | register int y, cb, cr; | 37 | 159k | register _JSAMPROW outptr; | 38 | 159k | register _JSAMPROW inptr0, inptr1, inptr2; | 39 | 159k | register JDIMENSION col; | 40 | 159k | JDIMENSION num_cols = cinfo->output_width; | 41 | | /* copy these pointers into registers if possible */ | 42 | 159k | register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit; | 43 | 159k | register int *Crrtab = cconvert->Cr_r_tab; | 44 | 159k | register int *Cbbtab = cconvert->Cb_b_tab; | 45 | 159k | register JLONG *Crgtab = cconvert->Cr_g_tab; | 46 | 159k | register JLONG *Cbgtab = cconvert->Cb_g_tab; | 47 | 159k | SHIFT_TEMPS | 48 | | | 49 | 402k | while (--num_rows >= 0) { | 50 | 242k | inptr0 = input_buf[0][input_row]; | 51 | 242k | inptr1 = input_buf[1][input_row]; | 52 | 242k | inptr2 = input_buf[2][input_row]; | 53 | 242k | input_row++; | 54 | 242k | outptr = *output_buf++; | 55 | 1.86M | for (col = 0; col < num_cols; col++) { | 56 | 1.62M | y = inptr0[col]; | 57 | 1.62M | cb = inptr1[col]; | 58 | 1.62M | cr = inptr2[col]; | 59 | | /* Range-limiting is essential due to noise introduced by DCT losses. */ | 60 | 1.62M | outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; | 61 | 1.62M | outptr[RGB_GREEN] = range_limit[y + | 62 | 1.62M | ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], | 63 | 1.62M | SCALEBITS))]; | 64 | 1.62M | outptr[RGB_BLUE] = range_limit[y + Cbbtab[cb]]; | 65 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 66 | | /* opaque alpha channel value */ | 67 | 1.62M | #ifdef RGB_ALPHA | 68 | 1.62M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 69 | 1.62M | #endif | 70 | 1.62M | outptr += RGB_PIXELSIZE; | 71 | 1.62M | } | 72 | 242k | } | 73 | | #else | 74 | | ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); | 75 | | #endif | 76 | 159k | } |
Unexecuted instantiation: jdcolor-12.c:ycc_extxrgb_convert Unexecuted instantiation: jdcolor-16.c:ycc_extrgb_convert Unexecuted instantiation: jdcolor-16.c:ycc_extrgbx_convert Unexecuted instantiation: jdcolor-16.c:ycc_extbgr_convert Unexecuted instantiation: jdcolor-16.c:ycc_extbgrx_convert Unexecuted instantiation: jdcolor-16.c:ycc_extxbgr_convert Unexecuted instantiation: jdcolor-16.c:ycc_extxrgb_convert Unexecuted instantiation: jdcolor-16.c:ycc_rgb_convert |
77 | | |
78 | | |
79 | | /* |
80 | | * Convert grayscale to RGB: just duplicate the graylevel three times. |
81 | | * This is provided to support applications that don't want to cope |
82 | | * with grayscale as a separate case. |
83 | | */ |
84 | | |
85 | | INLINE |
86 | | LOCAL(void) |
87 | | gray_rgb_convert(j_decompress_ptr cinfo, _JSAMPIMAGE input_buf, |
88 | | JDIMENSION input_row, _JSAMPARRAY output_buf, int num_rows) |
89 | 6.50M | { |
90 | 6.50M | register _JSAMPROW inptr, outptr; |
91 | 6.50M | register JDIMENSION col; |
92 | 6.50M | JDIMENSION num_cols = cinfo->output_width; |
93 | | |
94 | 16.6M | while (--num_rows >= 0) { |
95 | 10.1M | inptr = input_buf[0][input_row++]; |
96 | 10.1M | outptr = *output_buf++; |
97 | 897M | for (col = 0; col < num_cols; col++) { |
98 | 887M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; |
99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ |
100 | | /* opaque alpha channel value */ |
101 | | #ifdef RGB_ALPHA |
102 | 143M | outptr[RGB_ALPHA] = _MAXJSAMPLE; |
103 | | #endif |
104 | 887M | outptr += RGB_PIXELSIZE; |
105 | 887M | } |
106 | 10.1M | } |
107 | 6.50M | } jdcolor-8.c:gray_extrgb_convert Line | Count | Source | 89 | 1.97M | { | 90 | 1.97M | register _JSAMPROW inptr, outptr; | 91 | 1.97M | register JDIMENSION col; | 92 | 1.97M | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 5.14M | while (--num_rows >= 0) { | 95 | 3.17M | inptr = input_buf[0][input_row++]; | 96 | 3.17M | outptr = *output_buf++; | 97 | 460M | for (col = 0; col < num_cols; col++) { | 98 | 456M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | | #ifdef RGB_ALPHA | 102 | | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | | #endif | 104 | 456M | outptr += RGB_PIXELSIZE; | 105 | 456M | } | 106 | 3.17M | } | 107 | 1.97M | } |
jdcolor-8.c:gray_extrgbx_convert Line | Count | Source | 89 | 270k | { | 90 | 270k | register _JSAMPROW inptr, outptr; | 91 | 270k | register JDIMENSION col; | 92 | 270k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 540k | while (--num_rows >= 0) { | 95 | 270k | inptr = input_buf[0][input_row++]; | 96 | 270k | outptr = *output_buf++; | 97 | 12.6M | for (col = 0; col < num_cols; col++) { | 98 | 12.3M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | 12.3M | #ifdef RGB_ALPHA | 102 | 12.3M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 12.3M | #endif | 104 | 12.3M | outptr += RGB_PIXELSIZE; | 105 | 12.3M | } | 106 | 270k | } | 107 | 270k | } |
jdcolor-8.c:gray_extbgr_convert Line | Count | Source | 89 | 360k | { | 90 | 360k | register _JSAMPROW inptr, outptr; | 91 | 360k | register JDIMENSION col; | 92 | 360k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 721k | while (--num_rows >= 0) { | 95 | 360k | inptr = input_buf[0][input_row++]; | 96 | 360k | outptr = *output_buf++; | 97 | 21.4M | for (col = 0; col < num_cols; col++) { | 98 | 21.1M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | | #ifdef RGB_ALPHA | 102 | | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | | #endif | 104 | 21.1M | outptr += RGB_PIXELSIZE; | 105 | 21.1M | } | 106 | 360k | } | 107 | 360k | } |
jdcolor-8.c:gray_extbgrx_convert Line | Count | Source | 89 | 904k | { | 90 | 904k | register _JSAMPROW inptr, outptr; | 91 | 904k | register JDIMENSION col; | 92 | 904k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 2.38M | while (--num_rows >= 0) { | 95 | 1.48M | inptr = input_buf[0][input_row++]; | 96 | 1.48M | outptr = *output_buf++; | 97 | 70.0M | for (col = 0; col < num_cols; col++) { | 98 | 68.5M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | 68.5M | #ifdef RGB_ALPHA | 102 | 68.5M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 68.5M | #endif | 104 | 68.5M | outptr += RGB_PIXELSIZE; | 105 | 68.5M | } | 106 | 1.48M | } | 107 | 904k | } |
jdcolor-8.c:gray_extxbgr_convert Line | Count | Source | 89 | 245k | { | 90 | 245k | register _JSAMPROW inptr, outptr; | 91 | 245k | register JDIMENSION col; | 92 | 245k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 640k | while (--num_rows >= 0) { | 95 | 394k | inptr = input_buf[0][input_row++]; | 96 | 394k | outptr = *output_buf++; | 97 | 8.01M | for (col = 0; col < num_cols; col++) { | 98 | 7.62M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | 7.62M | #ifdef RGB_ALPHA | 102 | 7.62M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 7.62M | #endif | 104 | 7.62M | outptr += RGB_PIXELSIZE; | 105 | 7.62M | } | 106 | 394k | } | 107 | 245k | } |
jdcolor-8.c:gray_extxrgb_convert Line | Count | Source | 89 | 90.1k | { | 90 | 90.1k | register _JSAMPROW inptr, outptr; | 91 | 90.1k | register JDIMENSION col; | 92 | 90.1k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 180k | while (--num_rows >= 0) { | 95 | 90.1k | inptr = input_buf[0][input_row++]; | 96 | 90.1k | outptr = *output_buf++; | 97 | 1.59M | for (col = 0; col < num_cols; col++) { | 98 | 1.50M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | 1.50M | #ifdef RGB_ALPHA | 102 | 1.50M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 1.50M | #endif | 104 | 1.50M | outptr += RGB_PIXELSIZE; | 105 | 1.50M | } | 106 | 90.1k | } | 107 | 90.1k | } |
jdcolor-12.c:gray_extrgb_convert Line | Count | Source | 89 | 1.64M | { | 90 | 1.64M | register _JSAMPROW inptr, outptr; | 91 | 1.64M | register JDIMENSION col; | 92 | 1.64M | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 4.36M | while (--num_rows >= 0) { | 95 | 2.71M | inptr = input_buf[0][input_row++]; | 96 | 2.71M | outptr = *output_buf++; | 97 | 267M | for (col = 0; col < num_cols; col++) { | 98 | 265M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | | #ifdef RGB_ALPHA | 102 | | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | | #endif | 104 | 265M | outptr += RGB_PIXELSIZE; | 105 | 265M | } | 106 | 2.71M | } | 107 | 1.64M | } |
Unexecuted instantiation: jdcolor-12.c:gray_extrgbx_convert Unexecuted instantiation: jdcolor-12.c:gray_extbgr_convert jdcolor-12.c:gray_extbgrx_convert Line | Count | Source | 89 | 807k | { | 90 | 807k | register _JSAMPROW inptr, outptr; | 91 | 807k | register JDIMENSION col; | 92 | 807k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 2.14M | while (--num_rows >= 0) { | 95 | 1.33M | inptr = input_buf[0][input_row++]; | 96 | 1.33M | outptr = *output_buf++; | 97 | 50.6M | for (col = 0; col < num_cols; col++) { | 98 | 49.2M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | 49.2M | #ifdef RGB_ALPHA | 102 | 49.2M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 49.2M | #endif | 104 | 49.2M | outptr += RGB_PIXELSIZE; | 105 | 49.2M | } | 106 | 1.33M | } | 107 | 807k | } |
jdcolor-12.c:gray_extxbgr_convert Line | Count | Source | 89 | 205k | { | 90 | 205k | register _JSAMPROW inptr, outptr; | 91 | 205k | register JDIMENSION col; | 92 | 205k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 545k | while (--num_rows >= 0) { | 95 | 339k | inptr = input_buf[0][input_row++]; | 96 | 339k | outptr = *output_buf++; | 97 | 5.00M | for (col = 0; col < num_cols; col++) { | 98 | 4.66M | outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col]; | 99 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 100 | | /* opaque alpha channel value */ | 101 | 4.66M | #ifdef RGB_ALPHA | 102 | 4.66M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 4.66M | #endif | 104 | 4.66M | outptr += RGB_PIXELSIZE; | 105 | 4.66M | } | 106 | 339k | } | 107 | 205k | } |
Unexecuted instantiation: jdcolor-12.c:gray_extxrgb_convert Unexecuted instantiation: jdcolor-16.c:gray_extrgb_convert Unexecuted instantiation: jdcolor-16.c:gray_extrgbx_convert Unexecuted instantiation: jdcolor-16.c:gray_extbgr_convert Unexecuted instantiation: jdcolor-16.c:gray_extbgrx_convert Unexecuted instantiation: jdcolor-16.c:gray_extxbgr_convert Unexecuted instantiation: jdcolor-16.c:gray_extxrgb_convert Unexecuted instantiation: jdcolor-16.c:gray_rgb_convert |
108 | | |
109 | | |
110 | | /* |
111 | | * Convert RGB to extended RGB: just swap the order of source pixels |
112 | | */ |
113 | | |
114 | | INLINE |
115 | | LOCAL(void) |
116 | | rgb_rgb_convert(j_decompress_ptr cinfo, _JSAMPIMAGE input_buf, |
117 | | JDIMENSION input_row, _JSAMPARRAY output_buf, int num_rows) |
118 | 1.68M | { |
119 | 1.68M | register _JSAMPROW inptr0, inptr1, inptr2; |
120 | 1.68M | register _JSAMPROW outptr; |
121 | 1.68M | register JDIMENSION col; |
122 | 1.68M | JDIMENSION num_cols = cinfo->output_width; |
123 | | |
124 | 4.20M | while (--num_rows >= 0) { |
125 | 2.52M | inptr0 = input_buf[0][input_row]; |
126 | 2.52M | inptr1 = input_buf[1][input_row]; |
127 | 2.52M | inptr2 = input_buf[2][input_row]; |
128 | 2.52M | input_row++; |
129 | 2.52M | outptr = *output_buf++; |
130 | 135M | for (col = 0; col < num_cols; col++) { |
131 | 132M | outptr[RGB_RED] = inptr0[col]; |
132 | 132M | outptr[RGB_GREEN] = inptr1[col]; |
133 | 132M | outptr[RGB_BLUE] = inptr2[col]; |
134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ |
135 | | /* opaque alpha channel value */ |
136 | | #ifdef RGB_ALPHA |
137 | 55.9M | outptr[RGB_ALPHA] = _MAXJSAMPLE; |
138 | | #endif |
139 | 132M | outptr += RGB_PIXELSIZE; |
140 | 132M | } |
141 | 2.52M | } |
142 | 1.68M | } Unexecuted instantiation: jdcolor-8.c:rgb_extrgb_convert jdcolor-8.c:rgb_extrgbx_convert Line | Count | Source | 118 | 2.93k | { | 119 | 2.93k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 2.93k | register _JSAMPROW outptr; | 121 | 2.93k | register JDIMENSION col; | 122 | 2.93k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 8.29k | while (--num_rows >= 0) { | 125 | 5.36k | inptr0 = input_buf[0][input_row]; | 126 | 5.36k | inptr1 = input_buf[1][input_row]; | 127 | 5.36k | inptr2 = input_buf[2][input_row]; | 128 | 5.36k | input_row++; | 129 | 5.36k | outptr = *output_buf++; | 130 | 2.98M | for (col = 0; col < num_cols; col++) { | 131 | 2.98M | outptr[RGB_RED] = inptr0[col]; | 132 | 2.98M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 2.98M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 2.98M | #ifdef RGB_ALPHA | 137 | 2.98M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 2.98M | #endif | 139 | 2.98M | outptr += RGB_PIXELSIZE; | 140 | 2.98M | } | 141 | 5.36k | } | 142 | 2.93k | } |
jdcolor-8.c:rgb_extbgr_convert Line | Count | Source | 118 | 879k | { | 119 | 879k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 879k | register _JSAMPROW outptr; | 121 | 879k | register JDIMENSION col; | 122 | 879k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 1.85M | while (--num_rows >= 0) { | 125 | 971k | inptr0 = input_buf[0][input_row]; | 126 | 971k | inptr1 = input_buf[1][input_row]; | 127 | 971k | inptr2 = input_buf[2][input_row]; | 128 | 971k | input_row++; | 129 | 971k | outptr = *output_buf++; | 130 | 77.8M | for (col = 0; col < num_cols; col++) { | 131 | 76.9M | outptr[RGB_RED] = inptr0[col]; | 132 | 76.9M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 76.9M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | | #ifdef RGB_ALPHA | 137 | | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | | #endif | 139 | 76.9M | outptr += RGB_PIXELSIZE; | 140 | 76.9M | } | 141 | 971k | } | 142 | 879k | } |
jdcolor-8.c:rgb_extbgrx_convert Line | Count | Source | 118 | 116k | { | 119 | 116k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 116k | register _JSAMPROW outptr; | 121 | 116k | register JDIMENSION col; | 122 | 116k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 369k | while (--num_rows >= 0) { | 125 | 252k | inptr0 = input_buf[0][input_row]; | 126 | 252k | inptr1 = input_buf[1][input_row]; | 127 | 252k | inptr2 = input_buf[2][input_row]; | 128 | 252k | input_row++; | 129 | 252k | outptr = *output_buf++; | 130 | 10.4M | for (col = 0; col < num_cols; col++) { | 131 | 10.1M | outptr[RGB_RED] = inptr0[col]; | 132 | 10.1M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 10.1M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 10.1M | #ifdef RGB_ALPHA | 137 | 10.1M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 10.1M | #endif | 139 | 10.1M | outptr += RGB_PIXELSIZE; | 140 | 10.1M | } | 141 | 252k | } | 142 | 116k | } |
jdcolor-8.c:rgb_extxbgr_convert Line | Count | Source | 118 | 85.1k | { | 119 | 85.1k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 85.1k | register _JSAMPROW outptr; | 121 | 85.1k | register JDIMENSION col; | 122 | 85.1k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 272k | while (--num_rows >= 0) { | 125 | 187k | inptr0 = input_buf[0][input_row]; | 126 | 187k | inptr1 = input_buf[1][input_row]; | 127 | 187k | inptr2 = input_buf[2][input_row]; | 128 | 187k | input_row++; | 129 | 187k | outptr = *output_buf++; | 130 | 8.79M | for (col = 0; col < num_cols; col++) { | 131 | 8.61M | outptr[RGB_RED] = inptr0[col]; | 132 | 8.61M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 8.61M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 8.61M | #ifdef RGB_ALPHA | 137 | 8.61M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 8.61M | #endif | 139 | 8.61M | outptr += RGB_PIXELSIZE; | 140 | 8.61M | } | 141 | 187k | } | 142 | 85.1k | } |
jdcolor-8.c:rgb_extxrgb_convert Line | Count | Source | 118 | 988 | { | 119 | 988 | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 988 | register _JSAMPROW outptr; | 121 | 988 | register JDIMENSION col; | 122 | 988 | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 2.78k | while (--num_rows >= 0) { | 125 | 1.79k | inptr0 = input_buf[0][input_row]; | 126 | 1.79k | inptr1 = input_buf[1][input_row]; | 127 | 1.79k | inptr2 = input_buf[2][input_row]; | 128 | 1.79k | input_row++; | 129 | 1.79k | outptr = *output_buf++; | 130 | 351k | for (col = 0; col < num_cols; col++) { | 131 | 349k | outptr[RGB_RED] = inptr0[col]; | 132 | 349k | outptr[RGB_GREEN] = inptr1[col]; | 133 | 349k | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 349k | #ifdef RGB_ALPHA | 137 | 349k | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 349k | #endif | 139 | 349k | outptr += RGB_PIXELSIZE; | 140 | 349k | } | 141 | 1.79k | } | 142 | 988 | } |
Unexecuted instantiation: jdcolor-12.c:rgb_extrgb_convert Unexecuted instantiation: jdcolor-12.c:rgb_extrgbx_convert Unexecuted instantiation: jdcolor-12.c:rgb_extbgr_convert jdcolor-12.c:rgb_extbgrx_convert Line | Count | Source | 118 | 120k | { | 119 | 120k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 120k | register _JSAMPROW outptr; | 121 | 120k | register JDIMENSION col; | 122 | 120k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 294k | while (--num_rows >= 0) { | 125 | 174k | inptr0 = input_buf[0][input_row]; | 126 | 174k | inptr1 = input_buf[1][input_row]; | 127 | 174k | inptr2 = input_buf[2][input_row]; | 128 | 174k | input_row++; | 129 | 174k | outptr = *output_buf++; | 130 | 8.52M | for (col = 0; col < num_cols; col++) { | 131 | 8.35M | outptr[RGB_RED] = inptr0[col]; | 132 | 8.35M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 8.35M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 8.35M | #ifdef RGB_ALPHA | 137 | 8.35M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 8.35M | #endif | 139 | 8.35M | outptr += RGB_PIXELSIZE; | 140 | 8.35M | } | 141 | 174k | } | 142 | 120k | } |
jdcolor-12.c:rgb_extxbgr_convert Line | Count | Source | 118 | 115k | { | 119 | 115k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 115k | register _JSAMPROW outptr; | 121 | 115k | register JDIMENSION col; | 122 | 115k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 273k | while (--num_rows >= 0) { | 125 | 158k | inptr0 = input_buf[0][input_row]; | 126 | 158k | inptr1 = input_buf[1][input_row]; | 127 | 158k | inptr2 = input_buf[2][input_row]; | 128 | 158k | input_row++; | 129 | 158k | outptr = *output_buf++; | 130 | 7.22M | for (col = 0; col < num_cols; col++) { | 131 | 7.06M | outptr[RGB_RED] = inptr0[col]; | 132 | 7.06M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 7.06M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 7.06M | #ifdef RGB_ALPHA | 137 | 7.06M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 7.06M | #endif | 139 | 7.06M | outptr += RGB_PIXELSIZE; | 140 | 7.06M | } | 141 | 158k | } | 142 | 115k | } |
Unexecuted instantiation: jdcolor-12.c:rgb_extxrgb_convert Unexecuted instantiation: jdcolor-16.c:rgb_extrgb_convert Unexecuted instantiation: jdcolor-16.c:rgb_extrgbx_convert Unexecuted instantiation: jdcolor-16.c:rgb_extbgr_convert jdcolor-16.c:rgb_extbgrx_convert Line | Count | Source | 118 | 181k | { | 119 | 181k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 181k | register _JSAMPROW outptr; | 121 | 181k | register JDIMENSION col; | 122 | 181k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 567k | while (--num_rows >= 0) { | 125 | 385k | inptr0 = input_buf[0][input_row]; | 126 | 385k | inptr1 = input_buf[1][input_row]; | 127 | 385k | inptr2 = input_buf[2][input_row]; | 128 | 385k | input_row++; | 129 | 385k | outptr = *output_buf++; | 130 | 9.58M | for (col = 0; col < num_cols; col++) { | 131 | 9.19M | outptr[RGB_RED] = inptr0[col]; | 132 | 9.19M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 9.19M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 9.19M | #ifdef RGB_ALPHA | 137 | 9.19M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 9.19M | #endif | 139 | 9.19M | outptr += RGB_PIXELSIZE; | 140 | 9.19M | } | 141 | 385k | } | 142 | 181k | } |
jdcolor-16.c:rgb_extxbgr_convert Line | Count | Source | 118 | 181k | { | 119 | 181k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 181k | register _JSAMPROW outptr; | 121 | 181k | register JDIMENSION col; | 122 | 181k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 567k | while (--num_rows >= 0) { | 125 | 385k | inptr0 = input_buf[0][input_row]; | 126 | 385k | inptr1 = input_buf[1][input_row]; | 127 | 385k | inptr2 = input_buf[2][input_row]; | 128 | 385k | input_row++; | 129 | 385k | outptr = *output_buf++; | 130 | 9.58M | for (col = 0; col < num_cols; col++) { | 131 | 9.19M | outptr[RGB_RED] = inptr0[col]; | 132 | 9.19M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 9.19M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 9.19M | #ifdef RGB_ALPHA | 137 | 9.19M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 9.19M | #endif | 139 | 9.19M | outptr += RGB_PIXELSIZE; | 140 | 9.19M | } | 141 | 385k | } | 142 | 181k | } |
Unexecuted instantiation: jdcolor-16.c:rgb_extxrgb_convert |