Re: [FFmpeg-devel] [PATCH v5 2/2] avcodec/libvpxenc: add a way to explicitly set temporal layer id

2020-02-06 Thread James Zern
On Thu, Feb 6, 2020 at 8:58 AM Wonkap Jang
 wrote:
>
> Hi James,
>
> On Wed, Feb 5, 2020 at 5:29 PM James Zern 
> wrote:
>
> > On Mon, Feb 3, 2020 at 5:45 PM Wonkap Jang
> >  wrote:
> > >
> > > Hi
> > >
> > > On Mon, Feb 3, 2020 at 12:45 PM James Zern <
> > jzern-at-google@ffmpeg.org>
> > > wrote:
> > >
> > > > On Mon, Feb 3, 2020 at 10:02 AM Wonkap Jang
> > > >  wrote:
> > > > >
> > > > > In order for rate control to correctly allocate bitrate to each
> > temporal
> > > > > layer, correct temporal layer id has to be set to each frame. This
> > > > > commit provides the ability to set correct temporal layer id for each
> > > > > frame.
> > > > > ---
> > > > >  libavcodec/libvpxenc.c | 13 -
> > > > >  1 file changed, 12 insertions(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > > > > index 6fca05e6b1..2093aa8bca 100644
> > > > > --- a/libavcodec/libvpxenc.c
> > > > > +++ b/libavcodec/libvpxenc.c
> > > > > @@ -1519,11 +1519,22 @@ static int vpx_encode(AVCodecContext *avctx,
> > > > AVPacket *pkt,
> > > > >  #endif
> > > > >  if (frame->pict_type == AV_PICTURE_TYPE_I)
> > > > >  flags |= VPX_EFLAG_FORCE_KF;
> > > > > -if (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id ==
> > > > AV_CODEC_ID_VP8 && frame->metadata) {
> > > > > +if (frame->metadata) {
> > > > >  AVDictionaryEntry* en = av_dict_get(frame->metadata,
> > > > "vp8-flags", NULL, 0);
> > > >
> > > > I think you'll want to check the codec being used for this one still.
> > > > ___
> > > > 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".
> > >
> > >
> > > You want me to check whether it is vp8 or vp9? because... the flags will
> > > work for both, right?
> > >
> >
> > I meant specifically the field called 'vp8-flags', but looking again
> > that looks mostly like it was misnamed. I think there's a mention in
> > doc/encoders.texi about metadata, should that be updated to make
> > explicit reference to this field?
> >
> > [...]
> So.. what is your suggestion?
> just mention in the doc that the vp8-flags is used for both vp8 and vp9 and
> how it is used?
>

Sorry if it wasn't clear, in this case I was referring to the mention
of metadata related to temporal_id:
"No temporal layering flags are provided internally,
relies on flags being passed in using metadata in AVFrame."

The addition of vp8-flags could be a follow up.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 2/3] avformat/tty: Fix division by 0 in probe

2020-02-06 Thread Hendrik Leppkes
On Fri, Feb 7, 2020 at 12:16 AM Michael Niedermayer  wrote:
>
> On Thu, Feb 06, 2020 at 03:27:11PM +0100, Paul B Mahol wrote:
> > Nonsense, why would this code be called with 0 buffer?
>
> I guess because code calls av_probe_input_format3() with a 0 buffer
> its a public function and called by multiple places from our code base
> as well. Theres even code in it to handle the case of a 0 sized input.
>
> The code that triggers it in this case seems to be probing the stream
> content. Its not a 0 byte input file
>

The generic code in the public API calls should probably catch that
then, a probe function really can't do anything meaningful on a NULL
or zero-sized buffer.

- Hendrik
___
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] Fix undefined behavior in ff_configure_buffers_for_index()

2020-02-06 Thread Michael Niedermayer
On Thu, Jan 30, 2020 at 11:23:07AM -0800, Dale Curtis wrote:
> On Wed, Jan 29, 2020 at 10:23 PM Michael Niedermayer 
> wrote:
> 
> > so i think it works but maybe ive missed something, for which values
> > of e2_pts do you see a problem with e1_pts = INT64_MIN?
> >
> 
> For e1_pts = INT64_MIN and e2_pts >= 0 you end up with a negative int64_t
> result for e2_pts - (uint64_t)e1_pts, so it's always < time_tolerance. If
> that's what you intended, then sgtm.

thats what the code would do if the elemnts where large enough to not overflow
so that seems to match whats intended.

Do you see some issue here ?

If the idea is that extreem values are likely invalid and should be treated
special, then yes but to detect such values using the equations overflow
seems not correct. Similarly any other special values if they reach this
function should be checked for more explicitly 

Thanks

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

it is not once nor twice but times without number that the same ideas make
their appearance in the world. -- Aristotle


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

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

Re: [FFmpeg-devel] [PATCH 2/3] avformat/tty: Fix division by 0 in probe

2020-02-06 Thread Michael Niedermayer
On Thu, Feb 06, 2020 at 03:27:11PM +0100, Paul B Mahol wrote:
> Nonsense, why would this code be called with 0 buffer?

I guess because code calls av_probe_input_format3() with a 0 buffer
its a public function and called by multiple places from our code base
as well. Theres even code in it to handle the case of a 0 sized input.

The code that triggers it in this case seems to be probing the stream
content. Its not a 0 byte input file

Thanks


> 
> On 2/6/20, Michael Niedermayer  wrote:
> > Fixes: division by zero
> > Fixes:
> > 20436/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5763229752229888
> >
> > Found-by: continuous fuzzing process
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/tty.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/libavformat/tty.c b/libavformat/tty.c
> > index 60f7e9f87e..854a23c500 100644
> > --- a/libavformat/tty.c
> > +++ b/libavformat/tty.c
> > @@ -53,6 +53,9 @@ static int read_probe(const AVProbeData *p)
> >  {
> >  int cnt = 0;
> >
> > +if (!p->buf_size)
> > +return 0;
> > +
> >  for (int i = 0; i < p->buf_size; i++)
> >  cnt += !!isansicode(p->buf[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 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".

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No great genius has ever existed without some touch of madness. -- Aristotle


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

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

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/cavsdsp: Fix invalid left shifts in cavs_idct8_add_c()

2020-02-06 Thread Michael Niedermayer
On Thu, Feb 06, 2020 at 05:33:00PM +, Andreas Rheinhardt wrote:
> Michael Niedermayer:
> > Fixes: left shift of negative value -107
> > Fixes: 
> > 20398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5725389278412800
> > 
> > Found-by: continuous fuzzing process 
> > https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/cavsdsp.c | 52 ++--
> >  1 file changed, 26 insertions(+), 26 deletions(-)
> > 
> > diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c
> > index 90a67e910c..27413b9ee2 100644
> > --- a/libavcodec/cavsdsp.c
> > +++ b/libavcodec/cavsdsp.c
> > @@ -201,20 +201,20 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t 
> > *block, ptrdiff_t stride)
> >  src[0][0] += 8;
> >  
> >  for( i = 0; i < 8; i++ ) {
> > -const int a0 =  3*src[i][1] - (src[i][7]<<1);
> > -const int a1 =  3*src[i][3] + (src[i][5]<<1);
> > -const int a2 =  (src[i][3]<<1) - 3*src[i][5];
> > -const int a3 =  (src[i][1]<<1) + 3*src[i][7];
> > +const int a0 =  3*src[i][1] - (src[i][7]*2);
> > +const int a1 =  3*src[i][3] + (src[i][5]*2);
> > +const int a2 =  (src[i][3]*2) - 3*src[i][5];
> > +const int a3 =  (src[i][1]*2) + 3*src[i][7];
> >  
> > -const int b4 = ((a0 + a1 + a3)<<1) + a1;
> > -const int b5 = ((a0 - a1 + a2)<<1) + a0;
> > -const int b6 = ((a3 - a2 - a1)<<1) + a3;
> > -const int b7 = ((a0 - a2 - a3)<<1) - a2;
> > +const int b4 = ((a0 + a1 + a3)*2) + a1;
> > +const int b5 = ((a0 - a1 + a2)*2) + a0;
> > +const int b6 = ((a3 - a2 - a1)*2) + a3;
> > +const int b7 = ((a0 - a2 - a3)*2) - a2;
> >  
> > -const int a7 = (src[i][2]<<2) - 10*src[i][6];
> > -const int a6 = (src[i][6]<<2) + 10*src[i][2];
> > -const int a5 = ((src[i][0] - src[i][4]) << 3) + 4;
> > -const int a4 = ((src[i][0] + src[i][4]) << 3) + 4;
> > +const int a7 = (src[i][2]*4) - 10*src[i][6];
> > +const int a6 = (src[i][6]*4) + 10*src[i][2];
> > +const int a5 = ((src[i][0] - src[i][4]) * 8) + 4;
> > +const int a4 = ((src[i][0] + src[i][4]) * 8) + 4;
> >  
> >  const int b0 = a4 + a6;
> >  const int b1 = a5 + a7;
> > @@ -231,20 +231,20 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t 
> > *block, ptrdiff_t stride)
> >  src[i][7] = (b0 - b4) >> 3;
> >  }
> >  for( i = 0; i < 8; i++ ) {
> > -const int a0 =  3*src[1][i] - (src[7][i]<<1);
> > -const int a1 =  3*src[3][i] + (src[5][i]<<1);
> > -const int a2 =  (src[3][i]<<1) - 3*src[5][i];
> > -const int a3 =  (src[1][i]<<1) + 3*src[7][i];
> > -
> > -const int b4 = ((a0 + a1 + a3)<<1) + a1;
> > -const int b5 = ((a0 - a1 + a2)<<1) + a0;
> > -const int b6 = ((a3 - a2 - a1)<<1) + a3;
> > -const int b7 = ((a0 - a2 - a3)<<1) - a2;
> > -
> > -const int a7 = (src[2][i]<<2) - 10*src[6][i];
> > -const int a6 = (src[6][i]<<2) + 10*src[2][i];
> > -const int a5 = (src[0][i] - src[4][i]) << 3;
> > -const int a4 = (src[0][i] + src[4][i]) << 3;
> > +const int a0 =  3*src[1][i] - (src[7][i]*2);
> > +const int a1 =  3*src[3][i] + (src[5][i]*2);
> > +const int a2 =  (src[3][i]*2) - 3*src[5][i];
> > +const int a3 =  (src[1][i]*2) + 3*src[7][i];
> > +
> > +const int b4 = ((a0 + a1 + a3)*2) + a1;
> > +const int b5 = ((a0 - a1 + a2)*2) + a0;
> > +const int b6 = ((a3 - a2 - a1)*2) + a3;
> > +const int b7 = ((a0 - a2 - a3)*2) - a2;
> > +
> > +const int a7 = (src[2][i]*4) - 10*src[6][i];
> > +const int a6 = (src[6][i]*4) + 10*src[2][i];
> > +const int a5 = (src[0][i] - src[4][i]) * 8;
> > +const int a4 = (src[0][i] + src[4][i]) * 8;
> >  
> >  const int b0 = a4 + a6;
> >  const int b1 = a5 + a7;
> > 
> Duplicate of [1] which I consider more aesthetically pleasing (e.g.
> when rewriting "((a0 + a1 + a3)<<1) + a1" via multiplication, one can
> drop the outer parentheses, but you didn't).
> 
> - Andreas
> 
> [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-September/250681.html

will apply your variant

Thanks

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

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 


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] GSoC 2020

2020-02-06 Thread Michael Niedermayer
Hi all

please help fill the 2020 GSoC Ideas page
https://trac.ffmpeg.org/wiki/SponsoringPrograms/GSoC/2020

(This page is key to being acccepted to GSoC)

Thank you

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato


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] Fix undefined behavior in ff_configure_buffers_for_index()

2020-02-06 Thread Dale Curtis
Bump to apply?

- dale

On Thu, Jan 30, 2020 at 3:21 PM Dale Curtis  wrote:

> On Thu, Jan 30, 2020 at 11:23 AM Dale Curtis 
> wrote:
>
>> On Wed, Jan 29, 2020 at 10:23 PM Michael Niedermayer
>>  wrote:
>>
>>> so i think it works but maybe ive missed something, for which values
>>> of e2_pts do you see a problem with e1_pts = INT64_MIN?
>>>
>>
>> For e1_pts = INT64_MIN and e2_pts >= 0 you end up with a negative int64_t
>> result for e2_pts - (uint64_t)e1_pts, so it's always < time_tolerance. If
>> that's what you intended, then sgtm.
>>
>
> Actually, this was a test construction error on my part. In a conditional
> this does evaluate to a uint64_t vs int64_t, so the comparison is valid.
> I've attached your recommended patch. Thanks for your patience.
>
> - dale
>
>
>
___
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] avfilter: add pad opencl filter

2020-02-06 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 configure   |   1 +
 doc/filters.texi|  29 
 libavfilter/Makefile|   1 +
 libavfilter/allfilters.c|   1 +
 libavfilter/opencl/pad.cl   |  34 +
 libavfilter/opencl_source.h |   1 +
 libavfilter/vf_pad_opencl.c | 289 
 7 files changed, 356 insertions(+)
 create mode 100644 libavfilter/opencl/pad.cl
 create mode 100644 libavfilter/vf_pad_opencl.c

diff --git a/configure b/configure
index 58419cd88c..45ba821f8b 100755
--- a/configure
+++ b/configure
@@ -3535,6 +3535,7 @@ overlay_qsv_filter_deps="libmfx"
 overlay_qsv_filter_select="qsvvpp"
 overlay_vulkan_filter_deps="vulkan libglslang"
 owdenoise_filter_deps="gpl"
+pad_opencl_filter_deps="opencl"
 pan_filter_deps="swresample"
 perspective_filter_deps="gpl"
 phase_filter_deps="gpl"
diff --git a/doc/filters.texi b/doc/filters.texi
index f96ba638b2..245968be34 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -21096,6 +21096,35 @@ The inputs have same memory layout for color channels 
, the overlay has addition
 
 @end itemize
 
+@section pad_opencl
+
+Add paddings to the input image, and place the original input at the
+provided @var{x}, @var{y} coordinates.
+
+It accepts the following options:
+
+@table @option
+@item width, w
+@item height, h
+Specify the size of the output image with the
+paddings added. If the value for @var{width} or @var{height} is 0, the
+corresponding input size is used for the output.
+
+The default value of @var{width} and @var{height} is 0.
+
+@item x
+@item y
+Specify the offsets to place the input image at within the padded area,
+with respect to the top/left border of the output image.
+
+The default value of @var{x} and @var{y} is 0.
+
+@item color
+Specify the color of the padded area. For the syntax of this option,
+check the @ref{color syntax,,"Color" section in the ffmpeg-utils
+manual,ffmpeg-utils}.
+@end table
+
 @section prewitt_opencl
 
 Apply the Prewitt operator 
(@url{https://en.wikipedia.org/wiki/Prewitt_operator}) to input video stream.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 3053740dd3..f40849cdf8 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -328,6 +328,7 @@ OBJS-$(CONFIG_OVERLAY_QSV_FILTER)+= 
vf_overlay_qsv.o framesync.o
 OBJS-$(CONFIG_OVERLAY_VULKAN_FILTER) += vf_overlay_vulkan.o vulkan.o
 OBJS-$(CONFIG_OWDENOISE_FILTER)  += vf_owdenoise.o
 OBJS-$(CONFIG_PAD_FILTER)+= vf_pad.o
+OBJS-$(CONFIG_PAD_OPENCL_FILTER) += vf_pad_opencl.o opencl.o 
opencl/pad.o
 OBJS-$(CONFIG_PALETTEGEN_FILTER) += vf_palettegen.o
 OBJS-$(CONFIG_PALETTEUSE_FILTER) += vf_paletteuse.o framesync.o
 OBJS-$(CONFIG_PERMS_FILTER)  += f_perms.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 1052978cd4..49e748ae88 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -312,6 +312,7 @@ extern AVFilter ff_vf_overlay_qsv;
 extern AVFilter ff_vf_overlay_vulkan;
 extern AVFilter ff_vf_owdenoise;
 extern AVFilter ff_vf_pad;
+extern AVFilter ff_vf_pad_opencl;
 extern AVFilter ff_vf_palettegen;
 extern AVFilter ff_vf_paletteuse;
 extern AVFilter ff_vf_perms;
diff --git a/libavfilter/opencl/pad.cl b/libavfilter/opencl/pad.cl
new file mode 100644
index 00..43f95cc2fb
--- /dev/null
+++ b/libavfilter/opencl/pad.cl
@@ -0,0 +1,34 @@
+/*
+ * 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
+ */
+
+const sampler_t sampler = CLK_NORMALIZED_COORDS_FALSE |
+  CLK_FILTER_NEAREST;
+
+__kernel void pad (
+__read_only  image2d_t src,
+__write_only image2d_t dst,
+float4 color,
+int2 xy)
+{
+int2 size_src = get_image_dim(src);
+int2 loc = (int2)(get_global_id(0), get_global_id(1));
+int2 src_pos = (int2)(get_global_id(0) - xy.x, get_global_id(1) - xy.y);
+float4 pixel = read_imagef(src, sampler, src_pos);
+write_imagef(dst, loc, loc.x >= size_src.x + xy.x || loc.y >= size_src.y + 
xy.y ||
+   loc.x <  xy.x || loc.y < xy.y ? color : pixel);
+}
diff --git a/libavfilter/opencl_source.h b/libavfilter/opencl_source.h
index 4e262672ad..7e8133090e 100644
--- 

Re: [FFmpeg-devel] [PATCH 1/3] avcodec/cavsdsp: Fix invalid left shifts in cavs_idct8_add_c()

2020-02-06 Thread Andreas Rheinhardt
Michael Niedermayer:
> Fixes: left shift of negative value -107
> Fixes: 
> 20398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5725389278412800
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/cavsdsp.c | 52 ++--
>  1 file changed, 26 insertions(+), 26 deletions(-)
> 
> diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c
> index 90a67e910c..27413b9ee2 100644
> --- a/libavcodec/cavsdsp.c
> +++ b/libavcodec/cavsdsp.c
> @@ -201,20 +201,20 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t 
> *block, ptrdiff_t stride)
>  src[0][0] += 8;
>  
>  for( i = 0; i < 8; i++ ) {
> -const int a0 =  3*src[i][1] - (src[i][7]<<1);
> -const int a1 =  3*src[i][3] + (src[i][5]<<1);
> -const int a2 =  (src[i][3]<<1) - 3*src[i][5];
> -const int a3 =  (src[i][1]<<1) + 3*src[i][7];
> +const int a0 =  3*src[i][1] - (src[i][7]*2);
> +const int a1 =  3*src[i][3] + (src[i][5]*2);
> +const int a2 =  (src[i][3]*2) - 3*src[i][5];
> +const int a3 =  (src[i][1]*2) + 3*src[i][7];
>  
> -const int b4 = ((a0 + a1 + a3)<<1) + a1;
> -const int b5 = ((a0 - a1 + a2)<<1) + a0;
> -const int b6 = ((a3 - a2 - a1)<<1) + a3;
> -const int b7 = ((a0 - a2 - a3)<<1) - a2;
> +const int b4 = ((a0 + a1 + a3)*2) + a1;
> +const int b5 = ((a0 - a1 + a2)*2) + a0;
> +const int b6 = ((a3 - a2 - a1)*2) + a3;
> +const int b7 = ((a0 - a2 - a3)*2) - a2;
>  
> -const int a7 = (src[i][2]<<2) - 10*src[i][6];
> -const int a6 = (src[i][6]<<2) + 10*src[i][2];
> -const int a5 = ((src[i][0] - src[i][4]) << 3) + 4;
> -const int a4 = ((src[i][0] + src[i][4]) << 3) + 4;
> +const int a7 = (src[i][2]*4) - 10*src[i][6];
> +const int a6 = (src[i][6]*4) + 10*src[i][2];
> +const int a5 = ((src[i][0] - src[i][4]) * 8) + 4;
> +const int a4 = ((src[i][0] + src[i][4]) * 8) + 4;
>  
>  const int b0 = a4 + a6;
>  const int b1 = a5 + a7;
> @@ -231,20 +231,20 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t 
> *block, ptrdiff_t stride)
>  src[i][7] = (b0 - b4) >> 3;
>  }
>  for( i = 0; i < 8; i++ ) {
> -const int a0 =  3*src[1][i] - (src[7][i]<<1);
> -const int a1 =  3*src[3][i] + (src[5][i]<<1);
> -const int a2 =  (src[3][i]<<1) - 3*src[5][i];
> -const int a3 =  (src[1][i]<<1) + 3*src[7][i];
> -
> -const int b4 = ((a0 + a1 + a3)<<1) + a1;
> -const int b5 = ((a0 - a1 + a2)<<1) + a0;
> -const int b6 = ((a3 - a2 - a1)<<1) + a3;
> -const int b7 = ((a0 - a2 - a3)<<1) - a2;
> -
> -const int a7 = (src[2][i]<<2) - 10*src[6][i];
> -const int a6 = (src[6][i]<<2) + 10*src[2][i];
> -const int a5 = (src[0][i] - src[4][i]) << 3;
> -const int a4 = (src[0][i] + src[4][i]) << 3;
> +const int a0 =  3*src[1][i] - (src[7][i]*2);
> +const int a1 =  3*src[3][i] + (src[5][i]*2);
> +const int a2 =  (src[3][i]*2) - 3*src[5][i];
> +const int a3 =  (src[1][i]*2) + 3*src[7][i];
> +
> +const int b4 = ((a0 + a1 + a3)*2) + a1;
> +const int b5 = ((a0 - a1 + a2)*2) + a0;
> +const int b6 = ((a3 - a2 - a1)*2) + a3;
> +const int b7 = ((a0 - a2 - a3)*2) - a2;
> +
> +const int a7 = (src[2][i]*4) - 10*src[6][i];
> +const int a6 = (src[6][i]*4) + 10*src[2][i];
> +const int a5 = (src[0][i] - src[4][i]) * 8;
> +const int a4 = (src[0][i] + src[4][i]) * 8;
>  
>  const int b0 = a4 + a6;
>  const int b1 = a5 + a7;
> 
Duplicate of [1] which I consider more aesthetically pleasing (e.g.
when rewriting "((a0 + a1 + a3)<<1) + a1" via multiplication, one can
drop the outer parentheses, but you didn't).

- Andreas

[1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-September/250681.html
___
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 v7 0/3] Fix mpeg1/2 stream copy

2020-02-06 Thread Gaullier Nicolas
>Envoyé : vendredi 31 janvier 2020 09:59
>Objet : Re: [FFmpeg-devel] [PATCH v7 0/3] Fix mpeg1/2 stream copy
>
>I have not received any feedback yet on this latest version that does not 
>affect the public API.
>The 3 patches are still available in patchwork:
>https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200114234213.3224-2-nicolas.gaullier@cji.paris/
>https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200114234213.3224-3-nicolas.gaullier@cji.paris/
>https://patchwork.ffmpeg.org/project/ffmpeg/patch/20200114234213.3224-4-nicolas.gaullier@cji.paris/
>
>I think it should be near to be approved, could someone take some time for 
>this review ? Thank you.

Ping?

___
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 v5 2/2] avcodec/libvpxenc: add a way to explicitly set temporal layer id

2020-02-06 Thread Wonkap Jang
Hi James,

On Wed, Feb 5, 2020 at 5:29 PM James Zern 
wrote:

> On Mon, Feb 3, 2020 at 5:45 PM Wonkap Jang
>  wrote:
> >
> > Hi
> >
> > On Mon, Feb 3, 2020 at 12:45 PM James Zern <
> jzern-at-google@ffmpeg.org>
> > wrote:
> >
> > > On Mon, Feb 3, 2020 at 10:02 AM Wonkap Jang
> > >  wrote:
> > > >
> > > > In order for rate control to correctly allocate bitrate to each
> temporal
> > > > layer, correct temporal layer id has to be set to each frame. This
> > > > commit provides the ability to set correct temporal layer id for each
> > > > frame.
> > > > ---
> > > >  libavcodec/libvpxenc.c | 13 -
> > > >  1 file changed, 12 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > > > index 6fca05e6b1..2093aa8bca 100644
> > > > --- a/libavcodec/libvpxenc.c
> > > > +++ b/libavcodec/libvpxenc.c
> > > > @@ -1519,11 +1519,22 @@ static int vpx_encode(AVCodecContext *avctx,
> > > AVPacket *pkt,
> > > >  #endif
> > > >  if (frame->pict_type == AV_PICTURE_TYPE_I)
> > > >  flags |= VPX_EFLAG_FORCE_KF;
> > > > -if (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id ==
> > > AV_CODEC_ID_VP8 && frame->metadata) {
> > > > +if (frame->metadata) {
> > > >  AVDictionaryEntry* en = av_dict_get(frame->metadata,
> > > "vp8-flags", NULL, 0);
> > >
> > > I think you'll want to check the codec being used for this one still.
> > > ___
> > > 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".
> >
> >
> > You want me to check whether it is vp8 or vp9? because... the flags will
> > work for both, right?
> >
>
> I meant specifically the field called 'vp8-flags', but looking again
> that looks mostly like it was misnamed. I think there's a mention in
> doc/encoders.texi about metadata, should that be updated to make
> explicit reference to this field?
>
> > If the flags work for both vp8 and vp9, the codec type doesn't have to be
> > checked, no?
> >
> > Thanks,
> >
> > Wonkap
> > ___
> > 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".


So.. what is your suggestion?
just mention in the doc that the vp8-flags is used for both vp8 and vp9 and
how it is used?

Wonkap
___
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 0/2] Simon & Schuster Interactive VAG demuxer + decoder.

2020-02-06 Thread Michael Niedermayer
On Thu, Feb 06, 2020 at 09:55:41AM +0100, Paul B Mahol wrote:
> LGTM

will apply

thx

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

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2



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

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

Re: [FFmpeg-devel] [PATCH 2/3] avformat/tty: Fix division by 0 in probe

2020-02-06 Thread Paul B Mahol
Nonsense, why would this code be called with 0 buffer?

On 2/6/20, Michael Niedermayer  wrote:
> Fixes: division by zero
> Fixes:
> 20436/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5763229752229888
>
> Found-by: continuous fuzzing process
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/tty.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavformat/tty.c b/libavformat/tty.c
> index 60f7e9f87e..854a23c500 100644
> --- a/libavformat/tty.c
> +++ b/libavformat/tty.c
> @@ -53,6 +53,9 @@ static int read_probe(const AVProbeData *p)
>  {
>  int cnt = 0;
>
> +if (!p->buf_size)
> +return 0;
> +
>  for (int i = 0; i < p->buf_size; i++)
>  cnt += !!isansicode(p->buf[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 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] HEVC: Export motion vectors to frame side data.

2020-02-06 Thread Lynne
Feb 6, 2020, 11:17 by kavea...@gmail.com:

> On Sun, Feb 2, 2020 at 11:15 AM Asaf Kave  wrote:
>
>>
>>
>> On Tue, Jan 28, 2020 at 11:44 PM Asaf Kave  wrote:
>>
>>>
>>>
>>> On Sun, Jan 26, 2020, 12:31 Asaf Kave  wrote:
>>>


 On Wed, Jan 22, 2020 at 1:09 PM Asaf Kave  wrote:

>
>
> On Tue, Jan 21, 2020 at 8:17 PM Lynne  wrote:
>
>> Jan 20, 2020, 08:42 by kavea...@gmail.com:
>>
>> > Ping
>> >
>>
>> https://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248836.html
>>
>>
>> I've okayed it, its just not been pushed yet.
>> You'll need to add the vectors to the block struct. int16_t [2] will
>> do.
>>
>
> Thanks Lynne,
> I didn't find the 'libavutil: AVEncodeInfo data structures'
> commit\patch, even i try searching the code on the latest 'master' branch.
> Where can i get the new API ?
>

 Hi,
 Can someone accelerate this?
 Thanks


>>>
>>> Ping
>>>
>>
>> Pinging it again.
>>
>
> Hello,
> Can someone push this to master or if not than give me a feedback,
> Thanks
>

You need to download the patch and apply it yourself.
___
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 7/7] mlp: check huff_lsbs only when codebook is used

2020-02-06 Thread Michael Niedermayer
On Thu, Feb 06, 2020 at 02:59:03PM +0530, Jai Luthra wrote:
> On Tue, Feb 04, 2020 at 10:24:50PM +0100, Michael Niedermayer wrote:
> >On Mon, Feb 03, 2020 at 12:33:00AM +0530, Jai Luthra wrote:
> >>When no codebook is used, huff_lsbs can be more than 24 and still decode to
> >>original values once filters are applied.
> >
> >huff_lsbs can but get_bits() is limited to 25, you need get_bits_long() 
> >beyond
> 
> I see, thx Michael!
> 
> There are two ways to deal with this:
> 
> 1) Use get_bits_long() where get_bits() is used to read the lsb_bits from
> the bitstream as it is certainly going to be within 32.
> 
> 2) Limit huff_lsbs to 25 bits even if no codebook.
> 
> I tested encoding various samples and it does not go above 25 bits. It hits
> 25 in mlpenc because at the matrixing stage L+R channels get added together
> in a single channel, but I am not sure if other encoders would also adhere
> to that.
> 
> (I was previously wrong in assuming that it hits more than 24 at the
> filtering stage, I tested it [1] and it does so after the re-matrixing
> stage, before any FIR filters)
> 
> I prefer (1) as it is cleaner. Let me know if that is OK and I'll send a
> patch.

whatever you prefer that fixes the issue

thx

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

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle


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 2/3] avformat/tty: Fix division by 0 in probe

2020-02-06 Thread Michael Niedermayer
Fixes: division by zero
Fixes: 
20436/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5763229752229888

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

diff --git a/libavformat/tty.c b/libavformat/tty.c
index 60f7e9f87e..854a23c500 100644
--- a/libavformat/tty.c
+++ b/libavformat/tty.c
@@ -53,6 +53,9 @@ static int read_probe(const AVProbeData *p)
 {
 int cnt = 0;
 
+if (!p->buf_size)
+return 0;
+
 for (int i = 0; i < p->buf_size; i++)
 cnt += !!isansicode(p->buf[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/3] avcodec/intrax8: Check for end of bitstream in ff_intrax8_decode_picture()

2020-02-06 Thread Michael Niedermayer
Fixes: Timeout (105sec -> 1sec)
Fixes: 
20479/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1_fuzzer-5769846937878528

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

diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c
index d46f97c7a4..f385423dc1 100644
--- a/libavcodec/intrax8.c
+++ b/libavcodec/intrax8.c
@@ -801,6 +801,8 @@ int ff_intrax8_decode_picture(IntraX8Context *w, Picture 
*pict,
 for (w->mb_y = 0; w->mb_y < w->mb_height * 2; w->mb_y++) {
 x8_init_block_index(w, w->frame);
 mb_xy = (w->mb_y >> 1) * (w->mb_width + 1);
+if (get_bits_left(gb) < 1)
+goto error;
 for (w->mb_x = 0; w->mb_x < w->mb_width * 2; w->mb_x++) {
 x8_get_prediction(w);
 if (x8_setup_spatial_predictor(w, 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/3] avcodec/cavsdsp: Fix invalid left shifts in cavs_idct8_add_c()

2020-02-06 Thread Michael Niedermayer
Fixes: left shift of negative value -107
Fixes: 
20398/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CAVS_fuzzer-5725389278412800

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

diff --git a/libavcodec/cavsdsp.c b/libavcodec/cavsdsp.c
index 90a67e910c..27413b9ee2 100644
--- a/libavcodec/cavsdsp.c
+++ b/libavcodec/cavsdsp.c
@@ -201,20 +201,20 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t 
*block, ptrdiff_t stride)
 src[0][0] += 8;
 
 for( i = 0; i < 8; i++ ) {
-const int a0 =  3*src[i][1] - (src[i][7]<<1);
-const int a1 =  3*src[i][3] + (src[i][5]<<1);
-const int a2 =  (src[i][3]<<1) - 3*src[i][5];
-const int a3 =  (src[i][1]<<1) + 3*src[i][7];
+const int a0 =  3*src[i][1] - (src[i][7]*2);
+const int a1 =  3*src[i][3] + (src[i][5]*2);
+const int a2 =  (src[i][3]*2) - 3*src[i][5];
+const int a3 =  (src[i][1]*2) + 3*src[i][7];
 
-const int b4 = ((a0 + a1 + a3)<<1) + a1;
-const int b5 = ((a0 - a1 + a2)<<1) + a0;
-const int b6 = ((a3 - a2 - a1)<<1) + a3;
-const int b7 = ((a0 - a2 - a3)<<1) - a2;
+const int b4 = ((a0 + a1 + a3)*2) + a1;
+const int b5 = ((a0 - a1 + a2)*2) + a0;
+const int b6 = ((a3 - a2 - a1)*2) + a3;
+const int b7 = ((a0 - a2 - a3)*2) - a2;
 
-const int a7 = (src[i][2]<<2) - 10*src[i][6];
-const int a6 = (src[i][6]<<2) + 10*src[i][2];
-const int a5 = ((src[i][0] - src[i][4]) << 3) + 4;
-const int a4 = ((src[i][0] + src[i][4]) << 3) + 4;
+const int a7 = (src[i][2]*4) - 10*src[i][6];
+const int a6 = (src[i][6]*4) + 10*src[i][2];
+const int a5 = ((src[i][0] - src[i][4]) * 8) + 4;
+const int a4 = ((src[i][0] + src[i][4]) * 8) + 4;
 
 const int b0 = a4 + a6;
 const int b1 = a5 + a7;
@@ -231,20 +231,20 @@ static void cavs_idct8_add_c(uint8_t *dst, int16_t 
*block, ptrdiff_t stride)
 src[i][7] = (b0 - b4) >> 3;
 }
 for( i = 0; i < 8; i++ ) {
-const int a0 =  3*src[1][i] - (src[7][i]<<1);
-const int a1 =  3*src[3][i] + (src[5][i]<<1);
-const int a2 =  (src[3][i]<<1) - 3*src[5][i];
-const int a3 =  (src[1][i]<<1) + 3*src[7][i];
-
-const int b4 = ((a0 + a1 + a3)<<1) + a1;
-const int b5 = ((a0 - a1 + a2)<<1) + a0;
-const int b6 = ((a3 - a2 - a1)<<1) + a3;
-const int b7 = ((a0 - a2 - a3)<<1) - a2;
-
-const int a7 = (src[2][i]<<2) - 10*src[6][i];
-const int a6 = (src[6][i]<<2) + 10*src[2][i];
-const int a5 = (src[0][i] - src[4][i]) << 3;
-const int a4 = (src[0][i] + src[4][i]) << 3;
+const int a0 =  3*src[1][i] - (src[7][i]*2);
+const int a1 =  3*src[3][i] + (src[5][i]*2);
+const int a2 =  (src[3][i]*2) - 3*src[5][i];
+const int a3 =  (src[1][i]*2) + 3*src[7][i];
+
+const int b4 = ((a0 + a1 + a3)*2) + a1;
+const int b5 = ((a0 - a1 + a2)*2) + a0;
+const int b6 = ((a3 - a2 - a1)*2) + a3;
+const int b7 = ((a0 - a2 - a3)*2) - a2;
+
+const int a7 = (src[2][i]*4) - 10*src[6][i];
+const int a6 = (src[6][i]*4) + 10*src[2][i];
+const int a5 = (src[0][i] - src[4][i]) * 8;
+const int a4 = (src[0][i] + src[4][i]) * 8;
 
 const int b0 = a4 + a6;
 const int b1 = a5 + a7;
-- 
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] Support for Frame Duplication(Doubling/Tripling) by FFmpeg's HEVC Decoder by parsing the picture_struct SEI

2020-02-06 Thread Praveen Kumar
Hi Kieren,

Request you to kindly accept the patch and merge it.

Thanks & Regards,
Praveen


From: Praveen Kumar 
Sent: Wednesday, February 5, 2020 11:40 AM
To: Kieran Kunhya 
Cc: ffmpeg-devel@ffmpeg.org ; Thilo Borgmann 
; Michael Niedermayer ; Praveen 
Kumar Karadugattu 
Subject: Re: [FFmpeg-devel] [PATCH] Support for Frame 
Duplication(Doubling/Tripling) by FFmpeg's HEVC Decoder by parsing the 
picture_struct SEI

Yes Kieran, kindly push it to default.
Many thanks for reviewing it and sharing your inputs.

Regards,
Praveen


From: Kieran Kunhya 
Sent: Tuesday, February 4, 2020 10:58 PM
To: Praveen Kumar 
Cc: ffmpeg-devel@ffmpeg.org ; Thilo Borgmann 
; Kieran Kunhya ; Michael Niedermayer 
; Praveen Kumar Karadugattu 

Subject: Re: [FFmpeg-devel] [PATCH] Support for Frame 
Duplication(Doubling/Tripling) by FFmpeg's HEVC Decoder by parsing the 
picture_struct SEI



On Wed, 29 Jan 2020 at 13:25, Praveen Kumar 
mailto:praveenku...@outlook.com>> wrote:
Hi,

Re-submitting the patch. This patch has the implementation for supporting 
frame-duplication (doubling/ tripling) by FFmpeg's HEVC decoder based on the 
picture_structure SEI value present in the encoded video.
picture_structure value of 7 implies doubling and 8 implies tripling. The value 
of picture_structure is set while encoding.

More details here: 
http://ffmpeg.org/pipermail/ffmpeg-devel/2019-June/245521.html

Thanks & Regards,
Praveen

Patch is fine, would you like me to push it?

Kieran
___
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] avfilter/vf_zoompan: fix shaking when zooming

2020-02-06 Thread Robert Deibel

Would appreciate further review or info.

On 29.01.20 10:54, Robert Deibel wrote:

Fix shaking of image when zoom is applied by the zoompan filter.
Resolves ticket https://trac.ffmpeg.org/ticket/4298
---
Fixed a typo/bug where dy was dx. Removed request for oversized frame from 
filter, instead allocate
internal frame and copy contents to out frame once dimensions are correct.

  libavfilter/vf_zoompan.c | 109 +--
  1 file changed, 82 insertions(+), 27 deletions(-)

diff --git a/libavfilter/vf_zoompan.c b/libavfilter/vf_zoompan.c
index 59c9b19ec8..e18f9c8d1b 100644
--- a/libavfilter/vf_zoompan.c
+++ b/libavfilter/vf_zoompan.c
@@ -150,16 +150,30 @@ static int config_output(AVFilterLink *outlink)
  return 0;
  }
  
+/**

+ * Scales n to the next number divisible by 2 * 2^log_grid_size but minimally 
n + 2 * 2^log_grid_size.
+ *
+ * Used to scale the width and height of a frame to fit with the subsampling 
grid.
+ * @param n The number to be scaled.
+ * @param log_grid_size log 2 of the gridsize.
+ * @return The next number divisible by 2 * 2^log_grid_size but minimally n + 
2 * 2^log_grid_size
+ */
+static int scale_to_grid(int n, uint8_t log2_grid_size)
+{
+return (((n + (1 << log2_grid_size) * 2) & ~((1 << log2_grid_size) - 1)) + 1) 
& ~1;;
+}
+
  static int output_single_frame(AVFilterContext *ctx, AVFrame *in, double 
*var_values, int i,
 double *zoom, double *dx, double *dy)
  {
  ZPContext *s = ctx->priv;
  AVFilterLink *outlink = ctx->outputs[0];
  int64_t pts = s->frame_count;
-int k, x, y, w, h, ret = 0;
+int k, x, y, crop_x, crop_y, w, h, crop_w, crop_h, overscaled_w, 
overscaled_h, ret = 0;
  uint8_t *input[4];
  int px[4], py[4];
-AVFrame *out;
+AVFrame *out, *overscaled_frame;
+double dw, dh, dx_scaled, dy_scaled;
  
  var_values[VAR_PX]= s->x;

  var_values[VAR_PY]= s->y;
@@ -173,32 +187,44 @@ static int output_single_frame(AVFilterContext *ctx, 
AVFrame *in, double *var_va
  
  *zoom = av_clipd(*zoom, 1, 10);

  var_values[VAR_ZOOM] = *zoom;
-w = in->width * (1.0 / *zoom);
-h = in->height * (1.0 / *zoom);
  
-*dx = av_expr_eval(s->x_expr, var_values, NULL);

+w = dw = (double) in->width / *zoom;
+h = dh = (double) in->height / *zoom;
+crop_w = scale_to_grid(w, s->desc->log2_chroma_w);
+crop_h = scale_to_grid(h, s->desc->log2_chroma_h);
+overscaled_w = outlink->w + (crop_w - dw) * *zoom;
+overscaled_h = outlink->h + (crop_h - dh) * *zoom;
  
-x = *dx = av_clipd(*dx, 0, FFMAX(in->width - w, 0));

-var_values[VAR_X] = *dx;
-x &= ~((1 << s->desc->log2_chroma_w) - 1);
+*dx = av_expr_eval(s->x_expr, var_values, NULL);
+crop_x = ceil(av_clipd(*dx - (((double) crop_w - w) / 2.0), 0, 
FFMAX(in->width - crop_w, 0)));
+var_values[VAR_X] = *dx = av_clipd(*dx, 0, FFMAX(in->width - w, 0));
+crop_x &= ~((1 << s->desc->log2_chroma_w) - 1);
  
  *dy = av_expr_eval(s->y_expr, var_values, NULL);

+crop_y = ceil(av_clipd(*dy - (((double) crop_h - h)/ 2.0), 0, 
FFMAX(in->height - crop_h, 0)));
+var_values[VAR_Y] = *dy = av_clipd(*dy, 0, FFMAX(in->height - h, 0));
+crop_y &= ~((1 << s->desc->log2_chroma_h) - 1);
  
-y = *dy = av_clipd(*dy, 0, FFMAX(in->height - h, 0));

-var_values[VAR_Y] = *dy;
-y &= ~((1 << s->desc->log2_chroma_h) - 1);
-
-out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
-if (!out) {
+overscaled_frame = av_frame_alloc();
+if (!overscaled_frame) {
  ret = AVERROR(ENOMEM);
  return ret;
  }
  
-px[1] = px[2] = AV_CEIL_RSHIFT(x, s->desc->log2_chroma_w);

-px[0] = px[3] = x;
+overscaled_frame->height = overscaled_h;
+overscaled_frame->width = overscaled_w;
+overscaled_frame->format = outlink->format;
+if ((ret = av_frame_get_buffer(overscaled_frame, 0)) < 0)
+goto error;
  
-py[1] = py[2] = AV_CEIL_RSHIFT(y, s->desc->log2_chroma_h);

-py[0] = py[3] = y;
+px[1] = px[2] = AV_CEIL_RSHIFT(crop_x, s->desc->log2_chroma_w);
+px[0] = px[3] = crop_x;
+
+py[1] = py[2] = AV_CEIL_RSHIFT(crop_y, s->desc->log2_chroma_h);
+py[0] = py[3] = crop_y;
+
+for (k = 0; k < 4; k++)
+input[k] = in->data[k] + py[k] * in->linesize[k] + px[k];
  
  s->sws = sws_alloc_context();

  if (!s->sws) {
@@ -206,21 +232,48 @@ static int output_single_frame(AVFilterContext *ctx, 
AVFrame *in, double *var_va
  goto error;
  }
  
-for (k = 0; in->data[k]; k++)

-input[k] = in->data[k] + py[k] * in->linesize[k] + px[k];
-
-av_opt_set_int(s->sws, "srcw", w, 0);
-av_opt_set_int(s->sws, "srch", h, 0);
+av_opt_set_int(s->sws, "srcw", crop_w, 0);
+av_opt_set_int(s->sws, "srch", crop_h, 0);
  av_opt_set_int(s->sws, "src_format", in->format, 0);
-av_opt_set_int(s->sws, "dstw", outlink->w, 0);
-av_opt_set_int(s->sws, "dsth", outlink->h, 0);
+

Re: [FFmpeg-devel] [PATCH v2] HEVC: Export motion vectors to frame side data.

2020-02-06 Thread Asaf Kave
On Sun, Feb 2, 2020 at 11:15 AM Asaf Kave  wrote:

>
>
> On Tue, Jan 28, 2020 at 11:44 PM Asaf Kave  wrote:
>
>>
>>
>> On Sun, Jan 26, 2020, 12:31 Asaf Kave  wrote:
>>
>>>
>>>
>>> On Wed, Jan 22, 2020 at 1:09 PM Asaf Kave  wrote:
>>>


 On Tue, Jan 21, 2020 at 8:17 PM Lynne  wrote:

> Jan 20, 2020, 08:42 by kavea...@gmail.com:
>
> > Ping
> >
>
> https://ffmpeg.org/pipermail/ffmpeg-devel/2019-August/248836.html
>
>
> I've okayed it, its just not been pushed yet.
> You'll need to add the vectors to the block struct. int16_t [2] will
> do.
>

 Thanks Lynne,
 I didn't find the 'libavutil: AVEncodeInfo data structures'
 commit\patch, even i try searching the code on the latest 'master' branch.
 Where can i get the new API ?

>>>
>>> Hi,
>>> Can someone accelerate this?
>>> Thanks
>>>
>>>
>>
>> Ping
>>
>
> Pinging it again.
>

Hello,
Can someone push this to master or if not than give me a feedback,
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".


___
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 0/2] Simon & Schuster Interactive VAG demuxer + decoder.

2020-02-06 Thread Paul B Mahol
LGTM

On 2/6/20, Zane van Iperen  wrote:
> Hi all,
>
> This patchset adds support for the VAG container and ADPCM variant used
> by some Simon & Schuster Interactive games such as 'Real War',
> and 'Real War: Rogue States'.
>
> It has been tested against VAG files from both games.
>
> v2:
>   - simplify the demuxer
>   - fix error in header structure
>
> Some things to note:
> * SSI's VAG has no relation to the existing PS2 VAG.
>   I've named it 'kvag' (after its tag), but am open to suggestions if this
>   is inappropriate (ssi_vag?).
>
> Zane
>
>
> Zane van Iperen (2):
>   avcodec: add decoder for Simon & Schuster Interactive's ADPCM variant
>   avformat: add demuxer for Simon & Schuster Interactive's VAG format
>
>  libavcodec/Makefile  |   1 +
>  libavcodec/adpcm.c   |  10 
>  libavcodec/allcodecs.c   |   1 +
>  libavcodec/avcodec.h |   1 +
>  libavcodec/codec_desc.c  |   7 +++
>  libavcodec/version.h |   4 +-
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/kvag.c   | 117 +++
>  libavformat/version.h|   2 +-
>  10 files changed, 142 insertions(+), 3 deletions(-)
>  create mode 100644 libavformat/kvag.c
>
> --
> 2.17.1
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

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

Re: [FFmpeg-devel] [PATCH 7/7] mlp: check huff_lsbs only when codebook is used

2020-02-06 Thread Jai Luthra

On Tue, Feb 04, 2020 at 10:24:50PM +0100, Michael Niedermayer wrote:

On Mon, Feb 03, 2020 at 12:33:00AM +0530, Jai Luthra wrote:

When no codebook is used, huff_lsbs can be more than 24 and still decode to
original values once filters are applied.


huff_lsbs can but get_bits() is limited to 25, you need get_bits_long() beyond


I see, thx Michael!

There are two ways to deal with this:

1) Use get_bits_long() where get_bits() is used to read the lsb_bits from the 
bitstream as it is certainly going to be within 32.


2) Limit huff_lsbs to 25 bits even if no codebook.

I tested encoding various samples and it does not go above 25 bits. It hits 25 
in mlpenc because at the matrixing stage L+R channels get added together in a 
single channel, but I am not sure if other encoders would also adhere to that.


(I was previously wrong in assuming that it hits more than 24 at the filtering 
stage, I tested it [1] and it does so after the re-matrixing stage, before any 
FIR filters)


I prefer (1) as it is cleaner. Let me know if that is OK and I'll send a 
patch.


Cheers,
Jai

[1]: 
https://github.com/jailuthra/FFmpeg/commit/04cf7262496cd296be3b3beaf049bdb1887f2d84
with https://lynne.ee/files/sample.flac



thx

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

If you think the mosad wants you dead since a long time then you are either
wrong or dead since a long time.

___
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] [EXTREMELY IMPORTANT] [PLEASE DO NOT IGNORE] [PATCH] avfilter/framesync: do not pick AV_TIME_BASE for time base when not needed.

2020-02-06 Thread Paul B Mahol
On 2/6/20, Nicolas George  wrote:
> Paul B Mahol (12020-02-05):
>> I will write patch that fixes this. As unnecessary changing time-base
>> is wrong way around.
>
> I do not want several code paths, requiring extra testing in case of
> change, unless it is necessary. There is no mystique about the time
> base: the current code finds one that works, it is enough.
>

Who tells you that your personal opinion is higher valued than mine?
Current code does not work at all in such scenario and it utterly
fails to deliver
same presentation timestamps to output.

> --
>   Nicolas George
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
___
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".