Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 16 Dec 2011 00:23:15 +0000 (01:23 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 16 Dec 2011 00:23:15 +0000 (01:23 +0100)
* 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>
18 files changed:
configure
libavcodec/arm/dca.h
libavcodec/arm/rv40dsp_neon.S
libavcodec/libgsm.c
libavcodec/v410enc.c
libavformat/flvenc.c
libavformat/movenc.c
libavformat/movenc.h
libavformat/westwood.c
tests/Makefile
tests/fate.mak
tests/fate/atrac.mak [new file with mode: 0644]
tests/fate/indeo.mak [new file with mode: 0644]
tests/fate2.mak
tests/ref/acodec/alac
tests/ref/fate/r210 [new file with mode: 0644]
tests/ref/vsynth1/mpeg4
tests/ref/vsynth2/mpeg4

index d59e474..ac0cb20 100755 (executable)
--- a/configure
+++ b/configure
@@ -978,8 +978,17 @@ COMPONENT_LIST="
     protocols
 "
 
+PROGRAM_LIST="
+    avconv
+    ffplay
+    ffprobe
+    ffserver
+    ffmpeg
+"
+
 CONFIG_LIST="
     $COMPONENT_LIST
+    $PROGRAM_LIST
     aandct
     ac3dsp
     avcodec
@@ -994,11 +1003,6 @@ CONFIG_LIST="
     dwt
     dxva2
     fastdiv
-    ffmpeg
-    avconv
-    ffplay
-    ffprobe
-    ffserver
     fft
     frei0r
     gnutls
@@ -1790,6 +1794,8 @@ target_os_default=$(tolower $(uname -s))
 host_os=$target_os_default
 
 # configurable options
+enable $PROGRAM_LIST
+
 enable avcodec
 enable avdevice
 enable avfilter
@@ -1800,11 +1806,6 @@ enable stripping
 enable swresample
 enable swscale
 
-enable ffmpeg
-enable ffplay
-enable ffprobe
-enable ffserver
-
 enable asm
 enable debug
 enable doc
index 9ff7f7c..9b0efc0 100644 (file)
@@ -25,7 +25,7 @@
 #include "config.h"
 #include "libavutil/intmath.h"
 
-#if HAVE_ARMV6 && HAVE_INLINE_ASM
+#if HAVE_ARMV6 && HAVE_INLINE_ASM && AV_GCC_VERSION_AT_LEAST(4,4)
 
 #define decode_blockcodes decode_blockcodes
 static inline int decode_blockcodes(int code1, int code2, int levels,
index a4313d8..d9e1b7c 100644 (file)
@@ -372,7 +372,7 @@ endfunc
 
 function ff_\type\()_rv40_qpel8_mc33_neon, export=1
         mov             r3,  #8
-        b               ff_\type\()_pixels8_xy2_neon
+        b               X(ff_\type\()_pixels8_xy2_neon)
 endfunc
 
 function ff_\type\()_rv40_qpel8_mc13_neon, export=1
@@ -652,7 +652,7 @@ endfunc
 
 function ff_\type\()_rv40_qpel16_mc33_neon, export=1
         mov             r3,  #16
-        b               ff_\type\()_pixels16_xy2_neon
+        b               X(ff_\type\()_pixels16_xy2_neon)
 endfunc
 .endm
 
index 9ba9da9..ed4962a 100644 (file)
@@ -155,7 +155,7 @@ static av_cold int libgsm_decode_init(AVCodecContext *avctx) {
         break;
     case CODEC_ID_GSM_MS: {
         int one = 1;
-        gsm_option(avctx->priv_data, GSM_OPT_WAV49, &one);
+        gsm_option(s->state, GSM_OPT_WAV49, &one);
         avctx->frame_size  = 2 * GSM_FRAME_SIZE;
         avctx->block_align = GSM_MS_BLOCK_SIZE;
         }
@@ -212,9 +212,12 @@ static int libgsm_decode_frame(AVCodecContext *avctx, void *data,
 
 static void libgsm_flush(AVCodecContext *avctx) {
     LibGSMDecodeContext *s = avctx->priv_data;
+    int one = 1;
 
     gsm_destroy(s->state);
     s->state = gsm_create();
+    if (avctx->codec_id == CODEC_ID_GSM_MS)
+        gsm_option(s->state, GSM_OPT_WAV49, &one);
 }
 
 AVCodec ff_libgsm_decoder = {
index ea66653..e6c837e 100644 (file)
@@ -20,8 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include "libavutil/intreadwrite.h"
 #include "avcodec.h"
-#include "put_bits.h"
 
 static av_cold int v410_encode_init(AVCodecContext *avctx)
 {
@@ -50,7 +50,7 @@ static int v410_encode_frame(AVCodecContext *avctx, uint8_t *buf,
     int i, j;
     int output_size = 0;
 
-    if (buf_size < avctx->width * avctx->height * 3) {
+    if (buf_size < avctx->width * avctx->height * 4) {
         av_log(avctx, AV_LOG_ERROR, "Out buffer is too small.\n");
         return AVERROR(ENOMEM);
     }
index 2384e81..3f034bc 100644 (file)
@@ -93,6 +93,7 @@ static int get_audio_flags(AVCodecContext *enc){
         case    11025:
             flags |= FLV_SAMPLERATE_11025HZ;
             break;
+        case    16000: //nellymoser only
         case     8000: //nellymoser only
         case     5512: //not mp3
             if(enc->codec_id != CODEC_ID_MP3){
@@ -128,6 +129,8 @@ static int get_audio_flags(AVCodecContext *enc){
     case CODEC_ID_NELLYMOSER:
         if (enc->sample_rate == 8000) {
             flags |= FLV_CODECID_NELLYMOSER_8KHZ_MONO | FLV_SAMPLESSIZE_16BIT;
+        } else if (enc->sample_rate == 16000) {
+            flags |= FLV_CODECID_NELLYMOSER_16KHZ_MONO | FLV_SAMPLESSIZE_16BIT;
         } else {
             flags |= FLV_CODECID_NELLYMOSER | FLV_SAMPLESSIZE_16BIT;
         }
index 442a271..0b5097b 100644 (file)
@@ -49,6 +49,9 @@ static const AVOption options[] = {
     { "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 },
     { "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 },
     FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
+    { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
+    { "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},
+    { "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},
     { NULL },
 };
 
@@ -1489,21 +1492,34 @@ static int mov_write_traf_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
     return updateSize(pb, pos);
 }
 
-#if 0
-/* TODO: Not sorted out, but not necessary either */
 static int mov_write_iods_tag(AVIOContext *pb, MOVMuxContext *mov)
 {
-    avio_wb32(pb, 0x15); /* size */
+    int i, has_audio = 0, has_video = 0;
+    int64_t pos = avio_tell(pb);
+    int audio_profile = mov->iods_audio_profile;
+    int video_profile = mov->iods_video_profile;
+    for (i = 0; i < mov->nb_streams; i++) {
+        if(mov->tracks[i].entry > 0) {
+            has_audio |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_AUDIO;
+            has_video |= mov->tracks[i].enc->codec_type == AVMEDIA_TYPE_VIDEO;
+        }
+    }
+    if (audio_profile < 0)
+        audio_profile = 0xFF - has_audio;
+    if (video_profile < 0)
+        video_profile = 0xFF - has_video;
+    avio_wb32(pb, 0x0); /* size */
     ffio_wfourcc(pb, "iods");
     avio_wb32(pb, 0);    /* version & flags */
-    avio_wb16(pb, 0x1007);
-    avio_w8(pb, 0);
-    avio_wb16(pb, 0x4fff);
-    avio_wb16(pb, 0xfffe);
-    avio_wb16(pb, 0x01ff);
-    return 0x15;
+    putDescr(pb, 0x10, 7);
+    avio_wb16(pb, 0x004f);
+    avio_w8(pb, 0xff);
+    avio_w8(pb, 0xff);
+    avio_w8(pb, audio_profile);
+    avio_w8(pb, video_profile);
+    avio_w8(pb, 0xff);
+    return updateSize(pb, pos);
 }
-#endif
 
 static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
 {
@@ -1968,7 +1984,8 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov,
     }
 
     mov_write_mvhd_tag(pb, mov);
-    //mov_write_iods_tag(pb, mov);
+    if (mov->mode != MODE_MOV && !mov->iods_skip)
+        mov_write_iods_tag(pb, mov);
     for (i=0; i<mov->nb_streams; i++) {
         if(mov->tracks[i].entry > 0) {
             mov_write_trak_tag(pb, mov, &(mov->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL);
index a3701bb..f6c95ad 100644 (file)
@@ -125,6 +125,10 @@ typedef struct MOVMuxContext {
     int64_t reserved_moov_pos;
     int max_fragment_duration;
     int max_fragment_size;
+
+    int iods_skip;
+    int iods_video_profile;
+    int iods_audio_profile;
 } MOVMuxContext;
 
 #define FF_MOV_FLAG_RTP_HINT 1
index c232d5c..c46c3ba 100644 (file)
@@ -331,6 +331,11 @@ static int wsvqa_read_packet(AVFormatContext *s,
 
         skip_byte = chunk_size & 0x01;
 
+        if ((chunk_type == SND2_TAG || chunk_type == SND1_TAG) && wsvqa->audio_channels == 0) {
+            av_log(s, AV_LOG_ERROR, "audio chunk without any audio header information found\n");
+            return AVERROR_INVALIDDATA;
+        }
+
         if ((chunk_type == SND1_TAG) || (chunk_type == SND2_TAG) || (chunk_type == VQFR_TAG)) {
 
             ret= av_get_packet(pb, pkt, chunk_size);
index 640e630..b44db7d 100644 (file)
@@ -48,10 +48,12 @@ include $(SRC_PATH)/tests/fate/ac3.mak
 include $(SRC_PATH)/tests/fate/als.mak
 include $(SRC_PATH)/tests/fate/amrnb.mak
 include $(SRC_PATH)/tests/fate/amrwb.mak
+include $(SRC_PATH)/tests/fate/atrac.mak
 include $(SRC_PATH)/tests/fate/dct.mak
 include $(SRC_PATH)/tests/fate/fft.mak
 include $(SRC_PATH)/tests/fate/h264.mak
 include $(SRC_PATH)/tests/fate/image.mak
+include $(SRC_PATH)/tests/fate/indeo.mak
 include $(SRC_PATH)/tests/fate/libavutil.mak
 include $(SRC_PATH)/tests/fate/mapchan.mak
 include $(SRC_PATH)/tests/fate/lossless-audio.mak
index 81c5c33..067aaad 100644 (file)
@@ -126,12 +126,6 @@ FATE_TESTS += fate-iff-ilbm
 fate-iff-ilbm: CMD = framecrc  -i $(SAMPLES)/iff/lms-matriks.ilbm -pix_fmt rgb24
 FATE_TESTS += fate-iff-pcm
 fate-iff-pcm: CMD = md5  -i $(SAMPLES)/iff/Bells -f s16le
-FATE_TESTS += fate-indeo2
-fate-indeo2: CMD = framecrc  -i $(SAMPLES)/rt21/VPAR0026.AVI
-FATE_TESTS += fate-indeo3
-fate-indeo3: CMD = framecrc  -i $(SAMPLES)/iv32/cubes.mov
-FATE_TESTS += fate-indeo5
-fate-indeo5: CMD = framecrc  -i $(SAMPLES)/iv50/Educ_Movie_DeadlyForce.avi -an
 FATE_TESTS += fate-interplay-mve-16bit
 fate-interplay-mve-16bit: CMD = framecrc  -i $(SAMPLES)/interplay-mve/descent3-level5-16bit-partial.mve -pix_fmt rgb24
 FATE_TESTS += fate-interplay-mve-8bit
diff --git a/tests/fate/atrac.mak b/tests/fate/atrac.mak
new file mode 100644 (file)
index 0000000..1d586c6
--- /dev/null
@@ -0,0 +1,19 @@
+FATE_TESTS += fate-atrac1
+fate-atrac1: CMD = pcm -i $(SAMPLES)/atrac1/test_tones_small.aea
+fate-atrac1: CMP = oneoff
+fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm
+
+FATE_TESTS += fate-atrac3-1
+fate-atrac3-1: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_066_small.wav
+fate-atrac3-1: CMP = oneoff
+fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm
+
+FATE_TESTS += fate-atrac3-2
+fate-atrac3-2: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_105_small.wav
+fate-atrac3-2: CMP = oneoff
+fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm
+
+FATE_TESTS += fate-atrac3-3
+fate-atrac3-3: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_132_small.wav
+fate-atrac3-3: CMP = oneoff
+fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm
diff --git a/tests/fate/indeo.mak b/tests/fate/indeo.mak
new file mode 100644 (file)
index 0000000..df07392
--- /dev/null
@@ -0,0 +1,8 @@
+FATE_TESTS += fate-indeo2
+fate-indeo2: CMD = framecrc -i $(SAMPLES)/rt21/VPAR0026.AVI
+
+FATE_TESTS += fate-indeo3
+fate-indeo3: CMD = framecrc -i $(SAMPLES)/iv32/cubes.mov
+
+FATE_TESTS += fate-indeo5
+fate-indeo5: CMD = framecrc -i $(SAMPLES)/iv50/Educ_Movie_DeadlyForce.avi -an
index b0591a3..e78a8a3 100644 (file)
@@ -40,26 +40,6 @@ fate-truespeech: CMD = pcm -i $(SAMPLES)/truespeech/a6.wav
 fate-truespeech: CMP = oneoff
 fate-truespeech: REF = $(SAMPLES)/truespeech/a6.pcm
 
-FATE_TESTS += fate-atrac1
-fate-atrac1: CMD = pcm -i $(SAMPLES)/atrac1/test_tones_small.aea
-fate-atrac1: CMP = oneoff
-fate-atrac1: REF = $(SAMPLES)/atrac1/test_tones_small.pcm
-
-FATE_TESTS += fate-atrac3-1
-fate-atrac3-1: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_066_small.wav
-fate-atrac3-1: CMP = oneoff
-fate-atrac3-1: REF = $(SAMPLES)/atrac3/mc_sich_at3_066_small.pcm
-
-FATE_TESTS += fate-atrac3-2
-fate-atrac3-2: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_105_small.wav
-fate-atrac3-2: CMP = oneoff
-fate-atrac3-2: REF = $(SAMPLES)/atrac3/mc_sich_at3_105_small.pcm
-
-FATE_TESTS += fate-atrac3-3
-fate-atrac3-3: CMD = pcm -i $(SAMPLES)/atrac3/mc_sich_at3_132_small.wav
-fate-atrac3-3: CMP = oneoff
-fate-atrac3-3: REF = $(SAMPLES)/atrac3/mc_sich_at3_132_small.pcm
-
 FATE_TESTS += fate-gsm
 fate-gsm: CMD = framecrc -i $(SAMPLES)/gsm/sample-gsm-8000.mov -t 10
 
@@ -132,3 +112,6 @@ fate-v410dec: CMD = framecrc -i $(SAMPLES)/v410/lenav410.mov -pix_fmt yuv444p10l
 FATE_TESTS += fate-v410enc
 fate-v410enc: tests/vsynth1/00.pgm
 fate-v410enc: CMD = md5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -flags +bitexact -vcodec v410 -f avi
+
+FATE_TESTS += fate-r210
+fate-r210: CMD = framecrc -i $(SAMPLES)/r210/r210.avi -pix_fmt rgb48le
index db6393a..39264c5 100644 (file)
@@ -1,4 +1,4 @@
-4fe333ff79e86cca6ba8c109cc08263e *./tests/data/acodec/alac.m4a
-389166 ./tests/data/acodec/alac.m4a
+bff6044a7f303d8482775f4fcdc2d272 *./tests/data/acodec/alac.m4a
+389190 ./tests/data/acodec/alac.m4a
 64151e4bcc2b717aa5a8454d424d6a1f *./tests/data/alac.acodec.out.wav
 stddev:    0.00 PSNR:999.99 MAXDIFF:    0 bytes:  1058400/  1058400
diff --git a/tests/ref/fate/r210 b/tests/ref/fate/r210
new file mode 100644 (file)
index 0000000..238a136
--- /dev/null
@@ -0,0 +1,3 @@
+0, 0, 1843200, 0xbd414b93
+0, 3003, 1843200, 0x23298f1f
+0, 6006, 1843200, 0x5a56df19
index fbf3b8f..3d6f985 100644 (file)
@@ -1,4 +1,4 @@
-f32960be0f05be8b2ed03447e1eaea6f *./tests/data/vsynth1/odivx.mp4
-539996 ./tests/data/vsynth1/odivx.mp4
+146bf838d7efd524595c68145337dfef *./tests/data/vsynth1/odivx.mp4
+540020 ./tests/data/vsynth1/odivx.mp4
 8828a375448dc5c2215163ba70656f89 *./tests/data/mpeg4.vsynth1.out.yuv
 stddev:    7.97 PSNR: 30.10 MAXDIFF:  105 bytes:  7603200/  7603200
index 726e1d9..35729a0 100644 (file)
@@ -1,4 +1,4 @@
-4d092ca067362a61b9c96f5f12a1ab5a *./tests/data/vsynth2/odivx.mp4
-119649 ./tests/data/vsynth2/odivx.mp4
+ad44d4d5a20fbd40641703a5de46fd5c *./tests/data/vsynth2/odivx.mp4
+119673 ./tests/data/vsynth2/odivx.mp4
 90a3577850239083a9042bef33c50e85 *./tests/data/mpeg4.vsynth2.out.yuv
 stddev:    5.34 PSNR: 33.57 MAXDIFF:   83 bytes:  7603200/  7603200