From patchwork Sun Jan 8 18:10:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 2107 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp6753105vsb; Sun, 8 Jan 2017 10:10:18 -0800 (PST) X-Received: by 10.28.111.220 with SMTP id c89mr2826329wmi.102.1483899018669; Sun, 08 Jan 2017 10:10:18 -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 sc5si94788414wjb.155.2017.01.08.10.10.18; Sun, 08 Jan 2017 10:10:18 -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=@jkqxz-net.20150623.gappssmtp.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 91B7668A52E; Sun, 8 Jan 2017 20:10:09 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 48455689D47 for ; Sun, 8 Jan 2017 20:10:02 +0200 (EET) Received: by mail-wm0-f53.google.com with SMTP id a197so77986507wmd.0 for ; Sun, 08 Jan 2017 10:10:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=sL8SWfG7ztsjUQC0evGdbpwfe5iTnff6VcQZg0Tp7gQ=; b=kcqe+l80II+JdBdxqUHReNHZPNUEBBhSPF7QwZC1ClA0MGRDSHkaZrdvoefCkGNw0a y1WMbI13VSbHwjQ70H+f/TITFEewmMRdQ7vCX5XfeDquHmjGyrJB2IF+GE98POOjUvTE 7e8meRS3wio5OxHwJfxXXOSzlBAJGC4PkdRG3p35OntWz+7SmR5kRif+haSrWWC3s67R 9U0SrtRAUk+/2jo2Hwaekrd4anHgibzJ2al88c4KBm3olGgw5Wz9bAu9yDxNAI98PIX8 E9auiehQxu2OsWjGAWIdKv9g7f0JU0CRHTVG2iOj4PEGnCviFm3UkruUJ8vCqYu7/Wru i5Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=sL8SWfG7ztsjUQC0evGdbpwfe5iTnff6VcQZg0Tp7gQ=; b=kyhAV093DI2vC4cJL9zRo8r6XtSlyeJMC1jB85LyCP46XU6FXHgS2Qude4eX36U0QU cNyZL7+19N5ABPh/NKUypnkKJaGVuVilno1mu8NqLwtnY7k/FbdI81Rmgarwp4Oe6urN zoxuLcR+nlqQmKxMLsmjMfpxq/+5NcasmHWp3elrx+v6Q+tjqkh4iYtJCG+S7Y6DIP+O bUh7XxJhWh6RTUh+3WInUQkCr5n777S5/VumluU7nZNFP5q1xdT7f/YWOMhKDfQKiSjD qu7rWM9yTiVIg/PkYBMp7FOd9W5tni1xJRAsf3FlNdrMYCD9BZR8g7qpmJdGt0NTb9Z9 zFmQ== X-Gm-Message-State: AIkVDXJ7nnY/3JkL1EC8jP/xtqA3infpqU8dYgtgaY+axW4STsUK0mI6lT4ZpKjWpg6hPQ== X-Received: by 10.223.155.157 with SMTP id d29mr11338064wrc.37.1483899008939; Sun, 08 Jan 2017 10:10:08 -0800 (PST) Received: from [192.168.0.8] (cpc91242-cmbg18-2-0-cust650.5-4.cable.virginm.net. [82.8.130.139]) by smtp.gmail.com with ESMTPSA id n5sm14576757wmf.0.2017.01.08.10.10.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jan 2017 10:10:08 -0800 (PST) To: FFmpeg development discussions and patches References: <320e2652-f3d9-5509-11ac-fbd84e22db6a@jkqxz.net> From: Mark Thompson Message-ID: Date: Sun, 8 Jan 2017 18:10:07 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <320e2652-f3d9-5509-11ac-fbd84e22db6a@jkqxz.net> Subject: [FFmpeg-devel] [PATCH 03/16] vaapi_vc1: Constify pointers 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" (cherry picked from commit 01d6f84f49a55fd591aa120960fce2b9dba92d0d) --- libavcodec/vaapi_vc1.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c index 4e82be1ae1..7a9b8d3920 100644 --- a/libavcodec/vaapi_vc1.c +++ b/libavcodec/vaapi_vc1.c @@ -39,7 +39,7 @@ static int get_VAMvModeVC1(enum MVModes mv_mode) } /** Check whether the MVTYPEMB bitplane is present */ -static inline int vc1_has_MVTYPEMB_bitplane(VC1Context *v) +static inline int vc1_has_MVTYPEMB_bitplane(const VC1Context *v) { if (v->mv_type_is_raw) return 0; @@ -50,7 +50,7 @@ static inline int vc1_has_MVTYPEMB_bitplane(VC1Context *v) } /** Check whether the SKIPMB bitplane is present */ -static inline int vc1_has_SKIPMB_bitplane(VC1Context *v) +static inline int vc1_has_SKIPMB_bitplane(const VC1Context *v) { if (v->skip_is_raw) return 0; @@ -59,7 +59,7 @@ static inline int vc1_has_SKIPMB_bitplane(VC1Context *v) } /** Check whether the DIRECTMB bitplane is present */ -static inline int vc1_has_DIRECTMB_bitplane(VC1Context *v) +static inline int vc1_has_DIRECTMB_bitplane(const VC1Context *v) { if (v->dmb_is_raw) return 0; @@ -67,7 +67,7 @@ static inline int vc1_has_DIRECTMB_bitplane(VC1Context *v) } /** Check whether the ACPRED bitplane is present */ -static inline int vc1_has_ACPRED_bitplane(VC1Context *v) +static inline int vc1_has_ACPRED_bitplane(const VC1Context *v) { if (v->acpred_is_raw) return 0; @@ -77,7 +77,7 @@ static inline int vc1_has_ACPRED_bitplane(VC1Context *v) } /** Check whether the OVERFLAGS bitplane is present */ -static inline int vc1_has_OVERFLAGS_bitplane(VC1Context *v) +static inline int vc1_has_OVERFLAGS_bitplane(const VC1Context *v) { if (v->overflg_is_raw) return 0; @@ -89,9 +89,9 @@ static inline int vc1_has_OVERFLAGS_bitplane(VC1Context *v) } /** Reconstruct bitstream PTYPE (7.1.1.4, index into Table-35) */ -static int vc1_get_PTYPE(VC1Context *v) +static int vc1_get_PTYPE(const VC1Context *v) { - MpegEncContext * const s = &v->s; + const MpegEncContext *s = &v->s; switch (s->pict_type) { case AV_PICTURE_TYPE_I: return 0; case AV_PICTURE_TYPE_P: return v->p_frame_skipped ? 4 : 1; @@ -101,7 +101,7 @@ static int vc1_get_PTYPE(VC1Context *v) } /** Reconstruct bitstream MVMODE (7.1.1.32) */ -static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v) +static inline VAMvModeVC1 vc1_get_MVMODE(const VC1Context *v) { if (v->s.pict_type == AV_PICTURE_TYPE_P || (v->s.pict_type == AV_PICTURE_TYPE_B && !v->bi_type)) @@ -110,7 +110,7 @@ static inline VAMvModeVC1 vc1_get_MVMODE(VC1Context *v) } /** Reconstruct bitstream MVMODE2 (7.1.1.33) */ -static inline VAMvModeVC1 vc1_get_MVMODE2(VC1Context *v) +static inline VAMvModeVC1 vc1_get_MVMODE2(const VC1Context *v) { if (v->s.pict_type == AV_PICTURE_TYPE_P && v->mv_mode == MV_PMODE_INTENSITY_COMP) return get_VAMvModeVC1(v->mv_mode2); @@ -118,7 +118,7 @@ static inline VAMvModeVC1 vc1_get_MVMODE2(VC1Context *v) } /** Reconstruct bitstream TTFRM (7.1.1.41, Table-53) */ -static inline int vc1_get_TTFRM(VC1Context *v) +static inline int vc1_get_TTFRM(const VC1Context *v) { switch (v->ttfrm) { case TT_8X8: return 0; @@ -146,9 +146,9 @@ static inline void vc1_pack_bitplanes(uint8_t *bitplane, int n, const uint8_t *f static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size) { - VC1Context * const v = avctx->priv_data; - MpegEncContext * const s = &v->s; - FFVAContext * const vactx = ff_vaapi_get_context(avctx); + const VC1Context *v = avctx->priv_data; + const MpegEncContext *s = &v->s; + FFVAContext *vactx = ff_vaapi_get_context(avctx); VAPictureParameterBufferVC1 *pic_param; vactx->slice_param_size = sizeof(VASliceParameterBufferVC1); @@ -311,9 +311,9 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { - VC1Context * const v = avctx->priv_data; - MpegEncContext * const s = &v->s; - FFVAContext * const vactx = ff_vaapi_get_context(avctx); + const VC1Context *v = avctx->priv_data; + const MpegEncContext *s = &v->s; + FFVAContext *vactx = ff_vaapi_get_context(avctx); VASliceParameterBufferVC1 *slice_param; /* Current bit buffer is beyond any marker for VC-1, so skip it */