]> git.sesse.net Git - ffmpeg/commitdiff
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>
12 files changed:
1  2 
configure
libavcodec/libgsm.c
libavcodec/v410enc.c
libavformat/flvenc.c
libavformat/movenc.c
libavformat/movenc.h
libavformat/westwood.c
tests/Makefile
tests/fate.mak
tests/ref/acodec/alac
tests/ref/vsynth1/mpeg4
tests/ref/vsynth2/mpeg4

diff --cc configure
index d59e474909d7d2ed1e9a7872d7c59345fe4a5ba6,b3af2e9c6b2b1008b5f18b5f500d847ed212b0b0..ac0cb2096256a0f761780d3fb2846d4961034a36
+++ b/configure
@@@ -978,8 -903,17 +978,17 @@@ COMPONENT_LIST=
      protocols
  "
  
 -    avplay
 -    avprobe
 -    avserver
+ PROGRAM_LIST="
+     avconv
++    ffplay
++    ffprobe
++    ffserver
+     ffmpeg
+ "
  CONFIG_LIST="
      $COMPONENT_LIST
+     $PROGRAM_LIST
      aandct
      ac3dsp
      avcodec
@@@ -1796,15 -1671,8 +1802,10 @@@ enable avfilte
  enable avformat
  enable avutil
  enable postproc
 +enable stripping
 +enable swresample
  enable swscale
  
- enable ffmpeg
- enable ffplay
- enable ffprobe
- enable ffserver
  enable asm
  enable debug
  enable doc
Simple merge
Simple merge
Simple merge
index 442a2717cf8f6b966cfb63ed2045f6fcfe43bbab,046352836289179a8829a787cc2dbcc5992ab890..0b5097b56773e616fc267b8cdea65dd25399af12
  static const AVOption options[] = {
      { "movflags", "MOV muxer flags", offsetof(MOVMuxContext, flags), AV_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
      { "rtphint", "Add RTP hint tracks", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_RTP_HINT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
 +    { "moov_size", "maximum moov size so it can be placed at the begin", offsetof(MOVMuxContext, reserved_moov_size), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, 0 },
 +    { "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 },
  };
  
@@@ -1423,87 -1410,34 +1426,100 @@@ static int mov_write_trak_tag(AVIOConte
      return updateSize(pb, pos);
  }
  
- #if 0
- /* TODO: Not sorted out, but not necessary either */
 +static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
 +{
 +    int64_t pos = avio_tell(pb);
 +    int flags=1;
 +
 +    avio_wb32(pb, 0);
 +    ffio_wfourcc(pb, "tfhd");
 +    avio_w8(pb, 0);
 +    avio_wb24(pb, flags);
 +    avio_wb32(pb, track->trackID);
 +
 +    track->base_data_offset_pos= avio_tell(pb);
 +    if (flags & 0x01) avio_wb64(pb, 0);
 +
 +    return updateSize(pb, pos);
 +}
 +
 +static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track)
 +{
 +    int64_t pos = avio_tell(pb);
 +    int sample_count= track->entry - track->cluster_write_index;
 +    int tr_flags=0;
 +    int i;
 +
 +    for(i=track->cluster_write_index; i<track->entry; i++){
 +        int64_t duration = i + 1 == track->entry ?
 +                track->trackDuration - track->cluster[i].dts + track->cluster[0].dts : /* readjusting */
 +                track->cluster[i+1].dts - track->cluster[i].dts;
 +        if(duration         != 1) tr_flags |= 0x100;
 +        if(track->trex_size != track->cluster[i].size) tr_flags |= 0x200;
 +        if(track->trex_flags != ((track->cluster[i].flags&MOV_SYNC_SAMPLE) ? 0x02000000 : 0x01010000))
 +                                  tr_flags |= 0x400;
 +        if(track->cluster[i].cts) tr_flags |= 0x800;
 +    }
 +
 +    avio_wb32(pb, 0);
 +    ffio_wfourcc(pb, "trun");
 +    avio_w8(pb, 0);
 +    avio_wb24(pb, tr_flags);
 +    avio_wb32(pb, sample_count);
 +    if(tr_flags&1) avio_wb32(pb, 0);
 +
 +    for(i=track->cluster_write_index; i<track->entry; i++){
 +        int64_t duration = i + 1 == track->entry ?
 +                track->trackDuration - track->cluster[i].dts + track->cluster[0].dts : /* readjusting */
 +                track->cluster[i+1].dts - track->cluster[i].dts;
 +
 +        if(tr_flags&0x100) avio_wb32(pb, duration);
 +        if(tr_flags&0x200) avio_wb32(pb, track->cluster[i].size);
 +        if(tr_flags&0x400) avio_wb32(pb, (track->cluster[i].flags&MOV_SYNC_SAMPLE) ? 0x02000000 : 0x01010000);
 +        if(tr_flags&0x800) avio_wb32(pb, track->cluster[i].cts);
 +    }
 +
 +    return updateSize(pb, pos);
 +}
 +
 +static int mov_write_traf_tag(AVIOContext *pb, MOVTrack *track, AVStream *st)
 +{
 +    int64_t pos = avio_tell(pb);
 +    avio_wb32(pb, 0); /* size */
 +    ffio_wfourcc(pb, "traf");
 +    mov_write_tfhd_tag(pb, track, st);
 +    mov_write_trun_tag(pb, track);
 +    return updateSize(pb, pos);
 +}
 +
  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,10 -1845,11 +1984,11 @@@ static int mov_write_moov_tag(AVIOConte
      }
  
      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->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL);
 +            mov_write_trak_tag(pb, mov, &(mov->tracks[i]), i < s->nb_streams ? s->streams[i] : NULL);
          }
      }
  
index a3701bba0a77f74777b595025df0e0941adfa4e2,5ca5631c5a562ef6972d2c696eb1e38e672e3c5a..f6c95adea36834b7001d76726707032669d99c37
@@@ -121,10 -112,9 +121,14 @@@ typedef struct MOVMuxContext 
  
      int flags;
      int rtp_flags;
 +    int reserved_moov_size;
 +    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 c232d5c8292d9995cf126ec513008b1ff7725913,82b7e94840fc3a945f5267eeae11731c33cae9b8..c46c3ba10e024c8b620391162fb93ef7a001a09c
@@@ -320,22 -322,24 +320,27 @@@ static int wsvqa_read_packet(AVFormatCo
      int skip_byte;
  
      while (avio_read(pb, preamble, VQA_PREAMBLE_SIZE) == VQA_PREAMBLE_SIZE) {
 +        int64_t filesize= avio_size(s->pb);
          chunk_type = AV_RB32(&preamble[0]);
          chunk_size = AV_RB32(&preamble[4]);
 +
 +        if(chunk_size > filesize){
 +            av_log(s, AV_LOG_ERROR, "Chunk with size %d truncated\n", chunk_size);
 +            chunk_size= filesize;
 +        }
 +
          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)) {
  
 -            if (av_new_packet(pkt, chunk_size))
 -                return AVERROR(EIO);
 -            ret = avio_read(pb, pkt->data, chunk_size);
 -            if (ret != chunk_size) {
 -                av_free_packet(pkt);
 +            ret= av_get_packet(pb, pkt, chunk_size);
 +            if (ret<0)
                  return AVERROR(EIO);
 -            }
  
              if (chunk_type == SND2_TAG) {
                  pkt->stream_index = wsvqa->audio_stream_index;
diff --cc tests/Makefile
index 640e6300cc373be54af1cea998bf7358d3cfc6aa,6b08619e4b3a128a48391d742bc5b0e13f3b7587..b44db7dbd484e44f90f671db9c653089be6e5566
@@@ -52,8 -36,8 +53,9 @@@ include $(SRC_PATH)/tests/fate/dct.ma
  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
  include $(SRC_PATH)/tests/fate/lossless-video.mak
  include $(SRC_PATH)/tests/fate/mp3.mak
diff --cc tests/fate.mak
Simple merge
index db6393ac46a73f603fb84221957aec699f7a8fcd,15d1a1fa415c6f94b30e557526db141fd150ce50..39264c53c7b432519ee24e916e3a3c1a2bb6f222
@@@ -1,4 -1,4 +1,4 @@@
- 4fe333ff79e86cca6ba8c109cc08263e *./tests/data/acodec/alac.m4a
- 389166 ./tests/data/acodec/alac.m4a
 -8d9cb7f65c5b17c74e5f9bdc36f32b7d *./tests/data/acodec/alac.m4a
 -389410 ./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
index fbf3b8fdccbfd3940ba152451caa8870e7a9097a,133e228ff4ce37ea435d0f564e96b0611cdae8cd..3d6f985e5a59148b4c28688dcc1b43c1c69cd555
@@@ -1,4 -1,4 +1,4 @@@
- f32960be0f05be8b2ed03447e1eaea6f *./tests/data/vsynth1/odivx.mp4
- 539996 ./tests/data/vsynth1/odivx.mp4
 -9251145d12150cb639098016d61fc75e *./tests/data/vsynth1/odivx.mp4
 -540180 ./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 726e1d943616d2fb4d3bcbf00491cf2f2e664c90,b89a3ec60a6699642d04bc6e7f169aae08ab60e1..35729a0a7aca255d6647be834b0cd753469cb8d7
@@@ -1,4 -1,4 +1,4 @@@
- 4d092ca067362a61b9c96f5f12a1ab5a *./tests/data/vsynth2/odivx.mp4
- 119649 ./tests/data/vsynth2/odivx.mp4
 -c2ca709a0ed64833fd38f703b19e5e85 *./tests/data/vsynth2/odivx.mp4
 -119833 ./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