Mercurial > libavcodec.hg
comparison 8bps.c @ 4494:ce643a22f049 libavcodec
Replace deprecated PIX_FMT names by the newer variants.
author | diego |
---|---|
date | Wed, 07 Feb 2007 01:48:09 +0000 |
parents | f97a2081b5b1 |
children | 66ef3690d108 |
comparison
equal
deleted
inserted
replaced
4493:e78c415815f3 | 4494:ce643a22f049 |
---|---|
25 * QT 8BPS Video Decoder by Roberto Togni <rtogni at bresciaonline dot it> | 25 * QT 8BPS Video Decoder by Roberto Togni <rtogni at bresciaonline dot it> |
26 * For more information about the 8BPS format, visit: | 26 * For more information about the 8BPS format, visit: |
27 * http://www.pcisys.net/~melanson/codecs/ | 27 * http://www.pcisys.net/~melanson/codecs/ |
28 * | 28 * |
29 * Supports: PAL8 (RGB 8bpp, paletted) | 29 * Supports: PAL8 (RGB 8bpp, paletted) |
30 * : BGR24 (RGB 24bpp) (can also output it as RGBA32) | 30 * : BGR24 (RGB 24bpp) (can also output it as RGB32) |
31 * : RGBA32 (RGB 32bpp, 4th plane is probably alpha and it's ignored) | 31 * : RGB32 (RGB 32bpp, 4th plane is probably alpha and it's ignored) |
32 * | 32 * |
33 */ | 33 */ |
34 | 34 |
35 #include <stdio.h> | 35 #include <stdio.h> |
36 #include <stdlib.h> | 36 #include <stdlib.h> |
37 | 37 |
38 #include "common.h" | 38 #include "common.h" |
39 #include "avcodec.h" | 39 #include "avcodec.h" |
40 | 40 |
41 | 41 |
42 static const enum PixelFormat pixfmt_rgb24[] = {PIX_FMT_BGR24, PIX_FMT_RGBA32, -1}; | 42 static const enum PixelFormat pixfmt_rgb24[] = {PIX_FMT_BGR24, PIX_FMT_RGB32, -1}; |
43 | 43 |
44 /* | 44 /* |
45 * Decoder context | 45 * Decoder context |
46 */ | 46 */ |
47 typedef struct EightBpsContext { | 47 typedef struct EightBpsContext { |
87 | 87 |
88 /* Ignore alpha plane, don't know what to do with it */ | 88 /* Ignore alpha plane, don't know what to do with it */ |
89 if (planes == 4) | 89 if (planes == 4) |
90 planes--; | 90 planes--; |
91 | 91 |
92 px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGBA32); | 92 px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32); |
93 | 93 |
94 for (p = 0; p < planes; p++) { | 94 for (p = 0; p < planes; p++) { |
95 /* Lines length pointer for this plane */ | 95 /* Lines length pointer for this plane */ |
96 lp = encoded + p * (height << 1); | 96 lp = encoded + p * (height << 1); |
97 | 97 |
179 c->planemap[0] = 2; // 1st plane is red | 179 c->planemap[0] = 2; // 1st plane is red |
180 c->planemap[1] = 1; // 2nd plane is green | 180 c->planemap[1] = 1; // 2nd plane is green |
181 c->planemap[2] = 0; // 3rd plane is blue | 181 c->planemap[2] = 0; // 3rd plane is blue |
182 break; | 182 break; |
183 case 32: | 183 case 32: |
184 avctx->pix_fmt = PIX_FMT_RGBA32; | 184 avctx->pix_fmt = PIX_FMT_RGB32; |
185 c->planes = 4; | 185 c->planes = 4; |
186 #ifdef WORDS_BIGENDIAN | 186 #ifdef WORDS_BIGENDIAN |
187 c->planemap[0] = 1; // 1st plane is red | 187 c->planemap[0] = 1; // 1st plane is red |
188 c->planemap[1] = 2; // 2nd plane is green | 188 c->planemap[1] = 2; // 2nd plane is green |
189 c->planemap[2] = 3; // 3rd plane is blue | 189 c->planemap[2] = 3; // 3rd plane is blue |