[FFmpeg-cvslog] Make targa-in-mov QuickTime-compatible for more colour-spaces.

Carl Eugen Hoyos git at videolan.org
Thu Apr 19 18:32:30 CEST 2012


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Thu Apr 19 17:29:17 2012 +0200| [ab75ad0116b4dfbab640b93833192fb1095bc83e] | committer: Carl Eugen Hoyos

Make targa-in-mov QuickTime-compatible for more colour-spaces.

See ticket #1228.

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

 libavcodec/targaenc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c
index a80053b..833b563 100644
--- a/libavcodec/targaenc.c
+++ b/libavcodec/targaenc.c
@@ -96,13 +96,16 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     /* image descriptor byte: origin is always top-left, bits 0-3 specify alpha */
     pkt->data[17] = 0x20 | (avctx->pix_fmt == PIX_FMT_BGRA ? 8 : 0);
 
+    avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]);
     switch(avctx->pix_fmt) {
     case PIX_FMT_GRAY8:
         pkt->data[2]  = TGA_BW;     /* uncompressed grayscale image */
+        avctx->bits_per_coded_sample = 0x28;
         pkt->data[16] = 8;          /* bpp */
         break;
     case PIX_FMT_RGB555LE:
         pkt->data[2]  = TGA_RGB;    /* uncompresses true-color image */
+        avctx->bits_per_coded_sample =
         pkt->data[16] = 16;         /* bpp */
         break;
     case PIX_FMT_BGR24:



More information about the ffmpeg-cvslog mailing list