From patchwork Tue Oct 30 19:21:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 10854 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 8831444C0F7 for ; Tue, 30 Oct 2018 21:23:20 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 01BD068A6AD; Tue, 30 Oct 2018 21:22:52 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-qk1-f193.google.com (mail-qk1-f193.google.com [209.85.222.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E744168A533 for ; Tue, 30 Oct 2018 21:22:44 +0200 (EET) Received: by mail-qk1-f193.google.com with SMTP id 189so6599272qkj.8 for ; Tue, 30 Oct 2018 12:23:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=+AUMChzX0QkU6oUVnAueh2EYxuFCnd27nFj1O9cYC7Y=; b=jfdlqS5lhxVdlBPBYpBVJ3QEq70Ce3IsXS4ugBaaKZu223kiy0Vlc/bVQ+QVkXBEVv EQ/t6ySi26NUphwPNSgoBGWPPtz4Xn1b8f+2QkfyWiey9akO9Bp/Dw23+DvjTAqj1EQM ZW1tcbBTVDTlJX+29zsiuz6wwDWozPTJ0BIarJ7k6bOUvhKtFPYt6JWzPlcBDv+RA7kT e9Ae2L5jwz+j0pINNsaaGSy9YLkut5gowM9NnBSVvG0H9MXs15CNJDqB95FHMluNsVhG //gpEFVAqguJc/pVgdSXEZGhnHqaXiSXATafgFkwyVGpwuqaKp/xAUC35GfGTT9SOLZ8 HQGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+AUMChzX0QkU6oUVnAueh2EYxuFCnd27nFj1O9cYC7Y=; b=VowngNrqD1C1TRLWARYYQcCZWlMKOW+Cw4Y5R1G4L7fdsRL4eK5EFg5n00KXVZWqtd TXlsDfjg9s/FY+4ZxePoMbijws9MR4J5TRBvV3Ri51dEwmFMHm1pSghujjRZJeOiDdFM tUq8InQqbcJNLsW+IOTX40MK1tWEAxzEOj6w0HcCtO5QkwNH/Y3CC39RzPgmmYd9xVK4 Aklas6MUIrpVEc5a+OFUxp+1ZYcsZLWmlm0VXoN6eyWOKf3OKHOy65WojZW7qrPhKDFz j0TxT4w5Gq/sog55yQF3ji/7k8R3z80o1zCdd0cjDtSujeb0koP/DV774pnwwBIYDscH njEQ== X-Gm-Message-State: AGRZ1gIS7Z1jvIH12Pmk1QR5XPQAv81tFIwEwR0TPSdiHsqnAU/EjxcO E5A2F7obbVDIAEcDyvP0RSL85SCc X-Google-Smtp-Source: AJdET5f+l9zBlCf3gLokOF5lpL7MgGAOq5lN7yOC5UgYuOKgdOkdnGwkGQW7CM/oz7Nfp8ezIuK51w== X-Received: by 2002:a37:5803:: with SMTP id m3-v6mr162403qkb.81.1540927394870; Tue, 30 Oct 2018 12:23:14 -0700 (PDT) Received: from localhost.localdomain ([179.38.180.156]) by smtp.gmail.com with ESMTPSA id q36-v6sm14095822qte.94.2018.10.30.12.23.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 30 Oct 2018 12:23:14 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 30 Oct 2018 16:21:50 -0300 Message-Id: <20181030192151.6560-2-jamrial@gmail.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181030192151.6560-1-jamrial@gmail.com> References: <20181030192151.6560-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/cbs_vp9: store profile in the private context 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" Derived from profile_low_bit and profile_high_bit. Signed-off-by: James Almer --- libavcodec/cbs_vp9.h | 2 ++ libavcodec/cbs_vp9_syntax_template.c | 13 ++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/libavcodec/cbs_vp9.h b/libavcodec/cbs_vp9.h index 12689e51cc..3f1473c9f8 100644 --- a/libavcodec/cbs_vp9.h +++ b/libavcodec/cbs_vp9.h @@ -192,6 +192,8 @@ typedef struct VP9ReferenceFrameState { } VP9ReferenceFrameState; typedef struct CodedBitstreamVP9Context { + int profile; + // Frame dimensions in 8x8 mode info blocks. uint16_t mi_cols; uint16_t mi_rows; diff --git a/libavcodec/cbs_vp9_syntax_template.c b/libavcodec/cbs_vp9_syntax_template.c index 7b90775ed6..28f95dcd32 100644 --- a/libavcodec/cbs_vp9_syntax_template.c +++ b/libavcodec/cbs_vp9_syntax_template.c @@ -278,15 +278,14 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, VP9RawFrameHeader *current) { CodedBitstreamVP9Context *vp9 = ctx->priv_data; - int profile, i; - int err; + int err, i; f(2, frame_marker); f(1, profile_low_bit); f(1, profile_high_bit); - profile = (current->profile_high_bit << 1) + current->profile_low_bit; - if (profile == 3) + vp9->profile = (current->profile_high_bit << 1) + current->profile_low_bit; + if (vp9->profile == 3) f(1, profile_reserved_zero); f(1, show_existing_frame); @@ -304,7 +303,7 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, if (current->frame_type == VP9_KEY_FRAME) { CHECK(FUNC(frame_sync_code)(ctx, rw, current)); - CHECK(FUNC(color_config)(ctx, rw, current, profile)); + CHECK(FUNC(color_config)(ctx, rw, current, vp9->profile)); CHECK(FUNC(frame_size)(ctx, rw, current)); CHECK(FUNC(render_size)(ctx, rw, current)); @@ -324,8 +323,8 @@ static int FUNC(uncompressed_header)(CodedBitstreamContext *ctx, RWContext *rw, if (current->intra_only == 1) { CHECK(FUNC(frame_sync_code)(ctx, rw, current)); - if (profile > 0) { - CHECK(FUNC(color_config)(ctx, rw, current, profile)); + if (vp9->profile > 0) { + CHECK(FUNC(color_config)(ctx, rw, current, vp9->profile)); } else { infer(color_space, 1); infer(subsampling_x, 1);