OSDN Git Service

Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 11 Jun 2011 01:51:36 +0000 (03:51 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 11 Jun 2011 01:51:36 +0000 (03:51 +0200)
* qatar/master:
  bitstream: Properly promote av_reverse values before shifting.
  libavutil/swscale: YUV444P10/YUV444P9 support.
  H.264: Fix high bit depth explicit biweight
  h264: Fix 10-bit H.264 x86 chroma v loopfilter asm.
  Replace DEBUG_SEEK/DEBUG_SI + av_log combinations by av_dlog.
  Update copyright year for ac3enc_opts_template.c.
  adts: Adjust frame size mask to follow the specification.
  movenc: Add RTP muxer/hinter options
  movenc: Pass the RTP AVFormatContext to the SDP generation
  rtspenc: Add RTP muxer options
  rtspenc: Add an AVClass for setting muxer specific options
  rtpenc_chain: Pass the rtpflags options through to the chained muxer
  rtpenc: Declare the rtp flags private AVOptions in rtpenc.h
  sdp: Reindent after the previous commit
  rtpenc: MP4A-LATM payload support
  avoptions: Add an av_opt_flag_is_set function for inspecting flag fields
  sdp: Allow passing an AVFormatContext to the SDP generation
  mov: Fix wrong timestamp generation for fragmented movies that have time offset caused by the first edit list entry.
  mpeg12: more advanced ffmpeg mpeg2 aspect guessing code.
  swscale: split YUYV output out of yuv2packed[12X]_c().

Conflicts:
doc/APIchanges
libavcodec/Makefile
libavcodec/h264dsp_template.c
libavcodec/mpeg12.c
libavformat/aacdec.c
libavformat/avidec.c
libavformat/internal.h
libavformat/movenc.c
libavformat/rtpenc.c
libavformat/rtpenc_latm.c
libavformat/sdp.c
libavformat/version.h
libavutil/avutil.h
libavutil/pixfmt.h
libswscale/swscale.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
34 files changed:
1  2 
doc/APIchanges
libavcodec/Makefile
libavcodec/ac3enc_opts_template.c
libavcodec/bitstream.c
libavcodec/h264dsp_template.c
libavcodec/mpeg12.c
libavcodec/x86/h264_deblock_10bit.asm
libavformat/aacdec.c
libavformat/avidec.c
libavformat/ffmdec.c
libavformat/internal.h
libavformat/mov.c
libavformat/movenc.c
libavformat/movenc.h
libavformat/mpeg.c
libavformat/mpegenc.c
libavformat/mpegts.c
libavformat/nsvdec.c
libavformat/rtpenc.c
libavformat/rtpenc.h
libavformat/rtpenc_chain.c
libavformat/rtpenc_latm.c
libavformat/rtsp.h
libavformat/rtspenc.c
libavformat/sdp.c
libavformat/utils.c
libavformat/version.h
libavutil/opt.c
libavutil/opt.h
libavutil/pixdesc.c
libavutil/pixfmt.h
libswscale/swscale.c
libswscale/swscale_internal.h
libswscale/utils.c

diff --cc doc/APIchanges
@@@ -13,10 -13,10 +13,13 @@@ libavutil:   2011-04-1
  
  API changes, most recent first:
  
 -2011-06-xx - xxxxxxx - lavu 51.5.0 - AVMetadata
+ 2011-06-xx - xxxxxxx - lavu 51.6.0 - opt.h
+   Add av_opt_flag_is_set().
 +2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
 +  Add avfilter_get_audio_buffer_ref_from_arrays() to avfilter.h.
 +
 +2011-06-09 - d9f80ea - lavu 51.8.0 - AVMetadata
    Move AVMetadata from lavf to lavu and rename it to
    AVDictionary -- new installed header dict.h.
    All av_metadata_* functions renamed to av_dict_*.
@@@ -555,10 -543,9 +555,10 @@@ OBJS-$(CONFIG_MPEGTS_MUXER)            
  OBJS-$(CONFIG_MPEGTS_DEMUXER)          += mpeg4audio.o mpegaudiodata.o
  OBJS-$(CONFIG_NUT_MUXER)               += mpegaudiodata.o
  OBJS-$(CONFIG_OGG_DEMUXER)             += flacdec.o flacdata.o flac.o \
 -                                          dirac.o mpeg12data.o
 -OBJS-$(CONFIG_OGG_MUXER)               += xiph.o flacdec.o flacdata.o flac.o
 +                                          dirac.o mpeg12data.o vorbis_data.o
 +OBJS-$(CONFIG_OGG_MUXER)               += xiph.o flacdec.o flacdata.o flac.o \
 +                                          vorbis_data.o
- OBJS-$(CONFIG_RTP_MUXER)               += mpegvideo.o xiph.o
+ OBJS-$(CONFIG_RTP_MUXER)               += mpeg4audio.o mpegvideo.o xiph.o
  OBJS-$(CONFIG_SPDIF_DEMUXER)           += aacadtsdec.o mpeg4audio.o
  OBJS-$(CONFIG_WEBM_MUXER)              += xiph.o mpeg4audio.o \
                                            flacdec.o flacdata.o flac.o \
@@@ -1,10 -1,10 +1,10 @@@
  /*
   * AC-3 encoder options
-  * Copyright (c) 2010 Justin Ruggles <justin.ruggles@gmail.com>
+  * Copyright (c) 2011 Justin Ruggles <justin.ruggles@gmail.com>
   *
 - * This file is part of Libav.
 + * This file is part of FFmpeg.
   *
 - * Libav is free software; you can redistribute it and/or
 + * FFmpeg is free software; you can redistribute it and/or
   * modify it under the terms of the GNU Lesser General Public
   * License as published by the Free Software Foundation; either
   * version 2.1 of the License, or (at your option) any later version.
Simple merge
@@@ -58,11 -58,12 +58,12 @@@ static void FUNCC(weight_h264_pixels #
          op_scale1(15); \
      } \
  } \
- static void FUNCC(biweight_h264_pixels ## W ## x ## H)(uint8_t *p_dst, uint8_t *p_src, int stride, int log2_denom, int weightd, int weights, int offset){ \
+ static void FUNCC(biweight_h264_pixels ## W ## x ## H)(uint8_t *_dst, uint8_t *_src, int stride, int log2_denom, int weightd, int weights, int offset){ \
      int y; \
-     pixel *dst = (pixel*)p_dst; \
-     pixel *src = (pixel*)p_src; \
+     pixel *dst = (pixel*)_dst; \
+     pixel *src = (pixel*)_src; \
 -    stride /= sizeof(pixel); \
 +    stride >>= sizeof(pixel)-1; \
+     offset <<= (BIT_DEPTH-8); \
      offset = ((offset + 1) | 1) << log2_denom; \
      for(y=0; y<H; y++, dst += stride, src += stride){ \
          op_scale2(0); \
Simple merge
@@@ -851,10 -858,10 +858,10 @@@ cglobal deblock_v_chroma_10_%1, 5,7-(mm
  .loop:
  %endif
      CHROMA_V_LOAD r5
 -    LOAD_AB     m4, m5, r2, r3
 +    LOAD_AB     m4, m5, r2d, r3d
      LOAD_MASK   m0, m1, m2, m3, m4, m5, m7, m6, m4
      pxor        m4, m4
-     LOAD_TC     m6, r4
+     CHROMA_V_LOAD_TC m6, r4
      psubw       m6, [pw_3]
      pmaxsw      m6, m4
      pand        m7, m6
Simple merge
@@@ -1254,11 -1197,9 +1247,9 @@@ static int avi_load_index(AVFormatConte
  
      if (avio_seek(pb, avi->movi_end, SEEK_SET) < 0)
          goto the_end; // maybe truncated file
- #ifdef DEBUG_SEEK
-     av_log(s, AV_LOG_DEBUG, "movi_end=0x%"PRIx64"\n", avi->movi_end);
- #endif
+     av_dlog(s, "movi_end=0x%"PRIx64"\n", avi->movi_end);
      for(;;) {
 -        if (pb->eof_reached)
 +        if (url_feof(pb))
              break;
          tag = avio_rl32(pb);
          size = avio_rl32(pb);
Simple merge
Simple merge
@@@ -1537,10 -1532,11 +1537,11 @@@ static void mov_build_index(MOVContext 
  
      /* adjust first dts according to edit list */
      if (sc->time_offset && mov->time_scale > 0) {
-         int rescaled = sc->time_offset < 0 ? av_rescale(sc->time_offset, sc->time_scale, mov->time_scale) : sc->time_offset;
-         current_dts = -rescaled;
+         if (sc->time_offset < 0)
+             sc->time_offset = av_rescale(sc->time_offset, sc->time_scale, mov->time_scale);
+         current_dts = -sc->time_offset;
          if (sc->ctts_data && sc->stts_data &&
 -            sc->ctts_data[0].duration / sc->stts_data[0].duration > 16) {
 +            sc->ctts_data[0].duration / FFMAX(sc->stts_data[0].duration, 1) > 16) {
              /* more than 16 frames delay, dts are likely wrong
                 this happens with files created by iMovie */
              sc->wrong_dts = 1;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -48,8 -49,14 +49,15 @@@ AVFormatContext *ff_rtp_chain_mux_open(
      rtpctx->max_delay = s->max_delay;
      /* Copy other stream parameters. */
      rtpctx->streams[0]->sample_aspect_ratio = st->sample_aspect_ratio;
 +    rtpctx->flags |= s->flags & AVFMT_FLAG_MP4A_LATM;
  
+     av_set_parameters(rtpctx, NULL);
+     /* Copy the rtpflags values straight through */
+     if (s->oformat->priv_class &&
+         av_find_opt(s->priv_data, "rtpflags", NULL, 0, 0))
+         av_set_int(rtpctx->priv_data, "rtpflags",
+                    av_get_int(s->priv_data, "rtpflags", NULL));
      /* Set the synchronized start time. */
      rtpctx->start_time_realtime = s->start_time_realtime;
  
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -24,8 -24,8 +24,8 @@@
  #include "libavutil/avutil.h"
  
  #define LIBAVFORMAT_VERSION_MAJOR 53
 -#define LIBAVFORMAT_VERSION_MINOR  1
 -#define LIBAVFORMAT_VERSION_MICRO  3
 +#define LIBAVFORMAT_VERSION_MINOR  3
- #define LIBAVFORMAT_VERSION_MICRO  0
++#define LIBAVFORMAT_VERSION_MICRO  1
  
  #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
                                                 LIBAVFORMAT_VERSION_MINOR, \
diff --cc libavutil/opt.c
Simple merge
diff --cc libavutil/opt.h
Simple merge
Simple merge
@@@ -132,20 -132,19 +132,24 @@@ enum PixelFormat 
      PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
      PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
      PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
 -    PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
 +    PIX_FMT_GRAY8A,    ///< 8bit gray, 8bit alpha
      PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
      PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
-     //the following 6 formats have the disadvantage of needing 1 format for each bit depth, thus
 +
++    //the following 10 formats have the disadvantage of needing 1 format for each bit depth, thus
 +    //If you want to support multiple bit depths, then using PIX_FMT_YUV420P16* with the bpp stored seperately
 +    //is better
      PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
      PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
      PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
      PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-     PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-     PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+     PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+     PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+     PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+     PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+     PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+     PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
 +
      PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
  };
  
@@@ -2220,20 -2161,22 +2313,24 @@@ static av_cold void sws_init_swScale_c(
          case PIX_FMT_PAL8     :
          case PIX_FMT_BGR4_BYTE:
          case PIX_FMT_RGB4_BYTE: c->chrToYV12 = palToUV_c; break;
 -        case PIX_FMT_YUV420P9BE: c->chrToYV12 = BE9ToUV_c; break;
 -        case PIX_FMT_YUV444P9LE:
 -        case PIX_FMT_YUV420P9LE: c->chrToYV12 = LE9ToUV_c; break;
 +        case PIX_FMT_GRAY16BE :
+         case PIX_FMT_YUV444P9BE:
 +        case PIX_FMT_YUV420P9BE:
+         case PIX_FMT_YUV444P10BE:
          case PIX_FMT_YUV422P10BE:
 -        case PIX_FMT_YUV420P10BE: c->chrToYV12 = BE10ToUV_c; break;
 -        case PIX_FMT_YUV422P10LE:
 -        case PIX_FMT_YUV444P10LE:
 -        case PIX_FMT_YUV420P10LE: c->chrToYV12 = LE10ToUV_c; break;
 +        case PIX_FMT_YUV420P10BE:
          case PIX_FMT_YUV420P16BE:
          case PIX_FMT_YUV422P16BE:
 -        case PIX_FMT_YUV444P16BE: c->chrToYV12 = BEToUV_c; break;
 +        case PIX_FMT_YUV444P16BE: c->hScale16= HAVE_BIGENDIAN ? hScale16_c : hScale16X_c; break;
 +        case PIX_FMT_GRAY16LE :
++        case PIX_FMT_YUV444P9LE:
 +        case PIX_FMT_YUV420P9LE:
 +        case PIX_FMT_YUV422P10LE:
 +        case PIX_FMT_YUV420P10LE:
++        case PIX_FMT_YUV444P10LE:
          case PIX_FMT_YUV420P16LE:
          case PIX_FMT_YUV422P16LE:
 -        case PIX_FMT_YUV444P16LE: c->chrToYV12 = LEToUV_c; break;
 +        case PIX_FMT_YUV444P16LE: c->hScale16= HAVE_BIGENDIAN ? hScale16X_c : hScale16_c; break;
      }
      if (c->chrSrcHSubSample) {
          switch(srcFormat) {
@@@ -368,15 -352,18 +368,21 @@@ const char *sws_format_name(enum PixelF
          || (x)==PIX_FMT_YUV422P16BE \
          || (x)==PIX_FMT_YUV444P16BE \
      )
 -#define is9_OR_10BPS(x) (           \
 +#define isNBPS(x)       (           \
             (x)==PIX_FMT_YUV420P9LE  \
          || (x)==PIX_FMT_YUV420P9BE  \
+         || (x)==PIX_FMT_YUV444P9BE  \
+         || (x)==PIX_FMT_YUV444P9LE  \
+         || (x)==PIX_FMT_YUV422P10BE \
+         || (x)==PIX_FMT_YUV422P10LE \
+         || (x)==PIX_FMT_YUV444P10BE \
+         || (x)==PIX_FMT_YUV444P10LE \
          || (x)==PIX_FMT_YUV420P10LE \
          || (x)==PIX_FMT_YUV420P10BE \
 +        || (x)==PIX_FMT_YUV422P10LE \
 +        || (x)==PIX_FMT_YUV422P10BE \
      )
 +#define is9_OR_10BPS isNBPS //for ronald
  #define isBE(x) ((x)&1)
  #define isPlanar8YUV(x) (           \
             (x)==PIX_FMT_YUV410P     \
  #define isPlanarYUV(x)  (           \
          isPlanar8YUV(x)             \
          || (x)==PIX_FMT_YUV420P9LE  \
+         || (x)==PIX_FMT_YUV444P9LE  \
          || (x)==PIX_FMT_YUV420P10LE \
+         || (x)==PIX_FMT_YUV422P10LE \
+         || (x)==PIX_FMT_YUV444P10LE \
          || (x)==PIX_FMT_YUV420P16LE \
 +        || (x)==PIX_FMT_YUV422P10LE \
          || (x)==PIX_FMT_YUV422P16LE \
          || (x)==PIX_FMT_YUV444P16LE \
          || (x)==PIX_FMT_YUV420P9BE  \
+         || (x)==PIX_FMT_YUV444P9BE  \
          || (x)==PIX_FMT_YUV420P10BE \
+         || (x)==PIX_FMT_YUV422P10BE \
+         || (x)==PIX_FMT_YUV444P10BE \
          || (x)==PIX_FMT_YUV420P16BE \
 +        || (x)==PIX_FMT_YUV422P10BE \
          || (x)==PIX_FMT_YUV422P16BE \
          || (x)==PIX_FMT_YUV444P16BE \
      )
Simple merge