aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/svq3.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:13 +0100
commite6287f077c3e8e4aca11e61dd4bade1351439e6b (patch)
treefe27d754efb718b11606b3c14973ac1c8bde515c /libavcodec/svq3.c
parentf69574cf7aca4fe4d57a2155e925f37fc863474d (diff)
downloadffmpeg-e6287f077c3e8e4aca11e61dd4bade1351439e6b.tar.gz
h264: move {mv,ref}_cache into the per-slice context
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r--libavcodec/svq3.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 499c35d6d5..163a49eeda 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -459,15 +459,15 @@ static inline int svq3_mc_dir(SVQ3Context *s, int size, int mode,
int32_t mv = pack16to32(mx, my);
if (part_height == 8 && i < 8) {
- AV_WN32A(h->mv_cache[dir][scan8[k] + 1 * 8], mv);
+ AV_WN32A(sl->mv_cache[dir][scan8[k] + 1 * 8], mv);
if (part_width == 8 && j < 8)
- AV_WN32A(h->mv_cache[dir][scan8[k] + 1 + 1 * 8], mv);
+ AV_WN32A(sl->mv_cache[dir][scan8[k] + 1 + 1 * 8], mv);
}
if (part_width == 8 && j < 8)
- AV_WN32A(h->mv_cache[dir][scan8[k] + 1], mv);
+ AV_WN32A(sl->mv_cache[dir][scan8[k] + 1], mv);
if (part_width == 4 || part_height == 4)
- AV_WN32A(h->mv_cache[dir][scan8[k]], mv);
+ AV_WN32A(sl->mv_cache[dir][scan8[k]], mv);
}
/* write back motion vectors */
@@ -535,36 +535,36 @@ static int svq3_decode_mb(SVQ3Context *s, unsigned int mb_type)
for (m = 0; m < 2; m++) {
if (h->mb_x > 0 && sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - 1] + 6] != -1) {
for (i = 0; i < 4; i++)
- AV_COPY32(h->mv_cache[m][scan8[0] - 1 + i * 8],
+ AV_COPY32(sl->mv_cache[m][scan8[0] - 1 + i * 8],
h->cur_pic.motion_val[m][b_xy - 1 + i * h->b_stride]);
} else {
for (i = 0; i < 4; i++)
- AV_ZERO32(h->mv_cache[m][scan8[0] - 1 + i * 8]);
+ AV_ZERO32(sl->mv_cache[m][scan8[0] - 1 + i * 8]);
}
if (h->mb_y > 0) {
- memcpy(h->mv_cache[m][scan8[0] - 1 * 8],
+ memcpy(sl->mv_cache[m][scan8[0] - 1 * 8],
h->cur_pic.motion_val[m][b_xy - h->b_stride],
4 * 2 * sizeof(int16_t));
- memset(&h->ref_cache[m][scan8[0] - 1 * 8],
+ memset(&sl->ref_cache[m][scan8[0] - 1 * 8],
(sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1, 4);
if (h->mb_x < h->mb_width - 1) {
- AV_COPY32(h->mv_cache[m][scan8[0] + 4 - 1 * 8],
+ AV_COPY32(sl->mv_cache[m][scan8[0] + 4 - 1 * 8],
h->cur_pic.motion_val[m][b_xy - h->b_stride + 4]);
- h->ref_cache[m][scan8[0] + 4 - 1 * 8] =
+ sl->ref_cache[m][scan8[0] + 4 - 1 * 8] =
(sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride + 1] + 6] == -1 ||
sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride]] == -1) ? PART_NOT_AVAILABLE : 1;
} else
- h->ref_cache[m][scan8[0] + 4 - 1 * 8] = PART_NOT_AVAILABLE;
+ sl->ref_cache[m][scan8[0] + 4 - 1 * 8] = PART_NOT_AVAILABLE;
if (h->mb_x > 0) {
- AV_COPY32(h->mv_cache[m][scan8[0] - 1 - 1 * 8],
+ AV_COPY32(sl->mv_cache[m][scan8[0] - 1 - 1 * 8],
h->cur_pic.motion_val[m][b_xy - h->b_stride - 1]);
- h->ref_cache[m][scan8[0] - 1 - 1 * 8] =
+ sl->ref_cache[m][scan8[0] - 1 - 1 * 8] =
(sl->intra4x4_pred_mode[h->mb2br_xy[mb_xy - h->mb_stride - 1] + 3] == -1) ? PART_NOT_AVAILABLE : 1;
} else
- h->ref_cache[m][scan8[0] - 1 - 1 * 8] = PART_NOT_AVAILABLE;
+ sl->ref_cache[m][scan8[0] - 1 - 1 * 8] = PART_NOT_AVAILABLE;
} else
- memset(&h->ref_cache[m][scan8[0] - 1 * 8 - 1],
+ memset(&sl->ref_cache[m][scan8[0] - 1 * 8 - 1],
PART_NOT_AVAILABLE, 8);
if (h->pict_type != AV_PICTURE_TYPE_B)
@@ -1111,6 +1111,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
const uint8_t *buf = avpkt->data;
SVQ3Context *s = avctx->priv_data;
H264Context *h = &s->h;
+ H264SliceContext *sl = &h->slice_ctx[0];
int buf_size = avpkt->size;
int ret, m, i;
@@ -1235,9 +1236,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
for (i = 0; i < 4; i++) {
int j;
for (j = -1; j < 4; j++)
- h->ref_cache[m][scan8[0] + 8 * i + j] = 1;
+ sl->ref_cache[m][scan8[0] + 8 * i + j] = 1;
if (i < 3)
- h->ref_cache[m][scan8[0] + 8 * i + j] = PART_NOT_AVAILABLE;
+ sl->ref_cache[m][scan8[0] + 8 * i + j] = PART_NOT_AVAILABLE;
}
}