Browse code

Merge remote-tracking branch 'qatar/master'

* qatar/master:
movenc: Rudimentary IODs support.
v410enc: fix output buffer size check
v410enc: include correct headers
fate: add -pix_fmt rgb48le to r210 test
flvenc: Support muxing 16 kHz nellymoser
configure: refactor list of programs into a variable
fate: add r210 decoder test
fate: split off Indeo FATE tests into their own file
fate: split off ATRAC FATE tests into their own file
fate: Add FATE tests for v410 encoder and decoder
ARM: fix external symbol refs in rv40 asm
westwood: Make sure audio header info is present when parsing audio packets
libgsm: Reset the MS mode of GSM in the flush function
libgsm: Set options on the right object
ARM: dca: disable optimised decode_blockcodes() for old gcc

Conflicts:
configure
libavformat/movenc.c
libavformat/movenc.h
tests/fate2.mak
tests/ref/acodec/alac
tests/ref/vsynth1/mpeg4
tests/ref/vsynth2/mpeg4

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2011/12/16 09:23:15
Showing 18 changed files
... ...
@@ -978,8 +978,17 @@ COMPONENT_LIST="
978 978
     protocols
979 979
 "
980 980
 
981
+PROGRAM_LIST="
982
+    avconv
983
+    ffplay
984
+    ffprobe
985
+    ffserver
986
+    ffmpeg
987
+"
988
+
981 989
 CONFIG_LIST="
982 990
     $COMPONENT_LIST
991
+    $PROGRAM_LIST
983 992
     aandct
984 993
     ac3dsp
985 994
     avcodec
... ...
@@ -994,11 +1003,6 @@ CONFIG_LIST="
994 994
     dwt
995 995
     dxva2
996 996
     fastdiv
997
-    ffmpeg
998
-    avconv
999
-    ffplay
1000
-    ffprobe
1001
-    ffserver
1002 997
     fft
1003 998
     frei0r
1004 999
     gnutls
... ...
@@ -1790,6 +1794,8 @@ target_os_default=$(tolower $(uname -s))
1790 1790
 host_os=$target_os_default
1791 1791
 
1792 1792
 # configurable options
1793
+enable $PROGRAM_LIST
1794
+
1793 1795
 enable avcodec
1794 1796
 enable avdevice
1795 1797
 enable avfilter
... ...
@@ -1800,11 +1806,6 @@ enable stripping
1800 1800
 enable swresample
1801 1801
 enable swscale
1802 1802
 
1803
-enable ffmpeg
1804
-enable ffplay
1805
-enable ffprobe
1806
-enable ffserver
1807
-
1808 1803
 enable asm
1809 1804
 enable debug
1810 1805
 enable doc
... ...
@@ -25,7 +25,7 @@
25 25
 #include "config.h"
26 26
 #include "libavutil/intmath.h"
27 27
 
28
-#if HAVE_ARMV6 && HAVE_INLINE_ASM
28
+#if HAVE_ARMV6 && HAVE_INLINE_ASM && AV_GCC_VERSION_AT_LEAST(4,4)
29 29
 
30 30
 #define decode_blockcodes decode_blockcodes
31 31
 static inline int decode_blockcodes(int code1, int code2, int levels,
... ...
@@ -372,7 +372,7 @@ endfunc
372 372
 
373 373
 function ff_\type\()_rv40_qpel8_mc33_neon, export=1
374 374
         mov             r3,  #8
375
-        b               ff_\type\()_pixels8_xy2_neon
375
+        b               X(ff_\type\()_pixels8_xy2_neon)
376 376
 endfunc
377 377
 
378 378
 function ff_\type\()_rv40_qpel8_mc13_neon, export=1
... ...
@@ -652,7 +652,7 @@ endfunc
652 652
 
653 653
 function ff_\type\()_rv40_qpel16_mc33_neon, export=1
654 654
         mov             r3,  #16
655
-        b               ff_\type\()_pixels16_xy2_neon
655
+        b               X(ff_\type\()_pixels16_xy2_neon)
656 656
 endfunc
657 657
 .endm
658 658
 
... ...
@@ -155,7 +155,7 @@ static av_cold int libgsm_decode_init(AVCodecContext *avctx) {
155 155
         break;
156 156
     case CODEC_ID_GSM_MS: {
157 157
         int one = 1;
158
-        gsm_option(avctx->priv_data, GSM_OPT_WAV49, &one);
158
+        gsm_option(s->state, GSM_OPT_WAV49, &one);
159 159
         avctx->frame_size  = 2 * GSM_FRAME_SIZE;
160 160
         avctx->block_align = GSM_MS_BLOCK_SIZE;
161 161
         }
... ...
@@ -212,9 +212,12 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data,
212 212
 
213 213
 static void libgsm_flush(AVCodecContext *avctx) {
214 214
     LibGSMDecodeContext *s = avctx->priv_data;
215
+    int one = 1;
215 216
 
216 217
     gsm_destroy(s->state);
217 218
     s->state = gsm_create();
219
+    if (avctx->codec_id == CODEC_ID_GSM_MS)
220
+        gsm_option(s->state, GSM_OPT_WAV49, &one);
218 221
 }
219 222
 
220 223
 AVCodec ff_libgsm_decoder = {
... ...
@@ -20,8 +20,8 @@
20 20
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 21
  */
22 22
 
23
+#include "libavutil/intreadwrite.h"
23 24
 #include "avcodec.h"
24
-#include "put_bits.h"
25 25
 
26 26
 static av_cold int v410_encode_init(AVCodecContext *avctx)
27 27
 {
... ...
@@ -50,7 +50,7 @@ static int v410_encode_frame(AVCodecContext *avctx, uint8_t *buf,
50 50
     int i, j;
51 51
     int output_size = 0;
52 52
 
53
-    if (buf_size < avctx->width * avctx->height * 3) {
53
+    if (buf_size < avctx->width * avctx->height * 4) {
54 54
         av_log(avctx, AV_LOG_ERROR, "Out buffer is too small.\n");
55 55
         return AVERROR(ENOMEM);
56 56
     }
... ...
@@ -93,6 +93,7 @@ static int get_audio_flags(AVCodecContext *enc){
93 93
         case    11025:
94 94
             flags |= FLV_SAMPLERATE_11025HZ;
95 95
             break;
96
+        case    16000: //nellymoser only
96 97
         case     8000: //nellymoser only
97 98
         case     5512: //not mp3
98 99
             if(enc->codec_id != CODEC_ID_MP3){
... ...
@@ -128,6 +129,8 @@ static int get_audio_flags(AVCodecContext *enc){
128 128
     case CODEC_ID_NELLYMOSER:
129 129
         if (enc->sample_rate == 8000) {
130 130
             flags |= FLV_CODECID_NELLYMOSER_8KHZ_MONO | FLV_SAMPLESSIZE_16BIT;
131
+        } else if (enc->sample_rate == 16000) {
132
+            flags |= FLV_CODECID_NELLYMOSER_16KHZ_MONO | FLV_SAMPLESSIZE_16BIT;
131 133
         } else {
132 134
             flags |= FLV_CODECID_NELLYMOSER | FLV_SAMPLESSIZE_16BIT;
133 135
         }
... ...
@@ -49,6 +49,9 @@ static const AVOption options[] = {
49 49
     { "frag_size", "maximum fragment size", offsetof(MOVMuxContext, max_fragment_size), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 0 },
50 50
     { "frag_duration", "maximum fragment duration", offsetof(MOVMuxContext, max_fragment_duration), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 0 },
51 51
     FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
52
+    { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
53
+    { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM},
54
+    { "iods_video_profile", "iods video profile atom.", offsetof(MOVMuxContext, iods_video_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM},
52 55
     { NULL },
53 56
 };
54 57
 
... ...
@@ -1489,21 +1492,34 @@ static int mov_write_traf_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
1489 1489
     return updateSize(pb, pos);
1490 1490
 }
1491 1491
 
1492
-#if 0
1493
-/* TODO: Not sorted out, but not necessary either */
1494 1492
 static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov)
1495 1493
 {
1496
-    avio_wb32(pb, 0x15); /* size */
1494
+    int i, has_audio = 0, has_video = 0;
1495
+    int64_t pos = avio_tell(pb);
1496
+    int audio_profile = mov->iods_audio_profile;
1497
+    int video_profile = mov->iods_video_profile;
1498
+    for (i = 0; i < mov->nb_streams; i++) {
1499
+        if(mov->tracks[i].entry > 0) {
1500
+            has_audio |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_AUDIO;
1501
+            has_video |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_VIDEO;
1502
+        }
1503
+    }
1504
+    if (audio_profile < 0)
1505
+        audio_profile = 0xFF - has_audio;
1506
+    if (video_profile < 0)
1507
+        video_profile = 0xFF - has_video;
1508
+    avio_wb32(pb, 0x0); /* size */
1497 1509
     ffio_wfourcc(pb, "iods");
1498 1510
     avio_wb32(pb, 0);    /* version & flags */
1499
-    avio_wb16(pb, 0x1007);
1500
-    avio_w8(pb, 0);
1501
-    avio_wb16(pb, 0x4fff);
1502
-    avio_wb16(pb, 0xfffe);
1503
-    avio_wb16(pb, 0x01ff);
1504
-    return 0x15;
1511
+    putDescr(pb, 0x10, 7);
1512
+    avio_wb16(pb, 0x004f);
1513
+    avio_w8(pb, 0xff);
1514
+    avio_w8(pb, 0xff);
1515
+    avio_w8(pb, audio_profile);
1516
+    avio_w8(pb, video_profile);
1517
+    avio_w8(pb, 0xff);
1518
+    return updateSize(pb, pos);
1505 1519
 }
1506
-#endif
1507 1520
 
1508 1521
 static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
1509 1522
 {
... ...
@@ -1968,7 +1984,8 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov,
1968 1968
     }
1969 1969
 
1970 1970
     mov_write_mvhd_tag(pb, mov);
1971
-    //mov_write_iods_tag(pb, mov);
1971
+    if (mov->mode != MODE_MOV && !mov->iods_skip)
1972
+        mov_write_iods_tag(pb, mov);
1972 1973
     for (i=0; i<mov->nb_streams; i++) {
1973 1974
         if(mov->tracks[i].entry > 0) {
1974 1975
             mov_write_trak_tag(pb, mov, &(mov->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL);
... ...
@@ -125,6 +125,10 @@ typedef struct MOVMuxContext {
125 125
     int64_t reserved_moov_pos;
126 126
     int max_fragment_duration;
127 127
     int max_fragment_size;
128
+
129
+    int iods_skip;
130
+    int iods_video_profile;
131
+    int iods_audio_profile;
128 132
 } MOVMuxContext;
129 133
 
130 134
 #define FF_MOV_FLAG_RTP_HINT 1
... ...
@@ -331,6 +331,11 @@ static int wsvqa_read_packet(AVFormatContext *s,
331 331
 
332 332
         skip_byte = chunk_size & 0x01;
333 333
 
334
+        if ((chunk_type == SND2_TAG || chunk_type == SND1_TAG) && wsvqa->audio_channels == 0) {
335
+            av_log(s, AV_LOG_ERROR, "audio chunk without any audio header information found\n");
336
+            return AVERROR_INVALIDDATA;
337
+        }
338
+
334 339
         if ((chunk_type == SND1_TAG) || (chunk_type == SND2_TAG) || (chunk_type == VQFR_TAG)) {
335 340
 
336 341
             ret= av_get_packet(pb, pkt, chunk_size);
... ...
@@ -48,10 +48,12 @@ include $(SRC_PATH)/tests/fate/ac3.mak
48 48
 include $(SRC_PATH)/tests/fate/als.mak
49 49
 include $(SRC_PATH)/tests/fate/amrnb.mak
50 50
 include $(SRC_PATH)/tests/fate/amrwb.mak
51
+include $(SRC_PATH)/tests/fate/atrac.mak
51 52
 include $(SRC_PATH)/tests/fate/dct.mak
52 53
 include $(SRC_PATH)/tests/fate/fft.mak
53 54
 include $(SRC_PATH)/tests/fate/h264.mak
54 55
 include $(SRC_PATH)/tests/fate/image.mak
56
+include $(SRC_PATH)/tests/fate/indeo.mak
55 57
 include $(SRC_PATH)/tests/fate/libavutil.mak
56 58
 include $(SRC_PATH)/tests/fate/mapchan.mak
57 59
 include $(SRC_PATH)/tests/fate/lossless-audio.mak
... ...
@@ -126,12 +126,6 @@ FATE_TESTS += fate-iff-ilbm
126 126
 fate-iff-ilbm: CMD = framecrc  -i $(SAMPLES)/iff/lms-matriks.ilbm -pix_fmt rgb24
127 127
 FATE_TESTS += fate-iff-pcm
128 128
 fate-iff-pcm: CMD = md5  -i $(SAMPLES)/iff/Bells -f s16le
129
-FATE_TESTS += fate-indeo2
130
-fate-indeo2: CMD = framecrc  -i $(SAMPLES)/rt21/VPAR0026.AVI
131
-FATE_TESTS += fate-indeo3
132
-fate-indeo3: CMD = framecrc  -i $(SAMPLES)/iv32/cubes.mov
133
-FATE_TESTS += fate-indeo5
134
-fate-indeo5: CMD = framecrc  -i $(SAMPLES)/iv50/Educ_Movie_DeadlyForce.avi -an
135 129
 FATE_TESTS += fate-interplay-mve-16bit
136 130
 fate-interplay-mve-16bit: CMD = framecrc  -i $(SAMPLES)/interplay-mve/descent3-level5-16bit-partial.mve -pix_fmt rgb24
137 131
 FATE_TESTS += fate-interplay-mve-8bit
138 132
new file mode 100644
... ...
@@ -0,0 +1,19 @@
0
+FATE_TESTS += fate-atrac1
1
+fate-atrac1: CMD = pcm -i $(SAMPLES)/atrac1/test_tones_small.aea
2
+fate-atrac1: CMP = oneoff
3
+fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm
4
+
5
+FATE_TESTS += fate-atrac3-1
6
+fate-atrac3-1: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_066_small.wav
7
+fate-atrac3-1: CMP = oneoff
8
+fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm
9
+
10
+FATE_TESTS += fate-atrac3-2
11
+fate-atrac3-2: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_105_small.wav
12
+fate-atrac3-2: CMP = oneoff
13
+fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm
14
+
15
+FATE_TESTS += fate-atrac3-3
16
+fate-atrac3-3: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_132_small.wav
17
+fate-atrac3-3: CMP = oneoff
18
+fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm
0 19
new file mode 100644
... ...
@@ -0,0 +1,8 @@
0
+FATE_TESTS += fate-indeo2
1
+fate-indeo2: CMD = framecrc -i $(SAMPLES)/rt21/VPAR0026.AVI
2
+
3
+FATE_TESTS += fate-indeo3
4
+fate-indeo3: CMD = framecrc -i $(SAMPLES)/iv32/cubes.mov
5
+
6
+FATE_TESTS += fate-indeo5
7
+fate-indeo5: CMD = framecrc -i $(SAMPLES)/iv50/Educ_Movie_DeadlyForce.avi -an
... ...
@@ -40,26 +40,6 @@ fate-truespeech: CMD = pcm -i $(SAMPLES)/truespeech/a6.wav
40 40
 fate-truespeech: CMP = oneoff
41 41
 fate-truespeech: REF = $(SAMPLES)/truespeech/a6.pcm
42 42
 
43
-FATE_TESTS += fate-atrac1
44
-fate-atrac1: CMD = pcm -i $(SAMPLES)/atrac1/test_tones_small.aea
45
-fate-atrac1: CMP = oneoff
46
-fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm
47
-
48
-FATE_TESTS += fate-atrac3-1
49
-fate-atrac3-1: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_066_small.wav
50
-fate-atrac3-1: CMP = oneoff
51
-fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm
52
-
53
-FATE_TESTS += fate-atrac3-2
54
-fate-atrac3-2: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_105_small.wav
55
-fate-atrac3-2: CMP = oneoff
56
-fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm
57
-
58
-FATE_TESTS += fate-atrac3-3
59
-fate-atrac3-3: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_132_small.wav
60
-fate-atrac3-3: CMP = oneoff
61
-fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm
62
-
63 43
 FATE_TESTS += fate-gsm
64 44
 fate-gsm: CMD = framecrc -i $(SAMPLES)/gsm/sample-gsm-8000.mov -t 10
65 45
 
... ...
@@ -132,3 +112,6 @@ fate-v410dec: CMD = framecrc -i $(SAMPLES)/v410/lenav410.mov -pix_fmt yuv444p10l
132 132
 FATE_TESTS += fate-v410enc
133 133
 fate-v410enc: tests/vsynth1/00.pgm
134 134
 fate-v410enc: CMD = md5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -flags +bitexact -vcodec v410 -f avi
135
+
136
+FATE_TESTS += fate-r210
137
+fate-r210: CMD = framecrc -i $(SAMPLES)/r210/r210.avi -pix_fmt rgb48le
... ...
@@ -1,4 +1,4 @@
1
-4fe333ff79e86cca6ba8c109cc08263e *./tests/data/acodec/alac.m4a
2
-389166 ./tests/data/acodec/alac.m4a
1
+bff6044a7f303d8482775f4fcdc2d272 *./tests/data/acodec/alac.m4a
2
+389190 ./tests/data/acodec/alac.m4a
3 3
 64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/alac.acodec.out.wav
4 4
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
5 5
new file mode 100644
... ...
@@ -0,0 +1,3 @@
0
+0, 0, 1843200, 0xbd414b93
1
+0, 3003, 1843200, 0x23298f1f
2
+0, 6006, 1843200, 0x5a56df19
... ...
@@ -1,4 +1,4 @@
1
-f32960be0f05be8b2ed03447e1eaea6f *./tests/data/vsynth1/odivx.mp4
2
-539996 ./tests/data/vsynth1/odivx.mp4
1
+146bf838d7efd524595c68145337dfef *./tests/data/vsynth1/odivx.mp4
2
+540020 ./tests/data/vsynth1/odivx.mp4
3 3
 8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv
4 4
 stddev:    7.97 PSNR: 30.10 MAXDIFF:  105 bytes:  7603200/  7603200
... ...
@@ -1,4 +1,4 @@
1
-4d092ca067362a61b9c96f5f12a1ab5a *./tests/data/vsynth2/odivx.mp4
2
-119649 ./tests/data/vsynth2/odivx.mp4
1
+ad44d4d5a20fbd40641703a5de46fd5c *./tests/data/vsynth2/odivx.mp4
2
+119673 ./tests/data/vsynth2/odivx.mp4
3 3
 90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv
4 4
 stddev:    5.34 PSNR: 33.57 MAXDIFF:   83 bytes:  7603200/  7603200