Commit ef7601ff authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Push some redundant files into the attic.

parent a41d1d45
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; sources.idct - Ian Rickard's amazing new 5-multiply DCT.
; Thanks to Ian Rickards of ARM Ltd.
; Thanks also to Arai, Agui, Nakajima who actually invented the algorithm.
; Quick hack for now, to experiment with the new DCT core.
; ------------------------------------------------------------------------------
; on entry:
; takes coeff array in r0-r7
; contains coeffs 0, 4, 2, 6, 5, 1, 7, 3 in r0-r7 respectively
; uses r8-r9 as scratch
; total 43 data processing instructions
MACRO
DCTransform
; permute the inputs
MOV r8,r3
MOV r3,r6
MOV r6,r7
MOV r7,r8
MOV r8,r4
MOV r4,r5
MOV r5,r1
MOV r1,r8
; Now shift the numbers up by 8 so that the inputs are unscaled, but
; the output is shifted up by 8 - exactly like the existing code.
; MOV r0,r0,LSL #8
; MOV r1,r1,LSL #8
; MOV r2,r2,LSL #8
; MOV r3,r3,LSL #8
; MOV r4,r4,LSL #8
; MOV r5,r5,LSL #8
; MOV r6,r6,LSL #8
; MOV r7,r7,LSL #8
; Now start the DCT proper.
; starts
ADD r5,r5,r6
SUB r6,r5,r6,ASL #1
SUB r4,r4,r7
ADD r7,r4,r7,ASL #1
SUB r5,r5,r7
ADD r7,r5,r7,ASL #1
ADD r2,r2,r3
SUB r3,r2,r3,ASL #1
ADD r8,r4,r6
; mul r8 by 0.383 (or 392.2/1024)
SUB r8,r8,r8,ASR #3 ; = 448/512
SUB r8,r8,r8,ASR #3 ; = 392/512
; leave pending ASR #1 until instruction marked FIX_a5
; mul r2 by 0.707 (or 724.0/1024)
SUB r9,r2,r2,ASR #4 ; = 960/1024
ADD r9,r9,r9,ASR #2 ; = 1200/1024
SUB r2,r2,r9,ASR #2 ; = 724/1024
ADD r0,r0,r1
SUB r1,r0,r1,ASL #1
ADD r3,r2,r3
; mul r4 by 0.541 (or 554.0/1024)
ADD r9,r4,r4,ASR #1 ; = 768/512
SUB r9,r9,r9,ASR #3 ; = 672/512
ADD r4,r4,r9,ASR #4 ; = 554/512
; leave ASR #1 until instruction marked FIX_a2
; mul r5 by 0.707 (or 724.0/1024)
SUB r9,r5,r5,ASR #4 ; = 960/1024
ADD r9,r9,r9,ASR #2 ; = 1200/1024
SUB r5,r5,r9,ASR #2 ; = 724/1024
; mul r6 by 1.307 (or 1338.4/1024)
ADD r9,r6,r6,ASR #1 ; = 1536/1024
SUB r6,r9,r9,ASR #3 ; = 1344/1024
SUB r6,r6,r9,ASR #8 ; = 1338/1024
ADD r0,r0,r3
SUB r3,r0,r3,ASL #1
ADD r1,r1,r2
SUB r2,r1,r2,ASL #1
ADD r4,r4,r8 ; FIX_a2 & FIX_a5 => FIX_r4 below
SUB r6,r6,r8,ASR #1 ; FIX_a5
ADD r7,r6,r7
ADD r6,r5,r6
ADD r5,r5,r4,ASR #1 ; FIX_r4
ADD r0,r0,r7
SUB r7,r0,r7,ASL #1
ADD r1,r1,r6
SUB r6,r1,r6,ASL #1
ADD r2,r2,r5
SUB r5,r2,r5,ASL #1
ADD r3,r3,r4,ASR #1 ; FIX_r4
SUB r4,r3,r4 ; FIX_r4
; ends
; MOV r0,r0,ASR #4
; MOV r1,r1,ASR #4
; MOV r2,r2,ASR #4
; MOV r3,r3,ASR #4
; MOV r4,r4,ASR #4
; MOV r5,r5,ASR #4
; MOV r6,r6,ASR #4
; MOV r7,r7,ASR #4
MEND
; -------------------------------------------------------------------------------------------------
; r0=cinfo (unused)
; r1=data ptr
; r2=count
asm_j_rev_dct ; extern void asm_j_rev_dct(decompress_info_ptr cinfo, DCTBLOCK data, int count);
CMP r2,#0 ; if count=0, do nothing
MOVLE pc,lr
STMDB sp!,{r1,r2,r4-r12,lr} ; save state - count is at [sp,#4], r3 need not be preserved
dct_loop ; for each block
MOV r11,#8 ; loop counter for rows
MOV r12,r1 ; data pointer
; First do the rows
dctrow_loop
LDMIA r12,{r0-r7} ; get this row
ORRS r8,r0,r1
ORREQS r8,r2,r3
ORREQS r8,r4,r5
ORREQS r8,r6,r7
BEQ dctrow_skip
DCTransform
STMIA r12,{r0-r7} ; put this row
dctrow_skip
ADD r12,r12,#8*4 ; increment output pointer
SUBS r11,r11,#1
BNE dctrow_loop
; now to do the columns, very similar but the loads/stores are spaced
; out more.
; LDR r12,[sp] ; reload data pointer
SUB r12,r12,#8*8*4 ; reset data pointer
SUB r11,r12,#8*8*4 ; set up output pointer
dctcol_loop
; load the data values, spaced 8 words apart.
LDR r0,[r12,#8*4*0]
LDR r1,[r12,#8*4*1]
LDR r2,[r12,#8*4*2]
LDR r3,[r12,#8*4*3]
LDR r4,[r12,#8*4*4]
LDR r5,[r12,#8*4*5]
LDR r6,[r12,#8*4*6]
LDR r7,[r12,#8*4*7]
DCTransform
STMIA r11,{r0-r7} ; store in row order, in the block below the original input
dctcol_inc
ADD r11,r11,#8*4 ; advance output pointer
ADD r12,r12,#4 ; advance input pointer
SUB r10,r12,r11 ; terminate based on the difference between them
CMP r10,#8*4 ; until then the difference will be bigger
BGT dctcol_loop ; loop
LDMIA sp!,{r1,r2} ; get block pointer, count back
SUBS r2,r2,#1 ; decrement count
LDMLEIA sp!,{r4-r12,pc}^ ; exit
; 'count' says that we do another block
ADD r1,r1,#64*4 ; advance pointer to next block
STMDB sp!,{r1,r2} ; push pointer and count back on stack
B dct_loop ; and do another block
END
This diff is collapsed.
; Copyright 1996 Acorn Computers Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
; sources.jrevdctT - ObjAsm header for sources.jrevdct, for use in testing the implementation.
; See c.testdct for how to make use of this.
AREA |C$$code|, CODE, READONLY
EXPORT asm_dct_1_d
EXPORT asm_j_rev_dct
GET sources.jrevdct
; ------------------------------------------------------------------------
; Test proc - procedure to do a 1-D DCT
; ------------------------------------------------------------------------
; extern void dct_1d(decompress_info_ptr cinfo, int *data);
asm_dct_1_d
STMDB sp!,{r0-r12,lr} ; save state
MOV r9,r1 ; data pointer
LDMIA r9,{r0-r7} ; get this row
DCTransform dct1d
DCTransform2 dct1d
DCTransform3 dct1d
dct1d_store
STMIA r9!,{r0-r7} ; put this row
dct1d_inc
LDMIA sp!,{r0-r12,pc} ; exit
DCTransform_Leftovers dct1d
B dct1d_store
DCTransform_Leftovers2 dct1d
DCTransform3 dct1d
B dct1d_store
DCTransform_Leftovers3 dct1d
DCTransform3 dct1d
B dct1d_store
DCTransform_Leftovers4 dct1d
DCTransform3 dct1d
B dct1d_store
DCTransform_Leftovers5 dct1d
DCTransform3 dct1d
B dct1d_store
END
This diff is collapsed.
......@@ -21,23 +21,23 @@ structures between C and assembler a little bit easier. */
#include <stddef.h>
#define BOOL int
#include "jinclude.h"
#include "jpeglib.h"
int main(void)
{
printf("; s.jhdr, generated by genjhdr %s %s.\n\n", __DATE__, __TIME__);
printf("huff_tbl_maxcode * %i\n", offsetof(HUFF_TBL, maxcode[0]));
printf("huff_tbl_valptr * %i\n", offsetof(HUFF_TBL, valptr[0]));
printf("huff_tbl_huffval * %i\n", offsetof(HUFF_TBL, huffval[0]));
printf("huff_tbl_shortcut * %i\n", offsetof(HUFF_TBL, shortcut[0]));
printf("huff_tbl_maxcode * %i\n", offsetof(JHUFF_TBL, maxcode[0]));
printf("huff_tbl_valptr * %i\n", offsetof(JHUFF_TBL, valptr[0]));
printf("huff_tbl_huffval * %i\n", offsetof(JHUFF_TBL, huffval[0]));
printf("huff_tbl_shortcut * %i\n", offsetof(JHUFF_TBL, shortcut[0]));
printf("\n");
printf("cinfo_next_input_byte * %i\n", offsetof(struct decompress_info_struct, next_input_byte));
printf("cinfo_get_buffer * %i\n", offsetof(struct decompress_info_struct, get_buffer));
printf("cinfo_bits_left * %i\n", offsetof(struct decompress_info_struct, bits_left));
printf("cinfo_buffer_end * %i\n", offsetof(struct decompress_info_struct, buffer_end));
printf("cinfo_next_input_byte * %i\n", offsetof(struct jpeg_decompress_struct, next_input_byte));
printf("cinfo_get_buffer * %i\n", offsetof(struct jpeg_decompress_struct, get_buffer));
printf("cinfo_bits_left * %i\n", offsetof(struct jpeg_decompress_struct, bits_left));
printf("cinfo_buffer_end * %i\n", offsetof(struct jpeg_decompress_struct, buffer_end));
printf("\n END\n\n");
......
......@@ -28,13 +28,13 @@
#undef FILE_
#define FILE_ (10000)
#include "jinclude.h"
#include "jpeglib.h"
LOCAL int
huff_DECODE_buildshortcut (decompress_info_ptr cinfo, HUFF_TBL * htbl); /* forward reference */
LOCAL(int)
huff_DECODE_buildshortcut (j_decompress_ptr cinfo, JHUFF_TBL * htbl); /* forward reference */
LOCAL void
fix_huff_tbl (decompress_info_ptr cinfo, HUFF_TBL * htbl)
LOCAL(void)
fix_huff_tbl (j_decompress_ptr cinfo, JHUFF_TBL * htbl)
/* Compute derived values for a Huffman table */
{
int p, i, l, si;
......@@ -115,8 +115,8 @@ fix_huff_tbl (decompress_info_ptr cinfo, HUFF_TBL * htbl)
/* Extract the next N bits from the input stream (N <= 15) */
LOCAL int
get_bits (decompress_info_ptr cinfo, int nbits)
LOCAL(int)
get_bits (j_decompress_ptr cinfo, int nbits)
{
int result;
......@@ -149,8 +149,8 @@ get_bits (decompress_info_ptr cinfo, int nbits)
/* Figure F.16: extract next coded symbol from input stream */
/* Altered version of huff_DECODE for use in constructing the shortcut table */
LOCAL int
huff_DECODE_buildshortcut (decompress_info_ptr cinfo, HUFF_TBL * htbl)
LOCAL(int)
huff_DECODE_buildshortcut (j_decompress_ptr cinfo, JHUFF_TBL * htbl)
{
int l, p;
INT32 code;
......@@ -168,8 +168,8 @@ huff_DECODE_buildshortcut (decompress_info_ptr cinfo, HUFF_TBL * htbl)
#ifndef ASMHUFF
LOCAL int
huff_DECODE (decompress_info_ptr cinfo, HUFF_TBL * htbl)
LOCAL(int)
huff_DECODE (j_decompress_ptr cinfo, JHUFF_TBL * htbl)
{
int l, p;
INT32 code;
......@@ -256,8 +256,8 @@ static const short ZAG[DCTSIZE2+16] = {
#endif
LOCAL void
decode_one_block (decompress_info_ptr cinfo, JBLOCK block, HUFF_TBL *dctbl, HUFF_TBL *actbl, QUANT_TBL_PTR quanttbl, int *last_dc_val)
LOCAL(void)
decode_one_block (j_decompress_ptr cinfo, JBLOCK block, JHUFF_TBL *dctbl, JHUFF_TBL *actbl, QUANT_TBL_PTR quanttbl, int *last_dc_val)
{
int s, k, r, n;
......@@ -300,8 +300,8 @@ decode_one_block (decompress_info_ptr cinfo, JBLOCK block, HUFF_TBL *dctbl, HUFF
}
}
LOCAL void
skip_one_block (decompress_info_ptr cinfo, HUFF_TBL *dctbl, HUFF_TBL *actbl, int *last_dc_val)
LOCAL(void)
skip_one_block (j_decompress_ptr cinfo, JHUFF_TBL *dctbl, JHUFF_TBL *actbl, int *last_dc_val)
/* Like decode_one_block in its effect on *last_dc_val and the source of the input stream,
but no block of coefficients need be produced. */
{
......@@ -337,9 +337,9 @@ but no block of coefficients need be produced. */
}
}
LOCAL void
huff_decode_blocks(decompress_info_ptr cinfo, JBLOCK block,
HUFF_TBL *dctbl, HUFF_TBL *actbl, QUANT_TBL_PTR quanttbl,
LOCAL(void)
huff_decode_blocks(j_decompress_ptr cinfo, JBLOCK block,
JHUFF_TBL *dctbl, JHUFF_TBL *actbl, QUANT_TBL_PTR quanttbl,
int *last_dc_val, int nblocks)
{
while (nblocks > 0)
......@@ -350,8 +350,8 @@ huff_decode_blocks(decompress_info_ptr cinfo, JBLOCK block,
}
extern void
huff_skip_blocks (decompress_info_ptr cinfo, JBLOCK block,
HUFF_TBL *dctbl, HUFF_TBL *actbl,
huff_skip_blocks (j_decompress_ptr cinfo, JBLOCK block,
JHUFF_TBL *dctbl, JHUFF_TBL *actbl,
QUANT_TBL_PTR quanttbl, int *last_dc_val, int nblocks)
{
block=block; /* unused */
......@@ -370,8 +370,8 @@ huff_skip_blocks (decompress_info_ptr cinfo, JBLOCK block,
* This is invoked after reading the SOS marker.
*/
METHODDEF void
huff_decoder_init (decompress_info_ptr cinfo)
METHODDEF(void)
huff_decoder_init (j_decompress_ptr cinfo)
{
/* Initialize static variables */
/* dcinfo = cinfo; */
......
......@@ -41,10 +41,10 @@
#undef FILE_
#define FILE_ (20000)
#include "jinclude.h"
#ifdef JFIF_SUPPORTED
#include "jpeglib.h"
#include <string.h>
#if 1
typedef enum { /* JPEG marker codes */
M_SOF0 = 0xc0,
......@@ -105,8 +105,8 @@ typedef enum { /* JPEG marker codes */
*/
LOCAL INT32
get_2bytes (decompress_info_ptr cinfo)
LOCAL(INT32)
get_2bytes (j_decompress_ptr cinfo)
/* Get a 2-byte unsigned integer (e.g., a marker parameter length field) */
{
INT32 a;
......@@ -116,8 +116,8 @@ get_2bytes (decompress_info_ptr cinfo)
}
LOCAL void
skip_variable (decompress_info_ptr cinfo, int code)
LOCAL(void)
skip_variable (j_decompress_ptr cinfo, int code)
/* Skip over an unknown or uninteresting variable-length marker */
{
INT32 length;
......@@ -129,18 +129,20 @@ skip_variable (decompress_info_ptr cinfo, int code)
for (length -= 2; length > 0; length--)
(void) JGETC(cinfo);
UNUSED(code);
}
LOCAL void
get_dht (decompress_info_ptr cinfo)
LOCAL(void)
get_dht (j_decompress_ptr cinfo)
/* Process a DHT marker */
{
INT32 length;
UINT8 bits[17];
UINT8 huffval[256];
int i, index, count;
HUFF_TBL **htblptr;
JHUFF_TBL **htblptr;
length = get_2bytes(cinfo)-2;
......@@ -194,8 +196,8 @@ get_dht (decompress_info_ptr cinfo)
}
LOCAL void
get_dac (decompress_info_ptr cinfo)
LOCAL(void)
get_dac (j_decompress_ptr cinfo)
/* Process a DAC marker */
{
INT32 length;
......@@ -227,14 +229,14 @@ get_dac (decompress_info_ptr cinfo)
}
LOCAL void
get_dqt (decompress_info_ptr cinfo)
LOCAL(void)
get_dqt (j_decompress_ptr cinfo)
/* Process a DQT marker */
{
INT32 length;
int n, i, prec;
UINT16 tmp;
QUANT_TBL_PTR quant_ptr;
JQUANT_TBL *quant_ptr;
length = get_2bytes(cinfo) - 2;
......@@ -251,8 +253,8 @@ get_dqt (decompress_info_ptr cinfo)
#if 0
if (cinfo->quant_tbl_ptrs[n] == NULL)
cinfo->quant_tbl_ptrs[n] = (QUANT_TBL_PTR)
malloc (SIZEOF(QUANT_TBL));
cinfo->quant_tbl_ptrs[n] = (JQUANT_TBL *)
malloc (SIZEOF(JQUANT_TBL));
#endif
quant_ptr = cinfo->quant_tbl_ptrs[n];
......@@ -260,7 +262,7 @@ get_dqt (decompress_info_ptr cinfo)
tmp = JGETC(cinfo);
if (prec)
tmp = (tmp<<8) + JGETC(cinfo);
quant_ptr[i] = tmp;
quant_ptr->quantval[i] = tmp;
}
#ifdef DEBUG
......@@ -277,8 +279,8 @@ get_dqt (decompress_info_ptr cinfo)
}
LOCAL void
get_dri (decompress_info_ptr cinfo)
LOCAL(void)
get_dri (j_decompress_ptr cinfo)
/* Process a DRI marker */
{
if (get_2bytes(cinfo) != 4)
......@@ -291,8 +293,8 @@ get_dri (decompress_info_ptr cinfo)
}
LOCAL void
get_app0 (decompress_info_ptr cinfo)
LOCAL(void)
get_app0 (j_decompress_ptr cinfo)
/* Process an APP0 marker */
{
#define JFIF_LEN 14
......@@ -324,8 +326,8 @@ get_app0 (decompress_info_ptr cinfo)
cinfo->X_density = (b[8] << 8) + b[9];
cinfo->Y_density = (b[10] << 8) + b[11];
/* Assume colorspace is YCbCr, unless UI has overridden me */
if (cinfo->jpeg_color_space == CS_UNKNOWN)
cinfo->jpeg_color_space = CS_YCbCr;
if (cinfo->jpeg_color_space == JCS_UNKNOWN)
cinfo->jpeg_color_space = JCS_YCbCr;
TRACEMS3(cinfo->emethods, 1, "JFIF APP0 marker, density %dx%d %d",
cinfo->X_density, cinfo->Y_density, cinfo->density_unit);
} else {
......@@ -341,8 +343,8 @@ get_app0 (decompress_info_ptr cinfo)
}
LOCAL void
get_sof (decompress_info_ptr cinfo, int code)
LOCAL(void)
get_sof (j_decompress_ptr cinfo, int code)
/* Process a SOFn marker */
{
INT32 length;
......@@ -365,7 +367,7 @@ get_sof (decompress_info_ptr cinfo, int code)
/* We don't support files in which the image height is initially specified */
/* as 0 and is later redefined by DNL. As long as we have to check that, */
/* might as well have a general sanity check. */
if (cinfo->image_height <= 0 || cinfo->image_width <= 0
if (cinfo->image_height == 0 || cinfo->image_width == 0
|| cinfo->num_components <= 0)
ERREXIT(cinfo->emethods, "Empty JPEG image (DNL not supported)");
......@@ -407,11 +409,13 @@ get_sof (decompress_info_ptr cinfo, int code)
compptr->component_id, compptr->h_samp_factor,
compptr->v_samp_factor, compptr->quant_tbl_no);
}
UNUSED(code);
}
LOCAL void
get_sos (decompress_info_ptr cinfo)
LOCAL(void)
get_sos (j_decompress_ptr cinfo)
/* Process a SOS marker */
{
INT32 length;
......@@ -457,8 +461,8 @@ get_sos (decompress_info_ptr cinfo)
}
LOCAL void
get_soi (decompress_info_ptr cinfo)
LOCAL(void)
get_soi (j_decompress_ptr cinfo)
/* Process an SOI marker */
{
int i;
......@@ -482,8 +486,8 @@ get_soi (decompress_info_ptr cinfo)
}
LOCAL int
next_marker (decompress_info_ptr cinfo)
LOCAL(int)
next_marker (j_decompress_ptr cinfo)
/* Find the next JPEG marker */
/* Note that the output might not be a valid marker code, */
/* but it will never be 0 or FF */
......@@ -510,8 +514,8 @@ next_marker (decompress_info_ptr cinfo)
}
LOCAL JPEG_MARKER
process_tables (decompress_info_ptr cinfo)
LOCAL(JPEG_MARKER)
process_tables (j_decompress_ptr cinfo)
/* Scan and process JPEG markers that can appear in any order */
/* Return when an SOI, EOI, SOFn, or SOS is found */
{
......@@ -585,8 +589,8 @@ process_tables (decompress_info_ptr cinfo)
* Initialize and read the file header (everything through the SOF marker).
*/
METHODDEF void
read_file_header (decompress_info_ptr cinfo)
METHODDEF(void)
read_file_header (j_decompress_ptr cinfo)
{
int c;
......@@ -625,36 +629,38 @@ read_file_header (decompress_info_ptr cinfo)
switch (cinfo->num_components) {
case 1:
cinfo->jpeg_color_space = CS_GRAYSCALE;
cinfo->jpeg_color_space = JCS_GRAYSCALE;
break;
case 3:
/* if we saw a JFIF marker, leave it set to YCbCr; */
/* also leave it alone if UI has provided a value */
if (cinfo->jpeg_color_space == CS_UNKNOWN) {
if (cinfo->jpeg_color_space == JCS_UNKNOWN) {
short cid0 = cinfo->comp_info[0].component_id;
short cid1 = cinfo->comp_info[1].component_id;
short cid2 = cinfo->comp_info[2].component_id;
if (cid0 == 1 && cid1 == 2 && cid2 == 3)
cinfo->jpeg_color_space = CS_YCbCr; /* assume it's JFIF w/out marker */
cinfo->jpeg_color_space = JCS_YCbCr; /* assume it's JFIF w/out marker */
#if 0
else if (cid0 == 1 && cid1 == 4 && cid2 == 5)
cinfo->jpeg_color_space = CS_YIQ; /* prototype's YIQ matrix */
cinfo->jpeg_color_space = JCS_YIQ; /* prototype's YIQ matrix */
#endif
else {
TRACEMS3(cinfo->emethods, 0,
"Unrecognized component IDs %d %d %d, assuming YCbCr",
cid0, cid1, cid2);
cinfo->jpeg_color_space = CS_YCbCr;
cinfo->jpeg_color_space = JCS_YCbCr;
}
}
break;
case 4:
cinfo->jpeg_color_space = CS_CMYK;
cinfo->jpeg_color_space = JCS_CMYK;
break;
default:
cinfo->jpeg_color_space = CS_UNKNOWN;
cinfo->jpeg_color_space = JCS_UNKNOWN;
break;
}
}
......@@ -665,8 +671,8 @@ read_file_header (decompress_info_ptr cinfo)
* Return TRUE if find SOS, FALSE if find EOI.
*/
METHODDEF boolean
read_scan_header (decompress_info_ptr cinfo)
METHODDEF(boolean)
read_scan_header (j_decompress_ptr cinfo)
{
int c;
......@@ -696,8 +702,8 @@ read_scan_header (decompress_info_ptr cinfo)
* prepare for another read_scan_header call.
*/
METHODDEF void
read_scan_trailer (decompress_info_ptr cinfo)
METHODDEF(void)
read_scan_trailer (j_decompress_ptr cinfo)
{
/* no work needed */
}
......@@ -708,8 +714,8 @@ read_scan_trailer (decompress_info_ptr cinfo)
* Finish up at the end of the file.
*/
METHODDEF void
read_file_trailer (decompress_info_ptr cinfo)
METHODDEF(void)
read_file_trailer (j_decompress_ptr cinfo)
{
/* no work needed */
}
......@@ -725,8 +731,8 @@ read_file_trailer (decompress_info_ptr cinfo)
* the appropriate method selection routine.
*/
GLOBAL void
jselrjfif (decompress_info_ptr cinfo)
GLOBAL(void)
jselrjfif (j_decompress_ptr cinfo)
{
cinfo->methods->read_file_header = read_file_header;
cinfo->methods->read_scan_header = read_scan_header;
......
This diff is collapsed.
/*
* jinclude.h
*
* Copyright (C) 1991, 1992, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
* This is the central file that's #include'd by all the JPEG .c files.
* Its purpose is to provide a single place to fix any problems with
* including the wrong system include files.
* You can edit these declarations if you use a system with nonstandard
* system include files.
*/
/* RISCOS thing - only allow this file to be included once */
#ifndef jinclude__
#define jinclude__
/*
* Normally the __STDC__ macro can be taken as indicating that the system
* include files conform to the ANSI C standard. However, if you are running
* GCC on a machine with non-ANSI system include files, that is not the case.
* In that case change the following, or add -DNONANSI_INCLUDES to your CFLAGS.
*/
#ifdef __STDC__
#ifndef NONANSI_INCLUDES
#define INCLUDES_ARE_ANSI /* this is what's tested before including */
#endif
#endif
/*
* We need the size_t typedef, which defines the parameter type of malloc().
* In an ANSI-conforming implementation this is provided by <stdio.h>,
* but on non-ANSI systems it's more likely to be in <sys/types.h>.
* On some not-quite-ANSI systems you may find it in <stddef.h>.
*/
#ifndef INCLUDES_ARE_ANSI /* shouldn't need this if ANSI C */
#include <sys/types.h>
#endif
#ifdef __SASC /* Amiga SAS C provides it in stddef.h. */
#include <stddef.h>
#endif
/*
* In ANSI C, and indeed any rational implementation, size_t is also the
* type returned by sizeof(). However, it seems there are some irrational
* implementations out there, in which sizeof() returns an int even though
* size_t is defined as long or unsigned long. To ensure consistent results
* we always use this SIZEOF() macro in place of using sizeof() directly.
*/
#undef SIZEOF /* in case you included X11/xmd.h */
#define SIZEOF(object) ((size_t) sizeof(object))
/*
* We need the memcpy() and strcmp() functions, plus memory zeroing.
* ANSI and System V implementations declare these in <string.h>.
* BSD doesn't have the mem() functions, but it does have bcopy()/bzero().
* NOTE: we assume the size parameters to these functions are of type size_t.
* Insert casts in these macros if not!
*/
#ifdef INCLUDES_ARE_ANSI
#include <string.h>
#define MEMZERO(voidptr,size) memset((voidptr), 0, (size))
#else /* not ANSI */
#ifdef BSD
#include <strings.h>
#define MEMZERO(voidptr,size) bzero((voidptr), (size))
#define memcpy(dest,src,size) bcopy((src), (dest), (size))
#else /* not BSD, assume Sys V or compatible */
#include <string.h>
#define MEMZERO(voidptr,size) memset((voidptr), 0, (size))
#endif /* BSD */
#endif /* ANSI */
/* Now include the portable JPEG definition files. */
#include "jconfig.h"
#include "jpegdata.h"
/* Assembler coded stuff */
#ifdef ASMHUFF
extern void
asm_huff_decode_blocks(decompress_info_ptr cinfo, JBLOCK block,
HUFF_TBL *dctbl, HUFF_TBL *actbl, QUANT_TBL_PTR quanttbl,
int *last_dc_val, int nblocks);
extern void
asm_huff_skip_blocks(decompress_info_ptr cinfo, JBLOCK block,
HUFF_TBL *dctbl, HUFF_TBL *actbl, QUANT_TBL_PTR quanttbl,
int *last_dc_val, int nblocks);
#endif
#ifdef STATS
#define asm_j_rev_dct(i,b,c) j_rev_dct(i,b,c) /* Substitute 'Sources.jrevdct' for 'c.jrevdct4' */
#else
extern void asm_j_rev_dct(decompress_info_ptr cinfo, JBLOCK block, int count);
#endif
extern void asm_mono_convert_block(JBLOCK jblock, int *outptr, int outoffset);
extern void asm_mono_convert_block_8(JBLOCK jblock, int *outptr, int outoffset);
extern void asm_colour_convert_block(JBLOCK jblock, int *outptr, int outoffset);
extern void asm_colour_convert_block_16(JBLOCK jblock, short int *outptr, int outoffset);
extern void asm_colour_convert_block_8(JBLOCK jblock, char *outptr, int outoffset);
extern void asm_diffuse_to_8bpp(int *line, int linelength, char *output, char *table32k, int nlines, int linestep, int *palette_data);
extern char *asm_get_table32k(int *palette_data/*void*/);
extern void asm_convert_to_8bpp_grey(int *line, int linelength, char *output, int nlines, int linestep);
extern void asm_diffuse_to_24bpp(int *line, int linelength, int *output, char *table32k, int nlines, int linestep, int *palette_data);
#endif
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment