diff mbox series

[FFmpeg-devel,1/7] avcodec/rv34: Move dsp init code to rv30/rv40

Message ID HE1PR0301MB2154797581397B7732434BA08F749@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 4e65a41a5cfdcafb0c9d26b7e531daa3a1b5fde2
Headers show
Series [FFmpeg-devel,1/7] avcodec/rv34: Move dsp init code to rv30/rv40
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 8, 2021, 7:36 p.m. UTC
It avoids both runtime and compile-time checks.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/rv30.c | 1 +
 libavcodec/rv34.c | 9 ---------
 libavcodec/rv40.c | 1 +
 3 files changed, 2 insertions(+), 9 deletions(-)

Comments

Andreas Rheinhardt April 11, 2021, 1:15 a.m. UTC | #1
Andreas Rheinhardt:
> It avoids both runtime and compile-time checks.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/rv30.c | 1 +
>  libavcodec/rv34.c | 9 ---------
>  libavcodec/rv40.c | 1 +
>  3 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
> index 36cd5345fd..e2b75fbec0 100644
> --- a/libavcodec/rv30.c
> +++ b/libavcodec/rv30.c
> @@ -285,6 +285,7 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx)
>      r->loop_filter        = rv30_loop_filter;
>      r->luma_dc_quant_i = rv30_luma_dc_quant;
>      r->luma_dc_quant_p = rv30_luma_dc_quant;
> +    ff_rv30dsp_init(&r->rdsp);
>      return 0;
>  }
>  
> diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
> index 99e580a09a..e68072de06 100644
> --- a/libavcodec/rv34.c
> +++ b/libavcodec/rv34.c
> @@ -1503,15 +1503,6 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
>  
>      ff_h264_pred_init(&r->h, AV_CODEC_ID_RV40, 8, 1);
>  
> -#if CONFIG_RV30_DECODER
> -    if (avctx->codec_id == AV_CODEC_ID_RV30)
> -        ff_rv30dsp_init(&r->rdsp);
> -#endif
> -#if CONFIG_RV40_DECODER
> -    if (avctx->codec_id == AV_CODEC_ID_RV40)
> -        ff_rv40dsp_init(&r->rdsp);
> -#endif
> -
>      if ((ret = rv34_decoder_alloc(r)) < 0) {
>          ff_mpv_common_end(&r->s);
>          return ret;
> diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
> index e0903226b9..8532a872d9 100644
> --- a/libavcodec/rv40.c
> +++ b/libavcodec/rv40.c
> @@ -567,6 +567,7 @@ static av_cold int rv40_decode_init(AVCodecContext *avctx)
>      r->loop_filter        = rv40_loop_filter;
>      r->luma_dc_quant_i = rv40_luma_dc_quant[0];
>      r->luma_dc_quant_p = rv40_luma_dc_quant[1];
> +    ff_rv40dsp_init(&r->rdsp);
>      return 0;
>  }
>  
> 
Will apply this patchset tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c
index 36cd5345fd..e2b75fbec0 100644
--- a/libavcodec/rv30.c
+++ b/libavcodec/rv30.c
@@ -285,6 +285,7 @@  static av_cold int rv30_decode_init(AVCodecContext *avctx)
     r->loop_filter        = rv30_loop_filter;
     r->luma_dc_quant_i = rv30_luma_dc_quant;
     r->luma_dc_quant_p = rv30_luma_dc_quant;
+    ff_rv30dsp_init(&r->rdsp);
     return 0;
 }
 
diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c
index 99e580a09a..e68072de06 100644
--- a/libavcodec/rv34.c
+++ b/libavcodec/rv34.c
@@ -1503,15 +1503,6 @@  av_cold int ff_rv34_decode_init(AVCodecContext *avctx)
 
     ff_h264_pred_init(&r->h, AV_CODEC_ID_RV40, 8, 1);
 
-#if CONFIG_RV30_DECODER
-    if (avctx->codec_id == AV_CODEC_ID_RV30)
-        ff_rv30dsp_init(&r->rdsp);
-#endif
-#if CONFIG_RV40_DECODER
-    if (avctx->codec_id == AV_CODEC_ID_RV40)
-        ff_rv40dsp_init(&r->rdsp);
-#endif
-
     if ((ret = rv34_decoder_alloc(r)) < 0) {
         ff_mpv_common_end(&r->s);
         return ret;
diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c
index e0903226b9..8532a872d9 100644
--- a/libavcodec/rv40.c
+++ b/libavcodec/rv40.c
@@ -567,6 +567,7 @@  static av_cold int rv40_decode_init(AVCodecContext *avctx)
     r->loop_filter        = rv40_loop_filter;
     r->luma_dc_quant_i = rv40_luma_dc_quant[0];
     r->luma_dc_quant_p = rv40_luma_dc_quant[1];
+    ff_rv40dsp_init(&r->rdsp);
     return 0;
 }