From 3fe962940f1e8fd2f1881c0cee646bd0e52ab204 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet Date: Tue, 23 Sep 2014 21:36:42 +0000 Subject: [PATCH] hevc: move intermediate bidir buffer Other buffers are already there. Signed-off-by: Michael Niedermayer --- libavcodec/hevc.c | 14 ++++++-------- libavcodec/hevc.h | 1 + 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 5fc7324862..15285a850f 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -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) { HEVCLocalContext *lc = s->HEVClc; - DECLARE_ALIGNED(16, int16_t, tmp[MAX_PB_SIZE * MAX_PB_SIZE]); ptrdiff_t src0stride = ref0->linesize[0]; ptrdiff_t src1stride = ref1->linesize[0]; int pic_width = s->sps->width; @@ -1381,13 +1380,13 @@ static void luma_mc_uni(HEVCContext *s, uint8_t *dst, ptrdiff_t dststride, 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); 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); 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, s->sh.luma_weight_l0[current_mv->ref_idx[0]], s->sh.luma_weight_l1[current_mv->ref_idx[1]], @@ -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, 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; uint8_t *src1 = ref0->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 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); if (!weight_flag) 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); else 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, s->sh.chroma_log2_weight_denom, s->sh.chroma_weight_l0[current_mv->ref_idx[0]][cidx], diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h index 980d95f94d..90e47a14b0 100644 --- a/libavcodec/hevc.h +++ b/libavcodec/hevc.h @@ -771,6 +771,7 @@ typedef struct HEVCLocalContext { /* +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_buffer2)[(MAX_PB_SIZE + 7) * EDGE_EMU_BUFFER_STRIDE * 2]; + DECLARE_ALIGNED(16, int16_t, tmp [MAX_PB_SIZE * MAX_PB_SIZE]); CodingTree ct; CodingUnit cu;