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

Reorganise rojpeg.

Aside from moving blocks around and adding comments, decisions about numcomponents use switch/case statements to allow CMYK support in the future.
Split out (some of the) Huffman decoding to allow arithmetic support in the future.
Moved memcpy() and memset() into CSupport.
Tested in all colour depths with 1x1; 1x2; 2x1; 2x2 sampling & ChangeFSI.
Tighten up check on cinfo being NULL (was previously only checked in the colour decoder, not the monochrome).

Version 1.37. Tagged as 'SprExtend-1_37'
parent 009a0332
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
EXPORT |__rt_sdiv| EXPORT |__rt_sdiv|
EXPORT |__rt_udiv| EXPORT |__rt_udiv|
EXPORT |memcpy|
EXPORT |memset|
|x$divide| |x$divide|
|__rt_sdiv| |__rt_sdiv|
...@@ -165,4 +167,25 @@ u_sh0 RSBS ip, a1, a2 ...@@ -165,4 +167,25 @@ u_sh0 RSBS ip, a1, a2
MOV a1, a3 MOV a1, a3
MOV pc, r14 MOV pc, r14
|memcpy|
; extern void *memcpy(void *a1, const void *a2, size_t a3)
TEQ a3, #0
MOVNE ip, a1
mc_0
LDRNEB a4, [a2], #1
STRNEB a4, [ip], #1
SUBNES a3, a3, #1
BNE mc_0
MOV pc, lr
|memset|
; extern void *memset(void *a1, int a2, size_t a3)
TEQ a3, #0
MOVNE ip, a1
ms_0
STRNEB a2, [ip], #1
SUBNES a3, a3, #1
BNE ms_0
MOV pc, lr
END END
...@@ -11,13 +11,13 @@ ...@@ -11,13 +11,13 @@
GBLS Module_HelpVersion GBLS Module_HelpVersion
GBLS Module_ComponentName GBLS Module_ComponentName
GBLS Module_ComponentPath GBLS Module_ComponentPath
Module_MajorVersion SETS "1.36" Module_MajorVersion SETS "1.37"
Module_Version SETA 136 Module_Version SETA 137
Module_MinorVersion SETS "" Module_MinorVersion SETS ""
Module_Date SETS "14 Nov 2010" Module_Date SETS "22 Dec 2010"
Module_ApplicationDate SETS "14-Nov-10" Module_ApplicationDate SETS "22-Dec-10"
Module_ComponentName SETS "SprExtend" Module_ComponentName SETS "SprExtend"
Module_ComponentPath SETS "mixed/RiscOS/Sources/Video/Render/SprExtend" Module_ComponentPath SETS "mixed/RiscOS/Sources/Video/Render/SprExtend"
Module_FullVersion SETS "1.36" Module_FullVersion SETS "1.37"
Module_HelpVersion SETS "1.36 (14 Nov 2010)" Module_HelpVersion SETS "1.37 (22 Dec 2010)"
END END
/* (1.36) /* (1.37)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1. * Last processed by srccommit version: 1.1.
* *
*/ */
#define Module_MajorVersion_CMHG 1.36 #define Module_MajorVersion_CMHG 1.37
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Nov 2010 #define Module_Date_CMHG 22 Dec 2010
#define Module_MajorVersion "1.36" #define Module_MajorVersion "1.37"
#define Module_Version 136 #define Module_Version 137
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "14 Nov 2010" #define Module_Date "22 Dec 2010"
#define Module_ApplicationDate "14-Nov-10" #define Module_ApplicationDate "22-Dec-10"
#define Module_ComponentName "SprExtend" #define Module_ComponentName "SprExtend"
#define Module_ComponentPath "mixed/RiscOS/Sources/Video/Render/SprExtend" #define Module_ComponentPath "mixed/RiscOS/Sources/Video/Render/SprExtend"
#define Module_FullVersion "1.36" #define Module_FullVersion "1.37"
#define Module_HelpVersion "1.36 (14 Nov 2010)" #define Module_HelpVersion "1.37 (22 Dec 2010)"
#define Module_LibraryVersionInfo "1:36" #define Module_LibraryVersionInfo "1:37"
This diff is collapsed.
...@@ -97,7 +97,11 @@ asm_huff_skip_blocks(decompress_info_ptr cinfo, JBLOCK block, ...@@ -97,7 +97,11 @@ asm_huff_skip_blocks(decompress_info_ptr cinfo, JBLOCK block,
int *last_dc_val, int nblocks); int *last_dc_val, int nblocks);
#endif #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); 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(JBLOCK jblock, int *outptr, int outoffset);
extern void asm_mono_convert_block_8(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(JBLOCK jblock, int *outptr, int outoffset);
......
...@@ -190,16 +190,14 @@ typedef struct ...@@ -190,16 +190,14 @@ typedef struct
} huff_pointer; } huff_pointer;
/* ------------- Error codes for various forms of unacceptable JPEG file ------------- */ /* ------------- Error codes for various forms of unacceptable JPEG file ------------- */
#define E_PRE_NOT_8 1 /* Data precision not 8 */ #define E_PRE_NOT_8 1 /* Unsupported - Data precision not 8 */
#define E_RESTART 2 /* Restart interval not 0 */ #define E_MULTI_SCAN 2 /* Unsupported - Multi scan file */
#define E_MULTI_SCAN 3 /* Multi-scan file */ #define E_COMPONENTS 3 /* Unsupported - Bad number of components, only 1 or 3 allowed */
#define E_TOO_HIGH 4 /* Image too high, max is %i pixels */ #define E_BAD_SAMPLE 4 /* Bad sample factor */
#define E_BAD_SAMPLE 5 /* Bad sample factor */ #define E_HEIGHT_DISAGREES 5 /* Height is not as specified */
#define E_HEIGHT 6 /* Height is %i, not as specified */ #define E_WIDTH_DISAGREES 6 /* Width is not as specified */
#define E_WIDTH 7 /* Width is %i, not as specified */ #define E_COLOUR 7 /* Bad colour space, not grey or YUV */
#define E_COLOUR 8 /* Bad colour space (%i), not grey or YUV */ #define E_TOO_WIDE 8 /* Image too wide based on number of MCUs */
#define E_COMPONENTS 9 /* Bad number (%i) of components, only 1 or 3 allowed */
#define E_TOO_WIDE 10 /* Image too wide, max is %i pixels */
/* ------------- Working data for decompression ---------------------------------- */ /* ------------- Working data for decompression ---------------------------------- */
......
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