| @@ -66,7 +66,7 @@ static const uint8_t hevc_pel_weight[65] = { [2] = 0, [4] = 1, [6] = 2, [8] = 3, · 65 unmodified lines |
| 66 | 66 | */ |
| 67 | 67 | |
| 68 | 68 | /* free everything allocated by pic_arrays_init() */ |
| 69 | | −static void pic_arrays_free(HEVCContext *s, HEVCLayerContext *l) |
| 69 | +static void pic_arrays_free(HEVCLayerContext *l) |
| 70 | 70 | { |
| 71 | 71 | av_freep(&l->sao); |
| 72 | 72 | av_freep(&l->deblock); |
| @@ -85,12 +85,12 @@ static void pic_arrays_free(HEVCContext *s, HEVCLayerContext *l) · 12 unmodified lines |
| 85 | 85 | av_freep(&l->horizontal_bs); |
| 86 | 86 | av_freep(&l->vertical_bs); |
| 87 | 87 | |
| 88 | | − ff_refstruct_pool_uninit(&s->tab_mvf_pool); |
| 89 | | − ff_refstruct_pool_uninit(&s->rpl_tab_pool); |
| 88 | + ff_refstruct_pool_uninit(&l->tab_mvf_pool); |
| 89 | + ff_refstruct_pool_uninit(&l->rpl_tab_pool); |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /* allocate arrays that depend on frame dimensions */ |
| 93 | | −static int pic_arrays_init(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *sps) |
| 93 | +static int pic_arrays_init(HEVCLayerContext *l, const HEVCSPS *sps) |
| 94 | 94 | { |
| 95 | 95 | int log2_min_cb_size = sps->log2_min_cb_size; |
| 96 | 96 | int width = sps->width; |
| @@ -132,15 +132,15 @@ static int pic_arrays_init(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *s · 35 unmodified lines |
| 132 | 132 | if (!l->horizontal_bs || !l->vertical_bs) |
| 133 | 133 | goto fail; |
| 134 | 134 | |
| 135 | | − s->tab_mvf_pool = ff_refstruct_pool_alloc(min_pu_size * sizeof(MvField), 0); |
| 136 | | − s->rpl_tab_pool = ff_refstruct_pool_alloc(ctb_count * sizeof(RefPicListTab), 0); |
| 137 | | − if (!s->tab_mvf_pool || !s->rpl_tab_pool) |
| 135 | + l->tab_mvf_pool = ff_refstruct_pool_alloc(min_pu_size * sizeof(MvField), 0); |
| 136 | + l->rpl_tab_pool = ff_refstruct_pool_alloc(ctb_count * sizeof(RefPicListTab), 0); |
| 137 | + if (!l->tab_mvf_pool || !l->rpl_tab_pool) |
| 138 | 138 | goto fail; |
| 139 | 139 | |
| 140 | 140 | return 0; |
| 141 | 141 | |
| 142 | 142 | fail: |
| 143 | | − pic_arrays_free(s, l); |
| 143 | + pic_arrays_free(l); |
| 144 | 144 | return AVERROR(ENOMEM); |
| 145 | 145 | } |
| 146 | 146 | |
| @@ -531,14 +531,14 @@ static int set_sps(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *sps) · 384 unmodified lines |
| 531 | 531 | { |
| 532 | 532 | int ret, i; |
| 533 | 533 | |
| 534 | | − pic_arrays_free(s, l); |
| 534 | + pic_arrays_free(l); |
| 535 | 535 | s->ps.sps = NULL; |
| 536 | 536 | ff_refstruct_unref(&s->vps); |
| 537 | 537 | |
| 538 | 538 | if (!sps) |
| 539 | 539 | return 0; |
| 540 | 540 | |
| 541 | | − ret = pic_arrays_init(s, l, sps); |
| 541 | + ret = pic_arrays_init(l, sps); |
| 542 | 542 | if (ret < 0) |
| 543 | 543 | goto fail; |
| 544 | 544 | |
| @@ -576,7 +576,7 @@ static int set_sps(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *sps) · 31 unmodified lines |
| 576 | 576 | return 0; |
| 577 | 577 | |
| 578 | 578 | fail: |
| 579 | | − pic_arrays_free(s, l); |
| 579 | + pic_arrays_free(l); |
| 580 | 580 | for (i = 0; i < 3; i++) { |
| 581 | 581 | av_freep(&s->sao_pixel_buffer_h[i]); |
| 582 | 582 | av_freep(&s->sao_pixel_buffer_v[i]); |
| @@ -3529,7 +3529,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx) · 2946 unmodified lines |
| 3529 | 3529 | int i; |
| 3530 | 3530 | |
| 3531 | 3531 | for (int i = 0; i < FF_ARRAY_ELEMS(s->layers); i++) |
| 3532 | | − pic_arrays_free(s, &s->layers[i]); |
| 3532 | + pic_arrays_free(&s->layers[i]); |
| 3533 | 3533 | |
| 3534 | 3534 | ff_refstruct_unref(&s->vps); |
| 3535 | 3535 | ff_refstruct_unref(&s->pps); |