[FFmpeg-devel] [PATCH v2 1/3] avformat/mpegtsenc: Fix mpegts_write_pes() for private_stream_2 and other types

2021-04-19 Thread zheng qian
Changes since v1:
  Separate if-statement and cosmetic changes into different commits

According to the PES packet definition defined in Table 2-17
of ISO_IEC_13818-1 specification, some fields like PTS/DTS or
pes_extension could only appears if the stream_id meets the
condition:

if (stream_id != 0xBC &&  // program_stream_map
stream_id != 0xBE &&  // padding_stream
stream_id != 0xBF &&  // private_stream_2
stream_id != 0xF0 &&  // ECM
stream_id != 0xF1 &&  // EMM
stream_id != 0xFF &&  // program_stream_directory
stream_id != 0xF2 &&  // DSMCC_stream
stream_id != 0xF8) // ITU-T Rec. H.222.1 type E stream

And the following stream_id types don't have fields like PTS/DTS:

else if ( stream_id == program_stream_map
|| stream_id == private_stream_2
|| stream_id == ECM
|| stream_id == EMM
|| stream_id == program_stream_directory
|| stream_id == DSMCC_stream
|| stream_id == ITU-T Rec. H.222.1 type E stream ) {
for (i = 0; i < PES_packet_length; i++) {
PES_packet_data_byte
}
}

Current implementation skipped the judgement of stream_id
causing some kind of stream like private_stream_2 to be
incorrectly written with PTS/DTS field. For example,
Japan DTV transmits news and alerts through ARIB superimpose
that utilizes private_stream_2 still could not be remuxed
correctly for now.

This patch set fixes the remuxing for private_stream_2 and
other stream_id types.

Signed-off-by: zheng qian 
---
 libavformat/mpegtsenc.c | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index f302af84ff..0c543c385b 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1524,6 +1524,16 @@ static void mpegts_write_pes(AVFormatContext *s, 
AVStream *st,
 }
 *q++ = len >> 8;
 *q++ = len;
+
+if (stream_id != 0xBC &&  // program_stream_map
+stream_id != 0xBE &&  // padding_stream
+stream_id != 0xBF &&  // private_stream_2
+stream_id != 0xF0 &&  // ECM
+stream_id != 0xF1 &&  // EMM
+stream_id != 0xFF &&  // program_stream_directory
+stream_id != 0xF2 &&  // DSMCC_stream
+stream_id != 0xF8) {  // ITU-T Rec. H.222.1 type E stream
+
 val  = 0x80;
 /* data alignment indicator is required for subtitle and data 
streams */
 if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE || 
st->codecpar->codec_type == AVMEDIA_TYPE_DATA)
@@ -1569,6 +1579,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream 
*st,
 memset(q, 0xff, pes_header_stuffing_bytes);
 q += pes_header_stuffing_bytes;
 }
+}
 is_start = 0;
 }
 /* header size */
-- 
2.29.2

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

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


[FFmpeg-devel] [PATCH v2 3/3] avformat/mpegtsenc: Write stream_id into PES after stream_id decision

2021-04-19 Thread zheng qian
Since stream_id will have effect on the existences of
PES header fields like PTS/DTS, it should be better to
guarantee stream_id variable to be identical with
exact written value.

Signed-off-by: zheng qian 
---
 libavformat/mpegtsenc.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 4a20775af4..0e9c978d74 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1445,28 +1445,28 @@ static void mpegts_write_pes(AVFormatContext *s, 
AVStream *st,
 is_dvb_teletext = 0;
 if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
 if (st->codecpar->codec_id == AV_CODEC_ID_DIRAC)
-*q++ = STREAM_ID_EXTENDED_STREAM_ID;
+stream_id = STREAM_ID_EXTENDED_STREAM_ID;
 else
-*q++ = STREAM_ID_VIDEO_STREAM_0;
+stream_id = STREAM_ID_VIDEO_STREAM_0;
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
(st->codecpar->codec_id == AV_CODEC_ID_MP2 ||
 st->codecpar->codec_id == AV_CODEC_ID_MP3 ||
 st->codecpar->codec_id == AV_CODEC_ID_AAC)) {
-*q++ = STREAM_ID_AUDIO_STREAM_0;
+stream_id = STREAM_ID_AUDIO_STREAM_0;
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
 st->codecpar->codec_id == AV_CODEC_ID_AC3 &&
 ts->m2ts_mode) {
-*q++ = STREAM_ID_EXTENDED_STREAM_ID;
+stream_id = STREAM_ID_EXTENDED_STREAM_ID;
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA &&
st->codecpar->codec_id == AV_CODEC_ID_TIMED_ID3) {
-*q++ = STREAM_ID_PRIVATE_STREAM_1;
+stream_id = STREAM_ID_PRIVATE_STREAM_1;
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
-*q++ = stream_id != -1 ? stream_id : STREAM_ID_METADATA_STREAM;
+stream_id = stream_id != -1 ? stream_id : 
STREAM_ID_METADATA_STREAM;
 
 if (stream_id == STREAM_ID_PRIVATE_STREAM_1) /* asynchronous 
KLV */
 pts = dts = AV_NOPTS_VALUE;
 } else {
-*q++ = STREAM_ID_PRIVATE_STREAM_1;
+stream_id = STREAM_ID_PRIVATE_STREAM_1;
 if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) {
 if (st->codecpar->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
 is_dvb_subtitle = 1;
@@ -1475,6 +1475,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream 
*st,
 }
 }
 }
+*q++ = stream_id;
 header_len = 0;
 flags  = 0;
 if (pts != AV_NOPTS_VALUE) {
-- 
2.29.2

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

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


[FFmpeg-devel] [PATCH v2 2/3] avformat/mpegtsenc: Fix indentation inside if statement in mpegts_write_pes()

2021-04-19 Thread zheng qian
Fix indentation caused by the added stream_id judgement

Signed-off-by: zheng qian 
---
 libavformat/mpegtsenc.c | 84 -
 1 file changed, 42 insertions(+), 42 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 0c543c385b..4a20775af4 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1534,51 +1534,51 @@ static void mpegts_write_pes(AVFormatContext *s, 
AVStream *st,
 stream_id != 0xF2 &&  // DSMCC_stream
 stream_id != 0xF8) {  // ITU-T Rec. H.222.1 type E stream
 
-val  = 0x80;
-/* data alignment indicator is required for subtitle and data 
streams */
-if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE || 
st->codecpar->codec_type == AVMEDIA_TYPE_DATA)
-val |= 0x04;
-*q++ = val;
-*q++ = flags;
-*q++ = header_len;
-if (pts != AV_NOPTS_VALUE) {
-write_pts(q, flags >> 6, pts);
-q += 5;
-}
-if (dts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE && dts != pts) {
-write_pts(q, 1, dts);
-q += 5;
-}
-if (pes_extension && st->codecpar->codec_id == AV_CODEC_ID_DIRAC) {
-flags = 0x01;  /* set PES_extension_flag_2 */
-*q++  = flags;
-*q++  = 0x80 | 0x01; /* marker bit + extension length */
-/* Set the stream ID extension flag bit to 0 and
- * write the extended stream ID. */
-*q++ = 0x00 | 0x60;
-}
-/* For Blu-ray AC3 Audio Setting extended flags */
-if (ts->m2ts_mode &&
-pes_extension &&
-st->codecpar->codec_id == AV_CODEC_ID_AC3) {
-flags = 0x01; /* set PES_extension_flag_2 */
+val  = 0x80;
+/* data alignment indicator is required for subtitle and data 
streams */
+if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE || 
st->codecpar->codec_type == AVMEDIA_TYPE_DATA)
+val |= 0x04;
+*q++ = val;
 *q++ = flags;
-*q++ = 0x80 | 0x01; /* marker bit + extension length */
-*q++ = 0x00 | 0x71; /* for AC3 Audio (specifically on 
blue-rays) */
-}
+*q++ = header_len;
+if (pts != AV_NOPTS_VALUE) {
+write_pts(q, flags >> 6, pts);
+q += 5;
+}
+if (dts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE && dts != 
pts) {
+write_pts(q, 1, dts);
+q += 5;
+}
+if (pes_extension && st->codecpar->codec_id == 
AV_CODEC_ID_DIRAC) {
+flags = 0x01;  /* set PES_extension_flag_2 */
+*q++  = flags;
+*q++  = 0x80 | 0x01; /* marker bit + extension length */
+/* Set the stream ID extension flag bit to 0 and
+ * write the extended stream ID. */
+*q++ = 0x00 | 0x60;
+}
+/* For Blu-ray AC3 Audio Setting extended flags */
+if (ts->m2ts_mode &&
+pes_extension &&
+st->codecpar->codec_id == AV_CODEC_ID_AC3) {
+flags = 0x01; /* set PES_extension_flag_2 */
+*q++ = flags;
+*q++ = 0x80 | 0x01; /* marker bit + extension length */
+*q++ = 0x00 | 0x71; /* for AC3 Audio (specifically on 
blue-rays) */
+}
 
 
-if (is_dvb_subtitle) {
-/* First two fields of DVB subtitles PES data:
- * data_identifier: for DVB subtitle streams shall be coded 
with the value 0x20
- * subtitle_stream_id: for DVB subtitle stream shall be 
identified by the value 0x00 */
-*q++ = 0x20;
-*q++ = 0x00;
-}
-if (is_dvb_teletext) {
-memset(q, 0xff, pes_header_stuffing_bytes);
-q += pes_header_stuffing_bytes;
-}
+if (is_dvb_subtitle) {
+/* First two fields of DVB subtitles PES data:
+ * data_identifier: for DVB subtitle streams shall be 
coded with the value 0x20
+ * subtitle_stream_id: for DVB subtitle stream shall be 
identified by the value 0x00 */
+*q++ = 0x20;
+*q++ = 0x00;
+}
+if (is_dvb_teletext) {
+memset(q, 0xff, pes_header_stuffing_bytes);
+q += pes_header_stuffing_bytes;
+}
 }
 is_start = 0;
 }
-- 
2.29.2

___
ffmpeg-devel mailing list

Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-19 Thread Brad Smith

Can this please be back ported to the 4.4 branch?

On 4/18/2021 4:50 PM, Marton Balint wrote:



On Fri, 16 Apr 2021, Brad Smith wrote:


ping.


Will apply, thanks.

Marton



On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
  libavutil/cpu.c | 6 ++
  1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
  DWORD_PTR proc_aff, sys_aff;
  if (GetProcessAffinityMask(GetCurrentProcess(), 
_aff, _aff))

  nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+    int mib[2] = { CTL_HW, HW_NCPUONLINE };
+    size_t len = sizeof(nb_cpus);
+
+    if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+    nb_cpus = 0;
  #elif HAVE_SYSCTL && defined(HW_NCPU)
  int mib[2] = { CTL_HW, HW_NCPU };
  size_t len = sizeof(nb_cpus);

___
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] Gsoc: add the two fuzzy targets

2021-04-19 Thread Heng Zhang


> 在 2021年4月19日,下午5:47,Michael Niedermayer  写道:
> 
> On Mon, Apr 19, 2021 at 05:06:10PM +0800, a397341...@163.com 
>  wrote:
>> From: toseven 
>> 
>> ---
>> Makefile   |   5 ++
>> tools/Makefile |   6 ++
>> tools/target_avpacket_fuzzer.c | 125 +
>> tools/target_formats_fuzzer.c  | 120 +++
>> 4 files changed, 256 insertions(+)
>> create mode 100644 tools/target_avpacket_fuzzer.c
>> create mode 100644 tools/target_formats_fuzzer.c
>> 
>> diff --git a/Makefile b/Makefile
>> index 7e9d8b08c3..45509ab3b5 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -62,6 +62,11 @@ tools/target_dem_fuzzer$(EXESUF): 
>> tools/target_dem_fuzzer.o $(FF_DEP_LIBS)
>> tools/target_io_dem_fuzzer$(EXESUF): tools/target_io_dem_fuzzer.o 
>> $(FF_DEP_LIBS)
>>  $(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) 
>> $(LIBFUZZER_PATH)
>> 
>> +tools/target_avpacket_fuzzer$(EXESUF): tools/target_avpacket_fuzzer.o 
>> $(FF_DEP_LIBS)
>> +$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) 
>> $(LIBFUZZER_PATH)
>> +
>> +tools/target_formats_fuzzer$(EXESUF): tools/target_formats_fuzzer.o 
>> $(FF_DEP_LIBS)
>> +$(LD) $(LDFLAGS) $(LDEXEFLAGS) $(LD_O) $^ $(ELIBS) $(FF_EXTRALIBS) 
>> $(LIBFUZZER_PATH)
>> 
>> tools/enum_options$(EXESUF): ELIBS = $(FF_EXTRALIBS)
>> tools/enum_options$(EXESUF): $(FF_DEP_LIBS)
> 
>> diff --git a/tools/Makefile b/tools/Makefile
>> index 82baa8eadb..7ef720c8ba 100644
>> --- a/tools/Makefile
>> +++ b/tools/Makefile
>> @@ -17,6 +17,12 @@ tools/target_dem_fuzzer.o: tools/target_dem_fuzzer.c
>> tools/target_io_dem_fuzzer.o: tools/target_dem_fuzzer.c
>>  $(COMPILE_C) -DIO_FLAT=0
>> 
>> +tools/target_avpacket_fuzzer.o: tools/target_avpacket_fuzzer.c
>> +$(COMPILE_C) 
>> +
>> +tools/target_avpacket_fuzzer.o: tools/target_formats_fuzzer.c
>> +$(COMPILE_C) 
>> +
> 
> The target is duplicate

This is my mistake.

> 
> 
> 
> 
>> OUTDIRS += tools
>> 
>> clean::
>> diff --git a/tools/target_avpacket_fuzzer.c b/tools/target_avpacket_fuzzer.c
>> new file mode 100644
>> index 00..e5e7b3d4c8
>> --- /dev/null
>> +++ b/tools/target_avpacket_fuzzer.c
>> @@ -0,0 +1,125 @@
>> +/*
>> + * This file is part of FFmpeg.
>> + *
>> + * FFmpeg is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU Lesser General Public
>> + * License as published by the Free Software Foundation; either
>> + * version 2.1 of the License, or (at your option) any later version.
>> + *
>> + * FFmpeg is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> + * Lesser General Public License for more details.
>> + *
>> + * You should have received a copy of the GNU Lesser General Public
>> + * License along with FFmpeg; if not, write to the Free Software
>> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
>> USA
>> + */
>> +
>> +#include 
>> +#include 
>> +#include 
>> +#include 
>> +
>> +#include "libavcodec/avcodec.h"
>> +#include "libavutil/error.h"
>> +
>> +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
>> +
>> +static int setup_side_data_entry(AVPacket *avpkt)
>> +{
>> +const uint8_t *data_name = NULL;
>> +int ret = 0, bytes;
>> +uint8_t *extra_data = NULL;
>> +
>> +/* get side_data_name string */
>> +data_name = av_packet_side_data_name(AV_PKT_DATA_NEW_EXTRADATA);
>> +
>> +/* Allocate a memory bloc */
>> +bytes = strlen(data_name);
>> +
>> +if (!(extra_data = av_malloc(bytes)))
>> +{
>> +ret = AVERROR(ENOMEM);
>> +fprintf(stderr, "Error occurred: %s\n", av_err2str(ret));
>> +exit(1);
>> +}
>> +
>> +/* copy side_data_name to extra_data array */
>> +memcpy(extra_data, data_name, bytes);
>> +
>> +/* create side data for AVPacket */
>> +ret = av_packet_add_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA, 
>> extra_data,
>> +  bytes);
>> +
>> +if (ret < 0)
>> +{
>> +fprintf(stderr, "Error occurred in av_packet_add_side_data: %s\n",
>> +av_err2str(ret));
>> +}
>> +return ret;
> 
> the { } placing style mismatches whats used in FFmpeg (i dont mind but some 
> people do mind)
> 
> more general, how much code coverage is gained with these 2 fuzzers compared 
> to what already exists ?
> 
> thanks

Okay, I will modify my style to adopt for FFmpeg. What is more, I didn’t 
compare the code coverage between them. Do I have to do this?  I mainly refer 
to the fate test from libavcodec/tests/avpacket.c and 
libavfilter/tests/formats.c. 

> 
> [...]
> -- 
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> 
> "Nothing to hide" only works if the folks in power share the values of
> you and everyone you know 

Re: [FFmpeg-devel] [PATCH] avformat/mov: initial support for emsg box

2021-04-19 Thread James Almer

On 4/20/2021 1:01 AM, Brad Hards wrote:

This adds support for the EventMessage box, which is apparently described in
ISO/IEC 23009-1:2019, and is used for KLV metadata per MISB ST 1910.
See https://www.gwg.nga.mil/misb/docs/standards/ST1910.1.pdf Sect 6.2.1
---
  libavformat/isom.h | 15 
  libavformat/mov.c  | 61 ++
  2 files changed, 76 insertions(+)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 5a6d504090..8ea62e91f0 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -79,6 +79,18 @@ typedef struct MOVDref {
  int16_t nlvl_to, nlvl_from;
  } MOVDref;
  
+typedef struct MOVEmsg {

+uint8_t version;
+uint32_t timescale;
+uint32_t presentation_time_delta; ///< only valid for version 0
+uint64_t presentation_time; ///< only valid for version 1
+uint32_t event_duration;
+uint32_t id;
+char *scheme_id_uri;
+char *value;
+uint8_t *message_data;
+} MOVEmsg;
+
  typedef struct MOVAtom {
  uint32_t type;
  int64_t size; /* total size (excluding the size and type fields) */
@@ -297,6 +309,9 @@ typedef struct MOVContext {
  int32_t movie_display_matrix[3][3]; ///< display matrix from mvhd
  int have_read_mfra_size;
  uint32_t mfra_size;
+// Event Messages from DASH specification, used in MISB ST 1910
+unsigned emsg_count;  ///< Number of event messages
+MOVEmsg *emsg_data; ///< Array of Event Messages


You're not freeing this array anywhere. Same with each entry's 
message_data, scheme_id_uri and value.



  } MOVContext;
  
  int ff_mp4_read_descr_len(AVIOContext *pb);

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7805330bf9..22bf0b36ea 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5318,6 +5318,66 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
  return 0;
  }
  
+static int mov_read_emsg(MOVContext *c, AVIOContext *pb, MOVAtom atom)

+{
+int err;
+uint32_t bytes_read_from_atom = 0;
+size_t num_bytes_in_last_read;
+MOVEmsg *emsg;
+
+if ((uint64_t)c->emsg_count+1 >= UINT_MAX / sizeof(*c->emsg_data))
+return AVERROR_INVALIDDATA;
+if ((err = av_reallocp_array(>emsg_data, c->emsg_count + 1,


If there can be several emsg atoms in a bitstream, it may be a better 
idea to use av_fast_realloc() instead.


Also, no limit to their lifetime? Being events, one would expect they 
could be dropped after being handled.



+ sizeof(*c->emsg_data))) < 0) {
+c->emsg_count = 0;
+return err;
+}
+emsg = >emsg_data[c->emsg_count++];
+
+emsg->version = avio_r8(pb);
+bytes_read_from_atom += 1;
+avio_rb24(pb); /* flags */
+bytes_read_from_atom += 3;
+if (emsg->version == 0) {
+emsg->scheme_id_uri = av_malloc(atom.size + 1);
+num_bytes_in_last_read = avio_get_str(pb, atom.size, emsg->scheme_id_uri, 
pb->buffer_size + 1);
+bytes_read_from_atom += num_bytes_in_last_read;
+av_realloc(emsg->scheme_id_uri, num_bytes_in_last_read);
+emsg->value = av_malloc(atom.size + 1);
+num_bytes_in_last_read = avio_get_str(pb, atom.size, emsg->value, 
pb->buffer_size + 1);
+bytes_read_from_atom += num_bytes_in_last_read;
+av_realloc(emsg->value, num_bytes_in_last_read);
+emsg->timescale = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->presentation_time_delta = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->event_duration = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->id = avio_rb32(pb);
+bytes_read_from_atom += 4;
+} else if (emsg->version == 1) {
+emsg->timescale = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->presentation_time = avio_rb64(pb);
+bytes_read_from_atom += 8;
+emsg->event_duration = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->id = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->scheme_id_uri = av_malloc(atom.size + 1);
+num_bytes_in_last_read = avio_get_str(pb, atom.size, emsg->scheme_id_uri, 
pb->buffer_size + 1);
+bytes_read_from_atom += num_bytes_in_last_read;
+av_realloc(emsg->scheme_id_uri, num_bytes_in_last_read);
+emsg->value = av_malloc(atom.size + 1);
+num_bytes_in_last_read = avio_get_str(pb, atom.size, emsg->value, 
pb->buffer_size + 1);
+bytes_read_from_atom += num_bytes_in_last_read;


Use avio_tell() instead of keeping a byte count with this 
bytes_read_from_atom variable. As is this is pretty unreadable.



+av_realloc(emsg->value, num_bytes_in_last_read);
+}
+emsg->message_data = av_malloc(atom.size - bytes_read_from_atom);
+num_bytes_in_last_read = avio_read(pb, emsg->message_data, atom.size - 
bytes_read_from_atom);
+return 0;


You're not doing anything with these event messages. You're only storing 
them in an ever 

[FFmpeg-devel] [PATCH] avformat/mov: initial support for emsg box

2021-04-19 Thread Brad Hards
This adds support for the EventMessage box, which is apparently described in
ISO/IEC 23009-1:2019, and is used for KLV metadata per MISB ST 1910.
See https://www.gwg.nga.mil/misb/docs/standards/ST1910.1.pdf Sect 6.2.1
---
 libavformat/isom.h | 15 
 libavformat/mov.c  | 61 ++
 2 files changed, 76 insertions(+)

diff --git a/libavformat/isom.h b/libavformat/isom.h
index 5a6d504090..8ea62e91f0 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -79,6 +79,18 @@ typedef struct MOVDref {
 int16_t nlvl_to, nlvl_from;
 } MOVDref;
 
+typedef struct MOVEmsg {
+uint8_t version;
+uint32_t timescale;
+uint32_t presentation_time_delta; ///< only valid for version 0
+uint64_t presentation_time; ///< only valid for version 1
+uint32_t event_duration;
+uint32_t id;
+char *scheme_id_uri;
+char *value;
+uint8_t *message_data;
+} MOVEmsg;
+
 typedef struct MOVAtom {
 uint32_t type;
 int64_t size; /* total size (excluding the size and type fields) */
@@ -297,6 +309,9 @@ typedef struct MOVContext {
 int32_t movie_display_matrix[3][3]; ///< display matrix from mvhd
 int have_read_mfra_size;
 uint32_t mfra_size;
+// Event Messages from DASH specification, used in MISB ST 1910
+unsigned emsg_count;  ///< Number of event messages
+MOVEmsg *emsg_data; ///< Array of Event Messages
 } MOVContext;
 
 int ff_mp4_read_descr_len(AVIOContext *pb);
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 7805330bf9..22bf0b36ea 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5318,6 +5318,66 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 return 0;
 }
 
+static int mov_read_emsg(MOVContext *c, AVIOContext *pb, MOVAtom atom)
+{
+int err;
+uint32_t bytes_read_from_atom = 0;
+size_t num_bytes_in_last_read;
+MOVEmsg *emsg;
+
+if ((uint64_t)c->emsg_count+1 >= UINT_MAX / sizeof(*c->emsg_data))
+return AVERROR_INVALIDDATA;
+if ((err = av_reallocp_array(>emsg_data, c->emsg_count + 1,
+ sizeof(*c->emsg_data))) < 0) {
+c->emsg_count = 0;
+return err;
+}
+emsg = >emsg_data[c->emsg_count++];
+
+emsg->version = avio_r8(pb);
+bytes_read_from_atom += 1;
+avio_rb24(pb); /* flags */
+bytes_read_from_atom += 3;
+if (emsg->version == 0) {
+emsg->scheme_id_uri = av_malloc(atom.size + 1);
+num_bytes_in_last_read = avio_get_str(pb, atom.size, 
emsg->scheme_id_uri, pb->buffer_size + 1);
+bytes_read_from_atom += num_bytes_in_last_read;
+av_realloc(emsg->scheme_id_uri, num_bytes_in_last_read);
+emsg->value = av_malloc(atom.size + 1);
+num_bytes_in_last_read = avio_get_str(pb, atom.size, emsg->value, 
pb->buffer_size + 1);
+bytes_read_from_atom += num_bytes_in_last_read;
+av_realloc(emsg->value, num_bytes_in_last_read);
+emsg->timescale = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->presentation_time_delta = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->event_duration = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->id = avio_rb32(pb);
+bytes_read_from_atom += 4;
+} else if (emsg->version == 1) {
+emsg->timescale = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->presentation_time = avio_rb64(pb);
+bytes_read_from_atom += 8;
+emsg->event_duration = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->id = avio_rb32(pb);
+bytes_read_from_atom += 4;
+emsg->scheme_id_uri = av_malloc(atom.size + 1);
+num_bytes_in_last_read = avio_get_str(pb, atom.size, 
emsg->scheme_id_uri, pb->buffer_size + 1);
+bytes_read_from_atom += num_bytes_in_last_read;
+av_realloc(emsg->scheme_id_uri, num_bytes_in_last_read);
+emsg->value = av_malloc(atom.size + 1);
+num_bytes_in_last_read = avio_get_str(pb, atom.size, emsg->value, 
pb->buffer_size + 1);
+bytes_read_from_atom += num_bytes_in_last_read;
+av_realloc(emsg->value, num_bytes_in_last_read);
+}
+emsg->message_data = av_malloc(atom.size - bytes_read_from_atom);
+num_bytes_in_last_read = avio_read(pb, emsg->message_data, atom.size - 
bytes_read_from_atom);
+return 0;
+}
+
 static int mov_read_tmcd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
 {
 MOVStreamContext *sc;
@@ -6895,6 +6955,7 @@ static const MOVParseTableEntry mov_default_parse_table[] 
= {
 { MKTAG('d','r','e','f'), mov_read_dref },
 { MKTAG('e','d','t','s'), mov_read_default },
 { MKTAG('e','l','s','t'), mov_read_elst },
+{ MKTAG('e','m','s','g'), mov_read_emsg },
 { MKTAG('e','n','d','a'), mov_read_enda },
 { MKTAG('f','i','e','l'), mov_read_fiel },
 { MKTAG('a','d','r','m'), mov_read_adrm },
-- 
2.27.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org

Re: [FFmpeg-devel] [PATCH] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-19 Thread James Almer

On 4/19/2021 9:15 PM, Derek Buitenhuis wrote:

On 16/04/2021 23:10, Brad Smith wrote:

ping.


I found this in my spam folder, so it's possible others using GMail had the 
same issue.


Yes, same for me. All of Brad emails are sent to my spam folder.



- Derek



On 4/3/2021 2:49 PM, Brad Smith wrote:

avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

Signed-off-by: Brad Smith 
---
   libavutil/cpu.c | 6 ++
   1 file changed, 6 insertions(+)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 8e3576a1f3..9d249737df 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -291,6 +291,12 @@ int av_cpu_count(void)
   DWORD_PTR proc_aff, sys_aff;
   if (GetProcessAffinityMask(GetCurrentProcess(), _aff, _aff))
   nb_cpus = av_popcount64(proc_aff);
+#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
+int mib[2] = { CTL_HW, HW_NCPUONLINE };
+size_t len = sizeof(nb_cpus);
+
+if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
+nb_cpus = 0;
   #elif HAVE_SYSCTL && defined(HW_NCPU)
   int mib[2] = { CTL_HW, HW_NCPU };
   size_t len = sizeof(nb_cpus);

___
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] avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD

2021-04-19 Thread Derek Buitenhuis
On 16/04/2021 23:10, Brad Smith wrote:
> ping.

I found this in my spam folder, so it's possible others using GMail had the 
same issue.

- Derek

> 
> On 4/3/2021 2:49 PM, Brad Smith wrote:
>> avutil/cpu: Use HW_NCPUONLINE to detect # of online CPUs with OpenBSD
>>
>> Signed-off-by: Brad Smith 
>> ---
>>   libavutil/cpu.c | 6 ++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/libavutil/cpu.c b/libavutil/cpu.c
>> index 8e3576a1f3..9d249737df 100644
>> --- a/libavutil/cpu.c
>> +++ b/libavutil/cpu.c
>> @@ -291,6 +291,12 @@ int av_cpu_count(void)
>>   DWORD_PTR proc_aff, sys_aff;
>>   if (GetProcessAffinityMask(GetCurrentProcess(), _aff, _aff))
>>   nb_cpus = av_popcount64(proc_aff);
>> +#elif HAVE_SYSCTL && defined(HW_NCPUONLINE)
>> +int mib[2] = { CTL_HW, HW_NCPUONLINE };
>> +size_t len = sizeof(nb_cpus);
>> +
>> +if (sysctl(mib, 2, _cpus, , NULL, 0) == -1)
>> +nb_cpus = 0;
>>   #elif HAVE_SYSCTL && defined(HW_NCPU)
>>   int mib[2] = { CTL_HW, HW_NCPU };
>>   size_t len = sizeof(nb_cpus);
> ___
> 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 v2 67/90] avutil: Switch crypto APIs to size_t

2021-04-19 Thread Andreas Rheinhardt
On Mon, Apr 19, 2021 at 10:33 PM Carl Eugen Hoyos 
wrote:

> Am Mo., 19. Apr. 2021 um 21:22 Uhr schrieb Andreas Rheinhardt
> :
> >
> > From: Andreas Rheinhardt 
> >
> > Announced in e435beb1ea5380a90774dbf51fdc8c941e486551.
> >
> > Signed-off-by: Andreas Rheinhardt 
> > ---
> > I forgot a printf specifier in tests/api/api-h264-test.c.
>
> > diff --git a/libavutil/version.h b/libavutil/version.h
> > index dbeb7ffe23..54b09534a2 100644
> > --- a/libavutil/version.h
> > +++ b/libavutil/version.h
> > @@ -105,9 +105,6 @@
> >   * @{
> >   */
> >
> > -#ifndef FF_API_CRYPTO_SIZE_T
> > -#define FF_API_CRYPTO_SIZE_T(LIBAVUTIL_VERSION_MAJOR < 57)
> > -#endif
> >  #ifndef FF_API_FRAME_GET_SET
> >  #define FF_API_FRAME_GET_SET(LIBAVUTIL_VERSION_MAJOR < 57)
> >  #endif
> > diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c
> > index 04bdfbc9d2..6f13e773f9 100644
> > --- a/tests/api/api-h264-test.c
> > +++ b/tests/api/api-h264-test.c
> > @@ -153,7 +153,7 @@ static int video_decode_example(const char
> *input_filename)
> >  av_frame_unref(fr);
> >  return number_of_written_bytes;
> >  }
>
> > -printf("%d, %s, %s, %8"PRId64", %8d, 0x%08lx\n",
> video_stream,
> > +printf("%d, %s, %s, %8"PRId64", %8d, 0x%08"PRIx32"\n",
> video_stream,
> > av_ts2str(fr->pts), av_ts2str(fr->pkt_dts),
> fr->pkt_duration,
> > number_of_written_bytes, av_adler32_update(0, (const
> uint8_t*)byte_buffer, number_of_written_bytes));
>
> Afaict, this change is either related to another patch or wrong.
>

For most hash APIs the size parameter has been switched to size_t;
for av_adler32_update(), the return value has been switched as well:
>From unsigned long to uint32_t. Therefore this printf specifier had to
be updated as well.
(Adler-32 checksums are 32bit, so uint32_t is the natural type for them.)

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

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


Re: [FFmpeg-devel] [PATCH 11/11] lavu/x86: add FFT assembly

2021-04-19 Thread Lynne
Apr 19, 2021, 22:27 by d...@lynne.ee:

> This commit adds a pure x86 assembly SIMD version of the FFT in libavutil/tx. 
> The design of this pure assembly FFT is pretty unconventional.
>

Oh, I forgot to mention _why_ on the majority of transforms it's slower than 
FFTW.
It's simple - we don't hardcode anything. In fact, the biggest bottleneck by 
far is
the lookup done during loading of input data. Easily more than 40% of the entire
time is spent just doing lookups.
FFTW hardcodes the addresses in the transforms themselves (they call them
codelets). And in the process duplicate herculean amounts of code, amplified by
their just-as-inefficient Split-Radix refactoring which needs 4 versions of 
each codelet.
The 5+MB stripped binary can't get fat by itself, after all.
Also FFTW only supports a single extension (e.g. fma, avx, avx2) at once during
compile time, so that size figure looks even worse.

For an in-place pre-permuted transform where all the lookups are gone and 
replaced
with simple loads, we're actually consistently faster than FFTW. Thus, once
non-power-of-two transforms are implemented (where this situation happens),
we'll be faster than FFTW by quite a margin. The old non-power-of-two FFT
code is faster than FFTW by a bit, and this code's C version is quite a bit 
faster
than that code's C version.
I'd have implemented this as well before I sent the patch, but there are only 
so many
hours in a day, and ways to ignore the outside world, and the 5.0 release 
demands
my urgent attention, so I'll write the non-power-of-two part up when I feel 
like it in
hopefully a week or two.

An easy way to gauge optimization is the perf graph:
 39.58%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.32pt
 21.17%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.64pt
   8.21%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_deinterleave
   3.90%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_32768
   3.15%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_8192
   3.08%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_16384
   3.00%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_65536
   2.97%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_512
   2.96%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_4096
   2.96%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_2048
   2.95%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.256pt
   2.91%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.128pt
   2.89%  a.out    a.out  [.] 
ff_split_radix_fft_float_fma3.synth_1024
   0.04%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.512pt
   0.01%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.1024pt
   0.01%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.4096pt
   0.01%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.2048pt
   0.00%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.131072pt
   0.00%  a.out    a.out  [.] ff_split_radix_fft_float_fma3.8192pt

Only the 32-point and 64-point transforms read data from the input,
and that's where 60% of the overhead is.

A fast vgatherdpd will go a long way to speed this up, as well as
AVX512. This code should be quite a bit faster on Ice Lake and Tiger Lake
systems, where vgatherdpd was significantly improved over Skylake.
Maybe someone can run checkasm on one of those systems.
___
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 67/90] avutil: Switch crypto APIs to size_t

2021-04-19 Thread James Almer

On 4/19/2021 5:10 PM, Carl Eugen Hoyos wrote:

Am Mo., 19. Apr. 2021 um 21:22 Uhr schrieb Andreas Rheinhardt
:


From: Andreas Rheinhardt 

Announced in e435beb1ea5380a90774dbf51fdc8c941e486551.

Signed-off-by: Andreas Rheinhardt 
---
I forgot a printf specifier in tests/api/api-h264-test.c.



diff --git a/libavutil/version.h b/libavutil/version.h
index dbeb7ffe23..54b09534a2 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,9 +105,6 @@
   * @{
   */

-#ifndef FF_API_CRYPTO_SIZE_T
-#define FF_API_CRYPTO_SIZE_T(LIBAVUTIL_VERSION_MAJOR < 57)
-#endif
  #ifndef FF_API_FRAME_GET_SET
  #define FF_API_FRAME_GET_SET(LIBAVUTIL_VERSION_MAJOR < 57)
  #endif
diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c
index 04bdfbc9d2..6f13e773f9 100644
--- a/tests/api/api-h264-test.c
+++ b/tests/api/api-h264-test.c
@@ -153,7 +153,7 @@ static int video_decode_example(const char *input_filename)
  av_frame_unref(fr);
  return number_of_written_bytes;
  }



-printf("%d, %s, %s, %8"PRId64", %8d, 0x%08lx\n", video_stream,
+printf("%d, %s, %s, %8"PRId64", %8d, 0x%08"PRIx32"\n", 
video_stream,
 av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), 
fr->pkt_duration,
 number_of_written_bytes, av_adler32_update(0, (const 
uint8_t*)byte_buffer, number_of_written_bytes));


Afaict, this change is either related to another patch or wrong.


The patch changes av_adler32_update() from returning an unsigned long to 
returning an uint32_t, and this chunk here updates the printf specifier 
required for it.




Carl Eugen
___
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 1/1] avformat/mpegtsenc: Write necessary descriptors into PMT for arib_caption muxing

2021-04-19 Thread Jan Ekström
On Tue, Apr 20, 2021 at 12:11 AM Marton Balint  wrote:
>
>
>
> On Mon, 19 Apr 2021, zheng qian wrote:
>
> > Is there anyone who could review this patch?
>
> Jan was interested in this, so preferably he should also comment, but it
> looks fine to me.
>

OK, this explains why I didn't see my response on patchwork.
Apparently he had CC'd me and thus the "reply" button in gmail sent an
e-mail directly to him and I was hurrying due to being on a lunch
break -_- (and thus didn't notice).

In any case, I did some comments and am now waiting for a second
opinion regarding the usage of stream_identifiers in the ARIB context.
After all, the specifications do let one utilize 0x30-0x37 for profile
A/full-seg ARIB captions, so there must be a reason for them to not be
as limited as profile C/1seg to a single identifier :)

Jan
___
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/1] avformat/mpegtsenc: Write necessary descriptors into PMT for arib_caption muxing

2021-04-19 Thread Marton Balint




On Mon, 19 Apr 2021, zheng qian wrote:


Is there anyone who could review this patch?


Jan was interested in this, so preferably he should also comment, but it 
looks fine to me.


Thanks,
Marton
___
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/mpegtsenc: Fix mpegts_write_pes() for private_stream_2 and other types

2021-04-19 Thread Marton Balint




On Tue, 20 Apr 2021, zheng qian wrote:


According to the PES packet definition defined in Table 2-17
of ISO_IEC_13818-1 specification, some fields like PTS/DTS or
pes_extension could only appears if the stream_id meets the
condition:

if (stream_id != 0xBC &&  // program_stream_map
stream_id != 0xBE &&  // padding_stream
stream_id != 0xBF &&  // private_stream_2
stream_id != 0xF0 &&  // ECM
stream_id != 0xF1 &&  // EMM
stream_id != 0xFF &&  // program_stream_directory
stream_id != 0xF2 &&  // DSMCC_stream
stream_id != 0xF8) // ITU-T Rec. H.222.1 type E stream

And the following stream_id types don't have fields like PTS/DTS:

else if ( stream_id == program_stream_map
|| stream_id == private_stream_2
|| stream_id == ECM
|| stream_id == EMM
|| stream_id == program_stream_directory
|| stream_id == DSMCC_stream
|| stream_id == ITU-T Rec. H.222.1 type E stream ) {
   for (i = 0; i < PES_packet_length; i++) {
   PES_packet_data_byte
   }
}

Current implementation skipped the judgement of stream_id
causing some kind of stream like private_stream_2 to be
incorrectly written with PTS/DTS field. For example,
Japan DTV transmits news and alerts through ARIB superimpose
that utilizes private_stream_2 still could not be remuxed
correctly for now.

This patch fixes the remuxing of private_stream_2 and other
stream_id types.

Signed-off-by: zheng qian 
---
libavformat/mpegtsenc.c | 108 ++--
1 file changed, 60 insertions(+), 48 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index f302af84ff..da8fb381e5 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1445,28 +1445,28 @@ static void mpegts_write_pes(AVFormatContext *s, 
AVStream *st,
is_dvb_teletext = 0;
if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
if (st->codecpar->codec_id == AV_CODEC_ID_DIRAC)
-*q++ = STREAM_ID_EXTENDED_STREAM_ID;
+stream_id = STREAM_ID_EXTENDED_STREAM_ID;
else
-*q++ = STREAM_ID_VIDEO_STREAM_0;
+stream_id = STREAM_ID_VIDEO_STREAM_0;
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
   (st->codecpar->codec_id == AV_CODEC_ID_MP2 ||
st->codecpar->codec_id == AV_CODEC_ID_MP3 ||
st->codecpar->codec_id == AV_CODEC_ID_AAC)) {
-*q++ = STREAM_ID_AUDIO_STREAM_0;
+stream_id = STREAM_ID_AUDIO_STREAM_0;
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
st->codecpar->codec_id == AV_CODEC_ID_AC3 &&
ts->m2ts_mode) {
-*q++ = STREAM_ID_EXTENDED_STREAM_ID;
+stream_id = STREAM_ID_EXTENDED_STREAM_ID;
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA &&
   st->codecpar->codec_id == AV_CODEC_ID_TIMED_ID3) {
-*q++ = STREAM_ID_PRIVATE_STREAM_1;
+stream_id = STREAM_ID_PRIVATE_STREAM_1;
} else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
-*q++ = stream_id != -1 ? stream_id : STREAM_ID_METADATA_STREAM;
+stream_id = stream_id != -1 ? stream_id : 
STREAM_ID_METADATA_STREAM;

if (stream_id == STREAM_ID_PRIVATE_STREAM_1) /* asynchronous 
KLV */
pts = dts = AV_NOPTS_VALUE;
} else {
-*q++ = STREAM_ID_PRIVATE_STREAM_1;
+stream_id = STREAM_ID_PRIVATE_STREAM_1;
if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) {
if (st->codecpar->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
is_dvb_subtitle = 1;
@@ -1475,6 +1475,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream 
*st,
}
}
}
+*q++ = stream_id;


This is a purley cosmetic change so far, so it should be a separate patch 
from the functional change.



header_len = 0;
flags  = 0;
if (pts != AV_NOPTS_VALUE) {
@@ -1524,50 +1525,61 @@ static void mpegts_write_pes(AVFormatContext *s, 
AVStream *st,
}
*q++ = len >> 8;
*q++ = len;
-val  = 0x80;
-/* data alignment indicator is required for subtitle and data 
streams */
-if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE || 
st->codecpar->codec_type == AVMEDIA_TYPE_DATA)
-val |= 0x04;
-*q++ = val;
-*q++ = flags;
-*q++ = header_len;
-if (pts != AV_NOPTS_VALUE) {
-write_pts(q, flags >> 6, pts);
-q += 5;
-}
-if (dts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE && dts != pts) {
-write_pts(q, 1, dts);
-q += 5;
-}
-if (pes_extension 

Re: [FFmpeg-devel] [PATCH v2 67/90] avutil: Switch crypto APIs to size_t

2021-04-19 Thread Carl Eugen Hoyos
Am Mo., 19. Apr. 2021 um 21:22 Uhr schrieb Andreas Rheinhardt
:
>
> From: Andreas Rheinhardt 
>
> Announced in e435beb1ea5380a90774dbf51fdc8c941e486551.
>
> Signed-off-by: Andreas Rheinhardt 
> ---
> I forgot a printf specifier in tests/api/api-h264-test.c.

> diff --git a/libavutil/version.h b/libavutil/version.h
> index dbeb7ffe23..54b09534a2 100644
> --- a/libavutil/version.h
> +++ b/libavutil/version.h
> @@ -105,9 +105,6 @@
>   * @{
>   */
>
> -#ifndef FF_API_CRYPTO_SIZE_T
> -#define FF_API_CRYPTO_SIZE_T(LIBAVUTIL_VERSION_MAJOR < 57)
> -#endif
>  #ifndef FF_API_FRAME_GET_SET
>  #define FF_API_FRAME_GET_SET(LIBAVUTIL_VERSION_MAJOR < 57)
>  #endif
> diff --git a/tests/api/api-h264-test.c b/tests/api/api-h264-test.c
> index 04bdfbc9d2..6f13e773f9 100644
> --- a/tests/api/api-h264-test.c
> +++ b/tests/api/api-h264-test.c
> @@ -153,7 +153,7 @@ static int video_decode_example(const char 
> *input_filename)
>  av_frame_unref(fr);
>  return number_of_written_bytes;
>  }

> -printf("%d, %s, %s, %8"PRId64", %8d, 0x%08lx\n", video_stream,
> +printf("%d, %s, %s, %8"PRId64", %8d, 0x%08"PRIx32"\n", 
> video_stream,
> av_ts2str(fr->pts), av_ts2str(fr->pkt_dts), 
> fr->pkt_duration,
> number_of_written_bytes, av_adler32_update(0, (const 
> uint8_t*)byte_buffer, number_of_written_bytes));

Afaict, this change is either related to another patch or wrong.

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

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


[FFmpeg-devel] [PATCH 11/11] lavu/x86: add FFT assembly

2021-04-19 Thread Lynne
This commit adds a pure x86 assembly SIMD version of the FFT in libavutil/tx. 
The design of this pure assembly FFT is pretty unconventional.

On the lowest level, instead of splitting the complex numbers into
real and imaginary parts, we keep complex numbers together but split
them in terms of parity. This saves a number of shuffles in each transform,
but more importantly, it splits each transform into two independent
paths, which we process using separate registers in parallel.
This allows us to keep all units saturated and lets us use all available
registers to avoid dependencies.
Moreover, it allows us to double the granularity of our per-load permutation,
skipping many expensive lookups and allowing us to use just 4 loads per 
register,
rather than 8, or in case FMA3 (and by extension, AVX2), use the vgatherdpd
instruction, which is at least as fast as 4 separate loads on old hardware,
and quite a bit faster on modern CPUs).

Higher up, we go for a bottom-up construction of large transforms, foregoing
the traditional per-transform call-return recursion chains. Instead, we always
start at the bottom-most basis transform (in this case, a 32-point transform),
and continue constructing larger and larger transforms until we return to the
top-most transform.
This way, we only touch the stack 3 times per a complete target transform:
once for the 1/2 length transform and two times for the 1/4 length transform.

The combination algorithm we use is a standard Split-Radix algorithm,
as used in our C code. Although a version with less operations exists
(Steven G. Johnson and Matteo Frigo's "A modified split-radix FFT with fewer
arithmetic operations", IEEE Trans. Signal Process. 55 (1), 111–119 (2007),
which is the one FFTW uses), it only has 2% less operations and requires at 
least 4x
the binary code (due to it needing 4 different paths to do a single transform).
That version also has other issues which prevent it from being implemented
with SIMD code as efficiently, which makes it lose the marginal gains it 
offered,
and cannot be performed bottom-up, requiring many recursive call-return chains,
whose overhead adds up.

We go through a lot of effort to minimize load/stores by keeping as much in
registers in between construcring transforms. This saves us around 32 cycles,
on paper, but in reality a lot more due to load/store aliasing (a load from a
memory location cannot be issued while there's a store pending, and there are
only so many (2 for Zen 3) load/store units in a CPU).
Also, we interleave coefficients during the last stage to save on a store+load
per register.

Each of the smallest, basis transforms (4, 8 and 16-point in our case)
has been extremely optimized. Our 8-point transform is barely 20 instructions
in total, beating our old implementation 8-point transform by 1 instruction.
Our 2x8-point transform is 23 instructions, beating our old implementation by
6 instruction and needing 50% less cycles. Our 16-point transform's combination
code takes slightly more instructions than our old implementation, but makes up
for it by requiring a lot less arithmetic operations.

Overall, the transform was optimized for the timings of Zen 3, which at the
time of writing has the most IPC from all documented CPUs. Shuffles were
preferred over arithmetic operations due to their 1/0.5 latency/throughput.

On average, this code is 30% faster than our old libavcodec implementation.
It's able to trade blows with the previously-untouchable FFTW on small 
transforms,
and due to its tiny size and better prediction, outdoes FFTW on larger 
transforms
by 11% on the largest currently supported size.

Full benchmark available here: 
https://files.lynne.ee/fft_benchmark_i7-6700HQ.txt

Patch attached.

>From 6810e483e9273751578c730e3a7d408bf2117dd9 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 03:54:22 +0200
Subject: [PATCH 11/11] lavu/x86: add FFT assembly
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This commit adds a pure x86 assembly SIMD version of the FFT in libavutil/tx.
The design of this pure assembly FFT is pretty unconventional.

On the lowest level, instead of splitting the complex numbers into
real and imaginary parts, we keep complex numbers together but split
them in terms of parity. This saves a number of shuffles in each transform,
but more importantly, it splits each transform into two independent
paths, which we process using separate registers in parallel.
This allows us to keep all units saturated and lets us use all available
registers to avoid dependencies.
Moreover, it allows us to double the granularity of our per-load permutation,
skipping many expensive lookups and allowing us to use just 4 loads per register,
rather than 8, or in case FMA3 (and by extension, AVX2), use the vgatherdpd
instruction, which is at least as fast as 4 separate loads on old hardware,
and quite a bit faster on modern CPUs).

Higher up, we go for a bottom-up 

[FFmpeg-devel] [PATCH 10/11] doc/transforms: add documentation for the FFT transforms

2021-04-19 Thread Lynne
Makes the code far easier to follow, and makes creating new SIMD 
for the transforms far, far easier.
Patch attached.

>From 86892c2aaade9e676119c56af0a1ef262d432467 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 17 Apr 2021 17:35:14 +0200
Subject: [PATCH 10/11] doc/transforms: add documentation for the FFT
 transforms

Makes the code far easier to follow, and makes creating new SIMD
for the transforms far, far easier.
---
 doc/transforms.md | 706 ++
 1 file changed, 706 insertions(+)
 create mode 100644 doc/transforms.md

diff --git a/doc/transforms.md b/doc/transforms.md
new file mode 100644
index 00..78f3f68d65
--- /dev/null
+++ b/doc/transforms.md
@@ -0,0 +1,706 @@
+The basis transforms used for FFT and various other derived functions are based
+on the following unrollings.
+The functions can be easily adapted to double precision floats as well.
+
+# Parity permutation
+The basis transforms described here all use the following permutation:
+
+``` C
+void ff_tx_gen_split_radix_parity_revtab(int *revtab, int len, int inv,
+ int basis, int dual_stride);
+```
+Parity means even and odd complex numbers will be split, e.g. the even
+coefficients will come first, after which the odd coefficients will be
+placed. For example, a 4-point transform's coefficients after reordering:
+`z[0].re, z[0].im, z[2].re, z[2].im, z[1].re, z[1].im, z[3].re, z[3].im`
+
+The basis argument is the length of the largest non-composite transform
+supported, and also implies that the basis/2 transform is supported as well,
+as the split-radix algorithm requires it to be.
+
+The dual_stride argument indicates that both the basis, as well as the
+basis/2 transforms support doing two transforms at once, and the coefficients
+will be interleaved between each pair in a split-radix like so (stride == 2):
+`tx1[0], tx1[2], tx2[0], tx2[2], tx1[1], tx1[3], tx2[1], tx2[3]`
+A non-zero number switches this on, with the value indicating the stride
+(how many values of 1 transform to put first before switching to the other).
+Must be a power of two or 0. Must be less than the basis.
+Value will be clipped to the transform size, so for a basis of 16 and a
+dual_stride of 8, dual 8-point transforms will be laid out as if dual_stride
+was set to 4.
+Usually you'll set this to half the complex numbers that fit in a single
+register or 0. This allows to reuse SSE functions as dual-transform
+functions in AVX mode.
+If length is smaller than basis/2 this function will not do anything.
+
+# 4-point FFT transform
+The only permutation this transform needs is to swap the `z[1]` and `z[2]`
+elements when performing an inverse transform, which in the assembly code is
+hardcoded with the function itself being templated and duplicated for each
+direction.
+
+``` C
+static void fft4(FFTComplex *z)
+{
+FFTSample r1 = z[0].re - z[2].re;
+FFTSample r2 = z[0].im - z[2].im;
+FFTSample r3 = z[1].re - z[3].re;
+FFTSample r4 = z[1].im - z[3].im;
+/* r5-r8 second transform */
+
+FFTSample t1 = z[0].re + z[2].re;
+FFTSample t2 = z[0].im + z[2].im;
+FFTSample t3 = z[1].re + z[3].re;
+FFTSample t4 = z[1].im + z[3].im;
+/* t5-t8 second transform */
+
+/* 1sub + 1add = 2 instructions */
+
+/* 2 shufs */
+FFTSample a3 = t1 - t3;
+FFTSample a4 = t2 - t4;
+FFTSample b3 = r1 - r4;
+FFTSample b2 = r2 - r3;
+
+FFTSample a1 = t1 + t3;
+FFTSample a2 = t2 + t4;
+FFTSample b1 = r1 + r4;
+FFTSample b4 = r2 + r3;
+/* 1 add 1 sub 3 shufs */
+
+z[0].re = a1;
+z[0].im = a2;
+z[2].re = a3;
+z[2].im = a4;
+
+z[1].re = b1;
+z[1].im = b2;
+z[3].re = b3;
+z[3].im = b4;
+}
+```
+
+# 8-point AVX FFT transform
+Input must be pre-permuted using the parity lookup table, generated via
+`ff_tx_gen_split_radix_parity_revtab`.
+
+``` C
+static void fft8(FFTComplex *z)
+{
+FFTSample r1 = z[0].re - z[4].re;
+FFTSample r2 = z[0].im - z[4].im;
+FFTSample r3 = z[1].re - z[5].re;
+FFTSample r4 = z[1].im - z[5].im;
+
+FFTSample r5 = z[2].re - z[6].re;
+FFTSample r6 = z[2].im - z[6].im;
+FFTSample r7 = z[3].re - z[7].re;
+FFTSample r8 = z[3].im - z[7].im;
+
+FFTSample q1 = z[0].re + z[4].re;
+FFTSample q2 = z[0].im + z[4].im;
+FFTSample q3 = z[1].re + z[5].re;
+FFTSample q4 = z[1].im + z[5].im;
+
+FFTSample q5 = z[2].re + z[6].re;
+FFTSample q6 = z[2].im + z[6].im;
+FFTSample q7 = z[3].re + z[7].re;
+FFTSample q8 = z[3].im + z[7].im;
+
+FFTSample s3 = q1 - q3;
+FFTSample s1 = q1 + q3;
+FFTSample s4 = q2 - q4;
+FFTSample s2 = q2 + q4;
+
+FFTSample s7 = q5 - q7;
+FFTSample s5 = q5 + q7;
+FFTSample s8 = q6 - q8;
+FFTSample s6 = q6 + q8;
+
+FFTSample e1 = s1 * -1;
+FFTSample e2 = s2 * -1;
+FFTSample e3 = s3 * -1;
+FFTSample e4 = s4 * -1;
+
+FFTSample e5 = s5 *  1;
+FFTSample e6 = s6 *  1;

[FFmpeg-devel] [PATCH 09/11] checkasm: add av_tx FFT SIMD testing code

2021-04-19 Thread Lynne
This sadly required making changes to the code itself, 
due to the same context needing to be reused for both versions.
The lookup table had to be duplicated for both versions.

Patch attached.

>From 9b0998b5f41e198c6ab8faeb47ccc35d835963de Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 03:53:38 +0200
Subject: [PATCH 09/11] checkasm: add av_tx FFT SIMD testing code

This sadly required making changes to the code itself,
due to the same context needing to be reused for both versions.
The lookup table had to be duplicated for both versions.
---
 libavutil/tx.c|  15 +++---
 libavutil/tx_priv.h   |   5 +-
 libavutil/tx_template.c   |  18 +++
 tests/checkasm/Makefile   |   1 +
 tests/checkasm/av_tx.c| 109 ++
 tests/checkasm/checkasm.c |   1 +
 tests/checkasm/checkasm.h |   1 +
 tests/fate/checkasm.mak   |   1 +
 8 files changed, 135 insertions(+), 16 deletions(-)
 create mode 100644 tests/checkasm/av_tx.c

diff --git a/libavutil/tx.c b/libavutil/tx.c
index 6d0e854084..dcfb257899 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -106,22 +106,24 @@ int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup)
 {
 const int m = s->m, inv = s->inv;
 
-if (!(s->revtab = av_malloc(m*sizeof(*s->revtab
+if (!(s->revtab = av_malloc(s->m*sizeof(*s->revtab
+return AVERROR(ENOMEM);
+if (!(s->revtab_c = av_malloc(m*sizeof(*s->revtab_c
 return AVERROR(ENOMEM);
 
 /* Default */
 for (int i = 0; i < m; i++) {
 int k = -split_radix_permutation(i, m, inv) & (m - 1);
 if (invert_lookup)
-s->revtab[i] = k;
+s->revtab[i] = s->revtab_c[i] = k;
 else
-s->revtab[k] = i;
+s->revtab[i] = s->revtab_c[k] = i;
 }
 
 return 0;
 }
 
-int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
+int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s, int *revtab)
 {
 int nb_inplace_idx = 0;
 
@@ -130,7 +132,7 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
 
 /* The first coefficient is always already in-place */
 for (int src = 1; src < s->m; src++) {
-int dst = s->revtab[src];
+int dst = revtab[src];
 int found = 0;
 
 if (dst <= src)
@@ -146,7 +148,7 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
 break;
 }
 }
-dst = s->revtab[dst];
+dst = revtab[dst];
 } while (dst != src && !found);
 
 if (!found)
@@ -215,6 +217,7 @@ av_cold void av_tx_uninit(AVTXContext **ctx)
 av_free((*ctx)->pfatab);
 av_free((*ctx)->exptab);
 av_free((*ctx)->revtab);
+av_free((*ctx)->revtab_c);
 av_free((*ctx)->inplace_idx);
 av_free((*ctx)->tmp);
 
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index b889f6d3b4..88589fcbb4 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -122,6 +122,9 @@ struct AVTXContext {
 int*revtab; /* Input mapping for power of two transforms */
 int   *inplace_idx; /* Required indices to revtab for in-place transforms */
 
+int  *revtab_c; /* Revtab for only the C transforms, needed because
+ * checkasm makes us reuse the same context. */
+
 av_tx_fntop_tx; /* Used for computing transforms derived from other
  * transforms, like full-length iMDCTs and RDFTs.
  * NOTE: Do NOT use this to mix assembly with C code. */
@@ -147,7 +150,7 @@ int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup);
  * specific order,  allows the revtab to be done in-place. AVTXContext->revtab
  * must already exist.
  */
-int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s);
+int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s, int *revtab);
 
 /*
  * This generates a parity-based revtab of length len and direction inv.
diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index a68a84dcd5..cad66a8bc0 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -593,7 +593,7 @@ static void compound_fft_##N##xM(AVTXContext *s, void *_out,   \
 for (int i = 0; i < m; i++) {  \
 for (int j = 0; j < N; j++)\
 fft##N##in[j] = in[in_map[i*N + j]];   \
-fft##N(s->tmp + s->revtab[i], fft##N##in, m);  \
+fft##N(s->tmp + s->revtab_c[i], fft##N##in, m);\
 }  \
\
 for (int i = 0; i < N; i++)\
@@ -624,16 +624,16 @@ static void split_radix_fft(AVTXContext *s, void *_out, void *_in,
 
 do {
 tmp = out[src];
-dst = 

[FFmpeg-devel] [PATCH 08/11] lavu/tx: add parity revtab generator version

2021-04-19 Thread Lynne
This will be used for SIMD support.
Patch attached.

>From 464afa089d4a7bc91564e180b9958d85225d59b6 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 03:52:31 +0200
Subject: [PATCH 08/11] lavu/tx: add parity revtab generator version

This will be used for SIMD support.
---
 libavutil/tx.c  | 49 +
 libavutil/tx_priv.h | 31 
 2 files changed, 80 insertions(+)

diff --git a/libavutil/tx.c b/libavutil/tx.c
index 05d4de30cc..6d0e854084 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -158,6 +158,55 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
 return 0;
 }
 
+static void parity_revtab_generator(int *revtab, int n, int inv, int offset,
+int is_dual, int dual_high, int len,
+int basis, int dual_stride)
+{
+len >>= 1;
+
+if (len <= basis) {
+int k1, k2, *even, *odd, stride;
+
+is_dual = is_dual && dual_stride;
+dual_high = is_dual & dual_high;
+stride = is_dual ? FFMIN(dual_stride, len) : 0;
+
+even = [offset + dual_high*(stride - 2*len)];
+odd  = [len + (is_dual && !dual_high)*len + dual_high*len];
+
+for (int i = 0; i < len; i++) {
+k1 = -split_radix_permutation(offset + i*2 + 0, n, inv) & (n - 1);
+k2 = -split_radix_permutation(offset + i*2 + 1, n, inv) & (n - 1);
+*even++ = k1;
+*odd++  = k2;
+if (stride && !((i + 1) % stride)) {
+even += stride;
+odd  += stride;
+}
+}
+
+return;
+}
+
+parity_revtab_generator(revtab, n, inv, offset,
+0, 0, len >> 0, basis, dual_stride);
+parity_revtab_generator(revtab, n, inv, offset + (len >> 0),
+1, 0, len >> 1, basis, dual_stride);
+parity_revtab_generator(revtab, n, inv, offset + (len >> 0) + (len >> 1),
+1, 1, len >> 1, basis, dual_stride);
+}
+
+void ff_tx_gen_split_radix_parity_revtab(int *revtab, int len, int inv,
+ int basis, int dual_stride)
+{
+basis >>= 1;
+if (len < basis)
+return;
+av_assert0(!dual_stride || !(dual_stride & (dual_stride - 1)));
+av_assert0(dual_stride <= basis);
+parity_revtab_generator(revtab, len, inv, 0, 0, 0, len, basis, dual_stride);
+}
+
 av_cold void av_tx_uninit(AVTXContext **ctx)
 {
 if (!(*ctx))
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index 1d4245e71b..b889f6d3b4 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -149,6 +149,37 @@ int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup);
  */
 int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s);
 
+/*
+ * This generates a parity-based revtab of length len and direction inv.
+ *
+ * Parity means even and odd complex numbers will be split, e.g. the even
+ * coefficients will come first, after which the odd coefficients will be
+ * placed. For example, a 4-point transform's coefficients after reordering:
+ * z[0].re, z[0].im, z[2].re, z[2].im, z[1].re, z[1].im, z[3].re, z[3].im
+ *
+ * The basis argument is the length of the largest non-composite transform
+ * supported, and also implies that the basis/2 transform is supported as well,
+ * as the split-radix algorithm requires it to be.
+ *
+ * The dual_stride argument indicates that both the basis, as well as the
+ * basis/2 transforms support doing two transforms at once, and the coefficients
+ * will be interleaved between each pair in a split-radix like so (stride == 2):
+ * tx1[0], tx1[2], tx2[0], tx2[2], tx1[1], tx1[3], tx2[1], tx2[3]
+ * A non-zero number switches this on, with the value indicating the stride
+ * (how many values of 1 transform to put first before switching to the other).
+ * Must be a power of two or 0. Must be less than the basis.
+ * Value will be clipped to the transform size, so for a basis of 16 and a
+ * dual_stride of 8, dual 8-point transforms will be laid out as if dual_stride
+ * was set to 4.
+ * Usually you'll set this to half the complex numbers that fit in a single
+ * register or 0. This allows to reuse SSE functions as dual-transform
+ * functions in AVX mode.
+ *
+ * If length is smaller than basis/2 this function will not do anything.
+ */
+void ff_tx_gen_split_radix_parity_revtab(int *revtab, int len, int inv,
+ int basis, int dual_stride);
+
 /* Templated init functions */
 int ff_tx_init_mdct_fft_float(AVTXContext *s, av_tx_fn *tx,
   enum AVTXType type, int inv, int len,
-- 
2.31.0.291.g576ba9dcdaf

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

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


[FFmpeg-devel] [PATCH 07/11] lavu: bump minor and add APIchanges entry for the lavu/tx changes

2021-04-19 Thread Lynne
Patch attached.

>From 2113ffcf0b39239caf3db260b63e20dc3631c64c Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Mon, 19 Apr 2021 22:15:34 +0200
Subject: [PATCH 07/11] lavu: bump minor and add APIchanges entry for the
 lavu/tx changes

---
 doc/APIchanges  | 3 +++
 libavutil/version.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index cd3ea3c865..095e9aed99 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -14,6 +14,9 @@ libavutil: 2017-10-21
 
 
 API changes, most recent first:
+2021-04-19 - xx - lavu 56.74.100 - tx.h
+  Add AV_TX_FULL_IMDCT and AV_TX_UNALIGNED.
+
 2021-04-17 - xx - lavu 56.73.100 - frame.h detection_bbox.h
   Add AV_FRAME_DATA_DETECTION_BBOXES
 
diff --git a/libavutil/version.h b/libavutil/version.h
index 658bcd402e..fb6700511b 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  56
-#define LIBAVUTIL_VERSION_MINOR  73
+#define LIBAVUTIL_VERSION_MINOR  74
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-- 
2.31.0.291.g576ba9dcdaf

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

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


[FFmpeg-devel] [PATCH 06/11] lavu/tx: add full-sized iMDCT transform flag

2021-04-19 Thread Lynne
Patch attached.

>From f2e601d703a552bd4d6800048cd16cb6daee1385 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 03:55:37 +0200
Subject: [PATCH 06/11] lavu/tx: add full-sized iMDCT transform flag

---
 libavutil/tx.h  | 11 ++-
 libavutil/tx_priv.h |  4 
 libavutil/tx_template.c | 29 -
 3 files changed, 42 insertions(+), 2 deletions(-)

diff --git a/libavutil/tx.h b/libavutil/tx.h
index a3d70644e4..55173810ee 100644
--- a/libavutil/tx.h
+++ b/libavutil/tx.h
@@ -55,7 +55,8 @@ enum AVTXType {
  * Stride must be a non-zero multiple of sizeof(float).
  *
  * NOTE: the inverse transform is half-length, meaning the output will not
- * contain redundant data. This is what most codecs work with.
+ * contain redundant data. This is what most codecs work with. To do a full
+ * inverse transform, set the AV_TX_FULL_IMDCT flag on init.
  */
 AV_TX_FLOAT_MDCT = 1,
 
@@ -116,6 +117,14 @@ enum AVTXFlags {
  * May be slower with certain transform types.
  */
 AV_TX_UNALIGNED = 1ULL << 1,
+
+/**
+ * Performs a full inverse MDCT rather than leaving out samples that can be
+ * derived through symmetry. Requires an output array of 'len' floats,
+ * rather than the usual 'len/2' floats.
+ * Ignored for all transforms but inverse MDCTs.
+ */
+AV_TX_FULL_IMDCT = 1ULL << 2,
 };
 
 /**
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index 0b40234355..1d4245e71b 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -121,6 +121,10 @@ struct AVTXContext {
 int*pfatab; /* Input/Output mapping for compound transforms */
 int*revtab; /* Input mapping for power of two transforms */
 int   *inplace_idx; /* Required indices to revtab for in-place transforms */
+
+av_tx_fntop_tx; /* Used for computing transforms derived from other
+ * transforms, like full-length iMDCTs and RDFTs.
+ * NOTE: Do NOT use this to mix assembly with C code. */
 };
 
 /* Checks if type is an MDCT */
diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index b3532c1c5e..a68a84dcd5 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -875,6 +875,24 @@ static void naive_mdct(AVTXContext *s, void *_dst, void *_src,
 }
 }
 
+static void full_imdct_wrapper_fn(AVTXContext *s, void *_dst, void *_src,
+  ptrdiff_t stride)
+{
+int len = s->m*s->n*4;
+int len2 = len >> 1;
+int len4 = len >> 2;
+FFTSample *dst = _dst;
+
+s->top_tx(s, dst + len4, _src, stride);
+
+stride /= sizeof(*dst);
+
+for (int i = 0; i < len4; i++) {
+dst[i*stride] = -dst[(len2 - i - 1)*stride];
+dst[(len - i - 1)*stride] =  dst[(len2 + i + 0)*stride];
+}
+}
+
 static int gen_mdct_exptab(AVTXContext *s, int len4, double scale)
 {
 const double theta = (scale < 0 ? len4 : 0) + 1.0/8.0;
@@ -942,6 +960,10 @@ int TX_NAME(ff_tx_init_mdct_fft)(AVTXContext *s, av_tx_fn *tx,
 if (is_mdct) {
 s->scale = *((SCALE_TYPE *)scale);
 *tx = inv ? naive_imdct : naive_mdct;
+if (inv && (flags & AV_TX_FULL_IMDCT)) {
+s->top_tx = *tx;
+*tx = full_imdct_wrapper_fn;
+}
 }
 return 0;
 }
@@ -990,8 +1012,13 @@ int TX_NAME(ff_tx_init_mdct_fft)(AVTXContext *s, av_tx_fn *tx,
 init_cos_tabs(i);
 }
 
-if (is_mdct)
+if (is_mdct) {
+if (inv && (flags & AV_TX_FULL_IMDCT)) {
+s->top_tx = *tx;
+*tx = full_imdct_wrapper_fn;
+}
 return gen_mdct_exptab(s, n*m, *((SCALE_TYPE *)scale));
+}
 
 return 0;
 }
-- 
2.31.0.291.g576ba9dcdaf

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

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


[FFmpeg-devel] [PATCH 05/11] lavu/tx: add unaligned flag to the API

2021-04-19 Thread Lynne
Patch attached.

>From b72dd4fd88bad63a831e5d793dadbab1abc590fd Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 03:55:14 +0200
Subject: [PATCH 05/11] lavu/tx: add unaligned flag to the API

---
 libavutil/tx.h | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libavutil/tx.h b/libavutil/tx.h
index fccded8bc3..a3d70644e4 100644
--- a/libavutil/tx.h
+++ b/libavutil/tx.h
@@ -95,7 +95,7 @@ enum AVTXType {
  * @param stride the input or output stride in bytes
  *
  * The out and in arrays must be aligned to the maximum required by the CPU
- * architecture.
+ * architecture unless the AV_TX_UNALIGNED flag was set in av_tx_init().
  * The stride must follow the constraints the transform type has specified.
  */
 typedef void (*av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride);
@@ -110,6 +110,12 @@ enum AVTXFlags {
  * transform types.
  */
 AV_TX_INPLACE = 1ULL << 0,
+
+/**
+ * Relaxes alignment requirement for the in and out arrays of av_tx_fn().
+ * May be slower with certain transform types.
+ */
+AV_TX_UNALIGNED = 1ULL << 1,
 };
 
 /**
-- 
2.31.0.291.g576ba9dcdaf

___
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 04/11] lavu/tx: add a 9-point FFT and (i)MDCT

2021-04-19 Thread Lynne
Patch attached.

>From 6197817a1b3e9f2fc559d26cf0639a1fd465752c Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 04:19:06 +0200
Subject: [PATCH 04/11] lavu/tx: add a 9-point FFT and (i)MDCT

---
 libavutil/tx_template.c | 144 +++-
 1 file changed, 143 insertions(+), 1 deletion(-)

diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index 2946c039be..b3532c1c5e 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -41,6 +41,7 @@ COSTABLE(65536);
 COSTABLE(131072);
 DECLARE_ALIGNED(32, FFTComplex, TX_NAME(ff_cos_53))[4];
 DECLARE_ALIGNED(32, FFTComplex, TX_NAME(ff_cos_7))[3];
+DECLARE_ALIGNED(32, FFTComplex, TX_NAME(ff_cos_9))[4];
 
 static FFTSample * const cos_tabs[18] = {
 NULL,
@@ -111,10 +112,19 @@ static av_cold void ff_init_7_tabs(void)
 TX_NAME(ff_cos_7)[2] = (FFTComplex){ RESCALE(cos(2 * M_PI / 14)), RESCALE(sin(2 * M_PI / 14)) };
 }
 
+static av_cold void ff_init_9_tabs(void)
+{
+TX_NAME(ff_cos_9)[0] = (FFTComplex){ RESCALE(cos(2 * M_PI /  3)), RESCALE( sin(2 * M_PI /  3)) };
+TX_NAME(ff_cos_9)[1] = (FFTComplex){ RESCALE(cos(2 * M_PI /  9)), RESCALE( sin(2 * M_PI /  9)) };
+TX_NAME(ff_cos_9)[2] = (FFTComplex){ RESCALE(cos(2 * M_PI / 36)), RESCALE( sin(2 * M_PI / 36)) };
+TX_NAME(ff_cos_9)[3] = (FFTComplex){ TX_NAME(ff_cos_9)[1].re + TX_NAME(ff_cos_9)[2].im,
+ TX_NAME(ff_cos_9)[1].im - TX_NAME(ff_cos_9)[2].re };
+}
+
 static CosTabsInitOnce cos_tabs_init_once[] = {
 { ff_init_53_tabs, AV_ONCE_INIT },
 { ff_init_7_tabs, AV_ONCE_INIT },
-{ NULL },
+{ ff_init_9_tabs, AV_ONCE_INIT },
 { NULL },
 { init_cos_tabs_16, AV_ONCE_INIT },
 { init_cos_tabs_32, AV_ONCE_INIT },
@@ -299,6 +309,130 @@ static av_always_inline void fft7(FFTComplex *out, FFTComplex *in,
 out[6*stride].im = in[0].im + z[0].im;
 }
 
+static av_always_inline void fft9(FFTComplex *out, FFTComplex *in,
+  ptrdiff_t stride)
+{
+const FFTComplex *tab = TX_NAME(ff_cos_9);
+FFTComplex t[16], w[4], x[5], y[5], z[2];
+#ifdef TX_INT32
+int64_t mtmp[12];
+#endif
+
+BF(t[1].re, t[0].re, in[1].re, in[8].re);
+BF(t[1].im, t[0].im, in[1].im, in[8].im);
+BF(t[3].re, t[2].re, in[2].re, in[7].re);
+BF(t[3].im, t[2].im, in[2].im, in[7].im);
+BF(t[5].re, t[4].re, in[3].re, in[6].re);
+BF(t[5].im, t[4].im, in[3].im, in[6].im);
+BF(t[7].re, t[6].re, in[4].re, in[5].re);
+BF(t[7].im, t[6].im, in[4].im, in[5].im);
+
+w[0].re = t[0].re - t[6].re;
+w[0].im = t[0].im - t[6].im;
+w[1].re = t[2].re - t[6].re;
+w[1].im = t[2].im - t[6].im;
+w[2].re = t[1].re - t[7].re;
+w[2].im = t[1].im - t[7].im;
+w[3].re = t[3].re + t[7].re;
+w[3].im = t[3].im + t[7].im;
+
+z[0].re = in[0].re + t[4].re;
+z[0].im = in[0].im + t[4].im;
+
+z[1].re = t[0].re + t[2].re + t[6].re;
+z[1].im = t[0].im + t[2].im + t[6].im;
+
+out[0*stride].re = z[0].re + z[1].re;
+out[0*stride].im = z[0].im + z[1].im;
+
+#ifdef TX_INT32
+mtmp[0] = t[1].re - t[3].re + t[7].re;
+mtmp[1] = t[1].im - t[3].im + t[7].im;
+
+y[3].re = (int32_t)(((int64_t)tab[0].im)*mtmp[0] + 0x4000 >> 31);
+y[3].im = (int32_t)(((int64_t)tab[0].im)*mtmp[1] + 0x4000 >> 31);
+
+mtmp[0] = (int32_t)(((int64_t)tab[0].re)*z[1].re + 0x4000 >> 31);
+mtmp[1] = (int32_t)(((int64_t)tab[0].re)*z[1].im + 0x4000 >> 31);
+mtmp[2] = (int32_t)(((int64_t)tab[0].re)*t[4].re + 0x4000 >> 31);
+mtmp[3] = (int32_t)(((int64_t)tab[0].re)*t[4].im + 0x4000 >> 31);
+
+x[3].re = z[0].re  + (int32_t)mtmp[0];
+x[3].im = z[0].im  + (int32_t)mtmp[1];
+z[0].re = in[0].re + (int32_t)mtmp[2];
+z[0].im = in[0].im + (int32_t)mtmp[3];
+
+mtmp[0] = ((int64_t)tab[1].re)*w[0].re;
+mtmp[1] = ((int64_t)tab[1].re)*w[0].im;
+mtmp[2] = ((int64_t)tab[2].im)*w[0].re;
+mtmp[3] = ((int64_t)tab[2].im)*w[0].im;
+mtmp[4] = ((int64_t)tab[1].im)*w[2].re;
+mtmp[5] = ((int64_t)tab[1].im)*w[2].im;
+mtmp[6] = ((int64_t)tab[2].re)*w[2].re;
+mtmp[7] = ((int64_t)tab[2].re)*w[2].im;
+
+x[1].re = (int32_t)(mtmp[0] + ((int64_t)tab[2].im)*w[1].re + 0x4000 >> 31);
+x[1].im = (int32_t)(mtmp[1] + ((int64_t)tab[2].im)*w[1].im + 0x4000 >> 31);
+x[2].re = (int32_t)(mtmp[2] - ((int64_t)tab[3].re)*w[1].re + 0x4000 >> 31);
+x[2].im = (int32_t)(mtmp[3] - ((int64_t)tab[3].re)*w[1].im + 0x4000 >> 31);
+y[1].re = (int32_t)(mtmp[4] + ((int64_t)tab[2].re)*w[3].re + 0x4000 >> 31);
+y[1].im = (int32_t)(mtmp[5] + ((int64_t)tab[2].re)*w[3].im + 0x4000 >> 31);
+y[2].re = (int32_t)(mtmp[6] - ((int64_t)tab[3].im)*w[3].re + 0x4000 >> 31);
+y[2].im = (int32_t)(mtmp[7] - ((int64_t)tab[3].im)*w[3].im + 0x4000 >> 31);
+
+y[0].re = (int32_t)(((int64_t)tab[0].im)*t[5].re + 0x4000 >> 31);
+y[0].im = (int32_t)(((int64_t)tab[0].im)*t[5].im + 0x4000 

[FFmpeg-devel] [PATCH 03/11] lavu/tx: add a 7-point FFT and (i)MDCT

2021-04-19 Thread Lynne
Patch attached.

>From 61cd1bc6a5e4cc08b0ad7bafc55072feeb62ddf0 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 03:51:59 +0200
Subject: [PATCH 03/11] lavu/tx: add a 7-point FFT and (i)MDCT

---
 libavutil/tx_template.c | 126 
 1 file changed, 116 insertions(+), 10 deletions(-)

diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index f78e7abfb1..2946c039be 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -40,6 +40,7 @@ COSTABLE(32768);
 COSTABLE(65536);
 COSTABLE(131072);
 DECLARE_ALIGNED(32, FFTComplex, TX_NAME(ff_cos_53))[4];
+DECLARE_ALIGNED(32, FFTComplex, TX_NAME(ff_cos_7))[3];
 
 static FFTSample * const cos_tabs[18] = {
 NULL,
@@ -103,9 +104,16 @@ static av_cold void ff_init_53_tabs(void)
 TX_NAME(ff_cos_53)[3] = (FFTComplex){ RESCALE(cos(2 * M_PI / 10)), RESCALE(sin(2 * M_PI / 10)) };
 }
 
+static av_cold void ff_init_7_tabs(void)
+{
+TX_NAME(ff_cos_7)[0] = (FFTComplex){ RESCALE(cos(2 * M_PI /  7)), RESCALE(sin(2 * M_PI /  7)) };
+TX_NAME(ff_cos_7)[1] = (FFTComplex){ RESCALE(sin(2 * M_PI / 28)), RESCALE(cos(2 * M_PI / 28)) };
+TX_NAME(ff_cos_7)[2] = (FFTComplex){ RESCALE(cos(2 * M_PI / 14)), RESCALE(sin(2 * M_PI / 14)) };
+}
+
 static CosTabsInitOnce cos_tabs_init_once[] = {
 { ff_init_53_tabs, AV_ONCE_INIT },
-{ NULL },
+{ ff_init_7_tabs, AV_ONCE_INIT },
 { NULL },
 { NULL },
 { init_cos_tabs_16, AV_ONCE_INIT },
@@ -204,6 +212,93 @@ DECL_FFT5(fft5_m1,  0,  6, 12,  3,  9)
 DECL_FFT5(fft5_m2, 10,  1,  7, 13,  4)
 DECL_FFT5(fft5_m3,  5, 11,  2,  8, 14)
 
+static av_always_inline void fft7(FFTComplex *out, FFTComplex *in,
+  ptrdiff_t stride)
+{
+FFTComplex t[6], z[3];
+const FFTComplex *tab = TX_NAME(ff_cos_7);
+#ifdef TX_INT32
+int64_t mtmp[12];
+#endif
+
+BF(t[1].re, t[0].re, in[1].re, in[6].re);
+BF(t[1].im, t[0].im, in[1].im, in[6].im);
+BF(t[3].re, t[2].re, in[2].re, in[5].re);
+BF(t[3].im, t[2].im, in[2].im, in[5].im);
+BF(t[5].re, t[4].re, in[3].re, in[4].re);
+BF(t[5].im, t[4].im, in[3].im, in[4].im);
+
+out[0*stride].re = in[0].re + t[0].re + t[2].re + t[4].re;
+out[0*stride].im = in[0].im + t[0].im + t[2].im + t[4].im;
+
+#ifdef TX_INT32 /* NOTE: it's possible to do this with 16 mults but 72 adds */
+mtmp[ 0] = ((int64_t)tab[0].re)*t[0].re - ((int64_t)tab[2].re)*t[4].re;
+mtmp[ 1] = ((int64_t)tab[0].re)*t[4].re - ((int64_t)tab[1].re)*t[0].re;
+mtmp[ 2] = ((int64_t)tab[0].re)*t[2].re - ((int64_t)tab[2].re)*t[0].re;
+mtmp[ 3] = ((int64_t)tab[0].re)*t[0].im - ((int64_t)tab[1].re)*t[2].im;
+mtmp[ 4] = ((int64_t)tab[0].re)*t[4].im - ((int64_t)tab[1].re)*t[0].im;
+mtmp[ 5] = ((int64_t)tab[0].re)*t[2].im - ((int64_t)tab[2].re)*t[0].im;
+
+mtmp[ 6] = ((int64_t)tab[2].im)*t[1].im + ((int64_t)tab[1].im)*t[5].im;
+mtmp[ 7] = ((int64_t)tab[0].im)*t[5].im + ((int64_t)tab[2].im)*t[3].im;
+mtmp[ 8] = ((int64_t)tab[2].im)*t[5].im + ((int64_t)tab[1].im)*t[3].im;
+mtmp[ 9] = ((int64_t)tab[0].im)*t[1].re + ((int64_t)tab[1].im)*t[3].re;
+mtmp[10] = ((int64_t)tab[2].im)*t[3].re + ((int64_t)tab[0].im)*t[5].re;
+mtmp[11] = ((int64_t)tab[2].im)*t[1].re + ((int64_t)tab[1].im)*t[5].re;
+
+z[0].re = (int32_t)(mtmp[ 0] - ((int64_t)tab[1].re)*t[2].re + 0x4000 >> 31);
+z[1].re = (int32_t)(mtmp[ 1] - ((int64_t)tab[2].re)*t[2].re + 0x4000 >> 31);
+z[2].re = (int32_t)(mtmp[ 2] - ((int64_t)tab[1].re)*t[4].re + 0x4000 >> 31);
+z[0].im = (int32_t)(mtmp[ 3] - ((int64_t)tab[2].re)*t[4].im + 0x4000 >> 31);
+z[1].im = (int32_t)(mtmp[ 4] - ((int64_t)tab[2].re)*t[2].im + 0x4000 >> 31);
+z[2].im = (int32_t)(mtmp[ 5] - ((int64_t)tab[1].re)*t[4].im + 0x4000 >> 31);
+
+t[0].re = (int32_t)(mtmp[ 6] - ((int64_t)tab[0].im)*t[3].im + 0x4000 >> 31);
+t[2].re = (int32_t)(mtmp[ 7] - ((int64_t)tab[1].im)*t[1].im + 0x4000 >> 31);
+t[4].re = (int32_t)(mtmp[ 8] + ((int64_t)tab[0].im)*t[1].im + 0x4000 >> 31);
+t[0].im = (int32_t)(mtmp[ 9] + ((int64_t)tab[2].im)*t[5].re + 0x4000 >> 31);
+t[2].im = (int32_t)(mtmp[10] - ((int64_t)tab[1].im)*t[1].re + 0x4000 >> 31);
+t[4].im = (int32_t)(mtmp[11] - ((int64_t)tab[0].im)*t[3].re + 0x4000 >> 31);
+#else
+z[0].re = tab[0].re*t[0].re - tab[2].re*t[4].re - tab[1].re*t[2].re;
+z[1].re = tab[0].re*t[4].re - tab[1].re*t[0].re - tab[2].re*t[2].re;
+z[2].re = tab[0].re*t[2].re - tab[2].re*t[0].re - tab[1].re*t[4].re;
+z[0].im = tab[0].re*t[0].im - tab[1].re*t[2].im - tab[2].re*t[4].im;
+z[1].im = tab[0].re*t[4].im - tab[1].re*t[0].im - tab[2].re*t[2].im;
+z[2].im = tab[0].re*t[2].im - tab[2].re*t[0].im - tab[1].re*t[4].im;
+
+/* It's possible to do t[4].re and t[0].im with 2 multiplies only by
+ * multiplying the sum of all with the average of the twiddles */
+
+t[0].re = tab[2].im*t[1].im + tab[1].im*t[5].im - tab[0].im*t[3].im;
+   

[FFmpeg-devel] [PATCH 02/11] lavu/tx: refactor power-of-two FFT

2021-04-19 Thread Lynne
This commit refactors the power-of-two FFT, making it faster and 
halving the size of all tables, making the code much smaller on
all systems, and making initialization much faster.
This removes the big/small pass split, because on modern systems
the "big" pass is always faster, and even on older machines there
is no measurable speed difference.

Patch attached.

>From 6b752503bb6171292381102aedca6213a44638e0 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 03:47:18 +0200
Subject: [PATCH 02/11] lavu/tx: refactor power-of-two FFT

This commit refactors the power-of-two FFT, making it faster and
halving the size of all tables, making the code much smaller on
all systems.
This removes the big/small pass split, because on modern systems
the "big" pass is always faster, and even on older machines there
is no measurable speed difference.
---
 libavutil/tx_priv.h |   2 +-
 libavutil/tx_template.c | 164 +++-
 2 files changed, 79 insertions(+), 87 deletions(-)

diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index 10d7ea3ade..0b40234355 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -105,7 +105,7 @@ typedef void FFTComplex;
 CMUL((c).re, (c).im, (a).re, (a).im, (b).re, (b).im)
 
 #define COSTABLE(size) \
-DECLARE_ALIGNED(32, FFTSample, TX_NAME(ff_cos_##size))[size/2]
+DECLARE_ALIGNED(32, FFTSample, TX_NAME(ff_cos_##size))[size/4 + 1]
 
 /* Used by asm, reorder with care */
 struct AVTXContext {
diff --git a/libavutil/tx_template.c b/libavutil/tx_template.c
index a436f426d2..f78e7abfb1 100644
--- a/libavutil/tx_template.c
+++ b/libavutil/tx_template.c
@@ -1,6 +1,8 @@
 /*
- * Copyright (c) 2019 Lynne 
+ * Copyright (c) Lynne
+ *
  * Power of two FFT:
+ * Copyright (c) Lynne
  * Copyright (c) 2008 Loren Merritt
  * Copyright (c) 2002 Fabrice Bellard
  * Partly based on libdjbfft by D. J. Bernstein
@@ -65,10 +67,11 @@ static av_always_inline void init_cos_tabs_idx(int index)
 int m = 1 << index;
 double freq = 2*M_PI/m;
 FFTSample *tab = cos_tabs[index];
-for(int i = 0; i <= m/4; i++)
-tab[i] = RESCALE(cos(i*freq));
-for(int i = 1; i < m/4; i++)
-tab[m/2 - i] = tab[i];
+
+for (int i = 0; i < m/4; i++)
+*tab++ = RESCALE(cos(i*freq));
+
+*tab = 0;
 }
 
 #define INIT_FF_COS_TABS_FUNC(index, size) \
@@ -214,76 +217,60 @@ static av_always_inline void fft15(FFTComplex *out, FFTComplex *in,
 fft5_m3(out, tmp + 10, stride);
 }
 
-#define BUTTERFLIES(a0,a1,a2,a3) {\
-BF(t3, t5, t5, t1);\
-BF(a2.re, a0.re, a0.re, t5);\
-BF(a3.im, a1.im, a1.im, t3);\
-BF(t4, t6, t2, t6);\
-BF(a3.re, a1.re, a1.re, t4);\
-BF(a2.im, a0.im, a0.im, t6);\
-}
-
-// force loading all the inputs before storing any.
-// this is slightly slower for small data, but avoids store->load aliasing
-// for addresses separated by large powers of 2.
-#define BUTTERFLIES_BIG(a0,a1,a2,a3) {\
-FFTSample r0=a0.re, i0=a0.im, r1=a1.re, i1=a1.im;\
-BF(t3, t5, t5, t1);\
-BF(a2.re, a0.re, r0, t5);\
-BF(a3.im, a1.im, i1, t3);\
-BF(t4, t6, t2, t6);\
-BF(a3.re, a1.re, r1, t4);\
-BF(a2.im, a0.im, i0, t6);\
-}
-
-#define TRANSFORM(a0,a1,a2,a3,wre,wim) {\
-CMUL(t1, t2, a2.re, a2.im, wre, -wim);\
-CMUL(t5, t6, a3.re, a3.im, wre,  wim);\
-BUTTERFLIES(a0,a1,a2,a3)\
-}
-
-#define TRANSFORM_ZERO(a0,a1,a2,a3) {\
-t1 = a2.re;\
-t2 = a2.im;\
-t5 = a3.re;\
-t6 = a3.im;\
-BUTTERFLIES(a0,a1,a2,a3)\
-}
+#define BUTTERFLIES(a0,a1,a2,a3)   \
+do {   \
+r0=a0.re;  \
+i0=a0.im;  \
+r1=a1.re;  \
+i1=a1.im;  \
+BF(t3, t5, t5, t1);\
+BF(a2.re, a0.re, r0, t5);  \
+BF(a3.im, a1.im, i1, t3);  \
+BF(t4, t6, t2, t6);\
+BF(a3.re, a1.re, r1, t4);  \
+BF(a2.im, a0.im, i0, t6);  \
+} while (0)
+
+#define TRANSFORM(a0,a1,a2,a3,wre,wim) \
+do {   \
+CMUL(t1, t2, a2.re, a2.im, wre, -wim); \
+CMUL(t5, t6, a3.re, a3.im, wre,  wim); \
+BUTTERFLIES(a0, a1, a2, a3);   \
+} while (0)
 
 /* z[0...8n-1], w[1...2n-1] */
-#define PASS(name)\
-static void name(FFTComplex *z, const FFTSample *wre, unsigned int n)\
-{\
-FFTSample t1, t2, t3, t4, t5, t6;\
-int o1 = 2*n;\
-int o2 = 4*n;\
-int o3 = 6*n;\
-const FFTSample *wim = wre+o1;\
-n--;\
-\
-TRANSFORM_ZERO(z[0],z[o1],z[o2],z[o3]);\
-TRANSFORM(z[1],z[o1+1],z[o2+1],z[o3+1],wre[1],wim[-1]);\
-do {\
-z += 2;\
-wre += 2;\
-wim -= 2;\
-TRANSFORM(z[0],z[o1],z[o2],z[o3],wre[0],wim[0]);\

[FFmpeg-devel] [PATCH 01/11] lavu/tx: minor code style improvements and additional comments

2021-04-19 Thread Lynne
Patch attached.

>From db53a23233276e103e823312667aac06ed57c11e Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Sat, 10 Apr 2021 03:45:03 +0200
Subject: [PATCH 01/11] lavu/tx: minor code style improvements and additional
 comments

---
 libavutil/tx.c  | 17 +-
 libavutil/tx.h  |  2 ++
 libavutil/tx_priv.h | 57 -
 3 files changed, 48 insertions(+), 28 deletions(-)

diff --git a/libavutil/tx.c b/libavutil/tx.c
index 1161df3285..05d4de30cc 100644
--- a/libavutil/tx.c
+++ b/libavutil/tx.c
@@ -30,7 +30,7 @@ int ff_tx_type_is_mdct(enum AVTXType type)
 }
 }
 
-/* Calculates the modular multiplicative inverse, not fast, replace */
+/* Calculates the modular multiplicative inverse */
 static av_always_inline int mulinv(int n, int m)
 {
 n = n % m;
@@ -91,6 +91,17 @@ int ff_tx_gen_compound_mapping(AVTXContext *s)
 return 0;
 }
 
+static inline int split_radix_permutation(int i, int m, int inverse)
+{
+m >>= 1;
+if (m <= 1)
+return i & 1;
+if (!(i & m))
+return (split_radix_permutation(i, m, inverse) << 1);
+m >>= 1;
+return (split_radix_permutation(i, m, inverse) << 2) + 1 - 2*(!(i & m) ^ inverse);
+}
+
 int ff_tx_gen_ptwo_revtab(AVTXContext *s, int invert_lookup)
 {
 const int m = s->m, inv = s->inv;
@@ -117,6 +128,7 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
 if (!(s->inplace_idx = av_malloc(s->m*sizeof(*s->inplace_idx
 return AVERROR(ENOMEM);
 
+/* The first coefficient is always already in-place */
 for (int src = 1; src < s->m; src++) {
 int dst = s->revtab[src];
 int found = 0;
@@ -124,6 +136,9 @@ int ff_tx_gen_ptwo_inplace_revtab_idx(AVTXContext *s)
 if (dst <= src)
 continue;
 
+/* This just checks if a closed loop has been encountered before,
+ * and if so, skips it, since to fully permute a loop we must only
+ * enter it once. */
 do {
 for (int j = 0; j < nb_inplace_idx; j++) {
 if (dst == s->inplace_idx[j]) {
diff --git a/libavutil/tx.h b/libavutil/tx.h
index bfc0c7f2a3..fccded8bc3 100644
--- a/libavutil/tx.h
+++ b/libavutil/tx.h
@@ -49,9 +49,11 @@ enum AVTXType {
  * float. Length is the frame size, not the window size (which is 2x frame)
  * For forward transforms, the stride specifies the spacing between each
  * sample in the output array in bytes. The input must be a flat array.
+ *
  * For inverse transforms, the stride specifies the spacing between each
  * sample in the input array in bytes. The output will be a flat array.
  * Stride must be a non-zero multiple of sizeof(float).
+ *
  * NOTE: the inverse transform is half-length, meaning the output will not
  * contain redundant data. This is what most codecs work with.
  */
diff --git a/libavutil/tx_priv.h b/libavutil/tx_priv.h
index e2f4314a4f..10d7ea3ade 100644
--- a/libavutil/tx_priv.h
+++ b/libavutil/tx_priv.h
@@ -20,9 +20,7 @@
 #define AVUTIL_TX_PRIV_H
 
 #include "tx.h"
-#include 
 #include "thread.h"
-#include "mem.h"
 #include "mem_internal.h"
 #include "avassert.h"
 #include "attributes.h"
@@ -48,12 +46,14 @@ typedef void FFTComplex;
 
 #if defined(TX_FLOAT) || defined(TX_DOUBLE)
 
-#define CMUL(dre, dim, are, aim, bre, bim) do {\
+#define CMUL(dre, dim, are, aim, bre, bim) \
+do {   \
 (dre) = (are) * (bre) - (aim) * (bim); \
 (dim) = (are) * (bim) + (aim) * (bre); \
 } while (0)
 
-#define SMUL(dre, dim, are, aim, bre, bim) do {\
+#define SMUL(dre, dim, are, aim, bre, bim) \
+do {   \
 (dre) = (are) * (bre) - (aim) * (bim); \
 (dim) = (are) * (bim) - (aim) * (bre); \
 } while (0)
@@ -66,7 +66,8 @@ typedef void FFTComplex;
 #elif defined(TX_INT32)
 
 /* Properly rounds the result */
-#define CMUL(dre, dim, are, aim, bre, bim) do {\
+#define CMUL(dre, dim, are, aim, bre, bim) \
+do {   \
 int64_t accu;  \
 (accu)  = (int64_t)(bre) * (are);  \
 (accu) -= (int64_t)(bim) * (aim);  \
@@ -76,7 +77,8 @@ typedef void FFTComplex;
 (dim)   = (int)(((accu) + 0x4000) >> 31);  \
 } while (0)
 
-#define SMUL(dre, dim, are, aim, bre, bim) do {\
+#define SMUL(dre, dim, 

[FFmpeg-devel] [PATCH 00/11] lavu/tx: FFT improvements, additions and assembly

2021-04-19 Thread Lynne
This patchset cleans up and improves the power-of-two C code, 
adds a 7-point and a 9-point FFT, and adds a power-of-two length
floating-point assembly.

>From 6810e483e9273751578c730e3a7d408bf2117dd9 Mon Sep 17 00:00:00 2001
From: Lynne 
Date: Mon, 19 Apr 2021 22:17:05 +0200
Subject: [PATCH 00/11] lavu/tx: FFT improvements, additions and assembly
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patchset cleans up and improves the power-of-two C code,
adds a 7-point and a 9-point FFT, and adds a power-of-two length
floating-point assembly.

Lynne (11):
  lavu/tx: minor code style improvements and additional comments
  lavu/tx: refactor power-of-two FFT
  lavu/tx: add a 7-point FFT and (i)MDCT
  lavu/tx: add a 9-point FFT and (i)MDCT
  lavu/tx: add unaligned flag to the API
  lavu/tx: add full-sized iMDCT transform flag
  lavu: bump minor and add APIchanges entry for the lavu/tx changes
  lavu/tx: add parity revtab generator version
  checkasm: add av_tx FFT SIMD testing code
  doc/transforms: add documentation for the FFT transforms
  lavu/x86: add FFT assembly

 doc/APIchanges|3 +
 doc/transforms.md |  706 +++
 libavutil/tx.c|   83 ++-
 libavutil/tx.h|   21 +-
 libavutil/tx_priv.h   |  103 ++-
 libavutil/tx_template.c   |  481 ++---
 libavutil/version.h   |2 +-
 libavutil/x86/Makefile|2 +
 libavutil/x86/tx_float.asm| 1216 +
 libavutil/x86/tx_float_init.c |  101 +++
 tests/checkasm/Makefile   |1 +
 tests/checkasm/av_tx.c|  109 +++
 tests/checkasm/checkasm.c |1 +
 tests/checkasm/checkasm.h |1 +
 tests/fate/checkasm.mak   |1 +
 15 files changed, 2684 insertions(+), 147 deletions(-)
 create mode 100644 doc/transforms.md
 create mode 100644 libavutil/x86/tx_float.asm
 create mode 100644 libavutil/x86/tx_float_init.c
 create mode 100644 tests/checkasm/av_tx.c

-- 
2.31.0.291.g576ba9dcdaf

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

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


[FFmpeg-devel] [PATCH v2 67/90] avutil: Switch crypto APIs to size_t

2021-04-19 Thread Andreas Rheinhardt
From: Andreas Rheinhardt 

Announced in e435beb1ea5380a90774dbf51fdc8c941e486551.

Signed-off-by: Andreas Rheinhardt 
---
I forgot a printf specifier in tests/api/api-h264-test.c.

 libavutil/adler32.c   |  5 -
 libavutil/adler32.h   |  9 -
 libavutil/hash.c  |  4 
 libavutil/hash.h  |  4 
 libavutil/hmac.c  |  4 
 libavutil/md5.c   | 15 +++
 libavutil/md5.h   |  8 
 libavutil/murmur3.c   |  4 
 libavutil/murmur3.h   |  4 
 libavutil/ripemd.c| 23 ---
 libavutil/ripemd.h|  4 
 libavutil/sha.c   | 23 ---
 libavutil/sha.h   |  4 
 libavutil/sha512.c| 23 ---
 libavutil/sha512.h|  4 
 libavutil/version.h   |  3 ---
 tests/api/api-h264-test.c |  2 +-
 17 files changed, 40 insertions(+), 103 deletions(-)

diff --git a/libavutil/adler32.c b/libavutil/adler32.c
index 5ed5ff55a3..f7d3062265 100644
--- a/libavutil/adler32.c
+++ b/libavutil/adler32.c
@@ -41,12 +41,7 @@
 #define DO4(buf)  DO1(buf); DO1(buf); DO1(buf); DO1(buf);
 #define DO16(buf) DO4(buf); DO4(buf); DO4(buf); DO4(buf);
 
-#if FF_API_CRYPTO_SIZE_T
-unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf,
-unsigned int len)
-#else
 AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
-#endif
 {
 unsigned long s1 = adler & 0x;
 unsigned long s2 = adler >> 16;
diff --git a/libavutil/adler32.h b/libavutil/adler32.h
index e7a8f83729..232d07f5fe 100644
--- a/libavutil/adler32.h
+++ b/libavutil/adler32.h
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include "attributes.h"
-#include "version.h"
 
 /**
  * @defgroup lavu_adler32 Adler-32
@@ -40,11 +39,7 @@
  * @{
  */
 
-#if FF_API_CRYPTO_SIZE_T
-typedef unsigned long AVAdler;
-#else
 typedef uint32_t AVAdler;
-#endif
 
 /**
  * Calculate the Adler32 checksum of a buffer.
@@ -59,11 +54,7 @@ typedef uint32_t AVAdler;
  * @return  updated checksum
  */
 AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf,
-#if FF_API_CRYPTO_SIZE_T
-  unsigned int len) av_pure;
-#else
   size_t len) av_pure;
-#endif
 
 /**
  * @}
diff --git a/libavutil/hash.c b/libavutil/hash.c
index d626c31181..9a49748189 100644
--- a/libavutil/hash.c
+++ b/libavutil/hash.c
@@ -157,11 +157,7 @@ void av_hash_init(AVHashContext *ctx)
 }
 }
 
-#if FF_API_CRYPTO_SIZE_T
-void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len)
-#else
 void av_hash_update(AVHashContext *ctx, const uint8_t *src, size_t len)
-#endif
 {
 switch (ctx->type) {
 case MD5: av_md5_update(ctx->ctx, src, len); break;
diff --git a/libavutil/hash.h b/libavutil/hash.h
index af4719e423..930d2d6cde 100644
--- a/libavutil/hash.h
+++ b/libavutil/hash.h
@@ -182,11 +182,7 @@ void av_hash_init(struct AVHashContext *ctx);
  * @param[in] src Data to be added to the hash context
  * @param[in] len Size of the additional data
  */
-#if FF_API_CRYPTO_SIZE_T
-void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
-#else
 void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
-#endif
 
 /**
  * Finalize a hash context and compute the actual hash value.
diff --git a/libavutil/hmac.c b/libavutil/hmac.c
index d064a105f4..e277fd7701 100644
--- a/libavutil/hmac.c
+++ b/libavutil/hmac.c
@@ -34,11 +34,7 @@
 #define MAX_BLOCKLEN 128
 
 typedef void (*hmac_final)(void *ctx, uint8_t *dst);
-#if FF_API_CRYPTO_SIZE_T
-typedef void (*hmac_update)(void *ctx, const uint8_t *src, int len);
-#else
 typedef void (*hmac_update)(void *ctx, const uint8_t *src, size_t len);
-#endif
 typedef void (*hmac_init)(void *ctx);
 
 struct AVHMAC {
diff --git a/libavutil/md5.c b/libavutil/md5.c
index 31e69925ae..88596203c1 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -98,14 +98,13 @@ static const uint32_t T[64] = { // T[i]= fabs(sin(i+1)<<32)
 a = b + (a << t | a >> (32 - t));   \
 } while (0)
 
-static void body(uint32_t ABCD[4], const uint8_t *src, int nblocks)
+static void body(uint32_t ABCD[4], const uint8_t *src, size_t nblocks)
 {
 int i av_unused;
-int n;
 const uint32_t *X;
 uint32_t a, b, c, d, t;
 
-for (n = 0; n < nblocks; n++) {
+for (size_t n = 0; n < nblocks; n++) {
 a = ABCD[3];
 b = ABCD[2];
 c = ABCD[1];
@@ -150,11 +149,7 @@ void av_md5_init(AVMD5 *ctx)
 ctx->ABCD[3] = 0x67452301;
 }
 
-#if FF_API_CRYPTO_SIZE_T
-void av_md5_update(AVMD5 *ctx, const uint8_t *src, int len)
-#else
 void av_md5_update(AVMD5 *ctx, const uint8_t *src, size_t len)
-#endif
 {
 const uint8_t *end;
 int j;
@@ -180,7 +175,7 @@ void av_md5_update(AVMD5 *ctx, const uint8_t *src, size_t 
len)
src += 64;
 }
 } else {
-int nblocks = len / 64;
+size_t 

Re: [FFmpeg-devel] [PATCH 43/87] avformat/mov, movenc: Enc exporting rotation via metadata

2021-04-19 Thread James Almer

On 4/19/2021 3:35 PM, Michael Niedermayer wrote:

On Mon, Apr 19, 2021 at 11:09:40AM -0300, James Almer wrote:

From: Andreas Rheinhardt 

Deprecated in ddef3d902f0e4cbd6be6b3e5df7ec158ce51488b.

(The reference file of the mov-zombie test needed to be updated, because
a rotate metadata tag is no longer exported; the side-data is of course
still present.)

Signed-off-by: Andreas Rheinhardt 
---
  libavformat/mov.c | 14 --
  libavformat/movenc.c  | 15 ---
  libavformat/version.h |  3 ---
  tests/ref/fate/mov-zombie |  2 +-
  4 files changed, 1 insertion(+), 33 deletions(-)


it seems this doesnt want to apply

Applying: avformat/mov, movenc: Enc exporting rotation via metadata
Using index info to reconstruct a base tree...
M   libavformat/mov.c
error: patch failed: tests/ref/fate/mov-zombie:194
error: tests/ref/fate/mov-zombie: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Patch failed at 0001 avformat/mov, movenc: Enc exporting rotation via metadata
hint: Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Probably its related to the long line


Odd, git send-email doesn't normally screw up like this.

I'm attaching the patch here, then.
From 8fcb2b40b9210bf9dcc04eff34a56391514d4c3b Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt 
Date: Sat, 6 Mar 2021 16:33:48 +0100
Subject: [PATCH 43/87] avformat/mov, movenc: Enc exporting rotation via
 metadata

Deprecated in ddef3d902f0e4cbd6be6b3e5df7ec158ce51488b.

(The reference file of the mov-zombie test needed to be updated, because
a rotate metadata tag is no longer exported; the side-data is of course
still present.)

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/mov.c | 14 --
 libavformat/movenc.c  | 15 ---
 libavformat/version.h |  3 ---
 tests/ref/fate/mov-zombie |  2 +-
 4 files changed, 1 insertion(+), 33 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9ca1ac89a8..8b3371abe6 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4582,8 +4582,6 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 
 // save the matrix when it is not the default identity
 if (!IS_MATRIX_IDENT(res_display_matrix)) {
-double rotate;
-
 av_freep(>display_matrix);
 sc->display_matrix = av_malloc(sizeof(int32_t) * 9);
 if (!sc->display_matrix)
@@ -4592,18 +4590,6 @@ static int mov_read_tkhd(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 for (i = 0; i < 3; i++)
 for (j = 0; j < 3; j++)
 sc->display_matrix[i * 3 + j] = res_display_matrix[i][j];
-
-#if FF_API_OLD_ROTATE_API
-rotate = av_display_rotation_get(sc->display_matrix);
-if (!isnan(rotate)) {
-char rotate_buf[64];
-rotate = -rotate;
-if (rotate < 0) // for backward compatibility
-rotate += 360;
-snprintf(rotate_buf, sizeof(rotate_buf), "%g", rotate);
-av_dict_set(>metadata, "rotate", rotate_buf, 0);
-}
-#endif
 }
 
 // transform the display width/height according to the matrix
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8e6ed817d8..b15ecbe713 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3043,7 +3043,6 @@ static int mov_write_tkhd_tag(AVIOContext *pb, 
MOVMuxContext *mov,
   AV_ROUND_UP);
 int version = duration < INT32_MAX ? 0 : 1;
 int flags   = MOV_TKHD_FLAG_IN_MOVIE;
-int rotation = 0;
 int group   = 0;
 
 uint32_t *display_matrix = NULL;
@@ -3100,23 +3099,9 @@ static int mov_write_tkhd_tag(AVIOContext *pb, 
MOVMuxContext *mov,
 avio_wb16(pb, 0); /* reserved */
 
 /* Matrix structure */
-#if FF_API_OLD_ROTATE_API
-if (st && st->metadata) {
-AVDictionaryEntry *rot = av_dict_get(st->metadata, "rotate", NULL, 0);
-rotation = (rot && rot->value) ? atoi(rot->value) : 0;
-}
-#endif
 if (display_matrix) {
 for (i = 0; i < 9; i++)
 avio_wb32(pb, display_matrix[i]);
-#if FF_API_OLD_ROTATE_API
-} else if (rotation == 90) {
-write_matrix(pb,  0,  1, -1,  0, track->par->height, 0);
-} else if (rotation == 180) {
-write_matrix(pb, -1,  0,  0, -1, track->par->width, 
track->par->height);
-} else if (rotation == 270) {
-write_matrix(pb,  0, -1,  1,  0, 0, track->par->width);
-#endif
 } else {
 write_matrix(pb,  1,  0,  0,  1, 0, 0);
 }
diff --git a/libavformat/version.h b/libavformat/version.h
index 7108482624..4c186f2915 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -58,9 +58,6 @@
 #ifndef FF_API_LAVF_AVCTX
 #define FF_API_LAVF_AVCTX   

Re: [FFmpeg-devel] [PATCH 43/87] avformat/mov, movenc: Enc exporting rotation via metadata

2021-04-19 Thread Michael Niedermayer
On Mon, Apr 19, 2021 at 11:09:40AM -0300, James Almer wrote:
> From: Andreas Rheinhardt 
> 
> Deprecated in ddef3d902f0e4cbd6be6b3e5df7ec158ce51488b.
> 
> (The reference file of the mov-zombie test needed to be updated, because
> a rotate metadata tag is no longer exported; the side-data is of course
> still present.)
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/mov.c | 14 --
>  libavformat/movenc.c  | 15 ---
>  libavformat/version.h |  3 ---
>  tests/ref/fate/mov-zombie |  2 +-
>  4 files changed, 1 insertion(+), 33 deletions(-)

it seems this doesnt want to apply

Applying: avformat/mov, movenc: Enc exporting rotation via metadata
Using index info to reconstruct a base tree...
M   libavformat/mov.c
error: patch failed: tests/ref/fate/mov-zombie:194
error: tests/ref/fate/mov-zombie: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Patch failed at 0001 avformat/mov, movenc: Enc exporting rotation via metadata
hint: Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

Probably its related to the long line

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

"I am not trying to be anyone's saviour, I'm trying to think about the
 future and not be sad" - Elon Musk



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

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


[FFmpeg-devel] [PATCH 3/9] avformat/mov: Ignore duplicate CoLL

2021-04-19 Thread Michael Niedermayer
Fixes: memleak
Fixes: 
32146/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5377612845285376

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/mov.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index add1e94641..3436fb6b73 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5501,6 +5501,11 @@ static int mov_read_coll(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 }
 avio_skip(pb, 3); /* flags */
 
+if (sc->coll){
+av_log(c->fc, AV_LOG_WARNING, "Ignoring duplicate COLL\n");
+return 0;
+}
+
 sc->coll = av_content_light_metadata_alloc(>coll_size);
 if (!sc->coll)
 return AVERROR(ENOMEM);
-- 
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] [PATCH 9/9] avcodec/clearvideo: Check for 0 tile_shift

2021-04-19 Thread Michael Niedermayer
Fixes: shift exponent -1 is negative
Fixes: 
33401/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CLEARVIDEO_fuzzer-5908683596890112

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

diff --git a/libavcodec/clearvideo.c b/libavcodec/clearvideo.c
index 79ba88857c..b3ccb51334 100644
--- a/libavcodec/clearvideo.c
+++ b/libavcodec/clearvideo.c
@@ -722,8 +722,8 @@ static av_cold int clv_decode_init(AVCodecContext *avctx)
 }
 
 c->tile_shift = av_log2(c->tile_size);
-if (1U << c->tile_shift != c->tile_size) {
-av_log(avctx, AV_LOG_ERROR, "Tile size: %d, is not power of 2.\n", 
c->tile_size);
+if (1U << c->tile_shift != c->tile_size || c->tile_shift < 1) {
+av_log(avctx, AV_LOG_ERROR, "Tile size: %d, is not power of 2 > 1\n", 
c->tile_size);
 return AVERROR_INVALIDDATA;
 }
 
-- 
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] [PATCH 1/9] avformat/utils: check dts/duration to be representable before using them

2021-04-19 Thread Michael Niedermayer
Fixes: signed integer overflow: 6854513951393103890 + 3427256975738527712 
cannot be represented in type 'long'
Fixes: 
32936/clusterfuzz-testcase-minimized-ffmpeg_dem_R3D_fuzzer-5236914752978944

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index d4ec3d0190..26528f2a68 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1243,7 +1243,9 @@ static void update_initial_durations(AVFormatContext *s, 
AVStream *st,
 (pktl->pkt.dts == AV_NOPTS_VALUE ||
  pktl->pkt.dts == st->first_dts ||
  pktl->pkt.dts == RELATIVE_TS_BASE) &&
-!pktl->pkt.duration) {
+!pktl->pkt.duration &&
+av_sat_add64(cur_dts, duration) == cur_dts + (uint64_t)duration
+) {
 pktl->pkt.dts = cur_dts;
 if (!st->internal->avctx->has_b_frames)
 pktl->pkt.pts = cur_dts;
-- 
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] [PATCH 4/9] avformat/wtvdec: Improve size overflow checks in parse_chunks()

2021-04-19 Thread Michael Niedermayer
Fixes: signed integer overflow: 32 + 2147483647 cannot be represented in type 
'int
Fixes: 
32967/clusterfuzz-testcase-minimized-ffmpeg_dem_WTV_fuzzer-5132856218222592

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/wtvdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 44ca86d517..2f1b192cea 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -809,7 +809,7 @@ static int parse_chunks(AVFormatContext *s, int mode, 
int64_t seekts, int *len_p
 avio_skip(pb, 12);
 ff_get_guid(pb, );
 size = avio_rl32(pb);
-if (size < 0 || size > INT_MAX - 92)
+if (size < 0 || size > INT_MAX - 92 - consumed)
 return AVERROR_INVALIDDATA;
 parse_media_type(s, 0, sid, mediatype, subtype, formattype, 
size);
 consumed += 92 + size;
@@ -825,7 +825,7 @@ static int parse_chunks(AVFormatContext *s, int mode, 
int64_t seekts, int *len_p
 avio_skip(pb, 12);
 ff_get_guid(pb, );
 size = avio_rl32(pb);
-if (size < 0 || size > INT_MAX - 76)
+if (size < 0 || size > INT_MAX - 76 - consumed)
 return AVERROR_INVALIDDATA;
 parse_media_type(s, s->streams[stream_index], sid, mediatype, 
subtype, formattype, size);
 consumed += 76 + size;
-- 
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] [PATCH 8/9] tools/target_dec_fuzzer: Adjust threshold for TAK

2021-04-19 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
33346/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TAK_fuzzer-4715352157192192

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

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 80da7afcb8..6d19cff6f2 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -190,6 +190,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 case AV_CODEC_ID_SCREENPRESSO:maxpixels  /= 64;break;
 case AV_CODEC_ID_SMACKVIDEO:  maxpixels  /= 64;break;
 case AV_CODEC_ID_SNOW:maxpixels  /= 128;   break;
+case AV_CODEC_ID_TAK: maxsamples /= 1024;  break;
 case AV_CODEC_ID_TGV: maxpixels  /= 32;break;
 case AV_CODEC_ID_THEORA:  maxpixels  /= 1024;  break;
 case AV_CODEC_ID_TRUEMOTION2: maxpixels  /= 1024;  break;
-- 
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] [PATCH 7/9] avformat/id3v2: Check end for overflow in id3v2_parse()

2021-04-19 Thread Michael Niedermayer
Fixes: signed integer overflow: 9223372036840103978 + 67637280 cannot be 
represented in type 'long'
Fixes: 
33341/clusterfuzz-testcase-minimized-ffmpeg_dem_DSF_fuzzer-6408154041679872

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 libavformat/id3v2.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index e0fef08789..0f7035d4c5 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -824,7 +824,7 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary 
**metadata,
 int isv34, unsync;
 unsigned tlen;
 char tag[5];
-int64_t next, end = avio_tell(pb) + len;
+int64_t next, end = avio_tell(pb);
 int taghdrlen;
 const char *reason = NULL;
 AVIOContext pb_local;
@@ -836,6 +836,10 @@ static void id3v2_parse(AVIOContext *pb, AVDictionary 
**metadata,
 av_unused int uncompressed_buffer_size = 0;
 const char *comm_frame;
 
+if (av_sat_add64(end, len) != end + (uint64_t)len)
+return;
+end += len;
+
 av_log(s, AV_LOG_DEBUG, "id3v2 ver:%d flags:%02X len:%d\n", version, 
flags, len);
 
 switch (version) {
@@ -1057,7 +1061,7 @@ seek:
 
 /* Footer preset, always 10 bytes, skip over it */
 if (version == 4 && flags & 0x10)
-end += 10;
+end = av_sat_add64(end, 10);
 
 error:
 if (reason)
-- 
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] [PATCH 5/9] avcodec/vc1: Check remaining bits in ff_vc1_parse_frame_header()

2021-04-19 Thread Michael Niedermayer
Fixes: Timeout
Fixes: 
33156/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV3_fuzzer-6259655027326976

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

diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c
index b7140c089c..40e2b4d692 100644
--- a/libavcodec/vc1.c
+++ b/libavcodec/vc1.c
@@ -672,6 +672,8 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* 
gb)
 if (v->s.pict_type == AV_PICTURE_TYPE_P)
 v->rnd ^= 1;
 
+if (get_bits_left(gb) < 5)
+return AVERROR_INVALIDDATA;
 /* Quantizer stuff */
 pqindex = get_bits(gb, 5);
 if (!pqindex)
@@ -764,6 +766,9 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* 
gb)
 av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: "
"Imode: %i, Invert: %i\n", status>>1, status&1);
 
+if (get_bits_left(gb) < 4)
+return AVERROR_INVALIDDATA;
+
 /* Hopefully this is correct for P-frames */
 v->s.mv_table_index = get_bits(gb, 2); //but using ff_vc1_ tables
 v->cbptab = get_bits(gb, 2);
-- 
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] [PATCH 6/9] avcodec/adpcm: Set vqa_version before use in init

2021-04-19 Thread Michael Niedermayer
Fixes: null pointer dereference
Fixes: 
33172/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_WS_fuzzer-5200164273913856

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

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index be14607eac..2deefeb651 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -191,6 +191,8 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
 avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
 break;
 case AV_CODEC_ID_ADPCM_IMA_WS:
+if (avctx->extradata && avctx->extradata_size >= 2)
+c->vqa_version = AV_RL16(avctx->extradata);
 avctx->sample_fmt = c->vqa_version == 3 ? AV_SAMPLE_FMT_S16P :
   AV_SAMPLE_FMT_S16;
 break;
-- 
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] [PATCH 2/9] avformat/mov: Limit nb_chapter_tracks to input size

2021-04-19 Thread Michael Niedermayer
Fixes: Timeout (15k loop iterations instead of 400m)
Fixes: 
31368/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6601583174483968

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

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 9ca1ac89a8..add1e94641 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -4687,6 +4687,8 @@ static int mov_read_chap(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 for (i = 0; i < num && !pb->eof_reached; i++)
 c->chapter_tracks[i] = avio_rb32(pb);
 
+c->nb_chapter_tracks = i;
+
 return 0;
 }
 
-- 
2.17.1

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

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


Re: [FFmpeg-devel] [PATCH 88/90] avfilter: Constify all AVFilters

2021-04-19 Thread Nicolas George
Andreas Rheinhardt (12021-04-19):
> This is possible now that the next-API is gone.
> 
> Signed-off-by: Andreas Rheinhardt 

Ok.

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


[FFmpeg-devel] [PATCH 89/90] avdevice: Constify all devices

2021-04-19 Thread Andreas Rheinhardt
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt 
---
 libavdevice/alldevices.c  | 66 +--
 libavdevice/alsa_dec.c|  2 +-
 libavdevice/alsa_enc.c|  2 +-
 libavdevice/android_camera.c  |  2 +-
 libavdevice/audiotoolbox.m|  2 +-
 libavdevice/avfoundation.m|  2 +-
 libavdevice/bktr.c|  2 +-
 libavdevice/caca.c|  2 +-
 libavdevice/decklink_dec_c.c  |  2 +-
 libavdevice/decklink_enc_c.c  |  2 +-
 libavdevice/dshow.c   |  2 +-
 libavdevice/fbdev_dec.c   |  2 +-
 libavdevice/fbdev_enc.c   |  2 +-
 libavdevice/gdigrab.c |  2 +-
 libavdevice/iec61883.c|  2 +-
 libavdevice/jack.c|  2 +-
 libavdevice/kmsgrab.c |  2 +-
 libavdevice/lavfi.c   |  2 +-
 libavdevice/libcdio.c |  2 +-
 libavdevice/libdc1394.c   |  2 +-
 libavdevice/openal-dec.c  |  2 +-
 libavdevice/opengl_enc.c  |  2 +-
 libavdevice/oss_dec.c |  2 +-
 libavdevice/oss_enc.c |  2 +-
 libavdevice/pulse_audio_dec.c |  2 +-
 libavdevice/pulse_audio_enc.c |  2 +-
 libavdevice/sdl2.c|  2 +-
 libavdevice/sndio_dec.c   |  2 +-
 libavdevice/sndio_enc.c   |  2 +-
 libavdevice/v4l2.c|  2 +-
 libavdevice/v4l2enc.c |  2 +-
 libavdevice/vfwcap.c  |  2 +-
 libavdevice/xcbgrab.c |  2 +-
 libavdevice/xv.c  |  2 +-
 34 files changed, 66 insertions(+), 66 deletions(-)

diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index f65317018a..fbbe187a51 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -24,41 +24,41 @@
 #include "avdevice.h"
 
 /* devices */
-extern AVInputFormat  ff_alsa_demuxer;
-extern AVOutputFormat ff_alsa_muxer;
-extern AVInputFormat  ff_android_camera_demuxer;
-extern AVOutputFormat ff_audiotoolbox_muxer;
-extern AVInputFormat  ff_avfoundation_demuxer;
-extern AVInputFormat  ff_bktr_demuxer;
-extern AVOutputFormat ff_caca_muxer;
-extern AVInputFormat  ff_decklink_demuxer;
-extern AVOutputFormat ff_decklink_muxer;
-extern AVInputFormat  ff_dshow_demuxer;
-extern AVInputFormat  ff_fbdev_demuxer;
-extern AVOutputFormat ff_fbdev_muxer;
-extern AVInputFormat  ff_gdigrab_demuxer;
-extern AVInputFormat  ff_iec61883_demuxer;
-extern AVInputFormat  ff_jack_demuxer;
-extern AVInputFormat  ff_kmsgrab_demuxer;
-extern AVInputFormat  ff_lavfi_demuxer;
-extern AVInputFormat  ff_openal_demuxer;
-extern AVOutputFormat ff_opengl_muxer;
-extern AVInputFormat  ff_oss_demuxer;
-extern AVOutputFormat ff_oss_muxer;
-extern AVInputFormat  ff_pulse_demuxer;
-extern AVOutputFormat ff_pulse_muxer;
-extern AVOutputFormat ff_sdl2_muxer;
-extern AVInputFormat  ff_sndio_demuxer;
-extern AVOutputFormat ff_sndio_muxer;
-extern AVInputFormat  ff_v4l2_demuxer;
-extern AVOutputFormat ff_v4l2_muxer;
-extern AVInputFormat  ff_vfwcap_demuxer;
-extern AVInputFormat  ff_xcbgrab_demuxer;
-extern AVOutputFormat ff_xv_muxer;
+extern const AVInputFormat  ff_alsa_demuxer;
+extern const AVOutputFormat ff_alsa_muxer;
+extern const AVInputFormat  ff_android_camera_demuxer;
+extern const AVOutputFormat ff_audiotoolbox_muxer;
+extern const AVInputFormat  ff_avfoundation_demuxer;
+extern const AVInputFormat  ff_bktr_demuxer;
+extern const AVOutputFormat ff_caca_muxer;
+extern const AVInputFormat  ff_decklink_demuxer;
+extern const AVOutputFormat ff_decklink_muxer;
+extern const AVInputFormat  ff_dshow_demuxer;
+extern const AVInputFormat  ff_fbdev_demuxer;
+extern const AVOutputFormat ff_fbdev_muxer;
+extern const AVInputFormat  ff_gdigrab_demuxer;
+extern const AVInputFormat  ff_iec61883_demuxer;
+extern const AVInputFormat  ff_jack_demuxer;
+extern const AVInputFormat  ff_kmsgrab_demuxer;
+extern const AVInputFormat  ff_lavfi_demuxer;
+extern const AVInputFormat  ff_openal_demuxer;
+extern const AVOutputFormat ff_opengl_muxer;
+extern const AVInputFormat  ff_oss_demuxer;
+extern const AVOutputFormat ff_oss_muxer;
+extern const AVInputFormat  ff_pulse_demuxer;
+extern const AVOutputFormat ff_pulse_muxer;
+extern const AVOutputFormat ff_sdl2_muxer;
+extern const AVInputFormat  ff_sndio_demuxer;
+extern const AVOutputFormat ff_sndio_muxer;
+extern const AVInputFormat  ff_v4l2_demuxer;
+extern const AVOutputFormat ff_v4l2_muxer;
+extern const AVInputFormat  ff_vfwcap_demuxer;
+extern const AVInputFormat  ff_xcbgrab_demuxer;
+extern const AVOutputFormat ff_xv_muxer;
 
 /* external libraries */
-extern AVInputFormat  ff_libcdio_demuxer;
-extern AVInputFormat  ff_libdc1394_demuxer;
+extern const AVInputFormat  ff_libcdio_demuxer;
+extern const AVInputFormat  ff_libdc1394_demuxer;
 
 #include "libavdevice/outdev_list.c"
 #include "libavdevice/indev_list.c"
diff --git a/libavdevice/alsa_dec.c b/libavdevice/alsa_dec.c
index d8d4f3293b..e93f31b146 100644
--- a/libavdevice/alsa_dec.c
+++ b/libavdevice/alsa_dec.c
@@ -157,7 +157,7 @@ static const AVClass alsa_demuxer_class = {
 .category   = 

Re: [FFmpeg-devel] [PATCH] avformat/mpegtsenc: private_stream_1 is not asynchronous KLV

2021-04-19 Thread Mao Hata

On 2021/04/20 1:36, zheng qian wrote:

I'm working on ARIB related patches for mpegtsenc.c and later
I would like to provide a patch to fix the bug of private_stream_2.

In current situation, mpegts_write_pes() incorrectly writes
private_stream_2 with actually a private_stream_1-like PES header
that shouldn't appear according to the ISO/IEC 13818-1 standard.

Regards,
zheng



Oh, thank you! (and I should have searched the mailing list carefully 
before submitting my patch..)
Your posted patches might be close to what I'm wishing for. I will check 
them.

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

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


Re: [FFmpeg-devel] [PATCH 59/87] Disable vf_uspp/mcdeint.

2021-04-19 Thread Carl Eugen Hoyos
Am Mo., 19. Apr. 2021 um 16:19 Uhr schrieb James Almer :
>
> From: Anton Khirnov 
>
> These filters depend on avcodec APIs that are to be removed. Some people
> have expressed potential interest in updating these filters, so they are
> merely disabled for now instead of being removed.

I still believe that updating these filters is simply a prerequisite
for the patchset.

Carl Eugen
___
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] avformat/mpegtsenc: Fix mpegts_write_pes() for private_stream_2 and other types

2021-04-19 Thread zheng qian
According to the PES packet definition defined in Table 2-17
of ISO_IEC_13818-1 specification, some fields like PTS/DTS or
pes_extension could only appears if the stream_id meets the
condition:

if (stream_id != 0xBC &&  // program_stream_map
stream_id != 0xBE &&  // padding_stream
stream_id != 0xBF &&  // private_stream_2
stream_id != 0xF0 &&  // ECM
stream_id != 0xF1 &&  // EMM
stream_id != 0xFF &&  // program_stream_directory
stream_id != 0xF2 &&  // DSMCC_stream
stream_id != 0xF8) // ITU-T Rec. H.222.1 type E stream

And the following stream_id types don't have fields like PTS/DTS:

else if ( stream_id == program_stream_map
|| stream_id == private_stream_2
|| stream_id == ECM
|| stream_id == EMM
|| stream_id == program_stream_directory
|| stream_id == DSMCC_stream
|| stream_id == ITU-T Rec. H.222.1 type E stream ) {
for (i = 0; i < PES_packet_length; i++) {
PES_packet_data_byte
}
}

Current implementation skipped the judgement of stream_id
causing some kind of stream like private_stream_2 to be
incorrectly written with PTS/DTS field. For example,
Japan DTV transmits news and alerts through ARIB superimpose
that utilizes private_stream_2 still could not be remuxed
correctly for now.

This patch fixes the remuxing of private_stream_2 and other
stream_id types.

Signed-off-by: zheng qian 
---
 libavformat/mpegtsenc.c | 108 ++--
 1 file changed, 60 insertions(+), 48 deletions(-)

diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index f302af84ff..da8fb381e5 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -1445,28 +1445,28 @@ static void mpegts_write_pes(AVFormatContext *s, 
AVStream *st,
 is_dvb_teletext = 0;
 if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) {
 if (st->codecpar->codec_id == AV_CODEC_ID_DIRAC)
-*q++ = STREAM_ID_EXTENDED_STREAM_ID;
+stream_id = STREAM_ID_EXTENDED_STREAM_ID;
 else
-*q++ = STREAM_ID_VIDEO_STREAM_0;
+stream_id = STREAM_ID_VIDEO_STREAM_0;
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
(st->codecpar->codec_id == AV_CODEC_ID_MP2 ||
 st->codecpar->codec_id == AV_CODEC_ID_MP3 ||
 st->codecpar->codec_id == AV_CODEC_ID_AAC)) {
-*q++ = STREAM_ID_AUDIO_STREAM_0;
+stream_id = STREAM_ID_AUDIO_STREAM_0;
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO &&
 st->codecpar->codec_id == AV_CODEC_ID_AC3 &&
 ts->m2ts_mode) {
-*q++ = STREAM_ID_EXTENDED_STREAM_ID;
+stream_id = STREAM_ID_EXTENDED_STREAM_ID;
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA &&
st->codecpar->codec_id == AV_CODEC_ID_TIMED_ID3) {
-*q++ = STREAM_ID_PRIVATE_STREAM_1;
+stream_id = STREAM_ID_PRIVATE_STREAM_1;
 } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) {
-*q++ = stream_id != -1 ? stream_id : STREAM_ID_METADATA_STREAM;
+stream_id = stream_id != -1 ? stream_id : 
STREAM_ID_METADATA_STREAM;
 
 if (stream_id == STREAM_ID_PRIVATE_STREAM_1) /* asynchronous 
KLV */
 pts = dts = AV_NOPTS_VALUE;
 } else {
-*q++ = STREAM_ID_PRIVATE_STREAM_1;
+stream_id = STREAM_ID_PRIVATE_STREAM_1;
 if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE) {
 if (st->codecpar->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
 is_dvb_subtitle = 1;
@@ -1475,6 +1475,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream 
*st,
 }
 }
 }
+*q++ = stream_id;
 header_len = 0;
 flags  = 0;
 if (pts != AV_NOPTS_VALUE) {
@@ -1524,50 +1525,61 @@ static void mpegts_write_pes(AVFormatContext *s, 
AVStream *st,
 }
 *q++ = len >> 8;
 *q++ = len;
-val  = 0x80;
-/* data alignment indicator is required for subtitle and data 
streams */
-if (st->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE || 
st->codecpar->codec_type == AVMEDIA_TYPE_DATA)
-val |= 0x04;
-*q++ = val;
-*q++ = flags;
-*q++ = header_len;
-if (pts != AV_NOPTS_VALUE) {
-write_pts(q, flags >> 6, pts);
-q += 5;
-}
-if (dts != AV_NOPTS_VALUE && pts != AV_NOPTS_VALUE && dts != pts) {
-write_pts(q, 1, dts);
-q += 5;
-}
-if (pes_extension && st->codecpar->codec_id == AV_CODEC_ID_DIRAC) {
-flags = 0x01;  /* set PES_extension_flag_2 */
-

Re: [FFmpeg-devel] [PATCH] avformat/mpegtsenc: private_stream_1 is not asynchronous KLV

2021-04-19 Thread zheng qian
On Tue, Apr 20, 2021 at 12:44 AM Mao Hata  wrote:
>
> The reason I created the patch was to fix the problem: when I transcode
> a transport stream based on ARIB-STD-B24, the PTS/DTS is removed from
> private_stream_1 streams, and, conversely, it is added to private_stream_2.
> "ISO/IEC 13818-1 Table 2-17 - PES packet" (sorry, the table number may
> have been shifted) defines the conditions under which PTS/DTS can exist
> as follows:
>
>  >if (stream_id != program_stream_map
>  > && stream_id != padding_stream
>  > && stream_id != private_stream_2
>  > && stream_id != ECM
>  > && stream_id != EMM
>  > && stream_id != program_stream_directory
>  > && stream_id != DSMCC_stream
>  > && stream_id != ITU-T Rec. H.222.1 type E stream) {
>
> So, private_stream_2 can not insert PTS/DTS. In addition, "ARIB-STD-B24,
> VOLUME3, Chapter5" defines private_stream_1 as "Synchronized PES"
> (mainly used for subtitles, with PTS/DTS inserted) and
> private_stream_2 as "Asynchronous PES" (mainly used for superinpose, no
> PTS/DTS inserted).

I'm working on ARIB related patches for mpegtsenc.c and later
I would like to provide a patch to fix the bug of private_stream_2.

In current situation, mpegts_write_pes() incorrectly writes
private_stream_2 with actually a private_stream_1-like PES header
that shouldn't appear according to the ISO/IEC 13818-1 standard.

Regards,
zheng

>  From these things, I misunderstood like that " PTS/DTS is generally
> inserted for private_stream_1, so the `if (stream_id ==
> STREAM_ID_PRIVATE_STREAM_1)` statement (I patched) must be a mistake! " ...
>
> Anyway, as I read the related code, I now understand that the problem
> should be solved specifically for ARIB-based transport stream (at
> "mpegts.c" or so.).
> Thank you again.
> ___
> 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 19/87] avcodec/mpegvideo_enc: Remove deprecated RTP-callback

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 462a54e2291e1fa18e1f1254d09739dfbb795617.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avcodec.h   | 14 --
 libavcodec/mpegvideo_enc.c | 21 -
 libavcodec/version.h   |  3 ---
 3 files changed, 38 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 69f69a1aa4..064af12f31 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1387,20 +1387,6 @@ typedef struct AVCodecContext {
  */
 int trellis;
 
-#if FF_API_RTP_CALLBACK
-/**
- * @deprecated unused
- */
-/* The RTP callback: This function is called*/
-/* every time the encoder has a packet to send. */
-/* It depends on the encoder if the data starts */
-/* with a Start Code (it should). H.263 does.   */
-/* mb_nb contains the number of macroblocks */
-/* encoded in the RTP payload.  */
-attribute_deprecated
-void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, 
int mb_nb);
-#endif
-
 /**
  * pass1 encoding statistics output buffer
  * - encoding: Set by libavcodec.
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index f0490a39cc..1613d06023 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -2946,14 +2946,6 @@ static int encode_thread(AVCodecContext *c, void *arg){
 }
 }
 
-#if FF_API_RTP_CALLBACK
-FF_DISABLE_DEPRECATION_WARNINGS
-if (s->avctx->rtp_callback){
-int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + 
mb_x - s->resync_mb_x;
-s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, 
current_packet_size, number_mb);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 update_mb_info(s, 1);
 
 switch(s->codec_id){
@@ -3429,19 +3421,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
 write_slice_end(s);
 
-#if FF_API_RTP_CALLBACK
-FF_DISABLE_DEPRECATION_WARNINGS
-/* Send the last GOB if RTP */
-if (s->avctx->rtp_callback) {
-int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x;
-int pdif = put_bits_ptr(>pb) - s->ptr_lastgob;
-/* Call the RTP callback to send the last GOB */
-emms_c();
-s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 return 0;
 }
 
diff --git a/libavcodec/version.h b/libavcodec/version.h
index fbdc99abca..0e20d5c2e2 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -60,9 +60,6 @@
 #ifndef FF_API_AVPICTURE
 #define FF_API_AVPICTURE (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_RTP_CALLBACK
-#define FF_API_RTP_CALLBACK  (LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_VBV_DELAY
 #define FF_API_VBV_DELAY (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-- 
2.31.1

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

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


Re: [FFmpeg-devel] [PATCH] avformat/mpegtsenc: private_stream_1 is not asynchronous KLV

2021-04-19 Thread Mao Hata

On 2021/04/19 5:25, Marton Balint wrote:



On Sat, 17 Apr 2021, Mao Hata wrote:


According to ISO/IEC 13818-1, private_stream_1 is a synchronous
(has PTS/DTS) stream. Asynchronous one is private_stream_2.


Which section describes this?

Also keep in mind that code was added so that AV_CODEC_ID_SMPTE_KLV is 
handled in mpegts, and SMPTE RP 217 promotes the usage of 
private_stream_1, so I don't think this can be simply changed.


Regards,
Marton


Thank you for your reply. And I was not considering SMPTE (I misread the 
word "KLV" just an abbreviation for "Key-Length-Value"). Oh... I 
withdraw this patch.


The reason I created the patch was to fix the problem: when I transcode 
a transport stream based on ARIB-STD-B24, the PTS/DTS is removed from 
private_stream_1 streams, and, conversely, it is added to private_stream_2.
"ISO/IEC 13818-1 Table 2-17 - PES packet" (sorry, the table number may 
have been shifted) defines the conditions under which PTS/DTS can exist 
as follows:


>if (stream_id != program_stream_map
> && stream_id != padding_stream
> && stream_id != private_stream_2
> && stream_id != ECM
> && stream_id != EMM
> && stream_id != program_stream_directory
> && stream_id != DSMCC_stream
> && stream_id != ITU-T Rec. H.222.1 type E stream) {

So, private_stream_2 can not insert PTS/DTS. In addition, "ARIB-STD-B24, 
VOLUME3, Chapter5" defines private_stream_1 as "Synchronized PES" 
(mainly used for subtitles, with PTS/DTS inserted) and
private_stream_2 as "Asynchronous PES" (mainly used for superinpose, no 
PTS/DTS inserted).


From these things, I misunderstood like that " PTS/DTS is generally 
inserted for private_stream_1, so the `if (stream_id == 
STREAM_ID_PRIVATE_STREAM_1)` statement (I patched) must be a mistake! " ...


Anyway, as I read the related code, I now understand that the problem 
should be solved specifically for ARIB-based transport stream (at 
"mpegts.c" or so.).

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

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


[FFmpeg-devel] [PATCH 05/87] avcodec, avformat: Remove AVPacket.convergence_duration

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 948f3c19a8bd069768ca411212aaf8c1ed96b10d.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avcodec.h  |  8 
 libavcodec/avpacket.c | 16 
 libavcodec/packet.h   | 10 --
 libavcodec/parser.c   |  5 -
 libavcodec/version.h  |  3 ---
 libavformat/matroskadec.c |  8 
 libavformat/matroskaenc.c |  8 
 libavformat/srtenc.c  |  7 ---
 libavformat/utils.c   |  6 --
 9 files changed, 71 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b46b858416..81a18e2cde 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3386,14 +3386,6 @@ typedef struct AVCodecParserContext {
  */
 int key_frame;
 
-#if FF_API_CONVERGENCE_DURATION
-/**
- * @deprecated unused
- */
-attribute_deprecated
-int64_t convergence_duration;
-#endif
-
 // Timestamp generation support:
 /**
  * Synchronization point for start of timestamp generation.
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index b5bac5c5f2..b726a8db0e 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -39,11 +39,6 @@ void av_init_packet(AVPacket *pkt)
 pkt->dts  = AV_NOPTS_VALUE;
 pkt->pos  = -1;
 pkt->duration = 0;
-#if FF_API_CONVERGENCE_DURATION
-FF_DISABLE_DEPRECATION_WARNINGS
-pkt->convergence_duration = 0;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 pkt->flags= 0;
 pkt->stream_index = 0;
 pkt->buf  = NULL;
@@ -605,11 +600,6 @@ int av_packet_copy_props(AVPacket *dst, const AVPacket 
*src)
 dst->dts  = src->dts;
 dst->pos  = src->pos;
 dst->duration = src->duration;
-#if FF_API_CONVERGENCE_DURATION
-FF_DISABLE_DEPRECATION_WARNINGS
-dst->convergence_duration = src->convergence_duration;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 dst->flags= src->flags;
 dst->stream_index = src->stream_index;
 
@@ -742,12 +732,6 @@ void av_packet_rescale_ts(AVPacket *pkt, AVRational 
src_tb, AVRational dst_tb)
 pkt->dts = av_rescale_q(pkt->dts, src_tb, dst_tb);
 if (pkt->duration > 0)
 pkt->duration = av_rescale_q(pkt->duration, src_tb, dst_tb);
-#if FF_API_CONVERGENCE_DURATION
-FF_DISABLE_DEPRECATION_WARNINGS
-if (pkt->convergence_duration > 0)
-pkt->convergence_duration = av_rescale_q(pkt->convergence_duration, 
src_tb, dst_tb);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 }
 
 int avpriv_packet_list_put(PacketList **packet_buffer,
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index ca18ae631f..47e9b8999b 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -387,16 +387,6 @@ typedef struct AVPacket {
 int64_t duration;
 
 int64_t pos;///< byte position in stream, -1 
if unknown
-
-#if FF_API_CONVERGENCE_DURATION
-/**
- * @deprecated Same as the duration field, but as int64_t. This was 
required
- * for Matroska subtitles, whose duration values could overflow when the
- * duration field was still an int.
- */
-attribute_deprecated
-int64_t convergence_duration;
-#endif
 } AVPacket;
 
 #if FF_API_INIT_PACKET
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 11c41d6a0a..08b9945a57 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -67,11 +67,6 @@ found:
 goto err_out;
 }
 s->key_frame= -1;
-#if FF_API_CONVERGENCE_DURATION
-FF_DISABLE_DEPRECATION_WARNINGS
-s->convergence_duration = 0;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 s->dts_sync_point   = INT_MIN;
 s->dts_ref_dts_delta= INT_MIN;
 s->pts_dts_delta= INT_MIN;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 9b017d1980..b2882361bc 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -57,9 +57,6 @@
 #ifndef FF_API_VDPAU_PROFILE
 #define FF_API_VDPAU_PROFILE (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_CONVERGENCE_DURATION
-#define FF_API_CONVERGENCE_DURATION (LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_AVPICTURE
 #define FF_API_AVPICTURE (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e8c76f9cfb..116e331215 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -3572,14 +3572,6 @@ static int matroska_parse_frame(MatroskaDemuxContext 
*matroska,
 pkt->pos = pos;
 pkt->duration = lace_duration;
 
-#if FF_API_CONVERGENCE_DURATION
-FF_DISABLE_DEPRECATION_WARNINGS
-if (st->codecpar->codec_id == AV_CODEC_ID_SUBRIP) {
-pkt->convergence_duration = lace_duration;
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 res = avpriv_packet_list_put(>queue, >queue_end, pkt, 
NULL, 0);
 if (res < 0) {
 av_packet_unref(pkt);
diff --git a/libavformat/matroskaenc.c 

[FFmpeg-devel] [PATCH 07/87] avcodec: Remove deprecated stat-bits fields

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 16216b713f9a21865cc07993961cf5d0ece24916.

Signed-off-by: Andreas Rheinhardt 
---
 doc/codecs.texi|  9 -
 libavcodec/avcodec.h   | 24 
 libavcodec/mpegvideo_enc.c | 20 
 libavcodec/options_table.h | 11 ---
 libavcodec/snowenc.c   |  8 
 libavcodec/version.h   |  3 ---
 6 files changed, 75 deletions(-)

diff --git a/doc/codecs.texi b/doc/codecs.texi
index 9add7629cf..4a481dd5bf 100644
--- a/doc/codecs.texi
+++ b/doc/codecs.texi
@@ -150,15 +150,6 @@ Set strategy to choose between I/P/B-frames.
 @item ps @var{integer} (@emph{encoding,video})
 Set RTP payload size in bytes.
 
-@item mv_bits @var{integer}
-@item header_bits @var{integer}
-@item i_tex_bits @var{integer}
-@item p_tex_bits @var{integer}
-@item i_count @var{integer}
-@item p_count @var{integer}
-@item skip_count @var{integer}
-@item misc_bits @var{integer}
-@item frame_bits @var{integer}
 @item codec_tag @var{integer}
 @item bug @var{flags} (@emph{decoding,video})
 Workaround not auto detected encoder bugs.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 81a18e2cde..ee2350bcb0 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1525,30 +1525,6 @@ typedef struct AVCodecContext {
 /* headers inside the transmitted RTP payload.  */
 #endif
 
-#if FF_API_STAT_BITS
-/* statistics, used for 2-pass encoding */
-attribute_deprecated
-int mv_bits;
-attribute_deprecated
-int header_bits;
-attribute_deprecated
-int i_tex_bits;
-attribute_deprecated
-int p_tex_bits;
-attribute_deprecated
-int i_count;
-attribute_deprecated
-int p_count;
-attribute_deprecated
-int skip_count;
-attribute_deprecated
-int misc_bits;
-
-/** @deprecated this field is unused */
-attribute_deprecated
-int frame_bits;
-#endif
-
 /**
  * pass1 encoding statistics output buffer
  * - encoding: Set by libavcodec.
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 7909a5630a..e1864f2afb 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1841,20 +1841,6 @@ vbv_retry:
 if (ret < 0)
 return -1;
 
-#if FF_API_STAT_BITS
-FF_DISABLE_DEPRECATION_WARNINGS
-avctx->header_bits = s->header_bits;
-avctx->mv_bits = s->mv_bits;
-avctx->misc_bits   = s->misc_bits;
-avctx->i_tex_bits  = s->i_tex_bits;
-avctx->p_tex_bits  = s->p_tex_bits;
-avctx->i_count = s->i_count;
-// FIXME f/b_count in avctx
-avctx->p_count = s->mb_num - s->i_count - s->skip_count;
-avctx->skip_count  = s->skip_count;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 frame_end(s);
 
if ((CONFIG_MJPEG_ENCODER || CONFIG_AMV_ENCODER) && s->out_format == 
FMT_MJPEG)
@@ -2006,12 +1992,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 }
 s->total_bits += s->frame_bits;
-#if FF_API_STAT_BITS
-FF_DISABLE_DEPRECATION_WARNINGS
-avctx->frame_bits  = s->frame_bits;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 
 pkt->pts = s->current_picture.f->pts;
 if (!s->low_delay && s->pict_type != AV_PICTURE_TYPE_B) {
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 956132437a..b3d8a79f11 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -105,17 +105,6 @@ static const AVOption avcodec_options[] = {
 {"b_strategy", "strategy to choose between I/P/B-frames", 
OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, V|E},
 {"ps", "RTP payload size in bytes", OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, 
{.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
 #endif
-#if FF_API_STAT_BITS
-{"mv_bits", NULL, OFFSET(mv_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-{"header_bits", NULL, OFFSET(header_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-{"i_tex_bits", NULL, OFFSET(i_tex_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-{"p_tex_bits", NULL, OFFSET(p_tex_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-{"i_count", NULL, OFFSET(i_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-{"p_count", NULL, OFFSET(p_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-{"skip_count", NULL, OFFSET(skip_count), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-{"misc_bits", NULL, OFFSET(misc_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-{"frame_bits", NULL, OFFSET(frame_bits), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
-#endif
 {"codec_tag", NULL, OFFSET(codec_tag), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
INT_MIN, INT_MAX},
 {"bug", "work around not autodetected encoder bugs", OFFSET(workaround_bugs), 
AV_OPT_TYPE_FLAGS, {.i64 = FF_BUG_AUTODETECT }, INT_MIN, INT_MAX, V|D, "bug"},
 {"autodetect", NULL, 0, AV_OPT_TYPE_CONST, 

[FFmpeg-devel] [PATCH v2 32/32] avcodec: Switch AVCPBProperties to 64bits

2021-04-19 Thread Andreas Rheinhardt
From: Andreas Rheinhardt 

Announced in 2e8b0446c6798947dac77fee4a06f9c4e8131ab5.
Two FATE-tests needed to be updated because the checksums of
side data containing an AVCPBProperties struct changed.

buffer_size has also been switched to 64bits because it is a bitsize.

Signed-off-by: Andreas Rheinhardt 
---
Now also switching buffer_size to 64bits. This has the intended
side-effect of fixing the framecrc checksums for non-x64 arches.

 libavcodec/avcodec.h | 14 +-
 libavcodec/version.h |  3 ---
 libavformat/dump.c   |  4 
 tests/ref/fate/mxf-d10-user-comments |  2 +-
 tests/ref/fate/ts-demux  |  2 +-
 5 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 43b83ac348..684602f22f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -455,35 +455,23 @@ typedef struct AVCPBProperties {
  * Maximum bitrate of the stream, in bits per second.
  * Zero if unknown or unspecified.
  */
-#if FF_API_UNSANITIZED_BITRATES
-int max_bitrate;
-#else
 int64_t max_bitrate;
-#endif
 /**
  * Minimum bitrate of the stream, in bits per second.
  * Zero if unknown or unspecified.
  */
-#if FF_API_UNSANITIZED_BITRATES
-int min_bitrate;
-#else
 int64_t min_bitrate;
-#endif
 /**
  * Average bitrate of the stream, in bits per second.
  * Zero if unknown or unspecified.
  */
-#if FF_API_UNSANITIZED_BITRATES
-int avg_bitrate;
-#else
 int64_t avg_bitrate;
-#endif
 
 /**
  * The size of the buffer to which the ratecontrol is applied, in bits.
  * Zero if unknown or unspecified.
  */
-int buffer_size;
+int64_t buffer_size;
 
 /**
  * The delay between the time the packet this structure is associated with
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 17cd17c327..0830acf8b2 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -54,9 +54,6 @@
 #ifndef FF_API_CODED_FRAME
 #define FF_API_CODED_FRAME   (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_UNSANITIZED_BITRATES
-#define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_OPENH264_SLICE_MODE
 #define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 62ef5e9852..2b6ed1ed1f 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -322,11 +322,7 @@ static void dump_cpb(void *ctx, const AVPacketSideData *sd)
 }
 
 av_log(ctx, AV_LOG_INFO,
-#if FF_API_UNSANITIZED_BITRATES
-   "bitrate max/min/avg: %d/%d/%d buffer size: %d ",
-#else
"bitrate max/min/avg: %"PRId64"/%"PRId64"/%"PRId64" buffer size: %d 
",
-#endif
cpb->max_bitrate, cpb->min_bitrate, cpb->avg_bitrate,
cpb->buffer_size);
 if (cpb->vbv_delay == UINT64_MAX)
diff --git a/tests/ref/fate/mxf-d10-user-comments 
b/tests/ref/fate/mxf-d10-user-comments
index 13761fb0ce..609271ac05 100644
--- a/tests/ref/fate/mxf-d10-user-comments
+++ b/tests/ref/fate/mxf-d10-user-comments
@@ -6,7 +6,7 @@
 #codec_id 0: mpeg2video
 #dimensions 0: 1280x720
 #sar 0: 3/4
-0, -1,  0,1,   15, 0x0547870d, S=1,   24, 
0x5aa90ad0
+0, -1,  0,1,   15, 0x0547870d, S=1,   40, 
0x7ea50ad0
 0,  0,  1,1,   15, 0xe80a1612, F=0x0
 0,  1,  2,1,   15, 0xc5c50e2f, F=0x0
 0,  2,  3,1,   15, 0x51e28a04, F=0x0
diff --git a/tests/ref/fate/ts-demux b/tests/ref/fate/ts-demux
index cdf34d6af0..c20364483b 100644
--- a/tests/ref/fate/ts-demux
+++ b/tests/ref/fate/ts-demux
@@ -15,7 +15,7 @@
 1,   5760,   5760, 2880, 1536, 0xbab5129c
 1,   8640,   8640, 2880, 1536, 0x602f034b, S=1,1, 
0x00bd00bd
 1,  11520,  11520, 2880,  906, 0x69cdcbcd
-0,  32037,  36541, 1501,   114336, 0x37a215a8, S=2,1, 
0x00e000e0,   24, 0x663d0b52
+0,  32037,  36541, 1501,   114336, 0x37a215a8, S=2,1, 
0x00e000e0,   40, 0x91e10b52
 0,  33538,  33538, 1501,12560, 0xb559a3d4, F=0x0, S=1,
1, 0x00e000e0
 0,  35040,  35040, 1501,12704, 0x2614adf4, F=0x0, S=1,
1, 0x00e000e0
 0,  36541,  41046, 1501,51976, 0x9ff1dbfe, F=0x0, S=1,
1, 0x00e000e0
-- 
2.27.0

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

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


[FFmpeg-devel] [PATCH 00/87 v2] Major bump

2021-04-19 Thread James Almer
First version, including the bump notes, is here:
https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2021-April/278670.html

Most patches from the first version were already applied. And as mentioned in
the discussion there, this set here removes all the deprecated API one by one
before the actual major bump commit.
This is done to simplify bisecting for potential issues that can be tracked
back to one specific removal, instead of to a commit that bumped versions and
disabled everything simultaneously.

Andreas Rheinhardt (80):
  avcodec: Remove AVCodec, AVParser and AVBitStreamFilter next API
  avformat: Remove next API for AV(In|Out)putFormat
  avcodec, avformat: Remove old BSF API
  avcodec: Remove sidedata-only-packet cruft
  avcodec, avformat: Remove AVPacket.convergence_duration
  avcodec: Remove deprecated AVPacket API
  avcodec: Remove deprecated stat-bits fields
  avcodec: Remove deprecated coder type options
  avcodec: Remove deprecated API to split/merge side-data
  avcodec: Remove private options from AVCodecContext
  avcodec: Remove unneeded getters and setters
  avcodec: Remove deprecated av_codec_get_tag_string
  avcodec: Remove lock manager API
  avcodec: Remove remnants of user-visiable HW acceleration API
  avcodec: Remove deprecated avcodec_get_chroma_sub_sample
  avcodec/bitstream: Remove avpriv PutBits API functions
  avcodec/mpeg4audio: Remove avpriv_mpeg4audio_get_config
  avcodec/codec2utils: Remove legacy avpriv functions
  avcodec/mpegvideo_enc: Remove deprecated RTP-callback
  avcodec: Remove deprecated ASS with inline timing
  avcodec/(movtext|srt|ttml|webvtt)enc: Reindent after previous commit
  avcodec: Remove deprecated avcodec_get_context_defaults3
  avcodec/options: Remove deprecated avcodec_copy_context
  avcodec/vdpau: Remove deprecated av_vdpau_get_profile
  avcodec: Remove deprecated AVPicture API
  avcodec/imgconvert: Remove deprecated parts of pixel format API
  avcodec: Remove deprecated VBV delay field
  avcodec: Remove deprecated old aliases for NVENC encoders
  avcodec/vaapi: Remove old and deprecated VAAPI context and header
  avcodec/mpegvideo: Remove deprecated rc_strategy option
  avcodec/parser: Remove deprecated av_parser_change
  avcodec: Switch AVCPBProperties to 64bits
  avformat: Constify the API wrt AV(In|Out)putFormat
  avformat: Remove FFserver leftovers
  avformat: Remove deprecated old open callbacks
  avformat: Remove getters and setters
  avformat: Remove deprecated filename field from AVFormatContext
  avformat/avformat: Remove outdated private fields
  avformat/http: Remove deprecated "user-agent" option
  avformat/hlsenc: Remove deprecated wrap option
  avformat/hlsenc: Remove deprecated localtime options
  avformat: Remove remnants of side data merging
  avformat/mov, movenc: Enc exporting rotation via metadata
  avformat/aviobuf: End grace period of allowing 0 from read_packet
  avformat/rtsp: Remove deprecated old options, rename stimeout->timeout
  avformat/dashenc: Remove deprecated min_seg_duration option
  avformat: Remove deprecated AVFMT_FLAG_MP4A_LATM flag, latm option
  avformat: Remove deprecated av_demuxer_open()
  avformat: Switch AVChapter.id to 64bits
  avfilter/avfilter: Remove compatibility code for old filter options
  avfilter: Remove deprecated resample_lavr_opts
  avfilter: Remove deprecated avfilter_link_get_channels
  avfilter: Remove avfilter_next/avfilter_register API
  avfilter/avfilter: Remove deprecated avfilter_link_set_closed()
  avfilter/formats: Remove avfilter_make_format64_list()
  avfilter/transform: Stop exporting internal functions
  avfilter/Makefile: Don't compile transform.c unconditionally
  libswscale: Remove unused deprecated functions, make used ones static
  avcodec: Remove deprecated AVCodecContext.coded_frame
  avcodec: Remove deprecated old encode/decode APIs
  avutil/pixfmt: Remove deprecated VAAPI pixel formats
  avutil/frame: Remove AVFrame QP table API
  avutil/pixdesc: Remove deprecated off-by-one fields from pix fmt descs
  avutil/frame: Remove deprecated AVFrame.error
  avutil/frame: Remove deprecated AVFrame.pkt_pts field
  avutil: Switch crypto APIs to size_t
  avutil/frame: Remove deprecated getters and setters
  avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPAL
  avutil/buffer: Switch AVBuffer API to size_t
  avutil/cpu: Remove deprecated functions
  libavresample: Remove deprecated library
  avformat/avformat: Constify AVFormatContext.*_codec pointers
  avcodec/codec, allcodecs: Constify the AVCodec API
  avformat/avformat, utils: Make av_find_best_stream const-correct
  avdevice/avdevice: Constify avdevice_list_input_sources/output_sinks
  avdevice/avdevice: Constify av_*_device_next API
  avcodec: Constify AVCodecs
  avcodec: Constify AVCodecParserContext.parser
  avcodec: Constify all the AVCodecParsers
  avcodec: Move all AVCodecParser.split functions to
remove_extradata_bsf

Anton Khirnov (2):
  Disable vf_uspp/mcdeint.
  Bump major versions of all libraries.

James 

[FFmpeg-devel] [PATCH 25/87] avcodec: Remove deprecated AVPicture API

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in a17a7661906ba295d67afd80ac0770422e1b02b3.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/Makefile  |   2 -
 libavcodec/avcodec.h |  99 
 libavcodec/avpicture.c   |  82 
 libavcodec/dvbsubdec.c   |  12 ---
 libavcodec/dvdsubdec.c   |  18 
 libavcodec/dvdsubenc.c   |  14 ---
 libavcodec/imgconvert.c  | 156 +--
 libavcodec/libzvbi-teletextdec.c |   9 --
 libavcodec/pgssubdec.c   |  14 ---
 libavcodec/tests/.gitignore  |   1 -
 libavcodec/tests/imgconvert.c|  46 -
 libavcodec/version.h |   3 -
 libavcodec/xsubdec.c |  14 ---
 libavcodec/xsubenc.c |  13 ---
 14 files changed, 1 insertion(+), 482 deletions(-)
 delete mode 100644 libavcodec/avpicture.c
 delete mode 100644 libavcodec/tests/imgconvert.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index c11645616d..31b220025b 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -32,7 +32,6 @@ OBJS = ac3_parser.o   
  \
avcodec.o\
avdct.o  \
avpacket.o   \
-   avpicture.o  \
bitstream.o  \
bitstream_filters.o  \
bsf.o\
@@ -1213,7 +1212,6 @@ TESTPROGS = avpacket  
  \
 celp_math   \
 codec_desc  \
 htmlsubtitles   \
-imgconvert  \
 jpeg2000dwt \
 mathops\
 utils   \
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ea60e1fe46..315246e68e 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2418,33 +2418,6 @@ typedef struct AVHWAccel {
  * @}
  */
 
-#if FF_API_AVPICTURE
-/**
- * @defgroup lavc_picture AVPicture
- *
- * Functions for working with AVPicture
- * @{
- */
-
-/**
- * Picture data structure.
- *
- * Up to four components can be stored into it, the last component is
- * alpha.
- * @deprecated use AVFrame or imgutils functions instead
- */
-typedef struct AVPicture {
-attribute_deprecated
-uint8_t *data[AV_NUM_DATA_POINTERS];///< pointers to the image data 
planes
-attribute_deprecated
-int linesize[AV_NUM_DATA_POINTERS]; ///< number of bytes per line
-} AVPicture;
-
-/**
- * @}
- */
-#endif
-
 enum AVSubtitleType {
 SUBTITLE_NONE,
 
@@ -2472,13 +2445,6 @@ typedef struct AVSubtitleRect {
 int h; ///< height   of pict, undefined when pict is not 
set
 int nb_colors; ///< number of colors in pict, undefined when pict is not 
set
 
-#if FF_API_AVPICTURE
-/**
- * @deprecated unused
- */
-attribute_deprecated
-AVPicture pict;
-#endif
 /**
  * data+linesize for the bitmap of this subtitle.
  * Can be set for text/ass as well once they are rendered.
@@ -3445,71 +3411,6 @@ int avcodec_encode_subtitle(AVCodecContext *avctx, 
uint8_t *buf, int buf_size,
  * @}
  */
 
-#if FF_API_AVPICTURE
-/**
- * @addtogroup lavc_picture
- * @{
- */
-
-/**
- * @deprecated unused
- */
-attribute_deprecated
-int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, 
int height);
-
-/**
- * @deprecated unused
- */
-attribute_deprecated
-void avpicture_free(AVPicture *picture);
-
-/**
- * @deprecated use av_image_fill_arrays() instead.
- */
-attribute_deprecated
-int avpicture_fill(AVPicture *picture, const uint8_t *ptr,
-   enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * @deprecated use av_image_copy_to_buffer() instead.
- */
-attribute_deprecated
-int avpicture_layout(const AVPicture *src, enum AVPixelFormat pix_fmt,
- int width, int height,
- unsigned char *dest, int dest_size);
-
-/**
- * @deprecated use av_image_get_buffer_size() instead.
- */
-attribute_deprecated
-int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * @deprecated av_image_copy() instead.
- */
-attribute_deprecated
-void av_picture_copy(AVPicture *dst, const AVPicture *src,
- enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * @deprecated unused
- */
-attribute_deprecated
-int 

Re: [FFmpeg-devel] [PATCH 84/87] avfilter/buffersrc: postpone removal of sws_param

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> It was depreacted less than two years ago
> 
> Signed-off-by: James Almer 
> ---
>  libavfilter/version.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

No objection.

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 57/87] avfilter/Makefile: Don't compile transform.c unconditionally

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> From: Andreas Rheinhardt 
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/Makefile | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Should be ok.

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 56/87] avfilter/transform: Stop exporting internal functions

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> From: Andreas Rheinhardt 
> 
> avfilter_transform, avfilter_(add|sub|mult)_matrix are not part of the
> public API (transform.h is not a public header), yet they are currently
> exported because of their name. This commit changes this:
> avfilter_transform is renamed to ff_affine_transform; the other
> functions are just removed as they have never been used at all.
> 
> Found-by: Anton Khirnov 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/transform.c  | 23 +--
>  libavfilter/transform.h  | 29 +
>  libavfilter/vf_deshake.c |  5 +++--
>  3 files changed, 5 insertions(+), 52 deletions(-)

Should be ok.

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 55/87] avfilter/formats: Remove avfilter_make_format64_list()

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> From: Andreas Rheinhardt 
> 
> The API it is part of has been made private long ago (see commit
> b74a1da49db5ebed51aceae6cacc2329288a92c1).
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/formats.c | 7 ---
>  libavfilter/formats.h | 4 
>  2 files changed, 11 deletions(-)

Ok.

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 54/87] avfilter/avfilter: Remove deprecated avfilter_link_set_closed()

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> From: Andreas Rheinhardt 
> 
> Deprecated in 39a09e995d32d16e4f8c87a6ff5273cb9d98146e.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/avfilter.c | 6 --
>  libavfilter/avfilter.h | 9 -
>  libavfilter/version.h  | 3 ---
>  3 files changed, 18 deletions(-)

Ok.

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 53/87] avfilter: Remove avfilter_next/avfilter_register API

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> From: Andreas Rheinhardt 
> 
> Deprecated in 8f1382f80e0d4184c54c14afdda6482f050fbba7.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/allfilters.c | 38 --
>  libavfilter/avfilter.h   | 35 ---
>  libavfilter/version.h|  3 ---
>  3 files changed, 76 deletions(-)

Ok.

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 52/87] avfilter: Remove deprecated avfilter_link_get_channels

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> From: Andreas Rheinhardt 
> 
> Deprecated in b2c42fc6dc3502a8b6cae441c54d898972a51cff.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/avfilter.c | 7 ---
>  libavfilter/avfilter.h | 8 
>  libavfilter/version.h  | 3 ---
>  3 files changed, 18 deletions(-)

Ok.

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 51/87] avfilter: Remove deprecated resample_lavr_opts

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> From: Andreas Rheinhardt 
> 
> Deprecated in 3796fb2692f87dfc0aa4572ac025a6469c2b.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/avfilter.h  | 3 ---
>  libavfilter/avfiltergraph.c | 3 ---
>  libavfilter/version.h   | 3 ---
>  3 files changed, 9 deletions(-)

Ok.

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 50/87] avfilter/avfilter: Remove compatibility code for old filter options

2021-04-19 Thread Nicolas George
James Almer (12021-04-19):
> From: Andreas Rheinhardt 
> 
> Added in ad7d972e08dddb1788ac6a434d1be314febcb09d; the old syntax has
> been deprecated in b439c992c23f3e0f3832fffd2a34a664b236c525.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavfilter/avfilter.c | 82 ++
>  libavfilter/version.h  |  3 --
>  2 files changed, 3 insertions(+), 82 deletions(-)

Ok.

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


[FFmpeg-devel] [PATCH 87/87] Bump major versions of all libraries.

2021-04-19 Thread James Almer
From: Anton Khirnov 

---
 libavcodec/version.h| 6 +++---
 libavdevice/version.h   | 4 ++--
 libavfilter/version.h   | 4 ++--
 libavformat/version.h   | 4 ++--
 libavutil/version.h | 4 ++--
 libpostproc/version.h   | 4 ++--
 libswresample/version.h | 4 ++--
 libswscale/version.h| 4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/libavcodec/version.h b/libavcodec/version.h
index 414cfee1cd..8d37666d5e 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -27,9 +27,9 @@
 
 #include "libavutil/version.h"
 
-#define LIBAVCODEC_VERSION_MAJOR  58
-#define LIBAVCODEC_VERSION_MINOR 136
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MAJOR  59
+#define LIBAVCODEC_VERSION_MINOR   0
+#define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
diff --git a/libavdevice/version.h b/libavdevice/version.h
index 9fea3252c1..6021a0dd65 100644
--- a/libavdevice/version.h
+++ b/libavdevice/version.h
@@ -27,8 +27,8 @@
 
 #include "libavutil/version.h"
 
-#define LIBAVDEVICE_VERSION_MAJOR  58
-#define LIBAVDEVICE_VERSION_MINOR  14
+#define LIBAVDEVICE_VERSION_MAJOR  59
+#define LIBAVDEVICE_VERSION_MINOR   0
 #define LIBAVDEVICE_VERSION_MICRO 100
 
 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
diff --git a/libavfilter/version.h b/libavfilter/version.h
index dcac3e91ef..4325551d95 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -29,8 +29,8 @@
 
 #include "libavutil/version.h"
 
-#define LIBAVFILTER_VERSION_MAJOR   7
-#define LIBAVFILTER_VERSION_MINOR 111
+#define LIBAVFILTER_VERSION_MAJOR   8
+#define LIBAVFILTER_VERSION_MINOR   0
 #define LIBAVFILTER_VERSION_MICRO 100
 
 
diff --git a/libavformat/version.h b/libavformat/version.h
index 75568212c2..987a38dbb4 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,8 +31,8 @@
 
 // Major bumping may affect Ticket5467, 5421, 5451(compatibility with Chromium)
 // Also please add any ticket numbers that you believe might be affected here
-#define LIBAVFORMAT_VERSION_MAJOR  58
-#define LIBAVFORMAT_VERSION_MINOR  78
+#define LIBAVFORMAT_VERSION_MAJOR  59
+#define LIBAVFORMAT_VERSION_MINOR   0
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
diff --git a/libavutil/version.h b/libavutil/version.h
index eb380bc0d7..e11eaa20d0 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -78,8 +78,8 @@
  * @{
  */
 
-#define LIBAVUTIL_VERSION_MAJOR  56
-#define LIBAVUTIL_VERSION_MINOR  73
+#define LIBAVUTIL_VERSION_MAJOR  57
+#define LIBAVUTIL_VERSION_MINOR   0
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
diff --git a/libpostproc/version.h b/libpostproc/version.h
index 2dca25328a..3819b68997 100644
--- a/libpostproc/version.h
+++ b/libpostproc/version.h
@@ -28,8 +28,8 @@
 
 #include "libavutil/avutil.h"
 
-#define LIBPOSTPROC_VERSION_MAJOR  55
-#define LIBPOSTPROC_VERSION_MINOR  10
+#define LIBPOSTPROC_VERSION_MAJOR  56
+#define LIBPOSTPROC_VERSION_MINOR   0
 #define LIBPOSTPROC_VERSION_MICRO 100
 
 #define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \
diff --git a/libswresample/version.h b/libswresample/version.h
index 35cf7f0c14..ed7ce529d2 100644
--- a/libswresample/version.h
+++ b/libswresample/version.h
@@ -28,8 +28,8 @@
 
 #include "libavutil/avutil.h"
 
-#define LIBSWRESAMPLE_VERSION_MAJOR   3
-#define LIBSWRESAMPLE_VERSION_MINOR  10
+#define LIBSWRESAMPLE_VERSION_MAJOR   4
+#define LIBSWRESAMPLE_VERSION_MINOR   0
 #define LIBSWRESAMPLE_VERSION_MICRO 100
 
 #define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, 
\
diff --git a/libswscale/version.h b/libswscale/version.h
index f7bade61ca..f86a8049c1 100644
--- a/libswscale/version.h
+++ b/libswscale/version.h
@@ -26,8 +26,8 @@
 
 #include "libavutil/version.h"
 
-#define LIBSWSCALE_VERSION_MAJOR   5
-#define LIBSWSCALE_VERSION_MINOR  10
+#define LIBSWSCALE_VERSION_MAJOR   6
+#define LIBSWSCALE_VERSION_MINOR   0
 #define LIBSWSCALE_VERSION_MICRO 100
 
 #define LIBSWSCALE_VERSION_INT  AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \
-- 
2.31.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 10/87] avcodec: Remove private options from AVCodecContext

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Several options that were too codec-specific were deprecated between
0e6c8532215790bbe560a9eea4f3cc82bb55cf92 and
0e9c4fe254073b209970df3e3cb84531bc388e99.

Signed-off-by: Andreas Rheinhardt 
---
 doc/codecs.texi| 100 -
 libavcodec/alacenc.c   |  26 -
 libavcodec/avcodec.h   | 112 -
 libavcodec/ffv1enc.c   |  10 
 libavcodec/flacenc.c   |  36 
 libavcodec/huffyuvenc.c|  26 -
 libavcodec/j2kenc.c|   7 ---
 libavcodec/jpeglsenc.c |   7 ---
 libavcodec/libvpxenc.c |  12 
 libavcodec/libx264.c   |  33 ---
 libavcodec/libxavs.c   |  28 --
 libavcodec/libxvid.c   |   7 ---
 libavcodec/ljpegenc.c  |  14 -
 libavcodec/mpeg12dec.c |   7 ---
 libavcodec/mpeg12enc.c |   7 ---
 libavcodec/mpegvideo_enc.c |  71 ---
 libavcodec/options_table.h |  48 
 libavcodec/pngenc.c|   9 ---
 libavcodec/qsvenc.c|   6 --
 libavcodec/qsvenc_h264.c   |   3 -
 libavcodec/qsvenc_hevc.c   |   3 -
 libavcodec/qsvenc_mpeg2.c  |   3 -
 libavcodec/snowenc.c   |  14 -
 libavcodec/utvideoenc.c|  28 --
 libavcodec/version.h   |   3 -
 25 files changed, 620 deletions(-)

diff --git a/doc/codecs.texi b/doc/codecs.texi
index 702caa2a1d..5e10020900 100644
--- a/doc/codecs.texi
+++ b/doc/codecs.texi
@@ -144,12 +144,6 @@ Default value is 0.
 @item b_qfactor @var{float} (@emph{encoding,video})
 Set qp factor between P and B frames.
 
-@item b_strategy @var{integer} (@emph{encoding,video})
-Set strategy to choose between I/P/B-frames.
-
-@item ps @var{integer} (@emph{encoding,video})
-Set RTP payload size in bytes.
-
 @item codec_tag @var{integer}
 @item bug @var{flags} (@emph{decoding,video})
 Workaround not auto detected encoder bugs.
@@ -239,9 +233,6 @@ consider things that a sane encoder should not do as an 
error
 
 @item block_align @var{integer}
 
-@item mpeg_quant @var{integer} (@emph{encoding,video})
-Use MPEG quantizers instead of H.263.
-
 @item rc_override_count @var{integer}
 
 @item maxrate @var{integer} (@emph{encoding,audio,video})
@@ -347,19 +338,6 @@ favor predicting from the previous frame instead of the 
current
 
 @item bits_per_coded_sample @var{integer}
 
-@item pred @var{integer} (@emph{encoding,video})
-Set prediction method.
-
-Possible values:
-@table @samp
-@item left
-
-@item plane
-
-@item median
-
-@end table
-
 @item aspect @var{rational number} (@emph{encoding,video})
 Set sample aspect ratio.
 
@@ -576,9 +554,6 @@ sab diamond motion estimation
 @item last_pred @var{integer} (@emph{encoding,video})
 Set amount of motion predictors from the previous frame.
 
-@item preme @var{integer} (@emph{encoding,video})
-Set pre motion estimation.
-
 @item precmp @var{integer} (@emph{encoding,video})
 Set pre motion estimation compare function.
 
@@ -627,9 +602,6 @@ Set limit motion vectors range (1023 for DivX player).
 
 @item global_quality @var{integer} (@emph{encoding,audio,video})
 
-@item context @var{integer} (@emph{encoding,video})
-Set context model.
-
 @item slice_flags @var{integer}
 
 @item mbd @var{integer} (@emph{encoding,video})
@@ -645,12 +617,6 @@ use fewest bits
 use best rate distortion
 @end table
 
-@item sc_threshold @var{integer} (@emph{encoding,video})
-Set scene change threshold.
-
-@item nr @var{integer} (@emph{encoding,video})
-Set noise reduction.
-
 @item rc_init_occupancy @var{integer} (@emph{encoding,video})
 Set number of bits which should be loaded into the rc buffer before
 decoding starts.
@@ -738,64 +704,12 @@ Possible values:
 @item lowres @var{integer} (@emph{decoding,audio,video})
 Decode at 1= 1/2, 2=1/4, 3=1/8 resolutions.
 
-@item skip_threshold @var{integer} (@emph{encoding,video})
-Set frame skip threshold.
-
-@item skip_factor @var{integer} (@emph{encoding,video})
-Set frame skip factor.
-
-@item skip_exp @var{integer} (@emph{encoding,video})
-Set frame skip exponent.
-Negative values behave identical to the corresponding positive ones, except
-that the score is normalized.
-Positive values exist primarily for compatibility reasons and are not so 
useful.
-
-@item skipcmp @var{integer} (@emph{encoding,video})
-Set frame skip compare function.
-
-Possible values:
-@table @samp
-@item sad
-sum of absolute differences, fast (default)
-@item sse
-sum of squared errors
-@item satd
-sum of absolute Hadamard transformed differences
-@item dct
-sum of absolute DCT transformed differences
-@item psnr
-sum of squared quantization errors (avoid, low quality)
-@item bit
-number of bits needed for the block
-@item rd
-rate distortion optimal, slow
-@item zero
-0
-@item vsad
-sum of absolute vertical differences
-@item vsse
-sum of squared vertical differences
-@item nsse
-noise preserving sum of squared differences
-@item w53
-5/3 wavelet, only used in snow
-@item w97
-9/7 wavelet, only used in snow
-@item 

[FFmpeg-devel] [PATCH 12/87] avcodec: Remove deprecated av_codec_get_tag_string

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in f156d35321bb600b2309b78185d600b2fa64d84a.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avcodec.h | 16 
 libavcodec/utils.c   | 22 --
 libavcodec/version.h |  3 ---
 3 files changed, 41 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 612135dba5..0e86064ccb 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3636,22 +3636,6 @@ enum AVPixelFormat avcodec_default_get_format(struct 
AVCodecContext *s, const en
  * @}
  */
 
-#if FF_API_TAG_STRING
-/**
- * Put a string representing the codec tag codec_tag in buf.
- *
- * @param buf   buffer to place codec tag in
- * @param buf_size size in bytes of buf
- * @param codec_tag codec tag to assign
- * @return the length of the string that would have been generated if
- * enough space had been available, excluding the trailing null
- *
- * @deprecated see av_fourcc_make_string() and av_fourcc2str().
- */
-attribute_deprecated
-size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int 
codec_tag);
-#endif
-
 void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
 
 /**
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 25f69f59c6..643ea003df 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -453,28 +453,6 @@ const char *avcodec_get_name(enum AVCodecID id)
 return "unknown_codec";
 }
 
-#if FF_API_TAG_STRING
-size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int 
codec_tag)
-{
-int i, len, ret = 0;
-
-#define TAG_PRINT(x)  \
-(((x) >= '0' && (x) <= '9') ||\
- ((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') ||  \
- ((x) == '.' || (x) == ' ' || (x) == '-' || (x) == '_'))
-
-for (i = 0; i < 4; i++) {
-len = snprintf(buf, buf_size,
-   TAG_PRINT(codec_tag & 0xFF) ? "%c" : "[%d]", codec_tag 
& 0xFF);
-buf+= len;
-buf_size= buf_size > len ? buf_size - len : 0;
-ret+= len;
-codec_tag >>= 8;
-}
-return ret;
-}
-#endif
-
 const char *av_get_profile_name(const AVCodec *codec, int profile)
 {
 const AVProfile *p;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 87d54a4357..6d0f0f1d25 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -81,9 +81,6 @@
 #ifndef FF_API_STRUCT_VAAPI_CONTEXT
 #define FF_API_STRUCT_VAAPI_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_TAG_STRING
-#define FF_API_TAG_STRING(LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_GETCHROMA
 #define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-- 
2.31.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 08/87] avcodec: Remove deprecated coder type options

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in be00ec832c519427cd92218abac77dafdc1d5487.

Signed-off-by: Andreas Rheinhardt 
---
 doc/codecs.texi | 14 --
 libavcodec/avcodec.h| 12 
 libavcodec/ffv1enc.c| 17 -
 libavcodec/libopenh264enc.c | 10 --
 libavcodec/libx264.c|  9 -
 libavcodec/options_table.h  |  7 ---
 libavcodec/qsvenc.c |  6 --
 libavcodec/qsvenc_h264.c|  3 ---
 libavcodec/sgienc.c |  7 ---
 libavcodec/sunrastenc.c | 26 --
 libavcodec/targaenc.c   |  7 ---
 libavcodec/version.h|  3 ---
 12 files changed, 121 deletions(-)

diff --git a/doc/codecs.texi b/doc/codecs.texi
index 4a481dd5bf..702caa2a1d 100644
--- a/doc/codecs.texi
+++ b/doc/codecs.texi
@@ -627,20 +627,6 @@ Set limit motion vectors range (1023 for DivX player).
 
 @item global_quality @var{integer} (@emph{encoding,audio,video})
 
-@item coder @var{integer} (@emph{encoding,video})
-
-Possible values:
-@table @samp
-@item vlc
-variable length coder / huffman coder
-@item ac
-arithmetic coder
-@item raw
-raw (no encoding)
-@item rle
-run-length coder
-@end table
-
 @item context @var{integer} (@emph{encoding,video})
 Set context model.
 
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ee2350bcb0..b468ee7c6f 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1443,18 +1443,6 @@ typedef struct AVCodecContext {
  */
 int rc_initial_buffer_occupancy;
 
-#if FF_API_CODER_TYPE
-#define FF_CODER_TYPE_VLC   0
-#define FF_CODER_TYPE_AC1
-#define FF_CODER_TYPE_RAW   2
-#define FF_CODER_TYPE_RLE   3
-/**
- * @deprecated use encoder private options instead
- */
-attribute_deprecated
-int coder_type;
-#endif /* FF_API_CODER_TYPE */
-
 #if FF_API_PRIVATE_OPT
 /** @deprecated use encoder private options instead */
 attribute_deprecated
diff --git a/libavcodec/ffv1enc.c b/libavcodec/ffv1enc.c
index cdad65a4f9..de28ac44f1 100644
--- a/libavcodec/ffv1enc.c
+++ b/libavcodec/ffv1enc.c
@@ -554,13 +554,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
 return AVERROR_INVALIDDATA;
 }
 
-#if FF_API_CODER_TYPE
-FF_DISABLE_DEPRECATION_WARNINGS
-if (avctx->coder_type != -1)
-s->ac = avctx->coder_type > 0 ? AC_RANGE_CUSTOM_TAB : AC_GOLOMB_RICE;
-else
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 if (s->ac == 1) // Compatbility with common command line usage
 s->ac = AC_RANGE_CUSTOM_TAB;
 else if (s->ac == AC_RANGE_DEFAULT_TAB_FORCE)
@@ -1310,13 +1303,6 @@ static const AVClass ffv1_class = {
 .version= LIBAVUTIL_VERSION_INT,
 };
 
-#if FF_API_CODER_TYPE
-static const AVCodecDefault ffv1_defaults[] = {
-{ "coder", "-1" },
-{ NULL },
-};
-#endif
-
 AVCodec ff_ffv1_encoder = {
 .name   = "ffv1",
 .long_name  = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
@@ -1350,9 +1336,6 @@ AVCodec ff_ffv1_encoder = {
 AV_PIX_FMT_NONE
 
 },
-#if FF_API_CODER_TYPE
-.defaults   = ffv1_defaults,
-#endif
 .priv_class = _class,
 .caps_internal  = FF_CODEC_CAP_INIT_CLEANUP,
 };
diff --git a/libavcodec/libopenh264enc.c b/libavcodec/libopenh264enc.c
index 0eade73498..608fa59cdd 100644
--- a/libavcodec/libopenh264enc.c
+++ b/libavcodec/libopenh264enc.c
@@ -210,16 +210,6 @@ static av_cold int svc_encode_init(AVCodecContext *avctx)
 break;
 }
 
-#if FF_API_CODER_TYPE && FF_API_OPENH264_CABAC
-FF_DISABLE_DEPRECATION_WARNINGS
-if (s->coder < 0 && avctx->coder_type == FF_CODER_TYPE_AC)
-s->coder = 1;
-
-if (s->coder < 0)
-s->coder = s->cabac;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 if (s->profile == FF_PROFILE_UNKNOWN && s->coder >= 0)
 s->profile = s->coder == 0 ? FF_PROFILE_H264_CONSTRAINED_BASELINE :
 #if OPENH264_VER_AT_LEAST(1, 8)
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 4ddc4973a4..6d945fc3fb 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -747,12 +747,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 #endif
 if (avctx->keyint_min >= 0)
 x4->params.i_keyint_min = avctx->keyint_min;
-#if FF_API_CODER_TYPE
-FF_DISABLE_DEPRECATION_WARNINGS
-if (avctx->coder_type >= 0)
-x4->coder = avctx->coder_type == FF_CODER_TYPE_AC;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 if (avctx->me_cmp >= 0)
 x4->params.analyse.b_chroma_me = avctx->me_cmp & FF_CMP_CHROMA;
 
@@ -1174,9 +1168,6 @@ static const AVCodecDefault x264_defaults[] = {
 { "b_strategy",   "-1" },
 #endif
 { "keyint_min",   "-1" },
-#if FF_API_CODER_TYPE
-{ "coder","-1" },
-#endif
 { "cmp",  "-1" },
 { "threads",  AV_STRINGIFY(X264_THREADS_AUTO) },
 { "thread_type",  "0" },
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index b3d8a79f11..9b77428a50 100644
--- 

[FFmpeg-devel] [PATCH 86/87] avcodec: postpone removal of deprecated libopenh264 wrapper options

2021-04-19 Thread James Almer
They were deprecated only a year ago

Signed-off-by: James Almer 
---
 libavcodec/version.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/version.h b/libavcodec/version.h
index df2801401f..414cfee1cd 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -52,10 +52,10 @@
  */
 
 #ifndef FF_API_OPENH264_SLICE_MODE
-#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 59)
+#define FF_API_OPENH264_SLICE_MODE (LIBAVCODEC_VERSION_MAJOR < 60)
 #endif
 #ifndef FF_API_OPENH264_CABAC
-#define FF_API_OPENH264_CABAC  (LIBAVCODEC_VERSION_MAJOR < 59)
+#define FF_API_OPENH264_CABAC  (LIBAVCODEC_VERSION_MAJOR < 60)
 #endif
 #ifndef FF_API_UNUSED_CODEC_CAPS
 #define FF_API_UNUSED_CODEC_CAPS   (LIBAVCODEC_VERSION_MAJOR < 60)
-- 
2.31.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 11/87] avcodec: Remove unneeded getters and setters

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in c4131a0613c4b2c30c01b2550b41068815d27799.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avcodec.h | 39 ---
 libavcodec/utils.c   | 18 --
 libavcodec/version.h |  3 ---
 3 files changed, 60 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 696025ceda..612135dba5 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2221,47 +2221,8 @@ typedef struct AVCodecContext {
 int (*get_encode_buffer)(struct AVCodecContext *s, AVPacket *pkt, int 
flags);
 } AVCodecContext;
 
-#if FF_API_CODEC_GET_SET
-/**
- * Accessors for some AVCodecContext fields. These used to be provided for ABI
- * compatibility, and do not need to be used anymore.
- */
-attribute_deprecated
-AVRational av_codec_get_pkt_timebase (const AVCodecContext *avctx);
-attribute_deprecated
-void   av_codec_set_pkt_timebase (AVCodecContext *avctx, 
AVRational val);
-
-attribute_deprecated
-const AVCodecDescriptor *av_codec_get_codec_descriptor(const AVCodecContext 
*avctx);
-attribute_deprecated
-void av_codec_set_codec_descriptor(AVCodecContext *avctx, 
const AVCodecDescriptor *desc);
-
-attribute_deprecated
-unsigned av_codec_get_codec_properties(const AVCodecContext *avctx);
-
-attribute_deprecated
-int  av_codec_get_lowres(const AVCodecContext *avctx);
-attribute_deprecated
-void av_codec_set_lowres(AVCodecContext *avctx, int val);
-
-attribute_deprecated
-int  av_codec_get_seek_preroll(const AVCodecContext *avctx);
-attribute_deprecated
-void av_codec_set_seek_preroll(AVCodecContext *avctx, int val);
-
-attribute_deprecated
-uint16_t *av_codec_get_chroma_intra_matrix(const AVCodecContext *avctx);
-attribute_deprecated
-void av_codec_set_chroma_intra_matrix(AVCodecContext *avctx, uint16_t *val);
-#endif
-
 struct AVSubtitle;
 
-#if FF_API_CODEC_GET_SET
-attribute_deprecated
-int av_codec_get_max_lowres(const AVCodec *codec);
-#endif
-
 struct MpegEncContext;
 
 /**
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 896b99dc3f..25f69f59c6 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -429,24 +429,6 @@ enum AVPixelFormat avpriv_find_pix_fmt(const 
PixelFormatTag *tags,
 return AV_PIX_FMT_NONE;
 }
 
-#if FF_API_CODEC_GET_SET
-MAKE_ACCESSORS(AVCodecContext, codec, AVRational, pkt_timebase)
-MAKE_ACCESSORS(AVCodecContext, codec, const AVCodecDescriptor *, 
codec_descriptor)
-MAKE_ACCESSORS(AVCodecContext, codec, int, lowres)
-MAKE_ACCESSORS(AVCodecContext, codec, int, seek_preroll)
-MAKE_ACCESSORS(AVCodecContext, codec, uint16_t*, chroma_intra_matrix)
-
-unsigned av_codec_get_codec_properties(const AVCodecContext *codec)
-{
-return codec->properties;
-}
-
-int av_codec_get_max_lowres(const AVCodec *codec)
-{
-return codec->max_lowres;
-}
-#endif
-
 int avpriv_codec_get_cap_skip_frame_fill_param(const AVCodec *codec){
 return !!(codec->caps_internal & FF_CODEC_CAP_SKIP_FRAME_FILL_PARAM);
 }
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 2cca9839e2..87d54a4357 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -87,9 +87,6 @@
 #ifndef FF_API_GETCHROMA
 #define FF_API_GETCHROMA (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_CODEC_GET_SET
-#define FF_API_CODEC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_USER_VISIBLE_AVHWACCEL
 #define FF_API_USER_VISIBLE_AVHWACCEL (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-- 
2.31.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 02/87] avformat: Remove next API for AV(In|Out)putFormat

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/allformats.c | 98 
 libavformat/avformat.h   | 43 --
 libavformat/version.h|  3 --
 3 files changed, 144 deletions(-)

diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index fa093c7ac2..f450c1709b 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -22,10 +22,6 @@
 #include "libavutil/thread.h"
 #include "libavformat/internal.h"
 #include "avformat.h"
-#include "rtp.h"
-#include "rdt.h"
-#include "url.h"
-#include "version.h"
 
 /* (de)muxers */
 extern AVOutputFormat ff_a64_muxer;
@@ -573,104 +569,10 @@ const AVInputFormat *av_demuxer_iterate(void **opaque)
 
 static AVMutex avpriv_register_devices_mutex = AV_MUTEX_INITIALIZER;
 
-#if FF_API_NEXT
-FF_DISABLE_DEPRECATION_WARNINGS
-static AVOnce av_format_next_init = AV_ONCE_INIT;
-
-static void av_format_init_next(void)
-{
-AVOutputFormat *prevout = NULL, *out;
-AVInputFormat *previn = NULL, *in;
-
-ff_mutex_lock(_register_devices_mutex);
-
-for (int i = 0; (out = (AVOutputFormat*)muxer_list[i]); i++) {
-if (prevout)
-prevout->next = out;
-prevout = out;
-}
-
-if (outdev_list) {
-for (int i = 0; (out = (AVOutputFormat*)outdev_list[i]); i++) {
-if (prevout)
-prevout->next = out;
-prevout = out;
-}
-}
-
-for (int i = 0; (in = (AVInputFormat*)demuxer_list[i]); i++) {
-if (previn)
-previn->next = in;
-previn = in;
-}
-
-if (indev_list) {
-for (int i = 0; (in = (AVInputFormat*)indev_list[i]); i++) {
-if (previn)
-previn->next = in;
-previn = in;
-}
-}
-
-ff_mutex_unlock(_register_devices_mutex);
-}
-
-AVInputFormat *av_iformat_next(const AVInputFormat *f)
-{
-ff_thread_once(_format_next_init, av_format_init_next);
-
-if (f)
-#if FF_API_AVIOFORMAT
-return f->next;
-#else
-return (AVInputFormat *) f->next;
-#endif
-else {
-void *opaque = NULL;
-return (AVInputFormat *)av_demuxer_iterate();
-}
-}
-
-AVOutputFormat *av_oformat_next(const AVOutputFormat *f)
-{
-ff_thread_once(_format_next_init, av_format_init_next);
-
-if (f)
-#if FF_API_AVIOFORMAT
-return f->next;
-#else
-return (AVOutputFormat *) f->next;
-#endif
-else {
-void *opaque = NULL;
-return (AVOutputFormat *)av_muxer_iterate();
-}
-}
-
-void av_register_all(void)
-{
-ff_thread_once(_format_next_init, av_format_init_next);
-}
-
-void av_register_input_format(AVInputFormat *format)
-{
-ff_thread_once(_format_next_init, av_format_init_next);
-}
-
-void av_register_output_format(AVOutputFormat *format)
-{
-ff_thread_once(_format_next_init, av_format_init_next);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 void avpriv_register_devices(const AVOutputFormat * const o[], const 
AVInputFormat * const i[])
 {
 ff_mutex_lock(_register_devices_mutex);
 outdev_list = o;
 indev_list = i;
 ff_mutex_unlock(_register_devices_mutex);
-#if FF_API_NEXT
-av_format_init_next();
-#endif
 }
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 8600ee1bf7..6c97aff423 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -533,9 +533,6 @@ typedef struct AVOutputFormat {
 #define ff_const59
 #else
 #define ff_const59 const
-#endif
-#if FF_API_NEXT
-ff_const59 struct AVOutputFormat *next;
 #endif
 /**
  * size of private data so that it can be allocated in the wrapper
@@ -683,10 +680,6 @@ typedef struct AVInputFormat {
  * New public fields should be added right above.
  *
  */
-#if FF_API_NEXT
-ff_const59 struct AVInputFormat *next;
-#endif
-
 /**
  * Raw demuxers store their codec ID here.
  */
@@ -1941,24 +1934,6 @@ const char *avformat_configuration(void);
  */
 const char *avformat_license(void);
 
-#if FF_API_NEXT
-/**
- * Initialize libavformat and register all the muxers, demuxers and
- * protocols. If you do not call this function, then you can select
- * exactly which formats you want to support.
- *
- * @see av_register_input_format()
- * @see av_register_output_format()
- */
-attribute_deprecated
-void av_register_all(void);
-
-attribute_deprecated
-void av_register_input_format(AVInputFormat *format);
-attribute_deprecated
-void av_register_output_format(AVOutputFormat *format);
-#endif
-
 /**
  * Do global initialization of network libraries. This is optional,
  * and not recommended anymore.
@@ -1981,24 +1956,6 @@ int avformat_network_init(void);
  */
 int avformat_network_deinit(void);
 
-#if FF_API_NEXT
-/**
- * If f is NULL, returns the first registered input format,
- * if f is non-NULL, returns the next registered input format after f
- * or NULL if f is the last one.
- */

[FFmpeg-devel] [PATCH 85/87] avcodec: postpone removal of deprecated codec caps

2021-04-19 Thread James Almer
This was deprecated only a year ago

Signed-off-by: James Almer 
---
 libavcodec/version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/version.h b/libavcodec/version.h
index 75fde1f8c7..df2801401f 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -58,7 +58,7 @@
 #define FF_API_OPENH264_CABAC  (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
 #ifndef FF_API_UNUSED_CODEC_CAPS
-#define FF_API_UNUSED_CODEC_CAPS   (LIBAVCODEC_VERSION_MAJOR < 59)
+#define FF_API_UNUSED_CODEC_CAPS   (LIBAVCODEC_VERSION_MAJOR < 60)
 #endif
 #ifndef FF_API_THREAD_SAFE_CALLBACKS
 #define FF_API_THREAD_SAFE_CALLBACKS (LIBAVCODEC_VERSION_MAJOR < 60)
-- 
2.31.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 13/87] avcodec: Remove lock manager API

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in a04c2c707de2ce850f79870e84ac9d7ec7aa9143.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avcodec.c |  7 ---
 libavcodec/avcodec.h | 43 ---
 libavcodec/version.h |  3 ---
 3 files changed, 53 deletions(-)

diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index 760a98d8ef..8e91350d67 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -102,13 +102,6 @@ static void unlock_avcodec(const AVCodec *codec)
 ff_mutex_unlock(_mutex);
 }
 
-#if FF_API_LOCKMGR
-int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op))
-{
-return 0;
-}
-#endif
-
 static int64_t get_bit_rate(AVCodecContext *ctx)
 {
 int64_t bit_rate;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 0e86064ccb..7c6f5c1fc0 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3799,49 +3799,6 @@ attribute_deprecated
 AVHWAccel *av_hwaccel_next(const AVHWAccel *hwaccel);
 #endif
 
-#if FF_API_LOCKMGR
-/**
- * Lock operation used by lockmgr
- *
- * @deprecated Deprecated together with av_lockmgr_register().
- */
-enum AVLockOp {
-  AV_LOCK_CREATE,  ///< Create a mutex
-  AV_LOCK_OBTAIN,  ///< Lock the mutex
-  AV_LOCK_RELEASE, ///< Unlock the mutex
-  AV_LOCK_DESTROY, ///< Free mutex resources
-};
-
-/**
- * Register a user provided lock manager supporting the operations
- * specified by AVLockOp. The "mutex" argument to the function points
- * to a (void *) where the lockmgr should store/get a pointer to a user
- * allocated mutex. It is NULL upon AV_LOCK_CREATE and equal to the
- * value left by the last call for all other ops. If the lock manager is
- * unable to perform the op then it should leave the mutex in the same
- * state as when it was called and return a non-zero value. However,
- * when called with AV_LOCK_DESTROY the mutex will always be assumed to
- * have been successfully destroyed. If av_lockmgr_register succeeds
- * it will return a non-negative value, if it fails it will return a
- * negative value and destroy all mutex and unregister all callbacks.
- * av_lockmgr_register is not thread-safe, it must be called from a
- * single thread before any calls which make use of locking are used.
- *
- * @param cb User defined callback. av_lockmgr_register invokes calls
- *   to this callback and the previously registered callback.
- *   The callback will be used to create more than one mutex
- *   each of which must be backed by its own underlying locking
- *   mechanism (i.e. do not use a single static object to
- *   implement your lock manager). If cb is set to NULL the
- *   lockmgr will be unregistered.
- *
- * @deprecated This function does nothing, and always returns 0. Be sure to
- * build with thread support to get basic thread safety.
- */
-attribute_deprecated
-int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
-#endif
-
 /**
  * @return a positive value if s is open (i.e. avcodec_open2() was called on it
  * with no corresponding avcodec_close()), 0 otherwise.
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 6d0f0f1d25..c743d2a05c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -87,9 +87,6 @@
 #ifndef FF_API_USER_VISIBLE_AVHWACCEL
 #define FF_API_USER_VISIBLE_AVHWACCEL (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_LOCKMGR
-#define FF_API_LOCKMGR (LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_UNSANITIZED_BITRATES
 #define FF_API_UNSANITIZED_BITRATES (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-- 
2.31.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 03/87] avcodec, avformat: Remove old BSF API

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/Makefile   |   1 -
 libavcodec/avcodec.h  |  52 --
 libavcodec/bitstream_filter.c | 185 --
 libavcodec/version.h  |   3 -
 libavformat/avformat.h|  17 
 libavformat/utils.c   |  58 ---
 6 files changed, 316 deletions(-)
 delete mode 100644 libavcodec/bitstream_filter.c

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 4a597f727a..5b41450b86 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -34,7 +34,6 @@ OBJS = ac3_parser.o   
  \
avpacket.o   \
avpicture.o  \
bitstream.o  \
-   bitstream_filter.o   \
bitstream_filters.o  \
bsf.o\
codec_desc.o \
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 483ab9a358..5e6967df0d 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3978,58 +3978,6 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, 
int frame_bytes);
  */
 int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes);
 
-#if FF_API_OLD_BSF
-typedef struct AVBitStreamFilterContext {
-void *priv_data;
-const struct AVBitStreamFilter *filter;
-AVCodecParserContext *parser;
-struct AVBitStreamFilterContext *next;
-/**
- * Internal default arguments, used if NULL is passed to 
av_bitstream_filter_filter().
- * Not for access by library users.
- */
-char *args;
-} AVBitStreamFilterContext;
-
-/**
- * @deprecated the old bitstream filtering API (using AVBitStreamFilterContext)
- * is deprecated. Use the new bitstream filtering API (using AVBSFContext).
- */
-attribute_deprecated
-void av_register_bitstream_filter(AVBitStreamFilter *bsf);
-/**
- * @deprecated the old bitstream filtering API (using AVBitStreamFilterContext)
- * is deprecated. Use av_bsf_get_by_name(), av_bsf_alloc(), and av_bsf_init()
- * from the new bitstream filtering API (using AVBSFContext).
- */
-attribute_deprecated
-AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
-/**
- * @deprecated the old bitstream filtering API (using AVBitStreamFilterContext)
- * is deprecated. Use av_bsf_send_packet() and av_bsf_receive_packet() from the
- * new bitstream filtering API (using AVBSFContext).
- */
-attribute_deprecated
-int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-   AVCodecContext *avctx, const char *args,
-   uint8_t **poutbuf, int *poutbuf_size,
-   const uint8_t *buf, int buf_size, int keyframe);
-/**
- * @deprecated the old bitstream filtering API (using AVBitStreamFilterContext)
- * is deprecated. Use av_bsf_free() from the new bitstream filtering API (using
- * AVBSFContext).
- */
-attribute_deprecated
-void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
-/**
- * @deprecated the old bitstream filtering API (using AVBitStreamFilterContext)
- * is deprecated. Use av_bsf_iterate() from the new bitstream filtering API 
(using
- * AVBSFContext).
- */
-attribute_deprecated
-const AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f);
-#endif
-
 /* memory */
 
 /**
diff --git a/libavcodec/bitstream_filter.c b/libavcodec/bitstream_filter.c
deleted file mode 100644
index ca11ed371e..00
--- a/libavcodec/bitstream_filter.c
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer 
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include 
-
-#include "avcodec.h"
-#include "libavutil/internal.h"
-#include "libavutil/mem.h"
-#include "libavutil/opt.h"
-
-#if FF_API_OLD_BSF
-FF_DISABLE_DEPRECATION_WARNINGS
-
-const AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f)
-{
-const AVBitStreamFilter *filter = NULL;
-

[FFmpeg-devel] [PATCH 84/87] avfilter/buffersrc: postpone removal of sws_param

2021-04-19 Thread James Almer
It was depreacted less than two years ago

Signed-off-by: James Almer 
---
 libavfilter/version.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/version.h b/libavfilter/version.h
index ebac663e0d..dcac3e91ef 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -51,7 +51,7 @@
  */
 
 #ifndef FF_API_SWS_PARAM_OPTION
-#define FF_API_SWS_PARAM_OPTION (LIBAVFILTER_VERSION_MAJOR < 8)
+#define FF_API_SWS_PARAM_OPTION (LIBAVFILTER_VERSION_MAJOR < 9)
 #endif
 #ifndef FF_API_BUFFERSINK_ALLOC
 #define FF_API_BUFFERSINK_ALLOC (LIBAVFILTER_VERSION_MAJOR < 9)
-- 
2.31.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 04/87] avcodec: Remove sidedata-only-packet cruft

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avcodec.h   | 15 ---
 libavcodec/flacenc.c   |  6 --
 libavcodec/options_table.h |  3 ---
 libavcodec/version.h   |  3 ---
 4 files changed, 27 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 5e6967df0d..b46b858416 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2029,21 +2029,6 @@ typedef struct AVCodecContext {
 uint64_t vbv_delay;
 #endif
 
-#if FF_API_SIDEDATA_ONLY_PKT
-/**
- * Encoding only and set by default. Allow encoders to output packets
- * that do not contain any encoded data, only side data.
- *
- * Some encoders need to output such packets, e.g. to update some stream
- * parameters at the end of encoding.
- *
- * @deprecated this field disables the default behaviour and
- * it is kept only for compatibility.
- */
-attribute_deprecated
-int side_data_only_packets;
-#endif
-
 /**
  * Audio only. The number of "priming" samples (padding) inserted by the
  * encoder at the beginning of the audio. I.e. this number of leading
diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c
index 05a85d830f..38571ec9c9 100644
--- a/libavcodec/flacenc.c
+++ b/libavcodec/flacenc.c
@@ -1370,13 +1370,7 @@ static int flac_encode_frame(AVCodecContext *avctx, 
AVPacket *avpkt,
 av_md5_final(s->md5ctx, s->md5sum);
 write_streaminfo(s, avctx->extradata);
 
-#if FF_API_SIDEDATA_ONLY_PKT
-FF_DISABLE_DEPRECATION_WARNINGS
-if (avctx->side_data_only_packets && !s->flushed) {
-FF_ENABLE_DEPRECATION_WARNINGS
-#else
 if (!s->flushed) {
-#endif
 uint8_t *side_data = av_packet_new_side_data(avpkt, 
AV_PKT_DATA_NEW_EXTRADATA,
  
avctx->extradata_size);
 if (!side_data)
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index e12159f734..956132437a 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -444,9 +444,6 @@ static const AVOption avcodec_options[] = {
 #if FF_API_OLD_ENCDEC
 {"refcounted_frames", NULL, OFFSET(refcounted_frames), AV_OPT_TYPE_BOOL, {.i64 
= 0}, 0, 1, A|V|D },
 #endif
-#if FF_API_SIDEDATA_ONLY_PKT
-{"side_data_only_packets", NULL, OFFSET(side_data_only_packets), 
AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, A|V|E },
-#endif
 {"apply_cropping", NULL, OFFSET(apply_cropping), AV_OPT_TYPE_BOOL, { .i64 = 1 
}, 0, 1, V | D },
 {"skip_alpha", "Skip processing alpha", OFFSET(skip_alpha), AV_OPT_TYPE_BOOL, 
{.i64 = 0 }, 0, 1, V|D },
 {"field_order", "Field order", OFFSET(field_order), AV_OPT_TYPE_INT, {.i64 = 
AV_FIELD_UNKNOWN }, 0, 5, V|D|E, "field_order" },
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 1068716eb9..9b017d1980 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -54,9 +54,6 @@
 #ifndef FF_API_CODED_FRAME
 #define FF_API_CODED_FRAME   (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-#ifndef FF_API_SIDEDATA_ONLY_PKT
-#define FF_API_SIDEDATA_ONLY_PKT (LIBAVCODEC_VERSION_MAJOR < 59)
-#endif
 #ifndef FF_API_VDPAU_PROFILE
 #define FF_API_VDPAU_PROFILE (LIBAVCODEC_VERSION_MAJOR < 59)
 #endif
-- 
2.31.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 01/87] avcodec: Remove AVCodec, AVParser and AVBitStreamFilter next API

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/allcodecs.c | 39 -
 libavcodec/avcodec.h   | 40 --
 libavcodec/bitstream_filters.c |  6 -
 libavcodec/codec.h |  3 ---
 libavcodec/parsers.c   | 35 -
 libavcodec/version.h   |  3 ---
 6 files changed, 126 deletions(-)

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2e9a3581de..3194232500 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -869,45 +869,6 @@ const AVCodec *av_codec_iterate(void **opaque)
 return c;
 }
 
-#if FF_API_NEXT
-FF_DISABLE_DEPRECATION_WARNINGS
-static AVOnce av_codec_next_init = AV_ONCE_INIT;
-
-static void av_codec_init_next(void)
-{
-AVCodec *prev = NULL, *p;
-void *i = 0;
-while ((p = (AVCodec*)av_codec_iterate())) {
-if (prev)
-prev->next = p;
-prev = p;
-}
-}
-
-
-
-av_cold void avcodec_register(AVCodec *codec)
-{
-ff_thread_once(_codec_next_init, av_codec_init_next);
-}
-
-AVCodec *av_codec_next(const AVCodec *c)
-{
-ff_thread_once(_codec_next_init, av_codec_init_next);
-
-if (c)
-return c->next;
-else
-return (AVCodec*)codec_list[0];
-}
-
-void avcodec_register_all(void)
-{
-ff_thread_once(_codec_next_init, av_codec_init_next);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
 {
 switch(id){
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 8a71c04230..483ab9a358 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2728,16 +2728,6 @@ typedef struct AVSubtitle {
 int64_t pts;///< Same as packet pts, in AV_TIME_BASE
 } AVSubtitle;
 
-#if FF_API_NEXT
-/**
- * If c is NULL, returns the first registered codec,
- * if c is non-NULL, returns the next registered codec after c,
- * or NULL if c is the last one.
- */
-attribute_deprecated
-AVCodec *av_codec_next(const AVCodec *c);
-#endif
-
 /**
  * Return the LIBAVCODEC_VERSION_INT constant.
  */
@@ -2753,20 +2743,6 @@ const char *avcodec_configuration(void);
  */
 const char *avcodec_license(void);
 
-#if FF_API_NEXT
-/**
- * @deprecated Calling this function is unnecessary.
- */
-attribute_deprecated
-void avcodec_register(AVCodec *codec);
-
-/**
- * @deprecated Calling this function is unnecessary.
- */
-attribute_deprecated
-void avcodec_register_all(void);
-#endif
-
 /**
  * Allocate an AVCodecContext and set its fields to default values. The
  * resulting struct should be freed with avcodec_free_context().
@@ -3553,10 +3529,6 @@ typedef struct AVCodecParser {
 const uint8_t *buf, int buf_size);
 void (*parser_close)(AVCodecParserContext *s);
 int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
-#if FF_API_NEXT
-attribute_deprecated
-struct AVCodecParser *next;
-#endif
 } AVCodecParser;
 
 /**
@@ -3570,13 +3542,6 @@ typedef struct AVCodecParser {
  */
 const AVCodecParser *av_parser_iterate(void **opaque);
 
-#if FF_API_NEXT
-attribute_deprecated
-AVCodecParser *av_parser_next(const AVCodecParser *c);
-
-attribute_deprecated
-void av_register_codec_parser(AVCodecParser *parser);
-#endif
 AVCodecParserContext *av_parser_init(int codec_id);
 
 /**
@@ -4065,11 +4030,6 @@ attribute_deprecated
 const AVBitStreamFilter *av_bitstream_filter_next(const AVBitStreamFilter *f);
 #endif
 
-#if FF_API_NEXT
-attribute_deprecated
-const AVBitStreamFilter *av_bsf_next(void **opaque);
-#endif
-
 /* memory */
 
 /**
diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c
index 02d33abb18..3de2af92d3 100644
--- a/libavcodec/bitstream_filters.c
+++ b/libavcodec/bitstream_filters.c
@@ -75,12 +75,6 @@ const AVBitStreamFilter *av_bsf_iterate(void **opaque)
 return f;
 }
 
-#if FF_API_NEXT
-const AVBitStreamFilter *av_bsf_next(void **opaque) {
-return av_bsf_iterate(opaque);
-}
-#endif
-
 const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
 {
 const AVBitStreamFilter *f = NULL;
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index de050b2815..c95078491d 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -243,9 +243,6 @@ typedef struct AVCodec {
  *
  */
 int priv_data_size;
-#if FF_API_NEXT
-struct AVCodec *next;
-#endif
 /**
  * @name Frame-level threading support functions
  * @{
diff --git a/libavcodec/parsers.c b/libavcodec/parsers.c
index 3d944f5222..40b42e6d1a 100644
--- a/libavcodec/parsers.c
+++ b/libavcodec/parsers.c
@@ -18,10 +18,7 @@
 
 #include 
 
-#include "libavutil/thread.h"
-
 #include "avcodec.h"
-#include "version.h"
 
 extern AVCodecParser ff_aac_parser;
 extern AVCodecParser ff_aac_latm_parser;
@@ -78,38 +75,6 @@ extern AVCodecParser ff_xma_parser;
 
 #include "libavcodec/parser_list.c"
 
-#if 

[FFmpeg-devel] [PATCH 83/87] avutil: remove deprecated AVClass.child_class_next

2021-04-19 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/bitstream_filters.c | 22 
 libavcodec/bsf.c   |  3 ---
 libavcodec/bsf_internal.h  |  4 
 libavcodec/options.c   | 22 
 libavfilter/af_aresample.c | 10 -
 libavfilter/avfilter.c | 27 
 libavfilter/framesync.h|  4 
 libavfilter/vf_scale.c | 13 
 libavfilter/vf_spp.c   | 10 -
 libavformat/avio.c |  3 ---
 libavformat/aviobuf.c  | 10 -
 libavformat/options.c  | 38 --
 libavformat/protocols.c| 21 ---
 libavformat/url.h  |  4 
 libavutil/log.h| 13 
 libavutil/opt.c| 19 -
 libavutil/opt.h| 13 
 libavutil/version.h|  3 ---
 18 files changed, 239 deletions(-)

diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c
index 3de2af92d3..e03326515b 100644
--- a/libavcodec/bitstream_filters.c
+++ b/libavcodec/bitstream_filters.c
@@ -91,28 +91,6 @@ const AVBitStreamFilter *av_bsf_get_by_name(const char *name)
 return NULL;
 }
 
-#if FF_API_CHILD_CLASS_NEXT
-const AVClass *ff_bsf_child_class_next(const AVClass *prev)
-{
-const AVBitStreamFilter *f = NULL;
-void *i = 0;
-
-/* find the filter that corresponds to prev */
-while (prev && (f = av_bsf_iterate())) {
-if (f->priv_class == prev) {
-break;
-}
-}
-
-/* find next filter with priv options */
-while ((f = av_bsf_iterate())) {
-if (f->priv_class)
-return f->priv_class;
-}
-return NULL;
-}
-#endif
-
 const AVClass *ff_bsf_child_class_iterate(void **opaque)
 {
 const AVBitStreamFilter *f;
diff --git a/libavcodec/bsf.c b/libavcodec/bsf.c
index 543fe87b30..9d67ea5395 100644
--- a/libavcodec/bsf.c
+++ b/libavcodec/bsf.c
@@ -80,9 +80,6 @@ static const AVClass bsf_class = {
 .item_name= bsf_to_name,
 .version  = LIBAVUTIL_VERSION_INT,
 .child_next   = bsf_child_next,
-#if FF_API_CHILD_CLASS_NEXT
-.child_class_next = ff_bsf_child_class_next,
-#endif
 .child_class_iterate = ff_bsf_child_class_iterate,
 .category = AV_CLASS_CATEGORY_BITSTREAM_FILTER,
 };
diff --git a/libavcodec/bsf_internal.h b/libavcodec/bsf_internal.h
index b78c134bdd..06979fdaa3 100644
--- a/libavcodec/bsf_internal.h
+++ b/libavcodec/bsf_internal.h
@@ -42,10 +42,6 @@ int ff_bsf_get_packet(AVBSFContext *ctx, AVPacket **pkt);
  */
 int ff_bsf_get_packet_ref(AVBSFContext *ctx, AVPacket *pkt);
 
-#if FF_API_CHILD_CLASS_NEXT
-const AVClass *ff_bsf_child_class_next(const AVClass *prev);
-#endif
-
 const AVClass *ff_bsf_child_class_iterate(void **opaque);
 
 #endif /* AVCODEC_BSF_INTERNAL_H */
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 369110b8d0..bba6078b62 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -53,25 +53,6 @@ static void *codec_child_next(void *obj, void *prev)
 return NULL;
 }
 
-#if FF_API_CHILD_CLASS_NEXT
-static const AVClass *codec_child_class_next(const AVClass *prev)
-{
-void *iter = NULL;
-const AVCodec *c = NULL;
-
-/* find the codec that corresponds to prev */
-while (prev && (c = av_codec_iterate()))
-if (c->priv_class == prev)
-break;
-
-/* find next codec with priv options */
-while (c = av_codec_iterate())
-if (c->priv_class)
-return c->priv_class;
-return NULL;
-}
-#endif
-
 static const AVClass *codec_child_class_iterate(void **iter)
 {
 const AVCodec *c;
@@ -96,9 +77,6 @@ static const AVClass av_codec_context_class = {
 .version = LIBAVUTIL_VERSION_INT,
 .log_level_offset_offset = offsetof(AVCodecContext, log_level_offset),
 .child_next  = codec_child_next,
-#if FF_API_CHILD_CLASS_NEXT
-.child_class_next= codec_child_class_next,
-#endif
 .child_class_iterate = codec_child_class_iterate,
 .category= AV_CLASS_CATEGORY_ENCODER,
 .get_category= get_category,
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index e54bd3eb41..f8e03061a5 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -293,13 +293,6 @@ static int request_frame(AVFilterLink *outlink)
 return ret;
 }
 
-#if FF_API_CHILD_CLASS_NEXT
-static const AVClass *resample_child_class_next(const AVClass *prev)
-{
-return prev ? NULL : swr_get_class();
-}
-#endif
-
 static const AVClass *resample_child_class_iterate(void **iter)
 {
 const AVClass *c = *iter ? NULL : swr_get_class();
@@ -326,9 +319,6 @@ static const AVClass aresample_class = {
 .item_name= av_default_item_name,
 .option   = options,
 .version  = LIBAVUTIL_VERSION_INT,
-#if FF_API_CHILD_CLASS_NEXT
-

[FFmpeg-devel] [PATCH 06/87] avcodec: Remove deprecated AVPacket API

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in ce70f28a1732c74a9cd7fec2d56178750bd6e457.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/avpacket.c | 118 --
 libavcodec/packet.h   |  39 --
 libavcodec/version.h  |   3 --
 3 files changed, 160 deletions(-)

diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index b726a8db0e..4995a83bf8 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -174,108 +174,6 @@ int av_packet_from_data(AVPacket *pkt, uint8_t *data, int 
size)
 return 0;
 }
 
-#if FF_API_AVPACKET_OLD_API
-FF_DISABLE_DEPRECATION_WARNINGS
-#define ALLOC_MALLOC(data, size) data = av_malloc(size)
-#define ALLOC_BUF(data, size)\
-do { \
-av_buffer_realloc(>buf, size);  \
-data = pkt->buf ? pkt->buf->data : NULL; \
-} while (0)
-
-#define DUP_DATA(dst, src, size, padding, ALLOC)\
-do {\
-void *data; \
-if (padding) {  \
-if ((unsigned)(size) >  \
-(unsigned)(size) + AV_INPUT_BUFFER_PADDING_SIZE)\
-goto failed_alloc;  \
-ALLOC(data, size + AV_INPUT_BUFFER_PADDING_SIZE);   \
-} else {\
-ALLOC(data, size);  \
-}   \
-if (!data)  \
-goto failed_alloc;  \
-memcpy(data, src, size);\
-if (padding)\
-memset((uint8_t *)data + size, 0,   \
-   AV_INPUT_BUFFER_PADDING_SIZE);   \
-dst = data; \
-} while (0)
-
-/* Makes duplicates of data, side_data, but does not copy any other fields */
-static int copy_packet_data(AVPacket *pkt, const AVPacket *src, int dup)
-{
-pkt->data  = NULL;
-pkt->side_data = NULL;
-pkt->side_data_elems = 0;
-if (pkt->buf) {
-AVBufferRef *ref = av_buffer_ref(src->buf);
-if (!ref)
-return AVERROR(ENOMEM);
-pkt->buf  = ref;
-pkt->data = ref->data;
-} else {
-DUP_DATA(pkt->data, src->data, pkt->size, 1, ALLOC_BUF);
-}
-if (src->side_data_elems && dup) {
-pkt->side_data = src->side_data;
-pkt->side_data_elems = src->side_data_elems;
-}
-if (src->side_data_elems && !dup) {
-return av_copy_packet_side_data(pkt, src);
-}
-return 0;
-
-failed_alloc:
-av_packet_unref(pkt);
-return AVERROR(ENOMEM);
-}
-
-int av_copy_packet_side_data(AVPacket *pkt, const AVPacket *src)
-{
-if (src->side_data_elems) {
-int i;
-DUP_DATA(pkt->side_data, src->side_data,
-src->side_data_elems * sizeof(*src->side_data), 0, 
ALLOC_MALLOC);
-if (src != pkt) {
-memset(pkt->side_data, 0,
-   src->side_data_elems * sizeof(*src->side_data));
-}
-for (i = 0; i < src->side_data_elems; i++) {
-DUP_DATA(pkt->side_data[i].data, src->side_data[i].data,
-src->side_data[i].size, 1, ALLOC_MALLOC);
-pkt->side_data[i].size = src->side_data[i].size;
-pkt->side_data[i].type = src->side_data[i].type;
-}
-}
-pkt->side_data_elems = src->side_data_elems;
-return 0;
-
-failed_alloc:
-av_packet_unref(pkt);
-return AVERROR(ENOMEM);
-}
-
-int av_dup_packet(AVPacket *pkt)
-{
-AVPacket tmp_pkt;
-
-if (!pkt->buf && pkt->data) {
-tmp_pkt = *pkt;
-return copy_packet_data(pkt, _pkt, 1);
-}
-return 0;
-}
-
-int av_copy_packet(AVPacket *dst, const AVPacket *src)
-{
-*dst = *src;
-return copy_packet_data(dst, src, 0);
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 void av_packet_free_side_data(AVPacket *pkt)
 {
 int i;
@@ -285,22 +183,6 @@ void av_packet_free_side_data(AVPacket *pkt)
 pkt->side_data_elems = 0;
 }
 
-#if FF_API_AVPACKET_OLD_API
-FF_DISABLE_DEPRECATION_WARNINGS
-void av_free_packet(AVPacket *pkt)
-{
-if (pkt) {
-if (pkt->buf)
-av_buffer_unref(>buf);
-pkt->data= NULL;
-pkt->size= 0;
-
-av_packet_free_side_data(pkt);
-}
-}
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 int av_packet_add_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
 uint8_t *data, size_t size)
 {
diff --git 

[FFmpeg-devel] [PATCH 82/87] avformat: remove deprecated AVStream.codec

2021-04-19 Thread James Almer
Signed-off-by: James Almer 
---
 fftools/ffmpeg_opt.c  |  13 ---
 libavformat/avformat.h|   8 +-
 libavformat/dump.c|  24 --
 libavformat/isom.c|  12 +--
 libavformat/mov.c |  17 
 libavformat/movenc.c  |  38 +
 libavformat/mux.c |  27 ---
 libavformat/sdp.c |  18 -
 libavformat/segment.c |   6 --
 libavformat/utils.c   | 164 +-
 libavformat/version.h |   3 -
 libavformat/yuv4mpegenc.c |   7 --
 12 files changed, 7 insertions(+), 330 deletions(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index e66141f3ab..c0b9f023bd 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2442,19 +2442,6 @@ loop_end:
 avio_closep();
 }
 
-#if FF_API_LAVF_AVCTX
-for (i = nb_output_streams - oc->nb_streams; i < nb_output_streams; i++) { 
//for all streams of this output file
-AVDictionaryEntry *e;
-ost = output_streams[i];
-
-if ((ost->stream_copy || ost->attachment_filename)
-&& (e = av_dict_get(o->g->codec_opts, "flags", NULL, 
AV_DICT_IGNORE_SUFFIX))
-&& (!e->key[5] || check_stream_specifier(oc, ost->st, e->key+6)))
-if (av_opt_set(ost->st->codec, "flags", e->value, 0) < 0)
-exit_program(1);
-}
-#endif
-
 if (!oc->nb_streams && !(oc->oformat->flags & AVFMT_NOSTREAMS)) {
 av_dump_format(oc, nb_output_files - 1, oc->url, 1);
 av_log(NULL, AV_LOG_ERROR, "Output file #%d does not contain any 
stream\n", nb_output_files - 1);
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 28069d45dc..3e307efb16 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -839,13 +839,7 @@ typedef struct AVStream {
  * encoding: set by the user, replaced by libavformat if left unset
  */
 int id;
-#if FF_API_LAVF_AVCTX
-/**
- * @deprecated use the codecpar struct instead
- */
-attribute_deprecated
-AVCodecContext *codec;
-#endif
+
 void *priv_data;
 
 /**
diff --git a/libavformat/dump.c b/libavformat/dump.c
index a520b01e2d..47d3b4ca9a 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -522,18 +522,6 @@ static void dump_stream_format(const AVFormatContext *ic, 
int i,
 return;
 }
 
-#if FF_API_LAVF_AVCTX
-FF_DISABLE_DEPRECATION_WARNINGS
-// Fields which are missing from AVCodecParameters need to be taken from 
the AVCodecContext
-avctx->properties = st->codec->properties;
-avctx->codec  = st->codec->codec;
-avctx->qmin   = st->codec->qmin;
-avctx->qmax   = st->codec->qmax;
-avctx->coded_width  = st->codec->coded_width;
-avctx->coded_height = st->codec->coded_height;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 if (separator)
 av_opt_set(avctx, "dump_separator", separator, 0);
 avcodec_string(buf, sizeof(buf), avctx, is_output);
@@ -567,13 +555,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
 int fps = st->avg_frame_rate.den && st->avg_frame_rate.num;
 int tbr = st->r_frame_rate.den && st->r_frame_rate.num;
 int tbn = st->time_base.den && st->time_base.num;
-#if FF_API_LAVF_AVCTX
-FF_DISABLE_DEPRECATION_WARNINGS
-int tbc = st->codec->time_base.den && st->codec->time_base.num;
-FF_ENABLE_DEPRECATION_WARNINGS
-#else
 int tbc = 0;
-#endif
 
 if (fps || tbr || tbn || tbc)
 av_log(NULL, AV_LOG_INFO, "%s", separator);
@@ -584,12 +566,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 print_fps(av_q2d(st->r_frame_rate), tbn || tbc ? "tbr, " : "tbr");
 if (tbn)
 print_fps(1 / av_q2d(st->time_base), tbc ? "tbn, " : "tbn");
-#if FF_API_LAVF_AVCTX
-FF_DISABLE_DEPRECATION_WARNINGS
-if (tbc)
-print_fps(1 / av_q2d(st->codec->time_base), "tbc");
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 }
 
 if (st->disposition & AV_DISPOSITION_DEFAULT)
diff --git a/libavformat/isom.c b/libavformat/isom.c
index df98779149..35c5eb982e 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -329,22 +329,12 @@ static const AVCodecTag mp4_audio_types[] = {
 int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, 
AVIOContext *pb)
 {
 enum AVCodecID codec_id;
-unsigned v;
 int len, tag;
 int ret;
 int object_type_id = avio_r8(pb);
 avio_r8(pb); /* stream type */
 avio_rb24(pb); /* buffer size db */
-
-v = avio_rb32(pb);
-
-// TODO: fix this with codecpar
-#if FF_API_LAVF_AVCTX
-FF_DISABLE_DEPRECATION_WARNINGS
-if (v < INT32_MAX)
-st->codec->rc_max_rate = v;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
+avio_rb32(pb); /* rc_max_rate */
 
 st->codecpar->bit_rate = avio_rb32(pb); /* avg bitrate */
 
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 77ab45aa61..f6e96f31eb 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -804,12 +804,6 @@ static int mov_read_dac3(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 

[FFmpeg-devel] [PATCH 80/87] avcodec: Constify all the AVCodecParsers

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Possible now that the next pointer no longer exists.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/aac_parser.c|   2 +-
 libavcodec/ac3_parser.c|   2 +-
 libavcodec/adx_parser.c|   2 +-
 libavcodec/av1_parser.c|   2 +-
 libavcodec/avs2_parser.c   |   2 +-
 libavcodec/avs3_parser.c   |   2 +-
 libavcodec/bmp_parser.c|   2 +-
 libavcodec/cavs_parser.c   |   2 +-
 libavcodec/cook_parser.c   |   2 +-
 libavcodec/cri_parser.c|   2 +-
 libavcodec/dca_parser.c|   2 +-
 libavcodec/dirac_parser.c  |   2 +-
 libavcodec/dnxhd_parser.c  |   2 +-
 libavcodec/dolby_e_parser.c|   2 +-
 libavcodec/dpx_parser.c|   2 +-
 libavcodec/dvaudio_parser.c|   2 +-
 libavcodec/dvbsub_parser.c |   2 +-
 libavcodec/dvd_nav_parser.c|   2 +-
 libavcodec/dvdsub_parser.c |   2 +-
 libavcodec/flac_parser.c   |   2 +-
 libavcodec/g723_1_parser.c |   2 +-
 libavcodec/g729_parser.c   |   2 +-
 libavcodec/gif_parser.c|   2 +-
 libavcodec/gsm_parser.c|   2 +-
 libavcodec/h261_parser.c   |   2 +-
 libavcodec/h263_parser.c   |   2 +-
 libavcodec/h264_parser.c   |   2 +-
 libavcodec/hevc_parser.c   |   2 +-
 libavcodec/ipu_parser.c|   2 +-
 libavcodec/jpeg2000_parser.c   |   2 +-
 libavcodec/latm_parser.c   |   2 +-
 libavcodec/mjpeg_parser.c  |   2 +-
 libavcodec/mlp_parser.c|   2 +-
 libavcodec/mpeg4video_parser.c |   2 +-
 libavcodec/mpegaudio_parser.c  |   2 +-
 libavcodec/mpegvideo_parser.c  |   2 +-
 libavcodec/opus_parser.c   |   2 +-
 libavcodec/parsers.c   | 104 -
 libavcodec/png_parser.c|   2 +-
 libavcodec/pnm_parser.c|   2 +-
 libavcodec/rv34_parser.c   |   4 +-
 libavcodec/sbc_parser.c|   2 +-
 libavcodec/sipr_parser.c   |   2 +-
 libavcodec/tak_parser.c|   2 +-
 libavcodec/vc1_parser.c|   2 +-
 libavcodec/vorbis_parser.c |   2 +-
 libavcodec/vp3_parser.c|   2 +-
 libavcodec/vp8_parser.c|   2 +-
 libavcodec/vp9_parser.c|   2 +-
 libavcodec/webp_parser.c   |   2 +-
 libavcodec/xbm_parser.c|   2 +-
 libavcodec/xma_parser.c|   2 +-
 52 files changed, 104 insertions(+), 104 deletions(-)

diff --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c
index b8692625f3..f3baf7cde3 100644
--- a/libavcodec/aac_parser.c
+++ b/libavcodec/aac_parser.c
@@ -62,7 +62,7 @@ static av_cold int aac_parse_init(AVCodecParserContext *s1)
 }
 
 
-AVCodecParser ff_aac_parser = {
+const AVCodecParser ff_aac_parser = {
 .codec_ids  = { AV_CODEC_ID_AAC },
 .priv_data_size = sizeof(AACAC3ParseContext),
 .parser_init= aac_parse_init,
diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c
index ba171653ef..9ed6ede5c3 100644
--- a/libavcodec/ac3_parser.c
+++ b/libavcodec/ac3_parser.c
@@ -240,7 +240,7 @@ static av_cold int ac3_parse_init(AVCodecParserContext *s1)
 }
 
 
-AVCodecParser ff_ac3_parser = {
+const AVCodecParser ff_ac3_parser = {
 .codec_ids  = { AV_CODEC_ID_AC3, AV_CODEC_ID_EAC3 },
 .priv_data_size = sizeof(AACAC3ParseContext),
 .parser_init= ac3_parse_init,
diff --git a/libavcodec/adx_parser.c b/libavcodec/adx_parser.c
index 1fa718f694..52aa14b7ad 100644
--- a/libavcodec/adx_parser.c
+++ b/libavcodec/adx_parser.c
@@ -88,7 +88,7 @@ static int adx_parse(AVCodecParserContext *s1,
 return next;
 }
 
-AVCodecParser ff_adx_parser = {
+const AVCodecParser ff_adx_parser = {
 .codec_ids  = { AV_CODEC_ID_ADPCM_ADX },
 .priv_data_size = sizeof(ADXParseContext),
 .parser_parse   = adx_parse,
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index 6a76ffb7bc..578f5293c8 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -227,7 +227,7 @@ static int av1_parser_split(AVCodecContext *avctx,
 return 0;
 }
 
-AVCodecParser ff_av1_parser = {
+const AVCodecParser ff_av1_parser = {
 .codec_ids  = { AV_CODEC_ID_AV1 },
 .priv_data_size = sizeof(AV1ParseContext),
 .parser_init= av1_parser_init,
diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
index 54f687142f..059faf77c5 100644
--- a/libavcodec/avs2_parser.c
+++ b/libavcodec/avs2_parser.c
@@ -86,7 +86,7 @@ static int avs2_parse(AVCodecParserContext *s, AVCodecContext 
*avctx,
 return next;
 }
 
-AVCodecParser ff_avs2_parser = {
+const AVCodecParser ff_avs2_parser = {
 .codec_ids  = { AV_CODEC_ID_AVS2 },
 .priv_data_size = sizeof(ParseContext),
 .parser_parse   = avs2_parse,
diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c
index bf97f75db6..b0e720a844 100644
--- a/libavcodec/avs3_parser.c
+++ b/libavcodec/avs3_parser.c
@@ -170,7 +170,7 @@ static int avs3_parse(AVCodecParserContext *s, 
AVCodecContext *avctx,
 return next;
 }
 
-AVCodecParser ff_avs3_parser = {
+const AVCodecParser ff_avs3_parser = {
 

[FFmpeg-devel] [PATCH 81/87] avcodec: Move all AVCodecParser.split functions to remove_extradata_bsf

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

The remove_extradata bsf is the only user of these functions.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/Makefile   |   4 +-
 libavcodec/av1_parser.c   |  25 +---
 libavcodec/avs2_parser.c  |   1 -
 libavcodec/avs3_parser.c  |   1 -
 libavcodec/cavs_parser.c  |   1 -
 libavcodec/h264_parser.c  |  38 --
 libavcodec/hevc_parser.c  |  34 -
 libavcodec/mpeg4video_parser.c|   1 -
 libavcodec/mpegvideo_parser.c |  18 ---
 libavcodec/parser.c   |  14 ---
 libavcodec/remove_extradata_bsf.c | 201 +-
 libavcodec/vc1_parser.c   |  19 ---
 12 files changed, 171 insertions(+), 186 deletions(-)

diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index a640c548e5..c19a3cb60d 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -1075,7 +1075,7 @@ OBJS-$(CONFIG_AAC_PARSER)  += aac_parser.o 
aac_ac3_parser.o \
   mpeg4audio.o
 OBJS-$(CONFIG_AC3_PARSER)  += ac3tab.o aac_ac3_parser.o
 OBJS-$(CONFIG_ADX_PARSER)  += adx_parser.o adx.o
-OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o av1_parse.o
+OBJS-$(CONFIG_AV1_PARSER)  += av1_parser.o
 OBJS-$(CONFIG_AVS2_PARSER) += avs2_parser.o
 OBJS-$(CONFIG_AVS3_PARSER) += avs3_parser.o
 OBJS-$(CONFIG_BMP_PARSER)  += bmp_parser.o
@@ -1159,7 +1159,7 @@ OBJS-$(CONFIG_NULL_BSF)   += null_bsf.o
 OBJS-$(CONFIG_OPUS_METADATA_BSF)  += opus_metadata_bsf.o
 OBJS-$(CONFIG_PCM_RECHUNK_BSF)+= pcm_rechunk_bsf.o
 OBJS-$(CONFIG_PRORES_METADATA_BSF)+= prores_metadata_bsf.o
-OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o
+OBJS-$(CONFIG_REMOVE_EXTRADATA_BSF)   += remove_extradata_bsf.o av1_parse.o
 OBJS-$(CONFIG_SETTS_BSF)  += setts_bsf.o
 OBJS-$(CONFIG_TEXT2MOVSUB_BSF)+= movsub_bsf.o
 OBJS-$(CONFIG_TRACE_HEADERS_BSF)  += trace_headers_bsf.o
diff --git a/libavcodec/av1_parser.c b/libavcodec/av1_parser.c
index 578f5293c8..b6c8004ee3 100644
--- a/libavcodec/av1_parser.c
+++ b/libavcodec/av1_parser.c
@@ -20,7 +20,7 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "av1_parse.h"
+#include "libavutil/avassert.h"
 #include "cbs.h"
 #include "cbs_av1.h"
 #include "internal.h"
@@ -205,33 +205,10 @@ static void av1_parser_close(AVCodecParserContext *ctx)
 ff_cbs_close(>cbc);
 }
 
-static int av1_parser_split(AVCodecContext *avctx,
-const uint8_t *buf, int buf_size)
-{
-AV1OBU obu;
-const uint8_t *ptr = buf, *end = buf + buf_size;
-
-while (ptr < end) {
-int len = ff_av1_extract_obu(, ptr, buf_size, avctx);
-if (len < 0)
-break;
-
-if (obu.type == AV1_OBU_FRAME_HEADER ||
-obu.type == AV1_OBU_FRAME) {
-return ptr - buf;
-}
-ptr  += len;
-buf_size -= len;
-}
-
-return 0;
-}
-
 const AVCodecParser ff_av1_parser = {
 .codec_ids  = { AV_CODEC_ID_AV1 },
 .priv_data_size = sizeof(AV1ParseContext),
 .parser_init= av1_parser_init,
 .parser_close   = av1_parser_close,
 .parser_parse   = av1_parser_parse,
-.split  = av1_parser_split,
 };
diff --git a/libavcodec/avs2_parser.c b/libavcodec/avs2_parser.c
index 059faf77c5..b7d5d7774e 100644
--- a/libavcodec/avs2_parser.c
+++ b/libavcodec/avs2_parser.c
@@ -91,5 +91,4 @@ const AVCodecParser ff_avs2_parser = {
 .priv_data_size = sizeof(ParseContext),
 .parser_parse   = avs2_parse,
 .parser_close   = ff_parse_close,
-.split  = ff_mpeg4video_split,
 };
diff --git a/libavcodec/avs3_parser.c b/libavcodec/avs3_parser.c
index b0e720a844..1a05ea042e 100644
--- a/libavcodec/avs3_parser.c
+++ b/libavcodec/avs3_parser.c
@@ -175,5 +175,4 @@ const AVCodecParser ff_avs3_parser = {
 .priv_data_size = sizeof(ParseContext),
 .parser_parse   = avs3_parse,
 .parser_close   = ff_parse_close,
-.split  = ff_mpeg4video_split,
 };
diff --git a/libavcodec/cavs_parser.c b/libavcodec/cavs_parser.c
index 20adca1dbc..03f392c2e5 100644
--- a/libavcodec/cavs_parser.c
+++ b/libavcodec/cavs_parser.c
@@ -102,5 +102,4 @@ const AVCodecParser ff_cavsvideo_parser = {
 .priv_data_size = sizeof(ParseContext),
 .parser_parse   = cavsvideo_parse,
 .parser_close   = ff_parse_close,
-.split  = ff_mpeg4video_split,
 };
diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c
index 880ccb50fa..d3c56cc188 100644
--- a/libavcodec/h264_parser.c
+++ b/libavcodec/h264_parser.c
@@ -644,43 +644,6 @@ static int h264_parse(AVCodecParserContext *s,
 return next;
 }
 
-static int h264_split(AVCodecContext *avctx,
-  const uint8_t *buf, int buf_size)
-{
-uint32_t state = -1;
-int has_sps= 0;
-

[FFmpeg-devel] [PATCH 79/87] avcodec: Constify AVCodecParserContext.parser

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 doc/APIchanges   | 3 +++
 libavcodec/avcodec.h | 2 +-
 libavcodec/parser.c  | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index f405cd789c..6d47e775a6 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -17,6 +17,9 @@ API changes, most recent first:
 2021-04-17 - xx - lavu 56.73.100 - frame.h detection_bbox.h
   Add AV_FRAME_DATA_DETECTION_BBOXES
 
+2021-04-14 - xx - lavc y - avcodec.h
+  Constified AVCodecParserContext.parser.
+
 2021-04-14 - xx - lavd y - avdevice.h
   The av_*_device_next API functions now accept and return
   pointers to const AVInputFormat resp. AVOutputFormat.
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index bb5e8490ca..60d0164903 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2877,7 +2877,7 @@ enum AVPictureStructure {
 
 typedef struct AVCodecParserContext {
 void *priv_data;
-struct AVCodecParser *parser;
+const struct AVCodecParser *parser;
 int64_t frame_offset; /* offset of the current frame */
 int64_t cur_offset; /* current offset
(incremented by each av_parser_parse()) */
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 593ea9ddf7..f81a62d592 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -55,7 +55,7 @@ found:
 s = av_mallocz(sizeof(AVCodecParserContext));
 if (!s)
 goto err_out;
-s->parser = (AVCodecParser*)parser;
+s->parser = parser;
 s->priv_data = av_mallocz(parser->priv_data_size);
 if (!s->priv_data)
 goto err_out;
-- 
2.31.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 77/87] avdevice/avdevice: Constify av_*_device_next API

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 doc/APIchanges   |  4 
 fftools/cmdutils.c   |  4 ++--
 libavdevice/alldevices.c | 16 
 libavdevice/avdevice.h   |  8 
 4 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 443cb84b27..f405cd789c 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -17,6 +17,10 @@ API changes, most recent first:
 2021-04-17 - xx - lavu 56.73.100 - frame.h detection_bbox.h
   Add AV_FRAME_DATA_DETECTION_BBOXES
 
+2021-04-14 - xx - lavd y - avdevice.h
+  The av_*_device_next API functions now accept and return
+  pointers to const AVInputFormat resp. AVOutputFormat.
+
 2021-04-14 - xx - lavd y - avdevice.h
   avdevice_list_input_sources and avdevice_list_output_sinks now accept
   pointers to const AVInputFormat resp. const AVOutputFormat.
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 822fa8df45..4148285971 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -2289,7 +2289,7 @@ static int show_sinks_sources_parse_arg(const char *arg, 
char **dev, AVDictionar
 
 int show_sources(void *optctx, const char *opt, const char *arg)
 {
-AVInputFormat *fmt = NULL;
+const AVInputFormat *fmt = NULL;
 char *dev = NULL;
 AVDictionary *opts = NULL;
 int ret = 0;
@@ -2327,7 +2327,7 @@ int show_sources(void *optctx, const char *opt, const 
char *arg)
 
 int show_sinks(void *optctx, const char *opt, const char *arg)
 {
-AVOutputFormat *fmt = NULL;
+const AVOutputFormat *fmt = NULL;
 char *dev = NULL;
 AVDictionary *opts = NULL;
 int ret = 0;
diff --git a/libavdevice/alldevices.c b/libavdevice/alldevices.c
index 92b27a1d14..f65317018a 100644
--- a/libavdevice/alldevices.c
+++ b/libavdevice/alldevices.c
@@ -68,7 +68,7 @@ void avdevice_register_all(void)
 avpriv_register_devices(outdev_list, indev_list);
 }
 
-static void *next_input(const AVInputFormat *prev, AVClassCategory c2)
+static const void *next_input(const AVInputFormat *prev, AVClassCategory c2)
 {
 const AVClass *pc;
 const AVClassCategory c1 = AV_CLASS_CATEGORY_DEVICE_INPUT;
@@ -91,10 +91,10 @@ static void *next_input(const AVInputFormat *prev, 
AVClassCategory c2)
 continue;
 category = pc->category;
 } while (category != c1 && category != c2);
-return (AVInputFormat *)fmt;
+return fmt;
 }
 
-static void *next_output(const AVOutputFormat *prev, AVClassCategory c2)
+static const void *next_output(const AVOutputFormat *prev, AVClassCategory c2)
 {
 const AVClass *pc;
 const AVClassCategory c1 = AV_CLASS_CATEGORY_DEVICE_OUTPUT;
@@ -117,25 +117,25 @@ static void *next_output(const AVOutputFormat *prev, 
AVClassCategory c2)
 continue;
 category = pc->category;
 } while (category != c1 && category != c2);
-return (AVOutputFormat *)fmt;
+return fmt;
 }
 
-AVInputFormat *av_input_audio_device_next(AVInputFormat  *d)
+const AVInputFormat *av_input_audio_device_next(const AVInputFormat  *d)
 {
 return next_input(d, AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT);
 }
 
-AVInputFormat *av_input_video_device_next(AVInputFormat  *d)
+const AVInputFormat *av_input_video_device_next(const AVInputFormat  *d)
 {
 return next_input(d, AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT);
 }
 
-AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d)
+const AVOutputFormat *av_output_audio_device_next(const AVOutputFormat *d)
 {
 return next_output(d, AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT);
 }
 
-AVOutputFormat *av_output_video_device_next(AVOutputFormat *d)
+const AVOutputFormat *av_output_video_device_next(const AVOutputFormat *d)
 {
 return next_output(d, AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT);
 }
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index d0b0f23f5d..8370bbc7f2 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -77,7 +77,7 @@ void avdevice_register_all(void);
  * if d is non-NULL, returns the next registered input audio/video device 
after d
  * or NULL if d is the last one.
  */
-AVInputFormat *av_input_audio_device_next(AVInputFormat  *d);
+const AVInputFormat *av_input_audio_device_next(const AVInputFormat  *d);
 
 /**
  * Video input devices iterator.
@@ -86,7 +86,7 @@ AVInputFormat *av_input_audio_device_next(AVInputFormat  *d);
  * if d is non-NULL, returns the next registered input audio/video device 
after d
  * or NULL if d is the last one.
  */
-AVInputFormat *av_input_video_device_next(AVInputFormat  *d);
+const AVInputFormat *av_input_video_device_next(const AVInputFormat  *d);
 
 /**
  * Audio output devices iterator.
@@ -95,7 +95,7 @@ AVInputFormat *av_input_video_device_next(AVInputFormat  *d);
  * if d is non-NULL, returns the next registered output audio/video device 
after d
  * or NULL if d is the last one.
  */
-AVOutputFormat *av_output_audio_device_next(AVOutputFormat *d);
+const AVOutputFormat 

[FFmpeg-devel] [PATCH 76/87] avdevice/avdevice: Constify avdevice_list_input_sources/output_sinks

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 doc/APIchanges | 4 
 fftools/cmdutils.c | 4 ++--
 libavdevice/avdevice.c | 4 ++--
 libavdevice/avdevice.h | 4 ++--
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index d19b817660..443cb84b27 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -17,6 +17,10 @@ API changes, most recent first:
 2021-04-17 - xx - lavu 56.73.100 - frame.h detection_bbox.h
   Add AV_FRAME_DATA_DETECTION_BBOXES
 
+2021-04-14 - xx - lavd y - avdevice.h
+  avdevice_list_input_sources and avdevice_list_output_sinks now accept
+  pointers to const AVInputFormat resp. const AVOutputFormat.
+
 2021-04-14 - xx - lavf y - avformat.h
   av_find_best_stream now uses a const AVCodec ** parameter
   for the returned decoder.
diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 1db5e8cdd9..822fa8df45 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -2205,7 +2205,7 @@ double get_rotation(AVStream *st)
 }
 
 #if CONFIG_AVDEVICE
-static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
+static int print_device_sources(const AVInputFormat *fmt, AVDictionary *opts)
 {
 int ret, i;
 AVDeviceInfoList *device_list = NULL;
@@ -2235,7 +2235,7 @@ static int print_device_sources(AVInputFormat *fmt, 
AVDictionary *opts)
 return ret;
 }
 
-static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
+static int print_device_sinks(const AVOutputFormat *fmt, AVDictionary *opts)
 {
 int ret, i;
 AVDeviceInfoList *device_list = NULL;
diff --git a/libavdevice/avdevice.c b/libavdevice/avdevice.c
index 554debcf06..22b7595ab1 100644
--- a/libavdevice/avdevice.c
+++ b/libavdevice/avdevice.c
@@ -120,7 +120,7 @@ static int list_devices_for_context(AVFormatContext *s, 
AVDictionary *options,
 return ret;
 }
 
-int avdevice_list_input_sources(AVInputFormat *device, const char *device_name,
+int avdevice_list_input_sources(const AVInputFormat *device, const char 
*device_name,
 AVDictionary *device_options, AVDeviceInfoList 
**device_list)
 {
 AVFormatContext *s = NULL;
@@ -131,7 +131,7 @@ int avdevice_list_input_sources(AVInputFormat *device, 
const char *device_name,
 return list_devices_for_context(s, device_options, device_list);
 }
 
-int avdevice_list_output_sinks(AVOutputFormat *device, const char *device_name,
+int avdevice_list_output_sinks(const AVOutputFormat *device, const char 
*device_name,
AVDictionary *device_options, AVDeviceInfoList 
**device_list)
 {
 AVFormatContext *s = NULL;
diff --git a/libavdevice/avdevice.h b/libavdevice/avdevice.h
index 85a4dcc6df..d0b0f23f5d 100644
--- a/libavdevice/avdevice.h
+++ b/libavdevice/avdevice.h
@@ -507,9 +507,9 @@ void avdevice_free_list_devices(AVDeviceInfoList 
**device_list);
  * @return count of autodetected devices, negative on error.
  * @note device argument takes precedence over device_name when both are set.
  */
-int avdevice_list_input_sources(struct AVInputFormat *device, const char 
*device_name,
+int avdevice_list_input_sources(const AVInputFormat *device, const char 
*device_name,
 AVDictionary *device_options, AVDeviceInfoList 
**device_list);
-int avdevice_list_output_sinks(struct AVOutputFormat *device, const char 
*device_name,
+int avdevice_list_output_sinks(const AVOutputFormat *device, const char 
*device_name,
AVDictionary *device_options, AVDeviceInfoList 
**device_list);
 
 /**
-- 
2.31.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 75/87] avformat/avformat, utils: Make av_find_best_stream const-correct

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 doc/APIchanges | 4 
 libavformat/avformat.h | 2 +-
 libavformat/utils.c| 4 ++--
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index a823a4419c..d19b817660 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -17,6 +17,10 @@ API changes, most recent first:
 2021-04-17 - xx - lavu 56.73.100 - frame.h detection_bbox.h
   Add AV_FRAME_DATA_DETECTION_BBOXES
 
+2021-04-14 - xx - lavf y - avformat.h
+  av_find_best_stream now uses a const AVCodec ** parameter
+  for the returned decoder.
+
 2021-04-14 - xx - lavc y - codec.h
   avcodec_find_encoder_by_name(), avcodec_find_encoder(),
   avcodec_find_decoder_by_name() and avcodec_find_decoder()
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 23bdaa207b..28069d45dc 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2070,7 +2070,7 @@ int av_find_best_stream(AVFormatContext *ic,
 enum AVMediaType type,
 int wanted_stream_nb,
 int related_stream,
-AVCodec **decoder_ret,
+const AVCodec **decoder_ret,
 int flags);
 
 /**
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 7078891dc0..2f66f539a6 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4200,7 +4200,7 @@ AVProgram *av_find_program_from_stream(AVFormatContext 
*ic, AVProgram *last, int
 
 int av_find_best_stream(AVFormatContext *ic, enum AVMediaType type,
 int wanted_stream_nb, int related_stream,
-AVCodec **decoder_ret, int flags)
+const AVCodec **decoder_ret, int flags)
 {
 int i, nb_streams = ic->nb_streams;
 int ret = AVERROR_STREAM_NOT_FOUND;
@@ -4260,7 +4260,7 @@ int av_find_best_stream(AVFormatContext *ic, enum 
AVMediaType type,
 }
 }
 if (decoder_ret)
-*decoder_ret = (AVCodec*)best_decoder;
+*decoder_ret = best_decoder;
 return ret;
 }
 
-- 
2.31.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 74/87] avcodec/codec, allcodecs: Constify the AVCodec API

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 doc/APIchanges|  5 +
 libavcodec/allcodecs.c| 18 +-
 libavcodec/codec.h|  8 
 tools/target_dec_fuzzer.c |  8 
 4 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 2522978952..a823a4419c 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -17,6 +17,11 @@ API changes, most recent first:
 2021-04-17 - xx - lavu 56.73.100 - frame.h detection_bbox.h
   Add AV_FRAME_DATA_DETECTION_BBOXES
 
+2021-04-14 - xx - lavc y - codec.h
+  avcodec_find_encoder_by_name(), avcodec_find_encoder(),
+  avcodec_find_decoder_by_name() and avcodec_find_decoder()
+  now return a pointer to const AVCodec.
+
 2021-04-14 - xx - lavf y - avformat.h
   Constified AVFormatContext.*_codec.
 
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index cf6fe2055b..e60ac5ce78 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -872,7 +872,7 @@ static enum AVCodecID remap_deprecated_codec_id(enum 
AVCodecID id)
 }
 }
 
-static AVCodec *find_codec(enum AVCodecID id, int (*x)(const AVCodec *))
+static const AVCodec *find_codec(enum AVCodecID id, int (*x)(const AVCodec *))
 {
 const AVCodec *p, *experimental = NULL;
 void *i = 0;
@@ -886,24 +886,24 @@ static AVCodec *find_codec(enum AVCodecID id, int 
(*x)(const AVCodec *))
 if (p->capabilities & AV_CODEC_CAP_EXPERIMENTAL && !experimental) {
 experimental = p;
 } else
-return (AVCodec*)p;
+return p;
 }
 }
 
-return (AVCodec*)experimental;
+return experimental;
 }
 
-AVCodec *avcodec_find_encoder(enum AVCodecID id)
+const AVCodec *avcodec_find_encoder(enum AVCodecID id)
 {
 return find_codec(id, av_codec_is_encoder);
 }
 
-AVCodec *avcodec_find_decoder(enum AVCodecID id)
+const AVCodec *avcodec_find_decoder(enum AVCodecID id)
 {
 return find_codec(id, av_codec_is_decoder);
 }
 
-static AVCodec *find_codec_by_name(const char *name, int (*x)(const AVCodec *))
+static const AVCodec *find_codec_by_name(const char *name, int (*x)(const 
AVCodec *))
 {
 void *i = 0;
 const AVCodec *p;
@@ -915,18 +915,18 @@ static AVCodec *find_codec_by_name(const char *name, int 
(*x)(const AVCodec *))
 if (!x(p))
 continue;
 if (strcmp(name, p->name) == 0)
-return (AVCodec*)p;
+return p;
 }
 
 return NULL;
 }
 
-AVCodec *avcodec_find_encoder_by_name(const char *name)
+const AVCodec *avcodec_find_encoder_by_name(const char *name)
 {
 return find_codec_by_name(name, av_codec_is_encoder);
 }
 
-AVCodec *avcodec_find_decoder_by_name(const char *name)
+const AVCodec *avcodec_find_decoder_by_name(const char *name)
 {
 return find_codec_by_name(name, av_codec_is_decoder);
 }
diff --git a/libavcodec/codec.h b/libavcodec/codec.h
index c95078491d..c8653e3b31 100644
--- a/libavcodec/codec.h
+++ b/libavcodec/codec.h
@@ -367,7 +367,7 @@ const AVCodec *av_codec_iterate(void **opaque);
  * @param id AVCodecID of the requested decoder
  * @return A decoder if one was found, NULL otherwise.
  */
-AVCodec *avcodec_find_decoder(enum AVCodecID id);
+const AVCodec *avcodec_find_decoder(enum AVCodecID id);
 
 /**
  * Find a registered decoder with the specified name.
@@ -375,7 +375,7 @@ AVCodec *avcodec_find_decoder(enum AVCodecID id);
  * @param name name of the requested decoder
  * @return A decoder if one was found, NULL otherwise.
  */
-AVCodec *avcodec_find_decoder_by_name(const char *name);
+const AVCodec *avcodec_find_decoder_by_name(const char *name);
 
 /**
  * Find a registered encoder with a matching codec ID.
@@ -383,7 +383,7 @@ AVCodec *avcodec_find_decoder_by_name(const char *name);
  * @param id AVCodecID of the requested encoder
  * @return An encoder if one was found, NULL otherwise.
  */
-AVCodec *avcodec_find_encoder(enum AVCodecID id);
+const AVCodec *avcodec_find_encoder(enum AVCodecID id);
 
 /**
  * Find a registered encoder with the specified name.
@@ -391,7 +391,7 @@ AVCodec *avcodec_find_encoder(enum AVCodecID id);
  * @param name name of the requested encoder
  * @return An encoder if one was found, NULL otherwise.
  */
-AVCodec *avcodec_find_encoder_by_name(const char *name);
+const AVCodec *avcodec_find_encoder_by_name(const char *name);
 /**
  * @return a non-zero number if codec is an encoder, zero otherwise
  */
diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 334c47a2c8..f52eba92b1 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -59,7 +59,7 @@
 
 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
 
-extern AVCodec * codec_list[];
+extern const AVCodec * codec_list[];
 
 static void error(const char *err)
 {
@@ -67,10 +67,10 @@ static void error(const char *err)
 exit(1);
 }
 
-static AVCodec *c = NULL;
-static AVCodec 

[FFmpeg-devel] [PATCH 73/87] avformat/avformat: Constify AVFormatContext.*_codec pointers

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

This also allows to exclusively use pointers to const AVCodec in
fftools/ffmpeg_opt.c.

Signed-off-by: Andreas Rheinhardt 
---
 doc/APIchanges | 3 +++
 fftools/ffmpeg_opt.c   | 4 ++--
 libavformat/avformat.h | 8 
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index e9fa7ddf64..2522978952 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -17,6 +17,9 @@ API changes, most recent first:
 2021-04-17 - xx - lavu 56.73.100 - frame.h detection_bbox.h
   Add AV_FRAME_DATA_DETECTION_BBOXES
 
+2021-04-14 - xx - lavf y - avformat.h
+  Constified AVFormatContext.*_codec.
+
 2021-04-14 - xx - lavf y - avformat.h
   Constified the pointers to AVInputFormats and AVOutputFormats
   in AVFormatContext, avformat_alloc_output_context2(),
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 9e26de5a94..e66141f3ab 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -737,11 +737,11 @@ static int opt_recording_timestamp(void *optctx, const 
char *opt, const char *ar
 return 0;
 }
 
-static AVCodec *find_codec_or_die(const char *name, enum AVMediaType type, int 
encoder)
+static const AVCodec *find_codec_or_die(const char *name, enum AVMediaType 
type, int encoder)
 {
 const AVCodecDescriptor *desc;
 const char *codec_string = encoder ? "encoder" : "decoder";
-AVCodec *codec;
+const AVCodec *codec;
 
 codec = encoder ?
 avcodec_find_encoder_by_name(name) :
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 3834c9869f..23bdaa207b 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1598,7 +1598,7 @@ typedef struct AVFormatContext {
  * the same codec_id.
  * Demuxing: Set by user
  */
-AVCodec *video_codec;
+const AVCodec *video_codec;
 
 /**
  * Forced audio codec.
@@ -1606,7 +1606,7 @@ typedef struct AVFormatContext {
  * the same codec_id.
  * Demuxing: Set by user
  */
-AVCodec *audio_codec;
+const AVCodec *audio_codec;
 
 /**
  * Forced subtitle codec.
@@ -1614,7 +1614,7 @@ typedef struct AVFormatContext {
  * the same codec_id.
  * Demuxing: Set by user
  */
-AVCodec *subtitle_codec;
+const AVCodec *subtitle_codec;
 
 /**
  * Forced data codec.
@@ -1622,7 +1622,7 @@ typedef struct AVFormatContext {
  * the same codec_id.
  * Demuxing: Set by user
  */
-AVCodec *data_codec;
+const AVCodec *data_codec;
 
 /**
  * Number of bytes to be written as padding in a metadata header.
-- 
2.31.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 70/87] avutil/buffer: Switch AVBuffer API to size_t

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Announced in 14040a1d913794d9a3fd6406a6d8c2f0e37e0062.

Signed-off-by: Andreas Rheinhardt 
---
 fftools/ffprobe.c  |  2 +-
 libavcodec/aacdec_template.c   |  4 ++--
 libavcodec/adxdec.c|  2 +-
 libavcodec/audiotoolboxdec.c   |  2 +-
 libavcodec/avpacket.c  | 28 ++--
 libavcodec/cbs_bsf.c   |  2 +-
 libavcodec/decode.c| 13 +++--
 libavcodec/h264_metadata_bsf.c |  2 +-
 libavcodec/h264dec.c   |  2 +-
 libavcodec/hevcdec.c   |  2 +-
 libavcodec/libvpxdec.c |  2 +-
 libavcodec/mpeg12enc.c |  4 ++--
 libavcodec/mscc.c  |  5 +++--
 libavcodec/nvdec.c |  4 ++--
 libavcodec/packet.h| 24 
 libavcodec/srtdec.c|  2 +-
 libavcodec/vaapi_encode.c  |  2 +-
 libavdevice/decklink_dec.cpp   |  4 ++--
 libavdevice/decklink_enc.cpp   |  2 +-
 libavdevice/lavfi.c|  2 +-
 libavdevice/xcbgrab.c  |  2 +-
 libavfilter/af_ashowinfo.c |  3 ++-
 libavfilter/framepool.c|  4 ++--
 libavfilter/framepool.h|  4 ++--
 libavfilter/vf_showinfo.c  | 10 ++
 libavformat/adtsenc.c  |  2 +-
 libavformat/apngenc.c  |  2 +-
 libavformat/avformat.h |  8 
 libavformat/concatdec.c|  2 +-
 libavformat/dashenc.c  |  4 ++--
 libavformat/dump.c |  4 ++--
 libavformat/flacenc.c  |  2 +-
 libavformat/flvenc.c   |  2 +-
 libavformat/framecrcenc.c  |  6 --
 libavformat/hashenc.c  |  7 ---
 libavformat/img2dec.c  |  2 +-
 libavformat/latmenc.c  |  2 +-
 libavformat/matroskaenc.c  |  6 +++---
 libavformat/mov.c  |  3 +--
 libavformat/movenc.c   | 10 +-
 libavformat/mp3enc.c   |  4 ++--
 libavformat/mpegtsenc.c|  4 ++--
 libavformat/oggdec.h   |  2 +-
 libavformat/rtpenc.c   |  2 +-
 libavformat/segment.c  |  2 +-
 libavformat/srtenc.c   |  2 +-
 libavformat/utils.c|  6 +++---
 libavformat/webvttdec.c|  2 +-
 libavformat/webvttenc.c|  2 +-
 libavutil/buffer.c | 14 +++---
 libavutil/buffer.h | 29 -
 libavutil/buffer_internal.h|  8 
 libavutil/detection_bbox.c |  4 
 libavutil/frame.c  |  2 +-
 libavutil/frame.h  |  8 
 libavutil/hwcontext_cuda.c |  2 +-
 libavutil/hwcontext_d3d11va.c  |  2 +-
 libavutil/hwcontext_dxva2.c|  2 +-
 libavutil/hwcontext_opencl.c   |  2 +-
 libavutil/hwcontext_qsv.c  |  2 +-
 libavutil/hwcontext_vaapi.c|  2 +-
 libavutil/hwcontext_vdpau.c|  2 +-
 libavutil/hwcontext_vulkan.c   |  2 +-
 libavutil/internal.h   |  7 ---
 libavutil/version.h|  3 ---
 libavutil/video_enc_params.c   |  4 
 66 files changed, 110 insertions(+), 206 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 13ed16431d..7b28f6b3ce 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2158,7 +2158,7 @@ static void show_packet(WriterContext *w, InputFile 
*ifile, AVPacket *pkt, int p
   pkt->flags & AV_PKT_FLAG_DISCARD ? 'D' : '_');
 
 if (pkt->side_data_elems) {
-int size;
+size_t size;
 const uint8_t *side_metadata;
 
 side_metadata = av_packet_get_side_data(pkt, 
AV_PKT_DATA_STRINGS_METADATA, );
diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c
index 98f77a3ad7..d78e60ec2e 100644
--- a/libavcodec/aacdec_template.c
+++ b/libavcodec/aacdec_template.c
@@ -3437,11 +3437,11 @@ static int aac_decode_frame(AVCodecContext *avctx, void 
*data,
 int buf_consumed;
 int buf_offset;
 int err;
-buffer_size_t new_extradata_size;
+size_t new_extradata_size;
 const uint8_t *new_extradata = av_packet_get_side_data(avpkt,
AV_PKT_DATA_NEW_EXTRADATA,
_extradata_size);
-buffer_size_t jp_dualmono_size;
+size_t jp_dualmono_size;
 const uint8_t *jp_dualmono   = av_packet_get_side_data(avpkt,
AV_PKT_DATA_JP_DUALMONO,
_dualmono_size);
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index 94de3eee19..eb05145da9 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -103,7 +103,7 @@ static int adx_decode_frame(AVCodecContext *avctx, void 
*data,
 const uint8_t *buf  = avpkt->data;
 const uint8_t *buf_end = buf + avpkt->size;
 int num_blocks, ch, ret;
-buffer_size_t new_extradata_size;
+size_t new_extradata_size;
 uint8_t *new_extradata;
 
 new_extradata = av_packet_get_side_data(avpkt, AV_PKT_DATA_NEW_EXTRADATA,
diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index fa55f58988..a4fb8c9120 100644
--- 

[FFmpeg-devel] [PATCH 68/87] avutil/frame: Remove deprecated getters and setters

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 7df37dd319f2d9d3e1becd5d433884e3ccfa1ee2.

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/frame.c   | 14 -
 libavutil/frame.h   | 50 -
 libavutil/version.h |  3 ---
 3 files changed, 67 deletions(-)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index e29008752c..7d5a36b2f1 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -27,20 +27,6 @@
 #include "samplefmt.h"
 #include "hwcontext.h"
 
-#if FF_API_FRAME_GET_SET
-MAKE_ACCESSORS(AVFrame, frame, int64_t, best_effort_timestamp)
-MAKE_ACCESSORS(AVFrame, frame, int64_t, pkt_duration)
-MAKE_ACCESSORS(AVFrame, frame, int64_t, pkt_pos)
-MAKE_ACCESSORS(AVFrame, frame, int64_t, channel_layout)
-MAKE_ACCESSORS(AVFrame, frame, int, channels)
-MAKE_ACCESSORS(AVFrame, frame, int, sample_rate)
-MAKE_ACCESSORS(AVFrame, frame, AVDictionary *, metadata)
-MAKE_ACCESSORS(AVFrame, frame, int, decode_error_flags)
-MAKE_ACCESSORS(AVFrame, frame, int, pkt_size)
-MAKE_ACCESSORS(AVFrame, frame, enum AVColorSpace, colorspace)
-MAKE_ACCESSORS(AVFrame, frame, enum AVColorRange, color_range)
-#endif
-
 #define CHECK_CHANNELS_CONSISTENCY(frame) \
 av_assert2(!(frame)->channel_layout || \
(frame)->channels == \
diff --git a/libavutil/frame.h b/libavutil/frame.h
index 43345bcdee..853d4cabec 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -651,56 +651,6 @@ typedef struct AVFrame {
 AVBufferRef *private_ref;
 } AVFrame;
 
-#if FF_API_FRAME_GET_SET
-/**
- * Accessors for some AVFrame fields. These used to be provided for ABI
- * compatibility, and do not need to be used anymore.
- */
-attribute_deprecated
-int64_t av_frame_get_best_effort_timestamp(const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_best_effort_timestamp(AVFrame *frame, int64_t val);
-attribute_deprecated
-int64_t av_frame_get_pkt_duration (const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_pkt_duration (AVFrame *frame, int64_t val);
-attribute_deprecated
-int64_t av_frame_get_pkt_pos  (const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_pkt_pos  (AVFrame *frame, int64_t val);
-attribute_deprecated
-int64_t av_frame_get_channel_layout   (const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_channel_layout   (AVFrame *frame, int64_t val);
-attribute_deprecated
-int av_frame_get_channels (const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_channels (AVFrame *frame, int val);
-attribute_deprecated
-int av_frame_get_sample_rate  (const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_sample_rate  (AVFrame *frame, int val);
-attribute_deprecated
-AVDictionary *av_frame_get_metadata   (const AVFrame *frame);
-attribute_deprecated
-void  av_frame_set_metadata   (AVFrame *frame, AVDictionary *val);
-attribute_deprecated
-int av_frame_get_decode_error_flags   (const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_decode_error_flags   (AVFrame *frame, int val);
-attribute_deprecated
-int av_frame_get_pkt_size(const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_pkt_size(AVFrame *frame, int val);
-attribute_deprecated
-enum AVColorSpace av_frame_get_colorspace(const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_colorspace(AVFrame *frame, enum AVColorSpace val);
-attribute_deprecated
-enum AVColorRange av_frame_get_color_range(const AVFrame *frame);
-attribute_deprecated
-voidav_frame_set_color_range(AVFrame *frame, enum AVColorRange val);
-#endif
 
 #if FF_API_COLORSPACE_NAME
 /**
diff --git a/libavutil/version.h b/libavutil/version.h
index 54b09534a2..81f8690e01 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,9 +105,6 @@
  * @{
  */
 
-#ifndef FF_API_FRAME_GET_SET
-#define FF_API_FRAME_GET_SET(LIBAVUTIL_VERSION_MAJOR < 57)
-#endif
 #ifndef FF_API_PSEUDOPAL
 #define FF_API_PSEUDOPAL(LIBAVUTIL_VERSION_MAJOR < 57)
 #endif
-- 
2.31.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 69/87] avutil/pixdesc: Remove deprecated AV_PIX_FMT_FLAG_PSEUDOPAL

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in d6fc031caf64eed921bbdef86d79d56bfc2633b0.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/decode.c  |  5 +
 libavcodec/ffv1dec.c |  3 +--
 libavcodec/rawdec.c  | 17 +
 libavfilter/drawutils.c  |  2 +-
 libavfilter/framepool.c  |  6 ++
 libavfilter/vf_crop.c|  2 +-
 libavfilter/vf_pixdesctest.c |  3 +--
 libavfilter/vf_scale.c   |  3 +--
 libavfilter/vf_untile.c  |  2 +-
 libavutil/frame.c|  2 +-
 libavutil/imgutils.c | 15 ---
 libavutil/internal.h |  9 -
 libavutil/pixdesc.c  |  9 -
 libavutil/pixdesc.h  | 20 
 libavutil/version.h  |  3 ---
 tests/ref/fate/imgutils  | 10 +-
 16 files changed, 28 insertions(+), 83 deletions(-)

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 1a7c37043e..9e5230ae1d 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1425,8 +1425,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame 
*pic)
 pic->data[i] = NULL;
 pic->linesize[i] = 0;
 }
-if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
-((desc->flags & FF_PSEUDOPAL) && pic->data[1]))
+if (desc->flags & AV_PIX_FMT_FLAG_PAL)
 avpriv_set_systematic_pal2((uint32_t *)pic->data[1], pic->format);
 
 if (s->debug & FF_DEBUG_BUFFERS)
@@ -1589,8 +1588,6 @@ static void validate_avframe_allocation(AVCodecContext 
*avctx, AVFrame *frame)
 int flags = desc ? desc->flags : 0;
 if (num_planes == 1 && (flags & AV_PIX_FMT_FLAG_PAL))
 num_planes = 2;
-if ((flags & FF_PSEUDOPAL) && frame->data[1])
-num_planes = 2;
 for (i = 0; i < num_planes; i++) {
 av_assert0(frame->data[i]);
 }
diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index 8516fef5d7..14879779fa 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -952,8 +952,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame, AVPac
  (fs->slice_y >> sv) + ((fs->slice_x >> sh) << 
pixshift);
 
 }
-if (desc->flags & AV_PIX_FMT_FLAG_PAL ||
-desc->flags & FF_PSEUDOPAL) {
+if (desc->flags & AV_PIX_FMT_FLAG_PAL) {
 dst[1] = p->data[1];
 src[1] = f->last_picture.f->data[1];
 }
diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
index d3756328ba..a13f88b148 100644
--- a/libavcodec/rawdec.c
+++ b/libavcodec/rawdec.c
@@ -93,19 +93,13 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
 return AVERROR(EINVAL);
 }
 
-if (desc->flags & (AV_PIX_FMT_FLAG_PAL | FF_PSEUDOPAL)) {
+if (desc->flags & AV_PIX_FMT_FLAG_PAL) {
 context->palette = av_buffer_alloc(AVPALETTE_SIZE);
 if (!context->palette)
 return AVERROR(ENOMEM);
-#if FF_API_PSEUDOPAL
-if (desc->flags & AV_PIX_FMT_FLAG_PSEUDOPAL)
-avpriv_set_systematic_pal2((uint32_t*)context->palette->data, 
avctx->pix_fmt);
-#endif
-else {
-memset(context->palette->data, 0, AVPALETTE_SIZE);
-if (avctx->bits_per_coded_sample == 1)
-memset(context->palette->data, 0xff, 4);
-}
+memset(context->palette->data, 0, AVPALETTE_SIZE);
+if (avctx->bits_per_coded_sample == 1)
+memset(context->palette->data, 0xff, 4);
 }
 
 if ((avctx->extradata_size >= 9 &&
@@ -416,8 +410,7 @@ static int raw_decode(AVCodecContext *avctx, void *data, 
int *got_frame,
 frame->linesize[1] = FFALIGN(frame->linesize[1], linesize_align);
 }
 
-if ((avctx->pix_fmt == AV_PIX_FMT_PAL8 && buf_size < context->frame_size) 
||
-(desc->flags & FF_PSEUDOPAL)) {
+if (avctx->pix_fmt == AV_PIX_FMT_PAL8 && buf_size < context->frame_size) {
 frame->buf[1]  = av_buffer_ref(context->palette);
 if (!frame->buf[1]) {
 av_buffer_unref(>buf[0]);
diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 0a59ff9987..f95e12091b 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -91,7 +91,7 @@ int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat 
format, unsigned flags)
 
 if (!desc || !desc->name)
 return AVERROR(EINVAL);
-if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | 
FF_PSEUDOPAL | AV_PIX_FMT_FLAG_ALPHA))
+if (desc->flags & ~(AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB | 
AV_PIX_FMT_FLAG_ALPHA))
 return AVERROR(ENOSYS);
 if (format == AV_PIX_FMT_P010LE || format == AV_PIX_FMT_P010BE || format 
== AV_PIX_FMT_P016LE || format == AV_PIX_FMT_P016BE)
 return AVERROR(ENOSYS);
diff --git a/libavfilter/framepool.c b/libavfilter/framepool.c
index dab8891524..5f67fa170a 100644
--- a/libavfilter/framepool.c
+++ b/libavfilter/framepool.c
@@ -102,8 +102,7 @@ FFFramePool 

[FFmpeg-devel] [PATCH 71/87] avutil/cpu: Remove deprecated functions

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/cpu.c | 92 -
 libavutil/cpu.h | 24 
 libavutil/version.h |  3 --
 3 files changed, 119 deletions(-)

diff --git a/libavutil/cpu.c b/libavutil/cpu.c
index 1215394620..8960415d00 100644
--- a/libavutil/cpu.c
+++ b/libavutil/cpu.c
@@ -102,98 +102,6 @@ int av_get_cpu_flags(void)
 return flags;
 }
 
-#if FF_API_CPU_FLAGS
-void av_set_cpu_flags_mask(int mask)
-{
-atomic_store_explicit(_flags, get_cpu_flags() & mask,
-  memory_order_relaxed);
-}
-
-int av_parse_cpu_flags(const char *s)
-{
-#define CPUFLAG_MMXEXT   (AV_CPU_FLAG_MMX  | AV_CPU_FLAG_MMXEXT | 
AV_CPU_FLAG_CMOV)
-#define CPUFLAG_3DNOW(AV_CPU_FLAG_3DNOW| AV_CPU_FLAG_MMX)
-#define CPUFLAG_3DNOWEXT (AV_CPU_FLAG_3DNOWEXT | CPUFLAG_3DNOW)
-#define CPUFLAG_SSE  (AV_CPU_FLAG_SSE  | CPUFLAG_MMXEXT)
-#define CPUFLAG_SSE2 (AV_CPU_FLAG_SSE2 | CPUFLAG_SSE)
-#define CPUFLAG_SSE2SLOW (AV_CPU_FLAG_SSE2SLOW | CPUFLAG_SSE2)
-#define CPUFLAG_SSE3 (AV_CPU_FLAG_SSE3 | CPUFLAG_SSE2)
-#define CPUFLAG_SSE3SLOW (AV_CPU_FLAG_SSE3SLOW | CPUFLAG_SSE3)
-#define CPUFLAG_SSSE3(AV_CPU_FLAG_SSSE3| CPUFLAG_SSE3)
-#define CPUFLAG_SSE4 (AV_CPU_FLAG_SSE4 | CPUFLAG_SSSE3)
-#define CPUFLAG_SSE42(AV_CPU_FLAG_SSE42| CPUFLAG_SSE4)
-#define CPUFLAG_AVX  (AV_CPU_FLAG_AVX  | CPUFLAG_SSE42)
-#define CPUFLAG_AVXSLOW  (AV_CPU_FLAG_AVXSLOW  | CPUFLAG_AVX)
-#define CPUFLAG_XOP  (AV_CPU_FLAG_XOP  | CPUFLAG_AVX)
-#define CPUFLAG_FMA3 (AV_CPU_FLAG_FMA3 | CPUFLAG_AVX)
-#define CPUFLAG_FMA4 (AV_CPU_FLAG_FMA4 | CPUFLAG_AVX)
-#define CPUFLAG_AVX2 (AV_CPU_FLAG_AVX2 | CPUFLAG_AVX)
-#define CPUFLAG_BMI2 (AV_CPU_FLAG_BMI2 | AV_CPU_FLAG_BMI1)
-#define CPUFLAG_AESNI(AV_CPU_FLAG_AESNI| CPUFLAG_SSE42)
-#define CPUFLAG_AVX512   (AV_CPU_FLAG_AVX512   | CPUFLAG_AVX2)
-static const AVOption cpuflags_opts[] = {
-{ "flags"   , NULL, 0, AV_OPT_TYPE_FLAGS, { .i64 = 0 }, INT64_MIN, 
INT64_MAX, .unit = "flags" },
-#if   ARCH_PPC
-{ "altivec" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ALTIVEC 
 },.unit = "flags" },
-#elif ARCH_X86
-{ "mmx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_MMX 
 },.unit = "flags" },
-{ "mmxext"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_MMXEXT  
 },.unit = "flags" },
-{ "sse" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE 
 },.unit = "flags" },
-{ "sse2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE2
 },.unit = "flags" },
-{ "sse2slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE2SLOW
 },.unit = "flags" },
-{ "sse3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE3
 },.unit = "flags" },
-{ "sse3slow", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE3SLOW
 },.unit = "flags" },
-{ "ssse3"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSSE3   
 },.unit = "flags" },
-{ "atom", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ATOM
 },.unit = "flags" },
-{ "sse4.1"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE4
 },.unit = "flags" },
-{ "sse4.2"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_SSE42   
 },.unit = "flags" },
-{ "avx" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX 
 },.unit = "flags" },
-{ "avxslow" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVXSLOW 
 },.unit = "flags" },
-{ "xop" , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_XOP 
 },.unit = "flags" },
-{ "fma3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_FMA3
 },.unit = "flags" },
-{ "fma4", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_FMA4
 },.unit = "flags" },
-{ "avx2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX2
 },.unit = "flags" },
-{ "bmi1", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_BMI1
 },.unit = "flags" },
-{ "bmi2", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_BMI2
 },.unit = "flags" },
-{ "3dnow"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOW   
 },.unit = "flags" },
-{ "3dnowext", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_3DNOWEXT
 },.unit = "flags" },
-{ "cmov", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_CMOV
 },.unit = "flags" },
-{ "aesni"   , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AESNI   
 },.unit = "flags" },
-{ "avx512"  , NULL, 0, AV_OPT_TYPE_CONST, { .i64 = CPUFLAG_AVX512  
 },.unit = "flags" },
-#elif ARCH_ARM
-{ "armv5te",  NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV5TE 
 },.unit = "flags" },
-{ "armv6",NULL, 0, 

[FFmpeg-devel] [PATCH 67/87] avutil: Switch crypto APIs to size_t

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Announced in e435beb1ea5380a90774dbf51fdc8c941e486551.

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/adler32.c |  5 -
 libavutil/adler32.h |  9 -
 libavutil/hash.c|  4 
 libavutil/hash.h|  4 
 libavutil/hmac.c|  4 
 libavutil/md5.c | 15 +++
 libavutil/md5.h |  8 
 libavutil/murmur3.c |  4 
 libavutil/murmur3.h |  4 
 libavutil/ripemd.c  | 23 ---
 libavutil/ripemd.h  |  4 
 libavutil/sha.c | 23 ---
 libavutil/sha.h |  4 
 libavutil/sha512.c  | 23 ---
 libavutil/sha512.h  |  4 
 libavutil/version.h |  3 ---
 16 files changed, 39 insertions(+), 102 deletions(-)

diff --git a/libavutil/adler32.c b/libavutil/adler32.c
index 5ed5ff55a3..f7d3062265 100644
--- a/libavutil/adler32.c
+++ b/libavutil/adler32.c
@@ -41,12 +41,7 @@
 #define DO4(buf)  DO1(buf); DO1(buf); DO1(buf); DO1(buf);
 #define DO16(buf) DO4(buf); DO4(buf); DO4(buf); DO4(buf);
 
-#if FF_API_CRYPTO_SIZE_T
-unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf,
-unsigned int len)
-#else
 AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
-#endif
 {
 unsigned long s1 = adler & 0x;
 unsigned long s2 = adler >> 16;
diff --git a/libavutil/adler32.h b/libavutil/adler32.h
index e7a8f83729..232d07f5fe 100644
--- a/libavutil/adler32.h
+++ b/libavutil/adler32.h
@@ -30,7 +30,6 @@
 #include 
 #include 
 #include "attributes.h"
-#include "version.h"
 
 /**
  * @defgroup lavu_adler32 Adler-32
@@ -40,11 +39,7 @@
  * @{
  */
 
-#if FF_API_CRYPTO_SIZE_T
-typedef unsigned long AVAdler;
-#else
 typedef uint32_t AVAdler;
-#endif
 
 /**
  * Calculate the Adler32 checksum of a buffer.
@@ -59,11 +54,7 @@ typedef uint32_t AVAdler;
  * @return  updated checksum
  */
 AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf,
-#if FF_API_CRYPTO_SIZE_T
-  unsigned int len) av_pure;
-#else
   size_t len) av_pure;
-#endif
 
 /**
  * @}
diff --git a/libavutil/hash.c b/libavutil/hash.c
index d626c31181..9a49748189 100644
--- a/libavutil/hash.c
+++ b/libavutil/hash.c
@@ -157,11 +157,7 @@ void av_hash_init(AVHashContext *ctx)
 }
 }
 
-#if FF_API_CRYPTO_SIZE_T
-void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len)
-#else
 void av_hash_update(AVHashContext *ctx, const uint8_t *src, size_t len)
-#endif
 {
 switch (ctx->type) {
 case MD5: av_md5_update(ctx->ctx, src, len); break;
diff --git a/libavutil/hash.h b/libavutil/hash.h
index af4719e423..930d2d6cde 100644
--- a/libavutil/hash.h
+++ b/libavutil/hash.h
@@ -182,11 +182,7 @@ void av_hash_init(struct AVHashContext *ctx);
  * @param[in] src Data to be added to the hash context
  * @param[in] len Size of the additional data
  */
-#if FF_API_CRYPTO_SIZE_T
-void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
-#else
 void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
-#endif
 
 /**
  * Finalize a hash context and compute the actual hash value.
diff --git a/libavutil/hmac.c b/libavutil/hmac.c
index d064a105f4..e277fd7701 100644
--- a/libavutil/hmac.c
+++ b/libavutil/hmac.c
@@ -34,11 +34,7 @@
 #define MAX_BLOCKLEN 128
 
 typedef void (*hmac_final)(void *ctx, uint8_t *dst);
-#if FF_API_CRYPTO_SIZE_T
-typedef void (*hmac_update)(void *ctx, const uint8_t *src, int len);
-#else
 typedef void (*hmac_update)(void *ctx, const uint8_t *src, size_t len);
-#endif
 typedef void (*hmac_init)(void *ctx);
 
 struct AVHMAC {
diff --git a/libavutil/md5.c b/libavutil/md5.c
index 31e69925ae..88596203c1 100644
--- a/libavutil/md5.c
+++ b/libavutil/md5.c
@@ -98,14 +98,13 @@ static const uint32_t T[64] = { // T[i]= fabs(sin(i+1)<<32)
 a = b + (a << t | a >> (32 - t));   \
 } while (0)
 
-static void body(uint32_t ABCD[4], const uint8_t *src, int nblocks)
+static void body(uint32_t ABCD[4], const uint8_t *src, size_t nblocks)
 {
 int i av_unused;
-int n;
 const uint32_t *X;
 uint32_t a, b, c, d, t;
 
-for (n = 0; n < nblocks; n++) {
+for (size_t n = 0; n < nblocks; n++) {
 a = ABCD[3];
 b = ABCD[2];
 c = ABCD[1];
@@ -150,11 +149,7 @@ void av_md5_init(AVMD5 *ctx)
 ctx->ABCD[3] = 0x67452301;
 }
 
-#if FF_API_CRYPTO_SIZE_T
-void av_md5_update(AVMD5 *ctx, const uint8_t *src, int len)
-#else
 void av_md5_update(AVMD5 *ctx, const uint8_t *src, size_t len)
-#endif
 {
 const uint8_t *end;
 int j;
@@ -180,7 +175,7 @@ void av_md5_update(AVMD5 *ctx, const uint8_t *src, size_t 
len)
src += 64;
 }
 } else {
-int nblocks = len / 64;
+size_t nblocks = len / 64;
 body(ctx->ABCD, src, nblocks);
 src = end;
 }
@@ -204,11 +199,7 @@ void av_md5_final(AVMD5 *ctx, uint8_t *dst)
 AV_WL32(dst + 4 * i, 

[FFmpeg-devel] [PATCH 66/87] avutil/frame: Remove deprecated AVFrame.pkt_pts field

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 32c8359093d1ff4f45ed19518b449b3ac3769d27.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/audiotoolboxdec.c  |  5 -
 libavcodec/crystalhd.c|  5 -
 libavcodec/cuviddec.c |  5 -
 libavcodec/decode.c   | 11 ---
 libavcodec/gifdec.c   |  5 -
 libavcodec/libdav1d.c |  5 -
 libavcodec/libopenh264dec.c   |  5 -
 libavcodec/mediacodecdec_common.c | 10 --
 libavcodec/mmaldec.c  |  5 -
 libavcodec/qsvdec.c   |  5 -
 libavcodec/vp9.c  |  5 -
 libavutil/frame.c | 10 --
 libavutil/frame.h |  9 -
 libavutil/version.h   |  3 ---
 14 files changed, 88 deletions(-)

diff --git a/libavcodec/audiotoolboxdec.c b/libavcodec/audiotoolboxdec.c
index bf3e00959f..fa55f58988 100644
--- a/libavcodec/audiotoolboxdec.c
+++ b/libavcodec/audiotoolboxdec.c
@@ -540,11 +540,6 @@ static int ffat_decode(AVCodecContext *avctx, void *data,
 *got_frame_ptr = 1;
 if (at->last_pts != AV_NOPTS_VALUE) {
 frame->pts = at->last_pts;
-#if FF_API_PKT_PTS
-FF_DISABLE_DEPRECATION_WARNINGS
-frame->pkt_pts = at->last_pts;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 at->last_pts = avpkt->pts;
 }
 } else if (ret && ret != 1) {
diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c
index 228803183a..fbfe5e8f62 100644
--- a/libavcodec/crystalhd.c
+++ b/libavcodec/crystalhd.c
@@ -537,11 +537,6 @@ static inline CopyRet copy_frame(AVCodecContext *avctx,
 frame->top_field_first = !bottom_first;
 
 frame->pts = pkt_pts;
-#if FF_API_PKT_PTS
-FF_DISABLE_DEPRECATION_WARNINGS
-frame->pkt_pts = pkt_pts;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 
 frame->pkt_pos = -1;
 frame->pkt_duration = 0;
diff --git a/libavcodec/cuviddec.c b/libavcodec/cuviddec.c
index ec57afdefe..1e5e3ea9a6 100644
--- a/libavcodec/cuviddec.c
+++ b/libavcodec/cuviddec.c
@@ -614,11 +614,6 @@ static int cuvid_output_frame(AVCodecContext *avctx, 
AVFrame *frame)
 /* CUVIDs opaque reordering breaks the internal pkt logic.
  * So set pkt_pts and clear all the other pkt_ fields.
  */
-#if FF_API_PKT_PTS
-FF_DISABLE_DEPRECATION_WARNINGS
-frame->pkt_pts = frame->pts;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 frame->pkt_pos = -1;
 frame->pkt_duration = 0;
 frame->pkt_size = -1;
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index dbc3f0110b..1a7c37043e 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -394,12 +394,6 @@ static inline int decode_simple_internal(AVCodecContext 
*avctx, AVFrame *frame,
avctx->pkt_timebase);
 if(frame->pts!=AV_NOPTS_VALUE)
 frame->pts += diff_ts;
-#if FF_API_PKT_PTS
-FF_DISABLE_DEPRECATION_WARNINGS
-if(frame->pkt_pts!=AV_NOPTS_VALUE)
-frame->pkt_pts += diff_ts;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 if(frame->pkt_dts!=AV_NOPTS_VALUE)
 frame->pkt_dts += diff_ts;
 if (frame->pkt_duration >= diff_ts)
@@ -1504,11 +1498,6 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame 
*frame)
  pkt, sizeof(*pkt), NULL);
 
 frame->pts = pkt->pts;
-#if FF_API_PKT_PTS
-FF_DISABLE_DEPRECATION_WARNINGS
-frame->pkt_pts = pkt->pts;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 frame->pkt_pos  = pkt->pos;
 frame->pkt_duration = pkt->duration;
 frame->pkt_size = pkt->size;
diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c
index 1906a4c738..dffc860bbc 100644
--- a/libavcodec/gifdec.c
+++ b/libavcodec/gifdec.c
@@ -472,11 +472,6 @@ static int gif_decode_frame(AVCodecContext *avctx, void 
*data, int *got_frame, A
 bytestream2_init(>gb, avpkt->data, avpkt->size);
 
 s->frame->pts = avpkt->pts;
-#if FF_API_PKT_PTS
-FF_DISABLE_DEPRECATION_WARNINGS
-s->frame->pkt_pts = avpkt->pts;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 s->frame->pkt_dts = avpkt->dts;
 s->frame->pkt_duration = avpkt->duration;
 
diff --git a/libavcodec/libdav1d.c b/libavcodec/libdav1d.c
index 3c2a68b7e0..90c531fb91 100644
--- a/libavcodec/libdav1d.c
+++ b/libavcodec/libdav1d.c
@@ -314,11 +314,6 @@ static int libdav1d_receive_frame(AVCodecContext *c, 
AVFrame *frame)
 
 // match timestamps and packet size
 frame->pts = p->m.timestamp;
-#if FF_API_PKT_PTS
-FF_DISABLE_DEPRECATION_WARNINGS
-frame->pkt_pts = p->m.timestamp;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 frame->pkt_dts = p->m.timestamp;
 frame->pkt_pos = p->m.offset;
 frame->pkt_size = p->m.size;
diff --git a/libavcodec/libopenh264dec.c b/libavcodec/libopenh264dec.c
index c7aa7fa19c..832bfc49ef 100644
--- a/libavcodec/libopenh264dec.c
+++ 

[FFmpeg-devel] [PATCH 64/87] avutil/pixdesc: Remove deprecated off-by-one fields from pix fmt descs

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 2268db2cd052674fde55c7d48b7a5098ce89b4ba.

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/pixdesc.c | 1056 +--
 libavutil/pixdesc.h |   11 -
 libavutil/version.h |3 -
 3 files changed, 525 insertions(+), 545 deletions(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index a4ab93c975..e701005bc0 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -167,9 +167,6 @@ void av_write_image_line(const uint16_t *src,
 av_write_image_line2(src, data, linesize, desc, x, y, c, w, 2);
 }
 
-#if FF_API_PLUS1_MINUS1
-FF_DISABLE_DEPRECATION_WARNINGS
-#endif
 static const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 [AV_PIX_FMT_YUV420P] = {
 .name = "yuv420p",
@@ -177,9 +174,9 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .log2_chroma_w = 1,
 .log2_chroma_h = 1,
 .comp = {
-{ 0, 1, 0, 0, 8, 0, 7, 1 },/* Y */
-{ 1, 1, 0, 0, 8, 0, 7, 1 },/* U */
-{ 2, 1, 0, 0, 8, 0, 7, 1 },/* V */
+{ 0, 1, 0, 0, 8 },/* Y */
+{ 1, 1, 0, 0, 8 },/* U */
+{ 2, 1, 0, 0, 8 },/* V */
 },
 .flags = AV_PIX_FMT_FLAG_PLANAR,
 },
@@ -189,9 +186,9 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .log2_chroma_w = 1,
 .log2_chroma_h = 0,
 .comp = {
-{ 0, 2, 0, 0, 8, 1, 7, 1 },/* Y */
-{ 0, 4, 1, 0, 8, 3, 7, 2 },/* U */
-{ 0, 4, 3, 0, 8, 3, 7, 4 },/* V */
+{ 0, 2, 0, 0, 8 },/* Y */
+{ 0, 4, 1, 0, 8 },/* U */
+{ 0, 4, 3, 0, 8 },/* V */
 },
 },
 [AV_PIX_FMT_YVYU422] = {
@@ -200,9 +197,9 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .log2_chroma_w = 1,
 .log2_chroma_h = 0,
 .comp = {
-{ 0, 2, 0, 0, 8, 1, 7, 1 },/* Y */
-{ 0, 4, 3, 0, 8, 3, 7, 4 },/* U */
-{ 0, 4, 1, 0, 8, 3, 7, 2 },/* V */
+{ 0, 2, 0, 0, 8 },/* Y */
+{ 0, 4, 3, 0, 8 },/* U */
+{ 0, 4, 1, 0, 8 },/* V */
 },
 },
 [AV_PIX_FMT_Y210LE] = {
@@ -211,9 +208,9 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .log2_chroma_w = 1,
 .log2_chroma_h = 0,
 .comp = {
-{ 0, 4, 0, 6, 10, 3, 9, 1 },/* Y */
-{ 0, 8, 2, 6, 10, 7, 9, 3 },/* U */
-{ 0, 8, 6, 6, 10, 7, 9, 7 },/* V */
+{ 0, 4, 0, 6, 10 },/* Y */
+{ 0, 8, 2, 6, 10 },/* U */
+{ 0, 8, 6, 6, 10 },/* V */
 },
 },
 [AV_PIX_FMT_Y210BE] = {
@@ -222,9 +219,9 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .log2_chroma_w = 1,
 .log2_chroma_h = 0,
 .comp = {
-{ 0, 4, 0, 6, 10, 3, 9, 1 },/* Y */
-{ 0, 8, 2, 6, 10, 7, 9, 3 },/* U */
-{ 0, 8, 6, 6, 10, 7, 9, 7 },/* V */
+{ 0, 4, 0, 6, 10 },/* Y */
+{ 0, 8, 2, 6, 10 },/* U */
+{ 0, 8, 6, 6, 10 },/* V */
 },
 .flags = AV_PIX_FMT_FLAG_BE,
 },
@@ -234,9 +231,9 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .log2_chroma_w = 0,
 .log2_chroma_h = 0,
 .comp = {
-{ 0, 3, 0, 0, 8, 2, 7, 1 },/* R */
-{ 0, 3, 1, 0, 8, 2, 7, 2 },/* G */
-{ 0, 3, 2, 0, 8, 2, 7, 3 },/* B */
+{ 0, 3, 0, 0, 8 },/* R */
+{ 0, 3, 1, 0, 8 },/* G */
+{ 0, 3, 2, 0, 8 },/* B */
 },
 .flags = AV_PIX_FMT_FLAG_RGB,
 },
@@ -246,9 +243,9 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .log2_chroma_w = 0,
 .log2_chroma_h = 0,
 .comp = {
-{ 0, 3, 2, 0, 8, 2, 7, 3 },/* R */
-{ 0, 3, 1, 0, 8, 2, 7, 2 },/* G */
-{ 0, 3, 0, 0, 8, 2, 7, 1 },/* B */
+{ 0, 3, 2, 0, 8 },/* R */
+{ 0, 3, 1, 0, 8 },/* G */
+{ 0, 3, 0, 0, 8 },/* B */
 },
 .flags = AV_PIX_FMT_FLAG_RGB,
 },
@@ -258,9 +255,9 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 .log2_chroma_w= 0,
 .log2_chroma_h= 0,
 .comp = {
-{ 0, 4, 2, 4, 10, 3, 9, 2 },   /* R */
-{ 0, 4, 1, 2, 10, 3, 9, 3 },   /* G */
-{ 0, 4, 0, 0, 10, 3, 9, 4 },   /* B */
+{ 0, 4, 2, 4, 10 },   /* R */
+{ 0, 4, 1, 2, 10 },   /* G */
+ 

[FFmpeg-devel] [PATCH 65/87] avutil/frame: Remove deprecated AVFrame.error

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 1aa24df74c052a73175c43e57d35b4835e537ec8.

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/mpegvideo_enc.c | 7 ---
 libavcodec/snowenc.c   | 6 --
 libavfilter/vf_swapuv.c| 6 --
 libavutil/frame.c  | 6 --
 libavutil/frame.h  | 8 
 libavutil/version.h| 3 ---
 6 files changed, 36 deletions(-)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 0aa94dc7d8..f50f6cdeff 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1604,13 +1604,6 @@ static void frame_end(MpegEncContext *s)
 s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality;
 if (s->pict_type!= AV_PICTURE_TYPE_B)
 s->last_non_b_pict_type = s->pict_type;
-
-#if FF_API_ERROR_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-memcpy(s->current_picture.f->error, s->current_picture.encoding_error,
-   sizeof(s->current_picture.encoding_error));
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 }
 
 static void update_noise_reduction(MpegEncContext *s)
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 255968341a..e694d51a67 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1865,12 +1865,6 @@ redo_frame:
(s->avctx->flags_CODEC_FLAG_PSNR) ? 4 : 
0,
s->current_picture->pict_type);
 
-#if FF_API_ERROR_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-memcpy(s->current_picture->error, s->encoding_error, 
sizeof(s->encoding_error));
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 pkt->size = ff_rac_terminate(c, 0);
 if (s->current_picture->key_frame)
 pkt->flags |= AV_PKT_FLAG_KEY;
diff --git a/libavfilter/vf_swapuv.c b/libavfilter/vf_swapuv.c
index 8d62c48c4f..720e699c4a 100644
--- a/libavfilter/vf_swapuv.c
+++ b/libavfilter/vf_swapuv.c
@@ -46,12 +46,6 @@ static void do_swap(AVFrame *frame)
 FFSWAP(uint8_t*, frame->data[1], frame->data[2]);
 FFSWAP(int,  frame->linesize[1], frame->linesize[2]);
 FFSWAP(AVBufferRef*, frame->buf[1],  frame->buf[2]);
-
-#if FF_API_ERROR_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-FFSWAP(uint64_t, frame->error[1],frame->error[2]);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 }
 
 static AVFrame *get_video_buffer(AVFilterLink *link, int w, int h)
diff --git a/libavutil/frame.c b/libavutil/frame.c
index df826fbfb7..d69dd38dc4 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -316,12 +316,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
 
 av_dict_copy(>metadata, src->metadata, 0);
 
-#if FF_API_ERROR_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-memcpy(dst->error, src->error, sizeof(dst->error));
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 for (i = 0; i < src->nb_side_data; i++) {
 const AVFrameSideData *sd_src = src->side_data[i];
 AVFrameSideData *sd_dst;
diff --git a/libavutil/frame.h b/libavutil/frame.h
index fbecebbd70..23396189d9 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -434,14 +434,6 @@ typedef struct AVFrame {
  */
 void *opaque;
 
-#if FF_API_ERROR_FRAME
-/**
- * @deprecated unused
- */
-attribute_deprecated
-uint64_t error[AV_NUM_DATA_POINTERS];
-#endif
-
 /**
  * When decoding, this signals how much the picture must be delayed.
  * extra_delay = repeat_pict / (2*fps)
diff --git a/libavutil/version.h b/libavutil/version.h
index 2eb3d3c756..a72788d8e4 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,9 +105,6 @@
  * @{
  */
 
-#ifndef FF_API_ERROR_FRAME
-#define FF_API_ERROR_FRAME  (LIBAVUTIL_VERSION_MAJOR < 57)
-#endif
 #ifndef FF_API_PKT_PTS
 #define FF_API_PKT_PTS  (LIBAVUTIL_VERSION_MAJOR < 57)
 #endif
-- 
2.31.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 63/87] avutil/frame: Remove AVFrame QP table API

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Originally deprecated in 1296b1f6c0631ab79464e22d48a6a1548450b943;
scheduled again for removal in a9915268327b097bba84a07f68968d8c07f4b549.

Signed-off-by: Andreas Rheinhardt 
---
 libavfilter/f_sidedata.c | 34 --
 libavutil/frame.c| 97 
 libavutil/frame.h| 41 -
 libavutil/version.h  |  3 --
 4 files changed, 175 deletions(-)

diff --git a/libavfilter/f_sidedata.c b/libavfilter/f_sidedata.c
index 6f25d2b311..0542373ed8 100644
--- a/libavfilter/f_sidedata.c
+++ b/libavfilter/f_sidedata.c
@@ -43,7 +43,6 @@ typedef struct SideDataContext {
 } SideDataContext;
 
 #define OFFSET(x) offsetof(SideDataContext, x)
-#if FF_API_FRAME_QP
 #define DEFINE_OPTIONS(filt_name, FLAGS) \
 static const AVOption filt_name##_options[] = { \
 { "mode", "set a mode of operation", OFFSET(mode),   AV_OPT_TYPE_INT,
{.i64 = 0 }, 0, SIDEDATA_NB-1, FLAGS, "mode" }, \
@@ -66,8 +65,6 @@ static const AVOption filt_name##_options[] = { \
 {   "SPHERICAL",  "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_SPHERICAL  }, 0, 0, FLAGS, "type" }, \
 {   "CONTENT_LIGHT_LEVEL","", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_CONTENT_LIGHT_LEVEL}, 0, 0, FLAGS, "type" }, \
 {   "ICC_PROFILE","", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_ICC_PROFILE}, 0, 0, FLAGS, "type" }, \
-{   "QP_TABLE_PROPERTIES","", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_QP_TABLE_PROPERTIES}, 0, 0, FLAGS, "type" }, \
-{   "QP_TABLE_DATA",  "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_QP_TABLE_DATA  }, 0, 0, FLAGS, "type" }, \
 {   "S12M_TIMECOD",   "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_S12M_TIMECODE  }, 0, 0, FLAGS, "type" }, \
 {   "DYNAMIC_HDR_PLUS",   "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_DYNAMIC_HDR_PLUS   }, 0, 0, FLAGS, "type" }, \
 {   "REGIONS_OF_INTEREST","", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_REGIONS_OF_INTEREST}, 0, 0, FLAGS, "type" }, \
@@ -75,37 +72,6 @@ static const AVOption filt_name##_options[] = { \
 {   "SEI_UNREGISTERED",   "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_SEI_UNREGISTERED   }, 0, 0, FLAGS, "type" }, \
 { NULL } \
 }
-#else
-#define DEFINE_OPTIONS(filt_name, FLAGS) \
-static const AVOption filt_name##_options[] = { \
-{ "mode", "set a mode of operation", OFFSET(mode),   AV_OPT_TYPE_INT,
{.i64 = 0 }, 0, SIDEDATA_NB-1, FLAGS, "mode" }, \
-{   "select", "select frame",0,  AV_OPT_TYPE_CONST,  
{.i64 = SIDEDATA_SELECT }, 0, 0, FLAGS, "mode" }, \
-{   "delete", "delete side data",0,  AV_OPT_TYPE_CONST,  
{.i64 = SIDEDATA_DELETE }, 0, 0, FLAGS, "mode" }, \
-{ "type",   "set side data type",OFFSET(type),   AV_OPT_TYPE_INT,
{.i64 = -1 }, -1, INT_MAX, FLAGS, "type" }, \
-{   "PANSCAN","", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_PANSCAN}, 0, 0, FLAGS, "type" }, \
-{   "A53_CC", "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_A53_CC }, 0, 0, FLAGS, "type" }, \
-{   "STEREO3D",   "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_STEREO3D   }, 0, 0, FLAGS, "type" }, \
-{   "MATRIXENCODING", "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_MATRIXENCODING }, 0, 0, FLAGS, "type" }, \
-{   "DOWNMIX_INFO",   "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_DOWNMIX_INFO   }, 0, 0, FLAGS, "type" }, \
-{   "REPLAYGAIN", "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_REPLAYGAIN }, 0, 0, FLAGS, "type" }, \
-{   "DISPLAYMATRIX",  "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_DISPLAYMATRIX  }, 0, 0, FLAGS, "type" }, \
-{   "AFD","", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_AFD}, 0, 0, FLAGS, "type" }, \
-{   "MOTION_VECTORS", "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_MOTION_VECTORS }, 0, 0, FLAGS, "type" }, \
-{   "SKIP_SAMPLES",   "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_SKIP_SAMPLES   }, 0, 0, FLAGS, "type" }, \
-{   "AUDIO_SERVICE_TYPE", "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_AUDIO_SERVICE_TYPE }, 0, 0, FLAGS, "type" }, \
-{   "MASTERING_DISPLAY_METADATA", "", 0, AV_OPT_TYPE_CONST,  
{.i64 = AV_FRAME_DATA_MASTERING_DISPLAY_METADATA }, 

[FFmpeg-devel] [PATCH 62/87] avutil/pixfmt: Remove deprecated VAAPI pixel formats

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 9f8e57efe4400ca86352277873792792279c3b15.

Signed-off-by: Andreas Rheinhardt 
---
 libavutil/pixdesc.c | 25 -
 libavutil/pixfmt.h  | 10 --
 libavutil/version.h |  3 ---
 3 files changed, 38 deletions(-)

diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c
index 18c7a0efc8..a4ab93c975 100644
--- a/libavutil/pixdesc.c
+++ b/libavutil/pixdesc.c
@@ -1329,33 +1329,12 @@ static const AVPixFmtDescriptor 
av_pix_fmt_descriptors[AV_PIX_FMT_NB] = {
 },
 .flags = AV_PIX_FMT_FLAG_RGB,
 },
-#if FF_API_VAAPI
-[AV_PIX_FMT_VAAPI_MOCO] = {
-.name = "vaapi_moco",
-.log2_chroma_w = 1,
-.log2_chroma_h = 1,
-.flags = AV_PIX_FMT_FLAG_HWACCEL,
-},
-[AV_PIX_FMT_VAAPI_IDCT] = {
-.name = "vaapi_idct",
-.log2_chroma_w = 1,
-.log2_chroma_h = 1,
-.flags = AV_PIX_FMT_FLAG_HWACCEL,
-},
-[AV_PIX_FMT_VAAPI_VLD] = {
-.name = "vaapi_vld",
-.log2_chroma_w = 1,
-.log2_chroma_h = 1,
-.flags = AV_PIX_FMT_FLAG_HWACCEL,
-},
-#else
 [AV_PIX_FMT_VAAPI] = {
 .name = "vaapi",
 .log2_chroma_w = 1,
 .log2_chroma_h = 1,
 .flags = AV_PIX_FMT_FLAG_HWACCEL,
 },
-#endif
 [AV_PIX_FMT_YUV420P9LE] = {
 .name = "yuv420p9le",
 .nb_components = 3,
@@ -2515,10 +2494,6 @@ enum AVPixelFormat av_get_pix_fmt(const char *name)
 pix_fmt = get_pix_fmt_internal(name2);
 }
 
-#if FF_API_VAAPI
-if (pix_fmt == AV_PIX_FMT_NONE && !strcmp(name, "vaapi"))
-pix_fmt = AV_PIX_FMT_VAAPI;
-#endif
 return pix_fmt;
 }
 
diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h
index 46ef211add..30591133a4 100644
--- a/libavutil/pixfmt.h
+++ b/libavutil/pixfmt.h
@@ -112,21 +112,11 @@ enum AVPixelFormat {
 AV_PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), 
big-endian   , X=unused/undefined
 AV_PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1X 5B 5G 5R(lsb), 
little-endian, X=unused/undefined
 
-#if FF_API_VAAPI
-/** @name Deprecated pixel formats */
-/**@{*/
-AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion 
compensation entry-point, Picture.data[3] contains a vaapi_render_state struct 
which contains macroblocks as well as various fields extracted from headers
-AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT 
entry-point, Picture.data[3] contains a vaapi_render_state struct which 
contains fields extracted from headers
-AV_PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] 
contains a VASurfaceID
-/**@}*/
-AV_PIX_FMT_VAAPI = AV_PIX_FMT_VAAPI_VLD,
-#else
 /**
  *  Hardware acceleration through VA-API, data[3] contains a
  *  VASurfaceID.
  */
 AV_PIX_FMT_VAAPI,
-#endif
 
 AV_PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample 
per 2x2 Y samples), little-endian
 AV_PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample 
per 2x2 Y samples), big-endian
diff --git a/libavutil/version.h b/libavutil/version.h
index 658bcd402e..628a40d22b 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -105,9 +105,6 @@
  * @{
  */
 
-#ifndef FF_API_VAAPI
-#define FF_API_VAAPI(LIBAVUTIL_VERSION_MAJOR < 57)
-#endif
 #ifndef FF_API_FRAME_QP
 #define FF_API_FRAME_QP (LIBAVUTIL_VERSION_MAJOR < 57)
 #endif
-- 
2.31.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 61/87] avcodec: Remove deprecated old encode/decode APIs

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in commits 7fc329e2dd6226dfecaa4a1d7adf353bf2773726
and 31f6a4b4b83aca1d73f3cfc99ce2b39331970bf3.

Signed-off-by: Andreas Rheinhardt 
---
 configure |   8 --
 libavcodec/aarch64/neontest.c |  35 -
 libavcodec/arm/neontest.c |  35 -
 libavcodec/avcodec.c  |  30 -
 libavcodec/avcodec.h  | 245 +-
 libavcodec/decode.c   | 155 -
 libavcodec/encode.c   | 111 ---
 libavcodec/internal.h |  16 ---
 libavcodec/mpegvideo.h|   2 +-
 libavcodec/options_table.h|   3 -
 libavcodec/thread.h   |   4 +-
 libavcodec/version.h  |   3 -
 libavcodec/x86/w64xmmtest.c   |  35 -
 13 files changed, 4 insertions(+), 678 deletions(-)

diff --git a/configure b/configure
index d552d5e150..30b598dcc6 100755
--- a/configure
+++ b/configure
@@ -6857,11 +6857,7 @@ check_stripflags -x
 
 enabled neon_clobber_test &&
 check_ldflags -Wl,--wrap,avcodec_open2  \
-  -Wl,--wrap,avcodec_decode_audio4  \
-  -Wl,--wrap,avcodec_decode_video2  \
   -Wl,--wrap,avcodec_decode_subtitle2   \
-  -Wl,--wrap,avcodec_encode_audio2  \
-  -Wl,--wrap,avcodec_encode_video2  \
   -Wl,--wrap,avcodec_encode_subtitle\
   -Wl,--wrap,avcodec_send_packet\
   -Wl,--wrap,avcodec_receive_packet \
@@ -6873,11 +6869,7 @@ enabled neon_clobber_test &&
 
 enabled xmm_clobber_test &&
 check_ldflags -Wl,--wrap,avcodec_open2  \
-  -Wl,--wrap,avcodec_decode_audio4  \
-  -Wl,--wrap,avcodec_decode_video2  \
   -Wl,--wrap,avcodec_decode_subtitle2   \
-  -Wl,--wrap,avcodec_encode_audio2  \
-  -Wl,--wrap,avcodec_encode_video2  \
   -Wl,--wrap,avcodec_encode_subtitle\
   -Wl,--wrap,avcodec_send_packet\
   -Wl,--wrap,avcodec_receive_packet \
diff --git a/libavcodec/aarch64/neontest.c b/libavcodec/aarch64/neontest.c
index a4fc5a0e2f..ed84b6e073 100644
--- a/libavcodec/aarch64/neontest.c
+++ b/libavcodec/aarch64/neontest.c
@@ -29,41 +29,6 @@ wrap(avcodec_open2(AVCodecContext *avctx,
 testneonclobbers(avcodec_open2, avctx, codec, options);
 }
 
-#if FF_API_OLD_ENCDEC
-wrap(avcodec_decode_audio4(AVCodecContext *avctx,
-   AVFrame *frame,
-   int *got_frame_ptr,
-   AVPacket *avpkt))
-{
-testneonclobbers(avcodec_decode_audio4, avctx, frame,
- got_frame_ptr, avpkt);
-}
-
-wrap(avcodec_decode_video2(AVCodecContext *avctx,
-   AVFrame *picture,
-   int *got_picture_ptr,
-   AVPacket *avpkt))
-{
-testneonclobbers(avcodec_decode_video2, avctx, picture,
- got_picture_ptr, avpkt);
-}
-
-wrap(avcodec_encode_audio2(AVCodecContext *avctx,
-   AVPacket *avpkt,
-   const AVFrame *frame,
-   int *got_packet_ptr))
-{
-testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame,
- got_packet_ptr);
-}
-
-wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
-   const AVFrame *frame, int *got_packet_ptr))
-{
-testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, 
got_packet_ptr);
-}
-#endif
-
 wrap(avcodec_decode_subtitle2(AVCodecContext *avctx,
   AVSubtitle *sub,
   int *got_sub_ptr,
diff --git a/libavcodec/arm/neontest.c b/libavcodec/arm/neontest.c
index d1ede4955c..df64c6f778 100644
--- a/libavcodec/arm/neontest.c
+++ b/libavcodec/arm/neontest.c
@@ -29,41 +29,6 @@ wrap(avcodec_open2(AVCodecContext *avctx,
 testneonclobbers(avcodec_open2, avctx, codec, options);
 }
 
-#if FF_API_OLD_ENCDEC
-wrap(avcodec_decode_audio4(AVCodecContext *avctx,
-   AVFrame *frame,
-   int *got_frame_ptr,
-   AVPacket *avpkt))
-{
-testneonclobbers(avcodec_decode_audio4, avctx, frame,
- got_frame_ptr, avpkt);
-}
-
-wrap(avcodec_decode_video2(AVCodecContext *avctx,
-   AVFrame *picture,
-   int *got_picture_ptr,
-   AVPacket *avpkt))
-{
-testneonclobbers(avcodec_decode_video2, avctx, picture,
- got_picture_ptr, avpkt);
-}
-
-wrap(avcodec_encode_audio2(AVCodecContext *avctx,
-   AVPacket *avpkt,
-   const AVFrame *frame,
-   int *got_packet_ptr))
-{
-testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame,
-   

[FFmpeg-devel] [PATCH 60/87] avcodec: Remove deprecated AVCodecContext.coded_frame

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Deprecated in 40cf1bbacc6220a0aa6bed5c331871d43f9ce370.
(The currently disabled filter vf_mcdeint and vf_uspp were users of
this field; they have not been changed, so that whoever wants to fix
them can see the state of these filters when they were disabled.)

Signed-off-by: Andreas Rheinhardt 
---
 libavcodec/aliaspixenc.c  |  7 ---
 libavcodec/avcodec.c  | 10 --
 libavcodec/avcodec.h  | 11 ---
 libavcodec/bmpenc.c   |  6 --
 libavcodec/dnxhdenc.c | 17 -
 libavcodec/dvenc.c|  6 --
 libavcodec/encode.c   |  8 
 libavcodec/ffv1enc.c  | 17 -
 libavcodec/flashsvenc.c   | 13 -
 libavcodec/huffyuvenc.c   |  7 ---
 libavcodec/jpeglsenc.c| 13 -
 libavcodec/lclenc.c   |  7 ---
 libavcodec/libkvazaar.c   | 11 ---
 libavcodec/libtheoraenc.c |  5 -
 libavcodec/libvpxenc.c| 24 
 libavcodec/libx264.c  | 11 ---
 libavcodec/libx265.c  |  6 --
 libavcodec/libxavs.c  | 21 -
 libavcodec/libxvid.c  | 18 --
 libavcodec/ljpegenc.c |  7 ---
 libavcodec/mpegvideo_enc.c|  6 --
 libavcodec/nvenc.c|  6 --
 libavcodec/pamenc.c   | 13 -
 libavcodec/pcxenc.c   | 13 -
 libavcodec/pngenc.c   |  7 ---
 libavcodec/pnmenc.c   | 17 -
 libavcodec/proresenc_kostya.c |  6 --
 libavcodec/pthread_frame.c|  5 -
 libavcodec/qsvenc.c   |  6 --
 libavcodec/qtrleenc.c |  7 ---
 libavcodec/rawenc.c   |  5 -
 libavcodec/sgienc.c   |  7 ---
 libavcodec/snowenc.c  | 19 ---
 libavcodec/svq1enc.c  |  7 ---
 libavcodec/targaenc.c |  7 ---
 libavcodec/tiffenc.c  |  6 --
 libavcodec/utvideoenc.c   |  9 +
 libavcodec/v210enc.c  |  6 --
 libavcodec/v410enc.c  |  7 ---
 libavcodec/version.h  |  3 ---
 libavcodec/zmbvenc.c  |  6 --
 libavdevice/v4l2.c| 15 ---
 42 files changed, 1 insertion(+), 407 deletions(-)

diff --git a/libavcodec/aliaspixenc.c b/libavcodec/aliaspixenc.c
index a9ba00cd29..7c881d2e0a 100644
--- a/libavcodec/aliaspixenc.c
+++ b/libavcodec/aliaspixenc.c
@@ -33,13 +33,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 int width, height, bits_pixel, i, j, length, ret;
 uint8_t *in_buf, *buf;
 
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-avctx->coded_frame->key_frame = 1;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
-
 width  = avctx->width;
 height = avctx->height;
 
diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index 8e91350d67..62556301ce 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -400,11 +400,6 @@ free_and_end:
 av_opt_free(avctx);
 
 if (av_codec_is_encoder(avctx->codec)) {
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-av_frame_free(>coded_frame);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 av_freep(>extradata);
 avctx->extradata_size = 0;
 }
@@ -577,11 +572,6 @@ av_cold int avcodec_close(AVCodecContext *avctx)
 av_freep(>priv_data);
 if (av_codec_is_encoder(avctx->codec)) {
 av_freep(>extradata);
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-av_frame_free(>coded_frame);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 }
 avctx->codec = NULL;
 avctx->active_thread_type = 0;
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index c99b455814..144f299d46 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1578,17 +1578,6 @@ typedef struct AVCodecContext {
  */
  int lowres;
 
-#if FF_API_CODED_FRAME
-/**
- * the picture in the bitstream
- * - encoding: Set by libavcodec.
- * - decoding: unused
- *
- * @deprecated use the quality factor packet side data instead
- */
-attribute_deprecated AVFrame *coded_frame;
-#endif
-
 /**
  * thread count
  * is used to decide how many independent tasks should be passed to 
execute()
diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c
index e829d68475..bab2558bc9 100644
--- a/libavcodec/bmpenc.c
+++ b/libavcodec/bmpenc.c
@@ -74,12 +74,6 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 int bit_count = avctx->bits_per_coded_sample;
 uint8_t *ptr, *buf;
 
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
-avctx->coded_frame->key_frame = 1;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 switch (avctx->pix_fmt) {
 case AV_PIX_FMT_RGB444:
 compression = BMP_BITFIELDS;
diff --git 

[FFmpeg-devel] [PATCH 57/87] avfilter/Makefile: Don't compile transform.c unconditionally

2021-04-19 Thread James Almer
From: Andreas Rheinhardt 

Signed-off-by: Andreas Rheinhardt 
---
 libavfilter/Makefile | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index b77f2276a4..42efa14a67 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -19,7 +19,6 @@ OBJS = allfilters.o   
  \
framequeue.o \
graphdump.o  \
graphparser.o\
-   transform.o  \
video.o  \
 
 OBJS-$(HAVE_THREADS) += pthread.o
@@ -237,8 +236,8 @@ OBJS-$(CONFIG_DEJUDDER_FILTER)   += 
vf_dejudder.o
 OBJS-$(CONFIG_DELOGO_FILTER) += vf_delogo.o
 OBJS-$(CONFIG_DENOISE_VAAPI_FILTER)  += vf_misc_vaapi.o vaapi_vpp.o
 OBJS-$(CONFIG_DESHAKE_OPENCL_FILTER)+= vf_deshake_opencl.o opencl.o \
-opencl/deshake.o
-OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o
+opencl/deshake.o transform.o
+OBJS-$(CONFIG_DESHAKE_FILTER)+= vf_deshake.o transform.o
 OBJS-$(CONFIG_DESPILL_FILTER)+= vf_despill.o
 OBJS-$(CONFIG_DETELECINE_FILTER) += vf_detelecine.o
 OBJS-$(CONFIG_DILATION_FILTER)   += vf_neighbor.o
-- 
2.31.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 59/87] Disable vf_uspp/mcdeint.

2021-04-19 Thread James Almer
From: Anton Khirnov 

These filters depend on avcodec APIs that are to be removed. Some people
have expressed potential interest in updating these filters, so they are
merely disabled for now instead of being removed.
---
 configure | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/configure b/configure
index cc1013fb1d..d552d5e150 100755
--- a/configure
+++ b/configure
@@ -7095,6 +7095,12 @@ esac
 
 enable frame_thread_encoder
 
+# these filters depend on removed avcodec APIs
+# they are kept disabled for now, but will be removed if
+# nobody updates and re-enables them
+disable mcdeint_filter
+disable uspp_filter
+
 enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
 
 check_deps $CONFIG_LIST   \
-- 
2.31.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".


  1   2   >