diff options
author | Andrew Mahone <andrew.mahone@gmail.com> | 2009-05-09 07:31:27 +0000 |
---|---|---|
committer | Andrew Mahone <andrew.mahone@gmail.com> | 2009-05-09 07:31:27 +0000 |
commit | 91efc162564cd9c04677e2e38550cde21995b06e (patch) | |
tree | c927cefc7f12a49396541dbac246dc76ca444c71 /apps/recorder/resize.c | |
parent | 67695617a13e9f37f17e3718b03046f6d748a9e1 (diff) | |
download | rockbox-91efc162564cd9c04677e2e38550cde21995b06e.tar.gz rockbox-91efc162564cd9c04677e2e38550cde21995b06e.zip |
Split 8-bit-to-native conversion in bmp.c into a function, add support for plugging unscaled output in BMP and JPEG loaders, use output_row_8_native in JPEG decoder when possible.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20884 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/recorder/resize.c')
-rw-r--r-- | apps/recorder/resize.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/apps/recorder/resize.c b/apps/recorder/resize.c index 5ecb5c24cf..1e9210e819 100644 --- a/apps/recorder/resize.c +++ b/apps/recorder/resize.c | |||
@@ -518,7 +518,7 @@ static inline bool scale_v_linear(struct rowset *rset, | |||
518 | #endif /* HAVE_UPSCALER */ | 518 | #endif /* HAVE_UPSCALER */ |
519 | 519 | ||
520 | #if defined(HAVE_LCD_COLOR) && (defined(HAVE_JPEG) || defined(PLUGIN)) | 520 | #if defined(HAVE_LCD_COLOR) && (defined(HAVE_JPEG) || defined(PLUGIN)) |
521 | void output_row_native_fromyuv(uint32_t row, void * row_in, | 521 | static void output_row_32_native_fromyuv(uint32_t row, void * row_in, |
522 | struct scaler_context *ctx) | 522 | struct scaler_context *ctx) |
523 | { | 523 | { |
524 | int col; | 524 | int col; |
@@ -547,7 +547,7 @@ void output_row_native_fromyuv(uint32_t row, void * row_in, | |||
547 | #endif | 547 | #endif |
548 | 548 | ||
549 | #if !defined(PLUGIN) || LCD_DEPTH > 1 | 549 | #if !defined(PLUGIN) || LCD_DEPTH > 1 |
550 | void output_row_native(uint32_t row, void * row_in, | 550 | static void output_row_32_native(uint32_t row, void * row_in, |
551 | struct scaler_context *ctx) | 551 | struct scaler_context *ctx) |
552 | { | 552 | { |
553 | int col; | 553 | int col; |
@@ -644,13 +644,14 @@ unsigned int get_size_native(struct bitmap *bm) | |||
644 | } | 644 | } |
645 | 645 | ||
646 | const struct custom_format format_native = { | 646 | const struct custom_format format_native = { |
647 | .output_row_8 = output_row_8_native, | ||
647 | #if defined(HAVE_LCD_COLOR) && (defined(HAVE_JPEG) || defined(PLUGIN)) | 648 | #if defined(HAVE_LCD_COLOR) && (defined(HAVE_JPEG) || defined(PLUGIN)) |
648 | .output_row = { | 649 | .output_row_32 = { |
649 | output_row_native, | 650 | output_row_32_native, |
650 | output_row_native_fromyuv | 651 | output_row_32_native_fromyuv |
651 | }, | 652 | }, |
652 | #else | 653 | #else |
653 | .output_row = output_row_native, | 654 | .output_row_32 = output_row_32_native, |
654 | #endif | 655 | #endif |
655 | .get_size = get_size_native | 656 | .get_size = get_size_native |
656 | }; | 657 | }; |
@@ -722,17 +723,17 @@ int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, | |||
722 | ctx.dither = dither; | 723 | ctx.dither = dither; |
723 | #if !defined(PLUGIN) | 724 | #if !defined(PLUGIN) |
724 | #if defined(HAVE_LCD_COLOR) && defined(HAVE_JPEG) | 725 | #if defined(HAVE_LCD_COLOR) && defined(HAVE_JPEG) |
725 | ctx.output_row = format_index ? output_row_native_fromyuv | 726 | ctx.output_row = format_index ? output_row_32_native_fromyuv |
726 | : output_row_native; | 727 | : output_row_32_native; |
727 | #else | 728 | #else |
728 | ctx.output_row = output_row_native; | 729 | ctx.output_row = output_row_32_native; |
729 | #endif | 730 | #endif |
730 | if (format) | 731 | if (format) |
731 | #endif | 732 | #endif |
732 | #if defined(HAVE_LCD_COLOR) && (defined(HAVE_JPEG) || defined(PLUGIN)) | 733 | #if defined(HAVE_LCD_COLOR) && (defined(HAVE_JPEG) || defined(PLUGIN)) |
733 | ctx.output_row = format->output_row[format_index]; | 734 | ctx.output_row = format->output_row_32[format_index]; |
734 | #else | 735 | #else |
735 | ctx.output_row = format->output_row; | 736 | ctx.output_row = format->output_row_32; |
736 | #endif | 737 | #endif |
737 | #ifdef HAVE_UPSCALER | 738 | #ifdef HAVE_UPSCALER |
738 | if (sw > dw) | 739 | if (sw > dw) |