Mercurial > libavcodec.hg
comparison imgconvert.c @ 1057:bb5de8a59da8 libavcodec
* static,const,compiler warning cleanup
author | kabi |
---|---|
date | Mon, 10 Feb 2003 09:35:32 +0000 |
parents | 6261fdd1f69d |
children | b32afefe7d33 |
comparison
equal
deleted
inserted
replaced
1056:eb403f8158eb | 1057:bb5de8a59da8 |
---|---|
737 | 737 |
738 /* rgb555 handling */ | 738 /* rgb555 handling */ |
739 | 739 |
740 #define RGB_IN(r, g, b, s)\ | 740 #define RGB_IN(r, g, b, s)\ |
741 {\ | 741 {\ |
742 unsigned int v = ((UINT16 *)(s))[0];\ | 742 unsigned int v = ((const UINT16 *)(s))[0];\ |
743 r = bitcopy_n(v >> (10 - 3), 3);\ | 743 r = bitcopy_n(v >> (10 - 3), 3);\ |
744 g = bitcopy_n(v >> (5 - 3), 3);\ | 744 g = bitcopy_n(v >> (5 - 3), 3);\ |
745 b = bitcopy_n(v << 3, 3);\ | 745 b = bitcopy_n(v << 3, 3);\ |
746 } | 746 } |
747 | 747 |
760 | 760 |
761 /* rgb565 handling */ | 761 /* rgb565 handling */ |
762 | 762 |
763 #define RGB_IN(r, g, b, s)\ | 763 #define RGB_IN(r, g, b, s)\ |
764 {\ | 764 {\ |
765 unsigned int v = ((UINT16 *)(s))[0];\ | 765 unsigned int v = ((const UINT16 *)(s))[0];\ |
766 r = bitcopy_n(v >> (11 - 3), 3);\ | 766 r = bitcopy_n(v >> (11 - 3), 3);\ |
767 g = bitcopy_n(v >> (5 - 2), 2);\ | 767 g = bitcopy_n(v >> (5 - 2), 2);\ |
768 b = bitcopy_n(v << 3, 3);\ | 768 b = bitcopy_n(v << 3, 3);\ |
769 } | 769 } |
770 | 770 |
831 | 831 |
832 /* rgba32 handling */ | 832 /* rgba32 handling */ |
833 | 833 |
834 #define RGB_IN(r, g, b, s)\ | 834 #define RGB_IN(r, g, b, s)\ |
835 {\ | 835 {\ |
836 unsigned int v = ((UINT32 *)(s))[0];\ | 836 unsigned int v = ((const UINT32 *)(s))[0];\ |
837 r = (v >> 16) & 0xff;\ | 837 r = (v >> 16) & 0xff;\ |
838 g = (v >> 8) & 0xff;\ | 838 g = (v >> 8) & 0xff;\ |
839 b = v & 0xff;\ | 839 b = v & 0xff;\ |
840 } | 840 } |
841 | 841 |
1227 }; | 1227 }; |
1228 | 1228 |
1229 static int avpicture_alloc(AVPicture *picture, | 1229 static int avpicture_alloc(AVPicture *picture, |
1230 int pix_fmt, int width, int height) | 1230 int pix_fmt, int width, int height) |
1231 { | 1231 { |
1232 int size; | 1232 unsigned int size; |
1233 void *ptr; | 1233 void *ptr; |
1234 | 1234 |
1235 size = avpicture_get_size(pix_fmt, width, height); | 1235 size = avpicture_get_size(pix_fmt, width, height); |
1236 if (size < 0) | 1236 if (size < 0) |
1237 goto fail; | 1237 goto fail; |