From patchwork Mon Mar 13 14:18:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 40663 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:d046:b0:cd:afd7:272c with SMTP id hv6csp1798833pzb; Mon, 13 Mar 2023 07:18:27 -0700 (PDT) X-Google-Smtp-Source: AK7set97HUo+FV5OCjFwTBvOhNXTGD8kWqE29NkOWVficM7mgHn8Z9ZFBCnuqyAbdV1EJD904T55 X-Received: by 2002:a17:907:7b85:b0:92b:de2d:18f8 with SMTP id ne5-20020a1709077b8500b0092bde2d18f8mr1200042ejc.64.1678717106944; Mon, 13 Mar 2023 07:18:26 -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 p8-20020a170906498800b0091db3c17819si7217972eju.960.2023.03.13.07.18.26; Mon, 13 Mar 2023 07:18:26 -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=@outlook.com header.s=selector1 header.b=Z2ZmnqPl; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BAF5068BBB0; Mon, 13 Mar 2023 16:18:22 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04olkn2030.outbound.protection.outlook.com [40.92.73.30]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 37D3E6880B3 for ; Mon, 13 Mar 2023 16:18:16 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dmzJmMRh2GVd7KDdUcGDmko6N2FdyzI36cT/cX+BDwWPmQSgBp8c2Aw2x2I7g/e0m0s03Dw3lKYdEfeUUmGJThvUVZZ9CG3pIrQuMGIlNLdlS2pNjJyWFGugQC+DUzf66G5UQJ3btKNrpOOzDLVjDjxCq1z23TbeNzN+cDHtECimwijwSqaa5miyMJnVDLTk8ntoVRQxwi775TZCiAQGqfw+NGov2PKq2SQqodD4BSmfw91LY+UKNZId32rECudcgLgz0QUHOph5iyTMgtNfjYcHzfIqNikgzHWQixcr10KprqEVjpf0Uj87Q77S1f7LUDL5DExVe7kbeC1owY448Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dOZg61gDcrcRilwcx5sHF1uI08UBH5oq3l8UsDibEi0=; b=CeXXEw1uE0Ld84xcrDEmnxe4e0JSgxX1MN9vsKvOmkqJk5AJ6QanBz0u1urgNT7KD26SLgtoMaiKplL9l3bkn37KObPIBz6PVhRUpkq2e4wpC+5TZUkXJSpLerLC063aac0DDu1qbylwlPlOk1gVlBtqp2JDf8DtpYUsKskRaLzIQWwnLoYIxx5zvCT6VfE/OSJh5duhorqD8jJmFF5ZYIVRBrC3Okn8eEG0j18KjFAyIwmzuSRpHHp5klJ1j9TblSwPT+Z8oxrk5auQXeEAhGKzoQauChHG1PJUIBwH2x/j77B5HJGD+nr/pLfC3OXsmTeZ9U1gPV6SSr86mxqk0w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dOZg61gDcrcRilwcx5sHF1uI08UBH5oq3l8UsDibEi0=; b=Z2ZmnqPl14CYD0lXguCGkAigJL4L5QDjPVPTPB4Z46Yn049jr4jo9eOOG+B3dtMS1ZA9pUkFH7TdW9DRQIxRsAydS1oJxfOoRaJ90XfhdRKknRTfR3ehZkBApwsjsM4weIVv8WNMJQJqQp9I0E10Y9FpQJxFNRXqJ1RcXjd8uXhWn7QPkNeviMSCs1movD82L1xEbGOJZSR2Qcn/7dhjhsvSNdjk99no5hElPvyfz5VZ2wWmAldWAX9/tgyK/+pgUEapn2X2eUPO7G/cZKBulKnQSgFgB0aGvfLAPGhxBgt5Es4FVSYh8GLmlKdhpArDpgXQVQZ2PM/ilYTcoUkmlQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0333.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:27a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 14:18:14 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::73a:bd4b:26f3:cc2b]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::73a:bd4b:26f3:cc2b%3]) with mapi id 15.20.6178.015; Mon, 13 Mar 2023 14:18:14 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 13 Mar 2023 15:18:44 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [jOSUKyIEmo7UheBUv1+0z4Pp/xAzKUkBWnOCngKmphc=] X-ClientProxiedBy: ZR0P278CA0112.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:20::9) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20230313141844.801081-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0333:EE_ X-MS-Office365-Filtering-Correlation-Id: d5c4151a-14a6-49d4-4574-08db23cdc85c X-MS-Exchange-SLBlob-MailProps: AZnQBsB9XmqzsTrfB3bxuSktp+L/yXkivyjfYjKGbmyocYuPc4PIU9MrCAo5z4LbKu0BOqQ5OdoJ4U/mVOaj9P68ZdSQylRz1a3MmA9sV3NG+tlFnuDfxzHc+GILVIXBQL2pxPUjf8CBeAKAtrMUSmpwcxCcOyMqKx+Jlyj/yhCf04moMglX0XFDmxF4PRaE4dOhpGIT8/hADmuZsXdLa2Jlw/Pg0Nbv+tVPDb/9tPVWwuykmtqppBXO+1zofW0/4azPlSQ+gvZU2KgBuRM6VhgGuiIhZazRqqbdsZIa/K/W2J7bSjnhphRP+0DfTH/YnW1DTciyTR1u9lQKlBMTzPVRukq7mkUDlr32x3fLovBoV/ZDptmlk8fkKUXhmtObpuEm69Drfp1kobOoqlkXERJ8u1dMgfa8sRqoB0eD3kfgEjhhuj/qezJYmLLCG+A8MUJVuiGPVb4F8GGrAt3rSoPxDudYNGstndiGHeNz5jiW8cc/KwUWcrZ00rE1unCf3aNZgVD0xb2QjjndaO8GASGnHeWhg3DM7ElUH8BdQk1SChSUBJ6WN7zT0awCmgiBC4RHfjJzLS/0kumhV67aHKMCgngxgxck4lxQgG6c+3bOgGRv+sej2Srm4ZLATpj4jmlmN1omlrngHQB070OuVCyA3J9FbrlCWwtt+uoo2WexCdJvJbk8fns+7alRAFB5ZbSbJGYuunoJWDwhLVhHZ1B+uIwYqRwEcAzBFO3MDcQsJBSqIp8B0OBJXdRKRD2wzpM4Fe1IusI= X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-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wlFJvFjN4a/PEgiT9Fp72F0gLRQoXJwx8FgQKUioOPQajAkdtkUd3ViBKLY9udfzZKdgEoBOOULP41ydjmwWvq4V0Pr6XZTE9bb2jTlxiXy9tksWoW8PYMNLD13fHpC6/+swsAYf1102OL+Xt4ODH+aVIn/WCujZ4iHcCNdBGlmli+tIOoKrNmh9axUBIImfPF5PMeDIvsiNhNXjBCC15dtr554G7RwhRD4e3y1eyZtaGFMSsIvht3bEF9xqsXj7BbuM/eLEkkMySiDL47Lk9+EyZzaTKrnMAyShvEwlvOrd5YBltT4KLwghW91sPTd8uNEoNpvQcD7uaqfSwdM0SyUPsSdmOIb3eQoLAXNDKBvSxyQbhoEzlI32sJqetofY5zwj+aiTaey3uA7nX3WiTqCI1MNorPw2NbLrMXtkBiT5fmPZWVqr0+BZcFQ0wq+t5SaS2PzVd4slRscz+K9o6LQ4w1GLtHwEsXX66Jqh+spaXAx7nt9HJ9q3rd2Db9XBy770CrbHaYHtl//MPRbhBFr9qfhWP015rbRenRvPS0F+AmDUFzCvB5jFKNeTHciOHyIbFbdKWezdzCuEzVi//EJtX5fmupsEMvfLwQMvuJeAk4ooLGeL+LTeZeyQuwp2gCtugJaSBH+RXsDSOMEu5B+euoLQyl7TGy2dbPlBXO3ftBFPf2BdNMZc84xzj8CIMZWQqzTgyFlEyeK0xShP+1l4Q294LH0r5HT17PnQig0jxY4tG6Iom699J5t/W0BMA7iLMpjNXGQJC9b58Zu25WShIkgXp/jn0CnIzs/jXc8f8bi27vNPakNiRQbI+D3vQZ+4PY3E7aorEXDaBb+MHBV/XC++HOseF4uNkDZ1gqsyJvnilk+z9LvHybhALCFlbhsmIWa4lqng+mB4vaCJhEYLHsSxpx7EqD2zXiElkAu9o9lOq8jFYet5IGB+ksMXx5k16LZQI9BSPWs= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d5c4151a-14a6-49d4-4574-08db23cdc85c X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 14:18:14.2939 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2P250MB0333 Subject: [FFmpeg-devel] [PATCH] avcodec/h264dec: Remove dead function X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: F71wX4UGCPwN The H.264 decoder does not support draw_horiz_band (it does not have the AV_CODEC_CAP_DRAW_HORIZ_BAND), making ff_h264_draw_horiz_band() practically dead. Signed-off-by: Andreas Rheinhardt --- libavcodec/dxva2_h264.c | 7 +------ libavcodec/h264_slice.c | 2 -- libavcodec/h264dec.c | 35 ----------------------------------- libavcodec/h264dec.h | 2 -- libavcodec/vaapi_h264.c | 11 +---------- libavcodec/vdpau_h264.c | 2 -- 6 files changed, 2 insertions(+), 57 deletions(-) diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index 6300b1418d..26e18a71b0 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -499,20 +499,15 @@ static int dxva2_h264_decode_slice(AVCodecContext *avctx, static int dxva2_h264_end_frame(AVCodecContext *avctx) { H264Context *h = avctx->priv_data; - H264SliceContext *sl = &h->slice_ctx[0]; struct dxva2_picture_context *ctx_pic = h->cur_pic_ptr->hwaccel_picture_private; - int ret; if (ctx_pic->slice_count <= 0 || ctx_pic->bitstream_size <= 0) return -1; - ret = ff_dxva2_common_end_frame(avctx, h->cur_pic_ptr->f, + return ff_dxva2_common_end_frame(avctx, h->cur_pic_ptr->f, &ctx_pic->pp, sizeof(ctx_pic->pp), &ctx_pic->qm, sizeof(ctx_pic->qm), commit_bitstream_and_slice_buffer); - if (!ret) - ff_h264_draw_horiz_band(h, sl, 0, h->avctx->height); - return ret; } #if CONFIG_H264_DXVA2_HWACCEL diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c index 7767e16cf1..912f1ea9c7 100644 --- a/libavcodec/h264_slice.c +++ b/libavcodec/h264_slice.c @@ -2490,8 +2490,6 @@ static void decode_finish_row(const H264Context *h, H264SliceContext *sl) top = 0; } - ff_h264_draw_horiz_band(h, sl, top, height); - if (h->droppable || h->er.error_occurred) return; diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c index 2d691731c5..023716645f 100644 --- a/libavcodec/h264dec.c +++ b/libavcodec/h264dec.c @@ -96,41 +96,6 @@ static void h264_er_decode_mb(void *opaque, int ref, int mv_dir, int mv_type, ff_h264_hl_decode_mb(h, &h->slice_ctx[0]); } -void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, - int y, int height) -{ - AVCodecContext *avctx = h->avctx; - const AVFrame *src = h->cur_pic.f; - const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); - int vshift = desc->log2_chroma_h; - const int field_pic = h->picture_structure != PICT_FRAME; - if (field_pic) { - height <<= 1; - y <<= 1; - } - - height = FFMIN(height, avctx->height - y); - - if (field_pic && h->first_field && !(avctx->slice_flags & SLICE_FLAG_ALLOW_FIELD)) - return; - - if (avctx->draw_horiz_band) { - int offset[AV_NUM_DATA_POINTERS]; - int i; - - offset[0] = y * src->linesize[0]; - offset[1] = - offset[2] = (y >> vshift) * src->linesize[1]; - for (i = 3; i < AV_NUM_DATA_POINTERS; i++) - offset[i] = 0; - - emms_c(); - - avctx->draw_horiz_band(avctx, src, offset, - y, h->picture_structure, height); - } -} - void ff_h264_free_tables(H264Context *h) { int i; diff --git a/libavcodec/h264dec.h b/libavcodec/h264dec.h index 9a1ec1bace..28f62dbbba 100644 --- a/libavcodec/h264dec.h +++ b/libavcodec/h264dec.h @@ -787,8 +787,6 @@ void ff_h264_unref_picture(H264Context *h, H264Picture *pic); void ff_h264_slice_context_init(H264Context *h, H264SliceContext *sl); -void ff_h264_draw_horiz_band(const H264Context *h, H264SliceContext *sl, int y, int height); - /** * Submit a slice for decoding. * diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index 9332aa6f31..386adae346 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -311,17 +311,8 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx) { const H264Context *h = avctx->priv_data; VAAPIDecodePicture *pic = h->cur_pic_ptr->hwaccel_picture_private; - H264SliceContext *sl = &h->slice_ctx[0]; - int ret; - ret = ff_vaapi_decode_issue(avctx, pic); - if (ret < 0) - goto finish; - - ff_h264_draw_horiz_band(h, sl, 0, h->avctx->height); - -finish: - return ret; + return ff_vaapi_decode_issue(avctx, pic); } /** Decode the given H.264 slice with VA API. */ diff --git a/libavcodec/vdpau_h264.c b/libavcodec/vdpau_h264.c index 525e208495..d39dbdd042 100644 --- a/libavcodec/vdpau_h264.c +++ b/libavcodec/vdpau_h264.c @@ -201,7 +201,6 @@ static int vdpau_h264_decode_slice(AVCodecContext *avctx, static int vdpau_h264_end_frame(AVCodecContext *avctx) { H264Context *h = avctx->priv_data; - H264SliceContext *sl = &h->slice_ctx[0]; H264Picture *pic = h->cur_pic_ptr; struct vdpau_picture_context *pic_ctx = pic->hwaccel_picture_private; int val; @@ -210,7 +209,6 @@ static int vdpau_h264_end_frame(AVCodecContext *avctx) if (val < 0) return val; - ff_h264_draw_horiz_band(h, sl, 0, h->avctx->height); return 0; }