[FFmpeg-devel] [PATCH 2/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode()
Nuo Mi
nuomi2021 at gmail.com
Sat Jul 13 05:06:29 EEST 2024
On Sun, May 19, 2024 at 10:49 AM Michael Niedermayer <michael at 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 at 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 at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
>
More information about the ffmpeg-devel
mailing list