From patchwork Thu Jul 9 19:20:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 20936 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 9FEB844B0C4 for ; Thu, 9 Jul 2020 22:20:51 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8AB6A68B603; Thu, 9 Jul 2020 22:20:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 212C768B5F8 for ; Thu, 9 Jul 2020 22:20:43 +0300 (EEST) Received: by mail-wr1-f65.google.com with SMTP id a6so3556047wrm.4 for ; Thu, 09 Jul 2020 12:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/WUsuvVM+e84vGgOMU6uI/x1UosYEyfgHmTO9H1aOLI=; b=nDO3fzVrkbrzKQrMmK+rif3YvzeqbJeTmr3F18UhgHTNSW36JbQxN5gxqfZCzqEqqA e1jE5J8uM/+pfH1ydej+Lyb7ZGvNpUcF07Or9HpWE2DiyIcpT+BcYIdmJ+9TTiJfMKvS S9WjKD12dgIDzQQ+qX4AWCSKWnTEY5Dq+CoTzT1FP8ij26AhCtK2HR0Fd9cl4Rj/Ckch Lj+HFtUUeM7XILf2/DtkI1DjJbk1KmIMjSEKh/xC916xyCvjF28nF/Ciwy9sPq9Cbv9S MhBPc3SMqhkdaSqdGL2JFDOncoeIcEYNdYlP85xvxlkS8lpz7vlDwhdikhi9lJYl9sKr kWJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/WUsuvVM+e84vGgOMU6uI/x1UosYEyfgHmTO9H1aOLI=; b=BN08JxRqOQ0MvSx604BolO9W1X+pQTrfwrw3//N2TQ+Icp7Q+ZP5vSAJE7jUd9UxgH UscwCdG7qAmZnegzb9GiA+pL1Rsk7h8C8PJ2gOPS6+mweoJmvXHZr+nspCXn97N1C15/ kH9NrBPhcZjlwwiBtbgYJ2rrHBoa0tckxLNHI8/O91LaUwE4n6jaRm0IIgTXEn/c8pWz kO1w9v3K5yrMl2lI7NNq0SulLEW9JqxTXzlABi7tOFrKAM/cYMJtWJaSY15oZNrZTstC ixyQYJd09lxrJL/U0GMG1WtAD9a7nDBkXUTbn7IHxSlHSAg+XRxV0f+z4dayu7u95mPz hQQg== X-Gm-Message-State: AOAM533LBn0/pQrDEdMQ/J98Yl/Qdr3x5hxuUmEDroRjB2+LfT/fsuwZ 6oxX7hrXCgjgC8LLIE1oCeYJz327 X-Google-Smtp-Source: ABdhPJyortoVyzKw20V122LSDgPUCbKNEfOZHkAQojZpkbHLGXmY9Lw9UVqm039ZGPqlabsZHcuAxw== X-Received: by 2002:a5d:5388:: with SMTP id d8mr63760860wrv.35.1594322442141; Thu, 09 Jul 2020 12:20:42 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc10296.dynamic.kabel-deutschland.de. [188.193.2.150]) by smtp.gmail.com with ESMTPSA id p25sm5485330wmg.39.2020.07.09.12.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2020 12:20:41 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 9 Jul 2020 21:20:20 +0200 Message-Id: <20200709192022.9412-7-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200709103542.19909-1-andreas.rheinhardt@gmail.com> References: <20200709103542.19909-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 15/17] avformat/avc: Use the constraint_setx_flags as is 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" and also keep the reserved_zero_2bits in the corresponding H264SPS member. This simplifies parsing and will prove beneficial in ff_isom_write_avcc. Signed-off-by: Andreas Rheinhardt --- libavformat/avc.c | 8 +------- libavformat/avc.h | 2 +- libavformat/mxfenc.c | 2 +- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/libavformat/avc.c b/libavformat/avc.c index 6246410ad0..c106fe5792 100644 --- a/libavformat/avc.c +++ b/libavformat/avc.c @@ -410,13 +410,7 @@ int ff_avc_decode_sps(H264SPS *sps, const uint8_t *buf, int buf_size) memset(sps, 0, sizeof(*sps)); sps->profile_idc = get_bits(&gb, 8); - sps->constraint_set_flags |= get_bits1(&gb) << 0; // constraint_set0_flag - sps->constraint_set_flags |= get_bits1(&gb) << 1; // constraint_set1_flag - sps->constraint_set_flags |= get_bits1(&gb) << 2; // constraint_set2_flag - sps->constraint_set_flags |= get_bits1(&gb) << 3; // constraint_set3_flag - sps->constraint_set_flags |= get_bits1(&gb) << 4; // constraint_set4_flag - sps->constraint_set_flags |= get_bits1(&gb) << 5; // constraint_set5_flag - skip_bits(&gb, 2); // reserved_zero_2bits + sps->constraint_set_flags = get_bits(&gb, 8); sps->level_idc = get_bits(&gb, 8); GET_UE_GOLOMB(sps->id, H264_MAX_SPS_COUNT - 1); diff --git a/libavformat/avc.h b/libavformat/avc.h index db1d3334dd..2c7004a5ef 100644 --- a/libavformat/avc.h +++ b/libavformat/avc.h @@ -42,7 +42,7 @@ typedef struct { uint8_t id; uint8_t profile_idc; uint8_t level_idc; - uint8_t constraint_set_flags; + uint8_t constraint_set_flags; /* Also contains the reserved_zero_*bits. */ uint8_t chroma_format_idc; uint8_t bit_depth_luma_minus8; uint8_t bit_depth_chroma_minus8; diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 5eeeb9ab84..5168b17a2c 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -2204,7 +2204,7 @@ static int mxf_parse_h264_frame(AVFormatContext *s, AVStream *st, sc->aspect_ratio.den = st->codecpar->height * sps->sar.den; av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den, sc->aspect_ratio.num, sc->aspect_ratio.den, 1024*1024); - intra_only = (sps->constraint_set_flags >> 3) & 1; + intra_only = (sps->constraint_set_flags >> 4) & 1; sc->interlaced = !sps->frame_mbs_only_flag; sc->component_depth = sps->bit_depth_luma_minus8 + 8;