From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 4C33E4F887 for ; Mon, 23 Jun 2025 13:46:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 1A11968E091; Mon, 23 Jun 2025 16:41:03 +0300 (EEST) Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id E1A7B68E005 for ; Mon, 23 Jun 2025 16:41:01 +0300 (EEST) Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-235e1d710d8so56352615ad.1 for ; Mon, 23 Jun 2025 06:41:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750686060; x=1751290860; darn=ffmpeg.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date :references:in-reply-to:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=JNMKn78PLWejyj0FN7Q5qd2Ih05vQeGsb/PWelKbzco=; b=kOrPtALeGa90j2QDB2FGV2kewV4/FNFPtJNB+hPtuwcvGx6f7KsDVUSZNjoxwVBntY IkMyAh4AlkKDYkYuSjplhIDJz5AZDa342JSXxT6JKXl/BUJ4vAMjMDsdcGRMYDOpX9ee pdPYaNPDLKLXF9nbphQpb1hLUH+e1Qwbe10kqt5CSYphZZjZzua+etjNp1lH0sgP+QkX kkdm29E1pGFlw9XMkYe/ThFbDFFvgV7HFY1m3wIiNJLNGnmXZ6Izfa81wAKV9/ckv0df LKK9N4L/bgyfyR6bwUS/VqPUDS/414bYxoZy0CqCIn3BN+v8K/O5byxYYBXXPaKnax6+ UZmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750686060; x=1751290860; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date :references:in-reply-to:message-id:from:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=JNMKn78PLWejyj0FN7Q5qd2Ih05vQeGsb/PWelKbzco=; b=vRVB/Kn2t5J8i/j95s95H9MmY8rmrYGmG1HeAOSWmMp05Q0CuNJVB4TRDJi28+r40p 08bn0p4GldfQicvnk6mp8XWNwgZxiWida5yhuckpg+4zkl7fVXKzTFtyaU83PM4GYxJ+ sYkj9za0Yp7PNrIAsa4aZKusBaplDPEtWB6X2n5lR+3Rw5f9uSb/kaIQjqdrWRn9fTIL vTmc2oF0mzb3W56EO9yRkYNflQo997fxWScERLQH6KiQG+cR7ED9KD3ZDhH/QLcCmsoV 4/Fl6gp/+XMLn0qkQhGkF/xNoMaS2b31Wr4zDPLToN+6Hl0bmco723DSuv60804Lh3mh 4gYg== X-Gm-Message-State: AOJu0YwnVwN3JDNU2d3aeL0cZtZAtPgwRtS6dMR2cRag+qCxYnCzAxgF WGmp6j3jBG5OnW9u4Qv88vFS2N9RZlftJwkRBFLIu0mNjMEFb7rn6qL59tpoGQ== X-Gm-Gg: ASbGncvvgUxuUiRMzem12Pcr/q0bNx2qg/J8L1svDJjKl5Rhf+AppVaR/ZC6x7jjED8 hJh5rK4To22m/8t9gnCbVAIjHitsezeVYa9dPiS86sxG7Z8RQ3pVgOJQS5SE08+UqwmS+1hEwxl q+fuYwQmemUAlFYU4ukJizZMyr2O1Xsqg4MLGY/ZM8+DpcbofXReVX/eXF2oXPYgh3g10NzEtod jtK6qQeQxCifMYFYv+q5SocHh0rMW+w0/FvoRNcKROCA5JxMCgcoa2k4sOJ0nsOj5LwuVl2t9Ac tjTPDsKgOhUKUNIcwolpJG1vM/RG1Q5lJbGrSpiauvar1qj1G9bOBFavahqE3cjx5zBO1AM0DVL LSJpyzbiPvT/Z07h+ X-Google-Smtp-Source: AGHT+IECSElJ7qn43KdWE0txs0ey1vW3YyPuwJyY7pGirYK2RZ1FSddR/pIZ4gioiKeCf7zX7KGHeg== X-Received: by 2002:a17:902:cec5:b0:235:88b:2d06 with SMTP id d9443c01a7336-237d96bc38fmr152546215ad.6.1750686060201; Mon, 23 Jun 2025 06:41:00 -0700 (PDT) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-237d839326asm83774405ad.32.2025.06.23.06.40.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jun 2025 06:40:59 -0700 (PDT) From: Andreas Rheinhardt X-Google-Original-From: Andreas Rheinhardt Message-Id: In-Reply-To: References: Date: Mon, 23 Jun 2025 13:36:44 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 44/48] avcodec/mpeg_er: Allow to skip setting partitioned_frame, p[pb]_time 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 Cc: Andreas Rheinhardt Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Andreas Rheinhardt Instead of setting these unconditionally (they are always zero for H.261, MPEG-1/2, RV30/40, VC-1), add a variant of ff_mpeg_er_frame_start() that sets them and remove setting them from ff_mpeg_er_frame_start(). Also pass these values via parameters instead of reading them from the MPVContext itself. This will allow to move them from MPVContext. Signed-off-by: Andreas Rheinhardt --- libavcodec/h263dec.c | 3 ++- libavcodec/mpeg_er.c | 3 --- libavcodec/mpeg_er.h | 9 +++++++++ libavcodec/rv10.c | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 723040146f..aee52dd2b2 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -553,7 +553,8 @@ int ff_h263_decode_frame(AVCodecContext *avctx, AVFrame *pict, return ret; } - ff_mpeg_er_frame_start(s); + ff_mpv_er_frame_start_ext(s, s->partitioned_frame, + s->pp_time, s->pb_time); /* the second part of the wmv2 header contains the MB skip bits which * are stored in current_picture->mb_type which is not available before diff --git a/libavcodec/mpeg_er.c b/libavcodec/mpeg_er.c index 951167a478..5df75d8e85 100644 --- a/libavcodec/mpeg_er.c +++ b/libavcodec/mpeg_er.c @@ -51,10 +51,7 @@ void ff_mpeg_er_frame_start(MpegEncContext *s) set_erpic(&er->next_pic, s->next_pic.ptr); set_erpic(&er->last_pic, s->last_pic.ptr); - er->pp_time = s->pp_time; - er->pb_time = s->pb_time; er->quarter_sample = s->quarter_sample; - er->partitioned_frame = s->partitioned_frame; ff_er_frame_start(er); } diff --git a/libavcodec/mpeg_er.h b/libavcodec/mpeg_er.h index bb627a4d06..145d1866ed 100644 --- a/libavcodec/mpeg_er.h +++ b/libavcodec/mpeg_er.h @@ -24,4 +24,13 @@ int ff_mpeg_er_init(MpegEncContext *s); void ff_mpeg_er_frame_start(MpegEncContext *s); +static inline void ff_mpv_er_frame_start_ext(MPVContext *const s, int partitioned_frame, + uint16_t pp_time, uint16_t pb_time) +{ + s->er.partitioned_frame = partitioned_frame; + s->er.pp_time = pp_time; + s->er.pb_time = pb_time; + ff_mpeg_er_frame_start(s); +} + #endif /* AVCODEC_MPEG_ER_H */ diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index ed702dfb66..677db1cd42 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -451,7 +451,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf, } if ((ret = ff_mpv_frame_start(&h->c, avctx)) < 0) return ret; - ff_mpeg_er_frame_start(&h->c); + ff_mpv_er_frame_start_ext(&h->c, 0, h->c.pp_time, h->c.pb_time); } else { if (h->c.cur_pic.ptr->f->pict_type != h->c.pict_type) { av_log(h->c.avctx, AV_LOG_ERROR, "Slice type mismatch\n"); -- ffmpeg-codebot _______________________________________________ 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".