From patchwork Tue Oct 11 13:18:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 38692 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp861144pzb; Tue, 11 Oct 2022 06:18:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4qJHfN339q2exyVUEupy4ZBON2cLmGhAQjg2NWWK1X/L0t2uEvVTHXHOwCopM6rHZuyEoH X-Received: by 2002:a17:907:80b:b0:77a:86a1:db52 with SMTP id wv11-20020a170907080b00b0077a86a1db52mr19534347ejb.294.1665494336965; Tue, 11 Oct 2022 06:18:56 -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 sh37-20020a1709076ea500b0073dd47c3873si1735001ejc.878.2022.10.11.06.18.56; Tue, 11 Oct 2022 06:18:56 -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=H7OS2GfZ; 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 634CF68BCF2; Tue, 11 Oct 2022 16:18:54 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05olkn2039.outbound.protection.outlook.com [40.92.91.39]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 46CA468BC50 for ; Tue, 11 Oct 2022 16:18:47 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nNwvtC1vsyoeUpvKKnDoO4h3ZXqxzrUag61vVX60jTEqM6CfEnnH2gLSaAoSK3YHUBcjWQG9SUGnMedVNE1xcp/e9gHF1OaXbnkQm8x+EnWN2M44ixh19erqZuVhfwMIlX8ZiTC2x+eU1EeclMWwAmUOqv4ez6SyNCB8El/USm9WS8+uMEQyPlVB1I3jyFEuj2EuI58BcvjTz8OXR06TDpBDIHyc/Wh+NbXxroL2j63dGIfrcntiAjAyPq0jh3BwXFluBWDwyzQeN5qGJ+fFig3VKRju/ndUA6rYWu5SA3lSK/bYvWJ1cuV9+SYQwR6Q4d4Wd1L8ZNfGULfPAvVj9Q== 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=ggEVTij10VH0DMBpJxNJ/57rJ0kiEtWDA3qvQf0roUU=; b=ntcaIyIrzkTEkQJ+In/EuZOPPa0hRDx5ftCQF4/xSritKTHtiso97OefncLD+DLKqdsoXfEq/hwgUZVD3UZpXon3JFu8Zp1vhIW6LctDnHC44k6FF9R6dXKntnyB+23sMx83Iq8QWVfMuWscQ55TtrnyosvyK/nEfqWn+6AY10HiJ901taV/9LEGL5Ig6J0WAZeKlHXKIWbINpG1CFFzCkvph8zJ2QtRIcOOA5BH3wi3/9/xgvfm/nJg1D4wIBUIHpUKbpOWPWxqU89Oh4PunsYZRXxZGzsp3UAcNDmOqFFp7D+5rTs+NJATJ6P+aXsFFdzTxlR+VxxnaM3jyzfYBw== 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=ggEVTij10VH0DMBpJxNJ/57rJ0kiEtWDA3qvQf0roUU=; b=H7OS2GfZYlYM6z5n2uXbawvaOm2MR1NSH3PDmX24tcvGrinkyoQaRpd1qK+oe3l/u+aYmwZ/zLZUEbhLkv+tt5DL+G2pE/UPXaY1qcsvDdsFewXn2VYnpF6Sm9M93/7LsrD6MhGMO0A6S1XSrLsAjrYGn5OUKu7UjaSrRalRY/8eWnSudgsYmcCA1fFZhCBuhp5StZHXF0oCIt4RWShphHElICfDNc5if34UorpMmgncwd5bKC0UDGulyTOUZ8yyCXyg0OxLtR52P9su0dv/CQWLC4NMVSuIua3CJj8u/+HEuIshK4aB3iQ+qw2VkK/FgLGUMX9aV3/eXpDctc5oNw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by PR3P250MB0340.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:17f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5709.15; Tue, 11 Oct 2022 13:18:45 +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; Tue, 11 Oct 2022 13:18:45 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 11 Oct 2022 15:18:46 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [CNMMgOA6aEiJNi8ZeNobGjybr6Eh+J0EFVwiHVBD1dM=] X-ClientProxiedBy: FR3P281CA0048.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:4a::20) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20221011131848.798459-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|PR3P250MB0340:EE_ X-MS-Office365-Filtering-Correlation-Id: 5b1965f6-8cef-43b3-3249-08daab8b202a X-MS-Exchange-SLBlob-MailProps: ZILSnhm0P3kF9Z1W9BPVdBUiZmKrnp+J8CaVNoelKeQz9b1lBDJICYkU62c8rOKm6W2afhawxyU0QxBR2N26eWsUXnl+NWZ8/mdIybfXt9oeovxaKjyvuVsF7A9+lq02Sf0/byuKdgul0MbcV0FbHFnBodhzXMoDdDrP6zcJOx0qtXFh0i8Q+qH8UU0ZqQhXmc2FHfh8YpU2FcNxPuQzsw71VskjM+tfuQCFQXHNW12rvG3R0PbtExFLLOcLFMcOj/yCTutpwf6S52cbUDvzjOpynr58+K265s101nkyxCIGUftZYaQmGY5VVnqi1wUY3YFThZkO6bjs76HhzGOb+6v8DUpnAFOL2+Ycay1xP+OkNOHwtOuRF9P0oRoSxfcCW17oXBpG+ZCLW1PdwhfRciKUIxxujxAYBZGMQZAdzgcenAWFvc9Qr1hSwHogKZ1TJ1VVvoPKNnx2YddTLj9A2aevMEATIvnpABPqaB9n0y1v4zUYbU/jzBCcCgQjonkML/jQDEKrjjthh5fKu8oAgOEaT9EBIy8TcwSJqgSI+WsYTSrHqXw7qJxRYLcstc848831mnUA+fNRzM7wAceVgOE3mjM/meKTzjXqqRHrk6UvcEQhPbwRkCTL0uNaUv77pZEi4NjzwU+Iv29b7ffWd4HSuyMYvIVW7RpU9k5lCBbLZjNR8jaki5ARyK/0KwJZtHpzrE5nvxX2CFYRyp43y08sgb1BDJrl4VxMPgiCE8jtI8hUnsi55FOsUv3vPCCI7WuxWpyjvmMmZ4tFRqzj+yQMLejSjpRR X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NRwGmLTUj46o+Vr3jrFEsSBvG9MQGOWHLNLrIIWXzWI7xW6/DcFW4pyzj4U1VSMKeYrKzos5YEMJe70YzFOMW9DhFdRfzbXru7QRJo74TVfmEnVAzcgz2N4fyjomgQ+vtJjuu+t9fSazXGwHXkex3u9t8AohQqXWofApYT/+dK+0vmE7Mz9VsbyiuCAGKUrU6JVaVBFpB74Eh8fPv+a/wkVUXFYbLcJe8oeQNEgM2xQUhev6nKTPHtsAlPoT7YV29cFI8b7+tjrjxnLm96fBFFnHJVRuI5eRqawx5hmfiNi+/5ablA30kBpWclJUMHVgw5J9b6+MioziAmXMtZzLMAR16Uxjj/37C/wS7IskByriGwkSzrGQ17XwyL7lqwFLBobyUZiZ2AaRBcB4lxtegUqhzpr/wwZXLVC0rplEVwYI1ipKRNpVEM4YZRxBlZFwth5tmYR+DdqzcayX/InDZWu3pVNl9LSFZKmYiR1cusxtCVM7gU7FDmX+rCAV7RMcs2nKfF96mCFqt5bPYt+Oek1YygMPoV5+4+6fI+3dAXFv0RKoRYM53p2qGNIk/nPD0Kkc5+fmf8mhW7MqqxyoaLRdmaY3rk/302UDKLUL+RyXUk/c2ECWq/fcOocWyx3l3uO90DXrD1CKDY8iHc5FanRRbnA/9pUk/aP9GE+EEzS/t/spbdBsK1zvli7nc2wZ X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kQby2YbHBfqyxggGHuuWRe7cX3ZZWEGW5nq/31GLUzyYrjUpis91DY92q9Rdf0zZ8xOZyvDCyw+WqRDR9q5jJuNWICMfxaPz1wSVhPmmKoCpWicrqqUQWd08ggjXPWNBH9gOZYOa6H+xMCrWOKG3SjTCnfmswtFDx0Rn03OGotZO6FqvWECvfdxeKbqJiXpETzULOGvpbqYAkcRkM3KmSRAf0FzuWXCQxnucgsF1z4hoxl3V3FBsJjCSXMMa7vcIUkZjuKR3D0s3Vu3/lbO2LwXcSTXxgoOcqTXo2cdBJv5RFHJpA5zRVQyjEvTyXqtqZqv5Gg8gF6bV93LAcq+XJamPOtGDDYOdsjVw/erBwNTN5X3223tNzLYoAbzPREi1GrQgDZJQln2ArIuZ61Tdd39qABtNM8yubjU13QTZ29JPGbEYyRQV1pNQadPzVCjFb7KSS0IxgldR/RzmQ/g7//lsmzONzRGyR8SccItLY6ivZvSz/kWaG9tIQVjrlc0Q9J7r6x6OkcrqtcwDn0CDG28yGPAYkEOLtk1xBoHdLU41HPyP04TkkuqM7BhJv5R9gKmmDA4/IJUkx89nFhPahOnbtY5mBf4u9Xv5OY5FvtNUh6dzmXh3jmKBT0F52dvQN1DwoWJuMB/wuhDygzHzYAVK0xfbso55+/naPannYGBzAX8YYDmBvARRyAPp4KbrSFUr+MteVcRIISpcD/Cnhc9NZVlb/jCXKOAwyk4UrAH+/4/iAKYy5bJyYfKlDL5/BlohY4k5Pjb/NfAMMIhIqY2b3Ugar3dua8LPqvp9rVTAVOrUTJe6AhAmsaaiT85Yymwy2d8lkwbFQUu3Hqq5ko6odk2Mahnw6e47Arln9QNGNr+HP9jFhNJ9K3w5qqlCSQngCR28RgKgnBZi443kLHjQugyVn+VR/MjSn6dTrow89TKnptya96oF7IiJfVsD1dAfRhU2fFzPBGl6y0zS2k0G1eT5Lo/xEUzrfOH1oRpUCjbV+CMLG8NHXQqkf3GyR4Z64SGkhYBTY7pZliSEmTfNWeoQoAuNV0i0OVVRHhZMPovAMwtXunt2z3pE66/qC29SH+l70+WFITo4JG8VRnvOf7aShKDtr5hh4LXuwZqZsvint0fbLO7QDJhRCr8Zr24szgDyzW2QwyhrOXY3vfU+zfCGU9NbpYQ27aSAdjwcnD0wmNMMe5QcHKbJpGx3crm14C9KuDVA2Dbpb4oKBDVMqUeFgLWp4K6ayKNgzu3nckWwjnjG991ieeDhA1uwa99RAkZUU2EbkPlne0RoY+eV7dNpbvhXJnXKPBtNv11xWCQWIa23JOmKSoEZArU5 X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b1965f6-8cef-43b3-3249-08daab8b202a X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Oct 2022 13:18:45.6973 (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: PR3P250MB0340 Subject: [FFmpeg-devel] [PATCH 2/4] avcodec/svq1enc: Add SVQ1EncDSPContext, make codec context private 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: oPo751qCHvQ0 Currently, SVQ1EncContext is defined in a header that is also included by the arch-specific code that initializes the one and only dsp function that this encoder uses directly. But the arch-specific functions to set this dsp function do not need anything from SVQ1EncContext. This commit therefore adds a small SVQ1EncDSPContext whose only member is said function pointer and renames svq1enc.h to svq1encdsp.h to avoid exposing unnecessary internals to these init functions (and the whole mpegvideo with it). Signed-off-by: Andreas Rheinhardt --- libavcodec/ppc/svq1enc_altivec.c | 4 +- libavcodec/svq1enc.c | 60 ++++++++++++++++++++-- libavcodec/svq1enc.h | 86 -------------------------------- libavcodec/svq1encdsp.h | 34 +++++++++++++ libavcodec/x86/svq1enc_init.c | 4 +- 5 files changed, 93 insertions(+), 95 deletions(-) delete mode 100644 libavcodec/svq1enc.h create mode 100644 libavcodec/svq1encdsp.h diff --git a/libavcodec/ppc/svq1enc_altivec.c b/libavcodec/ppc/svq1enc_altivec.c index aa66b40996..5721bede34 100644 --- a/libavcodec/ppc/svq1enc_altivec.c +++ b/libavcodec/ppc/svq1enc_altivec.c @@ -27,7 +27,7 @@ #include "libavutil/ppc/cpu.h" #include "libavutil/ppc/util_altivec.h" -#include "libavcodec/svq1enc.h" +#include "libavcodec/svq1encdsp.h" #if HAVE_ALTIVEC static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2, @@ -71,7 +71,7 @@ static int ssd_int8_vs_int16_altivec(const int8_t *pix1, const int16_t *pix2, } #endif /* HAVE_ALTIVEC */ -av_cold void ff_svq1enc_init_ppc(SVQ1EncContext *c) +av_cold void ff_svq1enc_init_ppc(SVQ1EncDSPContext *c) { #if HAVE_ALTIVEC if (!PPC_ALTIVEC(av_get_cpu_flags())) diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 79e9e578ac..67a6de5cc0 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -37,11 +37,61 @@ #include "internal.h" #include "mpegutils.h" #include "packet_internal.h" +#include "put_bits.h" #include "svq1.h" -#include "svq1enc.h" +#include "svq1encdsp.h" #include "svq1enc_cb.h" + #include "libavutil/avassert.h" +#include "libavutil/frame.h" +#include "libavutil/mem_internal.h" + +typedef struct SVQ1EncContext { + /* FIXME: Needed for motion estimation, should not be used for anything + * else, the idea is to make the motion estimation eventually independent + * of MpegEncContext, so this will be removed then. */ + MpegEncContext m; + AVCodecContext *avctx; + MECmpContext mecc; + HpelDSPContext hdsp; + AVFrame *current_picture; + AVFrame *last_picture; + PutBitContext pb; + + /* Some compression statistics */ + enum AVPictureType pict_type; + int quality; + + /* why ooh why this sick breadth first order, + * everything is slower and more complex */ + PutBitContext reorder_pb[6]; + + int frame_width; + int frame_height; + + /* Y plane block dimensions */ + int y_block_width; + int y_block_height; + + /* U & V plane (C planes) block dimensions */ + int c_block_width; + int c_block_height; + + DECLARE_ALIGNED(16, int16_t, encoded_block_levels)[6][7][256]; + + uint16_t *mb_type; + uint32_t *dummy; + int16_t (*motion_val8[3])[2]; + int16_t (*motion_val16[3])[2]; + + int64_t rd_total; + + uint8_t *scratchbuf; + + int motion_est; + SVQ1EncDSPContext svq1encdsp; +} SVQ1EncContext; static void svq1_write_header(SVQ1EncContext *s, int frame_type) { @@ -154,7 +204,7 @@ static int encode_block(SVQ1EncContext *s, uint8_t *src, uint8_t *ref, int sqr, diff, score; vector = codebook + stage * size * 16 + i * size; - sqr = s->ssd_int8_vs_int16(vector, block[stage], size); + sqr = s->svq1encdsp.ssd_int8_vs_int16(vector, block[stage], size); diff = block_sum[stage] - sum; score = sqr - (diff * (int64_t)diff >> (level + 3)); // FIXME: 64 bits slooow if (score < best_vector_score) { @@ -558,7 +608,7 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx) s->y_block_height * sizeof(int16_t)); s->dummy = av_mallocz((s->y_block_width + 1) * s->y_block_height * sizeof(int32_t)); - s->ssd_int8_vs_int16 = ssd_int8_vs_int16_c; + s->svq1encdsp.ssd_int8_vs_int16 = ssd_int8_vs_int16_c; if (!s->m.me.temp || !s->m.me.scratchpad || !s->m.me.map || !s->m.me.score_map || !s->mb_type || !s->dummy) { @@ -566,9 +616,9 @@ static av_cold int svq1_encode_init(AVCodecContext *avctx) } #if ARCH_PPC - ff_svq1enc_init_ppc(s); + ff_svq1enc_init_ppc(&s->svq1encdsp); #elif ARCH_X86 - ff_svq1enc_init_x86(s); + ff_svq1enc_init_x86(&s->svq1encdsp); #endif ff_h263_encode_init(&s->m); // mv_penalty diff --git a/libavcodec/svq1enc.h b/libavcodec/svq1enc.h deleted file mode 100644 index bb6af082d5..0000000000 --- a/libavcodec/svq1enc.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * SVQ1 encoder - * - * This file is part of FFmpeg. - * - * FFmpeg is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * FFmpeg is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with FFmpeg; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef AVCODEC_SVQ1ENC_H -#define AVCODEC_SVQ1ENC_H - -#include - -#include "libavutil/frame.h" -#include "libavutil/mem_internal.h" - -#include "avcodec.h" -#include "hpeldsp.h" -#include "me_cmp.h" -#include "mpegvideo.h" -#include "put_bits.h" - -typedef struct SVQ1EncContext { - /* FIXME: Needed for motion estimation, should not be used for anything - * else, the idea is to make the motion estimation eventually independent - * of MpegEncContext, so this will be removed then. */ - MpegEncContext m; - AVCodecContext *avctx; - MECmpContext mecc; - HpelDSPContext hdsp; - AVFrame *current_picture; - AVFrame *last_picture; - PutBitContext pb; - - /* Some compression statistics */ - enum AVPictureType pict_type; - int quality; - - /* why ooh why this sick breadth first order, - * everything is slower and more complex */ - PutBitContext reorder_pb[6]; - - int frame_width; - int frame_height; - - /* Y plane block dimensions */ - int y_block_width; - int y_block_height; - - /* U & V plane (C planes) block dimensions */ - int c_block_width; - int c_block_height; - - DECLARE_ALIGNED(16, int16_t, encoded_block_levels)[6][7][256]; - - uint16_t *mb_type; - uint32_t *dummy; - int16_t (*motion_val8[3])[2]; - int16_t (*motion_val16[3])[2]; - - int64_t rd_total; - - uint8_t *scratchbuf; - - int motion_est; - - int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2, - intptr_t size); -} SVQ1EncContext; - -void ff_svq1enc_init_ppc(SVQ1EncContext *c); -void ff_svq1enc_init_x86(SVQ1EncContext *c); - -#endif /* AVCODEC_SVQ1ENC_H */ diff --git a/libavcodec/svq1encdsp.h b/libavcodec/svq1encdsp.h new file mode 100644 index 0000000000..91b36735d7 --- /dev/null +++ b/libavcodec/svq1encdsp.h @@ -0,0 +1,34 @@ +/* + * SVQ1 encoder DSP + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_SVQ1ENCDSP_H +#define AVCODEC_SVQ1ENCDSP_H + +#include + +typedef struct SVQ1EncDSPContext { + int (*ssd_int8_vs_int16)(const int8_t *pix1, const int16_t *pix2, + intptr_t size); +} SVQ1EncDSPContext; + +void ff_svq1enc_init_ppc(SVQ1EncDSPContext *c); +void ff_svq1enc_init_x86(SVQ1EncDSPContext *c); + +#endif /* AVCODEC_SVQ1ENCDSP_H */ diff --git a/libavcodec/x86/svq1enc_init.c b/libavcodec/x86/svq1enc_init.c index 787a5245f3..daf573beba 100644 --- a/libavcodec/x86/svq1enc_init.c +++ b/libavcodec/x86/svq1enc_init.c @@ -22,12 +22,12 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" -#include "libavcodec/svq1enc.h" +#include "libavcodec/svq1encdsp.h" int ff_ssd_int8_vs_int16_sse2(const int8_t *pix1, const int16_t *pix2, intptr_t size); -av_cold void ff_svq1enc_init_x86(SVQ1EncContext *c) +av_cold void ff_svq1enc_init_x86(SVQ1EncDSPContext *c) { int cpu_flags = av_get_cpu_flags();