From patchwork Tue Dec 13 02:42:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Reid X-Patchwork-Id: 39690 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp791775pzb; Mon, 12 Dec 2022 18:43:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf4dzkuA42kJ6GHEzSNgU9xDv+fgXC5ESsKsL8Re7CsVl3P0L7/k7APTvL7tVfN1phsweJip X-Received: by 2002:a17:907:d082:b0:78d:f455:c397 with SMTP id vc2-20020a170907d08200b0078df455c397mr16235522ejc.61.1670899382040; Mon, 12 Dec 2022 18:43:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670899382; cv=none; d=google.com; s=arc-20160816; b=x6fx6nWjehusrtW72wN0nWcVHOvOkV0T7COZUkym2gCOkEJmyWRZcxhBGD/XUSmMpv /pri5ZoFhOv7yrvHq8yFiOMWl/KUf7RTeSXKiwhjN7fQ3l7/PjVXqGRTanEI4e/+PtXs SCtgGhYv3JkdaOvsdwjZ/d+rIx7GVlvGEL1uFZXMZh7v8KuYaCNm1Fx13p7lL6ZUlf8Q SAyG1XRk1NsgRGj0mh/7SKP2GXL+gds4Kuv4tSMJry1Ww4gCs8XVoCwlGHXcXTTmEVWm 7CWxwNBIT9/EDeG9dgQ0wTblBb489page9ya/EhZcOdAU+q5yGRMWV0fYN18I71owH6k ifHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=sore+bGC+t4t519RbE+M0IF+QUUuvlCct24p+eT55E8=; b=jxX52A8XraFaH+oHkzDKE7/qcR+Apx2I/U5Ocwh+Jyb/pITZscy8a8AxscRYBhTLQh OMldd9/UYqV/bMIJJyJkDyQ0/4OM70D48IAHJW46n4ufJTkDag57Kp93ku+vw/iufX8T i0UQt+nE6Pon3SM4VTETFdmovDIsEeTXvkHRGrz4TnpTlfhtdSPC3XZL+YZqdYIHPsKE F/pQlWl1m/xS+bEmNBXkrk1VNHILdVvkMjVrWJuQ66XlHWjXxEkD51AZIwC4500xu6ZK 2tGjeHs2VCxlCeYeEAF+PzCR2IiI5DoFzXBbUIa+bgDx7odIJTbm/8Pk/2zfhTHiCC91 hXeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=hK2OmeQZ; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dt11-20020a170907728b00b007c098bddb61si7444228ejc.448.2022.12.12.18.43.01; Mon, 12 Dec 2022 18:43:02 -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=@gmail.com header.s=20210112 header.b=hK2OmeQZ; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D349568BE0C; Tue, 13 Dec 2022 04:42:41 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DCFB968B14E for ; Tue, 13 Dec 2022 04:42:33 +0200 (EET) Received: by mail-pl1-f181.google.com with SMTP id 4so8172864plj.3 for ; Mon, 12 Dec 2022 18:42:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ah5jnSQd0uwlQM476wKU9MSV1W213y5QXsaQdVLTuX0=; b=hK2OmeQZQx38gJ3DIw0B+WK9AuQdpSL8Tdz6PMqwQQQ1EiPX9W6dduIR9mnocVoO4P JP7t1tF0Eg1Fw9VL9pApGT5VUSvqyR39Iy3jYorhRHKSDkScWPppiVeQkjxBZ2pDCWA/ bfPkOzLTI1a1qnFP1LqXAqjlfZG3BatTfkK62urOiMaPq1NZUMBeoPIQukTqjy4FLfO7 CBXJW5VeqgQdTTpX5aAjUrgEXTWDQ2gxEQ7c2hXrliEaQn11oY7PNtB2WOPsByIMla8x KESVC4gN/ZVfA6MbSgRSlLkvBWqalKREZJ+yZxOeic/QsMKL852rOs8n9cBBpZ6sL1w2 bfoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ah5jnSQd0uwlQM476wKU9MSV1W213y5QXsaQdVLTuX0=; b=fmg/4MQRAkuiKhHPF092IJMjxZOA7l6+kW952tWAjCsC1y976MW1pZCo7m/VJkqzzl Zx85zPS0wS7iJMHX78BtQDhRVLVC+4QKKyJwTz5GNyzR9qn5gPxBZegigGqB/pYbKRNR 38Y1wvAbJ7M6zAjUOBEfLVM5ucCZD9uvEReEdWG3pH+1HaONr+94uXGdXdMGAroCVPAG mE4lKxew3q6UKQgaP6IueIJma+lN7GDS0nq9PRrpF+zc96KBev+abSbSq14QJPXj/Ons 3V0d6c0fNcMESFeRbzF5xc/ALJJ4/DPfq92kcbhzJ1NVix+9mf0aQNXR0rTxj5n6VOC2 dn1Q== X-Gm-Message-State: ANoB5pmrEVr8l26CkBBFGRJJEBVuBulP+O0XEhcMQHX2iLXk5pPR5sSe PDrhFTxT7OiUcThOREADQTNe0m7Baos= X-Received: by 2002:a17:902:9b93:b0:189:8c38:cb96 with SMTP id y19-20020a1709029b9300b001898c38cb96mr17725048plp.20.1670899351713; Mon, 12 Dec 2022 18:42:31 -0800 (PST) Received: from localhost.localdomain (S0106bc4dfba470f3.vc.shawcable.net. [174.7.244.175]) by smtp.gmail.com with ESMTPSA id ju2-20020a170903428200b00186ae20e8dcsm7060105plb.271.2022.12.12.18.42.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Dec 2022 18:42:31 -0800 (PST) From: mindmark@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 12 Dec 2022 18:42:15 -0800 Message-Id: <20221213024216.259-3-mindmark@gmail.com> X-Mailer: git-send-email 2.31.1.windows.1 In-Reply-To: <20221213024216.259-1-mindmark@gmail.com> References: <20221213024216.259-1-mindmark@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3 3/4] avcodec/bswapdsp: add documentation 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: Mark Reid Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: JcO4vFEeJx/8 From: Mark Reid --- libavcodec/bswapdsp.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/libavcodec/bswapdsp.h b/libavcodec/bswapdsp.h index 10519cfd2e..ecc37d2c56 100644 --- a/libavcodec/bswapdsp.h +++ b/libavcodec/bswapdsp.h @@ -21,11 +21,44 @@ #include +/** + * @file + * Optimized buffer byte swapping routines. + */ + typedef struct BswapDSPContext { + /** + * Byte swap 32 bit elements in a buffer. + + * @param dst Destination buffer. + * @param src Source buffer, may be the same as dst. + * @param len The number of elements in the buffer. + * + */ + /** @{ */ void (*bswap32_buf)(uint32_t *dst, const uint32_t *src, int len); + /** @} */ + + /** + * Byte swap 16 bit elements in a buffer. + * + * @param dst Destination buffer. + * @param src Source buffer, may be the same as dst. + * @param len The number of elements in the buffer. + * + */ + /** @{ */ void (*bswap16_buf)(uint16_t *dst, const uint16_t *src, int len); + /** @} */ } BswapDSPContext; + +/** + * Initialize BswapDSPContext function pointers. + * + * @param c pointer to BswapDSPContext + * + */ void ff_bswapdsp_init(BswapDSPContext *c); void ff_bswapdsp_init_riscv(BswapDSPContext *c); void ff_bswapdsp_init_x86(BswapDSPContext *c);