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
636 return GET_CABAC(PRED_MODE_FLAG_OFFSET);636 return GET_CABAC(PRED_MODE_FLAG_OFFSET);
637}637}
638 638
639int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, const HEVCSPS *sps,639int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, uint8_t *tab_ct_depth,
640 const HEVCSPS *sps,
640 int ct_depth, int x0, int y0)641 int ct_depth, int x0, int y0)
641{642{
642 const HEVCContext *const s = lc->parent;
643 int inc = 0, depth_left = 0, depth_top = 0;643 int inc = 0, depth_left = 0, depth_top = 0;
644 int x0b = av_zero_extend(x0, sps->log2_ctb_size);644 int x0b = av_zero_extend(x0, sps->log2_ctb_size);
645 int y0b = av_zero_extend(y0, sps->log2_ctb_size);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 int y_cb = y0 >> sps->log2_min_cb_size;647 int y_cb = y0 >> sps->log2_min_cb_size;
648 648
649 if (lc->ctb_left_flag || x0b)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 if (lc->ctb_up_flag || y0b)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 inc += (depth_left > ct_depth);654 inc += (depth_left > ct_depth);
655 inc += (depth_top > ct_depth);655 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
72 av_freep(&l->deblock);72 av_freep(&l->deblock);
73 73
74 av_freep(&l->skip_flag);74 av_freep(&l->skip_flag);
75 av_freep(&s->tab_ct_depth);75 av_freep(&l->tab_ct_depth);
76 76
77 av_freep(&s->tab_ipm);77 av_freep(&s->tab_ipm);
78 av_freep(&s->cbf_luma);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 goto fail;109 goto fail;
110 110
111 l->skip_flag = av_malloc_array(sps->min_cb_height, sps->min_cb_width);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);112 l->tab_ct_depth = av_malloc_array(sps->min_cb_height, sps->min_cb_width);
113 if (!l->skip_flag || !s->tab_ct_depth)113 if (!l->skip_flag || !l->tab_ct_depth)
114 goto fail;114 goto fail;
115 115
116 s->cbf_luma = av_malloc_array(sps->min_tb_width, sps->min_tb_height);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 lc->qPy_pred = lc->qp_y;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 return 0;2388 return 0;
2389}2389}
@@ -2403,7 +2403,8 @@ static int hls_coding_quadtree(HEVCLocalContext *lc, · 13 unmodified lines
2403 if (x0 + cb_size <= sps->width &&2403 if (x0 + cb_size <= sps->width &&
2404 y0 + cb_size <= sps->height &&2404 y0 + cb_size <= sps->height &&
2405 log2_cb_size > sps->log2_min_cb_size) {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 } else {2408 } else {
2408 split_cu = (log2_cb_size > sps->log2_min_cb_size);2409 split_cu = (log2_cb_size > sps->log2_min_cb_size);
2409 }2410 }
libavcodec/hevc/hevcdec.h+3−3
@@ -449,6 +449,7 @@ typedef struct HEVCLayerContext { · 448 unmodified lines
449 449
450 // CU450 // CU
451 uint8_t *skip_flag;451 uint8_t *skip_flag;
452 uint8_t *tab_ct_depth;
452} HEVCLayerContext;453} HEVCLayerContext;
453 454
454typedef struct HEVCContext {455typedef struct HEVCContext {
@@ -506,8 +507,6 @@ typedef struct HEVCContext { · 51 unmodified lines
506 507
507 int32_t *tab_slice_address;508 int32_t *tab_slice_address;
508 509
509 // CU
510 uint8_t *tab_ct_depth;
511 // PU510 // PU
512 uint8_t *tab_ipm;511 uint8_t *tab_ipm;
513 512
@@ -584,7 +583,8 @@ int ff_hevc_cu_transquant_bypass_flag_decode(HEVCLocalContext *lc); · 70 unmodified lines
584int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, uint8_t *skip_flag,583int ff_hevc_skip_flag_decode(HEVCLocalContext *lc, uint8_t *skip_flag,
585 int x0, int y0, int x_cb, int y_cb, int min_cb_width);584 int x0, int y0, int x_cb, int y_cb, int min_cb_width);
586int ff_hevc_pred_mode_decode(HEVCLocalContext *lc);585int ff_hevc_pred_mode_decode(HEVCLocalContext *lc);
587int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, const HEVCSPS *sps,586int ff_hevc_split_coding_unit_flag_decode(HEVCLocalContext *lc, uint8_t *tab_ct_depth,
587 const HEVCSPS *sps,
588 int ct_depth, int x0, int y0);588 int ct_depth, int x0, int y0);
589int ff_hevc_part_mode_decode(HEVCLocalContext *lc, const HEVCSPS *sps, int log2_cb_size);589int ff_hevc_part_mode_decode(HEVCLocalContext *lc, const HEVCSPS *sps, int log2_cb_size);
590int ff_hevc_pcm_flag_decode(HEVCLocalContext *lc);590int 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