[FFmpeg-cvslog] avcodec/rv10: Use ff_h263_decode_init()

Andreas Rheinhardt git at videolan.org
Thu Jun 20 20:01:24 EEST 2024


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Fri Jun 14 17:38:26 2024 +0200| [c735552b0b7fc5ab744fd8f652d27e490c6bccd9] | committer: Andreas Rheinhardt

avcodec/rv10: Use ff_h263_decode_init()

The RV10 and RV20 decoders use ff_h263_decode_mb() and also the
H.263 DSP and VLCs. Despite not calling ff_h263_decode_frame(),
it is nevertheless beneficial to call ff_h263_decode_init()
to reduce code duplication.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c735552b0b7fc5ab744fd8f652d27e490c6bccd9
---

 libavcodec/h263dec.c |  2 ++
 libavcodec/rv10.c    | 19 +++----------------
 2 files changed, 5 insertions(+), 16 deletions(-)

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 666675fcf1..19a57582ad 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -135,6 +135,8 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
         s->msmpeg4_version = MSMP4_WMV2;
         break;
     case AV_CODEC_ID_H263I:
+    case AV_CODEC_ID_RV10:
+    case AV_CODEC_ID_RV20:
         break;
     case AV_CODEC_ID_FLV1:
         s->h263_flv = 1;
diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c
index c6baaa0269..65060d4ece 100644
--- a/libavcodec/rv10.c
+++ b/libavcodec/rv10.c
@@ -346,7 +346,6 @@ static av_cold void rv10_init_static(void)
         rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i].sym = 255;
         rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i].len = 18;
     }
-    ff_h263_decode_init_vlc();
 }
 
 static av_cold int rv10_decode_init(AVCodecContext *avctx)
@@ -364,16 +363,12 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
                                    avctx->coded_height, 0, avctx)) < 0)
         return ret;
 
-    ret = ff_mpv_decode_init(s, avctx);
+    ret = ff_h263_decode_init(avctx);
     if (ret < 0)
         return ret;
 
-    s->out_format  = FMT_H263;
-
-    rv->orig_width  =
-    s->width        = avctx->coded_width;
-    rv->orig_height =
-    s->height       = avctx->coded_height;
+    rv->orig_width  = avctx->coded_width;
+    rv->orig_height = avctx->coded_height;
 
     s->h263_long_vectors = ((uint8_t *) avctx->extradata)[3] & 1;
     rv->sub_id           = AV_RB32((uint8_t *) avctx->extradata + 4);
@@ -382,7 +377,6 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
     minor_ver = RV_GET_MINOR_VER(rv->sub_id);
     micro_ver = RV_GET_MICRO_VER(rv->sub_id);
 
-    s->low_delay = 1;
     switch (major_ver) {
     case 1:
         s->rv10_version = micro_ver ? 3 : 1;
@@ -405,13 +399,6 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
                ((uint32_t *) avctx->extradata)[0]);
     }
 
-    avctx->pix_fmt = AV_PIX_FMT_YUV420P;
-
-    if ((ret = ff_mpv_common_init(s)) < 0)
-        return ret;
-
-    ff_h263dsp_init(&s->h263dsp);
-
     /* init static VLCs */
     ff_thread_once(&init_static_once, rv10_init_static);
 



More information about the ffmpeg-cvslog mailing list