[FFmpeg-cvslog] Support decoding of targa files with 32bit palette.

Carl Eugen Hoyos git at videolan.org
Tue Oct 9 02:01:08 CEST 2012


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Tue Oct  9 01:58:48 2012 +0200| [b49d94e4f25e22c613eb767d72b053e77d6319bc] | committer: Carl Eugen Hoyos

Support decoding of targa files with 32bit palette.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b49d94e4f25e22c613eb767d72b053e77d6319bc
---

 libavcodec/targa.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/targa.c b/libavcodec/targa.c
index e0c1936..8cef685 100644
--- a/libavcodec/targa.c
+++ b/libavcodec/targa.c
@@ -181,6 +181,7 @@ static int decode_frame(AVCodecContext *avctx,
             return -1;
         }
         switch (csize) {
+        case 32: pal_sample_size = 4; break;
         case 24: pal_sample_size = 3; break;
         case 16:
         case 15: pal_sample_size = 2; break;
@@ -201,6 +202,10 @@ static int decode_frame(AVCodecContext *avctx,
                 return AVERROR_INVALIDDATA;
             }
             switch (pal_sample_size) {
+            case 4:
+                for (t = 0; t < colors; t++)
+                    *pal++ = bytestream2_get_le32u(&s->gb);
+                break;
             case 3:
                 /* RGB24 */
                 for (t = 0; t < colors; t++)



More information about the ffmpeg-cvslog mailing list