Skip to content

Commit 45fdd99

Browse files
committed
Remove JPEG_INTERNALS usage
1 parent dffe271 commit 45fdd99

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

jpeg/transupp.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,43 @@
1515
/* Although this file really shouldn't have access to the library internals,
1616
* it's helpful to let it call jround_up() and jcopy_block_row().
1717
*/
18-
#define JPEG_INTERNALS
19-
2018
#include <stdio.h>
2119
#include <stdlib.h>
2220
#include <setjmp.h>
2321
#include "jpeglib.h"
22+
#include "jerror.h"
2423
#include "transupp.h" /* My own external interface */
2524
#include <ctype.h> /* to declare isdigit() */
2625

2726
#define SIZEOF(object) ((size_t) sizeof(object))
2827

28+
LOCAL(long)
29+
jdiv_round_up (long a, long b)
30+
/* Compute a/b rounded up to next integer, ie, ceil(a/b) */
31+
/* Assumes a >= 0, b > 0 */
32+
{
33+
return (a + b - 1L) / b;
34+
}
35+
36+
LOCAL(void)
37+
jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row,
38+
JDIMENSION num_blocks)
39+
/* Copy a row of coefficient blocks from one place to another. */
40+
{
41+
#ifdef FMEMCOPY
42+
FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
43+
#else
44+
register JCOEFPTR inptr, outptr;
45+
register long count;
46+
47+
inptr = (JCOEFPTR) input_row;
48+
outptr = (JCOEFPTR) output_row;
49+
for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
50+
*outptr++ = *inptr++;
51+
}
52+
#endif
53+
}
54+
2955
#if TRANSFORMS_SUPPORTED
3056

3157
/*

0 commit comments

Comments
 (0)