Re: [FFmpeg-devel] [PATCH v2] avformat/hlsenc: use AV_OPT_TYPE_DURATION

2021-01-29 Thread lance . lmwang
On Sun, Jan 17, 2021 at 10:13:20AM +0800, lance.lmw...@gmail.com wrote:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  doc/muxers.texi  | 15 +++
>  libavformat/hlsenc.c | 18 +-
>  2 files changed, 20 insertions(+), 13 deletions(-)
> 
> diff --git a/doc/muxers.texi b/doc/muxers.texi
> index 8e12aca..1f9f293 100644
> --- a/doc/muxers.texi
> +++ b/doc/muxers.texi
> @@ -609,14 +609,21 @@ segmentation.
>  This muxer supports the following options:
>  
>  @table @option
> -@item hls_init_time @var{seconds}
> -Set the initial target segment length in seconds. Default value is @var{0}.
> +@item hls_init_time @var{duration}
> +Set the initial target segment length. Default value is @var{0}.
> +
> +@var{duration} must be a time duration specification,
> +see @ref{time duration syntax,,the Time duration section in the 
> ffmpeg-utils(1) manual,ffmpeg-utils}.
> +
>  Segment will be cut on the next key frame after this time has passed on the 
> first m3u8 list.
>  After the initial playlist is filled @command{ffmpeg} will cut segments
>  at duration equal to @code{hls_time}
>  
> -@item hls_time @var{seconds}
> -Set the target segment length in seconds. Default value is 2.
> +@item hls_time @var{duration}
> +Set the target segment length. Default value is 2.
> +
> +@var{duration} must be a time duration specification,
> +see @ref{time duration syntax,,the Time duration section in the 
> ffmpeg-utils(1) manual,ffmpeg-utils}.
>  Segment will be cut on the next key frame after this time has passed.
>  
>  @item hls_list_size @var{size}
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 7f38db7..94fd505 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -196,8 +196,8 @@ typedef struct HLSContext {
>  int64_t start_sequence;
>  uint32_t start_sequence_source_type;  // enum StartSequenceSourceType
>  
> -float time;// Set by a private option.
> -float init_time;   // Set by a private option.
> +int64_t time;  // Set by a private option.
> +int64_t init_time; // Set by a private option.
>  int max_nb_segments;   // Set by a private option.
>  int hls_delete_threshold; // Set by a private option.
>  #if FF_API_HLS_WRAP
> @@ -2454,9 +2454,9 @@ static int hls_write_packet(AVFormatContext *s, 
> AVPacket *pkt)
>  
>  if (vs->sequence - vs->nb_entries > hls->start_sequence && 
> hls->init_time > 0) {
>  /* reset end_pts, hls->recording_time at end of the init hls list */
> -int64_t init_list_dur = hls->init_time * vs->nb_entries * 
> AV_TIME_BASE;
> -int64_t after_init_list_dur = (vs->sequence - hls->start_sequence - 
> vs->nb_entries) * (hls->time * AV_TIME_BASE);
> -hls->recording_time = hls->time * AV_TIME_BASE;
> +int64_t init_list_dur = hls->init_time * vs->nb_entries;
> +int64_t after_init_list_dur = (vs->sequence - hls->start_sequence - 
> vs->nb_entries) * hls->time;
> +hls->recording_time = hls->time;
>  end_pts = init_list_dur + after_init_list_dur ;
>  }
>  
> @@ -2941,7 +2941,7 @@ static int hls_init(AVFormatContext *s)
>  av_log(hls, AV_LOG_DEBUG, "start_number evaluated to %"PRId64"\n", 
> hls->start_sequence);
>  }
>  
> -hls->recording_time = (hls->init_time ? hls->init_time : hls->time) * 
> AV_TIME_BASE;
> +hls->recording_time = hls->init_time ? hls->init_time : hls->time;
>  
>  if (hls->flags & HLS_SPLIT_BY_TIME && hls->flags & 
> HLS_INDEPENDENT_SEGMENTS) {
>  // Independent segments cannot be guaranteed when splitting by time
> @@ -3094,7 +3094,7 @@ static int hls_init(AVFormatContext *s)
>  av_log(s, AV_LOG_WARNING, "append_list mode does not support 
> hls_init_time,"
> " hls_init_time value will have no effect\n");
>  hls->init_time = 0;
> -hls->recording_time = hls->time * AV_TIME_BASE;
> +hls->recording_time = hls->time;
>  }
>  }
>  
> @@ -3110,8 +3110,8 @@ static int hls_init(AVFormatContext *s)
>  #define E AV_OPT_FLAG_ENCODING_PARAM
>  static const AVOption options[] = {
>  {"start_number",  "set first number in the sequence",
> OFFSET(start_sequence),AV_OPT_TYPE_INT64,  {.i64 = 0}, 0, INT64_MAX, E},
> -{"hls_time",  "set segment length in seconds",   
> OFFSET(time),AV_OPT_TYPE_FLOAT,  {.dbl = 2}, 0, FLT_MAX, E},
> -{"hls_init_time", "set segment length in seconds at init list",  
>  OFFSET(init_time),AV_OPT_TYPE_FLOAT,  {.dbl = 0}, 0, FLT_MAX, E},
> +{"hls_time",  "set segment length",  
> OFFSET(time),  AV_OPT_TYPE_DURATION, {.i64 = 200}, 0, INT64_MAX, 
> E},
> +{"hls_init_time", "set segment length at init list", 
> OFFSET(init_time), AV_OPT_TYPE_DURATION, {.i64 = 0},   0, INT64_MAX, 
> E},
>  {"hls_list_size", "set maximum 

[FFmpeg-devel] [PATCH v5 2/2] avformat/mxfenc: prefer to use the configured metadta

2021-01-29 Thread lance . lmwang
From: Limin Wang 

The metadata company_name, product_name, product_version from input
file will be deleted to avoid overwriting information
Please to test with below command:
./ffmpeg -i ../fate-suite/mxf/Sony-1.mxf -c:v copy -c:a copy out.mxf
and
./ffmpeg -i ../fate-suite/mxf/Sony-1.mxf -c:v copy -c:a copy \
-metadata company_name="xxx" \
-metadata product_name="xxx" \
-metadata product_version="xxx" \
out.mxf

Signed-off-by: Limin Wang 
---
 fftools/ffmpeg_opt.c |  3 +++
 libavformat/mxfenc.c | 12 
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index bf2eb26..07308cc 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -2641,6 +2641,9 @@ loop_end:
 if(o->recording_time != INT64_MAX)
 av_dict_set(>metadata, "duration", NULL, 0);
 av_dict_set(>metadata, "creation_time", NULL, 0);
+av_dict_set(>metadata, "company_name", NULL, 0);
+av_dict_set(>metadata, "product_name", NULL, 0);
+av_dict_set(>metadata, "product_version", NULL, 0);
 }
 if (!o->metadata_streams_manual)
 for (i = of->ost_index; i < nb_output_streams; i++) {
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 2cf443f..d69bc9a 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -724,9 +724,13 @@ static void mxf_write_identification(AVFormatContext *s)
 {
 MXFContext *mxf = s->priv_data;
 AVIOContext *pb = s->pb;
-const char *company = "FFmpeg";
-const char *product = s->oformat != _mxf_opatom_muxer ? "OP1a Muxer" : 
"OPAtom Muxer";
-const char *version;
+AVDictionaryEntry *com_entry =  av_dict_get(s->metadata, "company_name", 
NULL, 0);
+AVDictionaryEntry *product_entry =  av_dict_get(s->metadata, 
"product_name", NULL, 0);
+AVDictionaryEntry *version_entry =  av_dict_get(s->metadata, 
"product_version", NULL, 0);
+const char *company = com_entry ? com_entry->value : "FFmpeg";
+const char *product = product_entry ? product_entry->value : s->oformat != 
_mxf_opatom_muxer ? "OP1a Muxer" : "OPAtom Muxer";
+const char *version = NULL;
+const char *product_version = version_entry ? version_entry->value : 
AV_STRINGIFY(LIBAVFORMAT_VERSION);
 const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : 
PLATFROM_IDENT;
 int length;
 
@@ -734,7 +738,7 @@ static void mxf_write_identification(AVFormatContext *s)
 PRINT_KEY(s, "identification key", pb->buf_ptr - 16);
 
 version = s->flags & AVFMT_FLAG_BITEXACT ?
-"0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION);
+"0.0.0" : product_version;
 length = 100 +mxf_utf16_local_tag_length(company) +
   mxf_utf16_local_tag_length(product) +
   mxf_utf16_local_tag_length(platform) +
-- 
1.8.3.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 v5 1/2] avformat/mxf: add platform local tag

2021-01-29 Thread lance . lmwang
From: Limin Wang 

Please check the string of platform with below command:
./ffmpeg -i ../fate-suite/mxf/Sony-1.mxf -c:v copy -c:a copy out.mxf
./ffmpeg -i out.mxf

application_platform: Lavf58.65.101 (linux)

Signed-off-by: Limin Wang 
---
 configure   | 1 +
 libavformat/mxfenc.c| 4 
 tests/ref/fate/copy-trac4914| 2 +-
 tests/ref/fate/mxf-d10-user-comments| 2 +-
 tests/ref/fate/mxf-opatom-user-comments | 2 +-
 tests/ref/fate/mxf-reel_name| 2 +-
 tests/ref/fate/mxf-user-comments| 2 +-
 tests/ref/fate/time_base| 2 +-
 tests/ref/lavf/mxf  | 6 +++---
 tests/ref/lavf/mxf_d10  | 2 +-
 tests/ref/lavf/mxf_dv25 | 2 +-
 tests/ref/lavf/mxf_dvcpro50 | 2 +-
 tests/ref/lavf/mxf_opatom   | 2 +-
 tests/ref/lavf/mxf_opatom_audio | 2 +-
 14 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/configure b/configure
index df298b4..a092a6b 100755
--- a/configure
+++ b/configure
@@ -7579,6 +7579,7 @@ cat > $TMPH oformat != _mxf_opatom_muxer ? "OP1a Muxer" : 
"OPAtom Muxer";
 const char *version;
+const char *platform = s->flags & AVFMT_FLAG_BITEXACT ? "Lavf" : 
PLATFROM_IDENT;
 int length;
 
 mxf_write_metadata_key(pb, 0x013000);
@@ -735,6 +737,7 @@ static void mxf_write_identification(AVFormatContext *s)
 "0.0.0" : AV_STRINGIFY(LIBAVFORMAT_VERSION);
 length = 100 +mxf_utf16_local_tag_length(company) +
   mxf_utf16_local_tag_length(product) +
+  mxf_utf16_local_tag_length(platform) +
   mxf_utf16_local_tag_length(version);
 klv_encode_ber_length(pb, length);
 
@@ -753,6 +756,7 @@ static void mxf_write_identification(AVFormatContext *s)
 store_version(s);
 
 mxf_write_local_tag_utf16(pb, 0x3C04, version); // Version String
+mxf_write_local_tag_utf16(pb, 0x3C08, platform); // Platform
 
 // write product uid
 mxf_write_local_tag(pb, 16, 0x3C05);
diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914
index e8f8afb..743dc8c 100644
--- a/tests/ref/fate/copy-trac4914
+++ b/tests/ref/fate/copy-trac4914
@@ -1,4 +1,4 @@
-5d58a32f21b78169d925845f783054e6 *tests/data/fate/copy-trac4914.mxf
+f5150fb82c1bb5a90906fce93dcc3f76 *tests/data/fate/copy-trac4914.mxf
 561721 tests/data/fate/copy-trac4914.mxf
 #tb 0: 1001/3
 #media_type 0: video
diff --git a/tests/ref/fate/mxf-d10-user-comments 
b/tests/ref/fate/mxf-d10-user-comments
index 3b9d9d2..c35add0 100644
--- a/tests/ref/fate/mxf-d10-user-comments
+++ b/tests/ref/fate/mxf-d10-user-comments
@@ -1 +1 @@
-fe9b43f5b6e7737fe2670b660fd3d860
+7bb9f39e8e05724525154de17f0235d8
diff --git a/tests/ref/fate/mxf-opatom-user-comments 
b/tests/ref/fate/mxf-opatom-user-comments
index be57eb4..ec4fdff 100644
--- a/tests/ref/fate/mxf-opatom-user-comments
+++ b/tests/ref/fate/mxf-opatom-user-comments
@@ -1 +1 @@
-9b3d7201c37c5783702774e46e0da141
+8475bebf3448a972ae89ba59309fd7d6
diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name
index acda8fe..d50f0f6 100644
--- a/tests/ref/fate/mxf-reel_name
+++ b/tests/ref/fate/mxf-reel_name
@@ -1 +1 @@
-422d6ed4821e7bbecbcdecc553abc6e4
+ce49a0361d3f79106e1952d387eace51
diff --git a/tests/ref/fate/mxf-user-comments b/tests/ref/fate/mxf-user-comments
index 3b77db9..5fcdc58 100644
--- a/tests/ref/fate/mxf-user-comments
+++ b/tests/ref/fate/mxf-user-comments
@@ -1 +1 @@
-c77b632dbcdacd6466e1ec794917556e
+956f653cd75e1a319569caec9df81b4f
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index d3c9795..28815d0 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@
-e5c9da6972b6f6e7b15bcbbf20a9dbd1
+78ac0348027b75d73acb8bea14e67a59
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index 1b1fe1a..21bf2be 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,9 +1,9 @@
-1703da2e9f0ca49a5f0bcbcc6944c9c0 *tests/data/lavf/lavf.mxf
+8938d5c4a396ff1b24d10d4f917ae1c9 *tests/data/lavf/lavf.mxf
 526393 tests/data/lavf/lavf.mxf
 tests/data/lavf/lavf.mxf CRC=0x8dddfaab
-b44c4f138f1a87256211c3112dd52c87 *tests/data/lavf/lavf.mxf
+93ea2cfdf5dda7fffdc0d2fdcfb6a9a4 *tests/data/lavf/lavf.mxf
 561721 tests/data/lavf/lavf.mxf
 tests/data/lavf/lavf.mxf CRC=0x96ff1b48
-9ede3c95054c30eb815fbe598a1f097b *tests/data/lavf/lavf.mxf
+87bdf844ae34bcc758e44419e80177a0 *tests/data/lavf/lavf.mxf
 526393 tests/data/lavf/lavf.mxf
 tests/data/lavf/lavf.mxf CRC=0x8dddfaab
diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10
index 19e6f20..47ef244 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@
-c72f1f3d6ce555f96946c421f705f880 *tests/data/lavf/lavf.mxf_d10
+7f16902e28718c2a92bc082400a1c6ee *tests/data/lavf/lavf.mxf_d10
 

Re: [FFmpeg-devel] [PATCH v4 3/3] avformat/mxfenc: prefer to use the configured metadta

2021-01-29 Thread lance . lmwang
On Thu, Jan 28, 2021 at 02:41:46PM +0100, Tomas Härdin wrote:
> tor 2021-01-28 klockan 21:08 +0800 skrev lance.lmw...@gmail.com:
> > On Thu, Jan 28, 2021 at 10:26:03AM +0100, emco...@ffastrans.com wrote:
> > > Am 2021-01-28 02:21, schrieb lance.lmw...@gmail.com:
> > > > I haven't found the s337m freely, so I'm not sure about the Platforma
> > > > metadata.
> > > > I think we haven't support the field yet, I guess it's 0x3C08 tag, but I
> > > > haven't
> > > > the document in hand so it's not OK to add it by me.
> > > > 
> > > Yeah the SMPTE are unfortunately not free :-(
> > > 
> > > Maybe this helps: a citate from 377-1-2009c which i believe is the only
> > > versoin of SMPTE 377 we should refer to unless we change the  "Minor
> > > Version" property of the partition pack to another value than "3" (which 
> > > it
> > > currently is):
> > 
> > thanks, I got a copy already.
> > 
> > > > Item Name: Platform
> > > > Type: UTF-16 string
> > > > Len: var
> > > > Local Tag: 3C.08
> > > > Item UL:  06.0E.2B.3401.01.01.0205.20.07.0106.01.00.00
> > > > Req?: Opt
> > > > Meaning: Human readable name of the toolkit and operating system used.
> > > > Best practice is to use the form “SDK name (OS name)” [RP 210 Specifies
> > > > the platform on which the application was run]
> > 
> > I haven't figured out how to get the string of "OS name", maybe I had to
> > change configure file to add OS_NAME=$target_os and export the string.
> > 
> > Below is two example for Apple and Linux:
> > application_platform: Lavf58.65.101(Darwin)
> > application_platform: Lavf58.65.101(Linux)
> > 
> > If it's OK, I'll update the patch.
> 
> You're missing a space before the parentheses. But yeah, something like
> that would be fine with me. Maybe someone else has an opinion?

Have fixed it and send the updated patch, please help to review them.

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

-- 
Thanks,
Limin Wang
___
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] lavc/hevc_parser: remove repeated profile/level settings

2021-01-29 Thread Linjie Fu
Since avctx->profile/level would be set in export_stream_params()
in set_sps(), identical codes here seem to be redundant.

Signed-off-by: Linjie Fu 
---
 libavcodec/hevc_parser.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 463d352055..0eb7fb074c 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -95,8 +95,6 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, 
H2645NAL *nal,
 s->width= ps->sps->width  - ow->left_offset - ow->right_offset;
 s->height   = ps->sps->height - ow->top_offset  - ow->bottom_offset;
 s->format   = ps->sps->pix_fmt;
-avctx->profile  = ps->sps->ptl.general_ptl.profile_idc;
-avctx->level= ps->sps->ptl.general_ptl.level_idc;
 
 if (ps->vps->vps_timing_info_present_flag) {
 num = ps->vps->vps_num_units_in_tick;
-- 
2.25.1

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

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

Re: [FFmpeg-devel] [PATCH] lavf/utils: reset event_flags if extradata is not extracted correctly

2021-01-29 Thread Linjie Fu
On Mon, Jan 25, 2021 at 9:08 PM Anton Khirnov  wrote:
>
> Quoting Linjie Fu (2021-01-25 04:49:21)
> > On Mon, Jan 25, 2021 at 12:49 AM Anton Khirnov  wrote:
> > >
> > > Quoting Linjie Fu (2021-01-24 16:05:56)
> > > > Regression since 87f0c8280.
> > > >
> > > > If the extradata of a stream could not be extracted correctly,
> > > > codec_info_nb_frames would remain zero, while st->event_flag would still
> > > > be marked as AVSTREAM_EVENT_FLAG_NEW_PACKETS.
> > > >
> > > > The two expressions could be different in this case, hence reset
> > > > event_flags and calculate the correct score.
> > > >
> > > > Fix #9029.
> > >
> > > The ticket mentions ffplay, but ffplay does not access event_flags.
> > >
> >
> > You are right, this helps ffmpeg cmdline to copy and dump:
> > $ ffmpeg -i sample_cut.flv -c copy -y dump.mp4
> >
> > Before 87f0c8280 and after this patch:
> >
> > audio streams could be dumped and playable, while video streams still not.
> >
> > 87f0c8280..master:
> > Error reporting and quits.
> >
> > [mp4 @ 0x7fb276809a00] dimensions not set
> > Could not write header for output file #0 (incorrect codec parameters
> > ?): Invalid argument
> > Error initializing output stream 0:1 --
> >
> > I'd change the commit message to "#9029 related" for this, since the
> > ffplay issue remains the same.
>
> I am still not convinced this is really a regression. You can still
> process the file by explicitly mapping only the audio stream.
Okay, I'm fine with this if it won't trigger failures for to different paths.

> This file is damaged and the video stream is not readable. IMO it is
> better to report an error and let the user decide what to do with it
> than silently skip the video stream while pretending everything is fine.
VLC is able to decode/play this correctly, hence maybe need to
investigate more into this.

- linjie
___
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 2/2] fate: Add test for namespace prefixes in libraries

2021-01-29 Thread Andreas Rheinhardt
Mark Thompson:
> Ensures that external symbols in the built static libraries either have
> correct namespace prefixes or are on a known list of exceptions.
> ---
>  tests/Makefile  |  1 +
>  tests/fate/namespace.mak| 19 ++
>  tests/fate/namespace.sh | 15 
>  tests/ref/fate/namespace-avcodec|  0
>  tests/ref/fate/namespace-avdevice   |  0
>  tests/ref/fate/namespace-avfilter   |  0
>  tests/ref/fate/namespace-avformat   |  0
>  tests/ref/fate/namespace-avutil |  0
>  tests/ref/fate/namespace-postproc   |  0
>  tests/ref/fate/namespace-swresample |  0
>  tests/ref/fate/namespace-swscale| 58 +
>  11 files changed, 93 insertions(+)
>  create mode 100644 tests/fate/namespace.mak
>  create mode 100755 tests/fate/namespace.sh
>  create mode 100644 tests/ref/fate/namespace-avcodec
>  create mode 100644 tests/ref/fate/namespace-avdevice
>  create mode 100644 tests/ref/fate/namespace-avfilter
>  create mode 100644 tests/ref/fate/namespace-avformat
>  create mode 100644 tests/ref/fate/namespace-avutil
>  create mode 100644 tests/ref/fate/namespace-postproc
>  create mode 100644 tests/ref/fate/namespace-swresample
>  create mode 100644 tests/ref/fate/namespace-swscale
> 
> diff --git a/tests/Makefile b/tests/Makefile
> index 7844901e53..94057eb81d 100644
> --- a/tests/Makefile
> +++ b/tests/Makefile
> @@ -173,6 +173,7 @@ include $(SRC_PATH)/tests/fate/mpeg4.mak
>  include $(SRC_PATH)/tests/fate/mpegps.mak
>  include $(SRC_PATH)/tests/fate/mpegts.mak
>  include $(SRC_PATH)/tests/fate/mxf.mak
> +include $(SRC_PATH)/tests/fate/namespace.mak
>  include $(SRC_PATH)/tests/fate/opus.mak
>  include $(SRC_PATH)/tests/fate/pcm.mak
>  include $(SRC_PATH)/tests/fate/pixfmt.mak
> diff --git a/tests/fate/namespace.mak b/tests/fate/namespace.mak
> new file mode 100644
> index 00..0021e7152d
> --- /dev/null
> +++ b/tests/fate/namespace.mak
> @@ -0,0 +1,19 @@
> +
> +define FATE_NAMESPACE
> +# (library_name, config_option)
> +FATE_NAMESPACE-$(call ALLYES, STATIC $(2)) += fate-namespace-$(1)
> +fate-namespace-$(1): lib$(1)/$(LIBPREF)$(1)$(LIBSUF)
> +fate-namespace-$(1): CMD = runlocal fate/namespace.sh "$(NM_CMD) -P 
> lib$(1)/$(LIBPREF)$(1)$(LIBSUF)"
> +endef
> +
> +$(eval $(call FATE_NAMESPACE,avutil, AVUTIL))
> +$(eval $(call FATE_NAMESPACE,avcodec,AVCODEC))
> +$(eval $(call FATE_NAMESPACE,avformat,   AVFORMAT))
> +$(eval $(call FATE_NAMESPACE,avfilter,   AVFILTER))
> +$(eval $(call FATE_NAMESPACE,avdevice,   AVDEVICE))
> +$(eval $(call FATE_NAMESPACE,swscale,SWSCALE))
> +$(eval $(call FATE_NAMESPACE,swresample, SWRESAMPLE))
> +$(eval $(call FATE_NAMESPACE,postproc,   POSTPROC))
> +
> +FATE += $(FATE_NAMESPACE-yes)
> +fate-namespace: $(FATE_NAMESPACE-yes)
> diff --git a/tests/fate/namespace.sh b/tests/fate/namespace.sh
> new file mode 100755
> index 00..16d306eafc
> --- /dev/null
> +++ b/tests/fate/namespace.sh
> @@ -0,0 +1,15 @@
> +#!/bin/sh
> +
> +$1 |
> +   grep ' [TDBR] ' | # Filter to all global text/data/bss symbols.
> +   grep -v '^ff_' | # Internal-only globals.
> +   grep -v '^av'  | # libav* external API.
> +   grep -v '^sws' | # libswscale external API.
> +   grep -v '^swr' | # libswresample external API.
> +   grep -v '^\(postproc\|pp\)_' | # libpostproc external API.
> +   grep -v '^\(ffio\|ffurl\)_'  | # libavformat internal ffio/ffurl APIs.
> +   grep -v '^rgb2rgb_init_' | # libswscale arch-specific init function.
> +   sed 's/ .*//'  | # Remove everything except the symbol name.
> +   sort # Sort to allow deterministic comparison.
> +
> +exit 0
> diff --git a/tests/ref/fate/namespace-avcodec 
> b/tests/ref/fate/namespace-avcodec
> new file mode 100644
> index 00..e69de29bb2
> diff --git a/tests/ref/fate/namespace-avdevice 
> b/tests/ref/fate/namespace-avdevice
> new file mode 100644
> index 00..e69de29bb2
> diff --git a/tests/ref/fate/namespace-avfilter 
> b/tests/ref/fate/namespace-avfilter
> new file mode 100644
> index 00..e69de29bb2
> diff --git a/tests/ref/fate/namespace-avformat 
> b/tests/ref/fate/namespace-avformat
> new file mode 100644
> index 00..e69de29bb2
> diff --git a/tests/ref/fate/namespace-avutil b/tests/ref/fate/namespace-avutil
> new file mode 100644
> index 00..e69de29bb2
> diff --git a/tests/ref/fate/namespace-postproc 
> b/tests/ref/fate/namespace-postproc
> new file mode 100644
> index 00..e69de29bb2
> diff --git a/tests/ref/fate/namespace-swresample 
> b/tests/ref/fate/namespace-swresample
> new file mode 100644
> index 00..e69de29bb2
> diff --git a/tests/ref/fate/namespace-swscale 
> b/tests/ref/fate/namespace-swscale
> new file mode 100644
> index 00..a7aa4504ae
> --- /dev/null
> +++ b/tests/ref/fate/namespace-swscale
> @@ -0,0 +1,58 @@
> +deinterleaveBytes
> +interleaveBytes
> +planar2x
> +rgb12to15
> +rgb12tobgr12
> +rgb15to16
> +rgb15to24
> +rgb15to32
> +rgb15tobgr15
> +rgb15tobgr16

[FFmpeg-devel] [PATCH 6/6] swscale: Make nonstatic identifiers respect the naming conventions

2021-01-29 Thread Andreas Rheinhardt
swscale had several nonstatic functions and function pointers without
the proper ff_-prefix; this has been fixed.

Signed-off-by: Andreas Rheinhardt 
---
Tested on x86 and x64; I hope I did everything correct for the other
arches, but I am not sure about that, therefore people with the
necessary hardware will have to confirm this.

 libswscale/aarch64/rgb2rgb.c |   4 +-
 libswscale/arm/rgb2yuv_neon_common.S |   2 +-
 libswscale/arm/swscale_unscaled.c|   4 +-
 libswscale/ppc/yuv2yuv_altivec.c |   8 +-
 libswscale/rgb2rgb.c | 178 
 libswscale/rgb2rgb.h | 196 +--
 libswscale/rgb2rgb_template.c|  92 ++---
 libswscale/swscale_unscaled.c| 160 +++---
 libswscale/tests/colorspace.c|  72 +-
 libswscale/utils.c   |   2 +-
 libswscale/x86/rgb2rgb.c |  18 +--
 libswscale/x86/rgb2rgb_template.c|  76 +--
 tests/checkasm/sw_rgb.c  |  16 +--
 13 files changed, 414 insertions(+), 414 deletions(-)

diff --git a/libswscale/aarch64/rgb2rgb.c b/libswscale/aarch64/rgb2rgb.c
index a9bf6ff9e0..62bf3c033c 100644
--- a/libswscale/aarch64/rgb2rgb.c
+++ b/libswscale/aarch64/rgb2rgb.c
@@ -31,11 +31,11 @@ void ff_interleave_bytes_neon(const uint8_t *src1, const 
uint8_t *src2,
   uint8_t *dest, int width, int height,
   int src1Stride, int src2Stride, int dstStride);
 
-av_cold void rgb2rgb_init_aarch64(void)
+av_cold void ff_rgb2rgb_init_aarch64(void)
 {
 int cpu_flags = av_get_cpu_flags();
 
 if (have_neon(cpu_flags)) {
-interleaveBytes = ff_interleave_bytes_neon;
+ff_interleave_bytes = ff_interleave_bytes_neon;
 }
 }
diff --git a/libswscale/arm/rgb2yuv_neon_common.S 
b/libswscale/arm/rgb2yuv_neon_common.S
index 30bcecd5bb..2381652de3 100644
--- a/libswscale/arm/rgb2yuv_neon_common.S
+++ b/libswscale/arm/rgb2yuv_neon_common.S
@@ -97,7 +97,7 @@ alias_dw_all0, 0, 1
 
 .macro  loop_420sp s_fmt, d_fmt, init, kernel, precision
 
-function \s_fmt\()_to_\d_fmt\()_neon_\precision, export=1
+function ff_\s_fmt\()_to_\d_fmt\()_neon_\precision, export=1
 prologue
 
 alias_loop_420sp
diff --git a/libswscale/arm/swscale_unscaled.c 
b/libswscale/arm/swscale_unscaled.c
index e41f294eac..da6486d102 100644
--- a/libswscale/arm/swscale_unscaled.c
+++ b/libswscale/arm/swscale_unscaled.c
@@ -24,12 +24,12 @@
 #include "libavutil/arm/cpu.h"
 
 #if HAVE_AS_DN_DIRECTIVE
-extern void rgbx_to_nv12_neon_32(const uint8_t *src, uint8_t *y, uint8_t 
*chroma,
+extern void ff_rgbx_to_nv12_neon_32(const uint8_t *src, uint8_t *y, uint8_t 
*chroma,
 int width, int height,
 int y_stride, int c_stride, int src_stride,
 int32_t coeff_tbl[9]);
 
-extern void rgbx_to_nv12_neon_16(const uint8_t *src, uint8_t *y, uint8_t 
*chroma,
+extern void ff_rgbx_to_nv12_neon_16(const uint8_t *src, uint8_t *y, uint8_t 
*chroma,
 int width, int height,
 int y_stride, int c_stride, int src_stride,
 int32_t coeff_tbl[9]);
diff --git a/libswscale/ppc/yuv2yuv_altivec.c b/libswscale/ppc/yuv2yuv_altivec.c
index 2b1c5dd3b8..ebee7f38c4 100644
--- a/libswscale/ppc/yuv2yuv_altivec.c
+++ b/libswscale/ppc/yuv2yuv_altivec.c
@@ -37,8 +37,8 @@ static int yv12toyuy2_unscaled_altivec(SwsContext *c, const 
uint8_t *src[],
int dstStride_a[])
 {
 uint8_t *dst = dstParam[0] + dstStride_a[0] * srcSliceY;
-// yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH,
-//srcStride[0], srcStride[1], dstStride[0]);
+// ff_yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH,
+//   srcStride[0], srcStride[1], dstStride[0]);
 const uint8_t *ysrc   = src[0];
 const uint8_t *usrc   = src[1];
 const uint8_t *vsrc   = src[2];
@@ -113,8 +113,8 @@ static int yv12touyvy_unscaled_altivec(SwsContext *c, const 
uint8_t *src[],
int dstStride_a[])
 {
 uint8_t *dst = dstParam[0] + dstStride_a[0] * srcSliceY;
-// yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH,
-//srcStride[0], srcStride[1], dstStride[0]);
+// ff_yv12toyuy2(src[0], src[1], src[2], dst, c->srcW, srcSliceH,
+//   srcStride[0], srcStride[1], dstStride[0]);
 const uint8_t *ysrc  = src[0];
 const uint8_t *usrc  = src[1];
 const uint8_t *vsrc  = src[2];
diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
index a7300f3ba4..4078c5cd1b 100644
--- a/libswscale/rgb2rgb.c
+++ b/libswscale/rgb2rgb.c
@@ -32,87 +32,87 @@
 #include "swscale.h"
 #include "swscale_internal.h"
 
-void (*rgb32tobgr24)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb32tobgr16)(const uint8_t *src, uint8_t *dst, int src_size);
-void (*rgb32tobgr15)(const 

[FFmpeg-devel] [PATCH 5/6] avformat/qtpalette: Use better headers

2021-01-29 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavformat/qtpalette.c | 3 ++-
 libavformat/qtpalette.h | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/qtpalette.c b/libavformat/qtpalette.c
index 2ac079a23c..9bcc3c6c38 100644
--- a/libavformat/qtpalette.c
+++ b/libavformat/qtpalette.c
@@ -24,8 +24,9 @@
 #include 
 #include 
 
-#include "avformat.h"
 #include "libavutil/intreadwrite.h"
+#include "libavcodec/codec_id.h"
+#include "avio.h"
 #include "qtpalette.h"
 
 static const uint8_t qt_default_palette_2[2 * 3] = {
diff --git a/libavformat/qtpalette.h b/libavformat/qtpalette.h
index 03c0154945..18a108ebaf 100644
--- a/libavformat/qtpalette.h
+++ b/libavformat/qtpalette.h
@@ -24,7 +24,7 @@
 #define AVFORMAT_QTPALETTE_H
 
 #include 
-#include "avformat.h"
+#include "avio.h"
 
 /**
  * Retrieve the palette (or "color table" in QuickTime terms), either
-- 
2.25.1

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

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

[FFmpeg-devel] [PATCH 4/6] avformat/rtsp: Fix build failure when RTP demuxers are disabled

2021-01-29 Thread Andreas Rheinhardt
rtsp.c uses a check of the form "if (CONFIG_RTSP_DEMUXER && ...) {}"
with the intent to make the code compilable even though the part guarded
by this check contains calls to functions that don't exist when the RTSP
demuxer is disabled. Yet even then compilers still need a declaration of
all the functions in the dead code block and error out if not (due to
our usage of -Werror=implicit-function-declaration) and no such
declaration exists for a static function in rtsp.c. Simply adding a
declaration leads to a "used but never defined" warning, therefore this
commit resorts to an #if.

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/rtsp.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 1b24496f3c..9a2933346e 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1941,12 +1941,15 @@ redirect:
 break;
 }
 
-if (CONFIG_RTSP_DEMUXER && s->iformat) {
+#if CONFIG_RTSP_DEMUXER
+if (s->iformat) {
 if (rt->server_type == RTSP_SERVER_SATIP)
 err = init_satip_stream(s);
 else
 err = ff_rtsp_setup_input_streams(s, reply);
-} else if (CONFIG_RTSP_MUXER)
+} else
+#endif
+   if (CONFIG_RTSP_MUXER)
 err = ff_rtsp_setup_output_streams(s, host);
 else
 av_assert0(0);
-- 
2.25.1

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

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

[FFmpeg-devel] [PATCH 3/6] avformat/Makefile: Only compile qtpalette.c when needed

2021-01-29 Thread Andreas Rheinhardt
Signed-off-by: Andreas Rheinhardt 
---
 libavformat/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/Makefile b/libavformat/Makefile
index c820dd35f4..bf1e56fc0a 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -16,7 +16,6 @@ OBJS = allformats.o \
mux.o\
options.o\
os_support.o \
-   qtpalette.o  \
protocols.o  \
riff.o   \
sdp.o\
@@ -308,7 +307,7 @@ OBJS-$(CONFIG_M4V_MUXER) += rawenc.o
 OBJS-$(CONFIG_MATROSKA_DEMUXER)  += matroskadec.o matroska.o  \
 rmsipr.o flac_picture.o \
 oggparsevorbis.o vorbiscomment.o \
-replaygain.o
+qtpalette.o replaygain.o
 OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \
 av1.o avc.o hevc.o \
 flacenc_header.o avlanguage.o \
@@ -330,7 +329,8 @@ OBJS-$(CONFIG_MMF_DEMUXER)   += mmf.o
 OBJS-$(CONFIG_MMF_MUXER) += mmf.o rawenc.o
 OBJS-$(CONFIG_MODS_DEMUXER)  += mods.o
 OBJS-$(CONFIG_MOFLEX_DEMUXER)+= moflex.o
-OBJS-$(CONFIG_MOV_DEMUXER)   += mov.o mov_chan.o mov_esds.o 
replaygain.o
+OBJS-$(CONFIG_MOV_DEMUXER)   += mov.o mov_chan.o mov_esds.o \
+qtpalette.o replaygain.o
 OBJS-$(CONFIG_MOV_MUXER) += movenc.o av1.o avc.o hevc.o vpcc.o 
\
 movenchint.o mov_chan.o rtp.o \
 movenccenc.o rawutils.o
-- 
2.25.1

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

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

[FFmpeg-devel] [PATCH 2/6] avformat/qtpalette: Move default palette to their only user

2021-01-29 Thread Andreas Rheinhardt
Namely qtpalette.c itself.

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/qtpalette.c | 300 +++-
 libavformat/qtpalette.h | 292 --
 2 files changed, 296 insertions(+), 296 deletions(-)

diff --git a/libavformat/qtpalette.c b/libavformat/qtpalette.c
index 6833f0cea9..2ac079a23c 100644
--- a/libavformat/qtpalette.c
+++ b/libavformat/qtpalette.c
@@ -28,6 +28,298 @@
 #include "libavutil/intreadwrite.h"
 #include "qtpalette.h"
 
+static const uint8_t qt_default_palette_2[2 * 3] = {
+  0xFF, 0xFF, 0xFF,
+  0x00, 0x00, 0x00
+};
+
+/* From a screenshot of the "Monitors & Sound" control panel in Mac OS 7.5.5 */
+static const uint8_t qt_default_palette_4[4 * 3] = {
+  0xFF, 0xFF, 0xFF,
+  0xAC, 0xAC, 0xAC,
+  0x55, 0x55, 0x55,
+  0x00, 0x00, 0x00
+};
+
+/* From a screenshot of the "Monitors & Sound" control panel in Mac OS 7.5.5 */
+static const uint8_t qt_default_palette_16[16 * 3] = {
+  0xFF, 0xFF, 0xFF,
+  0xFC, 0xF3, 0x05,
+  0xFF, 0x64, 0x02,
+  0xDD, 0x08, 0x06,
+  0xF2, 0x08, 0x84,
+  0x46, 0x00, 0xA5,
+  0x00, 0x00, 0xD4,
+  0x02, 0xAB, 0xEA,
+  0x1F, 0xB7, 0x14,
+  0x00, 0x64, 0x11,
+  0x56, 0x2C, 0x05,
+  0x90, 0x71, 0x3A,
+  0xC0, 0xC0, 0xC0,
+  0x80, 0x80, 0x80,
+  0x40, 0x40, 0x40,
+  0x00, 0x00, 0x00
+};
+
+static const uint8_t qt_default_palette_256[256 * 3] = {
+  /*   0, 0x00 */  0xFF, 0xFF, 0xFF,
+  /*   1, 0x01 */  0xFF, 0xFF, 0xCC,
+  /*   2, 0x02 */  0xFF, 0xFF, 0x99,
+  /*   3, 0x03 */  0xFF, 0xFF, 0x66,
+  /*   4, 0x04 */  0xFF, 0xFF, 0x33,
+  /*   5, 0x05 */  0xFF, 0xFF, 0x00,
+  /*   6, 0x06 */  0xFF, 0xCC, 0xFF,
+  /*   7, 0x07 */  0xFF, 0xCC, 0xCC,
+  /*   8, 0x08 */  0xFF, 0xCC, 0x99,
+  /*   9, 0x09 */  0xFF, 0xCC, 0x66,
+  /*  10, 0x0A */  0xFF, 0xCC, 0x33,
+  /*  11, 0x0B */  0xFF, 0xCC, 0x00,
+  /*  12, 0x0C */  0xFF, 0x99, 0xFF,
+  /*  13, 0x0D */  0xFF, 0x99, 0xCC,
+  /*  14, 0x0E */  0xFF, 0x99, 0x99,
+  /*  15, 0x0F */  0xFF, 0x99, 0x66,
+  /*  16, 0x10 */  0xFF, 0x99, 0x33,
+  /*  17, 0x11 */  0xFF, 0x99, 0x00,
+  /*  18, 0x12 */  0xFF, 0x66, 0xFF,
+  /*  19, 0x13 */  0xFF, 0x66, 0xCC,
+  /*  20, 0x14 */  0xFF, 0x66, 0x99,
+  /*  21, 0x15 */  0xFF, 0x66, 0x66,
+  /*  22, 0x16 */  0xFF, 0x66, 0x33,
+  /*  23, 0x17 */  0xFF, 0x66, 0x00,
+  /*  24, 0x18 */  0xFF, 0x33, 0xFF,
+  /*  25, 0x19 */  0xFF, 0x33, 0xCC,
+  /*  26, 0x1A */  0xFF, 0x33, 0x99,
+  /*  27, 0x1B */  0xFF, 0x33, 0x66,
+  /*  28, 0x1C */  0xFF, 0x33, 0x33,
+  /*  29, 0x1D */  0xFF, 0x33, 0x00,
+  /*  30, 0x1E */  0xFF, 0x00, 0xFF,
+  /*  31, 0x1F */  0xFF, 0x00, 0xCC,
+  /*  32, 0x20 */  0xFF, 0x00, 0x99,
+  /*  33, 0x21 */  0xFF, 0x00, 0x66,
+  /*  34, 0x22 */  0xFF, 0x00, 0x33,
+  /*  35, 0x23 */  0xFF, 0x00, 0x00,
+  /*  36, 0x24 */  0xCC, 0xFF, 0xFF,
+  /*  37, 0x25 */  0xCC, 0xFF, 0xCC,
+  /*  38, 0x26 */  0xCC, 0xFF, 0x99,
+  /*  39, 0x27 */  0xCC, 0xFF, 0x66,
+  /*  40, 0x28 */  0xCC, 0xFF, 0x33,
+  /*  41, 0x29 */  0xCC, 0xFF, 0x00,
+  /*  42, 0x2A */  0xCC, 0xCC, 0xFF,
+  /*  43, 0x2B */  0xCC, 0xCC, 0xCC,
+  /*  44, 0x2C */  0xCC, 0xCC, 0x99,
+  /*  45, 0x2D */  0xCC, 0xCC, 0x66,
+  /*  46, 0x2E */  0xCC, 0xCC, 0x33,
+  /*  47, 0x2F */  0xCC, 0xCC, 0x00,
+  /*  48, 0x30 */  0xCC, 0x99, 0xFF,
+  /*  49, 0x31 */  0xCC, 0x99, 0xCC,
+  /*  50, 0x32 */  0xCC, 0x99, 0x99,
+  /*  51, 0x33 */  0xCC, 0x99, 0x66,
+  /*  52, 0x34 */  0xCC, 0x99, 0x33,
+  /*  53, 0x35 */  0xCC, 0x99, 0x00,
+  /*  54, 0x36 */  0xCC, 0x66, 0xFF,
+  /*  55, 0x37 */  0xCC, 0x66, 0xCC,
+  /*  56, 0x38 */  0xCC, 0x66, 0x99,
+  /*  57, 0x39 */  0xCC, 0x66, 0x66,
+  /*  58, 0x3A */  0xCC, 0x66, 0x33,
+  /*  59, 0x3B */  0xCC, 0x66, 0x00,
+  /*  60, 0x3C */  0xCC, 0x33, 0xFF,
+  /*  61, 0x3D */  0xCC, 0x33, 0xCC,
+  /*  62, 0x3E */  0xCC, 0x33, 0x99,
+  /*  63, 0x3F */  0xCC, 0x33, 0x66,
+  /*  64, 0x40 */  0xCC, 0x33, 0x33,
+  /*  65, 0x41 */  0xCC, 0x33, 0x00,
+  /*  66, 0x42 */  0xCC, 0x00, 0xFF,
+  /*  67, 0x43 */  0xCC, 0x00, 0xCC,
+  /*  68, 0x44 */  0xCC, 0x00, 0x99,
+  /*  69, 0x45 */  0xCC, 0x00, 0x66,
+  /*  70, 0x46 */  0xCC, 0x00, 0x33,
+  /*  71, 0x47 */  0xCC, 0x00, 0x00,
+  /*  72, 0x48 */  0x99, 0xFF, 0xFF,
+  /*  73, 0x49 */  0x99, 0xFF, 0xCC,
+  /*  74, 0x4A */  0x99, 0xFF, 0x99,
+  /*  75, 0x4B */  0x99, 0xFF, 0x66,
+  /*  76, 0x4C */  0x99, 0xFF, 0x33,
+  /*  77, 0x4D */  0x99, 0xFF, 0x00,
+  /*  78, 0x4E */  0x99, 0xCC, 0xFF,
+  /*  79, 0x4F */  0x99, 0xCC, 0xCC,
+  /*  80, 0x50 */  0x99, 0xCC, 0x99,
+  /*  81, 0x51 */  0x99, 0xCC, 0x66,
+  /*  82, 0x52 */  0x99, 0xCC, 0x33,
+  /*  83, 0x53 */  0x99, 0xCC, 0x00,
+  /*  84, 0x54 */  0x99, 0x99, 0xFF,
+  /*  85, 0x55 */  0x99, 0x99, 0xCC,
+  /*  86, 0x56 */  0x99, 0x99, 0x99,
+  /*  87, 0x57 */  0x99, 0x99, 0x66,
+  /*  88, 0x58 */  0x99, 0x99, 0x33,
+  /*  89, 0x59 */  0x99, 0x99, 0x00,
+  /*  90, 0x5A */  0x99, 0x66, 0xFF,
+  /*  91, 0x5B */  0x99, 0x66, 0xCC,
+  /*  92, 0x5C */  0x99, 0x66, 0x99,
+  /*  93, 0x5D */  0x99, 0x66, 0x66,
+  /*  94, 0x5E */  0x99, 0x66, 0x33,
+  /*  95, 0x5F */  

[FFmpeg-devel] [PATCH 1/6] avformat/cutils, dvenc: Move ff_brktimegm to its only user

2021-01-29 Thread Andreas Rheinhardt
This also allows to completely remove cutils.c.

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/Makefile   |  1 -
 libavformat/cutils.c   | 39 ---
 libavformat/dvenc.c| 13 +++--
 libavformat/internal.h |  2 --
 4 files changed, 11 insertions(+), 44 deletions(-)
 delete mode 100644 libavformat/cutils.c

diff --git a/libavformat/Makefile b/libavformat/Makefile
index 3a8fbcbe5f..c820dd35f4 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -8,7 +8,6 @@ HEADERS = avformat.h
\
 OBJS = allformats.o \
avio.o   \
aviobuf.o\
-   cutils.o \
dump.o   \
format.o \
id3v1.o  \
diff --git a/libavformat/cutils.c b/libavformat/cutils.c
deleted file mode 100644
index d86ba05441..00
--- a/libavformat/cutils.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * various simple utilities for libavformat
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/time_internal.h"
-#include "avformat.h"
-#include "internal.h"
-
-#define ISLEAP(y) (((y) % 4 == 0) && (((y) % 100) != 0 || ((y) % 400) == 0))
-#define LEAPS_COUNT(y) ((y)/4 - (y)/100 + (y)/400)
-
-/* This is our own gmtime_r. It differs from its POSIX counterpart in a
-   couple of places, though. */
-struct tm *ff_brktimegm(time_t secs, struct tm *tm)
-{
-tm = gmtime_r(, tm);
-
-tm->tm_year += 1900; /* unlike gmtime_r we store complete year here */
-tm->tm_mon  += 1;/* unlike gmtime_r tm_mon is from 1 to 12 */
-
-return tm;
-}
diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c
index 6c0d40f819..320f8479f0 100644
--- a/libavformat/dvenc.c
+++ b/libavformat/dvenc.c
@@ -29,6 +29,7 @@
  */
 #include 
 
+#include "libavutil/time_internal.h"
 #include "avformat.h"
 #include "internal.h"
 #include "libavcodec/dv_profile.h"
@@ -72,6 +73,14 @@ static const int dv_aaux_packs_dist[12][9] = {
 { 0x50, 0x51, 0x52, 0x53, 0xff, 0xff, 0xff, 0xff, 0xff },
 };
 
+static void brktimegm(time_t secs, struct tm *tm)
+{
+tm = gmtime_r(, tm);
+
+tm->tm_year += 1900; /* unlike gmtime_r we store complete year here */
+tm->tm_mon  += 1;/* unlike gmtime_r tm_mon is from 1 to 12 */
+}
+
 static int dv_audio_frame_size(const AVDVProfile* sys, int frame, int 
sample_rate)
 {
 if ((sys->time_base.den == 25 || sys->time_base.den == 50) && 
sys->time_base.num == 1) {
@@ -143,7 +152,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, 
DVMuxContext *c, uint8_t* bu
 case dv_video_recdate:  /* VAUX recording date */
 ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
 c->sys->time_base.den, 
AV_ROUND_DOWN);
-ff_brktimegm(ct, );
+brktimegm(ct, );
 buf[1] = 0xff; /* ds, tm, tens of time zone, units of time zone */
/* 0xff is very likely to be "unknown" */
 buf[2] = (3 << 6) | /* reserved -- always 1 */
@@ -159,7 +168,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, 
DVMuxContext *c, uint8_t* bu
 case dv_video_rectime:  /* VAUX recording time */
 ct = c->start_time + av_rescale_rnd(c->frames, c->sys->time_base.num,
c->sys->time_base.den, 
AV_ROUND_DOWN);
-ff_brktimegm(ct, );
+brktimegm(ct, );
 buf[1] = (3 << 6) | /* reserved -- always 1 */
  0x3f; /* tens of frame, units of frame: 0x3f - "unknown" ? */
 buf[2] = (1 << 7) | /* reserved -- always 1 */
diff --git a/libavformat/internal.h b/libavformat/internal.h
index f45b1cd6b4..d0db331b96 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -365,8 +365,6 @@ do {\
 } while(0)
 #endif
 
-struct tm *ff_brktimegm(time_t secs, struct tm *tm);
-
 /**
  * Automatically create sub-directories
  *
-- 
2.25.1

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

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

Re: [FFmpeg-devel] [PATCH 1/3] avfilter/vf_pseudocolor: add presets

2021-01-29 Thread Nuo Mi
>
> +#define RGB_TO_Y_BT709(r, g, b) \
> +((0.21260*219.0/255.0) * (r) + (0.71520*219.0/255.0) * (g) + \
> + (0.07220*219.0/255.0) * (b))
> +
> +#define RGB_TO_U_BT709(r1, g1, b1, max) \
> +(-(0.11457*224.0/255.0) * r1 - (0.38543*224.0/255.0) * g1 + \
> +(0.5*224.0/255.0) * b1 + max * 0.5)
> +
> +#define RGB_TO_V_BT709(r1, g1, b1, max) \
> +((0.5*224.0/255.0) * r1 - (0.45415*224.0/255.0) * g1 - \
> +   (0.04585*224.0/255.0) * b1 + max * 0.5)
> +
> +static float lerpf(float v0, float v1, float f)
> +{
> +return v0 + (v1 - v0) * f;
> +}
>
Do we need to make this always inline?

> +
>  static int config_input(AVFilterLink *inlink)
>  {
>  AVFilterContext *ctx = inlink->dst;
>  PseudoColorContext *s = ctx->priv;
>  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
> -int depth, ret, hsub, vsub, color;
> +int depth, ret, hsub, vsub, color, factor, rgb;
>
> +rgb = desc->flags & AV_PIX_FMT_FLAG_RGB;
>  depth = desc->comp[0].depth;
> +factor = 1 << (depth - 8);
>  s->max = (1 << depth) - 1;
>  s->nb_planes = av_pix_fmt_count_planes(inlink->format);
>
> @@ -457,7 +1138,7 @@ static int config_input(AVFilterLink *inlink)
>  s->var_values[VAR_VMAX] = 240 * (1 << (depth - 8));
>  s->var_values[VAR_AMAX] = s->max;
>
> -for (color = 0; color < s->nb_planes; color++) {
> +for (color = 0; color < s->nb_planes && s->preset < 0; color++) {
>  double res;
>  int val;
>
> @@ -488,6 +1169,56 @@ static int config_input(AVFilterLink *inlink)
>  }
>  }
>
> +if (s->preset >= 0) {
> +for (int i = 0; i < 255; i++) {
> +for (int j = 0; j < factor; j++) {
> +const float lf = j / (float)factor;
> +int r, g, b;
> +
> +g = lerpf(presets[s->preset][i][1],
> presets[s->preset][i+1][1], lf) * s->max;
> +b = lerpf(presets[s->preset][i][2],
> presets[s->preset][i+1][2], lf) * s->max;
> +r = lerpf(presets[s->preset][i][0],
> presets[s->preset][i+1][0], lf) * s->max;
> +
> +if (!rgb) {
> +int y = RGB_TO_Y_BT709(r, g, b);
> +int u = RGB_TO_U_BT709(r, g, b, s->max);
> +int v = RGB_TO_V_BT709(r, g, b, s->max);
> +
> +r = v;
> +g = y;
> +b = u;
> +}
> +
> +s->lut[0][i*factor+j] = g;
> +s->lut[1][i*factor+j] = b;
> +s->lut[2][i*factor+j] = r;
> +}
> +}
> +
>
Near the same code block as below, could we move the for loop in a
function?

> +for (int j = 0; j < factor; j++) {
> +const float lf = j / (float)factor;
> +int r, g, b;
> +
> +g = lerpf(presets[s->preset][254][1],
> presets[s->preset][255][1], lf) * s->max;
> +b = lerpf(presets[s->preset][254][2],
> presets[s->preset][255][2], lf) * s->max;
> +r = lerpf(presets[s->preset][254][0],
> presets[s->preset][255][0], lf) * s->max;
> +
> +if (!rgb) {
> +int y = RGB_TO_Y_BT709(r, g, b);
> +int u = RGB_TO_U_BT709(r, g, b, s->max);
> +int v = RGB_TO_V_BT709(r, g, b, s->max);
> +
> +r = v;
> +g = y;
> +b = u;
> +}
> +
> +s->lut[0][255*factor+j] = g;
> +s->lut[1][255*factor+j] = b;
> +s->lut[2][255*factor+j] = r;

the previous block is " s->lut[2][i*factor+j] = r ",
Is this a typo of  "s->lut[2][254*factor+j] = r" ?

>

+}
> +}

+
>  switch (inlink->format) {
>  case AV_PIX_FMT_YUV444P:
>  case AV_PIX_FMT_YUVA444P:
> --
> 2.17.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 2/2] avcodec/hevc: set field_order=progressive when SPS makes it straightforward

2021-01-29 Thread Nuo Mi
Hi Nicolas,
One related question, do we have a deinterlace filter to handle hevc SAFF?
thanks

On Sat, Jan 30, 2021 at 1:24 AM Nicolas Gaullier 
wrote:

> ---
>  libavcodec/hevcdec.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
> index 92eb888033..2eaa683399 100644
> --- a/libavcodec/hevcdec.c
> +++ b/libavcodec/hevcdec.c
> @@ -330,6 +330,8 @@ static void export_stream_params(HEVCContext *s, const
> HEVCSPS *sps)
>  avctx->has_b_frames= sps->temporal_layer[sps->max_sub_layers
> - 1].num_reorder_pics;
>  avctx->profile = sps->ptl.general_ptl.profile_idc;
>  avctx->level   = sps->ptl.general_ptl.level_idc;
> +if (sps->ptl.general_ptl.progressive_source_flag &&
> !sps->ptl.general_ptl.interlaced_source_flag)
> +avctx->field_order = AV_FIELD_PROGRESSIVE;
>
>  ff_set_sar(avctx, sps->vui.sar);
>
> --
> 2.27.0.windows.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
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 1/6] avcodec/qsv_h2645: fix memory leak for plugin load

2021-01-29 Thread Guangxin Xu
Hi  Anton, Haihao
If this is the case, we allocated the string in caller, free and reallocate
it in callee.
It's not a good practice.
1. It will make the user confused, The original qsvdec_other.c author and I
are both confused about this.
https://github.com/FFmpeg/FFmpeg/blob/399c1f923574234e899beef72fe249863bd1722a/libavcodec/qsvdec_other.c#L86
2. The av_opt_free may change the design in the future, the new design may
not use av_freep to free the string

Is it possible use  av_opt_set(s, "load_plugin", uid, 0) in qsv_decode_init?
thanks



On Fri, Jan 29, 2021 at 8:37 AM Xiang, Haihao 
wrote:

> On Wed, 2021-01-27 at 13:44 +0100, Anton Khirnov wrote:
> > Quoting Xu Guangxin (2021-01-05 03:43:37)
> > > ---
> > >  libavcodec/qsvdec_h2645.c | 2 ++
> > >  1 file changed, 2 insertions(+)
> > >
> > > diff --git a/libavcodec/qsvdec_h2645.c b/libavcodec/qsvdec_h2645.c
> > > index 02c41883b6..3d6e85230f 100644
> > > --- a/libavcodec/qsvdec_h2645.c
> > > +++ b/libavcodec/qsvdec_h2645.c
> > > @@ -69,6 +69,8 @@ static av_cold int qsv_decode_close(AVCodecContext
> *avctx)
> > >  {
> > >  QSVH2645Context *s = avctx->priv_data;
> > >
> > > +av_freep(>qsv.load_plugins);
> >
> > Does this not get freed by av_opt_free()?
> >
>
> Yes, it gets freed by av_opt_free() when closing the AVCodecContext, we may
> remove the above code from qsvdec.
>
> Thanks
> Haihao
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH] avformat/rtpdec: Avoid allocations of small dynamic buffers

2021-01-29 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> Besides avoiding allocations this also fixes a design defect of
> ff_rtp_send_punch_packets: It did not return an error in case of
> these allocations failed.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/rtpdec.c | 38 +-
>  1 file changed, 13 insertions(+), 25 deletions(-)
> 
> diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
> index f40c020c33..d592e34893 100644
> --- a/libavformat/rtpdec.c
> +++ b/libavformat/rtpdec.c
> @@ -404,38 +404,26 @@ int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, 
> URLContext *fd,
>  
>  void ff_rtp_send_punch_packets(URLContext *rtp_handle)
>  {
> -AVIOContext *pb;
> -uint8_t *buf;
> -int len;
> +uint8_t buf[RTP_MIN_PACKET_LENGTH], *ptr = buf;
>  
>  /* Send a small RTP packet */
> -if (avio_open_dyn_buf() < 0)
> -return;
>  
> -avio_w8(pb, (RTP_VERSION << 6));
> -avio_w8(pb, 0); /* Payload type */
> -avio_wb16(pb, 0); /* Seq */
> -avio_wb32(pb, 0); /* Timestamp */
> -avio_wb32(pb, 0); /* SSRC */
> +bytestream_put_byte(, (RTP_VERSION << 6));
> +bytestream_put_byte(, 0); /* Payload type */
> +bytestream_put_be16(, 0); /* Seq */
> +bytestream_put_be32(, 0); /* Timestamp */
> +bytestream_put_be32(, 0); /* SSRC */
>  
> -len = avio_close_dyn_buf(pb, );
> -if ((len > 0) && buf)
> -ffurl_write(rtp_handle, buf, len);
> -av_free(buf);
> +ffurl_write(rtp_handle, buf, ptr - buf);
>  
>  /* Send a minimal RTCP RR */
> -if (avio_open_dyn_buf() < 0)
> -return;
> +ptr = buf;
> +bytestream_put_byte(, (RTP_VERSION << 6));
> +bytestream_put_byte(, RTCP_RR); /* receiver report */
> +bytestream_put_be16(, 1); /* length in words - 1 */
> +bytestream_put_be32(, 0); /* our own SSRC */
>  
> -avio_w8(pb, (RTP_VERSION << 6));
> -avio_w8(pb, RTCP_RR); /* receiver report */
> -avio_wb16(pb, 1); /* length in words - 1 */
> -avio_wb32(pb, 0); /* our own SSRC */
> -
> -len = avio_close_dyn_buf(pb, );
> -if ((len > 0) && buf)
> -ffurl_write(rtp_handle, buf, len);
> -av_free(buf);
> +ffurl_write(rtp_handle, buf, ptr - buf);
>  }
>  
>  static int find_missing_packets(RTPDemuxContext *s, uint16_t *first_missing,
> 
Will apply tomorrow unless there are objections.

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

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

Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: always parse video headers

2021-01-29 Thread Nicolas Gaullier
>De : Paul B Mahol  
>Envoyé : vendredi 29 janvier 2021 23:46
>À : FFmpeg development discussions and patches 
>Cc : Nicolas Gaullier 
>Objet : Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: always parse video headers
>
>Why is AV1 touched?
Well, AV1 is supposed to be left untouched but follows now the general case 
(except HEVC which has rich extradata and don't need "deep" parsing).
But sorry, I realized with patchwork that I forgot to run fate with SAMPLES 
set... and so at the end, I have to fix fate results for two items
mov-init-nonkeyframe
mov-zombie
I will take some time next week to check the reason why before commiting the 
diff (or fixing my patch if there were a real issue).

Nicolas
>On Fri, Jan 29, 2021 at 6:24 PM Nicolas Gaullier 
> wrote:
>This is aligned with current code of matroskadec.
>Fixes field_order reported by ffprobe for MP4 H264, for example.
>---
> libavformat/mov.c | 7 ---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
>diff --git a/libavformat/mov.c b/libavformat/mov.c
>index ad0b9a58d3..b5e012190b 100644
>--- a/libavformat/mov.c
>+++ b/libavformat/mov.c
>@@ -2461,12 +2461,13 @@ static int mov_finalize_stsd_codec(MOVContext *c, 
>AVIOContext *pb,
>     case AV_CODEC_ID_VP9:
>         st->need_parsing = AVSTREAM_PARSE_FULL;
>         break;
>-    case AV_CODEC_ID_AV1:
>-        st->need_parsing = AVSTREAM_PARSE_HEADERS;
>-        break;
>     default:
>         break;
>     }
>+    if (!st->need_parsing && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO
>+        && st->codecpar->codec_id != AV_CODEC_ID_HEVC)
>+        st->need_parsing = AVSTREAM_PARSE_HEADERS;
>+
>     return 0;
> }
>
>-- 
>2.27.0.windows.1
>
>___
>ffmpeg-devel mailing list
>mailto:ffmpeg-devel@ffmpeg.org
>https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>To unsubscribe, visit link above, or email
>mailto:ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 1/2] avformat/mov: always parse video headers

2021-01-29 Thread Paul B Mahol
Why is AV1 touched?

On Fri, Jan 29, 2021 at 6:24 PM Nicolas Gaullier 
wrote:

> This is aligned with current code of matroskadec.
> Fixes field_order reported by ffprobe for MP4 H264, for example.
> ---
>  libavformat/mov.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/libavformat/mov.c b/libavformat/mov.c
> index ad0b9a58d3..b5e012190b 100644
> --- a/libavformat/mov.c
> +++ b/libavformat/mov.c
> @@ -2461,12 +2461,13 @@ static int mov_finalize_stsd_codec(MOVContext *c,
> AVIOContext *pb,
>  case AV_CODEC_ID_VP9:
>  st->need_parsing = AVSTREAM_PARSE_FULL;
>  break;
> -case AV_CODEC_ID_AV1:
> -st->need_parsing = AVSTREAM_PARSE_HEADERS;
> -break;
>  default:
>  break;
>  }
> +if (!st->need_parsing && st->codecpar->codec_type ==
> AVMEDIA_TYPE_VIDEO
> +&& st->codecpar->codec_id != AV_CODEC_ID_HEVC)
> +st->need_parsing = AVSTREAM_PARSE_HEADERS;
> +
>  return 0;
>  }
>
> --
> 2.27.0.windows.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
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/mxf: Establish register of local tags

2021-01-29 Thread Marton Balint



On Thu, 28 Jan 2021, Tomas Härdin wrote:


tor 2021-01-28 klockan 14:48 +0100 skrev Tomas Härdin:

tor 2021-01-28 klockan 08:56 +0100 skrev Marton Balint:

On Thu, 28 Jan 2021, Tomas Härdin wrote:

ons 2021-01-27 klockan 23:50 +0100 skrev Marton Balint:

On Wed, 27 Jan 2021, Tomas Härdin wrote:

There's not really anything to av_assert0() on in
mxf_lookup_local_tag(). Either way, I'm thinking replacing the return
NULL with either

   av_log(NULL, AV_LOG_PANIC, "Tried to use unregistered local tag
0x%04x\n", tag);
   abort();

or

   av_assert0(0 && "Tried to use unregistered local tag");

or maybe

   av_log(NULL, AV_LOG_PANIC, "Tried to use unregistered local tag
0x%04x\n", tag);
   av_assert0(0);

to avoid explicitly calling abort()


I think we usually do av_assert0(0) in this case. I am not sure if the
error message is particularly useful, afterall who sees it should be a
programmer and file/line is printed by assert anyway, so a comment in the
source code before the assert makes more sense to me.


Maybe av_assert0(0 && "you forgot to add a local tag to the registry")?


Here's a rebased patch that does this, with a little comment also


LGTM, 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 01/13] avfilter/drawutils: Remove remnants of old API

2021-01-29 Thread Gyan Doshi



On 30-01-2021 12:47 am, Andreas Rheinhardt wrote:

Gyan Doshi:

Are there replacements or substitutes for these?


The new API was introduced in 8ec0832743d73c5de4c4978ea5f65b54cfa07625;
ff_copy_rectangle is replaced by ff_copy_rectangle2, ff_draw_rectangle
by ff_fill_rectangle; there is no direct replacement for
ff_fill_line_with_color, as said functions allocated the lines which
none of the new functions does.


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

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

Re: [FFmpeg-devel] [PATCH 01/13] avfilter/drawutils: Remove remnants of old API

2021-01-29 Thread Andreas Rheinhardt
Gyan Doshi:
> Are there replacements or substitutes for these?
> 

The new API was introduced in 8ec0832743d73c5de4c4978ea5f65b54cfa07625;
ff_copy_rectangle is replaced by ff_copy_rectangle2, ff_draw_rectangle
by ff_fill_rectangle; there is no direct replacement for
ff_fill_line_with_color, as said functions allocated the lines which
none of the new functions does.

- Andreas

> On 29-01-2021 10:52 am, Andreas Rheinhardt wrote:
>> ff_fill_line_with_color and ff_draw_rectangle are unused since
>> 19c8f2271423281c9b876b984076a6467c455904; ff_copy_rectangle
>> is unused since 53b7a3fe081ec56c5706228eb6431bb943ad471a.
>>
>> Signed-off-by: Andreas Rheinhardt 
>> ---
>>   libavfilter/drawutils.c | 98 -
>>   libavfilter/drawutils.h | 13 --
>>   2 files changed, 111 deletions(-)
>>

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

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

Re: [FFmpeg-devel] [PATCH 01/13] avfilter/drawutils: Remove remnants of old API

2021-01-29 Thread Gyan Doshi

Are there replacements or substitutes for these?

On 29-01-2021 10:52 am, Andreas Rheinhardt wrote:

ff_fill_line_with_color and ff_draw_rectangle are unused since
19c8f2271423281c9b876b984076a6467c455904; ff_copy_rectangle
is unused since 53b7a3fe081ec56c5706228eb6431bb943ad471a.

Signed-off-by: Andreas Rheinhardt 
---
  libavfilter/drawutils.c | 98 -
  libavfilter/drawutils.h | 13 --
  2 files changed, 111 deletions(-)

diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c
index 5f4cb548f0..71fe25692c 100644
--- a/libavfilter/drawutils.c
+++ b/libavfilter/drawutils.c
@@ -77,104 +77,6 @@ int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat 
pix_fmt)
  return 0;
  }
  
-int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4],

-enum AVPixelFormat pix_fmt, uint8_t rgba_color[4],
-int *is_packed_rgba, uint8_t rgba_map_ptr[4])
-{
-uint8_t rgba_map[4] = {0};
-int i;
-const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get(pix_fmt);
-int hsub;
-
-av_assert0(pix_desc);
-
-hsub = pix_desc->log2_chroma_w;
-
-*is_packed_rgba = ff_fill_rgba_map(rgba_map, pix_fmt) >= 0;
-
-if (*is_packed_rgba) {
-pixel_step[0] = (av_get_bits_per_pixel(pix_desc))>>3;
-for (i = 0; i < 4; i++)
-dst_color[rgba_map[i]] = rgba_color[i];
-
-line[0] = av_malloc_array(w, pixel_step[0]);
-if (!line[0])
-return AVERROR(ENOMEM);
-for (i = 0; i < w; i++)
-memcpy(line[0] + i * pixel_step[0], dst_color, pixel_step[0]);
-if (rgba_map_ptr)
-memcpy(rgba_map_ptr, rgba_map, sizeof(rgba_map[0]) * 4);
-} else {
-int plane;
-
-dst_color[0] = RGB_TO_Y_CCIR(rgba_color[0], rgba_color[1], 
rgba_color[2]);
-dst_color[1] = RGB_TO_U_CCIR(rgba_color[0], rgba_color[1], 
rgba_color[2], 0);
-dst_color[2] = RGB_TO_V_CCIR(rgba_color[0], rgba_color[1], 
rgba_color[2], 0);
-dst_color[3] = rgba_color[3];
-
-for (plane = 0; plane < 4; plane++) {
-int line_size;
-int hsub1 = (plane == 1 || plane == 2) ? hsub : 0;
-
-pixel_step[plane] = 1;
-line_size = AV_CEIL_RSHIFT(w, hsub1) * pixel_step[plane];
-line[plane] = av_malloc(line_size);
-if (!line[plane]) {
-while(plane && line[plane-1])
-av_freep([--plane]);
-return AVERROR(ENOMEM);
-}
-memset(line[plane], dst_color[plane], line_size);
-}
-}
-
-return 0;
-}
-
-void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4],
-   uint8_t *src[4], int pixelstep[4],
-   int hsub, int vsub, int x, int y, int w, int h)
-{
-int i, plane;
-uint8_t *p;
-
-for (plane = 0; plane < 4 && dst[plane]; plane++) {
-int hsub1 = plane == 1 || plane == 2 ? hsub : 0;
-int vsub1 = plane == 1 || plane == 2 ? vsub : 0;
-int width  = AV_CEIL_RSHIFT(w, hsub1);
-int height = AV_CEIL_RSHIFT(h, vsub1);
-
-p = dst[plane] + (y >> vsub1) * dst_linesize[plane];
-for (i = 0; i < height; i++) {
-memcpy(p + (x >> hsub1) * pixelstep[plane],
-   src[plane], width * pixelstep[plane]);
-p += dst_linesize[plane];
-}
-}
-}
-
-void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4],
-   uint8_t *src[4], int src_linesize[4], int pixelstep[4],
-   int hsub, int vsub, int x, int y, int y2, int w, int h)
-{
-int i, plane;
-uint8_t *p;
-
-for (plane = 0; plane < 4 && dst[plane]; plane++) {
-int hsub1 = plane == 1 || plane == 2 ? hsub : 0;
-int vsub1 = plane == 1 || plane == 2 ? vsub : 0;
-int width  = AV_CEIL_RSHIFT(w, hsub1);
-int height = AV_CEIL_RSHIFT(h, vsub1);
-
-p = dst[plane] + (y >> vsub1) * dst_linesize[plane];
-for (i = 0; i < height; i++) {
-memcpy(p + (x >> hsub1) * pixelstep[plane],
-   src[plane] + src_linesize[plane]*(i+(y2>>vsub1)), width * 
pixelstep[plane]);
-p += dst_linesize[plane];
-}
-}
-}
-
  int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned 
flags)
  {
  const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
diff --git a/libavfilter/drawutils.h b/libavfilter/drawutils.h
index b999d70e55..2ca2475585 100644
--- a/libavfilter/drawutils.h
+++ b/libavfilter/drawutils.h
@@ -30,19 +30,6 @@
  
  int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt);
  
-int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w,

-uint8_t dst_color[4],
-enum AVPixelFormat pix_fmt, uint8_t rgba_color[4],
-int *is_packed_rgba, uint8_t 

Re: [FFmpeg-devel] [PATCH 3/3] avformat/aiffdec: Check size before subtraction in get_aiff_header()

2021-01-29 Thread Michael Niedermayer
On Wed, Nov 11, 2020 at 05:01:02PM +0100, Michael Niedermayer wrote:
> Fixes: Infinite loop
> Fixes: 
> 27235/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-5761398380167168
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/aiffdec.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

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

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides


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 0/2] Enhance progressive content detection

2021-01-29 Thread Nicolas Gaullier
These are two completely independant patchs.
My use case is that I have many progressive materials and only a few interlaced,
and I just want to avoid inserting a deinterlacing filter if it is not required.

Thank you for the review
Nicolas

Nicolas Gaullier (2):
  avformat/mov: always parse video headers
  avcodec/hevc: set field_order=progressive when SPS makes it straightforward

 libavcodec/hevcdec.c | 2 ++
 libavformat/mov.c| 7 ---
 2 files changed, 6 insertions(+), 3 deletions(-)

-- 
2.27.0.windows.1

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

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

[FFmpeg-devel] [PATCH 2/2] avcodec/hevc: set field_order=progressive when SPS makes it straightforward

2021-01-29 Thread Nicolas Gaullier
---
 libavcodec/hevcdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 92eb888033..2eaa683399 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -330,6 +330,8 @@ static void export_stream_params(HEVCContext *s, const 
HEVCSPS *sps)
 avctx->has_b_frames= sps->temporal_layer[sps->max_sub_layers - 
1].num_reorder_pics;
 avctx->profile = sps->ptl.general_ptl.profile_idc;
 avctx->level   = sps->ptl.general_ptl.level_idc;
+if (sps->ptl.general_ptl.progressive_source_flag && 
!sps->ptl.general_ptl.interlaced_source_flag)
+avctx->field_order = AV_FIELD_PROGRESSIVE;
 
 ff_set_sar(avctx, sps->vui.sar);
 
-- 
2.27.0.windows.1

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

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

[FFmpeg-devel] [PATCH 1/2] avformat/mov: always parse video headers

2021-01-29 Thread Nicolas Gaullier
This is aligned with current code of matroskadec.
Fixes field_order reported by ffprobe for MP4 H264, for example.
---
 libavformat/mov.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index ad0b9a58d3..b5e012190b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2461,12 +2461,13 @@ static int mov_finalize_stsd_codec(MOVContext *c, 
AVIOContext *pb,
 case AV_CODEC_ID_VP9:
 st->need_parsing = AVSTREAM_PARSE_FULL;
 break;
-case AV_CODEC_ID_AV1:
-st->need_parsing = AVSTREAM_PARSE_HEADERS;
-break;
 default:
 break;
 }
+if (!st->need_parsing && st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO
+&& st->codecpar->codec_id != AV_CODEC_ID_HEVC)
+st->need_parsing = AVSTREAM_PARSE_HEADERS;
+
 return 0;
 }
 
-- 
2.27.0.windows.1

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

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

Re: [FFmpeg-devel] [PATCH 1/3] avformat/utils: Use av_sat_sub64() in max_analyze_duration check

2021-01-29 Thread Michael Niedermayer
On Wed, Nov 11, 2020 at 05:01:00PM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 9223372036854710272 - -541165944832 cannot be 
> represented in type 'long'
> Fixes: 
> 27000/clusterfuzz-testcase-minimized-ffmpeg_dem_IVF_fuzzer-5643670608674816
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/utils.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)

will apply

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

I know you won't believe me, but the highest form of Human Excellence is
to question oneself and others. -- Socrates


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

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

Re: [FFmpeg-devel] [PATCH 1/4] avformat/asfdec_o: Check size vs. offset in detect_unknown_subobject()

2021-01-29 Thread Michael Niedermayer
On Tue, Jan 12, 2021 at 10:51:13PM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 2314885530818453566 + 7503032301549264928 
> cannot be represented in type 'long'
> Fixes: 
> 26639/clusterfuzz-testcase-minimized-ffmpeg_dem_ASF_O_fuzzer-6024222100684800
> 
> Alternatively this could be ignored but then the end condition of the loop
> would be hard to reach as avio_tell() is int64_t
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/asfdec_o.c | 3 +++
>  1 file changed, 3 insertions(+)

will apply rest of this patchset

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

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


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

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

Re: [FFmpeg-devel] [PATCH 2/3] avcodec/cfhd: check peak.offset

2021-01-29 Thread Michael Niedermayer
On Sun, Dec 20, 2020 at 10:15:23PM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: -2147483648 - 4 cannot be represented in type 
> 'int'
> Fixes: 
> 26907/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CFHD_fuzzer-5746202330267648
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/cfhd.c | 6 ++
>  1 file changed, 6 insertions(+)

will apply

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

Democracy is the form of government in which you can choose your dictator


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

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

Re: [FFmpeg-devel] [PATCH 1/5] avformat/tedcaptionsdec: Check for overflow in parse_int()

2021-01-29 Thread Michael Niedermayer
On Sun, Nov 08, 2020 at 12:17:06AM +0100, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 111 * 10 cannot be 
> represented in type 'long'
> Fixes: 
> 26892/clusterfuzz-testcase-minimized-ffmpeg_dem_TEDCAPTIONS_fuzzer-5756045055754240
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/tedcaptionsdec.c | 2 ++
>  1 file changed, 2 insertions(+)

will apply

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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


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 v3] flac: add GIF image support

2021-01-29 Thread leo60228
The FLAC specification requires GIF images to contain their number of
colors. While I can't find a specific reference to that effect, I'm
assuming that's why GIF images were previously unsupported. This was
implemented by just writing AVPALETTE_COUNT for paletted images.
---
This version no longer includes a changelog entry or accidentally adds a
newline to existing code in flac_write_picture. This is identical to v2
except for fixing a mistake while submitting, sorry about that.

 libavformat/flacenc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c
index 1c983486aa..c9834b7d93 100644
--- a/libavformat/flacenc.c
+++ b/libavformat/flacenc.c
@@ -155,7 +155,10 @@ static int flac_write_picture(struct AVFormatContext *s, 
AVPacket *pkt)
 avio_wb32(pb, av_get_bits_per_pixel(pixdesc));
 else
 avio_wb32(pb, 0);
-avio_wb32(pb, 0);
+if (st->codecpar->format == AV_PIX_FMT_PAL8)
+avio_wb32(pb, AVPALETTE_COUNT);
+else
+avio_wb32(pb, 0);
 
 avio_wb32(pb, pkt->size);
 avio_write(pb, pkt->data, pkt->size);
@@ -218,9 +221,6 @@ static int flac_init(struct AVFormatContext *s)
 if (!(st->disposition & AV_DISPOSITION_ATTACHED_PIC)) {
 av_log(s, AV_LOG_WARNING, "Video stream #%d is not an attached 
picture. Ignoring\n", i);
 continue;
-} else if (st->codecpar->codec_id == AV_CODEC_ID_GIF) {
-av_log(s, AV_LOG_ERROR, "GIF image support is not 
implemented.\n");
-return AVERROR_PATCHWELCOME;
 } else if (!c->write_header) {
 av_log(s, AV_LOG_ERROR, "Can't write attached pictures without 
a header.\n");
 return AVERROR(EINVAL);
-- 
2.28.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] flac: add GIF image support

2021-01-29 Thread leo60228
The FLAC specification requires GIF images to contain their number of
colors. While I can't find a specific reference to that effect, I'm
assuming that's why GIF images were previously unsupported. This was
implemented by just writing AVPALETTE_COUNT for paletted images.
---
 libavformat/flacenc.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c
index 1c983486aa..c9834b7d93 100644
--- a/libavformat/flacenc.c
+++ b/libavformat/flacenc.c
@@ -155,7 +155,10 @@ static int flac_write_picture(struct AVFormatContext *s, 
AVPacket *pkt)
 avio_wb32(pb, av_get_bits_per_pixel(pixdesc));
 else
 avio_wb32(pb, 0);
-avio_wb32(pb, 0);
+if (st->codecpar->format == AV_PIX_FMT_PAL8)
+avio_wb32(pb, AVPALETTE_COUNT);
+else
+avio_wb32(pb, 0);
 
 avio_wb32(pb, pkt->size);
 avio_write(pb, pkt->data, pkt->size);
@@ -218,9 +221,6 @@ static int flac_init(struct AVFormatContext *s)
 if (!(st->disposition & AV_DISPOSITION_ATTACHED_PIC)) {
 av_log(s, AV_LOG_WARNING, "Video stream #%d is not an attached 
picture. Ignoring\n", i);
 continue;
-} else if (st->codecpar->codec_id == AV_CODEC_ID_GIF) {
-av_log(s, AV_LOG_ERROR, "GIF image support is not 
implemented.\n");
-return AVERROR_PATCHWELCOME;
 } else if (!c->write_header) {
 av_log(s, AV_LOG_ERROR, "Can't write attached pictures without 
a header.\n");
 return AVERROR(EINVAL);
-- 
2.28.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 v2] flac: add GIF image support

2021-01-29 Thread leo60228
This patch no longer makes an (accidental) change to adjacent code and
isn't included in the changelog.

___
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] libavformat: add librist protocol

2021-01-29 Thread Paul B Mahol
Will apply soon.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 01/13] avfilter/drawutils: Remove remnants of old API

2021-01-29 Thread Paul B Mahol
LGTM
___
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 6/6] avcodec/aacps_fixed_tablegen: Don't include config.h

2021-01-29 Thread Lynne
Jan 28, 2021, 17:26 by andreas.rheinha...@gmail.com:

> It is only valid for the target, not the host and therefore it must not
> be included when building the tables when hardcoded tables are enabled.
>
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/aacps_fixed_tablegen.h| 6 +-
>  libavcodec/aacps_tablegen_template.c | 1 +
>  2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/aacps_fixed_tablegen.h 
> b/libavcodec/aacps_fixed_tablegen.h
> index 356fb8b293..8fb1da5076 100644
> --- a/libavcodec/aacps_fixed_tablegen.h
> +++ b/libavcodec/aacps_fixed_tablegen.h
> @@ -36,8 +36,12 @@
>  #else
>  #include "libavutil/common.h"
>  #include "libavutil/mathematics.h"
> -#include "libavutil/mem.h"
> +#ifdef BUILD_TABLES
> +#undef DECLARE_ALIGNED
> +#define DECLARE_ALIGNED(align, type, variable) type variable
> +#else
>  #include "libavutil/mem_internal.h"
> +#endif
>  
>  #include "aac_defines.h"
>  #include "libavutil/softfloat.h"
> diff --git a/libavcodec/aacps_tablegen_template.c 
> b/libavcodec/aacps_tablegen_template.c
> index 341bd44409..e70edf884b 100644
> --- a/libavcodec/aacps_tablegen_template.c
> +++ b/libavcodec/aacps_tablegen_template.c
> @@ -21,6 +21,7 @@
>  */
>  
>  #include 
> +#define BUILD_TABLES
>  #define CONFIG_HARDCODED_TABLES 0
>  #include "aac_defines.h" 
>

LGTM (and to all AAC patches from the set that I might have forgotten)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 1/6] avcodec/aac_defines: Make macro more general

2021-01-29 Thread Lynne
Jan 28, 2021, 17:26 by andreas.rheinha...@gmail.com:

> The floating point AAC decoder shares lots of stuff (mainly tables)
> with other components; this is not so much true for the fixed point
> AAC decoder: There are tables for which the fixed point decoder is the
> only user whereas the floating point analogue is shared with other
> components. This can be exploited to make the fixed point tables static
> and because this has only been done for several KBD tables, the macro is
> designed for them. This commit makes it more general.
>
> Signed-off-by: Andreas Rheinhardt 
>

LGTM, could you push this along with the next AAC patch?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 3/6] avcodec/aacdec_fixed: Move fixed-point sinewin tables to its only user

2021-01-29 Thread Lynne
Jan 28, 2021, 17:26 by andreas.rheinha...@gmail.com:

> The fixed-point AAC decoder is the only user of the fixed-point sinewin
> tables from sinewin; and it only uses a few of them (about 10% when
> counting by size). This means that guarding initializing these tables by
> an AVOnce (as done in 3719122065863f701026632f610175980d42b05a) is
> unnecessary for them. Furthermore the array of pointers to the
> individual arrays is also unneeded.
>
> Therefore this commit moves these tables directly into aacdec_fixed.c;
> this is done by ridding the original sinewin.h and sinewin_tablegen.h
> headers completely of any fixed-point code at the cost of a bit of
> duplicated code (the alternative is an ugly ifdef-mess).
>
> This saves about 58KB from the binary when using hardcoded tables (as
> these tables are hardcoded in this scenario); when not using hardcoded
> tables, most of these savings only affect the .bss segment, but the rest
> (< 1KB) contains relocations (i.e. savings in .data.rel.ro).
>
> Signed-off-by: Andreas Rheinhardt 
> ---
>  configure  |  2 +-
>  libavcodec/Makefile|  4 +-
>  libavcodec/aacdec_fixed.c  |  2 +-
>  libavcodec/aacdec_template.c   | 27 +--
>  libavcodec/sinewin.c   |  1 -
>  libavcodec/sinewin.h   | 13 ++---
>  libavcodec/sinewin_fixed.c | 21 
>  libavcodec/sinewin_fixed_tablegen.c| 22 -
>  libavcodec/sinewin_fixed_tablegen.h| 67 ++
>  libavcodec/sinewin_tablegen.c  | 25 +-
>  libavcodec/sinewin_tablegen.h  | 33 +
>  libavcodec/sinewin_tablegen_template.c | 55 -
>  12 files changed, 143 insertions(+), 129 deletions(-)
>  delete mode 100644 libavcodec/sinewin_fixed.c
>  create mode 100644 libavcodec/sinewin_fixed_tablegen.h
>  delete mode 100644 libavcodec/sinewin_tablegen_template.c
>

LGTM, could you go ahead and push this whenever possible?
___
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 02/13] avcodec/fft_template: Avoid useless function

2021-01-29 Thread Lynne
Jan 29, 2021, 06:22 by andreas.rheinha...@gmail.com:

> ff_init_ff_cos_tabs is only used for the floating point FFT and only
> if hardcoded tables are disabled.
>
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/fft.h  | 16 
>  libavcodec/fft_template.c | 10 --
>  2 files changed, 12 insertions(+), 14 deletions(-)
>

LGTM

___
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 03/13] avcodec/vorbis_data: Move encoder-related table to its only user

2021-01-29 Thread Lynne
Jan 29, 2021, 06:22 by andreas.rheinha...@gmail.com:

> Said table was unused in case libvorbis was disabled.
>
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavcodec/libvorbisenc.c | 13 -
>  libavcodec/vorbis.h   |  1 -
>  libavcodec/vorbis_data.c  | 11 ---
>  3 files changed, 12 insertions(+), 13 deletions(-)
>

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