From patchwork Tue Apr 14 10:24:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe Gisquet X-Patchwork-Id: 18944 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id ECACD44B934 for ; Tue, 14 Apr 2020 13:25:17 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C148968B5BF; Tue, 14 Apr 2020 13:25:17 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F334168B532 for ; Tue, 14 Apr 2020 13:25:10 +0300 (EEST) Received: by mail-wm1-f66.google.com with SMTP id z6so13360523wml.2 for ; Tue, 14 Apr 2020 03:25:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=cx/sQQxhmn1a/Kd8es2rIoGH770vTcIeeG6jitfkrx8=; b=pMYJcbTcwZDEPrWw5eEsj3nt4u5RqmitIz3VU7ef0lz/1mwkyhJ/Wzzc5hJMY7ouKq XbWXw6iylO52Ib5dntbFEky9G2BYjYL9EqLHw9jYEljfuh1RFJWQvkPCzxAkXpwu8Tph 0URp3buwmgOPAL9WHFD6MbZ1albntcfZQ50USALJeF7rOOPQq4CneHgIn9GLinSKxfLq GrcPs+MOSLtL2M9hQAKLqvy5365t0llTlkcPSB6E/HT+b6ePVR0VMuVNprm7wByKgeW9 k7fLDwMOUIDMz9E9V5Q1jHfesQjM/JUQMRZSmz3GQd3t/62vKA8L90rvQfSuwvc9iygm TrNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=cx/sQQxhmn1a/Kd8es2rIoGH770vTcIeeG6jitfkrx8=; b=aPccFVJDGE50mbbTjGuw17CONNfp+9kapd3jkeJLOwQc9GUyQFloujE1BaU60PsJN4 9HkFztPMaRCziX9Nefa4rSpixA8R76+3GxGKYcVuJr5Fnt1+mP0n3j6SQyHTq1BvFlEq GN/GYTPFP634Skxq5Y3J0P3FU2C5abV3e+nWvv5wX/LewWx59fa7T5gd4yahAY2HddYf /tzeLpERRLNlC2lVlLTfr3HhBICuJFBuFiOUNUSGG/pbLZ1FQl2MpwH9hClVMCOFySGi iOcBIU0x0yqkHANdt58HHkwA5cglaHpZa/F0JyW7bG+83H7j97kBYT4nEtYgEGl5b/RZ BxjA== X-Gm-Message-State: AGi0PubpeBBzIpasMrLfCF8Xz1t+HxKMFHfX1jX7gfEo6o1l9eyutb6y g1iQQNk0smyL57APVGD4+DZ/CE8= X-Google-Smtp-Source: APiQypIcGLb3wMicQkNgAwtf3SgoKkKroVIIjBMCcEKwcBPF3kdweb4IWZIq5MhCo+ZFibOXPwtG1g== X-Received: by 2002:a1c:2392:: with SMTP id j140mr22663953wmj.136.1586859910218; Tue, 14 Apr 2020 03:25:10 -0700 (PDT) Received: from localhost.localdomain (2a01cb0881b29e00157b082460d14b2a.ipv6.abo.wanadoo.fr. [2a01:cb08:81b2:9e00:157b:824:60d1:4b2a]) by smtp.gmail.com with ESMTPSA id i17sm8574487wru.39.2020.04.14.03.25.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 03:25:09 -0700 (PDT) From: Christophe Gisquet To: ffmpeg-devel@ffmpeg.org Date: Tue, 14 Apr 2020 10:24:56 +0000 Message-Id: <20200414102503.7858-1-christophe.gisquet@gmail.com> X-Mailer: git-send-email 2.26.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 0/7] Port cache bitstream reader to 32bits, and improve X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This patch series gathers all changes affecting the cached reader and the file get_bits.h. The largest consists in modifying the cached reader so that the cache can be selected to be (native) 32 bits large. Then, due to some corner cases from various codecs, reducing some reads or fixing functions that can not guarantee the usual number of bits, are needed. Note: the MVHA sample was generated using the pattern generation from VirtualDub2 (Tools->Create test video->zone plates) and the MVHA codec, and is 235186 bytes. Christophe Gisquet (7): fate: add a MVHA test get_bits: support 32bits cache get_xbits: request fewer bits get_bits: replace index by an incremented pointer get_bits: improve and fix get_bits_long for 32b get_bits: change refill to RAD pattern get_bits: use immediate in skip_remaining libavcodec/get_bits.h | 193 +++++++++++++++++++++++++++------------- libavcodec/mvha.c | 2 +- libavcodec/utvideodec.c | 2 +- tests/fate/video.mak | 3 + tests/ref/fate/mvha | 6 ++ 5 files changed, 143 insertions(+), 63 deletions(-) create mode 100644 tests/ref/fate/mvha