[FFmpeg-devel] [PATCH] avformat/riffenc: don't force WAVEFORMATEXTENSIBLE for flt/dbl LPCM

2023-12-20 Thread Gyan Doshi
2c2a167ca7 forced WAVEFORMATEXTENSIBLE for all LPCM streams with greater
than 16 bits per sample. However, WAVEFORMATEX allows IEEE Float samples
or any depth where raw depth == coded depth, see Remarks section at
https://learn.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformatex
and samples M1F1-float32-AFsp, M1F1-float64-AFsp at
https://www.mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Samples.html

There are hardware devices and likely software players requiring float samples
that fail to qualify files with WAVEFORMATEXTENSIBLE headers.
---
 libavformat/riffenc.c  | 2 +-
 tests/ref/acodec/pcm-f32le | 4 ++--
 tests/ref/acodec/pcm-f64le | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavformat/riffenc.c b/libavformat/riffenc.c
index 3325419b94..8accb69541 100644
--- a/libavformat/riffenc.c
+++ b/libavformat/riffenc.c
@@ -81,7 +81,7 @@ int ff_put_wav_header(AVFormatContext *s, AVIOContext *pb,
 av_channel_layout_compare(&par->ch_layout, 
&(AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO)) ||
par->sample_rate > 48000 ||
par->codec_id == AV_CODEC_ID_EAC3 || par->codec_id 
== AV_CODEC_ID_DFPWM ||
-   av_get_bits_per_sample(par->codec_id) > 16;
+   (av_get_bits_per_sample(par->codec_id) > 16 && 
par->codec_tag != 0x0003);
 
 if (waveformatextensible)
 avio_wl16(pb, 0xfffe);
diff --git a/tests/ref/acodec/pcm-f32le b/tests/ref/acodec/pcm-f32le
index c0fdd70cd2..c63a2c4b70 100644
--- a/tests/ref/acodec/pcm-f32le
+++ b/tests/ref/acodec/pcm-f32le
@@ -1,4 +1,4 @@
-653d82a64b7bd96ac193e105e9f92d4c *tests/data/fate/acodec-pcm-f32le.wav
-2116880 tests/data/fate/acodec-pcm-f32le.wav
+03ae40a19deacaca6e0c4ec08dd35956 *tests/data/fate/acodec-pcm-f32le.wav
+2116858 tests/data/fate/acodec-pcm-f32le.wav
 95e54b261530a1bcf6de6fe3b21dc5f6 *tests/data/fate/acodec-pcm-f32le.out.wav
 stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  1058400/  1058400
diff --git a/tests/ref/acodec/pcm-f64le b/tests/ref/acodec/pcm-f64le
index 5c90e7bbbd..894d593ac1 100644
--- a/tests/ref/acodec/pcm-f64le
+++ b/tests/ref/acodec/pcm-f64le
@@ -1,4 +1,4 @@
-48b4cd378f47a50dc902aa03cc8280ed *tests/data/fate/acodec-pcm-f64le.wav
-4233680 tests/data/fate/acodec-pcm-f64le.wav
+69ffdb079600c53a00c5b0119b586a98 *tests/data/fate/acodec-pcm-f64le.wav
+4233658 tests/data/fate/acodec-pcm-f64le.wav
 95e54b261530a1bcf6de6fe3b21dc5f6 *tests/data/fate/acodec-pcm-f64le.out.wav
 stddev:0.00 PSNR:999.99 MAXDIFF:0 bytes:  1058400/  1058400
-- 
2.39.1

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

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


[FFmpeg-devel] Backporting Clang 14 fix to the 4.4 branch

2023-12-20 Thread Brad Smith



https://github.com/FFmpeg/FFmpeg/commit/ab792634197e364ca1bb194f9abe36836e42f12d

But the function is in libavformat/utils.c for 4.4 instead of 
libavformat/seek.c.


Could the Clang 14 fix please be backported to the 4.4 branch?

OpenBSD ran into this issue recently when upgrading from Clang 13 to 16.

https://marc.info/?l=openbsd-ports&m=170284868209618&w=2
https://marc.info/?l=openbsd-ports-cvs&m=170291311612369&w=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] avfilter/vf_showinfo: add udu_sei_as_ascii option

2023-12-20 Thread Zhao Zhili



> On Dec 13, 2023, at 11:46, Zhao Zhili  wrote:
> 
> From: Zhao Zhili 
> 
> Some encoders (e.g., libx264) dump encoder configuration as user
> data unregistered SEI message. This option try to print it as
> ascii character when possible.
> ---
> doc/filters.texi  |  4 
> libavfilter/version.h |  2 +-
> libavfilter/vf_showinfo.c | 14 --
> 3 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/doc/filters.texi b/doc/filters.texi
> index 6d00ba2c3f..0d4c5a47a0 100644
> --- a/doc/filters.texi
> +++ b/doc/filters.texi
> @@ -21796,6 +21796,10 @@ This filter supports the following options:
> @table @option
> @item checksum
> Calculate checksums of each plane. By default enabled.
> +
> +@item udu_sei_as_ascii
> +Try to print user data unregistered SEI as ascii character when possible,
> +in hex format otherwise.
> @end table
> 
> The shown line contains a sequence of key/value pairs of the form
> diff --git a/libavfilter/version.h b/libavfilter/version.h
> index 7642b670d1..83931e11dd 100644
> --- a/libavfilter/version.h
> +++ b/libavfilter/version.h
> @@ -32,7 +32,7 @@
> #include "version_major.h"
> 
> #define LIBAVFILTER_VERSION_MINOR  14
> -#define LIBAVFILTER_VERSION_MICRO 100
> +#define LIBAVFILTER_VERSION_MICRO 101
> 
> 
> #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
> diff --git a/libavfilter/vf_showinfo.c b/libavfilter/vf_showinfo.c
> index 71869446c6..309de28df9 100644
> --- a/libavfilter/vf_showinfo.c
> +++ b/libavfilter/vf_showinfo.c
> @@ -22,6 +22,7 @@
>  * filter for showing textual video frame information
>  */
> 
> +#include 
> #include 
> 
> #include "libavutil/bswap.h"
> @@ -52,6 +53,7 @@
> typedef struct ShowInfoContext {
> const AVClass *class;
> int calculate_checksums;
> +int udu_sei_as_ascii;
> } ShowInfoContext;
> 
> #define OFFSET(x) offsetof(ShowInfoContext, x)
> @@ -59,6 +61,8 @@ typedef struct ShowInfoContext {
> 
> static const AVOption showinfo_options[] = {
> { "checksum", "calculate checksums", OFFSET(calculate_checksums), 
> AV_OPT_TYPE_BOOL, {.i64=1}, 0, 1, VF },
> +{ "udu_sei_as_ascii", "try to print user data unregistered SEI as ascii 
> character when possible",
> +OFFSET(udu_sei_as_ascii), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VF },
> { NULL }
> };
> 
> @@ -418,6 +422,7 @@ static void dump_video_enc_params(AVFilterContext *ctx, 
> const AVFrameSideData *s
> static void dump_sei_unregistered_metadata(AVFilterContext *ctx, const 
> AVFrameSideData *sd)
> {
> const uint8_t *user_data = sd->data;
> +ShowInfoContext *s = ctx->priv;
> 
> if (sd->size < AV_UUID_LEN) {
> av_log(ctx, AV_LOG_ERROR, "invalid data(%"SIZE_SPECIFIER" < "
> @@ -428,8 +433,13 @@ static void 
> dump_sei_unregistered_metadata(AVFilterContext *ctx, const AVFrameSi
> av_log(ctx, AV_LOG_INFO, "UUID=" AV_PRI_UUID "\n", 
> AV_UUID_ARG(user_data));
> 
> av_log(ctx, AV_LOG_INFO, "User Data=");
> -for (size_t i = 16; i < sd->size; i++)
> -av_log(ctx, AV_LOG_INFO, "%02x", user_data[i]);
> +for (size_t i = 16; i < sd->size; i++) {
> +const char *format = "%02x";
> +
> +if (s->udu_sei_as_ascii)
> +format = isprint(user_data[i]) ? "%c" : "\\x%02x";
> +av_log(ctx, AV_LOG_INFO, format, user_data[i]);
> +}
> av_log(ctx, AV_LOG_INFO, "\n");
> }
> 
> -- 
> 2.25.1

Ping. Any comments on this idea and implementation?

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

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


[FFmpeg-devel] Temporary delays in patch reviewing and testing by me

2023-12-20 Thread Michael Niedermayer
Hi all

My main development machiene died today, so expect increased delays
about things that involve me/it until thats fixed

Rest of the mail is just about the issue, and you can skip reading that

Timeline:
box suddenly stopped, no reaction to any input or pings
power off and on did not bring it back, screen stayed dark, keyboard too
but fans spin up and theres power
opening it up i find it stuck on Q-code "0d" so i power it off
wiggle the ram modules a bit power it back on and it gets stuck on
qcode "15" i power cycle again and it reaches bios setup, so i go over all
values and just look but as i look, it hangs hard again
off/on again and we hit "0d" again
so i remove one of the CPU fans to get to the DIMM modules and reconfigure them 
like this:
B1A1 0+2 -> boot ok
B2A2 0+2 -> boot ok
B2A2 1+3 -> 0d
B2A2 0+3 -> boot ok
B1A1 1+2 -> 0d

This is consistent with DIMM module 1 being faulty. But iam not 100% convinced
because this box never crashed not once, it was always rock solid and suddenly
one module is so faulty the box hangs so early.
Either way i ordered 4 new and bigger modules from 2 independant shops
they should be here soon but i dont know what "soon" is around christmess

also i could try running it with just 2 modules, i might try that
tomorrow

RAM modules are: G.Skill Trident Z F4-3600C15D-16GTZ DDr4-3600 CL15-15-15 1.35v 
8Gb manufaturing date 2019 Dec
MOBO is: ASUS ROG STRIX X570-E Gaming

PS: i could have gotten the modules quicker but i was trying to get
4x16gb to double the 4x8gb and have them not slower. And it seems that
constrains me to 2-3days waiting at quickest.

PS2: The faulty module looks perfectly fine and all look suprisingly clean

thx

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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 v1] avcodec/av1dec: Add tile list OBU to decompose list

2023-12-20 Thread Wang, Fei W
On Wed, 2023-12-20 at 17:11 +0100, Andreas Rheinhardt wrote:
> fei.w.wang-at-intel@ffmpeg.org:
> > From: Fei Wang 
> > 
> > Show the unsupported message and return unsupported for clips
> > contain
> > tile list OBU since it hasn't been implemented. Otherwise, decoding
> > maybe successful but result is incorrect.
> > 
> > Signed-off-by: Fei Wang 
> > ---
> >  libavcodec/av1dec.c | 5 +
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
> > index 4dcde234c6..629e37c3f8 100644
> > --- a/libavcodec/av1dec.c
> > +++ b/libavcodec/av1dec.c
> > @@ -805,6 +805,7 @@ static const CodedBitstreamUnitType
> > decompose_unit_types[] = {
> >  AV1_OBU_SEQUENCE_HEADER,
> >  AV1_OBU_TEMPORAL_DELIMITER,
> >  AV1_OBU_TILE_GROUP,
> > +AV1_OBU_TILE_LIST,
> 
> What do you need this for? Decomposing it would only change whether
> CodedBitstreamUnit.content is available, but you are only reading
> CodedBitstreamUnit.type.

To show the unsupported error and let user know that there are tile
list OBUs in bitstream that decoder can't handle them. Otherwise, like
my commit mentioned, tile list obu bitsteam may be decoded 'successful'
according to log.

> 
> >  };
> >  
> >  static av_cold int av1_decode_init(AVCodecContext *avctx)
> > @@ -1327,6 +1328,10 @@ static int
> > av1_receive_frame_internal(AVCodecContext *avctx, AVFrame *frame)
> >  }
> >  break;
> >  case AV1_OBU_TILE_LIST:
> > +av_log(avctx, AV_LOG_ERROR, "Large scale tile decoding
> > is unsupported.\n");
> > +ret = AVERROR_PATCHWELCOME;
> > +goto end;
> > +break;
> >  case AV1_OBU_TEMPORAL_DELIMITER:
> >  case AV1_OBU_PADDING:
> >  break;
> 
> ___
> 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] Add new vf_tiltandshift filter

2023-12-20 Thread Vittorio Giovara
On Wed, Dec 20, 2023 at 2:50 PM Nicolas George  wrote:

> Vittorio Giovara (12023-12-20):
> > If there are no more comments, I'll push this today or tomorrow.
>
> I think the change you made after the last request might go too far, but
> I have not had time to look at the code carefully enough to be sure.
>
> If a filter can produce several output frames from one input, then it
> must send at lease one of the NEW frames.
>
> An illustration to make it clear: if I1 allows to compute O1a, O1b, O1c,
> I2 allows to compute O2a, O2b, O2c, etc.
>
> Then when I1 arrives, the filter must output at least O1a, it can output
> O1b and O1c or not.
>
> But when I2 arrives, it must output at lease O2a, which means it must
> output O1b and O1c if that was not done at the time of I1.
>
> Your filter only outputs one frame per input, but it seems to me it can
> create several frames.
>

the filter needs at least $width input frames to generate an output frame,
so it queues them
when the buffer is full, it will pop the head and generate the output frame
when the next input frame arrives, but the amount of input frames in the
queue needed to generate new frames is constant so it cannot output any
additional frames
at the end it will flush the buffer and generate the remaining output frames
-- 
Vittorio
___
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] Add new vf_tiltandshift filter

2023-12-20 Thread Nicolas George
Vittorio Giovara (12023-12-20):
> If there are no more comments, I'll push this today or tomorrow.

I think the change you made after the last request might go too far, but
I have not had time to look at the code carefully enough to be sure.

If a filter can produce several output frames from one input, then it
must send at lease one of the NEW frames.

An illustration to make it clear: if I1 allows to compute O1a, O1b, O1c,
I2 allows to compute O2a, O2b, O2c, etc.

Then when I1 arrives, the filter must output at least O1a, it can output
O1b and O1c or not.

But when I2 arrives, it must output at lease O2a, which means it must
output O1b and O1c if that was not done at the time of I1.

Your filter only outputs one frame per input, but it seems to me it can
create several frames.

Regards,

-- 
  Nicolas George


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] Add new vf_tiltandshift filter

2023-12-20 Thread Vittorio Giovara
On Fri, Dec 15, 2023 at 3:12 PM Vittorio Giovara 
wrote:

>
>
> On Fri, Dec 15, 2023 at 12:34 PM Andreas Rheinhardt <
> andreas.rheinha...@outlook.com> wrote:
>
>> > +static int list_add_frame(FrameList **list, size_t *size, AVFrame
>> > *frame)
>> > +{
>> > +FrameList *element = av_mallocz(sizeof(FrameList));
>>
>> The overhead of this FrameList is unnecessary: You can simply use
>> AVFrame.opaque as your next pointer.
>>
>
> Good tip! Attached an edited version, with all the other suggestions too.
> --
> Vittorio
>

If there are no more comments, I'll push this today or tomorrow.
Thanks
-- 
Vittorio
___
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] lavc: remove the QOA decoder

2023-12-20 Thread Michael Niedermayer
On Wed, Dec 20, 2023 at 05:57:40PM +0100, Tomas Härdin wrote:
> tis 2023-12-19 klockan 15:02 +0100 skrev Nicolas George:
[...]
> [...] , but every line of code
> carries with it a non-zero maintenance burden

Assuming you mean with "non-zero" a "larger than zero" maintenance burden

then we can proof this to be false

First we need to define what you mean by "maintenance burden" ?
There are a few ways this could be defined
A. the absolute number of hours all developers need to spend to maintain
some sort of stable quality

B. the number of hours on average a FFmpeg developers need to spend to
maintain some sort of stable quality

(A favors 9 hours over 10 hours even if the 10 hour case has 2 devlopers
 available but the 9 has only 1. While B favors the 10/2 over 9/1)

C. the number of hours of work noone really wants to do, FFmpeg developers need
to spend to maintain some sort of stable quality
(again we can do this as all or per developer)
(the idea of C is that we count work that people dont like to do with more 
weight)

(and there are many more ways to define it ...)

Now the sketch of a proof :)

Consider all the code related to "--help"
code related to printing the version and build. Code printing where to
send bugreports/samples.
Also all formating maybe ;)

or even some random check here or there.

The "maintenance burden" in all definitions will worsen as the code
becomes less readable, less well documented or as things related to
maintaince are removed

But its more than just this i think.
* If you remove code that some comnpany or major user needs, and who pays for
  maintaince than removial of even complex and hard to maintain code can
  actually be negative and similarly adding complex code can actually be
  positive maintaince wise. IF it also results in additional resources
  becoming available for maintaince. (this can be a developers time or
  a companies money or other)

* In the same light both merging and spliting code can have an impact on
  maintenance burden. For example if you have a group of developers who are
  unable to work together, them spliting up in 2 forks and a 3rd merging their
  work together avoiding their inability to agree can reduce burden on both
  OTOH if 2 groups can join and work together the sharing of resources and such
  can free up time and reduce maintaince burden

What iam trying to say is, the maintaince burden resulting from a change
is complex

In this specific case here we have a patch proposing the removial of a decoder
missing a test.
Its easy to say the burden is less when the decoder is removed
But its author recently left the project too

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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] lavc: remove the QOA decoder

2023-12-20 Thread Nicolas George
Tomas Härdin (12023-12-20):
> I'm not even sure what this is trying to say, but every line of code
> carries with it a non-zero maintenance burden

Sure, if you want. But for some parts of FFmpeg, like the one we are
discussing, the maintenance burden is so small that we wasted ten time
as much energy having this discussion. I congratulate you on an
efficient use of developers resources.

> Brag about your criminal enterprise and get busted by cops?

You do not even know the classics?

-- 
  Nicolas George


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] [MXF] - Add jpeg2000 subdescriptor in MXF file (V2).

2023-12-20 Thread Cédric Le Barz

Le 19/12/2023 à 14:36, Tomas Härdin a écrit :

+for ( comp = 0; comp < component_count; comp++ ) {
+avio_write(pb, &sc->j2k_info.j2k_comp_desc[3*comp] , 3);
+}

Looks like this could be simplified to just

   avio_write(pb, sc->j2k_info.j2k_comp_desc, 3*component_count);


+if (j2k_ncomponents != component_count) {
+av_log(s, AV_LOG_ERROR, "Incoherence about components image
number.\n");
+}

I again feel this should be a hard error


+for (comp = 0; comp < j2k_ncomponents; comp++) {
+sc->j2k_info.j2k_comp_desc[comp*j2k_ncomponents] =
bytestream2_get_byteu(&g);   // Bitdepth for each component
+sc->j2k_info.j2k_comp_desc[comp*j2k_ncomponents+1] =
bytestream2_get_byteu(&g); // Horizontal sampling for each component
+sc->j2k_info.j2k_comp_desc[comp*j2k_ncomponents+2] =
bytestream2_get_byteu(&g); // Vertical sampling for each component
+}

Could be simplified to a single avio_read()

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


Here is the new version of the patch taken into account your remarks.

Regards,

Cédric Le Barz
--- Begin Message ---
Signed-off-by: Cedric Le Barz 
---
 ffmpeg/libavformat/mxf.h|   1 +
 ffmpeg/libavformat/mxfenc.c | 169 +++-
 2 files changed, 169 insertions(+), 1 deletion(-)

diff --git a/ffmpeg/libavformat/mxf.h b/ffmpeg/libavformat/mxf.h
index 2561605..7dd1681 100644
--- a/ffmpeg/libavformat/mxf.h
+++ b/ffmpeg/libavformat/mxf.h
@@ -55,6 +55,7 @@ enum MXFMetadataSetType {
 SoundfieldGroupLabelSubDescriptor,
 GroupOfSoundfieldGroupsLabelSubDescriptor,
 FFV1SubDescriptor,
+JPEG2000SubDescriptor,
 };
 
 enum MXFFrameLayout {
diff --git a/ffmpeg/libavformat/mxfenc.c b/ffmpeg/libavformat/mxfenc.c
index 53bd6ae..685c11b 100644
--- a/ffmpeg/libavformat/mxfenc.c
+++ b/ffmpeg/libavformat/mxfenc.c
@@ -48,8 +48,10 @@
 #include "libavutil/pixdesc.h"
 #include "libavutil/time_internal.h"
 #include "libavcodec/defs.h"
+#include "libavcodec/bytestream.h"
 #include "libavcodec/golomb.h"
 #include "libavcodec/h264.h"
+#include "libavcodec/jpeg2000.h"
 #include "libavcodec/packet_internal.h"
 #include "libavcodec/rangecoder.h"
 #include "libavcodec/startcode.h"
@@ -78,6 +80,20 @@ typedef struct MXFIndexEntry {
 uint8_t flags;
 } MXFIndexEntry;
 
+typedef struct j2k_info_t {
+uint16_t j2k_cap;///< j2k required decoder capabilities
+uint16_t j2k_rsiz;   ///< j2k required decoder capabilities (Rsiz)
+uint32_t j2k_xsiz;   ///< j2k width of the reference grid (Xsiz)
+uint32_t j2k_ysiz;   ///< j2k height of the reference grid (Ysiz)
+uint32_t j2k_x0siz;  ///< j2k horizontal offset from the origin of the 
reference grid to the left side of the image (X0siz)
+uint32_t j2k_y0siz;  ///< j2k vertical offset from the origin of the 
reference grid to the left side of the image (Y0siz)
+uint32_t j2k_xtsiz;  ///< j2k width of one reference tile with respect 
to the reference grid (XTsiz)
+uint32_t j2k_ytsiz;  ///< j2k height of one reference tile with 
respect to the reference grid (YTsiz)
+uint32_t j2k_xt0siz; ///< j2k horizontal offset from the origin of the 
reference grid to the left side of the first tile (XT0siz)
+uint32_t j2k_yt0siz; ///< j2k vertical offset from the origin of the 
reference grid to the left side of the first tile (YT0siz)
+uint8_t  j2k_comp_desc[12]; ///< j2k components descriptor (Ssiz(i), 
XRsiz(i), YRsiz(i))
+} j2k_info_t;
+
 typedef struct MXFStreamContext {
 int64_t pkt_cnt; ///< pkt counter for muxed packets
 UID track_essence_element_key;
@@ -104,6 +120,7 @@ typedef struct MXFStreamContext {
 int low_delay;   ///< low delay, used in mpeg-2 descriptor
 int avc_intra;
 int micro_version;   ///< format micro_version, used in ffv1 descriptor
+j2k_info_t j2k_info;
 } MXFStreamContext;
 
 typedef struct MXFContainerEssenceEntry {
@@ -413,6 +430,20 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
 { 0xDFD9, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x0E,0x04,0x01,0x06,0x0C,0x06,0x00,0x00,0x00}},
 /* FFV1 Micro-version */
 { 0xDFDA, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x0E,0x04,0x01,0x06,0x0C,0x05,0x00,0x00,0x00}},
 /* FFV1 Version */
 { 0xDFDB, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x0E,0x04,0x01,0x06,0x0C,0x01,0x00,0x00,0x00}},
 /* FFV1 Initialization Metadata */
+// ff_mxf_jpeg2000_local_tags
+{ 0x8400, 
{0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x09,0x06,0x01,0x01,0x04,0x06,0x10,0x00,0x00}},
 /* Sub Descriptors / Opt Ordered array of strong references to sub descriptor 
sets */
+{ 0x8401, 
{0x06,0x0e,0x2b,0x34,0x01,0x01,0x01,0x0a,0x04,0x01,0x06,0x03,0x01,0x00,0x00,0x00}},
 /* Rsiz: An enumerated value that de

Re: [FFmpeg-devel] [PATCH] lavc: remove the QOA decoder

2023-12-20 Thread Tomas Härdin
tis 2023-12-19 klockan 15:02 +0100 skrev Nicolas George:
> Tomas Härdin (12023-12-19):
> > Technical debt concerns everyone
> 
> There is no technical debt. There is never a technical debt from
> something that can be removed at an instant notice and that some are
> considering removing now

I'm not even sure what this is trying to say, but every line of code
carries with it a non-zero maintenance burden

> Learn from the Dread Pirate Roberts

Brag about your criminal enterprise and get busted by cops?

/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 v1] avcodec/av1dec: Add tile list OBU to decompose list

2023-12-20 Thread Andreas Rheinhardt
fei.w.wang-at-intel@ffmpeg.org:
> From: Fei Wang 
> 
> Show the unsupported message and return unsupported for clips contain
> tile list OBU since it hasn't been implemented. Otherwise, decoding
> maybe successful but result is incorrect.
> 
> Signed-off-by: Fei Wang 
> ---
>  libavcodec/av1dec.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
> index 4dcde234c6..629e37c3f8 100644
> --- a/libavcodec/av1dec.c
> +++ b/libavcodec/av1dec.c
> @@ -805,6 +805,7 @@ static const CodedBitstreamUnitType 
> decompose_unit_types[] = {
>  AV1_OBU_SEQUENCE_HEADER,
>  AV1_OBU_TEMPORAL_DELIMITER,
>  AV1_OBU_TILE_GROUP,
> +AV1_OBU_TILE_LIST,

What do you need this for? Decomposing it would only change whether
CodedBitstreamUnit.content is available, but you are only reading
CodedBitstreamUnit.type.

>  };
>  
>  static av_cold int av1_decode_init(AVCodecContext *avctx)
> @@ -1327,6 +1328,10 @@ static int av1_receive_frame_internal(AVCodecContext 
> *avctx, AVFrame *frame)
>  }
>  break;
>  case AV1_OBU_TILE_LIST:
> +av_log(avctx, AV_LOG_ERROR, "Large scale tile decoding is 
> unsupported.\n");
> +ret = AVERROR_PATCHWELCOME;
> +goto end;
> +break;
>  case AV1_OBU_TEMPORAL_DELIMITER:
>  case AV1_OBU_PADDING:
>  break;

___
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] configure: Disable inline assembly with nonlocal labels with LTO on Clang on Windows

2023-12-20 Thread Martin Storsjö
The file libavcodec/x86/mlpdsp_init.c uses inline assembly with
nonlocal labels that are referenced outside of the assembly in C.
This fails to link with LTO when built with Clang when targeting
Windows.

The root cause has been reported upstream at
https://github.com/llvm/llvm-project/issues/76046.

Fixes: https://trac.ffmpeg.org/ticket/10548
---
 configure | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/configure b/configure
index 7742ea4ba2..b4f7c2de66 100755
--- a/configure
+++ b/configure
@@ -7372,6 +7372,16 @@ if [ -n "$lto" ]; then
 check_cflags  $lto
 check_ldflags $lto $cpuflags
 disable inline_asm_direct_symbol_refs
+if test "$cc_type" = "clang"; then
+# Clang's LTO fails on Windows, when there are references outside
+# of inline assembly to nonlocal labels defined within inline assembly,
+# see https://github.com/llvm/llvm-project/issues/76046.
+case $target_os in
+mingw32|win32)
+disable inline_asm_nonlocal_labels
+;;
+esac
+fi
 fi
 
 enabled ftrapv && check_cflags -ftrapv
-- 
2.34.1

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

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


[FFmpeg-devel] [PATCH] libavcodec: fix -Wint-conversion in vulkan

2023-12-20 Thread Sam James
FIx warnings (soon to be errors in GCC 14, already so in Clang 15):
```
src/libavcodec/vulkan_av1.c: In function ‘vk_av1_create_params’:
src/libavcodec/vulkan_av1.c:183:43: error: initialization of ‘long long 
unsigned int’ from ‘void *’ makes integer from pointer without a cast 
[-Wint-conversion]
  183 | .videoSessionParametersTemplate = NULL,
  |   ^~~~
src/libavcodec/vulkan_av1.c:183:43: note: (near initialization for 
‘(anonymous).videoSessionParametersTemplate’)
```

Use Vulkan's VK_NULL_HANDLE instead of bare NULL.

Fix Trac ticket #10724.

Was reported downstream in Gentoo at https://bugs.gentoo.org/919067.

Signed-off-by: Sam James 
---
 libavcodec/vulkan_av1.c| 2 +-
 libavcodec/vulkan_decode.c | 6 +++---
 libavcodec/vulkan_h264.c   | 2 +-
 libavcodec/vulkan_hevc.c   | 2 +-
 libavcodec/vulkan_video.c  | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/libavcodec/vulkan_av1.c b/libavcodec/vulkan_av1.c
index 4998bf7ebc..9730e4b08d 100644
--- a/libavcodec/vulkan_av1.c
+++ b/libavcodec/vulkan_av1.c
@@ -180,7 +180,7 @@ static int vk_av1_create_params(AVCodecContext *avctx, 
AVBufferRef **buf)
 .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
 .pNext = &av1_params,
 .videoSession = ctx->common.session,
-.videoSessionParametersTemplate = NULL,
+.videoSessionParametersTemplate = VK_NULL_HANDLE,
 };
 
 err = ff_vk_decode_create_params(buf, avctx, ctx, &session_params_create);
diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index a89d84fcaa..fdbcbb450a 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -188,9 +188,9 @@ int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, 
AVFrame *pic,
 return 0;
 
 vkpic->dpb_frame = NULL;
-vkpic->img_view_ref  = NULL;
-vkpic->img_view_out  = NULL;
-vkpic->img_view_dest = NULL;
+vkpic->img_view_ref  = VK_NULL_HANDLE;
+vkpic->img_view_out  = VK_NULL_HANDLE;
+vkpic->img_view_dest = VK_NULL_HANDLE;
 
 vkpic->destroy_image_view = vk->DestroyImageView;
 vkpic->wait_semaphores = vk->WaitSemaphores;
diff --git a/libavcodec/vulkan_h264.c b/libavcodec/vulkan_h264.c
index e727aafb16..39c123ddca 100644
--- a/libavcodec/vulkan_h264.c
+++ b/libavcodec/vulkan_h264.c
@@ -315,7 +315,7 @@ static int vk_h264_create_params(AVCodecContext *avctx, 
AVBufferRef **buf)
 .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
 .pNext = &h264_params,
 .videoSession = ctx->common.session,
-.videoSessionParametersTemplate = NULL,
+.videoSessionParametersTemplate = VK_NULL_HANDLE,
 };
 
 /* SPS list */
diff --git a/libavcodec/vulkan_hevc.c b/libavcodec/vulkan_hevc.c
index 99fdcf3b45..033172cbd6 100644
--- a/libavcodec/vulkan_hevc.c
+++ b/libavcodec/vulkan_hevc.c
@@ -653,7 +653,7 @@ static int vk_hevc_create_params(AVCodecContext *avctx, 
AVBufferRef **buf)
 .sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
 .pNext = &h265_params,
 .videoSession = ctx->common.session,
-.videoSessionParametersTemplate = NULL,
+.videoSessionParametersTemplate = VK_NULL_HANDLE,
 };
 
 HEVCHeaderSet *hdr;
diff --git a/libavcodec/vulkan_video.c b/libavcodec/vulkan_video.c
index 5fa8292b28..fb20315db4 100644
--- a/libavcodec/vulkan_video.c
+++ b/libavcodec/vulkan_video.c
@@ -287,7 +287,7 @@ av_cold void ff_vk_video_common_uninit(FFVulkanContext *s,
 if (common->session) {
 vk->DestroyVideoSessionKHR(s->hwctx->act_dev, common->session,
s->hwctx->alloc);
-common->session = NULL;
+common->session = VK_NULL_HANDLE;
 }
 
 if (common->nb_mem && common->mem)
-- 
2.43.0

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

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


Re: [FFmpeg-devel] [PATCH v2] fftools/ffplay: split filters & show modes cycling into separate keys

2023-12-20 Thread Ondřej Fiala
On Tue Dec 19, 2023 at 9:12 PM CET, Ondřej Fiala wrote:
> ...
>
> diff --git a/fftools/ffplay.c b/fftools/ffplay.c
> index 873ee8cc74..05182d9f49 100644
> --- a/fftools/ffplay.c
> +++ b/fftools/ffplay.c
> @@ -3370,14 +3370,11 @@ static void event_loop(VideoState *cur_stream)
>  case SDLK_t:
>  stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
>  break;
> +case SDLK_d:
> +toggle_audio_display(cur_stream);
> +break;
>  case SDLK_w:
> -if (cur_stream->show_mode == SHOW_MODE_VIDEO && 
> cur_stream->vfilter_idx < nb_vfilters - 1) {
> -if (++cur_stream->vfilter_idx >= nb_vfilters)
> -cur_stream->vfilter_idx = 0;
> -} else {
> -cur_stream->vfilter_idx = 0;
> -toggle_audio_display(cur_stream);
> -}
> +cur_stream->vfilter_idx = (cur_stream->vfilter_idx + 1) % 
> nb_vfilters;
This actually doesn't account for nb_vfilters being 0. Use version 1 of the 
patch instead please.

>  break;
>  case SDLK_PAGEUP:
>  if (cur_stream->ic->nb_chapters <= 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] Subject: [PATCH 3/3] lavc/dnxhdenc: R-V V get_pixels_8x4_sym

2023-12-20 Thread flow gg
Because the format of [PATCH 1/3] was modified, this patch needs to be
changed, and it has been modified in this reply.

flow gg  于2023年12月20日周三 16:41写道:

> C908:
> get_pixels_8x4_sym_c: 297.2
> get_pixels_8x4_sym_rvv_i64: 52.7
> ___
> 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".
>
From b7900ed41724cc42871362b73b2e4ac661d8728a Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Wed, 20 Dec 2023 16:28:33 +0800
Subject: [PATCH 3/3] lavc/dnxhdenc: R-V V get_pixels_8x4_sym

C908:
get_pixels_8x4_sym_c: 297.2
get_pixels_8x4_sym_rvv_i64: 52.7
---
 libavcodec/dnxhdenc.c  |  4 ++-
 libavcodec/dnxhdenc.h  |  1 +
 libavcodec/riscv/Makefile  |  2 ++
 libavcodec/riscv/dnxenc_init.c | 41 
 libavcodec/riscv/dnxenc_rvv.S  | 50 ++
 5 files changed, 97 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/riscv/dnxenc_init.c
 create mode 100644 libavcodec/riscv/dnxenc_rvv.S

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 0d9727bbbf..bab92753fa 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -1378,7 +1378,9 @@ const FFCodec ff_dnxhd_encoder = {
 
 void ff_dnxhdenc_init(DNXHDEncContext *ctx)
 {
-#if ARCH_X86
+#if ARCH_RISCV
+ff_dnxhdenc_init_riscv(ctx);
+#elif ARCH_X86
 ff_dnxhdenc_init_x86(ctx);
 #endif
 }
diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h
index 95aea83d28..3ed1451431 100644
--- a/libavcodec/dnxhdenc.h
+++ b/libavcodec/dnxhdenc.h
@@ -112,6 +112,7 @@ typedef struct DNXHDEncContext {
 } DNXHDEncContext;
 
 void ff_dnxhdenc_init(DNXHDEncContext *ctx);
+void ff_dnxhdenc_init_riscv(DNXHDEncContext *ctx);
 void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);
 
 #endif /* AVCODEC_DNXHDENC_H */
diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index aa758eba1c..35ad149326 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -13,6 +13,8 @@ RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o
 OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o
 RV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvb.o
 RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o
+OBJS-$(CONFIG_DNXHD_ENCODER) += riscv/dnxenc_init.o
+RVV-OBJS-$(CONFIG_DNXHD_ENCODER) += riscv/dnxenc_rvv.o
 OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_init.o
 RVV-OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_rvv.o
 OBJS-$(CONFIG_FLAC_DECODER) += riscv/flacdsp_init.o
diff --git a/libavcodec/riscv/dnxenc_init.c b/libavcodec/riscv/dnxenc_init.c
new file mode 100644
index 00..43bd61afd4
--- /dev/null
+++ b/libavcodec/riscv/dnxenc_init.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * 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 "libavcodec/dnxhdenc.h"
+
+void ff_get_pixels_8x4_sym_rvv(int16_t *block, const uint8_t *pixels,
+ptrdiff_t line_size);
+
+av_cold void ff_dnxhdenc_init_riscv(DNXHDEncContext *ctx)
+{
+#if HAVE_RVV
+int flags = av_get_cpu_flags();
+
+if (flags & AV_CPU_FLAG_RVV_I64) {
+if (ctx->cid_table->bit_depth == 8) {
+ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_rvv;
+}
+}
+#endif
+}
diff --git a/libavcodec/riscv/dnxenc_rvv.S b/libavcodec/riscv/dnxenc_rvv.S
new file mode 100644
index 00..f287a05575
--- /dev/null
+++ b/libavcodec/riscv/dnxenc_rvv.S
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * 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 GN

Re: [FFmpeg-devel] Subject: [PATCH 1/3] lvac/dnxhdenc: add ff_dnxhdenc_init

2023-12-20 Thread flow gg
> typo in 'lavc'

fixed.

> Brace should be on its own line

fixed

> Shouldn't it actually replace the existing ff_dnxhdenc_init_x86() call
in dnxhdenc.c?

Sorry, I missed this part, it's fixed in this reply

Anton Khirnov  于2023年12月20日周三 17:51写道:

> Quoting flow gg (2023-12-20 09:39:57)
> >
> >
> > From 3f8adabeac408ada6048a1e2ac472534f970364e Mon Sep 17 00:00:00 2001
> > From: sunyuechi 
> > Date: Wed, 20 Dec 2023 16:17:32 +0800
> > Subject: [PATCH 1/3] lvac/dnxhdenc: add ff_dnxhdenc_init
>
> typo in 'lavc'
>
> >
> > This is for clarity and use in testing, consistent with other parts of
> the code.
> > ---
> >  libavcodec/dnxhdenc.c | 6 ++
> >  libavcodec/dnxhdenc.h | 1 +
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
> > index f52a2e9918..1ac8116f53 100644
> > --- a/libavcodec/dnxhdenc.c
> > +++ b/libavcodec/dnxhdenc.c
> > @@ -1377,3 +1377,9 @@ const FFCodec ff_dnxhd_encoder = {
> >  .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
> >  .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
> >  };
> > +
> > +void ff_dnxhdenc_init(DNXHDEncContext *ctx) {
>
> Brace should be on its own line
>
> > +#if ARCH_X86
> > +ff_dnxhdenc_init_x86(ctx);
> > +#endif
> > +}
> > diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h
> > index e581312ce4..95aea83d28 100644
> > --- a/libavcodec/dnxhdenc.h
> > +++ b/libavcodec/dnxhdenc.h
> > @@ -111,6 +111,7 @@ typedef struct DNXHDEncContext {
> > const uint8_t *pixels, ptrdiff_t
> line_size);
> >  } DNXHDEncContext;
> >
> > +void ff_dnxhdenc_init(DNXHDEncContext *ctx);
>
> Shouldn't it actually replace the existing ff_dnxhdenc_init_x86() call
> in dnxhdenc.c?
>
> --
> 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".
>
From 38e8ffbf49d23417bc597b166f6869dadee5d0a3 Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Wed, 20 Dec 2023 16:17:32 +0800
Subject: [PATCH 1/3] lavc/dnxhdenc: add ff_dnxhdenc_init

This is for clarity and use in testing, consistent with other parts of the code.
---
 libavcodec/dnxhdenc.c | 11 ---
 libavcodec/dnxhdenc.h |  1 +
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index f52a2e9918..0d9727bbbf 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -445,9 +445,7 @@ static av_cold int dnxhd_encode_init(AVCodecContext *avctx)
 ctx->block_width_l2 = 3;
 }
 
-#if ARCH_X86
-ff_dnxhdenc_init_x86(ctx);
-#endif
+ff_dnxhdenc_init(ctx);
 
 ctx->m.mb_height = (avctx->height + 15) / 16;
 ctx->m.mb_width  = (avctx->width  + 15) / 16;
@@ -1377,3 +1375,10 @@ const FFCodec ff_dnxhd_encoder = {
 .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
 .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };
+
+void ff_dnxhdenc_init(DNXHDEncContext *ctx)
+{
+#if ARCH_X86
+ff_dnxhdenc_init_x86(ctx);
+#endif
+}
diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h
index e581312ce4..95aea83d28 100644
--- a/libavcodec/dnxhdenc.h
+++ b/libavcodec/dnxhdenc.h
@@ -111,6 +111,7 @@ typedef struct DNXHDEncContext {
const uint8_t *pixels, ptrdiff_t line_size);
 } DNXHDEncContext;
 
+void ff_dnxhdenc_init(DNXHDEncContext *ctx);
 void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);
 
 #endif /* AVCODEC_DNXHDENC_H */
-- 
2.43.0

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

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


Re: [FFmpeg-devel] Subject: [PATCH 1/3] lvac/dnxhdenc: add ff_dnxhdenc_init

2023-12-20 Thread Anton Khirnov
Quoting flow gg (2023-12-20 09:39:57)
> 
> 
> From 3f8adabeac408ada6048a1e2ac472534f970364e Mon Sep 17 00:00:00 2001
> From: sunyuechi 
> Date: Wed, 20 Dec 2023 16:17:32 +0800
> Subject: [PATCH 1/3] lvac/dnxhdenc: add ff_dnxhdenc_init

typo in 'lavc'

> 
> This is for clarity and use in testing, consistent with other parts of the 
> code.
> ---
>  libavcodec/dnxhdenc.c | 6 ++
>  libavcodec/dnxhdenc.h | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
> index f52a2e9918..1ac8116f53 100644
> --- a/libavcodec/dnxhdenc.c
> +++ b/libavcodec/dnxhdenc.c
> @@ -1377,3 +1377,9 @@ const FFCodec ff_dnxhd_encoder = {
>  .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
>  .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
>  };
> +
> +void ff_dnxhdenc_init(DNXHDEncContext *ctx) {

Brace should be on its own line

> +#if ARCH_X86
> +ff_dnxhdenc_init_x86(ctx);
> +#endif
> +}
> diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h
> index e581312ce4..95aea83d28 100644
> --- a/libavcodec/dnxhdenc.h
> +++ b/libavcodec/dnxhdenc.h
> @@ -111,6 +111,7 @@ typedef struct DNXHDEncContext {
> const uint8_t *pixels, ptrdiff_t line_size);
>  } DNXHDEncContext;
>  
> +void ff_dnxhdenc_init(DNXHDEncContext *ctx);

Shouldn't it actually replace the existing ff_dnxhdenc_init_x86() call
in dnxhdenc.c?

-- 
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 v3 1/3] fftools/ffmpeg_filter: fix NULL pointer dereference

2023-12-20 Thread Anton Khirnov
Quoting Zhao Zhili (2023-12-20 11:26:22)
> From: Zhao Zhili 
> 
> In close_output(), a dummy frame is created with format NONE passed
> to enc_open(), which isn't prepared for it. The NULL pointer
> dereference happened at
> av_pix_fmt_desc_get(enc_ctx->pix_fmt)->comp[0].depth.
> 
> When fgt.graph is NULL, skip fg_output_frame() since there is
> nothing to output.
> 
> frame #0: 0x00bc34a4 ffmpeg_g`enc_open(opaque=0xb47efe2db690, 
> frame=0xb47efe2d9f70) at ffmpeg_enc.c:235:44
> frame #1: 0x00bef250 ffmpeg_g`enc_open(sch=0xb47dde2d4090, 
> enc=0xb47e4e2daad0, frame=0xb47efe2d9f70) at ffmpeg_sched.c:1462:11
> frame #2: 0x00bee094 ffmpeg_g`send_to_enc(sch=0xb47dde2d4090, 
> enc=0xb47e4e2daad0, frame=0xb47efe2d9f70) at ffmpeg_sched.c:1571:19
> frame #3: 0x00bee01c ffmpeg_g`sch_filter_send(sch=0xb47dde2d4090, 
> fg_idx=0, out_idx=0, frame=0xb47efe2d9f70) at ffmpeg_sched.c:2154:12
> frame #4: 0x00bcf124 ffmpeg_g`close_output(ofp=0xb47e4e2d85b0, 
> fgt=0x007d1790eb08) at ffmpeg_filter.c:2225:15
> frame #5: 0x00bcb000 ffmpeg_g`fg_output_frame(ofp=0xb47e4e2d85b0, 
> fgt=0x007d1790eb08, frame=0x) at ffmpeg_filter.c:2317:16
> frame #6: 0x00bc7e48 ffmpeg_g`filter_thread(arg=0xb47eae2ce7a0) 
> at ffmpeg_filter.c:2836:15
> frame #7: 0x00bee568 ffmpeg_g`task_wrapper(arg=0xb47d8e2db478) at 
> ffmpeg_sched.c:2200:21
> ---
>  fftools/ffmpeg_filter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
> index 9fc877b437..f175ca7918 100644
> --- a/fftools/ffmpeg_filter.c
> +++ b/fftools/ffmpeg_filter.c
> @@ -2835,7 +2835,7 @@ read_frames:
>  for (unsigned i = 0; i < fg->nb_outputs; i++) {
>  OutputFilterPriv *ofp = ofp_from_ofilter(fg->outputs[i]);
>  
> -if (fgt.eof_out[i])
> +if (fgt.eof_out[i] || !fgt.graph)

Ok

Thanks for fixing this,
-- 
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] configure: Add a --disable-version-tracking option

2023-12-20 Thread Anton Khirnov
Quoting Martin Storsjö (2023-12-20 09:12:21)
> On Fri, 15 Dec 2023, Martin Storsjö wrote:
> 
> > This disables regenerating ffversion.h whenever the checked out
> > git commit changes, speeding up development rebuilds.
> >
> > Whenever this option is set, force the version to be printed as
> > "unknown" rather than showing potentially stale information.
> > ---
> > Makefile  | 7 ++-
> > configure | 4 
> > 2 files changed, 10 insertions(+), 1 deletion(-)
> 
> Any comments on the name here, or does this seem fine? Otherwise I'd go 
> ahead with this in a day or two if there's no opposition to it.

I am fine with the name and the general idea.

-- 
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] MAINTAINERS: remove myself from FFmpeg

2023-12-20 Thread Nicolas George
Vittorio Giovara (12023-12-19):
> I am not too sure that bringing up a topic from 12 days ago with arguments
> from 12 years ago is bringing any value to the conversation.

Those who do not learn from history are bound to repeat it.

>   Just as a
> note, remember that a clueless LGTM is a better review than NO review, and

Uh. No, a clueless LGTM is absolutely no better than no review at all,
that is what clueless means.

> in fact it's the system that it's employed in any modern software house:
> the master branch is usually protected and any PR/MR needs both CI pass and
> at least a read from a developer.

I have a scoop for you: Libre Software projects are not “modern software
house”s where most effort is spent covering one's ass and trying to
blame somebody else for unavoidable problems.

> Oh and for the sake of your (and our readers') time, don't bother replying,
> I'm not interested in discussing 12 years ago affairs or modern development
> practices here.

You know, YOU have the power to stop wasting your time and ours: just
stop posting wrong and dishonest messages, and I will not have to
correct them.

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

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


Re: [FFmpeg-devel] Subject: [PATCH 3/3] lavc/dnxhdenc: R-V V get_pixels_8x4_sym

2023-12-20 Thread flow gg
There are only three emails in my Sent Items, but there are six at
ffmpeg-devel.. I'm not quite sure why, please ignore the three duplicates.

flow gg  于2023年12月20日周三 16:41写道:

> C908:
> get_pixels_8x4_sym_c: 297.2
> get_pixels_8x4_sym_rvv_i64: 52.7
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH v1] avcodec/av1dec: Add tile list OBU to decompose list

2023-12-20 Thread fei . w . wang-at-intel . com
From: Fei Wang 

Show the unsupported message and return unsupported for clips contain
tile list OBU since it hasn't been implemented. Otherwise, decoding
maybe successful but result is incorrect.

Signed-off-by: Fei Wang 
---
 libavcodec/av1dec.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index 4dcde234c6..629e37c3f8 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -805,6 +805,7 @@ static const CodedBitstreamUnitType decompose_unit_types[] 
= {
 AV1_OBU_SEQUENCE_HEADER,
 AV1_OBU_TEMPORAL_DELIMITER,
 AV1_OBU_TILE_GROUP,
+AV1_OBU_TILE_LIST,
 };
 
 static av_cold int av1_decode_init(AVCodecContext *avctx)
@@ -1327,6 +1328,10 @@ static int av1_receive_frame_internal(AVCodecContext 
*avctx, AVFrame *frame)
 }
 break;
 case AV1_OBU_TILE_LIST:
+av_log(avctx, AV_LOG_ERROR, "Large scale tile decoding is 
unsupported.\n");
+ret = AVERROR_PATCHWELCOME;
+goto end;
+break;
 case AV1_OBU_TEMPORAL_DELIMITER:
 case AV1_OBU_PADDING:
 break;
-- 
2.25.1

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

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


[FFmpeg-devel] Subject: [PATCH 3/3] lavc/dnxhdenc: R-V V get_pixels_8x4_sym

2023-12-20 Thread flow gg
C908:
get_pixels_8x4_sym_c: 297.2
get_pixels_8x4_sym_rvv_i64: 52.7
From 6fe4dbe9af39af50a1bf2069e91dfa542d83fee3 Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Wed, 20 Dec 2023 16:28:33 +0800
Subject: [PATCH 3/3] lavc/dnxhdenc: R-V V get_pixels_8x4_sym

C908:
get_pixels_8x4_sym_c: 297.2
get_pixels_8x4_sym_rvv_i64: 52.7
---
 libavcodec/dnxhdenc.c  |  4 ++-
 libavcodec/dnxhdenc.h  |  1 +
 libavcodec/riscv/Makefile  |  2 ++
 libavcodec/riscv/dnxenc_init.c | 41 
 libavcodec/riscv/dnxenc_rvv.S  | 50 ++
 5 files changed, 97 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/riscv/dnxenc_init.c
 create mode 100644 libavcodec/riscv/dnxenc_rvv.S

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 1ac8116f53..8dbda5eea1 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -1379,7 +1379,9 @@ const FFCodec ff_dnxhd_encoder = {
 };
 
 void ff_dnxhdenc_init(DNXHDEncContext *ctx) {
-#if ARCH_X86
+#if ARCH_RISCV
+ff_dnxhdenc_init_riscv(ctx);
+#elif ARCH_X86
 ff_dnxhdenc_init_x86(ctx);
 #endif
 }
diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h
index 95aea83d28..3ed1451431 100644
--- a/libavcodec/dnxhdenc.h
+++ b/libavcodec/dnxhdenc.h
@@ -112,6 +112,7 @@ typedef struct DNXHDEncContext {
 } DNXHDEncContext;
 
 void ff_dnxhdenc_init(DNXHDEncContext *ctx);
+void ff_dnxhdenc_init_riscv(DNXHDEncContext *ctx);
 void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);
 
 #endif /* AVCODEC_DNXHDENC_H */
diff --git a/libavcodec/riscv/Makefile b/libavcodec/riscv/Makefile
index aa758eba1c..35ad149326 100644
--- a/libavcodec/riscv/Makefile
+++ b/libavcodec/riscv/Makefile
@@ -13,6 +13,8 @@ RVV-OBJS-$(CONFIG_AUDIODSP) += riscv/audiodsp_rvv.o
 OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_init.o
 RV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvb.o
 RVV-OBJS-$(CONFIG_BSWAPDSP) += riscv/bswapdsp_rvv.o
+OBJS-$(CONFIG_DNXHD_ENCODER) += riscv/dnxenc_init.o
+RVV-OBJS-$(CONFIG_DNXHD_ENCODER) += riscv/dnxenc_rvv.o
 OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_init.o
 RVV-OBJS-$(CONFIG_EXR_DECODER) += riscv/exrdsp_rvv.o
 OBJS-$(CONFIG_FLAC_DECODER) += riscv/flacdsp_init.o
diff --git a/libavcodec/riscv/dnxenc_init.c b/libavcodec/riscv/dnxenc_init.c
new file mode 100644
index 00..43bd61afd4
--- /dev/null
+++ b/libavcodec/riscv/dnxenc_init.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * 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 "libavcodec/dnxhdenc.h"
+
+void ff_get_pixels_8x4_sym_rvv(int16_t *block, const uint8_t *pixels,
+ptrdiff_t line_size);
+
+av_cold void ff_dnxhdenc_init_riscv(DNXHDEncContext *ctx)
+{
+#if HAVE_RVV
+int flags = av_get_cpu_flags();
+
+if (flags & AV_CPU_FLAG_RVV_I64) {
+if (ctx->cid_table->bit_depth == 8) {
+ctx->get_pixels_8x4_sym = ff_get_pixels_8x4_sym_rvv;
+}
+}
+#endif
+}
diff --git a/libavcodec/riscv/dnxenc_rvv.S b/libavcodec/riscv/dnxenc_rvv.S
new file mode 100644
index 00..f287a05575
--- /dev/null
+++ b/libavcodec/riscv/dnxenc_rvv.S
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * 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 "libavutil/riscv/asm.S"
+
+func ff_get_pixels_8x4_sym_rvv, zve64x
+vsetivlizero, 8, e8, mf2, ta, ma
+vlse64.v

[FFmpeg-devel] Subject: [PATCH 2/3] checkasm/dnxhdenc: add get_pixels_8x4_sym test

2023-12-20 Thread flow gg

From 2f17a594805615a93f3f475246d61d61cc0aa43b Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Wed, 20 Dec 2023 16:21:38 +0800
Subject: [PATCH 2/3] checkasm/dnxhdenc: add get_pixels_8x4_sym test

---
 tests/checkasm/Makefile   |  1 +
 tests/checkasm/checkasm.c |  3 ++
 tests/checkasm/checkasm.h |  1 +
 tests/checkasm/dnxhdenc.c | 73 +++
 tests/fate/checkasm.mak   |  1 +
 5 files changed, 79 insertions(+)
 create mode 100644 tests/checkasm/dnxhdenc.c

diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
index e6d732d8de..47328b59b9 100644
--- a/tests/checkasm/Makefile
+++ b/tests/checkasm/Makefile
@@ -26,6 +26,7 @@ AVCODECOBJS-$(CONFIG_AAC_DECODER)   += aacpsdsp.o \
 AVCODECOBJS-$(CONFIG_AAC_ENCODER)   += aacencdsp.o
 AVCODECOBJS-$(CONFIG_ALAC_DECODER)  += alacdsp.o
 AVCODECOBJS-$(CONFIG_DCA_DECODER)   += synth_filter.o
+AVCODECOBJS-$(CONFIG_DNXHD_ENCODER) += dnxhdenc.o
 AVCODECOBJS-$(CONFIG_EXR_DECODER)   += exrdsp.o
 AVCODECOBJS-$(CONFIG_FLAC_DECODER)  += flacdsp.o
 AVCODECOBJS-$(CONFIG_HUFFYUV_DECODER)   += huffyuvdsp.o
diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
index 51a8cdf3a0..e4606a15ca 100644
--- a/tests/checkasm/checkasm.c
+++ b/tests/checkasm/checkasm.c
@@ -98,6 +98,9 @@ static const struct {
 #if CONFIG_DCA_DECODER
 { "synth_filter", checkasm_check_synth_filter },
 #endif
+#if CONFIG_DNXHD_ENCODER
+{ "dnxhdenc", checkasm_check_dnxhdenc },
+#endif
 #if CONFIG_EXR_DECODER
 { "exrdsp", checkasm_check_exrdsp },
 #endif
diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
index cb57eeeddf..6dd001aeee 100644
--- a/tests/checkasm/checkasm.h
+++ b/tests/checkasm/checkasm.h
@@ -54,6 +54,7 @@ void checkasm_check_blend(void);
 void checkasm_check_blockdsp(void);
 void checkasm_check_bswapdsp(void);
 void checkasm_check_colorspace(void);
+void checkasm_check_dnxhdenc(void);
 void checkasm_check_exrdsp(void);
 void checkasm_check_fixed_dsp(void);
 void checkasm_check_flacdsp(void);
diff --git a/tests/checkasm/dnxhdenc.c b/tests/checkasm/dnxhdenc.c
new file mode 100644
index 00..c88ae3113d
--- /dev/null
+++ b/tests/checkasm/dnxhdenc.c
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2023 Institue of Software Chinese Academy of Sciences (ISCAS).
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU 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/mem.h"
+#include "libavutil/mem_internal.h"
+
+#include "libavcodec/dnxhdenc.h"
+#include "libavcodec/dnxhdenc.c"
+
+#include "checkasm.h"
+
+#define randomize(buf, len) \
+do { \
+for (int i = 0; i < len; i++) \
+buf[i] = rnd(); \
+} while (0)
+
+static void test_get_pixels_8x4_sym(void) {
+#define BUF_SIZE 64*2
+declare_func(void, int16_t *block, const uint8_t *pixels, ptrdiff_t line_size);
+
+const CIDEntry cid_array[] = {
+{.bit_depth = 8},
+};
+DNXHDEncContext s = {.cid_table = cid_array};
+
+s.get_pixels_8x4_sym = dnxhd_8bit_get_pixels_8x4_sym;
+
+ff_dnxhdenc_init(&s);
+
+if (check_func(s.get_pixels_8x4_sym, "get_pixels_8x4_sym")) {
+LOCAL_ALIGNED_32(int16_t, block1, [BUF_SIZE]);
+LOCAL_ALIGNED_32(int16_t, block2, [BUF_SIZE]);
+LOCAL_ALIGNED_32(uint8_t, pixels, [BUF_SIZE]);
+
+randomize(pixels, BUF_SIZE);
+
+call_ref(block1, pixels, BUF_SIZE);
+call_new(block2, pixels, BUF_SIZE);
+
+if (memcmp(block1, block2, BUF_SIZE) != 0) {
+fail();
+}
+
+bench_new(block1, pixels, BUF_SIZE);
+}
+
+report("get_pixels_8x4_sym");
+}
+
+void checkasm_check_dnxhdenc(void)
+{
+test_get_pixels_8x4_sym();
+}
diff --git a/tests/fate/checkasm.mak b/tests/fate/checkasm.mak
index 34e1a0a048..9e04b1b3cb 100644
--- a/tests/fate/checkasm.mak
+++ b/tests/fate/checkasm.mak
@@ -7,6 +7,7 @@ FATE_CHECKASM = fate-checkasm-aacencdsp \
 fate-checkasm-av_tx \
 fate-checkasm-blockdsp  \
 fate-checkasm-bswapdsp  \
+fate-checkasm-dnxhdenc  \
 fate-checkasm-exrdsp

[FFmpeg-devel] Subject: [PATCH 1/3] lvac/dnxhdenc: add ff_dnxhdenc_init

2023-12-20 Thread flow gg

From 3f8adabeac408ada6048a1e2ac472534f970364e Mon Sep 17 00:00:00 2001
From: sunyuechi 
Date: Wed, 20 Dec 2023 16:17:32 +0800
Subject: [PATCH 1/3] lvac/dnxhdenc: add ff_dnxhdenc_init

This is for clarity and use in testing, consistent with other parts of the code.
---
 libavcodec/dnxhdenc.c | 6 ++
 libavcodec/dnxhdenc.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index f52a2e9918..1ac8116f53 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -1377,3 +1377,9 @@ const FFCodec ff_dnxhd_encoder = {
 .p.profiles = NULL_IF_CONFIG_SMALL(ff_dnxhd_profiles),
 .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };
+
+void ff_dnxhdenc_init(DNXHDEncContext *ctx) {
+#if ARCH_X86
+ff_dnxhdenc_init_x86(ctx);
+#endif
+}
diff --git a/libavcodec/dnxhdenc.h b/libavcodec/dnxhdenc.h
index e581312ce4..95aea83d28 100644
--- a/libavcodec/dnxhdenc.h
+++ b/libavcodec/dnxhdenc.h
@@ -111,6 +111,7 @@ typedef struct DNXHDEncContext {
const uint8_t *pixels, ptrdiff_t line_size);
 } DNXHDEncContext;
 
+void ff_dnxhdenc_init(DNXHDEncContext *ctx);
 void ff_dnxhdenc_init_x86(DNXHDEncContext *ctx);
 
 #endif /* AVCODEC_DNXHDENC_H */
-- 
2.43.0

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

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


Re: [FFmpeg-devel] [PATCH] configure: Add a --disable-version-tracking option

2023-12-20 Thread Martin Storsjö

On Fri, 15 Dec 2023, Martin Storsjö wrote:


This disables regenerating ffversion.h whenever the checked out
git commit changes, speeding up development rebuilds.

Whenever this option is set, force the version to be printed as
"unknown" rather than showing potentially stale information.
---
Makefile  | 7 ++-
configure | 4 
2 files changed, 10 insertions(+), 1 deletion(-)


Any comments on the name here, or does this seem fine? Otherwise I'd go 
ahead with this in a day or two if there's no opposition to it.


// 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] [PATCH] checkasm: Remove unnecessary const on scalar parameters

2023-12-20 Thread Martin Storsjö

On Mon, 18 Dec 2023, Martin Storsjö wrote:


The ffmpeg coding style doesn't usually use const on scalar
parameters (or on the pointer values - as opposed to the type
that is pointed to, where it has a semantic meaning), contrary
to the dav1d coding style (where this was imported from).

This avoids warnings about differences in the type signatures
between declaration and definition of this function, with older
versions of MSVC.

The issue was observed with one version of MSVC 2017,
19.16.27024.1, with warnings like these:

   src/tests/checkasm/checkasm.c(969): warning C4028: formal parameter 3 
different from declaration


FWIW, newer versions of MSVC don't warn about this - the warning is bogus 
indeed. But these const markings are unnecessary here anyway, and aren't 
endorsed in the ffmpeg coding style.


Anyway, this patch got generally favourable response on irc yesterday, so 
I'll push it today.


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