Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 17 Jul 2011 17:52:05 +0000 (19:52 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 17 Jul 2011 18:12:02 +0000 (20:12 +0200)
* qatar/master:
  ffmpeg: fix some indentation
  ffmpeg: fix operation with --disable-avfilter
  simple_idct: remove disabled code
  motion_est: remove disabled code
  vc1: remove disabled code
  fate: separate lavf-mxf_d10 test from lavf-mxf
  cabac: Move code only used in the cabac test program to cabac.c.
  ffplay: warn that -pix_fmt is no longer working, suggest alternative
  ffplay: warn that -s is no longer working, suggest alternative
  lavf: rename enc variable in utils.c:has_codec_parameters()
  lavf: use designated initialisers for all (de)muxers.
  wav: remove a use of deprecated AV_METADATA_ macro
  rmdec: remove useless ap parameter from rm_read_header_old()
  dct-test: remove write-only variable
  des: fix #if conditional around P_shuffle
  Use LOCAL_ALIGNED in ff_check_alignment()

Conflicts:
ffmpeg.c
libavformat/avidec.c
libavformat/matroskaenc.c
libavformat/mp3enc.c
libavformat/oggenc.c
libavformat/utils.c
tests/ref/lavf/mxf

Merged-by: Michael Niedermayer <michaelni@gmx.at>
150 files changed:
1  2 
configure
doc/ffplay.texi
ffmpeg.c
ffplay.c
libavcodec/cabac.c
libavcodec/cabac.h
libavcodec/dct-test.c
libavcodec/dsputil.c
libavcodec/motion_est.c
libavcodec/motion_est_template.c
libavcodec/simple_idct.c
libavcodec/vc1data.h
libavcodec/x86/simple_idct_mmx.c
libavformat/4xm.c
libavformat/a64.c
libavformat/aacdec.c
libavformat/ac3dec.c
libavformat/adtsenc.c
libavformat/aea.c
libavformat/aiffdec.c
libavformat/aiffenc.c
libavformat/amr.c
libavformat/anm.c
libavformat/apc.c
libavformat/ape.c
libavformat/applehttp.c
libavformat/asfdec.c
libavformat/asfenc.c
libavformat/au.c
libavformat/avidec.c
libavformat/avienc.c
libavformat/avisynth.c
libavformat/avs.c
libavformat/bethsoftvid.c
libavformat/bfi.c
libavformat/bink.c
libavformat/c93.c
libavformat/cafdec.c
libavformat/cdg.c
libavformat/crcenc.c
libavformat/daud.c
libavformat/dfa.c
libavformat/dsicin.c
libavformat/dtsdec.c
libavformat/dv.c
libavformat/dvenc.c
libavformat/dxa.c
libavformat/eacdata.c
libavformat/electronicarts.c
libavformat/ffmdec.c
libavformat/ffmenc.c
libavformat/filmstripdec.c
libavformat/filmstripenc.c
libavformat/flacdec.c
libavformat/flacenc.c
libavformat/flic.c
libavformat/flvdec.c
libavformat/flvenc.c
libavformat/framecrcenc.c
libavformat/gif.c
libavformat/gxf.c
libavformat/gxfenc.c
libavformat/idcin.c
libavformat/idroqdec.c
libavformat/iff.c
libavformat/ingenientdec.c
libavformat/ipmovie.c
libavformat/iss.c
libavformat/iv8.c
libavformat/ivfdec.c
libavformat/libnut.c
libavformat/lmlm4.c
libavformat/matroskadec.c
libavformat/matroskaenc.c
libavformat/md5enc.c
libavformat/mm.c
libavformat/mmf.c
libavformat/mov.c
libavformat/movenc.c
libavformat/mp3dec.c
libavformat/mp3enc.c
libavformat/mpc.c
libavformat/mpc8.c
libavformat/mpeg.c
libavformat/mpegenc.c
libavformat/mpegts.c
libavformat/mpegtsenc.c
libavformat/mpjpeg.c
libavformat/msnwc_tcp.c
libavformat/mtv.c
libavformat/mvi.c
libavformat/mxfdec.c
libavformat/mxfenc.c
libavformat/ncdec.c
libavformat/nsvdec.c
libavformat/nullenc.c
libavformat/nutdec.c
libavformat/nutenc.c
libavformat/nuv.c
libavformat/oggenc.c
libavformat/oma.c
libavformat/psxstr.c
libavformat/pva.c
libavformat/r3d.c
libavformat/rawdec.c
libavformat/rawenc.c
libavformat/rawvideodec.c
libavformat/rl2.c
libavformat/rmdec.c
libavformat/rmenc.c
libavformat/rpl.c
libavformat/rtpenc.c
libavformat/rtsp.c
libavformat/rtspdec.c
libavformat/rtspenc.c
libavformat/sapdec.c
libavformat/sapenc.c
libavformat/segafilm.c
libavformat/sierravmd.c
libavformat/siff.c
libavformat/smacker.c
libavformat/sol.c
libavformat/soxdec.c
libavformat/soxenc.c
libavformat/spdifdec.c
libavformat/spdifenc.c
libavformat/swfdec.c
libavformat/swfenc.c
libavformat/thp.c
libavformat/tiertexseq.c
libavformat/tmv.c
libavformat/tta.c
libavformat/utils.c
libavformat/vc1test.c
libavformat/vc1testenc.c
libavformat/vocdec.c
libavformat/vocenc.c
libavformat/vqf.c
libavformat/wav.c
libavformat/wc3movie.c
libavformat/westwood.c
libavformat/wv.c
libavformat/xa.c
libavformat/xwma.c
libavformat/yop.c
libavformat/yuv4mpeg.c
libavutil/des.c
tests/lavf-regression.sh
tests/ref/lavf/mxf
tests/ref/lavf/mxf_d10

diff --cc configure
Simple merge
diff --cc doc/ffplay.texi
Simple merge
diff --cc ffmpeg.c
+++ b/ffmpeg.c
@@@ -2327,12 -2229,29 +2333,9 @@@ static int transcode(AVFormatContext **
                                        codec->height  != icodec->height ||
                                        codec->pix_fmt != icodec->pix_fmt;
                  if (ost->video_resample) {
 -#if !CONFIG_AVFILTER
 -                    avcodec_get_frame_defaults(&ost->pict_tmp);
 -                    if(avpicture_alloc((AVPicture*)&ost->pict_tmp, codec->pix_fmt,
 -                                       codec->width, codec->height)) {
 -                        fprintf(stderr, "Cannot allocate temp picture, check pix fmt\n");
 -                        ffmpeg_exit(1);
 -                    }
 -                    ost->img_resample_ctx = sws_getContext(
 -                        icodec->width,
 -                        icodec->height,
 -                        icodec->pix_fmt,
 -                        codec->width,
 -                        codec->height,
 -                        codec->pix_fmt,
 -                        ost->sws_flags, NULL, NULL, NULL);
 -                    if (ost->img_resample_ctx == NULL) {
 -                        fprintf(stderr, "Cannot get resampling context\n");
 -                        ffmpeg_exit(1);
 -                    }
 -#endif
 -                    codec->bits_per_raw_sample= 0;
 +                    codec->bits_per_raw_sample= frame_bits_per_raw_sample;
                  }
-                 if (!codec->width || !codec->height) {
-                     codec->width  = icodec->width;
-                     codec->height = icodec->height;
-                 }
                  ost->resample_height = icodec->height;
                  ost->resample_width  = icodec->width;
                  ost->resample_pix_fmt= icodec->pix_fmt;
diff --cc ffplay.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1446,13 -1389,12 +1446,13 @@@ static int avi_probe(AVProbeData *p
  }
  
  AVInputFormat ff_avi_demuxer = {
-     "avi",
-     NULL_IF_CONFIG_SMALL("AVI format"),
-     sizeof(AVIContext),
-     avi_probe,
-     avi_read_header,
-     avi_read_packet,
-     avi_read_close,
-     avi_read_seek,
+     .name           = "avi",
+     .long_name      = NULL_IF_CONFIG_SMALL("AVI format"),
+     .priv_data_size = sizeof(AVIContext),
+     .read_probe     = avi_probe,
+     .read_header    = avi_read_header,
+     .read_packet    = avi_read_packet,
+     .read_close     = avi_read_close,
+     .read_seek      = avi_read_seek,
 +    .priv_class = &demuxer_class,
  };
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1218,17 -1211,17 +1218,17 @@@ AVOutputFormat ff_matroska_muxer = 
  
  #if CONFIG_WEBM_MUXER
  AVOutputFormat ff_webm_muxer = {
-     "webm",
-     NULL_IF_CONFIG_SMALL("WebM file format"),
-     "video/webm",
-     "webm",
-     sizeof(MatroskaMuxContext),
-     CODEC_ID_VORBIS,
-     CODEC_ID_VP8,
-     mkv_write_header,
-     mkv_write_packet,
-     mkv_write_trailer,
+     .name              = "webm",
+     .long_name         = NULL_IF_CONFIG_SMALL("WebM file format"),
+     .mime_type         = "video/webm",
+     .extensions        = "webm",
+     .priv_data_size    = sizeof(MatroskaMuxContext),
+     .audio_codec       = CODEC_ID_VORBIS,
+     .video_codec       = CODEC_ID_VP8,
+     .write_header      = mkv_write_header,
+     .write_packet      = mkv_write_packet,
+     .write_trailer     = mkv_write_trailer,
 -    .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS,
 +    .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS | AVFMT_TS_NONSTRICT,
  };
  #endif
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -174,16 -162,14 +174,14 @@@ static int mp2_write_trailer(struct AVF
  
  #if CONFIG_MP2_MUXER
  AVOutputFormat ff_mp2_muxer = {
-     "mp2",
-     NULL_IF_CONFIG_SMALL("MPEG audio layer 2"),
-     "audio/x-mpeg",
-     "mp2,m2a",
-     0,
-     CODEC_ID_MP2,
-     CODEC_ID_NONE,
-     NULL,
-     ff_raw_write_packet,
-     mp2_write_trailer,
+     .name              = "mp2",
+     .long_name         = NULL_IF_CONFIG_SMALL("MPEG audio layer 2"),
+     .mime_type         = "audio/x-mpeg",
+     .extensions        = "mp2,m2a",
+     .audio_codec       = CODEC_ID_MP2,
+     .video_codec       = CODEC_ID_NONE,
+     .write_packet      = ff_raw_write_packet,
 -    .write_trailer     = mp3_write_trailer,
++    .write_trailer     = mp2_write_trailer,
  };
  #endif
  
@@@ -408,68 -303,18 +406,68 @@@ static int mp3_write_header(struct AVFo
      return 0;
  }
  
 +static int mp3_write_packet(AVFormatContext *s, AVPacket *pkt)
 +{
 +    if (! pkt || ! pkt->data || pkt->size < 4)
 +        return ff_raw_write_packet(s, pkt);
 +    else {
 +        MP3Context  *mp3 = s->priv_data;
 +#ifdef FILTER_VBR_HEADERS
 +        MPADecodeHeader c;
 +        int base;
 +
 +        ff_mpegaudio_decode_header(&c, AV_RB32(pkt->data));
 +
 +        /* filter out XING and INFO headers. */
 +        base = 4 + xing_offtbl[c.lsf == 1][c.nb_channels == 1];
 +
 +        if (base + 4 <= pkt->size) {
 +            uint32_t v = AV_RB32(pkt->data + base);
 +
 +            if (MKBETAG('X','i','n','g') == v || MKBETAG('I','n','f','o') == v)
 +                return 0;
 +        }
 +
 +        /* filter out VBRI headers. */
 +        base = 4 + 32;
 +
 +        if (base + 4 <= pkt->size && MKBETAG('V','B','R','I') == AV_RB32(pkt->data + base))
 +            return 0;
 +#endif
 +
 +        if (mp3->frames_offset)
 +            mp3_xing_add_frame(s, pkt);
 +
 +        return ff_raw_write_packet(s, pkt);
 +    }
 +}
 +
 +static int mp3_write_trailer(AVFormatContext *s)
 +{
 +    MP3Context  *mp3 = s->priv_data;
 +    int ret=mp2_write_trailer(s);
 +
 +    if (ret < 0)
 +        return ret;
 +
 +    if (mp3->frames_offset)
 +        mp3_fix_xing(s);
 +
 +    return 0;
 +}
 +
  AVOutputFormat ff_mp3_muxer = {
-     "mp3",
-     NULL_IF_CONFIG_SMALL("MPEG audio layer 3"),
-     "audio/x-mpeg",
-     "mp3",
-     sizeof(MP3Context),
-     CODEC_ID_MP3,
-     CODEC_ID_NONE,
-     mp3_write_header,
-     mp3_write_packet,
-     mp3_write_trailer,
-     AVFMT_NOTIMESTAMPS,
+     .name              = "mp3",
+     .long_name         = NULL_IF_CONFIG_SMALL("MPEG audio layer 3"),
+     .mime_type         = "audio/x-mpeg",
+     .extensions        = "mp3",
+     .priv_data_size    = sizeof(MP3Context),
+     .audio_codec       = CODEC_ID_MP3,
+     .video_codec       = CODEC_ID_NONE,
+     .write_header      = mp3_write_header,
 -    .write_packet      = ff_raw_write_packet,
++    .write_packet      = mp3_write_packet,
+     .write_trailer     = mp3_write_trailer,
+     .flags             = AVFMT_NOTIMESTAMPS,
      .priv_class = &mp3_muxer_class,
  };
  #endif
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -525,15 -505,14 +525,15 @@@ static int ogg_write_trailer(AVFormatCo
  }
  
  AVOutputFormat ff_ogg_muxer = {
-     "ogg",
-     NULL_IF_CONFIG_SMALL("Ogg"),
-     "application/ogg",
-     "ogg,ogv,spx",
-     sizeof(OGGContext),
-     CODEC_ID_FLAC,
-     CODEC_ID_THEORA,
-     ogg_write_header,
-     ogg_write_packet,
-     ogg_write_trailer,
+     .name              = "ogg",
+     .long_name         = NULL_IF_CONFIG_SMALL("Ogg"),
+     .mime_type         = "application/ogg",
+     .extensions        = "ogg,ogv,spx",
+     .priv_data_size    = sizeof(OGGContext),
+     .audio_codec       = CODEC_ID_FLAC,
+     .video_codec       = CODEC_ID_THEORA,
+     .write_header      = ogg_write_header,
+     .write_packet      = ogg_write_packet,
+     .write_trailer     = ogg_write_trailer,
 +    .priv_class = &ogg_muxer_class,
  };
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -2070,32 -2033,30 +2070,32 @@@ static void estimate_timings(AVFormatCo
          AVStream av_unused *st;
          for(i = 0;i < ic->nb_streams; i++) {
              st = ic->streams[i];
 -            av_dlog(ic, "%d: start_time: %0.3f duration: %0.3f\n", i,
 -                    (double) st->start_time / AV_TIME_BASE,
 -                    (double) st->duration   / AV_TIME_BASE);
 +        printf("%d: start_time: %0.3f duration: %0.3f\n",
 +               i, (double)st->start_time / AV_TIME_BASE,
 +               (double)st->duration / AV_TIME_BASE);
          }
 -        av_dlog(ic, "stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
 -                (double) ic->start_time / AV_TIME_BASE,
 -                (double) ic->duration   / AV_TIME_BASE,
 -                ic->bit_rate / 1000);
 +        printf("stream: start_time: %0.3f duration: %0.3f bitrate=%d kb/s\n",
 +               (double)ic->start_time / AV_TIME_BASE,
 +               (double)ic->duration / AV_TIME_BASE,
 +               ic->bit_rate / 1000);
      }
 +#endif
  }
  
- static int has_codec_parameters(AVCodecContext *enc)
+ static int has_codec_parameters(AVCodecContext *avctx)
  {
      int val;
-     switch(enc->codec_type) {
+     switch (avctx->codec_type) {
      case AVMEDIA_TYPE_AUDIO:
-         val = enc->sample_rate && enc->channels && enc->sample_fmt != AV_SAMPLE_FMT_NONE;
-         if(!enc->frame_size &&
-            (enc->codec_id == CODEC_ID_VORBIS ||
-             enc->codec_id == CODEC_ID_AAC ||
-             enc->codec_id == CODEC_ID_MP1 ||
-             enc->codec_id == CODEC_ID_MP2 ||
-             enc->codec_id == CODEC_ID_MP3 ||
-             enc->codec_id == CODEC_ID_SPEEX ||
-             enc->codec_id == CODEC_ID_CELT))
+         val = avctx->sample_rate && avctx->channels && avctx->sample_fmt != AV_SAMPLE_FMT_NONE;
 -        if (!avctx->frame_size &&
 -            (avctx->codec_id == CODEC_ID_VORBIS ||
 -             avctx->codec_id == CODEC_ID_AAC ||
 -             avctx->codec_id == CODEC_ID_MP1 ||
 -             avctx->codec_id == CODEC_ID_MP2 ||
 -             avctx->codec_id == CODEC_ID_MP3 ||
 -             avctx->codec_id == CODEC_ID_SPEEX))
++        if(!avctx->frame_size &&
++           (avctx->codec_id == CODEC_ID_VORBIS ||
++            avctx->codec_id == CODEC_ID_AAC ||
++            avctx->codec_id == CODEC_ID_MP1 ||
++            avctx->codec_id == CODEC_ID_MP2 ||
++            avctx->codec_id == CODEC_ID_MP3 ||
++            avctx->codec_id == CODEC_ID_SPEEX ||
++            avctx->codec_id == CODEC_ID_CELT))
              return 0;
          break;
      case AVMEDIA_TYPE_VIDEO:
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc libavutil/des.c
Simple merge
Simple merge
@@@ -1,6 -1,3 +1,3 @@@
 -6e9bd63c5cadd7550ad313553ebf665f *./tests/data/lavf/lavf.mxf
 +785e38ddd2466046f30aa36399b8f8fa *./tests/data/lavf/lavf.mxf
  525881 ./tests/data/lavf/lavf.mxf
--./tests/data/lavf/lavf.mxf CRC=0x4ace0849
- b3174e2db508564c1cce0b5e3c1bc1bd *./tests/data/lavf/lavf.mxf_d10
- 5330989 ./tests/data/lavf/lavf.mxf_d10
- ./tests/data/lavf/lavf.mxf_d10 CRC=0xc3f4f92e
++./tests/data/lavf/lavf.mxf CRC=0x4ace0849
index 0000000,f59a99e..2582022
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,3 +1,3 @@@
 -e7168856f2b54c6272685967e707fb21 *./tests/data/lavf/lavf.mxf_d10
++b3174e2db508564c1cce0b5e3c1bc1bd *./tests/data/lavf/lavf.mxf_d10
+ 5330989 ./tests/data/lavf/lavf.mxf_d10
+ ./tests/data/lavf/lavf.mxf_d10 CRC=0xc3f4f92e