From patchwork Sat Sep 22 16:14:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 10445 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:1286:0:0:0:0:0 with SMTP id 6-v6csp718511jap; Sat, 22 Sep 2018 09:16:12 -0700 (PDT) X-Google-Smtp-Source: ACcGV61CiKgr85tbhxx0+kmez2Oh8i/W1/g6xDL40fgImH80Q7tlEotpviBpYqQgC57HzK22l+vJ X-Received: by 2002:adf:8206:: with SMTP id 6-v6mr2411117wrb.160.1537632972155; Sat, 22 Sep 2018 09:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537632972; cv=none; d=google.com; s=arc-20160816; b=J+IIbCpUJYCRKb1JpDX2gVT1HAesBnOFjx53lZDVcy1J1BeBfbZxLFV0RB8tQzKSok CN+2C0VVSH3cS2rYw/ZCWZwtRg3Qrw61rrgivFHUHnUFzjJ5tPGxS8JlgaK0kmGQ5Zwd BQHolwCJ8f0uzBLmB/WBJAcyJKyG6gzOefoBs2EJpG+G+CFOGt2VHnt+inNRqACbsEbu LUaBUJy8iZQ5QrJVD0Vc/28ydCLut2kBygFVldodXRHsjaiukSLaZCkw5VyBDVxeOCso o9M9pLc/ayFmE9FOjg6eU5XtYVmNiBB1hM3bTw+1fsNOA4vwoJqeDuyn2noNwieTnVhr edgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding: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:delivered-to; bh=RaGkSzuwEqtCqwneVTBDmzbD52jLha9GaWbvwzTyBJU=; b=RcjdVqNRQBki7wUS0TS+67BPWyVBxksnncCjQ0XoRxPF90HCL3qrWRLM3fgjetM5YY UI6qbOpMgbAchF4Ju6qIR2B4wqeC9Tet1sygYYhCW06YzHyCMuXzIbXq9dnjVXfNhRlh 6N5l4lnXclMGVeqd4uq3+3W1rsElW1kNoH1JQhBE6ZOmQIn7ybw7OwdgWQvOi57NBm1M SIG2ErpAFaeUlv5JaWrDv79AX+yM2TioI7mcft7lvpnWcKbuKO1M0nGqX88UXCJrfFL8 GLNgD+QfkPnjvChH0RDrcWN7t3dmzVLMnNpJBHJopqCfhfodc9JKbr/9hmyKux3PXKeP 9NNQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f18-v6si89500wre.322.2018.09.22.09.16.11; Sat, 22 Sep 2018 09:16:12 -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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E73F968A69B; Sat, 22 Sep 2018 19:15:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe06-1.mx.upcmail.net (vie01a-dmta-pe06-1.mx.upcmail.net [84.116.36.14]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5EFFD68A557 for ; Sat, 22 Sep 2018 19:14:52 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe06.mx.upcmail.net with esmtp (Exim 4.88) (envelope-from ) id 1g3kYl-0007Gj-4j for ffmpeg-devel@ffmpeg.org; Sat, 22 Sep 2018 18:15:07 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id egF21y01x0S5wYM01gF4gS; Sat, 22 Sep 2018 18:15:04 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 22 Sep 2018 18:14:04 +0200 Message-Id: <20180922161408.22052-8-michael@niedermayer.cc> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180922161408.22052-1-michael@niedermayer.cc> References: <20180922161408.22052-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 08/11] avcodec/prosumer: Rename do_shift() to vertical_predict() 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" It seems what this function does is a vertical prediction filter, thus the new name should improve understanding. rename the related table_b too Signed-off-by: Michael Niedermayer --- libavcodec/prosumer.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavcodec/prosumer.c b/libavcodec/prosumer.c index 9eb3c18cae..575b00baca 100644 --- a/libavcodec/prosumer.c +++ b/libavcodec/prosumer.c @@ -39,7 +39,7 @@ typedef struct ProSumerContext { unsigned stride; unsigned size; uint32_t lut[0x10000]; - uint8_t *table_b; + uint8_t *initial_line; uint8_t *decbuffer; } ProSumerContext; @@ -132,7 +132,7 @@ static int decompress(GetByteContext *gb, int size, PutByteContext *pb, const ui return 0; } -static void do_shift(uint32_t *dst, int offset, const uint32_t *src, int stride, int height) +static void vertical_predict(uint32_t *dst, int offset, const uint32_t *src, int stride, int height) { uint32_t x = (0x7F7F7F7F >> 1) & 0x7F7F7F7F; @@ -163,8 +163,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, bytestream2_init_writer(&s->pb, s->decbuffer, s->size); decompress(&s->gb, AV_RL32(avpkt->data + 28) >> 1, &s->pb, s->lut); - do_shift((uint32_t *)s->decbuffer, 0, (uint32_t *)s->table_b, s->stride, 1); - do_shift((uint32_t *)s->decbuffer, s->stride, (uint32_t *)s->decbuffer, s->stride, avctx->height - 1); + vertical_predict((uint32_t *)s->decbuffer, 0, (uint32_t *)s->initial_line, s->stride, 1); + vertical_predict((uint32_t *)s->decbuffer, s->stride, (uint32_t *)s->decbuffer, s->stride, avctx->height - 1); ret = ff_get_buffer(avctx, frame, 0); if (ret < 0) @@ -344,11 +344,11 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->pix_fmt = AV_PIX_FMT_YUV411P; - s->table_b = av_malloc(s->stride); + s->initial_line = av_malloc(s->stride); s->decbuffer = av_malloc(s->size); - if (!s->table_b || !s->decbuffer) + if (!s->initial_line || !s->decbuffer) return AVERROR(ENOMEM); - memset(s->table_b, 0x80u, s->stride); + memset(s->initial_line, 0x80u, s->stride); fill_lut(s->lut); @@ -359,7 +359,7 @@ static av_cold int decode_close(AVCodecContext *avctx) { ProSumerContext *s = avctx->priv_data; - av_freep(&s->table_b); + av_freep(&s->initial_line); av_freep(&s->decbuffer); return 0;