Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH] lavc/videotoolbox: drop HEVC cropping from start_frame rather than end_frame
@ 2024-07-23  7:36 Anton Khirnov
  2024-07-23 10:42 ` epirat07
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Khirnov @ 2024-07-23  7:36 UTC (permalink / raw)
  To: ffmpeg-devel

HEVCContext.output_frame will be removed in following commits.

Reported-By: Max Bykov
---
Untested, testing welcome.

Cf. '[PATCH 37/39] lavc/hevcdec: use a ContainerFifo to hold frames
scheduled for output' currently on ML.
---
 libavcodec/videotoolbox.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
index 3dd804bb0c..505483ef66 100644
--- a/libavcodec/videotoolbox.c
+++ b/libavcodec/videotoolbox.c
@@ -1053,6 +1053,14 @@ static int videotoolbox_hevc_start_frame(AVCodecContext *avctx,
                                          const uint8_t *buffer,
                                          uint32_t size)
 {
+    HEVCContext *h = avctx->priv_data;
+    AVFrame *frame = h->cur_frame->f;
+
+    frame->crop_right  = 0;
+    frame->crop_left   = 0;
+    frame->crop_top    = 0;
+    frame->crop_bottom = 0;
+
     return 0;
 }
 
@@ -1079,11 +1087,6 @@ static int videotoolbox_hevc_end_frame(AVCodecContext *avctx)
     VTContext *vtctx = avctx->internal->hwaccel_priv_data;
     int ret;
 
-    h->output_frame->crop_right = 0;
-    h->output_frame->crop_left = 0;
-    h->output_frame->crop_top = 0;
-    h->output_frame->crop_bottom = 0;
-
     ret = ff_videotoolbox_common_end_frame(avctx, frame);
     vtctx->bitstream_size = 0;
     return ret;
-- 
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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [FFmpeg-devel] [PATCH] lavc/videotoolbox: drop HEVC cropping from start_frame rather than end_frame
  2024-07-23  7:36 [FFmpeg-devel] [PATCH] lavc/videotoolbox: drop HEVC cropping from start_frame rather than end_frame Anton Khirnov
@ 2024-07-23 10:42 ` epirat07
  0 siblings, 0 replies; 2+ messages in thread
From: epirat07 @ 2024-07-23 10:42 UTC (permalink / raw)
  To: FFmpeg development discussions and patches



On 23 Jul 2024, at 9:36, Anton Khirnov wrote:

> HEVCContext.output_frame will be removed in following commits.
>
> Reported-By: Max Bykov
> ---
> Untested, testing welcome.

Tested with fate-hevc-conformance-CONFWIN_A_Sony_1 and works.

LGTM

>
> Cf. '[PATCH 37/39] lavc/hevcdec: use a ContainerFifo to hold frames
> scheduled for output' currently on ML.
> ---
>  libavcodec/videotoolbox.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
>
> diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c
> index 3dd804bb0c..505483ef66 100644
> --- a/libavcodec/videotoolbox.c
> +++ b/libavcodec/videotoolbox.c
> @@ -1053,6 +1053,14 @@ static int videotoolbox_hevc_start_frame(AVCodecContext *avctx,
>                                           const uint8_t *buffer,
>                                           uint32_t size)
>  {
> +    HEVCContext *h = avctx->priv_data;
> +    AVFrame *frame = h->cur_frame->f;
> +
> +    frame->crop_right  = 0;
> +    frame->crop_left   = 0;
> +    frame->crop_top    = 0;
> +    frame->crop_bottom = 0;
> +
>      return 0;
>  }
>
> @@ -1079,11 +1087,6 @@ static int videotoolbox_hevc_end_frame(AVCodecContext *avctx)
>      VTContext *vtctx = avctx->internal->hwaccel_priv_data;
>      int ret;
>
> -    h->output_frame->crop_right = 0;
> -    h->output_frame->crop_left = 0;
> -    h->output_frame->crop_top = 0;
> -    h->output_frame->crop_bottom = 0;
> -
>      ret = ff_videotoolbox_common_end_frame(avctx, frame);
>      vtctx->bitstream_size = 0;
>      return ret;
> -- 
> 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".
_______________________________________________
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".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-23 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-23  7:36 [FFmpeg-devel] [PATCH] lavc/videotoolbox: drop HEVC cropping from start_frame rather than end_frame Anton Khirnov
2024-07-23 10:42 ` epirat07

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git