From patchwork Wed Oct 26 19:40:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philip Langdale X-Patchwork-Id: 1190 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.133 with SMTP id o127csp220163vsd; Wed, 26 Oct 2016 12:52:12 -0700 (PDT) X-Received: by 10.28.35.75 with SMTP id j72mr9492381wmj.8.1477511532597; Wed, 26 Oct 2016 12:52:12 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dh4si4473170wjc.106.2016.10.26.12.52.12; Wed, 26 Oct 2016 12:52:12 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@overt.org; dkim=neutral (body hash did not verify) header.i=@overt.org; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 95155689E7B; Wed, 26 Oct 2016 22:51:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from rs224.mailgun.us (rs224.mailgun.us [209.61.151.224]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2F4E6689E69 for ; Wed, 26 Oct 2016 22:51:41 +0300 (EEST) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=overt.org; q=dns/txt; s=k1; t=1477511505; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=SKlrE4z11Eu81egpWqNPsz9qAF5FZjQfUQ9McVmeAxI=; b=NIFOeYfTd+NkwU6Rh1rqzl58K2PXF5+hhEtc6ha/awfnJOIZWHL7RWfNuzLTcKeupHsByUVd Hh3F2FP4WTGse45uaZ8cytpqNpOJizoRsmeMM6kdTRFJbbfiJjsslqIDp/GJnJDfj/ToivMc +C1Vam3iGFLfFGqBm6ydaosNYn4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=overt.org; s=k1; q=dns; h=Sender: From: To: Cc: Subject: Date: Message-Id: In-Reply-To: References; b=Hp88Ej+FFQDh418McfcsFkCEarO3ZcGat1GZbQzc1Ok/7mcNiymnVOtd1Tcadjp3n4yT7A ICJ97ITrRzL0uhK5zW/2B/m/4XUJfIL6mjmoR+YqEcK3qmKzS1SIjbnLBmAUAEfrgDZV197o zHNBBMShtgOP4f62BR1puMbQRglpg= X-Mailgun-Sending-Ip: 209.61.151.224 X-Mailgun-Sid: WyIyM2Q3MCIsICJmZm1wZWctZGV2ZWxAZmZtcGVnLm9yZyIsICI0YTg5NjEiXQ== Received: from mail.overt.org (155.208.178.107.bc.googleusercontent.com [107.178.208.155]) by mxa.mailgun.org with ESMTP id 581106b4.7f542467fa78-in7; Wed, 26 Oct 2016 19:40:36 -0000 (UTC) Received: from authenticated-user (mail.overt.org [107.178.208.155]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.overt.org (Postfix) with ESMTPSA id BA316600D1; Wed, 26 Oct 2016 19:40:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=overt.org; s=mail; t=1477510835; bh=CT21UdDgDaeycxabOjbNXmgLArBqC+SHB1vyTzstsb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cVEm3XVhx8TJfOMLqh/yNhIuodTzRu8iV3m2BzY03AonOfhca/7IuNdHbDt5x3LJ3 8L/RsNU5mNBslW8Gu/o4jen8Jz5HShugTO3uPY/W3yTxjTylz5mXi+llRX/FCg4yiO a4ZmTxJI7ryPDt249Jv6GEa3J8yY8rHxCIpATzF9Qm7lhELCJLvjo2OTfVsBmprvh/ WVV5DL3mHm5kYlEFzwAfI2CCLTkRP2oeQk1OC+JIF5Cv5eZSB+UKoPBTlD9AXSolMt ShQvS3jVSx/5Zr6c7RYUhTXrgFD3B5FVKO+c3KYs8dlaxMKQHI38H/qVoAuhctw4CE iJI1eVJZtOR1A== From: Philip Langdale To: ffmpeg-devel@ffmpeg.org Date: Wed, 26 Oct 2016 12:40:23 -0700 Message-Id: <20161026194028.26438-6-philipl@overt.org> In-Reply-To: <20161026194028.26438-1-philipl@overt.org> References: <20161026194028.26438-1-philipl@overt.org> Subject: [FFmpeg-devel] [PATCH 05/10] crystalhd: We don't need the track the last picture number anymore X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Philip Langdale MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This was needed to detect an interlaced failure case that doesn't happen with the new decode api. Signed-off-by: Philip Langdale --- libavcodec/crystalhd.c | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index d738ddb..3db0e17 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -133,8 +133,6 @@ typedef struct { uint8_t is_nal; uint8_t need_second_field; - uint64_t last_picture; - OpaqueList *head; OpaqueList *tail; @@ -310,7 +308,6 @@ static void flush(AVCodecContext *avctx) { CHDContext *priv = avctx->priv_data; - priv->last_picture = -1; priv->need_second_field = 0; av_frame_unref (priv->pic); @@ -446,7 +443,6 @@ static av_cold int init(AVCodecContext *avctx) priv = avctx->priv_data; priv->avctx = avctx; priv->is_nal = avctx->extradata_size > 0 && *(avctx->extradata) == 1; - priv->last_picture = -1; priv->pic = av_frame_alloc(); subtype = id2subtype(priv, avctx->codec->id); @@ -609,19 +605,6 @@ static inline CopyRet copy_frame(AVCodecContext *avctx, return RET_ERROR; } - /* - * If we got a false negative for interlaced on the first field, - * we will realise our mistake here when we see that the picture number is that - * of the previous picture. We cannot recover the frame and should discard the - * second field to keep the correct number of output frames. - */ - if (output->PicInfo.picture_number == priv->last_picture && !priv->need_second_field) { - av_log(avctx, AV_LOG_WARNING, - "Incorrectly guessed progressive frame. Discarding second field\n"); - /* Returning without providing a picture. */ - return RET_OK; - } - interlaced = output->PicInfo.flags & VDEC_FLAG_INTERLACED_SRC; av_log(avctx, AV_LOG_VERBOSE, "Interlaced state: %d\n", @@ -786,42 +769,19 @@ 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 (priv->last_picture == -1) { - /* - * Init to one less, so that the incrementing code doesn't - * need to be special-cased. - */ - priv->last_picture = output.PicInfo.picture_number - 1; - } - 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"); } - priv->last_picture++; DtsReleaseOutputBuffs(dev, NULL, FALSE); return RET_COPY_AGAIN; } print_frame_info(priv, &output); - if (priv->last_picture + 1 < output.PicInfo.picture_number) { - av_log(avctx, AV_LOG_WARNING, - "CrystalHD: Picture Number discontinuity\n"); - /* - * XXX: I have no idea what the semantics of this situation - * are so I don't even know if we've lost frames or which - * ones. - */ - priv->last_picture = output.PicInfo.picture_number - 1; - } - copy_ret = copy_frame(avctx, &output, data, got_frame); - if (*got_frame > 0) { - priv->last_picture++; - } } else { /* * An invalid frame has been consumed.