Commit 2cc08cad authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '5f390eef'

* commit '5f390eef':
  h264: move mb_[uv]linesize into the per-slice context

Conflicts:
	libavcodec/h264.h
	libavcodec/h264_mb.c
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 892a6d00 5f390eef
...@@ -379,6 +379,9 @@ typedef struct H264SliceContext { ...@@ -379,6 +379,9 @@ typedef struct H264SliceContext {
unsigned int topright_samples_available; unsigned int topright_samples_available;
unsigned int left_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 * number of neighbors (top and/or left) that used 8x8 dct
*/ */
...@@ -452,8 +455,6 @@ typedef struct H264Context { ...@@ -452,8 +455,6 @@ typedef struct H264Context {
uint32_t *mb2br_xy; uint32_t *mb2br_xy;
int b_stride; // FIXME use s->b4_stride 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;
unsigned current_sps_id; ///< id of the current SPS unsigned current_sps_id; ///< id of the current SPS
SPS sps; ///< current sps SPS sps; ///< current sps
......
This diff is collapsed.
...@@ -67,8 +67,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl) ...@@ -67,8 +67,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
h->list_counts[mb_xy] = h->list_count; h->list_counts[mb_xy] = h->list_count;
if (!SIMPLE && MB_FIELD(h)) { if (!SIMPLE && MB_FIELD(h)) {
linesize = h->mb_linesize = h->linesize * 2; linesize = sl->mb_linesize = h->linesize * 2;
uvlinesize = h->mb_uvlinesize = h->uvlinesize * 2; uvlinesize = sl->mb_uvlinesize = h->uvlinesize * 2;
block_offset = &h->block_offset[48]; block_offset = &h->block_offset[48];
if (mb_y & 1) { // FIXME move out of this function? if (mb_y & 1) { // FIXME move out of this function?
dest_y -= h->linesize * 15; dest_y -= h->linesize * 15;
...@@ -94,8 +94,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl) ...@@ -94,8 +94,8 @@ static av_noinline void FUNC(hl_decode_mb)(H264Context *h, H264SliceContext *sl)
} }
} }
} else { } else {
linesize = h->mb_linesize = h->linesize; linesize = sl->mb_linesize = h->linesize;
uvlinesize = h->mb_uvlinesize = h->uvlinesize; uvlinesize = sl->mb_uvlinesize = h->uvlinesize;
// dct_offset = s->linesize * 16; // dct_offset = s->linesize * 16;
} }
...@@ -292,7 +292,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext ...@@ -292,7 +292,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
h->list_counts[mb_xy] = h->list_count; h->list_counts[mb_xy] = h->list_count;
if (!SIMPLE && MB_FIELD(h)) { 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]; block_offset = &h->block_offset[48];
if (mb_y & 1) // FIXME move out of this function? if (mb_y & 1) // FIXME move out of this function?
for (p = 0; p < 3; p++) for (p = 0; p < 3; p++)
...@@ -316,7 +316,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext ...@@ -316,7 +316,7 @@ static av_noinline void FUNC(hl_decode_mb_444)(H264Context *h, H264SliceContext
} }
} }
} else { } 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)) { if (!SIMPLE && IS_INTRA_PCM(mb_type)) {
......
...@@ -95,11 +95,11 @@ static void MCFUNC(hl_motion)(H264Context *h, H264SliceContext *sl, ...@@ -95,11 +95,11 @@ static void MCFUNC(hl_motion)(H264Context *h, H264SliceContext *sl,
weight_op, weight_avg, weight_op, weight_avg,
IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1)); IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 1));
} else if (IS_8X16(mb_type)) { } 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], qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
&weight_op[1], &weight_avg[1], &weight_op[1], &weight_avg[1],
IS_DIR(mb_type, 0, 0), IS_DIR(mb_type, 0, 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], qpix_put[1], chroma_put[1], qpix_avg[1], chroma_avg[1],
&weight_op[1], &weight_avg[1], &weight_op[1], &weight_avg[1],
IS_DIR(mb_type, 1, 0), IS_DIR(mb_type, 1, 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, ...@@ -132,12 +132,12 @@ static void MCFUNC(hl_motion)(H264Context *h, H264SliceContext *sl,
&weight_op[1], &weight_avg[1], &weight_op[1], &weight_avg[1],
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1)); IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1));
} else if (IS_SUB_4X8(sub_mb_type)) { } 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, dest_y, dest_cb, dest_cr, x_offset, y_offset,
qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2], qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
&weight_op[2], &weight_avg[2], &weight_op[2], &weight_avg[2],
IS_DIR(sub_mb_type, 0, 0), IS_DIR(sub_mb_type, 0, 1)); 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, dest_y, dest_cb, dest_cr, x_offset + 2, y_offset,
qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2], qpix_put[2], chroma_put[2], qpix_avg[2], chroma_avg[2],
&weight_op[2], &weight_avg[2], &weight_op[2], &weight_avg[2],
......
...@@ -2307,16 +2307,16 @@ static void loop_filter(H264Context *h, H264SliceContext *sl, int start_x, int e ...@@ -2307,16 +2307,16 @@ static void loop_filter(H264Context *h, H264SliceContext *sl, int start_x, int e
// FIXME simplify above // FIXME simplify above
if (MB_FIELD(h)) { if (MB_FIELD(h)) {
linesize = h->mb_linesize = h->linesize * 2; linesize = sl->mb_linesize = h->linesize * 2;
uvlinesize = h->mb_uvlinesize = h->uvlinesize * 2; uvlinesize = sl->mb_uvlinesize = h->uvlinesize * 2;
if (mb_y & 1) { // FIXME move out of this function? if (mb_y & 1) { // FIXME move out of this function?
dest_y -= h->linesize * 15; dest_y -= h->linesize * 15;
dest_cb -= h->uvlinesize * (block_h - 1); dest_cb -= h->uvlinesize * (block_h - 1);
dest_cr -= h->uvlinesize * (block_h - 1); dest_cr -= h->uvlinesize * (block_h - 1);
} }
} else { } else {
linesize = h->mb_linesize = h->linesize; linesize = sl->mb_linesize = h->linesize;
uvlinesize = h->mb_uvlinesize = h->uvlinesize; uvlinesize = sl->mb_uvlinesize = h->uvlinesize;
} }
backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize, backup_mb_border(h, dest_y, dest_cb, dest_cr, linesize,
uvlinesize, 0); 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