Commit 3fe96294 authored by Christophe Gisquet's avatar Christophe Gisquet Committed by Michael Niedermayer

hevc: move intermediate bidir buffer

Other buffers are already there.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent de60ce39
...@@ -1327,7 +1327,6 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, ...@@ -1327,7 +1327,6 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
int block_w, int block_h, AVFrame *ref1, const Mv *mv1, struct MvField *current_mv) int block_w, int block_h, AVFrame *ref1, const Mv *mv1, struct MvField *current_mv)
{ {
HEVCLocalContext *lc = s->HEVClc; HEVCLocalContext *lc = s->HEVClc;
DECLARE_ALIGNED(16, int16_t, tmp[MAX_PB_SIZE * MAX_PB_SIZE]);
ptrdiff_t src0stride = ref0->linesize[0]; ptrdiff_t src0stride = ref0->linesize[0];
ptrdiff_t src1stride = ref1->linesize[0]; ptrdiff_t src1stride = ref1->linesize[0];
int pic_width = s->sps->width; int pic_width = s->sps->width;
...@@ -1381,13 +1380,13 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, ...@@ -1381,13 +1380,13 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride,
src1stride = edge_emu_stride; src1stride = edge_emu_stride;
} }
s->hevcdsp.put_hevc_qpel[idx][!!my0][!!mx0](tmp, src0, src0stride, s->hevcdsp.put_hevc_qpel[idx][!!my0][!!mx0](lc->tmp, src0, src0stride,
block_h, mx0, my0, block_w); block_h, mx0, my0, block_w);
if (!weight_flag) if (!weight_flag)
s->hevcdsp.put_hevc_qpel_bi[idx][!!my1][!!mx1](dst, dststride, src1, src1stride, tmp, s->hevcdsp.put_hevc_qpel_bi[idx][!!my1][!!mx1](dst, dststride, src1, src1stride, lc->tmp,
block_h, mx1, my1, block_w); block_h, mx1, my1, block_w);
else else
s->hevcdsp.put_hevc_qpel_bi_w[idx][!!my1][!!mx1](dst, dststride, src1, src1stride, tmp, s->hevcdsp.put_hevc_qpel_bi_w[idx][!!my1][!!mx1](dst, dststride, src1, src1stride, lc->tmp,
block_h, s->sh.luma_log2_weight_denom, block_h, s->sh.luma_log2_weight_denom,
s->sh.luma_weight_l0[current_mv->ref_idx[0]], s->sh.luma_weight_l0[current_mv->ref_idx[0]],
s->sh.luma_weight_l1[current_mv->ref_idx[1]], s->sh.luma_weight_l1[current_mv->ref_idx[1]],
...@@ -1482,7 +1481,6 @@ static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0, ...@@ -1482,7 +1481,6 @@ static void chroma_mc_uni(HEVCContext *s, uint8_t *dst0,
static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVFrame *ref0, AVFrame *ref1, static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVFrame *ref0, AVFrame *ref1,
int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int cidx) int x_off, int y_off, int block_w, int block_h, struct MvField *current_mv, int cidx)
{ {
DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
HEVCLocalContext *lc = s->HEVClc; HEVCLocalContext *lc = s->HEVClc;
uint8_t *src1 = ref0->data[cidx+1]; uint8_t *src1 = ref0->data[cidx+1];
uint8_t *src2 = ref1->data[cidx+1]; uint8_t *src2 = ref1->data[cidx+1];
...@@ -1552,15 +1550,15 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF ...@@ -1552,15 +1550,15 @@ static void chroma_mc_bi(HEVCContext *s, uint8_t *dst0, ptrdiff_t dststride, AVF
src2stride = edge_emu_stride; src2stride = edge_emu_stride;
} }
s->hevcdsp.put_hevc_epel[idx][!!my0][!!mx0](tmp, src1, src1stride, s->hevcdsp.put_hevc_epel[idx][!!my0][!!mx0](lc->tmp, src1, src1stride,
block_h, _mx0, _my0, block_w); block_h, _mx0, _my0, block_w);
if (!weight_flag) if (!weight_flag)
s->hevcdsp.put_hevc_epel_bi[idx][!!my1][!!mx1](dst0, s->frame->linesize[cidx+1], s->hevcdsp.put_hevc_epel_bi[idx][!!my1][!!mx1](dst0, s->frame->linesize[cidx+1],
src2, src2stride, tmp, src2, src2stride, lc->tmp,
block_h, _mx1, _my1, block_w); block_h, _mx1, _my1, block_w);
else else
s->hevcdsp.put_hevc_epel_bi_w[idx][!!my1][!!mx1](dst0, s->frame->linesize[cidx+1], s->hevcdsp.put_hevc_epel_bi_w[idx][!!my1][!!mx1](dst0, s->frame->linesize[cidx+1],
src2, src2stride, tmp, src2, src2stride, lc->tmp,
block_h, block_h,
s->sh.chroma_log2_weight_denom, s->sh.chroma_log2_weight_denom,
s->sh.chroma_weight_l0[current_mv->ref_idx[0]][cidx], s->sh.chroma_weight_l0[current_mv->ref_idx[0]][cidx],
......
...@@ -771,6 +771,7 @@ typedef struct HEVCLocalContext { ...@@ -771,6 +771,7 @@ typedef struct HEVCLocalContext {
/* +7 is for subpixel interpolation, *2 for high bit depths */ /* +7 is for subpixel interpolation, *2 for high bit depths */
DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2]; DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2];
DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer2)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2]; DECLARE_ALIGNED(32, uint8_t, edge_emu_buffer2)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2];
DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]);
CodingTree ct; CodingTree ct;
CodingUnit cu; CodingUnit cu;
......
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