Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 features support

2020-06-30 Thread hydra3333
> -Original Message-
> From: ffmpeg-devel  On Behalf Of Soft Works
> Sent: Wednesday, July 1, 2020 1:34 PM
> To: Roman Arzumanyan ; FFmpeg development discussions 
> and patches 
> Cc: Yogender Gupta 
> Subject: Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 
> features support
>
> > From: Roman Arzumanyan 
> > Sent: Tuesday, June 30, 2020 10:23 PM
> > To: Soft Works ; FFmpeg development discussions 
> > and patches 
> > Cc: Yogender Gupta 
> > Subject: RE: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 
> > features support
> > 
> > Hello, nice to meet you.
> > 
> > >Wouldn't it make sense to transition from compile time version checks to 
> > >runtime checking?
> > 
> > Video Codec SDK headers are not included into ffmpeg 'as is' but using the 
> > nvcodec-headers project instead.
>
> I know 
> (https://github.com/FFmpeg/nv-codec-headers/commit/72f8b4bc6a2225c6fec6c046bb45c4a6be391f9f)
>
> > This is community-driven project which aims to work around the licensing 
> > policies.
>
> Talking about this rarely ends well, 
> > So we can't influence ffmpeg development too much and only supports it's 
> > development with patches.
>
> I'm sure, all contributions are welcome, small and big ones ;-)
>
> > Changing compile-time checks with runtime checks is a big thing to do and 
> > in order to convince community to accept such changes we need to have very 
> > solid background.
>
> I know that it's not a small thing and it will surely be better to discuss 
> this first (not with me...).
>
> Anyway, great to see Nvidia participating again!
>
> softworkz
>

Oh. Thank you again.

In here 
https://github.com/FFmpeg/nv-codec-headers/commit/5ee2ae591f74f53bd6028344f8690f1558a1f17a
it says this
NV_ENC_MULTI_PASS   multiPass;
/**< [in]: This flag is used to enable multi-pass encoding for a given 
::NV_ENC_PARAMS_RC_MODE. This flag is not valid for H264 and HEVC MEOnly mode */

So, just confirming, the new multi-pass is valid only for h265/hevc ?

And I see this:
NV_ENC_LEVEL_H264_5 = 50,
NV_ENC_LEVEL_H264_51= 51,
NV_ENC_LEVEL_H264_52= 52,

NV_ENC_LEVEL_H264_60= 60,
NV_ENC_LEVEL_H264_61= 61,
NV_ENC_LEVEL_H264_62= 62,

NV_ENC_LEVEL_HEVC_1 = 30,
NV_ENC_LEVEL_HEVC_2 = 60,
which seems to indicate h.264 levels up to 6.2 are possible - however the 
ffmpeg nvenc code somehow has a hard limit of 5.1 (even though 5.2 is already 
in the header).
I am not sure what other hard limits or exclusions may apply (eg cq?) ?

___
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] avdevice/xcbgrab: Add select_region option.

2020-06-30 Thread Andriy Gelman
Hi Omar,

Thanks for your patch.

nit: please remove "." at the end of the commit title

On Sun, 28. Jun 13:26, Omar Emara wrote:
> This patch adds a select_region option to the xcbgrab input device.
> If set to 1, the user will be prompted to select the grabbing area
> graphically by clicking and dragging. A rectangle will be drawn to
> mark the grabbing area. A single click with no dragging will select
> the whole screen. The option overwrites the video_size, grab_x, and
> grab_y options if set by the user.
> 
> For testing, just set the select_region option as follows:
> 
> ffmpeg -f x11grab -select_region 1 -i :0.0 output.mp4
> 
> The drawing happens directly on the root window using standard rubber
> banding techniques, so it is very efficient and doesn't depend on any
> X extensions or compositors.
> 
> Signed-off-by: Omar Emara 
> ---
>  doc/indevs.texi   |   7 +++
>  libavdevice/xcbgrab.c | 133 ++
>  2 files changed, 140 insertions(+)
> 
> diff --git a/doc/indevs.texi b/doc/indevs.texi
> index 6f5afaf344..b5df111801 100644
> --- a/doc/indevs.texi
> +++ b/doc/indevs.texi
> @@ -1478,6 +1478,13 @@ ffmpeg -f x11grab -framerate 25 -video_size cif -i 
> :0.0+10,20 out.mpg
>  @subsection Options
>  
>  @table @option
> +@item select_region
> +Specify whether to select the grabbing area graphically using the pointer.
> +A value of @code{1} prompts the user to select the grabbing area graphically
> +by clicking and dragging. A single click with no dragging will select the
> +whole screen. This option overwrites the @var{video_size}, @var{grab_x},
> +and @var{grab_y} options. Default value is @code{0}.
> +
>  @item draw_mouse
>  Specify whether to draw the mouse pointer. A value of @code{0} specifies
>  not to draw the pointer. Default value is @code{1}.
> diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c
> index 6f6b2dbf15..71259b986c 100644
> --- a/libavdevice/xcbgrab.c
> +++ b/libavdevice/xcbgrab.c
> @@ -22,6 +22,7 @@
>  #include "config.h"
>  
>  #include 

> +#include 

this include is not used

>  #include 
>  
>  #if CONFIG_LIBXCB_XFIXES
> @@ -69,6 +70,7 @@ typedef struct XCBGrabContext {
>  int show_region;
>  int region_border;
>  int centered;
> +int select_region;
>  
>  const char *framerate;
>  
> @@ -92,6 +94,7 @@ static const AVOption options[] = {
>  { "centered", "Keep the mouse pointer at the center of grabbing region 
> when following.", 0, AV_OPT_TYPE_CONST, { .i64 = -1 }, INT_MIN, INT_MAX, D, 
> "follow_mouse" },
>  { "show_region", "Show the grabbing region.", OFFSET(show_region), 
> AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
>  { "region_border", "Set the region border thickness.", 
> OFFSET(region_border), AV_OPT_TYPE_INT, { .i64 = 3 }, 1, 128, D },
> +{ "select_region", "Select the grabbing region graphically using the 
> pointer.", OFFSET(select_region), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, D },
>  { NULL },
>  };
>  
> @@ -668,6 +671,123 @@ static void setup_window(AVFormatContext *s)
>  draw_rectangle(s);
>  }
>  
> +#define CROSSHAIR_CURSOR 34
> +

> +typedef struct {
> +int16_t x;
> +int16_t y;
> +} Position;
> +

you can just reuse xcb_point_t struct 

> +static xcb_rectangle_t rectangle_from_corners(Position *corner_a, Position 
> *corner_b) {
> +xcb_rectangle_t rectangle;

> +if (corner_a->x < corner_b->x) {
> +rectangle.x = corner_a->x;
> +rectangle.width = corner_b->x - corner_a->x;
> +} else {
> +rectangle.x = corner_b->x;
> +rectangle.width = corner_a->x - corner_b->x;
> +}
> +if (corner_a->y < corner_b->y) {
> +rectangle.y = corner_a->y;
> +rectangle.height = corner_b->y - corner_a->y;
> +} else {
> +rectangle.y = corner_b->y;
> +rectangle.height = corner_a->y - corner_b->y;
> +}

can be simplified:
rectangle.x = FFMIN(corner_a->x, corner_b->x);
rectangle.width = FFABS(corner_a->x - corner_b->x);
...

> +return rectangle;
> +}
> +
> +static xcb_rectangle_t select_region(xcb_connection_t *connection,
> + xcb_screen_t *screen) {
> +int done = 0;
> +int was_drawn = 0;
> +int was_pressed = 0;
> +xcb_cursor_t cursor;
> +xcb_font_t cursor_font;
> +Position press_position;
> +xcb_generic_event_t *event;

> +xcb_rectangle_t old_rectangle;

zero initialize old_rectangle because 
event = xcb_wait_for_event(connection) can return NULL in the while loop below

> +
> +xcb_window_t root_window = screen->root;
> +xcb_gcontext_t graphics_context = xcb_generate_id(connection);
> +uint32_t graphics_context_mask = XCB_GC_FUNCTION | XCB_GC_SUBWINDOW_MODE;
> +uint32_t graphics_context_values[] = {XCB_GX_INVERT,
> +  
> XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS};

please use same style as other functions
s/graphics_context/gc
s/graphics_context_mask/mask

Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 features support

2020-06-30 Thread Soft Works
> From: Roman Arzumanyan  
> Sent: Tuesday, June 30, 2020 10:23 PM
> To: Soft Works ; FFmpeg development discussions and 
> patches 
> Cc: Yogender Gupta 
> Subject: RE: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 
> features support
> 
> Hello, nice to meet you.
> 
> >Wouldn't it make sense to transition from compile time version checks to 
> >runtime checking?
> 
> Video Codec SDK headers are not included into ffmpeg 'as is' but using the 
> nvcodec-headers project instead.

I know 
(https://github.com/FFmpeg/nv-codec-headers/commit/72f8b4bc6a2225c6fec6c046bb45c4a6be391f9f)

> This is community-driven project which aims to work around the licensing 
> policies.

Talking about this rarely ends well, 

> So we can't influence ffmpeg development too much and only supports it's 
> development with patches.

I'm sure, all contributions are welcome, small and big ones ;-)

> Changing compile-time checks with runtime checks is a big thing to do and in 
> order to convince community to accept such changes we need to have very solid 
> background.

I know that it's not a small thing and it will surely be better to discuss this 
first (not with me...).

Anyway, great to see Nvidia participating again!

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

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

Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 features support

2020-06-30 Thread hydra3333
> Hello,
>
> This patch adds Video Codec SDK 10 features support:
> 
>   *   Presets and tuning info
>   *   Multipass encode modes
>   *   Low Delay Key Frame Scale

Hello and thank you for this patch.  Possibly this post belongs in
ffmepg-user.

Per the above archive post above (
http://ffmpeg.org/pipermail/ffmpeg-devel/2020-June/265441.html )

Perhaps add a link and/or examples to be added to the internal help ?

1. In this thread/patch, what's the difference between options
slow, P7, and hq ?

Which is the "best" quality (some all say hq and a couple also say
multi-pass eg 2-pass) ?

2. How to combine and use the new options separately and/or in combination
with these, to achieve "best" quality ?
multipass 
fullres
...
-preset slow 
-2pass 1 
-rc:v vbr_hq

3. is there a link to a table of which models of cards have what features
enabled and what the target objectives are for each option, perhaps even a
ranking of quality/speed ?

Thanks

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

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

Re: [FFmpeg-devel] [PATCH v2] ffprobe: Allow unknown format private AVOptions

2020-06-30 Thread Marton Balint



On Sun, 28 Jun 2020, Derek Buitenhuis wrote:


This useful, because by ffprobe's very nature, you use it to probe
a file and find out what it is. Requiring every format private option
to be known to the demuxer forces one to run ffprobe twice, if one
wants to use ffprobe in a generic way.

For example, say one wants to probe all user-uploaded files, while
also ignoring edit lists for any MP4s that are uploaded. Currently,
you'd have to run ffprobe twice: once to identify the format, and
once again to actually probe the metadata you want. After this
patch, you could set -ignore_editlist 1 on every call and only
probe once.

Signed-off-by: Derek Buitenhuis 
---
Changed to just be the main behavior instead of behind an option,
as Michael suggested.

Didn't really know what would be added to ffprobe.texi, though, since
this is no longer an option.
---
fftools/ffprobe.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 5515e1b31b..61191add6b 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -2879,10 +2879,8 @@ static int open_input_file(InputFile *ifile, const char 
*filename,
ifile->fmt_ctx = fmt_ctx;
if (scan_all_pmts_set)
av_dict_set(_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE);
-if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) {
-av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key);
-return AVERROR_OPTION_NOT_FOUND;
-}
+if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX)))
+av_log(NULL, AV_LOG_WARNING, "Option %s skipped - not known to 
demuxer.\n", t->key);


This only logs the first skipped option. I think it is best if you 
iterate through all of them.


Regards,
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] Ticket #8750 Add inline function for the vec_xl intrinsic in non-VSX environments

2020-06-30 Thread Michael Niedermayer
On Tue, Jun 30, 2020 at 12:06:10PM +, Chip Kerchner wrote:
>  yuv2rgb_altivec.c |   10 ++
>  1 file changed, 10 insertions(+)
> 42288c448d2dadce913a969945ee36afc510d200  ffmpeg_altivec_yuv2rgb_novsx.patch
> diff --git a/libswscale/ppc/yuv2rgb_altivec.c 
> b/libswscale/ppc/yuv2rgb_altivec.c
> index 536545293d..0cd4a1db13 100644
> --- a/libswscale/ppc/yuv2rgb_altivec.c
> +++ b/libswscale/ppc/yuv2rgb_altivec.c

it seems git here doesnt like this attachment
Applying: Ticket #8750 Add inline function for the vec_xl intrinsic in non-VSX 
environments
error: corrupt patch at line 8
error: could not build fake ancestor

But the __VSX__ check looks wrong, nothing else checks for vsx that way

configure checks for vsx and there is HAVE_VSX, pleaase check if that works
too (iam not ppc maintainer and havnt tested. this suggestion is just from
looking and guessing)

Thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus


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 v4 1/2] libavcodec/pgxdec: Add PGX decoder

2020-06-30 Thread Michael Niedermayer
On Tue, Jun 30, 2020 at 08:31:39AM +0530, Gautam Ramakrishnan wrote:
> On Tue, Jun 30, 2020 at 5:49 AM Michael Niedermayer
>  wrote:
[...]
> >
> >
> > > +if (temp > INT_MAX)
> > > +return -1;
> > > +ret = temp;
> > > +}
> > > +
> > > +if (ret >= 0)
> > > +return ret;
> > > +return -1;
> > > +}
> > > +
> >
> > > +static int ff_pgx_decode_header(AVCodecContext *avctx, PGXContext * s,
> >
> > why does this have a ff_ prefix ?
> I'll remove it. I was following pnmdec.c while writing this. Does the ff 
> prefix
> indicate that it is a non-static function?

non statics need a ff, av, avpriv, ... prefix
each has a slightly different case to be used in,
see https://ffmpeg.org/developer.html#Naming-conventions

thx

[...]
-- 
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 4/4] avcodec/mpc: Fix multiple numerical overflows in ff_mpc_dequantize_and_synth()

2020-06-30 Thread Michael Niedermayer
Fixes: -2.4187e+09 is outside the range of representable values of type 'int'
Fixes: signed integer overflow: -14512205 + -2147483648 cannot be represented 
in type 'int'
Fixes: 
20492/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPC7_fuzzer-5747263166480384
Fixes: 
23528/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPC7_fuzzer-5747263166480384

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

diff --git a/libavcodec/mpc.c b/libavcodec/mpc.c
index 6cf9b9d520..e56b608d8c 100644
--- a/libavcodec/mpc.c
+++ b/libavcodec/mpc.c
@@ -75,17 +75,17 @@ void ff_mpc_dequantize_and_synth(MPCContext * c, int 
maxband, int16_t **out,
 j = 0;
 mul = (mpc_CC+1)[bands[i].res[ch]] * 
mpc_SCF[bands[i].scf_idx[ch][0] & 0xFF];
 for(; j < 12; j++)
-c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
+c->sb_samples[ch][j][i] = av_clipf(mul * c->Q[ch][j + 
off], INT32_MIN, INT32_MAX);
 mul = (mpc_CC+1)[bands[i].res[ch]] * 
mpc_SCF[bands[i].scf_idx[ch][1] & 0xFF];
 for(; j < 24; j++)
-c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
+c->sb_samples[ch][j][i] = av_clipf(mul * c->Q[ch][j + 
off], INT32_MIN, INT32_MAX);
 mul = (mpc_CC+1)[bands[i].res[ch]] * 
mpc_SCF[bands[i].scf_idx[ch][2] & 0xFF];
 for(; j < 36; j++)
-c->sb_samples[ch][j][i] = mul * c->Q[ch][j + off];
+c->sb_samples[ch][j][i] = av_clipf(mul * c->Q[ch][j + 
off], INT32_MIN, INT32_MAX);
 }
 }
 if(bands[i].msf){
-int t1, t2;
+unsigned t1, t2;
 for(j = 0; j < SAMPLES_PER_BAND; j++){
 t1 = c->sb_samples[0][j][i];
 t2 = c->sb_samples[1][j][i];
-- 
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 3/4] avcodec/apedec: Fix undefined integer overflow with 24bit

2020-06-30 Thread Michael Niedermayer
Fixes: signed integer overflow: 8683744 * 256 cannot be represented in type 
'int'
Fixes: 
23527/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_APE_fuzzer-5679885932822528

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

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index a81767307a..c76c0509df 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -1569,7 +1569,7 @@ static int ape_decode_frame(AVCodecContext *avctx, void 
*data,
 for (ch = 0; ch < s->channels; ch++) {
 sample24 = (int32_t *)frame->data[ch];
 for (i = 0; i < blockstodecode; i++)
-*sample24++ = s->decoded[ch][i] * 256;
+*sample24++ = s->decoded[ch][i] * 256U;
 }
 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/4] avcodec/hcadec: Check total_band_count against imdct_in size

2020-06-30 Thread Michael Niedermayer
Fixes: index 128 out of bounds for type 'float [128]'
Fixes: 
23465/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HCA_fuzzer-5089866596745216

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

diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c
index 28e7d07cec..11cb157277 100644
--- a/libavcodec/hcadec.c
+++ b/libavcodec/hcadec.c
@@ -157,6 +157,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
 } else
 return AVERROR_INVALIDDATA;
 
+if (c->total_band_count > FF_ARRAY_ELEMS(c->ch->imdct_in))
+return AVERROR_INVALIDDATA;
+
+
 while (get_bits_left(gb) >= 32) {
 chunk = get_bits_long(gb, 32);
 if (chunk == MKBETAG('v', 'b', 'r', 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".

[FFmpeg-devel] [PATCH 1/4] avcodec/loco: Fix integer overflow with large values from loco_get_rice()

2020-06-30 Thread Michael Niedermayer
Fixes: signed integer overflow: 155 + 2147483647 cannot be represented in type 
'int'
Fixes: 
23421/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LOCO_fuzzer-5652849097965568

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

diff --git a/libavcodec/loco.c b/libavcodec/loco.c
index d0cedf577d..25dd1575ba 100644
--- a/libavcodec/loco.c
+++ b/libavcodec/loco.c
@@ -131,7 +131,7 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, 
int width, int heigh
  int stride, const uint8_t *buf, int buf_size)
 {
 RICEContext rc;
-int val;
+unsigned val;
 int ret;
 int i, j;
 
-- 
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] avcodec/nvenc: Video Codec SDK 10 features support

2020-06-30 Thread Roman Arzumanyan
Hello, nice to meet you.

>Wouldn't it make sense to transition from compile time version checks to 
>runtime checking?
Video Codec SDK headers are not included into ffmpeg 'as is' but using the 
nvcodec-headers project instead.
This is community-driven project which aims to work around the licensing 
policies.
So we can't influence ffmpeg development too much and only supports it's 
development with patches.
Changing compile-time checks with runtime checks is a big thing to do and in 
order to convince community to accept such changes we need to have very solid 
background.


От: Soft Works 
Отправлено: 30 июня 2020 г. 17:35
Кому: FFmpeg development discussions and patches ; 
Roman Arzumanyan 
Копия: Yogender Gupta 
Тема: RE: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 features 
support

External email: Use caution opening links or attachments


> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Roman Arzumanyan
> Sent: Tuesday, June 30, 2020 4:08 PM
> To: ffmpeg-devel@ffmpeg.org; timo 
> Cc: Yogender Gupta 
> Subject: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10
> features support
>
> Hello,
>
> This patch adds Video Codec SDK 10 features support:
>
>   *   Presets and tuning info
>   *   Multipass encode modes
>   *   Low Delay Key Frame Scale

Hi Roman, Yogender,

great to see somebody from Nvidia here. I think it's been a while.. :-)

I have a rather general question: Wouldn't it make sense to transition
from compile time version checks to runtime checking?
(like Intel does..)

We're currently stuck at SDK 8.1 because otherwise it would break
functionality for customers having devices for which no newer drivers
are available.

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

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

[FFmpeg-devel] [PATCH v3] avcodec/libaomenc.c: Add super-resolution options to libaom wrapper

2020-06-30 Thread Wang Cao
From: Wang Cao 

Signed-off-by: Wang Cao 
---
 doc/encoders.texi  | 36 +
 libavcodec/libaomenc.c | 46 ++
 libavcodec/version.h   |  2 +-
 3 files changed, 83 insertions(+), 1 deletion(-)

diff --git a/doc/encoders.texi b/doc/encoders.texi
index 17a0f4c821..80052763db 100644
--- a/doc/encoders.texi
+++ b/doc/encoders.texi
@@ -1599,6 +1599,42 @@ Enable the use of global motion for block prediction. 
Default is true.
 Enable block copy mode for intra block prediction. This mode is
 useful for screen content. Default is true.
 
+@item superres-mode (@emph{mode})
+Select super-resolution mode.
+
+@table @option
+@item none (@emph{0})
+No frame superres allowed.
+
+@item fixed (@emph{1})
+All frames are coded at the specified scale and super-resolved.
+
+@item random (@emph{2})
+All frames are coded at a random scale and super-resolved.
+
+@item qthresh (@emph{3})
+Superres scale for a frame is determined based on q_index.
+
+@item auto (@emph{4})
+Automatically select superres for appropriate frames.
+@end table
+
+@item superres_denominator
+The denominator for superres to use when @option{superres-mode} is 
@option{fixed}.
+Valid value ranges from 8 to 16.
+
+@item superres_kf_denominator
+The denominator for superres to use on key frames when
+@option{superres-mode} is @option{fixed}. Valid value ranges from 8 to 16.
+
+@item superres_qthresh
+The q level threshold after which superres is used when @option{superres-mode}
+is @option{qthresh}. Valid value ranges from 1 to 63.
+
+@item superres_kf_qthresh
+The q level threshold after which superres is used for key frames when
+@option{superres-mode} is @option{qthresh}. Valid value ranges from 1 to 63.
+
 @end table
 
 @section libkvazaar
diff --git a/libavcodec/libaomenc.c b/libavcodec/libaomenc.c
index fe98449fa1..83ccf07fab 100644
--- a/libavcodec/libaomenc.c
+++ b/libavcodec/libaomenc.c
@@ -23,6 +23,7 @@
  * AV1 encoder support via libaom
  */
 
+#include 
 #define AOM_DISABLE_CTRL_TYPECHECKS 1
 #include 
 #include 
@@ -96,6 +97,11 @@ typedef struct AOMEncoderContext {
 int enable_restoration;
 int usage;
 int tune;
+int superres_mode;
+int superres_denominator;
+int superres_qthresh;
+int superres_kf_denominator;
+int superres_kf_qthresh;
 } AOMContext;
 
 static const char *const ctlidstr[] = {
@@ -135,6 +141,7 @@ static const char *const ctlidstr[] = {
 #endif
 [AV1E_SET_ENABLE_CDEF]  = "AV1E_SET_ENABLE_CDEF",
 [AOME_SET_TUNING]   = "AOME_SET_TUNING",
+[AV1E_SET_ENABLE_SUPERRES]  = "AV1E_SET_ENABLE_SUPERRES",
 };
 
 static av_cold void log_encoder_error(AVCodecContext *avctx, const char *desc)
@@ -204,6 +211,13 @@ static av_cold void dump_enc_cfg(AVCodecContext *avctx,
width, "tile_width_count:",  cfg->tile_width_count,
width, "tile_height_count:", cfg->tile_height_count);
 av_log(avctx, level, "\n");
+av_log(avctx, level, "super resolution settings\n"
+ "  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n  %*s%u\n  ",
+   width, "rc_superres_mode:",   cfg->rc_superres_mode,
+   width, "rc_superres_denominator:",cfg->rc_superres_denominator,
+   width, "rc_superres_qthresh:",cfg->rc_superres_qthresh,
+   width, "rc_superres_kf_denominator:", 
cfg->rc_superres_kf_denominator,
+   width, "rc_superres_kf_qthresh:", cfg->rc_superres_kf_qthresh);
 }
 
 static void coded_frame_add(void *list, struct FrameListData *cx_frame)
@@ -546,6 +560,17 @@ static av_cold int aom_init(AVCodecContext *avctx,
 return AVERROR(EINVAL);
 }
 
+if (ctx->superres_mode >= 0)
+enccfg.rc_superres_mode = ctx->superres_mode;
+if (ctx->superres_qthresh > 0)
+enccfg.rc_superres_qthresh = ctx->superres_qthresh;
+if (ctx->superres_kf_qthresh > 0)
+enccfg.rc_superres_kf_qthresh = ctx->superres_kf_qthresh;
+if (ctx->superres_denominator >= 8)
+enccfg.rc_superres_denominator = ctx->superres_denominator;
+if (ctx->superres_kf_denominator >= 8)
+enccfg.rc_superres_kf_denominator = ctx->superres_kf_denominator;
+
 dump_enc_cfg(avctx, );
 
 enccfg.g_w= avctx->width;
@@ -688,6 +713,8 @@ static av_cold int aom_init(AVCodecContext *avctx,
 // codec control failures are currently treated only as warnings
 av_log(avctx, AV_LOG_DEBUG, "aom_codec_control\n");
 codecctl_int(avctx, AOME_SET_CPUUSED, ctx->cpu_used);
+if (ctx->superres_mode > 0)
+codecctl_int(avctx, AV1E_SET_ENABLE_SUPERRES, 1);
 if (ctx->auto_alt_ref >= 0)
 codecctl_int(avctx, AOME_SET_ENABLEAUTOALTREF, ctx->auto_alt_ref);
 if (ctx->arnr_max_frames >= 0)
@@ -1107,6 +1134,25 @@ static const AVOption options[] = {
 { "tune","The metric that the encoder tunes for. Automatically 
chosen by the encoder by default", OFFSET(tune), AV_OPT_TYPE_INT, {.i64 = 

Re: [FFmpeg-devel] [PATCH] configure: remove libvmaf from EXTERNAL_LIBRARY_VERSION3_LIST

2020-06-30 Thread Kyle Swanson
On Mon, Jun 29, 2020 at 2:27 PM Carl Eugen Hoyos  wrote:
> No objections.

Thanks. I will merge in 24 hours or so, when the next libvmaf minor
release is cut.
___
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 09/12] avformat/hevc: Defer initializations in ff_isom_write_hvcc()

2020-06-30 Thread Andreas Rheinhardt
Andreas Rheinhardt:
> Saves initialization of an HEVCDecoderConfigurationRecord when
> the data is already in ISOBMFF-format or if it is plainly invalid.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/hevc.c | 18 --
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/libavformat/hevc.c b/libavformat/hevc.c
> index a4e53bc4ab..616e9ed49a 100644
> --- a/libavformat/hevc.c
> +++ b/libavformat/hevc.c
> @@ -1070,29 +1070,27 @@ int ff_hevc_annexb2mp4_buf(const uint8_t *buf_in, 
> uint8_t **buf_out,
>  int ff_isom_write_hvcc(AVIOContext *pb, const uint8_t *data,
> int size, int ps_array_completeness)
>  {
> -int ret = 0;
> -uint8_t *buf, *end, *start = NULL;
>  HEVCDecoderConfigurationRecord hvcc;
> -
> -hvcc_init();
> +uint8_t *buf, *end, *start;
> +int ret;
>  
>  if (size < 6) {
>  /* We can't write a valid hvcC from the provided data */
> -ret = AVERROR_INVALIDDATA;
> -goto end;
> +return AVERROR_INVALIDDATA;
>  } else if (*data == 1) {
>  /* Data is already hvcC-formatted */
>  avio_write(pb, data, size);
> -goto end;
> +return 0;
>  } else if (!(AV_RB24(data) == 1 || AV_RB32(data) == 1)) {
>  /* Not a valid Annex B start code prefix */
> -ret = AVERROR_INVALIDDATA;
> -goto end;
> +return AVERROR_INVALIDDATA;
>  }
>  
>  ret = ff_avc_parse_nal_units_buf(data, , );
>  if (ret < 0)
> -goto end;
> +return ret;
> +
> +hvcc_init();
>  
>  buf = start;
>  end = start + size;
> 
Ping. 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] avcodec/nvenc: Video Codec SDK 10 features support

2020-06-30 Thread Timo Rothenpieler

On 30.06.2020 16:08, Roman Arzumanyan wrote:

Hello,

This patch adds Video Codec SDK 10 features support:

   *   Presets and tuning info
   *   Multipass encode modes
   *   Low Delay Key Frame Scale



How does one get the new multipass option to work?

With the new preset, I get:

InitializeEncoder failed: invalid param (8): Presets P1 to P7 are not 
supported with older 2 Pass RC Modes(CBR_HQ, VBR_HQ) and cbr lowdelay.


With the old ones:

InitializeEncoder failed: invalid param (8): Older 
presets(default-lossless_hp) are not supported with 
NV_ENC_RC_PARAMS::multiPass and/or NV_ENC_INITIALIZE_PARAMS::tuningInfo



Otherwise, the minimum driver version requirement appears to be swapped 
between Windows and Linux?

___
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] libavfilter/vf_colorconstancy.c : Adding weighted greyedge

2020-06-30 Thread Yatendra Singh
>
> > +s->difford = 1;
>
> Why are you forcing this value?
>
The algorithm only uses first order differentials for the calculation of
the specular variant and it does not seem to be an option to use other
orders as far as I have understood from the paper and the official code.

>
> If you are setting initial estimation to normal white, does it make any
> difference to do a chromatic adaptation?
>
 I was trying to reproduce the same values as the official code in matlab
and hence this was done.
 It might provide a very minor improvement in speed but having an estimate
beforehand might help converge faster.
 I would update the next patch with chromatic adaptation.

>
> > +
> > +static const AVOption weighted_greyedge_options[] = {
> > +{ "minknorm",  "set Minkowski norm", OFFSET(minknorm),
> AV_OPT_TYPE_INT,{.i64=1},   0,20, FLAGS },
> > +{ "sigma", "set sigma",  OFFSET(sigma),
>  AV_OPT_TYPE_DOUBLE, {.dbl=1},   0.0,  1024.0, FLAGS },
> > +{ "min_err",   "set minimum angular error",  OFFSET(min_err),
>  AV_OPT_TYPE_DOUBLE, {.dbl=0.1}, 0.02, M_PI,   FLAGS },
> > +{ "max_iters", "set the maximum iterations", OFFSET(max_iters),
> AV_OPT_TYPE_INT,{.i64=10},  1,100,FLAGS },
> > +{ "kappa", "set the kappa for weights",  OFFSET(kappa),
>  AV_OPT_TYPE_INT,{.i64=10},  1,25,FLAGS },
>
> Why 25?
>
 Honestly, I have no idea as to what the actual upper limit on the power of
weights should be, so I used a random upper limit while testing.
 What would you suggest I should use?


I would also update the new patch with all the rest of the changes.
___
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/3] avformat/isom: add comment to mov_mdhd_language_map

2020-06-30 Thread Zhao Zhili
Ping for review, thanks!

> On Jun 27, 2020, at 10:26 PM, Zhao Zhili  wrote:
> 
> ---
> The following code is used to do the reformat:
> https://gist.github.com/quink-black/8643d8fab8b3f49ff6ace6916111d2c4
> 
> libavformat/isom.c | 158 +++--
> 1 file changed, 139 insertions(+), 19 deletions(-)
> 
> diff --git a/libavformat/isom.c b/libavformat/isom.c
> index 44c7b13038..209bbac5d1 100644
> --- a/libavformat/isom.c
> +++ b/libavformat/isom.c
> @@ -395,25 +395,145 @@ const AVCodecTag ff_codec_movdata_tags[] = {
> /* http://developer.apple.com/documentation/mac/Text/Text-368.html */
> /* deprecated by putting the code as 3*5 bits ASCII */
> static const char mov_mdhd_language_map[][4] = {
> -/* 0-9 */
> -"eng", "fra", "ger", "ita", "dut", "sve", "spa", "dan", "por", "nor",
> -"heb", "jpn", "ara", "fin", "gre", "ice", "mlt", "tur", "hr "/*scr*/, 
> "chi"/*ace?*/,
> -"urd", "hin", "tha", "kor", "lit", "pol", "hun", "est", "lav","",
> -"fo ","", "rus", "chi","", "iri", "alb", "ron", "ces", "slk",
> -"slv", "yid", "sr ", "mac", "bul", "ukr", "bel", "uzb", "kaz", "aze",
> -/*?*/
> -"aze", "arm", "geo", "mol", "kir", "tgk", "tuk", "mon","", "pus",
> -"kur", "kas", "snd", "tib", "nep", "san", "mar", "ben", "asm", "guj",
> -"pa ", "ori", "mal", "kan", "tam", "tel","", "bur", "khm", "lao",
> -/*   roman? arabic? */
> -"vie", "ind", "tgl", "may", "may", "amh", "tir", "orm", "som", "swa",
> -/*==rundi?*/
> -   "", "run","", "mlg", "epo","","","","","",
> -/* 100 */
> -   "","","","","","","","","","",
> -   "","","","","","","","","","",
> -   "","","","","","","","", "wel", "baq",
> -"cat", "lat", "que", "grn", "aym", "tat", "uig", "dzo", "jav"
> +"eng",/*   0 English */
> +"fra",/*   1 French */
> +"ger",/*   2 German */
> +"ita",/*   3 Italian */
> +"dut",/*   4 Dutch */
> +"sve",/*   5 Swedish */
> +"spa",/*   6 Spanish */
> +"dan",/*   7 Danish */
> +"por",/*   8 Portuguese */
> +"nor",/*   9 Norwegian */
> +"heb",/*  10 Hebrew */
> +"jpn",/*  11 Japanese */
> +"ara",/*  12 Arabic */
> +"fin",/*  13 Finnish */
> +"gre",/*  14 Greek */
> +"ice",/*  15 Icelandic */
> +"mlt",/*  16 Maltese */
> +"tur",/*  17 Turkish */
> +"hr ",/*  18 Croatian */
> +"chi",/*  19 Traditional Chinese */
> +"urd",/*  20 Urdu */
> +"hin",/*  21 Hindi */
> +"tha",/*  22 Thai */
> +"kor",/*  23 Korean */
> +"lit",/*  24 Lithuanian */
> +"pol",/*  25 Polish */
> +"hun",/*  26 Hungarian */
> +"est",/*  27 Estonian */
> +"lav",/*  28 Latvian */
> +   "",/*  29 Sami */
> +"fo ",/*  30 Faroese */
> +   "",/*  31 Farsi */
> +"rus",/*  32 Russian */
> +"chi",/*  33 Simplified Chinese */
> +   "",/*  34 Flemish */
> +"iri",/*  35 Irish */
> +"alb",/*  36 Albanian */
> +"ron",/*  37 Romanian */
> +"ces",/*  38 Czech */
> +"slk",/*  39 Slovak */
> +"slv",/*  40 Slovenian */
> +"yid",/*  41 Yiddish */
> +"sr ",/*  42 Serbian */
> +"mac",/*  43 Macedonian */
> +"bul",/*  44 Bulgarian */
> +"ukr",/*  45 Ukrainian */
> +"bel",/*  46 Belarusian */
> +"uzb",/*  47 Uzbek */
> +"kaz",/*  48 Kazakh */
> +"aze",/*  49 Azerbaijani */
> +"aze",/*  50 AzerbaijanAr */
> +"arm",/*  51 Armenian */
> +"geo",/*  52 Georgian */
> +"mol",/*  53 Moldavian */
> +"kir",/*  54 Kirghiz */
> +"tgk",/*  55 Tajiki */
> +"tuk",/*  56 Turkmen */
> +"mon",/*  57 Mongolian */
> +   "",/*  58 MongolianCyr */
> +"pus",/*  59 Pashto */
> +"kur",/*  60 Kurdish */
> +"kas",/*  61 Kashmiri */
> +"snd",/*  62 Sindhi */
> +"tib",/*  63 Tibetan */
> +"nep",/*  64 Nepali */
> +"san",/*  65 Sanskrit */
> +"mar",/*  66 Marathi */
> +"ben",/*  67 Bengali */
> +"asm",/*  68 Assamese */
> +"guj",/*  69 Gujarati */
> +"pa ",/*  70 Punjabi */
> +"ori",/*  71 Oriya */
> +"mal",/*  72 Malayalam */
> +"kan",/*  73 Kannada */
> +"tam",/*  74 Tamil */
> +"tel",/*  75 Telugu */
> +   "",/*  76 Sinhala */
> +"bur",/*  77 Burmese */
> +"khm",/*  78 Khmer */
> +"lao",/*  79 Lao */
> +"vie",/*  80 Vietnamese */
> +"ind",/*  81 Indonesian */
> +"tgl",/*  82 Tagalog */
> +"may",/*  83 MalayRoman */
> +"may",/*  84 MalayArabic */
> +"amh",/*  85 Amharic */
> +

Re: [FFmpeg-devel] [PATCH v5 2/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-30 Thread lance . lmwang
On Tue, Jun 30, 2020 at 05:39:12PM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> >  doc/APIchanges|  3 +++
> >  libavcodec/avpacket.c |  1 +
> >  libavcodec/decode.c   |  1 +
> >  libavcodec/packet.h   |  8 
> >  libavcodec/version.h  |  2 +-
> >  libavformat/dump.c| 21 +
> >  6 files changed, 35 insertions(+), 1 deletion(-)
> > 
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index 1d6cc36..7cad7fa 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -15,6 +15,9 @@ libavutil: 2017-10-21
> >  
> >  API changes, most recent first:
> >  
> > +2020-06-xx - xx - lavc 58.94.100 - packet.h
> > +  Add AV_PKT_DATA_S12M_TIMECODE.
> > +
> >  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
> >Add AV_PIX_FMT_X2RGB10.
> >  
> > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> > index dce26cb..4801163 100644
> > --- a/libavcodec/avpacket.c
> > +++ b/libavcodec/avpacket.c
> > @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> > AVPacketSideDataType type)
> >  case AV_PKT_DATA_PRFT:   return "Producer 
> > Reference Time";
> >  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
> >  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> > configuration record";
> > +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 
> > 12-1:2014 timecode";
> >  }
> >  return NULL;
> >  }
> > diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> > index de9c079..f2244fc 100644
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> > @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> > AVFrame *frame)
> >  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> > AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
> >  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
> >  { AV_PKT_DATA_ICC_PROFILE,
> > AV_FRAME_DATA_ICC_PROFILE },
> > +{ AV_PKT_DATA_S12M_TIMECODE,  
> > AV_FRAME_DATA_S12M_TIMECODE },
> >  };
> >  
> >  if (pkt) {
> > diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> > index 96f237f..232af69 100644
> > --- a/libavcodec/packet.h
> > +++ b/libavcodec/packet.h
> > @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
> >  AV_PKT_DATA_DOVI_CONF,
> >  
> >  /**
> > + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array 
> > of 4 uint32_t
> > + * where the first uint32_t describes how many (1-3) of the other 
> > timecodes are used.
> > + * The timecode format is described in the commenets of 
> > av_timecode_get_smpte_from_framenum()
> 
> Typo: commenets. But I actually like "documentation" more.

sure, replace it with documentation and change it in local.

> 
> > + * function in libavutil/timecode.h.
> > + */
> > +AV_PKT_DATA_S12M_TIMECODE,
> > +
> > +/**
> >   * The number of side data types.
> >   * This is not part of the public API/ABI in the sense that it may
> >   * change when new side data types are added.
> > diff --git a/libavcodec/version.h b/libavcodec/version.h
> > index 0359302..482cc6d 100644
> > --- a/libavcodec/version.h
> > +++ b/libavcodec/version.h
> > @@ -28,7 +28,7 @@
> >  #include "libavutil/version.h"
> >  
> >  #define LIBAVCODEC_VERSION_MAJOR  58
> > -#define LIBAVCODEC_VERSION_MINOR  93
> > +#define LIBAVCODEC_VERSION_MINOR  94
> >  #define LIBAVCODEC_VERSION_MICRO 100
> >  
> >  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> > diff --git a/libavformat/dump.c b/libavformat/dump.c
> > index 1083d7d..46db039 100644
> > --- a/libavformat/dump.c
> > +++ b/libavformat/dump.c
> > @@ -34,6 +34,7 @@
> >  #include "libavutil/replaygain.h"
> >  #include "libavutil/spherical.h"
> >  #include "libavutil/stereo3d.h"
> > +#include "libavutil/timecode.h"
> >  
> >  #include "avformat.h"
> >  
> > @@ -407,6 +408,22 @@ static void dump_dovi_conf(void *ctx, const 
> > AVPacketSideData *sd)
> > dovi->dv_bl_signal_compatibility_id);
> >  }
> >  
> > +static void dump_s12m_timecode(void *ctx, const AVPacketSideData *sd)
> > +{
> > +const uint32_t *tc = (const uint32_t *)sd->data;
> > +
> > +if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
> > +av_log(ctx, AV_LOG_ERROR, "invalid data\n");
> > +return;
> > +}
> > +
> > +for (int j = 1; j <= tc[0]; j++) {
> > +char tcbuf[AV_TIMECODE_STR_SIZE];
> > +av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
> > +av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", 
> > " : "");
> > +}
> > +}
> > +
> >  static void dump_sidedata(void *ctx, const AVStream *st, const char 
> > *indent)
> >  {
> >  int i;
> > @@ -473,6 +490,10 @@ static void dump_sidedata(void *ctx, const AVStream 
> > *st, const char *indent)
> >  av_log(ctx, 

Re: [FFmpeg-devel] [PATCH v5 2/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-30 Thread Andreas Rheinhardt
lance.lmw...@gmail.com:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  doc/APIchanges|  3 +++
>  libavcodec/avpacket.c |  1 +
>  libavcodec/decode.c   |  1 +
>  libavcodec/packet.h   |  8 
>  libavcodec/version.h  |  2 +-
>  libavformat/dump.c| 21 +
>  6 files changed, 35 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 1d6cc36..7cad7fa 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>  
>  API changes, most recent first:
>  
> +2020-06-xx - xx - lavc 58.94.100 - packet.h
> +  Add AV_PKT_DATA_S12M_TIMECODE.
> +
>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
>Add AV_PIX_FMT_X2RGB10.
>  
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index dce26cb..4801163 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> AVPacketSideDataType type)
>  case AV_PKT_DATA_PRFT:   return "Producer Reference 
> Time";
>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI configuration 
> record";
> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 12-1:2014 
> timecode";
>  }
>  return NULL;
>  }
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index de9c079..f2244fc 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> AVFrame *frame)
>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
>  { AV_PKT_DATA_ICC_PROFILE,AV_FRAME_DATA_ICC_PROFILE 
> },
> +{ AV_PKT_DATA_S12M_TIMECODE,  
> AV_FRAME_DATA_S12M_TIMECODE },
>  };
>  
>  if (pkt) {
> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> index 96f237f..232af69 100644
> --- a/libavcodec/packet.h
> +++ b/libavcodec/packet.h
> @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
>  AV_PKT_DATA_DOVI_CONF,
>  
>  /**
> + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array 
> of 4 uint32_t
> + * where the first uint32_t describes how many (1-3) of the other 
> timecodes are used.
> + * The timecode format is described in the commenets of 
> av_timecode_get_smpte_from_framenum()

Typo: commenets. But I actually like "documentation" more.

> + * function in libavutil/timecode.h.
> + */
> +AV_PKT_DATA_S12M_TIMECODE,
> +
> +/**
>   * The number of side data types.
>   * This is not part of the public API/ABI in the sense that it may
>   * change when new side data types are added.
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 0359302..482cc6d 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -28,7 +28,7 @@
>  #include "libavutil/version.h"
>  
>  #define LIBAVCODEC_VERSION_MAJOR  58
> -#define LIBAVCODEC_VERSION_MINOR  93
> +#define LIBAVCODEC_VERSION_MINOR  94
>  #define LIBAVCODEC_VERSION_MICRO 100
>  
>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index 1083d7d..46db039 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -34,6 +34,7 @@
>  #include "libavutil/replaygain.h"
>  #include "libavutil/spherical.h"
>  #include "libavutil/stereo3d.h"
> +#include "libavutil/timecode.h"
>  
>  #include "avformat.h"
>  
> @@ -407,6 +408,22 @@ static void dump_dovi_conf(void *ctx, const 
> AVPacketSideData *sd)
> dovi->dv_bl_signal_compatibility_id);
>  }
>  
> +static void dump_s12m_timecode(void *ctx, const AVPacketSideData *sd)
> +{
> +const uint32_t *tc = (const uint32_t *)sd->data;
> +
> +if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
> +av_log(ctx, AV_LOG_ERROR, "invalid data\n");
> +return;
> +}
> +
> +for (int j = 1; j <= tc[0]; j++) {
> +char tcbuf[AV_TIMECODE_STR_SIZE];
> +av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
> +av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", " 
> : "");
> +}
> +}
> +
>  static void dump_sidedata(void *ctx, const AVStream *st, const char *indent)
>  {
>  int i;
> @@ -473,6 +490,10 @@ static void dump_sidedata(void *ctx, const AVStream *st, 
> const char *indent)
>  av_log(ctx, AV_LOG_INFO, "DOVI configuration record: ");
>  dump_dovi_conf(ctx, sd);
>  break;
> +case AV_PKT_DATA_S12M_TIMECODE:
> +av_log(ctx, AV_LOG_INFO, "SMPTE ST 12-1:2014: ");
> +dump_s12m_timecode(ctx, sd);
> +break;
>  default:
>  av_log(ctx, AV_LOG_INFO,
> "unknown side data type %d (%d bytes)", sd->type, 
> 

[FFmpeg-devel] [PATCH v5 2/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-30 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 doc/APIchanges|  3 +++
 libavcodec/avpacket.c |  1 +
 libavcodec/decode.c   |  1 +
 libavcodec/packet.h   |  8 
 libavcodec/version.h  |  2 +-
 libavformat/dump.c| 21 +
 6 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/doc/APIchanges b/doc/APIchanges
index 1d6cc36..7cad7fa 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2017-10-21
 
 API changes, most recent first:
 
+2020-06-xx - xx - lavc 58.94.100 - packet.h
+  Add AV_PKT_DATA_S12M_TIMECODE.
+
 2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
   Add AV_PIX_FMT_X2RGB10.
 
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index dce26cb..4801163 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
AVPacketSideDataType type)
 case AV_PKT_DATA_PRFT:   return "Producer Reference 
Time";
 case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
 case AV_PKT_DATA_DOVI_CONF:  return "DOVI configuration 
record";
+case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 12-1:2014 
timecode";
 }
 return NULL;
 }
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index de9c079..f2244fc 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, AVFrame 
*frame)
 { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
 { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
 { AV_PKT_DATA_ICC_PROFILE,AV_FRAME_DATA_ICC_PROFILE },
+{ AV_PKT_DATA_S12M_TIMECODE,  AV_FRAME_DATA_S12M_TIMECODE 
},
 };
 
 if (pkt) {
diff --git a/libavcodec/packet.h b/libavcodec/packet.h
index 96f237f..232af69 100644
--- a/libavcodec/packet.h
+++ b/libavcodec/packet.h
@@ -283,6 +283,14 @@ enum AVPacketSideDataType {
 AV_PKT_DATA_DOVI_CONF,
 
 /**
+ * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array of 
4 uint32_t
+ * where the first uint32_t describes how many (1-3) of the other 
timecodes are used.
+ * The timecode format is described in the commenets of 
av_timecode_get_smpte_from_framenum()
+ * function in libavutil/timecode.h.
+ */
+AV_PKT_DATA_S12M_TIMECODE,
+
+/**
  * The number of side data types.
  * This is not part of the public API/ABI in the sense that it may
  * change when new side data types are added.
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 0359302..482cc6d 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -28,7 +28,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVCODEC_VERSION_MAJOR  58
-#define LIBAVCODEC_VERSION_MINOR  93
+#define LIBAVCODEC_VERSION_MINOR  94
 #define LIBAVCODEC_VERSION_MICRO 100
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
diff --git a/libavformat/dump.c b/libavformat/dump.c
index 1083d7d..46db039 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -34,6 +34,7 @@
 #include "libavutil/replaygain.h"
 #include "libavutil/spherical.h"
 #include "libavutil/stereo3d.h"
+#include "libavutil/timecode.h"
 
 #include "avformat.h"
 
@@ -407,6 +408,22 @@ static void dump_dovi_conf(void *ctx, const 
AVPacketSideData *sd)
dovi->dv_bl_signal_compatibility_id);
 }
 
+static void dump_s12m_timecode(void *ctx, const AVPacketSideData *sd)
+{
+const uint32_t *tc = (const uint32_t *)sd->data;
+
+if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
+av_log(ctx, AV_LOG_ERROR, "invalid data\n");
+return;
+}
+
+for (int j = 1; j <= tc[0]; j++) {
+char tcbuf[AV_TIMECODE_STR_SIZE];
+av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
+av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", " : 
"");
+}
+}
+
 static void dump_sidedata(void *ctx, const AVStream *st, const char *indent)
 {
 int i;
@@ -473,6 +490,10 @@ static void dump_sidedata(void *ctx, const AVStream *st, 
const char *indent)
 av_log(ctx, AV_LOG_INFO, "DOVI configuration record: ");
 dump_dovi_conf(ctx, sd);
 break;
+case AV_PKT_DATA_S12M_TIMECODE:
+av_log(ctx, AV_LOG_INFO, "SMPTE ST 12-1:2014: ");
+dump_s12m_timecode(ctx, sd);
+break;
 default:
 av_log(ctx, AV_LOG_INFO,
"unknown side data type %d (%d bytes)", sd->type, sd->size);
-- 
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] avutil/timecode: add description for SMPTE binary format

2020-06-30 Thread lance . lmwang
From: Limin Wang 

Signed-off-by: Limin Wang 
---
 libavutil/frame.h|  4 ++--
 libavutil/timecode.h | 12 
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/libavutil/frame.h b/libavutil/frame.h
index 3fb8c56..c694b12 100644
--- a/libavutil/frame.h
+++ b/libavutil/frame.h
@@ -162,8 +162,8 @@ enum AVFrameSideDataType {
 /**
  * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 
uint32_t
  * where the first uint32_t describes how many (1-3) of the other 
timecodes are used.
- * The timecode format is described in the 
av_timecode_get_smpte_from_framenum()
- * function in libavutil/timecode.c.
+ * The timecode format is described in the comments of 
av_timecode_get_smpte_from_framenum()
+ * function in libavutil/timecode.h.
  */
 AV_FRAME_DATA_S12M_TIMECODE,
 
diff --git a/libavutil/timecode.h b/libavutil/timecode.h
index ab38e66..65c5e91 100644
--- a/libavutil/timecode.h
+++ b/libavutil/timecode.h
@@ -62,6 +62,18 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int fps);
  * @param framenum frame number
  * @return the SMPTE binary representation
  *
+ * the format description as follows:
+ * bits 0-5:   hours, in BCD
+ * bits 6: BGF1
+ * bits 7: BGF2 (NTSC) or PC (PAL)
+ * bits 8-13:  minutes, in BCD
+ * bits 15:BGF0 (NTSC) or BGF2 (PAL)
+ * bits 16-21: seconds, in BCD
+ * bits 23:PC (NTSC) or BGF0 (PAL)
+ * bits 24-29: frames, in BCD
+ * bits 30:drop  frame flag (0: non drop,1: drop)
+ * bits 31:color frame flag (0: unsync mode, 1: sync mode)
+ * @note BCD numbers (6 bits): 4 lower bits for units, 2 higher bits for tens.
  * @note Frame number adjustment is automatically done in case of drop 
timecode,
  *   you do NOT have to call av_timecode_adjust_ntsc_framenum2().
  * @note The frame number is relative to tc->start.
-- 
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".

Re: [FFmpeg-devel] [PATCH v2] ffprobe: Allow unknown format private AVOptions

2020-06-30 Thread Derek Buitenhuis
On 28/06/2020 21:58, Derek Buitenhuis wrote:
> This useful, because by ffprobe's very nature, you use it to probe
> a file and find out what it is. Requiring every format private option
> to be known to the demuxer forces one to run ffprobe twice, if one
> wants to use ffprobe in a generic way.
> 
> For example, say one wants to probe all user-uploaded files, while
> also ignoring edit lists for any MP4s that are uploaded. Currently,
> you'd have to run ffprobe twice: once to identify the format, and
> once again to actually probe the metadata you want. After this
> patch, you could set -ignore_editlist 1 on every call and only
> probe once.
> 
> Signed-off-by: Derek Buitenhuis 
> ---
> Changed to just be the main behavior instead of behind an option,
> as Michael suggested.
> 
> Didn't really know what would be added to ffprobe.texi, though, since
> this is no longer an option.
> ---
>  fftools/ffprobe.c | 6 ++
>  1 file changed, 2 insertions(+), 4 deletions(-)

Ping.

If nobody objects, I'll push this tomorrow.

- Derek
___
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]libavfilter/asrc_atone.c : generate algorithmic music

2020-06-30 Thread Ashutosh Pradhan
On Tue, Jun 30, 2020 at 8:40 PM Thilo Borgmann 
wrote:

> Am 30.06.20 um 16:09 schrieb Ashutosh Pradhan:
> > On Mon, Jun 29, 2020 at 6:53 PM Moritz Barsnick 
> wrote:
> >
> >> On Thu, Jun 25, 2020 at 21:15:06 +0530, Ashutosh Pradhan wrote:
> >>> Generate algorithmic riff music. Changed to activate api.
> >>
> >> This commit doesn't change to activate API, as it introduces this
> >> filter. So that sentence doesn't belong here.
> >>
> >>>  - Real War KVAG muxer
> >>> -
> >>> +- atone filter
> >>
> >> Don't remove the empty line.
> >>
> >>>--enable-libfliteenable flite (voice synthesis) support via
> >> libflite [no]
> >>> +  --enable-libfluidsynth   enable libfluidsynth support for fluidsynth
> >> [no]
> >>
> >> "for fluidsynth"?. Perhaps "for atone source".
> >>
> > Will change to above.
> >
> >>
> >>>  atempo_filter_select="rdft"
> >>> +atone_filter_deps="libfluidsynth"
> >>
> >>> +@item sfont
> >>> +Specify the location of soundfont file. Default value is
> >>> +"/usr/share/sounds/sf2/FluidR3_GM.sf2"(for linux).
> >>
> >> For Linux - and elsewhere?
> >> It will be the same path on all Unixes, but meaningless under Windows,
> >> I guess.
> >>
> > Yes.
> > Windows doesn't have the recommended Fluid_R3 General Midi SoundFont
> file.
> > So one has to enter the path every time.
> >
> >>
> >>> +++ b/libavfilter/Makefile
> >>> @@ -152,6 +152,7 @@ OBJS-$(CONFIG_FLITE_FILTER)  +=
> >> asrc_flite.o
> >>>  OBJS-$(CONFIG_HILBERT_FILTER)+= asrc_hilbert.o
> >>>  OBJS-$(CONFIG_SINC_FILTER)   += asrc_sinc.o
> >>>  OBJS-$(CONFIG_SINE_FILTER)   += asrc_sine.o
> >>> +OBJS-$(CONFIG_ATONE_FILTER)  += asrc_atone.o
> >>
> >> I believe the audio sources are meant to be sorted alphabetically (by
> >> CONFIG_*).
> >>
> >>> --- a/libavfilter/allfilters.c
> >>> +++ b/libavfilter/allfilters.c
> >>> @@ -146,6 +146,7 @@ extern AVFilter ff_asrc_flite;
> >>>  extern AVFilter ff_asrc_hilbert;
> >>>  extern AVFilter ff_asrc_sinc;
> >>>  extern AVFilter ff_asrc_sine;
> >>> +extern AVFilter ff_asrc_atone;
> >>
> >> Same here.
> >>
> >>> +#include 
> >>
> >>> +s->beat_dur = 6/s->beats_pm;
> >>> +/*get change interval in frames/sec*/
> >>> +s->changerate = (4*s->beat_dur)*s->sample_rate/s->nb_samples;
> >>> +if (s->changerate<1.0)
> >>> +s->changerate = 1.0;
> >>
> >> Please leave single spaces around the operators such as '/', '*', '<'.
> >>
> >>> +s->numriffs = sizeof(riff)/(NPR* sizeof(int));
> >>
> >> Same here.
> >>
> >>> +for (int i = 0; i < s->numriffs*NPR ; i++)
> >>
> >> And here.
> >>
> >>> +if (s->framecount == INT_MAX)
> >>> +   s->framecount = 0;
> >>
> >> Indentation.
> >>
> >>> +for (int i = 0; i <
> >> sizeof(GM_instrument_list)/sizeof(GM_instrument_list[0]); i++)
> >>
> >> Use macro FF_ARRAY_ELEMS
> >>
> >>> +if (strcmp(GM_instrument_list[i], instrument) == 0)
> >>> +return i;
> >>> +
> >>> +return 0;
> >>> +}
> >>
> >> If this doesn't match any string, it returns 0. It also returns 0 if it
> >> matches "Acoustic-Grand". Is that correct? (In find_percussion_track(),
> >> you return i instead.)
> >>
> > I didn't want to output an error incase the instrument did not match. I
> > forgot to update 0 with the number of the default instrument. I will
> update
> > that.
>
> For that case, you might want to output a warning that the instrument
> could not be matched and the default instrument will be used instead.
>
I will change the code to implement this.

>
> >>
> >>> +static void schedule_noteon(int chan, short key, unsigned int ticks,
> >> int velocity, AtoneContext *s)
> >>> +{
> >>> +   fluid_event_t *ev = new_fluid_event();
> >>
> >> Indentation.
> >>
> >>> +unsigned rand = av_lfg_get(>r)/2;
> >> [...]
> >>> +riff = rand%s->numriffs;
> >>
> >> Spaces around operators, please.
> >>
> >>> +if (3*i < numbars)
> >>> +return (100 - (90*i)/numbars);
> >>> +else if (3*i > 2*numbars)
> >>> +return (40 + (90*i)/numbars);
> >>
> >> Same here.
> >>
> >>> +/*Determine the pattern, tempo (to paly as 8th, 16th or 32nd notes)
> and
> >> add the riffs to sequencer
> >>
> >> "play"
> >>
> >>> +Refernce: http://peterlangston.com/Papers/amc.pdf */
> >>
> >> "Reference"
> >>
> >>> +AVFrame *frame;
> >>> +int  nb_samples;
> >>   ^^ two spaces, drop one.
> >>
> >>> +ret = ff_set_common_formats (ctx, formats);
> >>   ^ drop the space
> >>
> >>> +typedef struct
> >>> +{
> >>
> >> Bracket on the same line.
> >>
> >>> +Refernce: http://peterlangston.com/Papers/amc.pdf */
> >>
> >> "Reference".
> >>
>
> -Thilo
> ___
> 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]libavfilter/asrc_atone.c : generate algorithmic music

2020-06-30 Thread Thilo Borgmann
Am 30.06.20 um 16:09 schrieb Ashutosh Pradhan:
> On Mon, Jun 29, 2020 at 6:53 PM Moritz Barsnick  wrote:
> 
>> On Thu, Jun 25, 2020 at 21:15:06 +0530, Ashutosh Pradhan wrote:
>>> Generate algorithmic riff music. Changed to activate api.
>>
>> This commit doesn't change to activate API, as it introduces this
>> filter. So that sentence doesn't belong here.
>>
>>>  - Real War KVAG muxer
>>> -
>>> +- atone filter
>>
>> Don't remove the empty line.
>>
>>>--enable-libfliteenable flite (voice synthesis) support via
>> libflite [no]
>>> +  --enable-libfluidsynth   enable libfluidsynth support for fluidsynth
>> [no]
>>
>> "for fluidsynth"?. Perhaps "for atone source".
>>
> Will change to above.
> 
>>
>>>  atempo_filter_select="rdft"
>>> +atone_filter_deps="libfluidsynth"
>>
>>> +@item sfont
>>> +Specify the location of soundfont file. Default value is
>>> +"/usr/share/sounds/sf2/FluidR3_GM.sf2"(for linux).
>>
>> For Linux - and elsewhere?
>> It will be the same path on all Unixes, but meaningless under Windows,
>> I guess.
>>
> Yes.
> Windows doesn't have the recommended Fluid_R3 General Midi SoundFont file.
> So one has to enter the path every time.
> 
>>
>>> +++ b/libavfilter/Makefile
>>> @@ -152,6 +152,7 @@ OBJS-$(CONFIG_FLITE_FILTER)  +=
>> asrc_flite.o
>>>  OBJS-$(CONFIG_HILBERT_FILTER)+= asrc_hilbert.o
>>>  OBJS-$(CONFIG_SINC_FILTER)   += asrc_sinc.o
>>>  OBJS-$(CONFIG_SINE_FILTER)   += asrc_sine.o
>>> +OBJS-$(CONFIG_ATONE_FILTER)  += asrc_atone.o
>>
>> I believe the audio sources are meant to be sorted alphabetically (by
>> CONFIG_*).
>>
>>> --- a/libavfilter/allfilters.c
>>> +++ b/libavfilter/allfilters.c
>>> @@ -146,6 +146,7 @@ extern AVFilter ff_asrc_flite;
>>>  extern AVFilter ff_asrc_hilbert;
>>>  extern AVFilter ff_asrc_sinc;
>>>  extern AVFilter ff_asrc_sine;
>>> +extern AVFilter ff_asrc_atone;
>>
>> Same here.
>>
>>> +#include 
>>
>>> +s->beat_dur = 6/s->beats_pm;
>>> +/*get change interval in frames/sec*/
>>> +s->changerate = (4*s->beat_dur)*s->sample_rate/s->nb_samples;
>>> +if (s->changerate<1.0)
>>> +s->changerate = 1.0;
>>
>> Please leave single spaces around the operators such as '/', '*', '<'.
>>
>>> +s->numriffs = sizeof(riff)/(NPR* sizeof(int));
>>
>> Same here.
>>
>>> +for (int i = 0; i < s->numriffs*NPR ; i++)
>>
>> And here.
>>
>>> +if (s->framecount == INT_MAX)
>>> +   s->framecount = 0;
>>
>> Indentation.
>>
>>> +for (int i = 0; i <
>> sizeof(GM_instrument_list)/sizeof(GM_instrument_list[0]); i++)
>>
>> Use macro FF_ARRAY_ELEMS
>>
>>> +if (strcmp(GM_instrument_list[i], instrument) == 0)
>>> +return i;
>>> +
>>> +return 0;
>>> +}
>>
>> If this doesn't match any string, it returns 0. It also returns 0 if it
>> matches "Acoustic-Grand". Is that correct? (In find_percussion_track(),
>> you return i instead.)
>>
> I didn't want to output an error incase the instrument did not match. I
> forgot to update 0 with the number of the default instrument. I will update
> that.

For that case, you might want to output a warning that the instrument could not 
be matched and the default instrument will be used instead.

>>
>>> +static void schedule_noteon(int chan, short key, unsigned int ticks,
>> int velocity, AtoneContext *s)
>>> +{
>>> +   fluid_event_t *ev = new_fluid_event();
>>
>> Indentation.
>>
>>> +unsigned rand = av_lfg_get(>r)/2;
>> [...]
>>> +riff = rand%s->numriffs;
>>
>> Spaces around operators, please.
>>
>>> +if (3*i < numbars)
>>> +return (100 - (90*i)/numbars);
>>> +else if (3*i > 2*numbars)
>>> +return (40 + (90*i)/numbars);
>>
>> Same here.
>>
>>> +/*Determine the pattern, tempo (to paly as 8th, 16th or 32nd notes) and
>> add the riffs to sequencer
>>
>> "play"
>>
>>> +Refernce: http://peterlangston.com/Papers/amc.pdf */
>>
>> "Reference"
>>
>>> +AVFrame *frame;
>>> +int  nb_samples;
>>   ^^ two spaces, drop one.
>>
>>> +ret = ff_set_common_formats (ctx, formats);
>>   ^ drop the space
>>
>>> +typedef struct
>>> +{
>>
>> Bracket on the same line.
>>
>>> +Refernce: http://peterlangston.com/Papers/amc.pdf */
>>
>> "Reference".
>>

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

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

Re: [FFmpeg-devel] [PATCH 2/2] avformat/dump: Use intermediate pointer for access to programs array

2020-06-30 Thread lance . lmwang
On Tue, Jun 30, 2020 at 03:09:09PM +0200, Andreas Rheinhardt wrote:
> Improves readability.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/dump.c | 15 ---
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index 3c76edfee4..1083d7db37 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -679,17 +679,18 @@ void av_dump_format(AVFormatContext *ic, int index,
>  if (ic->nb_programs) {
>  int j, k, total = 0;
>  for (j = 0; j < ic->nb_programs; j++) {
> -const AVDictionaryEntry *name = 
> av_dict_get(ic->programs[j]->metadata,
> +const AVProgram *program = ic->programs[j];
> +const AVDictionaryEntry *name = av_dict_get(program->metadata,
>  "name", NULL, 0);
> -av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", 
> ic->programs[j]->id,
> +av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", program->id,
> name ? name->value : "");
> -dump_metadata(NULL, ic->programs[j]->metadata, "");
> -for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {
> -dump_stream_format(ic, ic->programs[j]->stream_index[k],
> +dump_metadata(NULL, program->metadata, "");
> +for (k = 0; k < program->nb_stream_indexes; k++) {
> +dump_stream_format(ic, program->stream_index[k],
> index, is_output);
> -printed[ic->programs[j]->stream_index[k]] = 1;
> +printed[program->stream_index[k]] = 1;
>  }
> -total += ic->programs[j]->nb_stream_indexes;
> +total += program->nb_stream_indexes;
>  }
>  if (total < ic->nb_streams)
>  av_log(NULL, AV_LOG_INFO, "  No Program\n");
> -- 
> 2.20.1
> 

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

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

Re: [FFmpeg-devel] [PATCH 1/2] avformat/dump: Use const where appropriate

2020-06-30 Thread lance . lmwang
On Tue, Jun 30, 2020 at 03:09:08PM +0200, Andreas Rheinhardt wrote:
> Also switch to using a pointer to access stream side data instead of
> copying the stream's AVPacketSideData.
> 
> Signed-off-by: Andreas Rheinhardt 
> ---
>  libavformat/dump.c | 91 --
>  1 file changed, 48 insertions(+), 43 deletions(-)
> 
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index 117c68145c..3c76edfee4 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -131,10 +131,10 @@ static void print_fps(double d, const char *postfix)
>  av_log(NULL, AV_LOG_INFO, "%1.0fk %s", d / 1000, postfix);
>  }
>  
> -static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
> +static void dump_metadata(void *ctx, const AVDictionary *m, const char 
> *indent)
>  {
>  if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 
> 0))) {
> -AVDictionaryEntry *tag = NULL;
> +const AVDictionaryEntry *tag = NULL;
>  
>  av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
>  while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX)))
> @@ -158,7 +158,7 @@ static void dump_metadata(void *ctx, AVDictionary *m, 
> const char *indent)
>  }
>  
>  /* param change side data*/
> -static void dump_paramchange(void *ctx, AVPacketSideData *sd)
> +static void dump_paramchange(void *ctx, const AVPacketSideData *sd)
>  {
>  int size = sd->size;
>  const uint8_t *data = sd->data;
> @@ -235,15 +235,15 @@ static void print_peak(void *ctx, const char *str, 
> uint32_t peak)
>  av_log(ctx, AV_LOG_INFO, ", ");
>  }
>  
> -static void dump_replaygain(void *ctx, AVPacketSideData *sd)
> +static void dump_replaygain(void *ctx, const AVPacketSideData *sd)
>  {
> -AVReplayGain *rg;
> +const AVReplayGain *rg;
>  
>  if (sd->size < sizeof(*rg)) {
>  av_log(ctx, AV_LOG_ERROR, "invalid data");
>  return;
>  }
> -rg = (AVReplayGain*)sd->data;
> +rg = (const AVReplayGain *)sd->data;
>  
>  print_gain(ctx, "track gain", rg->track_gain);
>  print_peak(ctx, "track peak", rg->track_peak);
> @@ -251,16 +251,16 @@ static void dump_replaygain(void *ctx, AVPacketSideData 
> *sd)
>  print_peak(ctx, "album peak", rg->album_peak);
>  }
>  
> -static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
> +static void dump_stereo3d(void *ctx, const AVPacketSideData *sd)
>  {
> -AVStereo3D *stereo;
> +const AVStereo3D *stereo;
>  
>  if (sd->size < sizeof(*stereo)) {
>  av_log(ctx, AV_LOG_ERROR, "invalid data");
>  return;
>  }
>  
> -stereo = (AVStereo3D *)sd->data;
> +stereo = (const AVStereo3D *)sd->data;
>  
>  av_log(ctx, AV_LOG_INFO, "%s", av_stereo3d_type_name(stereo->type));
>  
> @@ -268,9 +268,9 @@ static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
>  av_log(ctx, AV_LOG_INFO, " (inverted)");
>  }
>  
> -static void dump_audioservicetype(void *ctx, AVPacketSideData *sd)
> +static void dump_audioservicetype(void *ctx, const AVPacketSideData *sd)
>  {
> -enum AVAudioServiceType *ast = (enum AVAudioServiceType *)sd->data;
> +const enum AVAudioServiceType *ast = (const enum AVAudioServiceType 
> *)sd->data;
>  
>  if (sd->size < sizeof(*ast)) {
>  av_log(ctx, AV_LOG_ERROR, "invalid data");
> @@ -311,9 +311,9 @@ static void dump_audioservicetype(void *ctx, 
> AVPacketSideData *sd)
>  }
>  }
>  
> -static void dump_cpb(void *ctx, AVPacketSideData *sd)
> +static void dump_cpb(void *ctx, const AVPacketSideData *sd)
>  {
> -AVCPBProperties *cpb = (AVCPBProperties *)sd->data;
> +const AVCPBProperties *cpb = (const AVCPBProperties *)sd->data;
>  
>  if (sd->size < sizeof(*cpb)) {
>  av_log(ctx, AV_LOG_ERROR, "invalid data");
> @@ -334,8 +334,10 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
>  av_log(ctx, AV_LOG_INFO, "vbv_delay: %"PRIu64"", cpb->vbv_delay);
>  }
>  
> -static void dump_mastering_display_metadata(void *ctx, AVPacketSideData* sd) 
> {
> -AVMasteringDisplayMetadata* metadata = 
> (AVMasteringDisplayMetadata*)sd->data;
> +static void dump_mastering_display_metadata(void *ctx, const 
> AVPacketSideData *sd)
> +{
> +const AVMasteringDisplayMetadata *metadata =
> +(const AVMasteringDisplayMetadata *)sd->data;
>  av_log(ctx, AV_LOG_INFO, "Mastering Display Metadata, "
> "has_primaries:%d has_luminance:%d "
> "r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) "
> @@ -351,17 +353,19 @@ static void dump_mastering_display_metadata(void *ctx, 
> AVPacketSideData* sd) {
> av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance));
>  }
>  
> -static void dump_content_light_metadata(void *ctx, AVPacketSideData* sd)
> +static void dump_content_light_metadata(void *ctx, const AVPacketSideData 
> *sd)
>  {
> -AVContentLightMetadata* metadata = (AVContentLightMetadata*)sd->data;
> +const 

Re: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 features support

2020-06-30 Thread Soft Works

> -Original Message-
> From: ffmpeg-devel  On Behalf Of
> Roman Arzumanyan
> Sent: Tuesday, June 30, 2020 4:08 PM
> To: ffmpeg-devel@ffmpeg.org; timo 
> Cc: Yogender Gupta 
> Subject: [FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10
> features support
> 
> Hello,
> 
> This patch adds Video Codec SDK 10 features support:
> 
>   *   Presets and tuning info
>   *   Multipass encode modes
>   *   Low Delay Key Frame Scale

Hi Roman, Yogender,

great to see somebody from Nvidia here. I think it's been a while.. :-)

I have a rather general question: Wouldn't it make sense to transition
from compile time version checks to runtime checking?
(like Intel does..)

We're currently stuck at SDK 8.1 because otherwise it would break
functionality for customers having devices for which no newer drivers
are available.

Regards
softworkz
___
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 v4 2/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-30 Thread lance . lmwang
On Tue, Jun 30, 2020 at 04:10:41PM +0200, Andreas Rheinhardt wrote:
> lance.lmw...@gmail.com:
> > From: Limin Wang 
> > 
> > Signed-off-by: Limin Wang 
> > ---
> >  doc/APIchanges|  3 +++
> >  libavcodec/avpacket.c |  1 +
> >  libavcodec/decode.c   |  1 +
> >  libavcodec/packet.h   |  8 
> >  libavcodec/version.h  |  2 +-
> >  libavformat/dump.c| 21 +
> >  6 files changed, 35 insertions(+), 1 deletion(-)
> > 
> > diff --git a/doc/APIchanges b/doc/APIchanges
> > index 1d6cc36..7cad7fa 100644
> > --- a/doc/APIchanges
> > +++ b/doc/APIchanges
> > @@ -15,6 +15,9 @@ libavutil: 2017-10-21
> >  
> >  API changes, most recent first:
> >  
> > +2020-06-xx - xx - lavc 58.94.100 - packet.h
> > +  Add AV_PKT_DATA_S12M_TIMECODE.
> > +
> >  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
> >Add AV_PIX_FMT_X2RGB10.
> >  
> > diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> > index dce26cb..4801163 100644
> > --- a/libavcodec/avpacket.c
> > +++ b/libavcodec/avpacket.c
> > @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> > AVPacketSideDataType type)
> >  case AV_PKT_DATA_PRFT:   return "Producer 
> > Reference Time";
> >  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
> >  case AV_PKT_DATA_DOVI_CONF:  return "DOVI 
> > configuration record";
> > +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 
> > 12-1:2014 timecode";
> >  }
> >  return NULL;
> >  }
> > diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> > index de9c079..f2244fc 100644
> > --- a/libavcodec/decode.c
> > +++ b/libavcodec/decode.c
> > @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> > AVFrame *frame)
> >  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> > AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
> >  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
> >  { AV_PKT_DATA_ICC_PROFILE,
> > AV_FRAME_DATA_ICC_PROFILE },
> > +{ AV_PKT_DATA_S12M_TIMECODE,  
> > AV_FRAME_DATA_S12M_TIMECODE },
> >  };
> >  
> >  if (pkt) {
> > diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> > index 96f237f..232af69 100644
> > --- a/libavcodec/packet.h
> > +++ b/libavcodec/packet.h
> > @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
> >  AV_PKT_DATA_DOVI_CONF,
> >  
> >  /**
> > + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array 
> > of 4 uint32_t
> > + * where the first uint32_t describes how many (1-3) of the other 
> > timecodes are used.
> > + * The timecode format is described in the commenets of 
> > av_timecode_get_smpte_from_framenum()
> > + * function in libavutil/timecode.h.
> > + */
> > +AV_PKT_DATA_S12M_TIMECODE,
> > +
> > +/**
> >   * The number of side data types.
> >   * This is not part of the public API/ABI in the sense that it may
> >   * change when new side data types are added.
> > diff --git a/libavcodec/version.h b/libavcodec/version.h
> > index 0359302..482cc6d 100644
> > --- a/libavcodec/version.h
> > +++ b/libavcodec/version.h
> > @@ -28,7 +28,7 @@
> >  #include "libavutil/version.h"
> >  
> >  #define LIBAVCODEC_VERSION_MAJOR  58
> > -#define LIBAVCODEC_VERSION_MINOR  93
> > +#define LIBAVCODEC_VERSION_MINOR  94
> >  #define LIBAVCODEC_VERSION_MICRO 100
> >  
> >  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> > diff --git a/libavformat/dump.c b/libavformat/dump.c
> > index 117c681..55ac129 100644
> > --- a/libavformat/dump.c
> > +++ b/libavformat/dump.c
> > @@ -34,6 +34,7 @@
> >  #include "libavutil/replaygain.h"
> >  #include "libavutil/spherical.h"
> >  #include "libavutil/stereo3d.h"
> > +#include "libavutil/timecode.h"
> >  
> >  #include "avformat.h"
> >  
> > @@ -402,6 +403,22 @@ static void dump_dovi_conf(void *ctx, 
> > AVPacketSideData* sd)
> > dovi->dv_bl_signal_compatibility_id);
> >  }
> >  
> > +static void dump_s12m_timecode(void *ctx, AVPacketSideData *sd)
> 
> const AVPacketSideData * please.

will fix it 

> 
> > +{
> > +uint32_t *tc = (uint32_t *)sd->data;
> 
> const uint32_t *

will fix it

> 
> > +
> > +if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
> > +av_log(ctx, AV_LOG_ERROR, "invalid data\n");
> > +return;
> > +}
> > +
> > +for (int j = 1; j <= tc[0]; j++) {
> > +char tcbuf[AV_TIMECODE_STR_SIZE];
> > +av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
> > +av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", 
> > " : "");
> > +}
> > +}
> > +
> >  static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
> >  {
> >  int i;
> > @@ -468,6 +485,10 @@ static void dump_sidedata(void *ctx, AVStream *st, 
> > const char *indent)
> >  av_log(ctx, AV_LOG_INFO, "DOVI configuration record: ");
> >  dump_dovi_conf(ctx, );

Re: [FFmpeg-devel] [PATCH]libavfilter/asrc_atone.c : generate algorithmic music

2020-06-30 Thread Nicolas George
Ashutosh Pradhan (12020-06-30):
> Yes.
> Windows doesn't have the recommended Fluid_R3 General Midi SoundFont file.
> So one has to enter the path every time.

Neither doses Linux.

It may be installed on the system, but not necessarily at this path. A
better solution needs to be found. The library probably has a mechanism
for a default path.

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 v6 1/2] libavcodec/pgxdec: Add PGX decoder

2020-06-30 Thread gautamramk
From: Gautam Ramakrishnan 

This patch adds a pgx decoder.
---
 Changelog   |   1 +
 doc/general.texi|   2 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/codec_desc.c |   7 ++
 libavcodec/codec_id.h   |   1 +
 libavcodec/pgxdec.c | 199 
 libavcodec/version.h|   2 +-
 8 files changed, 213 insertions(+), 1 deletion(-)
 create mode 100644 libavcodec/pgxdec.c

diff --git a/Changelog b/Changelog
index a60e7d2eb8..1bb9931c0d 100644
--- a/Changelog
+++ b/Changelog
@@ -4,6 +4,7 @@ releases are sorted from youngest to oldest.
 version :
 - AudioToolbox output device
 - MacCaption demuxer
+- PGX decoder
 
 
 version 4.3:
diff --git a/doc/general.texi b/doc/general.texi
index ea34b963b5..53d556c56c 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -751,6 +751,8 @@ following image formats are supported:
 @tab Portable GrayMap image
 @item PGMYUV   @tab X @tab X
 @tab PGM with U and V components in YUV 4:2:0
+@item PGX  @tab   @tab X
+@tab PGX file decoder
 @item PIC  @tab @tab X
 @tab Pictor/PC Paint
 @item PNG  @tab X @tab X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 5a6ea59715..12aa43fe51 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -536,6 +536,7 @@ OBJS-$(CONFIG_PGM_ENCODER) += pnmenc.o
 OBJS-$(CONFIG_PGMYUV_DECODER)  += pnmdec.o pnm.o
 OBJS-$(CONFIG_PGMYUV_ENCODER)  += pnmenc.o
 OBJS-$(CONFIG_PGSSUB_DECODER)  += pgssubdec.o
+OBJS-$(CONFIG_PGX_DECODER) += pgxdec.o
 OBJS-$(CONFIG_PICTOR_DECODER)  += pictordec.o cga_data.o
 OBJS-$(CONFIG_PIXLET_DECODER)  += pixlet.o
 OBJS-$(CONFIG_PJS_DECODER) += textdec.o ass.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index fa0c08d42e..a5048290f7 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -238,6 +238,7 @@ extern AVCodec ff_pgm_encoder;
 extern AVCodec ff_pgm_decoder;
 extern AVCodec ff_pgmyuv_encoder;
 extern AVCodec ff_pgmyuv_decoder;
+extern AVCodec ff_pgx_decoder;
 extern AVCodec ff_pictor_decoder;
 extern AVCodec ff_pixlet_decoder;
 extern AVCodec ff_png_encoder;
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index 9f8847544f..67e0a3055c 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1405,6 +1405,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("AVS2-P2/IEEE1857.4"),
 .props = AV_CODEC_PROP_LOSSY,
 },
+{
+.id= AV_CODEC_ID_PGX,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "pgx",
+.long_name = NULL_IF_CONFIG_SMALL("PGX (JPEG2000 Test Format)"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
+},
 {
 .id= AV_CODEC_ID_Y41P,
 .type  = AVMEDIA_TYPE_VIDEO,
diff --git a/libavcodec/codec_id.h b/libavcodec/codec_id.h
index d885962c9c..896ecb0ce0 100644
--- a/libavcodec/codec_id.h
+++ b/libavcodec/codec_id.h
@@ -241,6 +241,7 @@ enum AVCodecID {
 AV_CODEC_ID_SCREENPRESSO,
 AV_CODEC_ID_RSCC,
 AV_CODEC_ID_AVS2,
+AV_CODEC_ID_PGX,
 
 AV_CODEC_ID_Y41P = 0x8000,
 AV_CODEC_ID_AVRP,
diff --git a/libavcodec/pgxdec.c b/libavcodec/pgxdec.c
new file mode 100644
index 00..c9e07c1e55
--- /dev/null
+++ b/libavcodec/pgxdec.c
@@ -0,0 +1,199 @@
+/*
+ * PGX image format
+ * Copyright (c) 2020 Gautam Ramakrishnan
+ *
+ * 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 "avcodec.h"
+#include "internal.h"
+#include "bytestream.h"
+#include "libavutil/imgutils.h"
+
+typedef struct PGXContext {
+GetByteContext  g;
+} PGXContext;
+
+static int pgx_get_number(AVCodecContext *avctx, PGXContext * const s) {
+int ret = -1;
+char digit;
+
+while (1) {
+uint64_t temp;
+if (!bytestream2_get_bytes_left(>g))
+return -1;
+digit = bytestream2_get_byte(>g);
+if (digit == ' ' || digit == 0xA || digit == 0xD)
+break;
+else if (digit < '0' || digit > '9')
+return -1;
+
+if (ret < 0)
+ret = 0;
+
+temp = 10L * ret + (digit - '0');
+if 

Re: [FFmpeg-devel] [PATCH]libavfilter/asrc_atone.c : generate algorithmic music

2020-06-30 Thread Ashutosh Pradhan
On Mon, Jun 29, 2020 at 6:53 PM Moritz Barsnick  wrote:

> On Thu, Jun 25, 2020 at 21:15:06 +0530, Ashutosh Pradhan wrote:
> > Generate algorithmic riff music. Changed to activate api.
>
> This commit doesn't change to activate API, as it introduces this
> filter. So that sentence doesn't belong here.
>
> >  - Real War KVAG muxer
> > -
> > +- atone filter
>
> Don't remove the empty line.
>
> >--enable-libfliteenable flite (voice synthesis) support via
> libflite [no]
> > +  --enable-libfluidsynth   enable libfluidsynth support for fluidsynth
> [no]
>
> "for fluidsynth"?. Perhaps "for atone source".
>
Will change to above.

>
> >  atempo_filter_select="rdft"
> > +atone_filter_deps="libfluidsynth"
>
> > +@item sfont
> > +Specify the location of soundfont file. Default value is
> > +"/usr/share/sounds/sf2/FluidR3_GM.sf2"(for linux).
>
> For Linux - and elsewhere?
> It will be the same path on all Unixes, but meaningless under Windows,
> I guess.
>
Yes.
Windows doesn't have the recommended Fluid_R3 General Midi SoundFont file.
So one has to enter the path every time.

>
> > +++ b/libavfilter/Makefile
> > @@ -152,6 +152,7 @@ OBJS-$(CONFIG_FLITE_FILTER)  +=
> asrc_flite.o
> >  OBJS-$(CONFIG_HILBERT_FILTER)+= asrc_hilbert.o
> >  OBJS-$(CONFIG_SINC_FILTER)   += asrc_sinc.o
> >  OBJS-$(CONFIG_SINE_FILTER)   += asrc_sine.o
> > +OBJS-$(CONFIG_ATONE_FILTER)  += asrc_atone.o
>
> I believe the audio sources are meant to be sorted alphabetically (by
> CONFIG_*).
>
> > --- a/libavfilter/allfilters.c
> > +++ b/libavfilter/allfilters.c
> > @@ -146,6 +146,7 @@ extern AVFilter ff_asrc_flite;
> >  extern AVFilter ff_asrc_hilbert;
> >  extern AVFilter ff_asrc_sinc;
> >  extern AVFilter ff_asrc_sine;
> > +extern AVFilter ff_asrc_atone;
>
> Same here.
>
> > +#include 
>
> > +s->beat_dur = 6/s->beats_pm;
> > +/*get change interval in frames/sec*/
> > +s->changerate = (4*s->beat_dur)*s->sample_rate/s->nb_samples;
> > +if (s->changerate<1.0)
> > +s->changerate = 1.0;
>
> Please leave single spaces around the operators such as '/', '*', '<'.
>
> > +s->numriffs = sizeof(riff)/(NPR* sizeof(int));
>
> Same here.
>
> > +for (int i = 0; i < s->numriffs*NPR ; i++)
>
> And here.
>
> > +if (s->framecount == INT_MAX)
> > +   s->framecount = 0;
>
> Indentation.
>
> > +for (int i = 0; i <
> sizeof(GM_instrument_list)/sizeof(GM_instrument_list[0]); i++)
>
> Use macro FF_ARRAY_ELEMS
>
> > +if (strcmp(GM_instrument_list[i], instrument) == 0)
> > +return i;
> > +
> > +return 0;
> > +}
>
> If this doesn't match any string, it returns 0. It also returns 0 if it
> matches "Acoustic-Grand". Is that correct? (In find_percussion_track(),
> you return i instead.)
>
I didn't want to output an error incase the instrument did not match. I
forgot to update 0 with the number of the default instrument. I will update
that.

>
> > +static void schedule_noteon(int chan, short key, unsigned int ticks,
> int velocity, AtoneContext *s)
> > +{
> > +   fluid_event_t *ev = new_fluid_event();
>
> Indentation.
>
> > +unsigned rand = av_lfg_get(>r)/2;
> [...]
> > +riff = rand%s->numriffs;
>
> Spaces around operators, please.
>
> > +if (3*i < numbars)
> > +return (100 - (90*i)/numbars);
> > +else if (3*i > 2*numbars)
> > +return (40 + (90*i)/numbars);
>
> Same here.
>
> > +/*Determine the pattern, tempo (to paly as 8th, 16th or 32nd notes) and
> add the riffs to sequencer
>
> "play"
>
> > +Refernce: http://peterlangston.com/Papers/amc.pdf */
>
> "Reference"
>
> > +AVFrame *frame;
> > +int  nb_samples;
>   ^^ two spaces, drop one.
>
> > +ret = ff_set_common_formats (ctx, formats);
>   ^ drop the space
>
> > +typedef struct
> > +{
>
> Bracket on the same line.
>
> > +Refernce: http://peterlangston.com/Papers/amc.pdf */
>
> "Reference".
>
>
> Regards,
> Moritz
> ___
> 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 v4 2/2] API: add AV_PKT_DATA_S12M_TIMECODE to AVPacketSideDataType

2020-06-30 Thread Andreas Rheinhardt
lance.lmw...@gmail.com:
> From: Limin Wang 
> 
> Signed-off-by: Limin Wang 
> ---
>  doc/APIchanges|  3 +++
>  libavcodec/avpacket.c |  1 +
>  libavcodec/decode.c   |  1 +
>  libavcodec/packet.h   |  8 
>  libavcodec/version.h  |  2 +-
>  libavformat/dump.c| 21 +
>  6 files changed, 35 insertions(+), 1 deletion(-)
> 
> diff --git a/doc/APIchanges b/doc/APIchanges
> index 1d6cc36..7cad7fa 100644
> --- a/doc/APIchanges
> +++ b/doc/APIchanges
> @@ -15,6 +15,9 @@ libavutil: 2017-10-21
>  
>  API changes, most recent first:
>  
> +2020-06-xx - xx - lavc 58.94.100 - packet.h
> +  Add AV_PKT_DATA_S12M_TIMECODE.
> +
>  2020-06-12 - b09fb030c1 - lavu 56.55.100 - pixdesc.h
>Add AV_PIX_FMT_X2RGB10.
>  
> diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
> index dce26cb..4801163 100644
> --- a/libavcodec/avpacket.c
> +++ b/libavcodec/avpacket.c
> @@ -400,6 +400,7 @@ const char *av_packet_side_data_name(enum 
> AVPacketSideDataType type)
>  case AV_PKT_DATA_PRFT:   return "Producer Reference 
> Time";
>  case AV_PKT_DATA_ICC_PROFILE:return "ICC Profile";
>  case AV_PKT_DATA_DOVI_CONF:  return "DOVI configuration 
> record";
> +case AV_PKT_DATA_S12M_TIMECODE:  return "SMPTE ST 12-1:2014 
> timecode";
>  }
>  return NULL;
>  }
> diff --git a/libavcodec/decode.c b/libavcodec/decode.c
> index de9c079..f2244fc 100644
> --- a/libavcodec/decode.c
> +++ b/libavcodec/decode.c
> @@ -1699,6 +1699,7 @@ int ff_decode_frame_props(AVCodecContext *avctx, 
> AVFrame *frame)
>  { AV_PKT_DATA_CONTENT_LIGHT_LEVEL,
> AV_FRAME_DATA_CONTENT_LIGHT_LEVEL },
>  { AV_PKT_DATA_A53_CC, AV_FRAME_DATA_A53_CC },
>  { AV_PKT_DATA_ICC_PROFILE,AV_FRAME_DATA_ICC_PROFILE 
> },
> +{ AV_PKT_DATA_S12M_TIMECODE,  
> AV_FRAME_DATA_S12M_TIMECODE },
>  };
>  
>  if (pkt) {
> diff --git a/libavcodec/packet.h b/libavcodec/packet.h
> index 96f237f..232af69 100644
> --- a/libavcodec/packet.h
> +++ b/libavcodec/packet.h
> @@ -283,6 +283,14 @@ enum AVPacketSideDataType {
>  AV_PKT_DATA_DOVI_CONF,
>  
>  /**
> + * Timecode which conforms to SMPTE ST 12-1:2014. The data is an array 
> of 4 uint32_t
> + * where the first uint32_t describes how many (1-3) of the other 
> timecodes are used.
> + * The timecode format is described in the commenets of 
> av_timecode_get_smpte_from_framenum()
> + * function in libavutil/timecode.h.
> + */
> +AV_PKT_DATA_S12M_TIMECODE,
> +
> +/**
>   * The number of side data types.
>   * This is not part of the public API/ABI in the sense that it may
>   * change when new side data types are added.
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 0359302..482cc6d 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -28,7 +28,7 @@
>  #include "libavutil/version.h"
>  
>  #define LIBAVCODEC_VERSION_MAJOR  58
> -#define LIBAVCODEC_VERSION_MINOR  93
> +#define LIBAVCODEC_VERSION_MINOR  94
>  #define LIBAVCODEC_VERSION_MICRO 100
>  
>  #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
> diff --git a/libavformat/dump.c b/libavformat/dump.c
> index 117c681..55ac129 100644
> --- a/libavformat/dump.c
> +++ b/libavformat/dump.c
> @@ -34,6 +34,7 @@
>  #include "libavutil/replaygain.h"
>  #include "libavutil/spherical.h"
>  #include "libavutil/stereo3d.h"
> +#include "libavutil/timecode.h"
>  
>  #include "avformat.h"
>  
> @@ -402,6 +403,22 @@ static void dump_dovi_conf(void *ctx, AVPacketSideData* 
> sd)
> dovi->dv_bl_signal_compatibility_id);
>  }
>  
> +static void dump_s12m_timecode(void *ctx, AVPacketSideData *sd)

const AVPacketSideData * please.

> +{
> +uint32_t *tc = (uint32_t *)sd->data;

const uint32_t *

> +
> +if ((sd->size != sizeof(uint32_t) * 4) || (tc[0] > 3)) {
> +av_log(ctx, AV_LOG_ERROR, "invalid data\n");
> +return;
> +}
> +
> +for (int j = 1; j <= tc[0]; j++) {
> +char tcbuf[AV_TIMECODE_STR_SIZE];
> +av_timecode_make_smpte_tc_string(tcbuf, tc[j], 0);
> +av_log(ctx, AV_LOG_INFO, "timecode - %s%s", tcbuf, j != tc[0] ? ", " 
> : "");
> +}
> +}
> +
>  static void dump_sidedata(void *ctx, AVStream *st, const char *indent)
>  {
>  int i;
> @@ -468,6 +485,10 @@ static void dump_sidedata(void *ctx, AVStream *st, const 
> char *indent)
>  av_log(ctx, AV_LOG_INFO, "DOVI configuration record: ");
>  dump_dovi_conf(ctx, );
>  break;
> +case AV_PKT_DATA_S12M_TIMECODE:
> +av_log(ctx, AV_LOG_INFO, "SMPTE ST 12-1:2014: ");
> +dump_s12m_timecode(ctx, );

FYI: I sent a patch to avoid the AVPacketSideData on the stack and in
this case the latter of these two patches needs to be adapted (in your
case: remove "&").

> +break;
>  default:
>  

[FFmpeg-devel] [PATCH] avcodec/nvenc: Video Codec SDK 10 features support

2020-06-30 Thread Roman Arzumanyan
Hello,

This patch adds Video Codec SDK 10 features support:

  *   Presets and tuning info
  *   Multipass encode modes
  *   Low Delay Key Frame Scale


0001-Adding-SDK10-features-support.patch
Description: 0001-Adding-SDK10-features-support.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 v4 1/2] avutil/timecode: add description for SMPTE binary format

2020-06-30 Thread Nicolas George
lance.lmw...@gmail.com (12020-06-30):
> Below is my update by your suggestion, please help to review.

Fine by me. But it was only about form. I do not know timecodes at all,
so the semantic of the doc is beyond my skills.

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 v4 1/2] avutil/timecode: add description for SMPTE binary format

2020-06-30 Thread lance . lmwang
On Tue, Jun 30, 2020 at 12:28:34PM +0200, Nicolas George wrote:
> lance.lmw...@gmail.com (12020-06-30):
> > From: Limin Wang 
> > 
> > AV_FRAME_DATA_S12M_TIMECODE is public API, so user need to know its format
> > by the API header instead of reading the code.
> > 
> > Signed-off-by: Limin Wang 
> > ---
> >  libavutil/frame.h|  4 ++--
> >  libavutil/timecode.h | 16 +++-
> >  2 files changed, 17 insertions(+), 3 deletions(-)
> > 
> > diff --git a/libavutil/frame.h b/libavutil/frame.h
> > index 3fb8c56..c694b12 100644
> > --- a/libavutil/frame.h
> > +++ b/libavutil/frame.h
> > @@ -162,8 +162,8 @@ enum AVFrameSideDataType {
> >  /**
> >   * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 
> > uint32_t
> >   * where the first uint32_t describes how many (1-3) of the other 
> > timecodes are used.
> > - * The timecode format is described in the 
> > av_timecode_get_smpte_from_framenum()
> > - * function in libavutil/timecode.c.
> > + * The timecode format is described in the comments of 
> > av_timecode_get_smpte_from_framenum()
> > + * function in libavutil/timecode.h.
> >   */
> >  AV_FRAME_DATA_S12M_TIMECODE,
> >  
> > diff --git a/libavutil/timecode.h b/libavutil/timecode.h
> > index ab38e66..b1c1887 100644
> > --- a/libavutil/timecode.h
> > +++ b/libavutil/timecode.h
> > @@ -61,7 +61,21 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int 
> > fps);
> >   * @param tc   timecode data correctly initialized
> >   * @param framenum frame number
> >   * @return the SMPTE binary representation
> > - *
> 
> > + * the format description as follows, note it's in system byte order:
> 
> Better avoid contractions in documentation.
> 
> The result is uint32_t, not char[4]: there is no byte order.

Sure, will remove the note.

> 
> > + * 31b: color frame flag (0: unsync mode, 1: sync mode)
> > + * 30b: drop  frame flag (0: non drop,1: drop)
> > + * 28b,29b: tens  of frames
> > + * 24-27b:  units of frames
> > + * 23b: PC (NTSC) or BGF0 (PAL)
> > + * 20b,22b: tens  of seconds
> > + * 16-19b:  units of seconds
> > + * 15b: BGF0 (NTSC) or BGF2 (PAL)
> > + * 12b,13b: tens  of minutes
> > + * 8-11b:   units of minutes
> > + * 7b:  BGF2 (NTSC) or PC (PAL)
> > + * 6b:  BGF1
> > + * 4b,5b:   tens  of hours
> > + * 0b-3b:   units of hours
> 
> It seems more logical in the opposite order.
> 
> I do not think this b suffix is very standard. Better be explicit:
> 
>  * bits 24-27: units of frames
> 
> Also, no reason to make a special case when there are exactly two.
> 
> And since several numbers are stored the same way, I would suggest to
> regroup:
> 
>  * bits 8-13: minutes, in BCD
>  * ...
>  * BCD numbers (6 bits): 4 lower bits for units, 2 higher bits for tens.

Below is my update by your suggestion, please help to review.

MPTE binary representation
+  * the format description as follows:
+  * bits 0-5:   hours, in BCD
+  * bits 6: BGF1
+  * bits 7: BGF2 (NTSC) or PC (PAL)
+  * bits 8-13:  minutes, in BCD
+  * bits 15:BGF0 (NTSC) or BGF2 (PAL)
+  * bits 16-21: seconds, in BCD
+  * bits 23:PC (NTSC) or BGF0 (PAL)
+  * bits 24-29: frames, in BCD
+  * bits 30:drop  frame flag (0: non drop,1: drop)
+  * bits 31:color frame flag (0: unsync mode, 1: sync mode)
+  * @note BCD numbers (6 bits): 4 lower bits for units, 2 higher bits for tens.

> >   *   you do NOT have to call av_timecode_adjust_ntsc_framenum2().
> >   * @note The frame number is relative to tc->start.
> 
> Regards,
> 
> -- 
>   Nicolas George



-- 
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 v6 2/2] libavformat/img2dec: Added pgx demuxer

2020-06-30 Thread gautamramk
From: Gautam Ramakrishnan 

This patch adds support to demux pgx file
format.
---
 libavformat/allformats.c | 1 +
 libavformat/img2dec.c| 9 +
 libavformat/version.h| 2 +-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 97fd06debb..f8527b1fd4 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -488,6 +488,7 @@ extern AVInputFormat  ff_image_pbm_pipe_demuxer;
 extern AVInputFormat  ff_image_pcx_pipe_demuxer;
 extern AVInputFormat  ff_image_pgmyuv_pipe_demuxer;
 extern AVInputFormat  ff_image_pgm_pipe_demuxer;
+extern AVInputFormat  ff_image_pgx_pipe_demuxer;
 extern AVInputFormat  ff_image_pictor_pipe_demuxer;
 extern AVInputFormat  ff_image_png_pipe_demuxer;
 extern AVInputFormat  ff_image_ppm_pipe_demuxer;
diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c
index ee7ceed08f..a7e89cd056 100644
--- a/libavformat/img2dec.c
+++ b/libavformat/img2dec.c
@@ -1000,6 +1000,14 @@ static int pgmyuv_probe(const AVProbeData *p) // custom 
FFmpeg format recognized
 return ret && av_match_ext(p->filename, "pgmyuv") ? ret : 0;
 }
 
+static int pgx_probe(const AVProbeData *p)
+{
+const uint8_t *b = p->buf;
+if (!memcmp(b, "PG ML ", 6))
+return AVPROBE_SCORE_EXTENSION + 1;
+return 0;
+}
+
 static int ppm_probe(const AVProbeData *p)
 {
 return pnm_magic_check(p, 3) || pnm_magic_check(p, 6) ? pnm_probe(p) : 0;
@@ -1094,6 +1102,7 @@ IMAGEAUTO_DEMUXER(pbm, AV_CODEC_ID_PBM)
 IMAGEAUTO_DEMUXER(pcx, AV_CODEC_ID_PCX)
 IMAGEAUTO_DEMUXER(pgm, AV_CODEC_ID_PGM)
 IMAGEAUTO_DEMUXER(pgmyuv,  AV_CODEC_ID_PGMYUV)
+IMAGEAUTO_DEMUXER(pgx, AV_CODEC_ID_PGX)
 IMAGEAUTO_DEMUXER(pictor,  AV_CODEC_ID_PICTOR)
 IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG)
 IMAGEAUTO_DEMUXER(ppm, AV_CODEC_ID_PPM)
diff --git a/libavformat/version.h b/libavformat/version.h
index 3c1957b00c..75c03fde0a 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -32,7 +32,7 @@
 // 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  47
+#define LIBAVFORMAT_VERSION_MINOR  48
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-- 
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/2] avformat/dump: Use const where appropriate

2020-06-30 Thread Andreas Rheinhardt
Also switch to using a pointer to access stream side data instead of
copying the stream's AVPacketSideData.

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/dump.c | 91 --
 1 file changed, 48 insertions(+), 43 deletions(-)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 117c68145c..3c76edfee4 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -131,10 +131,10 @@ static void print_fps(double d, const char *postfix)
 av_log(NULL, AV_LOG_INFO, "%1.0fk %s", d / 1000, postfix);
 }
 
-static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
+static void dump_metadata(void *ctx, const AVDictionary *m, const char *indent)
 {
 if (m && !(av_dict_count(m) == 1 && av_dict_get(m, "language", NULL, 0))) {
-AVDictionaryEntry *tag = NULL;
+const AVDictionaryEntry *tag = NULL;
 
 av_log(ctx, AV_LOG_INFO, "%sMetadata:\n", indent);
 while ((tag = av_dict_get(m, "", tag, AV_DICT_IGNORE_SUFFIX)))
@@ -158,7 +158,7 @@ static void dump_metadata(void *ctx, AVDictionary *m, const 
char *indent)
 }
 
 /* param change side data*/
-static void dump_paramchange(void *ctx, AVPacketSideData *sd)
+static void dump_paramchange(void *ctx, const AVPacketSideData *sd)
 {
 int size = sd->size;
 const uint8_t *data = sd->data;
@@ -235,15 +235,15 @@ static void print_peak(void *ctx, const char *str, 
uint32_t peak)
 av_log(ctx, AV_LOG_INFO, ", ");
 }
 
-static void dump_replaygain(void *ctx, AVPacketSideData *sd)
+static void dump_replaygain(void *ctx, const AVPacketSideData *sd)
 {
-AVReplayGain *rg;
+const AVReplayGain *rg;
 
 if (sd->size < sizeof(*rg)) {
 av_log(ctx, AV_LOG_ERROR, "invalid data");
 return;
 }
-rg = (AVReplayGain*)sd->data;
+rg = (const AVReplayGain *)sd->data;
 
 print_gain(ctx, "track gain", rg->track_gain);
 print_peak(ctx, "track peak", rg->track_peak);
@@ -251,16 +251,16 @@ static void dump_replaygain(void *ctx, AVPacketSideData 
*sd)
 print_peak(ctx, "album peak", rg->album_peak);
 }
 
-static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
+static void dump_stereo3d(void *ctx, const AVPacketSideData *sd)
 {
-AVStereo3D *stereo;
+const AVStereo3D *stereo;
 
 if (sd->size < sizeof(*stereo)) {
 av_log(ctx, AV_LOG_ERROR, "invalid data");
 return;
 }
 
-stereo = (AVStereo3D *)sd->data;
+stereo = (const AVStereo3D *)sd->data;
 
 av_log(ctx, AV_LOG_INFO, "%s", av_stereo3d_type_name(stereo->type));
 
@@ -268,9 +268,9 @@ static void dump_stereo3d(void *ctx, AVPacketSideData *sd)
 av_log(ctx, AV_LOG_INFO, " (inverted)");
 }
 
-static void dump_audioservicetype(void *ctx, AVPacketSideData *sd)
+static void dump_audioservicetype(void *ctx, const AVPacketSideData *sd)
 {
-enum AVAudioServiceType *ast = (enum AVAudioServiceType *)sd->data;
+const enum AVAudioServiceType *ast = (const enum AVAudioServiceType 
*)sd->data;
 
 if (sd->size < sizeof(*ast)) {
 av_log(ctx, AV_LOG_ERROR, "invalid data");
@@ -311,9 +311,9 @@ static void dump_audioservicetype(void *ctx, 
AVPacketSideData *sd)
 }
 }
 
-static void dump_cpb(void *ctx, AVPacketSideData *sd)
+static void dump_cpb(void *ctx, const AVPacketSideData *sd)
 {
-AVCPBProperties *cpb = (AVCPBProperties *)sd->data;
+const AVCPBProperties *cpb = (const AVCPBProperties *)sd->data;
 
 if (sd->size < sizeof(*cpb)) {
 av_log(ctx, AV_LOG_ERROR, "invalid data");
@@ -334,8 +334,10 @@ static void dump_cpb(void *ctx, AVPacketSideData *sd)
 av_log(ctx, AV_LOG_INFO, "vbv_delay: %"PRIu64"", cpb->vbv_delay);
 }
 
-static void dump_mastering_display_metadata(void *ctx, AVPacketSideData* sd) {
-AVMasteringDisplayMetadata* metadata = 
(AVMasteringDisplayMetadata*)sd->data;
+static void dump_mastering_display_metadata(void *ctx, const AVPacketSideData 
*sd)
+{
+const AVMasteringDisplayMetadata *metadata =
+(const AVMasteringDisplayMetadata *)sd->data;
 av_log(ctx, AV_LOG_INFO, "Mastering Display Metadata, "
"has_primaries:%d has_luminance:%d "
"r(%5.4f,%5.4f) g(%5.4f,%5.4f) b(%5.4f %5.4f) wp(%5.4f, %5.4f) "
@@ -351,17 +353,19 @@ static void dump_mastering_display_metadata(void *ctx, 
AVPacketSideData* sd) {
av_q2d(metadata->min_luminance), av_q2d(metadata->max_luminance));
 }
 
-static void dump_content_light_metadata(void *ctx, AVPacketSideData* sd)
+static void dump_content_light_metadata(void *ctx, const AVPacketSideData *sd)
 {
-AVContentLightMetadata* metadata = (AVContentLightMetadata*)sd->data;
+const AVContentLightMetadata *metadata =
+(const AVContentLightMetadata *)sd->data;
 av_log(ctx, AV_LOG_INFO, "Content Light Level Metadata, "
"MaxCLL=%d, MaxFALL=%d",
metadata->MaxCLL, metadata->MaxFALL);
 }
 
-static void dump_spherical(void *ctx, AVCodecParameters *par, AVPacketSideData 
*sd)
+static void 

[FFmpeg-devel] [PATCH 2/2] avformat/dump: Use intermediate pointer for access to programs array

2020-06-30 Thread Andreas Rheinhardt
Improves readability.

Signed-off-by: Andreas Rheinhardt 
---
 libavformat/dump.c | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libavformat/dump.c b/libavformat/dump.c
index 3c76edfee4..1083d7db37 100644
--- a/libavformat/dump.c
+++ b/libavformat/dump.c
@@ -679,17 +679,18 @@ void av_dump_format(AVFormatContext *ic, int index,
 if (ic->nb_programs) {
 int j, k, total = 0;
 for (j = 0; j < ic->nb_programs; j++) {
-const AVDictionaryEntry *name = 
av_dict_get(ic->programs[j]->metadata,
+const AVProgram *program = ic->programs[j];
+const AVDictionaryEntry *name = av_dict_get(program->metadata,
 "name", NULL, 0);
-av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", ic->programs[j]->id,
+av_log(NULL, AV_LOG_INFO, "  Program %d %s\n", program->id,
name ? name->value : "");
-dump_metadata(NULL, ic->programs[j]->metadata, "");
-for (k = 0; k < ic->programs[j]->nb_stream_indexes; k++) {
-dump_stream_format(ic, ic->programs[j]->stream_index[k],
+dump_metadata(NULL, program->metadata, "");
+for (k = 0; k < program->nb_stream_indexes; k++) {
+dump_stream_format(ic, program->stream_index[k],
index, is_output);
-printed[ic->programs[j]->stream_index[k]] = 1;
+printed[program->stream_index[k]] = 1;
 }
-total += ic->programs[j]->nb_stream_indexes;
+total += program->nb_stream_indexes;
 }
 if (total < ic->nb_streams)
 av_log(NULL, AV_LOG_INFO, "  No Program\n");
-- 
2.20.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] libavcodec/jpeg2000.c: Precinct size check removed

2020-06-30 Thread Michael Niedermayer
On Mon, Jun 29, 2020 at 11:29:06PM +0530, gautamr...@gmail.com wrote:
> From: Gautam Ramakrishnan 
> 
> This patch removes a check which throws an error if
> the log2 precinct width/height is 0. The standard allows
> the first component to have 0 as the log2 width/height.
> However, to ensure proper intialization of coding style,
> an extra check has been added.
> ---
>  libavcodec/jpeg2000.c| 3 ---
>  libavcodec/jpeg2000.h| 1 +
>  libavcodec/jpeg2000dec.c | 6 --
>  3 files changed, 5 insertions(+), 5 deletions(-)

will apply

thx

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

The misfortune of the wise is better than the prosperity of the fool.
-- Epicurus


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] Ticket #8750 Add inline function for the vec_xl intrinsic in non-VSX environments

2020-06-30 Thread Chip Kerchner


ffmpeg_altivec_yuv2rgb_novsx.patch
Description: Binary data
___
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] avcodec/wmalosslessdec: fix overflow with pred in revert_cdlms

2020-06-30 Thread Michael Niedermayer
On Sun, Jun 28, 2020 at 01:46:52AM +0200, Michael Niedermayer wrote:
> Fixes: signed integer overflow: 2048 + 2147483646 cannot be represented in 
> type 'int'
> Fixes: 
> 23538/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5227567073460224
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/wmalosslessdec.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

will apply

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

Any man who breaks a law that conscience tells him is unjust and willingly 
accepts the penalty by staying in jail in order to arouse the conscience of 
the community on the injustice of the law is at that moment expressing the 
very highest respect for law. - Martin Luther King Jr


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/2] avutil/common: Fix integer overflow in av_ceil_log2_c()

2020-06-30 Thread Michael Niedermayer
On Sun, Jun 28, 2020 at 01:46:53AM +0200, Michael Niedermayer wrote:
> Fixes: left shift of 1913647649 by 1 places cannot be represented in type 
> 'int'
> Fixes: 
> 23572/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5082619795734528
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavutil/common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

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

Never trust a computer, one day, it may think you are the virus. -- Compn


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 v4 1/2] avutil/timecode: add description for SMPTE binary format

2020-06-30 Thread Nicolas George
lance.lmw...@gmail.com (12020-06-30):
> From: Limin Wang 
> 
> AV_FRAME_DATA_S12M_TIMECODE is public API, so user need to know its format
> by the API header instead of reading the code.
> 
> Signed-off-by: Limin Wang 
> ---
>  libavutil/frame.h|  4 ++--
>  libavutil/timecode.h | 16 +++-
>  2 files changed, 17 insertions(+), 3 deletions(-)
> 
> diff --git a/libavutil/frame.h b/libavutil/frame.h
> index 3fb8c56..c694b12 100644
> --- a/libavutil/frame.h
> +++ b/libavutil/frame.h
> @@ -162,8 +162,8 @@ enum AVFrameSideDataType {
>  /**
>   * Timecode which conforms to SMPTE ST 12-1. The data is an array of 4 
> uint32_t
>   * where the first uint32_t describes how many (1-3) of the other 
> timecodes are used.
> - * The timecode format is described in the 
> av_timecode_get_smpte_from_framenum()
> - * function in libavutil/timecode.c.
> + * The timecode format is described in the comments of 
> av_timecode_get_smpte_from_framenum()
> + * function in libavutil/timecode.h.
>   */
>  AV_FRAME_DATA_S12M_TIMECODE,
>  
> diff --git a/libavutil/timecode.h b/libavutil/timecode.h
> index ab38e66..b1c1887 100644
> --- a/libavutil/timecode.h
> +++ b/libavutil/timecode.h
> @@ -61,7 +61,21 @@ int av_timecode_adjust_ntsc_framenum2(int framenum, int 
> fps);
>   * @param tc   timecode data correctly initialized
>   * @param framenum frame number
>   * @return the SMPTE binary representation
> - *

> + * the format description as follows, note it's in system byte order:

Better avoid contractions in documentation.

The result is uint32_t, not char[4]: there is no byte order.

> + * 31b: color frame flag (0: unsync mode, 1: sync mode)
> + * 30b: drop  frame flag (0: non drop,1: drop)
> + * 28b,29b: tens  of frames
> + * 24-27b:  units of frames
> + * 23b: PC (NTSC) or BGF0 (PAL)
> + * 20b,22b: tens  of seconds
> + * 16-19b:  units of seconds
> + * 15b: BGF0 (NTSC) or BGF2 (PAL)
> + * 12b,13b: tens  of minutes
> + * 8-11b:   units of minutes
> + * 7b:  BGF2 (NTSC) or PC (PAL)
> + * 6b:  BGF1
> + * 4b,5b:   tens  of hours
> + * 0b-3b:   units of hours

It seems more logical in the opposite order.

I do not think this b suffix is very standard. Better be explicit:

 * bits 24-27: units of frames

Also, no reason to make a special case when there are exactly two.

And since several numbers are stored the same way, I would suggest to
regroup:

 * bits 8-13: minutes, in BCD
 * ...
 * BCD numbers (6 bits): 4 lower bits for units, 2 higher bits for tens.

>   * @note Frame number adjustment is automatically done in case of drop 
> timecode,
>   *   you do NOT have to call av_timecode_adjust_ntsc_framenum2().
>   * @note The frame number is relative to tc->start.

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] lavu: make AV_TIME_BASE_Q work in C++ code

2020-06-30 Thread Steinar H. Gunderson
On Tue, Jun 30, 2020 at 12:00:24PM +0200, Paul B Mahol wrote:
> So we should suffer instead by applying this patch?

The thousands of projects that include FFmpeg from C++, directly or
indirectly, suggests that the amount of suffering on FFmpeg's part
by supporting inclusion from C++ is not going to be large.
If you add some #ifndef __cplusplus extern "C" ... on each header and then
apply the given patch, I would be surprised if this creates a large
maintenance burden on your behalf.

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

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

Re: [FFmpeg-devel] [PATCH] lavu: make AV_TIME_BASE_Q work in C++ code

2020-06-30 Thread Paul B Mahol
On 6/30/20, Tomas Härdin  wrote:
> lör 2020-06-27 klockan 11:51 +0200 skrev Carl Eugen Hoyos:
>> Am Sa., 27. Juni 2020 um 11:47 Uhr schrieb Tomas Härdin
>> :
>> > fre 2020-06-26 klockan 11:36 +0200 skrev Hendrik Leppkes:
>> > > On Fri, Jun 26, 2020 at 11:31 AM Tomas Härdin 
>> > > wrote:
>> > > > ons 2020-06-24 klockan 21:22 +0200 skrev Carl Eugen Hoyos:
>> > > > > Am Mi., 24. Juni 2020 um 21:10 Uhr schrieb rcombs
>> > > > > :
>> > > > > > ---
>> > > > > >  libavutil/avutil.h | 4 
>> > > > > >  1 file changed, 4 insertions(+)
>> > > > > >
>> > > > > > diff --git a/libavutil/avutil.h b/libavutil/avutil.h
>> > > > > > index 4d633156d1..c11b33f466 100644
>> > > > > > --- a/libavutil/avutil.h
>> > > > > > +++ b/libavutil/avutil.h
>> > > > > > @@ -257,7 +257,11 @@ const char *av_get_media_type_string(enum
>> > > > > > AVMediaType media_type);
>> > > > > >   * Internal time base represented as fractional value
>> > > > > >   */
>> > > > > >
>> > > > > > +#ifdef __cplusplus
>> > > > > > +#define AV_TIME_BASE_Q  AVRational{1, AV_TIME_BASE}
>> > > > > > +#else
>> > > > > >  #define AV_TIME_BASE_Q  (AVRational){1, AV_TIME_BASE}
>> > > > > > +#endif
>> > > > >
>> > > > > The problem with this patch is that it gives C++ users of the
>> > > > > libraries
>> > > > > the feeling that we would care about them and that we would indeed
>> > > > > fix issues.
>> > > > > Given that the contrary is true (at least in the past) and that we
>> > > > > do
>> > > > > not do any specific C++ testing, I believe it is better to let
>> > > > > users
>> > > > > work around this issue (from their point of you).
>> > > >
>> > > > Maybe we should put in a #warning to that effect? Inside an #ifdef
>> > > > __cplusplus
>> > > >
>> > >
>> > > Now that would just be annoying. 99% of the headers work just fine in
>> > > C++, spewing a warning at us for using them would not serve anything.
>> >
>> > Well, if you volunteer to maintain C++ support then sure. Most devs in
>> > this project are C guys. Admittedly this is a bit of a Måns-ism, but
>> > he's no longer involved so.. I don't think anyone is principally
>> > opposed, it's just a question of where to spend developer effort.
>>
>> Not sure why you believe we need a warning:
>> Iiuc, currently AV_TIME_BASE_Q cannot be used from C++ programs,
>> any C++ developer will immediately be made aware of this, no?
>
> True, but it's generating threads on the list like this one on a
> regular basis.
>

So we should suffer instead by applying this patch?

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

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

Re: [FFmpeg-devel] [PATCH] lavu: make AV_TIME_BASE_Q work in C++ code

2020-06-30 Thread Tomas Härdin
lör 2020-06-27 klockan 11:51 +0200 skrev Carl Eugen Hoyos:
> Am Sa., 27. Juni 2020 um 11:47 Uhr schrieb Tomas Härdin :
> > fre 2020-06-26 klockan 11:36 +0200 skrev Hendrik Leppkes:
> > > On Fri, Jun 26, 2020 at 11:31 AM Tomas Härdin  wrote:
> > > > ons 2020-06-24 klockan 21:22 +0200 skrev Carl Eugen Hoyos:
> > > > > Am Mi., 24. Juni 2020 um 21:10 Uhr schrieb rcombs :
> > > > > > ---
> > > > > >  libavutil/avutil.h | 4 
> > > > > >  1 file changed, 4 insertions(+)
> > > > > > 
> > > > > > diff --git a/libavutil/avutil.h b/libavutil/avutil.h
> > > > > > index 4d633156d1..c11b33f466 100644
> > > > > > --- a/libavutil/avutil.h
> > > > > > +++ b/libavutil/avutil.h
> > > > > > @@ -257,7 +257,11 @@ const char *av_get_media_type_string(enum 
> > > > > > AVMediaType media_type);
> > > > > >   * Internal time base represented as fractional value
> > > > > >   */
> > > > > > 
> > > > > > +#ifdef __cplusplus
> > > > > > +#define AV_TIME_BASE_Q  AVRational{1, AV_TIME_BASE}
> > > > > > +#else
> > > > > >  #define AV_TIME_BASE_Q  (AVRational){1, AV_TIME_BASE}
> > > > > > +#endif
> > > > > 
> > > > > The problem with this patch is that it gives C++ users of the 
> > > > > libraries
> > > > > the feeling that we would care about them and that we would indeed
> > > > > fix issues.
> > > > > Given that the contrary is true (at least in the past) and that we do
> > > > > not do any specific C++ testing, I believe it is better to let users
> > > > > work around this issue (from their point of you).
> > > > 
> > > > Maybe we should put in a #warning to that effect? Inside an #ifdef
> > > > __cplusplus
> > > > 
> > > 
> > > Now that would just be annoying. 99% of the headers work just fine in
> > > C++, spewing a warning at us for using them would not serve anything.
> > 
> > Well, if you volunteer to maintain C++ support then sure. Most devs in
> > this project are C guys. Admittedly this is a bit of a Måns-ism, but
> > he's no longer involved so.. I don't think anyone is principally
> > opposed, it's just a question of where to spend developer effort.
> 
> Not sure why you believe we need a warning:
> Iiuc, currently AV_TIME_BASE_Q cannot be used from C++ programs,
> any C++ developer will immediately be made aware of this, no?

True, but it's generating threads on the list like this one on a
regular basis.

/Tomas

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

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

Re: [FFmpeg-devel] [PATCH v1 1/9] lavu/pix_fmt: add P012 pixel format

2020-06-30 Thread Xiang, Haihao

Agree with Mark. P012 and P016 have different significant bits, we should use
different pixfmts, otherwise an extra field in AVFrame is needed for bit depth. 

BTW there are the YUV420P variants for 10 / 12 / 14 / 16 bit in FFmpeg, it would
be better to follow FFmpeg's style to introduce P012 format instead of reusing
P016.

Thanks
Haihao


> Am So., 28. Juni 2020 um 23:01 Uhr schrieb Mark Thompson :
> 
> > FFmpeg has always used pixfmt as defining both the memory layout
> > and which bits are used in that (so, for example, ARGB and 0RGB
> > are not the same thing)
> 
> But they have the same bitdepth per component...
> 
> 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] lavc/qsvenc_hevc: add qmax/qmin support for HEVC encoding

2020-06-30 Thread Fu, Linjie
> From: Zhong Li 
> Sent: Thursday, March 12, 2020 10:07
> To: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Cc: Rogozhkin, Dmitry V ; Fu, Linjie
> 
> Subject: Re: [FFmpeg-devel] [PATCH] lavc/qsvenc_hevc: add qmax/qmin
> support for HEVC encoding
> 
> Linjie Fu  于2020年3月11日周三 下午6:44写道:
> >
> > Add qmax/qmin support for HEVC software bitrate control(SWBRC).
> >
> > Limitations:
> > - RateControlMethod != MFX_RATECONTROL_CQP
> > - with EXTBRC ON
> >
> > Signed-off-by: Dmitry Rogozhkin 
> > Signed-off-by: Linjie Fu 
> > ---
> >
> > Relative code in MSDK for the limitation:
> > https://github.com/Intel-Media-
> SDK/MediaSDK/blob/master/_studio/mfx_lib/encode_hw/hevc/agnostic/g9
> /hevcehw_g9_legacy.cpp#L4267
> >
> >  libavcodec/qsvenc.c  | 11 +--
> >  libavcodec/qsvenc_hevc.c |  2 ++
> >  2 files changed, 7 insertions(+), 6 deletions(-)
> >
> > diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
> > index 52b4e43..2c22eb7 100644
> > --- a/libavcodec/qsvenc.c
> > +++ b/libavcodec/qsvenc.c
> > @@ -732,6 +732,11 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >  if (q->adaptive_b >= 0)
> >  q->extco2.AdaptiveB = q->adaptive_b ?
> MFX_CODINGOPTION_ON : MFX_CODINGOPTION_OFF;
> >  #endif
> > +}
> > +
> > +if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id ==
> AV_CODEC_ID_HEVC) {
> > +if (q->extbrc >= 0)
> > +q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON :
> MFX_CODINGOPTION_OFF;
> >
> >  #if QSV_VERSION_ATLEAST(1, 9)
> >  if (avctx->qmin >= 0 && avctx->qmax >= 0 && avctx->qmin > 
> > avctx-
> >qmax) {
> > @@ -747,12 +752,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >  q->extco2.MaxQPP = q->extco2.MaxQPB = q->extco2.MaxQPI;
> >  }
> >  #endif
> > -}
> > -
> > -if (avctx->codec_id == AV_CODEC_ID_H264 || avctx->codec_id ==
> AV_CODEC_ID_HEVC) {
> > -if (q->extbrc >= 0)
> > -q->extco2.ExtBRC = q->extbrc ? MFX_CODINGOPTION_ON :
> MFX_CODINGOPTION_OFF;
> > -
> >  q->extco2.Header.BufferId = MFX_EXTBUFF_CODING_OPTION2;
> >  q->extco2.Header.BufferSz = sizeof(q->extco2);
> >
> > diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
> > index 27e2232..3bdca7d 100644
> > --- a/libavcodec/qsvenc_hevc.c
> > +++ b/libavcodec/qsvenc_hevc.c
> > @@ -262,6 +262,8 @@ static const AVCodecDefault qsv_enc_defaults[] = {
> >  // same as the x264 default
> >  { "g", "248"   },
> >  { "bf","8" },
> > +{ "qmin",  "-1"},
> > +{ "qmax",  "-1"},
> >  { "trellis",   "-1"},
> >  { "flags", "+cgop" },
> >  #if FF_API_PRIVATE_OPT
> > --
> > 2.7.4
> 
> LGTM, will apply
A kind ping.

- 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] lavfi/vf_vpp_qsv: fix the infinite loop while framerate lower than input

2020-06-30 Thread Fu, Linjie
> From: Zhong Li 
> Sent: Sunday, April 19, 2020 23:00
> To: Fu, Linjie 
> Cc: FFmpeg development discussions and patches  de...@ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH] lavfi/vf_vpp_qsv: fix the infinite loop
> while framerate lower than input
> 
> Fu, Linjie  于2020年2月29日周六 下午5:35写道:
> >
> > > -Original Message-
> > > From: Zhong Li 
> > > Sent: Saturday, February 29, 2020 13:14
> > > To: FFmpeg development discussions and patches  > > de...@ffmpeg.org>
> > > Cc: Fu, Linjie 
> > > Subject: Re: [FFmpeg-devel] [PATCH] lavfi/vf_vpp_qsv: fix the infinite
> loop
> > > while framerate lower than input
> > >
> > > Linjie Fu  于2020年2月28日周五 下午11:34写
> 道:
> > > >
> > > > There are frame droppings in frc while converting into a lower
> framerate,
> > > > and MSDK returns ERROR_MORE_DATA which should be ignored.
> > >
> > > Should be fixed in MSDK instead of working around in FFmpeg?
> >
> > MSDK made decision regarding frame rate conversion. If it's the framerate
> down case,
> > FRC would skip frame without producing an output [1], and request a new
> input frame.
> 
> I can't see the benefit to use MSDK framerate conversion function. Is
> it a good idea to drop it and use ffmpeg native fps filter instead?

Reconsidering this, leaving the filter buggy doesn't seem to be comfortable to 
me,
hence IMHO it'll be better to have this bug fixed.

Ping for this, thx.

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