Re: [FFmpeg-devel] [PATCH v6 1/2] ffmpeg: Add display_{rotation, hflip, vflip} options

2022-10-04 Thread Anton Khirnov
Quoting Thilo Borgmann (2022-09-26 07:57:52)
> From: Jan Ekström 
> 
> This enables overriding the rotation as well as horizontal/vertical
> flip state of a specific video stream on the input side.
> 
> Additionally, switch the singular test that was utilizing the rotation
> metadata to instead override the input display rotation, thus leading
> to the same result.
> ---
>  doc/ffmpeg.texi | 29 +
>  fftools/ffmpeg.h|  6 +
>  fftools/ffmpeg_opt.c| 50 +
>  tests/fate/filter-video.mak |  2 +-
>  4 files changed, 86 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/ffmpeg.texi b/doc/ffmpeg.texi
> index 42440d93b4..6016b43892 100644
> --- a/doc/ffmpeg.texi
> +++ b/doc/ffmpeg.texi
> @@ -912,6 +912,35 @@ If used together with @option{-vcodec copy}, it will 
> affect the aspect ratio
>  stored at container level, but not the aspect ratio stored in encoded
>  frames, if it exists.
>  
> +@item -display_rotation[:@var{stream_specifier}] @var{rotation} 
> (@emph{input,per-stream})
> +Set the video display rotation in degrees specified by @var{rotation}.
> +
> +@var{rotation} is a floating point number that describes a pure
> +counter-clockwise rotation in degrees.
> +When setting this, @code{-autorotate} logic will be affected.
> +For additional parameters affecting display matrix side data into which this
> +information is saved, see @code{-display_hflip}, @code{-display_vflip}.
> +
> +These options work as a unit, so if only one of them is set, then the display
> +matrix will be overridden to that specific value with the rest being set to
> +default values.
> +
> +If unset, the default value if a display matrix is being defined is a 
> rotation
> +of zero degrees.
> +
> +@item -display_hflip[:@var{stream_specifier}] (@emph{input,per-stream})
> +Set whether on display the image should be horizontally flipped.
> +
> +If unset, the default value if a display matrix is being defined is that 
> there
> +is no additional horizontal flip. See @code{-display_rotation}.
> +
> +@item -display_vflip[:@var{stream_specifier}] (@emph{input,per-stream})
> +Set whether on display the image should be vertically flipped.
> +
> +If unset, the default value if a display matrix is being defined is that 
> there
> +is no additional vertical flip. See @code{-display_rotation}.

@item -display_rotation[:@var{stream_specifier}] @var{rotation} 
(@emph{input,per-stream})
Set video rotation metadata.

@var{rotation} is a decimal number specifying the amount in degree by
which the video should be rotated counter-clockwise before being
displayed.

This option overrides the rotation/display transform metadata stored in
the file, if any. When the video is being transcoded (rather than
copied) and @code{-autorotate} is enabled, the video will be rotated at
the filtering stage. Otherwise, the metadata will be written into the
output file if the muxer supports it.

If the @code{-display_hflip} and/or @code{-display_vflip} options are
given, they are applied after the rotation specified by this option.

@item -display_hflip[:@var{stream_specifier}] (@emph{input,per-stream})
Set whether on display the image should be horizontally flipped.

See the @code{-display_rotation} option for more details.

@item -display_vflip[:@var{stream_specifier}] (@emph{input,per-stream})
Set whether on display the image should be vertically flipped.

See the @code{-display_rotation} option for more details.

> +static void add_display_matrix_to_stream(OptionsContext *o,
> + AVFormatContext *ctx, AVStream *st)
> +{
> +double rotation = DBL_MAX;
> +int hflip = -1, vflip = -1;
> +int hflip_set = 0, vflip_set = 0, rotation_set = 0;
> +uint8_t *buf = NULL;

should be int32_t*

Otherwise seems ok.

-- 
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 v6 2/2] ffmpeg: Deprecate display rotation override with a metadata key

2022-10-04 Thread Anton Khirnov
Quoting Thilo Borgmann (2022-09-26 07:57:53)
> diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
> index f07858333d..3f2409ee28 100644
> --- a/fftools/ffmpeg_opt.c
> +++ b/fftools/ffmpeg_opt.c
> @@ -2859,16 +2859,26 @@ static void of_add_metadata(AVFormatContext *oc, 
> const OptionsContext *o)
>  for (int j = 0; j < oc->nb_streams; j++) {
>  OutputStream *ost = output_streams[nb_output_streams - 
> oc->nb_streams + j];
>  if ((ret = check_stream_specifier(oc, oc->streams[j], 
> stream_spec)) > 0) {
> +#if FFMPEG_ROTATION_METADATA
>  if (!strcmp(o->metadata[i].u.str, "rotate")) {
>  char *tail;
>  double theta = av_strtod(val, &tail);
>  if (!*tail) {
>  ost->rotate_overridden = 1;
>  ost->rotate_override_value = theta;
> +
> +av_log(NULL, AV_LOG_WARNING,
> +   "Conversion of a 'rotate' metadata key to a "
> +   "proper display matrix rotation is 
> deprecated. "

Also, the user has no idea what a "proper display matrix rotation" is.
Make it something like
"Using 'rotate' metadata to specify rotation is deprecated.

> +   "See -display_rotation for setting rotation "
> +   "instead.");

Missing newline.

-- 
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] fixed_dsp: add missing av_restrict qualifiers

2022-10-04 Thread Anton Khirnov
Quoting Johannes Kauffmann (2022-09-25 00:41:18)
> The butterflies_fixed function pointer declaration specifies av_restrict
> for the first two pointer arguments. So the corresponding function
> definitions should honor this declaration.
> 
> MSVC emits warning C4113 for this.
> ---
>  libavutil/fixed_dsp.c  | 2 +-
>  libavutil/x86/fixed_dsp_init.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Makes sense, will push.

-- 
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 2/2] avformat/mp3dec: remove a call to avio_tell()

2022-10-04 Thread Anton Khirnov
Quoting Zhao Zhili (2022-09-25 06:28:41)
> From: Zhao Zhili 
> 
> ---
>  libavformat/mp3dec.c | 9 -
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
> index a9e494452d..05c13228bc 100644
> --- a/libavformat/mp3dec.c
> +++ b/libavformat/mp3dec.c
> @@ -424,15 +424,14 @@ static int mp3_read_header(AVFormatContext *s)
>  }
>  }
>  if (i == 64 * 1024) {
> -ret = avio_seek(s->pb, off, SEEK_SET);
> +off = avio_seek(s->pb, off, SEEK_SET);
>  } else {
>  av_log(s, i > 0 ? AV_LOG_INFO : AV_LOG_VERBOSE, "Skipping %d bytes 
> of junk at %"PRId64".\n", i, off);
> -ret = avio_seek(s->pb, off + i, SEEK_SET);
> +off = avio_seek(s->pb, off + i, SEEK_SET);
>  }
> -if (ret < 0)
> -return ret;
> +if (off < 0)
> +return off;
>  
> -off = avio_tell(s->pb);

Looks ok.

-- 
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 1/1] fate/opus: add silk LBRR test (refs #9890)

2022-10-04 Thread Anton Khirnov
Quoting Tristan Matthews (2022-09-30 15:53:48)
> These shorter samples have been updated by James Almer, so this patch
> is good to go

Will push soonish.

Thanks for the patches.

-- 
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 1/3] lavc/encode: make sure frame timebase matches encoder, when set

2022-10-04 Thread Anton Khirnov
Quoting Marton Balint (2022-09-28 21:54:11)
> 
> 
> On Wed, 28 Sep 2022, Anton Khirnov wrote:
> 
> > AVFrame.time_base has been added recently, but is currently not used for
> > anything. Prepare for its use in encoders by rejecting frames where
> > time_base is set, but differs from the AVCodecContext one.
> 
> How is that not an API break? Users can encode AVFrames with anything in 
> the AVFrame->time_base right now, if you change that behaviour, that will 
> surely break some code. That is why it was explicitly documented that 
> it will be ignored by encoders by default.

Why would there be anything in that field? No code we have currently
sets that field or does anything with it. There is no valid reason for
the users to be setting it on the frames they send to lavc.

As for "it would have worked before', there are many precedents where
some nonsensical parameter combination would "work", but then we'd add a
check and it would start returning errors. Callers should not be setting
random fields to random values and expect things to work.

Would applying this patch after a major bump alleviate your concerns? We
wanted to have one for a few months already.

-- 
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] Need to reduce size of ffmpeg.exe for version 5.0.1

2022-10-04 Thread Martijn van Beurden
Op ma 3 okt. 2022 om 22:14 schreef Kumar, Rahul :
> Can somebody help me answering below questions :
>
> 1. Can we reduce the size of ffmpeg.exe ? Any idea how can we create a 
> smaller ffmpeg.exe which should be able to run only above command  to convert 
> RTSP to HLS? (as its size is 110 mb+ so it is difficult to ship it with our 
> product).
> 2. Is there a way to run above ffmpeg command using "dll files" or other 
> alternative instead of using "ffmpeg.exe"
>

I sent you an answer to a similar question the 13th of July, but you
didn't reply: http://ffmpeg.org/pipermail/ffmpeg-devel/2022-June/297489.html

1) You can compile ffmpeg from sources yourself. You can disable
components you won't use and use --enable-small in the configuration.
2) You can use the dll files by writing a program using them.
___
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 0/7] arm64 neon implementation for 8bits functions

2022-10-04 Thread Martin Storsjö

On Mon, 3 Oct 2022, Grzegorz Bernacki wrote:


Changes since v1:

- changed tabs to spaces
- modified branch instruction in vsse8
- apply Martin's patches with improved instructions scheduling 


Grzegorz Bernacki (4):
 lavc/aarch64: Add neon implementation for pix_abs8 functions.
 lavc/aarch64: Provide neon implementation of nsse8
 lavc/aarch64: Provide optimized implementation of vsse8 for arm64.
 lavc/aarch64: Add neon implementation for vsse_intra8

Martin Storsjö (3):
 aarch64: me_cmp: Improve scheduling in ff_pix_abs8_y2_neon
 aarch64: me_cmp: Fix up the prologue of ff_pix_abs8_xy2_neon
 aarch64: me_cmp: Improve scheduling in vsse_intra8

libavcodec/aarch64/me_cmp_init_aarch64.c |  33 ++
libavcodec/aarch64/me_cmp_neon.S | 414 +++
2 files changed, 447 insertions(+)


Thanks! This mostly looked good to me.

I had actually meant that you would squash my fixes into your patches, 
instead of keeping them as separate ones.


After squashing such changes, it might have been interesting to get 
updated benchmarks in those commit messages (the ones that you have from 
Graviton 3). However in this case, these changes didn't really make much 
difference on out-of-order cores, only on in-order cores, so I guess 
there's not that much value in getting updated benchmarks from Graviton 3 
in this case.


So I went ahead and squashed those patches (and added co-authored-by lines 
where relevant), and pushed them now. Thanks for your contribution!


// Martin
___
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/10] avcodec/opus, opus_celt: Fix header descriptions

2022-10-04 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/opus.h  | 2 +-
 libavcodec/opus_celt.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/opus.h b/libavcodec/opus.h
index 80d685d47c..4d061cf5f8 100644
--- a/libavcodec/opus.h
+++ b/libavcodec/opus.h
@@ -1,5 +1,5 @@
 /*
- * Opus decoder/demuxer common functions
+ * Opus common header
  * Copyright (c) 2012 Andrew D'Addesio
  * Copyright (c) 2013-2014 Mozilla Corporation
  *
diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h
index 3aa96244e1..2dbb79be6c 100644
--- a/libavcodec/opus_celt.h
+++ b/libavcodec/opus_celt.h
@@ -1,5 +1,5 @@
 /*
- * Opus decoder/demuxer common functions
+ * Opus decoder/encoder CELT functions
  * Copyright (c) 2012 Andrew D'Addesio
  * Copyright (c) 2013-2014 Mozilla Corporation
  * Copyright (c) 2016 Rostislav Pehlivanov 
-- 
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 0/7] arm64 neon implementation for 8bits functions

2022-10-04 Thread Grzegorz Bernacki
Great!! Thanks a lot for your help and your review.
thanks,
greg

wt., 4 paź 2022 o 12:57 Martin Storsjö  napisał(a):

> On Mon, 3 Oct 2022, Grzegorz Bernacki wrote:
>
> > Changes since v1:
> >
> > - changed tabs to spaces
> > - modified branch instruction in vsse8
> > - apply Martin's patches with improved instructions scheduling
> >
> > Grzegorz Bernacki (4):
> >  lavc/aarch64: Add neon implementation for pix_abs8 functions.
> >  lavc/aarch64: Provide neon implementation of nsse8
> >  lavc/aarch64: Provide optimized implementation of vsse8 for arm64.
> >  lavc/aarch64: Add neon implementation for vsse_intra8
> >
> > Martin Storsjö (3):
> >  aarch64: me_cmp: Improve scheduling in ff_pix_abs8_y2_neon
> >  aarch64: me_cmp: Fix up the prologue of ff_pix_abs8_xy2_neon
> >  aarch64: me_cmp: Improve scheduling in vsse_intra8
> >
> > libavcodec/aarch64/me_cmp_init_aarch64.c |  33 ++
> > libavcodec/aarch64/me_cmp_neon.S | 414 +++
> > 2 files changed, 447 insertions(+)
>
> Thanks! This mostly looked good to me.
>
> I had actually meant that you would squash my fixes into your patches,
> instead of keeping them as separate ones.
>
> After squashing such changes, it might have been interesting to get
> updated benchmarks in those commit messages (the ones that you have from
> Graviton 3). However in this case, these changes didn't really make much
> difference on out-of-order cores, only on in-order cores, so I guess
> there's not that much value in getting updated benchmarks from Graviton 3
> in this case.
>
> So I went ahead and squashed those patches (and added co-authored-by lines
> where relevant), and pushed them now. Thanks for your contribution!
>
> // Martin
>
___
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] [crop support for matroska demuxer 1/3] libavcodec: Add crop related fields to structure AVCodecContext and AVCodecParameters.

2022-10-04 Thread Anton Khirnov
Quoting Timo Rothenpieler (2022-10-01 13:24:26)
> On 01.10.2022 08:13, OvchinnikovDmitrii wrote:
> > ---
> >   libavcodec/avcodec.h   | 8 
> >   libavcodec/codec_par.h | 8 
> >   2 files changed, 16 insertions(+)
> > 
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > index 7365eb5cc0..66df571afc 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -585,6 +585,14 @@ typedef struct AVCodecContext {
> >*/
> >   int coded_width, coded_height;
> >   
> > +/**
> > + * The dimensions of the crop, usually from container.
> > + */
> > +int crop_top;
> > +int crop_left;
> > +int crop_bottom;
> > +int crop_right;
> > +
> 
> Shouldn't these be added at the very end, to not break ABI?
> 

yes they should

> I'm also not very convinced this kind of information really belongs into 
> AVCodecContext and codecpar.
> Can't it just be frame-sidedata?

AVFrame already has fields for this, which are typically filled from
codec-level headers.

The idea here is to support container-level information, so some new
fields for lavf are certainly needed, but I'm not convinced just adding
them to AVCodecContext is the best solution. The semantics of these new
fields definitely need to be defined more precisely (like who sets them
and what does lavc do with the values).

-- 
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] [crop support for matroska demuxer 2/3] libavcodec: Public code to support container crop

2022-10-04 Thread Anton Khirnov
Quoting Hendrik Leppkes (2022-10-01 09:16:20)
> Somehow I don't feel like adding the two crops together is really
> going to do what most users would expect to happen. It just feels
> weird.
> It also changes the decoder crop information, and an API user does not
> get the pure information from the decoder, but rather an "interpreted"
> form. As an API user, I do not get the ability here to extract the
> pure decoder crop info, unless I manually null out the container info
> beforehand, or subtract it again, both of which seems odd and
> undesirable to me. Shouldn't I be provided with clean information, and
> then I (the API user) can choose how to act?

I agree, such policy decisions belong in the caller, not our libraries.

-- 
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] [crop support for matroska demuxer 1/3] libavcodec: Add crop related fields to structure AVCodecContext and AVCodecParameters.

2022-10-04 Thread James Almer

On 10/1/2022 4:06 AM, Hendrik Leppkes wrote:

On Sat, Oct 1, 2022 at 8:14 AM OvchinnikovDmitrii
 wrote:


---
  libavcodec/avcodec.h   | 8 
  libavcodec/codec_par.h | 8 
  2 files changed, 16 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 7365eb5cc0..66df571afc 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -585,6 +585,14 @@ typedef struct AVCodecContext {
   */
  int coded_width, coded_height;

+/**
+ * The dimensions of the crop, usually from container.
+ */
+int crop_top;
+int crop_left;
+int crop_bottom;
+int crop_right;
+
  /**
   * the number of pictures in a group of pictures, or 0 for intra_only
   * - encoding: Set by user.
diff --git a/libavcodec/codec_par.h b/libavcodec/codec_par.h
index 7660791a12..c730a79957 100644
--- a/libavcodec/codec_par.h
+++ b/libavcodec/codec_par.h
@@ -210,6 +210,14 @@ typedef struct AVCodecParameters {
   * Audio only. The channel layout and number of channels.
   */
  AVChannelLayout ch_layout;
+
+/**
+ * The dimensions of the crop, usually from container.
+ */
+int crop_top;
+int crop_left;
+int crop_bottom;
+int crop_right;
  } AVCodecParameters;



All of these should be size_t (and in AVCodecContext as well,
naturally), matching the type in AVFrame.


IMO the AVFrame ones should have not been size_t to begin with, not just 
because the actual dimensions you'll apply them to are int, but because 
these fields are not arch dependent or meant for the size of some object 
in memory.




- Hendrik
___
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 2/9] avcodec/opustab: Avoid indirection to access ff_celt_window

2022-10-04 Thread Michael Niedermayer
On Tue, Oct 04, 2022 at 12:44:58AM +0200, Andreas Rheinhardt wrote:
> Currently, it is accessed via a pointer (ff_celt_window)
> exported from opustab.h which points inside a static array
> (ff_celt_window_padded) in opustab.h. Instead export
> ff_celt_window_padded directly and make opustab.h
> a static const pointer pointing inside ff_celt_window_padded.
> Also mark all the declarations in opustab.h as hidden,
> so that the compiler knows that ff_celt_window has a fixed
> offset from the code even when compiling position-independent
> code.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/opusenc.c | 4 ++--
>  libavcodec/opustab.c | 4 +---
>  libavcodec/opustab.h | 8 +++-
>  3 files changed, 10 insertions(+), 6 deletions(-)
[...]
> diff --git a/libavcodec/opustab.h b/libavcodec/opustab.h
> index 16011db758..9c9f1b9d98 100644
> --- a/libavcodec/opustab.h
> +++ b/libavcodec/opustab.h
> @@ -25,6 +25,9 @@
>  
>  #include 
>  
> +#include "libavutil/attributes_internal.h"
> +
> +FF_VISIBILITY_PUSH_HIDDEN
>  extern const uint8_t  ff_celt_band_end[];
>  
>  extern const uint8_t  ff_opus_default_coupled_streams[];

didnt investigate but this breaks mingw64 here

CC  libavcodec/opus.o
In file included from src/libavcodec/opus.c:34:0:
src/libavcodec/opustab.h:31:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘extern’
 extern const uint8_t  ff_celt_band_end[];
 ^~
In file included from src/libavcodec/opus.c:35:0:
src/libavcodec/internal.h:52:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
‘__attribute__’ before ‘typedef’
 typedef struct AVCodecInternal {
 ^~~
src/libavcodec/opus.c: In function ‘ff_opus_parse_extradata’:
src/libavcodec/opus.c:333:24: error: ‘struct AVCodecInternal’ has no member 
named ‘skip_samples’
 avctx->internal->skip_samples = avctx->delay;
^~
src/ffbuild/common.mak:81: recipe for target 'libavcodec/opus.o' failed
make: *** [libavcodec/opus.o] Error 1



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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- 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 2/9] avcodec/opustab: Avoid indirection to access ff_celt_window

2022-10-04 Thread Andreas Rheinhardt
Michael Niedermayer:
> On Tue, Oct 04, 2022 at 12:44:58AM +0200, Andreas Rheinhardt wrote:
>> Currently, it is accessed via a pointer (ff_celt_window)
>> exported from opustab.h which points inside a static array
>> (ff_celt_window_padded) in opustab.h. Instead export
>> ff_celt_window_padded directly and make opustab.h
>> a static const pointer pointing inside ff_celt_window_padded.
>> Also mark all the declarations in opustab.h as hidden,
>> so that the compiler knows that ff_celt_window has a fixed
>> offset from the code even when compiling position-independent
>> code.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>  libavcodec/opusenc.c | 4 ++--
>>  libavcodec/opustab.c | 4 +---
>>  libavcodec/opustab.h | 8 +++-
>>  3 files changed, 10 insertions(+), 6 deletions(-)
> [...]
>> diff --git a/libavcodec/opustab.h b/libavcodec/opustab.h
>> index 16011db758..9c9f1b9d98 100644
>> --- a/libavcodec/opustab.h
>> +++ b/libavcodec/opustab.h
>> @@ -25,6 +25,9 @@
>>  
>>  #include 
>>  
>> +#include "libavutil/attributes_internal.h"
>> +
>> +FF_VISIBILITY_PUSH_HIDDEN
>>  extern const uint8_t  ff_celt_band_end[];
>>  
>>  extern const uint8_t  ff_opus_default_coupled_streams[];
> 
> didnt investigate but this breaks mingw64 here
> 
> CClibavcodec/opus.o
> In file included from src/libavcodec/opus.c:34:0:
> src/libavcodec/opustab.h:31:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
> ‘__attribute__’ before ‘extern’
>  extern const uint8_t  ff_celt_band_end[];
>  ^~
> In file included from src/libavcodec/opus.c:35:0:
> src/libavcodec/internal.h:52:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or 
> ‘__attribute__’ before ‘typedef’
>  typedef struct AVCodecInternal {
>  ^~~
> src/libavcodec/opus.c: In function ‘ff_opus_parse_extradata’:
> src/libavcodec/opus.c:333:24: error: ‘struct AVCodecInternal’ has no member 
> named ‘skip_samples’
>  avctx->internal->skip_samples = avctx->delay;
> ^~
> src/ffbuild/common.mak:81: recipe for target 'libavcodec/opus.o' failed
> make: *** [libavcodec/opus.o] Error 1
> 
> 

I already see the problem: An earlier version used
FF_VISIBILITY_START/END_HIDDEN, then I decided to switch to
FF_VISIBILITY_PUSH/POP_HIDDEN, but I only modified the part where hidden
is supported; in the other case, FF_VISIBILITY_START/END_HIDDEN is still
defined.
Thanks for testing.

- 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] Encrypted SMPTE DC MXF - additional UL needed to unpack EKLV packet

2022-10-04 Thread Tomas Härdin
mån 2022-10-03 klockan 11:47 + skrev Richard Ayres:
> Thanks, Pierre-Anthony. I've updated the patch to remove the
> unnecessary UL and it's now using mxf_match_uid() to detect the EKLV
> packet.
> 
> Signed-off-by: Richard Ayres 
> ---
>  libavformat/mxfdec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index badd2be224..b1ab90f25f 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -3737,7 +3737,7 @@ static int mxf_read_header(AVFormatContext *s)
> 
>  PRINT_KEY(s, "read header", klv.key);
>  av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset
> %#"PRIx64"\n", klv.length, klv.offset);
> -    if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
> +    if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key,

Why do we have IS_KLV_KEY at all? I feel it is only appropriate in
cases where we have to deal with less-than-standard files, or if we
explicitly have to differentiate between different versions of relevant
specs.

Patch looks OK

/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] [PATCH 1/3] fftools/cmdutils: Use av_err2str

2022-10-04 Thread Marvin Scholz
av_err2str which is a wrapper for av_strerror already calls
strerror_r if available and if not has a fallback for the other
error codes that would be handled by that, so manually calling
strerror again if it fails is not necessary.
---
 fftools/cmdutils.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index f911c52be2..beef8ce385 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -798,12 +798,7 @@ do {   
\
 
 void print_error(const char *filename, int err)
 {
-char errbuf[128];
-const char *errbuf_ptr = errbuf;
-
-if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
-errbuf_ptr = strerror(AVUNERROR(err));
-av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, errbuf_ptr);
+av_log(NULL, AV_LOG_ERROR, "%s: %s\n", filename, av_err2str(err));
 }
 
 int read_yesno(void)
-- 
2.37.0 (Apple Git-136)

___
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] fftools/ffprobe: Use av_err2str

2022-10-04 Thread Marvin Scholz
av_err2str which is a wrapper for av_strerror already calls
strerror_r if available and if not has a fallback for the other
error codes that would be handled by that, so manually calling
strerror again if it fails is not necessary.
---
 fftools/ffprobe.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 421ada5bd8..9b7e82fd8c 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3279,15 +3279,9 @@ static int show_format(WriterContext *w, InputFile 
*ifile)
 
 static void show_error(WriterContext *w, int err)
 {
-char errbuf[128];
-const char *errbuf_ptr = errbuf;
-
-if (av_strerror(err, errbuf, sizeof(errbuf)) < 0)
-errbuf_ptr = strerror(AVUNERROR(err));
-
 writer_print_section_header(w, SECTION_ID_ERROR);
 print_int("code", err);
-print_str("string", errbuf_ptr);
+print_str("string", av_err2str(err));
 writer_print_section_footer(w);
 }
 
-- 
2.37.0 (Apple Git-136)

___
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] fftools/ffmpeg_opt: Use av_err2str

2022-10-04 Thread Marvin Scholz
This simplifies the code as there is no other place the error buffer
is needed, so the av_err2str helper macro can be used.
---
 fftools/ffmpeg_opt.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 8f57b699f1..272a772283 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -3716,7 +3716,6 @@ static int open_files(OptionGroupList *l, const char 
*inout,
 int ffmpeg_parse_options(int argc, char **argv)
 {
 OptionParseContext octx;
-uint8_t error[128];
 int ret;
 
 memset(&octx, 0, sizeof(octx));
@@ -3767,8 +3766,7 @@ int ffmpeg_parse_options(int argc, char **argv)
 fail:
 uninit_parse_context(&octx);
 if (ret < 0) {
-av_strerror(ret, error, sizeof(error));
-av_log(NULL, AV_LOG_FATAL, "%s\n", error);
+av_log(NULL, AV_LOG_FATAL, "%s\n", av_err2str(ret));
 }
 return ret;
 }
-- 
2.37.0 (Apple Git-136)

___
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 3/7] avcodec/sgidec: Avoid redundant private context

2022-10-04 Thread Tomas Härdin
fre 2022-09-30 klockan 19:05 +0200 skrev Andreas Rheinhardt:
> SGI is intra-frame only; the decoder therefore does not
> maintain any state between frames, so remove
> the private context.
> 
> Also rename depth to nb_components.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/sgidec.c | 158 --
> --
>  1 file changed, 73 insertions(+), 85 deletions(-)

Looks OK

/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".


Re: [FFmpeg-devel] [FFmpeg-cvslog] x86/lpc: implement a new Welch windowing function

2022-10-04 Thread Michael Niedermayer
On Wed, Sep 21, 2022 at 05:12:52AM +, Lynne wrote:
> ffmpeg | branch: master | Lynne  | Mon Sep 19 23:48:53 2022 
> +0200| [3ade6a8644ab519fcd7caa7ef457dd406162bc14] | committer: Lynne
> 
> x86/lpc: implement a new Welch windowing function
> 
> Old one was written with the assumption only even inputs would be given.
> This very messy replacement supports even and odd inputs, and supports
> AVX2 for extra speed. The buffers given are usually quite big (4k samples),
> so the speedup is worth it.
> The new SSE version is still faster than the old inline asm version by 33%.
> 
> Also checkasm is provided to make sure this monstrosity works.
> 
> This fixes some FATE tests.
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3ade6a8644ab519fcd7caa7ef457dd406162bc14
> ---

This seems to "break" one flac case

./ffmpeg -i asynth-44100-2-2.wav -bitexact -frame_size 4095  
-max_prediction_order 16 test-old.flac

The file size becomes worse by alot:

-rw-r- 1 michael michael 379149 Okt  4 16:45 test-new.flac
-rw-r- 1 michael michael 235482 Okt  4 16:46 test-old.flac


[...]
-- 
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] Encrypted SMPTE DC MXF - additional UL needed to unpack EKLV packet

2022-10-04 Thread Pierre-Anthony Lemieux
On Tue, Oct 4, 2022 at 7:29 AM Tomas Härdin  wrote:
>
> mån 2022-10-03 klockan 11:47 + skrev Richard Ayres:
> > Thanks, Pierre-Anthony. I've updated the patch to remove the
> > unnecessary UL and it's now using mxf_match_uid() to detect the EKLV
> > packet.
> >
> > Signed-off-by: Richard Ayres 
> > ---
> >  libavformat/mxfdec.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > index badd2be224..b1ab90f25f 100644
> > --- a/libavformat/mxfdec.c
> > +++ b/libavformat/mxfdec.c
> > @@ -3737,7 +3737,7 @@ static int mxf_read_header(AVFormatContext *s)
> >
> >  PRINT_KEY(s, "read header", klv.key);
> >  av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset
> > %#"PRIx64"\n", klv.length, klv.offset);
> > -if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
> > +if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key,
>
> Why do we have IS_KLV_KEY at all? I feel it is only appropriate in
> cases where we have to deal with less-than-standard files, or if we
> explicitly have to differentiate between different versions of relevant
> specs.

SMPTE ULs should always be compared ignoring the version byte -- but
for exceptional cases.

mxf_match_uid() should probably be renamed mxf_match_ul() since a UID
can also be a UUID and.

>
> Patch looks OK

+1

>
> /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 v6 0/3] 32bps FLAC patches

2022-10-04 Thread Martijn van Beurden
Op vr 16 sep. 2022 om 22:14 schreef Martijn van Beurden :
>
> Recently libFLAC gained the ability (first released in FLAC 1.4.0)
> to create FLAC files containing 32-bit int PCM samples. To
> keep complexity reasonable, the choice was made to limit residuals
> to 32-bit integers, which the encoder must make sure of. In case
> the encoder cannot find any predictor of which the residuals fit
> this limit, it must default to using a verbatim subframe. Tests have
> shown that this does not happen often (<0.1% of subframes on a
> music corpus of various styles). See also discussion here:
> https://github.com/ietf-wg-cellar/flac-specification/pull/148
>
> These two patches implement decoding and encoding following this
> format.
>
> Changes since v1:
> fix copy-paste error in encoder, several invocations of
> lpc_encode_choose_datapath used wrong parameters, making FATE fail as
> compression was less than it should be
>
> Changes since v2:
> Rebased decoder part as it didn't apply anymore
>
> Changes since v3:
> Moved put_golomb part to flacenc.c (as it is now quite specific to FLAC)
> and renamed put_sbits64 to put_sbits63 (and changed assert accordingly)
>
> Changes since v4:
> Fix check of decoded_buffer_33bps malloc. Fix reading of wasted bits
> for 33bps subframe. Add fate test
>
> Changes since v5:
> Slimmed down 32 bps fate flac test from 2 to 1 input file. Replaced
> -strict -2 with -strict experimental in fate and encoder warning.
>
> Martijn van Beurden (3):
>   libavcodec/flacdec: Implement decoding of 32 bit-per-sample PCM
>   libavcodec/flacenc: Implement encoding of 32 bit-per-sample PCM
>   fate/flac: Add test of 32 bps encoding/decoding
>
>  libavcodec/flac.c   |   4 +-
>  libavcodec/flacdec.c| 250 +--
>  libavcodec/flacenc.c| 518 
>  libavcodec/get_bits.h   |  12 +
>  libavcodec/mathops.h|   9 +
>  libavcodec/put_bits.h   |   7 +
>  libavcodec/put_golomb.h |  14 --
>  tests/fate/flac.mak |   4 +
>  8 files changed, 678 insertions(+), 140 deletions(-)
>
> --
> 2.30.2
>

With this, I'd like to remind the mailing list of the existence of
these patches :) They still apply, build and pass fate against current
master at my end
___
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] Encrypted SMPTE DC MXF - additional UL needed to unpack EKLV packet

2022-10-04 Thread Tomas Härdin
tis 2022-10-04 klockan 07:50 -0700 skrev Pierre-Anthony Lemieux:
> On Tue, Oct 4, 2022 at 7:29 AM Tomas Härdin  wrote:
> > 
> > mån 2022-10-03 klockan 11:47 + skrev Richard Ayres:
> > > Thanks, Pierre-Anthony. I've updated the patch to remove the
> > > unnecessary UL and it's now using mxf_match_uid() to detect the
> > > EKLV
> > > packet.
> > > 
> > > Signed-off-by: Richard Ayres 
> > > ---
> > >  libavformat/mxfdec.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > > index badd2be224..b1ab90f25f 100644
> > > --- a/libavformat/mxfdec.c
> > > +++ b/libavformat/mxfdec.c
> > > @@ -3737,7 +3737,7 @@ static int mxf_read_header(AVFormatContext
> > > *s)
> > > 
> > >  PRINT_KEY(s, "read header", klv.key);
> > >  av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset
> > > %#"PRIx64"\n", klv.length, klv.offset);
> > > -    if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
> > > +    if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key,
> > 
> > Why do we have IS_KLV_KEY at all? I feel it is only appropriate in
> > cases where we have to deal with less-than-standard files, or if we
> > explicitly have to differentiate between different versions of
> > relevant
> > specs.
> 
> SMPTE ULs should always be compared ignoring the version byte -- but
> for exceptional cases.
> 
> mxf_match_uid() should probably be renamed mxf_match_ul() since a UID
> can also be a UUID and.

Oh yeah, UUIDs *must* be just memcpy()'d IIRC. Perhaps we should have
three functions to be extra explicit: mxf_match_ul(), mxf_match_uid()
and mxf_match_uuid()..

/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".


Re: [FFmpeg-devel] [PATCH] Encrypted SMPTE DC MXF - additional UL needed to unpack EKLV packet

2022-10-04 Thread Pierre-Anthony Lemieux
On Tue, Oct 4, 2022 at 7:59 AM Tomas Härdin  wrote:
>
> tis 2022-10-04 klockan 07:50 -0700 skrev Pierre-Anthony Lemieux:
> > On Tue, Oct 4, 2022 at 7:29 AM Tomas Härdin  wrote:
> > >
> > > mån 2022-10-03 klockan 11:47 + skrev Richard Ayres:
> > > > Thanks, Pierre-Anthony. I've updated the patch to remove the
> > > > unnecessary UL and it's now using mxf_match_uid() to detect the
> > > > EKLV
> > > > packet.
> > > >
> > > > Signed-off-by: Richard Ayres 
> > > > ---
> > > >  libavformat/mxfdec.c | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> > > > index badd2be224..b1ab90f25f 100644
> > > > --- a/libavformat/mxfdec.c
> > > > +++ b/libavformat/mxfdec.c
> > > > @@ -3737,7 +3737,7 @@ static int mxf_read_header(AVFormatContext
> > > > *s)
> > > >
> > > >  PRINT_KEY(s, "read header", klv.key);
> > > >  av_log(s, AV_LOG_TRACE, "size %"PRIu64" offset
> > > > %#"PRIx64"\n", klv.length, klv.offset);
> > > > -if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key) ||
> > > > +if (mxf_match_uid(klv.key, mxf_encrypted_triplet_key,
> > >
> > > Why do we have IS_KLV_KEY at all? I feel it is only appropriate in
> > > cases where we have to deal with less-than-standard files, or if we
> > > explicitly have to differentiate between different versions of
> > > relevant
> > > specs.
> >
> > SMPTE ULs should always be compared ignoring the version byte -- but
> > for exceptional cases.
> >
> > mxf_match_uid() should probably be renamed mxf_match_ul() since a UID
> > can also be a UUID and.
>
> Oh yeah, UUIDs *must* be just memcpy()'d IIRC. Perhaps we should have
> three functions to be extra explicit: mxf_match_ul(), mxf_match_uid()
> and mxf_match_uuid()..

av_uuid_equal() already exists.

>
> /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 v6 2/3] libavcodec/flacenc: Implement encoding of 32 bit-per-sample PCM

2022-10-04 Thread Andreas Rheinhardt
Martijn van Beurden:
> Add encoding of 32 bit-per-sample PCM to FLAC files to libavcodec.
> Coding to this format is at this point considered experimental and
> -strict experimental is needed to get ffmpeg to encode such files.
> ---
>  libavcodec/flacenc.c| 518 
>  libavcodec/put_bits.h   |   7 +
>  libavcodec/put_golomb.h |  14 --
>  3 files changed, 423 insertions(+), 116 deletions(-)
> 
> diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
> index 5d8c3f82be..b69adaf4ba 100644
> --- a/libavcodec/flacenc.c
> +++ b/libavcodec/flacenc.c
> @@ -31,7 +31,6 @@
>  #include "codec_internal.h"
>  #include "encode.h"
>  #include "put_bits.h"
> -#include "put_golomb.h"
>  #include "lpc.h"
>  #include "flac.h"
>  #include "flacdata.h"
> @@ -95,6 +94,7 @@ typedef struct FlacSubframe {
>  
>  typedef struct FlacFrame {
>  FlacSubframe subframes[FLAC_MAX_CHANNELS];
> +int64_t samples_33bps[FLAC_MAX_BLOCKSIZE];
>  int blocksize;
>  int bs_code[2];
>  uint8_t crc8;
> @@ -282,10 +282,22 @@ static av_cold int flac_encode_init(AVCodecContext 
> *avctx)
>  s->bps_code= 4;
>  break;
>  case AV_SAMPLE_FMT_S32:
> -if (avctx->bits_per_raw_sample != 24)
> -av_log(avctx, AV_LOG_WARNING, "encoding as 24 
> bits-per-sample\n");
> -avctx->bits_per_raw_sample = 24;
> -s->bps_code= 6;
> +if (avctx->bits_per_raw_sample <= 24) {
> +if (avctx->bits_per_raw_sample < 24)
> +av_log(avctx, AV_LOG_WARNING, "encoding as 24 
> bits-per-sample\n");
> +avctx->bits_per_raw_sample = 24;
> +s->bps_code= 6;
> +} else if (avctx->strict_std_compliance > 
> FF_COMPLIANCE_EXPERIMENTAL) {
> +av_log(avctx, AV_LOG_WARNING,
> +   "encoding as 24 bits-per-sample, more is considered "
> +   "experimental. Add -strict experimental if you want "
> +   "to encode more than 24 bits-per-sample\n");
> +avctx->bits_per_raw_sample = 24;
> +s->bps_code= 6;
> +} else {
> +avctx->bits_per_raw_sample = 32;
> +s->bps_code = 7;
> +}
>  break;
>  }
>  
> @@ -533,8 +545,7 @@ static uint64_t rice_count_exact(const int32_t *res, int 
> n, int k)
>  uint64_t count = 0;
>  
>  for (i = 0; i < n; i++) {
> -int32_t v = -2 * res[i] - 1;
> -v ^= v >> 31;
> +unsigned v = ((unsigned)(res[i]) << 1) ^ (res[i] >> 31);
>  count += (v >> k) + 1 + k;
>  }
>  return count;
> @@ -713,8 +724,8 @@ static uint64_t calc_rice_params(RiceContext *rc,
>  
>  tmp_rc.coding_mode = rc->coding_mode;
>  
> -for (i = 0; i < n; i++)
> -udata[i] = (2 * data[i]) ^ (data[i] >> 31);
> +for (i = pred_order; i < n; i++)
> +udata[i] = ((unsigned)(data[i]) << 1) ^ (data[i] >> 31);
>  
>  calc_sum_top(pmax, exact ? kmax : 0, udata, n, pred_order, sums);
>  
> @@ -812,6 +823,180 @@ static void encode_residual_fixed(int32_t *res, const 
> int32_t *smp, int n,
>  }
>  
>  
> +static int encode_residual_fixed_with_residual_limit(int32_t *res, const 
> int32_t *smp,
> +  int n, int order)
> +{
> +/* This function checks for every residual whether it can be
> + * contained in  + * function that called this function has to try something else */
> +int i;
> +int64_t res64;
> +
> +for (i = 0; i < order; i++)
> +res[i] = smp[i];
> +
> +if (order == 0) {
> +for (i = order; i < n; i++) {
> +if (smp[i] == INT32_MIN)
> +return 1;
> +res[i] = smp[i];
> +}
> +} else if (order == 1) {
> +for (i = order; i < n; i++) {
> +res64 = (int64_t)smp[i] - smp[i-1];
> +if (res64 <= INT32_MIN || res64 > INT32_MAX)
> +return 1;
> +res[i] = res64;
> +}
> +} else if (order == 2) {
> +for (i = order; i < n; i++) {
> +res64 = (int64_t)smp[i] - 2*(int64_t)smp[i-1] + smp[i-2];
> +if (res64 <= INT32_MIN || res64 > INT32_MAX)
> +return 1;
> +res[i] = res64;
> +}
> +} else if (order == 3) {
> +for (i = order; i < n; i++) {
> +res64 = (int64_t)smp[i] - 3*(int64_t)smp[i-1] + 
> 3*(int64_t)smp[i-2] - smp[i-3];
> +if (res64 <= INT32_MIN || res64 > INT32_MAX)
> +return 1;
> +res[i] = res64;
> +}
> +} else {
> +for (i = order; i < n; i++) {
> +res64 = (int64_t)smp[i] - 4*(int64_t)smp[i-1] + 
> 6*(int64_t)smp[i-2] - 4*(int64_t)smp[i-3] + smp[i-4];
> +if (res64 <= INT32_MIN || res64 > INT32_MAX)
> +return 1;
> +res[i] = res64;
> +}
> +}
> +return 0;
> +}
> +
> +
> +s

Re: [FFmpeg-devel] [PATCH v6 3/3] fate/flac: Add test of 32 bps encoding/decoding

2022-10-04 Thread Andreas Rheinhardt
Martijn van Beurden:
> ---
>  tests/fate/flac.mak | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/tests/fate/flac.mak b/tests/fate/flac.mak
> index 115cc965e1..3424b2bf82 100644
> --- a/tests/fate/flac.mak
> +++ b/tests/fate/flac.mak
> @@ -6,6 +6,7 @@ FATE_FLAC += fate-flac-16-chmode-indep
>   \
>   fate-flac-16-lpc-cholesky  \
>   fate-flac-16-lpc-levinson  \
>   fate-flac-24-comp-8\
> + fate-flac-32-wasted-bits   \
>   fate-flac-rice-params  \
>  
>  fate-flac-16-chmode-%: OPTS = -ch_mode $(@:fate-flac-16-chmode-%=%)
> @@ -20,6 +21,9 @@ fate-flac-24-comp-%: OPTS = -compression_level 
> $(@:fate-flac-24-comp-%=%)
>  fate-flac-24-%: REF = 
> $(SAMPLES)/audio-reference/divertimenti_2ch_96kHz_s24.wav
>  fate-flac-24-%: CMD = enc_dec_pcm flac wav s24le $(subst 
> $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c flac $(OPTS)
>  
> +fate-flac-32-wasted-bits: REF = 
> $(SAMPLES)/audio-reference/drums_2ch_44kHz_s32_wastedbits.wav
> +fate-flac-32-wasted-bits: CMD = enc_dec_pcm flac wav s32le $(subst 
> $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c flac -strict experimental
> +
>  fate-flac-rice-params: REF = 
> $(SAMPLES)/audio-reference/chorusnoise_2ch_44kHz_s16.wav
>  fate-flac-rice-params: CMD = enc_dec_pcm flac wav s16le $(subst 
> $(SAMPLES),$(TARGET_SAMPLES),$(REF)) -c flac
>  

Is the encoder bitexact, i.e. does it always produce the same output
regardless of plattform (this is different from the encoder's output
decoding exactly to the original input)?

- 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] [FFmpeg-cvslog] fftools/ffmpeg: drop the -async option

2022-10-04 Thread Michael Niedermayer
On Tue, Oct 04, 2022 at 09:56:29AM +, Anton Khirnov wrote:
> ffmpeg | branch: master | Anton Khirnov  | Tue Aug 30 
> 11:14:13 2022 +0200| [3d86a13b47b726e49c2d780c5f723c290e8a36b4] | committer: 
> Anton Khirnov
> 
> fftools/ffmpeg: drop the -async option
> 
> It has been deprecated in favor of the aresample filter for almost 10
> years.
> 
> Another thing this option can do is drop audio timestamps and have them
> generated by the encoding code or the muxer, but
> - for encoding, this can already be done with the setpts filter
> - for muxing this should almost never be done as timestamp generation by
>   the muxer is deprecated, but people who really want to do this can use
>   the setts bitstream filter
> 
> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3d86a13b47b726e49c2d780c5f723c290e8a36b4
> ---
> 
>  doc/ffmpeg.texi | 12 
>  fftools/ffmpeg.c|  2 +-
>  fftools/ffmpeg.h|  1 -
>  fftools/ffmpeg_filter.c | 10 --
>  fftools/ffmpeg_mux.c|  3 +--
>  fftools/ffmpeg_opt.c|  3 ---
>  6 files changed, 2 insertions(+), 29 deletions(-)

This breaks:
./ffmpeg -i ~/tickets/507/avdesync_cut.avi -bitexact -r 24000/1001 -t 145 
-async 1 file1-old.avi

The file is no longer AV-synced after this, and iam not sure the user
will understand why
its not warning or erroring out either


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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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/asv: Split ASV1Context into decoder and encoder contexts

2022-10-04 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> A lot of the stuff in ASV1Context is actually only used
> by decoders or encoders, but not both: Of the seven contexts
> in ASV1Context, only the BswapDSPContext is used by both.
> So splitting makes sense.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/asv.c|  4 ++-
>  libavcodec/asv.h| 25 ++--
>  libavcodec/asvdec.c | 72 -
>  libavcodec/asvenc.c | 69 ++-
>  4 files changed, 92 insertions(+), 78 deletions(-)
> 
> diff --git a/libavcodec/asv.c b/libavcodec/asv.c
> index dcae90982a..3aa08c30c0 100644
> --- a/libavcodec/asv.c
> +++ b/libavcodec/asv.c
> @@ -25,6 +25,8 @@
>  
>  #include 
>  
> +#include "libavutil/attributes.h"
> +
>  #include "asv.h"
>  #include "avcodec.h"
>  #include "bswapdsp.h"
> @@ -88,7 +90,7 @@ const uint16_t ff_asv2_level_tab[63][2] = {
>  
>  av_cold void ff_asv_common_init(AVCodecContext *avctx)
>  {
> -ASV1Context *const a = avctx->priv_data;
> +ASVCommonContext *const a = avctx->priv_data;
>  
>  ff_bswapdsp_init(&a->bbdsp);
>  
> diff --git a/libavcodec/asv.h b/libavcodec/asv.h
> index 269bbe7c18..7c0983a497 100644
> --- a/libavcodec/asv.h
> +++ b/libavcodec/asv.h
> @@ -28,38 +28,17 @@
>  
>  #include 
>  
> -#include "libavutil/mem_internal.h"
> -
>  #include "avcodec.h"
> -#include "blockdsp.h"
>  #include "bswapdsp.h"
> -#include "fdctdsp.h"
> -#include "idctdsp.h"
> -#include "get_bits.h"
> -#include "pixblockdsp.h"
> -#include "put_bits.h"
>  
> -typedef struct ASV1Context {
> +typedef struct ASVCommonContext {
>  AVCodecContext *avctx;
> -BlockDSPContext bdsp;
>  BswapDSPContext bbdsp;
> -FDCTDSPContext fdsp;
> -IDCTDSPContext idsp;
> -PixblockDSPContext pdsp;
> -PutBitContext pb;
> -GetBitContext gb;
> -ScanTable scantable;
> -int inv_qscale;
>  int mb_width;
>  int mb_height;
>  int mb_width2;
>  int mb_height2;
> -DECLARE_ALIGNED(32, int16_t, block)[6][64];
> -uint16_t intra_matrix[64];
> -int q_intra_matrix[64];
> -uint8_t *bitstream_buffer;
> -unsigned int bitstream_buffer_size;
> -} ASV1Context;
> +} ASVCommonContext;
>  
>  extern const uint8_t ff_asv_scantab[64];
>  extern const uint8_t ff_asv_ccp_tab[17][2];
> diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c
> index 4ca370d1ec..81260058fc 100644
> --- a/libavcodec/asvdec.c
> +++ b/libavcodec/asvdec.c
> @@ -25,6 +25,7 @@
>  
>  #include "libavutil/attributes.h"
>  #include "libavutil/mem.h"
> +#include "libavutil/mem_internal.h"
>  #include "libavutil/thread.h"
>  
>  #include "asv.h"
> @@ -33,6 +34,7 @@
>  #include "codec_internal.h"
>  #include "config_components.h"
>  #include "decode.h"
> +#include "get_bits.h"
>  #include "idctdsp.h"
>  #include "mpeg12data.h"
>  
> @@ -48,6 +50,20 @@ static VLC dc_ccp_vlc;
>  static VLC ac_ccp_vlc;
>  static VLC asv2_level_vlc;
>  
> +typedef struct ASVDecContext {
> +ASVCommonContext c;
> +
> +GetBitContext gb;
> +
> +BlockDSPContext bdsp;
> +IDCTDSPContext idsp;
> +ScanTable scantable;
> +DECLARE_ALIGNED(32, int16_t, block)[6][64];
> +uint16_t intra_matrix[64];
> +uint8_t *bitstream_buffer;
> +unsigned int bitstream_buffer_size;
> +} ASVDecContext;
> +
>  static av_cold void init_vlcs(void)
>  {
>  INIT_VLC_STATIC(&ccp_vlc, CCP_VLC_BITS, 17,
> @@ -106,7 +122,7 @@ static inline int asv2_get_level(GetBitContext *gb)
>  return code - 31;
>  }
>  
> -static inline int asv1_decode_block(ASV1Context *a, int16_t block[64])
> +static inline int asv1_decode_block(ASVDecContext *a, int16_t block[64])
>  {
>  int i;
>  
> @@ -119,7 +135,7 @@ static inline int asv1_decode_block(ASV1Context *a, 
> int16_t block[64])
>  if (ccp == 16)
>  break;
>  if (ccp < 0 || i >= 10) {
> -av_log(a->avctx, AV_LOG_ERROR, "coded coeff pattern 
> damaged\n");
> +av_log(a->c.avctx, AV_LOG_ERROR, "coded coeff pattern 
> damaged\n");
>  return AVERROR_INVALIDDATA;
>  }
>  
> @@ -137,7 +153,7 @@ static inline int asv1_decode_block(ASV1Context *a, 
> int16_t block[64])
>  return 0;
>  }
>  
> -static inline int asv2_decode_block(ASV1Context *a, int16_t block[64])
> +static inline int asv2_decode_block(ASVDecContext *a, int16_t block[64])
>  {
>  int i, count, ccp;
>  
> @@ -173,13 +189,13 @@ static inline int asv2_decode_block(ASV1Context *a, 
> int16_t block[64])
>  return 0;
>  }
>  
> -static inline int decode_mb(ASV1Context *a, int16_t block[6][64])
> +static inline int decode_mb(ASVDecContext *a, int16_t block[6][64])
>  {
>  int i, ret;
>  
>  a->bdsp.clear_blocks(block[0]);
>  
> -if (a->avctx->codec_id == AV_CODEC_ID_ASV1) {
> +if (a->c.avctx->codec_id == AV_CODEC_ID_ASV1) {
>  for (i = 0; i < 6; i++) {
>  if ((ret = asv1_decode_block(a, block[i])) < 0)
>  retu

[FFmpeg-devel] [PATCH 2/3] lavc/alacdsp: RISC-V V append_extra_bits[0]

2022-10-04 Thread remi
From: Rémi Denis-Courmont 

---
 libavcodec/riscv/alacdsp_init.c |  8 +++-
 libavcodec/riscv/alacdsp_rvv.S  | 18 ++
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/libavcodec/riscv/alacdsp_init.c b/libavcodec/riscv/alacdsp_init.c
index 9ddebaa60b..37688be67b 100644
--- a/libavcodec/riscv/alacdsp_init.c
+++ b/libavcodec/riscv/alacdsp_init.c
@@ -27,13 +27,19 @@
 
 void ff_alac_decorrelate_stereo_rvv(int32_t *buffer[2], int nb_samples,
 int decorr_shift, int decorr_left_weight);
+void ff_alac_append_extra_bits_mono_rvv(int32_t *buffer[2],
+int32_t *extra_bits_buf[2],
+int extra_bits, int channels,
+int nb_samples);
 
 av_cold void ff_alacdsp_init_riscv(ALACDSPContext *c)
 {
 #if HAVE_RVV && (__riscv_xlen == 64)
 int flags = av_get_cpu_flags();
 
-if (flags & AV_CPU_FLAG_RVV_I32)
+if (flags & AV_CPU_FLAG_RVV_I32) {
 c->decorrelate_stereo = ff_alac_decorrelate_stereo_rvv;
+c->append_extra_bits[0] = ff_alac_append_extra_bits_mono_rvv;
+}
 #endif
 }
diff --git a/libavcodec/riscv/alacdsp_rvv.S b/libavcodec/riscv/alacdsp_rvv.S
index 5d75d6f2f9..7478ab228b 100644
--- a/libavcodec/riscv/alacdsp_rvv.S
+++ b/libavcodec/riscv/alacdsp_rvv.S
@@ -43,4 +43,22 @@ func ff_alac_decorrelate_stereo_rvv, zve32x
 
 ret
 endfunc
+
+func ff_alac_append_extra_bits_mono_rvv, zve32x
+ld  a0, (a0)
+ld  a1, (a1)
+1:
+vsetvli t0, a4, e32, m1, ta, ma
+vle32.v v16, (a0)
+sub a4, a4, t0
+vle32.v v24, (a1)
+sh2add  a1, t0, a1
+vsll.vx v16, v16, a2
+vor.vv  v16, v24, v16
+vse32.v v16, (a0)
+sh2add  a0, t0, a0
+bneza4, 1b
+
+ret
+endfunc
 #endif
-- 
2.37.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 3/3] lavc/alacdsp: RISC-V V append_extra_bits[1]

2022-10-04 Thread remi
From: Rémi Denis-Courmont 

---
 libavcodec/riscv/alacdsp_init.c |  5 +
 libavcodec/riscv/alacdsp_rvv.S  | 27 +++
 2 files changed, 32 insertions(+)

diff --git a/libavcodec/riscv/alacdsp_init.c b/libavcodec/riscv/alacdsp_init.c
index 37688be67b..fa8a7c8129 100644
--- a/libavcodec/riscv/alacdsp_init.c
+++ b/libavcodec/riscv/alacdsp_init.c
@@ -31,6 +31,10 @@ void ff_alac_append_extra_bits_mono_rvv(int32_t *buffer[2],
 int32_t *extra_bits_buf[2],
 int extra_bits, int channels,
 int nb_samples);
+void ff_alac_append_extra_bits_stereo_rvv(int32_t *buffer[2],
+  int32_t *extra_bits_buf[2],
+  int extra_bits, int channels,
+  int nb_samples);
 
 av_cold void ff_alacdsp_init_riscv(ALACDSPContext *c)
 {
@@ -40,6 +44,7 @@ av_cold void ff_alacdsp_init_riscv(ALACDSPContext *c)
 if (flags & AV_CPU_FLAG_RVV_I32) {
 c->decorrelate_stereo = ff_alac_decorrelate_stereo_rvv;
 c->append_extra_bits[0] = ff_alac_append_extra_bits_mono_rvv;
+c->append_extra_bits[1] = ff_alac_append_extra_bits_stereo_rvv;
 }
 #endif
 }
diff --git a/libavcodec/riscv/alacdsp_rvv.S b/libavcodec/riscv/alacdsp_rvv.S
index 7478ab228b..21b89ca0e7 100644
--- a/libavcodec/riscv/alacdsp_rvv.S
+++ b/libavcodec/riscv/alacdsp_rvv.S
@@ -61,4 +61,31 @@ func ff_alac_append_extra_bits_mono_rvv, zve32x
 
 ret
 endfunc
+
+func ff_alac_append_extra_bits_stereo_rvv, zve32x
+ld  a6, 8(a0)
+ld  a0,  (a0)
+ld  a7, 8(a1)
+ld  a1,  (a1)
+1:
+vsetvli t0, a4, e32, m1, ta, ma
+vle32.v v16, (a0)
+sub a4, a4, t0
+vle32.v v0, (a6)
+vsll.vx v16, v16, a2
+vsll.vx v0, v0, a2
+vle32.v v24, (a1)
+sh2add  a1, t0, a1
+vle32.v v8, (a7)
+sh2add  a7, t0, a7
+vor.vv  v16, v24, v16
+vor.vv  v0, v8, v0
+vse32.v v16, (a0)
+sh2add  a0, t0, a0
+vse32.v v0, (a6)
+sh2add  a6, t0, a6
+bneza4, 1b
+
+ret
+endfunc
 #endif
-- 
2.37.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 1/3] lavc/alacdsp: RISC-V V decorrelate_stereo

2022-10-04 Thread remi
From: Rémi Denis-Courmont 

To avoid data dependencies, this does the following unroll, which
requires one extra but probably free addition:

coeff = (b * left_weight) >> decorr_shift;
b += a;
a -= coeff;
b -= coeff;
swap(a, b);
---
 libavcodec/alacdsp.c|  4 ++-
 libavcodec/alacdsp.h|  1 +
 libavcodec/riscv/Makefile   |  2 ++
 libavcodec/riscv/alacdsp_init.c | 39 
 libavcodec/riscv/alacdsp_rvv.S  | 46 +
 5 files changed, 91 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/riscv/alacdsp_init.c
 create mode 100644 libavcodec/riscv/alacdsp_rvv.S

diff --git a/libavcodec/alacdsp.c b/libavcodec/alacdsp.c
index b033a27970..a604566afb 100644
--- a/libavcodec/alacdsp.c
+++ b/libavcodec/alacdsp.c
@@ -58,7 +58,9 @@ av_cold void ff_alacdsp_init(ALACDSPContext *c)
 c->append_extra_bits[0] =
 c->append_extra_bits[1] = append_extra_bits;
 
-#if ARCH_X86
+#if ARCH_RISCV
+ff_alacdsp_init_riscv(c);
+#elif ARCH_X86
 ff_alacdsp_init_x86(c);
 #endif
 }
diff --git a/libavcodec/alacdsp.h b/libavcodec/alacdsp.h
index f8b56dd5dc..489ebc6704 100644
--- a/libavcodec/alacdsp.h
+++ b/libavcodec/alacdsp.h
@@ -29,6 +29,7 @@ typedef struct ALACDSPContext {
 } ALACDSPContext;
 
 void ff_alacdsp_init(ALACDSPContext *c);
+void ff_alacdsp_init_riscv(ALACDSPContext *c);
 void ff_alacdsp_init_x86(ALACDSPContext *c);
 
 #endif /* AVCODEC_ALACDSP_H */
diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index 0fb2c81c75..81f4b985ac 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -1,5 +1,7 @@
 OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_init.o
 RVV-OBJS-$(CONFIG_AAC_DECODER) += riscv/aacpsdsp_rvv.o
+OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_init.o
+RVV-OBJS-$(CONFIG_ALAC_DECODER) += riscv/alacdsp_rvv.o
 OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_init.o \
riscv/audiodsp_rvf.o
 RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o
diff --git a/libavcodec/riscv/alacdsp_init.c b/libavcodec/riscv/alacdsp_init.c
new file mode 100644
index 00..9ddebaa60b
--- /dev/null
+++ b/libavcodec/riscv/alacdsp_init.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2022 Rémi Denis-Courmont.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include 
+
+#include "libavutil/attributes.h"
+#include "libavutil/cpu.h"
+#include "libavcodec/avcodec.h"
+#include "libavcodec/alacdsp.h"
+
+void ff_alac_decorrelate_stereo_rvv(int32_t *buffer[2], int nb_samples,
+int decorr_shift, int decorr_left_weight);
+
+av_cold void ff_alacdsp_init_riscv(ALACDSPContext *c)
+{
+#if HAVE_RVV && (__riscv_xlen == 64)
+int flags = av_get_cpu_flags();
+
+if (flags & AV_CPU_FLAG_RVV_I32)
+c->decorrelate_stereo = ff_alac_decorrelate_stereo_rvv;
+#endif
+}
diff --git a/libavcodec/riscv/alacdsp_rvv.S b/libavcodec/riscv/alacdsp_rvv.S
new file mode 100644
index 00..5d75d6f2f9
--- /dev/null
+++ b/libavcodec/riscv/alacdsp_rvv.S
@@ -0,0 +1,46 @@
+/*
+ * Copyright © 2022 Rémi Denis-Courmont.
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "config.h"
+#include "libavutil/riscv/asm.S"
+
+#if (__riscv_xlen == 64)
+func ff_alac_decorrelate_stereo_rvv, zve32x
+ld  a4, 8(a0)
+ld  a0, 0(a0)
+1:
+vsetvli t0, a1, e32, m1, ta, ma
+vle32.v v24, (a4)
+sub a1, a1, t0
+vle32.v v16, (a0)
+vmul.vx v8, v24, a3
+va

[FFmpeg-devel] [PATCH] riscv: remove unnecessary #include's

2022-10-04 Thread Rémi Denis-Courmont
Pointed out by Andreas Rheinhardt.
---
 libavcodec/riscv/fmtconvert_rvv.S  | 1 -
 libavcodec/riscv/idctdsp_rvv.S | 1 -
 libavcodec/riscv/pixblockdsp_rvi.S | 1 -
 libavcodec/riscv/pixblockdsp_rvv.S | 1 -
 libavcodec/riscv/vorbisdsp_rvv.S   | 1 -
 libavutil/riscv/asm.S  | 2 --
 libavutil/riscv/fixed_dsp_rvv.S| 1 -
 libavutil/riscv/float_dsp_rvv.S| 1 -
 8 files changed, 9 deletions(-)

diff --git a/libavcodec/riscv/fmtconvert_rvv.S 
b/libavcodec/riscv/fmtconvert_rvv.S
index 49893ec8d7..51365753d9 100644
--- a/libavcodec/riscv/fmtconvert_rvv.S
+++ b/libavcodec/riscv/fmtconvert_rvv.S
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
 #include "libavutil/riscv/asm.S"
 
 func ff_int32_to_float_fmul_scalar_rvv, zve32f
diff --git a/libavcodec/riscv/idctdsp_rvv.S b/libavcodec/riscv/idctdsp_rvv.S
index f5e1165eee..06e64e6529 100644
--- a/libavcodec/riscv/idctdsp_rvv.S
+++ b/libavcodec/riscv/idctdsp_rvv.S
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
 #include "libavutil/riscv/asm.S"
 
 func ff_put_pixels_clamped_rvv, zve32x
diff --git a/libavcodec/riscv/pixblockdsp_rvi.S 
b/libavcodec/riscv/pixblockdsp_rvi.S
index e84170244b..efdd48 100644
--- a/libavcodec/riscv/pixblockdsp_rvi.S
+++ b/libavcodec/riscv/pixblockdsp_rvi.S
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
 #include "libavutil/riscv/asm.S"
 
 func ff_get_pixels_8_rvi
diff --git a/libavcodec/riscv/pixblockdsp_rvv.S 
b/libavcodec/riscv/pixblockdsp_rvv.S
index c125408523..1a364e6dab 100644
--- a/libavcodec/riscv/pixblockdsp_rvv.S
+++ b/libavcodec/riscv/pixblockdsp_rvv.S
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
 #include "libavutil/riscv/asm.S"
 
 func ff_get_pixels_8_rvv, zve32x
diff --git a/libavcodec/riscv/vorbisdsp_rvv.S b/libavcodec/riscv/vorbisdsp_rvv.S
index bbe9c7dc6d..f45e7dc2f1 100644
--- a/libavcodec/riscv/vorbisdsp_rvv.S
+++ b/libavcodec/riscv/vorbisdsp_rvv.S
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
 #include "libavutil/riscv/asm.S"
 
 func ff_vorbis_inverse_coupling_rvv, zve32f
diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S
index de5e1ad0a6..ffa0bd9068 100644
--- a/libavutil/riscv/asm.S
+++ b/libavutil/riscv/asm.S
@@ -19,8 +19,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
-
 #if defined (__riscv_float_abi_soft)
 #define NOHWF
 #define NOHWD
diff --git a/libavutil/riscv/fixed_dsp_rvv.S b/libavutil/riscv/fixed_dsp_rvv.S
index 0e78734b4c..a91316e1da 100644
--- a/libavutil/riscv/fixed_dsp_rvv.S
+++ b/libavutil/riscv/fixed_dsp_rvv.S
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
 #include "asm.S"
 
 // (a0) = (a0) + (a1), (a1) = (a0) - (a1) [0..a2-1]
diff --git a/libavutil/riscv/float_dsp_rvv.S b/libavutil/riscv/float_dsp_rvv.S
index ab2e0c42d7..2bf8c6ee96 100644
--- a/libavutil/riscv/float_dsp_rvv.S
+++ b/libavutil/riscv/float_dsp_rvv.S
@@ -18,7 +18,6 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "config.h"
 #include "asm.S"
 
 // (a0) = (a1) * (a2) [0..a3-1]
-- 
2.37.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 v2] avutil/attributes_internal: Add visibility pragma

2022-10-04 Thread Andreas Rheinhardt
GCC 4.0 not only added a visibility attribute, but also
a pragma to set it for a whole region of code.*
This commit exposes this via macros.

*: See https://gcc.gnu.org/gcc-4.0/changes.html

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/attributes_internal.h | 4 
 1 file changed, 4 insertions(+)

diff --git a/libavutil/attributes_internal.h b/libavutil/attributes_internal.h
index 9d3d10b63e..3df1ee6af3 100644
--- a/libavutil/attributes_internal.h
+++ b/libavutil/attributes_internal.h
@@ -23,8 +23,12 @@
 
 #if (AV_GCC_VERSION_AT_LEAST(4,0) || defined(__clang__)) && (defined(__ELF__) 
|| defined(__MACH__))
 #define attribute_visibility_hidden __attribute__((visibility("hidden")))
+#define FF_VISIBILITY_PUSH_HIDDEN   _Pragma("GCC visibility push(hidden)")
+#define FF_VISIBILITY_POP_HIDDEN_Pragma("GCC visibility pop")
 #else
 #define attribute_visibility_hidden
+#define FF_VISIBILITY_PUSH_HIDDEN
+#define FF_VISIBILITY_POP_HIDDEN
 #endif
 
 #endif /* AVUTIL_ATTRIBUTES_INTERNAL_H */
-- 
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 v6 3/3] fate/flac: Add test of 32 bps encoding/decoding

2022-10-04 Thread Martijn van Beurden
Op di 4 okt. 2022 om 17:14 schreef Andreas Rheinhardt
:
> Is the encoder bitexact, i.e. does it always produce the same output
> regardless of plattform (this is different from the encoder's output
> decoding exactly to the original input)?

I don't know but it seems unlikely to me. Of libFLAC I'm absolutely
sure it produces different outputs for different platforms. It seems
reasonable to assume ffmpeg won't be bitexact either.
___
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/10] avcodec/opus, opus_celt: Fix header descriptions

2022-10-04 Thread Lynne
Oct 4, 2022, 13:09 by andreas.rheinha...@outlook.com:

> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/opus.h  | 2 +-
>  libavcodec/opus_celt.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libavcodec/opus.h b/libavcodec/opus.h
> index 80d685d47c..4d061cf5f8 100644
> --- a/libavcodec/opus.h
> +++ b/libavcodec/opus.h
> @@ -1,5 +1,5 @@
>  /*
> - * Opus decoder/demuxer common functions
> + * Opus common header
>  * Copyright (c) 2012 Andrew D'Addesio
>  * Copyright (c) 2013-2014 Mozilla Corporation
>  *
> diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h
> index 3aa96244e1..2dbb79be6c 100644
> --- a/libavcodec/opus_celt.h
> +++ b/libavcodec/opus_celt.h
> @@ -1,5 +1,5 @@
>  /*
> - * Opus decoder/demuxer common functions
> + * Opus decoder/encoder CELT functions
>  * Copyright (c) 2012 Andrew D'Addesio
>  * Copyright (c) 2013-2014 Mozilla Corporation
>  * Copyright (c) 2016 Rostislav Pehlivanov <> atomnu...@gmail.com> >
>

Could you merge this with patch 7/9?

Patchset looks good to me (as well as your more recent patch
for the visibility pragma).
___
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] avformat/vividas: Check packet size

2022-10-04 Thread Michael Niedermayer
On Fri, Sep 30, 2022 at 01:09:25AM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 119760682 - -2084600173 cannot be represented 
> in type 'int'
> Fixes: 
> 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVIDAS_fuzzer-6745781167587328
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/vividas.c | 7 +++
>  1 file changed, 7 insertions(+)

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 1/3] lavc/opusdsp: RISC-V V postfilter

2022-10-04 Thread Lynne
Oct 1, 2022, 14:32 by r...@remlab.net:

> From: Rémi Denis-Courmont 
>
> This is optimised for a vector size of 128-bit. Or maybe it would be
> more accurate to state that this is not properly optimised for larger
> vector sizes, as they would work just fine with a smaller vector group
> multiplier.
> ---
>  libavcodec/opusdsp.c|  2 ++
>  libavcodec/opusdsp.h|  1 +
>  libavcodec/riscv/Makefile   |  2 ++
>  libavcodec/riscv/opusdsp_init.c | 38 
>  libavcodec/riscv/opusdsp_rvv.S  | 51 +
>  5 files changed, 94 insertions(+)
>  create mode 100644 libavcodec/riscv/opusdsp_init.c
>  create mode 100644 libavcodec/riscv/opusdsp_rvv.S
>
> diff --git a/libavcodec/opusdsp.c b/libavcodec/opusdsp.c
> index badcfcc884..0764d712e4 100644
> --- a/libavcodec/opusdsp.c
> +++ b/libavcodec/opusdsp.c
> @@ -58,6 +58,8 @@ av_cold void ff_opus_dsp_init(OpusDSP *ctx)
>  
>  #if ARCH_AARCH64
>  ff_opus_dsp_init_aarch64(ctx);
> +#elif ARCH_RISCV
> +ff_opus_dsp_init_riscv(ctx);
>  #elif ARCH_X86
>  ff_opus_dsp_init_x86(ctx);
>  #endif
> diff --git a/libavcodec/opusdsp.h b/libavcodec/opusdsp.h
> index 3ea3d14bf0..c2a301e832 100644
> --- a/libavcodec/opusdsp.h
> +++ b/libavcodec/opusdsp.h
> @@ -30,5 +30,6 @@ void ff_opus_dsp_init(OpusDSP *ctx);
>  
>  void ff_opus_dsp_init_x86(OpusDSP *ctx);
>  void ff_opus_dsp_init_aarch64(OpusDSP *ctx);
> +void ff_opus_dsp_init_riscv(OpusDSP *ctx);
>  
>  #endif /* AVCODEC_OPUSDSP_H */
> diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
> index 0fb2c81c75..1edfa76ea5 100644
> --- a/libavcodec/riscv/Makefile
> +++ b/libavcodec/riscv/Makefile
> @@ -7,6 +7,8 @@ OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_init.o
>  RVV-OBJS-$(CONFIG_FMTCONVERT) += riscv/fmtconvert_rvv.o
>  OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_init.o
>  RVV-OBJS-$(CONFIG_IDCTDSP) += riscv/idctdsp_rvv.o
> +OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_init.o
> +RVV-OBJS-$(CONFIG_OPUS_DECODER) += riscv/opusdsp_rvv.o
>  OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_init.o \
>  riscv/pixblockdsp_rvi.o
>  RVV-OBJS-$(CONFIG_PIXBLOCKDSP) += riscv/pixblockdsp_rvv.o
> diff --git a/libavcodec/riscv/opusdsp_init.c b/libavcodec/riscv/opusdsp_init.c
> new file mode 100644
> index 00..18d3892329
> --- /dev/null
> +++ b/libavcodec/riscv/opusdsp_init.c
> @@ -0,0 +1,38 @@
> +/*
> + * Copyright © 2022 Rémi Denis-Courmont.
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
> + */
> +
> +#include "config.h"
> +
> +#include "libavutil/attributes.h"
> +#include "libavutil/cpu.h"
> +#include "libavutil/riscv/cpu.h"
> +#include "libavcodec/opusdsp.h"
> +
> +void ff_opus_postfilter_rvv(float *data, int period, float *gains, int len);
> +
> +av_cold void ff_opus_dsp_init_riscv(OpusDSP *d)
> +{
> +#if HAVE_RVV
> +int flags = av_get_cpu_flags();
> +
> +if ((flags & AV_CPU_FLAG_RVV_I32) && ff_get_rv_vlenb() >= 16)
> +d->postfilter = ff_opus_postfilter_rvv;
> +#endif
>

Function doesn't use RVV_I32 but zve32f.

___
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/10] avcodec/opus, opus_celt: Fix header descriptions

2022-10-04 Thread Andreas Rheinhardt
Lynne:
> Oct 4, 2022, 13:09 by andreas.rheinha...@outlook.com:
> 
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>  libavcodec/opus.h  | 2 +-
>>  libavcodec/opus_celt.h | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/libavcodec/opus.h b/libavcodec/opus.h
>> index 80d685d47c..4d061cf5f8 100644
>> --- a/libavcodec/opus.h
>> +++ b/libavcodec/opus.h
>> @@ -1,5 +1,5 @@
>>  /*
>> - * Opus decoder/demuxer common functions
>> + * Opus common header
>>  * Copyright (c) 2012 Andrew D'Addesio
>>  * Copyright (c) 2013-2014 Mozilla Corporation
>>  *
>> diff --git a/libavcodec/opus_celt.h b/libavcodec/opus_celt.h
>> index 3aa96244e1..2dbb79be6c 100644
>> --- a/libavcodec/opus_celt.h
>> +++ b/libavcodec/opus_celt.h
>> @@ -1,5 +1,5 @@
>>  /*
>> - * Opus decoder/demuxer common functions
>> + * Opus decoder/encoder CELT functions
>>  * Copyright (c) 2012 Andrew D'Addesio
>>  * Copyright (c) 2013-2014 Mozilla Corporation
>>  * Copyright (c) 2016 Rostislav Pehlivanov <> atomnu...@gmail.com> >
>>
> 
> Could you merge this with patch 7/9?
> 
> Patchset looks good to me (as well as your more recent patch
> for the visibility pragma).

Will merge the opus.h change into 4/9 and the opus_celt.h patch into 7/9
and apply 3-9; but I will wait with the visibility patch a bit more to
give others more time to comment.

- 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 2/2] avcodec/asvenc: Remove unnecessary emms_c()

2022-10-04 Thread Andreas Rheinhardt
PixblockDSP does not use MMX functions any more since
92b58002776edd3a3df03c90e8a3ab24b8f987de and FDCTDSP
since d402ec6be99dc82e263bad883e7c1c3d957343db.
BswapDSP never used MMX, so that the emms_c() here
is unnecessary.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/asvenc.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c
index e185d501b3..9da7cbb986 100644
--- a/libavcodec/asvenc.c
+++ b/libavcodec/asvenc.c
@@ -300,7 +300,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 encode_mb(a, a->block);
 }
 }
-emms_c();
 
 if (avctx->codec_id == AV_CODEC_ID_ASV1)
 flush_put_bits(&a->pb);
-- 
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] lavc/cbs_av1: restore CodedBitstreamAV1Context when AVERROR(ENOSPC)

2022-10-04 Thread Xiang, Haihao
On Wed, 2022-09-28 at 09:39 +0800, Xiang, Haihao wrote:
> From: Haihao Xiang 
> 
> The current pbc might be small for an obu frame, so a new pbc is
> required then parse this obu frame again. Because
> CodedBitstreamAV1Context has already been updated for this obu frame, we
> need to restore CodedBitstreamAV1Context, otherwise
> CodedBitstreamAV1Context doesn't match this obu frame when parsing obu
> frame again, e.g. CodedBitstreamAV1Context.order_hint.
> 
> $ ffmpeg -i input.ivf -c:v copy -f null -
> [...]
> [av1_frame_merge @ 0x558bc3d6f880] ref_order_hint[i] does not match
> inferred value: 20, but should be 22.
> [av1_frame_merge @ 0x558bc3d6f880] Failed to write unit 1 (type 6).
> [av1_frame_merge @ 0x558bc3d6f880] Failed to write packet.
> [obu @ 0x558bc3d6e040] av1_frame_merge filter failed to send output
> packet
> ---
>  libavcodec/cbs_av1.c | 64 
>  1 file changed, 47 insertions(+), 17 deletions(-)
> 
> diff --git a/libavcodec/cbs_av1.c b/libavcodec/cbs_av1.c
> index 154d9156cf..45e1288a51 100644
> --- a/libavcodec/cbs_av1.c
> +++ b/libavcodec/cbs_av1.c
> @@ -1058,15 +1058,31 @@ static int cbs_av1_write_obu(CodedBitstreamContext
> *ctx,
>  AV1RawTileData *td;
>  size_t header_size;
>  int err, start_pos, end_pos, data_pos;
> +CodedBitstreamAV1Context av1ctx;
>  
>  // OBUs in the normal bitstream format must contain a size field
>  // in every OBU (in annex B it is optional, but we don't support
>  // writing that).
>  obu->header.obu_has_size_field = 1;
> +av1ctx = *priv;
> +
> +if (priv->sequence_header_ref) {
> +av1ctx.sequence_header_ref = av_buffer_ref(priv-
> >sequence_header_ref);
> +if (!av1ctx.sequence_header_ref)
> +return AVERROR(ENOMEM);
> +}
> +
> +if (priv->frame_header_ref) {
> +av1ctx.frame_header_ref = av_buffer_ref(priv->frame_header_ref);
> +if (!av1ctx.frame_header_ref) {
> +err = AVERROR(ENOMEM);
> +goto error;
> +}
> +}
>  
>  err = cbs_av1_write_obu_header(ctx, pbc, &obu->header);
>  if (err < 0)
> -return err;
> +goto error;
>  
>  if (obu->header.obu_has_size_field) {
>  pbc_tmp = *pbc;
> @@ -1084,18 +1100,21 @@ static int cbs_av1_write_obu(CodedBitstreamContext
> *ctx,
>  err = cbs_av1_write_sequence_header_obu(ctx, pbc,
>  &obu-
> >obu.sequence_header);
>  if (err < 0)
> -return err;
> +goto error;
>  
>  av_buffer_unref(&priv->sequence_header_ref);
>  priv->sequence_header = NULL;
>  
>  err = ff_cbs_make_unit_refcounted(ctx, unit);
>  if (err < 0)
> -return err;
> +goto error;
>  
>  priv->sequence_header_ref = av_buffer_ref(unit->content_ref);
> -if (!priv->sequence_header_ref)
> -return AVERROR(ENOMEM);
> +if (!priv->sequence_header_ref) {
> +err = AVERROR(ENOMEM);
> +goto error;
> +}
> +
>  priv->sequence_header = &obu->obu.sequence_header;
>  }
>  break;
> @@ -1103,7 +1122,7 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
>  {
>  err = cbs_av1_write_temporal_delimiter_obu(ctx, pbc);
>  if (err < 0)
> -return err;
> +goto error;
>  }
>  break;
>  case AV1_OBU_FRAME_HEADER:
> @@ -1115,7 +1134,7 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
>   AV1_OBU_REDUNDANT_FRAME_HEAD
> ER,
>   NULL);
>  if (err < 0)
> -return err;
> +goto error;
>  }
>  break;
>  case AV1_OBU_TILE_GROUP:
> @@ -1123,7 +1142,7 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
>  err = cbs_av1_write_tile_group_obu(ctx, pbc,
> &obu->obu.tile_group);
>  if (err < 0)
> -return err;
> +goto error;
>  
>  td = &obu->obu.tile_group.tile_data;
>  }
> @@ -1132,7 +1151,7 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
>  {
>  err = cbs_av1_write_frame_obu(ctx, pbc, &obu->obu.frame, NULL);
>  if (err < 0)
> -return err;
> +goto error;
>  
>  td = &obu->obu.frame.tile_group.tile_data;
>  }
> @@ -1141,7 +1160,7 @@ static int cbs_av1_write_obu(CodedBitstreamContext *ctx,
>  {
>  err = cbs_av1_write_tile_list_obu(ctx, pbc, &obu->obu.tile_list);
>  if (err < 0)
> -return err;
> +goto error;
>  
>  td = &obu->obu.tile_list.tile_data;
>  

Re: [FFmpeg-devel] [PATCH] riscv: remove unnecessary #include's

2022-10-04 Thread Lynne
Oct 4, 2022, 19:49 by r...@remlab.net:

> Pointed out by Andreas Rheinhardt.
> ---
>  libavcodec/riscv/fmtconvert_rvv.S  | 1 -
>  libavcodec/riscv/idctdsp_rvv.S | 1 -
>  libavcodec/riscv/pixblockdsp_rvi.S | 1 -
>  libavcodec/riscv/pixblockdsp_rvv.S | 1 -
>  libavcodec/riscv/vorbisdsp_rvv.S   | 1 -
>  libavutil/riscv/asm.S  | 2 --
>  libavutil/riscv/fixed_dsp_rvv.S| 1 -
>  libavutil/riscv/float_dsp_rvv.S| 1 -
>  8 files changed, 9 deletions(-)
>
> diff --git a/libavcodec/riscv/fmtconvert_rvv.S 
> b/libavcodec/riscv/fmtconvert_rvv.S
> index 49893ec8d7..51365753d9 100644
> --- a/libavcodec/riscv/fmtconvert_rvv.S
> +++ b/libavcodec/riscv/fmtconvert_rvv.S
> @@ -18,7 +18,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
>  
> -#include "config.h"
>  #include "libavutil/riscv/asm.S"
>  
>  func ff_int32_to_float_fmul_scalar_rvv, zve32f
> diff --git a/libavcodec/riscv/idctdsp_rvv.S b/libavcodec/riscv/idctdsp_rvv.S
> index f5e1165eee..06e64e6529 100644
> --- a/libavcodec/riscv/idctdsp_rvv.S
> +++ b/libavcodec/riscv/idctdsp_rvv.S
> @@ -18,7 +18,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
>  
> -#include "config.h"
>  #include "libavutil/riscv/asm.S"
>  
>  func ff_put_pixels_clamped_rvv, zve32x
> diff --git a/libavcodec/riscv/pixblockdsp_rvi.S 
> b/libavcodec/riscv/pixblockdsp_rvi.S
> index e84170244b..efdd48 100644
> --- a/libavcodec/riscv/pixblockdsp_rvi.S
> +++ b/libavcodec/riscv/pixblockdsp_rvi.S
> @@ -18,7 +18,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
>  
> -#include "config.h"
>  #include "libavutil/riscv/asm.S"
>  
>  func ff_get_pixels_8_rvi
> diff --git a/libavcodec/riscv/pixblockdsp_rvv.S 
> b/libavcodec/riscv/pixblockdsp_rvv.S
> index c125408523..1a364e6dab 100644
> --- a/libavcodec/riscv/pixblockdsp_rvv.S
> +++ b/libavcodec/riscv/pixblockdsp_rvv.S
> @@ -18,7 +18,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
>  
> -#include "config.h"
>  #include "libavutil/riscv/asm.S"
>  
>  func ff_get_pixels_8_rvv, zve32x
> diff --git a/libavcodec/riscv/vorbisdsp_rvv.S 
> b/libavcodec/riscv/vorbisdsp_rvv.S
> index bbe9c7dc6d..f45e7dc2f1 100644
> --- a/libavcodec/riscv/vorbisdsp_rvv.S
> +++ b/libavcodec/riscv/vorbisdsp_rvv.S
> @@ -18,7 +18,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
>  
> -#include "config.h"
>  #include "libavutil/riscv/asm.S"
>  
>  func ff_vorbis_inverse_coupling_rvv, zve32f
> diff --git a/libavutil/riscv/asm.S b/libavutil/riscv/asm.S
> index de5e1ad0a6..ffa0bd9068 100644
> --- a/libavutil/riscv/asm.S
> +++ b/libavutil/riscv/asm.S
> @@ -19,8 +19,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
>  
> -#include "config.h"
> -
>  #if defined (__riscv_float_abi_soft)
>  #define NOHWF
>  #define NOHWD
> diff --git a/libavutil/riscv/fixed_dsp_rvv.S b/libavutil/riscv/fixed_dsp_rvv.S
> index 0e78734b4c..a91316e1da 100644
> --- a/libavutil/riscv/fixed_dsp_rvv.S
> +++ b/libavutil/riscv/fixed_dsp_rvv.S
> @@ -18,7 +18,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
>  
> -#include "config.h"
>  #include "asm.S"
>  
>  // (a0) = (a0) + (a1), (a1) = (a0) - (a1) [0..a2-1]
> diff --git a/libavutil/riscv/float_dsp_rvv.S b/libavutil/riscv/float_dsp_rvv.S
> index ab2e0c42d7..2bf8c6ee96 100644
> --- a/libavutil/riscv/float_dsp_rvv.S
> +++ b/libavutil/riscv/float_dsp_rvv.S
> @@ -18,7 +18,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
>  
> -#include "config.h"
>  #include "asm.S"
>  
>  // (a0) = (a1) * (a2) [0..a3-1]
>

Pushed alongside the alacdsp patch.
Thanks.
___
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] riscv/alacdsp: drop config.h include

2022-10-04 Thread Rémi Denis-Courmont
Le 5 octobre 2022 08:00:00 GMT+03:00, Lynne  a écrit :
>ffmpeg | branch: master | Lynne  | Wed Oct  5 06:58:26 2022 
>+0200| [b25c6a5704ac114e825577209a610f5e95abe6c0] | committer: Lynne
>
>riscv/alacdsp: drop config.h include
>
>> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=b25c6a5704ac114e825577209a610f5e95abe6c0
>---
>
> libavcodec/riscv/alacdsp_rvv.S | 1 -
> 1 file changed, 1 deletion(-)
>
>diff --git a/libavcodec/riscv/alacdsp_rvv.S b/libavcodec/riscv/alacdsp_rvv.S
>index 21b89ca0e7..8fbe3fbe77 100644
>--- a/libavcodec/riscv/alacdsp_rvv.S
>+++ b/libavcodec/riscv/alacdsp_rvv.S
>@@ -18,7 +18,6 @@
>  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>  */
> 
>-#include "config.h"
> #include "libavutil/riscv/asm.S"
> 
> #if (__riscv_xlen == 64)
>
>___
>ffmpeg-cvslog mailing list
>ffmpeg-cvs...@ffmpeg.org
>https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog
>
>To unsubscribe, visit link above, or email
>ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".
>

Thanks, Lynne.
___
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/4] lavc/bswapdsp: RISC-V V bswap16_buf

2022-10-04 Thread Lynne
Oct 2, 2022, 13:55 by r...@remlab.net:

> From: Rémi Denis-Courmont 
>
> ---
>  libavcodec/riscv/bswapdsp_init.c |  5 -
>  libavcodec/riscv/bswapdsp_rvv.S  | 17 +
>  2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/riscv/bswapdsp_init.c 
> b/libavcodec/riscv/bswapdsp_init.c
> index c17b6b75bb..abe84ec1f7 100644
> --- a/libavcodec/riscv/bswapdsp_init.c
> +++ b/libavcodec/riscv/bswapdsp_init.c
> @@ -27,6 +27,7 @@
>  
>  void ff_bswap32_buf_rvb(uint32_t *dst, const uint32_t *src, int len);
>  void ff_bswap32_buf_rvv(uint32_t *dst, const uint32_t *src, int len);
> +void ff_bswap16_buf_rvv(uint16_t *dst, const uint16_t *src, int len);
>  
>  av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c)
>  {
> @@ -37,7 +38,9 @@ av_cold void ff_bswapdsp_init_riscv(BswapDSPContext *c)
>  c->bswap_buf = ff_bswap32_buf_rvb;
>  #endif
>  #if HAVE_RVV
> -if (cpu_flags & AV_CPU_FLAG_RVV_I32)
> +if (cpu_flags & AV_CPU_FLAG_RVV_I32) {
>  c->bswap_buf = ff_bswap32_buf_rvv;
> +c->bswap16_buf = ff_bswap16_buf_rvv;
> +}
>  #endif
>  }
> diff --git a/libavcodec/riscv/bswapdsp_rvv.S b/libavcodec/riscv/bswapdsp_rvv.S
> index 7ea747b3ce..ef2999c1be 100644
> --- a/libavcodec/riscv/bswapdsp_rvv.S
> +++ b/libavcodec/riscv/bswapdsp_rvv.S
> @@ -43,3 +43,20 @@ func ff_bswap32_buf_rvv, zve32x
>  
>  ret
>  endfunc
> +
> +func ff_bswap16_buf_rvv, zve32x
> +li  t2, 2
> +addit1, a0, 1
> +1:
> +vsetvlit0, a2, e8, m1, ta, ma
> +vlseg2e8.v v8, (a1)
> +suba2, a2, t0
> +sh1add a1, t0, a1
> +vsse8.vv8, (t1), t2
> +sh1add t1, t0, t1
> +vsse8.vv9, (a0), t2
> +sh1add a0, t0, a0
> +bnez   a2, 1b
> +
> +ret
> +endfunc
>

Pushed patchset with a minor bump and apichanges
Thanks
___
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".