History

lavc/hevcdec: move HEVCContext.tab_ct_depth to HEVCLayerContext

Anton Khirnov committed 2 years ago

Commit cf7add81 parent 1ca4c2a3 files · +13 −12Browse files

Unified · Split

3 files
  1. libavcodec/hevc/cabac.c +4 −4
  2. libavcodec/hevc/hevcdec.c +6 −5
  3. libavcodec/hevc/hevcdec.h +3 −3
libavcodec/hevc/cabac.c+4−4
@@ -636,10 +636,10 @@ int ff_hevc_pred_mode_decode(HEVCLocalContext *lc) · 635 unmodified lines
636636 return GET_CABAC(PRED_MODE_FLAG_OFFSET);
637637 }
638638
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,
640641 int ct_depth, int x0, int y0)
641642 {
642− const HEVCContext *const s = lc->parent;
643643 int inc = 0, depth_left = 0, depth_top = 0;
644644 int x0b = av_zero_extend(x0, sps->log2_ctb_size);
645645 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
647647 int y_cb = y0 >> sps->log2_min_cb_size;
648648
649649 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];
651651 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];
653653
654654 inc += (depth_left > ct_depth);
655655 inc += (depth_top > ct_depth);
libavcodec/hevc/hevcdec.c+6−5
@@ -72,7 +72,7 @@ static void pic_arrays_free(HEVCContext *s, HEVCLayerContext *l) · 71 unmodified lines
7272 av_freep(&l->deblock);
7373
7474 av_freep(&l->skip_flag);
75− av_freep(&s->tab_ct_depth);
75+ av_freep(&l->tab_ct_depth);
7676
7777 av_freep(&s->tab_ipm);
7878 av_freep(&s->cbf_luma);
@@ -109,8 +109,8 @@ static int pic_arrays_init(HEVCContext *s, HEVCLayerContext *l, const HEVCSPS *s · 30 unmodified lines
109109 goto fail;
110110
111111 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)
114114 goto fail;
115115
116116 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
23832383 lc->qPy_pred = lc->qp_y;
23842384 }
23852385
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);
23872387
23882388 return 0;
23892389 }
@@ -2403,7 +2403,8 @@ static int hls_coding_quadtree(HEVCLocalContext *lc, · 13 unmodified lines
24032403 if (x0 + cb_size <= sps->width &&
24042404 y0 + cb_size <= sps->height &&
24052405 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);
24072408 } else {
24082409 split_cu = (log2_cb_size > sps->log2_min_cb_size);
24092410 }
libavcodec/hevc/hevcdec.h+3−3
@@ -449,6 +449,7 @@ typedef struct HEVCLayerContext { · 448 unmodified lines
449449
450450 // CU
451451 uint8_t *skip_flag;
452+ uint8_t *tab_ct_depth;
452453 } HEVCLayerContext;
453454
454455 typedef struct HEVCContext {
@@ -506,8 +507,6 @@ typedef struct HEVCContext { · 51 unmodified lines
506507
507508 int32_t *tab_slice_address;
508509
509− // CU
510− uint8_t *tab_ct_depth;
511510 // PU
512511 uint8_t *tab_ipm;
513512
@@ -584,7 +583,8 @@ int ff_hevc_cu_transquant_bypass_flag_decode(HEVCLocalContext *lc); · 70 unmodified lines
584583 int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, uint8_t *skip_flag,
585584 int x0, int y0, int x_cb, int y_cb, int min_cb_width);
586585 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,
588588 int ct_depth, int x0, int y0);
589589 int ff_hevc_part_mode_decode(HEVCLocalContext *lc, const HEVCSPS *sps, int log2_cb_size);
590590 int ff_hevc_pcm_flag_decode(HEVCLocalContext *lc);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t