From patchwork Mon Jul 6 18:30:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yongle Lin X-Patchwork-Id: 20852 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 4C6AF44B731 for ; Mon, 6 Jul 2020 21:37:53 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1D2D468B474; Mon, 6 Jul 2020 21:37:53 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f68.google.com (mail-vs1-f68.google.com [209.85.217.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F18668921A for ; Mon, 6 Jul 2020 21:37:47 +0300 (EEST) Received: by mail-vs1-f68.google.com with SMTP id a17so10252856vsq.6 for ; Mon, 06 Jul 2020 11:37:47 -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=UTAiFZgG7l+TCi86PW6/AzrOu+WW7HG+3QeciyWytv0=; b=WDAOlXY66nZ2pOlxmLETJYb7Zo0oxLNY2LNZdrKY2t5FnqD36jSUygoN2Gs7rLbRt8 Fdbpp/NRjvGQVKtLzoB0ZiLcqbxK+dcjR2mEa3rL6n5iYklCXrMqs4Wf6CHJgqRCvNYZ 1qeZulwLfMywiDrIjh8Hkf2jWZDbLV87fVYBXI+pXggwvWiiTh4uPwN5FfhLxi7xYk1m eIytgFcV9JUPdBR0LblW5A052zsW17WKw1WpWZKwXFZvospi70eL2525skifZGTyP/Pn Y4odQXr/r6/wdvTke3g8pRlUVprQ/F01lWV34zcHvmL1ikhfVhsG6WO4Ls9KLAuUNQ6m 8VVQ== 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=UTAiFZgG7l+TCi86PW6/AzrOu+WW7HG+3QeciyWytv0=; b=WOlGKI+q7klA+eh+uS0RVKIKTR1hx/KryvQOADuJcDHxhzTGcQdMjzwyo3/4wR9qF2 R3Pcxi/dWpzaeVyjfNLsptNXAWqOo06vgr9ig6jLM2o9PChQKZzz1R+xjYpS7VnXmhzQ Lybp+IBos7+k6/Bp6C0Ls9qWqTAX6bpyPM10sPyyIeLbQ4KmBBGzwHHhh7UYiUiWpfjB CMxSNMRF0twFcusu/3mrYeBqMSIOn0DCRpAyAVWx2BRTT6NFXieP8grY4GLa1Ubq/Ikt pE38cuhTd1S/EeJZDNZ8OqUtV3HsdAjuOtyqqYJz9bR28MlVNf37Ge5L7xqROAWs7PCB IiWQ== X-Gm-Message-State: AOAM532V3A6H4AHw1K0xhsED5NO1+UdZt+8B+LcgbzVZpuWYhD/MXDx8 OGRvsq6W75hCbSvXGHfsMOPun21J X-Google-Smtp-Source: ABdhPJw2BpwkHlWfSJ+oVPMtLmcIm0DL932unlYvUHPtCbLHc/pXAN0LMc0ek4HSWVrWMQxmh2nz8Q== X-Received: by 2002:aa7:970a:: with SMTP id a10mr32343136pfg.319.1594060292450; Mon, 06 Jul 2020 11:31:32 -0700 (PDT) Received: from yonglel.c.googlers.com.com (197.59.83.34.bc.googleusercontent.com. [34.83.59.197]) by smtp.gmail.com with ESMTPSA id 6sm19877737pfi.170.2020.07.06.11.31.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2020 11:31:32 -0700 (PDT) From: Yongle Lin X-Google-Original-From: Yongle Lin To: ffmpeg-devel@ffmpeg.org Date: Mon, 6 Jul 2020 18:30:07 +0000 Message-Id: <20200706183007.2472127-1-yonglel@google.com> X-Mailer: git-send-email 2.27.0.383.g050319c2ae-goog In-Reply-To: <20200702150904.GY3171139@pb2> References: <20200702150904.GY3171139@pb2> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] libavcodec/vp9: export block structure when segmentation isn't enable 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: Yongle Lin Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" it makes sense to export block structure like src_x, src_y, width and height when segmentation isn't enable so we could visualize and see the structure of the block. --- libavcodec/vp9.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c index fd0bab14a2..e700def70e 100644 --- a/libavcodec/vp9.c +++ b/libavcodec/vp9.c @@ -1501,10 +1501,8 @@ static int vp9_export_enc_params(VP9Context *s, VP9Frame *frame) AVVideoEncParams *par; unsigned int tile, nb_blocks = 0; - if (s->s.h.segmentation.enabled) { - for (tile = 0; tile < s->active_tile_cols; tile++) - nb_blocks += s->td[tile].nb_block_structure; - } + for (tile = 0; tile < s->active_tile_cols; tile++) + nb_blocks += s->td[tile].nb_block_structure; par = av_video_enc_params_create_side_data(frame->tf.f, AV_VIDEO_ENC_PARAMS_VP9, nb_blocks); @@ -1536,7 +1534,7 @@ static int vp9_export_enc_params(VP9Context *s, VP9Frame *frame) b->w = 1 << (3 + td->block_structure[block_tile].block_size_idx_x); b->h = 1 << (3 + td->block_structure[block_tile].block_size_idx_y); - if (s->s.h.segmentation.feat[seg_id].q_enabled) { + if (s->s.h.segmentation.enabled && s->s.h.segmentation.feat[seg_id].q_enabled) { b->delta_qp = s->s.h.segmentation.feat[seg_id].q_val; if (s->s.h.segmentation.absolute_vals) b->delta_qp -= par->qp;