From patchwork Sun Jan 8 18:09:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 2120 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp6754624vsb; Sun, 8 Jan 2017 10:16:12 -0800 (PST) X-Received: by 10.223.173.43 with SMTP id p40mr9117222wrc.163.1483899372702; Sun, 08 Jan 2017 10:16:12 -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 e9si6146971wra.151.2017.01.08.10.16.12; Sun, 08 Jan 2017 10:16:12 -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 E335668A592; Sun, 8 Jan 2017 20:16:03 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 227CE68A58C for ; Sun, 8 Jan 2017 20:15:58 +0200 (EET) Received: by mail-wm0-f45.google.com with SMTP id c206so4540290wme.0 for ; Sun, 08 Jan 2017 10:16:05 -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=elozIi1rCMehBXZpEsOmJ6drPsPzt41gHEILdwncvjQ=; b=QLtpA5YTDN6UeH6575oFSAHPB8taRRPR1GSUfu3EUe73+/04OnRQPOzqb/GQ7rTwWo dLnnWUe+0oqJc5nITzdMxl7tmV0v0E3p4BGPP1y8EhB4ITMU1pBnyhST9gDBbnQR/+vr IIuoVKTf4pWVDjoZ7VLHw4Q6TPG9IGGyw6NcGdkZCYfpTojjjwuxlYgpMxmgh7lQjniR ZyTxT3vh82/XYJnCn8qZTMj6DYPgPdWUTCN7D6as6ZlJODivPvyF2rLZYaugnNcHAQfp FYMrv2baU3uTsXDBvIa0gkoaRtz6qSaajYeMaCW9M5wym7z9RnaAnRY0aqc+5vrwG23P vy0g== 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=elozIi1rCMehBXZpEsOmJ6drPsPzt41gHEILdwncvjQ=; b=RDmCVagzKs2jl7713NLUB/x2QvrDodt1RzePP2G3fpZCZYi018av9gdvYuo30dNq6V VUMaXADTgeSLtf2mD7wezcRwM4KYB2uOPEQR/8yTyH56BHUj6+aIgNG6m0EGA39HIGnC R0yP3VJK5ekCtZGbv5qoO0wnTVn9HUtfq733mWp7FD7ShC8X8jtjZgjuunlJNAOBVeMk CugdZ9vxC6Rdq3Chg+PUeeEPFW3nvmzmwjzYin/xjvDaoEHCxpraDvu07x8K76zUdk2u N0a1Z4qFF66A3qb+Q40WKV9fAH41+cT1xtoOzxGAZRym1VBPX3ZsB4/GUvcJDJXNt6h6 Ln+A== X-Gm-Message-State: AIkVDXLPRLEepdF2hcHentwV5VaUuMCbProGUTPq/N/J2Dc6JMmG1Imu6YHnuUVzZKsGZQ== X-Received: by 10.28.1.213 with SMTP id 204mr1093621wmb.70.1483898990012; Sun, 08 Jan 2017 10:09:50 -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 f126sm14452087wme.22.2017.01.08.10.09.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jan 2017 10:09:49 -0800 (PST) To: FFmpeg development discussions and patches References: <320e2652-f3d9-5509-11ac-fbd84e22db6a@jkqxz.net> From: Mark Thompson Message-ID: <9d639e7d-0119-734c-2a12-05f300478520@jkqxz.net> Date: Sun, 8 Jan 2017 18:09:48 +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 02/16] vaapi_mpeg2: 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 ee9061293e925916fe2e0b7c08fbbd1f981b1d29) --- libavcodec/vaapi_mpeg2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c index 9329e5450a..beaac9a57f 100644 --- a/libavcodec/vaapi_mpeg2.c +++ b/libavcodec/vaapi_mpeg2.c @@ -26,22 +26,22 @@ #include "internal.h" /** Reconstruct bitstream f_code */ -static inline int mpeg2_get_f_code(MpegEncContext *s) +static inline int mpeg2_get_f_code(const MpegEncContext *s) { return (s->mpeg_f_code[0][0] << 12) | (s->mpeg_f_code[0][1] << 8) | (s->mpeg_f_code[1][0] << 4) | s->mpeg_f_code[1][1]; } /** Determine frame start: first field for field picture or frame picture */ -static inline int mpeg2_get_is_frame_start(MpegEncContext *s) +static inline int mpeg2_get_is_frame_start(const MpegEncContext *s) { return s->first_field || s->picture_structure == PICT_FRAME; } static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size) { - struct MpegEncContext * const s = avctx->priv_data; - FFVAContext * const vactx = ff_vaapi_get_context(avctx); + const MpegEncContext *s = avctx->priv_data; + FFVAContext *vactx = ff_vaapi_get_context(avctx); VAPictureParameterBufferMPEG2 *pic_param; VAIQMatrixBufferMPEG2 *iq_matrix; int i; @@ -101,8 +101,8 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { - MpegEncContext * const s = avctx->priv_data; - FFVAContext * const vactx = ff_vaapi_get_context(avctx); + const MpegEncContext *s = avctx->priv_data; + FFVAContext *vactx = ff_vaapi_get_context(avctx); VASliceParameterBufferMPEG2 *slice_param; GetBitContext gb; uint32_t quantiser_scale_code, intra_slice_flag, macroblock_offset;