From: Nuo Mi <nuomi2021@gmail.com> To: ffmpeg-devel@ffmpeg.org Cc: Nuo Mi <nuomi2021@gmail.com> Subject: [FFmpeg-devel] [PATCH 08/11] avcodec/vvcdec: fix dual tree for skipped transform tree/unit Date: Thu, 22 Feb 2024 15:14:03 +0800 Message-ID: <TYSPR06MB64338C85642FCBD0FFEB3EC0AA562@TYSPR06MB6433.apcprd06.prod.outlook.com> (raw) In-Reply-To: <20240222071406.5714-1-nuomi2021@gmail.com> fix IBC_E_Tencent_1.bit --- libavcodec/vvc/vvc_ctu.c | 24 +++++++++++++++--------- libavcodec/vvc/vvc_intra.c | 6 ++++-- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/libavcodec/vvc/vvc_ctu.c b/libavcodec/vvc/vvc_ctu.c index 00476c81e4..2cf6e82f26 100644 --- a/libavcodec/vvc/vvc_ctu.c +++ b/libavcodec/vvc/vvc_ctu.c @@ -481,8 +481,9 @@ static int hls_transform_tree(VVCLocalContext *lc, int x0, int y0,int tu_width, static int skipped_transform_tree(VVCLocalContext *lc, int x0, int y0,int tu_width, int tu_height) { - VVCFrameContext *fc = lc->fc; - const VVCSPS *sps = fc->ps.sps; + VVCFrameContext *fc = lc->fc; + const CodingUnit *cu = lc->cu; + const VVCSPS *sps = fc->ps.sps; if (tu_width > sps->max_tb_size_y || tu_height > sps->max_tb_size_y) { const int ver_split_first = tu_width > sps->max_tb_size_y && tu_width > tu_height; @@ -501,11 +502,14 @@ static int skipped_transform_tree(VVCLocalContext *lc, int x0, int y0,int tu_wid else SKIPPED_TRANSFORM_TREE(x0, y0 + trafo_height); } else { - TransformUnit *tu = add_tu(fc, lc->cu, x0, y0, tu_width, tu_height); - const int c_end = sps->r->sps_chroma_format_idc ? VVC_MAX_SAMPLE_ARRAYS : (LUMA + 1); + TransformUnit *tu = add_tu(fc, lc->cu, x0, y0, tu_width, tu_height); + const int has_chroma = sps->r->sps_chroma_format_idc && cu->tree_type != DUAL_TREE_LUMA; + const int c_start = cu->tree_type == DUAL_TREE_CHROMA ? CB : LUMA; + const int c_end = has_chroma ? VVC_MAX_SAMPLE_ARRAYS : CB; + if (!tu) return AVERROR_INVALIDDATA; - for (int i = LUMA; i < c_end; i++) { + for (int i = c_start; i < c_end; i++) { TransformBlock *tb = add_tb(tu, lc, x0, y0, tu_width >> sps->hshift[i], tu_height >> sps->vshift[i], i); if (i != CR) set_tb_pos(fc, tb); @@ -1125,11 +1129,14 @@ static void sbt_info(VVCLocalContext *lc, const VVCSPS *sps) static int skipped_transform_tree_unit(VVCLocalContext *lc) { - const CodingUnit *cu = lc->cu; + const H266RawSPS *rsps = lc->fc->ps.sps->r; + const CodingUnit *cu = lc->cu; int ret; - set_qp_y(lc, cu->x0, cu->y0, 0); - set_qp_c(lc); + if (cu->tree_type != DUAL_TREE_CHROMA) + set_qp_y(lc, cu->x0, cu->y0, 0); + if (rsps->sps_chroma_format_idc && cu->tree_type != DUAL_TREE_LUMA) + set_qp_c(lc); ret = skipped_transform_tree(lc, cu->x0, cu->y0, cu->cb_width, cu->cb_height); if (ret < 0) return ret; @@ -1815,7 +1822,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in if (ret < 0) return ret; } else { - av_assert0(tree_type == SINGLE_TREE); ret = skipped_transform_tree_unit(lc); if (ret < 0) return ret; diff --git a/libavcodec/vvc/vvc_intra.c b/libavcodec/vvc/vvc_intra.c index 214ad38c8c..fb001d6713 100644 --- a/libavcodec/vvc/vvc_intra.c +++ b/libavcodec/vvc/vvc_intra.c @@ -602,8 +602,10 @@ int ff_vvc_reconstruct(VVCLocalContext *lc, const int rs, const int rx, const in if (cu->coded_flag) { ret = reconstruct(lc); } else { - add_reconstructed_area(lc, LUMA, cu->x0, cu->y0, cu->cb_width, cu->cb_height); - add_reconstructed_area(lc, CHROMA, cu->x0, cu->y0, cu->cb_width, cu->cb_height); + if (cu->tree_type != DUAL_TREE_CHROMA) + add_reconstructed_area(lc, LUMA, cu->x0, cu->y0, cu->cb_width, cu->cb_height); + if (sps->r->sps_chroma_format_idc && cu->tree_type != DUAL_TREE_LUMA) + add_reconstructed_area(lc, CHROMA, cu->x0, cu->y0, cu->cb_width, cu->cb_height); } cu = cu->next; } -- 2.25.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2024-02-22 7:16 UTC|newest] Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <20240222071406.5714-1-nuomi2021@gmail.com> 2024-02-22 7:13 ` [FFmpeg-devel] [PATCH 01/11] avcodec/vvcdec: refact out deblock_bs to reduce duplicate code Nuo Mi 2024-02-22 7:13 ` [FFmpeg-devel] [PATCH 02/11] avcodec/vvcdec: set CuPredMode table for chroma Nuo Mi 2024-02-22 7:13 ` [FFmpeg-devel] [PATCH 03/11] avcodec/vvcdec: deblock_bs, fix intra check for IBC Nuo Mi 2024-02-22 7:13 ` [FFmpeg-devel] [PATCH 04/11] avcodec/vvcdec: cabac, fix non_inter_flag, pred_mode_flag, amvr_shift " Nuo Mi 2024-02-22 7:14 ` [FFmpeg-devel] [PATCH 05/11] avcodec/vvcdec: implement update_hmvp " Nuo Mi 2024-02-22 7:14 ` [FFmpeg-devel] [PATCH 06/11] avcodec/vvcdec: skip inter prediction for IBC blocks Nuo Mi 2024-02-22 7:14 ` [FFmpeg-devel] [PATCH 07/11] avcodec/vvcdec: ff_vvc_set_intra_mvf, refact to support dmvr tab Nuo Mi 2024-02-22 7:14 ` Nuo Mi [this message] 2024-02-22 7:14 ` [FFmpeg-devel] [PATCH 09/11] avcodec/vvcdec: refact, rename !is_mvp to check_mer Nuo Mi 2024-02-22 7:14 ` [FFmpeg-devel] [PATCH 10/11] avcodec/vvcdec: add Intra Block Copy parser Nuo Mi 2024-02-22 7:14 ` [FFmpeg-devel] [PATCH 11/11] avcodec/vvcdec: add Intra Block Copy decoder Nuo Mi 2024-02-23 13:03 ` Nuo Mi 2024-02-24 12:33 ` Nuo Mi 2024-02-24 13:20 ` Ronald S. Bultje 2024-02-25 3:07 ` Nuo Mi
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=TYSPR06MB64338C85642FCBD0FFEB3EC0AA562@TYSPR06MB6433.apcprd06.prod.outlook.com \ --to=nuomi2021@gmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git