Coverage Report

Created: 2026-08-13 07:24

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
881k
{
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.66M
  while (--num_rows >= 0) {
51
1.78M
    inptr0 = input_buf[0][input_row];
52
1.78M
    inptr1 = input_buf[1][input_row];
53
1.78M
    inptr2 = input_buf[2][input_row];
54
1.78M
    input_row++;
55
1.78M
    outptr = *output_buf++;
56
86.0M
    for (col = 0; col < num_cols; col++) {
57
84.3M
      y  = inptr0[col];
58
84.3M
      cb = inptr1[col];
59
84.3M
      cr = inptr2[col];
60
      /* Range-limiting is essential due to noise introduced by DCT losses. */
61
84.3M
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
62
84.3M
      outptr[RGB_GREEN] = range_limit[y +
63
84.3M
                              ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
64
84.3M
                                                SCALEBITS))];
65
84.3M
      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
19.7M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
70
#endif
71
84.3M
      outptr += RGB_PIXELSIZE;
72
84.3M
    }
73
1.78M
  }
74
#else
75
0
  ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
76
#endif
77
881k
}
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
429k
{
35
429k
#if BITS_IN_JSAMPLE != 16
36
429k
  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
37
429k
  register int y, cb, cr;
38
429k
  register _JSAMPROW outptr;
39
429k
  register _JSAMPROW inptr0, inptr1, inptr2;
40
429k
  register JDIMENSION col;
41
429k
  JDIMENSION num_cols = cinfo->output_width;
42
  /* copy these pointers into registers if possible */
43
429k
  register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit;
44
429k
  register int *Crrtab = cconvert->Cr_r_tab;
45
429k
  register int *Cbbtab = cconvert->Cb_b_tab;
46
429k
  register JLONG *Crgtab = cconvert->Cr_g_tab;
47
429k
  register JLONG *Cbgtab = cconvert->Cb_g_tab;
48
429k
  SHIFT_TEMPS
49
50
1.37M
  while (--num_rows >= 0) {
51
946k
    inptr0 = input_buf[0][input_row];
52
946k
    inptr1 = input_buf[1][input_row];
53
946k
    inptr2 = input_buf[2][input_row];
54
946k
    input_row++;
55
946k
    outptr = *output_buf++;
56
65.5M
    for (col = 0; col < num_cols; col++) {
57
64.5M
      y  = inptr0[col];
58
64.5M
      cb = inptr1[col];
59
64.5M
      cr = inptr2[col];
60
      /* Range-limiting is essential due to noise introduced by DCT losses. */
61
64.5M
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
62
64.5M
      outptr[RGB_GREEN] = range_limit[y +
63
64.5M
                              ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
64
64.5M
                                                SCALEBITS))];
65
64.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
64.5M
      outptr += RGB_PIXELSIZE;
72
64.5M
    }
73
946k
  }
74
#else
75
  ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
76
#endif
77
429k
}
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
360k
{
35
360k
#if BITS_IN_JSAMPLE != 16
36
360k
  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
37
360k
  register int y, cb, cr;
38
360k
  register _JSAMPROW outptr;
39
360k
  register _JSAMPROW inptr0, inptr1, inptr2;
40
360k
  register JDIMENSION col;
41
360k
  JDIMENSION num_cols = cinfo->output_width;
42
  /* copy these pointers into registers if possible */
43
360k
  register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit;
44
360k
  register int *Crrtab = cconvert->Cr_r_tab;
45
360k
  register int *Cbbtab = cconvert->Cb_b_tab;
46
360k
  register JLONG *Crgtab = cconvert->Cr_g_tab;
47
360k
  register JLONG *Cbgtab = cconvert->Cb_g_tab;
48
360k
  SHIFT_TEMPS
49
50
1.03M
  while (--num_rows >= 0) {
51
672k
    inptr0 = input_buf[0][input_row];
52
672k
    inptr1 = input_buf[1][input_row];
53
672k
    inptr2 = input_buf[2][input_row];
54
672k
    input_row++;
55
672k
    outptr = *output_buf++;
56
18.9M
    for (col = 0; col < num_cols; col++) {
57
18.2M
      y  = inptr0[col];
58
18.2M
      cb = inptr1[col];
59
18.2M
      cr = inptr2[col];
60
      /* Range-limiting is essential due to noise introduced by DCT losses. */
61
18.2M
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
62
18.2M
      outptr[RGB_GREEN] = range_limit[y +
63
18.2M
                              ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
64
18.2M
                                                SCALEBITS))];
65
18.2M
      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
18.2M
#ifdef RGB_ALPHA
69
18.2M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
70
18.2M
#endif
71
18.2M
      outptr += RGB_PIXELSIZE;
72
18.2M
    }
73
672k
  }
74
#else
75
  ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
76
#endif
77
360k
}
jdcolor-12.c:ycc_extxbgr_convert_internal
Line
Count
Source
34
91.0k
{
35
91.0k
#if BITS_IN_JSAMPLE != 16
36
91.0k
  my_cconvert_ptr cconvert = (my_cconvert_ptr)cinfo->cconvert;
37
91.0k
  register int y, cb, cr;
38
91.0k
  register _JSAMPROW outptr;
39
91.0k
  register _JSAMPROW inptr0, inptr1, inptr2;
40
91.0k
  register JDIMENSION col;
41
91.0k
  JDIMENSION num_cols = cinfo->output_width;
42
  /* copy these pointers into registers if possible */
43
91.0k
  register _JSAMPLE *range_limit = (_JSAMPLE *)cinfo->sample_range_limit;
44
91.0k
  register int *Crrtab = cconvert->Cr_r_tab;
45
91.0k
  register int *Cbbtab = cconvert->Cb_b_tab;
46
91.0k
  register JLONG *Crgtab = cconvert->Cr_g_tab;
47
91.0k
  register JLONG *Cbgtab = cconvert->Cb_g_tab;
48
91.0k
  SHIFT_TEMPS
49
50
260k
  while (--num_rows >= 0) {
51
169k
    inptr0 = input_buf[0][input_row];
52
169k
    inptr1 = input_buf[1][input_row];
53
169k
    inptr2 = input_buf[2][input_row];
54
169k
    input_row++;
55
169k
    outptr = *output_buf++;
56
1.66M
    for (col = 0; col < num_cols; col++) {
57
1.49M
      y  = inptr0[col];
58
1.49M
      cb = inptr1[col];
59
1.49M
      cr = inptr2[col];
60
      /* Range-limiting is essential due to noise introduced by DCT losses. */
61
1.49M
      outptr[RGB_RED] =   range_limit[y + Crrtab[cr]];
62
1.49M
      outptr[RGB_GREEN] = range_limit[y +
63
1.49M
                              ((int)RIGHT_SHIFT(Cbgtab[cb] + Crgtab[cr],
64
1.49M
                                                SCALEBITS))];
65
1.49M
      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.49M
#ifdef RGB_ALPHA
69
1.49M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
70
1.49M
#endif
71
1.49M
      outptr += RGB_PIXELSIZE;
72
1.49M
    }
73
169k
  }
74
#else
75
  ERREXIT(cinfo, JERR_CONVERSION_NOTIMPL);
76
#endif
77
91.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.66M
{
92
5.66M
  register _JSAMPROW inptr, outptr;
93
5.66M
  register JDIMENSION col;
94
5.66M
  JDIMENSION num_cols = cinfo->output_width;
95
96
13.9M
  while (--num_rows >= 0) {
97
8.28M
    inptr = input_buf[0][input_row++];
98
8.28M
    outptr = *output_buf++;
99
812M
    for (col = 0; col < num_cols; col++) {
100
804M
      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
98.8M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
#endif
106
804M
      outptr += RGB_PIXELSIZE;
107
804M
    }
108
8.28M
  }
109
5.66M
}
jdcolor-8.c:gray_extrgb_convert_internal
Line
Count
Source
91
1.35M
{
92
1.35M
  register _JSAMPROW inptr, outptr;
93
1.35M
  register JDIMENSION col;
94
1.35M
  JDIMENSION num_cols = cinfo->output_width;
95
96
3.56M
  while (--num_rows >= 0) {
97
2.21M
    inptr = input_buf[0][input_row++];
98
2.21M
    outptr = *output_buf++;
99
331M
    for (col = 0; col < num_cols; col++) {
100
329M
      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
329M
      outptr += RGB_PIXELSIZE;
107
329M
    }
108
2.21M
  }
109
1.35M
}
jdcolor-8.c:gray_extrgbx_convert_internal
Line
Count
Source
91
707k
{
92
707k
  register _JSAMPROW inptr, outptr;
93
707k
  register JDIMENSION col;
94
707k
  JDIMENSION num_cols = cinfo->output_width;
95
96
1.41M
  while (--num_rows >= 0) {
97
707k
    inptr = input_buf[0][input_row++];
98
707k
    outptr = *output_buf++;
99
13.6M
    for (col = 0; col < num_cols; col++) {
100
12.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
12.9M
#ifdef RGB_ALPHA
104
12.9M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
12.9M
#endif
106
12.9M
      outptr += RGB_PIXELSIZE;
107
12.9M
    }
108
707k
  }
109
707k
}
jdcolor-8.c:gray_extbgr_convert_internal
Line
Count
Source
91
943k
{
92
943k
  register _JSAMPROW inptr, outptr;
93
943k
  register JDIMENSION col;
94
943k
  JDIMENSION num_cols = cinfo->output_width;
95
96
1.88M
  while (--num_rows >= 0) {
97
943k
    inptr = input_buf[0][input_row++];
98
943k
    outptr = *output_buf++;
99
23.0M
    for (col = 0; col < num_cols; col++) {
100
22.1M
      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
22.1M
      outptr += RGB_PIXELSIZE;
107
22.1M
    }
108
943k
  }
109
943k
}
jdcolor-8.c:gray_extbgrx_convert_internal
Line
Count
Source
91
485k
{
92
485k
  register _JSAMPROW inptr, outptr;
93
485k
  register JDIMENSION col;
94
485k
  JDIMENSION num_cols = cinfo->output_width;
95
96
1.24M
  while (--num_rows >= 0) {
97
763k
    inptr = input_buf[0][input_row++];
98
763k
    outptr = *output_buf++;
99
29.2M
    for (col = 0; col < num_cols; col++) {
100
28.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
28.5M
#ifdef RGB_ALPHA
104
28.5M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
28.5M
#endif
106
28.5M
      outptr += RGB_PIXELSIZE;
107
28.5M
    }
108
763k
  }
109
485k
}
jdcolor-8.c:gray_extxbgr_convert_internal
Line
Count
Source
91
157k
{
92
157k
  register _JSAMPROW inptr, outptr;
93
157k
  register JDIMENSION col;
94
157k
  JDIMENSION num_cols = cinfo->output_width;
95
96
417k
  while (--num_rows >= 0) {
97
259k
    inptr = input_buf[0][input_row++];
98
259k
    outptr = *output_buf++;
99
5.76M
    for (col = 0; col < num_cols; col++) {
100
5.50M
      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.50M
#ifdef RGB_ALPHA
104
5.50M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
5.50M
#endif
106
5.50M
      outptr += RGB_PIXELSIZE;
107
5.50M
    }
108
259k
  }
109
157k
}
jdcolor-8.c:gray_extxrgb_convert_internal
Line
Count
Source
91
236k
{
92
236k
  register _JSAMPROW inptr, outptr;
93
236k
  register JDIMENSION col;
94
236k
  JDIMENSION num_cols = cinfo->output_width;
95
96
472k
  while (--num_rows >= 0) {
97
236k
    inptr = input_buf[0][input_row++];
98
236k
    outptr = *output_buf++;
99
1.82M
    for (col = 0; col < num_cols; col++) {
100
1.58M
      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.58M
#ifdef RGB_ALPHA
104
1.58M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
1.58M
#endif
106
1.58M
      outptr += RGB_PIXELSIZE;
107
1.58M
    }
108
236k
  }
109
236k
}
Unexecuted instantiation: jdcolor-8.c:gray_rgb_convert_internal
jdcolor-12.c:gray_extrgb_convert_internal
Line
Count
Source
91
1.17M
{
92
1.17M
  register _JSAMPROW inptr, outptr;
93
1.17M
  register JDIMENSION col;
94
1.17M
  JDIMENSION num_cols = cinfo->output_width;
95
96
3.24M
  while (--num_rows >= 0) {
97
2.07M
    inptr = input_buf[0][input_row++];
98
2.07M
    outptr = *output_buf++;
99
356M
    for (col = 0; col < num_cols; col++) {
100
353M
      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
353M
      outptr += RGB_PIXELSIZE;
107
353M
    }
108
2.07M
  }
109
1.17M
}
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
464k
{
92
464k
  register _JSAMPROW inptr, outptr;
93
464k
  register JDIMENSION col;
94
464k
  JDIMENSION num_cols = cinfo->output_width;
95
96
1.29M
  while (--num_rows >= 0) {
97
829k
    inptr = input_buf[0][input_row++];
98
829k
    outptr = *output_buf++;
99
45.2M
    for (col = 0; col < num_cols; col++) {
100
44.3M
      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
44.3M
#ifdef RGB_ALPHA
104
44.3M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
44.3M
#endif
106
44.3M
      outptr += RGB_PIXELSIZE;
107
44.3M
    }
108
829k
  }
109
464k
}
jdcolor-12.c:gray_extxbgr_convert_internal
Line
Count
Source
91
147k
{
92
147k
  register _JSAMPROW inptr, outptr;
93
147k
  register JDIMENSION col;
94
147k
  JDIMENSION num_cols = cinfo->output_width;
95
96
406k
  while (--num_rows >= 0) {
97
259k
    inptr = input_buf[0][input_row++];
98
259k
    outptr = *output_buf++;
99
6.12M
    for (col = 0; col < num_cols; col++) {
100
5.86M
      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.86M
#ifdef RGB_ALPHA
104
5.86M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
105
5.86M
#endif
106
5.86M
      outptr += RGB_PIXELSIZE;
107
5.86M
    }
108
259k
  }
109
147k
}
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.74M
{
122
2.74M
  register _JSAMPROW inptr0, inptr1, inptr2;
123
2.74M
  register _JSAMPROW outptr;
124
2.74M
  register JDIMENSION col;
125
2.74M
  JDIMENSION num_cols = cinfo->output_width;
126
127
6.49M
  while (--num_rows >= 0) {
128
3.74M
    inptr0 = input_buf[0][input_row];
129
3.74M
    inptr1 = input_buf[1][input_row];
130
3.74M
    inptr2 = input_buf[2][input_row];
131
3.74M
    input_row++;
132
3.74M
    outptr = *output_buf++;
133
230M
    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
77.0M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
#endif
142
227M
      outptr += RGB_PIXELSIZE;
143
227M
    }
144
3.74M
  }
145
2.74M
}
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
305k
  while (--num_rows >= 0) {
128
158k
    inptr0 = input_buf[0][input_row];
129
158k
    inptr1 = input_buf[1][input_row];
130
158k
    inptr2 = input_buf[2][input_row];
131
158k
    input_row++;
132
158k
    outptr = *output_buf++;
133
6.56M
    for (col = 0; col < num_cols; col++) {
134
6.40M
      outptr[RGB_RED] = inptr0[col];
135
6.40M
      outptr[RGB_GREEN] = inptr1[col];
136
6.40M
      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.40M
#ifdef RGB_ALPHA
140
6.40M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
6.40M
#endif
142
6.40M
      outptr += RGB_PIXELSIZE;
143
6.40M
    }
144
158k
  }
145
146k
}
jdcolor-8.c:rgb_extbgr_convert_internal
Line
Count
Source
121
1.81M
{
122
1.81M
  register _JSAMPROW inptr0, inptr1, inptr2;
123
1.81M
  register _JSAMPROW outptr;
124
1.81M
  register JDIMENSION col;
125
1.81M
  JDIMENSION num_cols = cinfo->output_width;
126
127
3.84M
  while (--num_rows >= 0) {
128
2.03M
    inptr0 = input_buf[0][input_row];
129
2.03M
    inptr1 = input_buf[1][input_row];
130
2.03M
    inptr2 = input_buf[2][input_row];
131
2.03M
    input_row++;
132
2.03M
    outptr = *output_buf++;
133
152M
    for (col = 0; col < num_cols; col++) {
134
150M
      outptr[RGB_RED] = inptr0[col];
135
150M
      outptr[RGB_GREEN] = inptr1[col];
136
150M
      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
150M
      outptr += RGB_PIXELSIZE;
143
150M
    }
144
2.03M
  }
145
1.81M
}
jdcolor-8.c:rgb_extbgrx_convert_internal
Line
Count
Source
121
188k
{
122
188k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
188k
  register _JSAMPROW outptr;
124
188k
  register JDIMENSION col;
125
188k
  JDIMENSION num_cols = cinfo->output_width;
126
127
432k
  while (--num_rows >= 0) {
128
244k
    inptr0 = input_buf[0][input_row];
129
244k
    inptr1 = input_buf[1][input_row];
130
244k
    inptr2 = input_buf[2][input_row];
131
244k
    input_row++;
132
244k
    outptr = *output_buf++;
133
11.4M
    for (col = 0; col < num_cols; col++) {
134
11.2M
      outptr[RGB_RED] = inptr0[col];
135
11.2M
      outptr[RGB_GREEN] = inptr1[col];
136
11.2M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
11.2M
#ifdef RGB_ALPHA
140
11.2M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
11.2M
#endif
142
11.2M
      outptr += RGB_PIXELSIZE;
143
11.2M
    }
144
244k
  }
145
188k
}
jdcolor-8.c:rgb_extxbgr_convert_internal
Line
Count
Source
121
156k
{
122
156k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
156k
  register _JSAMPROW outptr;
124
156k
  register JDIMENSION col;
125
156k
  JDIMENSION num_cols = cinfo->output_width;
126
127
334k
  while (--num_rows >= 0) {
128
178k
    inptr0 = input_buf[0][input_row];
129
178k
    inptr1 = input_buf[1][input_row];
130
178k
    inptr2 = input_buf[2][input_row];
131
178k
    input_row++;
132
178k
    outptr = *output_buf++;
133
9.34M
    for (col = 0; col < num_cols; col++) {
134
9.16M
      outptr[RGB_RED] = inptr0[col];
135
9.16M
      outptr[RGB_GREEN] = inptr1[col];
136
9.16M
      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.16M
#ifdef RGB_ALPHA
140
9.16M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
9.16M
#endif
142
9.16M
      outptr += RGB_PIXELSIZE;
143
9.16M
    }
144
178k
  }
145
156k
}
jdcolor-8.c:rgb_extxrgb_convert_internal
Line
Count
Source
121
49.0k
{
122
49.0k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
49.0k
  register _JSAMPROW outptr;
124
49.0k
  register JDIMENSION col;
125
49.0k
  JDIMENSION num_cols = cinfo->output_width;
126
127
101k
  while (--num_rows >= 0) {
128
52.7k
    inptr0 = input_buf[0][input_row];
129
52.7k
    inptr1 = input_buf[1][input_row];
130
52.7k
    inptr2 = input_buf[2][input_row];
131
52.7k
    input_row++;
132
52.7k
    outptr = *output_buf++;
133
821k
    for (col = 0; col < num_cols; col++) {
134
768k
      outptr[RGB_RED] = inptr0[col];
135
768k
      outptr[RGB_GREEN] = inptr1[col];
136
768k
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
768k
#ifdef RGB_ALPHA
140
768k
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
768k
#endif
142
768k
      outptr += RGB_PIXELSIZE;
143
768k
    }
144
52.7k
  }
145
49.0k
}
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
175k
{
122
175k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
175k
  register _JSAMPROW outptr;
124
175k
  register JDIMENSION col;
125
175k
  JDIMENSION num_cols = cinfo->output_width;
126
127
588k
  while (--num_rows >= 0) {
128
413k
    inptr0 = input_buf[0][input_row];
129
413k
    inptr1 = input_buf[1][input_row];
130
413k
    inptr2 = input_buf[2][input_row];
131
413k
    input_row++;
132
413k
    outptr = *output_buf++;
133
17.2M
    for (col = 0; col < num_cols; col++) {
134
16.8M
      outptr[RGB_RED] = inptr0[col];
135
16.8M
      outptr[RGB_GREEN] = inptr1[col];
136
16.8M
      outptr[RGB_BLUE] = inptr2[col];
137
      /* Set unused byte to _MAXJSAMPLE so it can be interpreted as an */
138
      /* opaque alpha channel value */
139
16.8M
#ifdef RGB_ALPHA
140
16.8M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
16.8M
#endif
142
16.8M
      outptr += RGB_PIXELSIZE;
143
16.8M
    }
144
413k
  }
145
175k
}
jdcolor-12.c:rgb_extxbgr_convert_internal
Line
Count
Source
121
102k
{
122
102k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
102k
  register _JSAMPROW outptr;
124
102k
  register JDIMENSION col;
125
102k
  JDIMENSION num_cols = cinfo->output_width;
126
127
364k
  while (--num_rows >= 0) {
128
262k
    inptr0 = input_buf[0][input_row];
129
262k
    inptr1 = input_buf[1][input_row];
130
262k
    inptr2 = input_buf[2][input_row];
131
262k
    input_row++;
132
262k
    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
262k
  }
145
102k
}
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
56.0k
{
122
56.0k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
56.0k
  register _JSAMPROW outptr;
124
56.0k
  register JDIMENSION col;
125
56.0k
  JDIMENSION num_cols = cinfo->output_width;
126
127
257k
  while (--num_rows >= 0) {
128
201k
    inptr0 = input_buf[0][input_row];
129
201k
    inptr1 = input_buf[1][input_row];
130
201k
    inptr2 = input_buf[2][input_row];
131
201k
    input_row++;
132
201k
    outptr = *output_buf++;
133
9.45M
    for (col = 0; col < num_cols; col++) {
134
9.25M
      outptr[RGB_RED] = inptr0[col];
135
9.25M
      outptr[RGB_GREEN] = inptr1[col];
136
9.25M
      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.25M
#ifdef RGB_ALPHA
140
9.25M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
9.25M
#endif
142
9.25M
      outptr += RGB_PIXELSIZE;
143
9.25M
    }
144
201k
  }
145
56.0k
}
jdcolor-16.c:rgb_extxbgr_convert_internal
Line
Count
Source
121
56.0k
{
122
56.0k
  register _JSAMPROW inptr0, inptr1, inptr2;
123
56.0k
  register _JSAMPROW outptr;
124
56.0k
  register JDIMENSION col;
125
56.0k
  JDIMENSION num_cols = cinfo->output_width;
126
127
257k
  while (--num_rows >= 0) {
128
201k
    inptr0 = input_buf[0][input_row];
129
201k
    inptr1 = input_buf[1][input_row];
130
201k
    inptr2 = input_buf[2][input_row];
131
201k
    input_row++;
132
201k
    outptr = *output_buf++;
133
9.45M
    for (col = 0; col < num_cols; col++) {
134
9.25M
      outptr[RGB_RED] = inptr0[col];
135
9.25M
      outptr[RGB_GREEN] = inptr1[col];
136
9.25M
      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.25M
#ifdef RGB_ALPHA
140
9.25M
      outptr[RGB_ALPHA] = _MAXJSAMPLE;
141
9.25M
#endif
142
9.25M
      outptr += RGB_PIXELSIZE;
143
9.25M
    }
144
201k
  }
145
56.0k
}
Unexecuted instantiation: jdcolor-16.c:rgb_extxrgb_convert_internal
Unexecuted instantiation: jdcolor-16.c:rgb_rgb_convert_internal