]> git.sesse.net Git - ffmpeg/commitdiff
Merge remote-tracking branch 'qatar/master'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 5 Apr 2012 20:26:50 +0000 (22:26 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 5 Apr 2012 20:26:50 +0000 (22:26 +0200)
* qatar/master:
  h264: Factorize declaration of mb_sizes array.
  vsrc_buffer: when no frame is available, return an error instead of segfaulting.
  configure: add dl to frei0r extralibs.
  dsputil x86: use SSE float instruction instead of SSE2 integer equivalent
  dsputil x86: remove deprecated parameter from scalarproduct_int16 prototype
  vp8dsp x86: perform rounding shift with a single instruction
  fate: add BMP tests.
  swscale: handle complete dimensions for monoblack/white.
  aacenc: Mark deinterleave_input_samples argument as const.
  vf_unsharp: Mark readonly variable as const.
  h264: fix 4:2:2 PCM-macroblocks decoding

Conflicts:
configure
libavcodec/h264.h
libavcodec/x86/dsputil_mmx.c
libavfilter/vf_unsharp.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
12 files changed:
1  2 
configure
libavcodec/aacenc.c
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_cabac.c
libavcodec/h264_cavlc.c
libavcodec/x86/dsputil_mmx.c
libavcodec/x86/vp8dsp.asm
libavfilter/vf_unsharp.c
libswscale/input.c
libswscale/output.c
tests/Makefile

diff --cc configure
index 201217569664a9de0a2aeb7ea98038296004419c,e207ed82fed35a5cde35547c210995a17cf76feb..c31bf5d916b6d1a74ecc50201a6e80b0e3f150ad
+++ b/configure
@@@ -1674,17 -1525,13 +1674,19 @@@ colormatrix_filter_deps="gpl
  cropdetect_filter_deps="gpl"
  delogo_filter_deps="gpl"
  drawtext_filter_deps="libfreetype"
 -frei0r_filter_deps="frei0r dlopen strtok_r"
 +frei0r_filter_deps="frei0r dlopen"
+ frei0r_filter_extralibs='$ldl'
 -frei0r_src_filter_deps="frei0r dlopen strtok_r"
 +frei0r_src_filter_deps="frei0r dlopen"
+ frei0r_src_filter_extralibs='$ldl'
  hqdn3d_filter_deps="gpl"
 +movie_filter_deps="avcodec avformat"
 +mp_filter_deps="gpl avcodec swscale postproc"
 +mptestsrc_filter_deps="gpl"
 +negate_filter_deps="lut_filter"
  ocv_filter_deps="libopencv"
 +pan_filter_deps="swresample"
  scale_filter_deps="swscale"
 +tinterlace_filter_deps="gpl"
  yadif_filter_deps="gpl"
  
  # libraries
index fd72dafd17ff4b50539b776619c9b6a37261081f,bc99a443b3a0906542bb5786c604ce9a07aa31a5..3ac2ad890dcead90213302f6bdee3c46501b7d5b
@@@ -475,9 -475,9 +475,9 @@@ static void put_bitstream_info(AVCodecC
  
  /*
   * Deinterleave input samples.
 - * Channels are reordered from Libav's default order to AAC order.
 + * Channels are reordered from libavcodec's default order to AAC order.
   */
- static void deinterleave_input_samples(AACEncContext *s, AVFrame *frame)
+ static void deinterleave_input_samples(AACEncContext *s, const AVFrame *frame)
  {
      int ch, i;
      const int sinc = s->channels;
index fc612905ab05cfe7c83a1af3e4f0ce5d2c71c521,890dd223f34356df9dbf08d2c083cf439677b97c..b909600b3ed0060438abb9fc9d5d907f2166eb68
@@@ -2122,11 -2139,12 +2124,12 @@@ static av_always_inline void hl_decode_
      }
  
      if (!simple && IS_INTRA_PCM(mb_type)) {
 +        const int bit_depth = h->sps.bit_depth_luma;
          if (pixel_shift) {
 -            const int bit_depth = h->sps.bit_depth_luma;
              int j;
              GetBitContext gb;
-             init_get_bits(&gb, (uint8_t *)h->mb, 384 * bit_depth);
+             init_get_bits(&gb, (uint8_t *)h->mb,
+                           ff_h264_mb_sizes[h->sps.chroma_format_idc] * bit_depth);
  
              for (i = 0; i < 16; i++) {
                  uint16_t *tmp_y = (uint16_t *)(dest_y + i * linesize);
              }
          } else {
              for (i = 0; i < 16; i++)
-                 memcpy(dest_y + i * linesize, h->mb + i * 8, 16);
+                 memcpy(dest_y + i * linesize, (uint8_t *)h->mb + i * 16, 16);
              if (simple || !CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
                  if (!h->sps.chroma_format_idc) {
 -                    for (i = 0; i < block_h; i++) {
 -                        memset(dest_cb + i * uvlinesize, 128, 8);
 -                        memset(dest_cr + i * uvlinesize, 128, 8);
 +                    for (i = 0; i < 8; i++) {
 +                        memset(dest_cb + i*uvlinesize, 1 << (bit_depth - 1), 8);
 +                        memset(dest_cr + i*uvlinesize, 1 << (bit_depth - 1), 8);
                      }
                  } else {
+                     uint8_t *src_cb = (uint8_t *)h->mb + 256;
+                     uint8_t *src_cr = (uint8_t *)h->mb + 256 + block_h * 8;
                      for (i = 0; i < block_h; i++) {
-                         memcpy(dest_cb + i * uvlinesize, h->mb + 128 + i * 4, 8);
-                         memcpy(dest_cr + i * uvlinesize, h->mb + 160 + i * 4, 8);
+                         memcpy(dest_cb + i * uvlinesize, src_cb + i * 8, 8);
+                         memcpy(dest_cr + i * uvlinesize, src_cr + i * 8, 8);
                      }
                  }
              }
index 153d83c6957346f795c8d63d6757875631221126,ce06f613cd815967b24eae1126939632bc5f2ecd..f5542bfb1d5504260842a45bd051484b567acbd4
@@@ -601,7 -583,8 +601,8 @@@ typedef struct H264Context
  }H264Context;
  
  
 -extern const uint8_t ff_h264_chroma_qp[3][QP_MAX_NUM+1]; ///< One chroma qp table for each supported bit depth (8, 9, 10).
 +extern const uint8_t ff_h264_chroma_qp[5][QP_MAX_NUM+1]; ///< One chroma qp table for each possible bit depth (8-12).
+ extern const uint16_t ff_h264_mb_sizes[4];
  
  /**
   * Decode SEI
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 1d139a67ee3ad93e6e162d3f105e98d4736e694c,b4855093a0263f0786ffbc64bf962364cd2aecc8..a3c00ced613fb2f08709d67164c88c94e533faf4
@@@ -422,33 -305,27 +422,35 @@@ static void palToUV_c(uint16_t *dstU, i
      }
  }
  
 -static void monowhite2Y_c(uint8_t *dst, const uint8_t *src,
 -                          int width, uint32_t *unused)
 +static void monowhite2Y_c(int16_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2,  int width, uint32_t *unused)
  {
      int i, j;
-     for (i=0; i<width/8; i++) {
+     width = (width + 7) >> 3;
+     for (i = 0; i < width; i++) {
          int d= ~src[i];
          for(j=0; j<8; j++)
 -            dst[8*i+j]= ((d>>(7-j))&1)*255;
 +            dst[8*i+j]= ((d>>(7-j))&1)*16383;
 +    }
 +    if(width&7){
 +        int d= ~src[i];
 +        for(j=0; j<(width&7); j++)
 +            dst[8*i+j]= ((d>>(7-j))&1)*16383;
      }
  }
  
 -static void monoblack2Y_c(uint8_t *dst, const uint8_t *src,
 -                          int width, uint32_t *unused)
 +static void monoblack2Y_c(int16_t *dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2,  int width, uint32_t *unused)
  {
      int i, j;
-     for (i=0; i<width/8; i++) {
+     width = (width + 7) >> 3;
+     for (i = 0; i < width; i++) {
          int d= src[i];
          for(j=0; j<8; j++)
 -            dst[8*i+j]= ((d>>(7-j))&1)*255;
 +            dst[8*i+j]= ((d>>(7-j))&1)*16383;
 +    }
 +    if(width&7){
 +        int d= src[i];
 +        for(j=0; j<(width&7); j++)
 +            dst[8*i+j]= ((d>>(7-j))&1)*16383;
      }
  }
  
index 34ed114207cc8fcd170ffc8cff472914c074698d,f1acf9ec92b5743a73a5a53f4e54719c86e009f2..6b17c922baa06aab8b4bb23e005702bb5d307b7b
@@@ -388,17 -389,17 +392,17 @@@ yuv2mono_1_c_template(SwsContext *c, co
      const uint8_t * const d128 = dither_8x8_220[y & 7];
      int i;
  
-     for (i = 0; i < dstW - 7; i += 8) {
+     for (i = 0; i < dstW; i += 8) {
          int acc = 0;
  
 -        accumulate_bit(acc, (buf0[i + 0] >> 7) + d128[0]);
 -        accumulate_bit(acc, (buf0[i + 1] >> 7) + d128[1]);
 -        accumulate_bit(acc, (buf0[i + 2] >> 7) + d128[2]);
 -        accumulate_bit(acc, (buf0[i + 3] >> 7) + d128[3]);
 -        accumulate_bit(acc, (buf0[i + 4] >> 7) + d128[4]);
 -        accumulate_bit(acc, (buf0[i + 5] >> 7) + d128[5]);
 -        accumulate_bit(acc, (buf0[i + 6] >> 7) + d128[6]);
 -        accumulate_bit(acc, (buf0[i + 7] >> 7) + d128[7]);
 +        accumulate_bit(acc, ((buf0[i + 0] + 64) >> 7) + d128[0]);
 +        accumulate_bit(acc, ((buf0[i + 1] + 64) >> 7) + d128[1]);
 +        accumulate_bit(acc, ((buf0[i + 2] + 64) >> 7) + d128[2]);
 +        accumulate_bit(acc, ((buf0[i + 3] + 64) >> 7) + d128[3]);
 +        accumulate_bit(acc, ((buf0[i + 4] + 64) >> 7) + d128[4]);
 +        accumulate_bit(acc, ((buf0[i + 5] + 64) >> 7) + d128[5]);
 +        accumulate_bit(acc, ((buf0[i + 6] + 64) >> 7) + d128[6]);
 +        accumulate_bit(acc, ((buf0[i + 7] + 64) >> 7) + d128[7]);
  
          output_pixel(*dest++, acc);
      }
diff --cc tests/Makefile
Simple merge