Unified · Split
| @@ -636,10 +636,10 @@ int ff_hevc_pred_mode_decode(HEVCLocalContext *lc) · 635 unmodified lines | ||
| 636 | 636 | return GET_CABAC(PRED_MODE_FLAG_OFFSET); |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | −int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, const HEVCSPS *sps, | |
| 639 | +int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, uint8_t *tab_ct_depth, | |
| 640 | + const HEVCSPS *sps, | |
| 640 | 641 | int ct_depth, int x0, int y0) |
| 641 | 642 | { |
| 642 | − const HEVCContext *const s = lc->parent; | |
| 643 | 643 | int inc = 0, depth_left = 0, depth_top = 0; |
| 644 | 644 | int x0b = av_zero_extend(x0, sps->log2_ctb_size); |
| 645 | 645 | int y0b = av_zero_extend(y0, sps->log2_ctb_size); |
| @@ -647,9 +647,9 @@ int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, const HEVCSPS *s · 1 unmodified line | ||
| 647 | 647 | int y_cb = y0 >> sps->log2_min_cb_size; |
| 648 | 648 | |
| 649 | 649 | if (lc->ctb_left_flag || x0b) |
| 650 | − depth_left = s->tab_ct_depth[(y_cb) * sps->min_cb_width + x_cb - 1]; | |
| 650 | + depth_left = tab_ct_depth[(y_cb) * sps->min_cb_width + x_cb - 1]; | |
| 651 | 651 | if (lc->ctb_up_flag || y0b) |
| 652 | − depth_top = s->tab_ct_depth[(y_cb - 1) * sps->min_cb_width + x_cb]; | |
| 652 | + depth_top = tab_ct_depth[(y_cb - 1) * sps->min_cb_width + x_cb]; | |
| 653 | 653 | |
| 654 | 654 | inc += (depth_left > ct_depth); |
| 655 | 655 | inc += (depth_top > ct_depth); |
| @@ -72,7 +72,7 @@ static void pic_arrays_free(HEVCContext *s, HEVCLayerContext *l) · 71 unmodified lines | ||
| 72 | 72 | av_freep(&l->deblock); |
| 73 | 73 | |
| 74 | 74 | av_freep(&l->skip_flag); |
| 75 | − av_freep(&s->tab_ct_depth); | |
| 75 | + av_freep(&l->tab_ct_depth); | |
| 76 | 76 | |
| 77 | 77 | av_freep(&s->tab_ipm); |
| 78 | 78 | av_freep(&s->cbf_luma); |
| @@ -109,8 +109,8 @@ static int pic_arrays_init(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *s · 30 unmodified lines | ||
| 109 | 109 | goto fail; |
| 110 | 110 | |
| 111 | 111 | l->skip_flag = av_malloc_array(sps->min_cb_height, sps->min_cb_width); |
| 112 | − s->tab_ct_depth = av_malloc_array(sps->min_cb_height, sps->min_cb_width); | |
| 113 | − if (!l->skip_flag || !s->tab_ct_depth) | |
| 112 | + l->tab_ct_depth = av_malloc_array(sps->min_cb_height, sps->min_cb_width); | |
| 113 | + if (!l->skip_flag || !l->tab_ct_depth) | |
| 114 | 114 | goto fail; |
| 115 | 115 | |
| 116 | 116 | s->cbf_luma = av_malloc_array(sps->min_tb_width, sps->min_tb_height); |
| @@ -2383,7 +2383,7 @@ static int hls_coding_unit(HEVCLocalContext *lc, const HEVCContext *s, · 2266 unmodified lines | ||
| 2383 | 2383 | lc->qPy_pred = lc->qp_y; |
| 2384 | 2384 | } |
| 2385 | 2385 | |
| 2386 | − set_ct_depth(sps, s->tab_ct_depth, x0, y0, log2_cb_size, lc->ct_depth); | |
| 2386 | + set_ct_depth(sps, l->tab_ct_depth, x0, y0, log2_cb_size, lc->ct_depth); | |
| 2387 | 2387 | |
| 2388 | 2388 | return 0; |
| 2389 | 2389 | } |
| @@ -2403,7 +2403,8 @@ static int hls_coding_quadtree(HEVCLocalContext *lc, · 13 unmodified lines | ||
| 2403 | 2403 | if (x0 + cb_size <= sps->width && |
| 2404 | 2404 | y0 + cb_size <= sps->height && |
| 2405 | 2405 | log2_cb_size > sps->log2_min_cb_size) { |
| 2406 | − split_cu = ff_hevc_split_coding_unit_flag_decode(lc, sps, cb_depth, x0, y0); | |
| 2406 | + split_cu = ff_hevc_split_coding_unit_flag_decode(lc, l->tab_ct_depth, | |
| 2407 | + sps, cb_depth, x0, y0); | |
| 2407 | 2408 | } else { |
| 2408 | 2409 | split_cu = (log2_cb_size > sps->log2_min_cb_size); |
| 2409 | 2410 | } |
| @@ -449,6 +449,7 @@ typedef struct HEVCLayerContext { · 448 unmodified lines | ||
| 449 | 449 | |
| 450 | 450 | // CU |
| 451 | 451 | uint8_t *skip_flag; |
| 452 | + uint8_t *tab_ct_depth; | |
| 452 | 453 | } HEVCLayerContext; |
| 453 | 454 | |
| 454 | 455 | typedef struct HEVCContext { |
| @@ -506,8 +507,6 @@ typedef struct HEVCContext { · 51 unmodified lines | ||
| 506 | 507 | |
| 507 | 508 | int32_t *tab_slice_address; |
| 508 | 509 | |
| 509 | − // CU | |
| 510 | − uint8_t *tab_ct_depth; | |
| 511 | 510 | // PU |
| 512 | 511 | uint8_t *tab_ipm; |
| 513 | 512 | |
| @@ -584,7 +583,8 @@ int ff_hevc_cu_transquant_bypass_flag_decode(HEVCLocalContext *lc); · 70 unmodified lines | ||
| 584 | 583 | int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, uint8_t *skip_flag, |
| 585 | 584 | int x0, int y0, int x_cb, int y_cb, int min_cb_width); |
| 586 | 585 | int ff_hevc_pred_mode_decode(HEVCLocalContext *lc); |
| 587 | −int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, const HEVCSPS *sps, | |
| 586 | +int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, uint8_t *tab_ct_depth, | |
| 587 | + const HEVCSPS *sps, | |
| 588 | 588 | int ct_depth, int x0, int y0); |
| 589 | 589 | int ff_hevc_part_mode_decode(HEVCLocalContext *lc, const HEVCSPS *sps, int log2_cb_size); |
| 590 | 590 | int ff_hevc_pcm_flag_decode(HEVCLocalContext *lc); |