summaryrefslogtreecommitdiff
path: root/libavcodec/h264_direct.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_direct.c
parent0edbe6faa7ef80daf0e84353cbe733389bf1a522 (diff)
h264: move mb_{x,y} into the per-slice context
Diffstat (limited to 'libavcodec/h264_direct.c')
-rw-r--r--libavcodec/h264_direct.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/libavcodec/h264_direct.c b/libavcodec/h264_direct.c
index 136d8fa25e..43ad41de90 100644
--- a/libavcodec/h264_direct.c
+++ b/libavcodec/h264_direct.c
@@ -179,7 +179,7 @@ static void pred_spatial_direct_motion(H264Context *const h, H264SliceContext *s
{
int b8_stride = 2;
int b4_stride = h->b_stride;
- int mb_xy = sl->mb_xy, mb_y = h->mb_y;
+ int mb_xy = sl->mb_xy, mb_y = sl->mb_y;
int mb_type_col[2];
const int16_t (*l1mv0)[2], (*l1mv1)[2];
const int8_t *l1ref0, *l1ref1;
@@ -193,7 +193,7 @@ static void pred_spatial_direct_motion(H264Context *const h, H264SliceContext *s
assert(sl->ref_list[1][0].reference & 3);
await_reference_mb_row(h, &sl->ref_list[1][0],
- h->mb_y + !!IS_INTERLACED(*mb_type));
+ sl->mb_y + !!IS_INTERLACED(*mb_type));
#define MB_TYPE_16x16_OR_INTRA (MB_TYPE_16x16 | MB_TYPE_INTRA4x4 | \
MB_TYPE_INTRA16x16 | MB_TYPE_INTRA_PCM)
@@ -262,9 +262,9 @@ static void pred_spatial_direct_motion(H264Context *const h, H264SliceContext *s
if (IS_INTERLACED(sl->ref_list[1][0].mb_type[mb_xy])) { // AFL/AFR/FR/FL -> AFL/FL
if (!IS_INTERLACED(*mb_type)) { // AFR/FR -> AFL/FL
- mb_y = (h->mb_y & ~1) + sl->col_parity;
- mb_xy = h->mb_x +
- ((h->mb_y & ~1) + sl->col_parity) * h->mb_stride;
+ mb_y = (sl->mb_y & ~1) + sl->col_parity;
+ mb_xy = sl->mb_x +
+ ((sl->mb_y & ~1) + sl->col_parity) * h->mb_stride;
b8_stride = 0;
} else {
mb_y += sl->col_fieldoff;
@@ -273,8 +273,8 @@ static void pred_spatial_direct_motion(H264Context *const h, H264SliceContext *s
goto single_col;
} else { // AFL/AFR/FR/FL -> AFR/FR
if (IS_INTERLACED(*mb_type)) { // AFL /FL -> AFR/FR
- mb_y = h->mb_y & ~1;
- mb_xy = (h->mb_y & ~1) * h->mb_stride + h->mb_x;
+ mb_y = sl->mb_y & ~1;
+ mb_xy = (sl->mb_y & ~1) * h->mb_stride + sl->mb_x;
mb_type_col[0] = sl->ref_list[1][0].mb_type[mb_xy];
mb_type_col[1] = sl->ref_list[1][0].mb_type[mb_xy + h->mb_stride];
b8_stride = 2 + 4 * h->mb_stride;
@@ -323,7 +323,7 @@ single_col:
l1ref0 = &sl->ref_list[1][0].ref_index[0][4 * mb_xy];
l1ref1 = &sl->ref_list[1][0].ref_index[1][4 * mb_xy];
if (!b8_stride) {
- if (h->mb_y & 1) {
+ if (sl->mb_y & 1) {
l1ref0 += 2;
l1ref1 += 2;
l1mv0 += 2 * b4_stride;
@@ -465,7 +465,7 @@ static void pred_temp_direct_motion(H264Context *const h, H264SliceContext *sl,
{
int b8_stride = 2;
int b4_stride = h->b_stride;
- int mb_xy = sl->mb_xy, mb_y = h->mb_y;
+ int mb_xy = sl->mb_xy, mb_y = sl->mb_y;
int mb_type_col[2];
const int16_t (*l1mv0)[2], (*l1mv1)[2];
const int8_t *l1ref0, *l1ref1;
@@ -476,13 +476,13 @@ static void pred_temp_direct_motion(H264Context *const h, H264SliceContext *sl,
assert(sl->ref_list[1][0].reference & 3);
await_reference_mb_row(h, &sl->ref_list[1][0],
- h->mb_y + !!IS_INTERLACED(*mb_type));
+ sl->mb_y + !!IS_INTERLACED(*mb_type));
if (IS_INTERLACED(sl->ref_list[1][0].mb_type[mb_xy])) { // AFL/AFR/FR/FL -> AFL/FL
if (!IS_INTERLACED(*mb_type)) { // AFR/FR -> AFL/FL
- mb_y = (h->mb_y & ~1) + sl->col_parity;
- mb_xy = h->mb_x +
- ((h->mb_y & ~1) + sl->col_parity) * h->mb_stride;
+ mb_y = (sl->mb_y & ~1) + sl->col_parity;
+ mb_xy = sl->mb_x +
+ ((sl->mb_y & ~1) + sl->col_parity) * h->mb_stride;
b8_stride = 0;
} else {
mb_y += sl->col_fieldoff;
@@ -491,8 +491,8 @@ static void pred_temp_direct_motion(H264Context *const h, H264SliceContext *sl,
goto single_col;
} else { // AFL/AFR/FR/FL -> AFR/FR
if (IS_INTERLACED(*mb_type)) { // AFL /FL -> AFR/FR
- mb_y = h->mb_y & ~1;
- mb_xy = h->mb_x + (h->mb_y & ~1) * h->mb_stride;
+ mb_y = sl->mb_y & ~1;
+ mb_xy = sl->mb_x + (sl->mb_y & ~1) * h->mb_stride;
mb_type_col[0] = sl->ref_list[1][0].mb_type[mb_xy];
mb_type_col[1] = sl->ref_list[1][0].mb_type[mb_xy + h->mb_stride];
b8_stride = 2 + 4 * h->mb_stride;
@@ -547,7 +547,7 @@ single_col:
l1ref0 = &sl->ref_list[1][0].ref_index[0][4 * mb_xy];
l1ref1 = &sl->ref_list[1][0].ref_index[1][4 * mb_xy];
if (!b8_stride) {
- if (h->mb_y & 1) {
+ if (sl->mb_y & 1) {
l1ref0 += 2;
l1ref1 += 2;
l1mv0 += 2 * b4_stride;
@@ -562,9 +562,9 @@ single_col:
int ref_offset;
if (FRAME_MBAFF(h) && IS_INTERLACED(*mb_type)) {
- map_col_to_list0[0] = sl->map_col_to_list0_field[h->mb_y & 1][0];
- map_col_to_list0[1] = sl->map_col_to_list0_field[h->mb_y & 1][1];
- dist_scale_factor = sl->dist_scale_factor_field[h->mb_y & 1];
+ map_col_to_list0[0] = sl->map_col_to_list0_field[sl->mb_y & 1][0];
+ map_col_to_list0[1] = sl->map_col_to_list0_field[sl->mb_y & 1][1];
+ dist_scale_factor = sl->dist_scale_factor_field[sl->mb_y & 1];
}
ref_offset = (sl->ref_list[1][0].mbaff << 4) & (mb_type_col[0] >> 3);