1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-07-26 06:01:30 +02:00

avcodec/snowenc: Remove redundant pixel format check

ff_encode_preinit() already checked the pixel format via
AVCodec.pix_fmts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2021-09-28 14:10:21 +02:00
parent 4b1aa74de3
commit be6da2f252

View File

@ -120,17 +120,12 @@ static av_cold int encode_init(AVCodecContext *avctx)
/* case AV_PIX_FMT_RGB32: /* case AV_PIX_FMT_RGB32:
s->colorspace= 1; s->colorspace= 1;
break;*/ break;*/
default:
av_log(avctx, AV_LOG_ERROR, "pixel format not supported\n");
return AVERROR_PATCHWELCOME;
} }
ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift, ret = av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &s->chroma_h_shift,
&s->chroma_v_shift); &s->chroma_v_shift);
if (ret) { if (ret)
av_log(avctx, AV_LOG_ERROR, "pixel format invalid or unknown\n");
return ret; return ret;
}
ff_set_cmp(&s->mecc, s->mecc.me_cmp, s->avctx->me_cmp); ff_set_cmp(&s->mecc, s->mecc.me_cmp, s->avctx->me_cmp);
ff_set_cmp(&s->mecc, s->mecc.me_sub_cmp, s->avctx->me_sub_cmp); ff_set_cmp(&s->mecc, s->mecc.me_sub_cmp, s->avctx->me_sub_cmp);