From patchwork Mon Oct 24 02:21:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38935 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp1980941pzb; Sun, 23 Oct 2022 19:21:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Y1HzWo0gBoPJqLkfL/Lbo5PTFPASFose/M91o4aSnbHUeP1ZxUl06ZkuHia1znX6LIbM3 X-Received: by 2002:a17:907:3e85:b0:73d:60cc:5d06 with SMTP id hs5-20020a1709073e8500b0073d60cc5d06mr26296164ejc.722.1666578105561; Sun, 23 Oct 2022 19:21:45 -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 h5-20020a0564020e0500b00460b26c8286si9947940edh.523.2022.10.23.19.21.44; Sun, 23 Oct 2022 19:21:45 -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="l/AQCnMP"; 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 853DB68BC6C; Mon, 24 Oct 2022 05:21:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-oln040092074084.outbound.protection.outlook.com [40.92.74.84]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C2F3668BC94 for ; Mon, 24 Oct 2022 05:21:34 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eGA5zGo5OWpGuvKOzAbp8+LrmfMBCzUIp+bq8hWKAb5VZjdLPcHcIca8LzNaYUO0bW5jFa+6rbtcBvGIYOQsXIi92KEcJ/kJl4xXweDEioAhogYwGKmTyHD9NMG7NmP0wNylMraOQKJMc08mLyTt0G+Vk+qhA/yOqIdZzIqqDC29BkEYYLKXvgYuJcIGzmxW99kES87RYGixyMpUte+jjcLpy3S8Hl+Qb9caw644XaXdUN+voeVh/M7SqSwaGwDnCUlbc2ZYFrlbU0P15zE1E/5ZmYwW3gmS/riAejldyM2RNfIaq7A7AeDW7MqrPbpNWeCR+POaLdr3+dZrOfmWZQ== 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=hkR4YnwfckJhuZGI5mHJ0LcsG5wgmR2KZ7c8aNG5mLY=; b=IFdZtqLrx6w+cJdGQo3HOlyoUhp2D8lYR/BQrzKbbjjqB4rYtOi/IVCayw9hsbZCEVIjs5RZMfnfYZvKdS1C9VFEw+tsgnoyN58Ic4TC1Dxf4yrVsLpSE2BAB/XQ7EJbSidCMMjY7hsgfzDah7/j5L9/7gdFgpdFoh3B/XAujCIBR/IulrdU0bWZaq2jKWOoz0IoQko53Ocroz/Os0oCmurH3TBb3R5NuJ8uOPX+r34gvZFGH+MrxO8rPZiGo/gyvNcUkgc2nMLBbot9MC1Dq6i9rZYSpSgMm9S29aPN78mY6xi/udrA5FXE6EO1uWOwEXK0DSydYN12SHLW/THn1Q== 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=hkR4YnwfckJhuZGI5mHJ0LcsG5wgmR2KZ7c8aNG5mLY=; b=l/AQCnMPrxcs7GJZxkuRkw3xQYL/4WL6oXi1YEMFsEtOoEPM+FQvVdQ1E0KeCXhyHddNhzlKMX/ve3jzW+PeSpNrn/GZgW3LWWp96BIrESErN4iVWOh9rvcelcEUiUC0TYCs9ZA6LEERXdE4ruEkfqvqRDuEPrmqCxX271NX1ST6jKrCWt8mvofc+/kVvf9gjjaMePDmMxYKrwutlzEEBLMSml5G5Phtq+moXTBqBA44QfgD29Z/w+mxEui6Y1THxJubLCpcrMc3+5yf5JogIyOab8TQVKPDLoqR7X2PS5smab1w9eXFJm2toWFQjysZ5hYW1kf9nnHjO7LwTWxqIQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PR3P250MB0081.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:170::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5746.21; Mon, 24 Oct 2022 02:21:32 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::f9d7:680f:70c4:44fe%7]) with mapi id 15.20.5709.015; Mon, 24 Oct 2022 02:21:32 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Mon, 24 Oct 2022 04:21:36 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [i/oOXrQCJVOXCjhAEkxe1PQ0GZ1kvjwcUGJmOs7tscI=] X-ClientProxiedBy: FR0P281CA0077.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::16) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221024022137.1454362-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PR3P250MB0081:EE_ X-MS-Office365-Filtering-Correlation-Id: f2d686aa-3b60-4d43-ff1e-08dab566779b X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3mR3rcIqcGvj4Fme6n/uYkqevx2kB82dHn2+zE/oYy8zXs/E0XeZgSiDs0LV2uQmNxQsIMJ8YB2IgNM4dTsAaJOyoT7Vgn79tYzcqBEB8Haqwvdq9hCaIgjQ0ohN/SkFXUqSquDh3gPPQ724oGmefxzzGv9/LwTBX6CkviYhyqwkTjFN6PKRgPqSwkqreeQ8k3jyHymEdjTCKkXeeRE/QgMUznj8662xo0s+d0Zt8J7bONVYcQ4W5MBb+kSN3iB8YG+k9r8MIZwzmfFRuGsV75eMSJ8PFuZrQB2NImNqtMOD5UeIobV4JI0UhvFQdZToy2keFtdvxY7dqLXEYTFc5wN+r7Y2k8FSvGZKYhYLad7yJXkwvv+MoclTvbYbREJs+VU1eUBC5SJ7S8ycGr+2XedC6Vu0B/Hzw8DnqKq2Syl8K6jOd9LaAmaEfFb795Z5rmCAxEj35ZRSOOpra4XJGZgc323v4UqXf/HKB/4aKXisJJ6QuEFnWF49cmZYneXN2DKKBlyncM/bTPHfTZSOrEx2OGcMegujTupyWyzThYv/IBdXoQlElOP8+hFbfAIif6caggHA3/eZ+8tvagY/7yA7Dg9MFcPI+WDG3wHvlMz9cMBgvn3JmzAZgVlyTC7fkqdwVLBL+O5dy1knNY8tr4cgQAvvqiArWjr7mKYBgN/gi6oJ+wxY1W6R+RC6LXJbKjHCIiJQcRcY7DFr1iTFkeeMdE+JfqEgOcYkXydR2aVhoHpaxYQr7LbuEbVVo7Xu4aw7k58J8ObQooRyyU0KmRD X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FnWYmD6l+evZkmW3IZbJdILZKPrmyQ2Q3BlWn7kr2wIBAovxPdYePM1/rVnaXNhyJuH7nLWvIhbT6e4XfZxz4EpqlcOHLt3VGzrGun3ALXmFZijLgBVENajlcm0rInGyQryVBlbEVyDuN5KA8PzjwJjiNfErWEj17+lSTp8mA99KidE/uLG9clfaNbVki68bgl3PYLHF/CKVkM6KIRWtGvuX+LABD1Su9D5dDAbIJ4PXBcQ4X/tcW/G0hTS0Ox3WlX4PoDK4kfqU5/XODskp4YlF4JySx4MLmB98pqihYjGL9jTLGOZr6Oq4BFbLXHxyBGhcHRZYQD5qGkakvQu735RWYbTHwEb9rzGWldOxh5+ddM7+Dd3eXuZ/Ea3Y9/SzZ0zx9yo9fYMAuW9pLgCFbzs0pvCeElcE8Rsyym594v/n/BRNhNH5IWWEtblbzLlNWXaYWyaXttXldqNY2uTVpETRTXcoVU4FuKa2hchI65V6oKIHf0El2jiUfbzZFey6YAIVpkNva+wO22Mp0qJjcxMiZ+i50oEzvyAo2WhfsCnOpmjgtM6eMWQPITZQykkRqSuk1asBqCCZj9OrrlwzQPdrdrW2KWH52gO2zVspKsYeSXmr+x7dbsaXqhF7gzkgkH1leomtztITYRMHygnlazuFa4SfKjgddAO4tc5/PDZGlMR11GxQchK83lxyhPk5 X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: nkqxpCHN+3wacK1O24TuD4YR4DqSF4cSWvaNUdZDWRNh5RUmR7Ux4iHfujwo9pST5wWkajfOgozFEZjw3Fx4AF84NZ+EKZP8+2a8FIEJCSIPNQLQ2Dxs8poMDXiVYuWFZynVuuyZwtvJLoFY8g0BSDiUYLiM1RAmjQsTduhhsscRKXZH7HTTMo7nkND1ID9ZeTpUaZuqLEn9VHrkfBivP2j6f+HesT6m+IjF+wut1QK/R5RCX2z8afL/kvpf3Ysmo5IKyp3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vI X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2d686aa-3b60-4d43-ff1e-08dab566779b X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2022 02:21:32.6537 (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: PR3P250MB0081 Subject: [FFmpeg-devel] [PATCH 1/2] avcodec/mpegvideo: Don't initialize H264Chroma ctx unnecessarily 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: 3JXMouszzXr/ It is only used by the decoders' lowres code, so only initialize it for decoders. Signed-off-by: Andreas Rheinhardt --- configure | 4 ++-- libavcodec/mpegvideo.c | 1 - libavcodec/mpegvideo_dec.c | 3 +++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/configure b/configure index eefd103414..dd207769a2 100755 --- a/configure +++ b/configure @@ -2754,8 +2754,8 @@ me_cmp_select="idctdsp" mpeg_er_select="error_resilience" mpegaudio_select="mpegaudiodsp mpegaudioheader" mpegaudiodsp_select="dct" -mpegvideo_select="blockdsp h264chroma hpeldsp idctdsp videodsp" -mpegvideodec_select="mpegvideo mpeg_er" +mpegvideo_select="blockdsp hpeldsp idctdsp videodsp" +mpegvideodec_select="h264chroma mpegvideo mpeg_er" mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp qpeldsp" msmpeg4dec_select="h263_decoder" msmpeg4enc_select="h263_encoder" diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index c436dc8001..697438fa6f 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -275,7 +275,6 @@ static void gray8(uint8_t *dst, const uint8_t *src, ptrdiff_t linesize, int h) static av_cold int dct_init(MpegEncContext *s) { ff_blockdsp_init(&s->bdsp); - ff_h264chroma_init(&s->h264chroma, 8); //for lowres ff_hpeldsp_init(&s->hdsp, s->avctx->flags); ff_videodsp_init(&s->vdsp, s->avctx->bits_per_raw_sample); diff --git a/libavcodec/mpegvideo_dec.c b/libavcodec/mpegvideo_dec.c index c2d6d8bdd7..12c7144ffb 100644 --- a/libavcodec/mpegvideo_dec.c +++ b/libavcodec/mpegvideo_dec.c @@ -51,6 +51,8 @@ void ff_mpv_decode_init(MpegEncContext *s, AVCodecContext *avctx) /* convert fourcc to upper case */ s->codec_tag = ff_toupper4(avctx->codec_tag); + + ff_h264chroma_init(&s->h264chroma, 8); //for lowres } int ff_mpeg_update_thread_context(AVCodecContext *dst, @@ -83,6 +85,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, memset(s, 0, sizeof(*s)); s->avctx = dst; s->private_ctx = private_ctx; + memcpy(&s->h264chroma, &s1->h264chroma, sizeof(s->h264chroma)); return err; } }