Merge commit 'ed451a08a46b2b07fd2dba3e55ffddd18ae6e3d6'
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 13:37:55 +0000 (14:37 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 21 Mar 2015 13:37:55 +0000 (14:37 +0100)
* commit 'ed451a08a46b2b07fd2dba3e55ffddd18ae6e3d6':
  h264: move sub_mb_type into the per-slice context

Conflicts:
libavcodec/h264_cabac.c

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

Simple merge
@@@ -2120,12 -2114,13 +2120,12 @@@ decode_intra_mb
  
          for( list = 0; list < h->list_count; list++ ) {
                  for( i = 0; i < 4; i++ ) {
-                     if(IS_DIRECT(h->sub_mb_type[i])) continue;
-                     if(IS_DIR(h->sub_mb_type[i], 0, list)){
+                     if(IS_DIRECT(sl->sub_mb_type[i])) continue;
+                     if(IS_DIR(sl->sub_mb_type[i], 0, list)){
 -                        int rc = h->ref_count[list] << MB_MBAFF(h);
 -                        if (rc > 1) {
 +                        if (local_ref_count[list] > 1) {
                              ref[list][i] = decode_cabac_mb_ref(h, sl, list, 4 * i);
 -                            if (ref[list][i] >= (unsigned) rc) {
 -                                av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref[list][i], rc);
 +                            if (ref[list][i] >= (unsigned)local_ref_count[list]) {
 +                                av_log(h->avctx, AV_LOG_ERROR, "Reference %d >= %d\n", ref[list][i], local_ref_count[list]);
                                  return -1;
                              }
                          }else
@@@ -863,23 -852,23 +863,23 @@@ decode_intra_mb
                  sl->ref_cache[1][scan8[12]] = PART_NOT_AVAILABLE;
              }
          }else{
 -            assert(sl->slice_type_nos == AV_PICTURE_TYPE_P); //FIXME SP correct ?
 +            av_assert2(sl->slice_type_nos == AV_PICTURE_TYPE_P); //FIXME SP correct ?
              for(i=0; i<4; i++){
-                 h->sub_mb_type[i]= get_ue_golomb_31(&h->gb);
-                 if(h->sub_mb_type[i] >=4){
-                     av_log(h->avctx, AV_LOG_ERROR, "P sub_mb_type %u out of range at %d %d\n", h->sub_mb_type[i], h->mb_x, h->mb_y);
+                 sl->sub_mb_type[i]= get_ue_golomb_31(&h->gb);
+                 if(sl->sub_mb_type[i] >=4){
+                     av_log(h->avctx, AV_LOG_ERROR, "P sub_mb_type %u out of range at %d %d\n", sl->sub_mb_type[i], h->mb_x, h->mb_y);
                      return -1;
                  }
-                 sub_partition_count[i]= p_sub_mb_type_info[ h->sub_mb_type[i] ].partition_count;
-                 h->sub_mb_type[i]=      p_sub_mb_type_info[ h->sub_mb_type[i] ].type;
+                 sub_partition_count[i]= p_sub_mb_type_info[ sl->sub_mb_type[i] ].partition_count;
+                 sl->sub_mb_type[i]=      p_sub_mb_type_info[ sl->sub_mb_type[i] ].type;
              }
          }
  
          for(list=0; list<h->list_count; list++){
 -            int ref_count = IS_REF0(mb_type) ? 1 : h->ref_count[list] << MB_MBAFF(h);
 +            int ref_count = IS_REF0(mb_type) ? 1 : local_ref_count[list];
              for(i=0; i<4; i++){
-                 if(IS_DIRECT(h->sub_mb_type[i])) continue;
-                 if(IS_DIR(h->sub_mb_type[i], 0, list)){
+                 if(IS_DIRECT(sl->sub_mb_type[i])) continue;
+                 if(IS_DIR(sl->sub_mb_type[i], 0, list)){
                      unsigned int tmp;
                      if(ref_count == 1){
                          tmp= 0;
Simple merge
@@@ -120,10 -120,10 +120,10 @@@ static void await_references(H264Contex
      } else {
          int i;
  
 -        assert(IS_8X8(mb_type));
 +        av_assert2(IS_8X8(mb_type));
  
          for (i = 0; i < 4; i++) {
-             const int sub_mb_type = h->sub_mb_type[i];
+             const int sub_mb_type = sl->sub_mb_type[i];
              const int n           = 4 * i;
              int y_offset          = (i & 2) << 2;
  
@@@ -106,10 -106,10 +106,10 @@@ static void MCFUNC(hl_motion)(H264Conte
      } else {
          int i;
  
 -        assert(IS_8X8(mb_type));
 +        av_assert2(IS_8X8(mb_type));
  
          for (i = 0; i < 4; i++) {
-             const int sub_mb_type = h->sub_mb_type[i];
+             const int sub_mb_type = sl->sub_mb_type[i];
              const int n  = 4 * i;
              int x_offset = (i & 1) << 2;
              int y_offset = (i & 2) << 1;