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.
Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -135,6 +135,8 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) · 134 unmodified lines | |||
| 135 | s->msmpeg4_version = MSMP4_WMV2; | 135 | s->msmpeg4_version = MSMP4_WMV2; |
| 136 | break; | 136 | break; |
| 137 | case AV_CODEC_ID_H263I: | 137 | case AV_CODEC_ID_H263I: |
| 138 | case AV_CODEC_ID_RV10: | ||
| 139 | case AV_CODEC_ID_RV20: | ||
| 138 | break; | 140 | break; |
| 139 | case AV_CODEC_ID_FLV1: | 141 | case AV_CODEC_ID_FLV1: |
| 140 | s->h263_flv = 1; | 142 | s->h263_flv = 1; |
| @@ -346,7 +346,6 @@ static av_cold void rv10_init_static(void) · 345 unmodified lines | |||
| 346 | rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i].sym = 255; | 346 | rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i].sym = 255; |
| 347 | rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i].len = 18; | 347 | rv_dc_chrom.table[(0x1FE << (DC_VLC_BITS - 9)) + i].len = 18; |
| 348 | } | 348 | } |
| 349 | ff_h263_decode_init_vlc(); | ||
| 350 | } | 349 | } |
| 351 | 350 | ||
| 352 | static av_cold int rv10_decode_init(AVCodecContext *avctx) | 351 | static av_cold int rv10_decode_init(AVCodecContext *avctx) |
| @@ -364,16 +363,12 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) · 11 unmodified lines | |||
| 364 | avctx->coded_height, 0, avctx)) < 0) | 363 | avctx->coded_height, 0, avctx)) < 0) |
| 365 | return ret; | 364 | return ret; |
| 366 | 365 | ||
| 367 | ret = ff_mpv_decode_init(s, avctx); | 366 | ret = ff_h263_decode_init(avctx); |
| 368 | if (ret < 0) | 367 | if (ret < 0) |
| 369 | return ret; | 368 | return ret; |
| 370 | 369 | ||
| 371 | s->out_format = FMT_H263; | 370 | rv->orig_width = avctx->coded_width; |
| 372 | 371 | rv->orig_height = avctx->coded_height; | |
| 373 | rv->orig_width = | ||
| 374 | s->width = avctx->coded_width; | ||
| 375 | rv->orig_height = | ||
| 376 | s->height = avctx->coded_height; | ||
| 377 | 372 | ||
| 378 | s->h263_long_vectors = ((uint8_t *) avctx->extradata)[3] & 1; | 373 | s->h263_long_vectors = ((uint8_t *) avctx->extradata)[3] & 1; |
| 379 | rv->sub_id = AV_RB32((uint8_t *) avctx->extradata + 4); | 374 | rv->sub_id = AV_RB32((uint8_t *) avctx->extradata + 4); |
| @@ -382,7 +377,6 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) · 2 unmodified lines | |||
| 382 | minor_ver = RV_GET_MINOR_VER(rv->sub_id); | 377 | minor_ver = RV_GET_MINOR_VER(rv->sub_id); |
| 383 | micro_ver = RV_GET_MICRO_VER(rv->sub_id); | 378 | micro_ver = RV_GET_MICRO_VER(rv->sub_id); |
| 384 | 379 | ||
| 385 | s->low_delay = 1; | ||
| 386 | switch (major_ver) { | 380 | switch (major_ver) { |
| 387 | case 1: | 381 | case 1: |
| 388 | s->rv10_version = micro_ver ? 3 : 1; | 382 | s->rv10_version = micro_ver ? 3 : 1; |
| @@ -405,13 +399,6 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) · 16 unmodified lines | |||
| 405 | ((uint32_t *) avctx->extradata)[0]); | 399 | ((uint32_t *) avctx->extradata)[0]); |
| 406 | } | 400 | } |
| 407 | 401 | ||
| 408 | avctx->pix_fmt = AV_PIX_FMT_YUV420P; | ||
| 409 | |||
| 410 | if ((ret = ff_mpv_common_init(s)) < 0) | ||
| 411 | return ret; | ||
| 412 | |||
| 413 | ff_h263dsp_init(&s->h263dsp); | ||
| 414 | |||
| 415 | /* init static VLCs */ | 402 | /* init static VLCs */ |
| 416 | ff_thread_once(&init_static_once, rv10_init_static); | 403 | ff_thread_once(&init_static_once, rv10_init_static); |
| 417 | 404 | ||