diff options
-rw-r--r-- | apps/plugins/lib/SOURCES | 5 | ||||
-rw-r--r-- | apps/plugins/lib/bmp.c | 15 | ||||
-rw-r--r-- | apps/plugins/lib/bmp.h | 5 | ||||
-rw-r--r-- | apps/plugins/lib/resize.c (renamed from apps/plugins/lib/core_resize.c) | 12 | ||||
-rw-r--r-- | apps/plugins/lib/resize.h (renamed from apps/plugins/lib/core_bmp.c) | 13 | ||||
-rw-r--r-- | apps/plugins/lib/wrappers.h | 44 | ||||
-rw-r--r-- | apps/plugins/test_greylib_bitmap_scale.c | 2 | ||||
-rw-r--r-- | apps/recorder/bmp.c | 34 | ||||
-rw-r--r-- | apps/recorder/bmp.h | 7 | ||||
-rw-r--r-- | apps/recorder/resize.c | 31 | ||||
-rw-r--r-- | apps/recorder/resize.h | 5 |
11 files changed, 107 insertions, 66 deletions
diff --git a/apps/plugins/lib/SOURCES b/apps/plugins/lib/SOURCES index c8c1553dc8..b28878cffc 100644 --- a/apps/plugins/lib/SOURCES +++ b/apps/plugins/lib/SOURCES | |||
@@ -5,8 +5,7 @@ playback_control.c | |||
5 | rgb_hsv.c | 5 | rgb_hsv.c |
6 | #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) | 6 | #if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH < 4) |
7 | #if LCD_DEPTH == 1 | 7 | #if LCD_DEPTH == 1 |
8 | core_bmp.c | 8 | resize.c |
9 | core_resize.c | ||
10 | #endif | 9 | #endif |
11 | grey_core.c | 10 | grey_core.c |
12 | grey_draw.c | 11 | grey_draw.c |
@@ -34,9 +33,7 @@ picture.c | |||
34 | xlcd_core.c | 33 | xlcd_core.c |
35 | xlcd_draw.c | 34 | xlcd_draw.c |
36 | xlcd_scroll.c | 35 | xlcd_scroll.c |
37 | #if LCD_DEPTH>1 | ||
38 | bmp.c | 36 | bmp.c |
39 | #endif | ||
40 | #ifdef HAVE_LCD_COLOR | 37 | #ifdef HAVE_LCD_COLOR |
41 | bmp_smooth_scale.c | 38 | bmp_smooth_scale.c |
42 | #endif | 39 | #endif |
diff --git a/apps/plugins/lib/bmp.c b/apps/plugins/lib/bmp.c index a8ebbffc27..b3e0e2b948 100644 --- a/apps/plugins/lib/bmp.c +++ b/apps/plugins/lib/bmp.c | |||
@@ -8,6 +8,7 @@ | |||
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * Copyright (C) 2006 by Antoine Cellerier <dionoea -at- videolan -dot- org> | 10 | * Copyright (C) 2006 by Antoine Cellerier <dionoea -at- videolan -dot- org> |
11 | * Copyright (C) 2009 by Andrew Mahone | ||
11 | * | 12 | * |
12 | * This program is free software; you can redistribute it and/or | 13 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 14 | * modify it under the terms of the GNU General Public License |
@@ -26,6 +27,7 @@ | |||
26 | #include "lcd.h" | 27 | #include "lcd.h" |
27 | #include "system.h" | 28 | #include "system.h" |
28 | 29 | ||
30 | #if LCD_DEPTH > 1 | ||
29 | #ifdef HAVE_LCD_COLOR | 31 | #ifdef HAVE_LCD_COLOR |
30 | #define LE16(x) (htole16(x))&0xff, ((htole16(x))>>8)&0xff | 32 | #define LE16(x) (htole16(x))&0xff, ((htole16(x))>>8)&0xff |
31 | #define LE32(x) (htole32(x))&0xff, ((htole32(x))>>8)&0xff, ((htole32(x))>>16)&0xff, ((htole32(x))>>24)&0xff | 33 | #define LE32(x) (htole32(x))&0xff, ((htole32(x))>>8)&0xff, ((htole32(x))>>16)&0xff, ((htole32(x))>>24)&0xff |
@@ -119,3 +121,16 @@ void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst) | |||
119 | yr += yrstep; | 121 | yr += yrstep; |
120 | } | 122 | } |
121 | } | 123 | } |
124 | |||
125 | #else | ||
126 | #include "wrappers.h" | ||
127 | |||
128 | static const struct plugin_api *rb; | ||
129 | |||
130 | #include "../../recorder/bmp.c" | ||
131 | |||
132 | void bmp_init(const struct plugin_api *api) | ||
133 | { | ||
134 | rb = api; | ||
135 | } | ||
136 | #endif | ||
diff --git a/apps/plugins/lib/bmp.h b/apps/plugins/lib/bmp.h index 12894f7551..379a889994 100644 --- a/apps/plugins/lib/bmp.h +++ b/apps/plugins/lib/bmp.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include "lcd.h" | 24 | #include "lcd.h" |
25 | #include "plugin.h" | 25 | #include "plugin.h" |
26 | 26 | ||
27 | #if LCD_DEPTH > 1 | ||
27 | #ifdef HAVE_LCD_COLOR | 28 | #ifdef HAVE_LCD_COLOR |
28 | /** | 29 | /** |
29 | * Save bitmap to file | 30 | * Save bitmap to file |
@@ -43,4 +44,8 @@ void simple_resize_bitmap(struct bitmap *src, struct bitmap *dst); | |||
43 | */ | 44 | */ |
44 | void smooth_resize_bitmap(struct bitmap *src, struct bitmap *dst); | 45 | void smooth_resize_bitmap(struct bitmap *src, struct bitmap *dst); |
45 | 46 | ||
47 | #else | ||
48 | void bmp_init(const struct plugin_api *api); | ||
49 | #endif | ||
50 | |||
46 | #endif | 51 | #endif |
diff --git a/apps/plugins/lib/core_resize.c b/apps/plugins/lib/resize.c index 099d4079ed..28446e75a7 100644 --- a/apps/plugins/lib/core_resize.c +++ b/apps/plugins/lib/resize.c | |||
@@ -7,7 +7,9 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * This is a wrapper for the core bmp.c | 10 | * Copyright (C) 2009 by Andrew Mahone |
11 | * | ||
12 | * This is a wrapper for the core resize.c | ||
11 | * | 13 | * |
12 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 15 | * modify it under the terms of the GNU General Public License |
@@ -20,5 +22,13 @@ | |||
20 | ****************************************************************************/ | 22 | ****************************************************************************/ |
21 | 23 | ||
22 | #include <plugin.h> | 24 | #include <plugin.h> |
25 | #include "wrappers.h" | ||
26 | |||
27 | static const struct plugin_api *rb; | ||
28 | |||
23 | #include "../../recorder/resize.c" | 29 | #include "../../recorder/resize.c" |
24 | 30 | ||
31 | void resize_init(const struct plugin_api *api) | ||
32 | { | ||
33 | rb = api; | ||
34 | } | ||
diff --git a/apps/plugins/lib/core_bmp.c b/apps/plugins/lib/resize.h index 28d70b1bb8..3674e140c3 100644 --- a/apps/plugins/lib/core_bmp.c +++ b/apps/plugins/lib/resize.h | |||
@@ -7,7 +7,9 @@ | |||
7 | * \/ \/ \/ \/ \/ | 7 | * \/ \/ \/ \/ \/ |
8 | * $Id$ | 8 | * $Id$ |
9 | * | 9 | * |
10 | * This is a wrapper for the core bmp.c | 10 | * Copyright (C) 2009 by Andrew Mahone |
11 | * | ||
12 | * This is a header for the pluginlib extensions to the core resize.c file | ||
11 | * | 13 | * |
12 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
13 | * modify it under the terms of the GNU General Public License | 15 | * modify it under the terms of the GNU General Public License |
@@ -19,6 +21,11 @@ | |||
19 | * | 21 | * |
20 | ****************************************************************************/ | 22 | ****************************************************************************/ |
21 | 23 | ||
22 | #include <plugin.h> | 24 | #ifndef _LIB_RESIZE_H_ |
23 | #include "../../recorder/bmp.c" | 25 | #define _LIB_RESIZE_H_ |
26 | |||
27 | #if LCD_DEPTH == 1 | ||
28 | void resize_init(const struct plugin_api *api); | ||
29 | #endif | ||
24 | 30 | ||
31 | #endif | ||
diff --git a/apps/plugins/lib/wrappers.h b/apps/plugins/lib/wrappers.h new file mode 100644 index 0000000000..2eb4ea025e --- /dev/null +++ b/apps/plugins/lib/wrappers.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2009 by Andrew Mahone | ||
11 | * | ||
12 | * This header redefines some core functions as calls via the plugin_api, to | ||
13 | * allow easy compilation of core source files in the pluginlib with different | ||
14 | * features from the version built for the core, or when a core object file is | ||
15 | * not built for a particular target. | ||
16 | * | ||
17 | * This program is free software; you can redistribute it and/or | ||
18 | * modify it under the terms of the GNU General Public License | ||
19 | * as published by the Free Software Foundation; either version 2 | ||
20 | * of the License, or (at your option) any later version. | ||
21 | * | ||
22 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
23 | * KIND, either express or implied. | ||
24 | * | ||
25 | ****************************************************************************/ | ||
26 | |||
27 | #ifndef _LIB_WRAPPERS_H_ | ||
28 | #define _LIB_WRAPPERS_H_ | ||
29 | |||
30 | #define open rb->open | ||
31 | #define close rb->close | ||
32 | #define read rb->read | ||
33 | #define lseek rb->lseek | ||
34 | #define memset rb->memset | ||
35 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | ||
36 | #define cpu_boost rb->cpu_boost | ||
37 | #endif | ||
38 | #define yield rb->yield | ||
39 | #if CONFIG_CODEC == SWCODEC | ||
40 | #define align_buffer rb->align_buffer | ||
41 | #endif | ||
42 | |||
43 | #endif | ||
44 | |||
diff --git a/apps/plugins/test_greylib_bitmap_scale.c b/apps/plugins/test_greylib_bitmap_scale.c index 3d6f81f91e..a3de006e05 100644 --- a/apps/plugins/test_greylib_bitmap_scale.c +++ b/apps/plugins/test_greylib_bitmap_scale.c | |||
@@ -21,6 +21,8 @@ | |||
21 | 21 | ||
22 | #include "plugin.h" | 22 | #include "plugin.h" |
23 | #include "lib/grey.h" | 23 | #include "lib/grey.h" |
24 | #include "lib/resize.h" | ||
25 | #include "lib/bmp.h" | ||
24 | 26 | ||
25 | #if LCD_DEPTH == 1 | 27 | #if LCD_DEPTH == 1 |
26 | #define BMP_LOAD read_bmp_file | 28 | #define BMP_LOAD read_bmp_file |
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index 01b57d2116..d6d836a6c5 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c | |||
@@ -72,19 +72,6 @@ | |||
72 | #pragma pack (push, 2) | 72 | #pragma pack (push, 2) |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | #ifndef PLUGIN | ||
76 | #define API(x) x | ||
77 | #else | ||
78 | #define API(x) rb->x | ||
79 | |||
80 | static const struct plugin_api *rb; | ||
81 | |||
82 | void bmp_init(const struct plugin_api * api) | ||
83 | { | ||
84 | rb = api; | ||
85 | } | ||
86 | #endif | ||
87 | |||
88 | /* BMP header structure */ | 75 | /* BMP header structure */ |
89 | struct bmp_header { | 76 | struct bmp_header { |
90 | uint16_t type; /* signature - 'BM' */ | 77 | uint16_t type; /* signature - 'BM' */ |
@@ -137,15 +124,13 @@ static const struct uint8_rgb bitfields[3][3] = { | |||
137 | }, | 124 | }, |
138 | }; | 125 | }; |
139 | 126 | ||
140 | #if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) || \ | 127 | #if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) |
141 | defined(PLUGIN) | ||
142 | /* the full 16x16 Bayer dither matrix may be calculated quickly with this table | 128 | /* the full 16x16 Bayer dither matrix may be calculated quickly with this table |
143 | */ | 129 | */ |
144 | const unsigned char dither_table[16] = | 130 | const unsigned char dither_table[16] = |
145 | { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }; | 131 | { 0,192, 48,240, 12,204, 60,252, 3,195, 51,243, 15,207, 63,255 }; |
146 | #endif | 132 | #endif |
147 | 133 | ||
148 | #ifndef PLUGIN | ||
149 | #if ((LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)) \ | 134 | #if ((LCD_DEPTH == 2) && (LCD_PIXELFORMAT == VERTICAL_INTERLEAVED)) \ |
150 | || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH == 2) \ | 135 | || (defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH == 2) \ |
151 | && (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED)) | 136 | && (LCD_REMOTE_PIXELFORMAT == VERTICAL_INTERLEAVED)) |
@@ -153,7 +138,6 @@ const unsigned short vi_pattern[4] = { | |||
153 | 0x0101, 0x0100, 0x0001, 0x0000 | 138 | 0x0101, 0x0100, 0x0001, 0x0000 |
154 | }; | 139 | }; |
155 | #endif | 140 | #endif |
156 | #endif | ||
157 | 141 | ||
158 | /****************************************************************************** | 142 | /****************************************************************************** |
159 | * read_bmp_file() | 143 | * read_bmp_file() |
@@ -168,7 +152,7 @@ int read_bmp_file(const char* filename, | |||
168 | const struct custom_format *cformat) | 152 | const struct custom_format *cformat) |
169 | { | 153 | { |
170 | int fd, ret; | 154 | int fd, ret; |
171 | fd = API(open)(filename, O_RDONLY); | 155 | fd = open(filename, O_RDONLY); |
172 | 156 | ||
173 | /* Exit if file opening failed */ | 157 | /* Exit if file opening failed */ |
174 | if (fd < 0) { | 158 | if (fd < 0) { |
@@ -180,7 +164,7 @@ int read_bmp_file(const char* filename, | |||
180 | filename, !!(format & FORMAT_REMOTE), !!(format & FORMAT_RESIZE), | 164 | filename, !!(format & FORMAT_REMOTE), !!(format & FORMAT_RESIZE), |
181 | !!(format & FORMAT_KEEP_ASPECT)); | 165 | !!(format & FORMAT_KEEP_ASPECT)); |
182 | ret = read_bmp_fd(fd, bm, maxsize, format, cformat); | 166 | ret = read_bmp_fd(fd, bm, maxsize, format, cformat); |
183 | API(close)(fd); | 167 | close(fd); |
184 | return ret; | 168 | return ret; |
185 | } | 169 | } |
186 | 170 | ||
@@ -237,7 +221,7 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
237 | #endif | 221 | #endif |
238 | ibuf = ((unsigned char *)buf) + (BM_MAX_WIDTH << 2) - len; | 222 | ibuf = ((unsigned char *)buf) + (BM_MAX_WIDTH << 2) - len; |
239 | BDEBUGF("read_part_line: cols=%d len=%d\n",cols,len); | 223 | BDEBUGF("read_part_line: cols=%d len=%d\n",cols,len); |
240 | ret = API(read)(fd, ibuf, len); | 224 | ret = read(fd, ibuf, len); |
241 | if (ret != len) | 225 | if (ret != len) |
242 | { | 226 | { |
243 | DEBUGF("read_part_line: error reading image, read returned %d " | 227 | DEBUGF("read_part_line: error reading image, read returned %d " |
@@ -324,7 +308,7 @@ static unsigned int read_part_line(struct bmp_args *ba) | |||
324 | if (pad > 0) | 308 | if (pad > 0) |
325 | { | 309 | { |
326 | BDEBUGF("seeking %d bytes to next line\n",pad); | 310 | BDEBUGF("seeking %d bytes to next line\n",pad); |
327 | API(lseek)(fd, pad, SEEK_CUR); | 311 | lseek(fd, pad, SEEK_CUR); |
328 | } | 312 | } |
329 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ | 313 | #if LCD_DEPTH > 1 || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1) || \ |
330 | defined(PLUGIN) | 314 | defined(PLUGIN) |
@@ -422,7 +406,7 @@ int read_bmp_fd(int fd, | |||
422 | #endif /*(LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)*/ | 406 | #endif /*(LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1)*/ |
423 | 407 | ||
424 | /* read fileheader */ | 408 | /* read fileheader */ |
425 | ret = API(read)(fd, &bmph, sizeof(struct bmp_header)); | 409 | ret = read(fd, &bmph, sizeof(struct bmp_header)); |
426 | if (ret < 0) { | 410 | if (ret < 0) { |
427 | return ret * 10 - 2; | 411 | return ret * 10 - 2; |
428 | } | 412 | } |
@@ -531,7 +515,7 @@ int read_bmp_fd(int fd, | |||
531 | int i; | 515 | int i; |
532 | union rgb_union pal; | 516 | union rgb_union pal; |
533 | for (i = 0; i < numcolors; i++) { | 517 | for (i = 0; i < numcolors; i++) { |
534 | if (API(read)(fd, &pal, sizeof(pal)) != (int)sizeof(pal)) | 518 | if (read(fd, &pal, sizeof(pal)) != (int)sizeof(pal)) |
535 | { | 519 | { |
536 | DEBUGF("read_bmp_fd: Can't read color palette\n"); | 520 | DEBUGF("read_bmp_fd: Can't read color palette\n"); |
537 | return -7; | 521 | return -7; |
@@ -589,9 +573,9 @@ int read_bmp_fd(int fd, | |||
589 | } | 573 | } |
590 | 574 | ||
591 | /* Search to the beginning of the image data */ | 575 | /* Search to the beginning of the image data */ |
592 | API(lseek)(fd, (off_t)letoh32(bmph.off_bits), SEEK_SET); | 576 | lseek(fd, (off_t)letoh32(bmph.off_bits), SEEK_SET); |
593 | 577 | ||
594 | API(memset)(bitmap, 0, totalsize); | 578 | memset(bitmap, 0, totalsize); |
595 | 579 | ||
596 | struct bmp_args ba = { | 580 | struct bmp_args ba = { |
597 | .fd = fd, .padded_width = padded_width, .read_width = read_width, | 581 | .fd = fd, .padded_width = padded_width, .read_width = read_width, |
diff --git a/apps/recorder/bmp.h b/apps/recorder/bmp.h index 946bc6f8b8..c570a3d6bd 100644 --- a/apps/recorder/bmp.h +++ b/apps/recorder/bmp.h | |||
@@ -52,8 +52,7 @@ struct rowset { | |||
52 | short rowstop; | 52 | short rowstop; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | #if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) || \ | 55 | #if (LCD_DEPTH > 1) || defined(HAVE_REMOTE_LCD) && (LCD_REMOTE_DEPTH > 1) |
56 | defined(PLUGIN) | ||
57 | extern const unsigned char dither_table[16]; | 56 | extern const unsigned char dither_table[16]; |
58 | #define DITHERY(y) (dither_table[(y) & 15] & 0xAA) | 57 | #define DITHERY(y) (dither_table[(y) & 15] & 0xAA) |
59 | #define DITHERX(x) (dither_table[(x) & 15]) | 58 | #define DITHERX(x) (dither_table[(x) & 15]) |
@@ -212,9 +211,5 @@ int read_bmp_fd(int fd, | |||
212 | int maxsize, | 211 | int maxsize, |
213 | int format, | 212 | int format, |
214 | const struct custom_format *cformat); | 213 | const struct custom_format *cformat); |
215 | #ifdef PLUGIN | ||
216 | struct plugin_api; | ||
217 | void bmp_init(const struct plugin_api * api); | ||
218 | #endif | ||
219 | 214 | ||
220 | #endif | 215 | #endif |
diff --git a/apps/recorder/resize.c b/apps/recorder/resize.c index 6e5e9c4efb..99ccc84d55 100644 --- a/apps/recorder/resize.c +++ b/apps/recorder/resize.c | |||
@@ -59,19 +59,6 @@ | |||
59 | #define DEBUGF(...) | 59 | #define DEBUGF(...) |
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | #ifndef PLUGIN | ||
63 | #define API(x) x | ||
64 | #else | ||
65 | #define API(x) rb->x | ||
66 | |||
67 | static const struct plugin_api *rb; | ||
68 | |||
69 | void resize_init(const struct plugin_api *api) | ||
70 | { | ||
71 | rb = api; | ||
72 | } | ||
73 | #endif | ||
74 | |||
75 | /* calculate the maximum dimensions which will preserve the aspect ration of | 62 | /* calculate the maximum dimensions which will preserve the aspect ration of |
76 | src while fitting in the constraints passed in dst, and store result in dst, | 63 | src while fitting in the constraints passed in dst, and store result in dst, |
77 | returning 0 if rounding and 1 if not rounding. | 64 | returning 0 if rounding and 1 if not rounding. |
@@ -154,7 +141,7 @@ static bool scale_h_area(void *out_line_ptr, | |||
154 | oxe = 0; | 141 | oxe = 0; |
155 | mul = 0; | 142 | mul = 0; |
156 | /* give other tasks a chance to run */ | 143 | /* give other tasks a chance to run */ |
157 | API(yield)(); | 144 | yield(); |
158 | for (ix = 0; ix < (unsigned int)ctx->src->width; ix++) | 145 | for (ix = 0; ix < (unsigned int)ctx->src->width; ix++) |
159 | { | 146 | { |
160 | oxe += ctx->bm->width; | 147 | oxe += ctx->bm->width; |
@@ -257,11 +244,11 @@ static inline bool scale_v_area(struct rowset *rset, struct scaler_context *ctx) | |||
257 | #ifdef HAVE_LCD_COLOR | 244 | #ifdef HAVE_LCD_COLOR |
258 | uint32_t *rowacc = (uint32_t *) ctx->buf, | 245 | uint32_t *rowacc = (uint32_t *) ctx->buf, |
259 | *rowtmp = rowacc + 3 * ctx->bm->width; | 246 | *rowtmp = rowacc + 3 * ctx->bm->width; |
260 | API(memset)((void *)ctx->buf, 0, ctx->bm->width * 2 * sizeof(struct uint32_rgb)); | 247 | memset((void *)ctx->buf, 0, ctx->bm->width * 2 * sizeof(struct uint32_rgb)); |
261 | #else | 248 | #else |
262 | uint32_t *rowacc = (uint32_t *) ctx->buf, | 249 | uint32_t *rowacc = (uint32_t *) ctx->buf, |
263 | *rowtmp = rowacc + ctx->bm->width; | 250 | *rowtmp = rowacc + ctx->bm->width; |
264 | API(memset)((void *)ctx->buf, 0, ctx->bm->width * 2 * sizeof(uint32_t)); | 251 | memset((void *)ctx->buf, 0, ctx->bm->width * 2 * sizeof(uint32_t)); |
265 | #endif | 252 | #endif |
266 | SDEBUGF("scale_v_area\n"); | 253 | SDEBUGF("scale_v_area\n"); |
267 | /* zero the accumulator and temp rows */ | 254 | /* zero the accumulator and temp rows */ |
@@ -298,9 +285,9 @@ static inline bool scale_v_area(struct rowset *rset, struct scaler_context *ctx) | |||
298 | ctx->output_row(oy, (void*)rowacc, ctx); | 285 | ctx->output_row(oy, (void*)rowacc, ctx); |
299 | /* clear accumulator row, store partial coverage for next row */ | 286 | /* clear accumulator row, store partial coverage for next row */ |
300 | #ifdef HAVE_LCD_COLOR | 287 | #ifdef HAVE_LCD_COLOR |
301 | API(memset)((void *)rowacc, 0, ctx->bm->width * sizeof(uint32_t) * 3); | 288 | memset((void *)rowacc, 0, ctx->bm->width * sizeof(uint32_t) * 3); |
302 | #else | 289 | #else |
303 | API(memset)((void *)rowacc, 0, ctx->bm->width * sizeof(uint32_t)); | 290 | memset((void *)rowacc, 0, ctx->bm->width * sizeof(uint32_t)); |
304 | #endif | 291 | #endif |
305 | mul = oye; | 292 | mul = oye; |
306 | oy += rset->rowstep; | 293 | oy += rset->rowstep; |
@@ -346,7 +333,7 @@ static bool scale_h_linear(void *out_line_ptr, struct scaler_context *ctx, | |||
346 | /* The error is set so that values are initialized on the first pass. */ | 333 | /* The error is set so that values are initialized on the first pass. */ |
347 | ixe = ctx->bm->width - 1; | 334 | ixe = ctx->bm->width - 1; |
348 | /* give other tasks a chance to run */ | 335 | /* give other tasks a chance to run */ |
349 | API(yield)(); | 336 | yield(); |
350 | for (ox = 0; ox < (uint32_t)ctx->bm->width; ox++) | 337 | for (ox = 0; ox < (uint32_t)ctx->bm->width; ox++) |
351 | { | 338 | { |
352 | #ifdef HAVE_LCD_COLOR | 339 | #ifdef HAVE_LCD_COLOR |
@@ -630,7 +617,7 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, | |||
630 | 0 : needed]; | 617 | 0 : needed]; |
631 | #endif | 618 | #endif |
632 | #if CONFIG_CODEC == SWCODEC | 619 | #if CONFIG_CODEC == SWCODEC |
633 | len = (unsigned int)API(align_buffer)(PUN_PTR(void**, &buf), len, | 620 | len = (unsigned int)align_buffer(PUN_PTR(void**, &buf), len, |
634 | sizeof(uint32_t)); | 621 | sizeof(uint32_t)); |
635 | #endif | 622 | #endif |
636 | if (needed > len) | 623 | if (needed > len) |
@@ -659,7 +646,7 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, | |||
659 | 646 | ||
660 | struct scaler_context ctx; | 647 | struct scaler_context ctx; |
661 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 648 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
662 | API(cpu_boost)(true); | 649 | cpu_boost(true); |
663 | #endif | 650 | #endif |
664 | ctx.store_part = store_part; | 651 | ctx.store_part = store_part; |
665 | ctx.args = args; | 652 | ctx.args = args; |
@@ -698,7 +685,7 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, | |||
698 | ret = scale_v_linear(rset, &ctx); | 685 | ret = scale_v_linear(rset, &ctx); |
699 | #endif | 686 | #endif |
700 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ | 687 | #ifdef HAVE_ADJUSTABLE_CPU_FREQ |
701 | API(cpu_boost)(false); | 688 | cpu_boost(false); |
702 | #endif | 689 | #endif |
703 | if (!ret) | 690 | if (!ret) |
704 | return 0; | 691 | return 0; |
diff --git a/apps/recorder/resize.h b/apps/recorder/resize.h index 9b52a7aa65..f8328e3f3d 100644 --- a/apps/recorder/resize.h +++ b/apps/recorder/resize.h | |||
@@ -95,9 +95,4 @@ int resize_on_load(struct bitmap *bm, bool dither, | |||
95 | struct img_part* (*store_part)(void *args), | 95 | struct img_part* (*store_part)(void *args), |
96 | void *args); | 96 | void *args); |
97 | 97 | ||
98 | #ifdef PLUGIN | ||
99 | struct plugin_api; | ||
100 | void resize_init(const struct plugin_api *api); | ||
101 | #endif | ||
102 | |||
103 | #endif /* _RESIZE_H_ */ | 98 | #endif /* _RESIZE_H_ */ |