aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/h264_cabac.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2015-01-17 22:28:46 +0100
committerAnton Khirnov <anton@khirnov.net>2015-03-21 11:27:14 +0100
commit6479c79f5517e2881bc881e737b2dbce69553878 (patch)
treeb94fcc90fc969c14cdcb5e0c884389a93d7d49e0 /libavcodec/h264_cabac.c
parenta67f8ae9a2c8529bf6a635e8ca4e3483592708b1 (diff)
downloadffmpeg-6479c79f5517e2881bc881e737b2dbce69553878.tar.gz
h264: move mvd_cache into the per-slice context
Diffstat (limited to 'libavcodec/h264_cabac.c')
-rw-r--r--libavcodec/h264_cabac.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/libavcodec/h264_cabac.c b/libavcodec/h264_cabac.c
index 24ce093499..cc3db5dc7d 100644
--- a/libavcodec/h264_cabac.c
+++ b/libavcodec/h264_cabac.c
@@ -1535,10 +1535,10 @@ static int decode_cabac_mb_mvd(H264Context *h, H264SliceContext *sl, int ctxbase
#define DECODE_CABAC_MB_MVD( h, list, n )\
{\
- int amvd0 = h->mvd_cache[list][scan8[n] - 1][0] +\
- h->mvd_cache[list][scan8[n] - 8][0];\
- int amvd1 = h->mvd_cache[list][scan8[n] - 1][1] +\
- h->mvd_cache[list][scan8[n] - 8][1];\
+ int amvd0 = sl->mvd_cache[list][scan8[n] - 1][0] +\
+ sl->mvd_cache[list][scan8[n] - 8][0];\
+ int amvd1 = sl->mvd_cache[list][scan8[n] - 1][1] +\
+ sl->mvd_cache[list][scan8[n] - 8][1];\
\
mx += decode_cabac_mb_mvd(h, sl, 40, amvd0, &mpx);\
my += decode_cabac_mb_mvd(h, sl, 47, amvd1, &mpy);\
@@ -2146,7 +2146,7 @@ decode_intra_mb:
for(i=0; i<4; i++){
sl->ref_cache[list][scan8[4 * i]] = sl->ref_cache[list][scan8[4 * i] + 1];
if(IS_DIRECT(sl->sub_mb_type[i])){
- fill_rectangle(h->mvd_cache[list][scan8[4*i]], 2, 2, 8, 0, 2);
+ fill_rectangle(sl->mvd_cache[list][scan8[4*i]], 2, 2, 8, 0, 2);
continue;
}
@@ -2158,7 +2158,7 @@ decode_intra_mb:
int mx, my;
const int index= 4*i + block_width*j;
int16_t (* mv_cache)[2] = &sl->mv_cache[list][ scan8[index] ];
- uint8_t (* mvd_cache)[2]= &h->mvd_cache[list][ scan8[index] ];
+ uint8_t (* mvd_cache)[2]= &sl->mvd_cache[list][ scan8[index] ];
pred_motion(h, sl, index, block_width, list, sl->ref_cache[list][ scan8[index] ], &mx, &my);
DECODE_CABAC_MB_MVD( h, list, index)
tprintf(h->avctx, "final mv:%d %d\n", mx, my);
@@ -2194,14 +2194,14 @@ decode_intra_mb:
}
}else{
fill_rectangle(sl->mv_cache [list][ scan8[4*i] ], 2, 2, 8, 0, 4);
- fill_rectangle(h->mvd_cache[list][ scan8[4*i] ], 2, 2, 8, 0, 2);
+ fill_rectangle(sl->mvd_cache[list][ scan8[4*i] ], 2, 2, 8, 0, 2);
}
}
}
} else if( IS_DIRECT(mb_type) ) {
ff_h264_pred_direct_motion(h, sl, &mb_type);
- fill_rectangle(h->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 2);
- fill_rectangle(h->mvd_cache[1][scan8[0]], 4, 4, 8, 0, 2);
+ fill_rectangle(sl->mvd_cache[0][scan8[0]], 4, 4, 8, 0, 2);
+ fill_rectangle(sl->mvd_cache[1][scan8[0]], 4, 4, 8, 0, 2);
dct8x8_allowed &= h->sps.direct_8x8_inference_flag;
} else {
int list, i;
@@ -2227,7 +2227,7 @@ decode_intra_mb:
DECODE_CABAC_MB_MVD( h, list, 0)
tprintf(h->avctx, "final mv:%d %d\n", mx, my);
- fill_rectangle(h->mvd_cache[list][ scan8[0] ], 4, 4, 8, pack8to16(mpx,mpy), 2);
+ fill_rectangle(sl->mvd_cache[list][ scan8[0] ], 4, 4, 8, pack8to16(mpx,mpy), 2);
fill_rectangle(sl->mv_cache[list][ scan8[0] ], 4, 4, 8, pack16to32(mx,my), 4);
}
}
@@ -2258,10 +2258,10 @@ decode_intra_mb:
DECODE_CABAC_MB_MVD( h, list, 8*i)
tprintf(h->avctx, "final mv:%d %d\n", mx, my);
- fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack8to16(mpx,mpy), 2);
+ fill_rectangle(sl->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack8to16(mpx,mpy), 2);
fill_rectangle(sl->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, pack16to32(mx,my), 4);
}else{
- fill_rectangle(h->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 2);
+ fill_rectangle(sl->mvd_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 2);
fill_rectangle(sl->mv_cache[list][ scan8[0] + 16*i ], 4, 2, 8, 0, 4);
}
}
@@ -2293,10 +2293,10 @@ decode_intra_mb:
DECODE_CABAC_MB_MVD( h, list, 4*i)
tprintf(h->avctx, "final mv:%d %d\n", mx, my);
- fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack8to16(mpx,mpy), 2);
+ fill_rectangle(sl->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack8to16(mpx,mpy), 2);
fill_rectangle(sl->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, pack16to32(mx,my), 4);
}else{
- fill_rectangle(h->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 2);
+ fill_rectangle(sl->mvd_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 2);
fill_rectangle(sl->mv_cache[list][ scan8[0] + 2*i ], 2, 4, 8, 0, 4);
}
}