Re: [FFmpeg-devel] [PATCH v16 6/9] avcodec/evc_decoder: Provided support for EVC decoder

2023-03-06 Thread Lynne
Jan 2, 2023, 13:55 by d.kozin...@samsung.com:

> - Added EVC decoder wrapper
> - Changes in project configuration file and libavcodec Makefile
> - Added documentation for xevd wrapper
>
> Signed-off-by: Dawid Kozinski 
> ---
>  configure |   4 +
>  doc/decoders.texi |  24 +++
>  doc/general_contents.texi |  10 +-
>  libavcodec/Makefile   |   1 +
>  libavcodec/allcodecs.c|   1 +
>  libavcodec/libxevd.c  | 400 ++
>  6 files changed, 439 insertions(+), 1 deletion(-)
>  create mode 100644 libavcodec/libxevd.c
>
> diff --git a/configure b/configure
> index 392169a4ee..f9b83b7166 100755
> --- a/configure
> +++ b/configure
> @@ -292,6 +292,7 @@ External library support:
>  --enable-libx264 enable H.264 encoding via x264 [no]
>  --enable-libx265 enable HEVC encoding via x265 [no]
>  --enable-libxeve enable EVC encoding via libxeve [no]
> +  --enable-libxevd enable EVC decoding via libxevd [no]
>  --enable-libxavs enable AVS encoding via xavs [no]
>  --enable-libxavs2enable AVS2 encoding via xavs2 [no]
>  --enable-libxcb  enable X11 grabbing using XCB [autodetect]
> @@ -1863,6 +1864,7 @@ EXTERNAL_LIBRARY_LIST="
>  libvorbis
>  libvpx
>  libwebp
> +libxevd
>  libxeve
>  libxml2
>  libzimg
> @@ -3396,6 +3398,7 @@ libx265_encoder_deps="libx265"
>  libx265_encoder_select="atsc_a53"
>  libxavs_encoder_deps="libxavs"
>  libxavs2_encoder_deps="libxavs2"
> +libxevd_decoder_deps="libxevd"
>  libxeve_encoder_deps="libxeve"
>  libxvid_encoder_deps="libxvid"
>  libzvbi_teletext_decoder_deps="libzvbi"
> @@ -6721,6 +6724,7 @@ enabled libx265   && require_pkg_config libx265 
> x265 x265.h x265_api_get
>  require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
>  enabled libxavs   && require libxavs "stdint.h xavs.h" 
> xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
>  enabled libxavs2  && require_pkg_config libxavs2 "xavs2 >= 1.3.0" 
> "stdint.h xavs2.h" xavs2_api_get
> +enabled libxevd   && require_pkg_config libxevd "xevd >= 0.4.0" 
> "xevd.h" xevd_decode
>  enabled libxeve   && require_pkg_config libxeve "xeve >= 0.4.0" 
> "xeve.h" xeve_encode
>  enabled libxvid   && require libxvid xvid.h xvid_global -lxvidcore
>  enabled libzimg   && require_pkg_config libzimg "zimg >= 2.7.0" 
> zimg.h zimg_get_api_version
> diff --git a/doc/decoders.texi b/doc/decoders.texi
> index 5ba85cf9b1..54720ee8b4 100644
> --- a/doc/decoders.texi
> +++ b/doc/decoders.texi
> @@ -130,6 +130,30 @@ Set amount of frame threads to use during decoding. The 
> default value is 0 (auto
>  
>  @end table
>  
> +@section libxevd
> +
> +eXtra-fast Essential Video Decoder (XEVD) MPEG-5 EVC decoder wrapper.
> +
> +This decoder requires the presence of the libxevd headers and library
> +during configuration. You need to explicitly configure the build with
> +@option{--enable-libxevd}.
> +
> +The xevd project website is at @url{https://github.com/mpeg5/xevd}.
> +
> +@subsection Options
> +
> +The following options are supported by the libxevd wrapper.
> +The xevd-equivalent options or values are listed in parentheses for easy 
> migration.
> +
> +To get a more accurate and extensive documentation of the libxevd options,
> +invoke the command  @code{xevd_app --help} or consult the libxevd 
> documentation.
> +
> +@table @option
> +@item threads (@emph{threads})
> +Force to use a specific number of threads
> +
> +@end table
> +
>  @section QSV Decoders
>  
>  The family of Intel QuickSync Video decoders (VC1, MPEG-2, H.264, HEVC,
> diff --git a/doc/general_contents.texi b/doc/general_contents.texi
> index bcff3e29b7..38940d497a 100644
> --- a/doc/general_contents.texi
> +++ b/doc/general_contents.texi
> @@ -351,6 +351,14 @@ Go to @url{https://github.com/mpeg5/xeve} and follow the 
> instructions for
>  installing the XEVE library. Then pass @code{--enable-libxeve} to configure 
> to
>  enable it.
>  
> +@section eXtra-fast Essential Video Decoder (XEVD)
> +
> +FFmpeg can make use of the XEVD library for EVC video decoding.
> +
> +Go to @url{https://github.com/mpeg5/xevd} and follow the instructions for
> +installing the XEVD library. Then pass @code{--enable-libxevd} to configure 
> to
> +enable it.
> +
>  @section ZVBI
>  
>  ZVBI is a VBI decoding library which can be used by FFmpeg to decode DVB
> @@ -944,7 +952,7 @@ following image formats are supported:
>  @item Escape 124 @tab @tab  X
>  @item Escape 130 @tab @tab  X
>  @item EVC / MPEG-5 Part 1@tab  X  @tab  X
> -@tab encoding supported through external library libxeve
> +@tab encoding and decoding supported through external libraries libxeve 
> and libxevd
>  @item FFmpeg video codec #1  @tab  X  @tab  X
>  @tab lossless codec (fourcc: FFV1)
>  @item Flash Screen Video v1  @tab  X  @tab  X
> diff --git a/libavcodec/Makefile b/libavcodec/Makefile
> index 

Re: [FFmpeg-devel] [PATCH v16 5/9] avcodec/evc_encoder: Provided support for EVC encoder

2023-03-06 Thread Lynne
Jan 2, 2023, 13:54 by d.kozin...@samsung.com:

> - Added EVC encoder wrapper
> - Changes in project configuration file and libavcodec Makefile
> - Added documentation for xeve wrapper
>
> Signed-off-by: Dawid Kozinski 
> ---
> configure |   4 +
> doc/encoders.texi |  69 +
> doc/general_contents.texi |  11 +
> libavcodec/Makefile   |   1 +
> libavcodec/allcodecs.c|   1 +
> libavcodec/libxeve.c  | 618 ++
> 6 files changed, 704 insertions(+)
> create mode 100644 libavcodec/libxeve.c
>
> diff --git a/configure b/configure
> index 675dc84f56..392169a4ee 100755
> --- a/configure
> +++ b/configure
> @@ -291,6 +291,7 @@ External library support:
> --enable-libwebp enable WebP encoding via libwebp [no]
> --enable-libx264 enable H.264 encoding via x264 [no]
> --enable-libx265 enable HEVC encoding via x265 [no]
> +  --enable-libxeve enable EVC encoding via libxeve [no]
> --enable-libxavs enable AVS encoding via xavs [no]
> --enable-libxavs2enable AVS2 encoding via xavs2 [no]
> --enable-libxcb  enable X11 grabbing using XCB [autodetect]
> @@ -1862,6 +1863,7 @@ EXTERNAL_LIBRARY_LIST="
> libvorbis
> libvpx
> libwebp
> +libxeve
> libxml2
> libzimg
> libzmq
> @@ -3394,6 +3396,7 @@ libx265_encoder_deps="libx265"
> libx265_encoder_select="atsc_a53"
> libxavs_encoder_deps="libxavs"
> libxavs2_encoder_deps="libxavs2"
> +libxeve_encoder_deps="libxeve"
> libxvid_encoder_deps="libxvid"
> libzvbi_teletext_decoder_deps="libzvbi"
> vapoursynth_demuxer_deps="vapoursynth"
> @@ -6718,6 +6721,7 @@ enabled libx265   && require_pkg_config libx265 
> x265 x265.h x265_api_get
> require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
> enabled libxavs   && require libxavs "stdint.h xavs.h" 
> xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
> enabled libxavs2  && require_pkg_config libxavs2 "xavs2 >= 1.3.0" 
> "stdint.h xavs2.h" xavs2_api_get
> +enabled libxeve   && require_pkg_config libxeve "xeve >= 0.4.0" 
> "xeve.h" xeve_encode
> enabled libxvid   && require libxvid xvid.h xvid_global -lxvidcore
> enabled libzimg   && require_pkg_config libzimg "zimg >= 2.7.0" 
> zimg.h zimg_get_api_version
> enabled libzmq&& require_pkg_config libzmq "libzmq >= 4.2.1" 
> zmq.h zmq_ctx_new
> diff --git a/doc/encoders.texi b/doc/encoders.texi
> index b8051cda3f..15b8db76c0 100644
> --- a/doc/encoders.texi
> +++ b/doc/encoders.texi
> @@ -2894,6 +2894,75 @@ ffmpeg -i input -c:v libxavs2 -xavs2-params 
> RdoqLevel=0 output.avs2
> @end example
> @end table
>
> +@section libxeve
> +
> +eXtra-fast Essential Video Encoder (XEVE) MPEG-5 EVC encoder wrapper.
> +The xeve-equivalent options or values are listed in parentheses for easy 
> migration.
> +
> +This encoder requires the presence of the libxeve headers and library
> +during configuration. You need to explicitly configure the build with
> +@option{--enable-libxeve}.
> +
> +@float NOTE
> +Many libxeve encoder options are mapped to FFmpeg global codec options,
> +while unique encoder options are provided through private options.
> +Additionally the xeve-params private options allows one to pass a list
> +of key=value tuples as accepted by the libxeve @code{parse_xeve_params} 
> function.
> +@end float
> +
> +The xeve project website is at @url{https://github.com/mpeg5/xeve}.
> +
> +@subsection Options
> +
> +The following options are supported by the libxeve wrapper.
> +The xeve-equivalent options or values are listed in parentheses for easy 
> migration.
> +
> +@float NOTE
> +To reduce the duplication of documentation, only the private options
> +and some others requiring special attention are documented here. For
> +the documentation of the undocumented generic options, see
> +@ref{codec-options,,the Codec Options chapter}.
> +@end float
> +
> +@float NOTE
> +To get a more accurate and extensive documentation of the libxeve options,
> +invoke the command  @code{xeve_app --help} or consult the libxeve 
> documentation.
> +@end float
> +
> +@table @option
> +@item b (@emph{bitrate})
> +Set target video bitrate in bits/s.
> +Note that FFmpeg's b option is expressed in bits/s, while xeve's bitrate is 
> in kilobits/s.
> +
> +@item bf (@emph{bframes})
> +Set the maximum number of B frames (1,3,7,15).
> +
> +@item g (@emph{keyint})
> +Set the GOP size (I-picture period).
> +
> +@item preset (@emph{preset})
> +Set the xeve preset.
> +Set the encoder preset value to determine encoding speed [fast, medium, 
> slow, placebo]
> +
> +@item tune (@emph{tune})
> +Set the encoder tune parameter [psnr, zerolatency]
> +
> +@item profile (@emph{profile})
> +Set the encoder profile [0: baselie; 1: main]
> +
> +@item crf (@emph{crf})
> +Set the quality for constant quality mode.
> +Constant rate factor <10..49> [default: 32]
> +
> +@item qp (@emph{qp})
> +Set constant quantization rate control method parameter.
> 

Re: [FFmpeg-devel] [PATCH v16 2/9] avcodec/evc_parser: Added parser implementation for EVC format

2023-03-06 Thread Lynne
Jan 2, 2023, 13:53 by d.kozin...@samsung.com:

> - Added constants definitions for EVC parser
> - Provided NAL units parsing following ISO_IEC_23094-1
> - EVC parser registration
>
> Signed-off-by: Dawid Kozinski 
> ---
>  libavcodec/Makefile |1 +
>  libavcodec/evc.h|  155 +
>  libavcodec/evc_parser.c | 1417 +++
>  libavcodec/parsers.c|1 +
>  4 files changed, 1574 insertions(+)
>  create mode 100644 libavcodec/evc.h
>  create mode 100644 libavcodec/evc_parser.c
>
>
> +
> +// @see ISO_IEC_23094-1 (7.3.7 Reference picture list structure syntax)
> +static int ref_pic_list_struct(GetBitContext* gb, RefPicListStruct* rpl)
> +{
> +uint32_t delta_poc_st, strp_entry_sign_flag = 0;
> +rpl->ref_pic_num = get_ue_golomb(gb);
> +if (rpl->ref_pic_num > 0)
> +{
> +delta_poc_st = get_ue_golomb(gb);
> +
> +rpl->ref_pics[0] = delta_poc_st;
> +if (rpl->ref_pics[0] != 0)
> +{
> +strp_entry_sign_flag = get_bits(gb, 1);
> +
> +rpl->ref_pics[0] *= 1 - (strp_entry_sign_flag << 1);
> +}
> +}
> +
> +for (int i = 1; i < rpl->ref_pic_num; ++i)
> +{
> +delta_poc_st = get_ue_golomb(gb);
> +if (delta_poc_st != 0) {
> +strp_entry_sign_flag = get_bits(gb, 1);
> +}
> +rpl->ref_pics[i] = rpl->ref_pics[i - 1] + delta_poc_st * (1 - 
> (strp_entry_sign_flag << 1));
> +}
> +
> +return 0;
> +}
>

Code style issues here, we don't put a newline on the bracket
after an if or a for, and we don't use brackets at all for one-line
if statements or if/else statements (as long as all statements are one-line).


> +/**
> + * @brief Reconstruct NAL Unit from incomplete data
> + *
> + * @param[in]  s parser context
> + * @param[in]  data pointer to the buffer containg new data for current NALU 
> prefix
> + * @param[in]  data_size amount of bytes to read from the input buffer
> + * @param[out] nalu_prefix assembled NALU length
> + * @param[in ] avctx codec context
> + *
> + * Assemble the NALU prefix storing NALU length if it has been split between 
> 2 subsequent buffers (input chunks) incoming to the parser.
> + * This is the case when the buffer size is not enough for the buffer to 
> store the whole NAL unit prefix.
> + * In this case, we have to get part of the prefix from the previous buffer 
> and assemble it with the rest from the current buffer.
> + * Then we'll be able to read NAL unit size.
> + */
> +static int evc_assemble_nalu_prefix(AVCodecParserContext *s, const uint8_t 
> *data, int data_size,
> +uint8_t *nalu_prefix, AVCodecContext 
> *avctx)
> +{
> +EVCParserContext *ctx = s->priv_data;
> +ParseContext *pc = >pc;
> +
> +// 1. pc->buffer contains previously read bytes of NALU prefix
> +// 2. buf contains the rest of NAL unit prefix bytes
> +//
> +// ~~~
> +// EXAMPLE
> +// ~~~
> +//
> +// In the following example we assumed that the number of already read 
> NAL Unit prefix bytes is equal 1
> +//
> +// --
> +// pc->buffer -> conatins already read bytes
> +// --
> +//  __ pc->index == 1
> +// |
> +// V
> +// ---
> +// |   0   |   1   |   2   |   3   |   4   | ... |   N   |
> +// ---
> +// |  0x00 |  0xXX |  0xXX |  0xXX |  0xXX | ... |  0xXX |
> +// ---
> +// |  PREF |   |   |   |   | ... |   |
> +// ---
> +//
> +// --
> +// buf -> contains newly read bytes
> +// --
> +// ---
> +// |   0   |   1   |   2   |   3   |   4   | ... |   N   |
> +// ---
> +// |  0x00 |  0x00 |  0x3C |  0xXX |  0xXX | ... |  0xXX |
> +// ---
> +// |  PREF |  PREF |  PREF |   |   | ... |   |
> +// ---
> +//
> +// --
> +// nalu_prefix
> +// --
> +// -
> +// |   0   |   1   |   2   |   3   |
> +// -
> +// |  0x00 |  0x00 |  0x00 |  0x3C |
> +// -
> +// | NALU LENGTH   |
> +// -
> +// NAL Unit lenght =  60 (0x003C)
> +//
>

The ascii art is neat, but it just makes this more complicated to read,
and it doesn't even say all that much about it. just remove it.


> +for (int i = 0; i < EVC_NALU_LENGTH_PREFIX_SIZE; i++) {
> +if (i < pc->index)
> +  

Re: [FFmpeg-devel] [PATCH v3 4/5] avformat/movenc: add PCM in mp4 support

2023-03-06 Thread zhilizhao(赵志立)


> On Mar 6, 2023, at 20:28, Tomas Härdin  wrote:
> 
>> +static int mov_write_chnl_tag(AVFormatContext *s, AVIOContext *pb,
>> MOVTrack *track)
>> +{
>> +int64_t pos = avio_tell(pb);
>> +int config = 0;
>> +int ret;
>> +uint8_t *speaker_pos = NULL;
>> +const AVChannelLayout *layout = >par->ch_layout;
>> +
>> +ret = ff_mov_get_channel_config_from_layout(layout, );
>> +if (ret || !config) {
> 
> ret is always 0..

That implementation details. It’s robust for caller to not depending
on that.

> 
> 
> /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 v3 3/5] avformat/mov: parse ISO-14496-12 ChannelLayout

2023-03-06 Thread zhilizhao(赵志立)


> On Mar 6, 2023, at 20:26, Tomas Härdin  wrote:
> 
>> +int ff_mov_get_channel_config_from_layout(const AVChannelLayout
>> *layout, int *config)
>> +{
>> +// Set default value which means any setup in 23001-8
>> +*config = 0;
>> +for (int i = 0; i < FF_ARRAY_ELEMS(iso_channel_configuration);
>> i++) {
>> +if (!av_channel_layout_compare(layout,
>> iso_channel_configuration + i)) {
>> +*config = i;
>> +break;
>> +}
>> +}
>> +
>> +return 0;
> 
> Is always returning 0 intended? If so then what is the point?
> ff_mov_get_channel_positions_from_layout() returns non-zero on error..

As the comments says, ChannelConfiguration 0 means “any setup”. If no
iso_channel_configuration item match layout, *config get 0 as a valid
value.

Current implementation of the function doesn’t fail, but it might in
future.

> 
> /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] avformat/matroska: Add support for A_ATRAC/AT1

2023-03-06 Thread asivery
It's been added recently. Here's the definition: 
https://github.com/ietf-wg-cellar/matroska-specification/blob/master/codec_specs.md#a_atracat1


--- Original Message ---
On Monday, March 6th, 2023 at 7:39 PM, Paul B Mahol  wrote:


> On 3/6/23, asivery asiv...@protonmail.com wrote:
> 
> > Signed-off-by: asivery asiv...@protonmail.com
> > ---
> > libavformat/matroska.c | 1 +
> > libavformat/matroskadec.c | 2 ++
> > 2 files changed, 3 insertions(+)
> 
> 
> where is this defined?
> 
> > diff --git a/libavformat/matroska.c b/libavformat/matroska.c
> > index 90d94b65bf..37305a523c 100644
> > --- a/libavformat/matroska.c
> > +++ b/libavformat/matroska.c
> > @@ -55,6 +55,7 @@ const CodecTags ff_mkv_codec_tags[]={
> > {"A_REAL/ATRC" , AV_CODEC_ID_ATRAC3},
> > {"A_REAL/COOK" , AV_CODEC_ID_COOK},
> > {"A_REAL/SIPR" , AV_CODEC_ID_SIPR},
> > + {"A_ATRAC/AT1" , AV_CODEC_ID_ATRAC1},
> > {"A_TRUEHD" , AV_CODEC_ID_TRUEHD},
> > {"A_TTA1" , AV_CODEC_ID_TTA},
> > {"A_VORBIS" , AV_CODEC_ID_VORBIS},
> > diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> > index d582f566a2..0aa8e6f3b3 100644
> > --- a/libavformat/matroskadec.c
> > +++ b/libavformat/matroskadec.c
> > @@ -2795,6 +2795,8 @@ static int matroska_parse_tracks(AVFormatContext s)
> > track->audio.frame_size);
> > if (!track->audio.buf)
> > return AVERROR(ENOMEM);
> > + } else if (codec_id == AV_CODEC_ID_ATRAC1) {
> > + st->codecpar->block_align = track->audio.channels * 212; / Constant ATRAC
> > frame size */
> > } else if (codec_id == AV_CODEC_ID_FLAC && track->codec_priv.size) {
> > ret = matroska_parse_flac(s, track, _offset);
> > if (ret < 0)
> > --
> > 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 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] avformat/matroska: Add support for A_ATRAC/AT1

2023-03-06 Thread Paul B Mahol
On 3/6/23, asivery  wrote:
> Signed-off-by: asivery 
> ---
> libavformat/matroska.c | 1 +
> libavformat/matroskadec.c | 2 ++
> 2 files changed, 3 insertions(+)
>

where is this defined?


> diff --git a/libavformat/matroska.c b/libavformat/matroska.c
> index 90d94b65bf..37305a523c 100644
> --- a/libavformat/matroska.c
> +++ b/libavformat/matroska.c
> @@ -55,6 +55,7 @@ const CodecTags ff_mkv_codec_tags[]={
> {"A_REAL/ATRC" , AV_CODEC_ID_ATRAC3},
> {"A_REAL/COOK" , AV_CODEC_ID_COOK},
> {"A_REAL/SIPR" , AV_CODEC_ID_SIPR},
> + {"A_ATRAC/AT1" , AV_CODEC_ID_ATRAC1},
> {"A_TRUEHD" , AV_CODEC_ID_TRUEHD},
> {"A_TTA1" , AV_CODEC_ID_TTA},
> {"A_VORBIS" , AV_CODEC_ID_VORBIS},
> diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
> index d582f566a2..0aa8e6f3b3 100644
> --- a/libavformat/matroskadec.c
> +++ b/libavformat/matroskadec.c
> @@ -2795,6 +2795,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
> track->audio.frame_size);
> if (!track->audio.buf)
> return AVERROR(ENOMEM);
> + } else if (codec_id == AV_CODEC_ID_ATRAC1) {
> + st->codecpar->block_align = track->audio.channels * 212; /* Constant ATRAC
> frame size */
> } else if (codec_id == AV_CODEC_ID_FLAC && track->codec_priv.size) {
> ret = matroska_parse_flac(s, track, _offset);
> if (ret < 0)
> --
> 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 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] mips: fix build fail on MIPS R6

2023-03-06 Thread Michael Niedermayer
On Mon, Mar 06, 2023 at 05:44:55PM +0800, Junxian Zhu wrote:
> Hello, Michael, can you help to review this pacth? It made ffmpeg compilable 
> on mips r6 platform.

iam not mips maintainer, i have no mips hw anymore, i know very little
about the different mips variants
Iam sure there are people who are in a better position to review this

thx

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

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates


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] avformat/mxfenc: fix stored/sampled/displayed width/height

2023-03-06 Thread Nicolas Gaullier
>>> The width is one thing; for whatever reason, there is a divergence between 
>>> DV100 on one hand and AVCI/XDCAMHD35 on the other. In my understanding, in 
>>> current practices, DV obey s337 (stored width includes scaling) but 
>>> >xdcam does not, so current code is fine >but maybe this is an 
>>> opportunity to document this ?
>>
>>AFAIK:
>>- DV in MXF: found old Omneon with no scaling for stored value, no sampled 
>>value (so stored value), scaled value for displayed value, old Quantel with 
>>scaling everywhere. From my understanding of spec, I would keep the scaling.
>>- MPEG-2 Video including XDCAMHD35 in MXF obey "including any decoder 
>>scaling or padding" wording with a 16x16 rounding for height, I have no 
>>file not 1920 or 3840 width
>>- AVC in MXF: found old Omneon or old Quantel  or old Telestream with no 
>>padding value for stored value (height of 540 for interlaced). I don't 
>>understand why it is not same as with MPEG-2 Video so I don't touch FFmpeg 
>>behavior >there (rounding). Actually checking >again SMPTE ST 381-2013, there 
>>is an explicit example: "1088: 1080-line progressive".
>
>I totally agree they are so many weird things in the wild, particularly 
>looking at some early implementations. I also have fully broken DV100 and 
>XDCAMHD35 Omneon records with release v6.1 (2010) at the early stages of HD, 
>but it was fixed afterwards (with many other >issues too!). Looking at GVG, 
>1440x1088i stored size was implemented from the early beginnings (2010 too) : 
>sample clips are still available here : 
>http://www.gvgdevelopers.com/concrete/products/k2/test_clips/
>There is also "kind of" reference sony implementation available here both for 
>xdcamhd35/avc-1440:  https://www.sonycreativesoftware.com/catalystbrowse
>Anyway, I think we all agree not to change anything related to MPEG2 and AVC.
>
>>I don't have DV in MXF with non multiple of 16 (I thought that DV is 
>>only 720x576 or 720x480 or 1280x720 or 1920x1080, all values multiple of
>>16) and don't know about video encoding in DV so I didn't want to change the 
>>behavior of FFmpeg when I don't know, but case AV_CODEC_ID_DVVIDEO:
>>line could be definitely removed if it is fine for you.
>DV is questionable. Currently, the dust is under the rug (as a defaults 
>behaviour), which is an issue with very little concern.
>Now, with the patch, the dust become visible, the DV rule is made explicit and 
>moreover it is presented as an exception, sharing code with macroblock 
>codecs... I think it is time to fix, even if it was not your prior intention.
>I don't have an extensive experience with DV too, I just have samples here and 
>there like you, but it seems we share the same information.
>Let see if someone else react and ask for keeping the current 1088 lines for 
>DV stored height, but if nobody does, I think it should be okay.
>
>> Do you want me to add a comment line e.g. "obey 'including any decoder 
>> scaling or padding' from SMPTE ST 377"?
>I am not a core developer and will let others give their feedback. My personal 
>opinion is that the spec is supposed to be well known and does not require 
>commenting, but that it would be interesting to explicit why we make a 
>difference between DV and MPEG2/AVC. And >personally, I don't have the answer 
>to this question. If nobody has one, maybe a comment could say "because this 
>is the observed common practice".
>
>Nicolas

Some weeks later now and no replies, maybe time to go on ?
I think the "case AV_CODEC_ID_DVVIDEO:" can be removed as discussed, fate 
updated and that should be ok for everybody.
(Ideally, it could have been an opportunity to document why we have this "DV 
exception", but I understand it is not very comfortable to write as there is no 
meaningful reason, so forget about this, this won't hold up the patch anyway)
For information, there was a long thread recently on ffmpeg-user about a "bug" 
in dnxhd stored_height (will be fixed with your patch):
https://ffmpeg.org/pipermail/ffmpeg-user/2023-February/056111.html

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

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


[FFmpeg-devel] [PATCH] avcodec/av1dec: parse and export Metadata OBUs

2023-03-06 Thread James Almer
This includes Mastering Display, Content light level, and some ITU-T T35
metadata like closed captions and HDR10+.

Signed-off-by: James Almer 
---
 libavcodec/av1dec.c | 163 
 libavcodec/av1dec.h |   8 +++
 2 files changed, 171 insertions(+)

diff --git a/libavcodec/av1dec.c b/libavcodec/av1dec.c
index d83c902f1f..dda9a22cf2 100644
--- a/libavcodec/av1dec.c
+++ b/libavcodec/av1dec.c
@@ -21,13 +21,16 @@
 #include "config_components.h"
 
 #include "libavutil/film_grain_params.h"
+#include "libavutil/mastering_display_metadata.h"
 #include "libavutil/pixdesc.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
 #include "av1dec.h"
+#include "atsc_a53.h"
 #include "bytestream.h"
 #include "codec_internal.h"
 #include "decode.h"
+#include "dynamic_hdr10_plus.h"
 #include "hwconfig.h"
 #include "profiles.h"
 #include "thread.h"
@@ -645,6 +648,7 @@ fail:
 static av_cold int av1_decode_free(AVCodecContext *avctx)
 {
 AV1DecContext *s = avctx->priv_data;
+AV1RawMetadataITUTT35 itut_t35;
 
 for (int i = 0; i < FF_ARRAY_ELEMS(s->ref); i++) {
 av1_frame_unref(avctx, >ref[i]);
@@ -655,8 +659,14 @@ static av_cold int av1_decode_free(AVCodecContext *avctx)
 
 av_buffer_unref(>seq_ref);
 av_buffer_unref(>header_ref);
+av_buffer_unref(>cll_ref);
+av_buffer_unref(>mdcv_ref);
 av_freep(>tile_group_info);
 
+while (s->itut_t35_fifo && av_fifo_read(s->itut_t35_fifo, _t35, 1) >= 
0)
+av_buffer_unref(_t35.payload_ref);
+av_fifo_freep2(>itut_t35_fifo);
+
 ff_cbs_fragment_free(>current_obu);
 ff_cbs_close(>cbc);
 
@@ -771,6 +781,11 @@ static av_cold int av1_decode_init(AVCodecContext *avctx)
 if (ret < 0)
 return ret;
 
+s->itut_t35_fifo = av_fifo_alloc2(1, sizeof(AV1RawMetadataITUTT35),
+  AV_FIFO_FLAG_AUTO_GROW);
+if (!s->itut_t35_fifo)
+return AVERROR(ENOMEM);
+
 av_opt_set_int(s->cbc->priv_data, "operating_point", s->operating_point, 
0);
 
 if (avctx->extradata && avctx->extradata_size) {
@@ -852,6 +867,106 @@ fail:
 return ret;
 }
 
+static int export_itut_t35(AVCodecContext *avctx, AVFrame *frame,
+   AV1RawMetadataITUTT35 *itut_t35)
+{
+GetByteContext gb;
+int ret, provider_code;
+
+bytestream2_init(, itut_t35->payload, itut_t35->payload_size);
+
+provider_code = bytestream2_get_be16();
+switch (provider_code) {
+case 0x31: { // atsc_provider_code
+uint32_t user_identifier = bytestream2_get_be32();
+switch (user_identifier) {
+case MKBETAG('G', 'A', '9', '4'): { // closed captions
+AVBufferRef *buf = NULL;
+
+ret = ff_parse_a53_cc(, gb.buffer, 
bytestream2_get_bytes_left());
+if (ret < 0)
+return ret;
+if (!ret)
+break;
+
+if (!av_frame_new_side_data_from_buf(frame, AV_FRAME_DATA_A53_CC, 
buf))
+av_buffer_unref();
+
+avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
+break;
+}
+default: // ignore unsupported identifiers
+break;
+}
+}
+case 0x3C: { // smpte_provider_code
+AVDynamicHDRPlus *hdrplus;
+int provider_oriented_code = bytestream2_get_be16();
+int application_identifier = bytestream2_get_byte();
+
+if (provider_oriented_code != 1 || application_identifier != 4)
+break;
+
+hdrplus = av_dynamic_hdr_plus_create_side_data(frame);
+if (!hdrplus)
+return AVERROR(ENOMEM);
+
+ret = ff_parse_itu_t_t35_to_dynamic_hdr10_plus(hdrplus, gb.buffer,
+   
bytestream2_get_bytes_left());
+if (ret < 0)
+return ret;
+break;
+}
+default: // ignore unsupported provider codes
+break;
+}
+
+return 0;
+}
+
+static int export_metadata(AVCodecContext *avctx, AVFrame *frame)
+{
+AV1DecContext *s = avctx->priv_data;
+AV1RawMetadataITUTT35 itut_t35;
+int ret = 0;
+
+if (s->mdcv) {
+AVMasteringDisplayMetadata *mastering = 
av_mastering_display_metadata_create_side_data(frame);
+if (!mastering)
+return AVERROR(ENOMEM);
+
+for (int i = 0; i < 3; i++) {
+mastering->display_primaries[i][0] = 
av_make_q(s->mdcv->primary_chromaticity_x[i], 1 << 16);
+mastering->display_primaries[i][1] = 
av_make_q(s->mdcv->primary_chromaticity_y[i], 1 << 16);
+}
+mastering->white_point[0] = 
av_make_q(s->mdcv->white_point_chromaticity_x, 1 << 16);
+mastering->white_point[1] = 
av_make_q(s->mdcv->white_point_chromaticity_y, 1 << 16);
+
+mastering->max_luminance = av_make_q(s->mdcv->luminance_max, 1 << 8);
+mastering->min_luminance = av_make_q(s->mdcv->luminance_min, 1 << 14);
+
+mastering->has_primaries = 1;
+

Re: [FFmpeg-devel] [PATCH V6 1/3] lavfi/dnn: Mark native backend as unsupported

2023-03-06 Thread Fu, Ting



> -Original Message-
> From: ffmpeg-devel  On Behalf Of Ting
> Fu
> Sent: Monday, March 6, 2023 09:56 PM
> To: ffmpeg-devel@ffmpeg.org
> Subject: [FFmpeg-devel] [PATCH V6 1/3] lavfi/dnn: Mark native backend as
> unsupported
> 
> Native is deprecated value for backed_type option. Modify related error
> message.
> 
> Signed-off-by: Ting Fu 
> ---
>  libavfilter/dnn/dnn_interface.c | 10 +-
>  1 file changed, 1 insertion(+), 9 deletions(-)
> 
[...]
Compared with PATCH V5, only restored some content incorrectly deleted in 
doc/filters.texi, and rebase commit on latest code.
> --
> 2.17.1
> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org
> with subject "unsubscribe".
___
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 V6 2/3] lavfi/dnn: Modified DNN native backend related tools and docs.

2023-03-06 Thread Ting Fu
Deleted the native backend related files in 'tools' dir. Modify its'
docs and codes mentioned in such docs.

Signed-off-by: Ting Fu 
---
 doc/filters.texi|  39 +-
 libavfilter/vf_derain.c |   2 +-
 libavfilter/vf_dnn_processing.c |   2 +-
 libavfilter/vf_sr.c |   2 +-
 tools/python/convert.py |  56 ---
 tools/python/convert_from_tensorflow.py | 607 
 tools/python/convert_header.py  |  26 -
 7 files changed, 7 insertions(+), 727 deletions(-)
 delete mode 100644 tools/python/convert.py
 delete mode 100644 tools/python/convert_from_tensorflow.py
 delete mode 100644 tools/python/convert_header.py

diff --git a/doc/filters.texi b/doc/filters.texi
index 7a7b2ba4e7..726d2fd7e2 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -11305,9 +11305,6 @@ See 
@url{http://openaccess.thecvf.com/content_ECCV_2018/papers/Xia_Li_Recurrent_
 Training as well as model generation scripts are provided in
 the repository at @url{https://github.com/XueweiMeng/derain_filter.git}.
 
-Native model files (.model) can be generated from TensorFlow model
-files (.pb) by using tools/python/convert.py
-
 The filter accepts the following options:
 
 @table @option
@@ -11328,21 +11325,16 @@ Specify which DNN backend to use for model loading 
and execution. This option ac
 the following values:
 
 @table @samp
-@item native
-Native implementation of DNN loading and execution.
-
 @item tensorflow
 TensorFlow backend. To enable this backend you
 need to install the TensorFlow for C library (see
 @url{https://www.tensorflow.org/install/lang_c}) and configure FFmpeg with
 @code{--enable-libtensorflow}
 @end table
-Default value is @samp{native}.
 
 @item model
 Set path to model file specifying network architecture and its parameters.
-Note that different backends use different file formats. TensorFlow and native
-backend can load files for only its format.
+Note that different backends use different file formats. TensorFlow can load 
files for only its format.
 @end table
 
 To get full functionality (such as async execution), please use the 
@ref{dnn_processing} filter.
@@ -11666,9 +11658,6 @@ Specify which DNN backend to use for model loading and 
execution. This option ac
 the following values:
 
 @table @samp
-@item native
-Native implementation of DNN loading and execution.
-
 @item tensorflow
 TensorFlow backend. To enable this backend you
 need to install the TensorFlow for C library (see
@@ -11684,14 +11673,9 @@ be needed if the header files and libraries are not 
installed into system path)
 
 @end table
 
-Default value is @samp{native}.
-
 @item model
 Set path to model file specifying network architecture and its parameters.
-Note that different backends use different file formats. TensorFlow, OpenVINO 
and native
-backend can load files for only its format.
-
-Native model file (.model) can be generated from TensorFlow model file (.pb) 
by using tools/python/convert.py
+Note that different backends use different file formats. TensorFlow, OpenVINO 
backend can load files for only its format.
 
 @item input
 Set the input name of the dnn network.
@@ -11717,12 +11701,6 @@ Remove rain in rgb24 frame with can.pb (see 
@ref{derain} filter):
 ./ffmpeg -i rain.jpg -vf 
format=rgb24,dnn_processing=dnn_backend=tensorflow:model=can.pb:input=x:output=y
 derain.jpg
 @end example
 
-@item
-Halve the pixel value of the frame with format gray32f:
-@example
-ffmpeg -i input.jpg -vf 
format=grayf32,dnn_processing=model=halve_gray_float.model:input=dnn_in:output=dnn_out:dnn_backend=native
 -y out.native.png
-@end example
-
 @item
 Handle the Y channel with srcnn.pb (see @ref{sr} filter) for frame with 
yuv420p (planar YUV formats supported):
 @example
@@ -21750,9 +21728,6 @@ Training scripts as well as scripts for model file 
(.pb) saving can be found at
 @url{https://github.com/XueweiMeng/sr/tree/sr_dnn_native}. Original repository
 is at @url{https://github.com/HighVoltageRocknRoll/sr.git}.
 
-Native model files (.model) can be generated from TensorFlow model
-files (.pb) by using tools/python/convert.py
-
 The filter accepts the following options:
 
 @table @option
@@ -21761,9 +21736,6 @@ Specify which DNN backend to use for model loading and 
execution. This option ac
 the following values:
 
 @table @samp
-@item native
-Native implementation of DNN loading and execution.
-
 @item tensorflow
 TensorFlow backend. To enable this backend you
 need to install the TensorFlow for C library (see
@@ -21771,13 +21743,10 @@ need to install the TensorFlow for C library (see
 @code{--enable-libtensorflow}
 @end table
 
-Default value is @samp{native}.
-
 @item model
 Set path to model file specifying network architecture and its parameters.
-Note that different backends use different file formats. TensorFlow backend
-can load files for both formats, while native backend can load files for only
-its format.
+Note that different backends use 

[FFmpeg-devel] [PATCH V6 1/3] lavfi/dnn: Mark native backend as unsupported

2023-03-06 Thread Ting Fu
Native is deprecated value for backed_type option. Modify related error
message.

Signed-off-by: Ting Fu 
---
 libavfilter/dnn/dnn_interface.c | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/libavfilter/dnn/dnn_interface.c b/libavfilter/dnn/dnn_interface.c
index 554a36b0dc..5b1695a1dd 100644
--- a/libavfilter/dnn/dnn_interface.c
+++ b/libavfilter/dnn/dnn_interface.c
@@ -24,7 +24,6 @@
  */
 
 #include "../dnn_interface.h"
-#include "dnn_backend_native.h"
 #include "dnn_backend_tf.h"
 #include "dnn_backend_openvino.h"
 #include "libavutil/mem.h"
@@ -39,13 +38,6 @@ DNNModule *ff_get_dnn_module(DNNBackendType backend_type)
 }
 
 switch(backend_type){
-case DNN_NATIVE:
-dnn_module->load_model = _dnn_load_model_native;
-dnn_module->execute_model = _dnn_execute_model_native;
-dnn_module->get_result = _dnn_get_result_native;
-dnn_module->flush = _dnn_flush_native;
-dnn_module->free_model = _dnn_free_model_native;
-break;
 case DNN_TF:
 #if (CONFIG_LIBTENSORFLOW == 1)
 dnn_module->load_model = _dnn_load_model_tf;
@@ -71,7 +63,7 @@ DNNModule *ff_get_dnn_module(DNNBackendType backend_type)
 #endif
 break;
 default:
-av_log(NULL, AV_LOG_ERROR, "Module backend_type is not native or 
tensorflow\n");
+av_log(NULL, AV_LOG_ERROR, "Module backend_type is not supported or 
enabled.\n");
 av_freep(_module);
 return NULL;
 }
-- 
2.17.1

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

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


Re: [FFmpeg-devel] Making progress re: jpeg2000dec patchsets

2023-03-06 Thread Tomas Härdin


Sorry for replying a bit late to this. Anyway:

> Hi Caleb, Tomas et al.,
> 
> I have been experimenting with combining the HTJ2K patchset [1] and
> the J2K test patchset [2]:
> 
> (a) neither valgrind nor the fuzzer seem to complain

Excellent.

> (b) there are code style/cosmetic issues
> (c) the HTJ2K block decoder does not yet support placeholder passes
> [3], which are not necessarily present

Can we error out in that case and ask for patches?

> I do not think that (c) is a blocker and recommend that we plan on
> merging the combined patchset once the code style/cosmetic issues are
> fixed. The idea is to have a baseline from which performance and
> feature set can be improved.

Sounds good.

/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 v3 4/5] avformat/movenc: add PCM in mp4 support

2023-03-06 Thread Tomas Härdin
> +static int mov_write_chnl_tag(AVFormatContext *s, AVIOContext *pb,
> MOVTrack *track)
> +{
> +    int64_t pos = avio_tell(pb);
> +    int config = 0;
> +    int ret;
> +    uint8_t *speaker_pos = NULL;
> +    const AVChannelLayout *layout = >par->ch_layout;
> +
> +    ret = ff_mov_get_channel_config_from_layout(layout, );
> +    if (ret || !config) {

ret is always 0..


/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 v3 3/5] avformat/mov: parse ISO-14496-12 ChannelLayout

2023-03-06 Thread Tomas Härdin
> +int ff_mov_get_channel_config_from_layout(const AVChannelLayout
> *layout, int *config)
> +{
> +    // Set default value which means any setup in 23001-8
> +    *config = 0;
> +    for (int i = 0; i < FF_ARRAY_ELEMS(iso_channel_configuration);
> i++) {
> +    if (!av_channel_layout_compare(layout,
> iso_channel_configuration + i)) {
> +    *config = i;
> +    break;
> +    }
> +    }
> +
> +    return 0;

Is always returning 0 intended? If so then what is the point?
ff_mov_get_channel_positions_from_layout() returns non-zero on error..

/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 v14 9/9] avcodec/evc: Changes in Changelog and MAINTAINERS files

2023-03-06 Thread Dawid Kozinski/Multimedia (PLT) /SRPOL/Staff Engineer/Samsung Electronics



> -Original Message-
> From: ffmpeg-devel  On Behalf Of Lynne
> Sent: wtorek, 14 lutego 2023 19:01
> To: FFmpeg development discussions and patches 
> Subject: Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in
> Changelog and MAINTAINERS files
> 
> Feb 14, 2023, 13:10 by d.kozin...@samsung.com:
> 
> >
> > -Original Message-
> > From: ffmpeg-devel  On Behalf Of
> > Lynne
> > Sent: poniedziałek, 13 lutego 2023 18:32
> > To: FFmpeg development discussions and patches
> > 
> > Subject: Re: [FFmpeg-devel] [PATCH v14 9/9] avcodec/evc: Changes in
> > Changelog and MAINTAINERS files
> >
> > Feb 13, 2023, 10:29 by d.kozin...@samsung.com:
> >
> >> Lynne, if it concerns us, we will comply with both the current and
> >> the new maintainership policy once your patchset is pushed. We see
> >> that your change has not yet been pushed into the main branch, and it
> >> appears that the discussion on this topic may still be ongoing,
> >> although both Michael and other maintainers have reviewed and
> >> commented on
> >>
> > it.
> >
> >>
> >>
> >
> > What do you mean both current and new policy?
> >
> > Lynne, you mentioned a new policy change on maintainership in one of
> > the previous emails:
> > "I assign myself to personally review the patchset and push it, if you
> > review my policy change on maintainership. As I said, I have no
> > objection on who gets maintainership, just that it is done explicitly
> > via a separate list in the maintainers file."
> >
> 
> Fair enough, I'll just review the patchset while ignoring this patch.

Dear Lynne,

I just wanted to timidly remind you that we are still waiting for a review of 
our code.
Please have mercy on us and don't let us wait for ages. We don't want to wait 
indefinitely, and we would like to move forward with our project.

We understand that our patch is not a tiny piece of code, and we know the 
effort required to review it thoroughly is expected to be rather big. However, 
we would like to receive some feedback, even if it is just to let us know that 
currently you are overwhelmed by something else but you still keep it in your 
mind, and you will review it as soon as you are able. 
It is a little bit frustrating to wait for weeks without any feedback. Please, 
try to understand us.

We understand that there may be some issues that need to be addressed, and we 
are willing to work with you to fix any problems and ensure that our code meets 
all the requirements of the FFmpeg project. 
If there is something that requires improvement, please let us know so that we 
can address them.

On the other hand, if our code is already satisfactory, we would like to see it 
included in the FFmpeg repository. We believe that our patches could benefit 
the FFmpeg community, and we would like to contribute to the project. 
We appreciate your time and effort, and we look forward to hearing back from 
you soon.

Best regards,
DK
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://protect2.fireeye.com/v1/url?k=c6da1d34-a6388069-c6db967b-
> 000babd9f1ba-f1087034b8a00e05=1=f6840520-ddf5-4d1d-890b-
> 9f658856ac36=https%3A%2F%2Fffmpeg.org%2Fmailman%2Flistinfo%2Fffmp
> eg-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] mips: fix build fail on MIPS R6

2023-03-06 Thread Junxian Zhu
Hello, Michael, can you help to review this pacth? It made ffmpeg compilable on 
mips r6 platform.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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


[FFmpeg-devel] [PATCH v3] avcodec/mathops: Optimize generic mid_pred function

2023-03-06 Thread Junxian Zhu
From: Junxian Zhu 

Rewrite mid_pred function in generic mathops.h, reduce branch jump to improve 
performance. And because nowadays new version compiler can compile enough short 
asmbbely code as handwritting in these function, so remove specified optimized 
mips inline asmbbely mathops.h.

Signed-off-by: Junxian Zhu 
---
 libavcodec/mathops.h  | 20 
 libavcodec/mips/mathops.h | 67 ---
 2 files changed, 6 insertions(+), 81 deletions(-)
 delete mode 100644 libavcodec/mips/mathops.h

diff --git a/libavcodec/mathops.h b/libavcodec/mathops.h
index c89054d6ed..526ffe0eec 100644
--- a/libavcodec/mathops.h
+++ b/libavcodec/mathops.h
@@ -41,8 +41,6 @@ extern const uint8_t ff_zigzag_scan[16+1];
 #   include "arm/mathops.h"
 #elif ARCH_AVR32
 #   include "avr32/mathops.h"
-#elif ARCH_MIPS
-#   include "mips/mathops.h"
 #elif ARCH_PPC
 #   include "ppc/mathops.h"
 #elif ARCH_X86
@@ -98,18 +96,12 @@ static av_always_inline unsigned UMULH(unsigned a, unsigned 
b){
 #define mid_pred mid_pred
 static inline av_const int mid_pred(int a, int b, int c)
 {
-if(a>b){
-if(c>b){
-if(c>a) b=a;
-elseb=c;
-}
-}else{
-if(b>c){
-if(c>a) b=c;
-elseb=a;
-}
-}
-return b;
+int t0,t1,t2,t3;
+t0 = (a > b) ? b : a ;
+t1 = (a > b) ? a : b ;
+t2 = (t0 > c) ? t0 : c;
+t3 = (t1 > t2) ? t2 : t1;
+return t3; 
 }
 #endif
 
diff --git a/libavcodec/mips/mathops.h b/libavcodec/mips/mathops.h
deleted file mode 100644
index bb9dc8375a..00
--- a/libavcodec/mips/mathops.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2009 Mans Rullgard 
- * Copyright (c) 2015 Zhou Xiaoyong 
- *
- * 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
- */
-
-#ifndef AVCODEC_MIPS_MATHOPS_H
-#define AVCODEC_MIPS_MATHOPS_H
-
-#include 
-#include "config.h"
-#include "libavutil/common.h"
-
-#if HAVE_INLINE_ASM
-
-#if HAVE_LOONGSON3
-
-#define MULH MULH
-static inline av_const int MULH(int a, int b)
-{
-int c;
-__asm__ ("dmult %1, %2  \n\t"
- "mflo %0   \n\t"
- "dsrl %0, %0, 32   \n\t"
- : "=r"(c)
- : "r"(a),"r"(b)
- : "hi", "lo");
-return c;
-}
-
-#define mid_pred mid_pred
-static inline av_const int mid_pred(int a, int b, int c)
-{
-int t = b;
-__asm__ ("sgt $8, %1, %2\n\t"
- "movn %0, %1, $8   \n\t"
- "movn %1, %2, $8   \n\t"
- "sgt $8, %1, %3\n\t"
- "movz %1, %3, $8   \n\t"
- "sgt $8, %0, %1\n\t"
- "movn %0, %1, $8   \n\t"
- : "+"(t),"+"(a)
- : "r"(b),"r"(c)
- : "$8");
-return t;
-}
-
-#endif /* HAVE_LOONGSON3 */
-
-#endif /* HAVE_INLINE_ASM */
-
-#endif /* AVCODEC_MIPS_MATHOPS_H */
-- 
2.39.2.windows.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] lavu/vulkan: fix handle type for 32-bit targets

2023-03-06 Thread Martin Storsjö

On Thu, 2 Mar 2023, Kacper Michajłow wrote:


Fixes compilation with clang which errors out on Wint-conversion.

Signed-off-by: Kacper Michajłow 
---
libavutil/hwcontext_vulkan.c | 2 +-
libavutil/vulkan.h   | 4 
2 files changed, 5 insertions(+), 1 deletion(-)


Minor context; it's only recent Clang that treats this issue as an error 
by default - iirc it changed sometime last year, so possibly since Clang 
15 or so.




diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 2a9b5f4aac..b3eccea7af 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1149,7 +1149,7 @@ static void free_exec_ctx(AVHWFramesContext *hwfc, 
VulkanExecCtx *cmd)

av_freep(>queues);
av_freep(>bufs);
-cmd->pool = NULL;
+cmd->pool = VK_NULL_HANDLE;
}


This LGTM - I had run into the same issue and tried to fix this issue 
differently, but this looks better to me.



static VkCommandBuffer get_buf_exec_ctx(AVHWFramesContext *hwfc, VulkanExecCtx 
*cmd)
diff --git a/libavutil/vulkan.h b/libavutil/vulkan.h
index d1ea1e24fb..90922c6cf3 100644
--- a/libavutil/vulkan.h
+++ b/libavutil/vulkan.h
@@ -122,7 +122,11 @@ typedef struct FFVulkanPipeline {
VkDescriptorSetLayout *desc_layout;
VkDescriptorPool   desc_pool;
VkDescriptorSet   *desc_set;
+#if VK_USE_64_BIT_PTR_DEFINES == 1
void **desc_staging;
+#else
+uint64_t  *desc_staging;
+#endif
VkDescriptorSetLayoutBinding **desc_binding;
VkDescriptorUpdateTemplate*desc_template;
int   *desc_set_initialized;
--
2.34.1


What issue does this fix? I don't run into any errors relating to this, 
when building with Clang for Windows on i386 or armv7. I think the fix is 
correct though, the vulkan data types are a bit hard to get a grip of.


// 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] vulkan: Fix win/i386 calling convention and pointer/int conversion error

2023-03-06 Thread Martin Storsjö

On Sun, 5 Mar 2023, Martin Storsjö wrote:


This fixes the following two errors when compiling with a modern
version of Clang for Windows/i386:

src/libavutil/hwcontext_vulkan.c:738:32: error: incompatible function pointer 
types initializing 'PFN_vkDebugUtilsMessengerCallbackEXT' (aka 'unsigned int 
(*)(enum VkDebugUtilsMessageSeverityFlagBitsEXT, unsigned int, const struct 
VkDebugUtilsMessengerCallbackDataEXT *, void *) __attribute__((stdcall))') with 
an expression of type 'VkBool32 (VkDebugUtilsMessageSeverityFlagBitsEXT, 
VkDebugUtilsMessageTypeFlagsEXT, const VkDebugUtilsMessengerCallbackDataEXT *, 
void *)' (aka 'unsigned int (enum VkDebugUtilsMessageSeverityFlagBitsEXT, 
unsigned int, const struct VkDebugUtilsMessengerCallbackDataEXT *, void *)') 
[-Wincompatible-function-pointer-types]
   .pfnUserCallback = vk_dbg_callback,
  ^~~
src/libavutil/hwcontext_vulkan.c:1152:15: error: incompatible pointer to 
integer conversion assigning to 'VkCommandPool' (aka 'unsigned long long') from 
'void *' [-Wint-conversion]
   cmd->pool = NULL;
 ^ 
2 errors generated.

The calling convention mismatch is an issue only on Windows/i386,
while the latter is a hard error by default in modern Clang whenever
pointers are smaller than unsigned long long.

Signed-off-by: Martin Storsjö 
---
libavutil/hwcontext_vulkan.c | 10 +-
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 2a9b5f4aac..2ae469283d 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -401,10 +401,10 @@ static const char *vk_ret2str(VkResult res)
#undef CASE
}

-static VkBool32 vk_dbg_callback(VkDebugUtilsMessageSeverityFlagBitsEXT 
severity,
-VkDebugUtilsMessageTypeFlagsEXT messageType,
-const VkDebugUtilsMessengerCallbackDataEXT 
*data,
-void *priv)
+static VkBool32 VKAPI_CALL 
vk_dbg_callback(VkDebugUtilsMessageSeverityFlagBitsEXT severity,
+   VkDebugUtilsMessageTypeFlagsEXT 
messageType,
+   const 
VkDebugUtilsMessengerCallbackDataEXT *data,
+   void *priv)
{
int l;
AVHWDeviceContext *ctx = priv;
@@ -1149,7 +1149,7 @@ static void free_exec_ctx(AVHWFramesContext *hwfc, 
VulkanExecCtx *cmd)

av_freep(>queues);
av_freep(>bufs);
-cmd->pool = NULL;
+cmd->pool = 0;
}

static VkCommandBuffer get_buf_exec_ctx(AVHWFramesContext *hwfc, VulkanExecCtx 
*cmd)
--
2.34.1


OK'd by Lynne on irc. She also noted that the latter code gets removed by 
her pending patchsets - but I think it's good to have a fix for the 
existing code forms, for backporting.


I was pointed to an existing patch by Kacper Michajłow that also fixes the 
other issue in a better way, so I'll refrain from pushing that part of my 
fix.


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