/src/libjpeg-turbo.main/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 | 967k | { |
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.23M | while (--num_rows >= 0) { |
50 | 2.26M | inptr0 = input_buf[0][input_row]; |
51 | 2.26M | inptr1 = input_buf[1][input_row]; |
52 | 2.26M | inptr2 = input_buf[2][input_row]; |
53 | 2.26M | input_row++; |
54 | 2.26M | outptr = *output_buf++; |
55 | 59.6M | for (col = 0; col < num_cols; col++) { |
56 | 57.4M | y = inptr0[col]; |
57 | 57.4M | cb = inptr1[col]; |
58 | 57.4M | cr = inptr2[col]; |
59 | | /* Range-limiting is essential due to noise introduced by DCT losses. */ |
60 | 57.4M | outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; |
61 | 57.4M | outptr[RGB_GREEN] = range_limit[y + |
62 | 57.4M | ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], |
63 | 57.4M | SCALEBITS))]; |
64 | 57.4M | 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 | 16.3M | outptr[RGB_ALPHA] = _MAXJSAMPLE; |
69 | | #endif |
70 | 57.4M | outptr += RGB_PIXELSIZE; |
71 | 57.4M | } |
72 | 2.26M | } |
73 | | #else |
74 | 0 | ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); |
75 | | #endif |
76 | 967k | } 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 | 440k | { | 34 | 440k | #if BITS_IN_JSAMPLE != 16 | 35 | 440k | my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; | 36 | 440k | register int y, cb, cr; | 37 | 440k | register _JSAMPROW outptr; | 38 | 440k | register _JSAMPROW inptr0, inptr1, inptr2; | 39 | 440k | register JDIMENSION col; | 40 | 440k | JDIMENSION num_cols = cinfo->output_width; | 41 | | /* copy these pointers into registers if possible */ | 42 | 440k | register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit; | 43 | 440k | register int *Crrtab = cconvert->Cr_r_tab; | 44 | 440k | register int *Cbbtab = cconvert->Cb_b_tab; | 45 | 440k | register JLONG *Crgtab = cconvert->Cr_g_tab; | 46 | 440k | register JLONG *Cbgtab = cconvert->Cb_g_tab; | 47 | 440k | SHIFT_TEMPS | 48 | | | 49 | 1.58M | while (--num_rows >= 0) { | 50 | 1.14M | inptr0 = input_buf[0][input_row]; | 51 | 1.14M | inptr1 = input_buf[1][input_row]; | 52 | 1.14M | inptr2 = input_buf[2][input_row]; | 53 | 1.14M | input_row++; | 54 | 1.14M | outptr = *output_buf++; | 55 | 42.2M | for (col = 0; col < num_cols; col++) { | 56 | 41.1M | y = inptr0[col]; | 57 | 41.1M | cb = inptr1[col]; | 58 | 41.1M | cr = inptr2[col]; | 59 | | /* Range-limiting is essential due to noise introduced by DCT losses. */ | 60 | 41.1M | outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; | 61 | 41.1M | outptr[RGB_GREEN] = range_limit[y + | 62 | 41.1M | ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], | 63 | 41.1M | SCALEBITS))]; | 64 | 41.1M | 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 | 41.1M | outptr += RGB_PIXELSIZE; | 71 | 41.1M | } | 72 | 1.14M | } | 73 | | #else | 74 | | ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); | 75 | | #endif | 76 | 440k | } |
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 | 420k | { | 34 | 420k | #if BITS_IN_JSAMPLE != 16 | 35 | 420k | my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; | 36 | 420k | register int y, cb, cr; | 37 | 420k | register _JSAMPROW outptr; | 38 | 420k | register _JSAMPROW inptr0, inptr1, inptr2; | 39 | 420k | register JDIMENSION col; | 40 | 420k | JDIMENSION num_cols = cinfo->output_width; | 41 | | /* copy these pointers into registers if possible */ | 42 | 420k | register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit; | 43 | 420k | register int *Crrtab = cconvert->Cr_r_tab; | 44 | 420k | register int *Cbbtab = cconvert->Cb_b_tab; | 45 | 420k | register JLONG *Crgtab = cconvert->Cr_g_tab; | 46 | 420k | register JLONG *Cbgtab = cconvert->Cb_g_tab; | 47 | 420k | SHIFT_TEMPS | 48 | | | 49 | 1.31M | while (--num_rows >= 0) { | 50 | 893k | inptr0 = input_buf[0][input_row]; | 51 | 893k | inptr1 = input_buf[1][input_row]; | 52 | 893k | inptr2 = input_buf[2][input_row]; | 53 | 893k | input_row++; | 54 | 893k | outptr = *output_buf++; | 55 | 16.0M | for (col = 0; col < num_cols; col++) { | 56 | 15.1M | y = inptr0[col]; | 57 | 15.1M | cb = inptr1[col]; | 58 | 15.1M | cr = inptr2[col]; | 59 | | /* Range-limiting is essential due to noise introduced by DCT losses. */ | 60 | 15.1M | outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; | 61 | 15.1M | outptr[RGB_GREEN] = range_limit[y + | 62 | 15.1M | ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], | 63 | 15.1M | SCALEBITS))]; | 64 | 15.1M | 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 | 15.1M | #ifdef RGB_ALPHA | 68 | 15.1M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 69 | 15.1M | #endif | 70 | 15.1M | outptr += RGB_PIXELSIZE; | 71 | 15.1M | } | 72 | 893k | } | 73 | | #else | 74 | | ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); | 75 | | #endif | 76 | 420k | } |
jdcolor-12.c:ycc_extxbgr_convert Line | Count | Source | 33 | 105k | { | 34 | 105k | #if BITS_IN_JSAMPLE != 16 | 35 | 105k | my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert; | 36 | 105k | register int y, cb, cr; | 37 | 105k | register _JSAMPROW outptr; | 38 | 105k | register _JSAMPROW inptr0, inptr1, inptr2; | 39 | 105k | register JDIMENSION col; | 40 | 105k | JDIMENSION num_cols = cinfo->output_width; | 41 | | /* copy these pointers into registers if possible */ | 42 | 105k | register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit; | 43 | 105k | register int *Crrtab = cconvert->Cr_r_tab; | 44 | 105k | register int *Cbbtab = cconvert->Cb_b_tab; | 45 | 105k | register JLONG *Crgtab = cconvert->Cr_g_tab; | 46 | 105k | register JLONG *Cbgtab = cconvert->Cb_g_tab; | 47 | 105k | SHIFT_TEMPS | 48 | | | 49 | 329k | while (--num_rows >= 0) { | 50 | 223k | inptr0 = input_buf[0][input_row]; | 51 | 223k | inptr1 = input_buf[1][input_row]; | 52 | 223k | inptr2 = input_buf[2][input_row]; | 53 | 223k | input_row++; | 54 | 223k | outptr = *output_buf++; | 55 | 1.41M | for (col = 0; col < num_cols; col++) { | 56 | 1.18M | y = inptr0[col]; | 57 | 1.18M | cb = inptr1[col]; | 58 | 1.18M | cr = inptr2[col]; | 59 | | /* Range-limiting is essential due to noise introduced by DCT losses. */ | 60 | 1.18M | outptr[RGB_RED] = range_limit[y + Crrtab[cr]]; | 61 | 1.18M | outptr[RGB_GREEN] = range_limit[y + | 62 | 1.18M | ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr], | 63 | 1.18M | SCALEBITS))]; | 64 | 1.18M | 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.18M | #ifdef RGB_ALPHA | 68 | 1.18M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 69 | 1.18M | #endif | 70 | 1.18M | outptr += RGB_PIXELSIZE; | 71 | 1.18M | } | 72 | 223k | } | 73 | | #else | 74 | | ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL); | 75 | | #endif | 76 | 105k | } |
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 | 7.57M | { |
90 | 7.57M | register _JSAMPROW inptr, outptr; |
91 | 7.57M | register JDIMENSION col; |
92 | 7.57M | JDIMENSION num_cols = cinfo->output_width; |
93 | | |
94 | 19.8M | while (--num_rows >= 0) { |
95 | 12.2M | inptr = input_buf[0][input_row++]; |
96 | 12.2M | outptr = *output_buf++; |
97 | 1.16G | for (col = 0; col < num_cols; col++) { |
98 | 1.15G | 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 | 168M | outptr[RGB_ALPHA] = _MAXJSAMPLE; |
103 | | #endif |
104 | 1.15G | outptr += RGB_PIXELSIZE; |
105 | 1.15G | } |
106 | 12.2M | } |
107 | 7.57M | } jdcolor-8.c:gray_extrgb_convert Line | Count | Source | 89 | 2.69M | { | 90 | 2.69M | register _JSAMPROW inptr, outptr; | 91 | 2.69M | register JDIMENSION col; | 92 | 2.69M | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 6.79M | while (--num_rows >= 0) { | 95 | 4.09M | inptr = input_buf[0][input_row++]; | 96 | 4.09M | outptr = *output_buf++; | 97 | 552M | for (col = 0; col < num_cols; col++) { | 98 | 548M | 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 | 548M | outptr += RGB_PIXELSIZE; | 105 | 548M | } | 106 | 4.09M | } | 107 | 2.69M | } |
jdcolor-8.c:gray_extrgbx_convert Line | Count | Source | 89 | 156k | { | 90 | 156k | register _JSAMPROW inptr, outptr; | 91 | 156k | register JDIMENSION col; | 92 | 156k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 312k | while (--num_rows >= 0) { | 95 | 156k | inptr = input_buf[0][input_row++]; | 96 | 156k | outptr = *output_buf++; | 97 | 8.47M | for (col = 0; col < num_cols; col++) { | 98 | 8.31M | 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 | 8.31M | #ifdef RGB_ALPHA | 102 | 8.31M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 8.31M | #endif | 104 | 8.31M | outptr += RGB_PIXELSIZE; | 105 | 8.31M | } | 106 | 156k | } | 107 | 156k | } |
jdcolor-8.c:gray_extbgr_convert Line | Count | Source | 89 | 208k | { | 90 | 208k | register _JSAMPROW inptr, outptr; | 91 | 208k | register JDIMENSION col; | 92 | 208k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 416k | while (--num_rows >= 0) { | 95 | 208k | inptr = input_buf[0][input_row++]; | 96 | 208k | outptr = *output_buf++; | 97 | 14.4M | for (col = 0; col < num_cols; col++) { | 98 | 14.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 | | #ifdef RGB_ALPHA | 102 | | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | | #endif | 104 | 14.2M | outptr += RGB_PIXELSIZE; | 105 | 14.2M | } | 106 | 208k | } | 107 | 208k | } |
jdcolor-8.c:gray_extbgrx_convert Line | Count | Source | 89 | 1.23M | { | 90 | 1.23M | register _JSAMPROW inptr, outptr; | 91 | 1.23M | register JDIMENSION col; | 92 | 1.23M | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 3.13M | while (--num_rows >= 0) { | 95 | 1.90M | inptr = input_buf[0][input_row++]; | 96 | 1.90M | outptr = *output_buf++; | 97 | 84.3M | for (col = 0; col < num_cols; col++) { | 98 | 82.4M | 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 | 82.4M | #ifdef RGB_ALPHA | 102 | 82.4M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 82.4M | #endif | 104 | 82.4M | outptr += RGB_PIXELSIZE; | 105 | 82.4M | } | 106 | 1.90M | } | 107 | 1.23M | } |
jdcolor-8.c:gray_extxbgr_convert Line | Count | Source | 89 | 336k | { | 90 | 336k | register _JSAMPROW inptr, outptr; | 91 | 336k | register JDIMENSION col; | 92 | 336k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 846k | while (--num_rows >= 0) { | 95 | 510k | inptr = input_buf[0][input_row++]; | 96 | 510k | outptr = *output_buf++; | 97 | 9.61M | for (col = 0; col < num_cols; col++) { | 98 | 9.10M | 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 | 9.10M | #ifdef RGB_ALPHA | 102 | 9.10M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 9.10M | #endif | 104 | 9.10M | outptr += RGB_PIXELSIZE; | 105 | 9.10M | } | 106 | 510k | } | 107 | 336k | } |
jdcolor-8.c:gray_extxrgb_convert Line | Count | Source | 89 | 52.0k | { | 90 | 52.0k | register _JSAMPROW inptr, outptr; | 91 | 52.0k | register JDIMENSION col; | 92 | 52.0k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 104k | while (--num_rows >= 0) { | 95 | 52.0k | inptr = input_buf[0][input_row++]; | 96 | 52.0k | outptr = *output_buf++; | 97 | 1.04M | for (col = 0; col < num_cols; col++) { | 98 | 993k | 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 | 993k | #ifdef RGB_ALPHA | 102 | 993k | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 993k | #endif | 104 | 993k | outptr += RGB_PIXELSIZE; | 105 | 993k | } | 106 | 52.0k | } | 107 | 52.0k | } |
jdcolor-12.c:gray_extrgb_convert Line | Count | Source | 89 | 1.80M | { | 90 | 1.80M | register _JSAMPROW inptr, outptr; | 91 | 1.80M | register JDIMENSION col; | 92 | 1.80M | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 5.12M | while (--num_rows >= 0) { | 95 | 3.32M | inptr = input_buf[0][input_row++]; | 96 | 3.32M | outptr = *output_buf++; | 97 | 422M | for (col = 0; col < num_cols; col++) { | 98 | 418M | 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 | 418M | outptr += RGB_PIXELSIZE; | 105 | 418M | } | 106 | 3.32M | } | 107 | 1.80M | } |
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 | 858k | { | 90 | 858k | register _JSAMPROW inptr, outptr; | 91 | 858k | register JDIMENSION col; | 92 | 858k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 2.44M | while (--num_rows >= 0) { | 95 | 1.58M | inptr = input_buf[0][input_row++]; | 96 | 1.58M | outptr = *output_buf++; | 97 | 62.7M | for (col = 0; col < num_cols; col++) { | 98 | 61.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 | 61.1M | #ifdef RGB_ALPHA | 102 | 61.1M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 61.1M | #endif | 104 | 61.1M | outptr += RGB_PIXELSIZE; | 105 | 61.1M | } | 106 | 1.58M | } | 107 | 858k | } |
jdcolor-12.c:gray_extxbgr_convert Line | Count | Source | 89 | 225k | { | 90 | 225k | register _JSAMPROW inptr, outptr; | 91 | 225k | register JDIMENSION col; | 92 | 225k | JDIMENSION num_cols = cinfo->output_width; | 93 | | | 94 | 641k | while (--num_rows >= 0) { | 95 | 415k | inptr = input_buf[0][input_row++]; | 96 | 415k | outptr = *output_buf++; | 97 | 7.35M | for (col = 0; col < num_cols; col++) { | 98 | 6.94M | 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 | 6.94M | #ifdef RGB_ALPHA | 102 | 6.94M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 103 | 6.94M | #endif | 104 | 6.94M | outptr += RGB_PIXELSIZE; | 105 | 6.94M | } | 106 | 415k | } | 107 | 225k | } |
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 | 2.40M | { |
119 | 2.40M | register _JSAMPROW inptr0, inptr1, inptr2; |
120 | 2.40M | register _JSAMPROW outptr; |
121 | 2.40M | register JDIMENSION col; |
122 | 2.40M | JDIMENSION num_cols = cinfo->output_width; |
123 | | |
124 | 6.45M | while (--num_rows >= 0) { |
125 | 4.04M | inptr0 = input_buf[0][input_row]; |
126 | 4.04M | inptr1 = input_buf[1][input_row]; |
127 | 4.04M | inptr2 = input_buf[2][input_row]; |
128 | 4.04M | input_row++; |
129 | 4.04M | outptr = *output_buf++; |
130 | 140M | for (col = 0; col < num_cols; col++) { |
131 | 136M | outptr[RGB_RED] = inptr0[col]; |
132 | 136M | outptr[RGB_GREEN] = inptr1[col]; |
133 | 136M | 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 | 98.1M | outptr[RGB_ALPHA] = _MAXJSAMPLE; |
138 | | #endif |
139 | 136M | outptr += RGB_PIXELSIZE; |
140 | 136M | } |
141 | 4.04M | } |
142 | 2.40M | } Unexecuted instantiation: jdcolor-8.c:rgb_extrgb_convert jdcolor-8.c:rgb_extrgbx_convert Line | Count | Source | 118 | 78.0k | { | 119 | 78.0k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 78.0k | register _JSAMPROW outptr; | 121 | 78.0k | register JDIMENSION col; | 122 | 78.0k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 233k | while (--num_rows >= 0) { | 125 | 155k | inptr0 = input_buf[0][input_row]; | 126 | 155k | inptr1 = input_buf[1][input_row]; | 127 | 155k | inptr2 = input_buf[2][input_row]; | 128 | 155k | input_row++; | 129 | 155k | outptr = *output_buf++; | 130 | 5.47M | for (col = 0; col < num_cols; col++) { | 131 | 5.32M | outptr[RGB_RED] = inptr0[col]; | 132 | 5.32M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 5.32M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 5.32M | #ifdef RGB_ALPHA | 137 | 5.32M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 5.32M | #endif | 139 | 5.32M | outptr += RGB_PIXELSIZE; | 140 | 5.32M | } | 141 | 155k | } | 142 | 78.0k | } |
jdcolor-8.c:rgb_extbgr_convert Line | Count | Source | 118 | 1.10M | { | 119 | 1.10M | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 1.10M | register _JSAMPROW outptr; | 121 | 1.10M | register JDIMENSION col; | 122 | 1.10M | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 2.41M | while (--num_rows >= 0) { | 125 | 1.31M | inptr0 = input_buf[0][input_row]; | 126 | 1.31M | inptr1 = input_buf[1][input_row]; | 127 | 1.31M | inptr2 = input_buf[2][input_row]; | 128 | 1.31M | input_row++; | 129 | 1.31M | outptr = *output_buf++; | 130 | 39.9M | for (col = 0; col < num_cols; col++) { | 131 | 38.6M | outptr[RGB_RED] = inptr0[col]; | 132 | 38.6M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 38.6M | 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 | 38.6M | outptr += RGB_PIXELSIZE; | 140 | 38.6M | } | 141 | 1.31M | } | 142 | 1.10M | } |
jdcolor-8.c:rgb_extbgrx_convert Line | Count | Source | 118 | 235k | { | 119 | 235k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 235k | register _JSAMPROW outptr; | 121 | 235k | register JDIMENSION col; | 122 | 235k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 852k | while (--num_rows >= 0) { | 125 | 617k | inptr0 = input_buf[0][input_row]; | 126 | 617k | inptr1 = input_buf[1][input_row]; | 127 | 617k | inptr2 = input_buf[2][input_row]; | 128 | 617k | input_row++; | 129 | 617k | outptr = *output_buf++; | 130 | 12.4M | for (col = 0; col < num_cols; col++) { | 131 | 11.8M | outptr[RGB_RED] = inptr0[col]; | 132 | 11.8M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 11.8M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 11.8M | #ifdef RGB_ALPHA | 137 | 11.8M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 11.8M | #endif | 139 | 11.8M | outptr += RGB_PIXELSIZE; | 140 | 11.8M | } | 141 | 617k | } | 142 | 235k | } |
jdcolor-8.c:rgb_extxbgr_convert Line | Count | Source | 118 | 206k | { | 119 | 206k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 206k | register _JSAMPROW outptr; | 121 | 206k | register JDIMENSION col; | 122 | 206k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 720k | while (--num_rows >= 0) { | 125 | 513k | inptr0 = input_buf[0][input_row]; | 126 | 513k | inptr1 = input_buf[1][input_row]; | 127 | 513k | inptr2 = input_buf[2][input_row]; | 128 | 513k | input_row++; | 129 | 513k | outptr = *output_buf++; | 130 | 11.2M | for (col = 0; col < num_cols; col++) { | 131 | 10.7M | outptr[RGB_RED] = inptr0[col]; | 132 | 10.7M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 10.7M | 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.7M | #ifdef RGB_ALPHA | 137 | 10.7M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 10.7M | #endif | 139 | 10.7M | outptr += RGB_PIXELSIZE; | 140 | 10.7M | } | 141 | 513k | } | 142 | 206k | } |
jdcolor-8.c:rgb_extxrgb_convert Line | Count | Source | 118 | 26.0k | { | 119 | 26.0k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 26.0k | register _JSAMPROW outptr; | 121 | 26.0k | register JDIMENSION col; | 122 | 26.0k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 77.9k | while (--num_rows >= 0) { | 125 | 51.8k | inptr0 = input_buf[0][input_row]; | 126 | 51.8k | inptr1 = input_buf[1][input_row]; | 127 | 51.8k | inptr2 = input_buf[2][input_row]; | 128 | 51.8k | input_row++; | 129 | 51.8k | outptr = *output_buf++; | 130 | 700k | for (col = 0; col < num_cols; col++) { | 131 | 648k | outptr[RGB_RED] = inptr0[col]; | 132 | 648k | outptr[RGB_GREEN] = inptr1[col]; | 133 | 648k | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 648k | #ifdef RGB_ALPHA | 137 | 648k | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 648k | #endif | 139 | 648k | outptr += RGB_PIXELSIZE; | 140 | 648k | } | 141 | 51.8k | } | 142 | 26.0k | } |
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 | 151k | { | 119 | 151k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 151k | register _JSAMPROW outptr; | 121 | 151k | register JDIMENSION col; | 122 | 151k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 473k | while (--num_rows >= 0) { | 125 | 322k | inptr0 = input_buf[0][input_row]; | 126 | 322k | inptr1 = input_buf[1][input_row]; | 127 | 322k | inptr2 = input_buf[2][input_row]; | 128 | 322k | input_row++; | 129 | 322k | outptr = *output_buf++; | 130 | 16.2M | for (col = 0; col < num_cols; col++) { | 131 | 15.9M | outptr[RGB_RED] = inptr0[col]; | 132 | 15.9M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 15.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 | 15.9M | #ifdef RGB_ALPHA | 137 | 15.9M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 15.9M | #endif | 139 | 15.9M | outptr += RGB_PIXELSIZE; | 140 | 15.9M | } | 141 | 322k | } | 142 | 151k | } |
jdcolor-12.c:rgb_extxbgr_convert Line | Count | Source | 118 | 114k | { | 119 | 114k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 114k | register _JSAMPROW outptr; | 121 | 114k | register JDIMENSION col; | 122 | 114k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 333k | while (--num_rows >= 0) { | 125 | 219k | inptr0 = input_buf[0][input_row]; | 126 | 219k | inptr1 = input_buf[1][input_row]; | 127 | 219k | inptr2 = input_buf[2][input_row]; | 128 | 219k | input_row++; | 129 | 219k | outptr = *output_buf++; | 130 | 13.0M | for (col = 0; col < num_cols; col++) { | 131 | 12.8M | outptr[RGB_RED] = inptr0[col]; | 132 | 12.8M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 12.8M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 12.8M | #ifdef RGB_ALPHA | 137 | 12.8M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 12.8M | #endif | 139 | 12.8M | outptr += RGB_PIXELSIZE; | 140 | 12.8M | } | 141 | 219k | } | 142 | 114k | } |
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 | 247k | { | 119 | 247k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 247k | register _JSAMPROW outptr; | 121 | 247k | register JDIMENSION col; | 122 | 247k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 673k | while (--num_rows >= 0) { | 125 | 426k | inptr0 = input_buf[0][input_row]; | 126 | 426k | inptr1 = input_buf[1][input_row]; | 127 | 426k | inptr2 = input_buf[2][input_row]; | 128 | 426k | input_row++; | 129 | 426k | outptr = *output_buf++; | 130 | 20.8M | for (col = 0; col < num_cols; col++) { | 131 | 20.4M | outptr[RGB_RED] = inptr0[col]; | 132 | 20.4M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 20.4M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 20.4M | #ifdef RGB_ALPHA | 137 | 20.4M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 20.4M | #endif | 139 | 20.4M | outptr += RGB_PIXELSIZE; | 140 | 20.4M | } | 141 | 426k | } | 142 | 247k | } |
jdcolor-16.c:rgb_extxbgr_convert Line | Count | Source | 118 | 247k | { | 119 | 247k | register _JSAMPROW inptr0, inptr1, inptr2; | 120 | 247k | register _JSAMPROW outptr; | 121 | 247k | register JDIMENSION col; | 122 | 247k | JDIMENSION num_cols = cinfo->output_width; | 123 | | | 124 | 673k | while (--num_rows >= 0) { | 125 | 426k | inptr0 = input_buf[0][input_row]; | 126 | 426k | inptr1 = input_buf[1][input_row]; | 127 | 426k | inptr2 = input_buf[2][input_row]; | 128 | 426k | input_row++; | 129 | 426k | outptr = *output_buf++; | 130 | 20.8M | for (col = 0; col < num_cols; col++) { | 131 | 20.4M | outptr[RGB_RED] = inptr0[col]; | 132 | 20.4M | outptr[RGB_GREEN] = inptr1[col]; | 133 | 20.4M | outptr[RGB_BLUE] = inptr2[col]; | 134 | | /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */ | 135 | | /* opaque alpha channel value */ | 136 | 20.4M | #ifdef RGB_ALPHA | 137 | 20.4M | outptr[RGB_ALPHA] = _MAXJSAMPLE; | 138 | 20.4M | #endif | 139 | 20.4M | outptr += RGB_PIXELSIZE; | 140 | 20.4M | } | 141 | 426k | } | 142 | 247k | } |
Unexecuted instantiation: jdcolor-16.c:rgb_extxrgb_convert |