* [FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode()
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
@ 2024-05-19 2:49 ` Michael Niedermayer
2024-07-12 21:24 ` Michael Niedermayer
2024-07-13 2:06 ` Nuo Mi
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 3/9] avcodec/vvc/ctu: Simplify pred_mode_plt_flag Michael Niedermayer
` (7 subsequent siblings)
8 siblings, 2 replies; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 2:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
This simplification assumes that the code is correct
Fixes: CID1560036 Logically dead code
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/vvc/ctu.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
index 53f92ca10f7..7495ced0d5a 100644
--- a/libavcodec/vvc/ctu.c
+++ b/libavcodec/vvc/ctu.c
@@ -1080,12 +1080,10 @@ static PredMode pred_mode_decode(VVCLocalContext *lc,
}
if (pred_mode_ibc_flag)
pred_mode = MODE_IBC;
+ return pred_mode;
} else {
- pred_mode_flag = is_4x4 || mode_type == MODE_TYPE_INTRA ||
- mode_type != MODE_TYPE_INTER || IS_I(rsh);
- pred_mode = pred_mode_flag ? MODE_INTRA : MODE_INTER;
+ return MODE_INTRA;
}
- return pred_mode;
}
static void sbt_info(VVCLocalContext *lc, const VVCSPS *sps)
--
2.45.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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode()
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode() Michael Niedermayer
@ 2024-07-12 21:24 ` Michael Niedermayer
2024-07-13 2:06 ` Nuo Mi
1 sibling, 0 replies; 24+ messages in thread
From: Michael Niedermayer @ 2024-07-12 21:24 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 664 bytes --]
On Sun, May 19, 2024 at 04:49:08AM +0200, Michael Niedermayer wrote:
> This simplification assumes that the code is correct
>
> Fixes: CID1560036 Logically dead code
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/vvc/ctu.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
will apply
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode()
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode() Michael Niedermayer
2024-07-12 21:24 ` Michael Niedermayer
@ 2024-07-13 2:06 ` Nuo Mi
1 sibling, 0 replies; 24+ messages in thread
From: Nuo Mi @ 2024-07-13 2:06 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sun, May 19, 2024 at 10:49 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:
> This simplification assumes that the code is correct
>
> Fixes: CID1560036 Logically dead code
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/vvc/ctu.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
> index 53f92ca10f7..7495ced0d5a 100644
> --- a/libavcodec/vvc/ctu.c
> +++ b/libavcodec/vvc/ctu.c
> @@ -1080,12 +1080,10 @@ static PredMode pred_mode_decode(VVCLocalContext
> *lc,
> }
> if (pred_mode_ibc_flag)
> pred_mode = MODE_IBC;
> + return pred_mode;
> } else {
> - pred_mode_flag = is_4x4 || mode_type == MODE_TYPE_INTRA ||
> - mode_type != MODE_TYPE_INTER || IS_I(rsh);
> - pred_mode = pred_mode_flag ? MODE_INTRA : MODE_INTER;
> + return MODE_INTRA;
> }
> - return pred_mode;
> }
>
LGTM.
We can also remove the else branch since the if branch returns.
>
> static void sbt_info(VVCLocalContext *lc, const VVCSPS *sps)
> --
> 2.45.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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* [FFmpeg-devel] [PATCH 3/9] avcodec/vvc/ctu: Simplify pred_mode_plt_flag
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode() Michael Niedermayer
@ 2024-05-19 2:49 ` Michael Niedermayer
2024-05-19 14:40 ` Nuo Mi
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 4/9] avcodec/vvc/ctu: Remove dead ret check Michael Niedermayer
` (6 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 2:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: CID1560039 Logically dead code
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/vvc/ctu.c | 23 ++++++-----------------
1 file changed, 6 insertions(+), 17 deletions(-)
diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
index 7495ced0d5a..b7089b9a004 100644
--- a/libavcodec/vvc/ctu.c
+++ b/libavcodec/vvc/ctu.c
@@ -1793,7 +1793,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in
const int hs = sps->hshift[CHROMA];
const int vs = sps->vshift[CHROMA];
const int is_128 = cb_width > 64 || cb_height > 64;
- int pred_mode_plt_flag = 0;
int ret;
CodingUnit *cu = add_cu(lc, x0, y0, cb_width, cb_height, cqt_depth, tree_type);
@@ -1811,7 +1810,7 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in
mode_type != MODE_TYPE_INTER && ((cb_width * cb_height) >
(tree_type != DUAL_TREE_CHROMA ? 16 : (16 << hs << vs))) &&
(mode_type != MODE_TYPE_INTRA || tree_type != DUAL_TREE_CHROMA)) {
- pred_mode_plt_flag = ff_vvc_pred_mode_plt_flag(lc);
+ int pred_mode_plt_flag = ff_vvc_pred_mode_plt_flag(lc);
if (pred_mode_plt_flag) {
avpriv_report_missing_feature(fc->log_ctx, "Palette");
return AVERROR_PATCHWELCOME;
@@ -1823,31 +1822,21 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in
}
if (cu->pred_mode == MODE_INTRA || cu->pred_mode == MODE_PLT) {
if (tree_type == SINGLE_TREE || tree_type == DUAL_TREE_LUMA) {
- if (pred_mode_plt_flag) {
- avpriv_report_missing_feature(fc->log_ctx, "Palette");
- return AVERROR_PATCHWELCOME;
- } else {
- intra_luma_pred_modes(lc);
- }
+ intra_luma_pred_modes(lc);
ff_vvc_set_intra_mvf(lc, 0);
}
if ((tree_type == SINGLE_TREE || tree_type == DUAL_TREE_CHROMA) && sps->r->sps_chroma_format_idc) {
- if (pred_mode_plt_flag && tree_type == DUAL_TREE_CHROMA) {
- avpriv_report_missing_feature(fc->log_ctx, "Palette");
- return AVERROR_PATCHWELCOME;
- } else if (!pred_mode_plt_flag) {
- if (!cu->act_enabled_flag)
- intra_chroma_pred_modes(lc);
- }
+ if (!cu->act_enabled_flag)
+ intra_chroma_pred_modes(lc);
}
} else if (tree_type != DUAL_TREE_CHROMA) { /* MODE_INTER or MODE_IBC */
if ((ret = inter_data(lc)) < 0)
return ret;
}
- if (cu->pred_mode != MODE_INTRA && !pred_mode_plt_flag && !lc->cu->pu.general_merge_flag)
+ if (cu->pred_mode != MODE_INTRA && !lc->cu->pu.general_merge_flag)
cu->coded_flag = ff_vvc_cu_coded_flag(lc);
else
- cu->coded_flag = !(cu->skip_flag || pred_mode_plt_flag);
+ cu->coded_flag = !(cu->skip_flag);
if (cu->coded_flag) {
sbt_info(lc, sps);
--
2.45.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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/9] avcodec/vvc/ctu: Simplify pred_mode_plt_flag
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 3/9] avcodec/vvc/ctu: Simplify pred_mode_plt_flag Michael Niedermayer
@ 2024-05-19 14:40 ` Nuo Mi
2024-05-19 19:27 ` Michael Niedermayer
0 siblings, 1 reply; 24+ messages in thread
From: Nuo Mi @ 2024-05-19 14:40 UTC (permalink / raw)
To: FFmpeg development discussions and patches, Wu Jianhua
On Sun, May 19, 2024 at 10:49 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:
> Fixes: CID1560039 Logically dead code
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/vvc/ctu.c | 23 ++++++-----------------
> 1 file changed, 6 insertions(+), 17 deletions(-)
>
> diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
> index 7495ced0d5a..b7089b9a004 100644
> --- a/libavcodec/vvc/ctu.c
> +++ b/libavcodec/vvc/ctu.c
> @@ -1793,7 +1793,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int
> x0, int y0, int cb_width, in
> const int hs = sps->hshift[CHROMA];
> const int vs = sps->vshift[CHROMA];
> const int is_128 = cb_width > 64 || cb_height > 64;
> - int pred_mode_plt_flag = 0;
> int ret;
>
> CodingUnit *cu = add_cu(lc, x0, y0, cb_width, cb_height, cqt_depth,
> tree_type);
> @@ -1811,7 +1810,7 @@ static int hls_coding_unit(VVCLocalContext *lc, int
> x0, int y0, int cb_width, in
> mode_type != MODE_TYPE_INTER && ((cb_width * cb_height) >
> (tree_type != DUAL_TREE_CHROMA ? 16 : (16 << hs << vs))) &&
> (mode_type != MODE_TYPE_INTRA || tree_type != DUAL_TREE_CHROMA)) {
> - pred_mode_plt_flag = ff_vvc_pred_mode_plt_flag(lc);
> + int pred_mode_plt_flag = ff_vvc_pred_mode_plt_flag(lc);
> if (pred_mode_plt_flag) {
> avpriv_report_missing_feature(fc->log_ctx, "Palette");
> return AVERROR_PATCHWELCOME;
> @@ -1823,31 +1822,21 @@ static int hls_coding_unit(VVCLocalContext *lc,
> int x0, int y0, int cb_width, in
> }
> if (cu->pred_mode == MODE_INTRA || cu->pred_mode == MODE_PLT) {
> if (tree_type == SINGLE_TREE || tree_type == DUAL_TREE_LUMA) {
> - if (pred_mode_plt_flag) {
> - avpriv_report_missing_feature(fc->log_ctx, "Palette");
> - return AVERROR_PATCHWELCOME;
> - } else {
> - intra_luma_pred_modes(lc);
> - }
> + intra_luma_pred_modes(lc);
> ff_vvc_set_intra_mvf(lc, 0);
> }
> if ((tree_type == SINGLE_TREE || tree_type == DUAL_TREE_CHROMA)
> && sps->r->sps_chroma_format_idc) {
> - if (pred_mode_plt_flag && tree_type == DUAL_TREE_CHROMA) {
> - avpriv_report_missing_feature(fc->log_ctx, "Palette");
> - return AVERROR_PATCHWELCOME;
> - } else if (!pred_mode_plt_flag) {
> - if (!cu->act_enabled_flag)
> - intra_chroma_pred_modes(lc);
> - }
> + if (!cu->act_enabled_flag)
> + intra_chroma_pred_modes(lc);
> }
> } else if (tree_type != DUAL_TREE_CHROMA) { /* MODE_INTER or MODE_IBC
> */
> if ((ret = inter_data(lc)) < 0)
> return ret;
> }
> - if (cu->pred_mode != MODE_INTRA && !pred_mode_plt_flag &&
> !lc->cu->pu.general_merge_flag)
> + if (cu->pred_mode != MODE_INTRA && !lc->cu->pu.general_merge_flag)
> cu->coded_flag = ff_vvc_cu_coded_flag(lc);
> else
> - cu->coded_flag = !(cu->skip_flag || pred_mode_plt_flag);
> + cu->coded_flag = !(cu->skip_flag);
>
> if (cu->coded_flag) {
> sbt_info(lc, sps);
> --
> 2.45.1
>
Hi Michael,
Could we skip this one?
Thanks to Jianhua's help. We may have Palette support in the next month.
Thank you
>
> _______________________________________________
> 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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 3/9] avcodec/vvc/ctu: Simplify pred_mode_plt_flag
2024-05-19 14:40 ` Nuo Mi
@ 2024-05-19 19:27 ` Michael Niedermayer
0 siblings, 0 replies; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 19:27 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 4176 bytes --]
On Sun, May 19, 2024 at 10:40:57PM +0800, Nuo Mi wrote:
> On Sun, May 19, 2024 at 10:49 AM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
>
> > Fixes: CID1560039 Logically dead code
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavcodec/vvc/ctu.c | 23 ++++++-----------------
> > 1 file changed, 6 insertions(+), 17 deletions(-)
> >
> > diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
> > index 7495ced0d5a..b7089b9a004 100644
> > --- a/libavcodec/vvc/ctu.c
> > +++ b/libavcodec/vvc/ctu.c
> > @@ -1793,7 +1793,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int
> > x0, int y0, int cb_width, in
> > const int hs = sps->hshift[CHROMA];
> > const int vs = sps->vshift[CHROMA];
> > const int is_128 = cb_width > 64 || cb_height > 64;
> > - int pred_mode_plt_flag = 0;
> > int ret;
> >
> > CodingUnit *cu = add_cu(lc, x0, y0, cb_width, cb_height, cqt_depth,
> > tree_type);
> > @@ -1811,7 +1810,7 @@ static int hls_coding_unit(VVCLocalContext *lc, int
> > x0, int y0, int cb_width, in
> > mode_type != MODE_TYPE_INTER && ((cb_width * cb_height) >
> > (tree_type != DUAL_TREE_CHROMA ? 16 : (16 << hs << vs))) &&
> > (mode_type != MODE_TYPE_INTRA || tree_type != DUAL_TREE_CHROMA)) {
> > - pred_mode_plt_flag = ff_vvc_pred_mode_plt_flag(lc);
> > + int pred_mode_plt_flag = ff_vvc_pred_mode_plt_flag(lc);
> > if (pred_mode_plt_flag) {
> > avpriv_report_missing_feature(fc->log_ctx, "Palette");
> > return AVERROR_PATCHWELCOME;
> > @@ -1823,31 +1822,21 @@ static int hls_coding_unit(VVCLocalContext *lc,
> > int x0, int y0, int cb_width, in
> > }
> > if (cu->pred_mode == MODE_INTRA || cu->pred_mode == MODE_PLT) {
> > if (tree_type == SINGLE_TREE || tree_type == DUAL_TREE_LUMA) {
> > - if (pred_mode_plt_flag) {
> > - avpriv_report_missing_feature(fc->log_ctx, "Palette");
> > - return AVERROR_PATCHWELCOME;
> > - } else {
> > - intra_luma_pred_modes(lc);
> > - }
> > + intra_luma_pred_modes(lc);
> > ff_vvc_set_intra_mvf(lc, 0);
> > }
> > if ((tree_type == SINGLE_TREE || tree_type == DUAL_TREE_CHROMA)
> > && sps->r->sps_chroma_format_idc) {
> > - if (pred_mode_plt_flag && tree_type == DUAL_TREE_CHROMA) {
> > - avpriv_report_missing_feature(fc->log_ctx, "Palette");
> > - return AVERROR_PATCHWELCOME;
> > - } else if (!pred_mode_plt_flag) {
> > - if (!cu->act_enabled_flag)
> > - intra_chroma_pred_modes(lc);
> > - }
> > + if (!cu->act_enabled_flag)
> > + intra_chroma_pred_modes(lc);
> > }
> > } else if (tree_type != DUAL_TREE_CHROMA) { /* MODE_INTER or MODE_IBC
> > */
> > if ((ret = inter_data(lc)) < 0)
> > return ret;
> > }
> > - if (cu->pred_mode != MODE_INTRA && !pred_mode_plt_flag &&
> > !lc->cu->pu.general_merge_flag)
> > + if (cu->pred_mode != MODE_INTRA && !lc->cu->pu.general_merge_flag)
> > cu->coded_flag = ff_vvc_cu_coded_flag(lc);
> > else
> > - cu->coded_flag = !(cu->skip_flag || pred_mode_plt_flag);
> > + cu->coded_flag = !(cu->skip_flag);
> >
> > if (cu->coded_flag) {
> > sbt_info(lc, sps);
> > --
> > 2.45.1
> >
> Hi Michael,
> Could we skip this one?
> Thanks to Jianhua's help. We may have Palette support in the next month.
of course, patch droped, issues marked as intentional in coverity
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* [FFmpeg-devel] [PATCH 4/9] avcodec/vvc/ctu: Remove dead ret check
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode() Michael Niedermayer
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 3/9] avcodec/vvc/ctu: Simplify pred_mode_plt_flag Michael Niedermayer
@ 2024-05-19 2:49 ` Michael Niedermayer
2024-07-02 18:35 ` Michael Niedermayer
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 5/9] avcodec/vvc/dec: Remove constant eos_at_start Michael Niedermayer
` (5 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 2:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: CID1560040 Logically dead code
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/vvc/ctu.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
index b7089b9a004..89eb9d338c7 100644
--- a/libavcodec/vvc/ctu.c
+++ b/libavcodec/vvc/ctu.c
@@ -1854,8 +1854,6 @@ static int hls_coding_unit(VVCLocalContext *lc, int x0, int y0, int cb_width, in
cu->lfnst_idx = lfnst_idx_decode(lc);
cu->mts_idx = mts_idx_decode(lc);
set_qp_c(lc);
- if (ret < 0)
- return ret;
} else {
ret = skipped_transform_tree_unit(lc);
if (ret < 0)
--
2.45.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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 4/9] avcodec/vvc/ctu: Remove dead ret check
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 4/9] avcodec/vvc/ctu: Remove dead ret check Michael Niedermayer
@ 2024-07-02 18:35 ` Michael Niedermayer
2024-07-03 12:44 ` Nuo Mi
0 siblings, 1 reply; 24+ messages in thread
From: Michael Niedermayer @ 2024-07-02 18:35 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 612 bytes --]
On Sun, May 19, 2024 at 04:49:10AM +0200, Michael Niedermayer wrote:
> Fixes: CID1560040 Logically dead code
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/vvc/ctu.c | 2 --
> 1 file changed, 2 deletions(-)
will apply
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 4/9] avcodec/vvc/ctu: Remove dead ret check
2024-07-02 18:35 ` Michael Niedermayer
@ 2024-07-03 12:44 ` Nuo Mi
0 siblings, 0 replies; 24+ messages in thread
From: Nuo Mi @ 2024-07-03 12:44 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Jul 3, 2024 at 2:44 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:
> On Sun, May 19, 2024 at 04:49:10AM +0200, Michael Niedermayer wrote:
> > Fixes: CID1560040 Logically dead code
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavcodec/vvc/ctu.c | 2 --
> > 1 file changed, 2 deletions(-)
>
> will apply
>
+1, thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Breaking DRM is a little like attempting to break through a door even
> though the window is wide open and the only thing in the house is a bunch
> of things you dont want and which you would get tomorrow for free anyway
> _______________________________________________
> 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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* [FFmpeg-devel] [PATCH 5/9] avcodec/vvc/dec: Remove constant eos_at_start
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
` (2 preceding siblings ...)
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 4/9] avcodec/vvc/ctu: Remove dead ret check Michael Niedermayer
@ 2024-05-19 2:49 ` Michael Niedermayer
2024-07-02 18:34 ` Michael Niedermayer
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 6/9] avcodec/vvc/dec: Check init_get_bits8() for failure Michael Niedermayer
` (4 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 2:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: CID1560041 'Constant' variable guards dead code
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/vvc/dec.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
index 25cdb39cabb..d262d310125 100644
--- a/libavcodec/vvc/dec.c
+++ b/libavcodec/vvc/dec.c
@@ -825,7 +825,6 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt)
const CodedBitstreamH266Context *h266 = s->cbc->priv_data;
CodedBitstreamFragment *frame = &s->current_frame;
int ret = 0;
- int eos_at_start = 1;
s->last_eos = s->eos;
s->eos = 0;
@@ -841,10 +840,7 @@ static int decode_nal_units(VVCContext *s, VVCFrameContext *fc, AVPacket *avpkt)
const CodedBitstreamUnit *unit = frame->units + i;
if (unit->type == VVC_EOB_NUT || unit->type == VVC_EOS_NUT) {
- if (eos_at_start)
- s->last_eos = 1;
- else
- s->eos = 1;
+ s->last_eos = 1;
} else {
ret = decode_nal_unit(s, fc, nal, unit);
if (ret < 0) {
--
2.45.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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 5/9] avcodec/vvc/dec: Remove constant eos_at_start
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 5/9] avcodec/vvc/dec: Remove constant eos_at_start Michael Niedermayer
@ 2024-07-02 18:34 ` Michael Niedermayer
2024-07-03 12:44 ` Nuo Mi
0 siblings, 1 reply; 24+ messages in thread
From: Michael Niedermayer @ 2024-07-02 18:34 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 494 bytes --]
On Sun, May 19, 2024 at 04:49:11AM +0200, Michael Niedermayer wrote:
> Fixes: CID1560041 'Constant' variable guards dead code
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/vvc/dec.c | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
will apply
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is what and why we do it that matters, not just one of them.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 5/9] avcodec/vvc/dec: Remove constant eos_at_start
2024-07-02 18:34 ` Michael Niedermayer
@ 2024-07-03 12:44 ` Nuo Mi
0 siblings, 0 replies; 24+ messages in thread
From: Nuo Mi @ 2024-07-03 12:44 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Wed, Jul 3, 2024 at 2:44 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:
> On Sun, May 19, 2024 at 04:49:11AM +0200, Michael Niedermayer wrote:
> > Fixes: CID1560041 'Constant' variable guards dead code
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavcodec/vvc/dec.c | 6 +-----
> > 1 file changed, 1 insertion(+), 5 deletions(-)
>
> will apply
>
+1, thx
>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> It is what and why we do it that matters, not just one of them.
> _______________________________________________
> 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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* [FFmpeg-devel] [PATCH 6/9] avcodec/vvc/dec: Check init_get_bits8() for failure
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
` (3 preceding siblings ...)
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 5/9] avcodec/vvc/dec: Remove constant eos_at_start Michael Niedermayer
@ 2024-05-19 2:49 ` Michael Niedermayer
2024-05-19 14:31 ` Nuo Mi
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 7/9] avcodec/vvc/mvs: Initialize mvf Michael Niedermayer
` (3 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 2:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: CID1560042 Unchecked return value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/vvc/dec.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
index d262d310125..f2ede490c8b 100644
--- a/libavcodec/vvc/dec.c
+++ b/libavcodec/vvc/dec.c
@@ -514,6 +514,7 @@ static int slice_init_entry_points(SliceContext *sc,
int nb_eps = sh->r->num_entry_points + 1;
int ctu_addr = 0;
GetBitContext gb;
+ int ret;
if (sc->nb_eps != nb_eps) {
eps_free(sc);
@@ -523,7 +524,9 @@ static int slice_init_entry_points(SliceContext *sc,
sc->nb_eps = nb_eps;
}
- init_get_bits8(&gb, slice->data, slice->data_size);
+ ret = init_get_bits8(&gb, slice->data, slice->data_size);
+ if (ret < 0)
+ return ret;
for (int i = 0; i < sc->nb_eps; i++)
{
EntryPoint *ep = sc->eps + i;
--
2.45.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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 6/9] avcodec/vvc/dec: Check init_get_bits8() for failure
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 6/9] avcodec/vvc/dec: Check init_get_bits8() for failure Michael Niedermayer
@ 2024-05-19 14:31 ` Nuo Mi
2024-05-19 19:39 ` Michael Niedermayer
0 siblings, 1 reply; 24+ messages in thread
From: Nuo Mi @ 2024-05-19 14:31 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sun, May 19, 2024 at 10:50 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:
> Fixes: CID1560042 Unchecked return value
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/vvc/dec.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
> index d262d310125..f2ede490c8b 100644
> --- a/libavcodec/vvc/dec.c
> +++ b/libavcodec/vvc/dec.c
> @@ -514,6 +514,7 @@ static int slice_init_entry_points(SliceContext *sc,
> int nb_eps = sh->r->num_entry_points + 1;
> int ctu_addr = 0;
> GetBitContext gb;
> + int ret;
>
> if (sc->nb_eps != nb_eps) {
> eps_free(sc);
> @@ -523,7 +524,9 @@ static int slice_init_entry_points(SliceContext *sc,
> sc->nb_eps = nb_eps;
> }
>
> - init_get_bits8(&gb, slice->data, slice->data_size);
> + ret = init_get_bits8(&gb, slice->data, slice->data_size);
> + if (ret < 0)
> + return ret;
> for (int i = 0; i < sc->nb_eps; i++)
> {
> EntryPoint *ep = sc->eps + i;
>
LGTM.
Thank you, Michael.
> --
> 2.45.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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 6/9] avcodec/vvc/dec: Check init_get_bits8() for failure
2024-05-19 14:31 ` Nuo Mi
@ 2024-05-19 19:39 ` Michael Niedermayer
0 siblings, 0 replies; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 19:39 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1532 bytes --]
On Sun, May 19, 2024 at 10:31:50PM +0800, Nuo Mi wrote:
> On Sun, May 19, 2024 at 10:50 AM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
>
> > Fixes: CID1560042 Unchecked return value
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavcodec/vvc/dec.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c
> > index d262d310125..f2ede490c8b 100644
> > --- a/libavcodec/vvc/dec.c
> > +++ b/libavcodec/vvc/dec.c
> > @@ -514,6 +514,7 @@ static int slice_init_entry_points(SliceContext *sc,
> > int nb_eps = sh->r->num_entry_points + 1;
> > int ctu_addr = 0;
> > GetBitContext gb;
> > + int ret;
> >
> > if (sc->nb_eps != nb_eps) {
> > eps_free(sc);
> > @@ -523,7 +524,9 @@ static int slice_init_entry_points(SliceContext *sc,
> > sc->nb_eps = nb_eps;
> > }
> >
> > - init_get_bits8(&gb, slice->data, slice->data_size);
> > + ret = init_get_bits8(&gb, slice->data, slice->data_size);
> > + if (ret < 0)
> > + return ret;
> > for (int i = 0; i < sc->nb_eps; i++)
> > {
> > EntryPoint *ep = sc->eps + i;
> >
> LGTM.
> Thank you, Michael.
will apply
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* [FFmpeg-devel] [PATCH 7/9] avcodec/vvc/mvs: Initialize mvf
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
` (4 preceding siblings ...)
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 6/9] avcodec/vvc/dec: Check init_get_bits8() for failure Michael Niedermayer
@ 2024-05-19 2:49 ` Michael Niedermayer
2024-05-19 14:28 ` Nuo Mi
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 8/9] avcodec/wavpack: Remove dead assignments Michael Niedermayer
` (2 subsequent siblings)
8 siblings, 1 reply; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 2:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
This might not be needed for correctness but it could
help general reproducability of issues
Related to: CID1560037 Uninitialized scalar variable
Related to: CID1560044 Uninitialized scalar variable
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/vvc/mvs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c
index fe7d9234603..521cf96a896 100644
--- a/libavcodec/vvc/mvs.c
+++ b/libavcodec/vvc/mvs.c
@@ -411,7 +411,7 @@ void ff_vvc_store_sb_mvs(const VVCLocalContext *lc, PredictionUnit *pu)
const int sbw = cu->cb_width / mi->num_sb_x;
const int sbh = cu->cb_height / mi->num_sb_y;
SubblockParams params[2];
- MvField mvf;
+ MvField mvf = {0};
mvf.pred_flag = mi->pred_flag;
mvf.bcw_idx = mi->bcw_idx;
@@ -504,7 +504,7 @@ void ff_vvc_store_mvf(const VVCLocalContext *lc, const MvField *mvf)
void ff_vvc_store_mv(const VVCLocalContext *lc, const MotionInfo *mi)
{
const CodingUnit *cu = lc->cu;
- MvField mvf;
+ MvField mvf = {0};
mvf.hpel_if_idx = mi->hpel_if_idx;
mvf.bcw_idx = mi->bcw_idx;
--
2.45.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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 7/9] avcodec/vvc/mvs: Initialize mvf
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 7/9] avcodec/vvc/mvs: Initialize mvf Michael Niedermayer
@ 2024-05-19 14:28 ` Nuo Mi
2024-05-19 19:40 ` Michael Niedermayer
0 siblings, 1 reply; 24+ messages in thread
From: Nuo Mi @ 2024-05-19 14:28 UTC (permalink / raw)
To: FFmpeg development discussions and patches
On Sun, May 19, 2024 at 10:50 AM Michael Niedermayer <michael@niedermayer.cc>
wrote:
> This might not be needed for correctness but it could
> help general reproducability of issues
>
> Related to: CID1560037 Uninitialized scalar variable
> Related to: CID1560044 Uninitialized scalar variable
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/vvc/mvs.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c
> index fe7d9234603..521cf96a896 100644
> --- a/libavcodec/vvc/mvs.c
> +++ b/libavcodec/vvc/mvs.c
> @@ -411,7 +411,7 @@ void ff_vvc_store_sb_mvs(const VVCLocalContext *lc,
> PredictionUnit *pu)
> const int sbw = cu->cb_width / mi->num_sb_x;
> const int sbh = cu->cb_height / mi->num_sb_y;
> SubblockParams params[2];
> - MvField mvf;
> + MvField mvf = {0};
>
> mvf.pred_flag = mi->pred_flag;
> mvf.bcw_idx = mi->bcw_idx;
> @@ -504,7 +504,7 @@ void ff_vvc_store_mvf(const VVCLocalContext *lc, const
> MvField *mvf)
> void ff_vvc_store_mv(const VVCLocalContext *lc, const MotionInfo *mi)
> {
> const CodingUnit *cu = lc->cu;
> - MvField mvf;
> + MvField mvf = {0};
>
> mvf.hpel_if_idx = mi->hpel_if_idx;
> mvf.bcw_idx = mi->bcw_idx;
> --
> 2.45.1
>
both "mvf.ciip_flag = 0" are not needed if we set mvf to 0
>
> _______________________________________________
> 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".
>
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 7/9] avcodec/vvc/mvs: Initialize mvf
2024-05-19 14:28 ` Nuo Mi
@ 2024-05-19 19:40 ` Michael Niedermayer
0 siblings, 0 replies; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 19:40 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1831 bytes --]
On Sun, May 19, 2024 at 10:28:49PM +0800, Nuo Mi wrote:
> On Sun, May 19, 2024 at 10:50 AM Michael Niedermayer <michael@niedermayer.cc>
> wrote:
>
> > This might not be needed for correctness but it could
> > help general reproducability of issues
> >
> > Related to: CID1560037 Uninitialized scalar variable
> > Related to: CID1560044 Uninitialized scalar variable
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavcodec/vvc/mvs.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavcodec/vvc/mvs.c b/libavcodec/vvc/mvs.c
> > index fe7d9234603..521cf96a896 100644
> > --- a/libavcodec/vvc/mvs.c
> > +++ b/libavcodec/vvc/mvs.c
> > @@ -411,7 +411,7 @@ void ff_vvc_store_sb_mvs(const VVCLocalContext *lc,
> > PredictionUnit *pu)
> > const int sbw = cu->cb_width / mi->num_sb_x;
> > const int sbh = cu->cb_height / mi->num_sb_y;
> > SubblockParams params[2];
> > - MvField mvf;
> > + MvField mvf = {0};
> >
> > mvf.pred_flag = mi->pred_flag;
> > mvf.bcw_idx = mi->bcw_idx;
> > @@ -504,7 +504,7 @@ void ff_vvc_store_mvf(const VVCLocalContext *lc, const
> > MvField *mvf)
> > void ff_vvc_store_mv(const VVCLocalContext *lc, const MotionInfo *mi)
> > {
> > const CodingUnit *cu = lc->cu;
> > - MvField mvf;
> > + MvField mvf = {0};
> >
> > mvf.hpel_if_idx = mi->hpel_if_idx;
> > mvf.bcw_idx = mi->bcw_idx;
> > --
> > 2.45.1
> >
> both "mvf.ciip_flag = 0" are not needed if we set mvf to 0
locally changed
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* [FFmpeg-devel] [PATCH 8/9] avcodec/wavpack: Remove dead assignments
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
` (5 preceding siblings ...)
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 7/9] avcodec/vvc/mvs: Initialize mvf Michael Niedermayer
@ 2024-05-19 2:49 ` Michael Niedermayer
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 9/9] avcodec/wavpackenc: Use unsigned for potential 31bit shift Michael Niedermayer
2024-05-19 3:18 ` [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Peter Ross
8 siblings, 0 replies; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 2:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: CID1442018 Unused value
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/wavpack.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index d4cf489c0fa..bf9aa0cdcec 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -1418,13 +1418,13 @@ static int wavpack_decode_block(AVCodecContext *avctx, AVFrame *frame, int block
chmask = bytestream2_get_le32(&gb);
break;
case 4:
- size = bytestream2_get_byte(&gb);
+ bytestream2_get_byte(&gb);
chan |= (bytestream2_get_byte(&gb) & 0xF) << 8;
chan += 1;
chmask = bytestream2_get_le24(&gb);
break;
case 5:
- size = bytestream2_get_byte(&gb);
+ bytestream2_get_byte(&gb);
chan |= (bytestream2_get_byte(&gb) & 0xF) << 8;
chan += 1;
chmask = bytestream2_get_le32(&gb);
--
2.45.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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* [FFmpeg-devel] [PATCH 9/9] avcodec/wavpackenc: Use unsigned for potential 31bit shift
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
` (6 preceding siblings ...)
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 8/9] avcodec/wavpack: Remove dead assignments Michael Niedermayer
@ 2024-05-19 2:49 ` Michael Niedermayer
2024-06-02 19:08 ` Michael Niedermayer
2024-05-19 3:18 ` [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Peter Ross
8 siblings, 1 reply; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 2:49 UTC (permalink / raw)
To: FFmpeg development discussions and patches
Fixes: CID1465481 Unintentional integer overflow
Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/wavpackenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/wavpackenc.c b/libavcodec/wavpackenc.c
index ba0371592d9..e99ab951d41 100644
--- a/libavcodec/wavpackenc.c
+++ b/libavcodec/wavpackenc.c
@@ -1979,7 +1979,7 @@ static void encode_flush(WavPackEncodeContext *s)
put_bits(pb, 31, 0x7FFFFFFF);
cbits -= 31;
} else {
- put_bits(pb, cbits, (1 << cbits) - 1);
+ put_bits(pb, cbits, (1U << cbits) - 1);
cbits = 0;
}
} while (cbits);
@@ -2008,7 +2008,7 @@ static void encode_flush(WavPackEncodeContext *s)
put_bits(pb, 31, 0x7FFFFFFF);
cbits -= 31;
} else {
- put_bits(pb, cbits, (1 << cbits) - 1);
+ put_bits(pb, cbits, (1U << cbits) - 1);
cbits = 0;
}
} while (cbits);
--
2.45.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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 9/9] avcodec/wavpackenc: Use unsigned for potential 31bit shift
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 9/9] avcodec/wavpackenc: Use unsigned for potential 31bit shift Michael Niedermayer
@ 2024-06-02 19:08 ` Michael Niedermayer
0 siblings, 0 replies; 24+ messages in thread
From: Michael Niedermayer @ 2024-06-02 19:08 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 687 bytes --]
On Sun, May 19, 2024 at 04:49:15AM +0200, Michael Niedermayer wrote:
> Fixes: CID1465481 Unintentional integer overflow
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/wavpackenc.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
will apply the 2 wavpack* patches
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
If the United States is serious about tackling the national security threats
related to an insecure 5G network, it needs to rethink the extent to which it
values corporate profits and government espionage over security.-Bruce Schneier
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure
2024-05-19 2:49 [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Michael Niedermayer
` (7 preceding siblings ...)
2024-05-19 2:49 ` [FFmpeg-devel] [PATCH 9/9] avcodec/wavpackenc: Use unsigned for potential 31bit shift Michael Niedermayer
@ 2024-05-19 3:18 ` Peter Ross
2024-05-19 19:37 ` Michael Niedermayer
8 siblings, 1 reply; 24+ messages in thread
From: Peter Ross @ 2024-05-19 3:18 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1101 bytes --]
On Sun, May 19, 2024 at 04:49:07AM +0200, Michael Niedermayer wrote:
> Fixes: CID1516090 Unchecked return value
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
> libavcodec/vqcdec.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c
> index 5c6cab3c1ab..bb69844327d 100644
> --- a/libavcodec/vqcdec.c
> +++ b/libavcodec/vqcdec.c
> @@ -147,10 +147,13 @@ static int decode_vectors(VqcContext * s, const uint8_t * buf, int size, int wid
> GetBitContext gb;
> uint8_t * vectors = s->vectors;
> uint8_t * vectors_end = s->vectors + (width * height * 3) / 2;
> + int ret;
>
> memset(vectors, 0, 3 * width * height / 2);
>
> - init_get_bits8(&gb, buf, size);
> + ret = init_get_bits8(&gb, buf, size);
> + if (ret < 0)
> + return ret;
>
> for (int i = 0; i < 3 * width * height / 2 / 32; i++) {
> uint8_t * dst = vectors;
ok
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure
2024-05-19 3:18 ` [FFmpeg-devel] [PATCH 1/9] avcodec/vqcdec: Check init_get_bits8() for failure Peter Ross
@ 2024-05-19 19:37 ` Michael Niedermayer
0 siblings, 0 replies; 24+ messages in thread
From: Michael Niedermayer @ 2024-05-19 19:37 UTC (permalink / raw)
To: FFmpeg development discussions and patches
[-- Attachment #1.1: Type: text/plain, Size: 1460 bytes --]
On Sun, May 19, 2024 at 01:18:09PM +1000, Peter Ross wrote:
> On Sun, May 19, 2024 at 04:49:07AM +0200, Michael Niedermayer wrote:
> > Fixes: CID1516090 Unchecked return value
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> > libavcodec/vqcdec.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavcodec/vqcdec.c b/libavcodec/vqcdec.c
> > index 5c6cab3c1ab..bb69844327d 100644
> > --- a/libavcodec/vqcdec.c
> > +++ b/libavcodec/vqcdec.c
> > @@ -147,10 +147,13 @@ static int decode_vectors(VqcContext * s, const uint8_t * buf, int size, int wid
> > GetBitContext gb;
> > uint8_t * vectors = s->vectors;
> > uint8_t * vectors_end = s->vectors + (width * height * 3) / 2;
> > + int ret;
> >
> > memset(vectors, 0, 3 * width * height / 2);
> >
> > - init_get_bits8(&gb, buf, size);
> > + ret = init_get_bits8(&gb, buf, size);
> > + if (ret < 0)
> > + return ret;
> >
> > for (int i = 0; i < 3 * width * height / 2 / 32; i++) {
> > uint8_t * dst = vectors;
>
> ok
will apply
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
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".
^ permalink raw reply [flat|nested] 24+ messages in thread