summaryrefslogtreecommitdiff
path: root/libavcodec/h264_mb_template.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
commitd4d9068cdf8f4b2b87ae87a2ef880d243f77b977 (patch)
tree2ede3f693c54ca02c41d90549295fe5868f55b54 /libavcodec/h264_mb_template.c
parent0edbe6faa7ef80daf0e84353cbe733389bf1a522 (diff)
h264: move mb_{x,y} into the per-slice context
Diffstat (limited to 'libavcodec/h264_mb_template.c')
-rw-r--r--libavcodec/h264_mb_template.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/h264_mb_template.c b/libavcodec/h264_mb_template.c
index 4eca679357..556a2b5dd3 100644
--- a/libavcodec/h264_mb_template.c
+++ b/libavcodec/h264_mb_template.c
@@ -42,8 +42,8 @@
static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
{
- const int mb_x = h->mb_x;
- const int mb_y = h->mb_y;
+ const int mb_x = sl->mb_x;
+ const int mb_y = sl->mb_y;
const int mb_xy = sl->mb_xy;
const int mb_type = h->cur_pic.mb_type[mb_xy];
uint8_t *dest_y, *dest_cb, *dest_cr;
@@ -61,8 +61,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
dest_cb = h->cur_pic.f.data[1] + (mb_x << PIXEL_SHIFT) * 8 + mb_y * h->uvlinesize * block_h;
dest_cr = h->cur_pic.f.data[2] + (mb_x << PIXEL_SHIFT) * 8 + mb_y * h->uvlinesize * block_h;
- h->vdsp.prefetch(dest_y + (h->mb_x & 3) * 4 * h->linesize + (64 << PIXEL_SHIFT), h->linesize, 4);
- h->vdsp.prefetch(dest_cb + (h->mb_x & 7) * h->uvlinesize + (64 << PIXEL_SHIFT), dest_cr - dest_cb, 2);
+ h->vdsp.prefetch(dest_y + (sl->mb_x & 3) * 4 * h->linesize + (64 << PIXEL_SHIFT), h->linesize, 4);
+ h->vdsp.prefetch(dest_cb + (sl->mb_x & 7) * h->uvlinesize + (64 << PIXEL_SHIFT), dest_cr - dest_cb, 2);
h->list_counts[mb_xy] = sl->list_count;
@@ -82,13 +82,13 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
continue;
if (IS_16X16(mb_type)) {
int8_t *ref = &sl->ref_cache[list][scan8[0]];
- fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (h->mb_y & 1), 1);
+ fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (sl->mb_y & 1), 1);
} else {
for (i = 0; i < 16; i += 4) {
int ref = sl->ref_cache[list][scan8[i]];
if (ref >= 0)
fill_rectangle(&sl->ref_cache[list][scan8[i]], 2, 2,
- 8, (16 + ref) ^ (h->mb_y & 1), 1);
+ 8, (16 + ref) ^ (sl->mb_y & 1), 1);
}
}
}
@@ -274,8 +274,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext *sl)
{
- const int mb_x = h->mb_x;
- const int mb_y = h->mb_y;
+ const int mb_x = sl->mb_x;
+ const int mb_y = sl->mb_y;
const int mb_xy = sl->mb_xy;
const int mb_type = h->cur_pic.mb_type[mb_xy];
uint8_t *dest[3];
@@ -288,7 +288,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
for (p = 0; p < plane_count; p++) {
dest[p] = h->cur_pic.f.data[p] +
((mb_x << PIXEL_SHIFT) + mb_y * h->linesize) * 16;
- h->vdsp.prefetch(dest[p] + (h->mb_x & 3) * 4 * h->linesize + (64 << PIXEL_SHIFT),
+ h->vdsp.prefetch(dest[p] + (sl->mb_x & 3) * 4 * h->linesize + (64 << PIXEL_SHIFT),
h->linesize, 4);
}
@@ -307,13 +307,13 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
continue;
if (IS_16X16(mb_type)) {
int8_t *ref = &sl->ref_cache[list][scan8[0]];
- fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (h->mb_y & 1), 1);
+ fill_rectangle(ref, 4, 4, 8, (16 + *ref) ^ (sl->mb_y & 1), 1);
} else {
for (i = 0; i < 16; i += 4) {
int ref = sl->ref_cache[list][scan8[i]];
if (ref >= 0)
fill_rectangle(&sl->ref_cache[list][scan8[i]], 2, 2,
- 8, (16 + ref) ^ (h->mb_y & 1), 1);
+ 8, (16 + ref) ^ (sl->mb_y & 1), 1);
}
}
}