From: Nuo Mi <nuomi2021@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Cc: Nuo Mi <nuomi2021@gmail.com>
Subject: [FFmpeg-devel] [PATCH 3/8] cbs_h266: fix inference for xh_deblocking_filter_disabled_flag
Date: Mon, 7 Aug 2023 22:55:28 +0800
Message-ID: <TYSPR06MB6433E0B274FEB3EE952CA634AA0CA@TYSPR06MB6433.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <20230807145533.17949-1-nuomi2021@gmail.com>
if !ph_deblocking_params_present_flag is true, ph_deblocking_filter_disabled_flag infered from pps
if !sh_deblocking_params_present_flag is true, sh_deblocking_filter_disabled_flag infered from ph
---
libavcodec/cbs_h266_syntax_template.c | 76 ++++++++++-----------------
1 file changed, 28 insertions(+), 48 deletions(-)
diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index 801feedb4a..7277154c40 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -2938,20 +2938,14 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw,
infer(ph_sao_chroma_enabled_flag, 0);
}
- if (pps->pps_dbf_info_in_ph_flag) {
+ if (pps->pps_dbf_info_in_ph_flag)
flag(ph_deblocking_params_present_flag);
- if (current->ph_deblocking_params_present_flag) {
- if (!pps->pps_deblocking_filter_disabled_flag) {
- flag(ph_deblocking_filter_disabled_flag);
- } else {
- if (pps->pps_deblocking_filter_disabled_flag &&
- current->ph_deblocking_params_present_flag) {
- infer(ph_deblocking_filter_disabled_flag, 0);
- } else {
- infer(ph_deblocking_filter_disabled_flag,
- pps->pps_deblocking_filter_disabled_flag);
- }
- }
+ else
+ infer(ph_deblocking_params_present_flag, 0);
+
+ if (current->ph_deblocking_params_present_flag) {
+ if (!pps->pps_deblocking_filter_disabled_flag) {
+ flag(ph_deblocking_filter_disabled_flag);
if (!current->ph_deblocking_filter_disabled_flag) {
se(ph_luma_beta_offset_div2, -12, 12);
se(ph_luma_tc_offset_div2, -12, 12);
@@ -2970,25 +2964,19 @@ static int FUNC(picture_header) (CodedBitstreamContext *ctx, RWContext *rw,
infer(ph_cr_tc_offset_div2,
current->ph_luma_tc_offset_div2);
}
- } else {
- infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2);
- infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2);
- if (pps->pps_chroma_tool_offsets_present_flag) {
- infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2);
- infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2);
- infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2);
- infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2);
- } else {
- infer(ph_cb_beta_offset_div2,
- current->ph_luma_beta_offset_div2);
- infer(ph_cb_tc_offset_div2,
- current->ph_luma_tc_offset_div2);
- infer(ph_cr_beta_offset_div2,
- current->ph_luma_beta_offset_div2);
- infer(ph_cr_tc_offset_div2,
- current->ph_luma_tc_offset_div2);
- }
}
+ } else {
+ infer(ph_deblocking_filter_disabled_flag, 0);
+ }
+ } else {
+ infer(ph_deblocking_filter_disabled_flag, pps->pps_deblocking_filter_disabled_flag);
+ if (!current->ph_deblocking_filter_disabled_flag) {
+ infer(ph_luma_beta_offset_div2, pps->pps_luma_beta_offset_div2);
+ infer(ph_luma_tc_offset_div2, pps->pps_luma_tc_offset_div2);
+ infer(ph_cb_beta_offset_div2, pps->pps_cb_beta_offset_div2);
+ infer(ph_cb_tc_offset_div2, pps->pps_cb_tc_offset_div2);
+ infer(ph_cr_beta_offset_div2, pps->pps_cr_beta_offset_div2);
+ infer(ph_cr_tc_offset_div2, pps->pps_cr_tc_offset_div2);
}
}
@@ -3321,9 +3309,7 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
if (!pps->pps_deblocking_filter_disabled_flag)
flag(sh_deblocking_filter_disabled_flag);
else
- infer(sh_deblocking_filter_disabled_flag,
- !(pps->pps_deblocking_filter_disabled_flag &&
- current->sh_deblocking_params_present_flag));
+ infer(sh_deblocking_filter_disabled_flag, 0);
if (!current->sh_deblocking_filter_disabled_flag) {
se(sh_luma_beta_offset_div2, -12, 12);
se(sh_luma_tc_offset_div2, -12, 12);
@@ -3340,22 +3326,16 @@ static int FUNC(slice_header) (CodedBitstreamContext *ctx, RWContext *rw,
current->sh_luma_beta_offset_div2);
infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2);
}
- } else {
+ }
+ } else {
+ infer(sh_deblocking_filter_disabled_flag, ph->ph_deblocking_filter_disabled_flag);
+ if (!current->sh_deblocking_filter_disabled_flag) {
infer(sh_luma_beta_offset_div2, ph->ph_luma_beta_offset_div2);
infer(sh_luma_tc_offset_div2, ph->ph_luma_tc_offset_div2);
- if (pps->pps_chroma_tool_offsets_present_flag) {
- infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2);
- infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2);
- infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2);
- infer(sh_cr_tc_offset_div2, ph->ph_cr_beta_offset_div2);
- } else {
- infer(sh_cb_beta_offset_div2,
- current->sh_luma_beta_offset_div2);
- infer(sh_cb_tc_offset_div2, current->sh_luma_tc_offset_div2);
- infer(sh_cr_beta_offset_div2,
- current->sh_luma_beta_offset_div2);
- infer(sh_cr_tc_offset_div2, current->sh_luma_tc_offset_div2);
- }
+ infer(sh_cb_beta_offset_div2, ph->ph_cb_beta_offset_div2);
+ infer(sh_cb_tc_offset_div2, ph->ph_cb_tc_offset_div2);
+ infer(sh_cr_beta_offset_div2, ph->ph_cr_beta_offset_div2);
+ infer(sh_cr_tc_offset_div2, ph->ph_cr_tc_offset_div2);
}
}
--
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:[~2023-08-07 14:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230807145533.17949-1-nuomi2021@gmail.com>
2023-08-07 14:55 ` [FFmpeg-devel] [PATCH 2/8] cbs_h266: fix inference for sh_alf_enabled_flag Nuo Mi
2023-08-07 14:55 ` Nuo Mi [this message]
2023-08-07 14:55 ` [FFmpeg-devel] [PATCH 4/8] cbs_h266: fix slice_height_in_ctus for single slice tile Nuo Mi
2023-08-07 14:55 ` [FFmpeg-devel] [PATCH 5/8] cbs_h266: H266RawSliceHeader, expose NumEntryPoints 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=TYSPR06MB6433E0B274FEB3EE952CA634AA0CA@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