From patchwork Sun Jan 8 18:09:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Thompson X-Patchwork-Id: 2106 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp6752926vsb; Sun, 8 Jan 2017 10:09:39 -0800 (PST) X-Received: by 10.28.132.9 with SMTP id g9mr425149wmd.28.1483898979088; Sun, 08 Jan 2017 10:09:39 -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 gl1si9630757wjd.182.2017.01.08.10.09.38; Sun, 08 Jan 2017 10:09:39 -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 2920868A52A; Sun, 8 Jan 2017 20:09:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wj0-f175.google.com (mail-wj0-f175.google.com [209.85.210.175]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C4BDA689D8F for ; Sun, 8 Jan 2017 20:09:22 +0200 (EET) Received: by mail-wj0-f175.google.com with SMTP id i20so56683823wjn.2 for ; Sun, 08 Jan 2017 10:09:29 -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=h4cvI/aumqXm3LKNvNBHDmSkXiVJFlUmD45DXIMRew8=; b=LJfQh5smKDV2e4PfARANAiVaO336FEzluAkYLDQoKJw0zlqv8l9WhJx8Xz9b24I600 1Coks5eFhrCDNTRDVeHHJbucgx5b/wJUI5jMTzRaZMZ0c8+QNS7qtLnWD0B+fcwTeA84 zLe0Qh29GLIsQMAI6kHr8zCpRKs72Z1NwUovGY7qv7pmCfV8SRzc5ExkQpk8r0vTHir6 Efj3BaCHOHeoVc0Rk1psjFboHKcVdDYC5wkwNnWxLybznePQT3jIxDiME4fTNjS8z0ad I/7xLkyd3c4CbhKs5rIeI6idkL7VpCgOGC0nq0tqSEKJe9Ybimj1rayRPO9KabMOdTCo lroQ== 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=h4cvI/aumqXm3LKNvNBHDmSkXiVJFlUmD45DXIMRew8=; b=jU/eUHt2OfKp+5CG8SqlXtsmbPKs9bsB0LWpRvbfx7Ej2mXFOmqKo8gdxp60GbXSQ+ pqrsHSrvMj2GgHLwSsUjDZOQhfItDpK8bB3HVJhyb7vMEQ5btOYJbr16vfLuRFVYFMLY slyjKcxPu/Aa9xRyrBbHQB11EG6ejamCzBeNqh7pChl/kwUGrKMmZ69GJDuWw3jKU21u hPGZ0OP2r/dCZuYKLt1ofJzjsIVBwf+ewR3UxBqZz8CxyJ6VPJ4VoN6bh2r9HZr7AAIk A7T6PuyS275imEqM//fE8hc4ehHeLohJ+gK3o5pIhgY+RTQV/UsVHg+t1u0TZuJqzn5Q GY0A== X-Gm-Message-State: AIkVDXKk2yfEmC16DvvRQkXN5yCgTG2ZEMB68aEfW1wJCO+APX3QtdJTwD35ar/cOHHIbQ== X-Received: by 10.194.20.68 with SMTP id l4mr65528778wje.49.1483898968881; Sun, 08 Jan 2017 10:09:28 -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 e14sm5557311wmd.14.2017.01.08.10.09.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jan 2017 10:09:28 -0800 (PST) To: FFmpeg development discussions and patches References: <320e2652-f3d9-5509-11ac-fbd84e22db6a@jkqxz.net> From: Mark Thompson Message-ID: <7c88b413-97f2-51ef-83b2-b6ce334d29e4@jkqxz.net> Date: Sun, 8 Jan 2017 18:09:27 +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 01/16] vaapi_h264: 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 03adfe913062c6995136eb1ca51152b6d596c0f4) --- libavcodec/vaapi_h264.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index bc12d77d6d..7811c10708 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -53,7 +53,7 @@ static void init_vaapi_pic(VAPictureH264 *va_pic) * supersedes pic's field type if nonzero. */ static void fill_vaapi_pic(VAPictureH264 *va_pic, - H264Picture *pic, + const H264Picture *pic, int pic_structure) { if (pic_structure == 0) @@ -91,7 +91,7 @@ typedef struct DPB { * available. The decoded picture buffer's size must be large enough * to receive the new VA API picture object. */ -static int dpb_add(DPB *dpb, H264Picture *pic) +static int dpb_add(DPB *dpb, const H264Picture *pic) { int i; @@ -123,7 +123,7 @@ static int dpb_add(DPB *dpb, H264Picture *pic) /** Fill in VA API reference frames array. */ static int fill_vaapi_ReferenceFrames(VAPictureParameterBufferH264 *pic_param, - H264Context *h) + const H264Context *h) { DPB dpb; int i; @@ -135,13 +135,13 @@ static int fill_vaapi_ReferenceFrames(VAPictureParameterBufferH264 *pic_param, init_vaapi_pic(&dpb.va_pics[i]); for (i = 0; i < h->short_ref_count; i++) { - H264Picture * const pic = h->short_ref[i]; + const H264Picture *pic = h->short_ref[i]; if (pic && pic->reference && dpb_add(&dpb, pic) < 0) return -1; } for (i = 0; i < 16; i++) { - H264Picture * const pic = h->long_ref[i]; + const H264Picture *pic = h->long_ref[i]; if (pic && pic->reference && dpb_add(&dpb, pic) < 0) return -1; } @@ -157,7 +157,7 @@ static int fill_vaapi_ReferenceFrames(VAPictureParameterBufferH264 *pic_param, * @param[in] ref_count The number of reference pictures in ref_list */ static void fill_vaapi_RefPicList(VAPictureH264 RefPicList[32], - H264Ref *ref_list, + const H264Ref *ref_list, unsigned int ref_count) { unsigned int i, n = 0; @@ -185,7 +185,7 @@ static void fill_vaapi_RefPicList(VAPictureH264 RefPicList[32], * @param[out] chroma_weight VA API plain chroma weight table * @param[out] chroma_offset VA API plain chroma offset table */ -static void fill_vaapi_plain_pred_weight_table(H264Context *h, +static void fill_vaapi_plain_pred_weight_table(const H264Context *h, int list, unsigned char *luma_weight_flag, short luma_weight[32], @@ -194,7 +194,7 @@ static void fill_vaapi_plain_pred_weight_table(H264Context *h, short chroma_weight[32][2], short chroma_offset[32][2]) { - H264SliceContext *sl = &h->slice_ctx[0]; + const H264SliceContext *sl = &h->slice_ctx[0]; unsigned int i, j; *luma_weight_flag = sl->pwt.luma_weight_flag[list]; @@ -227,8 +227,8 @@ static int vaapi_h264_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size) { - H264Context * const h = avctx->priv_data; - FFVAContext * const vactx = ff_vaapi_get_context(avctx); + const H264Context *h = avctx->priv_data; + FFVAContext *vactx = ff_vaapi_get_context(avctx); const PPS *pps = h->ps.pps; const SPS *sps = h->ps.sps; VAPictureParameterBufferH264 *pic_param; @@ -293,8 +293,8 @@ static int vaapi_h264_start_frame(AVCodecContext *avctx, /** End a hardware decoding based frame. */ static int vaapi_h264_end_frame(AVCodecContext *avctx) { - FFVAContext * const vactx = ff_vaapi_get_context(avctx); - H264Context * const h = avctx->priv_data; + FFVAContext *vactx = ff_vaapi_get_context(avctx); + const H264Context *h = avctx->priv_data; H264SliceContext *sl = &h->slice_ctx[0]; int ret; @@ -318,9 +318,9 @@ static int vaapi_h264_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, uint32_t size) { - FFVAContext * const vactx = ff_vaapi_get_context(avctx); - H264Context * const h = avctx->priv_data; - H264SliceContext *sl = &h->slice_ctx[0]; + FFVAContext *vactx = ff_vaapi_get_context(avctx); + const H264Context *h = avctx->priv_data; + const H264SliceContext *sl = &h->slice_ctx[0]; VASliceParameterBufferH264 *slice_param; /* Fill in VASliceParameterBufferH264. */