mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-03-08 13:38:07 +00:00
avcodec/h264_mb: fix grayscale only decoding with weighted prediction
Fixes Ticket3412 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b6c9266722
commit
94f60b6544
@ -420,10 +420,12 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
|
|||||||
int weight1 = 64 - weight0;
|
int weight1 = 64 - weight0;
|
||||||
luma_weight_avg(dest_y, tmp_y, h->mb_linesize,
|
luma_weight_avg(dest_y, tmp_y, h->mb_linesize,
|
||||||
height, 5, weight0, weight1, 0);
|
height, 5, weight0, weight1, 0);
|
||||||
|
if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
|
||||||
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize,
|
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize,
|
||||||
chroma_height, 5, weight0, weight1, 0);
|
chroma_height, 5, weight0, weight1, 0);
|
||||||
chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize,
|
chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize,
|
||||||
chroma_height, 5, weight0, weight1, 0);
|
chroma_height, 5, weight0, weight1, 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
luma_weight_avg(dest_y, tmp_y, h->mb_linesize, height,
|
luma_weight_avg(dest_y, tmp_y, h->mb_linesize, height,
|
||||||
h->luma_log2_weight_denom,
|
h->luma_log2_weight_denom,
|
||||||
@ -431,6 +433,7 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
|
|||||||
h->luma_weight[refn1][1][0],
|
h->luma_weight[refn1][1][0],
|
||||||
h->luma_weight[refn0][0][1] +
|
h->luma_weight[refn0][0][1] +
|
||||||
h->luma_weight[refn1][1][1]);
|
h->luma_weight[refn1][1][1]);
|
||||||
|
if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
|
||||||
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
|
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
|
||||||
h->chroma_log2_weight_denom,
|
h->chroma_log2_weight_denom,
|
||||||
h->chroma_weight[refn0][0][0][0],
|
h->chroma_weight[refn0][0][0][0],
|
||||||
@ -444,6 +447,7 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
|
|||||||
h->chroma_weight[refn0][0][1][1] +
|
h->chroma_weight[refn0][0][1][1] +
|
||||||
h->chroma_weight[refn1][1][1][1]);
|
h->chroma_weight[refn1][1][1][1]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
int list = list1 ? 1 : 0;
|
int list = list1 ? 1 : 0;
|
||||||
int refn = h->ref_cache[list][scan8[n]];
|
int refn = h->ref_cache[list][scan8[n]];
|
||||||
@ -456,6 +460,7 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
|
|||||||
h->luma_log2_weight_denom,
|
h->luma_log2_weight_denom,
|
||||||
h->luma_weight[refn][list][0],
|
h->luma_weight[refn][list][0],
|
||||||
h->luma_weight[refn][list][1]);
|
h->luma_weight[refn][list][1]);
|
||||||
|
if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
|
||||||
if (h->use_weight_chroma) {
|
if (h->use_weight_chroma) {
|
||||||
chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
|
chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
|
||||||
h->chroma_log2_weight_denom,
|
h->chroma_log2_weight_denom,
|
||||||
@ -467,6 +472,7 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
|
|||||||
h->chroma_weight[refn][list][1][1]);
|
h->chroma_weight[refn][list][1][1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_always_inline void prefetch_motion(H264Context *h, int list,
|
static av_always_inline void prefetch_motion(H264Context *h, int list,
|
||||||
|
Loading…
Reference in New Issue
Block a user