[FFmpeg-devel] [PATCH] avcodec/dpxenc: store frame rate

Michael Niedermayer michaelni at gmx.at
Fri Apr 25 23:25:02 CEST 2014


Fixes part of Ticket3511

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavcodec/dpxenc.c |    6 +++++-
 tests/ref/lavf/dpx  |   24 ++++++++++++------------
 2 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c
index 0eb1297..4ca5d89 100644
--- a/libavcodec/dpxenc.c
+++ b/libavcodec/dpxenc.c
@@ -170,7 +170,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     int size, ret;
     uint8_t *buf;
 
-#define HEADER_SIZE 1664  /* DPX Generic header */
+#define HEADER_SIZE 1920  /* DPX Generic header */
     if (s->bits_per_component == 10)
         size = avctx->height * avctx->width * 4;
     else
@@ -208,6 +208,10 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     write32(buf + 1628, avctx->sample_aspect_ratio.num);
     write32(buf + 1632, avctx->sample_aspect_ratio.den);
 
+    /* Motion-picture film information header */
+    if (avctx->time_base.num > 0)
+        write32(buf + 1724, av_float2int(av_q2d(av_inv_q(avctx->time_base))));
+
     switch(s->bits_per_component) {
     case 8:
     case 16:
diff --git a/tests/ref/lavf/dpx b/tests/ref/lavf/dpx
index 591ef1b..bee5cec 100644
--- a/tests/ref/lavf/dpx
+++ b/tests/ref/lavf/dpx
@@ -1,18 +1,18 @@
-4c8880d5835ffb5fe37c1ed8c8d404de *./tests/data/images/dpx/02.dpx
+67c3b48b54679550d366980cda77a5f3 *./tests/data/images/dpx/02.dpx
 ./tests/data/images/dpx/%02d.dpx CRC=0x6da01946
-305792 ./tests/data/images/dpx/02.dpx
-16d65ceaa127806dc7ede9391fe80872 *./tests/data/images/dpx/02.dpx
+306048 ./tests/data/images/dpx/02.dpx
+caf30c76ee389b74975d48e6c7362636 *./tests/data/images/dpx/02.dpx
 ./tests/data/images/dpx/%02d.dpx CRC=0x22dcc7a8
-407168 ./tests/data/images/dpx/02.dpx
-02b4fd859d944075905e84e9f389bf23 *./tests/data/images/dpx/02.dpx
+407424 ./tests/data/images/dpx/02.dpx
+a1dbcc9d0b50e223ddff2267418a7a1b *./tests/data/images/dpx/02.dpx
 ./tests/data/images/dpx/%02d.dpx CRC=0x964b87ba
-609920 ./tests/data/images/dpx/02.dpx
-075963c3c08978b6a20555ba09161434 *./tests/data/images/dpx/02.dpx
+610176 ./tests/data/images/dpx/02.dpx
+655785f3ac62a89d87bbb4bd995a8606 *./tests/data/images/dpx/02.dpx
 ./tests/data/images/dpx/%02d.dpx CRC=0xe5b9c023
-609920 ./tests/data/images/dpx/02.dpx
-b9f22728f8ff393bf30cf6cbd624fa95 *./tests/data/images/dpx/02.dpx
+610176 ./tests/data/images/dpx/02.dpx
+8c994b3c6e8285db15af5e465815387c *./tests/data/images/dpx/02.dpx
 ./tests/data/images/dpx/%02d.dpx CRC=0xf38d5830
-407168 ./tests/data/images/dpx/02.dpx
-545603630f30dec2768c8ae8d12eb8ea *./tests/data/images/dpx/02.dpx
+407424 ./tests/data/images/dpx/02.dpx
+d5a8e18af7a769e41babc16475850c65 *./tests/data/images/dpx/02.dpx
 ./tests/data/images/dpx/%02d.dpx CRC=0xe72ce131
-812672 ./tests/data/images/dpx/02.dpx
+812928 ./tests/data/images/dpx/02.dpx
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list