jutils.c File Reference

#include "jinclude.h"
#include "jpeglib.h"

Go to the source code of this file.

Defines

#define FMEMCOPY(dest, src, size)   MEMCOPY(dest,src,size)
#define FMEMZERO(target, size)   MEMZERO(target,size)
#define JPEG_INTERNALS

Functions

 jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks)
 jcopy_sample_rows (JSAMPARRAY input_array, int source_row, JSAMPARRAY output_array, int dest_row, int num_rows, JDIMENSION num_cols)
 jdiv_round_up (long a, long b)
 jround_up (long a, long b)
 jzero_far (void FAR *target, size_t bytestozero)

Variables

const int jpeg_natural_order [DCTSIZE2+16]


Define Documentation

#define FMEMCOPY ( dest,
src,
size   )     MEMCOPY(dest,src,size)

Definition at line 100 of file jutils.c.

Referenced by jcopy_block_row(), and jcopy_sample_rows().

#define FMEMZERO ( target,
size   )     MEMZERO(target,size)

Definition at line 101 of file jutils.c.

Referenced by jzero_far().

#define JPEG_INTERNALS

Definition at line 14 of file jutils.c.


Function Documentation

jcopy_block_row ( JBLOCKROW  input_row,
JBLOCKROW  output_row,
JDIMENSION  num_blocks 
)

Definition at line 145 of file jutils.c.

References DCTSIZE2, FMEMCOPY, and SIZEOF.

Referenced by decompress_smooth_data(), and do_flip_v().

00148 {
00149 #ifdef FMEMCOPY
00150   FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
00151 #else
00152   register JCOEFPTR inptr, outptr;
00153   register long count;
00154 
00155   inptr = (JCOEFPTR) input_row;
00156   outptr = (JCOEFPTR) output_row;
00157   for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
00158     *outptr++ = *inptr++;
00159   }
00160 #endif
00161 }

jcopy_sample_rows ( JSAMPARRAY  input_array,
int  source_row,
JSAMPARRAY  output_array,
int  dest_row,
int  num_rows,
JDIMENSION  num_cols 
)

Definition at line 111 of file jutils.c.

References FMEMCOPY, and SIZEOF.

Referenced by expand_bottom_edge(), fullsize_downsample(), grayscale_convert(), h2v2_upsample(), int_upsample(), merged_2v_upsample(), and pre_process_context().

00119 {
00120   register JSAMPROW inptr, outptr;
00121 #ifdef FMEMCOPY
00122   register size_t count = (size_t) (num_cols * SIZEOF(JSAMPLE));
00123 #else
00124   register JDIMENSION count;
00125 #endif
00126   register int row;
00127 
00128   input_array += source_row;
00129   output_array += dest_row;
00130 
00131   for (row = num_rows; row > 0; row--) {
00132     inptr = *input_array++;
00133     outptr = *output_array++;
00134 #ifdef FMEMCOPY
00135     FMEMCOPY(outptr, inptr, count);
00136 #else
00137     for (count = num_cols; count > 0; count--)
00138       *outptr++ = *inptr++; /* needn't bother with GETJSAMPLE() here */
00139 #endif
00140   }
00141 }

jdiv_round_up ( long  a,
long  b 
)

Definition at line 72 of file jutils.c.

Referenced by initial_setup(), jpeg_calc_output_dimensions(), METHODDEF(), and per_scan_setup().

00075 {
00076   return (a + b - 1L) / b;
00077 }

jround_up ( long  a,
long  b 
)

Definition at line 81 of file jutils.c.

Referenced by jinit_c_coef_controller(), jinit_c_main_controller(), jinit_d_coef_controller(), jinit_d_post_controller(), jinit_upsampler(), and jtransform_request_workspace().

00084 {
00085   a += b - 1L;
00086   return a - (a % b);
00087 }

jzero_far ( void FAR *  target,
size_t  bytestozero 
)

Definition at line 165 of file jutils.c.

References FAR, and FMEMZERO.

Referenced by access_virt_barray(), access_virt_sarray(), compress_data(), compress_first_pass(), decompress_onepass(), quantize_fs_dither(), quantize_ord_dither(), start_pass_1_quant(), start_pass_2_quant(), and transencode_coef_controller().

00168 {
00169 #ifdef FMEMZERO
00170   FMEMZERO(target, bytestozero);
00171 #else
00172   register char FAR * ptr = (char FAR *) target;
00173   register size_t count;
00174 
00175   for (count = bytestozero; count > 0; count--) {
00176     *ptr++ = 0;
00177   }
00178 #endif
00179 }


Variable Documentation

const int jpeg_natural_order[DCTSIZE2+16]

Initial value:

 {
  0,  1,  8, 16,  9,  2,  3, 10,
 17, 24, 32, 25, 18, 11,  4,  5,
 12, 19, 26, 33, 40, 48, 41, 34,
 27, 20, 13,  6,  7, 14, 21, 28,
 35, 42, 49, 56, 57, 50, 43, 36,
 29, 22, 15, 23, 30, 37, 44, 51,
 58, 59, 52, 45, 38, 31, 39, 46,
 53, 60, 61, 54, 47, 55, 62, 63,
 63, 63, 63, 63, 63, 63, 63, 63, 
 63, 63, 63, 63, 63, 63, 63, 63
}

Definition at line 53 of file jutils.c.

Referenced by decode_mcu(), decode_mcu_AC_first(), decode_mcu_AC_refine(), emit_dqt(), encode_one_block(), get_dqt(), and htest_one_block().


Generated on Fri Feb 19 02:31:05 2010 for AVR32 - IJG JPEG Decoder Example by  doxygen 1.5.5