Re: [FFmpeg-devel] [PATCH 2/2] vulkan_decode: convert max level from vulkan to av for comparisons

2023-09-07 Thread Lynne
Sep 6, 2023, 06:21 by d...@lynne.ee:

> The spec finally clarified the meaning of the field to:
>
>> maxLevelIdc is a StdVideoH264LevelIdc value specifying the maximum H.264 
>> level supported by the profile, where enum constant 
>> STD_VIDEO_H264_LEVEL_IDC__ identifies H.264 level 
>> . as defined in section A.3 of the ITU-T H.264 Specification.1
>>
>
> Annoyingly, we have to convert it to an IDC value to compare it.
> Mesa commit:
> https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24649
> Only mesa currently uses the IDC value, all other drivers use the enum.
>
> Patch attached.
>

Pushed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v4 2/2] lavc/videotoolboxenc: Get the encoder supported properties

2023-09-07 Thread Jun Zhao
Get the encoder supported properties list, it will be used for
feature support checks.

Signed-off-by: Jun Zhao 
---
 libavcodec/videotoolboxenc.c | 72 
 1 file changed, 49 insertions(+), 23 deletions(-)

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 2e96990741..1d1595329a 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -232,6 +232,7 @@ typedef struct VTEncContext {
 AVClass *class;
 enum AVCodecID codec_id;
 VTCompressionSessionRef session;
+CFDictionaryRef supported_props;
 CFStringRef ycbcr_matrix;
 CFStringRef color_primaries;
 CFStringRef transfer_function;
@@ -321,6 +322,34 @@ static void clear_frame_queue(VTEncContext *vtctx)
 set_async_error(vtctx, 0);
 }
 
+static void vtenc_reset(VTEncContext *vtctx)
+{
+if (vtctx->session) {
+CFRelease(vtctx->session);
+vtctx->session = NULL;
+}
+
+if (vtctx->supported_props) {
+CFRelease(vtctx->supported_props);
+vtctx->supported_props = NULL;
+}
+
+if (vtctx->color_primaries) {
+CFRelease(vtctx->color_primaries);
+vtctx->color_primaries = NULL;
+}
+
+if (vtctx->transfer_function) {
+CFRelease(vtctx->transfer_function);
+vtctx->transfer_function = NULL;
+}
+
+if (vtctx->ycbcr_matrix) {
+CFRelease(vtctx->ycbcr_matrix);
+vtctx->ycbcr_matrix = NULL;
+}
+}
+
 static int vtenc_q_pop(VTEncContext *vtctx, bool wait, CMSampleBufferRef *buf, 
ExtraSEI **sei)
 {
 BufNode *info;
@@ -1110,6 +1139,22 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
 return AVERROR_EXTERNAL;
 }
 
+#if defined (MAC_OS_X_VERSION_10_13) && (MAC_OS_X_VERSION_MAX_ALLOWED >= 
MAC_OS_X_VERSION_10_13)
+if (__builtin_available(macOS 10.13, *)) {
+status = VTCopySupportedPropertyDictionaryForEncoder(avctx->width,
+ avctx->height,
+ codec_type,
+ enc_info,
+ NULL,
+ 
>supported_props);
+
+if (status != noErr) {
+av_log(avctx, AV_LOG_ERROR,"Error retrieving the supported 
property dictionary err=%"PRId64"\n", (int64_t)status);
+return AVERROR_EXTERNAL;
+}
+}
+#endif
+
 // Dump the init encoder
 {
 CFStringRef encoderID = NULL;
@@ -1662,7 +1707,6 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
 // It can happen when user set avctx->profile directly.
 if (vtctx->profile == AV_PROFILE_UNKNOWN)
 vtctx->profile = avctx->profile;
-vtctx->session = NULL;
 status = vtenc_configure_encoder(avctx);
 if (status) return status;
 
@@ -2431,8 +2475,8 @@ static int create_cv_pixel_buffer(AVCodecContext   *avctx,
 
 vtstatus = VTCompressionSessionPrepareToEncodeFrames(vtctx->session);
 if (vtstatus == kVTInvalidSessionErr) {
-CFRelease(vtctx->session);
-vtctx->session = NULL;
+vtenc_reset(vtctx);
+
 status = vtenc_configure_encoder(avctx);
 if (status == 0)
 pix_buf_pool = 
VTCompressionSessionGetPixelBufferPool(vtctx->session);
@@ -2688,10 +2732,7 @@ static int vtenc_populate_extradata(AVCodecContext   
*avctx,
 
 pe_cleanup:
 CVPixelBufferRelease(pix_buf);
-if(vtctx->session)
-CFRelease(vtctx->session);
-
-vtctx->session = NULL;
+vtenc_reset(vtctx);
 vtctx->frame_ct_out = 0;
 
 av_assert0(status != 0 || (avctx->extradata && avctx->extradata_size > 0));
@@ -2714,23 +2755,8 @@ static av_cold int vtenc_close(AVCodecContext *avctx)
 clear_frame_queue(vtctx);
 pthread_cond_destroy(>cv_sample_sent);
 pthread_mutex_destroy(>lock);
-CFRelease(vtctx->session);
-vtctx->session = NULL;
-
-if (vtctx->color_primaries) {
-CFRelease(vtctx->color_primaries);
-vtctx->color_primaries = NULL;
-}
 
-if (vtctx->transfer_function) {
-CFRelease(vtctx->transfer_function);
-vtctx->transfer_function = NULL;
-}
-
-if (vtctx->ycbcr_matrix) {
-CFRelease(vtctx->ycbcr_matrix);
-vtctx->ycbcr_matrix = NULL;
-}
+vtenc_reset(vtctx);
 
 return 0;
 }
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v4 1/2] lavc/videotoolboxenc: Dump the encoder

2023-09-07 Thread Jun Zhao
Dump the encoder, it's will help debug some case

Signed-off-by: Jun Zhao 
---
 libavcodec/videotoolboxenc.c | 28 
 1 file changed, 28 insertions(+)

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index d0a00347b5..2e96990741 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1110,6 +1110,34 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
 return AVERROR_EXTERNAL;
 }
 
+// Dump the init encoder
+{
+CFStringRef encoderID = NULL;
+status = VTSessionCopyProperty(vtctx->session,
+   kVTCompressionPropertyKey_EncoderID,
+   kCFAllocatorDefault,
+   );
+if (status == noErr) {
+CFIndex length   = CFStringGetLength(encoderID);
+CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, 
kCFStringEncodingUTF8);
+char *name   = av_malloc(max_size);
+if (!name) {
+CFRelease(encoderID);
+return AVERROR(ENOMEM);
+}
+
+CFStringGetCString(encoderID,
+   name,
+   max_size,
+   kCFStringEncodingUTF8);
+av_log(avctx, AV_LOG_DEBUG, "Init the encoder: %s\n", name);
+
+av_freep();
+}
+if (encoderID != NULL)
+CFRelease(encoderID);
+}
+
 if (avctx->flags & AV_CODEC_FLAG_QSCALE && !vtenc_qscale_enabled()) {
 av_log(avctx, AV_LOG_ERROR, "Error: -q:v qscale not available for 
encoder. Use -b:v bitrate instead.\n");
 return AVERROR_EXTERNAL;
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 2/2] lavc/videotoolboxenc: Get the encoder supported properties

2023-09-07 Thread myp...@gmail.com
On Fri, Sep 8, 2023 at 11:15 AM Marvin Scholz  wrote:
>
>
>
> On 8 Sep 2023, at 4:55, Jun Zhao wrote:
>
> > Get the encoder supported properties list, it will be used for
> > feature support checks.
> >
> > Signed-off-by: Jun Zhao 
> > ---
> >  libavcodec/videotoolboxenc.c | 70 
> >  1 file changed, 47 insertions(+), 23 deletions(-)
> >
> > diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> > index 2e96990741..832147b6cd 100644
> > --- a/libavcodec/videotoolboxenc.c
> > +++ b/libavcodec/videotoolboxenc.c
> > @@ -232,6 +232,7 @@ typedef struct VTEncContext {
> >  AVClass *class;
> >  enum AVCodecID codec_id;
> >  VTCompressionSessionRef session;
> > +CFDictionaryRef supported_props;
> >  CFStringRef ycbcr_matrix;
> >  CFStringRef color_primaries;
> >  CFStringRef transfer_function;
> > @@ -321,6 +322,34 @@ static void clear_frame_queue(VTEncContext *vtctx)
> >  set_async_error(vtctx, 0);
> >  }
> >
> > +static void vtenc_reset(VTEncContext *vtctx)
> > +{
> > +if (vtctx->session) {
> > +CFRelease(vtctx->session);
> > +vtctx->session = NULL;
> > +}
> > +
> > +if (vtctx->supported_props) {
> > +CFRelease(vtctx->supported_props);
> > +vtctx->supported_props = NULL;
> > +}
> > +
> > +if (vtctx->color_primaries) {
> > +CFRelease(vtctx->color_primaries);
> > +vtctx->color_primaries = NULL;
> > +}
> > +
> > +if (vtctx->transfer_function) {
> > +CFRelease(vtctx->transfer_function);
> > +vtctx->transfer_function = NULL;
> > +}
> > +
> > +if (vtctx->ycbcr_matrix) {
> > +CFRelease(vtctx->ycbcr_matrix);
> > +vtctx->ycbcr_matrix = NULL;
> > +}
> > +}
> > +
> >  static int vtenc_q_pop(VTEncContext *vtctx, bool wait, CMSampleBufferRef 
> > *buf, ExtraSEI **sei)
> >  {
> >  BufNode *info;
> > @@ -1110,6 +1139,20 @@ static int vtenc_create_encoder(AVCodecContext   
> > *avctx,
> >  return AVERROR_EXTERNAL;
> >  }
> >
> > +if (__builtin_available(macOS 10.13, iOS 11, tvOS 11, *)) {
>
> Thanks, though this needs the proper SDK guards as well too, to not break
> building with SDKs older than 10.13, unless FFmpeg does not care about this.
>
> See 
> https://epir.at/2019/10/30/api-availability-and-target-conditionals/#checking-api-availability-at-compile-time
>
Thx the reference link, will add the build check
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v3 2/2] lavc/videotoolboxenc: Get the encoder supported properties

2023-09-07 Thread Marvin Scholz



On 8 Sep 2023, at 4:55, Jun Zhao wrote:

> Get the encoder supported properties list, it will be used for
> feature support checks.
>
> Signed-off-by: Jun Zhao 
> ---
>  libavcodec/videotoolboxenc.c | 70 
>  1 file changed, 47 insertions(+), 23 deletions(-)
>
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index 2e96990741..832147b6cd 100644
> --- a/libavcodec/videotoolboxenc.c
> +++ b/libavcodec/videotoolboxenc.c
> @@ -232,6 +232,7 @@ typedef struct VTEncContext {
>  AVClass *class;
>  enum AVCodecID codec_id;
>  VTCompressionSessionRef session;
> +CFDictionaryRef supported_props;
>  CFStringRef ycbcr_matrix;
>  CFStringRef color_primaries;
>  CFStringRef transfer_function;
> @@ -321,6 +322,34 @@ static void clear_frame_queue(VTEncContext *vtctx)
>  set_async_error(vtctx, 0);
>  }
>
> +static void vtenc_reset(VTEncContext *vtctx)
> +{
> +if (vtctx->session) {
> +CFRelease(vtctx->session);
> +vtctx->session = NULL;
> +}
> +
> +if (vtctx->supported_props) {
> +CFRelease(vtctx->supported_props);
> +vtctx->supported_props = NULL;
> +}
> +
> +if (vtctx->color_primaries) {
> +CFRelease(vtctx->color_primaries);
> +vtctx->color_primaries = NULL;
> +}
> +
> +if (vtctx->transfer_function) {
> +CFRelease(vtctx->transfer_function);
> +vtctx->transfer_function = NULL;
> +}
> +
> +if (vtctx->ycbcr_matrix) {
> +CFRelease(vtctx->ycbcr_matrix);
> +vtctx->ycbcr_matrix = NULL;
> +}
> +}
> +
>  static int vtenc_q_pop(VTEncContext *vtctx, bool wait, CMSampleBufferRef 
> *buf, ExtraSEI **sei)
>  {
>  BufNode *info;
> @@ -1110,6 +1139,20 @@ static int vtenc_create_encoder(AVCodecContext   
> *avctx,
>  return AVERROR_EXTERNAL;
>  }
>
> +if (__builtin_available(macOS 10.13, iOS 11, tvOS 11, *)) {

Thanks, though this needs the proper SDK guards as well too, to not break
building with SDKs older than 10.13, unless FFmpeg does not care about this.

See 
https://epir.at/2019/10/30/api-availability-and-target-conditionals/#checking-api-availability-at-compile-time

> +status = VTCopySupportedPropertyDictionaryForEncoder(avctx->width,
> + avctx->height,
> + codec_type,
> + enc_info,
> + NULL,
> + 
> >supported_props);
> +
> +if (status != noErr) {
> +av_log(avctx, AV_LOG_ERROR,"Error retrieving the supported 
> property dictionary err=%"PRId64"\n", (int64_t)status);
> +return AVERROR_EXTERNAL;
> +}
> +}
> +
>  // Dump the init encoder
>  {
>  CFStringRef encoderID = NULL;
> @@ -1662,7 +1705,6 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
>  // It can happen when user set avctx->profile directly.
>  if (vtctx->profile == AV_PROFILE_UNKNOWN)
>  vtctx->profile = avctx->profile;
> -vtctx->session = NULL;
>  status = vtenc_configure_encoder(avctx);
>  if (status) return status;
>
> @@ -2431,8 +2473,8 @@ static int create_cv_pixel_buffer(AVCodecContext   
> *avctx,
>
>  vtstatus = VTCompressionSessionPrepareToEncodeFrames(vtctx->session);
>  if (vtstatus == kVTInvalidSessionErr) {
> -CFRelease(vtctx->session);
> -vtctx->session = NULL;
> +vtenc_reset(vtctx);
> +
>  status = vtenc_configure_encoder(avctx);
>  if (status == 0)
>  pix_buf_pool = 
> VTCompressionSessionGetPixelBufferPool(vtctx->session);
> @@ -2688,10 +2730,7 @@ static int vtenc_populate_extradata(AVCodecContext   
> *avctx,
>
>  pe_cleanup:
>  CVPixelBufferRelease(pix_buf);
> -if(vtctx->session)
> -CFRelease(vtctx->session);
> -
> -vtctx->session = NULL;
> +vtenc_reset(vtctx);
>  vtctx->frame_ct_out = 0;
>
>  av_assert0(status != 0 || (avctx->extradata && avctx->extradata_size > 
> 0));
> @@ -2714,23 +2753,8 @@ static av_cold int vtenc_close(AVCodecContext *avctx)
>  clear_frame_queue(vtctx);
>  pthread_cond_destroy(>cv_sample_sent);
>  pthread_mutex_destroy(>lock);
> -CFRelease(vtctx->session);
> -vtctx->session = NULL;
> -
> -if (vtctx->color_primaries) {
> -CFRelease(vtctx->color_primaries);
> -vtctx->color_primaries = NULL;
> -}
>
> -if (vtctx->transfer_function) {
> -CFRelease(vtctx->transfer_function);
> -vtctx->transfer_function = NULL;
> -}
> -
> -if (vtctx->ycbcr_matrix) {
> -CFRelease(vtctx->ycbcr_matrix);
> -vtctx->ycbcr_matrix = NULL;
> -}
> +vtenc_reset(vtctx);
>
>  return 0;
>  }
> -- 
> 2.25.1
>
> 

[FFmpeg-devel] [PATCH v3 2/2] lavc/videotoolboxenc: Get the encoder supported properties

2023-09-07 Thread Jun Zhao
Get the encoder supported properties list, it will be used for
feature support checks.

Signed-off-by: Jun Zhao 
---
 libavcodec/videotoolboxenc.c | 70 
 1 file changed, 47 insertions(+), 23 deletions(-)

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index 2e96990741..832147b6cd 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -232,6 +232,7 @@ typedef struct VTEncContext {
 AVClass *class;
 enum AVCodecID codec_id;
 VTCompressionSessionRef session;
+CFDictionaryRef supported_props;
 CFStringRef ycbcr_matrix;
 CFStringRef color_primaries;
 CFStringRef transfer_function;
@@ -321,6 +322,34 @@ static void clear_frame_queue(VTEncContext *vtctx)
 set_async_error(vtctx, 0);
 }
 
+static void vtenc_reset(VTEncContext *vtctx)
+{
+if (vtctx->session) {
+CFRelease(vtctx->session);
+vtctx->session = NULL;
+}
+
+if (vtctx->supported_props) {
+CFRelease(vtctx->supported_props);
+vtctx->supported_props = NULL;
+}
+
+if (vtctx->color_primaries) {
+CFRelease(vtctx->color_primaries);
+vtctx->color_primaries = NULL;
+}
+
+if (vtctx->transfer_function) {
+CFRelease(vtctx->transfer_function);
+vtctx->transfer_function = NULL;
+}
+
+if (vtctx->ycbcr_matrix) {
+CFRelease(vtctx->ycbcr_matrix);
+vtctx->ycbcr_matrix = NULL;
+}
+}
+
 static int vtenc_q_pop(VTEncContext *vtctx, bool wait, CMSampleBufferRef *buf, 
ExtraSEI **sei)
 {
 BufNode *info;
@@ -1110,6 +1139,20 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
 return AVERROR_EXTERNAL;
 }
 
+if (__builtin_available(macOS 10.13, iOS 11, tvOS 11, *)) {
+status = VTCopySupportedPropertyDictionaryForEncoder(avctx->width,
+ avctx->height,
+ codec_type,
+ enc_info,
+ NULL,
+ 
>supported_props);
+
+if (status != noErr) {
+av_log(avctx, AV_LOG_ERROR,"Error retrieving the supported 
property dictionary err=%"PRId64"\n", (int64_t)status);
+return AVERROR_EXTERNAL;
+}
+}
+
 // Dump the init encoder
 {
 CFStringRef encoderID = NULL;
@@ -1662,7 +1705,6 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
 // It can happen when user set avctx->profile directly.
 if (vtctx->profile == AV_PROFILE_UNKNOWN)
 vtctx->profile = avctx->profile;
-vtctx->session = NULL;
 status = vtenc_configure_encoder(avctx);
 if (status) return status;
 
@@ -2431,8 +2473,8 @@ static int create_cv_pixel_buffer(AVCodecContext   *avctx,
 
 vtstatus = VTCompressionSessionPrepareToEncodeFrames(vtctx->session);
 if (vtstatus == kVTInvalidSessionErr) {
-CFRelease(vtctx->session);
-vtctx->session = NULL;
+vtenc_reset(vtctx);
+
 status = vtenc_configure_encoder(avctx);
 if (status == 0)
 pix_buf_pool = 
VTCompressionSessionGetPixelBufferPool(vtctx->session);
@@ -2688,10 +2730,7 @@ static int vtenc_populate_extradata(AVCodecContext   
*avctx,
 
 pe_cleanup:
 CVPixelBufferRelease(pix_buf);
-if(vtctx->session)
-CFRelease(vtctx->session);
-
-vtctx->session = NULL;
+vtenc_reset(vtctx);
 vtctx->frame_ct_out = 0;
 
 av_assert0(status != 0 || (avctx->extradata && avctx->extradata_size > 0));
@@ -2714,23 +2753,8 @@ static av_cold int vtenc_close(AVCodecContext *avctx)
 clear_frame_queue(vtctx);
 pthread_cond_destroy(>cv_sample_sent);
 pthread_mutex_destroy(>lock);
-CFRelease(vtctx->session);
-vtctx->session = NULL;
-
-if (vtctx->color_primaries) {
-CFRelease(vtctx->color_primaries);
-vtctx->color_primaries = NULL;
-}
 
-if (vtctx->transfer_function) {
-CFRelease(vtctx->transfer_function);
-vtctx->transfer_function = NULL;
-}
-
-if (vtctx->ycbcr_matrix) {
-CFRelease(vtctx->ycbcr_matrix);
-vtctx->ycbcr_matrix = NULL;
-}
+vtenc_reset(vtctx);
 
 return 0;
 }
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3 1/2] lavc/videotoolboxenc: Dump the encoder

2023-09-07 Thread Jun Zhao
Dump the encoder, it's will help debug some case

Signed-off-by: Jun Zhao 
---
 libavcodec/videotoolboxenc.c | 28 
 1 file changed, 28 insertions(+)

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index d0a00347b5..2e96990741 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1110,6 +1110,34 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
 return AVERROR_EXTERNAL;
 }
 
+// Dump the init encoder
+{
+CFStringRef encoderID = NULL;
+status = VTSessionCopyProperty(vtctx->session,
+   kVTCompressionPropertyKey_EncoderID,
+   kCFAllocatorDefault,
+   );
+if (status == noErr) {
+CFIndex length   = CFStringGetLength(encoderID);
+CFIndex max_size = CFStringGetMaximumSizeForEncoding(length, 
kCFStringEncodingUTF8);
+char *name   = av_malloc(max_size);
+if (!name) {
+CFRelease(encoderID);
+return AVERROR(ENOMEM);
+}
+
+CFStringGetCString(encoderID,
+   name,
+   max_size,
+   kCFStringEncodingUTF8);
+av_log(avctx, AV_LOG_DEBUG, "Init the encoder: %s\n", name);
+
+av_freep();
+}
+if (encoderID != NULL)
+CFRelease(encoderID);
+}
+
 if (avctx->flags & AV_CODEC_FLAG_QSCALE && !vtenc_qscale_enabled()) {
 av_log(avctx, AV_LOG_ERROR, "Error: -q:v qscale not available for 
encoder. Use -b:v bitrate instead.\n");
 return AVERROR_EXTERNAL;
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v3] avcodec/av1dec: export pixel format even if no hardware decoder is present

2023-09-07 Thread James Almer
And remove the AVOID_PROBING flag, given it's the last av1 decoder to be tested
either way.
This fixes a regression introduced in 1652f2492f88434010053289d946dab6a57e4d58,
where even if forcing the native av1 decoder, if another decoder was present,
like libdav1d or libaom-av1, they'd be used for probing and some fate tests
would have different results.

Signed-off-by: James Almer 
---
 libavcodec/av1dec.c | 41 -
 tests/fate-run.sh   | 11 +
 tests/fate/flvenc.mak   |  4 ++--
 tests/fate/lavf-container.mak   |  8 +++
 tests/fate/mpegps.mak   |  2 +-
 tests/ref/fate/av1-annexb-demux |  2 +-
 tests/ref/lavf-fate/av1.mkv |  4 ++--
 tests/ref/lavf-fate/av1.mp4 |  4 ++--
 8 files changed, 43 insertions(+), 33 deletions(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index ec8401f4e0..8f9c2dfefb 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -440,20 +440,11 @@ static int get_tiles_info(AVCodecContext *avctx, const 
AV1RawTileGroup *tile_gro
 
 }
 
-static int get_pixel_format(AVCodecContext *avctx)
+static enum AVPixelFormat get_sw_pixel_format(AVCodecContext *avctx,
+  const AV1RawSequenceHeader *seq)
 {
-AV1DecContext *s = avctx->priv_data;
-const AV1RawSequenceHeader *seq = s->raw_seq;
 uint8_t bit_depth;
-int ret;
 enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
-#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \
- CONFIG_AV1_D3D11VA_HWACCEL * 2 + \
- CONFIG_AV1_NVDEC_HWACCEL + \
- CONFIG_AV1_VAAPI_HWACCEL + \
- CONFIG_AV1_VDPAU_HWACCEL + \
- CONFIG_AV1_VULKAN_HWACCEL)
-enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
 
 if (seq->seq_profile == 2 && seq->color_config.high_bitdepth)
 bit_depth = seq->color_config.twelve_bit ? 12 : 10;
@@ -509,8 +500,22 @@ static int get_pixel_format(AVCodecContext *avctx)
 av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n");
 }
 
-av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n",
-   av_get_pix_fmt_name(pix_fmt));
+return pix_fmt;
+}
+
+static int get_pixel_format(AVCodecContext *avctx)
+{
+AV1DecContext *s = avctx->priv_data;
+const AV1RawSequenceHeader *seq = s->raw_seq;
+int ret;
+enum AVPixelFormat pix_fmt = get_sw_pixel_format(avctx, seq);
+#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \
+ CONFIG_AV1_D3D11VA_HWACCEL * 2 + \
+ CONFIG_AV1_NVDEC_HWACCEL + \
+ CONFIG_AV1_VAAPI_HWACCEL + \
+ CONFIG_AV1_VDPAU_HWACCEL + \
+ CONFIG_AV1_VULKAN_HWACCEL)
+enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
 
 if (pix_fmt == AV_PIX_FMT_NONE)
 return -1;
@@ -609,8 +614,6 @@ static int get_pixel_format(AVCodecContext *avctx)
 *fmtp = AV_PIX_FMT_NONE;
 
 ret = ff_thread_get_format(avctx, pix_fmts);
-if (ret < 0)
-return ret;
 
 /**
  * check if the HW accel is inited correctly. If not, return 
un-implemented.
@@ -620,12 +623,16 @@ static int get_pixel_format(AVCodecContext *avctx)
 if (!avctx->hwaccel) {
 av_log(avctx, AV_LOG_ERROR, "Your platform doesn't support"
" hardware accelerated AV1 decoding.\n");
+avctx->pix_fmt = AV_PIX_FMT_NONE;
 return AVERROR(ENOSYS);
 }
 
 s->pix_fmt = pix_fmt;
 avctx->pix_fmt = ret;
 
+av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n",
+   av_get_pix_fmt_name(avctx->pix_fmt));
+
 return 0;
 }
 
@@ -865,6 +872,8 @@ static av_cold int av1_decode_init(AVCodecContext *avctx)
 goto end;
 }
 
+avctx->pix_fmt = get_sw_pixel_format(avctx, seq);
+
 end:
 ff_cbs_fragment_reset(>current_obu);
 }
@@ -1518,7 +1527,7 @@ const FFCodec ff_av1_decoder = {
 .init  = av1_decode_init,
 .close = av1_decode_free,
 FF_CODEC_RECEIVE_FRAME_CB(av1_receive_frame),
-.p.capabilities= AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
+.p.capabilities= AV_CODEC_CAP_DR1,
 .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
 .flush = av1_decode_flush,
 .p.profiles= NULL_IF_CONFIG_SMALL(ff_av1_profiles),
diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 5a71ac001e..743d9b3620 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -275,15 +275,16 @@ transcode(){
 stream_remux(){
 src_fmt=$1
 srcfile=$2
-enc_fmt=$3
-stream_maps=$4
-final_decode=$5
-ffprobe_opts=$6
+src_opts=$3
+enc_fmt=$4
+stream_maps=$5
+final_decode=$6
+ffprobe_opts=$7
 encfile="${outdir}/${test}.${enc_fmt}"
 test $keep -ge 1 || cleanfiles="$cleanfiles $encfile"
 tsrcfile=$(target_path $srcfile)
 

Re: [FFmpeg-devel] [PATCH v2] avcodec/av1dec: export pixel format even if no hardware decoder is present

2023-09-07 Thread Michael Niedermayer
On Thu, Sep 07, 2023 at 02:55:25PM -0300, James Almer wrote:
> And remove the AVOID_PROBING flag, given it's the last av1 decoder to be 
> tested
> either way.
> This fixes a regression introduced in 
> 1652f2492f88434010053289d946dab6a57e4d58,
> where even if forcing the native av1 decoder, if another decoder was present,
> like libdav1d or libaom-av1, they'd be used for probing and some fate tests
> would have different results.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/av1dec.c | 50 -
>  tests/fate/lavf-container.mak   |  8 +++---
>  tests/ref/fate/av1-annexb-demux |  2 +-
>  tests/ref/lavf-fate/av1.mkv |  4 +--
>  tests/ref/lavf-fate/av1.mp4 |  4 +--
>  5 files changed, 39 insertions(+), 29 deletions(-)

breaks some fate tests like:
make fate-cbs-av1-non_uniform_tiling
TESTcbs-av1-non_uniform_tiling
--- ./tests/ref/fate/cbs-av1-non_uniform_tiling 2023-09-07 20:08:32.252582673 
+0200
+++ tests/data/fate/cbs-av1-non_uniform_tiling  2023-09-08 01:40:11.103091424 
+0200
@@ -1 +0,0 @@
-3e204ee8a71273cf0247f48e977e64b7
Test cbs-av1-non_uniform_tiling failed. Look at 
tests/data/fate/cbs-av1-non_uniform_tiling.err for details.
tests/Makefile:308: recipe for target 'fate-cbs-av1-non_uniform_tiling' failed
make: *** [fate-cbs-av1-non_uniform_tiling] Error 134

V=2 output:
Assertion n >= 1 failed at libavcodec/decode.c:1274
Aborted (core dumped)
threads=1
tests/Makefile:308: recipe for target 'fate-cbs-av1-non_uniform_tiling' failed
make: *** [fate-cbs-av1-non_uniform_tiling] Error 134



[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 1/2] configure: don't force specific C++ standard library linking

2023-09-07 Thread Timo Rothenpieler via ffmpeg-devel

On 07.09.2023 23:38, Kacper Michajlow wrote:

On Thu, 7 Sept 2023 at 15:12, Derek Buitenhuis
 wrote:


On 9/6/2023 6:31 PM, Kacper Michajlow wrote:

What would be a downside of preferring CXX always if it exists?


FFmpeg runs in a multitude of environments with a multitude of portability
requirements. Needlessly linking a C++ runtime is not OK.


This does not answer my question. Let me rephrase. Do we know the case
where using C++ compiler driver rather than C would degrade the
quality of the resulting build?

Using C++ driver would indeed append the (correct) runtime library to
the linker command, but if nothing references any symbols from it it
would not be linked. It is also why the current way of forcing
`lstdc++` kinda works, because it is silently ignored when not needed.

Implementing logic to use C++ only when necessary is possible, but I'm
not a big fan of such automation. And in practice not sure how well it
would work, because it would require trying to link twice every
dependency in configure.

Also the fact that "FFmpeg runs in a multitude of environment" is
precisely why I really don't like the current unconditional including
`-lstdc++`.


Couldn't you just check if stdc++ is in the ldflags/extralibs, and if 
so, remove it, and use g++ to link?

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] read_xbits: request fewer bits

2023-09-07 Thread Andreas Rheinhardt
Christophe Gisquet:
> This would have also helped a bitstream reader with a cache
> of 32 bits.
> ---
>  libavcodec/bitstream_template.h | 14 --
>  1 file changed, 12 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/bitstream_template.h b/libavcodec/bitstream_template.h
> index 3f90fc6a07..c27e8108b2 100644
> --- a/libavcodec/bitstream_template.h
> +++ b/libavcodec/bitstream_template.h
> @@ -423,8 +423,18 @@ static inline const uint8_t *BS_FUNC(align)(BSCTX *bc)
>   */
>  static inline int BS_FUNC(read_xbits)(BSCTX *bc, unsigned int n)
>  {
> -int32_t cache = BS_FUNC(peek)(bc, 32);
> -int sign = ~cache >> 31;
> +int32_t cache;
> +int sign;
> +
> +if (n > bc->bits_valid)
> +BS_FUNC(priv_refill_32)(bc);
> +
> +#if defined(BITSTREAM_READER_LE)
> +cache = bc->bits & 0x;
> +#else
> +cache = bc->bits >> 32;
> +#endif
> +sign = ~cache >> 31;
>  BS_FUNC(skip_remaining)(bc, n);
>  
>  return uint32_t)(sign ^ cache)) >> (32 - n)) ^ sign) - sign;

Great, this function has the same issue at the end of input as read_vlc.

- Andreas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/2] Expose and start using skip_remaining

2023-09-07 Thread Andreas Rheinhardt
Christophe Gisquet:
> Bitstream readers sometimes have already checked there are enough
> bits, and the check is redundant.

This patch aims to do two things; and these should be in separate
patches so that one can see immediately where you just change the name
and where you change the actual code.

> ---
>  libavcodec/bitstream.h  |  8 +---
>  libavcodec/bitstream_template.h | 22 +++---
>  libavcodec/get_bits.h   |  1 +
>  3 files changed, 17 insertions(+), 14 deletions(-)
> 
> diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h
> index 35b7873b9c..dd043fb349 100644
> --- a/libavcodec/bitstream.h
> +++ b/libavcodec/bitstream.h
> @@ -95,6 +95,7 @@
>  # define bits_peek_signed   bits_peek_signed_le
>  # define bits_peek_signed_nz bits_peek_signed_nz_le
>  # define bits_skip  bits_skip_le
> +# define bits_skip_remaining bits_skip_remaining_le
>  # define bits_seek  bits_seek_le
>  # define bits_align bits_align_le
>  # define bits_read_xbitsbits_read_xbits_le
> @@ -124,6 +125,7 @@
>  # define bits_peek_signed   bits_peek_signed_be
>  # define bits_peek_signed_nz bits_peek_signed_nz_be
>  # define bits_skip  bits_skip_be
> +# define bits_skip_remaining bits_skip_remaining_be
>  # define bits_seek  bits_seek_be
>  # define bits_align bits_align_be
>  # define bits_read_xbitsbits_read_xbits_be
> @@ -146,7 +148,7 @@
>  n = table[index].len;   \
>  \
>  if (max_depth > 1 && n < 0) {   \
> -bits_skip(bc, bits);\
> +skip_remaining(bc, bits);   \

This is problematic, because you seem to think that bits_peek(bc, bits)
ensures that there are at least `bits` available in the cache; yet this
is not so, because it can happen that one reached the end of input in
which case no refilling happens. See
https://github.com/mkver/FFmpeg/commit/fba57506a9cf6be2f4aa57b10d54729fd92a
for a way that fixes this.

Now that I have written this, I have to admit that the current code here
is also very problematic: bits_skip() is also suffering from the fallacy
that priv_refill_64() always works. Even worse, the code simply
increments the buffer ptr without checking the bounds (the whole branch
for n >= 64 is of course nonsense for BITS_RL_VLC. In fact, I think that
we will end up with the exact same state in case the reloading in
bits_peek() failed with bits_skip() and skip_remaining().
Luckily BITS_RL_VLC is absolutely unused.

Needless to say, a proper fix involves something along the lines of my
patch above. But this patch is based around the assumption that the
combined amount of bits consumed in any get_vlc2/GET_RL_VLC/BITS_RL_VLC
call can't exceed 32. Is this assumption actually still true now that we
have multi-vlc stuff?

https://github.com/mkver/FFmpeg/commit/9b5a977957968c0718dea55a5b15f060ef6201dc
and
https://github.com/mkver/FFmpeg/commits/aligned32_le_bitstream_reader
are probably also of interest to you.

>  \
>  nb_bits = -n;   \
>  \
> @@ -154,7 +156,7 @@
>  level = table[index].level; \
>  n = table[index].len;   \
>  if (max_depth > 2 && n < 0) {   \
> -bits_skip(bc, nb_bits); \
> +skip_remaining(bc, nb_bits);\
>  nb_bits = -n;   \
>  \
>  index = bits_peek(bc, nb_bits) + level; \
> @@ -163,7 +165,7 @@
>  }   \
>  }   \
>  run = table[index].run; \
> -bits_skip(bc, n);   \
> +skip_remaining(bc, n);  \
>  } while (0)
>  
>  #endif /* AVCODEC_BITSTREAM_H */
> diff --git a/libavcodec/bitstream_template.h b/libavcodec/bitstream_template.h
> index 0308e3a924..3f90fc6a07 100644
> --- a/libavcodec/bitstream_template.h
> +++ b/libavcodec/bitstream_template.h
> @@ -175,7 +175,7 @@ static inline uint64_t BS_FUNC(priv_val_show)(BSCTX *bc, 
> unsigned int n)
>  #endif
>  }
>  
> -static inline void BS_FUNC(priv_skip_remaining)(BSCTX *bc, unsigned int n)
> +static inline void BS_FUNC(skip_remaining)(BSCTX *bc, unsigned int n)
>  {
>  #ifdef BITSTREAM_TEMPLATE_LE
>  bc->bits >>= n;
> @@ -192,7 +192,7 @@ static inline uint64_t BS_FUNC(priv_val_get)(BSCTX *bc, 
> unsigned int n)
>  av_assert2(n > 0 && n < 64);
>  
>  ret = BS_FUNC(priv_val_show)(bc, n);
> -

[FFmpeg-devel] [PATCH] avcodec/xvididct: Fix integer overflow in idct_row()

2023-09-07 Thread Michael Niedermayer
Fixes: signed integer overflow: 1871429831 + 343006811 cannot be represented in 
type 'int'
Fixes: 
61784/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AIC_fuzzer-5372151001120768

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/xvididct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/xvididct.c b/libavcodec/xvididct.c
index 43ea927437..dcea32210a 100644
--- a/libavcodec/xvididct.c
+++ b/libavcodec/xvididct.c
@@ -114,7 +114,7 @@ static int idct_row(short *in, const int *const tab, int 
rnd)
 in[5] = a1;
 in[6] = a1;
 } else {
-const int k  = c4 * in[0] + rnd;
+const unsigned int k  = c4 * in[0] + rnd;
 const unsigned int a0 = k + c2 * in[2] + c4 * in[4] + c6 * in[6];
 const unsigned int a1 = k + c6 * in[2] - c4 * in[4] - c2 * in[6];
 const unsigned int a2 = k - c6 * in[2] - c4 * in[4] + c2 * in[6];
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 1/5] avcodec/vmixdec: Check for end of input in decode_dcac()

2023-09-07 Thread Michael Niedermayer
On Sun, Jul 23, 2023 at 08:02:59PM +0200, Michael Niedermayer wrote:
> Fixes: Timeout
> Fixes: 
> 59952/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VMIX_fuzzer-6718213736759296
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/vmixdec.c | 4 
>  1 file changed, 4 insertions(+)

will apply 1/5 and 2/5

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 1/2] configure: don't force specific C++ standard library linking

2023-09-07 Thread Kieran Kunhya
On Thu, 7 Sept 2023 at 22:39, Kacper Michajlow  wrote:

> On Thu, 7 Sept 2023 at 15:12, Derek Buitenhuis
>  wrote:
> >
> > On 9/6/2023 6:31 PM, Kacper Michajlow wrote:
> > > What would be a downside of preferring CXX always if it exists?
> >
> > FFmpeg runs in a multitude of environments with a multitude of
> portability
> > requirements. Needlessly linking a C++ runtime is not OK.
>
> This does not answer my question. Let me rephrase. Do we know the case
> where using C++ compiler driver rather than C would degrade the
> quality of the resulting build?
>

The machine that ffmpeg is being compiled on is not necessarily the one
that ffmpeg is going to be run on.

Kieran
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 4/5] avcodec/hevcdec: Fix undefined memcpy()

2023-09-07 Thread Michael Niedermayer
On Sun, Jul 23, 2023 at 08:03:02PM +0200, Michael Niedermayer wrote:
> There is likely a better way to fix this, this is mainly to show the problem
> 
> Fixes: MC within same frame resulting in overlapping memcpy()
> Fixes: 
> 60189/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4992746590175232
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/hevcdec.c | 7 +--
>  1 file changed, 5 insertions(+), 2 deletions(-)

this fixes 2 more files
will apply with all 3 in the commit message

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/3] avcodec/hevcdec: do not memcpy into itself

2023-09-07 Thread Michael Niedermayer
On Thu, Apr 27, 2023 at 08:38:39PM +0200, Michael Niedermayer wrote:
> Iam not sure if this buffer setup is intended but if it occurs memcpy() 
> cannot always
> be used
> 
> Fixes: memcpy-param-overlap
> Fixes: 
> 58062/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HEVC_fuzzer-4717458841010176
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/hevcdec.c | 1 +
>  1 file changed, 1 insertion(+)

patch withdrawn, as this is not a complete fix of the issue

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder

2023-09-07 Thread Michael Niedermayer
On Thu, Sep 07, 2023 at 11:39:41PM +0200, Paul B Mahol wrote:
> Sorry but I do not have such file, file i have only does 1 frame.

https://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket1915/

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 1/2] configure: don't force specific C++ standard library linking

2023-09-07 Thread Kacper Michajlow
On Thu, 7 Sept 2023 at 15:12, Derek Buitenhuis
 wrote:
>
> On 9/6/2023 6:31 PM, Kacper Michajlow wrote:
> > What would be a downside of preferring CXX always if it exists?
>
> FFmpeg runs in a multitude of environments with a multitude of portability
> requirements. Needlessly linking a C++ runtime is not OK.

This does not answer my question. Let me rephrase. Do we know the case
where using C++ compiler driver rather than C would degrade the
quality of the resulting build?

Using C++ driver would indeed append the (correct) runtime library to
the linker command, but if nothing references any symbols from it it
would not be linked. It is also why the current way of forcing
`lstdc++` kinda works, because it is silently ignored when not needed.

Implementing logic to use C++ only when necessary is possible, but I'm
not a big fan of such automation. And in practice not sure how well it
would work, because it would require trying to link twice every
dependency in configure.

Also the fact that "FFmpeg runs in a multitude of environment" is
precisely why I really don't like the current unconditional including
`-lstdc++`.

> Further, we do not generally automatically change build output based on
> what is available on the system.

I must kindly disagree. configure has 35 components marked as
`[autodetect]` and they are certainly changing the build output based
on what's available on the system. Whether it is intended or
historical behaviour is another question. But I'm also not proposing
to auto detect anything, quite the opposite with this silly manual
list of libraries.

- Kacper
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder

2023-09-07 Thread Paul B Mahol
Sorry but I do not have such file, file i have only does 1 frame.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/celp_math: avoid overflow in shift

2023-09-07 Thread Michael Niedermayer
by making gain unsigned we have 1 bit more available
alternatively we can clip twice as in the g729 reference

Fixes: left shift of 23404 by 17 places cannot be represented in type 'int'
Fixes: 
61728/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ACELP_KELVIN_fuzzer-6280412547383296

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavcodec/celp_math.h  | 2 +-
 libavcodec/g729postfilter.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/celp_math.h b/libavcodec/celp_math.h
index 1a425d..99a0470719 100644
--- a/libavcodec/celp_math.h
+++ b/libavcodec/celp_math.h
@@ -78,7 +78,7 @@ int64_t ff_dot_product(const int16_t *a, const int16_t *b, 
int length);
  *
  * @return value << offset, if offset>=0; value >> -offset - otherwise
  */
-static inline int bidir_sal(int value, int offset)
+static inline unsigned bidir_sal(unsigned value, int offset)
 {
 if(offset < 0) return value >> -offset;
 else   return value <<  offset;
diff --git a/libavcodec/g729postfilter.c b/libavcodec/g729postfilter.c
index 26e937f0ba..382db92432 100644
--- a/libavcodec/g729postfilter.c
+++ b/libavcodec/g729postfilter.c
@@ -581,7 +581,7 @@ void ff_g729_postfilter(AudioDSPContext *adsp, int16_t* 
ht_prev_data, int* voici
 int16_t ff_g729_adaptive_gain_control(int gain_before, int gain_after, int16_t 
*speech,
int subframe_size, int16_t gain_prev)
 {
-int gain; // (3.12)
+unsigned gain; // (3.12)
 int n;
 int exp_before, exp_after;
 
@@ -603,7 +603,7 @@ int16_t ff_g729_adaptive_gain_control(int gain_before, int 
gain_after, int16_t *
 gain = ((gain_before - gain_after) << 14) / gain_after + 0x4000;
 gain = bidir_sal(gain, exp_after - exp_before);
 }
-gain = av_clip_int16(gain);
+gain = FFMIN(gain, 32767);
 gain = (gain * G729_AGC_FAC1 + 0x4000) >> 15; // gain * (1-0.9875)
 } else
 gain = 0;
-- 
2.17.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder

2023-09-07 Thread Michael Niedermayer
On Thu, Sep 07, 2023 at 06:44:40PM +0200, Paul B Mahol wrote:
> Attached.

>  mjpegdec.c |8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
> f65de11bf58ea36b071c3501d4fa700d242edf21  
> 0001-avcodec-mjpegdec-add-frame-threading-for-mjpeg-decod.patch
> From 2cff86b07b56d2923f60923e7dd21a546c2cc6fa Mon Sep 17 00:00:00 2001
> From: Paul B Mahol 
> Date: Thu, 7 Sep 2023 18:42:03 +0200
> Subject: [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder
> 
> Signed-off-by: Paul B Mahol 
> ---
>  libavcodec/mjpegdec.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

./ffmpeg  -v -1 -i tickets/1915/m_noint.avi -f framecrc -an -t 1 -
Here the timestamps change and the files output does not look healthy
(looks as if one field is behind)

@@ -645,18 +645,22 @@
 #codec_id 0: rawvideo
 #dimensions 0: 640x480
 #sar 0: 0/1
-0,  0,  0,1,   614400, 0x51734de4
-0,  2,  2,1,   614400, 0x9dfe6e90
-0,  4,  4,1,   614400, 0x16d1f0d5
-0,  6,  6,1,   614400, 0x67cbb0f0
-0,  8,  8,1,   614400, 0x40f5223e
-0, 10, 10,1,   614400, 0xef9a9ba8
-0, 12, 12,1,   614400, 0x415cb69a
-0, 14, 14,1,   614400, 0xbebf1993
-0, 16, 16,1,   614400, 0xe4495f0f
-0, 18, 18,1,   614400, 0x05a06480
-0, 20, 20,1,   614400, 0x323bb5eb
-0, 22, 22,1,   614400, 0x941b44ff
+0,  0,  0,1,   614400, 0xb7f88313
+0,  1,  1,1,   614400, 0xeda529e0
+0,  2,  2,1,   614400, 0x29d53819
+0,  3,  3,1,   614400, 0x95619af7
+0,  4,  4,1,   614400, 0xfadb0437
+0,  5,  5,1,   614400, 0xb2efa298
+0,  6,  6,1,   614400, 0x8f4312c6
+0,  7,  7,1,   614400, 0x8968e329
+0,  8,  8,1,   614400, 0x545954c5
+0,  9,  9,1,   614400, 0x144cd0b3
+0, 10, 10,1,   614400, 0x5cd10fe0
+0, 11, 11,1,   614400, 0x81b8473c
+0, 12, 12,1,   614400, 0x58808c89
+0, 13, 13,1,   614400, 0x21371f9f
+0, 14, 14,1,   614400, 0x7533cd2a
+0, 15, 15,1,   614400, 0xc2e8ec09




[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 2/2] read_xbits: request fewer bits

2023-09-07 Thread Christophe Gisquet
This would have also helped a bitstream reader with a cache
of 32 bits.
---
 libavcodec/bitstream_template.h | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/libavcodec/bitstream_template.h b/libavcodec/bitstream_template.h
index 3f90fc6a07..c27e8108b2 100644
--- a/libavcodec/bitstream_template.h
+++ b/libavcodec/bitstream_template.h
@@ -423,8 +423,18 @@ static inline const uint8_t *BS_FUNC(align)(BSCTX *bc)
  */
 static inline int BS_FUNC(read_xbits)(BSCTX *bc, unsigned int n)
 {
-int32_t cache = BS_FUNC(peek)(bc, 32);
-int sign = ~cache >> 31;
+int32_t cache;
+int sign;
+
+if (n > bc->bits_valid)
+BS_FUNC(priv_refill_32)(bc);
+
+#if defined(BITSTREAM_READER_LE)
+cache = bc->bits & 0x;
+#else
+cache = bc->bits >> 32;
+#endif
+sign = ~cache >> 31;
 BS_FUNC(skip_remaining)(bc, n);
 
 return uint32_t)(sign ^ cache)) >> (32 - n)) ^ sign) - sign;
-- 
2.42.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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 1/2] Expose and start using skip_remaining

2023-09-07 Thread Christophe Gisquet
Bitstream readers sometimes have already checked there are enough
bits, and the check is redundant.
---
 libavcodec/bitstream.h  |  8 +---
 libavcodec/bitstream_template.h | 22 +++---
 libavcodec/get_bits.h   |  1 +
 3 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/libavcodec/bitstream.h b/libavcodec/bitstream.h
index 35b7873b9c..dd043fb349 100644
--- a/libavcodec/bitstream.h
+++ b/libavcodec/bitstream.h
@@ -95,6 +95,7 @@
 # define bits_peek_signed   bits_peek_signed_le
 # define bits_peek_signed_nz bits_peek_signed_nz_le
 # define bits_skip  bits_skip_le
+# define bits_skip_remaining bits_skip_remaining_le
 # define bits_seek  bits_seek_le
 # define bits_align bits_align_le
 # define bits_read_xbitsbits_read_xbits_le
@@ -124,6 +125,7 @@
 # define bits_peek_signed   bits_peek_signed_be
 # define bits_peek_signed_nz bits_peek_signed_nz_be
 # define bits_skip  bits_skip_be
+# define bits_skip_remaining bits_skip_remaining_be
 # define bits_seek  bits_seek_be
 # define bits_align bits_align_be
 # define bits_read_xbitsbits_read_xbits_be
@@ -146,7 +148,7 @@
 n = table[index].len;   \
 \
 if (max_depth > 1 && n < 0) {   \
-bits_skip(bc, bits);\
+skip_remaining(bc, bits);   \
 \
 nb_bits = -n;   \
 \
@@ -154,7 +156,7 @@
 level = table[index].level; \
 n = table[index].len;   \
 if (max_depth > 2 && n < 0) {   \
-bits_skip(bc, nb_bits); \
+skip_remaining(bc, nb_bits);\
 nb_bits = -n;   \
 \
 index = bits_peek(bc, nb_bits) + level; \
@@ -163,7 +165,7 @@
 }   \
 }   \
 run = table[index].run; \
-bits_skip(bc, n);   \
+skip_remaining(bc, n);  \
 } while (0)
 
 #endif /* AVCODEC_BITSTREAM_H */
diff --git a/libavcodec/bitstream_template.h b/libavcodec/bitstream_template.h
index 0308e3a924..3f90fc6a07 100644
--- a/libavcodec/bitstream_template.h
+++ b/libavcodec/bitstream_template.h
@@ -175,7 +175,7 @@ static inline uint64_t BS_FUNC(priv_val_show)(BSCTX *bc, 
unsigned int n)
 #endif
 }
 
-static inline void BS_FUNC(priv_skip_remaining)(BSCTX *bc, unsigned int n)
+static inline void BS_FUNC(skip_remaining)(BSCTX *bc, unsigned int n)
 {
 #ifdef BITSTREAM_TEMPLATE_LE
 bc->bits >>= n;
@@ -192,7 +192,7 @@ static inline uint64_t BS_FUNC(priv_val_get)(BSCTX *bc, 
unsigned int n)
 av_assert2(n > 0 && n < 64);
 
 ret = BS_FUNC(priv_val_show)(bc, n);
-BS_FUNC(priv_skip_remaining)(bc, n);
+BS_FUNC(skip_remaining)(bc, n);
 
 return ret;
 }
@@ -375,7 +375,7 @@ static inline int BS_FUNC(peek_signed)(BSCTX *bc, unsigned 
int n)
 static inline void BS_FUNC(skip)(BSCTX *bc, unsigned int n)
 {
 if (n < bc->bits_valid)
-BS_FUNC(priv_skip_remaining)(bc, n);
+BS_FUNC(skip_remaining)(bc, n);
 else {
 n -= bc->bits_valid;
 bc->bits   = 0;
@@ -389,7 +389,7 @@ static inline void BS_FUNC(skip)(BSCTX *bc, unsigned int n)
 }
 BS_FUNC(priv_refill_64)(bc);
 if (n)
-BS_FUNC(priv_skip_remaining)(bc, n);
+BS_FUNC(skip_remaining)(bc, n);
 }
 }
 
@@ -425,7 +425,7 @@ static inline int BS_FUNC(read_xbits)(BSCTX *bc, unsigned 
int n)
 {
 int32_t cache = BS_FUNC(peek)(bc, 32);
 int sign = ~cache >> 31;
-BS_FUNC(priv_skip_remaining)(bc, n);
+BS_FUNC(skip_remaining)(bc, n);
 
 return uint32_t)(sign ^ cache)) >> (32 - n)) ^ sign) - sign;
 }
@@ -508,14 +508,14 @@ static inline int BS_FUNC(read_vlc)(BSCTX *bc, const 
VLCElem *table,
 int n= table[idx].len;
 
 if (max_depth > 1 && n < 0) {
-BS_FUNC(priv_skip_remaining)(bc, bits);
+BS_FUNC(skip_remaining)(bc, bits);
 code = BS_FUNC(priv_set_idx)(bc, code, , _bits, table);
 if (max_depth > 2 && n < 0) {
-BS_FUNC(priv_skip_remaining)(bc, nb_bits);
+BS_FUNC(skip_remaining)(bc, nb_bits);
 code = BS_FUNC(priv_set_idx)(bc, code, , _bits, table);
 }
 }
-BS_FUNC(priv_skip_remaining)(bc, n);
+BS_FUNC(skip_remaining)(bc, n);
 
 return code;
 }
@@ -534,17 +534,17 @@ static inline int 

[FFmpeg-devel] [PATCH 0/2] cached bistream: small improvements

2023-09-07 Thread Christophe Gisquet
Preparatory patch independently beneficial. Note: all of these
are for the sake of simplicity, from 2020, but needed cleaner
rebasing.

Christophe Gisquet (2):
  Expose and start using skip_remaining
  read_xbits: request fewer bits

 libavcodec/bitstream.h  |  8 +---
 libavcodec/bitstream_template.h | 36 +
 libavcodec/get_bits.h   |  1 +
 3 files changed, 29 insertions(+), 16 deletions(-)

-- 
2.42.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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] Trac spam

2023-09-07 Thread Michael Niedermayer
On Thu, Sep 07, 2023 at 06:20:07AM +0200, Michael Koch wrote:
> new spammer in ticket 2776

spammer killed and also everything else he did

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH v2] avcodec/av1dec: export pixel format even if no hardware decoder is present

2023-09-07 Thread James Almer
And remove the AVOID_PROBING flag, given it's the last av1 decoder to be tested
either way.
This fixes a regression introduced in 1652f2492f88434010053289d946dab6a57e4d58,
where even if forcing the native av1 decoder, if another decoder was present,
like libdav1d or libaom-av1, they'd be used for probing and some fate tests
would have different results.

Signed-off-by: James Almer 
---
 libavcodec/av1dec.c | 50 -
 tests/fate/lavf-container.mak   |  8 +++---
 tests/ref/fate/av1-annexb-demux |  2 +-
 tests/ref/lavf-fate/av1.mkv |  4 +--
 tests/ref/lavf-fate/av1.mp4 |  4 +--
 5 files changed, 39 insertions(+), 29 deletions(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index ec8401f4e0..3766290c0f 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -440,20 +440,11 @@ static int get_tiles_info(AVCodecContext *avctx, const 
AV1RawTileGroup *tile_gro
 
 }
 
-static int get_pixel_format(AVCodecContext *avctx)
+static enum AVPixelFormat get_sw_pixel_format(AVCodecContext *avctx,
+  const AV1RawSequenceHeader *seq)
 {
-AV1DecContext *s = avctx->priv_data;
-const AV1RawSequenceHeader *seq = s->raw_seq;
-uint8_t bit_depth;
-int ret;
 enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
-#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \
- CONFIG_AV1_D3D11VA_HWACCEL * 2 + \
- CONFIG_AV1_NVDEC_HWACCEL + \
- CONFIG_AV1_VAAPI_HWACCEL + \
- CONFIG_AV1_VDPAU_HWACCEL + \
- CONFIG_AV1_VULKAN_HWACCEL)
-enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
+uint8_t bit_depth;
 
 if (seq->seq_profile == 2 && seq->color_config.high_bitdepth)
 bit_depth = seq->color_config.twelve_bit ? 12 : 10;
@@ -505,15 +496,29 @@ static int get_pixel_format(AVCodecContext *avctx)
 pix_fmt = AV_PIX_FMT_GRAY10;
 else if (bit_depth == 12)
 pix_fmt = AV_PIX_FMT_GRAY12;
-else
-av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n");
 }
 
-av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n",
-   av_get_pix_fmt_name(pix_fmt));
+return pix_fmt;
+}
 
-if (pix_fmt == AV_PIX_FMT_NONE)
+static int get_pixel_format(AVCodecContext *avctx)
+{
+AV1DecContext *s = avctx->priv_data;
+const AV1RawSequenceHeader *seq = s->raw_seq;
+int ret;
+enum AVPixelFormat pix_fmt = get_sw_pixel_format(avctx, seq);
+#define HWACCEL_MAX (CONFIG_AV1_DXVA2_HWACCEL + \
+ CONFIG_AV1_D3D11VA_HWACCEL * 2 + \
+ CONFIG_AV1_NVDEC_HWACCEL + \
+ CONFIG_AV1_VAAPI_HWACCEL + \
+ CONFIG_AV1_VDPAU_HWACCEL + \
+ CONFIG_AV1_VULKAN_HWACCEL)
+enum AVPixelFormat pix_fmts[HWACCEL_MAX + 2], *fmtp = pix_fmts;
+
+if (pix_fmt == AV_PIX_FMT_NONE) {
+av_log(avctx, AV_LOG_WARNING, "Unknown AV1 pixel format.\n");
 return -1;
+}
 
 switch (pix_fmt) {
 case AV_PIX_FMT_YUV420P:
@@ -605,13 +610,14 @@ static int get_pixel_format(AVCodecContext *avctx)
 break;
 }
 
-*fmtp++ = pix_fmt;
 *fmtp = AV_PIX_FMT_NONE;
 
 ret = ff_thread_get_format(avctx, pix_fmts);
 if (ret < 0)
 return ret;
 
+avctx->pix_fmt = ret;
+
 /**
  * check if the HW accel is inited correctly. If not, return 
un-implemented.
  * Since now the av1 decoder doesn't support native decode, if it will be
@@ -624,7 +630,9 @@ static int get_pixel_format(AVCodecContext *avctx)
 }
 
 s->pix_fmt = pix_fmt;
-avctx->pix_fmt = ret;
+
+av_log(avctx, AV_LOG_DEBUG, "AV1 decode get format: %s.\n",
+   av_get_pix_fmt_name(pix_fmt));
 
 return 0;
 }
@@ -865,6 +873,8 @@ static av_cold int av1_decode_init(AVCodecContext *avctx)
 goto end;
 }
 
+avctx->pix_fmt = get_sw_pixel_format(avctx, seq);
+
 end:
 ff_cbs_fragment_reset(>current_obu);
 }
@@ -1518,7 +1528,7 @@ const FFCodec ff_av1_decoder = {
 .init  = av1_decode_init,
 .close = av1_decode_free,
 FF_CODEC_RECEIVE_FRAME_CB(av1_receive_frame),
-.p.capabilities= AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
+.p.capabilities= AV_CODEC_CAP_DR1,
 .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
 .flush = av1_decode_flush,
 .p.profiles= NULL_IF_CONFIG_SMALL(ff_av1_profiles),
diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak
index 0d4a224601..0081b45eea 100644
--- a/tests/fate/lavf-container.mak
+++ b/tests/fate/lavf-container.mak
@@ -70,9 +70,9 @@ fate-lavf-wtv: CMD = lavf_container "" "-c:a mp2 -threads 1"
 FATE_AVCONV += $(FATE_LAVF_CONTAINER)
 fate-lavf-container fate-lavf: $(FATE_LAVF_CONTAINER)
 
-FATE_LAVF_CONTAINER_FATE-$(call ALLYES, IVF_DEMUXER AV1_PARSER 

Re: [FFmpeg-devel] [PATCH 29/31] avcodec/tiff: Don't cast const away

2023-09-07 Thread Paul B Mahol
LGTM
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder

2023-09-07 Thread Paul B Mahol
On Thu, Sep 7, 2023 at 7:34 PM Paul B Mahol  wrote:

>
>
> On Thu, Sep 7, 2023 at 7:21 PM Andreas Rheinhardt <
> andreas.rheinha...@outlook.com> wrote:
>
>> Paul B Mahol:
>> > Attached.
>> >
>> >
>>
>> Haven't you sent a patch exactly like this before, which led to Michael
>> Niedermayer providing a command line where this changes the output?
>>
>
> That  was not me.
>
> But I know what thread you are referring to.
>

Checked that file, my patch does not fix nor break playing of that .avi
That AVI with mjpeg codec is not decoding with latest FFmpeg master code.

Even if I extract mjpeg losslessly from avi It still decodes just fine
without and with this patch applied.


>
>
>> - Andreas
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/get_bits: Avoid reading multiple times in get_bits_long

2023-09-07 Thread Andreas Rheinhardt
Due to non-byte-alignment a read of 32 bits guarantees only
25 usable bits; therefore get_bits_long() (which is used to
potentially read more than 25 bits) performs two reads in case
it needs to read more than 25 bits and combines the result.

Yet this is not necessary: One can just read 64 bits at a time
to get 32 usable bits (57 would be possible). This commit does so.

This reduced the size of .text by 30144B for GCC 11.4 and 5648B
for Clang 14 (both with -O3).

(get_bits_long() is a building block of show_bits_long()
and get_ue_golomb_long(), so this patch affects these, too.)

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/get_bits.h | 38 +-
 1 file changed, 29 insertions(+), 9 deletions(-)

diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 0594e104bb..f43bcae91e 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -187,21 +187,28 @@ static inline unsigned int show_bits(GetBitContext *s, 
int n);
 
 #define CLOSE_READER(name, gb) (gb)->index = name ## _index
 
+#define UPDATE_CACHE_BE_EXT(name, gb, bits, dst_bits) name ## _cache = \
+AV_RB ## bits((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 
7) >> (bits - dst_bits)
+
+#define UPDATE_CACHE_LE_EXT(name, gb, bits, dst_bits) name ## _cache = \
+(uint ## dst_bits ## _t)(AV_RL ## bits((gb)->buffer + (name ## _index >> 
3)) >> (name ## _index & 7))
+
+/* Using these two macros ensures that 32 bits are available. */
+# define UPDATE_CACHE_LE_32(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 64, 32)
+
+# define UPDATE_CACHE_BE_32(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 64, 32)
+
 # ifdef LONG_BITSTREAM_READER
 
-# define UPDATE_CACHE_LE(name, gb) name ## _cache = \
-  AV_RL64((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
+# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_32(name, (gb))
 
-# define UPDATE_CACHE_BE(name, gb) name ## _cache = \
-  AV_RB64((gb)->buffer + (name ## _index >> 3)) >> (32 - (name ## _index & 
7))
+# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_32(name, (gb))
 
 #else
 
-# define UPDATE_CACHE_LE(name, gb) name ## _cache = \
-  AV_RL32((gb)->buffer + (name ## _index >> 3)) >> (name ## _index & 7)
+# define UPDATE_CACHE_LE(name, gb) UPDATE_CACHE_LE_EXT(name, (gb), 32, 32)
 
-# define UPDATE_CACHE_BE(name, gb) name ## _cache = \
-  AV_RB32((gb)->buffer + (name ## _index >> 3)) << (name ## _index & 7)
+# define UPDATE_CACHE_BE(name, gb) UPDATE_CACHE_BE_EXT(name, (gb), 32, 32)
 
 #endif
 
@@ -209,12 +216,14 @@ static inline unsigned int show_bits(GetBitContext *s, 
int n);
 #ifdef BITSTREAM_READER_LE
 
 # define UPDATE_CACHE(name, gb) UPDATE_CACHE_LE(name, gb)
+# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_LE_32(name, (gb))
 
 # define SKIP_CACHE(name, gb, num) name ## _cache >>= (num)
 
 #else
 
 # define UPDATE_CACHE(name, gb) UPDATE_CACHE_BE(name, gb)
+# define UPDATE_CACHE_32(name, gb) UPDATE_CACHE_BE_32(name, (gb))
 
 # define SKIP_CACHE(name, gb, num) name ## _cache <<= (num)
 
@@ -414,15 +423,26 @@ static inline unsigned int get_bits_long(GetBitContext 
*s, int n)
 av_assert2(n>=0 && n<=32);
 if (!n) {
 return 0;
-} else if (n <= MIN_CACHE_BITS) {
+} else if ((!HAVE_FAST_64BIT || av_builtin_constant_p(n <= MIN_CACHE_BITS))
+   && n <= MIN_CACHE_BITS) {
 return get_bits(s, n);
 } else {
+#if HAVE_FAST_64BIT
+unsigned tmp;
+OPEN_READER(re, s);
+UPDATE_CACHE_32(re, s);
+tmp = SHOW_UBITS(re, s, n);
+LAST_SKIP_BITS(re, s, n);
+CLOSE_READER(re, s);
+return tmp;
+#else
 #ifdef BITSTREAM_READER_LE
 unsigned ret = get_bits(s, 16);
 return ret | (get_bits(s, n - 16) << 16);
 #else
 unsigned ret = get_bits(s, 16) << (n - 16);
 return ret | get_bits(s, n - 16);
+#endif
 #endif
 }
 }
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder

2023-09-07 Thread Paul B Mahol
On Thu, Sep 7, 2023 at 7:21 PM Andreas Rheinhardt <
andreas.rheinha...@outlook.com> wrote:

> Paul B Mahol:
> > Attached.
> >
> >
>
> Haven't you sent a patch exactly like this before, which led to Michael
> Niedermayer providing a command line where this changes the output?
>

That  was not me.

But I know what thread you are referring to.


> - Andreas
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@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-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder

2023-09-07 Thread Andreas Rheinhardt
Paul B Mahol:
> Attached.
> 
> 

Haven't you sent a patch exactly like this before, which led to Michael
Niedermayer providing a command line where this changes the output?

- Andreas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/mjpegdec: add support for frame threading

2023-09-07 Thread Paul B Mahol
On Thu, Sep 7, 2023 at 7:17 PM Paul B Mahol  wrote:

>
>
> On Tue, Dec 6, 2022 at 12:02 AM Timo Rothenpieler 
> wrote:
>
>> On 05.12.2022 15:15, Andreas Rheinhardt wrote:
>> > Timo Rothenpieler:
>> >> In my tests, this lead to a notable speed increase with the amount
>> >> of threads used. Decoding a 720p sample gave the following results:
>> >>
>> >> 1 Thread: 1428 FPS
>> >> 2 Threads: 2501 FPS
>> >> 8 Threads: 7575 FPS
>> >> Automatic: 11326 FPS (On a 16 Core/32 Threads system)
>> >> ---
>> >>   libavcodec/jpeglsdec.c |  2 +-
>> >>   libavcodec/mjpegdec.c  | 13 +++--
>> >>   libavcodec/sp5xdec.c   |  4 ++--
>> >>   3 files changed, 10 insertions(+), 9 deletions(-)
>> >>
>>
>
> I made almost same patch, can you apply this one?
> Thanks.
>

Actually, on better look, this one is more complicated, and does not apply
anymore.
So ignore my 'request'.


>
>
>> >> diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
>> >> index 2e6d018ea6..c0642e8e30 100644
>> >> --- a/libavcodec/jpeglsdec.c
>> >> +++ b/libavcodec/jpeglsdec.c
>> >> @@ -559,7 +559,7 @@ const FFCodec ff_jpegls_decoder = {
>> >>   .init   = ff_mjpeg_decode_init,
>> >>   .close  = ff_mjpeg_decode_end,
>> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
>> >> -.p.capabilities = AV_CODEC_CAP_DR1,
>> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
>> >>   .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
>> >> FF_CODEC_CAP_SETS_PKT_DTS,
>> >>   };
>> >> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
>> >> index 9b7465abe7..d30d722398 100644
>> >> --- a/libavcodec/mjpegdec.c
>> >> +++ b/libavcodec/mjpegdec.c
>> >> @@ -54,6 +54,7 @@
>> >>   #include "exif.h"
>> >>   #include "bytestream.h"
>> >>   #include "tiff_common.h"
>> >> +#include "thread.h"
>> >>
>> >>
>> >>   static int init_default_huffman_tables(MJpegDecodeContext *s)
>> >> @@ -713,7 +714,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
>> >>   s->avctx->pix_fmt,
>> >>   AV_PIX_FMT_NONE,
>> >>   };
>> >> -s->hwaccel_pix_fmt = ff_get_format(s->avctx, pix_fmts);
>> >> +s->hwaccel_pix_fmt = ff_thread_get_format(s->avctx,
>> pix_fmts);
>> >>   if (s->hwaccel_pix_fmt < 0)
>> >>   return AVERROR(EINVAL);
>> >>
>> >> @@ -729,7 +730,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
>> >>   }
>> >>
>> >>   av_frame_unref(s->picture_ptr);
>> >> -if (ff_get_buffer(s->avctx, s->picture_ptr,
>> AV_GET_BUFFER_FLAG_REF) < 0)
>> >> +if (ff_thread_get_buffer(s->avctx, s->picture_ptr,
>> AV_GET_BUFFER_FLAG_REF) < 0)
>> >>   return -1;
>> >>   s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
>> >>   s->picture_ptr->key_frame = 1;
>> >> @@ -2388,7 +2389,7 @@ static int mjpeg_get_packet(AVCodecContext
>> *avctx)
>> >>   int ret;
>> >>
>> >>   av_packet_unref(s->pkt);
>> >> -ret = ff_decode_get_packet(avctx, s->pkt);
>> >> +ret = ff_thread_decode_get_packet(avctx, s->pkt);
>> >>   if (ret < 0)
>> >>   return ret;
>> >>
>> >> @@ -3020,7 +3021,7 @@ const FFCodec ff_mjpeg_decoder = {
>> >>   .close  = ff_mjpeg_decode_end,
>> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
>> >>   .flush  = decode_flush,
>> >> -.p.capabilities = AV_CODEC_CAP_DR1,
>> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
>> >>   .p.max_lowres   = 3,
>> >>   .p.priv_class   = _class,
>> >>   .p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
>> >> @@ -3050,7 +3051,7 @@ const FFCodec ff_thp_decoder = {
>> >>   .close  = ff_mjpeg_decode_end,
>> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
>> >>   .flush  = decode_flush,
>> >> -.p.capabilities = AV_CODEC_CAP_DR1,
>> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
>> >>   .p.max_lowres   = 3,
>> >>   .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
>> >> FF_CODEC_CAP_SETS_PKT_DTS,
>> >> @@ -3068,7 +3069,7 @@ const FFCodec ff_smvjpeg_decoder = {
>> >>   .close  = ff_mjpeg_decode_end,
>> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
>> >>   .flush  = decode_flush,
>> >> -.p.capabilities = AV_CODEC_CAP_DR1,
>> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
>> >>   .caps_internal  = FF_CODEC_CAP_EXPORTS_CROPPING |
>> >> FF_CODEC_CAP_SETS_PKT_DTS |
>> FF_CODEC_CAP_INIT_CLEANUP,
>> >>   };
>> >> diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c
>> >> index 394448c5a9..8b08dc672a 100644
>> >> --- a/libavcodec/sp5xdec.c
>> >> +++ b/libavcodec/sp5xdec.c
>> >> @@ -101,7 +101,7 @@ const FFCodec ff_sp5x_decoder = {
>> >>   .init   = ff_mjpeg_decode_init,
>> >>   .close  = ff_mjpeg_decode_end,
>> >>   

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/mjpegdec: add support for frame threading

2023-09-07 Thread Paul B Mahol
On Tue, Dec 6, 2022 at 12:02 AM Timo Rothenpieler 
wrote:

> On 05.12.2022 15:15, Andreas Rheinhardt wrote:
> > Timo Rothenpieler:
> >> In my tests, this lead to a notable speed increase with the amount
> >> of threads used. Decoding a 720p sample gave the following results:
> >>
> >> 1 Thread: 1428 FPS
> >> 2 Threads: 2501 FPS
> >> 8 Threads: 7575 FPS
> >> Automatic: 11326 FPS (On a 16 Core/32 Threads system)
> >> ---
> >>   libavcodec/jpeglsdec.c |  2 +-
> >>   libavcodec/mjpegdec.c  | 13 +++--
> >>   libavcodec/sp5xdec.c   |  4 ++--
> >>   3 files changed, 10 insertions(+), 9 deletions(-)
> >>
>

I made almost same patch, can you apply this one?
Thanks.


> >> diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c
> >> index 2e6d018ea6..c0642e8e30 100644
> >> --- a/libavcodec/jpeglsdec.c
> >> +++ b/libavcodec/jpeglsdec.c
> >> @@ -559,7 +559,7 @@ const FFCodec ff_jpegls_decoder = {
> >>   .init   = ff_mjpeg_decode_init,
> >>   .close  = ff_mjpeg_decode_end,
> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
> >> -.p.capabilities = AV_CODEC_CAP_DR1,
> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
> >>   .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
> >> FF_CODEC_CAP_SETS_PKT_DTS,
> >>   };
> >> diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
> >> index 9b7465abe7..d30d722398 100644
> >> --- a/libavcodec/mjpegdec.c
> >> +++ b/libavcodec/mjpegdec.c
> >> @@ -54,6 +54,7 @@
> >>   #include "exif.h"
> >>   #include "bytestream.h"
> >>   #include "tiff_common.h"
> >> +#include "thread.h"
> >>
> >>
> >>   static int init_default_huffman_tables(MJpegDecodeContext *s)
> >> @@ -713,7 +714,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
> >>   s->avctx->pix_fmt,
> >>   AV_PIX_FMT_NONE,
> >>   };
> >> -s->hwaccel_pix_fmt = ff_get_format(s->avctx, pix_fmts);
> >> +s->hwaccel_pix_fmt = ff_thread_get_format(s->avctx,
> pix_fmts);
> >>   if (s->hwaccel_pix_fmt < 0)
> >>   return AVERROR(EINVAL);
> >>
> >> @@ -729,7 +730,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
> >>   }
> >>
> >>   av_frame_unref(s->picture_ptr);
> >> -if (ff_get_buffer(s->avctx, s->picture_ptr,
> AV_GET_BUFFER_FLAG_REF) < 0)
> >> +if (ff_thread_get_buffer(s->avctx, s->picture_ptr,
> AV_GET_BUFFER_FLAG_REF) < 0)
> >>   return -1;
> >>   s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
> >>   s->picture_ptr->key_frame = 1;
> >> @@ -2388,7 +2389,7 @@ static int mjpeg_get_packet(AVCodecContext *avctx)
> >>   int ret;
> >>
> >>   av_packet_unref(s->pkt);
> >> -ret = ff_decode_get_packet(avctx, s->pkt);
> >> +ret = ff_thread_decode_get_packet(avctx, s->pkt);
> >>   if (ret < 0)
> >>   return ret;
> >>
> >> @@ -3020,7 +3021,7 @@ const FFCodec ff_mjpeg_decoder = {
> >>   .close  = ff_mjpeg_decode_end,
> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
> >>   .flush  = decode_flush,
> >> -.p.capabilities = AV_CODEC_CAP_DR1,
> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
> >>   .p.max_lowres   = 3,
> >>   .p.priv_class   = _class,
> >>   .p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
> >> @@ -3050,7 +3051,7 @@ const FFCodec ff_thp_decoder = {
> >>   .close  = ff_mjpeg_decode_end,
> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
> >>   .flush  = decode_flush,
> >> -.p.capabilities = AV_CODEC_CAP_DR1,
> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
> >>   .p.max_lowres   = 3,
> >>   .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
> >> FF_CODEC_CAP_SETS_PKT_DTS,
> >> @@ -3068,7 +3069,7 @@ const FFCodec ff_smvjpeg_decoder = {
> >>   .close  = ff_mjpeg_decode_end,
> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
> >>   .flush  = decode_flush,
> >> -.p.capabilities = AV_CODEC_CAP_DR1,
> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
> >>   .caps_internal  = FF_CODEC_CAP_EXPORTS_CROPPING |
> >> FF_CODEC_CAP_SETS_PKT_DTS |
> FF_CODEC_CAP_INIT_CLEANUP,
> >>   };
> >> diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c
> >> index 394448c5a9..8b08dc672a 100644
> >> --- a/libavcodec/sp5xdec.c
> >> +++ b/libavcodec/sp5xdec.c
> >> @@ -101,7 +101,7 @@ const FFCodec ff_sp5x_decoder = {
> >>   .init   = ff_mjpeg_decode_init,
> >>   .close  = ff_mjpeg_decode_end,
> >>   FF_CODEC_RECEIVE_FRAME_CB(ff_mjpeg_receive_frame),
> >> -.p.capabilities = AV_CODEC_CAP_DR1,
> >> +.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
> >>   .p.max_lowres   = 3,
> >>   .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP |
> >> 

Re: [FFmpeg-devel] [PATCH v2 15/22] avformat/avio: Constify data pointees of write callbacks

2023-09-07 Thread Andreas Rheinhardt
Anton Khirnov:
> Quoting Andreas Rheinhardt (2023-09-07 03:05:31)
>> They are currently non-const for reasons unknown, although
>> avio_write() accepts a const buffer.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>> rtmpcrypt.c sometimes modifies the buffer whose content
>> it is supposed to write.
>>
>>  doc/APIchanges   |  4 
>>  libavformat/avio.c   |  4 
>>  libavformat/avio.h   | 13 +
>>  libavformat/avio_internal.h  |  4 
>>  libavformat/aviobuf.c| 28 
>>  libavformat/hdsenc.c |  4 
>>  libavformat/smoothstreamingenc.c |  4 
>>  libavformat/url.h|  8 
>>  libavformat/version_major.h  |  1 +
>>  9 files changed, 70 insertions(+)
>>
>> diff --git a/doc/APIchanges b/doc/APIchanges
>> index 762c2d6628..963ad477bf 100644
>> --- a/doc/APIchanges
>> +++ b/doc/APIchanges
>> @@ -2,6 +2,10 @@ The last version increases of all libraries were on 
>> 2023-02-09
>>  
>>  API changes, most recent first:
>>  
>> +2023-09-07 - xx - lavf 60.xx.100 - avio.h
>> +  Constify the buffer pointees in the write_packet and write_data_type
>> +  callbacks of AVIOContext.
> 
> This implies that the change happens immediately, not that it's
> scheduled for the next major version.
> 

Thanks for noticing, will amend.

- Andreas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder

2023-09-07 Thread Paul B Mahol
Attached.
From 2cff86b07b56d2923f60923e7dd21a546c2cc6fa Mon Sep 17 00:00:00 2001
From: Paul B Mahol 
Date: Thu, 7 Sep 2023 18:42:03 +0200
Subject: [PATCH] avcodec/mjpegdec: add frame threading for mjpeg decoder

Signed-off-by: Paul B Mahol 
---
 libavcodec/mjpegdec.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 29f281231c..cc38b6c4a9 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -52,12 +52,12 @@
 #include "jpeglsdec.h"
 #include "profiles.h"
 #include "put_bits.h"
+#include "thread.h"
 #include "tiff.h"
 #include "exif.h"
 #include "bytestream.h"
 #include "tiff_common.h"
 
-
 static int init_default_huffman_tables(MJpegDecodeContext *s)
 {
 static const struct {
@@ -753,8 +753,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 }
 
 av_frame_unref(s->picture_ptr);
-if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
-return -1;
+if ((ret = ff_thread_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF)) < 0)
+return ret;
 s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
 s->picture_ptr->flags |= AV_FRAME_FLAG_KEY;
 s->got_picture= 1;
@@ -3006,7 +3006,7 @@ const FFCodec ff_mjpeg_decoder = {
 .close  = ff_mjpeg_decode_end,
 FF_CODEC_DECODE_CB(ff_mjpeg_decode_frame),
 .flush  = decode_flush,
-.p.capabilities = AV_CODEC_CAP_DR1,
+.p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
 .p.max_lowres   = 3,
 .p.priv_class   = _class,
 .p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles),
-- 
2.39.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 15/22] avformat/avio: Constify data pointees of write callbacks

2023-09-07 Thread Anton Khirnov
Quoting Andreas Rheinhardt (2023-09-07 03:05:31)
> They are currently non-const for reasons unknown, although
> avio_write() accepts a const buffer.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
> rtmpcrypt.c sometimes modifies the buffer whose content
> it is supposed to write.
> 
>  doc/APIchanges   |  4 
>  libavformat/avio.c   |  4 
>  libavformat/avio.h   | 13 +
>  libavformat/avio_internal.h  |  4 
>  libavformat/aviobuf.c| 28 
>  libavformat/hdsenc.c |  4 
>  libavformat/smoothstreamingenc.c |  4 
>  libavformat/url.h|  8 
>  libavformat/version_major.h  |  1 +
>  9 files changed, 70 insertions(+)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 762c2d6628..963ad477bf 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -2,6 +2,10 @@ The last version increases of all libraries were on 
> 2023-02-09
>  
>  API changes, most recent first:
>  
> +2023-09-07 - xx - lavf 60.xx.100 - avio.h
> +  Constify the buffer pointees in the write_packet and write_data_type
> +  callbacks of AVIOContext.

This implies that the change happens immediately, not that it's
scheduled for the next major version.

-- 
Anton Khirnov
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 28/31] avfilter/vsrc_testsrc: Don't use const uint8_t* when pointee changes

2023-09-07 Thread Paul B Mahol
LGTM
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/av1dec: export pixel format even if no hardware decoder is present

2023-09-07 Thread James Almer

On 9/7/2023 5:06 AM, Andreas Rheinhardt wrote:

James Almer:

And remove the AVOID_PROBING flag, given it's the last av1 decoder to be tested
either way.
This fixes a regression introduced in 1652f2492f88434010053289d946dab6a57e4d58,
where even if forcing the native av1 decoder, if another decoder was present,
like libdav1d or libaom-av1, they'd be used for probing and some fate tests
would have different results.

Signed-off-by: James Almer 
---
  libavcodec/av1dec.c | 8 
  tests/fate/lavf-container.mak   | 8 
  tests/ref/fate/av1-annexb-demux | 2 +-
  tests/ref/lavf-fate/av1.mkv | 4 ++--
  tests/ref/lavf-fate/av1.mp4 | 4 ++--
  5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index ec8401f4e0..a1e08185a7 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -612,6 +612,9 @@ static int get_pixel_format(AVCodecContext *avctx)
  if (ret < 0)
  return ret;
  
+s->pix_fmt = pix_fmt;

+avctx->pix_fmt = ret;
+
  /**
   * check if the HW accel is inited correctly. If not, return 
un-implemented.
   * Since now the av1 decoder doesn't support native decode, if it will be
@@ -623,9 +626,6 @@ static int get_pixel_format(AVCodecContext *avctx)
  return AVERROR(ENOSYS);


Is the log message here actually accurate? The get_format callback
choosing the software pixel format does not mean that the hardware this
is run on or the lavc binary in use do not support hardware accelerated
AV1 decoding.


It's not, but that's also unrelated to this patch.


(How is an API user actually supposed to know that decoding will fail if
the software pixel format is selected?)


Other than the first returned ENOSYS, nothing. I could make it always 
return ENOSYS, same as before this patch, but anything we do will 
probably be hacky unless we add an actual software implementation.

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 27/31] avfilter/vf_vif: Don't cast const away unnecessarily

2023-09-07 Thread Paul B Mahol
OK
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 31/31] avfilter/blend_modes: Always preserve constness

2023-09-07 Thread Paul B Mahol
OK
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 30/31] avfilter/vf_varblur: Don't use pointer-to-const for destination

2023-09-07 Thread Paul B Mahol
OK
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 31/31] avfilter/blend_modes: Always preserve constness

2023-09-07 Thread Andreas Rheinhardt
These casts cast const away temporarily; they are safe, because
the pointers that are initialized point to const data. But this
is nevertheless not nice and leads to warnings when using
-Wcast-qual. blend_modes.c generates 546 (2*39*7) such warnings
which is the majority of such warnings for FFmpeg as a whole.
vf_blend.c and vf_blend_init.h also use this pattern;
they have also been changed.

Signed-off-by: Andreas Rheinhardt 
---
 libavfilter/blend_modes.c   | 4 ++--
 libavfilter/vf_blend.c  | 4 ++--
 libavfilter/vf_blend_init.h | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavfilter/blend_modes.c b/libavfilter/blend_modes.c
index e2be676243..65c5e6f890 100644
--- a/libavfilter/blend_modes.c
+++ b/libavfilter/blend_modes.c
@@ -93,8 +93,8 @@ static void fn0(NAME)(const uint8_t *_top, ptrdiff_t 
top_linesize, \
  ptrdiff_t width, ptrdiff_t height,   \
  FilterParams *param, double *values, int starty) \
 {  
 \
-const PIXEL *top = (PIXEL *)_top;  
 \
-const PIXEL *bottom = (PIXEL *)_bottom;
 \
+const PIXEL *top = (const PIXEL *)_top;
 \
+const PIXEL *bottom = (const PIXEL *)_bottom;  
 \
 PIXEL *dst = (PIXEL *)_dst;
 \
 const float opacity = param->opacity;  
 \

 \
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index dfe2b8b174..7100d9f372 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -133,8 +133,8 @@ static void blend_expr_## name(const uint8_t *_top, 
ptrdiff_t top_linesize,
ptrdiff_t width, ptrdiff_t height,  
\
FilterParams *param, double *values, int 
starty) \
 {  
\
-const type *top = (type*)_top; 
\
-const type *bottom = (type*)_bottom;   
\
+const type *top = (const type*)_top;   
\
+const type *bottom = (const type*)_bottom; 
\
 type *dst = (type*)_dst;   
\
 AVExpr *e = param->e;  
\
 int y, x;  
\
diff --git a/libavfilter/vf_blend_init.h b/libavfilter/vf_blend_init.h
index f531338a54..d24f178032 100644
--- a/libavfilter/vf_blend_init.h
+++ b/libavfilter/vf_blend_init.h
@@ -82,8 +82,8 @@ static void blend_normal_##name(const uint8_t *_top, 
ptrdiff_t top_linesize,
 ptrdiff_t width, ptrdiff_t height, 
   \
 FilterParams *param, double *values, int 
starty)  \
 {  
   \
-const type *top = (type*)_top; 
   \
-const type *bottom = (type*)_bottom;   
   \
+const type *top = (const type*)_top;   
   \
+const type *bottom = (const type*)_bottom; 
   \
 type *dst = (type*)_dst;   
   \
 const float opacity = param->opacity;  
   \

   \
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 30/31] avfilter/vf_varblur: Don't use pointer-to-const for destination

2023-09-07 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavfilter/vf_varblur.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_varblur.c b/libavfilter/vf_varblur.c
index f6f8382adc..6ebb9c0663 100644
--- a/libavfilter/vf_varblur.c
+++ b/libavfilter/vf_varblur.c
@@ -45,7 +45,7 @@ typedef struct VarBlurContext {
 void (*compute_sat)(const uint8_t *ssrc,
 int linesize,
 int w, int h,
-const uint8_t *dstp,
+uint8_t *dstp,
 int dst_linesize);
 
 int (*blur_plane)(AVFilterContext *ctx,
@@ -98,7 +98,7 @@ static const enum AVPixelFormat pix_fmts[] = {
 static void compute_sat##depth(const uint8_t *ssrc,  \
int linesize, \
int w, int h, \
-   const uint8_t *dstp,  \
+   uint8_t *dstp,\
int dst_linesize) \
 {\
 const type *src = (const type *)ssrc;\
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 29/31] avcodec/tiff: Don't cast const away

2023-09-07 Thread Andreas Rheinhardt
lzma_stream.next_in is const for more than 15 years now
and has been so in every release of liblzma.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/tiff.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 148964590b..adb49e4525 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -337,7 +337,7 @@ static void av_always_inline dng_blit(TiffContext *s, 
uint8_t *dst, int dst_stri
(split vertically in the middle). */
 for (line = 0; line < height / 2; line++) {
 uint16_t *dst_u16 = (uint16_t *)dst;
-uint16_t *src_u16 = (uint16_t *)src;
+const uint16_t *src_u16 = (const uint16_t *)src;
 
 /* Blit first half of input row row to initial row of output */
 for (col = 0; col < width; col++)
@@ -360,7 +360,7 @@ static void av_always_inline dng_blit(TiffContext *s, 
uint8_t *dst, int dst_stri
 if (is_u16) {
 for (line = 0; line < height; line++) {
 uint16_t *dst_u16 = (uint16_t *)dst;
-uint16_t *src_u16 = (uint16_t *)src;
+const uint16_t *src_u16 = (const uint16_t *)src;
 
 for (col = 0; col < width; col++)
 *dst_u16++ = dng_process_color16(*src_u16++, s->dng_lut,
@@ -570,7 +570,7 @@ static int tiff_uncompress_lzma(uint8_t *dst, uint64_t 
*len, const uint8_t *src,
 lzma_stream stream = LZMA_STREAM_INIT;
 lzma_ret ret;
 
-stream.next_in   = (uint8_t *)src;
+stream.next_in   = src;
 stream.avail_in  = size;
 stream.next_out  = dst;
 stream.avail_out = *len;
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 28/31] avfilter/vsrc_testsrc: Don't use const uint8_t* when pointee changes

2023-09-07 Thread Andreas Rheinhardt
The const makes no sense and is later cast away.

Signed-off-by: Andreas Rheinhardt 
---
 libavfilter/vsrc_testsrc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index d24481e6c4..5e41416464 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -327,7 +327,7 @@ static void haldclutsrc_fill_picture(AVFilterContext *ctx, 
AVFrame *frame)
 float scale;
 const int w = frame->width;
 const int h = frame->height;
-const uint8_t *data = frame->data[0];
+uint8_t *data = frame->data[0];
 const int linesize  = frame->linesize[0];
 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);
 const int depth = desc->comp[0].depth;
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 27/31] avfilter/vf_vif: Don't cast const away unnecessarily

2023-09-07 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavfilter/vf_vif.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_vif.c b/libavfilter/vf_vif.c
index 3c662491b2..a927abaf6f 100644
--- a/libavfilter/vf_vif.c
+++ b/libavfilter/vf_vif.c
@@ -301,8 +301,8 @@ static int compute_vif2(AVFilterContext *ctx,
 float *main_sq_filt = data_buf[11];
 float *ref_main_filt = data_buf[12];
 
-float *curr_ref_scale = (float *)ref;
-float *curr_main_scale = (float *)main;
+const float *curr_ref_scale  = ref;
+const float *curr_main_scale = main;
 int curr_ref_stride = ref_stride;
 int curr_main_stride = main_stride;
 
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 1/2] configure: don't force specific C++ standard library linking

2023-09-07 Thread Derek Buitenhuis
On 9/6/2023 6:31 PM, Kacper Michajlow wrote:
> What would be a downside of preferring CXX always if it exists?

FFmpeg runs in a multitude of environments with a multitude of portability
requirements. Needlessly linking a C++ runtime is not OK.

Further, we do not generally automatically change build output based on
what is available on the system.

- Derek
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH 26/26] avfilter/buffersrc: Use av_frame_clone() where appropriate

2023-09-07 Thread Nicolas George
Andreas Rheinhardt (12023-09-07):
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/buffersrc.c | 13 +
>  1 file changed, 5 insertions(+), 8 deletions(-)

No objection.

Regards,

-- 
  Nicolas George
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 26/26] avfilter/buffersrc: Use av_frame_clone() where appropriate

2023-09-07 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavfilter/buffersrc.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
index ea50713701..453fc0fd5c 100644
--- a/libavfilter/buffersrc.c
+++ b/libavfilter/buffersrc.c
@@ -230,17 +230,14 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
 }
 
-if (!(copy = av_frame_alloc()))
-return AVERROR(ENOMEM);
-
 if (refcounted && !(flags & AV_BUFFERSRC_FLAG_KEEP_REF)) {
+if (!(copy = av_frame_alloc()))
+return AVERROR(ENOMEM);
 av_frame_move_ref(copy, frame);
 } else {
-ret = av_frame_ref(copy, frame);
-if (ret < 0) {
-av_frame_free();
-return ret;
-}
+copy = av_frame_clone(frame);
+if (!copy)
+return AVERROR(ENOMEM);
 }
 
 #if FF_API_PKT_DURATION
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 25/26] all: Use av_frame_replace() where appropriate

2023-09-07 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/agm.c | 3 +--
 libavcodec/arbc.c| 3 +--
 libavcodec/audiotoolboxenc.c | 3 +--
 libavcodec/bink.c| 3 +--
 libavcodec/cdgraphics.c  | 3 +--
 libavcodec/dxa.c | 3 +--
 libavcodec/eacmv.c   | 5 ++---
 libavcodec/eamad.c   | 3 +--
 libavcodec/eatgv.c   | 3 +--
 libavcodec/escape124.c   | 3 +--
 libavcodec/gif.c | 3 +--
 libavcodec/imm4.c| 3 +--
 libavcodec/interplayvideo.c  | 3 +--
 libavcodec/mss2.c| 3 +--
 libavcodec/mv30.c| 3 +--
 libavcodec/mwsc.c| 3 +--
 libavcodec/pdvdec.c  | 3 +--
 libavcodec/pngenc.c  | 3 +--
 libavcodec/qpeg.c| 3 +--
 libavcodec/qsvenc.c  | 3 +--
 libavcodec/qtrleenc.c| 3 +--
 libavcodec/smcenc.c  | 3 +--
 libavcodec/snowenc.c | 3 +--
 libavcodec/svq1dec.c | 3 +--
 libavcodec/vmdvideo.c| 3 +--
 libavcodec/vp56.c| 6 ++
 libavcodec/xan.c | 3 +--
 libavcodec/zerocodec.c   | 3 +--
 libavfilter/vf_paletteuse.c  | 3 +--
 libavfilter/vsrc_ddagrab.c   | 3 +--
 libavutil/hwcontext.c| 6 ++
 31 files changed, 34 insertions(+), 67 deletions(-)

diff --git a/libavcodec/agm.c b/libavcodec/agm.c
index 55cf0b47c8..84c96d22b5 100644
--- a/libavcodec/agm.c
+++ b/libavcodec/agm.c
@@ -1203,8 +1203,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 if (ret < 0)
 return ret;
 
-av_frame_unref(s->prev_frame);
-if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
+if ((ret = av_frame_replace(s->prev_frame, frame)) < 0)
 return ret;
 
 frame->crop_top  = avctx->coded_height - avctx->height;
diff --git a/libavcodec/arbc.c b/libavcodec/arbc.c
index 1b349f4dd6..46b0275e9a 100644
--- a/libavcodec/arbc.c
+++ b/libavcodec/arbc.c
@@ -166,8 +166,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 prev_pixels -= fill_tile4(avctx, fill, frame);
 }
 
-av_frame_unref(s->prev_frame);
-if ((ret = av_frame_ref(s->prev_frame, frame)) < 0)
+if ((ret = av_frame_replace(s->prev_frame, frame)) < 0)
 return ret;
 
 frame->pict_type = prev_pixels <= 0 ? AV_PICTURE_TYPE_I : 
AV_PICTURE_TYPE_P;
diff --git a/libavcodec/audiotoolboxenc.c b/libavcodec/audiotoolboxenc.c
index 1b4e2a6c43..42ab7ae6e4 100644
--- a/libavcodec/audiotoolboxenc.c
+++ b/libavcodec/audiotoolboxenc.c
@@ -483,8 +483,7 @@ static OSStatus ffat_encode_callback(AudioConverterRef 
converter, UInt32 *nb_pac
 if (*nb_packets > frame->nb_samples)
 *nb_packets = frame->nb_samples;
 
-av_frame_unref(at->encoding_frame);
-ret = av_frame_ref(at->encoding_frame, frame);
+ret = av_frame_replace(at->encoding_frame, frame);
 if (ret < 0) {
 *nb_packets = 0;
 return ret;
diff --git a/libavcodec/bink.c b/libavcodec/bink.c
index 8d96dee705..9024c388f3 100644
--- a/libavcodec/bink.c
+++ b/libavcodec/bink.c
@@ -1300,8 +1300,7 @@ static int decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 emms_c();
 
 if (c->version > 'b') {
-av_frame_unref(c->last);
-if ((ret = av_frame_ref(c->last, frame)) < 0)
+if ((ret = av_frame_replace(c->last, frame)) < 0)
 return ret;
 }
 
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index 0c5022a5d6..7b0666a3e2 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -344,8 +344,7 @@ static int cdg_decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 return ret;
 
 cdg_scroll(cc, cdg_data, frame, inst == CDG_INST_SCROLL_COPY);
-av_frame_unref(cc->frame);
-ret = av_frame_ref(cc->frame, frame);
+ret = av_frame_replace(cc->frame, frame);
 if (ret < 0)
 return ret;
 break;
diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c
index d903b7ecd4..650502ad23 100644
--- a/libavcodec/dxa.c
+++ b/libavcodec/dxa.c
@@ -317,8 +317,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 return AVERROR_INVALIDDATA;
 }
 
-av_frame_unref(c->prev);
-if ((ret = av_frame_ref(c->prev, frame)) < 0)
+if ((ret = av_frame_replace(c->prev, frame)) < 0)
 return ret;
 
 *got_frame = 1;
diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c
index e73e310c4a..43dba20fae 100644
--- a/libavcodec/eacmv.c
+++ b/libavcodec/eacmv.c
@@ -210,9 +210,8 @@ static int cmv_decode_frame(AVCodecContext *avctx, AVFrame 
*frame,
 cmv_decode_intra(s, frame, buf+2, buf_end);
 }
 
-av_frame_unref(s->last2_frame);
-av_frame_move_ref(s->last2_frame, s->last_frame);
-if ((ret = av_frame_ref(s->last_frame, frame)) < 0)
+FFSWAP(AVFrame*, s->last2_frame, s->last_frame);
+if ((ret = av_frame_replace(s->last_frame, frame)) < 0)
 return ret;
 
 *got_frame = 1;
diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c
index 

[FFmpeg-devel] [PATCH 24/26] avformat/avio: Remove redundant checks

2023-09-07 Thread Andreas Rheinhardt
Checking the return value of av_opt_set() is equivalent
to the current checks.

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/avio.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index a4572d2f05..617c1c0ac0 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -125,10 +125,7 @@ static int url_alloc_for_protocol(URLContext **puc, const 
URLProtocol *up,
 
 while(ret >= 0 && (key= strchr(p, sep)) && ppriv_data, p, key+1, 0);
+ret = av_opt_set(uc->priv_data, p, key+1, 0);
 if (ret == AVERROR_OPTION_NOT_FOUND)
 av_log(uc, AV_LOG_ERROR, "Key '%s' not found.\n", p);
 *val= *key= sep;
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH 23/26] avformat/avio: Remove duplicated freeing code

2023-09-07 Thread Andreas Rheinhardt
The target of the jump frees this stuff, too.

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/avio.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavformat/avio.c b/libavformat/avio.c
index 053cb2e05a..a4572d2f05 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -136,8 +136,6 @@ static int url_alloc_for_protocol(URLContext **puc, const 
URLProtocol *up,
 }
 if(ret<0 || p!=key){
 av_log(uc, AV_LOG_ERROR, "Error parsing options string 
%s\n", start);
-av_freep(>priv_data);
-av_freep();
 err = AVERROR(EINVAL);
 goto fail;
 }
-- 
2.34.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avformat/flacdec: set time base for headerless flac

2023-09-07 Thread Paul B Mahol
will apply
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] fate: add rpza encoder tests

2023-09-07 Thread Paul B Mahol
Attached. Now without floats.

On Thu, Sep 7, 2023 at 10:10 AM Paul B Mahol  wrote:

> Attached.
>
From 5e9d20d393659c1c94ac328237699c3aa65f3ac9 Mon Sep 17 00:00:00 2001
From: Paul B Mahol 
Date: Thu, 7 Sep 2023 10:08:30 +0200
Subject: [PATCH 2/2] fate: add rpza encoder tests

Signed-off-by: Paul B Mahol 
---
 tests/fate/vcodec.mak | 4 
 tests/ref/vsynth/vsynth1-rpza | 4 
 tests/ref/vsynth/vsynth2-rpza | 4 
 tests/ref/vsynth/vsynth3-rpza | 4 
 4 files changed, 16 insertions(+)
 create mode 100644 tests/ref/vsynth/vsynth1-rpza
 create mode 100644 tests/ref/vsynth/vsynth2-rpza
 create mode 100644 tests/ref/vsynth/vsynth3-rpza

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index e32d28c556..45ed88da96 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -396,6 +396,10 @@ fate-vsynth%-roqvideo:   ENCOPTS = -frames 5
 fate-vsynth%-roqvideo:   RAWDECOPTS = -r 30
 fate-vsynth%-roqvideo:   FMT = roq
 
+FATE_VCODEC_SCALE-$(call ENCDEC, RPZA, MOV) += rpza
+fate-vsynth%-rpza:   CODEC   = rpza
+fate-vsynth%-rpza:   FMT = mov
+
 FATE_VCODEC-$(call ENCDEC, RV10, RM)+= rv10
 fate-vsynth%-rv10:   ENCOPTS = -qscale 10
 fate-vsynth%-rv10:   FMT = rm
diff --git a/tests/ref/vsynth/vsynth1-rpza b/tests/ref/vsynth/vsynth1-rpza
new file mode 100644
index 00..b238b245d3
--- /dev/null
+++ b/tests/ref/vsynth/vsynth1-rpza
@@ -0,0 +1,4 @@
+e4e9660c4a13709b277aac42419b9a23 *tests/data/fate/vsynth1-rpza.mov
+10138529 tests/data/fate/vsynth1-rpza.mov
+99bece160cfb0da47f446b60d42fa3ae *tests/data/fate/vsynth1-rpza.out.rawvideo
+stddev:4.06 PSNR: 35.94 MAXDIFF:   47 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-rpza b/tests/ref/vsynth/vsynth2-rpza
new file mode 100644
index 00..847844f384
--- /dev/null
+++ b/tests/ref/vsynth/vsynth2-rpza
@@ -0,0 +1,4 @@
+e7c5b381214556507f64052ba26ccb68 *tests/data/fate/vsynth2-rpza.mov
+9975182 tests/data/fate/vsynth2-rpza.mov
+eb3f0c974ed17ede7cd3ce30ce417d8d *tests/data/fate/vsynth2-rpza.out.rawvideo
+stddev:2.81 PSNR: 39.14 MAXDIFF:   19 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-rpza b/tests/ref/vsynth/vsynth3-rpza
new file mode 100644
index 00..c933a44c4b
--- /dev/null
+++ b/tests/ref/vsynth/vsynth3-rpza
@@ -0,0 +1,4 @@
+791ad5931c5d54eff406c639be0c79e2 *tests/data/fate/vsynth3-rpza.mov
+130493 tests/data/fate/vsynth3-rpza.mov
+19f61c34cbdef98b0f4aca6c19f59ed4 *tests/data/fate/vsynth3-rpza.out.rawvideo
+stddev:4.35 PSNR: 35.35 MAXDIFF:   46 bytes:86700/86700
-- 
2.39.1

From 8c2df35828b5b15a1c9915b118a8f8ad6ba08ee6 Mon Sep 17 00:00:00 2001
From: Paul B Mahol 
Date: Thu, 7 Sep 2023 11:00:38 +0200
Subject: [PATCH 1/2] avcodec/rpzaenc: replace float-point calculations with
 integer ones

Signed-off-by: Paul B Mahol 
---
 libavcodec/rpzaenc.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/libavcodec/rpzaenc.c b/libavcodec/rpzaenc.c
index a399d55c93..9da929718a 100644
--- a/libavcodec/rpzaenc.c
+++ b/libavcodec/rpzaenc.c
@@ -30,6 +30,7 @@
 #include "avcodec.h"
 #include "codec_internal.h"
 #include "encode.h"
+#include "mathops.h"
 #include "put_bits.h"
 
 typedef struct RpzaContext {
@@ -266,9 +267,9 @@ static int compare_blocks(const uint16_t *block1, const uint16_t *block2,
  */
 static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi,
 channel_offset xchannel, channel_offset ychannel,
-double *slope, double *y_intercept, double *correlation_coef)
+int *slope, int *y_intercept, int *correlation_coef)
 {
-double sumx = 0, sumy = 0, sumx2 = 0, sumy2 = 0, sumxy = 0,
+int sumx = 0, sumy = 0, sumx2 = 0, sumy2 = 0, sumxy = 0,
sumx_sq = 0, sumy_sq = 0, tmp, tmp2;
 int i, j, count;
 uint8_t x, y;
@@ -305,10 +306,10 @@ static int leastsquares(const uint16_t *block_ptr, const BlockInfo *bi,
 
 tmp2 = count * sumy2 - sumy_sq;
 if (tmp2 == 0) {
-*correlation_coef = 0.0;
+*correlation_coef = 0;
 } else {
 *correlation_coef = (count * sumxy - sumx * sumy) /
-sqrt(tmp * tmp2);
+ff_sqrt(tmp * tmp2);
 }
 
 return 0; // success
@@ -332,18 +333,18 @@ static int calc_lsq_max_fit_error(const uint16_t *block_ptr, const BlockInfo *bi
 y = GET_CHAN(block_ptr[j], ychannel);
 
 /* calculate x_inc as the 4-color index (0..3) */
-x_inc = floor( (x - min) * 3.0 / (max - min) + 0.5);
+x_inc = (x - min) * 3 / (max - min) + 1;
 x_inc = FFMAX(FFMIN(3, x_inc), 0);
 
 /* calculate lin_y corresponding to x_inc */
-lin_y = (int)(tmp_min + (tmp_max - tmp_min) * x_inc / 3.0 + 0.5);
+lin_y = tmp_min + (tmp_max - tmp_min) * x_inc / 3 + 1;
 
 err = FFABS(lin_y - y);
 if (err > 

Re: [FFmpeg-devel] [PATCH] fate: add rpza encoder tests

2023-09-07 Thread Andreas Rheinhardt
Paul B Mahol:
> Attached.
> 
> 

This encoder uses floating point. Sure it is bitexact?

- Andreas

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH] avcodec/av1dec: export pixel format even if no hardware decoder is present

2023-09-07 Thread Andreas Rheinhardt
James Almer:
> And remove the AVOID_PROBING flag, given it's the last av1 decoder to be 
> tested
> either way.
> This fixes a regression introduced in 
> 1652f2492f88434010053289d946dab6a57e4d58,
> where even if forcing the native av1 decoder, if another decoder was present,
> like libdav1d or libaom-av1, they'd be used for probing and some fate tests
> would have different results.
> 
> Signed-off-by: James Almer 
> ---
>  libavcodec/av1dec.c | 8 
>  tests/fate/lavf-container.mak   | 8 
>  tests/ref/fate/av1-annexb-demux | 2 +-
>  tests/ref/lavf-fate/av1.mkv | 4 ++--
>  tests/ref/lavf-fate/av1.mp4 | 4 ++--
>  5 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
> index ec8401f4e0..a1e08185a7 100644
> --- a/libavcodec/av1dec.c
> +++ b/libavcodec/av1dec.c
> @@ -612,6 +612,9 @@ static int get_pixel_format(AVCodecContext *avctx)
>  if (ret < 0)
>  return ret;
>  
> +s->pix_fmt = pix_fmt;
> +avctx->pix_fmt = ret;
> +
>  /**
>   * check if the HW accel is inited correctly. If not, return 
> un-implemented.
>   * Since now the av1 decoder doesn't support native decode, if it will be
> @@ -623,9 +626,6 @@ static int get_pixel_format(AVCodecContext *avctx)
>  return AVERROR(ENOSYS);

Is the log message here actually accurate? The get_format callback
choosing the software pixel format does not mean that the hardware this
is run on or the lavc binary in use do not support hardware accelerated
AV1 decoding.
(How is an API user actually supposed to know that decoding will fail if
the software pixel format is selected?)

>  }
>  
> -s->pix_fmt = pix_fmt;
> -avctx->pix_fmt = ret;
> -
>  return 0;
>  }
>  
> @@ -1518,7 +1518,7 @@ const FFCodec ff_av1_decoder = {
>  .init  = av1_decode_init,
>  .close = av1_decode_free,
>  FF_CODEC_RECEIVE_FRAME_CB(av1_receive_frame),
> -.p.capabilities= AV_CODEC_CAP_DR1 | AV_CODEC_CAP_AVOID_PROBING,
> +.p.capabilities= AV_CODEC_CAP_DR1,
>  .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
>  .flush = av1_decode_flush,
>  .p.profiles= NULL_IF_CONFIG_SMALL(ff_av1_profiles),
> diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak
> index 0d4a224601..0081b45eea 100644
> --- a/tests/fate/lavf-container.mak
> +++ b/tests/fate/lavf-container.mak
> @@ -70,9 +70,9 @@ fate-lavf-wtv: CMD = lavf_container "" "-c:a mp2 -threads 1"
>  FATE_AVCONV += $(FATE_LAVF_CONTAINER)
>  fate-lavf-container fate-lavf: $(FATE_LAVF_CONTAINER)
>  
> -FATE_LAVF_CONTAINER_FATE-$(call ALLYES, IVF_DEMUXER AV1_PARSER MOV_MUXER)
>   += av1.mp4
> +FATE_LAVF_CONTAINER_FATE-$(call ALLYES, IVF_DEMUXER AV1_DECODER AV1_PARSER 
> MOV_MUXER)  += av1.mp4
> +FATE_LAVF_CONTAINER_FATE-$(call ALLYES, IVF_DEMUXER AV1_DECODER AV1_PARSER 
> MATROSKA_MUXER) += av1.mkv
>  FATE_LAVF_CONTAINER_FATE-$(call ALLYES, EVC_DEMUXER EVC_PARSER MOV_MUXER)
>   += evc.mp4
> -FATE_LAVF_CONTAINER_FATE-$(call ALLYES, IVF_DEMUXER AV1_PARSER 
> MATROSKA_MUXER) += av1.mkv
>  FATE_LAVF_CONTAINER_FATE-$(call ALLYES, H264_DEMUXER H264_PARSER MOV_MUXER)  
>   += h264.mp4
>  FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MATROSKA_DEMUXER   OGG_MUXER)
>   += vp3.ogg
>  FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MATROSKA_DEMUXER   OGV_MUXER)
>   += vp8.ogg
> @@ -86,8 +86,8 @@ FATE_LAVF_CONTAINER_FATE = 
> $(FATE_LAVF_CONTAINER_FATE-yes:%=fate-lavf-fate-%)
>  $(FATE_LAVF_CONTAINER_FATE): REF = 
> $(SRC_PATH)/tests/ref/lavf-fate/$(@:fate-lavf-fate-%=%)
>  $(FATE_LAVF_CONTAINER_FATE): $(AREF) $(VREF)
>  
> -fate-lavf-fate-av1.mp4: CMD = lavf_container_fate 
> "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy"
> -fate-lavf-fate-av1.mkv: CMD = lavf_container_fate 
> "av1-test-vectors/av1-1-b8-05-mv.ivf" "" "-c:v copy"
> +fate-lavf-fate-av1.mp4: CMD = lavf_container_fate 
> "av1-test-vectors/av1-1-b8-05-mv.ivf" "-c:v av1" "-c:v copy"
> +fate-lavf-fate-av1.mkv: CMD = lavf_container_fate 
> "av1-test-vectors/av1-1-b8-05-mv.ivf" "-c:v av1" "-c:v copy"
>  fate-lavf-fate-evc.mp4: CMD = lavf_container_fate "evc/akiyo_cif.evc" "" 
> "-c:v copy"
>  fate-lavf-fate-h264.mp4: CMD = lavf_container_fate "h264/intra_refresh.h264" 
> "" "-c:v copy"
>  fate-lavf-fate-vp3.ogg: CMD = lavf_container_fate "vp3/coeff_level64.mkv" 
> "-idct auto"
> diff --git a/tests/ref/fate/av1-annexb-demux b/tests/ref/fate/av1-annexb-demux
> index 77e0e378ab..139a893ec1 100644
> --- a/tests/ref/fate/av1-annexb-demux
> +++ b/tests/ref/fate/av1-annexb-demux
> @@ -3,7 +3,7 @@
>  #media_type 0: video
>  #codec_id 0: av1
>  #dimensions 0: 300x300
> -#sar 0: 1/1
> +#sar 0: 0/1
>  0,  0,  0,48000,12691, 0xf0adcc79
>  0,  48000,  48000,48000, 4975, 0x1742a45f, F=0x0
>  0,  96000,  96000,48000,  928, 0x7408be1a, F=0x0
> diff --git a/tests/ref/lavf-fate/av1.mkv 

[FFmpeg-devel] [PATCH] fate: add rpza encoder tests

2023-09-07 Thread Paul B Mahol
Attached.
From 1030770b92f74738dec515e8a2a6d660f7031c27 Mon Sep 17 00:00:00 2001
From: Paul B Mahol 
Date: Thu, 7 Sep 2023 10:08:30 +0200
Subject: [PATCH] fate: add rpza encoder tests

Signed-off-by: Paul B Mahol 
---
 tests/fate/vcodec.mak | 4 
 tests/ref/vsynth/vsynth1-rpza | 4 
 tests/ref/vsynth/vsynth2-rpza | 4 
 tests/ref/vsynth/vsynth3-rpza | 4 
 4 files changed, 16 insertions(+)
 create mode 100644 tests/ref/vsynth/vsynth1-rpza
 create mode 100644 tests/ref/vsynth/vsynth2-rpza
 create mode 100644 tests/ref/vsynth/vsynth3-rpza

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index e32d28c556..45ed88da96 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -396,6 +396,10 @@ fate-vsynth%-roqvideo:   ENCOPTS = -frames 5
 fate-vsynth%-roqvideo:   RAWDECOPTS = -r 30
 fate-vsynth%-roqvideo:   FMT = roq
 
+FATE_VCODEC_SCALE-$(call ENCDEC, RPZA, MOV) += rpza
+fate-vsynth%-rpza:   CODEC   = rpza
+fate-vsynth%-rpza:   FMT = mov
+
 FATE_VCODEC-$(call ENCDEC, RV10, RM)+= rv10
 fate-vsynth%-rv10:   ENCOPTS = -qscale 10
 fate-vsynth%-rv10:   FMT = rm
diff --git a/tests/ref/vsynth/vsynth1-rpza b/tests/ref/vsynth/vsynth1-rpza
new file mode 100644
index 00..b238b245d3
--- /dev/null
+++ b/tests/ref/vsynth/vsynth1-rpza
@@ -0,0 +1,4 @@
+e4e9660c4a13709b277aac42419b9a23 *tests/data/fate/vsynth1-rpza.mov
+10138529 tests/data/fate/vsynth1-rpza.mov
+99bece160cfb0da47f446b60d42fa3ae *tests/data/fate/vsynth1-rpza.out.rawvideo
+stddev:4.06 PSNR: 35.94 MAXDIFF:   47 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth2-rpza b/tests/ref/vsynth/vsynth2-rpza
new file mode 100644
index 00..97861a49e4
--- /dev/null
+++ b/tests/ref/vsynth/vsynth2-rpza
@@ -0,0 +1,4 @@
+b66a3067c093d301a2d79e52533e8f4a *tests/data/fate/vsynth2-rpza.mov
+9968006 tests/data/fate/vsynth2-rpza.mov
+56f34ca2e29331dce8a2704c32ad5694 *tests/data/fate/vsynth2-rpza.out.rawvideo
+stddev:2.82 PSNR: 39.12 MAXDIFF:   37 bytes:  7603200/  7603200
diff --git a/tests/ref/vsynth/vsynth3-rpza b/tests/ref/vsynth/vsynth3-rpza
new file mode 100644
index 00..c933a44c4b
--- /dev/null
+++ b/tests/ref/vsynth/vsynth3-rpza
@@ -0,0 +1,4 @@
+791ad5931c5d54eff406c639be0c79e2 *tests/data/fate/vsynth3-rpza.mov
+130493 tests/data/fate/vsynth3-rpza.mov
+19f61c34cbdef98b0f4aca6c19f59ed4 *tests/data/fate/vsynth3-rpza.out.rawvideo
+stddev:4.35 PSNR: 35.35 MAXDIFF:   46 bytes:86700/86700
-- 
2.39.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] [PATCH v2 20/22] avcodec/v210dec: Don't cast const away

2023-09-07 Thread Paul B Mahol
LGTM
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".