From: Limin Wang <lance.lmw...@gmail.com> Signed-off-by: Limin Wang <lance.lmw...@gmail.com> --- libavcodec/bitpacked.c | 44 +++++--------------------------------------- 1 file changed, 5 insertions(+), 39 deletions(-)
diff --git a/libavcodec/bitpacked.c b/libavcodec/bitpacked.c index 0440df9..d239141 100644 --- a/libavcodec/bitpacked.c +++ b/libavcodec/bitpacked.c @@ -36,29 +36,6 @@ struct BitpackedContext { const AVPacket *pkt); }; -/* For this format, it's a simple passthrough */ -static int bitpacked_decode_uyvy422(AVCodecContext *avctx, AVFrame *frame, - const AVPacket *avpkt) -{ - int ret; - - /* there is no need to copy as the data already match - * a known pixel format */ - frame->buf[0] = av_buffer_ref(avpkt->buf); - if (!frame->buf[0]) { - return AVERROR(ENOMEM); - } - - ret = av_image_fill_arrays(frame->data, frame->linesize, avpkt->data, - avctx->pix_fmt, avctx->width, avctx->height, 1); - if (ret < 0) { - av_buffer_unref(&frame->buf[0]); - return ret; - } - - return 0; -} - static int bitpacked_decode_yuv422p10(AVCodecContext *avctx, AVFrame *frame, const AVPacket *avpkt) { @@ -102,21 +79,14 @@ static av_cold int bitpacked_init_decoder(AVCodecContext *avctx) { struct BitpackedContext *bc = avctx->priv_data; - if (!avctx->codec_tag || !avctx->width || !avctx->height) + if (!avctx->width || !avctx->height) return AVERROR_INVALIDDATA; - if (avctx->codec_tag == MKTAG('U', 'Y', 'V', 'Y')) { - if (avctx->bits_per_coded_sample == 16 && - avctx->pix_fmt == AV_PIX_FMT_UYVY422) - bc->decode = bitpacked_decode_uyvy422; - else if (avctx->bits_per_coded_sample == 20 && - avctx->pix_fmt == AV_PIX_FMT_YUV422P10) - bc->decode = bitpacked_decode_yuv422p10; - else - return AVERROR_INVALIDDATA; - } else { + if (avctx->bits_per_coded_sample == 20 && + avctx->pix_fmt == AV_PIX_FMT_YUV422P10) + bc->decode = bitpacked_decode_yuv422p10; + else return AVERROR_INVALIDDATA; - } return 0; } @@ -150,9 +120,5 @@ const AVCodec ff_bitpacked_decoder = { .init = bitpacked_init_decoder, .decode = bitpacked_decode, .capabilities = AV_CODEC_CAP_EXPERIMENTAL, - .codec_tags = (const uint32_t []){ - MKTAG('U', 'Y', 'V', 'Y'), - FF_CODEC_TAGS_END, - }, .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE, }; -- 1.8.3.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".