[FFmpeg-cvslog] h264: move neighbor_transform_size into the per-slice context

Anton Khirnov git at videolan.org
Sat Mar 21 14:37:59 CET 2015


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Jan 17 22:28:46 2015 +0100| [99a35d1ccbb6b6cd260ce5c8369a897a79fe6a3a] | committer: Anton Khirnov

h264: move neighbor_transform_size into the per-slice context

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=99a35d1ccbb6b6cd260ce5c8369a897a79fe6a3a
---

 libavcodec/h264.h        |   10 +++++-----
 libavcodec/h264_cabac.c  |    4 ++--
 libavcodec/h264_mvpred.h |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index 189825a..8ed84b4 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -343,6 +343,11 @@ typedef struct H264SliceContext {
     unsigned int left_samples_available;
 
     /**
+     * number of neighbors (top and/or left) that used 8x8 dct
+     */
+    int neighbor_transform_size;
+
+    /**
      * non zero coeff count cache.
      * is 64 if not available.
      */
@@ -399,11 +404,6 @@ typedef struct H264Context {
 #define PART_NOT_AVAILABLE -2
 
     /**
-     * number of neighbors (top and/or left) that used 8x8 dct
-     */
-    int neighbor_transform_size;
-
-    /**
      * block_offset[ 0..23] for frame macroblocks
      * block_offset[24..47] for field macroblocks
      */
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 7fa1ae6..35e5521 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -2050,7 +2050,7 @@ decode_intra_mb:
     if( IS_INTRA( mb_type ) ) {
         int i, pred_mode;
         if( IS_INTRA4x4( mb_type ) ) {
-            if( dct8x8_allowed && get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] ) ) {
+            if (dct8x8_allowed && get_cabac_noinline(&h->cabac, &h->cabac_state[399 + sl->neighbor_transform_size])) {
                 mb_type |= MB_TYPE_8x8DCT;
                 for( i = 0; i < 16; i+=4 ) {
                     int pred = pred_intra_mode(h, sl, i);
@@ -2309,7 +2309,7 @@ decode_intra_mb:
     h->cbp_table[mb_xy] = h->cbp = cbp;
 
     if( dct8x8_allowed && (cbp&15) && !IS_INTRA( mb_type ) ) {
-        mb_type |= MB_TYPE_8x8DCT * get_cabac_noinline( &h->cabac, &h->cabac_state[399 + h->neighbor_transform_size] );
+        mb_type |= MB_TYPE_8x8DCT * get_cabac_noinline(&h->cabac, &h->cabac_state[399 + sl->neighbor_transform_size]);
     }
 
     /* It would be better to do this in fill_decode_caches, but we don't know
diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h
index 3d4ffa0..abf26b6 100644
--- a/libavcodec/h264_mvpred.h
+++ b/libavcodec/h264_mvpred.h
@@ -794,7 +794,7 @@ static void fill_decode_caches(H264Context *h, H264SliceContext *sl, int mb_type
         }
     }
 
-    h->neighbor_transform_size = !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[LTOP]);
+    sl->neighbor_transform_size = !!IS_8x8DCT(top_type) + !!IS_8x8DCT(left_type[LTOP]);
 }
 
 /**



More information about the ffmpeg-cvslog mailing list