From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D6D984928F for ; Sun, 7 Apr 2024 13:53:08 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 483A868D1D8; Sun, 7 Apr 2024 16:53:05 +0300 (EEST) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0C48068CD8D for ; Sun, 7 Apr 2024 16:52:59 +0300 (EEST) Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2d48d75ab70so48948351fa.0 for ; Sun, 07 Apr 2024 06:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jkqxz-net.20230601.gappssmtp.com; s=20230601; t=1712497978; x=1713102778; darn=ffmpeg.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=ypf5ZP+WxQglCW9OGehJk10QwJvFN1tpD0rRVgCqPxk=; b=gDp3gUPBhMRe5Q9oFiycPU+TXvV4dMC9fUjIEZ8L3uwLOMZW8aTfoLCWpTk4AfaITo B+XFRibzbhhXXNeoPIFJeT2ymn94AZ9Mjoe6/3jkfKhoaZsBeKZb+HFEZDpwCSHTj2GH hZ/Nidef1KUPORKXjuqCnb4EMtdtLB+tk0XJ6nXP2DBHfVU01bnRl0iiIzEKyacMYnnl pqXdv0+AcXxqvsvC75rxJgMr6w7/q6Gq/0a4SZ7dSKTyUy7b7vc+S2Ix/Jmydvz335Yx YXjp/tbmUbVqWv+tcWY4gwLDHhEQHqE3UecpLgyaIi+gsN8SJkSguRrN8Bv5Ve+dDE0Y +QRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712497978; x=1713102778; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ypf5ZP+WxQglCW9OGehJk10QwJvFN1tpD0rRVgCqPxk=; b=n5fv7SFQdLtlhncnwdmX9BU2WClap6VDsEvbSEFAMNd2ddMFuW2eaTXIJIXBUG34Gk 615Z1C7ZlPL+RTmiA7nr9QG5az8zFOwE8UAhpGORSjkV9HKZapuY9Ql3V0s/0BPRq2zC orlclIPeadKmVsCr5l3duoWBRX6G6tw9Ay/H+0lropMwJ+YWcTQWiGrYsktV9hzCQs9m 1akARH6UhmDRz6WWNsnAOcqNWauq20yBacGwm2p1JH3zHmVjQ4+LpaLC147PZaFEAp1W K53F1H7LEJAYp/dzoxSJgKuryu3AFQ2Aj0RMVkcg1bX61CFL4vLn1TN9RwIqHoidxnLM rVNg== X-Gm-Message-State: AOJu0YzhuUhi3sx5tlgIoZnmcbeuyuoUO8FqWbRjECJLNaXNw1wMbbsI IM2eFVCkEcEbikSJK+onaydTcDS5H4+xFo3YBTWMFaE/K3mIHaQxdBoXHiyjgaPzHXFA0qLDDZP g X-Google-Smtp-Source: AGHT+IEf8RFoa67JB2d6PiZUyC4I5xvTETIQhBNN7uPrd4odbCYXY/aSXZ8bS1iR0/VNUUEsI8hS0w== X-Received: by 2002:a2e:9d8c:0:b0:2d8:3dc7:e302 with SMTP id c12-20020a2e9d8c000000b002d83dc7e302mr4178785ljj.2.1712497977986; Sun, 07 Apr 2024 06:52:57 -0700 (PDT) Received: from [192.168.0.15] (cpc92302-cmbg19-2-0-cust1183.5-4.cable.virginm.net. [82.1.212.160]) by smtp.gmail.com with ESMTPSA id j15-20020a05600c190f00b004162b7af645sm12360222wmq.10.2024.04.07.06.52.57 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Apr 2024 06:52:57 -0700 (PDT) Message-ID: <784d0f98-8da0-4aa5-bbae-7eb7e4db18a9@jkqxz.net> Date: Sun, 7 Apr 2024 14:53:24 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: FFmpeg development discussions and patches From: Mark Thompson Subject: [FFmpeg-devel] [PATCH 1/2] lavc/av1: Record reference ordering information for each frame X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This is needed by Vulkan. Constructing this can't be delegated to CBS because packets might contain multiple frames (when non-shown frames are present) but we need separate snapshots immediately before each frame for the decoder. --- libavcodec/av1dec.c | 26 ++++++++++++++++++++++++++ libavcodec/av1dec.h | 4 ++++ 2 files changed, 30 insertions(+) diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c index 824725c031..439f17825b 100644 --- a/libavcodec/av1dec.c +++ b/libavcodec/av1dec.c @@ -359,6 +359,25 @@ static void coded_lossless_param(AV1DecContext *s) } } +static void order_hint_info(AV1DecContext *s) +{ + const AV1RawFrameHeader *header = s->raw_frame_header; + const AV1RawSequenceHeader *seq = s->raw_seq; + AV1Frame *frame = &s->cur_frame; + + frame->order_hint = header->order_hint; + + for (int i = 0; i < AV1_REFS_PER_FRAME; i++) { + int ref_name = i + AV1_REF_FRAME_LAST; + int ref_slot = header->ref_frame_idx[i]; + int ref_order_hint = s->ref[ref_slot].order_hint; + + frame->saved_order_hints[ref_name] = ref_order_hint; + frame->ref_frame_sign_bias[ref_name] = + get_relative_dist(seq, ref_order_hint, frame->order_hint); + } +} + static void load_grain_params(AV1DecContext *s) { const AV1RawFrameHeader *header = s->raw_frame_header; @@ -701,6 +720,12 @@ static int av1_frame_ref(AVCodecContext *avctx, AV1Frame *dst, const AV1Frame *s sizeof(dst->film_grain)); dst->coded_lossless = src->coded_lossless; + dst->order_hint = src->order_hint; + memcpy(dst->ref_frame_sign_bias, src->ref_frame_sign_bias, + sizeof(dst->ref_frame_sign_bias)); + memcpy(dst->saved_order_hints, src->saved_order_hints, + sizeof(dst->saved_order_hints)); + return 0; fail: @@ -1257,6 +1282,7 @@ static int get_current_frame(AVCodecContext *avctx) global_motion_params(s); skip_mode_params(s); coded_lossless_param(s); + order_hint_info(s); load_grain_params(s); return ret; diff --git a/libavcodec/av1dec.h b/libavcodec/av1dec.h index 336eb61359..0a7073ddce 100644 --- a/libavcodec/av1dec.h +++ b/libavcodec/av1dec.h @@ -53,6 +53,10 @@ typedef struct AV1Frame { AV1RawFilmGrainParams film_grain; uint8_t coded_lossless; + + uint8_t order_hint; + uint8_t ref_frame_sign_bias[AV1_NUM_REF_FRAMES]; + uint8_t saved_order_hints[AV1_NUM_REF_FRAMES]; } AV1Frame; typedef struct TileGroupInfo { -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".