avcodec/vc1dec: Remove VC-1 decoders->H.263 decoder dependency
The only thing from the H.263 decoder that is reachable by the VC-1 decoder is ff_h263_decode_init(); but it does not even use all of it; e.g. h263dsp is unused and so are the VLCs initialized in ff_h263_decode_init() (they amount to about 77KB which are now no longer touched). Notice that one could also call ff_idctdsp_init() directly instead of ff_mpv_idct_init(); one could even do so in ff_vc1_init_common(). Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
1d9aac9c4b
commit
496b3c6987
2
configure
vendored
2
configure
vendored
@ -2970,7 +2970,7 @@ utvideo_encoder_select="bswapdsp huffman llvidencdsp"
|
||||
vble_decoder_select="llviddsp"
|
||||
vbn_decoder_select="texturedsp"
|
||||
vbn_encoder_select="texturedspenc"
|
||||
vc1_decoder_select="blockdsp h263_decoder h264qpel intrax8 mpegvideodec vc1dsp"
|
||||
vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec qpeldsp vc1dsp"
|
||||
vc1image_decoder_select="vc1_decoder"
|
||||
vorbis_encoder_select="audio_frame_queue"
|
||||
vp3_decoder_select="hpeldsp vp3dsp videodsp"
|
||||
|
@ -63,9 +63,6 @@ static enum AVPixelFormat h263_get_format(AVCodecContext *avctx)
|
||||
return avctx->pix_fmt;
|
||||
}
|
||||
|
||||
if (avctx->codec->id == AV_CODEC_ID_MSS2)
|
||||
return AV_PIX_FMT_YUV420P;
|
||||
|
||||
if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY)) {
|
||||
if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
|
||||
avctx->color_range = AVCOL_RANGE_MPEG;
|
||||
@ -117,15 +114,6 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
|
||||
s->h263_pred = 1;
|
||||
s->msmpeg4_version = 5;
|
||||
break;
|
||||
case AV_CODEC_ID_VC1:
|
||||
case AV_CODEC_ID_WMV3:
|
||||
case AV_CODEC_ID_VC1IMAGE:
|
||||
case AV_CODEC_ID_WMV3IMAGE:
|
||||
case AV_CODEC_ID_MSS2:
|
||||
s->h263_pred = 1;
|
||||
s->msmpeg4_version = 6;
|
||||
avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
|
||||
break;
|
||||
case AV_CODEC_ID_H263I:
|
||||
break;
|
||||
case AV_CODEC_ID_FLV1:
|
||||
|
@ -405,6 +405,20 @@ static av_cold int vc1_decode_init_alloc_tables(VC1Context *v)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static enum AVPixelFormat vc1_get_format(AVCodecContext *avctx)
|
||||
{
|
||||
if (avctx->codec_id == AV_CODEC_ID_MSS2)
|
||||
return AV_PIX_FMT_YUV420P;
|
||||
|
||||
if (CONFIG_GRAY && (avctx->flags & AV_CODEC_FLAG_GRAY)) {
|
||||
if (avctx->color_range == AVCOL_RANGE_UNSPECIFIED)
|
||||
avctx->color_range = AVCOL_RANGE_MPEG;
|
||||
return AV_PIX_FMT_GRAY8;
|
||||
}
|
||||
|
||||
return ff_get_format(avctx, avctx->codec->pix_fmts);
|
||||
}
|
||||
|
||||
av_cold int ff_vc1_decode_init(AVCodecContext *avctx)
|
||||
{
|
||||
VC1Context *const v = avctx->priv_data;
|
||||
@ -415,7 +429,12 @@ av_cold int ff_vc1_decode_init(AVCodecContext *avctx)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = ff_h263_decode_init(avctx);
|
||||
ff_mpv_decode_init(s, avctx);
|
||||
ff_mpv_idct_init(s);
|
||||
|
||||
avctx->pix_fmt = vc1_get_format(avctx);
|
||||
|
||||
ret = ff_mpv_common_init(s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -578,13 +597,23 @@ static av_cold void vc1_init_static(void)
|
||||
av_cold void ff_vc1_init_common(VC1Context *v)
|
||||
{
|
||||
static AVOnce init_static_once = AV_ONCE_INIT;
|
||||
MpegEncContext *const s = &v->s;
|
||||
|
||||
/* defaults */
|
||||
v->pq = -1;
|
||||
v->mvrange = 0; /* 7.1.1.18, p80 */
|
||||
|
||||
s->avctx->chroma_sample_location = AVCHROMA_LOC_LEFT;
|
||||
s->out_format = FMT_H263;
|
||||
|
||||
s->h263_pred = 1;
|
||||
s->msmpeg4_version = 6;
|
||||
|
||||
ff_vc1dsp_init(&v->vc1dsp);
|
||||
|
||||
/* For error resilience */
|
||||
ff_qpeldsp_init(&s->qdsp);
|
||||
|
||||
/* VLC tables */
|
||||
ff_thread_once(&init_static_once, vc1_init_static);
|
||||
}
|
||||
@ -702,7 +731,6 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx)
|
||||
|
||||
ff_blockdsp_init(&s->bdsp);
|
||||
ff_h264chroma_init(&v->h264chroma, 8);
|
||||
ff_qpeldsp_init(&s->qdsp);
|
||||
|
||||
avctx->has_b_frames = !!avctx->max_b_frames;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user