summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2013-04-22 08:14:46 +0200
committerDavid Tardon <dtardon@redhat.com>2013-04-22 08:14:46 +0200
commit845456565db945ffd2a1551ab86446fcd1717021 (patch)
treefe07bc841dab010f06df3afcad61cf0e18ae6230 /vcl
parentf9c45046f39029a69f6ab90a972459d8c12f065e (diff)
DO NOT use internal headers of jpeg
They ARE NOT available when using system jpeg. Apart of that, I am not sure if it is all right to include parts of jpeg directly into our code. Change-Id: Ic19a22e73094d452ffd072b819020e4a46256406
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/filter/jpeg/transupp.c34
1 files changed, 23 insertions, 11 deletions
diff --git a/vcl/source/filter/jpeg/transupp.c b/vcl/source/filter/jpeg/transupp.c
index fd2ff37eb257..500b0a2a62f7 100644
--- a/vcl/source/filter/jpeg/transupp.c
+++ b/vcl/source/filter/jpeg/transupp.c
@@ -14,11 +14,7 @@
* interfaces.
*/
-/* Although this file really shouldn't have access to the library internals,
- * it's helpful to let it call jround_up() and jcopy_block_row().
- */
-#define JPEG_INTERNALS
-
+#include "jerror.h"
#include "jinclude.h"
#include "jpeglib.h"
#include "transupp.h" /* My own external interface */
@@ -86,6 +82,22 @@
* source buffer it is an undocumented property of jdcoefct.c.
*/
+static void lcl_jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks)
+/* Copy a row of coefficient blocks from one place to another. */
+{
+#ifdef FMEMCOPY
+ FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
+#else
+ register JCOEFPTR inptr, outptr;
+ register long count;
+
+ inptr = (JCOEFPTR) input_row;
+ outptr = (JCOEFPTR) output_row;
+ for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
+ *outptr++ = *inptr++;
+ }
+#endif
+}
LOCAL(void)
do_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
@@ -116,7 +128,7 @@ do_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
dst_blk_y + y_crop_blocks,
(JDIMENSION) compptr->v_samp_factor, FALSE);
for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
- jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
+ lcl_jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
dst_buffer[offset_y],
compptr->width_in_blocks);
}
@@ -176,12 +188,12 @@ do_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
}
if (x_crop_blocks > 0) {
/* Now left-justify the portion of the data to be kept.
- * We can't use a single jcopy_block_row() call because that routine
+ * We can't use a single lcl_jcopy_block_row() call because that routine
* depends on memcpy(), whose behavior is unspecified for overlapping
* source and destination areas. Sigh.
*/
for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) {
- jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,
+ lcl_jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,
buffer[offset_y] + blk_x,
(JDIMENSION) 1);
}
@@ -243,7 +255,7 @@ do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
}
} else {
/* Copy last partial block(s) verbatim */
- jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
+ lcl_jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
dst_row_ptr + dst_blk_x,
(JDIMENSION) 1);
}
@@ -324,7 +336,7 @@ do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
}
} else {
/* Just copy row verbatim. */
- jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
+ lcl_jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
dst_buffer[offset_y],
compptr->width_in_blocks);
}
@@ -630,7 +642,7 @@ do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
}
} else {
/* Any remaining right-edge blocks are only copied. */
- jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
+ lcl_jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
dst_row_ptr + dst_blk_x,
(JDIMENSION) 1);
}