[FFmpeg-soc] [soc]: r4576 - in spdif: spdif.c todo

bwolowiec subversion at mplayerhq.hu
Fri Jul 3 21:10:50 CEST 2009


Author: bwolowiec
Date: Fri Jul  3 21:10:50 2009
New Revision: 4576

Log:
Add support for 14bit and LE dts

Modified:
   spdif/spdif.c
   spdif/todo

Modified: spdif/spdif.c
==============================================================================
--- spdif/spdif.c	Thu Jul  2 22:14:05 2009	(r4575)
+++ spdif/spdif.c	Fri Jul  3 21:10:50 2009	(r4576)
@@ -62,11 +62,23 @@ static int spdif_header_dts(AVFormatCont
     uint32_t syncword_dts = (pkt->data[0] << 24) | (pkt->data[1]<<16) | (pkt->data[2]<<8) | pkt->data[3];
     int samples;
 
-    if(syncword_dts != DCA_MARKER_RAW_BE){
-        av_log(NULL, AV_LOG_ERROR, "bad DTS syncword\n");
-        return -1;
+    switch(syncword_dts){
+        case DCA_MARKER_RAW_BE:
+            samples = ((((pkt->data[4] & 0x01) << 6) | (pkt->data[5] >> 2)) + 1) << 5;
+            break;
+        case DCA_MARKER_RAW_LE:
+            samples = ((((pkt->data[5] & 0x01) << 6) | (pkt->data[4] >> 2)) + 1) << 5;
+            break;
+        case DCA_MARKER_14B_BE:
+            samples = ((((pkt->data[5] & 0x07) << 4) | (pkt->data[6] & 0x3f)) >> 2) << 5;
+            break;
+        case DCA_MARKER_14B_LE:
+            samples = ((((pkt->data[4] & 0x07) << 4) | (pkt->data[7] & 0x3f)) >> 2) << 5;
+            break;
+        default:
+            av_log(NULL, AV_LOG_ERROR, "bad DTS syncword\n");
+            return -1;
     }
-    samples = ((((pkt->data[4] & 0x01) << 6) | (pkt->data[5] >> 2)) + 1) << 5; // :)
     av_log(NULL, AV_LOG_DEBUG, "samples=%i\n", samples);
     switch(samples){
         case 512:

Modified: spdif/todo
==============================================================================
--- spdif/todo	Thu Jul  2 22:14:05 2009	(r4575)
+++ spdif/todo	Fri Jul  3 21:10:50 2009	(r4576)
@@ -4,9 +4,6 @@
                Broadway-5.1-48khz-448kbit.ac3 and FFmpeg AC3 encoder
 -test DTS - tested with (only RAW_BE version) 5.1 24bit.dts, ES 6.1 - 5.1 16bit.dts and FFmpeg DCA encoder
 
--add support for little-endian DTS
--add support for 14-bit DTS
-
 -add support for mpeg
 -add support for wma
 -add support for aac


More information about the FFmpeg-soc mailing list