Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 4 Apr 2012 19:17:52 +0000 (21:17 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 4 Apr 2012 19:17:52 +0000 (21:17 +0200)
* qatar/master:
  w32threads: Make pthread_cond_wait follow POSIX
  cosmetics: Consistently place static, inline and av_cold attributes/keywords.
  sbrdsp: Use standard multiple inclusion guards.
  pcm: K&R formatting cosmetics
  rawdec: Support fourccs YV16 and YV24
  rtmp: implement bandwidth notification
  rtmp: update supported audio codecs value

Conflicts:
libavcodec/pcm.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
15 files changed:
1  2 
libavcodec/aacdec.c
libavcodec/arm/dcadsp_init_arm.c
libavcodec/arm/dsputil_init_armv5te.c
libavcodec/arm/dsputil_init_armv6.c
libavcodec/ffv1.c
libavcodec/fmtconvert.h
libavcodec/h264.c
libavcodec/ivi_common.c
libavcodec/mpegaudiodsp_template.c
libavcodec/pcm.c
libavcodec/tiffenc.c
libavcodec/wmaprodec.c
libavdevice/fbdev.c
libavformat/rtmpproto.c
libavutil/lfg.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -96,11 -96,13 +96,11 @@@ static int pcm_encode_frame(AVCodecCont
      n           = frame->nb_samples * avctx->channels;
      samples     = (const short *)frame->data[0];
  
 -    if ((ret = ff_alloc_packet(avpkt, n * sample_size))) {
 -        av_log(avctx, AV_LOG_ERROR, "Error getting output packet\n");
 +    if ((ret = ff_alloc_packet2(avctx, avpkt, n * sample_size)))
          return ret;
 -    }
      dst = avpkt->data;
  
-     switch(avctx->codec->id) {
+     switch (avctx->codec->id) {
      case CODEC_ID_PCM_U32LE:
          ENCODE(uint32_t, le32, samples, dst, n, 0, 0x80000000)
          break;
@@@ -338,15 -338,15 +338,15 @@@ static int pcm_decode_frame(AVCodecCont
          break;
      case CODEC_ID_PCM_S16LE_PLANAR:
      {
 -        const uint8_t *src2[MAX_CHANNELS];
 +        int i;
          n /= avctx->channels;
-         for(c=0;c<avctx->channels;c++) {
 -        for (c = 0; c < avctx->channels; c++)
 -            src2[c] = &src[c * n * 2];
 -        for (; n > 0; n--)
 -            for (c = 0; c < avctx->channels; c++) {
 -                AV_WN16A(samples, bytestream_get_le16(&src2[c]));
++        for (c = 0; c < avctx->channels; c++) {
 +            samples = s->frame.data[c];
-             for(i=n;i>0;i--) {
++            for (i = n; i > 0; i--) {
 +                AV_WN16A(samples, bytestream_get_le16(&src));
                  samples += 2;
              }
 +        }
          break;
      }
      case CODEC_ID_PCM_U16LE:
      case CODEC_ID_PCM_LXF:
      {
          int i;
 -        const uint8_t *src8;
 -        dst_int32_t = (int32_t *)s->frame.data[0];
          n /= avctx->channels;
 -        // unpack and de-planarize
 -        for (i = 0; i < n; i++) {
 -            for (c = 0, src8 = src + i * 5; c < avctx->channels; c++, src8 += n * 5) {
 -                // extract low 20 bits and expand to 32 bits
 -                *dst_int32_t++ = (src8[2] << 28)        |
 -                                 (src8[1] << 20)        |
 -                                 (src8[0] << 12)        |
 -                                 ((src8[2] & 0xF) << 8) |
 -                                 src8[1];
 -            }
 -            for (c = 0, src8 = src + i * 5; c < avctx->channels; c++, src8 += n * 5) {
 -                // extract high 20 bits and expand to 32 bits
 -                *dst_int32_t++ = (src8[4] << 24)         |
 -                                 (src8[3] << 16)         |
 -                                 ((src8[2] & 0xF0) << 8) |
 -                                 (src8[4] << 4)          |
 -                                 (src8[3] >> 4);
 +        //unpack
 +        for (c = 0; c < avctx->channels; c++) {
 +            dst_int32_t = (int32_t *)s->frame.data[c];
 +            for (i = 0; i < n; i++) {
 +                //extract low 20 bits and expand to 32 bits
-                 *dst_int32_t++ = (src[2] << 28) | (src[1] << 20) | (src[0] << 12) |
-                                  ((src[2] & 0xF) << 8) | src[1];
++                *dst_int32_t++ = (src[2] << 28) |
++                                 (src[1] << 20) |
++                                 (src[0] << 12) |
++                                 ((src[2] & 0xF) << 8) |
++                                 src[1];
 +                //extract high 20 bits and expand to 32 bits
-                 *dst_int32_t++ = (src[4] << 24) | (src[3] << 16) |
-                                  ((src[2] & 0xF0) << 8) | (src[4] << 4) | (src[3] >> 4);
++                *dst_int32_t++ = (src[4] << 24) |
++                                 (src[3] << 16) |
++                                 ((src[2] & 0xF0) << 8) |
++                                 (src[4] << 4) |
++                                 (src[3] >> 4);
 +                src += 5;
              }
          }
          break;
@@@ -487,48 -495,50 +493,51 @@@ AVCodec ff_ ## name_ ## _encoder = 
  #endif
  
  #if CONFIG_DECODERS
- #define PCM_DECODER(id_,sample_fmt_,name_,long_name_)         \
- AVCodec ff_ ## name_ ## _decoder = {            \
-     .name           = #name_,                   \
-     .type           = AVMEDIA_TYPE_AUDIO,       \
-     .id             = id_,                      \
-     .priv_data_size = sizeof(PCMDecode),        \
-     .init           = pcm_decode_init,          \
-     .decode         = pcm_decode_frame,         \
-     .capabilities   = CODEC_CAP_DR1,            \
-     .sample_fmts = (const enum AVSampleFormat[]){sample_fmt_,AV_SAMPLE_FMT_NONE}, \
-     .long_name = NULL_IF_CONFIG_SMALL(long_name_), \
+ #define PCM_DECODER(id_, sample_fmt_, name_, long_name_)                    \
+ AVCodec ff_ ## name_ ## _decoder = {                                        \
+     .name           = #name_,                                               \
+     .type           = AVMEDIA_TYPE_AUDIO,                                   \
+     .id             = id_,                                                  \
+     .priv_data_size = sizeof(PCMDecode),                                    \
+     .init           = pcm_decode_init,                                      \
+     .decode         = pcm_decode_frame,                                     \
+     .capabilities   = CODEC_CAP_DR1,                                        \
+     .sample_fmts    = (const enum AVSampleFormat[]){ sample_fmt_,           \
+                                                      AV_SAMPLE_FMT_NONE },  \
+     .long_name      = NULL_IF_CONFIG_SMALL(long_name_),                     \
  }
  #else
- #define PCM_DECODER(id,sample_fmt_,name,long_name_)
+ #define PCM_DECODER(id, sample_fmt_, name, long_name_)
  #endif
  
- #define PCM_CODEC(id, sample_fmt_, name, long_name_)         \
-     PCM_ENCODER(id,sample_fmt_,name,long_name_); PCM_DECODER(id,sample_fmt_,name,long_name_)
+ #define PCM_CODEC(id, sample_fmt_, name, long_name_)                    \
+     PCM_ENCODER(id, sample_fmt_, name, long_name_);                     \
+     PCM_DECODER(id, sample_fmt_, name, long_name_)
  
  /* Note: Do not forget to add new entries to the Makefile as well. */
- PCM_CODEC  (CODEC_ID_PCM_ALAW,  AV_SAMPLE_FMT_S16, pcm_alaw, "PCM A-law / G.711 A-law");
- PCM_DECODER(CODEC_ID_PCM_DVD,   AV_SAMPLE_FMT_S32, pcm_dvd, "PCM signed 20|24-bit big-endian");
- PCM_CODEC  (CODEC_ID_PCM_F32BE, AV_SAMPLE_FMT_FLT, pcm_f32be, "PCM 32-bit floating point big-endian");
- PCM_CODEC  (CODEC_ID_PCM_F32LE, AV_SAMPLE_FMT_FLT, pcm_f32le, "PCM 32-bit floating point little-endian");
- PCM_CODEC  (CODEC_ID_PCM_F64BE, AV_SAMPLE_FMT_DBL, pcm_f64be, "PCM 64-bit floating point big-endian");
- PCM_CODEC  (CODEC_ID_PCM_F64LE, AV_SAMPLE_FMT_DBL, pcm_f64le, "PCM 64-bit floating point little-endian");
- PCM_DECODER(CODEC_ID_PCM_LXF,   AV_SAMPLE_FMT_S32P, pcm_lxf, "PCM signed 20-bit little-endian planar");
- PCM_CODEC  (CODEC_ID_PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw, "PCM mu-law / G.711 mu-law");
- PCM_CODEC  (CODEC_ID_PCM_S8,    AV_SAMPLE_FMT_U8,  pcm_s8, "PCM signed 8-bit");
- PCM_CODEC  (CODEC_ID_PCM_S16BE, AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian");
- PCM_CODEC  (CODEC_ID_PCM_S16LE, AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian");
- PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P, pcm_s16le_planar, "PCM 16-bit little-endian planar");
- PCM_CODEC  (CODEC_ID_PCM_S24BE, AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian");
- PCM_CODEC  (CODEC_ID_PCM_S24DAUD, AV_SAMPLE_FMT_S16,  pcm_s24daud, "PCM D-Cinema audio signed 24-bit");
- PCM_CODEC  (CODEC_ID_PCM_S24LE, AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian");
- PCM_CODEC  (CODEC_ID_PCM_S32BE, AV_SAMPLE_FMT_S32, pcm_s32be, "PCM signed 32-bit big-endian");
- PCM_CODEC  (CODEC_ID_PCM_S32LE, AV_SAMPLE_FMT_S32, pcm_s32le, "PCM signed 32-bit little-endian");
- PCM_CODEC  (CODEC_ID_PCM_U8,    AV_SAMPLE_FMT_U8,  pcm_u8, "PCM unsigned 8-bit");
- PCM_CODEC  (CODEC_ID_PCM_U16BE, AV_SAMPLE_FMT_S16, pcm_u16be, "PCM unsigned 16-bit big-endian");
- PCM_CODEC  (CODEC_ID_PCM_U16LE, AV_SAMPLE_FMT_S16, pcm_u16le, "PCM unsigned 16-bit little-endian");
- PCM_CODEC  (CODEC_ID_PCM_U24BE, AV_SAMPLE_FMT_S32, pcm_u24be, "PCM unsigned 24-bit big-endian");
- PCM_CODEC  (CODEC_ID_PCM_U24LE, AV_SAMPLE_FMT_S32, pcm_u24le, "PCM unsigned 24-bit little-endian");
- PCM_CODEC  (CODEC_ID_PCM_U32BE, AV_SAMPLE_FMT_S32, pcm_u32be, "PCM unsigned 32-bit big-endian");
- PCM_CODEC  (CODEC_ID_PCM_U32LE, AV_SAMPLE_FMT_S32, pcm_u32le, "PCM unsigned 32-bit little-endian");
- PCM_DECODER(CODEC_ID_PCM_ZORK,  AV_SAMPLE_FMT_U8,  pcm_zork,  "PCM Zork");
 -PCM_CODEC  (CODEC_ID_PCM_ALAW,         AV_SAMPLE_FMT_S16, pcm_alaw,         "PCM A-law");
++PCM_CODEC  (CODEC_ID_PCM_ALAW,         AV_SAMPLE_FMT_S16, pcm_alaw,         "PCM A-law / G.711 A-law");
+ PCM_DECODER(CODEC_ID_PCM_DVD,          AV_SAMPLE_FMT_S32, pcm_dvd,          "PCM signed 20|24-bit big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_F32BE,        AV_SAMPLE_FMT_FLT, pcm_f32be,        "PCM 32-bit floating point big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_F32LE,        AV_SAMPLE_FMT_FLT, pcm_f32le,        "PCM 32-bit floating point little-endian");
+ PCM_CODEC  (CODEC_ID_PCM_F64BE,        AV_SAMPLE_FMT_DBL, pcm_f64be,        "PCM 64-bit floating point big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_F64LE,        AV_SAMPLE_FMT_DBL, pcm_f64le,        "PCM 64-bit floating point little-endian");
 -PCM_DECODER(CODEC_ID_PCM_LXF,          AV_SAMPLE_FMT_S32, pcm_lxf,          "PCM signed 20-bit little-endian planar");
 -PCM_CODEC  (CODEC_ID_PCM_MULAW,        AV_SAMPLE_FMT_S16, pcm_mulaw,        "PCM mu-law");
++PCM_DECODER(CODEC_ID_PCM_LXF,          AV_SAMPLE_FMT_S32P,pcm_lxf,          "PCM signed 20-bit little-endian planar");
++PCM_CODEC  (CODEC_ID_PCM_MULAW,        AV_SAMPLE_FMT_S16, pcm_mulaw,        "PCM mu-law / G.711 mu-law");
+ PCM_CODEC  (CODEC_ID_PCM_S8,           AV_SAMPLE_FMT_U8,  pcm_s8,           "PCM signed 8-bit");
+ PCM_CODEC  (CODEC_ID_PCM_S16BE,        AV_SAMPLE_FMT_S16, pcm_s16be,        "PCM signed 16-bit big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_S16LE,        AV_SAMPLE_FMT_S16, pcm_s16le,        "PCM signed 16-bit little-endian");
 -PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16, pcm_s16le_planar, "PCM 16-bit little-endian planar");
++PCM_DECODER(CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P,pcm_s16le_planar, "PCM 16-bit little-endian planar");
+ PCM_CODEC  (CODEC_ID_PCM_S24BE,        AV_SAMPLE_FMT_S32, pcm_s24be,        "PCM signed 24-bit big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_S24DAUD,      AV_SAMPLE_FMT_S16, pcm_s24daud,      "PCM D-Cinema audio signed 24-bit");
+ PCM_CODEC  (CODEC_ID_PCM_S24LE,        AV_SAMPLE_FMT_S32, pcm_s24le,        "PCM signed 24-bit little-endian");
+ PCM_CODEC  (CODEC_ID_PCM_S32BE,        AV_SAMPLE_FMT_S32, pcm_s32be,        "PCM signed 32-bit big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_S32LE,        AV_SAMPLE_FMT_S32, pcm_s32le,        "PCM signed 32-bit little-endian");
+ PCM_CODEC  (CODEC_ID_PCM_U8,           AV_SAMPLE_FMT_U8,  pcm_u8,           "PCM unsigned 8-bit");
+ PCM_CODEC  (CODEC_ID_PCM_U16BE,        AV_SAMPLE_FMT_S16, pcm_u16be,        "PCM unsigned 16-bit big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_U16LE,        AV_SAMPLE_FMT_S16, pcm_u16le,        "PCM unsigned 16-bit little-endian");
+ PCM_CODEC  (CODEC_ID_PCM_U24BE,        AV_SAMPLE_FMT_S32, pcm_u24be,        "PCM unsigned 24-bit big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_U24LE,        AV_SAMPLE_FMT_S32, pcm_u24le,        "PCM unsigned 24-bit little-endian");
+ PCM_CODEC  (CODEC_ID_PCM_U32BE,        AV_SAMPLE_FMT_S32, pcm_u32be,        "PCM unsigned 32-bit big-endian");
+ PCM_CODEC  (CODEC_ID_PCM_U32LE,        AV_SAMPLE_FMT_S32, pcm_u32le,        "PCM unsigned 32-bit little-endian");
+ PCM_DECODER(CODEC_ID_PCM_ZORK,         AV_SAMPLE_FMT_U8,  pcm_zork,         "PCM Zork");
++
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc libavutil/lfg.c
Simple merge