summaryrefslogtreecommitdiff
path: root/apps/recorder/jpeg_load.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-07-15 19:40:55 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-07-24 21:20:13 +0000
commit092c340a2062fa98b7387fc5fd63578ddae7d0b6 (patch)
tree98ec96946eeb2ae709cb0528cc6998e21bb9b290 /apps/recorder/jpeg_load.c
parent17f7cc92c258bc456a27c3e7c5a19c9409851879 (diff)
downloadrockbox-092c340a2062fa98b7387fc5fd63578ddae7d0b6.tar.gz
rockbox-092c340a2062fa98b7387fc5fd63578ddae7d0b6.zip
[1/4] Remove SH support and all archos targets
This removes all code specific to SH targets Change-Id: I7980523785d2596e65c06430f4638eec74a06061
Diffstat (limited to 'apps/recorder/jpeg_load.c')
-rw-r--r--apps/recorder/jpeg_load.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/apps/recorder/jpeg_load.c b/apps/recorder/jpeg_load.c
index 61ec3bfa0e..16a2f4e3a3 100644
--- a/apps/recorder/jpeg_load.c
+++ b/apps/recorder/jpeg_load.c
@@ -137,21 +137,7 @@ static struct jpeg jpeg;
137 137
138INLINE unsigned range_limit(int value) 138INLINE unsigned range_limit(int value)
139{ 139{
140#if CONFIG_CPU == SH7034 140#if defined(CPU_COLDFIRE)
141 unsigned tmp;
142 asm ( /* Note: Uses knowledge that only low byte of result is used */
143 "extu.b %[v],%[t] \n"
144 "cmp/eq %[v],%[t] \n" /* low byte == whole number ? */
145 "bt 1f \n" /* yes: no overflow */
146 "cmp/pz %[v] \n" /* overflow: positive? */
147 "subc %[v],%[v] \n" /* %[r] now either 0 or 0xffffffff */
148 "1: \n"
149 : /* outputs */
150 [v]"+r"(value),
151 [t]"=&r"(tmp)
152 );
153 return value;
154#elif defined(CPU_COLDFIRE)
155 /* Note: Uses knowledge that only the low byte of the result is used */ 141 /* Note: Uses knowledge that only the low byte of the result is used */
156 asm ( 142 asm (
157 "cmp.l #255,%[v] \n" /* overflow? */ 143 "cmp.l #255,%[v] \n" /* overflow? */
@@ -232,7 +218,7 @@ INLINE unsigned scale_output(int value)
232*/ 218*/
233#define MULTIPLY(var1, var2) ((var1) * (var2)) 219#define MULTIPLY(var1, var2) ((var1) * (var2))
234 220
235#if defined(CPU_SH) || defined(CPU_COLDFIRE) || \ 221#if defined(CPU_COLDFIRE) || \
236 (defined(CPU_ARM) && ARM_ARCH > 4) 222 (defined(CPU_ARM) && ARM_ARCH > 4)
237#define MULTIPLY16(var,const) (((short) (var)) * ((short) (const))) 223#define MULTIPLY16(var,const) (((short) (var)) * ((short) (const)))
238#else 224#else
@@ -1687,24 +1673,6 @@ static void search_restart(struct jpeg *p_jpeg)
1687} 1673}
1688 1674
1689/* Figure F.12: extend sign bit. */ 1675/* Figure F.12: extend sign bit. */
1690#if CONFIG_CPU == SH7034
1691/* SH1 lacks a variable-shift instruction */
1692#define HUFF_EXTEND(x,s) ((x) < extend_test[s] ? (x) + extend_offset[s] : (x))
1693
1694static const int extend_test[16] = /* entry n is 2**(n-1) */
1695{
1696 0, 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080,
1697 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000
1698};
1699
1700static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
1701{
1702 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
1703 ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
1704 ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
1705 ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1
1706};
1707#else
1708/* This saves some code and data size, benchmarks about the same on RAM */ 1676/* This saves some code and data size, benchmarks about the same on RAM */
1709#define HUFF_EXTEND(x,s) \ 1677#define HUFF_EXTEND(x,s) \
1710({ \ 1678({ \
@@ -1712,7 +1680,6 @@ static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
1712 int s__ = s; \ 1680 int s__ = s; \
1713 x__ & BIT_N(s__- 1) ? x__ : x__ + (-1 << s__) + 1; \ 1681 x__ & BIT_N(s__- 1) ? x__ : x__ + (-1 << s__) + 1; \
1714}) 1682})
1715#endif
1716 1683
1717/* Decode a single value */ 1684/* Decode a single value */
1718#define huff_decode_dc(p_jpeg, tbl, s, r) \ 1685#define huff_decode_dc(p_jpeg, tbl, s, r) \