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@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2024-06-14 17:38:26 +02:00
parent 7b539ca3e6
commit c735552b0b
2 changed files with 5 additions and 16 deletions

View File

@ -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;

View File

@ -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);