From patchwork Wed Dec 15 12:35:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 32522 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:cd86:0:0:0:0:0 with SMTP id d128csp8175506iog; Wed, 15 Dec 2021 04:36:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZINqxhMCjE56Sv3uhQU+SMfExFSgs3jBmmcfzVmcXtBXLBzr/R4wt9KkaCx3hqCdJe3rX X-Received: by 2002:aa7:d6d6:: with SMTP id x22mr1767264edr.132.1639571761242; Wed, 15 Dec 2021 04:36:01 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id he43si1247144ejc.410.2021.12.15.04.36.00; Wed, 15 Dec 2021 04:36:01 -0800 (PST) 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=VPggQeBz; 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 D657668B0C8; Wed, 15 Dec 2021 14:35:57 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-oln040092067045.outbound.protection.outlook.com [40.92.67.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 31CE568AD8B for ; Wed, 15 Dec 2021 14:35:51 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AuHgQ/FvjOOjFem64jVx1VlgSgqwpxEDgtji9aoNE9Oe5mj4a9DV5uQaaT/Rmcca1p/TjsJbnlT7L39GYbMHQ1kU9rI3Eoh9jQszxhmJE1GNmnkZONfQ+ApREpmKuSWKDCWGWpoZJasUWl+bqyazMunCLY9WLF7Ub0UVteOcCneLx3l54PobdmRXm7/t5ESOxrA7GXAmmSnvt7w1psip1ZgAzYtv7EThPRYYM8p/Q4XPXYBuwIKtQh05e+SVVwiXXlfw5Sp8i7VYg4ewSMBU4nICtlkgsR5FMSoJJZyyEjv/GGBexVnKnFV/NHoHkxWyEPLvt82m810kYSW7QEyZPQ== 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=ntn4tpvoPd0Ein5ax2uG/0k9+H3Tcnj3ZyCWpHx6yJU=; b=Mpau0VzqEqPwaVKb2+6dzNr7oABr39veKo//n1EGCZVjiEpPNNbE3Lu4V/YC2pDkarpkEvsJeZ5+y49GawShTnSZFgMwKaazZItzXCMgvKdGK6OgjFRWqb7ncntSenYjS/bJmo6S4ZH/ROEptxkQKyVzdS8dyAJKVuLD2FyzQxvaZi8hZjfWef91GOZrpl4TDRkKMgJFQ9GkO3aaLrpR3lkcnEFAfJCCeb5lM87jRIvVd3/SQuyMo+ZVI9n59dv44Yn3HmscfmLot5HgFovlWiPSJI9erotVVvwvpsvQxTQmsZtsmFLpYmMFz45wZBu/fseIcoo8/gJiuNkw/7fYkQ== 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=ntn4tpvoPd0Ein5ax2uG/0k9+H3Tcnj3ZyCWpHx6yJU=; b=VPggQeBzWGo6Fy0H0GcXVoNowo/zvW50smLEmM7ZDK+k5NNDoOTwH1PORHSsd1AjK5OXZtGnHEf61aLXSVXluiaPC0Ewd3/NeQxEFY2kZr904UETyjXCOeVpGYo7S4cUzlpTkh2otZa4FyzdNeY5FgadTAy2tzMoWEjRsyl6YmCpi2O7eUH+MXUuw/q7RhSBCCRv+WTNwvUfeq0XGctrtS+8lDOmv/GyQVdtucCrF+WzXXNMC9IWxL4kZ6HAfn19A96h37DwGyV6zIrsPoluHbKghZld80rxOM8kOT2HU7NXO3EspOchnNGzEy6LnLfohVixcIS5S/ONWY4vTmaTYQ== Received: from AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) by AM6PR03MB4952.eurprd03.prod.outlook.com (2603:10a6:20b:8a::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.17; Wed, 15 Dec 2021 12:35:49 +0000 Received: from AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca]) by AM7PR03MB6660.eurprd03.prod.outlook.com ([fe80::f0dc:92f5:6bc2:45ca%6]) with mapi id 15.20.4778.018; Wed, 15 Dec 2021 12:35:49 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 15 Dec 2021 13:35:32 +0100 Message-ID: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: X-TMN: [F1Pz3irbBJhulPUtcwFsEZtR3+c9nX1d] X-ClientProxiedBy: AM0PR08CA0014.eurprd08.prod.outlook.com (2603:10a6:208:d2::27) To AM7PR03MB6660.eurprd03.prod.outlook.com (2603:10a6:20b:1c1::22) X-Microsoft-Original-Message-ID: <20211215123541.5406-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4b968702-63f9-48d6-ccb2-08d9bfc76cd8 X-MS-Exchange-SLBlob-MailProps: gjx25WM8ZNWm3GLoeUntTG6KfWWWbWhlVpCLGNRSkIMVmqyDrsLszT+nibWhup8zrMZbRk6nZOcGGAnW08M4EM5OmEulSvJT+CwSUgv3RHbM9Rguw0zBqJsJMvmjGSCGeUKHFcMrLnYmO/S8pFne2BIbO0ze7rXlsHH7RTwTiX4urdQaszJQARzvflH9PB8DMZSRmB/HWB6uacrg4us3l2Q5y2o4eS/SF9MaHsNZmw+58NSY9+dNdfAYt6R8nAhcSmlp/kcJEHf6EJM4meZ9vXR6rRE8Gqo7t6gGi/SuxAcGrrhemqeUnJt5r+eAgdfdCVr6hAEbqadOInFtAZEBtLKRnxEA/JHIiYEPGOiB7FInLjQamBOubEdS/9ZRdfbW19mgQ56NHjcCL/AG0pfLVEkRI36gO9Z6bPPyFpTgxWMgua4sjlu0SOvTIuYvbSuTvMaCWElxUTwLMiDmY7ddyZpYZJSuH0poKQ4FAfDfahpSHYyHAsbZhxFOWAswa98JALhToylGmJg3lo/pgYEHrs8/A/eDMOGkSvVkLcxDH1y/GaOhSz1LqbBUhNqxHhWNtK6aW/UPjMKQewXwdiZdG+aNaYn/PnA0cjiffSYliuJLHLYMVXvG+fthxc9qDx+vZlVTRsDGUrO7m6iLc9AJjZoSFCBIghUrtFZfMcI3bOJszqImlXpAI7tLyv1Pz2jvLw1yLRmDq6EAQ5f8jYSjaVhpVSycAO6AA9+KOloyjfI= X-MS-TrafficTypeDiagnostic: AM6PR03MB4952:EE_ X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VY8aJWeQDq2SdzevdVCzNhuUvOw0S/iFmhydDYPVnZTWB4eh5dfxoOpR8HKo5t4jr9veAyz1q3Y7NKe0Lk4QjkgJ1R6X9Vxm5JH+erVWOmqaswU8MJGhIBGdy3sM0KMCRMZ6Xch/syEvznvPSyyC4W4iquZZeTT/+HOpONN7i96+hhT9DkLkpd/sJB0RV3xjAB72OtTPHl8II5VKUFAa1l+CcGtawR4VgJ3NnPkXk5Z0NDH2ZOttb5CtCWpHZV0Qm+Lus1ULApmugjst+chQLOeMtLDB0mlbD1Q9E5+5SE2Ns4Y7w1tWwam8Xz5OkRYHzUFevQM1ET8E5NJtmjnQUcS0iS3shzIN2HHnisRwE2Obr0gfMVhKoOrsh+h0nKHDuR9W6s/1p3bbHCMLUBLs7a5xR8lMTlvVMfZKBw2vlrZaVp0zCnaDz5uXMLR6AR5SK52HBEN+ULfHNhxyv1XtYEq3p7eGu/Pxa+t2FN+SiRS45XXt5ZSwP5JSx1fZH0cWT+hD7egNIyqOHZJhV7fdOnJTluCOUbKTgS/SLmF/Z59a604EqCSjgsw671Jguzh+ILRntry57Ve8zCkiA0rikA== X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Dnz8IZ65FuXfg334fUw4asSO1gk/xZvAEjX39DbwtIr2MVfJ2AP/vHsiSVDso3o5XcYdO5FxyS1EJ669w3gJCMNGIgarojSw5/SP8C1dVuEeaxGYwKtHoAOYW/tP6+vPlk5iGsZ9tHOMuGdMuYLFcmcmTW/M6UQRDXp0egSia5EOesAfJL2fJdAo+DdY+YTPyiPUZLuuIGQKtNDpup3/93+5k7de/aIOVvzoWTubwlQwq2cW3gMkSEF5k5FVvlhHrFWSgsacsrZJhR3Kl03+iCcy2dMIMSuCKXhbFZw702hZok8kBRWFmCDhgGsmFv0Z1t8qey50JKcg8y1prxwGkvGSq/xX8qY1eAb8xNueX0SrBLDvG6V5+ZHykvMQzhcp04rVNlDrsGoEWRaVpfWArXC8p/YdPxPJaoxFVPs0DJDY6+P3vw440X53g13BQH3d79gQhhx4W+C2UkqtPml0uf8reo5osyVTngstGmfMGQsOEMdKZmhuEBEgHyfmXanRr+Fumo1/GZ5jIZoiqMSxyHrHUmsriKGY7Ul6GJRJSAxzsan8MzpsWpOAjpppg7cryM+Jl0lvQjplax/GdIGx2COnacK1sN7wXpnPytWQ5tKsEjQrAi0DG2v3mVYlN0lMHF6pILaR7EH4oVW4QjiLOGVdyRIXqzvXGOkOz5WfLLSqQEjENU796Mz3KXrcWcCqbbjMOVBxog48tcg0PsaOakhDSyH2uAWKpyKoWXryMraNhQrRQFC4cEvJNJTBM9Vjf9Ngs3GbDe/TzMeGOeGXBamVf9ekWtdnQZuXELpae0CQz3t5Tj3WU/CAxY4mCtdz5sd6lHHU76kJZH8MPDO2lTCMM8iZuzuNukVCFaqXJ7DiMF62RtydGSKigLML1v4jn1crzfQmAbUFgXXdSp6vAJxD6NeN3OYVg4/F3HlbI42I8QbNkgaDaVS36PlspKv9xj4FX4SSAfRr67agLSqsgQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4b968702-63f9-48d6-ccb2-08d9bfc76cd8 X-MS-Exchange-CrossTenant-AuthSource: AM7PR03MB6660.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Dec 2021 12:35:49.7836 (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: AM6PR03MB4952 Subject: [FFmpeg-devel] [PATCH 02/11] avcodec/raw: Reduce number of avpriv symbols 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: SLcmGoUd4kUl libavcodec currently exports four avpriv symbols that deal with PixelFormatTags: avpriv_get_raw_pix_fmt_tags, avpriv_find_pix_fmt, avpriv_pix_fmt_bps_avi and avpriv_pix_fmt_bps_mov. The latter two are lists of PixelFormatTags, the former returns such a list and the second searches a list for a pixel format that matches a given fourcc; only one of the aforementioned three lists is ever searched. Yet for avpriv_pix_fmt_bps_avi, avpriv_pix_fmt_bps_mov and avpriv_find_pix_fmt the overhead of exporting these functions actually exceeds the size of said objects (at least for ELF; the following numbers are for x64 Ubuntu 20.10): The code size of avpriv_find_pix_fmt is small (GCC 10.2 37B, Clang 11 41B), yet exporting it adds a 20B string for the name alone to the exporting as well as to each importing library; there is more: Four bytes in the exporting libraries .gnu.hash; two bytes each for the exporting as well as each importing libraries .gnu.version; 24B in the exporting as well as each importing libraries .dynsym; 16B+24B for an entry in .plt as well as the accompanying relocation entry in .rela.plt for each importing library. The overhead for the lists is similar: The strings are 23B and the .plt+.rela.plt pair is replaced by 8B+24B for an entry in .got and a relocation entry in .rela.dyn. These lists have a size of 80 resp. 72 bytes. Yet for ff_raw_pix_fmt_tags, exporting it is advantageous compared to duplicating it into libavformat and potentially libavdevice. Therefore this commit replaces all library uses of the four symbols with a single function that is exported for shared builds. It has an enum parameter to choose the desired list besides the parameter for the fourcc. New lists can be supported with new enum values. Unfortunately, avpriv_get_raw_pix_fmt_tags could not be removed, as the fourcc2pixfmt tool uses the table of raw pix fmts. No other user of this function remains. Signed-off-by: Andreas Rheinhardt --- 1. It would make sense to deduplicate avpriv_pix_fmt_bps_(mov|avi) size-wise if it is preferred to keep the lists accessible to users. 2. One could handle the fourcc2pixfmt case in avpriv_pix_fmt_find(), too, if one added another parameter (say count). In this case avpriv_pix_fmt_find() will return the first pixfmt with the desired fourcc if count is zero, the second one is count is 1 etc. (and AV_PIX_FMT_NONE in case there is none any more). This would also make this function more future-proof. libavcodec/raw.c | 40 +++++++++++++++++++++++++++++++++++----- libavcodec/raw.h | 13 +++++++------ libavcodec/rawdec.c | 8 ++++---- libavcodec/utils.c | 11 ----------- libavdevice/dshow.c | 2 +- libavformat/avienc.c | 2 +- libavformat/demux.c | 2 +- libavformat/movenc.c | 2 +- 8 files changed, 50 insertions(+), 30 deletions(-) diff --git a/libavcodec/raw.c b/libavcodec/raw.c index 079d5c5d10..5efc1eb465 100644 --- a/libavcodec/raw.c +++ b/libavcodec/raw.c @@ -28,7 +28,7 @@ #include "raw.h" #include "libavutil/common.h" -const PixelFormatTag ff_raw_pix_fmt_tags[] = { +static const PixelFormatTag raw_pix_fmt_tags[] = { { AV_PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */ { AV_PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') }, { AV_PIX_FMT_YUV420P, MKTAG('y', 'v', '1', '2') }, @@ -299,12 +299,12 @@ const PixelFormatTag ff_raw_pix_fmt_tags[] = { const struct PixelFormatTag *avpriv_get_raw_pix_fmt_tags(void) { - return ff_raw_pix_fmt_tags; + return raw_pix_fmt_tags; } unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt) { - const PixelFormatTag *tags = ff_raw_pix_fmt_tags; + const PixelFormatTag *tags = raw_pix_fmt_tags; while (tags->pix_fmt >= 0) { if (tags->pix_fmt == fmt) return tags->fourcc; @@ -313,7 +313,7 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt) return 0; } -const PixelFormatTag avpriv_pix_fmt_bps_avi[] = { +static const PixelFormatTag pix_fmt_bps_avi[] = { { AV_PIX_FMT_PAL8, 1 }, { AV_PIX_FMT_PAL8, 2 }, { AV_PIX_FMT_PAL8, 4 }, @@ -326,7 +326,7 @@ const PixelFormatTag avpriv_pix_fmt_bps_avi[] = { { AV_PIX_FMT_NONE, 0 }, }; -const PixelFormatTag avpriv_pix_fmt_bps_mov[] = { +static const PixelFormatTag pix_fmt_bps_mov[] = { { AV_PIX_FMT_PAL8, 1 }, { AV_PIX_FMT_PAL8, 2 }, { AV_PIX_FMT_PAL8, 4 }, @@ -337,3 +337,33 @@ const PixelFormatTag avpriv_pix_fmt_bps_mov[] = { { AV_PIX_FMT_PAL8, 33 }, { AV_PIX_FMT_NONE, 0 }, }; + +static enum AVPixelFormat find_pix_fmt(const PixelFormatTag *tags, + unsigned int fourcc) +{ + while (tags->pix_fmt != AV_PIX_FMT_NONE) { + if (tags->fourcc == fourcc) + return tags->pix_fmt; + tags++; + } + return AV_PIX_FMT_NONE; +} + +enum AVPixelFormat avpriv_pix_fmt_find(enum PixelFormatTagLists list, + unsigned fourcc) +{ + const PixelFormatTag *tags; + + switch (list) { + case PIX_FMT_LIST_RAW: + tags = raw_pix_fmt_tags; + break; + case PIX_FMT_LIST_AVI: + tags = pix_fmt_bps_avi; + break; + case PIX_FMT_LIST_MOV: + tags = pix_fmt_bps_mov; + break; + } + return find_pix_fmt(tags, fourcc); +} diff --git a/libavcodec/raw.h b/libavcodec/raw.h index 6a041690b1..9a4ddef8fc 100644 --- a/libavcodec/raw.h +++ b/libavcodec/raw.h @@ -28,20 +28,21 @@ #define AVCODEC_RAW_H #include "libavutil/pixfmt.h" -#include "internal.h" typedef struct PixelFormatTag { enum AVPixelFormat pix_fmt; unsigned int fourcc; } PixelFormatTag; -extern const PixelFormatTag ff_raw_pix_fmt_tags[]; // exposed through avpriv_get_raw_pix_fmt_tags() - const struct PixelFormatTag *avpriv_get_raw_pix_fmt_tags(void); -enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc); +enum PixelFormatTagLists { + PIX_FMT_LIST_RAW, + PIX_FMT_LIST_AVI, + PIX_FMT_LIST_MOV, +}; -extern av_export_avcodec const PixelFormatTag avpriv_pix_fmt_bps_avi[]; -extern av_export_avcodec const PixelFormatTag avpriv_pix_fmt_bps_mov[]; +enum AVPixelFormat avpriv_pix_fmt_find(enum PixelFormatTagLists list, + unsigned fourcc); #endif /* AVCODEC_RAW_H */ diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index b22e36e984..9724cce13f 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -76,15 +76,15 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) if ( avctx->codec_tag == MKTAG('r','a','w',' ') || avctx->codec_tag == MKTAG('N','O','1','6')) - avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_mov, + avctx->pix_fmt = avpriv_pix_fmt_find(PIX_FMT_LIST_MOV, avctx->bits_per_coded_sample); else if (avctx->codec_tag == MKTAG('W', 'R', 'A', 'W')) - avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi, + avctx->pix_fmt = avpriv_pix_fmt_find(PIX_FMT_LIST_AVI, avctx->bits_per_coded_sample); else if (avctx->codec_tag && (avctx->codec_tag & 0xFFFFFF) != MKTAG('B','I','T', 0)) - avctx->pix_fmt = avpriv_find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag); + avctx->pix_fmt = avpriv_pix_fmt_find(PIX_FMT_LIST_RAW, avctx->codec_tag); else if (avctx->pix_fmt == AV_PIX_FMT_NONE && avctx->bits_per_coded_sample) - avctx->pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi, + avctx->pix_fmt = avpriv_pix_fmt_find(PIX_FMT_LIST_AVI, avctx->bits_per_coded_sample); desc = av_pix_fmt_desc_get(avctx->pix_fmt); diff --git a/libavcodec/utils.c b/libavcodec/utils.c index a91a54b0dc..4d236ff1cd 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -436,17 +436,6 @@ void ff_color_frame(AVFrame *frame, const int c[4]) } } -enum AVPixelFormat avpriv_find_pix_fmt(const PixelFormatTag *tags, - unsigned int fourcc) -{ - while (tags->pix_fmt >= 0) { - if (tags->fourcc == fourcc) - return tags->pix_fmt; - tags++; - } - return AV_PIX_FMT_NONE; -} - int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec){ return !!(codec->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM); } diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index ef78781865..ec1501ef8e 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -51,7 +51,7 @@ static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount) return AV_PIX_FMT_0RGB32; } } - return avpriv_find_pix_fmt(avpriv_get_raw_pix_fmt_tags(), biCompression); // all others + return avpriv_pix_fmt_find(PIX_FMT_LIST_RAW, biCompression); // all others } static int diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 3fbde0be1e..be2493ce55 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -448,7 +448,7 @@ static int avi_write_header(AVFormatContext *s) par->bits_per_coded_sample = 16; avist->pal_offset = avio_tell(pb) + 40; ff_put_bmp_header(pb, par, 0, 0, avi->flipped_raw_rgb); - pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_avi, + pix_fmt = avpriv_pix_fmt_find(PIX_FMT_LIST_AVI, par->bits_per_coded_sample); if ( !par->codec_tag && par->codec_id == AV_CODEC_ID_RAWVIDEO diff --git a/libavformat/demux.c b/libavformat/demux.c index 745dc8687c..360abd6014 100644 --- a/libavformat/demux.c +++ b/libavformat/demux.c @@ -2795,7 +2795,7 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) { if (avctx->codec_id == AV_CODEC_ID_RAWVIDEO && !avctx->codec_tag && !avctx->bits_per_coded_sample) { uint32_t tag= avcodec_pix_fmt_to_codec_tag(avctx->pix_fmt); - if (avpriv_find_pix_fmt(avpriv_get_raw_pix_fmt_tags(), tag) == avctx->pix_fmt) + if (avpriv_pix_fmt_find(PIX_FMT_LIST_RAW, tag) == avctx->pix_fmt) avctx->codec_tag= tag; } diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 0f912dd012..7216331fa1 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -1636,7 +1636,7 @@ static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track) } } - pix_fmt = avpriv_find_pix_fmt(avpriv_pix_fmt_bps_mov, + pix_fmt = avpriv_pix_fmt_find(PIX_FMT_LIST_MOV, track->par->bits_per_coded_sample); if (tag == MKTAG('r','a','w',' ') && track->par->format != pix_fmt &&