Merge commit '64c81b2cd0dcf1fe66c381a5d2c707dddcf35a7e'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 12:58:11 +0000 (13:58 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 12:59:16 +0000 (13:59 +0100)
* commit '64c81b2cd0dcf1fe66c381a5d2c707dddcf35a7e':
  h264: move *_samples_available into the per-slice context

Conflicts:
libavcodec/h264.c
libavcodec/h264_mb.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/h264.c
libavcodec/h264.h
libavcodec/h264_cabac.c
libavcodec/h264_cavlc.c
libavcodec/h264_mb.c
libavcodec/h264_mvpred.h
libavcodec/svq3.c

@@@ -211,20 -195,20 +212,20 @@@ int ff_h264_check_intra_pred_mode(H264C
          }
      }
  
-     if ((h->left_samples_available & 0x8080) != 0x8080) {
+     if ((sl->left_samples_available & 0x8080) != 0x8080) {
          mode = left[mode];
 -        if (is_chroma && (sl->left_samples_available & 0x8080)) {
 -            // mad cow disease mode, aka MBAFF + constrained_intra_pred
 -            mode = ALZHEIMER_DC_L0T_PRED8x8 +
 -                   (!(sl->left_samples_available & 0x8000)) +
 -                   2 * (mode == DC_128_PRED8x8);
 -        }
          if (mode < 0) {
              av_log(h->avctx, AV_LOG_ERROR,
                     "left block unavailable for requested intra mode at %d %d\n",
                     h->mb_x, h->mb_y);
              return AVERROR_INVALIDDATA;
          }
-         if (is_chroma && (h->left_samples_available & 0x8080)) {
++        if (is_chroma && (sl->left_samples_available & 0x8080)) {
 +            // mad cow disease mode, aka MBAFF + constrained_intra_pred
 +            mode = ALZHEIMER_DC_L0T_PRED8x8 +
-                    (!(h->left_samples_available & 0x8000)) +
++                   (!(sl->left_samples_available & 0x8000)) +
 +                   2 * (mode == DC_128_PRED8x8);
 +        }
      }
  
      return mode;
@@@ -854,10 -795,11 +855,11 @@@ int ff_h264_check_intra4x4_pred_mode(H2
   * Check if the top & left blocks are available if needed & change the
   * dc mode so it only uses the available blocks.
   */
- int ff_h264_check_intra_pred_mode(H264Context *h, int mode, int is_chroma);
+ int ff_h264_check_intra_pred_mode(H264Context *h, H264SliceContext *sl,
+                                   int mode, int is_chroma);
  
  void ff_h264_hl_decode_mb(H264Context *h, H264SliceContext *sl);
 -int ff_h264_decode_extradata(H264Context *h);
 +int ff_h264_decode_extradata(H264Context *h, const uint8_t *buf, int size);
  int ff_h264_decode_init(AVCodecContext *avctx);
  void ff_h264_decode_init_vlc(void);
  
Simple merge
Simple merge
@@@ -633,16 -633,11 +633,16 @@@ static av_always_inline void hl_decode_
                  uint8_t *const ptr = dest_y + block_offset[i];
                  const int dir      = sl->intra4x4_pred_mode_cache[scan8[i]];
                  if (transform_bypass && h->sps.profile_idc == 244 && dir <= 1) {
 -                    h->hpc.pred8x8l_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
 +                    if (h->x264_build != -1) {
 +                        h->hpc.pred8x8l_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
 +                    } else
 +                        h->hpc.pred8x8l_filter_add[dir](ptr, h->mb + (i * 16 + p * 256 << pixel_shift),
-                                                         (h-> topleft_samples_available << i) & 0x8000,
-                                                         (h->topright_samples_available << i) & 0x4000, linesize);
++                                                        (sl-> topleft_samples_available << i) & 0x8000,
++                                                        (sl->topright_samples_available << i) & 0x4000, linesize);
                  } else {
                      const int nnz = h->non_zero_count_cache[scan8[i + p * 16]];
-                     h->hpc.pred8x8l[dir](ptr, (h->topleft_samples_available << i) & 0x8000,
-                                          (h->topright_samples_available << i) & 0x4000, linesize);
+                     h->hpc.pred8x8l[dir](ptr, (sl->topleft_samples_available << i) & 0x8000,
+                                          (sl->topright_samples_available << i) & 0x4000, linesize);
                      if (nnz) {
                          if (nnz == 1 && dctcoef_get(h->mb, pixel_shift, i * 16 + p * 256))
                              idct_dc_add(ptr, h->mb + (i * 16 + p * 256 << pixel_shift), linesize);
                      int nnz, tr;
                      uint64_t tr_high;
                      if (dir == DIAG_DOWN_LEFT_PRED || dir == VERT_LEFT_PRED) {
-                         const int topright_avail = (h->topright_samples_available << i) & 0x8000;
+                         const int topright_avail = (sl->topright_samples_available << i) & 0x8000;
 -                        assert(h->mb_y || linesize <= block_offset[i]);
 +                        av_assert2(h->mb_y || linesize <= block_offset[i]);
                          if (!topright_avail) {
                              if (pixel_shift) {
                                  tr_high  = ((uint16_t *)ptr)[3 - linesize / 2] * 0x0001000100010001ULL;
@@@ -488,10 -488,10 +488,10 @@@ static void fill_decode_caches(H264Cont
                  } else {
                      int left_typei = h->cur_pic.mb_type[left_xy[LTOP] + h->mb_stride];
  
 -                    assert(left_xy[LTOP] == left_xy[LBOT]);
 +                    av_assert2(left_xy[LTOP] == left_xy[LBOT]);
                      if (!((left_typei & type_mask) && (left_type[LTOP] & type_mask))) {
-                         h->topleft_samples_available &= 0xDF5F;
-                         h->left_samples_available    &= 0x5F5F;
+                         sl->topleft_samples_available &= 0xDF5F;
+                         sl->left_samples_available    &= 0x5F5F;
                      }
                  }
              } else {
Simple merge