[FFmpeg-devel] [PATCH]Read 64bit dpx files

Carl Eugen Hoyos cehoyos at ag.or.at
Thu Jan 12 01:52:05 CET 2012


Hi!

Attached patch allows to read 64bit dpx files, and I can encode them to pam.
If it is correct, the tiff patch is wrong, because encoding to tiff fails on 
BE (produces a wrong file).

Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index e8dae30..8a30ca6 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -140,11 +140,11 @@ static int decode_frame(AVCodecContext *avctx,
         case 12:
         case 16:
             if (endian) {
-                avctx->pix_fmt = PIX_FMT_RGB48BE;
+                avctx->pix_fmt = elements == 4 ? PIX_FMT_RGBA64BE : PIX_FMT_RGB48BE;
             } else {
-                avctx->pix_fmt = PIX_FMT_RGB48LE;
+                avctx->pix_fmt = elements == 4 ? PIX_FMT_RGBA64LE : PIX_FMT_RGB48LE;
             }
-            target_packet_size = 6;
+            target_packet_size =
             source_packet_size = elements * 2;
             break;
         default:


More information about the ffmpeg-devel mailing list