diff options
author | Philip Langdale <philipl@overt.org> | 2017-04-23 15:31:55 -0700 |
---|---|---|
committer | Philip Langdale <philipl@overt.org> | 2017-04-23 15:33:36 -0700 |
commit | dd49eff93095110d2e878bbcc81b0062590d865f (patch) | |
tree | 3af39f2226848b3ff223d3c9aa0d3820c988a829 /libavcodec/crystalhd.c | |
parent | 181aa1be493416c38c8adf0ce21e7fdac64a039e (diff) | |
download | ffmpeg-dd49eff93095110d2e878bbcc81b0062590d865f.tar.gz |
avcodec/crystalhd: Another attempt at using mpeg4_unpack_bframes bsf
I tried doing this before, but it resulted in weird behaviour with
certain samples. I want to say I think I've got it sorted out now,
and the new autobsf stuff makes it trivial to turn on.
The native support for packed bframes is buggy and I think buggy
in ways beyond what I already try to account for, so this should be
a net improvements.
Diffstat (limited to 'libavcodec/crystalhd.c')
-rw-r--r-- | libavcodec/crystalhd.c | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index a22dfe16ea..83bc8bf364 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -101,7 +101,6 @@ typedef struct { /* Options */ uint32_t sWidth; - uint8_t bframe_bug; } CHDContext; static const AVOption options[] = { @@ -631,16 +630,6 @@ static inline CopyRet receive_frame(AVCodecContext *avctx, } else if (ret == BC_STS_SUCCESS) { int copy_ret = -1; if (output.PoutFlags & BC_POUT_FLAGS_PIB_VALID) { - if (avctx->codec->id == AV_CODEC_ID_MPEG4 && - output.PicInfo.timeStamp == 0 && priv->bframe_bug) { - if (!priv->bframe_bug) { - av_log(avctx, AV_LOG_VERBOSE, - "CrystalHD: Not returning packed frame twice.\n"); - } - DtsReleaseOutputBuffs(dev, NULL, FALSE); - return RET_COPY_AGAIN; - } - print_frame_info(priv, &output); copy_ret = copy_frame(avctx, &output, frame, got_frame); @@ -675,21 +664,6 @@ static int crystalhd_decode_packet(AVCodecContext *avctx, const AVPacket *avpkt) if (avpkt && avpkt->size) { uint64_t pts; - if (!priv->bframe_bug && (avpkt->size == 6 || avpkt->size == 7)) { - /* - * Drop frames trigger the bug - */ - av_log(avctx, AV_LOG_WARNING, - "CrystalHD: Enabling work-around for packed b-frame bug\n"); - priv->bframe_bug = 1; - } else if (priv->bframe_bug && avpkt->size == 8) { - /* - * Delay frames don't trigger the bug - */ - av_log(avctx, AV_LOG_WARNING, - "CrystalHD: Disabling work-around for packed b-frame bug\n"); - priv->bframe_bug = 0; - } /* * Despite being notionally opaque, either libcrystalhd or @@ -825,7 +799,7 @@ DEFINE_CRYSTALHD_DECODER(mpeg2, MPEG2VIDEO, NULL) #endif #if CONFIG_MPEG4_CRYSTALHD_DECODER -DEFINE_CRYSTALHD_DECODER(mpeg4, MPEG4, NULL) +DEFINE_CRYSTALHD_DECODER(mpeg4, MPEG4, "mpeg4_unpack_bframes") #endif #if CONFIG_MSMPEG4_CRYSTALHD_DECODER |