Re: [FFmpeg-devel] [PATCH 05/22] avformat/matroskadec: Use int64_t size

2024-07-12 Thread Andreas Rheinhardt
Michael Niedermayer:
> The length is 64bit that is passed into the functions.
> Alternatively the values can be checked before cast
> 
> Fixes: CID1604572 Overflowed return value
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/matroskadec.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index aa28a37da4c..9914838698c 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -989,7 +989,7 @@ static int ebml_read_length(MatroskaDemuxContext 
> *matroska, AVIOContext *pb,
>   * Read the next element as an unsigned int.
>   * Returns NEEDS_CHECKING unless size == 0.
>   */
> -static int ebml_read_uint(AVIOContext *pb, int size,
> +static int ebml_read_uint(AVIOContext *pb, int64_t size,
>uint64_t default_value, uint64_t *num)
>  {
>  int n = 0;
> @@ -1010,7 +1010,7 @@ static int ebml_read_uint(AVIOContext *pb, int size,
>   * Read the next element as a signed int.
>   * Returns NEEDS_CHECKING unless size == 0.
>   */
> -static int ebml_read_sint(AVIOContext *pb, int size,
> +static int ebml_read_sint(AVIOContext *pb, int64_t size,
>int64_t default_value, int64_t *num)
>  {
>  int n = 1;
> @@ -1033,7 +1033,7 @@ static int ebml_read_sint(AVIOContext *pb, int size,
>   * Read the next element as a float.
>   * Returns 0 if size == 0, NEEDS_CHECKING or < 0 on obvious failure.
>   */
> -static int ebml_read_float(AVIOContext *pb, int size,
> +static int ebml_read_float(AVIOContext *pb, int64_t size,
> double default_value, double *num)
>  {
>  if (size == 0) {

The values are already checked before that (via the max_lengths list).

- 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/9] avcodec/dovi_rpudec: clarify semantics

2024-07-12 Thread Niklas Haas
On Mon, 24 Jun 2024 19:20:36 +0200 Niklas Haas  wrote:
> From: Niklas Haas 
> 
> ff_dovi_rpu_parse() and ff_dovi_rpu_generate() are a bit inconsistent in
> that they expect different levels of encapsulation, due to the nature of
> how this is handled in the context of different APIs. Clarify the status
> quo. (And fix an incorrect reference to the RPU payload bytes as 'RBSP')
> ---
>  libavcodec/dovi_rpu.h| 5 +++--
>  libavcodec/dovi_rpudec.c | 2 +-
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/libavcodec/dovi_rpu.h b/libavcodec/dovi_rpu.h
> index bfb118d6b5..205d16ffbc 100644
> --- a/libavcodec/dovi_rpu.h
> +++ b/libavcodec/dovi_rpu.h
> @@ -95,8 +95,9 @@ void ff_dovi_ctx_unref(DOVIContext *s);
>  void ff_dovi_ctx_flush(DOVIContext *s);
>  
>  /**
> - * Parse the contents of a Dovi RPU NAL and update the parsed values in the
> - * DOVIContext struct.
> + * Parse the contents of a Dolby Vision RPU and update the parsed values in 
> the
> + * DOVIContext struct. This function should receive the decoded unit payload,
> + * without any T.35 or NAL unit headers.
>   *
>   * Returns 0 or an error code.
>   *
> diff --git a/libavcodec/dovi_rpudec.c b/libavcodec/dovi_rpudec.c
> index c025800206..375e6e560b 100644
> --- a/libavcodec/dovi_rpudec.c
> +++ b/libavcodec/dovi_rpudec.c
> @@ -360,7 +360,7 @@ int ff_dovi_rpu_parse(DOVIContext *s, const uint8_t *rpu, 
> size_t rpu_size,
>  emdf_protection = get_bits(gb, 5 + 12);
>  VALIDATE(emdf_protection, 0x400, 0x400);
>  } else {
> -/* NAL RBSP with prefix and trailing zeroes */
> +/* NAL unit with prefix and trailing zeroes */
>  VALIDATE(rpu[0], 25, 25); /* NAL prefix */
>  rpu++;
>  rpu_size--;
> -- 
> 2.45.1
> 

Confirmed working via the official Dolby Bitstream validator tool. I'll
merge it shortly if nobody objects.

I made one more minor local change, renaming the default "all" compression
preset to "limited", corresponding to the limited metadata compression
scheme described in chapter 9 of the dolby vision bitstream
specification.

Specifically, we want to discourage the use of potential compression
modes that go beyond "limited" because they are not broadly compatible
with real devices, so having an "all" preset is a bit pointless.
___
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] fate/lavf-container: add a test for L-HEVC remuxing

2024-07-12 Thread James Almer
Signed-off-by: James Almer 
---
 tests/fate-run.sh   |  4 ++--
 tests/fate/lavf-container.mak   | 28 +++-
 tests/ref/lavf-fate/mv_hevc.mp4 |  3 +++
 3 files changed, 20 insertions(+), 15 deletions(-)
 create mode 100644 tests/ref/lavf-fate/mv_hevc.mp4

diff --git a/tests/fate-run.sh b/tests/fate-run.sh
index 6ae0320c60..35f8da6be0 100755
--- a/tests/fate-run.sh
+++ b/tests/fate-run.sh
@@ -401,8 +401,8 @@ lavf_container_fate()
 cleanfiles="$cleanfiles $file"
 input="${target_samples}/$1"
 do_avconv $file -auto_conversion_filters $DEC_OPTS $2 -i "$input" \
-  "$ENC_OPTS -metadata title=lavftest" -vcodec copy -acodec copy 
|| return
-do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i 
$target_path/$file $3
+  $3 "$ENC_OPTS -metadata title=lavftest" -vcodec copy -acodec 
copy || return
+do_avconv_crc $file -auto_conversion_filters $DEC_OPTS -i 
$target_path/$file $4
 }
 
 lavf_image(){
diff --git a/tests/fate/lavf-container.mak b/tests/fate/lavf-container.mak
index fbd95070d0..8c306ddeda 100644
--- a/tests/fate/lavf-container.mak
+++ b/tests/fate/lavf-container.mak
@@ -76,6 +76,7 @@ FATE_LAVF_CONTAINER_FATE-$(call ALLYES, IVF_DEMUXER 
AV1_DECODER AV1_PARSER MATRO
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, EVC_DEMUXER EVC_PARSER MOV_MUXER)  
+= evc.mp4
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, H264_DEMUXER H264_PARSER MOV_MUXER)
+= h264.mp4
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, HEVC_DEMUXER HEVC_PARSER 
EXTRACT_EXTRADATA_BSF MOV_MUXER) += hevc.mp4
+FATE_LAVF_CONTAINER_FATE-$(call ALLYES, MOV_DEMUXER MOV_MUXER) 
+= mv_hevc.mp4
 FATE_LAVF_CONTAINER_FATE-$(call ALLYES, VVC_DEMUXER VVC_PARSER MOV_MUXER)  
+= vvc.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
@@ -90,19 +91,20 @@ 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 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-hevc.mp4: CMD = lavf_container_fate 
"hevc-conformance/HRD_A_Fujitsu_2.bit" "" "-c:v copy"
-fate-lavf-fate-vvc.mp4: CMD = lavf_container_fate 
"vvc-conformance/VPS_A_3.bit" "" "-c:v copy"
-fate-lavf-fate-vp3.ogg: CMD = lavf_container_fate "vp3/coeff_level64.mkv" 
"-idct auto"
-fate-lavf-fate-vp8.ogg: CMD = lavf_container_fate "vp8/RRSF49-short.webm" "" 
"-acodec copy"
-fate-lavf-fate-latm: CMD = lavf_container_fate "aac/al04_44.mp4" "" "-acodec 
copy"
-fate-lavf-fate-mp3: CMD = lavf_container_fate "mp3-conformance/he_32khz.bit" 
"" "-acodec copy"
-fate-lavf-fate-qtrle_mace6.mov: CMD = lavf_container_fate 
"qtrle/Animation-16Greys.mov" "-idct auto"
-fate-lavf-fate-cram.avi: CMD = lavf_container_fate "cram/toon.avi" "-idct auto"
-fate-lavf-fate-hevc.flv: CMD = lavf_container_fate "mkv/hdr10tags-both.mkv" "" 
"-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-hevc.mp4: CMD = lavf_container_fate 
"hevc-conformance/HRD_A_Fujitsu_2.bit" "" "" "-c:v copy"
+fate-lavf-fate-vvc.mp4: CMD = lavf_container_fate 
"vvc-conformance/VPS_A_3.bit" "" "" "-c:v copy"
+fate-lavf-fate-vp3.ogg: CMD = lavf_container_fate "vp3/coeff_level64.mkv" "" 
"-idct auto"
+fate-lavf-fate-vp8.ogg: CMD = lavf_container_fate "vp8/RRSF49-short.webm" "" 
"" "-acodec copy"
+fate-lavf-fate-latm: CMD = lavf_container_fate "aac/al04_44.mp4" "" "" 
"-acodec copy"
+fate-lavf-fate-mp3: CMD = lavf_container_fate "mp3-conformance/he_32khz.bit" 
"" "" "-acodec copy"
+fate-lavf-fate-mv_hevc.mp4: CMD = lavf_container_fate "hevc/multiview.mov" "" 
"-strict -1" "-c:v copy"
+fate-lavf-fate-qtrle_mace6.mov: CMD = lavf_container_fate 
"qtrle/Animation-16Greys.mov" "" "-idct auto"
+fate-lavf-fate-cram.avi: CMD = lavf_container_fate "cram/toon.avi" "" "-idct 
auto"
+fate-lavf-fate-hevc.flv: CMD = lavf_container_fate "mkv/hdr10tags-both.mkv" "" 
"" "-c:v copy"
 
 FATE_SAMPLES_FFMPEG += $(FATE_LAVF_CONTAINER_FATE)
 fate-lavf-fate fate-lavf: $(FATE_LAVF_CONTAINER_FATE)
diff --git a/tests/ref/lavf-fate/mv_hevc.mp4 b/tests/ref/lavf-fat

Re: [FFmpeg-devel] [PATCH 05/22] avformat/matroskadec: Use int64_t size

2024-07-12 Thread Michael Niedermayer
On Fri, Jul 12, 2024 at 10:42:38AM +0200, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > The length is 64bit that is passed into the functions.
> > Alternatively the values can be checked before cast
> > 
> > Fixes: CID1604572 Overflowed return value
> > 
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/matroskadec.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> > index aa28a37da4c..9914838698c 100644
> > --- a/libavformat/matroskadec.c
> > +++ b/libavformat/matroskadec.c
> > @@ -989,7 +989,7 @@ static int ebml_read_length(MatroskaDemuxContext 
> > *matroska, AVIOContext *pb,
> >   * Read the next element as an unsigned int.
> >   * Returns NEEDS_CHECKING unless size == 0.
> >   */
> > -static int ebml_read_uint(AVIOContext *pb, int size,
> > +static int ebml_read_uint(AVIOContext *pb, int64_t size,
> >uint64_t default_value, uint64_t *num)
> >  {
> >  int n = 0;
> > @@ -1010,7 +1010,7 @@ static int ebml_read_uint(AVIOContext *pb, int size,
> >   * Read the next element as a signed int.
> >   * Returns NEEDS_CHECKING unless size == 0.
> >   */
> > -static int ebml_read_sint(AVIOContext *pb, int size,
> > +static int ebml_read_sint(AVIOContext *pb, int64_t size,
> >int64_t default_value, int64_t *num)
> >  {
> >  int n = 1;
> > @@ -1033,7 +1033,7 @@ static int ebml_read_sint(AVIOContext *pb, int size,
> >   * Read the next element as a float.
> >   * Returns 0 if size == 0, NEEDS_CHECKING or < 0 on obvious failure.
> >   */
> > -static int ebml_read_float(AVIOContext *pb, int size,
> > +static int ebml_read_float(AVIOContext *pb, int64_t size,
> > double default_value, double *num)
> >  {
> >  if (size == 0) {
> 
> The values are already checked before that (via the max_lengths list).

Patch droped
teh issue is already marked as false positive as it was mixed with other false 
positive stuff

thx

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

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


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] [FFmpeg-cvslog] avformat/mov: export cropping values from clap boxes

2024-07-12 Thread Michael Niedermayer
On Thu, Jul 11, 2024 at 01:31:23PM +, James Almer wrote:
> ffmpeg | branch: master | James Almer  | Mon Jul  8 
> 20:50:18 2024 -0300| [93be6b425ebeb6cf96faf502281a4f7a1ed5138c] | committer: 
> James Almer
> 
> avformat/mov: export cropping values from clap boxes
> 
> Addresses part of ticket #7437.
> 
> Signed-off-by: James Almer 
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93be6b425ebeb6cf96faf502281a4f7a1ed5138c
> ---
> 
>  libavformat/mov.c   | 74 
> +
>  tests/ref/fate/aic  | 32 +++---
>  tests/ref/fate/prores-transparency  |  4 +-
>  tests/ref/fate/prores-transparency_skip |  4 +-
>  4 files changed, 94 insertions(+), 20 deletions(-)

breaks:

./ffmpeg_g -i ~/tickets/1439/in.mov -t 1 -timecode 09:59:30:06 -an -c:v dvvideo 
-pix_fmt yuv420p -an -y -bitexact /tmp/ile1439.mov

[dvvideo @ 0x7fd2d8011980] Found no DV profile for 702x576 yuv420p video. Valid 
DV profiles are:
[dvvideo @ 0x7fd2d8011980] Frame size: 720x480; pixel format: yuv411p, 
framerate: 3/1001
[dvvideo @ 0x7fd2d8011980] Frame size: 720x576; pixel format: yuv420p, 
framerate: 25/1
[dvvideo @ 0x7fd2d8011980] Frame size: 720x576; pixel format: yuv411p, 
framerate: 25/1
[dvvideo @ 0x7fd2d8011980] Frame size: 720x480; pixel format: yuv422p, 
framerate: 3/1001
[dvvideo @ 0x7fd2d8011980] Frame size: 720x576; pixel format: yuv422p, 
framerate: 25/1
[dvvideo @ 0x7fd2d8011980] Frame size: 1280x1080; pixel format: yuv422p, 
framerate: 3/1001
[dvvideo @ 0x7fd2d8011980] Frame size: 1440x1080; pixel format: yuv422p, 
framerate: 25/1
[dvvideo @ 0x7fd2d8011980] Frame size: 960x720; pixel format: yuv422p, 
framerate: 6/1001
[dvvideo @ 0x7fd2d8011980] Frame size: 960x720; pixel format: yuv422p, 
framerate: 50/1
[dvvideo @ 0x7fd2d8011980] Frame size: 720x576; pixel format: yuv420p, 
framerate: 25/1
[dvvideo @ 0x5592d5bb9040] ff_frame_thread_encoder_init failed
[vost#0:0/dvvideo @ 0x5592d5bb8b80] Error while opening encoder - maybe 
incorrect parameters such as bit_rate, rate, width or height.
[vf#0:0 @ 0x5592d5ba6e00] Error sending frames to consumers: Invalid argument
[vf#0:0 @ 0x5592d5ba6e00] Task finished with error code: -22 (Invalid argument)
[vf#0:0 @ 0x5592d5ba6e00] Terminating thread with return code -22 (Invalid 
argument)
[vost#0:0/dvvideo @ 0x5592d5bb8b80] Could not open encoder before EOF
[vost#0:0/dvvideo @ 0x5592d5bb8b80] Task finished with error code: -22 (Invalid 
argument)
[vost#0:0/dvvideo @ 0x5592d5bb8b80] Terminating thread with return code -22 
(Invalid argument)
[out#0/mov @ 0x5592d5bb79c0] Nothing was written into output file, because at 
least one of its streams received no packets.

thx

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

If you drop bombs on a foreign country and kill a hundred thousand
innocent people, expect your government to call the consequence
"unprovoked inhuman terrorist attacks" and use it to justify dropping
more bombs and killing more people. The technology changed, the idea is old.


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] [FFmpeg-cvslog] avformat/mov: export cropping values from clap boxes

2024-07-12 Thread James Almer

On 7/12/2024 1:53 PM, Michael Niedermayer wrote:

On Thu, Jul 11, 2024 at 01:31:23PM +, James Almer wrote:

ffmpeg | branch: master | James Almer  | Mon Jul  8 20:50:18 
2024 -0300| [93be6b425ebeb6cf96faf502281a4f7a1ed5138c] | committer: James Almer

avformat/mov: export cropping values from clap boxes

Addresses part of ticket #7437.

Signed-off-by: James Almer 


http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93be6b425ebeb6cf96faf502281a4f7a1ed5138c

---

  libavformat/mov.c   | 74 +
  tests/ref/fate/aic  | 32 +++---
  tests/ref/fate/prores-transparency  |  4 +-
  tests/ref/fate/prores-transparency_skip |  4 +-
  4 files changed, 94 insertions(+), 20 deletions(-)


breaks:

./ffmpeg_g -i ~/tickets/1439/in.mov -t 1 -timecode 09:59:30:06 -an -c:v dvvideo 
-pix_fmt yuv420p -an -y -bitexact /tmp/ile1439.mov

[dvvideo @ 0x7fd2d8011980] Found no DV profile for 702x576 yuv420p video. Valid 
DV profiles are:


The input file has a clap box that defines cropping, which began being 
applied by default after the aforementioned commit. You should add 
"-apply_cropping 0" to disable all cropping or "-apply_cropping 2" to 
only apply codec level cropping.

___
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 01/11] avdevice/audiotoolbox: fix mixed declaration and code

2024-07-12 Thread Marvin Scholz
Fix a bunch of "mixing declarations and code is incompatible with
standards before C99" warnings.
---
 libavdevice/audiotoolbox.m | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/libavdevice/audiotoolbox.m b/libavdevice/audiotoolbox.m
index 7d95c34593..dd607589b4 100644
--- a/libavdevice/audiotoolbox.m
+++ b/libavdevice/audiotoolbox.m
@@ -77,6 +77,9 @@ static av_cold int at_write_header(AVFormatContext *avctx)
 ATContext *ctx = (ATContext*)avctx->priv_data;
 OSStatus err = noErr;
 CFStringRef device_UID = NULL;
+const char *stream_name = avctx->url;
+AVCodecParameters *codecpar = avctx->streams[0]->codecpar;
+AudioStreamBasicDescription device_format = {0};
 AudioDeviceID *devices;
 int num_devices;
 
@@ -133,7 +136,6 @@ static av_cold int at_write_header(AVFormatContext *avctx)
 
 // get user-defined device UID or use default device
 // -audio_device_index overrides any URL given
-const char *stream_name = avctx->url;
 if (stream_name && ctx->audio_device_index == -1) {
 sscanf(stream_name, "%d", &ctx->audio_device_index);
 }
@@ -163,10 +165,8 @@ static av_cold int at_write_header(AVFormatContext *avctx)
 }
 
 av_freep(&devices);
-AVCodecParameters *codecpar = avctx->streams[0]->codecpar;
 
 // audio format
-AudioStreamBasicDescription device_format = {0};
 device_format.mSampleRate= codecpar->sample_rate;
 device_format.mFormatID  = kAudioFormatLinearPCM;
 device_format.mFormatFlags  |= (codecpar->format == AV_SAMPLE_FMT_FLT) 
? kLinearPCMFormatFlagIsFloat : 0;
@@ -237,6 +237,7 @@ static av_cold int at_write_header(AVFormatContext *avctx)
 
 static int at_write_packet(AVFormatContext *avctx, AVPacket *pkt)
 {
+AudioQueueBufferRef buf;
 ATContext *ctx = (ATContext*)avctx->priv_data;
 OSStatus err = noErr;
 
@@ -256,7 +257,7 @@ static int at_write_packet(AVFormatContext *avctx, AVPacket 
*pkt)
 }
 }
 
-AudioQueueBufferRef buf = ctx->buffer[ctx->cur_buf];
+buf = ctx->buffer[ctx->cur_buf];
 
 // copy audio data into buffer and enqueue the buffer
 memcpy(buf->mAudioData, pkt->data, buf->mAudioDataBytesCapacity);

base-commit: 85706f5136cf7c88f95843b2634dd3f7d7d2cb6d
-- 
2.39.3 (Apple Git-146)


___
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 02/11] avfilter/af_channelsplit: fix mixed declaration and code

2024-07-12 Thread Marvin Scholz
Fix a "mixing declarations and code is incompatible with standards
before C99" warning.
---
 libavfilter/af_channelsplit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_channelsplit.c b/libavfilter/af_channelsplit.c
index 43b2667750..b91195a4c6 100644
--- a/libavfilter/af_channelsplit.c
+++ b/libavfilter/af_channelsplit.c
@@ -151,6 +151,7 @@ static int query_formats(AVFilterContext *ctx)
 
 static int filter_frame(AVFilterLink *outlink, AVFrame *buf)
 {
+AVFrame *buf_out;
 AVFilterContext *ctx = outlink->src;
 ChannelSplitContext *s = ctx->priv;
 const int i = FF_OUTLINK_IDX(outlink);
@@ -159,7 +160,7 @@ static int filter_frame(AVFilterLink *outlink, AVFrame *buf)
 
 av_assert1(channel >= 0);
 
-AVFrame *buf_out = av_frame_clone(buf);
+buf_out = av_frame_clone(buf);
 if (!buf_out)
 return AVERROR(ENOMEM);
 
-- 
2.39.3 (Apple Git-146)


___
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 03/11] avdevice/avfoundation: fix mixed declarations and code

2024-07-12 Thread Marvin Scholz
Fix several "mixing declarations and code is incompatible with standards
before C99" warnings.
---
 libavdevice/avfoundation.m | 26 ++
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index c5a09c6563..17900d39d9 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -680,6 +680,7 @@ static int get_audio_config(AVFormatContext *s)
 {
 AVFContext *ctx = (AVFContext*)s->priv_data;
 CMFormatDescriptionRef format_desc;
+const AudioStreamBasicDescription *basic_desc;
 AVStream* stream = avformat_new_stream(s, NULL);
 
 if (!stream) {
@@ -698,7 +699,7 @@ static int get_audio_config(AVFormatContext *s)
 avpriv_set_pts_info(stream, 64, 1, avf_time_base);
 
 format_desc = CMSampleBufferGetFormatDescription(ctx->current_audio_frame);
-const AudioStreamBasicDescription *basic_desc = 
CMAudioFormatDescriptionGetStreamBasicDescription(format_desc);
+basic_desc = 
CMAudioFormatDescriptionGetStreamBasicDescription(format_desc);
 
 if (!basic_desc) {
 unlock_frames(ctx);
@@ -765,7 +766,9 @@ static int get_audio_config(AVFormatContext *s)
 
 static NSArray* getDevicesWithMediaType(AVMediaType mediaType) {
 #if ((TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 10) || 
(TARGET_OS_OSX && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500))
+AVCaptureDeviceDiscoverySession *captureDeviceDiscoverySession;
 NSMutableArray *deviceTypes = nil;
+
 if (mediaType == AVMediaTypeVideo) {
 deviceTypes = [NSMutableArray 
arrayWithArray:@[AVCaptureDeviceTypeBuiltInWideAngleCamera]];
 #if (TARGET_OS_IPHONE && __IPHONE_OS_VERSION_MIN_REQUIRED >= 10)
@@ -810,7 +813,7 @@ static int get_audio_config(AVFormatContext *s)
 return nil;
 }
 
-AVCaptureDeviceDiscoverySession *captureDeviceDiscoverySession =
+captureDeviceDiscoverySession =
 [AVCaptureDeviceDiscoverySession
 discoverySessionWithDeviceTypes:deviceTypes
   mediaType:mediaType
@@ -899,8 +902,9 @@ static int avf_read_header(AVFormatContext *s)
 } else if (ctx->video_device_index < ctx->num_video_devices + 
num_screens) {
 #if !TARGET_OS_IPHONE && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
 CGDirectDisplayID screens[num_screens];
+AVCaptureScreenInput* capture_screen_input;
 CGGetActiveDisplayList(num_screens, screens, &num_screens);
-AVCaptureScreenInput* capture_screen_input = 
[[[AVCaptureScreenInput alloc] 
initWithDisplayID:screens[ctx->video_device_index - ctx->num_video_devices]] 
autorelease];
+capture_screen_input = [[[AVCaptureScreenInput alloc] 
initWithDisplayID:screens[ctx->video_device_index - ctx->num_video_devices]] 
autorelease];
 
 if (ctx->framerate.num > 0) {
 capture_screen_input.minFrameDuration = 
CMTimeMake(ctx->framerate.den, ctx->framerate.num);
@@ -954,8 +958,9 @@ static int avf_read_header(AVFormatContext *s)
 int idx;
 if(sscanf(ctx->video_filename, "Capture screen %d", &idx) && idx < 
num_screens) {
 CGDirectDisplayID screens[num_screens];
+AVCaptureScreenInput* capture_screen_input;
 CGGetActiveDisplayList(num_screens, screens, &num_screens);
-AVCaptureScreenInput* capture_screen_input = 
[[[AVCaptureScreenInput alloc] initWithDisplayID:screens[idx]] autorelease];
+capture_screen_input = [[[AVCaptureScreenInput alloc] 
initWithDisplayID:screens[idx]] autorelease];
 video_device = (AVCaptureDevice*) capture_screen_input;
 ctx->video_device_index = ctx->num_video_devices + idx;
 ctx->video_is_screen = 1;
@@ -1123,10 +1128,12 @@ static int avf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 do {
 CVImageBufferRef image_buffer;
 CMBlockBufferRef block_buffer;
+CMItemCount count;
+CMSampleTimingInfo timing_info;
 lock_frames(ctx);
 
 if (ctx->current_frame != nil) {
-int status;
+int status = 0;
 int length = 0;
 
 image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
@@ -1146,9 +1153,6 @@ static int avf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 return AVERROR(EIO);
 }
 
-CMItemCount count;
-CMSampleTimingInfo timing_info;
-
 if 
(CMSampleBufferGetOutputSampleTimingInfoArray(ctx->current_frame, 1, 
&timing_info, &count) == noErr) {
 AVRational timebase_q = av_make_q(1, 
timing_info.presentationTimeStamp.timescale);
 pkt->pts = pkt->dts = 
av_rescale_q(timing_info.presentationTimeStamp.value, timebase_q, 
avf_time_base_q);
@@ -1160,7 +1164,6 @@ static int avf_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 if (image_buffer) {
   

[FFmpeg-devel] [PATCH 04/11] avdevice/avfoundation: remove write-only variable

2024-07-12 Thread Marvin Scholz
The block_buffer was only ever written to but then never used in the
following code, making it unnecessary.

Fixes a "variable 'block_buffer' set but not used" compiler warning.
---
 libavdevice/avfoundation.m | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavdevice/avfoundation.m b/libavdevice/avfoundation.m
index 17900d39d9..72a7f24b7d 100644
--- a/libavdevice/avfoundation.m
+++ b/libavdevice/avfoundation.m
@@ -632,7 +632,6 @@ static int get_video_config(AVFormatContext *s)
 {
 AVFContext *ctx = (AVFContext*)s->priv_data;
 CVImageBufferRef image_buffer;
-CMBlockBufferRef block_buffer;
 CGSize image_buffer_size;
 AVStream* stream = avformat_new_stream(s, NULL);
 
@@ -652,7 +651,6 @@ static int get_video_config(AVFormatContext *s)
 avpriv_set_pts_info(stream, 64, 1, avf_time_base);
 
 image_buffer = CMSampleBufferGetImageBuffer(ctx->current_frame);
-block_buffer = CMSampleBufferGetDataBuffer(ctx->current_frame);
 
 if (image_buffer) {
 image_buffer_size = CVImageBufferGetEncodedSize(image_buffer);
-- 
2.39.3 (Apple Git-146)


___
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 05/11] lavfi/metal: fix mixed declaration and code

2024-07-12 Thread Marvin Scholz
Fix a "mixing declarations and code is incompatible with standards
before C99" warning.
---
 libavfilter/metal/utils.m | 12 
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/libavfilter/metal/utils.m b/libavfilter/metal/utils.m
index f365d3ceea..d5c85e619d 100644
--- a/libavfilter/metal/utils.m
+++ b/libavfilter/metal/utils.m
@@ -24,11 +24,15 @@ void ff_metal_compute_encoder_dispatch(id device,
id encoder,
NSUInteger width, NSUInteger height)
 {
-[encoder setComputePipelineState:pipeline];
-NSUInteger w = pipeline.threadExecutionWidth;
-NSUInteger h = pipeline.maxTotalThreadsPerThreadgroup / w;
-MTLSize threadsPerThreadgroup = MTLSizeMake(w, h, 1);
 BOOL fallback = YES;
+MTLSize threadsPerThreadgroup;
+NSUInteger w, h;
+
+[encoder setComputePipelineState:pipeline];
+w = pipeline.threadExecutionWidth;
+h = pipeline.maxTotalThreadsPerThreadgroup / w;
+threadsPerThreadgroup = MTLSizeMake(w, h, 1);
+
 // MAC_OS_X_VERSION_10_15 is only defined on SDKs new enough to include 
its functionality (including iOS, tvOS, etc)
 #ifdef MAC_OS_X_VERSION_10_15
 if (@available(macOS 10.15, iOS 11, tvOS 14.5, *)) {
-- 
2.39.3 (Apple Git-146)


___
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 06/11] lavfi/metal: simplify fallback

2024-07-12 Thread Marvin Scholz
Instead of using a fallback variable, just do an early return.
---
 libavfilter/metal/utils.m | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavfilter/metal/utils.m b/libavfilter/metal/utils.m
index d5c85e619d..6a9e5ef7cf 100644
--- a/libavfilter/metal/utils.m
+++ b/libavfilter/metal/utils.m
@@ -24,7 +24,6 @@ void ff_metal_compute_encoder_dispatch(id device,
id encoder,
NSUInteger width, NSUInteger height)
 {
-BOOL fallback = YES;
 MTLSize threadsPerThreadgroup;
 NSUInteger w, h;
 
@@ -39,11 +38,13 @@ void ff_metal_compute_encoder_dispatch(id device,
 if ([device supportsFamily:MTLGPUFamilyCommon3]) {
 MTLSize threadsPerGrid = MTLSizeMake(width, height, 1);
 [encoder dispatchThreads:threadsPerGrid 
threadsPerThreadgroup:threadsPerThreadgroup];
-fallback = NO;
+return;
 }
 }
 #endif
-if (fallback) {
+
+// Fallback path, if we took the above one we already returned so none of 
this is reached
+{
 MTLSize threadgroups = MTLSizeMake((width + w - 1) / w,
(height + h - 1) / h,
1);
-- 
2.39.3 (Apple Git-146)


___
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 07/11] avfilter/vf_coreimage: fix mixed declaration and code

2024-07-12 Thread Marvin Scholz
Fix several "mixing declarations and code is incompatible with
standards before C99" warnings.
---
 libavfilter/vf_coreimage.m | 60 ++
 1 file changed, 29 insertions(+), 31 deletions(-)

diff --git a/libavfilter/vf_coreimage.m b/libavfilter/vf_coreimage.m
index 4d4cdfb7c7..bfc17764b5 100644
--- a/libavfilter/vf_coreimage.m
+++ b/libavfilter/vf_coreimage.m
@@ -66,6 +66,7 @@
 static int config_output(AVFilterLink *link)
 {
 CoreImageContext *ctx = link->src->priv;
+const AVPixFmtDescriptor *desc;
 
 link->w   = ctx->w;
 link->h   = ctx->h;
@@ -73,7 +74,7 @@ static int config_output(AVFilterLink *link)
 link->frame_rate  = ctx->frame_rate;
 link->time_base   = ctx->time_base;
 
-const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);
+desc   = av_pix_fmt_desc_get(link->format);
 ctx->bits_per_component= av_get_bits_per_pixel(desc) / 
desc->nb_components;
 
 return 0;
@@ -106,14 +107,13 @@ static void list_filters(CoreImageContext *ctx)
 
 NSString *filter_name;
 while (filter_name = [filters nextObject]) {
-av_log(ctx, AV_LOG_INFO, "Filter: %s\n", [filter_name UTF8String]);
-NSString *input;
-
 CIFilter *filter = [CIFilter filterWithName:filter_name];
 NSDictionary *filter_attribs = [filter attributes]; // 
 NSArray  *filter_inputs  = [filter inputKeys];  // 
 
-for (input in filter_inputs) {
+av_log(ctx, AV_LOG_INFO, "Filter: %s\n", [filter_name UTF8String]);
+
+for (NSString *input in filter_inputs) {
 NSDictionary *input_attribs = [filter_attribs valueForKey:input];
 NSString *input_class   = [input_attribs 
valueForKey:kCIAttributeClass];
 if ([input_class isEqualToString:@"NSNumber"]) {
@@ -139,6 +139,11 @@ static void list_filters(CoreImageContext *ctx)
 static int apply_filter(CoreImageContext *ctx, AVFilterLink *link, AVFrame 
*frame)
 {
 int i;
+CGImageRef out;
+CGRect out_rect;
+CIFilter *filter= NULL;
+CIImage  *filter_input  = (__bridge CIImage*)ctx->input_image;
+CIImage  *filter_output = NULL;
 
 // (re-)initialize input image
 const CGSize frame_size = {
@@ -150,26 +155,22 @@ static int apply_filter(CoreImageContext *ctx, 
AVFilterLink *link, AVFrame *fram
length:frame->height*frame->linesize[0]
freeWhenDone:NO];
 
-CIImage *ret = [(__bridge CIImage*)ctx->input_image initWithBitmapData:data
-
bytesPerRow:frame->linesize[0]
-size:frame_size
-format:kCIFormatARGB8
-
colorSpace:ctx->color_space]; //kCGColorSpaceGenericRGB
+CIImage *ret = [filter_input initWithBitmapData:data
+ bytesPerRow:frame->linesize[0]
+ size:frame_size
+ format:kCIFormatARGB8
+ colorSpace:ctx->color_space]; 
//kCGColorSpaceGenericRGB
 if (!ret) {
 av_log(ctx, AV_LOG_ERROR, "Input image could not be initialized.\n");
 return AVERROR_EXTERNAL;
 }
 
-CIFilter *filter   = NULL;
-CIImage *filter_input  = (__bridge CIImage*)ctx->input_image;
-CIImage *filter_output = NULL;
-
 // successively apply all filters
 for (i = 0; i < ctx->num_filters; i++) {
 if (i) {
 // set filter input to previous filter output
 filter_input= [(__bridge CIImage*)ctx->filters[i-1] 
valueForKey:kCIOutputImageKey];
-CGRect out_rect = [filter_input extent];
+out_rect = [filter_input extent];
 if (out_rect.size.width > frame->width || out_rect.size.height > 
frame->height) {
 // do not keep padded image regions after filtering
 out_rect.origin.x= 0.0f;
@@ -206,7 +207,7 @@ static int apply_filter(CoreImageContext *ctx, AVFilterLink 
*link, AVFrame *fram
 }
 
 // do not keep padded image regions after filtering
-CGRect out_rect = [filter_output extent];
+out_rect = [filter_output extent];
 if (out_rect.size.width > frame->width || out_rect.size.height > 
frame->height) {
 av_log(ctx, AV_LOG_DEBUG, "Cropping output image.\n");
 out_rect.origin.x= 0.0f;
@@ -215,8 +216,8 @@ static int apply_filter(CoreImageContext *ctx, AVFilterLink 
*link, AVFrame *fram
 out_rect.size.height = frame->height;
 }
 
-CGImageRef out = [(__bridge CIContext*)ctx->glctx 
createCGImage:filter_output
-  fromRect:out_rect];
+out = [(__bridge CIContext*)ctx->glctx createCGImage:filter_out

[FFmpeg-devel] [PATCH 08/11] avfilter/vf_coreimage: simplify list_filters code

2024-07-12 Thread Marvin Scholz
Use fast-enumeration and get rid of unnecessary intermediate variables.
---
 libavfilter/vf_coreimage.m | 13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/libavfilter/vf_coreimage.m b/libavfilter/vf_coreimage.m
index bfc17764b5..38355414bd 100644
--- a/libavfilter/vf_coreimage.m
+++ b/libavfilter/vf_coreimage.m
@@ -102,18 +102,13 @@ static void list_filters(CoreImageContext *ctx)
 filter_categories = [NSArray arrayWithObjects:kCICategoryGenerator, 
nil];
 }
 
-NSArray *filter_names = [CIFilter 
filterNamesInCategories:filter_categories];
-NSEnumerator *filters = [filter_names objectEnumerator];
-
-NSString *filter_name;
-while (filter_name = [filters nextObject]) {
-CIFilter *filter = [CIFilter filterWithName:filter_name];
-NSDictionary *filter_attribs = [filter attributes]; // 
-NSArray  *filter_inputs  = [filter inputKeys];  // 
+for (NSString *filter_name in [CIFilter 
filterNamesInCategories:filter_categories]) {
+CIFilter *filter = [CIFilter filterWithName:filter_name];
+NSDictionary *filter_attribs = [filter attributes];
 
 av_log(ctx, AV_LOG_INFO, "Filter: %s\n", [filter_name UTF8String]);
 
-for (NSString *input in filter_inputs) {
+for (NSString *input in [filter inputKeys]) {
 NSDictionary *input_attribs = [filter_attribs valueForKey:input];
 NSString *input_class   = [input_attribs 
valueForKey:kCIAttributeClass];
 if ([input_class isEqualToString:@"NSNumber"]) {
-- 
2.39.3 (Apple Git-146)


___
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 09/11] avfilter/vf_coreimage: silence AVFrame deprecation warnings

2024-07-12 Thread Marvin Scholz
Deprecation warning need to be disabled here as we set deprecated
fields.
---
 libavfilter/vf_coreimage.m | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavfilter/vf_coreimage.m b/libavfilter/vf_coreimage.m
index 38355414bd..45b16cc48a 100644
--- a/libavfilter/vf_coreimage.m
+++ b/libavfilter/vf_coreimage.m
@@ -296,14 +296,18 @@ static int request_frame(AVFilterLink *link)
 
 frame->pts = ctx->pts;
 frame->duration= 1;
+frame->flags  |= AV_FRAME_FLAG_KEY;
+frame->flags  &= ~AV_FRAME_FLAG_INTERLACED;
+
+FF_DISABLE_DEPRECATION_WARNINGS
 #if FF_API_FRAME_KEY
 frame->key_frame   = 1;
 #endif
-frame->flags  |= AV_FRAME_FLAG_KEY;
 #if FF_API_INTERLACED_FRAME
 frame->interlaced_frame= 0;
 #endif
-frame->flags  &= ~AV_FRAME_FLAG_INTERLACED;
+FF_ENABLE_DEPRECATION_WARNINGS
+
 frame->pict_type   = AV_PICTURE_TYPE_I;
 frame->sample_aspect_ratio = ctx->sar;
 
-- 
2.39.3 (Apple Git-146)


___
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 10/11] avfilter/yadif_common: remove unused variable

2024-07-12 Thread Marvin Scholz
---
 libavfilter/vf_yadif_videotoolbox.m | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavfilter/vf_yadif_videotoolbox.m 
b/libavfilter/vf_yadif_videotoolbox.m
index c47d3edfb8..eb7026395e 100644
--- a/libavfilter/vf_yadif_videotoolbox.m
+++ b/libavfilter/vf_yadif_videotoolbox.m
@@ -172,7 +172,6 @@ static void filter(AVFilterContext *ctx, AVFrame *dst,
 static av_cold void do_uninit(AVFilterContext *ctx) 
API_AVAILABLE(macos(10.11), ios(8.0))
 {
 YADIFVTContext *s = ctx->priv;
-YADIFContext *y = &s->yadif;
 
 ff_yadif_uninit(ctx);
 
-- 
2.39.3 (Apple Git-146)


___
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 11/11] avfilter/yadif_common: fix mixed declaration and code

2024-07-12 Thread Marvin Scholz
Fix a "mixing declarations and code is incompatible with standards
before C99" warning.
---
 libavfilter/vf_yadif_videotoolbox.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavfilter/vf_yadif_videotoolbox.m 
b/libavfilter/vf_yadif_videotoolbox.m
index eb7026395e..5cc7585f3f 100644
--- a/libavfilter/vf_yadif_videotoolbox.m
+++ b/libavfilter/vf_yadif_videotoolbox.m
@@ -205,6 +205,7 @@ static av_cold int do_init(AVFilterContext *ctx) 
API_AVAILABLE(macos(10.11), ios
 YADIFVTContext *s = ctx->priv;
 NSError *err = nil;
 CVReturn ret;
+dispatch_data_t libData;
 
 s->mtlDevice = MTLCreateSystemDefaultDevice();
 if (!s->mtlDevice) {
@@ -214,7 +215,7 @@ static av_cold int do_init(AVFilterContext *ctx) 
API_AVAILABLE(macos(10.11), ios
 
 av_log(ctx, AV_LOG_INFO, "Using Metal device: %s\n", 
s->mtlDevice.name.UTF8String);
 
-dispatch_data_t libData = dispatch_data_create(
+libData = dispatch_data_create(
 ff_vf_yadif_videotoolbox_metallib_data,
 ff_vf_yadif_videotoolbox_metallib_len,
 nil,
-- 
2.39.3 (Apple Git-146)
___
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/3] avutil/avassert: Add av_assert_unreachable()

2024-07-12 Thread Marvin Scholz
---
 libavutil/avassert.h | 12 
 1 file changed, 12 insertions(+)

diff --git a/libavutil/avassert.h b/libavutil/avassert.h
index 1895fb7551..cdab912fe4 100644
--- a/libavutil/avassert.h
+++ b/libavutil/avassert.h
@@ -75,4 +75,16 @@
  */
 void av_assert0_fpu(void);
 
+/**
+ * Assert this can not be reached
+ */
+#if AV_HAS_BUILTIN(__builtin_unreachable)
+#define av_assert_unreachable() do {   \
+av_assert2(0);  \
+__builtin_unreachable();\
+} while (0)
+#else
+#define av_assert_unreachable() av_assert2(0)
+#endif
+
 #endif /* AVUTIL_AVASSERT_H */

base-commit: 85706f5136cf7c88f95843b2634dd3f7d7d2cb6d
-- 
2.39.3 (Apple Git-146)


___
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/3] avfilter/af_afftdn: use av_assert_unreachable

2024-07-12 Thread Marvin Scholz
Fixes a compiler warning about mag possibly being uninitialised.
---
 libavfilter/af_afftdn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c
index a2e6ca6107..f26b620cfb 100644
--- a/libavfilter/af_afftdn.c
+++ b/libavfilter/af_afftdn.c
@@ -378,7 +378,7 @@ static void process_frame(AVFilterContext *ctx,
 noisy_data[i] = mag = hypot(fft_data_dbl[i].re, 
fft_data_dbl[i].im);
 break;
 default:
-av_assert2(0);
+av_assert_unreachable();
 }
 
 power = mag * mag;
-- 
2.39.3 (Apple Git-146)


___
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 3/3] avcodec/pcm-dvdenc: use av_assert_unreachable

2024-07-12 Thread Marvin Scholz
Fixes a compiler warning about quant possibly being uninitialised.
---
 libavcodec/pcm-dvdenc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pcm-dvdenc.c b/libavcodec/pcm-dvdenc.c
index 71e9b6915a..f553d8076a 100644
--- a/libavcodec/pcm-dvdenc.c
+++ b/libavcodec/pcm-dvdenc.c
@@ -58,7 +58,7 @@ static av_cold int pcm_dvd_encode_init(AVCodecContext *avctx)
 quant = 2;
 break;
 default:
-av_assert1(0);
+av_assert_unreachable();
 }
 
 avctx->bits_per_coded_sample = 16 + quant * 4;
-- 
2.39.3 (Apple Git-146)
___
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] ffbuild: add METALCC and METALLIB to BRIEF

2024-07-12 Thread Marvin Scholz
---
 ffbuild/common.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ffbuild/common.mak b/ffbuild/common.mak
index 87a3ffd2b0..023adb8567 100644
--- a/ffbuild/common.mak
+++ b/ffbuild/common.mak
@@ -18,7 +18,7 @@ BIN2C = $(BIN2CEXE)
 ifndef V
 Q  = @
 ECHO   = printf "$(1)\t%s\n" $(2)
-BRIEF  = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD STRIP CP WINDRES NVCC BIN2C
+BRIEF  = CC CXX OBJCC HOSTCC HOSTLD AS X86ASM AR LD STRIP CP WINDRES NVCC 
BIN2C METALCC METALLIB
 SILENT = DEPCC DEPHOSTCC DEPAS DEPX86ASM RANLIB RM
 
 MSG= $@

base-commit: 85706f5136cf7c88f95843b2634dd3f7d7d2cb6d
-- 
2.39.3 (Apple Git-146)
___
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] avcodec/pngdec: avoid erroring with sBIT on indexed-color images

2024-07-12 Thread Leo Izen
Indexed color images use three colors for sBIT, but the function
ff_png_get_nb_channels returns 1 in this case. We should avoid erroring
out on valid files in this scenario.

Signed-off-by: Leo Izen 
Reported-by: Ramiro Polla 
---
 libavcodec/pngdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index 180806e5e1..b0d02c97dd 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1084,7 +1084,7 @@ static int decode_sbit_chunk(AVCodecContext *avctx, 
PNGDecContext *s,
 return AVERROR_INVALIDDATA;
 }
 
-channels = ff_png_get_nb_channels(s->color_type);
+channels = s->color_type & PNG_COLOR_MASK_PALETTE ? 3 : 
ff_png_get_nb_channels(s->color_type);
 
 if (bytestream2_get_bytes_left(gb) != channels)
 return AVERROR_INVALIDDATA;
-- 
2.45.2

___
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] avcodec/png: more informative error message for invalid sBIT size

2024-07-12 Thread Leo Izen
If the sBIT chunk size is invalid, we should print a more informative
error message rather than return an error and print nothing.

Signed-off-by: Leo Izen 
---
 libavcodec/pngdec.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
index b0d02c97dd..cb861e5f60 100644
--- a/libavcodec/pngdec.c
+++ b/libavcodec/pngdec.c
@@ -1086,8 +1086,11 @@ static int decode_sbit_chunk(AVCodecContext *avctx, 
PNGDecContext *s,
 
 channels = s->color_type & PNG_COLOR_MASK_PALETTE ? 3 : 
ff_png_get_nb_channels(s->color_type);
 
-if (bytestream2_get_bytes_left(gb) != channels)
+if (bytestream2_get_bytes_left(gb) != channels) {
+av_log(avctx, AV_LOG_ERROR, "Invalid sBIT size: %d, expected: %d\n",
+bytestream2_get_bytes_left(gb), channels);
 return AVERROR_INVALIDDATA;
+}
 
 for (int i = 0; i < channels; i++) {
 int b = bytestream2_get_byteu(gb);
-- 
2.45.2

___
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] MAINTAINERS: add myself as d3d12va_encode maintainer

2024-07-12 Thread Michael Niedermayer
On Tue, Jul 09, 2024 at 02:41:20PM +0200, Michael Niedermayer wrote:
> On Mon, Jul 08, 2024 at 03:16:28PM +, Tong Wu wrote:
> > Ping. As the author of d3d12va_encode, I would like to get the access in 
> > order maintain the code and add more new features.
> 
> will apply

Before adding your key, can you explain why your email domain changed from
intel.com to outlook at about the time you volunteer as mainatiner ?

I tried to mail the intel.com address but it bounced, which is why i am posting
here

Tong Wu (tong1...@intel.com)
A communication failure occurred during the delivery of this message. Please 
try resending the message later. If the problem continues, contact your email 
admin.

BN2PEPF44AB.mail.protection.outlook.com gave this error:
Recipient address rejected: Access denied. 
[BN2PEPF44AB.namprd04.prod.outlook.com 2024-07-12T19:12:51.273Z 
08DC9DE0F46B8D63]

also if you use multiple email addresses in git, best to add them to .mailmap

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


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] [FFmpeg-cvslog] avformat/mov: export cropping values from clap boxes

2024-07-12 Thread Michael Niedermayer
On Fri, Jul 12, 2024 at 01:57:43PM -0300, James Almer wrote:
> On 7/12/2024 1:53 PM, Michael Niedermayer wrote:
> > On Thu, Jul 11, 2024 at 01:31:23PM +, James Almer wrote:
> > > ffmpeg | branch: master | James Almer  | Mon Jul  8 
> > > 20:50:18 2024 -0300| [93be6b425ebeb6cf96faf502281a4f7a1ed5138c] | 
> > > committer: James Almer
> > > 
> > > avformat/mov: export cropping values from clap boxes
> > > 
> > > Addresses part of ticket #7437.
> > > 
> > > Signed-off-by: James Almer 
> > > 
> > > > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93be6b425ebeb6cf96faf502281a4f7a1ed5138c
> > > ---
> > > 
> > >   libavformat/mov.c   | 74 
> > > +
> > >   tests/ref/fate/aic  | 32 +++---
> > >   tests/ref/fate/prores-transparency  |  4 +-
> > >   tests/ref/fate/prores-transparency_skip |  4 +-
> > >   4 files changed, 94 insertions(+), 20 deletions(-)
> > 
> > breaks:
> > 
> > ./ffmpeg_g -i ~/tickets/1439/in.mov -t 1 -timecode 09:59:30:06 -an -c:v 
> > dvvideo -pix_fmt yuv420p -an -y -bitexact /tmp/ile1439.mov
> > 
> > [dvvideo @ 0x7fd2d8011980] Found no DV profile for 702x576 yuv420p video. 
> > Valid DV profiles are:
> 
> The input file has a clap box that defines cropping, which began being
> applied by default after the aforementioned commit.

I did realize that, i reported that anyway as it was a interresting failure


> You should add
> "-apply_cropping 0" to disable all cropping or "-apply_cropping 2" to only
> apply codec level cropping.

thx ill use that

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


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/2] avcodec/png: more informative error message for invalid sBIT size

2024-07-12 Thread Paul B Mahol
You are deeply confused.


Checking with != for overread bytes is wrong.
___
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 v4 1/3] avcodec/jpeg2000dec: Add support for CAP and CPF markers

2024-07-12 Thread Pierre-Anthony Lemieux
On Thu, Jul 11, 2024 at 10:28 PM Tomas Härdin  wrote:
>
> > +if (s->in_tile_headers == 1 && s->isHT && (!s-
> > >Ccap15_b11))
> > +av_log(s->avctx, AV_LOG_WARNING, "COD marker is
> > found in HOMOGENEOUS HT set\n");
>
> How bad is this and the other markers being present in this case?

At the very least, it means that signaling is inconsistent within the
codestream since the standard states that:
"""
The HOMOGENEOUS set is the set of HTJ2K codestreams where:
• none of the functional marker segments, e.g., COD, COC, RGN, QCD,
QCC, and POC, are present in any
tile-part header; and
• no PPT marker segment is present.
"""

The point of signalling that a codestream is "HOMOGENEOUS" is to allow
decoders to configure themselves solely based on information retrieved
entirely from the main header.

Since, AFAIK, FFMPEG does not rely on the HOMOGENEOUS to short-circuit
configuration, incorrect HOMOGENEOUS signalling will likely not impact
FFMPEG.

This condition may impact downstream decoders and might signal
something deeply wrong with the codestream.

In any case, maybe the case ought to be clarified to something along
the lines of: "Non-conformant codestream: a COD marker is present in a
tile-part header even though the codestream is marked as HOMOGENEOUS."

> Should we perhaps error out?
>
> /Tomas
> ___
> 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 1/6] avfilter/vf_tiltandshift: Free dst on error

2024-07-12 Thread Michael Niedermayer
On Fri, Jul 12, 2024 at 12:19:29AM +0200, Vittorio Giovara wrote:
> On Thu, Jul 11, 2024 at 12:50 AM Michael Niedermayer 
> wrote:
> 
> > Fixes: CID1559901 Resource leak
> >
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavfilter/vf_tiltandshift.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/vf_tiltandshift.c b/libavfilter/vf_tiltandshift.c
> > index b49a713339d..08bcb062473 100644
> > --- a/libavfilter/vf_tiltandshift.c
> > +++ b/libavfilter/vf_tiltandshift.c
> > @@ -237,8 +237,10 @@ static int output_frame(AVFilterLink *outlink)
> >
> >  // set correct timestamps and props as long as there is proper input
> >  ret = av_frame_copy_props(dst, s->input);
> > -if (ret < 0)
> > +if (ret < 0) {
> > +av_frame_free(&dst);
> >  return ret;
> > +}
> >
> >  // discard frame at the top of the list since it has been fully
> > processed
> >  list_remove_head(s);
> > --
> >
> 
> lgtm

will apply

thx

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

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2



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] avutil/imgutils: av_image_check_size2() ensure width and height fit in 32bit

2024-07-12 Thread Michael Niedermayer
On Wed, Jul 10, 2024 at 12:52:39PM -0300, James Almer wrote:
> On 7/10/2024 12:49 PM, Michael Niedermayer wrote:
> > width and height > 32bit is not supported and its easier to check in a 
> > central place
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >   libavutil/imgutils.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
> > index d2463815637..b738cff37c2 100644
> > --- a/libavutil/imgutils.c
> > +++ b/libavutil/imgutils.c
> > @@ -298,7 +298,7 @@ int av_image_check_size2(unsigned int w, unsigned int 
> > h, int64_t max_pixels, enu
> >   stride = 8LL*w;
> >   stride += 128*8;
> > -if ((int)w<=0 || (int)h<=0 || stride >= INT_MAX || 
> > stride*(uint64_t)(h+128) >= INT_MAX) {
> > +if (w==0 || h==0 || w > INT32_MAX || h > INT32_MAX || stride >= 
> > INT_MAX || stride*(uint64_t)(h+128) >= INT_MAX) {
> 
> You could do stride*(h+128ULL) while at it, to make the line more readable.

will apply with this change

thx

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

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


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] [FFmpeg-cvslog] avformat/mov: export cropping values from clap boxes

2024-07-12 Thread James Almer

On 7/12/2024 4:34 PM, Michael Niedermayer wrote:

On Fri, Jul 12, 2024 at 01:57:43PM -0300, James Almer wrote:

On 7/12/2024 1:53 PM, Michael Niedermayer wrote:

On Thu, Jul 11, 2024 at 01:31:23PM +, James Almer wrote:

ffmpeg | branch: master | James Almer  | Mon Jul  8 20:50:18 
2024 -0300| [93be6b425ebeb6cf96faf502281a4f7a1ed5138c] | committer: James Almer

avformat/mov: export cropping values from clap boxes

Addresses part of ticket #7437.

Signed-off-by: James Almer 


http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=93be6b425ebeb6cf96faf502281a4f7a1ed5138c

---

   libavformat/mov.c   | 74 
+
   tests/ref/fate/aic  | 32 +++---
   tests/ref/fate/prores-transparency  |  4 +-
   tests/ref/fate/prores-transparency_skip |  4 +-
   4 files changed, 94 insertions(+), 20 deletions(-)


breaks:

./ffmpeg_g -i ~/tickets/1439/in.mov -t 1 -timecode 09:59:30:06 -an -c:v dvvideo 
-pix_fmt yuv420p -an -y -bitexact /tmp/ile1439.mov

[dvvideo @ 0x7fd2d8011980] Found no DV profile for 702x576 yuv420p video. Valid 
DV profiles are:


The input file has a clap box that defines cropping, which began being
applied by default after the aforementioned commit.


I did realize that, i reported that anyway as it was a interresting failure



You should add
"-apply_cropping 0" to disable all cropping or "-apply_cropping 2" to only
apply codec level cropping.


thx ill use that


All values for apply_cropping are documented in ffmpeg.texi. It used to 
be a bool but now it also accepts 2 and 3 (And const aliases for all 
four values).


I wouldn't use 0 in general, before or after the above commit, as codec 
level cropping is almost always desirable (1080p h264 samples would 
decode as 1088 lines otherwise, for example), so IMO use 2/codec to 
disable container cropping and only leave codec cropping on for this 
kind of scenario.

___
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] avfilter/af_surround: Check output format

2024-07-12 Thread Michael Niedermayer
Fixes: CID1516994 Out-of-bounds access
Fixes: CID1516996 Out-of-bounds access
Fixes: CID1516999 Out-of-bounds access

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer 
---
 libavfilter/af_surround.c | 25 +
 1 file changed, 25 insertions(+)

diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c
index e37dddc3614..d42a23b8ad2 100644
--- a/libavfilter/af_surround.c
+++ b/libavfilter/af_surround.c
@@ -1123,6 +1123,31 @@ static av_cold int init(AVFilterContext *ctx)
 s->create_lfe = av_channel_layout_index_from_channel(&s->out_ch_layout,
  
AV_CHAN_LOW_FREQUENCY) >= 0;
 
+switch (out_channel_layout) {
+case AV_CH_LAYOUT_MONO:
+case AV_CH_LAYOUT_STEREO:
+case AV_CH_LAYOUT_2POINT1:
+case AV_CH_LAYOUT_2_1:
+case AV_CH_LAYOUT_2_2:
+case AV_CH_LAYOUT_SURROUND:
+case AV_CH_LAYOUT_3POINT1:
+case AV_CH_LAYOUT_QUAD:
+case AV_CH_LAYOUT_4POINT0:
+case AV_CH_LAYOUT_4POINT1:
+case AV_CH_LAYOUT_5POINT0:
+case AV_CH_LAYOUT_5POINT1:
+case AV_CH_LAYOUT_5POINT0_BACK:
+case AV_CH_LAYOUT_5POINT1_BACK:
+case AV_CH_LAYOUT_6POINT0:
+case AV_CH_LAYOUT_6POINT1:
+case AV_CH_LAYOUT_7POINT0:
+case AV_CH_LAYOUT_7POINT1:
+case AV_CH_LAYOUT_OCTAGONAL:
+break;
+default:
+goto fail;
+}
+
 switch (in_channel_layout) {
 case AV_CH_LAYOUT_STEREO:
 s->filter = filter_stereo;
-- 
2.45.2

___
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/6] avcodec/vaapi_h264: Do not store our error code in VASliceParameterBufferH264

2024-07-12 Thread Michael Niedermayer
On Tue, Jul 09, 2024 at 06:11:54AM +, Xiang, Haihao wrote:
> On So, 2024-07-07 at 20:47 +0200, Michael Niedermayer wrote:
> > I am not sure this is possible (thus this requires review)
> > 
> > Fixes: CID1604570 Overflowed constant
> > 
> > Sponsored-by: Sovereign Tech Fund
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/vaapi_h264.c | 6 +-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
> > index 398e92568c2..77819a64a4e 100644
> > --- a/libavcodec/vaapi_h264.c
> > +++ b/libavcodec/vaapi_h264.c
> > @@ -342,6 +342,10 @@ static int vaapi_h264_decode_slice(AVCodecContext 
> > *avctx,
> >  const H264SliceContext *sl  = &h->slice_ctx[0];
> >  VASliceParameterBufferH264 slice_param;
> >  int err;
> > +    int slice_type = ff_h264_get_slice_type(sl);
> > +
> > +    if (slice_type < 0)
> > +    return slice_type;
> 
> sl->slice_type should be one of AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B,
> AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_SP and AV_PICTURE_TYPE_SI when this 
> callback
> function is called, I don't think the if statement is required. 

patch dropped, i will mark this as false positive

thanks


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

What does censorship reveal? It reveals fear. -- Julian Assange


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 01/15] avcodec/xsubdec: Check parse_timecode()

2024-07-12 Thread Michael Niedermayer
On Fri, Jul 05, 2024 at 02:21:42AM +0200, Michael Niedermayer wrote:
> Fixes: CID1604490 Overflowed constant
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/xsubdec.c | 11 +--
>  1 file changed, 9 insertions(+), 2 deletions(-)

will apply patchset

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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/osq: avoid signed overflow in downsample path

2024-07-12 Thread Michael Niedermayer
On Fri, Jun 21, 2024 at 09:35:48PM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 865309950 * 256 cannot be represented in type 
> 'int'
> Fixes: 
> 69191/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_OSQ_fuzzer-6310214413385728
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/osq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


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 1/2] configure: permit POWER9 cpu flags

2024-07-12 Thread Sean McGovern
Hi,


On Wed, Jul 3, 2024, 21:24 Sean McGovern  wrote:

> ---
>  configure | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index b28221f258..bbda7a02cb 100755
> --- a/configure
> +++ b/configure
> @@ -5493,7 +5493,7 @@ elif enabled ppc; then
>  cpuflags="-mcpu=$cpu"
>  disable vsx
>  ;;
> -power[7-8]*)
> +power[7-9]*)
>  cpuflags="-mcpu=$cpu"
>  ;;
>  cell)
> --
> 2.39.2
>

Hold off on this for now, it is missing the co-requisite changes in
lavu/ppc/cpu.c

Additionally I realize there probably aren't many people who can review PPC
or AltiVec/VSX patches. Should I just keep these to myself for now? I'd
like to do more for the lavc DSP functions as well.

-- Sean McGovern

>
___
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/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode()

2024-07-12 Thread Michael Niedermayer
On Sun, May 19, 2024 at 04:49:08AM +0200, Michael Niedermayer wrote:
> This simplification assumes that the code is correct
> 
> Fixes: CID1560036 Logically dead code
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/vvc/ctu.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)

will apply

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

Concerning the gods, I have no means of knowing whether they exist or not
or of what sort they may be, because of the obscurity of the subject, and
the brevity of human life -- Protagoras


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 17/17] avdevice/dshow_filter: Use wcscpy_s()

2024-07-12 Thread Michael Niedermayer
On Mon, May 27, 2024 at 01:52:29AM +0200, Michael Niedermayer wrote:
> Fixes: CID1591929 Copy into fixed size buffer
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer 
> ---
>  libavdevice/dshow_filter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


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 1/3] avfilter/vf_avgblur_opencl: Use AV_VIDEO_MAX_PLANES

2024-07-12 Thread Michael Niedermayer
On Thu, Jun 13, 2024 at 12:22:09AM +0200, Michael Niedermayer wrote:
> Fixes: CID1437470 Out-of-bounds read (out of bounds read would only occur 
> with a pixel format of more than 4 planes)
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer 
> ---
>  libavfilter/vf_avgblur_opencl.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)

will apply patchset

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

No snowflake in an avalanche ever feels responsible. -- Voltaire


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 1/6] avcodec/tiff: Check value on positive signed targets

2024-07-12 Thread Michael Niedermayer
On Sun, Jul 07, 2024 at 08:47:24PM +0200, Michael Niedermayer wrote:
> Fixes: CID1604593 Overflowed constant
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/tiff.c | 20 ++--
>  1 file changed, 18 insertions(+), 2 deletions(-)

will apply patches 1,4,5

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


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] avutil/hwcontext_drm: Check ioctl in drm_map_frame() for failure

2024-07-12 Thread Michael Niedermayer
On Mon, May 20, 2024 at 03:36:55PM +0200, Michael Niedermayer wrote:
> On Mon, May 20, 2024 at 11:33:41AM +0200, Andreas Rheinhardt wrote:
> > Michael Niedermayer:
> > > Fixes: CID1583742 Unchecked return value
> > > 
> > > Sponsored-by: Sovereign Tech Fund
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavutil/hwcontext_drm.c | 5 -
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/libavutil/hwcontext_drm.c b/libavutil/hwcontext_drm.c
> > > index 0847db09a08..e080c0597b8 100644
> > > --- a/libavutil/hwcontext_drm.c
> > > +++ b/libavutil/hwcontext_drm.c
> > > @@ -166,7 +166,10 @@ static int drm_map_frame(AVHWFramesContext *hwfc,
> > >  #if HAVE_LINUX_DMA_BUF_H
> > >  /* We're not checking for errors here because the kernel may not
> > >   * support the ioctl, in which case its okay to carry on */
> > > -ioctl(desc->objects[i].fd, DMA_BUF_IOCTL_SYNC, &sync_start);
> > > +if (ioctl(desc->objects[i].fd, DMA_BUF_IOCTL_SYNC, &sync_start) 
> > > == -1) {
> > > +err = AVERROR(errno);
> > > +goto fail;
> > > +}
> > >  #endif
> > >  }
> > >  map->nb_regions = i;
> > 
> > Did you read the comment above the code?
> 
> Apparently not
> 
> patch droped, will mark this as intentional

theres a 2nd ioctl() call in the file (drm_unmap_frame()), that has no comment
and no check
Is that as intended or does it need some change ?
(its CID1583743 Unchecked return value)

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The educated differ from the uneducated as much as the living from the
dead. -- Aristotle 


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] [WIP] False positives on Coverity

2024-07-12 Thread Michael Niedermayer
On Fri, Jul 12, 2024 at 01:55:42AM +0200, Michael Niedermayer wrote:
[...]
> Only 7 outstanding remain from prior may. and 19 total. So 99% of issues

down to 3 outstanding prior may and 8 overall


[...]
> 1604599 Overflowed constant; intentional
> 1604530 Infinite loop ; "intentional"
> 700368 Explicit null dereferenced ; the loop will exit after this and the 
> code cannot be reached
> 1559187 Data race condition ; intentional
> 1591898 Unsigned compared against 0 ; pollfd has a signed fd on some platforms
> 1559180 Check of thread-shared field evades lock acquisition ; See source code

4 more false positives:
1604428 Overflowed return value ; avio_tell() misanalysis
1604511 Overflowed constant ; intentional
1604570 Overflowed constant ; not possible
1591857 Resource leak ; I think this works like intended

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


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 1/3] avutil/avassert: Add av_assert_unreachable()

2024-07-12 Thread Andreas Rheinhardt
Marvin Scholz:
> ---
>  libavutil/avassert.h | 12 
>  1 file changed, 12 insertions(+)
> 
> diff --git a/libavutil/avassert.h b/libavutil/avassert.h
> index 1895fb7551..cdab912fe4 100644
> --- a/libavutil/avassert.h
> +++ b/libavutil/avassert.h
> @@ -75,4 +75,16 @@
>   */
>  void av_assert0_fpu(void);
>  
> +/**
> + * Assert this can not be reached
> + */
> +#if AV_HAS_BUILTIN(__builtin_unreachable)
> +#define av_assert_unreachable() do {   \
> +av_assert2(0);  \
> +__builtin_unreachable();\
> +} while (0)
> +#else
> +#define av_assert_unreachable() av_assert2(0)
> +#endif
> +
>  #endif /* AVUTIL_AVASSERT_H */
> 
> base-commit: 85706f5136cf7c88f95843b2634dd3f7d7d2cb6d

You are not the first one with this idea:
https://ffmpeg.org/pipermail/ffmpeg-devel/2024-May/328116.html
But Michael Niedermayer thinks that adding a new macro instead of
directly reusing av_assert is more complicated.

- 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 10/11] avfilter/yadif_common: remove unused variable

2024-07-12 Thread Andreas Rheinhardt
Marvin Scholz:
> ---
>  libavfilter/vf_yadif_videotoolbox.m | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libavfilter/vf_yadif_videotoolbox.m 
> b/libavfilter/vf_yadif_videotoolbox.m
> index c47d3edfb8..eb7026395e 100644
> --- a/libavfilter/vf_yadif_videotoolbox.m
> +++ b/libavfilter/vf_yadif_videotoolbox.m
> @@ -172,7 +172,6 @@ static void filter(AVFilterContext *ctx, AVFrame *dst,
>  static av_cold void do_uninit(AVFilterContext *ctx) 
> API_AVAILABLE(macos(10.11), ios(8.0))
>  {
>  YADIFVTContext *s = ctx->priv;
> -YADIFContext *y = &s->yadif;
>  
>  ff_yadif_uninit(ctx);
>  

This is not yadif_common.

- 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] MAINTAINERS: add myself as d3d12va_encode maintainer

2024-07-12 Thread Tong Wu


Michael Niedermayer:
>Subject: Re: [FFmpeg-devel] [PATCH] MAINTAINERS: add myself as
>d3d12va_encode maintainer
>
>On Tue, Jul 09, 2024 at 02:41:20PM +0200, Michael Niedermayer wrote:
>> On Mon, Jul 08, 2024 at 03:16:28PM +, Tong Wu wrote:
>> > Ping. As the author of d3d12va_encode, I would like to get the access in 
>> > order
>maintain the code and add more new features.
>>
>> will apply
>
>Before adding your key, can you explain why your email domain changed from
>intel.com to outlook at about the time you volunteer as mainatiner ?
>
>I tried to mail the intel.com address but it bounced, which is why i am 
>posting here

Hi Michael. I left the company before the d3d12va_encode patch set was merged. 
That's why I'm using the new address since the previous domain is invalid.  


>
>Tong Wu (tong1...@intel.com)
>A communication failure occurred during the delivery of this message. Please 
>try
>resending the message later. If the problem continues, contact your email 
>admin.
>
>BN2PEPF44AB.mail.protection.outlook.com gave this error:
>Recipient address rejected: Access denied.
>[BN2PEPF44AB.namprd04.prod.outlook.com 2024-07-12T19:12:51.273Z
>08DC9DE0F46B8D63]

Looks like you also have trouble reaching me through the outlook?

>
>also if you use multiple email addresses in git, best to add them to .mailmap
>

Good idea. I'll add it to map the previous commits thx.
___
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/9] avcodec/vvc/ctu: Simplify code at the end of pred_mode_decode()

2024-07-12 Thread Nuo Mi
On Sun, May 19, 2024 at 10:49 AM Michael Niedermayer 
wrote:

> This simplification assumes that the code is correct
>
> Fixes: CID1560036 Logically dead code
>
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/vvc/ctu.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/libavcodec/vvc/ctu.c b/libavcodec/vvc/ctu.c
> index 53f92ca10f7..7495ced0d5a 100644
> --- a/libavcodec/vvc/ctu.c
> +++ b/libavcodec/vvc/ctu.c
> @@ -1080,12 +1080,10 @@ static PredMode pred_mode_decode(VVCLocalContext
> *lc,
>  }
>  if (pred_mode_ibc_flag)
>  pred_mode = MODE_IBC;
> +return pred_mode;
>  } else {
> -pred_mode_flag = is_4x4 || mode_type == MODE_TYPE_INTRA ||
> -mode_type != MODE_TYPE_INTER || IS_I(rsh);
> -pred_mode = pred_mode_flag ? MODE_INTRA : MODE_INTER;
> +return MODE_INTRA;
>  }
> -return pred_mode;
>  }
>
LGTM.
We can also remove the else branch since the if branch returns.

>
>  static void sbt_info(VVCLocalContext *lc, const VVCSPS *sps)
> --
> 2.45.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 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] hwcontext_vulkan: add a new mechanism to expose used queue families

2024-07-12 Thread Lynne via ffmpeg-devel

On 10/07/2024 10:18, Anton Khirnov wrote:

Quoting Lynne via ffmpeg-devel (2024-07-10 01:56:57)

On 09/07/2024 08:57, Anton Khirnov wrote:

Quoting Lynne via ffmpeg-devel (2024-07-09 03:07:12)

@@ -151,6 +162,17 @@ typedef struct AVVulkanDeviceContext {
* Similar to lock_queue(), unlocks a queue. Must only be called after 
locking.
*/
   void (*unlock_queue)(struct AVHWDeviceContext *ctx, uint32_t 
queue_family, uint32_t index);
+
+/**
+ * Queue families used. Must be preferentially ordered. List may contain
+ * duplicates, as long as their capability flags do not match.
+ *
+ * For compatibility reasons, all the enabled queue families listed above
+ * (queue_family_(tx/comp/encode/decode)_index) must also be included in
+ * this list until they're removed after deprecation.
+ */
+AVVulkanDeviceQueueFamily qf[16];


Why 16? And are we really really sure sizeof(AVVulkanDeviceQueueFamily)
should be a part of the ABI?


16 is just an arbitrary limit. I don't expect to need more than this
ever, but if we do, its not something that we can't wait until a bump
occurs.
I can increase it to 32 if you're concerned about it.

There are 6 total queue family types, and 6 more currently supported
encode and decode operations for each queue -> 12.

I'd like to avoid making this not a part of the ABI, particularly as its
a context that users should be able to easily set themselves.


I'm more concerned about adding new fields to AVVulkanDeviceQueueFamily.
Can't you just make qf an array of pointers, with a new function that
adds a new queue family to it?


I don't foresee needing to add any more fields to the struct, so I'd 
rather not have the complexity.


OpenPGP_0xA2FEA5F03F034464.asc
Description: OpenPGP public key


OpenPGP_signature.asc
Description: OpenPGP digital 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".