[FFmpeg-devel] [PATCH 5/5] iff demuxer: include DEEP TVDC lookup table in extradata buffer

Peter Ross pross at xvid.org
Sun Nov 25 05:31:21 CET 2012


Signed-off-by: Peter Ross <pross at xvid.org>
---
 libavformat/iff.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavformat/iff.c b/libavformat/iff.c
index fbd0a0d..ebfa6a7 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -64,6 +64,7 @@
 #define ID_DBOD       MKTAG('D','B','O','D')
 #define ID_DPEL       MKTAG('D','P','E','L')
 #define ID_DLOC       MKTAG('D','L','O','C')
+#define ID_TVDC       MKTAG('T','V','D','C')
 
 #define LEFT    2
 #define RIGHT   4
@@ -77,7 +78,7 @@
  * set it to smallest possible size of 2 to indicate that there's
  * no extradata changing in this frame.
  */
-#define IFF_EXTRA_VIDEO_SIZE 9
+#define IFF_EXTRA_VIDEO_SIZE 41
 
 typedef enum {
     COMP_NONE,
@@ -96,6 +97,7 @@ typedef struct {
     unsigned  flags;        ///< 1 for EHB, 0 is no extra half darkening
     unsigned  transparency; ///< transparency color index in palette
     unsigned  masking;      ///< masking method used
+    uint8_t   tvdc[32];     ///< TVDC lookup table
 } IffDemuxContext;
 
 /* Metadata string read */
@@ -279,6 +281,13 @@ static int iff_read_header(AVFormatContext *s)
             st->codec->height = avio_rb16(pb);
             break;
 
+        case ID_TVDC:
+            if (data_size < sizeof(iff->tvdc))
+                return AVERROR_INVALIDDATA;
+            if ((res = avio_read(pb, iff->tvdc, sizeof(iff->tvdc))) < 0)
+                return res;
+            break;
+
         case ID_ANNO:
         case ID_TEXT:      metadata_tag = "comment";   break;
         case ID_AUTH:      metadata_tag = "artist";    break;
@@ -346,6 +355,7 @@ static int iff_read_header(AVFormatContext *s)
         bytestream_put_byte(&buf, iff->flags);
         bytestream_put_be16(&buf, iff->transparency);
         bytestream_put_byte(&buf, iff->masking);
+        bytestream_put_buffer(&buf, iff->tvdc, sizeof(iff->tvdc));
         st->codec->codec_id = AV_CODEC_ID_IFF_ILBM;
         break;
     default:
-- 
1.8.0

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20121125/0e370eaa/attachment.asc>


More information about the ffmpeg-devel mailing list