Merge remote branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 11 May 2011 03:34:17 +0000 (05:34 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 11 May 2011 03:47:02 +0000 (05:47 +0200)
* qatar/master: (30 commits)
  AVOptions: make default_val a union, as proposed in AVOption2.
  arm/h264pred: add missing argument type.
  h264dsp_mmx: place bracket outside #if/#endif block.
  lavf/utils: fix ff_interleave_compare_dts corner case.
  fate: add 10-bit H264 tests.
  h264: do not print "too many references" warning for intra-only.
  Enable decoding of high bit depth h264.
  Adds 8-, 9- and 10-bit versions of some of the functions used by the h264 decoder.
  Add support for higher QP values in h264.
  Add the notion of pixel size in h264 related functions.
  Make the h264 loop filter bit depth aware.
  Template dsputil_template.c with respect to pixel size, etc.
  Template h264idct_template.c with respect to pixel size, etc.
  Preparatory patch for high bit depth h264 decoding support.
  Move some functions in dsputil.c into a new file dsputil_template.c.
  Move the functions in h264idct into a new file h264idct_template.c.
  Move the functions in h264pred.c into a new file h264pred_template.c.
  Preparatory patch for high bit depth h264 decoding support.
  Add pixel formats for 9- and 10-bit yuv420p.
  Choose h264 chroma dc dequant function dynamically.
  ...

Conflicts:
doc/APIchanges
ffmpeg.c
ffplay.c
libavcodec/alpha/dsputil_alpha.c
libavcodec/arm/dsputil_init_arm.c
libavcodec/arm/dsputil_init_armv6.c
libavcodec/arm/dsputil_init_neon.c
libavcodec/arm/dsputil_iwmmxt.c
libavcodec/arm/h264pred_init_arm.c
libavcodec/bfin/dsputil_bfin.c
libavcodec/dsputil.c
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_cabac.c
libavcodec/h264_cavlc.c
libavcodec/h264_loopfilter.c
libavcodec/h264_ps.c
libavcodec/h264_refs.c
libavcodec/h264dsp.c
libavcodec/h264idct.c
libavcodec/h264pred.c
libavcodec/mlib/dsputil_mlib.c
libavcodec/options.c
libavcodec/ppc/dsputil_altivec.c
libavcodec/ppc/dsputil_ppc.c
libavcodec/ppc/h264_altivec.c
libavcodec/ps2/dsputil_mmi.c
libavcodec/sh4/dsputil_align.c
libavcodec/sh4/dsputil_sh4.c
libavcodec/sparc/dsputil_vis.c
libavcodec/utils.c
libavcodec/version.h
libavcodec/x86/dsputil_mmx.c
libavformat/options.c
libavformat/utils.c
libavutil/pixfmt.h
libswscale/swscale.c
libswscale/swscale_internal.h
libswscale/swscale_template.c
tests/ref/seek/lavf_avi

Merged-by: Michael Niedermayer <michaelni@gmx.at>
43 files changed:
1  2 
doc/APIchanges
ffmpeg.c
libavcodec/alacenc.c
libavcodec/alpha/dsputil_alpha.c
libavcodec/arm/dsputil_init_arm.c
libavcodec/arm/dsputil_init_armv6.c
libavcodec/arm/dsputil_init_neon.c
libavcodec/arm/dsputil_iwmmxt.c
libavcodec/arm/h264pred_init_arm.c
libavcodec/avcodec.h
libavcodec/bfin/dsputil_bfin.c
libavcodec/dsputil.c
libavcodec/flacenc.c
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_cabac.c
libavcodec/h264_cavlc.c
libavcodec/h264_loopfilter.c
libavcodec/h264_ps.c
libavcodec/h264_refs.c
libavcodec/h264dsp.c
libavcodec/h264dsp.h
libavcodec/h264idct.c
libavcodec/h264pred.c
libavcodec/lpc.c
libavcodec/lpc.h
libavcodec/mlib/dsputil_mlib.c
libavcodec/options.c
libavcodec/ppc/dsputil_altivec.c
libavcodec/ppc/dsputil_ppc.c
libavcodec/ppc/h264_altivec.c
libavcodec/ps2/dsputil_mmi.c
libavcodec/ra144enc.c
libavcodec/sh4/dsputil_align.c
libavcodec/sh4/dsputil_sh4.c
libavcodec/sparc/dsputil_vis.c
libavcodec/utils.c
libavcodec/version.h
libavcodec/x86/dsputil_mmx.c
libavformat/utils.c
libavutil/opt.h
libavutil/pixfmt.h
libswscale/utils.c

diff --cc doc/APIchanges
@@@ -13,30 -13,12 +13,36 @@@ libavutil:   2011-04-1
  
  API changes, most recent first:
  
+ 2011-05-10 - xxxxxxx - lavc 53.3.0 - avcodec.h
+   Deprecate AVLPCType and the following fields in
+   AVCodecContext: lpc_coeff_precision, prediction_order_method,
+   min_partition_order, max_partition_order, lpc_type, lpc_passes.
+   Corresponding FLAC encoder options should be used instead.
 +2011-05-07 - xxxxxxx - lavfi 2.5.0 - avcodec.h
 +  Add libavfilter/avcodec.h header and avfilter_copy_frame_props()
 +  function.
 +
 +2011-05-07 - xxxxxxx - lavc 53.5.0 - AVFrame
 +  Add format field to AVFrame.
 +
 +2011-05-07 - xxxxxxx - lavc 53.4.0 - AVFrame
 +  Add width and height fields to AVFrame.
 +
 +2011-05-01 - xxxxxxx - lavfi 2.4.0 - avfilter.h
 +  Rename AVFilterBufferRefVideoProps.pixel_aspect to
 +  sample_aspect_ratio.
 +
 +2011-05-01 - xxxxxxx - lavc 53.3.0 - AVFrame
 +  Add a sample_aspect_ratio field to AVFrame.
 +
 +2011-05-01 - xxxxxxx - lavc 53.2.0 - AVFrame
 +  Add a pkt_pos field to AVFrame.
 +
 +2011-04-xx - xxxxxxx - lavu 51.2.0 - mem.h
 +  Add av_dynarray_add function for adding
 +  an element to a dynamic array.
 +
  2011-04-XX - bebe72f - lavu 51.1.0 - avutil.h
    Add AVPictureType enum and av_get_picture_type_char(), deprecate
    FF_*_TYPE defines and av_get_pict_type_char() defined in
diff --cc ffmpeg.c
+++ b/ffmpeg.c
@@@ -291,8 -282,6 +291,7 @@@ typedef struct AVOutputStream 
      int resample_width;
      int resample_pix_fmt;
  
 +    float frame_aspect_ratio;
      /* forced key frames */
      int64_t *forced_kf_pts;
      int forced_kf_count;
@@@ -1505,9 -1417,9 +1504,9 @@@ static int output_packet(AVInputStream 
      AVFormatContext *os;
      AVOutputStream *ost;
      int ret, i;
-     int got_picture;
+     int got_output;
      AVFrame picture;
 -    void *buffer_to_free;
 +    void *buffer_to_free = NULL;
      static unsigned int samples_size= 0;
      AVSubtitle subtitle, *subtitle_to_free;
      int64_t pkt_pts = AV_NOPTS_VALUE;
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -425,30 -439,8 +439,30 @@@ static av_cold int flac_encode_init(AVC
      if (!avctx->coded_frame)
          return AVERROR(ENOMEM);
  
 +    if (channels == 3 &&
 +            avctx->channel_layout != (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER) ||
 +        channels == 4 &&
 +            avctx->channel_layout != AV_CH_LAYOUT_2_2 &&
 +            avctx->channel_layout != AV_CH_LAYOUT_QUAD ||
 +        channels == 5 &&
 +            avctx->channel_layout != AV_CH_LAYOUT_5POINT0 &&
 +            avctx->channel_layout != AV_CH_LAYOUT_5POINT0_BACK ||
 +        channels == 6 &&
 +            avctx->channel_layout != AV_CH_LAYOUT_5POINT1 &&
 +            avctx->channel_layout != AV_CH_LAYOUT_5POINT1_BACK) {
 +        if (avctx->channel_layout) {
 +            av_log(avctx, AV_LOG_ERROR, "Channel layout not supported by Flac, "
 +                                             "output stream will have incorrect "
 +                                             "channel layout.\n");
 +        } else {
 +            av_log(avctx, AV_LOG_WARNING, "No channel layout specified. The encoder "
 +                                               "will use Flac channel layout for "
 +                                               "%d channels.\n", channels);
 +        }
 +    }
 +
      ret = ff_lpc_init(&s->lpc_ctx, avctx->frame_size,
-                       s->options.max_prediction_order, AV_LPC_TYPE_LEVINSON);
+                       s->options.max_prediction_order, FF_LPC_TYPE_LEVINSON);
  
      dprint_compression_options(s);
  
@@@ -584,11 -894,11 +584,12 @@@ av_cold int ff_h264_decode_init(AVCodec
  
      ff_h264_decode_init_vlc();
  
 +    h->sps.bit_depth_luma = avctx->bits_per_raw_sample = 8;
      h->pixel_shift = 0;
+     h->sps.bit_depth_luma = avctx->bits_per_raw_sample = 8;
  
      h->thread_context[0] = h;
 -    h->outputed_poc = INT_MIN;
 +    h->outputed_poc = h->next_outputed_poc = INT_MIN;
      h->prev_poc_msb= 1<<16;
      h->x264_build = -1;
      ff_h264_reset_sei(h);
@@@ -1237,15 -1275,12 +1243,15 @@@ static av_always_inline void hl_decode_
                                  nnz = h->non_zero_count_cache[ scan8[i] ];
                                  if(nnz){
                                      if(is_h264){
-                                         if(nnz == 1 && dctcoef_get(h, h->mb, i*16, pixel_shift))
-                                             idct_dc_add(ptr, h->mb + (i*16<<pixel_shift), linesize);
+                                         if(nnz == 1 && dctcoef_get(h->mb, pixel_shift, i*16))
+                                             idct_dc_add(ptr, h->mb + (i*16 << pixel_shift), linesize);
                                          else
 -                                            idct_add   (ptr, h->mb + (i*16 << pixel_shift), linesize);
 -                                    }else
 +                                            idct_add   (ptr, h->mb + (i*16<<pixel_shift), linesize);
 +                                    }
 +#if CONFIG_SVQ3_DECODER
 +                                    else
                                          ff_svq3_add_idct_c(ptr, h->mb + i*16, linesize, s->qscale, 0);
 +#endif
                                  }
                              }
                          }
                              static const uint8_t dc_mapping[16] = { 0*16, 1*16, 4*16, 5*16, 2*16, 3*16, 6*16, 7*16,
                                                                      8*16, 9*16,12*16,13*16,10*16,11*16,14*16,15*16};
                              for(i = 0; i < 16; i++)
-                                 dctcoef_set(h, h->mb, dc_mapping[i], dctcoef_get(h, h->mb_luma_dc, i,pixel_shift),pixel_shift);
+                                 dctcoef_set(h->mb, pixel_shift, dc_mapping[i], dctcoef_get(h->mb_luma_dc, pixel_shift, i));
                          }
                      }
 -                }else
 +                }
 +#if CONFIG_SVQ3_DECODER
 +                else
                      ff_svq3_luma_dc_dequant_idct_c(h->mb, h->mb_luma_dc, s->qscale);
 +#endif
              }
              if(h->deblocking_filter)
                  xchg_mb_border(h, dest_y, dest_cb, dest_cr, linesize, uvlinesize, 0, simple, pixel_shift);
@@@ -2556,11 -2562,10 +2566,12 @@@ static void loop_filter(H264Context *h)
      int linesize, uvlinesize, mb_x, mb_y;
      const int end_mb_y= s->mb_y + FRAME_MBAFF;
      const int old_slice_type= h->slice_type;
 +    const int end_mb_x  = s->mb_x;
+     const int pixel_shift = h->pixel_shift;
  
      if(h->deblocking_filter) {
 -        for(mb_x= 0; mb_x<s->mb_width; mb_x++){
 +        int start_x= s->resync_mb_y == s->mb_y ? s->resync_mb_x : 0;
 +        for(mb_x= start_x; mb_x<end_mb_x; mb_x++){
              for(mb_y=end_mb_y - FRAME_MBAFF; mb_y<= end_mb_y; mb_y++){
                  int mb_xy, mb_type;
                  mb_xy = h->mb_xy = mb_x + mb_y*s->mb_stride;
Simple merge
@@@ -1101,12 -1101,12 +1101,13 @@@ static av_always_inline void decode_cab
          }
      }
  
 +
  #define STORE_BLOCK(type) \
-     do {\
-         uint8_t *ctx = coeff_abs_level1_ctx[node_ctx] + abs_level_m1_ctx_base;\
- \
-         int j= scantable[index[--coeff_count]];\
+     do { \
+         uint8_t *ctx = coeff_abs_level1_ctx[node_ctx] + abs_level_m1_ctx_base; \
+  \
+         int j= scantable[index[--coeff_count]]; \
+  \
          if( get_cabac( CC, ctx ) == 0 ) { \
              node_ctx = coeff_abs_level_transition[0][node_ctx]; \
              if( is_dc ) { \
              }else{ \
                  ((type*)block)[j] = ((int)(get_cabac_bypass_sign( CC, -coeff_abs ) * qmul[j] + 32)) >> 6; \
              } \
-         }\
-     } while( coeff_count );
+         } \
+     } while ( coeff_count );
  
 -    if (h->pixel_shift) {
 -        STORE_BLOCK(int32_t)
 -    } else {
 -        STORE_BLOCK(int16_t)
 -    }
 +        if (h->pixel_shift) {
 +            STORE_BLOCK(int32_t)
 +        } else {
 +            STORE_BLOCK(int16_t)
 +        }
  #ifdef CABAC_ON_STACK
              h->cabac.range     = cc.range     ;
              h->cabac.low       = cc.low       ;
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
@@@ -2441,8 -2537,9 +2441,8 @@@ void dsputil_init_mmx(DSPContext* c, AV
  #endif
  
          c->add_bytes= add_bytes_mmx;
 -        c->add_bytes_l2= add_bytes_l2_mmx;
  
-         if (!h264_high_depth)
+         if (!high_bit_depth)
          c->draw_edges = draw_edges_mmx;
  
          if (CONFIG_H263_DECODER || CONFIG_H263_ENCODER) {
              H264_QPEL_FUNCS(3, 2, ssse3);
              H264_QPEL_FUNCS(3, 3, ssse3);
              }
 -            c->add_png_paeth_prediction= add_png_paeth_prediction_ssse3;
  #if HAVE_YASM
-             if (!h264_high_depth) {
+             if (!high_bit_depth) {
              c->put_h264_chroma_pixels_tab[0]= ff_put_h264_chroma_mc8_ssse3_rnd;
              c->avg_h264_chroma_pixels_tab[0]= ff_avg_h264_chroma_mc8_ssse3_rnd;
              c->put_h264_chroma_pixels_tab[1]= ff_put_h264_chroma_mc4_ssse3;
Simple merge
diff --cc libavutil/opt.h
Simple merge
@@@ -128,15 -128,13 +128,15 @@@ enum PixelFormat 
      PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
      PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
  
 -    PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
      PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
 -    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
 +    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_Y400A,     ///< 8bit gray, 8bit alpha
 +    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
 +    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 4 formats are deprecated and should be replaced by PIX_FMT_YUV420P16* with the bpp stored seperately
 +
++    //the following 6 formats are deprecated and should be replaced by PIX_FMT_YUV420P16* with the bpp stored seperately
      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
Simple merge