Commit 5f390eef authored by Anton Khirnov's avatar Anton Khirnov

h264: move mb_[uv]linesize into the per-slice context

parent 99a35d1c
......@@ -342,6 +342,9 @@ typedef struct H264SliceContext {
unsigned int topright_samples_available;
unsigned int left_samples_available;
ptrdiff_t mb_linesize; ///< may be equal to s->linesize or s->linesize * 2, for mbaff
ptrdiff_t mb_uvlinesize;
/**
* number of neighbors (top and/or left) that used 8x8 dct
*/
......@@ -413,9 +416,6 @@ typedef struct H264Context {
uint32_t *mb2br_xy;
int b_stride; // FIXME use s->b4_stride
ptrdiff_t mb_linesize; ///< may be equal to s->linesize or s->linesize * 2, for mbaff
ptrdiff_t mb_uvlinesize;
SPS sps; ///< current sps
PPS pps; ///< current pps
......
This diff is collapsed.
......@@ -67,8 +67,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
h->list_counts[mb_xy] = h->list_count;
if (!SIMPLE && MB_FIELD(h)) {
linesize = h->mb_linesize = h->linesize * 2;
uvlinesize = h->mb_uvlinesize = h->uvlinesize * 2;
linesize = sl->mb_linesize = h->linesize * 2;
uvlinesize = sl->mb_uvlinesize = h->uvlinesize * 2;
block_offset = &h->block_offset[48];
if (mb_y & 1) { // FIXME move out of this function?
dest_y -= h->linesize * 15;
......@@ -94,8 +94,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
}
}
} else {
linesize = h->mb_linesize = h->linesize;
uvlinesize = h->mb_uvlinesize = h->uvlinesize;
linesize = sl->mb_linesize = h->linesize;
uvlinesize = sl->mb_uvlinesize = h->uvlinesize;
// dct_offset = s->linesize * 16;
}
......@@ -295,7 +295,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
h->list_counts[mb_xy] = h->list_count;
if (!SIMPLE && MB_FIELD(h)) {
linesize = h->mb_linesize = h->mb_uvlinesize = h->linesize * 2;
linesize = sl->mb_linesize = sl->mb_uvlinesize = h->linesize * 2;
block_offset = &h->block_offset[48];
if (mb_y & 1) // FIXME move out of this function?
for (p = 0; p < 3; p++)
......@@ -319,7 +319,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
}
}
} else {
linesize = h->mb_linesize = h->mb_uvlinesize = h->linesize;
linesize = sl->mb_linesize = sl->mb_uvlinesize = h->linesize;
}
if (!SIMPLE && IS_INTRA_PCM(mb_type)) {
......
......@@ -95,11 +95,11 @@ static void MCFUNC(hl_motion)(H264Context *h, H264SliceContext *sl,
weight_op, weight_avg,
IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));
} else if (IS_8X16(mb_type)) {
mc_part(h, sl, 0, 0, 16, 8 * h->mb_linesize, dest_y, dest_cb, dest_cr, 0, 0,
mc_part(h, sl, 0, 0, 16, 8 * sl->mb_linesize, dest_y, dest_cb, dest_cr, 0, 0,
qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
&weight_op[1], &weight_avg[1],
IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 1));
mc_part(h, sl, 4, 0, 16, 8 * h->mb_linesize, dest_y, dest_cb, dest_cr, 4, 0,
mc_part(h, sl, 4, 0, 16, 8 * sl->mb_linesize, dest_y, dest_cb, dest_cr, 4, 0,
qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
&weight_op[1], &weight_avg[1],
IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));
......@@ -132,12 +132,12 @@ static void MCFUNC(hl_motion)(H264Context *h, H264SliceContext *sl,
&weight_op[1], &weight_avg[1],
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
} else if (IS_SUB_4X8(sub_mb_type)) {
mc_part(h, sl, n, 0, 8, 4 * h->mb_linesize,
mc_part(h, sl, n, 0, 8, 4 * sl->mb_linesize,
dest_y, dest_cb, dest_cr, x_offset, y_offset,
qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
&weight_op[2], &weight_avg[2],
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
mc_part(h, sl, n + 1, 0, 8, 4 * h->mb_linesize,
mc_part(h, sl, n + 1, 0, 8, 4 * sl->mb_linesize,
dest_y, dest_cb, dest_cr, x_offset + 2, y_offset,
qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
&weight_op[2], &weight_avg[2],
......
......@@ -2086,16 +2086,16 @@ static void loop_filter(H264Context *h, H264SliceContext *sl, int start_x, int e
// FIXME simplify above
if (MB_FIELD(h)) {
linesize = h->mb_linesize = h->linesize * 2;
uvlinesize = h->mb_uvlinesize = h->uvlinesize * 2;
linesize = sl->mb_linesize = h->linesize * 2;
uvlinesize = sl->mb_uvlinesize = h->uvlinesize * 2;
if (mb_y & 1) { // FIXME move out of this function?
dest_y -= h->linesize * 15;
dest_cb -= h->uvlinesize * (block_h - 1);
dest_cr -= h->uvlinesize * (block_h - 1);
}
} else {
linesize = h->mb_linesize = h->linesize;
uvlinesize = h->mb_uvlinesize = h->uvlinesize;
linesize = sl->mb_linesize = h->linesize;
uvlinesize = sl->mb_uvlinesize = h->uvlinesize;
}
backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize,
uvlinesize, 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment