Coverage Report

Created: 2026-09-03 07:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libjpeg-turbo.3.1.x/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, 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_internal(j_decompress_ptr cinfo, _JSAMPIMAGE input_buf,
32
                         JDIMENSION input_row, _JSAMPARRAY output_buf,
33
                         int num_rows)
34
884k
{
35
#if BITS_IN_JSAMPLE != 16
36
  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
37
  register int y, cb, cr;
38
  register _JSAMPROW outptr;
39
  register _JSAMPROW inptr0, inptr1, inptr2;
40
  register JDIMENSION col;
41
  JDIMENSION num_cols = cinfo->output_width;
42
  /* copy these pointers into registers if possible */
43
  register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit;
44
  register int *Crrtab = cconvert->Cr_r_tab;
45
  register int *Cbbtab = cconvert->Cb_b_tab;
46
  register JLONG *Crgtab = cconvert->Cr_g_tab;
47
  register JLONG *Cbgtab = cconvert->Cb_g_tab;
48
  SHIFT_TEMPS
49
50
2.78M
  while (--num_rows >= 0) {
51
1.90M
    inptr0 = input_buf[0][input_row];
52
1.90M
    inptr1 = input_buf[1][input_row];
53
1.90M
    inptr2 = input_buf[2][input_row];
54
1.90M
    input_row++;
55
1.90M
    outptr = *output_buf++;
56
95.9M
    for (col = 0; col < num_cols; col++) {
57
94.0M
      y  = inptr0[col];
58
94.0M
      cb = inptr1[col];
59
94.0M
      cr = inptr2[col];
60
      /* Range-limiting is essential due to noise introduced by DCT losses. */
61
94.0M
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
62
94.0M
      outptr[RGB_GREEN] = range_limit[y +
63
94.0M
                              ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
64
94.0M
                                                SCALEBITS))];
65
94.0M
      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];
66
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
67
      /* opaque alpha channel value */
68
#ifdef RGB_ALPHA
69
22.4M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
70
#endif
71
94.0M
      outptr += RGB_PIXELSIZE;
72
94.0M
    }
73
1.90M
  }
74
#else
75
0
  ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
76
#endif
77
884k
}
Unexecuted instantiation: jdcolor-8.c:ycc_extrgb_convert_internal
Unexecuted instantiation: jdcolor-8.c:ycc_extrgbx_convert_internal
Unexecuted instantiation: jdcolor-8.c:ycc_extbgr_convert_internal
Unexecuted instantiation: jdcolor-8.c:ycc_extbgrx_convert_internal
Unexecuted instantiation: jdcolor-8.c:ycc_extxbgr_convert_internal
Unexecuted instantiation: jdcolor-8.c:ycc_extxrgb_convert_internal
Unexecuted instantiation: jdcolor-8.c:ycc_rgb_convert_internal
jdcolor-12.c:ycc_extrgb_convert_internal
Line
Count
Source
34
452k
{
35
452k
#if BITS_IN_JSAMPLE != 16
36
452k
  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
37
452k
  register int y, cb, cr;
38
452k
  register _JSAMPROW outptr;
39
452k
  register _JSAMPROW inptr0, inptr1, inptr2;
40
452k
  register JDIMENSION col;
41
452k
  JDIMENSION num_cols = cinfo->output_width;
42
  /* copy these pointers into registers if possible */
43
452k
  register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit;
44
452k
  register int *Crrtab = cconvert->Cr_r_tab;
45
452k
  register int *Cbbtab = cconvert->Cb_b_tab;
46
452k
  register JLONG *Crgtab = cconvert->Cr_g_tab;
47
452k
  register JLONG *Cbgtab = cconvert->Cb_g_tab;
48
452k
  SHIFT_TEMPS
49
50
1.49M
  while (--num_rows >= 0) {
51
1.04M
    inptr0 = input_buf[0][input_row];
52
1.04M
    inptr1 = input_buf[1][input_row];
53
1.04M
    inptr2 = input_buf[2][input_row];
54
1.04M
    input_row++;
55
1.04M
    outptr = *output_buf++;
56
72.6M
    for (col = 0; col < num_cols; col++) {
57
71.5M
      y  = inptr0[col];
58
71.5M
      cb = inptr1[col];
59
71.5M
      cr = inptr2[col];
60
      /* Range-limiting is essential due to noise introduced by DCT losses. */
61
71.5M
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
62
71.5M
      outptr[RGB_GREEN] = range_limit[y +
63
71.5M
                              ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
64
71.5M
                                                SCALEBITS))];
65
71.5M
      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];
66
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
67
      /* opaque alpha channel value */
68
#ifdef RGB_ALPHA
69
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
70
#endif
71
71.5M
      outptr += RGB_PIXELSIZE;
72
71.5M
    }
73
1.04M
  }
74
#else
75
  ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
76
#endif
77
452k
}
Unexecuted instantiation: jdcolor-12.c:ycc_extrgbx_convert_internal
Unexecuted instantiation: jdcolor-12.c:ycc_extbgr_convert_internal
jdcolor-12.c:ycc_extbgrx_convert_internal
Line
Count
Source
34
344k
{
35
344k
#if BITS_IN_JSAMPLE != 16
36
344k
  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
37
344k
  register int y, cb, cr;
38
344k
  register _JSAMPROW outptr;
39
344k
  register _JSAMPROW inptr0, inptr1, inptr2;
40
344k
  register JDIMENSION col;
41
344k
  JDIMENSION num_cols = cinfo->output_width;
42
  /* copy these pointers into registers if possible */
43
344k
  register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit;
44
344k
  register int *Crrtab = cconvert->Cr_r_tab;
45
344k
  register int *Cbbtab = cconvert->Cb_b_tab;
46
344k
  register JLONG *Crgtab = cconvert->Cr_g_tab;
47
344k
  register JLONG *Cbgtab = cconvert->Cb_g_tab;
48
344k
  SHIFT_TEMPS
49
50
1.03M
  while (--num_rows >= 0) {
51
687k
    inptr0 = input_buf[0][input_row];
52
687k
    inptr1 = input_buf[1][input_row];
53
687k
    inptr2 = input_buf[2][input_row];
54
687k
    input_row++;
55
687k
    outptr = *output_buf++;
56
21.5M
    for (col = 0; col < num_cols; col++) {
57
20.8M
      y  = inptr0[col];
58
20.8M
      cb = inptr1[col];
59
20.8M
      cr = inptr2[col];
60
      /* Range-limiting is essential due to noise introduced by DCT losses. */
61
20.8M
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
62
20.8M
      outptr[RGB_GREEN] = range_limit[y +
63
20.8M
                              ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
64
20.8M
                                                SCALEBITS))];
65
20.8M
      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];
66
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
67
      /* opaque alpha channel value */
68
20.8M
#ifdef RGB_ALPHA
69
20.8M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
70
20.8M
#endif
71
20.8M
      outptr += RGB_PIXELSIZE;
72
20.8M
    }
73
687k
  }
74
#else
75
  ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
76
#endif
77
344k
}
jdcolor-12.c:ycc_extxbgr_convert_internal
Line
Count
Source
34
87.0k
{
35
87.0k
#if BITS_IN_JSAMPLE != 16
36
87.0k
  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
37
87.0k
  register int y, cb, cr;
38
87.0k
  register _JSAMPROW outptr;
39
87.0k
  register _JSAMPROW inptr0, inptr1, inptr2;
40
87.0k
  register JDIMENSION col;
41
87.0k
  JDIMENSION num_cols = cinfo->output_width;
42
  /* copy these pointers into registers if possible */
43
87.0k
  register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit;
44
87.0k
  register int *Crrtab = cconvert->Cr_r_tab;
45
87.0k
  register int *Cbbtab = cconvert->Cb_b_tab;
46
87.0k
  register JLONG *Crgtab = cconvert->Cr_g_tab;
47
87.0k
  register JLONG *Cbgtab = cconvert->Cb_g_tab;
48
87.0k
  SHIFT_TEMPS
49
50
259k
  while (--num_rows >= 0) {
51
172k
    inptr0 = input_buf[0][input_row];
52
172k
    inptr1 = input_buf[1][input_row];
53
172k
    inptr2 = input_buf[2][input_row];
54
172k
    input_row++;
55
172k
    outptr = *output_buf++;
56
1.77M
    for (col = 0; col < num_cols; col++) {
57
1.59M
      y  = inptr0[col];
58
1.59M
      cb = inptr1[col];
59
1.59M
      cr = inptr2[col];
60
      /* Range-limiting is essential due to noise introduced by DCT losses. */
61
1.59M
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
62
1.59M
      outptr[RGB_GREEN] = range_limit[y +
63
1.59M
                              ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
64
1.59M
                                                SCALEBITS))];
65
1.59M
      outptr[RGB_BLUE] =  range_limit[y + Cbbtab[cb]];
66
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
67
      /* opaque alpha channel value */
68
1.59M
#ifdef RGB_ALPHA
69
1.59M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
70
1.59M
#endif
71
1.59M
      outptr += RGB_PIXELSIZE;
72
1.59M
    }
73
172k
  }
74
#else
75
  ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
76
#endif
77
87.0k
}
Unexecuted instantiation: jdcolor-12.c:ycc_extxrgb_convert_internal
Unexecuted instantiation: jdcolor-12.c:ycc_rgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:ycc_extrgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:ycc_extrgbx_convert_internal
Unexecuted instantiation: jdcolor-16.c:ycc_extbgr_convert_internal
Unexecuted instantiation: jdcolor-16.c:ycc_extbgrx_convert_internal
Unexecuted instantiation: jdcolor-16.c:ycc_extxbgr_convert_internal
Unexecuted instantiation: jdcolor-16.c:ycc_extxrgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:ycc_rgb_convert_internal
78
79
80
/*
81
 * Convert grayscale to RGB: just duplicate the graylevel three times.
82
 * This is provided to support applications that don't want to cope
83
 * with grayscale as a separate case.
84
 */
85
86
INLINE
87
LOCAL(void)
88
gray_rgb_convert_internal(j_decompress_ptr cinfo, _JSAMPIMAGE input_buf,
89
                          JDIMENSION input_row, _JSAMPARRAY output_buf,
90
                          int num_rows)
91
5.65M
{
92
5.65M
  register _JSAMPROW inptr, outptr;
93
5.65M
  register JDIMENSION col;
94
5.65M
  JDIMENSION num_cols = cinfo->output_width;
95
96
13.8M
  while (--num_rows >= 0) {
97
8.20M
    inptr = input_buf[0][input_row++];
98
8.20M
    outptr = *output_buf++;
99
821M
    for (col = 0; col < num_cols; col++) {
100
813M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
#ifdef RGB_ALPHA
104
100M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
#endif
106
813M
      outptr += RGB_PIXELSIZE;
107
813M
    }
108
8.20M
  }
109
5.65M
}
jdcolor-8.c:gray_extrgb_convert_internal
Line
Count
Source
91
1.38M
{
92
1.38M
  register _JSAMPROW inptr, outptr;
93
1.38M
  register JDIMENSION col;
94
1.38M
  JDIMENSION num_cols = cinfo->output_width;
95
96
3.62M
  while (--num_rows >= 0) {
97
2.24M
    inptr = input_buf[0][input_row++];
98
2.24M
    outptr = *output_buf++;
99
316M
    for (col = 0; col < num_cols; col++) {
100
314M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
#ifdef RGB_ALPHA
104
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
#endif
106
314M
      outptr += RGB_PIXELSIZE;
107
314M
    }
108
2.24M
  }
109
1.38M
}
jdcolor-8.c:gray_extrgbx_convert_internal
Line
Count
Source
91
693k
{
92
693k
  register _JSAMPROW inptr, outptr;
93
693k
  register JDIMENSION col;
94
693k
  JDIMENSION num_cols = cinfo->output_width;
95
96
1.38M
  while (--num_rows >= 0) {
97
693k
    inptr = input_buf[0][input_row++];
98
693k
    outptr = *output_buf++;
99
15.6M
    for (col = 0; col < num_cols; col++) {
100
14.9M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
14.9M
#ifdef RGB_ALPHA
104
14.9M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
14.9M
#endif
106
14.9M
      outptr += RGB_PIXELSIZE;
107
14.9M
    }
108
693k
  }
109
693k
}
jdcolor-8.c:gray_extbgr_convert_internal
Line
Count
Source
91
924k
{
92
924k
  register _JSAMPROW inptr, outptr;
93
924k
  register JDIMENSION col;
94
924k
  JDIMENSION num_cols = cinfo->output_width;
95
96
1.84M
  while (--num_rows >= 0) {
97
924k
    inptr = input_buf[0][input_row++];
98
924k
    outptr = *output_buf++;
99
26.6M
    for (col = 0; col < num_cols; col++) {
100
25.7M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
#ifdef RGB_ALPHA
104
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
#endif
106
25.7M
      outptr += RGB_PIXELSIZE;
107
25.7M
    }
108
924k
  }
109
924k
}
jdcolor-8.c:gray_extbgrx_convert_internal
Line
Count
Source
91
512k
{
92
512k
  register _JSAMPROW inptr, outptr;
93
512k
  register JDIMENSION col;
94
512k
  JDIMENSION num_cols = cinfo->output_width;
95
96
1.30M
  while (--num_rows >= 0) {
97
794k
    inptr = input_buf[0][input_row++];
98
794k
    outptr = *output_buf++;
99
27.4M
    for (col = 0; col < num_cols; col++) {
100
26.6M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
26.6M
#ifdef RGB_ALPHA
104
26.6M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
26.6M
#endif
106
26.6M
      outptr += RGB_PIXELSIZE;
107
26.6M
    }
108
794k
  }
109
512k
}
jdcolor-8.c:gray_extxbgr_convert_internal
Line
Count
Source
91
162k
{
92
162k
  register _JSAMPROW inptr, outptr;
93
162k
  register JDIMENSION col;
94
162k
  JDIMENSION num_cols = cinfo->output_width;
95
96
428k
  while (--num_rows >= 0) {
97
265k
    inptr = input_buf[0][input_row++];
98
265k
    outptr = *output_buf++;
99
5.54M
    for (col = 0; col < num_cols; col++) {
100
5.27M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
5.27M
#ifdef RGB_ALPHA
104
5.27M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
5.27M
#endif
106
5.27M
      outptr += RGB_PIXELSIZE;
107
5.27M
    }
108
265k
  }
109
162k
}
jdcolor-8.c:gray_extxrgb_convert_internal
Line
Count
Source
91
231k
{
92
231k
  register _JSAMPROW inptr, outptr;
93
231k
  register JDIMENSION col;
94
231k
  JDIMENSION num_cols = cinfo->output_width;
95
96
462k
  while (--num_rows >= 0) {
97
231k
    inptr = input_buf[0][input_row++];
98
231k
    outptr = *output_buf++;
99
2.04M
    for (col = 0; col < num_cols; col++) {
100
1.81M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
1.81M
#ifdef RGB_ALPHA
104
1.81M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
1.81M
#endif
106
1.81M
      outptr += RGB_PIXELSIZE;
107
1.81M
    }
108
231k
  }
109
231k
}
Unexecuted instantiation: jdcolor-8.c:gray_rgb_convert_internal
jdcolor-12.c:gray_extrgb_convert_internal
Line
Count
Source
91
1.15M
{
92
1.15M
  register _JSAMPROW inptr, outptr;
93
1.15M
  register JDIMENSION col;
94
1.15M
  JDIMENSION num_cols = cinfo->output_width;
95
96
3.17M
  while (--num_rows >= 0) {
97
2.01M
    inptr = input_buf[0][input_row++];
98
2.01M
    outptr = *output_buf++;
99
374M
    for (col = 0; col < num_cols; col++) {
100
372M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
#ifdef RGB_ALPHA
104
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
#endif
106
372M
      outptr += RGB_PIXELSIZE;
107
372M
    }
108
2.01M
  }
109
1.15M
}
Unexecuted instantiation: jdcolor-12.c:gray_extrgbx_convert_internal
Unexecuted instantiation: jdcolor-12.c:gray_extbgr_convert_internal
jdcolor-12.c:gray_extbgrx_convert_internal
Line
Count
Source
91
447k
{
92
447k
  register _JSAMPROW inptr, outptr;
93
447k
  register JDIMENSION col;
94
447k
  JDIMENSION num_cols = cinfo->output_width;
95
96
1.23M
  while (--num_rows >= 0) {
97
783k
    inptr = input_buf[0][input_row++];
98
783k
    outptr = *output_buf++;
99
46.3M
    for (col = 0; col < num_cols; col++) {
100
45.5M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
45.5M
#ifdef RGB_ALPHA
104
45.5M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
45.5M
#endif
106
45.5M
      outptr += RGB_PIXELSIZE;
107
45.5M
    }
108
783k
  }
109
447k
}
jdcolor-12.c:gray_extxbgr_convert_internal
Line
Count
Source
91
144k
{
92
144k
  register _JSAMPROW inptr, outptr;
93
144k
  register JDIMENSION col;
94
144k
  JDIMENSION num_cols = cinfo->output_width;
95
96
396k
  while (--num_rows >= 0) {
97
252k
    inptr = input_buf[0][input_row++];
98
252k
    outptr = *output_buf++;
99
6.43M
    for (col = 0; col < num_cols; col++) {
100
6.17M
      outptr[RGB_RED] = outptr[RGB_GREEN] = outptr[RGB_BLUE] = inptr[col];
101
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
102
      /* opaque alpha channel value */
103
6.17M
#ifdef RGB_ALPHA
104
6.17M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
6.17M
#endif
106
6.17M
      outptr += RGB_PIXELSIZE;
107
6.17M
    }
108
252k
  }
109
144k
}
Unexecuted instantiation: jdcolor-12.c:gray_extxrgb_convert_internal
Unexecuted instantiation: jdcolor-12.c:gray_rgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:gray_extrgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:gray_extrgbx_convert_internal
Unexecuted instantiation: jdcolor-16.c:gray_extbgr_convert_internal
Unexecuted instantiation: jdcolor-16.c:gray_extbgrx_convert_internal
Unexecuted instantiation: jdcolor-16.c:gray_extxbgr_convert_internal
Unexecuted instantiation: jdcolor-16.c:gray_extxrgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:gray_rgb_convert_internal
110
111
112
/*
113
 * Convert RGB to extended RGB: just swap the order of source pixels
114
 */
115
116
INLINE
117
LOCAL(void)
118
rgb_rgb_convert_internal(j_decompress_ptr cinfo, _JSAMPIMAGE input_buf,
119
                         JDIMENSION input_row, _JSAMPARRAY output_buf,
120
                         int num_rows)
121
2.91M
{
122
2.91M
  register _JSAMPROW inptr0, inptr1, inptr2;
123
2.91M
  register _JSAMPROW outptr;
124
2.91M
  register JDIMENSION col;
125
2.91M
  JDIMENSION num_cols = cinfo->output_width;
126
127
6.96M
  while (--num_rows >= 0) {
128
4.05M
    inptr0 = input_buf[0][input_row];
129
4.05M
    inptr1 = input_buf[1][input_row];
130
4.05M
    inptr2 = input_buf[2][input_row];
131
4.05M
    input_row++;
132
4.05M
    outptr = *output_buf++;
133
231M
    for (col = 0; col < num_cols; col++) {
134
227M
      outptr[RGB_RED] = inptr0[col];
135
227M
      outptr[RGB_GREEN] = inptr1[col];
136
227M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
#ifdef RGB_ALPHA
140
78.9M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
#endif
142
227M
      outptr += RGB_PIXELSIZE;
143
227M
    }
144
4.05M
  }
145
2.91M
}
Unexecuted instantiation: jdcolor-8.c:rgb_extrgb_convert_internal
jdcolor-8.c:rgb_extrgbx_convert_internal
Line
Count
Source
121
146k
{
122
146k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
146k
  register _JSAMPROW outptr;
124
146k
  register JDIMENSION col;
125
146k
  JDIMENSION num_cols = cinfo->output_width;
126
127
303k
  while (--num_rows >= 0) {
128
157k
    inptr0 = input_buf[0][input_row];
129
157k
    inptr1 = input_buf[1][input_row];
130
157k
    inptr2 = input_buf[2][input_row];
131
157k
    input_row++;
132
157k
    outptr = *output_buf++;
133
6.79M
    for (col = 0; col < num_cols; col++) {
134
6.64M
      outptr[RGB_RED] = inptr0[col];
135
6.64M
      outptr[RGB_GREEN] = inptr1[col];
136
6.64M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
6.64M
#ifdef RGB_ALPHA
140
6.64M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
6.64M
#endif
142
6.64M
      outptr += RGB_PIXELSIZE;
143
6.64M
    }
144
157k
  }
145
146k
}
jdcolor-8.c:rgb_extbgr_convert_internal
Line
Count
Source
121
1.73M
{
122
1.73M
  register _JSAMPROW inptr0, inptr1, inptr2;
123
1.73M
  register _JSAMPROW outptr;
124
1.73M
  register JDIMENSION col;
125
1.73M
  JDIMENSION num_cols = cinfo->output_width;
126
127
3.68M
  while (--num_rows >= 0) {
128
1.95M
    inptr0 = input_buf[0][input_row];
129
1.95M
    inptr1 = input_buf[1][input_row];
130
1.95M
    inptr2 = input_buf[2][input_row];
131
1.95M
    input_row++;
132
1.95M
    outptr = *output_buf++;
133
150M
    for (col = 0; col < num_cols; col++) {
134
148M
      outptr[RGB_RED] = inptr0[col];
135
148M
      outptr[RGB_GREEN] = inptr1[col];
136
148M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
#ifdef RGB_ALPHA
140
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
#endif
142
148M
      outptr += RGB_PIXELSIZE;
143
148M
    }
144
1.95M
  }
145
1.73M
}
jdcolor-8.c:rgb_extbgrx_convert_internal
Line
Count
Source
121
263k
{
122
263k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
263k
  register _JSAMPROW outptr;
124
263k
  register JDIMENSION col;
125
263k
  JDIMENSION num_cols = cinfo->output_width;
126
127
600k
  while (--num_rows >= 0) {
128
336k
    inptr0 = input_buf[0][input_row];
129
336k
    inptr1 = input_buf[1][input_row];
130
336k
    inptr2 = input_buf[2][input_row];
131
336k
    input_row++;
132
336k
    outptr = *output_buf++;
133
10.0M
    for (col = 0; col < num_cols; col++) {
134
9.70M
      outptr[RGB_RED] = inptr0[col];
135
9.70M
      outptr[RGB_GREEN] = inptr1[col];
136
9.70M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
9.70M
#ifdef RGB_ALPHA
140
9.70M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
9.70M
#endif
142
9.70M
      outptr += RGB_PIXELSIZE;
143
9.70M
    }
144
336k
  }
145
263k
}
jdcolor-8.c:rgb_extxbgr_convert_internal
Line
Count
Source
121
240k
{
122
240k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
240k
  register _JSAMPROW outptr;
124
240k
  register JDIMENSION col;
125
240k
  JDIMENSION num_cols = cinfo->output_width;
126
127
524k
  while (--num_rows >= 0) {
128
284k
    inptr0 = input_buf[0][input_row];
129
284k
    inptr1 = input_buf[1][input_row];
130
284k
    inptr2 = input_buf[2][input_row];
131
284k
    input_row++;
132
284k
    outptr = *output_buf++;
133
7.89M
    for (col = 0; col < num_cols; col++) {
134
7.60M
      outptr[RGB_RED] = inptr0[col];
135
7.60M
      outptr[RGB_GREEN] = inptr1[col];
136
7.60M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
7.60M
#ifdef RGB_ALPHA
140
7.60M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
7.60M
#endif
142
7.60M
      outptr += RGB_PIXELSIZE;
143
7.60M
    }
144
284k
  }
145
240k
}
jdcolor-8.c:rgb_extxrgb_convert_internal
Line
Count
Source
121
48.7k
{
122
48.7k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
48.7k
  register _JSAMPROW outptr;
124
48.7k
  register JDIMENSION col;
125
48.7k
  JDIMENSION num_cols = cinfo->output_width;
126
127
101k
  while (--num_rows >= 0) {
128
52.5k
    inptr0 = input_buf[0][input_row];
129
52.5k
    inptr1 = input_buf[1][input_row];
130
52.5k
    inptr2 = input_buf[2][input_row];
131
52.5k
    input_row++;
132
52.5k
    outptr = *output_buf++;
133
857k
    for (col = 0; col < num_cols; col++) {
134
805k
      outptr[RGB_RED] = inptr0[col];
135
805k
      outptr[RGB_GREEN] = inptr1[col];
136
805k
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
805k
#ifdef RGB_ALPHA
140
805k
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
805k
#endif
142
805k
      outptr += RGB_PIXELSIZE;
143
805k
    }
144
52.5k
  }
145
48.7k
}
Unexecuted instantiation: jdcolor-8.c:rgb_rgb_convert_internal
Unexecuted instantiation: jdcolor-12.c:rgb_extrgb_convert_internal
Unexecuted instantiation: jdcolor-12.c:rgb_extrgbx_convert_internal
Unexecuted instantiation: jdcolor-12.c:rgb_extbgr_convert_internal
jdcolor-12.c:rgb_extbgrx_convert_internal
Line
Count
Source
121
193k
{
122
193k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
193k
  register _JSAMPROW outptr;
124
193k
  register JDIMENSION col;
125
193k
  JDIMENSION num_cols = cinfo->output_width;
126
127
640k
  while (--num_rows >= 0) {
128
446k
    inptr0 = input_buf[0][input_row];
129
446k
    inptr1 = input_buf[1][input_row];
130
446k
    inptr2 = input_buf[2][input_row];
131
446k
    input_row++;
132
446k
    outptr = *output_buf++;
133
18.5M
    for (col = 0; col < num_cols; col++) {
134
18.0M
      outptr[RGB_RED] = inptr0[col];
135
18.0M
      outptr[RGB_GREEN] = inptr1[col];
136
18.0M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
18.0M
#ifdef RGB_ALPHA
140
18.0M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
18.0M
#endif
142
18.0M
      outptr += RGB_PIXELSIZE;
143
18.0M
    }
144
446k
  }
145
193k
}
jdcolor-12.c:rgb_extxbgr_convert_internal
Line
Count
Source
121
103k
{
122
103k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
103k
  register _JSAMPROW outptr;
124
103k
  register JDIMENSION col;
125
103k
  JDIMENSION num_cols = cinfo->output_width;
126
127
369k
  while (--num_rows >= 0) {
128
266k
    inptr0 = input_buf[0][input_row];
129
266k
    inptr1 = input_buf[1][input_row];
130
266k
    inptr2 = input_buf[2][input_row];
131
266k
    input_row++;
132
266k
    outptr = *output_buf++;
133
14.3M
    for (col = 0; col < num_cols; col++) {
134
14.0M
      outptr[RGB_RED] = inptr0[col];
135
14.0M
      outptr[RGB_GREEN] = inptr1[col];
136
14.0M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
14.0M
#ifdef RGB_ALPHA
140
14.0M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
14.0M
#endif
142
14.0M
      outptr += RGB_PIXELSIZE;
143
14.0M
    }
144
266k
  }
145
103k
}
Unexecuted instantiation: jdcolor-12.c:rgb_extxrgb_convert_internal
Unexecuted instantiation: jdcolor-12.c:rgb_rgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:rgb_extrgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:rgb_extrgbx_convert_internal
Unexecuted instantiation: jdcolor-16.c:rgb_extbgr_convert_internal
jdcolor-16.c:rgb_extbgrx_convert_internal
Line
Count
Source
121
91.8k
{
122
91.8k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
91.8k
  register _JSAMPROW outptr;
124
91.8k
  register JDIMENSION col;
125
91.8k
  JDIMENSION num_cols = cinfo->output_width;
126
127
369k
  while (--num_rows >= 0) {
128
278k
    inptr0 = input_buf[0][input_row];
129
278k
    inptr1 = input_buf[1][input_row];
130
278k
    inptr2 = input_buf[2][input_row];
131
278k
    input_row++;
132
278k
    outptr = *output_buf++;
133
11.2M
    for (col = 0; col < num_cols; col++) {
134
10.9M
      outptr[RGB_RED] = inptr0[col];
135
10.9M
      outptr[RGB_GREEN] = inptr1[col];
136
10.9M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
10.9M
#ifdef RGB_ALPHA
140
10.9M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
10.9M
#endif
142
10.9M
      outptr += RGB_PIXELSIZE;
143
10.9M
    }
144
278k
  }
145
91.8k
}
jdcolor-16.c:rgb_extxbgr_convert_internal
Line
Count
Source
121
91.8k
{
122
91.8k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
91.8k
  register _JSAMPROW outptr;
124
91.8k
  register JDIMENSION col;
125
91.8k
  JDIMENSION num_cols = cinfo->output_width;
126
127
369k
  while (--num_rows >= 0) {
128
278k
    inptr0 = input_buf[0][input_row];
129
278k
    inptr1 = input_buf[1][input_row];
130
278k
    inptr2 = input_buf[2][input_row];
131
278k
    input_row++;
132
278k
    outptr = *output_buf++;
133
11.2M
    for (col = 0; col < num_cols; col++) {
134
10.9M
      outptr[RGB_RED] = inptr0[col];
135
10.9M
      outptr[RGB_GREEN] = inptr1[col];
136
10.9M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
10.9M
#ifdef RGB_ALPHA
140
10.9M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
10.9M
#endif
142
10.9M
      outptr += RGB_PIXELSIZE;
143
10.9M
    }
144
278k
  }
145
91.8k
}
Unexecuted instantiation: jdcolor-16.c:rgb_extxrgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:rgb_rgb_convert_internal