1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-10 06:10:52 +02:00

Merge commit 'a7b365ae191f45a0d7ed7b34033d5d0cbdd47139'

* commit 'a7b365ae191f45a0d7ed7b34033d5d0cbdd47139':
  hevc: reduce code duplication in hls_prediction_unit()

Conflicts:
	libavcodec/hevc.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2014-11-17 11:54:41 +01:00

View File

@@ -1604,26 +1604,12 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
int x_pu, y_pu;
int i, j;
if (SAMPLE_CTB(s->skip_flag, x_cb, y_cb)) {
if (s->sh.max_num_merge_cand > 1)
merge_idx = ff_hevc_merge_idx_decode(s);
else
merge_idx = 0;
int skip_flag = SAMPLE_CTB(s->skip_flag, x_cb, y_cb);
ff_hevc_luma_mv_merge_mode(s, x0, y0,
1 << log2_cb_size,
1 << log2_cb_size,
log2_cb_size, partIdx,
merge_idx, &current_mv);
x_pu = x0 >> s->sps->log2_min_pu_size;
y_pu = y0 >> s->sps->log2_min_pu_size;
for (j = 0; j < nPbH >> s->sps->log2_min_pu_size; j++)
for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
} else { /* MODE_INTER */
if (!skip_flag)
lc->pu.merge_flag = ff_hevc_merge_flag_decode(s);
if (lc->pu.merge_flag) {
if (skip_flag || lc->pu.merge_flag) {
if (s->sh.max_num_merge_cand > 1)
merge_idx = ff_hevc_merge_idx_decode(s);
else
@@ -1649,6 +1635,7 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
ref_idx[0] = ff_hevc_ref_idx_lx_decode(s, s->sh.nb_refs[L0]);
current_mv.ref_idx[0] = ref_idx[0];
}
current_mv.pred_flag = PF_L0;
ff_hevc_hls_mvd_coding(s, x0, y0, 0);
mvp_flag[0] = ff_hevc_mvp_lx_flag_decode(s);
@@ -1687,7 +1674,6 @@ static void hls_prediction_unit(HEVCContext *s, int x0, int y0,
for (i = 0; i < nPbW >> s->sps->log2_min_pu_size; i++)
tab_mvf[(y_pu + j) * min_pu_width + x_pu + i] = current_mv;
}
}
if (current_mv.pred_flag & PF_L0) {
ref0 = refPicList[0].ref[current_mv.ref_idx[0]];