summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-03-21 15:57:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-03-21 15:57:21 +0100
commitc9841c05be67908e0980dafe0f7585ba47cbfe28 (patch)
tree962eb94bdac044eb1bf6f054d0c1f85f158190ec
parenta4952e7343f9a77d2995d699ac045b095ab11052 (diff)
parenta67f8ae9a2c8529bf6a635e8ca4e3483592708b1 (diff)
downloadffmpeg-c9841c05be67908e0980dafe0f7585ba47cbfe28.tar.gz
Merge commit 'a67f8ae9a2c8529bf6a635e8ca4e3483592708b1'
* commit 'a67f8ae9a2c8529bf6a635e8ca4e3483592708b1': h264: move mvd_table into the per-slice context Conflicts: libavcodec/h264.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/h264.c3
-rw-r--r--libavcodec/h264.h4
-rw-r--r--libavcodec/h264_mvpred.h2
-rw-r--r--libavcodec/h264_slice.c4
4 files changed, 9 insertions, 4 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 1849cc32d2..74ef9612ec 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -449,6 +449,9 @@ int ff_h264_alloc_tables(H264Context *h)
row_mb_num, 16 * sizeof(uint8_t), fail);
FF_ALLOCZ_ARRAY_OR_GOTO(h->avctx, h->mvd_table[1],
row_mb_num, 16 * sizeof(uint8_t), fail);
+ h->slice_ctx[0].mvd_table[0] = h->mvd_table[0];
+ h->slice_ctx[0].mvd_table[1] = h->mvd_table[1];
+
FF_ALLOCZ_OR_GOTO(h->avctx, h->direct_table,
4 * big_mb_num * sizeof(uint8_t), fail);
FF_ALLOCZ_OR_GOTO(h->avctx, h->list_counts,
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index a342cfc16c..1c4e3f9090 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -439,6 +439,8 @@ typedef struct H264SliceContext {
///< check that i is not too large or ensure that there is some unused stuff after mb
int16_t mb_padding[256 * 2];
+ uint8_t (*mvd_table[2])[2];
+
/**
* Cabac
*/
@@ -1065,7 +1067,7 @@ static av_always_inline void write_back_motion_list(H264Context *h,
AV_COPY128(mv_dst + 2 * b_stride, mv_src + 8 * 2);
AV_COPY128(mv_dst + 3 * b_stride, mv_src + 8 * 3);
if (CABAC(h)) {
- uint8_t (*mvd_dst)[2] = &h->mvd_table[list][FMO ? 8 * h->mb_xy
+ uint8_t (*mvd_dst)[2] = &sl->mvd_table[list][FMO ? 8 * h->mb_xy
: h->mb2br_xy[h->mb_xy]];
uint8_t(*mvd_src)[2] = &h->mvd_cache[list][scan8[0]];
if (IS_SKIP(mb_type)) {
diff --git a/libavcodec/h264_mvpred.h b/libavcodec/h264_mvpred.h
index 9da3a5798f..24fcde5c20 100644
--- a/libavcodec/h264_mvpred.h
+++ b/libavcodec/h264_mvpred.h
@@ -689,7 +689,7 @@ static void fill_decode_caches(H264Context *h, H264SliceContext *sl, int mb_type
if (!(mb_type & (MB_TYPE_SKIP | MB_TYPE_DIRECT2))) {
uint8_t(*mvd_cache)[2] = &h->mvd_cache[list][scan8[0]];
- uint8_t(*mvd)[2] = h->mvd_table[list];
+ uint8_t(*mvd)[2] = sl->mvd_table[list];
ref_cache[2 + 8 * 0] =
ref_cache[2 + 8 * 2] = PART_NOT_AVAILABLE;
AV_ZERO32(mv_cache[2 + 8 * 0]);
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 7db1ee8f37..11ed1f1554 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -388,6 +388,8 @@ static void clone_tables(H264Context *dst, H264SliceContext *sl,
H264Context *src, int i)
{
sl->intra4x4_pred_mode = src->intra4x4_pred_mode + i * 8 * 2 * src->mb_stride;
+ sl->mvd_table[0] = src->mvd_table[0] + i * 8 * 2 * src->mb_stride;
+ sl->mvd_table[1] = src->mvd_table[1] + i * 8 * 2 * src->mb_stride;
dst->non_zero_count = src->non_zero_count;
dst->slice_table = src->slice_table;
@@ -395,8 +397,6 @@ static void clone_tables(H264Context *dst, H264SliceContext *sl,
dst->mb2b_xy = src->mb2b_xy;
dst->mb2br_xy = src->mb2br_xy;
dst->chroma_pred_mode_table = src->chroma_pred_mode_table;
- dst->mvd_table[0] = src->mvd_table[0] + i * 8 * 2 * src->mb_stride;
- dst->mvd_table[1] = src->mvd_table[1] + i * 8 * 2 * src->mb_stride;
dst->direct_table = src->direct_table;
dst->list_counts = src->list_counts;
dst->DPB = src->DPB;