Re: [FFmpeg-devel] [PATCH]Allow easy png streamcopying

2015-04-30 Thread tim nicholson
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 27/04/15 13:16, Nicolas George wrote:
> L'octidi 8 floréal, an CCXXIII, Michael Niedermayer a écrit :
>> the code changes look ok
> 
> The phrasing seems to invite this:
> 
> The commit message does not shock me.
> 
> Seriously, I do not know how my message about commit messages ended be
ing so
> long, I do not intend to become a commit message tyrant, I just wanted
 to
> raise awareness about the issue.
> 

You made some sensible points, that will hopefully lead to clearer
future commits, if it took that many words to make the point so be it. I
do not consider you a tyrant [ yet ;) ].

> [..]

- -- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (GNU/Linux)

iQEcBAEBAgAGBQJVQdz+AAoJEAwL/ESLC/yD2ggH/jDHgzJohwr/MFrqpNtSmBCZ
qs3x2as/k9UjxU2yINv/q8MYJaM3gl1Gnr6EuZ/apTxggEXYI/DW4yf1smeKaTW0
pu4eAQZSKU8xJ3jCGGzcokR27ZVlNdYg32SkCh7mw1DQ9UlXG+fXL5uZVP10TPGz
TpgHXHjZ3KoYxbXU1MScrxU3qoQO0oV3PLRr647U1DjjNn8WZQkqbJwEdsTSL//q
S/UYuELzWXkLwumYW4VdoczEwnjchXQypGv8CwuhmBnvNnMRRuJm3WgZL5lKgI0c
RkVK8PFSUP1Exa0Q/OGHoEjTxLrk/B3Z+6XHq/9yBkWb5dfIjBtJYSSUJQE9oA0=
=MtTV
-END PGP SIGNATURE-
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter: add findandcover filter

2015-04-30 Thread Clément Bœsch
On Wed, Apr 29, 2015 at 06:00:54PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavfilter/Makefile  |1 +
>  libavfilter/allfilters.c  |1 +
>  libavfilter/vf_findandcover.c |  400 
> +

doc/filters.texi please...

(note: don't forget to minor bump)

>  3 files changed, 402 insertions(+)
>  create mode 100644 libavfilter/vf_findandcover.c
> 
> diff --git a/libavfilter/Makefile b/libavfilter/Makefile
> index 48cee50..09bc465 100644
> --- a/libavfilter/Makefile
> +++ b/libavfilter/Makefile
> @@ -126,6 +126,7 @@ OBJS-$(CONFIG_FFTFILT_FILTER)+= 
> vf_fftfilt.o
>  OBJS-$(CONFIG_FIELD_FILTER)  += vf_field.o
>  OBJS-$(CONFIG_FIELDMATCH_FILTER) += vf_fieldmatch.o
>  OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o
> +OBJS-$(CONFIG_FINDANDCOVER_FILTER)   += vf_findandcover.o
>  OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o
>  OBJS-$(CONFIG_FRAMESTEP_FILTER)  += vf_framestep.o
>  OBJS-$(CONFIG_FPS_FILTER)+= vf_fps.o
> diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
> index 7961dca..c4d4d74 100644
> --- a/libavfilter/allfilters.c
> +++ b/libavfilter/allfilters.c
> @@ -142,6 +142,7 @@ void avfilter_register_all(void)
>  REGISTER_FILTER(FIELD,  field,  vf);
>  REGISTER_FILTER(FIELDMATCH, fieldmatch, vf);
>  REGISTER_FILTER(FIELDORDER, fieldorder, vf);
> +REGISTER_FILTER(FINDANDCOVER,   findandcover,   vf);
>  REGISTER_FILTER(FORMAT, format, vf);
>  REGISTER_FILTER(FPS,fps,vf);
>  REGISTER_FILTER(FRAMEPACK,  framepack,  vf);
> diff --git a/libavfilter/vf_findandcover.c b/libavfilter/vf_findandcover.c
> new file mode 100644
> index 000..5838e3b
> --- /dev/null
> +++ b/libavfilter/vf_findandcover.c
> @@ -0,0 +1,400 @@
> +/*
> + * Copyright (c) 2014-2015 Michael Niedermayer 
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 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 General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */
> +
> +#include "libavutil/avassert.h"
> +#include "libavutil/imgutils.h"
> +#include "libavutil/opt.h"
> +#include "internal.h"
> +
> +#include "lavfutils.h"
> +
> +enum mode {
> +MODE_COVER,
> +MODE_BLUR,
> +NB_MODES
> +};
> +
> +#define MAX_MIPMAPS 5
> +
> +typedef struct FOCContext {
> +AVClass *class;
> +float threshold;
> +int mipmaps;
> +int xmin, ymin, xmax, ymax;

> +enum mode mode;

didn't you fix a bunch of related issue recently?

> +char *obj_filename;
> +char *cover_filename;
> +int last_x, last_y;
> +AVFrame *obj_frame;
> +AVFrame *cover_frame;
> +AVFrame *needle_frame[MAX_MIPMAPS];
> +AVFrame *haystack_frame[MAX_MIPMAPS];
> +} FOCContext;
> +
> +#define OFFSET(x) offsetof(FOCContext, x)
> +#define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM
> +static const AVOption foc_options[] = {
> +{ "object", "object bitmap filename", OFFSET(obj_filename), 
> AV_OPT_TYPE_STRING, {.str = NULL}, .flags = FLAGS },
> +{ "cover",  "cover bitmap filename",  OFFSET(cover_filename),  
> AV_OPT_TYPE_STRING, {.str = NULL}, .flags = FLAGS },
> +{ "threshold", "set threshold", OFFSET(threshold), AV_OPT_TYPE_FLOAT, 
> {.dbl = 0.5}, 0, 1.0, FLAGS },
> +{ "mipmaps", "set mipmaps", OFFSET(mipmaps), AV_OPT_TYPE_INT, {.i64 = 
> 3}, 1, MAX_MIPMAPS, FLAGS },
> +{ "xmin", "", OFFSET(xmin), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, 
> FLAGS },
> +{ "ymin", "", OFFSET(ymin), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, 
> FLAGS },
> +{ "xmax", "", OFFSET(xmax), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, 
> FLAGS },
> +{ "ymax", "", OFFSET(ymax), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, 
> FLAGS },
> +{ "mode", "set removial mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = 
> MODE_BLUR}, 0, NB_MODES - 1, FLAGS, "mode" },
> +{ "cover", "cover area with bitmap", 0, AV_OPT_TYPE_CONST, {.i64 = 
> MODE_COVER}, INT_MIN, INT_MAX, FLAGS, "mode" },
> +{ "blur", "blur area", 0, AV_OPT_TYPE_CONST, {.i64 = MODE_BLUR}, 
> INT_MIN, INT_MAX, FLAGS, "mode" },
> +{ NULL }
> +};
> +
> +static const AVClass foc_class = {
> +.class_name   = "foc",
> +.it

Re: [FFmpeg-devel] filter vf_findandcover

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 06:50:47AM +, JULIAN GARDNER wrote:
> Can you post the png fix please so i can backport this

it was this one:
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=d2184bf3b65354e44c177e226a6c59c5d6fdbad4

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

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


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


[FFmpeg-devel] ffserver jpg output

2015-04-30 Thread Caligula useraccount

Ave all

Background:
I'm using ffserver, which feeds of a webcam, to serve .swf and .jpg files.

To serve the .jpg files, I use the patch mentioned in 
http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2006-June/013107.html
Over the years I "ported" the patch to more current versions of ffmpeg.

Attached is a patch for 2.6.x, older versions are available at 
http://sarijopen.student.utwente.nl/caligula/ffmpeg/


Greetings Martijn
(Who hopes that ffserver is kept alive)





diff -Nrup ffmpeg-2.6.1--orig/ffserver.c ffmpeg-2.6.1/ffserver.c
--- ffmpeg-2.6.1--orig/ffserver.c   2015-03-16 20:25:48.0 +0100
+++ ffmpeg-2.6.1/ffserver.c 2015-04-05 02:33:53.0 +0200
@@ -967,6 +967,10 @@ static int handle_connection(HTTPContext
 /* close connection if trailer sent */
 if (c->state == HTTPSTATE_SEND_DATA_TRAILER)
 return -1;
+/* Check if it is a single jpeg frame 123 */
+if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && 
c->cur_frame_bytes > 0) {
+close_connection(c);
+}
 break;
 case HTTPSTATE_RECEIVE_DATA:
 /* no need to read if no events */
diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.c ffmpeg-2.6.1/ffserver_config.c
--- ffmpeg-2.6.1--orig/ffserver_config.c2015-03-16 20:25:48.0 
+0100
+++ ffmpeg-2.6.1/ffserver_config.c  2015-04-05 02:33:53.0 +0200
@@ -862,8 +862,10 @@ static int ffserver_parse_config_stream(
 } else {
 stream->stream_type = STREAM_TYPE_LIVE;
 /* JPEG cannot be used here, so use single frame MJPEG */
-if (!strcmp(arg, "jpeg"))
-strcpy(arg, "mjpeg");
+if (!strcmp(arg, "jpeg")) {
+strcpy(arg, "singlejpeg");
+stream->single_frame=1; 
+}

 stream->fmt = ffserver_guess_format(arg, NULL, NULL);
 if (!stream->fmt)
 ERROR("Unknown Format: '%s'\n", arg);
diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.h ffmpeg-2.6.1/ffserver_config.h
--- ffmpeg-2.6.1--orig/ffserver_config.h2015-03-16 20:25:48.0 
+0100
+++ ffmpeg-2.6.1/ffserver_config.h  2015-04-05 02:33:53.0 +0200
@@ -79,6 +79,7 @@ typedef struct FFServerStream {
 int multicast_port;   /* first port used for multicast */
 int multicast_ttl;
 int loop; /* if true, send the stream in loops (only 
meaningful if file) */
+char single_frame;/* only single frame */

 /* feed specific */
 int feed_opened;  /* true if someone is writing to the feed */
diff -Nrup ffmpeg-2.6.1--orig/libavformat/allformats.c 
ffmpeg-2.6.1/libavformat/allformats.c
--- ffmpeg-2.6.1--orig/libavformat/allformats.c 2015-03-16 20:25:52.0 
+0100
+++ ffmpeg-2.6.1/libavformat/allformats.c   2015-04-05 02:33:53.0 
+0200
@@ -273,6 +273,7 @@ void av_register_all(void)
 REGISTER_MUXER   (SEGMENT,  stream_segment);
 REGISTER_DEMUXER (SHORTEN,  shorten);
 REGISTER_DEMUXER (SIFF, siff);
+REGISTER_MUXER   (SINGLEJPEG,   singlejpeg);
 REGISTER_DEMUXER (SLN,  sln);
 REGISTER_DEMUXER (SMACKER,  smacker);
 REGISTER_MUXDEMUX(SMJPEG,   smjpeg);
diff -Nrup ffmpeg-2.6.1--orig/libavformat/rawenc.c 
ffmpeg-2.6.1/libavformat/rawenc.c
--- ffmpeg-2.6.1--orig/libavformat/rawenc.c 2015-03-16 20:25:54.0 
+0100
+++ ffmpeg-2.6.1/libavformat/rawenc.c   2015-04-05 02:33:53.0 +0200
@@ -250,6 +250,17 @@ AVOutputFormat ff_mjpeg_muxer = {
 .write_packet  = ff_raw_write_packet,
 .flags = AVFMT_NOTIMESTAMPS,
 };
+
+AVOutputFormat ff_singlejpeg_muxer = {
+.name  = "singlejpeg",
+.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"),
+.mime_type = "image/jpeg",
+.extensions= "jpg,jpeg",
+.audio_codec   = AV_CODEC_ID_NONE,
+.video_codec   = AV_CODEC_ID_MJPEG,
+.write_packet  = ff_raw_write_packet,
+.flags = AVFMT_NOTIMESTAMPS,
+};
 #endif

 #if CONFIG_MLP_MUXER



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


[FFmpeg-devel] [PATCH 1/3] libavutil/softfloat: exponent adjusted for aac fixed point dec

2015-04-30 Thread Nedeljko Babic
Exponent usage and calculation in softfloat adjusted to the format used in
implementation of fixed point aac decoder.

Signed-off-by: Nedeljko Babic 
---
 libavutil/softfloat.h | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index 2e85765..5f4ac26 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -83,7 +83,7 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, 
SoftFloat b){
 a.exp += b.exp;
 av_assert2((int32_t)((a.mant * (int64_t)b.mant) >> ONE_BITS) == (a.mant * 
(int64_t)b.mant) >> ONE_BITS);
 a.mant = (a.mant * (int64_t)b.mant) >> ONE_BITS;
-return av_normalize1_sf(a);
+return av_normalize1_sf((SoftFloat){a.mant, a.exp - 1});
 }
 
 /**
@@ -91,7 +91,7 @@ static inline av_const SoftFloat av_mul_sf(SoftFloat a, 
SoftFloat b){
  * @return Will not be more denormalized than a.
  */
 static av_const SoftFloat av_div_sf(SoftFloat a, SoftFloat b){
-a.exp -= b.exp+1;
+a.exp -= b.exp;
 a.mant = ((int64_t)a.mant<<(ONE_BITS+1)) / b.mant;
 return av_normalize1_sf(a);
 }
@@ -121,14 +121,14 @@ static inline av_const SoftFloat av_sub_sf(SoftFloat a, 
SoftFloat b){
  * @returns a SoftFloat with value v * 2^frac_bits
  */
 static inline av_const SoftFloat av_int2sf(int v, int frac_bits){
-return av_normalize_sf((SoftFloat){v, ONE_BITS-frac_bits});
+return av_normalize_sf((SoftFloat){v, ONE_BITS + 1 - frac_bits});
 }
 
 /**
  * Rounding is to -inf.
  */
 static inline av_const int av_sf2int(SoftFloat v, int frac_bits){
-v.exp += frac_bits - ONE_BITS;
+v.exp += frac_bits - (ONE_BITS + 1);
 if(v.exp >= 0) return v.mant <<  v.exp ;
 else   return v.mant >>(-v.exp);
 }
-- 
1.8.2.1

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


[FFmpeg-devel] [PATCH 2/3] libavutil/softfloat: Added av_normalize_sf in av_add_sf

2015-04-30 Thread Nedeljko Babic
This will normalize sums for which mantissa is smaller than the lower boundary
(needed for implementation of fixed point aac decoder).

Signed-off-by: Nedeljko Babic 
---
 libavutil/softfloat.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index 5f4ac26..42b3c3e 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -105,8 +105,8 @@ static inline av_const int av_cmp_sf(SoftFloat a, SoftFloat 
b){
 static inline av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b){
 int t= a.exp - b.exp;
 if  (t <-31) return b;
-else if (t <  0) return av_normalize1_sf((SoftFloat){b.mant + (a.mant >> 
(-t)), b.exp});
-else if (t < 32) return av_normalize1_sf((SoftFloat){a.mant + (b.mant >>   
t ), a.exp});
+else if (t <  0) return av_normalize_sf(av_normalize1_sf((SoftFloat){ 
b.mant + (a.mant >> (-t)), b.exp}));
+else if (t < 32) return av_normalize_sf(av_normalize1_sf((SoftFloat){ 
a.mant + (b.mant >>   t ), a.exp}));
 else return a;
 }
 
-- 
1.8.2.1

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


[FFmpeg-devel] Softfloat changes

2015-04-30 Thread Nedeljko Babic
This patch set is replacement of patch "libavutil: Make changes in
softfloat needed for fixed point aac decoder."

The original patch is split so it is easier to do a review.

All the changes that are not absolutely needed for implementation of fixed
point aac decoder are removed.

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


[FFmpeg-devel] [PATCH 3/3] libavutil/softfloat: Add functions.

2015-04-30 Thread Nedeljko Babic
Functions av_gt_sf, av_sqrt_sf and av_sincos_sf added to softfloat

Signed-off-by: Nedeljko Babic 
---
 libavutil/softfloat.h|  93 +++-
 libavutil/softfloat_tables.h | 260 +++
 2 files changed, 352 insertions(+), 1 deletion(-)
 create mode 100644 libavutil/softfloat_tables.h

diff --git a/libavutil/softfloat.h b/libavutil/softfloat.h
index 42b3c3e..d6cfc3c 100644
--- a/libavutil/softfloat.h
+++ b/libavutil/softfloat.h
@@ -25,6 +25,7 @@
 #include "common.h"
 
 #include "avassert.h"
+#include "softfloat_tables.h"
 
 #define MIN_EXP -126
 #define MAX_EXP  126
@@ -102,6 +103,13 @@ static inline av_const int av_cmp_sf(SoftFloat a, 
SoftFloat b){
 elsereturn  a.mant  - (b.mant >> t);
 }
 
+static inline av_const int av_gt_sf(SoftFloat a, SoftFloat b)
+{
+int t= a.exp - b.exp;
+if(t<0) return (a.mant >> (-t)) >  b.mant  ;
+elsereturn  a.mant  > (b.mant >> t);
+}
+
 static inline av_const SoftFloat av_add_sf(SoftFloat a, SoftFloat b){
 int t= a.exp - b.exp;
 if  (t <-31) return b;
@@ -114,7 +122,7 @@ static inline av_const SoftFloat av_sub_sf(SoftFloat a, 
SoftFloat b){
 return av_add_sf(a, (SoftFloat){ -b.mant, b.exp});
 }
 
-//FIXME sqrt, log, exp, pow, sin, cos
+//FIXME log, exp, pow
 
 /**
  * Converts a mantisse and exponent to a SoftFloat
@@ -133,4 +141,87 @@ static inline av_const int av_sf2int(SoftFloat v, int 
frac_bits){
 else   return v.mant >>(-v.exp);
 }
 
+/**
+ * Rounding-to-nearest used.
+ */
+static av_always_inline SoftFloat av_sqrt_sf(SoftFloat val)
+{
+int tabIndex, rem;
+
+if (val.mant == 0)
+val.exp = 0;
+else
+{
+tabIndex = (val.mant - 0x2000) >> 20;
+
+rem = val.mant & 0xF;
+val.mant  = (int)(((int64_t)av_sqrttbl_sf[tabIndex] * (0x10 - rem) 
+
+   (int64_t)av_sqrttbl_sf[tabIndex + 1] * rem +
+   0x8) >> 20);
+val.mant = (int)(((int64_t)av_sqr_exp_multbl_sf[val.exp & 1] * 
val.mant +
+  0x1000) >> 29);
+
+if (val.mant < 0x4000)
+val.exp -= 2;
+else
+val.mant >>= 1;
+
+val.exp = (val.exp >> 1) + 1;
+}
+
+return val;
+}
+
+/**
+ * Rounding-to-nearest used.
+ */
+static av_always_inline void av_sincos_sf(int a, int *s, int *c)
+{
+int idx, sign;
+int sv, cv;
+int st, ct;
+
+idx = a >> 26;
+sign = (idx << 27) >> 31;
+cv = av_costbl_1_sf[idx & 0xf];
+cv = (cv ^ sign) - sign;
+
+idx -= 8;
+sign = (idx << 27) >> 31;
+sv = av_costbl_1_sf[idx & 0xf];
+sv = (sv ^ sign) - sign;
+
+idx = a >> 21;
+ct = av_costbl_2_sf[idx & 0x1f];
+st = av_sintbl_2_sf[idx & 0x1f];
+
+idx = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x2000) >> 30);
+
+sv = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x2000) >> 30);
+
+cv = idx;
+
+idx = a >> 16;
+ct = av_costbl_3_sf[idx & 0x1f];
+st = av_sintbl_3_sf[idx & 0x1f];
+
+idx = (int)(((int64_t)cv * ct - (int64_t)sv * st + 0x2000) >> 30);
+
+sv = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x2000) >> 30);
+cv = idx;
+
+idx = a >> 11;
+
+ct = (int)(((int64_t)av_costbl_4_sf[idx & 0x1f] * (0x800 - (a & 0x7ff)) +
+(int64_t)av_costbl_4_sf[(idx & 0x1f)+1]*(a & 0x7ff) +
+0x400) >> 11);
+st = (int)(((int64_t)av_sintbl_4_sf[idx & 0x1f] * (0x800 - (a & 0x7ff)) +
+(int64_t)av_sintbl_4_sf[(idx & 0x1f) + 1] * (a & 0x7ff) +
+0x400) >> 11);
+
+*c = (int)(((int64_t)cv * ct + (int64_t)sv * st + 0x2000) >> 30);
+
+*s = (int)(((int64_t)cv * st + (int64_t)sv * ct + 0x2000) >> 30);
+}
+
 #endif /* AVUTIL_SOFTFLOAT_H */
diff --git a/libavutil/softfloat_tables.h b/libavutil/softfloat_tables.h
new file mode 100644
index 000..9d3c808
--- /dev/null
+++ b/libavutil/softfloat_tables.h
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2012
+ *  MIPS Technologies, Inc., California.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the MIPS Technologies, Inc., nor the names of is
+ *contributors may be used to endorse or promote products derived from
+ *this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE MIPS TECHNOLOGIES, INC. ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES

[FFmpeg-devel] standardization route for FFV1 specification

2015-04-30 Thread Dave Rice
Hi FFmpeg-devel,

As you may have heard, PREFORMA (a Pre-Commercial Procurement (PCP) 
project co-funded by the European Commission under its FP7-ICT Programme) is a 
project to address the challenge of implementing good quality standardised file 
formats for preserving data content in the long term. The project selected 
several audiovisual formats to focus on and MediaArea wrote a proposal focusing 
on three of their selections: FFV1, LPCM, and Matroska. As part of the proposal 
we noted that Matroska and FFV1 have not undergone a formal standardization 
process (via an external standardization org) and wrote up plans [1] to attempt 
to facilitate this via the IETF. These plans follow earlier discussions on FFV1 
and standardization held on ffmpeg-devel such as here [2] and in small 
in-person meetings such as recently at FOSDEM. Recently PREFORMA announced that 
MediaArea’s proposal was selected to continue to the prototyping phase [3].

As a quick summary of our plan: we hope to prepare the current draft of 
the FFV1 specification up to version 3 for consideration at an upcoming IETF 
meeting (we anticipate applying for a BoF meeting for IETF93). This effort 
would not change ffv1 but simply make the current documentation more clear and 
complete. Ideally it should be feasible to create an FFV1 decode based solely 
of the specification without having to rely on the FFV1 encoder/decoder 
implemented in FFmpeg. Then at a later phase we may provide recommendations 
towards the development of FFV1 version 4. Version 3 will be an information 
standard submission at IETF so that the existing implementation is standardized 
but not up for modification. Version 4 would at a later IETF meeting be moved 
through a more formal process that would include IETF feedback into the version 
4 of ffv1.

Thus far the conversation about refinement work to the FFV1 
specification has been taking place with the spec's github repo [4], but to 
facilitate greater oversight and participation we'll start sending related 
patches to ffmpeg-devel for consideration. Within the repository the ffv1.lyx 
aims to be the basis for FFV1 standardization efforts but we hope to regularly 
update the html rendering within the repo as well.

Best Regards,
Dave Rice

[1] https://github.com/MediaArea/MediaConch/blob/master/StandardsNarrative.md 

[2] http://comments.gmane.org/gmane.comp.video.ffmpeg.devel/153269 

[3] 
http://www.digitalmeetsculture.net/article/kick-off-of-the-prototyping-phase/ 

[4] https://github.com/ffmpeg/ffv1 
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] FFV1 specification: Quantization Tables syntax

2015-04-30 Thread Jerome Martinez

Quantization Tables syntax was not defined.
Corresponding HTML export: 
https://mediaarea.net/temp/ffv1-patched-Quantization-tables-syntax.html#toc-Subsection-4.4 

From 7d58498adbc04aeabc5497df0270c6ebd1cfac12 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
Date: Wed, 29 Apr 2015 21:54:13 +0200
Subject: [PATCH] Quantization tables syntax.

More details is provided about how to read quantization tables and the 
associated values (context_count).
---
 ffv1.lyx | 1006 +-
 1 file changed, 1002 insertions(+), 4 deletions(-)

diff --git a/ffv1.lyx b/ffv1.lyx
index 3d2380c..22c4a93 100644
--- a/ffv1.lyx
+++ b/ffv1.lyx
@@ -5246,7 +5246,7 @@ br
 \begin_inset space ~
 \end_inset
 
-QuantizationTables
+QuantizationTable(0)
 \end_layout
 
 \end_inset
@@ -5966,7 +5966,7 @@ for(i=0; i
+
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+QuantizationTable (i) {
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+type
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+scale=1
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+for(j=0; j
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+QuantizationTablePerContext(i, j, scale)
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+scale*=2*len_count[i][j]-1
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+context_count[i]=(scale+1)/2
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+MAX_CONTEXT_INPUTS is 5.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+
+
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+QuantizationTablePerContext (i, j, scale) {
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+type
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+v=0
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+for(k= 0; k<128;) {
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+len-1
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layo

Re: [FFmpeg-devel] [PATCH] avfilter: add findandcover filter

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 09:49:27AM +0200, Clément Bœsch wrote:
> On Wed, Apr 29, 2015 at 06:00:54PM +0200, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer 
[...]
> > +c = (n*oh_sum_v - o_sum_v*(int64_t)h_sum_v) / 
> > (sqrt(o_sigma)*sqrt(h_sigma));
> 
> not using sqrt(o_sigma * h_sigma) for precision or overflow concerns?

overflow


[...]
> > +for (y=0; y > +for (x=0; x > +data[x] = src[x];
> > +}
> 
> > +data += in->linesize[p];
> > +src += foc->cover_frame->linesize[p];
> 
> i've seen gcc derping a lot on this; you might want to check if taking
> these dereferencing out of the loop helps

i dont think that at this point of this loop it can have any overall
relevant effect


> 
> > +}
> > +}
> > +}
> > +static void blur(FOCContext *foc, AVFrame *in, int offx, int offy)
> > +{
> > +int x, y, p;
> > +
> > +for (p=0; p<3; p++) {
> 
> > +int ox = offx>>!!p;
> > +int oy = offy>>!!p;
> 
> FF_CEIL_RSHIFT?

no that would be wrong here
others changed to use FF_CEIL_RSHIF


> 
> > +int stride = in->linesize[p];
> > +uint8_t *data = in->data[p] + ox + oy * stride;
> > +int w = foc->obj_frame->width  >> !!p;
> > +int h = foc->obj_frame->height >> !!p;
> > +int iw = in->width  >> !!p;
> > +int ih = in->height >> !!p;
> > +for (y=0; y > +for (x=0; x > +int c = 0;
> > +int s = 0;
> > +if (ox) {
> > +int scale = 65536 / (x + 1);
> > +s += data[-1 + y*stride] * scale;
> > +c += scale;
> > +}
> > +if (oy) {
> > +int scale = 65536 / (y + 1);
> > +s += data[x - stride] * scale;
> > +c += scale;
> > +}
> > +if (ox + w < iw) {
> > +int scale = 65536 / (w - x);
> > +s += data[w + y*stride] * scale;
> > +c += scale;
> > +}
> > +if (oy + h < ih) {
> > +int scale = 65536 / (h - y);
> > +s += data[x + h*stride] * scale;
> > +c += scale;
> > +}
> > +data[x + y*stride] = (s + (c>>1)) / c;
> > +}
> > +}
> > +}
> > +}
> > +
> > +static int filter_frame(AVFilterLink *inlink, AVFrame *in)
> > +{
> > +AVFilterContext *ctx = inlink->dst;
> > +FOCContext *foc = ctx->priv;
> > +float best_score;
> > +int best_x, best_y;
> > +int i;
> > +
> > +foc->haystack_frame[0] = av_frame_clone(in);
> > +for (i=1; imipmaps; i++) {
> > +foc->haystack_frame[i] = downscale(foc->haystack_frame[i-1]);
> > +}
> > +
> > +best_score = search(foc, 0, 0,
> > +FFMAX(foc->xmin, foc->last_x - 8),
> > +FFMIN(foc->xmax, foc->last_x + 8),
> > +FFMAX(foc->ymin, foc->last_y - 8),
> > +FFMIN(foc->ymax, foc->last_y + 8),
> > +&best_x, &best_y, 1.0);
> > +
> > +best_score = search(foc, 0, foc->mipmaps - 1, foc->xmin, foc->xmax, 
> > foc->ymin, foc->ymax,
> > +&best_x, &best_y, best_score);
> > +
> > +for (i=0; i > +av_frame_free(&foc->haystack_frame[i]);
> > +}
> > +
> > +if (best_score > foc->threshold) {
> > +return ff_filter_frame(ctx->outputs[0], in);
> > +}
> > +
> 
> > +av_log(ctx, AV_LOG_DEBUG, "Found at %d %d score %f\n", best_x, best_y, 
> > best_score);
> 
> found what?

the filter is called "find and cover" so i think "Found" is clear


> 
> > +foc->last_x = best_x;
> > +foc->last_y = best_y;
> > +
> > +av_frame_make_writable(in);
> > +
> > +if (foc->mode == MODE_BLUR) {
> > +blur (foc, in, best_x, best_y);
> > +} else {
> > +cover(foc, in, best_x, best_y);
> > +}
> > +return ff_filter_frame(ctx->outputs[0], in);
> > +}
> > +
> > +static av_cold void uninit(AVFilterContext *ctx)
> > +{
> > +FOCContext *foc = ctx->priv;
> > +int i;
> > +
> > +for (i=0; i 
> nit: pleasefixthestyle

google says
mipmap has 287,000 result
mip map has 57,500 results



> 
> > +av_frame_free(&foc->needle_frame[i]);
> > +av_frame_free(&foc->haystack_frame[i]);
> > +}
> > +
> > +if (foc->obj_frame)
> > +av_freep(&foc->obj_frame->data[0]);
> > +if (foc->cover_frame)
> > +av_freep(&foc->cover_frame->data[0]);
> > +av_frame_free(&foc->obj_frame);
> > +}
> > +
> > +static av_cold int init(AVFilterContext *ctx)
> > +{
> > +FOCContext *foc = ctx->priv;
> > +int ret, i;
> > +
> > +if (!foc->obj_filename || (!foc->cover_filename && foc->mode == 
> > MODE_COVER)) {
> > +av_log(ctx, AV_LOG_ERROR, "object or cover filename not s

[FFmpeg-devel] [PATCH 0/4] FFV1 specification: Slice Header syntax moved and expanded

2015-04-30 Thread Jerome Martinez
Slice Header bitstream syntax is moved from the Slice subsection to its 
own subsection for more clarity and is expanded.
Corresponding HTML export: 
https://mediaarea.net/temp/ffv1-patched-SliceHeader.html#toc-Subsection-4.2

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


[FFmpeg-devel] [PATCH] avfilter: add findandcover filter

2015-04-30 Thread Michael Niedermayer
Signed-off-by: Michael Niedermayer 
---
 configure |1 +
 doc/filters.texi  |   46 +
 libavfilter/Makefile  |1 +
 libavfilter/allfilters.c  |1 +
 libavfilter/version.h |2 +-
 libavfilter/vf_findandcover.c |  399 +
 6 files changed, 449 insertions(+), 1 deletion(-)
 create mode 100644 libavfilter/vf_findandcover.c

diff --git a/configure b/configure
index 88e0d97..965a678 100755
--- a/configure
+++ b/configure
@@ -2644,6 +2644,7 @@ eq_filter_deps="gpl"
 fftfilt_filter_deps="avcodec"
 fftfilt_filter_select="rdft"
 flite_filter_deps="libflite"
+findandcover_filter_deps="gpl"
 frei0r_filter_deps="frei0r dlopen"
 frei0r_src_filter_deps="frei0r dlopen"
 fspp_filter_deps="gpl"
diff --git a/doc/filters.texi b/doc/filters.texi
index b7a9c9b..c5ddca1 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -5163,6 +5163,52 @@ framework.
 
 It does not take parameters.
 
+@section foc
+
+Find and cover a rectangular object
+
+It accepts the following options:
+
+@table @option
+@item object
+Filepath of the object image, needs to be in gray8.
+
+@item cover
+Filepath of the optional cover image, needs to be in yuv420.
+
+@item threshold
+Detection threshold, default is 0.5.
+
+@item mipmaps
+Number of mipmaps, default is 3.
+
+@item xmin, ymin, xmax, ymax
+Specifies the recatangle in which to search.
+
+@item mode
+Set covering mode.
+
+It accepts the following values:
+@table @samp
+@item cover
+cover it by the supplied image
+@item blur
+cover it by interpolating the surrounding pixels
+@end table
+
+Default value is @var{blur}.
+@end table
+
+@subsection Examples
+
+@itemize
+@item
+Generate a representative palette of a given video using @command{ffmpeg}:
+@example
+ffmpeg -i file.ts -vf foc=newref.pgm:cover.jpg:mode=cover new.mkv
+@end example
+@end itemize
+
 @anchor{format}
 @section format
 
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 48cee50..09bc465 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -126,6 +126,7 @@ OBJS-$(CONFIG_FFTFILT_FILTER)+= vf_fftfilt.o
 OBJS-$(CONFIG_FIELD_FILTER)  += vf_field.o
 OBJS-$(CONFIG_FIELDMATCH_FILTER) += vf_fieldmatch.o
 OBJS-$(CONFIG_FIELDORDER_FILTER) += vf_fieldorder.o
+OBJS-$(CONFIG_FINDANDCOVER_FILTER)   += vf_findandcover.o
 OBJS-$(CONFIG_FORMAT_FILTER) += vf_format.o
 OBJS-$(CONFIG_FRAMESTEP_FILTER)  += vf_framestep.o
 OBJS-$(CONFIG_FPS_FILTER)+= vf_fps.o
diff --git a/libavfilter/allfilters.c b/libavfilter/allfilters.c
index 7961dca..c4d4d74 100644
--- a/libavfilter/allfilters.c
+++ b/libavfilter/allfilters.c
@@ -142,6 +142,7 @@ void avfilter_register_all(void)
 REGISTER_FILTER(FIELD,  field,  vf);
 REGISTER_FILTER(FIELDMATCH, fieldmatch, vf);
 REGISTER_FILTER(FIELDORDER, fieldorder, vf);
+REGISTER_FILTER(FINDANDCOVER,   findandcover,   vf);
 REGISTER_FILTER(FORMAT, format, vf);
 REGISTER_FILTER(FPS,fps,vf);
 REGISTER_FILTER(FRAMEPACK,  framepack,  vf);
diff --git a/libavfilter/version.h b/libavfilter/version.h
index a4a9e63..d6dc95a 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFILTER_VERSION_MAJOR  5
-#define LIBAVFILTER_VERSION_MINOR  14
+#define LIBAVFILTER_VERSION_MINOR  15
 #define LIBAVFILTER_VERSION_MICRO 100
 
 #define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
diff --git a/libavfilter/vf_findandcover.c b/libavfilter/vf_findandcover.c
new file mode 100644
index 000..33947f0
--- /dev/null
+++ b/libavfilter/vf_findandcover.c
@@ -0,0 +1,399 @@
+/*
+ * Copyright (c) 2014-2015 Michael Niedermayer 
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#include "libavutil/avassert.h"
+#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
+#include "internal.h"
+
+#include "lavfutils.h"
+
+enum mode {
+MODE_COVER,
+MODE_BLUR,
+NB_MODES
+};
+
+#define MAX_MIPMAPS 5
+
+typedef struct FOCContext {
+AVClass *class;
+float threshold;
+int mipmaps;
+int xmin, ymin, xmax, ymax;
+

[FFmpeg-devel] [PATCH 1/4] FFV1 specification: Slice Header subsection

2015-04-30 Thread Jerome Martinez


>From d7a6ca009e1bc36402d8c73cb7c35185207f6f65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
Date: Thu, 30 Apr 2015 12:59:06 +0200
Subject: [PATCH 1/4] Slice Header subsection

Slice Header syntax is moved from Slice section to its own section
---
 ffv1.lyx | 969 ---
 1 file changed, 425 insertions(+), 544 deletions(-)

diff --git a/ffv1.lyx b/ffv1.lyx
index d90f048..cd22498 100644
--- a/ffv1.lyx
+++ b/ffv1.lyx
@@ -2314,7 +2314,7 @@ Slice
 
 \begin_layout Standard
 \begin_inset Tabular
-
+
 
 
 
@@ -2358,7 +2358,7 @@ type
 \begin_inset space ~
 \end_inset
 
-if(version>2) {
+if(version>2)
 \end_layout
 
 \end_inset
@@ -2409,7 +2409,7 @@ if(version>2) {
 \begin_inset space ~
 \end_inset
 
-slice_x
+SliceHeader(i)
 \end_layout
 
 \end_inset
@@ -2418,14 +2418,14 @@ slice_x
 \begin_inset Text
 
 \begin_layout Plain Layout
-ur
+
 \end_layout
 
 \end_inset
 
 
 
-
+
 \begin_inset Text
 
 \begin_layout Plain Layout
@@ -2444,23 +2444,7 @@ ur
 \begin_inset space ~
 \end_inset
 
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-slice_y
+if (colorspace_type == 1) {
 \end_layout
 
 \end_inset
@@ -2469,14 +2453,14 @@ slice_y
 \begin_inset Text
 
 \begin_layout Plain Layout
-ur
+
 \end_layout
 
 \end_inset
 
 
 
-
+
 \begin_inset Text
 
 \begin_layout Plain Layout
@@ -2511,7 +2495,15 @@ ur
 \begin_inset space ~
 \end_inset
 
-slice_width-1
+for (y=0;
+\begin_inset space ~
+\end_inset
+
+y
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-ur
-\end_layout
-
-\end_inset
-
-
-
-
-\begin_inset Text
 
-\begin_layout Plain Layout
 \begin_inset space ~
 \end_inset
 
@@ -2833,7 +2854,7 @@ ur
 \begin_inset space ~
 \end_inset
 
-sar_den
+AlphaLine[y]
 \end_layout
 
 \end_inset
@@ -2842,7 +2863,7 @@ sar_den
 \begin_inset Text
 
 \begin_layout Plain Layout
-ur
+
 \end_layout
 
 \end_inset
@@ -2884,7 +2905,7 @@ ur
 \begin_inset space ~
 \end_inset
 
-if (version > 3)
+}
 \end_layout
 
 \end_inset
@@ -2919,7 +2940,26 @@ if (version > 3)
 \begin_inset space ~
 \end_inset
 
+} else {
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
 
+\begin_layout Plain Layout
 \begin_inset space ~
 \end_inset
 
@@ -2951,7 +2991,7 @@ if (version > 3)
 \begin_inset space ~
 \end_inset
 
-reset_contexts
+LumaPlane
 \end_layout
 
 \end_inset
@@ -2960,7 +3000,7 @@ reset_contexts
 \begin_inset Text
 
 \begin_layout Plain Layout
-br
+
 \end_layout
 
 \end_inset
@@ -3002,23 +3042,7 @@ br
 \begin_inset space ~
 \end_inset
 
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-slice_coding_mode
+if (chroma_planes) {
 \end_layout
 
 \end_inset
@@ -3027,7 +3051,7 @@ slice_coding_mode
 \begin_inset Text
 
 \begin_layout Plain Layout
-ur
+
 \end_layout
 
 \end_inset
@@ -3053,26 +3077,19 @@ ur
 \begin_inset space ~
 \end_inset
 
-}
-\end_layout
 
+\begin_inset space ~
 \end_inset
-
-
-\begin_inset Text
 
-\begin_layout Plain Layout
 
-\end_layout
+\begin_inset space ~
+\end_inset
+
 
+\begin_inset space ~
 \end_inset
-
-
-
-
-\begin_inset Text
 
-\begin_layout Plain Layout
+
 \begin_inset space ~
 \end_inset
 
@@ -3088,7 +3105,11 @@ ur
 \begin_inset space ~
 \end_inset
 
-if (colorspace_type == 1) {
+
+\begin_inset space ~
+\end_inset
+
+CbPlane
 \end_layout
 
 \end_inset
@@ -3104,7 +3125,7 @@ if (colorspace_type == 1) {
 
 
 
-
+
 \begin_inset Text
 
 \begin_layout Plain Layout
@@ -3139,15 +3160,23 @@ if (colorspace_type == 1) {
 \begin_inset space ~
 \end_inset
 
-for (y=0;
+
 \begin_inset space ~
 \end_inset
 
-y
+
+\begin_inset Text
 
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-if (alpha_plane)
-\end_layout
-
-\end_inset
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
+\begin_layout Plain Layout
 
 \end_layout
 
@@ -3450,55 +3415,7 @@ if (alpha_plane)
 \begin_inset space ~
 \end_inset
 
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-
-\begin_inset space ~
-\end_inset
-
-AlphaLine[y]
+if(i || version>2)
 \end_layout
 
 \end_inset
@@ -3549,7 +3466,7 @@ AlphaLine[y]
 \begin_inset space ~
 \end_inset
 
-}
+slice_size
 \end_layout
 
 \end_inset
@@ -3558,7 +3475,7 @@ AlphaLine[y]
 \begin_inset Text
 
 \beg

[FFmpeg-devel] [PATCH 2/4] FFV1 specification: Slice Header specific semantics moved

2015-04-30 Thread Jerome Martinez


>From e700d99b0be2e758a8ae198affcc8c7c3bdc9473 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
Date: Thu, 30 Apr 2015 13:04:39 +0200
Subject: [PATCH 2/4] Slice Header specific semantics moved

>From Header version 3 section to Slice Header section
---
 ffv1.lyx | 350 +++
 1 file changed, 175 insertions(+), 175 deletions(-)

diff --git a/ffv1.lyx b/ffv1.lyx
index cd22498..b90406d 100644
--- a/ffv1.lyx
+++ b/ffv1.lyx
@@ -4492,6 +4492,181 @@ ur
 \end_layout
 
 \begin_layout Description
+slice_x indicates the x position on the slice raster formed by num_h_slices.
+\end_layout
+
+\begin_layout Description
+slice_y indicates the y position on the slice raster formed by num_v_slices.
+\end_layout
+
+\begin_layout Description
+slice_width indicates the width on the slice raster.
+\end_layout
+
+\begin_layout Description
+slice_height indicates the height on the slice raster.
+\end_layout
+
+\begin_layout Description
+quant_table_index indicates the index to select the quantization table set
+ and the initial states for the slice.
+\end_layout
+
+\begin_layout Description
+picture_structure specifies the picture structure.
+\begin_inset Newline newline
+\end_inset
+
+
+\begin_inset Tabular
+
+
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+value
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+picure structure used
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+unknown
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+top field first
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+bottom field first
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+progressive
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+Other
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+reserved for future use
+\end_layout
+
+\end_inset
+
+
+
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Description
+sar_num specifies the sample aspect ratio numerator.
+\begin_inset Newline newline
+\end_inset
+
+MUST be 0 if sample aspect ratio is unknown.
+\end_layout
+
+\begin_layout Description
+sar_den specifies the sample aspect ratio numerator.
+\begin_inset Newline newline
+\end_inset
+
+MUST be 0 if sample aspect ratio is unknown.
+\end_layout
+
+\begin_layout Description
 slice_coding_mode indicates the slice coding mode.
 \begin_inset Newline newline
 \end_inset
@@ -7199,181 +7374,6 @@ slice_count indicates the number of slices in the 
current frame, slice_count
 \end_layout
 
 \begin_layout Description
-slice_x indicates the x position on the slice raster formed by num_h_slices.
-\end_layout
-
-\begin_layout Description
-slice_y indicates the y position on the slice raster formed by num_v_slices.
-\end_layout
-
-\begin_layout Description
-slice_width indicates the width on the slice raster.
-\end_layout
-
-\begin_layout Description
-slice_height indicates the height on the slice raster.
-\end_layout
-
-\begin_layout Description
-quant_table_index indicates the index to select the quantization table set
- and the initial states for the slice.
-\end_layout
-
-\begin_layout Description
-picture_structure specifies the picture structure.
-\begin_inset Newline newline
-\end_inset
-
-
-\begin_inset Tabular
-
-
-
-
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-value
-\end_layout
-
-\end_inset
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-picure structure used
-\end_layout
-
-\end_inset
-
-
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-0
-\end_layout
-
-\end_inset
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-unknown
-\end_layout
-
-\end_inset
-
-
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-1
-\end_layout
-
-\end_inset
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-top field first
-\end_layout
-
-\end_inset
-
-
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-2
-\end_layout
-
-\end_inset
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-bottom field first
-\end_layout
-
-\end_inset
-
-
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-3
-\end_layout
-
-\end_inset
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-progressive
-\end_layout
-
-\end_inset
-
-
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-Other
-\end_layout
-
-\end_inset
-
-
-\begin_inset Text
-
-\begin_layout Plain Layout
-reserved for future use
-\end_layout
-
-\end_inset
-
-
-
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Description
-sar_num specifie

[FFmpeg-devel] [PATCH 3/4] FFV1 specification: Slice Header inferred values if not present

2015-04-30 Thread Jerome Martinez


>From 5c6efe277fd8efa590dd9ffe7950c4aebad44c97 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
Date: Thu, 30 Apr 2015 13:41:30 +0200
Subject: [PATCH 3/4] Slice Header inferred values if not present.

In the case of version 1 or 2, Slice Header does not exist and the 
specification should explicit the inferred values.
---
 ffv1.lyx | 36 
 1 file changed, 36 insertions(+)

diff --git a/ffv1.lyx b/ffv1.lyx
index b90406d..947158a 100644
--- a/ffv1.lyx
+++ b/ffv1.lyx
@@ -4493,23 +4493,43 @@ ur
 
 \begin_layout Description
 slice_x indicates the x position on the slice raster formed by num_h_slices.
+\begin_inset Newline newline
+\end_inset
+
+Inferred to be 0 if not present.
 \end_layout
 
 \begin_layout Description
 slice_y indicates the y position on the slice raster formed by num_v_slices.
+\begin_inset Newline newline
+\end_inset
+
+Inferred to be 0 if not present.
 \end_layout
 
 \begin_layout Description
 slice_width indicates the width on the slice raster.
+\begin_inset Newline newline
+\end_inset
+
+Inferred to be 1 if not present.
 \end_layout
 
 \begin_layout Description
 slice_height indicates the height on the slice raster.
+\begin_inset Newline newline
+\end_inset
+
+Inferred to be 1 if not present.
 \end_layout
 
 \begin_layout Description
 quant_table_index indicates the index to select the quantization table set
  and the initial states for the slice.
+\begin_inset Newline newline
+\end_inset
+
+Inferred to be 0 if not present.
 \end_layout
 
 \begin_layout Description
@@ -4517,6 +4537,10 @@ picture_structure specifies the picture structure.
 \begin_inset Newline newline
 \end_inset
 
+Inferred to be 0 if not present.
+\begin_inset Newline newline
+\end_inset
+
 
 \begin_inset Tabular
 
@@ -4655,6 +4679,10 @@ sar_num specifies the sample aspect ratio numerator.
 \begin_inset Newline newline
 \end_inset
 
+Inferred to be 0 if not present.
+\begin_inset Newline newline
+\end_inset
+
 MUST be 0 if sample aspect ratio is unknown.
 \end_layout
 
@@ -4663,6 +4691,10 @@ sar_den specifies the sample aspect ratio numerator.
 \begin_inset Newline newline
 \end_inset
 
+Inferred to be 0 if not present.
+\begin_inset Newline newline
+\end_inset
+
 MUST be 0 if sample aspect ratio is unknown.
 \end_layout
 
@@ -4671,6 +4703,10 @@ slice_coding_mode indicates the slice coding mode.
 \begin_inset Newline newline
 \end_inset
 
+Inferred to be 0 if not present.
+\begin_inset Newline newline
+\end_inset
+
 
 \begin_inset Tabular
 
-- 
1.9.5.msysgit.1

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


[FFmpeg-devel] [PATCH 4/4] FFV1 specification: reset_contexts bitstream element defined

2015-04-30 Thread Jerome Martinez


>From 9e5f9c491b10fcf4d1dd51414d5459cde12fca5b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
Date: Thu, 30 Apr 2015 13:43:42 +0200
Subject: [PATCH 4/4] reset_contexts bitstream element defined.

---
 ffv1.lyx | 8 
 1 file changed, 8 insertions(+)

diff --git a/ffv1.lyx b/ffv1.lyx
index 947158a..a7cf8cc 100644
--- a/ffv1.lyx
+++ b/ffv1.lyx
@@ -4699,6 +4699,14 @@ MUST be 0 if sample aspect ratio is unknown.
 \end_layout
 
 \begin_layout Description
+reset_contexts indicates if slice contexts must be reseted.
+\begin_inset Newline newline
+\end_inset
+
+Inferred to be 0 if not present.
+\end_layout
+
+\begin_layout Description
 slice_coding_mode indicates the slice coding mode.
 \begin_inset Newline newline
 \end_inset
-- 
1.9.5.msysgit.1

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


[FFmpeg-devel] [PATCH] lavf/mux: do not fail in case of non monotonically increasing DTS values for data packets

2015-04-30 Thread Stefano Sabatini
Disable monotonicity test for data packets. Data packets are not supposed
to be decoded by FFmpeg, and this checks cause conversion failure with
some files with non strictly monotonous timestamps.
---
 libavformat/mux.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index 9101925..f714168 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -486,10 +486,11 @@ static int compute_pkt_fields2(AVFormatContext *s, 
AVStream *st, AVPacket *pkt)
 pkt->dts = st->pts_buffer[0];
 }
 
-if (st->cur_dts && st->cur_dts != AV_NOPTS_VALUE &&
+if ((st->codec->codec_type != AVMEDIA_TYPE_DATA) &&
+(st->cur_dts && st->cur_dts != AV_NOPTS_VALUE &&
 ((!(s->oformat->flags & AVFMT_TS_NONSTRICT) &&
   st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE &&
-  st->cur_dts >= pkt->dts) || st->cur_dts > pkt->dts)) {
+  st->cur_dts >= pkt->dts) || st->cur_dts > pkt->dts))) {
 av_log(s, AV_LOG_ERROR,
"Application provided invalid, non monotonically increasing dts 
to muxer in stream %d: %s >= %s\n",
st->index, av_ts2str(st->cur_dts), av_ts2str(pkt->dts));
-- 
1.8.3.2

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


Re: [FFmpeg-devel] [PATCH] avfilter: add findandcover filter

2015-04-30 Thread Nicolas George
Le primidi 11 floréal, an CCXXIII, Michael Niedermayer a écrit :
> +@item object
> +Filepath of the object image, needs to be in gray8.
> +
> +@item cover
> +Filepath of the optional cover image, needs to be in yuv420.

Suggestion: read object and cover (if enabled) from a second and third input
to the filter. That way, format conversions, file reading, etc., is already
taken care of. That also allows future enhancement, like having object
and/or cover evolve.

Another suggestion: make the filter just "find", export the found
coordinates as metadata, and let overlay or delogo do the rest of the work.

Regards,

-- 
  Nicolas George


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


Re: [FFmpeg-devel] [PATCH 1/3] libavutil/softfloat: exponent adjusted for aac fixed point dec

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 01:51:35PM +0200, Nedeljko Babic wrote:
> Exponent usage and calculation in softfloat adjusted to the format used in
> implementation of fixed point aac decoder.
> 
> Signed-off-by: Nedeljko Babic 
> ---
>  libavutil/softfloat.h | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

applied

thanks

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope


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


Re: [FFmpeg-devel] [PATCH] Adobe HTTP Dynamic Streaming (HDS) demuxer improvements

2015-04-30 Thread Gorilla Maguila
New patch with some fixes:

- Corrected style and formatting.
- No ugly casts.
- New hds_probe function
- No forward declarations in f4fbox.c. I couldn't get rid of the forward
declaration in amfmetadata.c due to circular dependencies (Ideas welcome)
- Other minor fixes.


TODO:

- Fragment caching.
- Parsing child manifests

2015-04-28 15:00 GMT+02:00 Carl Eugen Hoyos :

> Gorilla Maguila  gmail.com> writes:
>
> > +static int hds_probe(AVProbeData *p)
> > +{
> > +if(p->filename && av_stristr(p->filename, ".f4m"))
> > +return AVPROBE_SCORE_MAX;
> > +return 0;
> > +}
>
> Remove this function, instead add ".f4m" as
> .extentions to the AVInputFormat.
>
> Carl Eugen
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
From 60067f45dea17c372e28201f8529250373bf002e Mon Sep 17 00:00:00 2001
From: Developer Mobdro 
Date: Thu, 30 Apr 2015 14:31:30 +0200
Subject: [PATCH] hds demuxer

---
 Changelog |   1 +
 configure |   5 +
 libavformat/Makefile  |   1 +
 libavformat/allformats.c  |   2 +-
 libavformat/amfmetadata.c | 228 +
 libavformat/amfmetadata.h |  39 +++
 libavformat/f4fbox.c  | 399 +++
 libavformat/f4fbox.h  |  95 ++
 libavformat/f4mmanifest.c | 338 +++
 libavformat/f4mmanifest.h |  59 
 libavformat/flvtag.c  | 378 +
 libavformat/flvtag.h  |  32 ++
 libavformat/hdsdec.c  | 815 ++
 13 files changed, 2391 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/amfmetadata.c
 create mode 100644 libavformat/amfmetadata.h
 create mode 100644 libavformat/f4fbox.c
 create mode 100644 libavformat/f4fbox.h
 create mode 100644 libavformat/f4mmanifest.c
 create mode 100644 libavformat/f4mmanifest.h
 create mode 100644 libavformat/flvtag.c
 create mode 100644 libavformat/flvtag.h
 create mode 100644 libavformat/hdsdec.c

diff --git a/Changelog b/Changelog
index 02dd77b..9862d22 100644
--- a/Changelog
+++ b/Changelog
@@ -18,6 +18,7 @@ version :
 - nvenc level and tier options
 - chorus filter
 - Canopus HQ/HQA decoder
+- HDS demuxer
 
 
 version 2.6:
diff --git a/configure b/configure
index 88e0d97..f296e25 100755
--- a/configure
+++ b/configure
@@ -276,6 +276,7 @@ External library support:
   --disable-sdldisable sdl [autodetect]
   --enable-x11grab enable X11 grabbing (legacy) [no]
   --disable-xlib   disable xlib [autodetect]
+  --disable-xml2   disable XML parsing using the C library libxml2 [autodetect]
   --disable-zlib   disable zlib [autodetect]
 
 Toolchain options:
@@ -1424,6 +1425,7 @@ EXTERNAL_LIBRARY_LIST="
 sdl
 x11grab
 xlib
+xml2
 zlib
 "
 
@@ -2482,6 +2484,7 @@ dxa_demuxer_select="riffdec"
 eac3_demuxer_select="ac3_parser"
 f4v_muxer_select="mov_muxer"
 flac_demuxer_select="flac_parser"
+hds_demuxer_select="xml2"
 hds_muxer_select="flv_muxer"
 hls_muxer_select="mpegts_muxer"
 image2_alias_pix_demuxer_select="image2_demuxer"
@@ -5014,6 +5017,8 @@ disabled  zlib || check_lib   zlib.h  zlibVersion -lz   || disable  zlib
 disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
 disabled  lzma || check_lib2  lzma.h lzma_version_number -llzma || disable lzma
 
+disabled xml2 || require_pkg_config libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion || disable xml2
+
 check_lib math.h sin -lm && LIBM="-lm"
 disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 8d9a770..d2062b7 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -179,6 +179,7 @@ OBJS-$(CONFIG_H263_DEMUXER)  += h263dec.o rawdec.o
 OBJS-$(CONFIG_H263_MUXER)+= rawenc.o
 OBJS-$(CONFIG_H264_DEMUXER)  += h264dec.o rawdec.o
 OBJS-$(CONFIG_H264_MUXER)+= rawenc.o
+OBJS-$(CONFIG_HDS_DEMUXER)   += hdsdec.o amfmetadata.o f4mmanifest.o f4fbox.o flvtag.o
 OBJS-$(CONFIG_HDS_MUXER) += hdsenc.o
 OBJS-$(CONFIG_HEVC_DEMUXER)  += hevcdec.o rawdec.o
 OBJS-$(CONFIG_HEVC_MUXER)+= rawenc.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index e6a9d01..d1be6d9 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -141,7 +141,7 @@ void av_register_all(void)
 REGISTER_MUXDEMUX(H261, h261);
 REGISTER_MUXDEMUX(H263, h263);
 REGISTER_MUXDEMUX(H264, h264);
-REGISTER_MUXER   (HDS,  hds);
+REGISTER_MUXDEMUX(HDS,  hds);
 REGISTER_MUXDEMUX(HEVC, hevc);
 REGISTER_MUXDEMUX(HLS,  hls);
 REGISTER_DEMUXER (HNM,  hnm);
diff --git a/libavformat/amfmetadata.c b/libavformat/amfmetadata.c
new file

Re: [FFmpeg-devel] [PATCH] avfilter: add findandcover filter

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:21:55PM +0200, Nicolas George wrote:
> Le primidi 11 floréal, an CCXXIII, Michael Niedermayer a écrit :
> > +@item object
> > +Filepath of the object image, needs to be in gray8.
> > +
> > +@item cover
> > +Filepath of the optional cover image, needs to be in yuv420.
> 
> Suggestion: read object and cover (if enabled) from a second and third input
> to the filter. That way, format conversions, file reading, etc., is already
> taken care of. That also allows future enhancement, like having object
> and/or cover evolve.
> 
> Another suggestion: make the filter just "find", export the found
> coordinates as metadata, and let overlay or delogo do the rest of the work.

These are good suggestions, do you and ubitux want to work on these?

I can volunteer to maintain the filter once these redesigns are done
or in case people agree that these redesigns are not mandatory for
pushing to main git


Thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway


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


Re: [FFmpeg-devel] [PATCH 1/3] libavutil/softfloat: exponent adjusted for aac fixed point dec

2015-04-30 Thread Nedeljko Babic
I submitted 2 more patches with this one, but for some reason they are all over 
the list (probably because I used the same Subject message as before)...

Should I resend them all again so they are together on the list?

Thanks,
-Nedeljko

Od: ffmpeg-devel-boun...@ffmpeg.org [ffmpeg-devel-boun...@ffmpeg.org] u ime 
korisnika Michael Niedermayer [michae...@gmx.at]
Poslato: 30. april 2015 14:31
Za: FFmpeg development discussions and patches
Tema: Re: [FFmpeg-devel] [PATCH 1/3] libavutil/softfloat: exponent  
adjusted for aac fixed point dec

On Thu, Apr 30, 2015 at 01:51:35PM +0200, Nedeljko Babic wrote:
> Exponent usage and calculation in softfloat adjusted to the format used in
> implementation of fixed point aac decoder.
>
> Signed-off-by: Nedeljko Babic 
> ---
>  libavutil/softfloat.h | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)

applied

thanks

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

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/3] libavutil/softfloat: Added av_normalize_sf in av_add_sf

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 01:51:36PM +0200, Nedeljko Babic wrote:
> This will normalize sums for which mantissa is smaller than the lower boundary
> (needed for implementation of fixed point aac decoder).
> 
> Signed-off-by: Nedeljko Babic 
> ---
>  libavutil/softfloat.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

applied

please add a testcase for this to the self tests

thanks

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato


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


Re: [FFmpeg-devel] [PATCH 2/3] libavutil/softfloat: Added av_normalize_sf in av_add_sf

2015-04-30 Thread Nedeljko Babic
ok

thanks,
-Nedeljko

Od: ffmpeg-devel-boun...@ffmpeg.org [ffmpeg-devel-boun...@ffmpeg.org] u ime 
korisnika Michael Niedermayer [michae...@gmx.at]
Poslato: 30. april 2015 14:52
Za: FFmpeg development discussions and patches
Tema: Re: [FFmpeg-devel] [PATCH 2/3] libavutil/softfloat: Added av_normalize_sf 
in av_add_sf

On Thu, Apr 30, 2015 at 01:51:36PM +0200, Nedeljko Babic wrote:
> This will normalize sums for which mantissa is smaller than the lower boundary
> (needed for implementation of fixed point aac decoder).
>
> Signed-off-by: Nedeljko Babic 
> ---
>  libavutil/softfloat.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

applied

please add a testcase for this to the self tests

thanks

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] libavutil/softfloat: Add functions.

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 01:51:37PM +0200, Nedeljko Babic wrote:
> Functions av_gt_sf, av_sqrt_sf and av_sincos_sf added to softfloat
> 
> Signed-off-by: Nedeljko Babic 
> ---
>  libavutil/softfloat.h|  93 +++-
>  libavutil/softfloat_tables.h | 260 
> +++
>  2 files changed, 352 insertions(+), 1 deletion(-)
>  create mode 100644 libavutil/softfloat_tables.h

applied

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

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.


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


Re: [FFmpeg-devel] [PATCH 1/3] libavutil/softfloat: exponent adjusted for aac fixed point dec

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 12:50:46PM +, Nedeljko Babic wrote:
> I submitted 2 more patches with this one, but for some reason they are all 
> over the list (probably because I used the same Subject message as before)...
> 
> Should I resend them all again so they are together on the list?

i think ive found and applied all 3

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

Old school: Use the lowest level language in which you can solve the problem
conveniently.
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.


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


Re: [FFmpeg-devel] [PATCH] FFV1 specification: Quantization Tables syntax

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:06:20PM +0200, Jerome Martinez wrote:
> Quantization Tables syntax was not defined.
> Corresponding HTML export: 
> https://mediaarea.net/temp/ffv1-patched-Quantization-tables-syntax.html#toc-Subsection-4.4
> 

>  ffv1.lyx | 1006 
> ++-
>  1 file changed, 1002 insertions(+), 4 deletions(-)
> 7625403ff9abc9cbb1dbcbaaec313510b92b9a0d  
> 0001-Quantization-tables-syntax.patch
> From 7d58498adbc04aeabc5497df0270c6ebd1cfac12 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
> Date: Wed, 29 Apr 2015 21:54:13 +0200

> Subject: [PATCH] Quantization tables syntax.

Add quantization tables syntax.


> 
> More details is provided about how to read quantization tables and the 
> associated values (context_count).
> ---
>  ffv1.lyx | 1006 
> +-
>  1 file changed, 1002 insertions(+), 4 deletions(-)
> 
> diff --git a/ffv1.lyx b/ffv1.lyx
> index 3d2380c..22c4a93 100644
> --- a/ffv1.lyx
> +++ b/ffv1.lyx
> @@ -5246,7 +5246,7 @@ br
>  \begin_inset space ~
>  \end_inset
>  
> -QuantizationTables
> +QuantizationTable(0)
>  \end_layout
>  
>  \end_inset
> @@ -5966,7 +5966,7 @@ for(i=0; i  \begin_inset space ~
>  \end_inset
>  
> -QuantizationTables
> +QuantizationTable(i)
>  \end_layout
>  
>  \end_inset
> @@ -6170,7 +6170,7 @@ if(states_coded)
>  \begin_inset space ~
>  \end_inset
>  
> -for(j=0; j +for(j=0; j  \end_layout
>  
>  \end_inset
> @@ -7906,7 +7906,7 @@ crc_parity 32bit that are choosen so that the global 
> header as a whole or
>  \end_layout
>  
>  \begin_layout Subsection
> -Quant Table
> +Quantization Tables
>  \end_layout
>  
>  \begin_layout Standard
> @@ -7933,6 +7933,1004 @@ Table: 0 0 1 1 1 1 2 2-2-2-2-1-1-1-1 0
>  \end_inset
>  
>  Stored values: 1, 3, 1
> +\begin_inset Newline newline
> +\end_inset
> +
> +
> +\end_layout
> +
> +\begin_layout Standard
> +\begin_inset Tabular
> +
> +
> +
> +
> +
> + usebox="none">
> +\begin_inset Text
> +
> +\begin_layout Plain Layout
> +QuantizationTable (i) {

normally i dont care that much about formating but in a spec
consistent formating is important otherwise it looks unprofessional
so please make sure formating is consistent throughut the spec
further above there is QuantizationTable(i), that is without
the space
i think ite better without the space


[...]
> +scale*=2*len_count[i][j]-1

missing spaces between operands and there are many more such
cases


> +\end_layout
> +
> +\end_inset
> +
> + rightline="true" usebox="none">
> +\begin_inset Text
> +
> +\begin_layout Plain Layout
> +
> +\end_layout
> +
> +\end_inset
> +
> +
> +
> + usebox="none">
> +\begin_inset Text
> +
> +\begin_layout Plain Layout
> +\begin_inset space ~
> +\end_inset
> +
> +
> +\begin_inset space ~
> +\end_inset
> +
> +
> +\begin_inset space ~
> +\end_inset
> +
> +
> +\begin_inset space ~
> +\end_inset
> +
> +}
> +\end_layout
> +
> +\end_inset
> +
> + rightline="true" usebox="none">
> +\begin_inset Text
> +
> +\begin_layout Plain Layout
> +
> +\end_layout
> +
> +\end_inset
> +
> +
> +
> + usebox="none">
> +\begin_inset Text
> +
> +\begin_layout Plain Layout
> +\begin_inset space ~
> +\end_inset
> +
> +
> +\begin_inset space ~
> +\end_inset
> +
> +
> +\begin_inset space ~
> +\end_inset
> +
> +
> +\begin_inset space ~
> +\end_inset
> +

> +context_count[i]=(scale+1)/2

is the rounding of the division operator defined somewhere ?
something like maybe refering to C for arithmetic operators

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are best at talking, realize last or never when they are wrong.


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


Re: [FFmpeg-devel] [PATCH 1/4] FFV1 specification: Slice Header subsection

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:10:51PM +0200, Jerome Martinez wrote:
> 

>  ffv1.lyx |  969 
> +++
>  1 file changed, 425 insertions(+), 544 deletions(-)
> 171224b09a73e0b6e2e99e10eb0096d84bc78098  0001-Slice-Header-subsection.patch
> From d7a6ca009e1bc36402d8c73cb7c35185207f6f65 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
> Date: Thu, 30 Apr 2015 12:59:06 +0200
> Subject: [PATCH 1/4] Slice Header subsection
> 
> Slice Header syntax is moved from Slice section to its own section

reworded a bit and applied

note, btw while not introduced by the patch there are some {} missing
in the syntax compared to its indention

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

He who knows, does not speak. He who speaks, does not know. -- Lao Tsu


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


Re: [FFmpeg-devel] [PATCH 1/4] FFV1 specification: Slice Header subsection

2015-04-30 Thread Jerome Martinez

Le 30/04/2015 16:11, Michael Niedermayer a écrit :
note, btw while not introduced by the patch there are some {} missing 
in the syntax compared to its indention


You killed my next patch ;-).

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


Re: [FFmpeg-devel] [PATCH 2/4] FFV1 specification: Slice Header specific semantics moved

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:11:35PM +0200, Jerome Martinez wrote:
> 

>  ffv1.lyx |  350 
> +++
>  1 file changed, 175 insertions(+), 175 deletions(-)
> 51d1ab490a52b63470b818051f716c02255ff9f6  
> 0002-Slice-Header-specific-semantics-moved.patch
> From e700d99b0be2e758a8ae198affcc8c7c3bdc9473 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
> Date: Thu, 30 Apr 2015 13:04:39 +0200
> Subject: [PATCH 2/4] Slice Header specific semantics moved
> 
> From Header version 3 section to Slice Header section

is it inteded not to move plane_count ?

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

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


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


Re: [FFmpeg-devel] [PATCH] FFV1 specification: Quantization Tables syntax

2015-04-30 Thread Jerome Martinez

Le 30/04/2015 15:53, Michael Niedermayer a écrit :

On Thu, Apr 30, 2015 at 02:06:20PM +0200, Jerome Martinez wrote:

Subject: [PATCH] Quantization tables syntax.

Add quantization tables syntax.


Modified



normally i dont care that much about formating but in a spec
consistent formating is important otherwise it looks unprofessional
so please make sure formating is consistent throughut the spec
further above there is QuantizationTable(i), that is without
the space
i think ite better without the space


I tried to do that everywhere but I missed these ones.
Fixed.


[...]

+scale*=2*len_count[i][j]-1

missing spaces between operands and there are many more such
cases


I deliberately reused the same formating than in the original 
specification, example:

if(coder_type>1)
No spaces between operands.

Actually there are already some inconsistent formating. Example:
if(version>2) {
LyX Document
if (colorspace_type == 1) {
I only used the most common formating in the original spec.

I propose to commit as is then I send a new patch with the formating.
(with or without spaces between operands, as you prefer, but I prefer on 
my side not to mix e.g. "version>2" and "scale *= 2 * len_count[i][j] - 
1", so I would reformat e.g. "version>2" to "version > 2" too)



+context_count[i]=(scale+1)/2

is the rounding of the division operator defined somewhere ?
something like maybe refering to C for arithmetic operators


Not for the moment.
Explicit definition of operations is planned in a future dedicated patch.

New patch attached (patch title, no space between function name and 
parameters).
>From 929f3ea088fc52a7340c8b973cc422104863f4b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
Date: Thu, 30 Apr 2015 16:20:45 +0200
Subject: [PATCH] Add quantization tables syntax.

More details is provided about how to read quantization tables and the 
associated values (context_count).
---
 ffv1.lyx | 1006 +-
 1 file changed, 1002 insertions(+), 4 deletions(-)

diff --git a/ffv1.lyx b/ffv1.lyx
index 3d2380c..829e685 100644
--- a/ffv1.lyx
+++ b/ffv1.lyx
@@ -5246,7 +5246,7 @@ br
 \begin_inset space ~
 \end_inset
 
-QuantizationTables
+QuantizationTable(0)
 \end_layout
 
 \end_inset
@@ -5966,7 +5966,7 @@ for(i=0; i
+
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+QuantizationTable(i) {
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+type
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+scale=1
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+for(j=0; j
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+QuantizationTablePerContext(i, j, scale)
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+scale*=2*len_count[i][j]-1
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+
+\begin_inset space ~
+\end_inset
+
+context_count[i]=(scale+1)/2
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+}
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\end_inset
+
+
+
+
+\end_inset

Re: [FFmpeg-devel] [PATCH] lavf/mux: do not fail in case of non monotonically increasing DTS values for data packets

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:20:52PM +0200, Stefano Sabatini wrote:
> Disable monotonicity test for data packets. Data packets are not supposed
> to be decoded by FFmpeg, and this checks cause conversion failure with
> some files with non strictly monotonous timestamps.
> ---
>  libavformat/mux.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)

most muxers will not work with packets which arent ordered no matter
what type the packets are

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

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


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


Re: [FFmpeg-devel] [PATCH 2/4] FFV1 specification: Slice Header specific semantics moved

2015-04-30 Thread Jerome Martinez

Le 30/04/2015 16:20, Michael Niedermayer a écrit :

is it inteded not to move plane_count ?


plane_count is actually not part of the bitstream syntax (it is computed 
from chroma_planes and transparency).
Additionally, the definition (" LyX Document count of planes") is 
misleading (plane_count is 2 in the case of 3 planes, because the 
chroma_planes are counted as 1).
So I plan to remove it and add a more clear definition of the count of 
quant_table_indexes in a future patch.

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


Re: [FFmpeg-devel] [PATCH] FFV1 specification: Quantization Tables syntax

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 04:22:23PM +0200, Jerome Martinez wrote:
> Le 30/04/2015 15:53, Michael Niedermayer a écrit :
> >On Thu, Apr 30, 2015 at 02:06:20PM +0200, Jerome Martinez wrote:
> >>Subject: [PATCH] Quantization tables syntax.
> >Add quantization tables syntax.
> 
> Modified
> 
> >
> >normally i dont care that much about formating but in a spec
> >consistent formating is important otherwise it looks unprofessional
> >so please make sure formating is consistent throughut the spec
> >further above there is QuantizationTable(i), that is without
> >the space
> >i think ite better without the space
> 
> I tried to do that everywhere but I missed these ones.
> Fixed.
> 
> >[...]
> >>+scale*=2*len_count[i][j]-1
> >missing spaces between operands and there are many more such
> >cases
> 
> I deliberately reused the same formating than in the original
> specification, example:
> if(coder_type>1)
> No spaces between operands.
> 
> Actually there are already some inconsistent formating. Example:
> if(version>2) {
> LyX Document
> if (colorspace_type == 1) {
> I only used the most common formating in the original spec.
> 
> I propose to commit as is then I send a new patch with the formating.
> (with or without spaces between operands, as you prefer, but I
> prefer on my side not to mix e.g. "version>2" and "scale *= 2 *
> len_count[i][j] - 1", so I would reformat e.g. "version>2" to
> "version > 2" too)
> 
> >>+context_count[i]=(scale+1)/2
> >is the rounding of the division operator defined somewhere ?
> >something like maybe refering to C for arithmetic operators
> 
> Not for the moment.
> Explicit definition of operations is planned in a future dedicated patch.
> 
> New patch attached (patch title, no space between function name and
> parameters).

>  ffv1.lyx | 1006 
> ++-
>  1 file changed, 1002 insertions(+), 4 deletions(-)
> 6c31eedc120a06e8575ccdeedc141dc49fb7c5cd  
> 0001-Add-quantization-tables-syntax.patch
> From 929f3ea088fc52a7340c8b973cc422104863f4b4 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
> Date: Thu, 30 Apr 2015 16:20:45 +0200
> Subject: [PATCH] Add quantization tables syntax.
> 
> More details is provided about how to read quantization tables and the 
> associated values (context_count).
> ---
>  ffv1.lyx | 1006 
> +-
>  1 file changed, 1002 insertions(+), 4 deletions(-)

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA


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


[FFmpeg-devel] [PATCH 01/16] vp9: profile 1 header decoding.

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 88 
 1 file changed, 64 insertions(+), 24 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 1310798..3487f99 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -112,8 +112,7 @@ typedef struct VP9Context {
 uint8_t invisible;
 uint8_t use_last_frame_mvs;
 uint8_t errorres;
-uint8_t colorspace;
-uint8_t fullrange;
+uint8_t ss_h, ss_v;
 uint8_t intraonly;
 uint8_t resetctx;
 uint8_t refreshrefmask;
@@ -463,11 +462,56 @@ static int update_prob(VP56RangeCoder *c, int p)
 255 - inv_recenter_nonneg(inv_map_table[d], 255 - p);
 }
 
+static enum AVPixelFormat read_colorspace_details(AVCodecContext *ctx)
+{
+static const enum AVColorSpace colorspaces[8] = {
+AVCOL_SPC_UNSPECIFIED, AVCOL_SPC_BT470BG, AVCOL_SPC_BT709, 
AVCOL_SPC_SMPTE170M,
+AVCOL_SPC_SMPTE240M, AVCOL_SPC_BT2020_NCL, AVCOL_SPC_RESERVED, 
AVCOL_SPC_RGB,
+};
+VP9Context *s = ctx->priv_data;
+enum AVPixelFormat res;
+
+ctx->colorspace = colorspaces[get_bits(&s->gb, 3)];
+if (ctx->colorspace == AVCOL_SPC_RGB) { // RGB = profile 1
+if (s->profile == 1) {
+s->ss_h = s->ss_v = 1;
+res = AV_PIX_FMT_GBRP;
+ctx->color_range = AVCOL_RANGE_JPEG;
+} else {
+av_log(ctx, AV_LOG_ERROR, "RGB not supported in profile 0\n");
+return AVERROR_INVALIDDATA;
+}
+} else {
+static const enum AVPixelFormat pix_fmt_for_ss[2 /* v */][2 /* h */] = 
{
+{ AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P },
+{ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV420P },
+};
+ctx->color_range = get_bits1(&s->gb) ? AVCOL_RANGE_JPEG : 
AVCOL_RANGE_MPEG;
+if (s->profile == 1) {
+s->ss_h = get_bits1(&s->gb);
+s->ss_v = get_bits1(&s->gb);
+if ((res = pix_fmt_for_ss[s->ss_v][s->ss_h]) == 
AV_PIX_FMT_YUV420P) {
+av_log(ctx, AV_LOG_ERROR, "YUV 4:2:0 not supported in profile 
1\n");
+return AVERROR_INVALIDDATA;
+} else if (get_bits1(&s->gb)) {
+av_log(ctx, AV_LOG_ERROR, "Profile 1 color details reserved 
bit set\n");
+return AVERROR_INVALIDDATA;
+}
+} else {
+s->ss_h = s->ss_v = 1;
+res = AV_PIX_FMT_YUV420P;
+}
+}
+
+return res;
+}
+
 static int decode_frame_header(AVCodecContext *ctx,
const uint8_t *data, int size, int *ref)
 {
 VP9Context *s = ctx->priv_data;
 int c, i, j, k, l, m, n, w, h, max, size2, res, sharp;
+enum AVPixelFormat fmt = ctx->pix_fmt;
 int last_invisible;
 const uint8_t *data2;
 
@@ -481,8 +525,9 @@ static int decode_frame_header(AVCodecContext *ctx,
 return AVERROR_INVALIDDATA;
 }
 s->profile = get_bits1(&s->gb);
-if (get_bits1(&s->gb)) { // reserved bit
-av_log(ctx, AV_LOG_ERROR, "Reserved bit should be zero\n");
+s->profile |= get_bits1(&s->gb) << 1;
+if (s->profile > 1) {
+av_log(ctx, AV_LOG_ERROR, "Profile %d is not yet supported\n", 
s->profile);
 return AVERROR_INVALIDDATA;
 }
 if (get_bits1(&s->gb)) {
@@ -500,12 +545,8 @@ static int decode_frame_header(AVCodecContext *ctx,
 av_log(ctx, AV_LOG_ERROR, "Invalid sync code\n");
 return AVERROR_INVALIDDATA;
 }
-s->colorspace = get_bits(&s->gb, 3);
-if (s->colorspace == 7) { // RGB = profile 1
-av_log(ctx, AV_LOG_ERROR, "RGB not supported in profile 0\n");
-return AVERROR_INVALIDDATA;
-}
-s->fullrange  = get_bits1(&s->gb);
+if ((fmt = read_colorspace_details(ctx)) < 0)
+return fmt;
 // for profile 1, here follows the subsampling bits
 s->refreshrefmask = 0xff;
 w = get_bits(&s->gb, 16) + 1;
@@ -520,6 +561,15 @@ static int decode_frame_header(AVCodecContext *ctx,
 av_log(ctx, AV_LOG_ERROR, "Invalid sync code\n");
 return AVERROR_INVALIDDATA;
 }
+if (s->profile == 1) {
+if ((fmt = read_colorspace_details(ctx)) < 0)
+return fmt;
+} else {
+s->ss_h = s->ss_v = 1;
+fmt = AV_PIX_FMT_YUV420P;
+ctx->colorspace = AVCOL_SPC_BT470BG;
+ctx->color_range = AVCOL_RANGE_JPEG;
+}
 s->refreshrefmask = get_bits(&s->gb, 8);
 w = get_bits(&s->gb, 16) + 1;
 h = get_bits(&s->gb, 16) + 1;
@@ -3808,18 +3858,6 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 return res;
 }
 
-if (s->fullrange)
-ctx->color_range = AVCOL_RANGE_JPEG;
-else
-ctx->color_range = AVCOL_RANGE_MPEG;
-
-switch (s->colorspace) {
-case 1: ctx->colorspace = AVCOL_SPC_BT470BG; break;
-

[FFmpeg-devel] [PATCH 04/16] vp9: take chroma subsampling into account when walking the block tree.

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 42 +-
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 985e184..4a777d6 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3188,24 +3188,24 @@ static void decode_sb(AVCodecContext *ctx, int row, int 
col, struct VP9Filter *l
 case PARTITION_H:
 decode_b(ctx, row, col, lflvl, yoff, uvoff, bl, bp);
 yoff  += hbs * 8 * y_stride;
-uvoff += hbs * 4 * uv_stride;
+uvoff += hbs * 8 * uv_stride >> s->ss_v;
 decode_b(ctx, row + hbs, col, lflvl, yoff, uvoff, bl, bp);
 break;
 case PARTITION_V:
 decode_b(ctx, row, col, lflvl, yoff, uvoff, bl, bp);
 yoff  += hbs * 8;
-uvoff += hbs * 4;
+uvoff += hbs * 8 >> s->ss_h;
 decode_b(ctx, row, col + hbs, lflvl, yoff, uvoff, bl, bp);
 break;
 case PARTITION_SPLIT:
 decode_sb(ctx, row, col, lflvl, yoff, uvoff, bl + 1);
 decode_sb(ctx, row, col + hbs, lflvl,
-  yoff + 8 * hbs, uvoff + 4 * hbs, bl + 1);
+  yoff + 8 * hbs, uvoff + (8 * hbs >> s->ss_h), bl + 
1);
 yoff  += hbs * 8 * y_stride;
-uvoff += hbs * 4 * uv_stride;
+uvoff += hbs * 8 * uv_stride >> s->ss_v;
 decode_sb(ctx, row + hbs, col, lflvl, yoff, uvoff, bl + 1);
 decode_sb(ctx, row + hbs, col + hbs, lflvl,
-  yoff + 8 * hbs, uvoff + 4 * hbs, bl + 1);
+  yoff + 8 * hbs, uvoff + (8 * hbs >> s->ss_h), bl + 
1);
 break;
 default:
 av_assert0(0);
@@ -3214,7 +3214,7 @@ static void decode_sb(AVCodecContext *ctx, int row, int 
col, struct VP9Filter *l
 bp = PARTITION_SPLIT;
 decode_sb(ctx, row, col, lflvl, yoff, uvoff, bl + 1);
 decode_sb(ctx, row, col + hbs, lflvl,
-  yoff + 8 * hbs, uvoff + 4 * hbs, bl + 1);
+  yoff + 8 * hbs, uvoff + (8 * hbs >> s->ss_h), bl + 1);
 } else {
 bp = PARTITION_H;
 decode_b(ctx, row, col, lflvl, yoff, uvoff, bl, bp);
@@ -3224,7 +3224,7 @@ static void decode_sb(AVCodecContext *ctx, int row, int 
col, struct VP9Filter *l
 bp = PARTITION_SPLIT;
 decode_sb(ctx, row, col, lflvl, yoff, uvoff, bl + 1);
 yoff  += hbs * 8 * y_stride;
-uvoff += hbs * 4 * uv_stride;
+uvoff += hbs * 8 * uv_stride >> s->ss_v;
 decode_sb(ctx, row + hbs, col, lflvl, yoff, uvoff, bl + 1);
 } else {
 bp = PARTITION_V;
@@ -3253,11 +3253,11 @@ static void decode_sb_mem(AVCodecContext *ctx, int row, 
int col, struct VP9Filte
 decode_b(ctx, row, col, lflvl, yoff, uvoff, b->bl, b->bp);
 if (b->bp == PARTITION_H && row + hbs < s->rows) {
 yoff  += hbs * 8 * y_stride;
-uvoff += hbs * 4 * uv_stride;
+uvoff += hbs * 8 * uv_stride >> s->ss_v;
 decode_b(ctx, row + hbs, col, lflvl, yoff, uvoff, b->bl, b->bp);
 } else if (b->bp == PARTITION_V && col + hbs < s->cols) {
 yoff  += hbs * 8;
-uvoff += hbs * 4;
+uvoff += hbs * 8 >> s->ss_h;
 decode_b(ctx, row, col + hbs, lflvl, yoff, uvoff, b->bl, b->bp);
 }
 } else {
@@ -3265,20 +3265,20 @@ static void decode_sb_mem(AVCodecContext *ctx, int row, 
int col, struct VP9Filte
 if (col + hbs < s->cols) { // FIXME why not <=?
 if (row + hbs < s->rows) {
 decode_sb_mem(ctx, row, col + hbs, lflvl, yoff + 8 * hbs,
-  uvoff + 4 * hbs, bl + 1);
+  uvoff + (8 * hbs >> s->ss_h), bl + 1);
 yoff  += hbs * 8 * y_stride;
-uvoff += hbs * 4 * uv_stride;
+uvoff += hbs * 8 * uv_stride >> s->ss_v;
 decode_sb_mem(ctx, row + hbs, col, lflvl, yoff, uvoff, bl + 1);
 decode_sb_mem(ctx, row + hbs, col + hbs, lflvl,
-yoff + 8 * hbs, uvoff + 4 * hbs, bl + 1);
+yoff + 8 * hbs, uvoff + (8 * hbs >> 
s->ss_h), bl + 1);
 } else {
 yoff  += hbs * 8;
-uvoff += hbs * 4;
+uvoff += hbs * 8 >> s->ss_h;
 decode_sb_mem(ctx, row, col + hbs, lflvl, yoff, uvoff, bl + 1);
 }
 } else if (row + hbs < s->rows) {
 yoff  += hbs * 8 * y_stride;
-uvoff += hbs * 4 * uv_stride;
+uvoff += hbs * 8 * uv_stride >> s->ss_v;
 decode_sb_mem(ctx, row + hbs, col, lflvl, yoff, uvoff, bl + 1);
 }
 }
@@ -3943,7 +3943,7 @@ static int vp9_decode_frame(AVC

[FFmpeg-devel] [PATCH 05/16] vp9: use correct chroma subsampling for profile 1 intra block recon.

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 25 +
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 4a777d6..63ce641 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -2390,7 +2390,7 @@ static av_always_inline int check_intra_mode(VP9Context 
*s, int mode, uint8_t **
  uint8_t *dst_inner, ptrdiff_t 
stride_inner,
  uint8_t *l, int col, int x, int w,
  int row, int y, enum TxfmMode tx,
- int p)
+ int p, int ss_h, int ss_v)
 {
 int have_top = row > 0 || y > 0;
 int have_left = col > s->tiling.tile_col_start || x > 0;
@@ -2445,7 +2445,7 @@ static av_always_inline int check_intra_mode(VP9Context 
*s, int mode, uint8_t **
 mode = mode_conv[mode][have_left][have_top];
 if (edges[mode].needs_top) {
 uint8_t *top, *topleft;
-int n_px_need = 4 << tx, n_px_have = (((s->cols - col) << !p) - x) * 4;
+int n_px_need = 4 << tx, n_px_have = (((s->cols - col) << !ss_h) - x) 
* 4;
 int n_px_need_tr = 0;
 
 if (tx == TX_4X4 && edges[mode].needs_topright && have_right)
@@ -2456,11 +2456,11 @@ static av_always_inline int check_intra_mode(VP9Context 
*s, int mode, uint8_t **
 // post-loopfilter data)
 if (have_top) {
 top = !(row & 7) && !y ?
-s->intra_pred_data[p] + col * (8 >> !!p) + x * 4 :
+s->intra_pred_data[p] + col * (8 >> ss_h) + x * 4 :
 y == 0 ? &dst_edge[-stride_edge] : &dst_inner[-stride_inner];
 if (have_left)
 topleft = !(row & 7) && !y ?
-s->intra_pred_data[p] + col * (8 >> !!p) + x * 4 :
+s->intra_pred_data[p] + col * (8 >> ss_h) + x * 4 :
 y == 0 || x == 0 ? &dst_edge[-stride_edge] :
 &dst_inner[-stride_inner];
 }
@@ -2501,7 +2501,7 @@ static av_always_inline int check_intra_mode(VP9Context 
*s, int mode, uint8_t **
 }
 if (edges[mode].needs_left) {
 if (have_left) {
-int n_px_need = 4 << tx, i, n_px_have = (((s->rows - row) << !p) - 
y) * 4;
+int n_px_need = 4 << tx, i, n_px_have = (((s->rows - row) << 
!ss_v) - y) * 4;
 uint8_t *dst = x == 0 ? dst_edge : dst_inner;
 ptrdiff_t stride = x == 0 ? stride_edge : stride_inner;
 
@@ -2560,7 +2560,7 @@ static void intra_recon(AVCodecContext *ctx, ptrdiff_t 
y_off, ptrdiff_t uv_off)
 mode = check_intra_mode(s, mode, &a, ptr_r,
 s->frames[CUR_FRAME].tf.f->linesize[0],
 ptr, s->y_stride, l,
-col, x, w4, row, y, b->tx, 0);
+col, x, w4, row, y, b->tx, 0, 0, 0);
 s->dsp.intra_pred[b->tx][mode](ptr, s->y_stride, l, a);
 if (eob)
 s->dsp.itxfm_add[tx][txtp](ptr, s->y_stride,
@@ -2571,9 +2571,9 @@ static void intra_recon(AVCodecContext *ctx, ptrdiff_t 
y_off, ptrdiff_t uv_off)
 }
 
 // U/V
-w4 >>= 1;
-end_x >>= 1;
-end_y >>= 1;
+w4 >>= s->ss_h;
+end_x >>= s->ss_h;
+end_y >>= s->ss_v;
 step = 1 << (b->uvtx * 2);
 for (p = 0; p < 2; p++) {
 dst   = s->dst[1 + p];
@@ -2588,8 +2588,8 @@ static void intra_recon(AVCodecContext *ctx, ptrdiff_t 
y_off, ptrdiff_t uv_off)
 
 mode = check_intra_mode(s, mode, &a, ptr_r,
 s->frames[CUR_FRAME].tf.f->linesize[1],
-ptr, s->uv_stride, l,
-col, x, w4, row, y, b->uvtx, p + 1);
+ptr, s->uv_stride, l, col, x, w4, row, 
y,
+b->uvtx, p + 1, s->ss_h, s->ss_v);
 s->dsp.intra_pred[b->uvtx][mode](ptr, s->uv_stride, l, a);
 if (eob)
 s->dsp.itxfm_add[uvtx][DCT_DCT](ptr, s->uv_stride,
@@ -3010,7 +3010,8 @@ static void decode_b(AVCodecContext *ctx, int row, int 
col,
 b->bl = bl;
 b->bp = bp;
 decode_mode(ctx);
-b->uvtx = b->tx - (w4 * 2 == (1 << b->tx) || h4 * 2 == (1 << b->tx));
+b->uvtx = b->tx - ((s->ss_h && w4 * 2 == (1 << b->tx)) ||
+   (s->ss_v && h4 * 2 == (1 << b->tx)));
 
 if (!b->skip) {
 decode_coeffs(ctx);
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 03/16] vp9: support non-420 chroma subsampling for profile 1 token decoding.

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 77 
 1 file changed, 38 insertions(+), 39 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 702498a..985e184 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -2337,12 +2337,12 @@ static void decode_coeffs(AVCodecContext *ctx)
 break;
 }
 
-#define DECODE_UV_COEF_LOOP(step) \
+#define DECODE_UV_COEF_LOOP(step, decode_coeffs_fn) \
 for (n = 0, y = 0; y < end_y; y += step) { \
 for (x = 0; x < end_x; x += step, n += step * step) { \
-res = decode_coeffs_b(&s->c, s->uvblock[pl] + 16 * n, \
-  16 * step * step, c, e, p, a[x] + l[y], \
-  uvscan, uvnb, uv_band_counts, qmul[1]); \
+res = decode_coeffs_fn(&s->c, s->uvblock[pl] + 16 * n, \
+   16 * step * step, c, e, p, a[x] + l[y], \
+   uvscan, uvnb, uv_band_counts, qmul[1]); \
 a[x] = l[y] = !!res; \
 if (step >= 4) { \
 AV_WN16A(&s->uveob[pl][n], res); \
@@ -2355,36 +2355,30 @@ static void decode_coeffs(AVCodecContext *ctx)
 p = s->prob.coef[b->uvtx][1 /* uv */][!b->intra];
 c = s->counts.coef[b->uvtx][1 /* uv */][!b->intra];
 e = s->counts.eob[b->uvtx][1 /* uv */][!b->intra];
-w4 >>= 1;
-h4 >>= 1;
-end_x >>= 1;
-end_y >>= 1;
+w4 >>= s->ss_h;
+end_x >>= s->ss_h;
+h4 >>= s->ss_v;
+end_y >>= s->ss_v;
 for (pl = 0; pl < 2; pl++) {
-a = &s->above_uv_nnz_ctx[pl][col];
-l = &s->left_uv_nnz_ctx[pl][row & 7];
+a = &s->above_uv_nnz_ctx[pl][col << !s->ss_h];
+l = &s->left_uv_nnz_ctx[pl][(row & 7) << !s->ss_v];
 switch (b->uvtx) {
 case TX_4X4:
-DECODE_UV_COEF_LOOP(1);
+DECODE_UV_COEF_LOOP(1, decode_coeffs_b);
 break;
 case TX_8X8:
 MERGE_CTX(2, AV_RN16A);
-DECODE_UV_COEF_LOOP(2);
+DECODE_UV_COEF_LOOP(2, decode_coeffs_b);
 SPLAT_CTX(2);
 break;
 case TX_16X16:
 MERGE_CTX(4, AV_RN32A);
-DECODE_UV_COEF_LOOP(4);
+DECODE_UV_COEF_LOOP(4, decode_coeffs_b);
 SPLAT_CTX(4);
 break;
 case TX_32X32:
 MERGE_CTX(8, AV_RN64A);
-// a 64x64 (max) uv block can ever only contain 1 tx32x32 block
-// so there is no need to loop
-res = decode_coeffs_b32(&s->c, s->uvblock[pl],
-1024, c, e, p, a[0] + l[0],
-uvscan, uvnb, uv_band_counts, qmul[1]);
-a[0] = l[0] = !!res;
-AV_WN16A(&s->uveob[pl][0], res);
+DECODE_UV_COEF_LOOP(8, decode_coeffs_b32);
 SPLAT_CTX(8);
 break;
 }
@@ -3031,34 +3025,39 @@ static void decode_b(AVCodecContext *ctx, int row, int 
col,
 case 8:  AV_ZERO64(&v);  break; \
 case 16: AV_ZERO128(&v); break; \
 }
-#define SPLAT_ZERO_YUV(dir, var, off, n) \
+#define SPLAT_ZERO_YUV(dir, var, off, n, dir2) \
 do { \
 SPLAT_ZERO_CTX(s->dir##_y_##var[off * 2], n * 2); \
-SPLAT_ZERO_CTX(s->dir##_uv_##var[0][off], n); \
-SPLAT_ZERO_CTX(s->dir##_uv_##var[1][off], n); \
+if (s->ss_##dir2) { \
+SPLAT_ZERO_CTX(s->dir##_uv_##var[0][off], n); \
+SPLAT_ZERO_CTX(s->dir##_uv_##var[1][off], n); \
+} else { \
+SPLAT_ZERO_CTX(s->dir##_uv_##var[0][off * 2], n * 2); \
+SPLAT_ZERO_CTX(s->dir##_uv_##var[1][off * 2], n * 2); \
+} \
 } while (0)
 
 switch (w4) {
-case 1: SPLAT_ZERO_YUV(above, nnz_ctx, col, 1); break;
-case 2: SPLAT_ZERO_YUV(above, nnz_ctx, col, 2); break;
-case 4: SPLAT_ZERO_YUV(above, nnz_ctx, col, 4); break;
-case 8: SPLAT_ZERO_YUV(above, nnz_ctx, col, 8); break;
+case 1: SPLAT_ZERO_YUV(above, nnz_ctx, col, 1, h); break;
+case 2: SPLAT_ZERO_YUV(above, nnz_ctx, col, 2, h); break;
+case 4: SPLAT_ZERO_YUV(above, nnz_ctx, col, 4, h); break;
+case 8: SPLAT_ZERO_YUV(above, nnz_ctx, col, 8, h); break;
 }
 switch (h4) {
-case 1: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 1); break;
-case 2: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 2); break;
-case 4: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 4); break;
-case 8: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 8); break;
+case 1: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 1, v); break;
+case 2: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 2, v); break;
+case 4: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 4, v); break;
+case 8: SPLAT_ZERO_YUV(left, nnz_ctx, row7, 8, v); break;
 }
 }
 if (s->pass == 1) {
 s->b++;
 s->block += w4 * h4 * 64;
-   

[FFmpeg-devel] [PATCH 06/16] vp9: use correct chroma subsampling for profile 1 inter block recon.

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c |  16 +--
 libavcodec/vp9_mc_template.c | 300 +--
 2 files changed, 271 insertions(+), 45 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 63ce641..f151c23 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -2609,7 +2609,7 @@ static av_always_inline void mc_luma_scaled(VP9Context 
*s, vp9_scaled_mc_func sm
 int bw, int bh, int w, int h,
 const uint16_t *scale, const 
uint8_t *step)
 {
-#define scale_mv(n, dim) (((int64_t)n * scale[dim]) >> 14)
+#define scale_mv(n, dim) (((int64_t)(n) * scale[dim]) >> 14)
 // BUG libvpx seems to scale the two components separately. This introduces
 // rounding errors but we have to reproduce them to be exactly compatible
 // with the output from libvpx...
@@ -2653,8 +2653,8 @@ static av_always_inline void mc_chroma_scaled(VP9Context 
*s, vp9_scaled_mc_func
   const uint16_t *scale, const 
uint8_t *step)
 {
 // BUG https://code.google.com/p/webm/issues/detail?id=820
-int mx = scale_mv(mv->x, 0) + (scale_mv(x * 16, 0) & ~15) + (scale_mv(x * 
32, 0) & 15);
-int my = scale_mv(mv->y, 1) + (scale_mv(y * 16, 1) & ~15) + (scale_mv(y * 
32, 1) & 15);
+int mx = scale_mv(mv->x << !s->ss_h, 0) + (scale_mv(x * 16, 0) & ~15) + 
(scale_mv(x * 32, 0) & 15);
+int my = scale_mv(mv->y << !s->ss_v, 1) + (scale_mv(y * 16, 1) & ~15) + 
(scale_mv(y * 32, 1) & 15);
 #undef scale_mv
 int refbw_m1, refbh_m1;
 int th;
@@ -2670,7 +2670,7 @@ static av_always_inline void mc_chroma_scaled(VP9Context 
*s, vp9_scaled_mc_func
 // FIXME bilinear filter only needs 0/1 pixels, not 3/4
 // we use +7 because the last 7 pixels of each sbrow can be changed in
 // the longest loopfilter of the next sbrow
-th = (y + refbh_m1 + 4 + 7) >> 5;
+th = (y + refbh_m1 + 4 + 7) >> (6 - s->ss_v);
 ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
 if (x < 3 || y < 3 || x + 4 >= w - refbw_m1 || y + 4 >= h - refbh_m1) {
 s->vdsp.emulated_edge_mc(s->edge_emu_buffer,
@@ -2748,7 +2748,7 @@ static av_always_inline void 
mc_chroma_unscaled(VP9Context *s, vp9_mc_func (*mc)
 ptrdiff_t y, ptrdiff_t x, 
const VP56mv *mv,
 int bw, int bh, int w, int h)
 {
-int mx = mv->x, my = mv->y, th;
+int mx = mv->x << !s->ss_h, my = mv->y << !s->ss_v, th;
 
 y += my >> 4;
 x += mx >> 4;
@@ -2759,7 +2759,7 @@ static av_always_inline void 
mc_chroma_unscaled(VP9Context *s, vp9_mc_func (*mc)
 // FIXME bilinear filter only needs 0/1 pixels, not 3/4
 // we use +7 because the last 7 pixels of each sbrow can be changed in
 // the longest loopfilter of the next sbrow
-th = (y + bh + 4 * !!my + 7) >> 5;
+th = (y + bh + 4 * !!my + 7) >> (6 - s->ss_v);
 ff_thread_await_progress(ref_frame, FFMAX(th, 0), 0);
 if (x < !!mx * 3 || y < !!my * 3 ||
 x + !!mx * 4 > w - bw || y + !!my * 4 > h - bh) {
@@ -2833,8 +2833,8 @@ static void inter_recon(AVCodecContext *ctx)
 }
 
 // uv itxfm add
-end_x >>= 1;
-end_y >>= 1;
+end_x >>= s->ss_h;
+end_y >>= s->ss_v;
 step = 1 << (b->uvtx * 2);
 for (p = 0; p < 2; p++) {
 dst = s->dst[p + 1];
diff --git a/libavcodec/vp9_mc_template.c b/libavcodec/vp9_mc_template.c
index c6ae432..11b9500 100644
--- a/libavcodec/vp9_mc_template.c
+++ b/libavcodec/vp9_mc_template.c
@@ -21,6 +21,12 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#define ROUNDED_DIV_MVx2(a, b) \
+(VP56mv) { .x = ROUNDED_DIV(a.x + b.x, 2), .y = ROUNDED_DIV(a.y + b.y, 2) }
+#define ROUNDED_DIV_MVx4(a, b, c, d) \
+(VP56mv) { .x = ROUNDED_DIV(a.x + b.x + c.x + d.x, 4), \
+   .y = ROUNDED_DIV(a.y + b.y + c.y + d.y, 4) }
+
 static void FN(inter_pred)(AVCodecContext *ctx)
 {
 static const uint8_t bwlog_tab[2][N_BS_SIZES] = {
@@ -44,6 +50,8 @@ static void FN(inter_pred)(AVCodecContext *ctx)
 
 // y inter pred
 if (b->bs > BS_8x8) {
+VP56mv uvmv;
+
 if (b->bs == BS_8x4) {
 mc_luma_dir(s, mc[3][b->filter][0], s->dst[0], ls_y,
 ref1->data[0], ref1->linesize[0], tref1,
@@ -52,6 +60,30 @@ static void FN(inter_pred)(AVCodecContext *ctx)
 s->dst[0] + 4 * ls_y, ls_y,
 ref1->data[0], ref1->linesize[0], tref1,
 (row << 3) + 4, col << 3, &b->mv[2][0], 8, 4, w1, h1, 
0);
+w1 = (w1 + s->ss_h) >> s->ss_h;
+if (s->ss_v) {
+h1 = (h1 + 1) >> 1;
+uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[2][0]);
+mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][0],
+  s->dst[1], s->dst[2], ls_uv,

[FFmpeg-devel] [PATCH 02/16] vp9: increase buffer sizes for non-420 chroma subsamplings.

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 67 +++-
 1 file changed, 37 insertions(+), 30 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 3487f99..702498a 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -215,7 +215,7 @@ typedef struct VP9Context {
 DECLARE_ALIGNED(16, uint8_t, left_y_nnz_ctx)[16];
 DECLARE_ALIGNED(16, uint8_t, left_mode_ctx)[16];
 DECLARE_ALIGNED(16, VP56mv, left_mv_ctx)[16][2];
-DECLARE_ALIGNED(8, uint8_t, left_uv_nnz_ctx)[2][8];
+DECLARE_ALIGNED(16, uint8_t, left_uv_nnz_ctx)[2][16];
 DECLARE_ALIGNED(8, uint8_t, left_partition_ctx)[8];
 DECLARE_ALIGNED(8, uint8_t, left_skip_ctx)[8];
 DECLARE_ALIGNED(8, uint8_t, left_txfm_ctx)[8];
@@ -248,8 +248,8 @@ typedef struct VP9Context {
 int16_t *block_base, *block, *uvblock_base[2], *uvblock[2];
 uint8_t *eob_base, *uveob_base[2], *eob, *uveob[2];
 struct { int x, y; } min_mv, max_mv;
-DECLARE_ALIGNED(32, uint8_t, tmp_y)[64*64];
-DECLARE_ALIGNED(32, uint8_t, tmp_uv)[2][32*32];
+DECLARE_ALIGNED(32, uint8_t, tmp_y)[64 * 64];
+DECLARE_ALIGNED(32, uint8_t, tmp_uv)[2][64 * 64];
 uint16_t mvscale[3][2];
 uint8_t mvstep[3][2];
 } VP9Context;
@@ -307,39 +307,42 @@ static int vp9_ref_frame(AVCodecContext *ctx, VP9Frame 
*dst, VP9Frame *src)
 return 0;
 }
 
-static int update_size(AVCodecContext *ctx, int w, int h)
+static int update_size(AVCodecContext *ctx, int w, int h, enum AVPixelFormat 
fmt)
 {
 VP9Context *s = ctx->priv_data;
 uint8_t *p;
 
 av_assert0(w > 0 && h > 0);
 
-if (s->intra_pred_data[0] && w == ctx->width && h == ctx->height)
+if (s->intra_pred_data[0] && w == ctx->width && h == ctx->height && 
ctx->pix_fmt == fmt)
 return 0;
 
-ctx->width  = w;
-ctx->height = h;
-s->sb_cols  = (w + 63) >> 6;
-s->sb_rows  = (h + 63) >> 6;
-s->cols = (w + 7) >> 3;
-s->rows = (h + 7) >> 3;
+ctx->width   = w;
+ctx->height  = h;
+ctx->pix_fmt = fmt;
+s->sb_cols   = (w + 63) >> 6;
+s->sb_rows   = (h + 63) >> 6;
+s->cols  = (w + 7) >> 3;
+s->rows  = (h + 7) >> 3;
 
 #define assign(var, type, n) var = (type) p; p += s->sb_cols * (n) * 
sizeof(*var)
 av_freep(&s->intra_pred_data[0]);
-p = av_malloc(s->sb_cols * (240 + sizeof(*s->lflvl) + 16 * 
sizeof(*s->above_mv_ctx)));
+// FIXME we slightly over-allocate here for subsampled chroma, but a little
+// bit of padding shouldn't affect performance...
+p = av_malloc(s->sb_cols * (320 + sizeof(*s->lflvl) + 16 * 
sizeof(*s->above_mv_ctx)));
 if (!p)
 return AVERROR(ENOMEM);
 assign(s->intra_pred_data[0],  uint8_t *, 64);
-assign(s->intra_pred_data[1],  uint8_t *, 32);
-assign(s->intra_pred_data[2],  uint8_t *, 32);
+assign(s->intra_pred_data[1],  uint8_t *, 64);
+assign(s->intra_pred_data[2],  uint8_t *, 64);
 assign(s->above_y_nnz_ctx, uint8_t *, 16);
 assign(s->above_mode_ctx,  uint8_t *, 16);
 assign(s->above_mv_ctx,VP56mv(*)[2],  16);
+assign(s->above_uv_nnz_ctx[0], uint8_t *, 16);
+assign(s->above_uv_nnz_ctx[1], uint8_t *, 16);
 assign(s->above_partition_ctx, uint8_t *,  8);
 assign(s->above_skip_ctx,  uint8_t *,  8);
 assign(s->above_txfm_ctx,  uint8_t *,  8);
-assign(s->above_uv_nnz_ctx[0], uint8_t *,  8);
-assign(s->above_uv_nnz_ctx[1], uint8_t *,  8);
 assign(s->above_segpred_ctx,   uint8_t *,  8);
 assign(s->above_intra_ctx, uint8_t *,  8);
 assign(s->above_comp_ctx,  uint8_t *,  8);
@@ -358,34 +361,39 @@ static int update_size(AVCodecContext *ctx, int w, int h)
 static int update_block_buffers(AVCodecContext *ctx)
 {
 VP9Context *s = ctx->priv_data;
+int chroma_blocks, chroma_eobs;
 
 if (s->b_base && s->block_base && s->block_alloc_using_2pass == 
s->frames[CUR_FRAME].uses_2pass)
 return 0;
 
 av_free(s->b_base);
 av_free(s->block_base);
+chroma_blocks = 64 * 64 >> (s->ss_h + s->ss_v);
+chroma_eobs   = 16 * 16 >> (s->ss_h + s->ss_v);
 if (s->frames[CUR_FRAME].uses_2pass) {
 int sbs = s->sb_cols * s->sb_rows;
 
 s->b_base = av_malloc_array(s->cols * s->rows, sizeof(VP9Block));
-s->block_base = av_mallocz((64 * 64 + 128) * sbs * 3);
+s->block_base = av_mallocz(((64 * 64 + 2 * chroma_blocks) * 
sizeof(int16_t) +
+16 * 16 + 2 * chroma_eobs) * sbs);
 if (!s->b_base || !s->block_base)
 return AVERROR(ENOMEM);
 s->uvblock_base[0] = s->block_base + sbs * 64 * 64;
-s->uvblock_base[1] = s->uvblock_base[0] + sbs * 32 * 32;
-s->eob_base = (uint8_t *) (s->uvblock_base[1] + sbs * 32 * 32);
-s->uveob_

[FFmpeg-devel] [PATCH 07/16] vp9: invert order of two conditions.

2015-04-30 Thread Ronald S. Bultje
This makes it equal to row-based loopfilter code, and also makes the
chroma/luma code identical.
---
 libavcodec/vp9.c | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index f151c23..4228621 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3309,11 +3309,11 @@ static void loopfilter_sb(AVCodecContext *ctx, struct 
VP9Filter *lflvl,
 unsigned hm = hm1 | hm2 | hm13 | hm23;
 
 for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 8, l++) {
-if (hm1 & x) {
-int L = *l, H = L >> 4;
-int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
+if (col || x > 1) {
+if (hm1 & x) {
+int L = *l, H = L >> 4;
+int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
 
-if (col || x > 1) {
 if (hmask1[0] & x) {
 if (hmask2[0] & x) {
 av_assert2(l[8] == L);
@@ -,12 +,10 @@ static void loopfilter_sb(AVCodecContext *ctx, struct 
VP9Filter *lflvl,
 s->dsp.loop_filter_8[!!(hmask1[1] & x)]
 [0](ptr, ls_y, E, I, H);
 }
-}
-} else if (hm2 & x) {
-int L = l[8], H = L >> 4;
-int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
+} else if (hm2 & x) {
+int L = l[8], H = L >> 4;
+int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
 
-if (col || x > 1) {
 s->dsp.loop_filter_8[!!(hmask2[1] & x)]
 [0](ptr + 8 * ls_y, ls_y, E, I, H);
 }
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 11/16] vp9: add fate test for profile 1 444.

2015-04-30 Thread Ronald S. Bultje
Sample available at:
http://downloads.webmproject.org/test_data/libvpx/vp91-2-04-yuv444.webm
---
 tests/fate/vpx.mak | 43 --
 tests/ref/fate/vp9p1-04-yuv444 | 15 +++
 2 files changed, 40 insertions(+), 18 deletions(-)
 create mode 100644 tests/ref/fate/vp9p1-04-yuv444

diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
index ac7db5c..ab6b15d 100644
--- a/tests/fate/vpx.mak
+++ b/tests/fate/vpx.mak
@@ -85,6 +85,12 @@ fate-vp9$(2)-$(1): CMD = framemd5 $(3) -i 
$(TARGET_SAMPLES)/vp9-test-vectors/vp9
 fate-vp9$(2)-$(1): REF = $(SRC_PATH)/tests/ref/fate/vp9-$(1)
 endef
 
+define FATE_VP9_PROFILE_SUITE
+FATE_VP9-$(CONFIG_MATROSKA_DEMUXER) += fate-vp9p$(2)-$(1)
+fate-vp9p$(2)-$(1): CMD = framemd5 -i 
$(TARGET_SAMPLES)/vp9-test-vectors/vp9$(2)-2-$(1).webm
+fate-vp9p$(2)-$(1): REF = $(SRC_PATH)/tests/ref/fate/vp9p$(2)-$(1)
+endef
+
 VP9_Q = 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 \
 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 \
 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 \
@@ -94,24 +100,25 @@ VP9_SIZE_A = 08 10 16 18 32 34 64 66
 VP9_SIZE_B = 196 198 200 202 208 210 224 226
 
 define FATE_VP9_FULL
-$(foreach Q,$(VP9_Q),$(eval $(call 
FATE_VP9_SUITE,00-quantizer-$(Q),$(1),$(2
-$(foreach SHARP,$(VP9_SHARP),$(eval $(call 
FATE_VP9_SUITE,01-sharpness-$(SHARP),$(1),$(2
-$(foreach W,$(VP9_SIZE_A),$(eval $(foreach H,$(VP9_SIZE_A),$(eval $(call 
FATE_VP9_SUITE,02-size-$(W)x$(H),$(1),$(2))
-$(foreach W,$(VP9_SIZE_B),$(eval $(foreach H,$(VP9_SIZE_B),$(eval $(call 
FATE_VP9_SUITE,03-size-$(W)x$(H),$(1),$(2))
-$(eval $(call FATE_VP9_SUITE,03-deltaq,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,06-bilinear,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,09-lf_deltas,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,10-show-existing-frame,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,10-show-existing-frame2,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,15-segkey_adpq,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,16-intra-only,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,2pass-akiyo,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,parallelmode-akiyo,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,segmentation-aq-akiyo,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,segmentation-sf-akiyo,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,tiling-pedestrian,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,trac3849,$(1),$(2)))
-$(eval $(call FATE_VP9_SUITE,trac4359,$(1),$(2)))
+$(foreach Q,$(VP9_Q),$(eval $(call FATE_VP9_SUITE,00-quantizer-$(Q
+$(foreach SHARP,$(VP9_SHARP),$(eval $(call 
FATE_VP9_SUITE,01-sharpness-$(SHARP
+$(foreach W,$(VP9_SIZE_A),$(eval $(foreach H,$(VP9_SIZE_A),$(eval $(call 
FATE_VP9_SUITE,02-size-$(W)x$(H))
+$(foreach W,$(VP9_SIZE_B),$(eval $(foreach H,$(VP9_SIZE_B),$(eval $(call 
FATE_VP9_SUITE,03-size-$(W)x$(H))
+$(eval $(call FATE_VP9_SUITE,03-deltaq))
+$(eval $(call FATE_VP9_PROFILE_SUITE,04-yuv444,1))
+$(eval $(call FATE_VP9_SUITE,06-bilinear))
+$(eval $(call FATE_VP9_SUITE,09-lf_deltas))
+$(eval $(call FATE_VP9_SUITE,10-show-existing-frame))
+$(eval $(call FATE_VP9_SUITE,10-show-existing-frame2))
+$(eval $(call FATE_VP9_SUITE,15-segkey_adpq))
+$(eval $(call FATE_VP9_SUITE,16-intra-only))
+$(eval $(call FATE_VP9_SUITE,2pass-akiyo))
+$(eval $(call FATE_VP9_SUITE,parallelmode-akiyo))
+$(eval $(call FATE_VP9_SUITE,segmentation-aq-akiyo))
+$(eval $(call FATE_VP9_SUITE,segmentation-sf-akiyo))
+$(eval $(call FATE_VP9_SUITE,tiling-pedestrian))
+$(eval $(call FATE_VP9_SUITE,trac3849))
+$(eval $(call FATE_VP9_SUITE,trac4359))
 endef
 
 $(eval $(call FATE_VP9_FULL))
diff --git a/tests/ref/fate/vp9p1-04-yuv444 b/tests/ref/fate/vp9p1-04-yuv444
new file mode 100644
index 000..e9559c6
--- /dev/null
+++ b/tests/ref/fate/vp9p1-04-yuv444
@@ -0,0 +1,15 @@
+#format: frame checksums
+#version: 1
+#hash: MD5
+#tb 0: 1/25
+#stream#, dts,pts, duration, size, hash
+0,  0,  0,1,   304128, 859df7b3661783e337a16ee79f3c20bc
+0,  1,  1,1,   304128, 3b3ccf344cd5a478c4c1fa422497183d
+0,  2,  2,1,   304128, 3be1f565823cb88013a14a93a3cf9480
+0,  3,  3,1,   304128, 6e188a963deaf46c2d6e741b03c4240c
+0,  4,  4,1,   304128, 82ead184ae478ac821b1b4b72f28c9cd
+0,  5,  5,1,   304128, 59bb43badc76b39a228b1ad96b6339ca
+0,  6,  6,1,   304128, 2eaee790fc188e2251b92dd4ea90c42a
+0,  7,  7,1,   304128, 2a95f8727589e710dc1b95400916b72e
+0,  8,  8,1,   304128, b7032f73544a7108fcdcaca2832ecc32
+0,  9,  9,1,   304128, b7778c35b30bcc400b25ed0e5b7913e1
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 08/16] vp9: split out loopfilter luma rows/cols functions from loopfilter_sb().

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 97 
 1 file changed, 56 insertions(+), 41 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 4228621..0647dd4 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3285,25 +3285,15 @@ static void decode_sb_mem(AVCodecContext *ctx, int row, 
int col, struct VP9Filte
 }
 }
 
-static void loopfilter_sb(AVCodecContext *ctx, struct VP9Filter *lflvl,
-  int row, int col, ptrdiff_t yoff, ptrdiff_t uvoff)
+static av_always_inline void filter_plane_cols(VP9Context *s, int col,
+   uint8_t *lvl, uint8_t 
(*mask)[4],
+   uint8_t *dst, ptrdiff_t ls)
 {
-VP9Context *s = ctx->priv_data;
-AVFrame *f = s->frames[CUR_FRAME].tf.f;
-uint8_t *dst = f->data[0] + yoff, *lvl = lflvl->level;
-ptrdiff_t ls_y = f->linesize[0], ls_uv = f->linesize[1];
-int y, x, p;
+int y, x;
 
-// FIXME in how far can we interleave the v/h loopfilter calls? E.g.
-// if you think of them as acting on a 8x8 block max, we can interleave
-// each v/h within the single x loop, but that only works if we work on
-// 8 pixel blocks, and we won't always do that (we want at least 16px
-// to use SSE2 optimizations, perhaps 32 for AVX2)
-
-// filter edges between columns, Y plane (e.g. block1 | block2)
-for (y = 0; y < 8; y += 2, dst += 16 * ls_y, lvl += 16) {
-uint8_t *ptr = dst, *l = lvl, *hmask1 = lflvl->mask[0][0][y];
-uint8_t *hmask2 = lflvl->mask[0][0][y + 1];
+// filter edges between columns (e.g. block1 | block2)
+for (y = 0; y < 8; y += 2, dst += 16 * ls, lvl += 16) {
+uint8_t *ptr = dst, *l = lvl, *hmask1 = mask[y], *hmask2 = mask[y + 1];
 unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2], hm13 = hmask1[3];
 unsigned hm2 = hmask2[1] | hmask2[2], hm23 = hmask2[3];
 unsigned hm = hm1 | hm2 | hm13 | hm23;
@@ -3317,9 +3307,9 @@ static void loopfilter_sb(AVCodecContext *ctx, struct 
VP9Filter *lflvl,
 if (hmask1[0] & x) {
 if (hmask2[0] & x) {
 av_assert2(l[8] == L);
-s->dsp.loop_filter_16[0](ptr, ls_y, E, I, H);
+s->dsp.loop_filter_16[0](ptr, ls, E, I, H);
 } else {
-s->dsp.loop_filter_8[2][0](ptr, ls_y, E, I, H);
+s->dsp.loop_filter_8[2][0](ptr, ls, E, I, H);
 }
 } else if (hm2 & x) {
 L = l[8];
@@ -3328,17 +3318,17 @@ static void loopfilter_sb(AVCodecContext *ctx, struct 
VP9Filter *lflvl,
 I |= s->filter.lim_lut[L] << 8;
 s->dsp.loop_filter_mix2[!!(hmask1[1] & x)]
[!!(hmask2[1] & x)]
-   [0](ptr, ls_y, E, I, H);
+   [0](ptr, ls, E, I, H);
 } else {
 s->dsp.loop_filter_8[!!(hmask1[1] & x)]
-[0](ptr, ls_y, E, I, H);
+[0](ptr, ls, E, I, H);
 }
 } else if (hm2 & x) {
 int L = l[8], H = L >> 4;
 int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
 
 s->dsp.loop_filter_8[!!(hmask2[1] & x)]
-[0](ptr + 8 * ls_y, ls_y, E, I, H);
+[0](ptr + 8 * ls, ls, E, I, H);
 }
 }
 if (hm13 & x) {
@@ -3350,26 +3340,31 @@ static void loopfilter_sb(AVCodecContext *ctx, struct 
VP9Filter *lflvl,
 H |= (L >> 4) << 8;
 E |= s->filter.mblim_lut[L] << 8;
 I |= s->filter.lim_lut[L] << 8;
-s->dsp.loop_filter_mix2[0][0][0](ptr + 4, ls_y, E, I, H);
+s->dsp.loop_filter_mix2[0][0][0](ptr + 4, ls, E, I, H);
 } else {
-s->dsp.loop_filter_8[0][0](ptr + 4, ls_y, E, I, H);
+s->dsp.loop_filter_8[0][0](ptr + 4, ls, E, I, H);
 }
 } else if (hm23 & x) {
 int L = l[8], H = L >> 4;
 int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
 
-s->dsp.loop_filter_8[0][0](ptr + 8 * ls_y + 4, ls_y, E, I, H);
+s->dsp.loop_filter_8[0][0](ptr + 8 * ls + 4, ls, E, I, H);
 }
 }
 }
+}
 
-//  block1
-// filter edges between rows, Y plane (e.g. --)
-//  block2
-dst = f->data[0] + yoff;
-lvl = lflvl->level;
-for (y = 0; 

[FFmpeg-devel] [PATCH 09/16] vp9: merge uv loopfilter code into generic filter_plane_rows/cols().

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 215 ++-
 1 file changed, 71 insertions(+), 144 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 0647dd4..98a98f9 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3285,20 +3285,20 @@ static void decode_sb_mem(AVCodecContext *ctx, int row, 
int col, struct VP9Filte
 }
 }
 
-static av_always_inline void filter_plane_cols(VP9Context *s, int col,
+static av_always_inline void filter_plane_cols(VP9Context *s, int col, int ss,
uint8_t *lvl, uint8_t 
(*mask)[4],
uint8_t *dst, ptrdiff_t ls)
 {
 int y, x;
 
 // filter edges between columns (e.g. block1 | block2)
-for (y = 0; y < 8; y += 2, dst += 16 * ls, lvl += 16) {
-uint8_t *ptr = dst, *l = lvl, *hmask1 = mask[y], *hmask2 = mask[y + 1];
+for (y = 0; y < 8; y += 2 << ss, dst += 16 * ls, lvl += 16 << ss) {
+uint8_t *ptr = dst, *l = lvl, *hmask1 = mask[y], *hmask2 = mask[y + (1 
<< ss)];
 unsigned hm1 = hmask1[0] | hmask1[1] | hmask1[2], hm13 = hmask1[3];
 unsigned hm2 = hmask2[1] | hmask2[2], hm23 = hmask2[3];
 unsigned hm = hm1 | hm2 | hm13 | hm23;
 
-for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 8, l++) {
+for (x = 1; hm & ~(x - 1); x <<= 1, ptr += 8 >> ss) {
 if (col || x > 1) {
 if (hm1 & x) {
 int L = *l, H = L >> 4;
@@ -3306,13 +3306,13 @@ static av_always_inline void 
filter_plane_cols(VP9Context *s, int col,
 
 if (hmask1[0] & x) {
 if (hmask2[0] & x) {
-av_assert2(l[8] == L);
+av_assert2(l[8 << ss] == L);
 s->dsp.loop_filter_16[0](ptr, ls, E, I, H);
 } else {
 s->dsp.loop_filter_8[2][0](ptr, ls, E, I, H);
 }
 } else if (hm2 & x) {
-L = l[8];
+L = l[8 << ss];
 H |= (L >> 4) << 8;
 E |= s->filter.mblim_lut[L] << 8;
 I |= s->filter.lim_lut[L] << 8;
@@ -3324,37 +3324,43 @@ static av_always_inline void 
filter_plane_cols(VP9Context *s, int col,
 [0](ptr, ls, E, I, H);
 }
 } else if (hm2 & x) {
-int L = l[8], H = L >> 4;
+int L = l[8 << ss], H = L >> 4;
 int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
 
 s->dsp.loop_filter_8[!!(hmask2[1] & x)]
 [0](ptr + 8 * ls, ls, E, I, H);
 }
 }
-if (hm13 & x) {
-int L = *l, H = L >> 4;
-int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
-
-if (hm23 & x) {
-L = l[8];
-H |= (L >> 4) << 8;
-E |= s->filter.mblim_lut[L] << 8;
-I |= s->filter.lim_lut[L] << 8;
-s->dsp.loop_filter_mix2[0][0][0](ptr + 4, ls, E, I, H);
-} else {
-s->dsp.loop_filter_8[0][0](ptr + 4, ls, E, I, H);
-}
-} else if (hm23 & x) {
-int L = l[8], H = L >> 4;
-int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
+if (ss) {
+if (x & 0xAA)
+l += 2;
+} else {
+if (hm13 & x) {
+int L = *l, H = L >> 4;
+int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
+
+if (hm23 & x) {
+L = l[8];
+H |= (L >> 4) << 8;
+E |= s->filter.mblim_lut[L] << 8;
+I |= s->filter.lim_lut[L] << 8;
+s->dsp.loop_filter_mix2[0][0][0](ptr + 4, ls, E, I, H);
+} else {
+s->dsp.loop_filter_8[0][0](ptr + 4, ls, E, I, H);
+}
+} else if (hm23 & x) {
+int L = l[8], H = L >> 4;
+int E = s->filter.mblim_lut[L], I = s->filter.lim_lut[L];
 
-s->dsp.loop_filter_8[0][0](ptr + 8 * ls + 4, ls, E, I, H);
+s->dsp.loop_filter_8[0][0](ptr + 8 * ls + 4, ls, E, I, H);
+}
+l++;
 }
 }
 }
 }
 
-static av_always_inline void filter_plane_rows(VP9Context *s, int row,
+static av_always_inline void filter_plane_rows(VP9Context *s, int row, int ss,
uint8_t *lvl, uint8_t 
(*mask)[4],
uint8_t *dst, ptrdiff_t ls)
 {
@@ -33

[FFmpeg-devel] [PATCH 10/16] vp9: don't create special u/v filter masks for 444.

2015-04-30 Thread Ronald S. Bultje
This fixes vp91-2-04-yuv444.webm.
---
 libavcodec/vp9.c | 14 --
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index 98a98f9..aeaf5ca 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3132,10 +3132,11 @@ static void decode_b(AVCodecContext *ctx, int row, int 
col,
 
 setctx_2d(&lflvl->level[row7 * 8 + col7], w4, h4, 8, lvl);
 mask_edges(lflvl, 0, row7, col7, x_end, y_end, 0, 0, b->tx, 
skip_inter);
-mask_edges(lflvl, 1, row7, col7, x_end, y_end,
-   s->cols & 1 && col + w4 >= s->cols ? s->cols & 7 : 0,
-   s->rows & 1 && row + h4 >= s->rows ? s->rows & 7 : 0,
-   b->uvtx, skip_inter);
+if (s->ss_h || s->ss_v)
+mask_edges(lflvl, 1, row7, col7, x_end, y_end,
+   s->cols & 1 && col + w4 >= s->cols ? s->cols & 7 : 0,
+   s->rows & 1 && row + h4 >= s->rows ? s->rows & 7 : 0,
+   b->uvtx, skip_inter);
 
 if (!s->filter.lim_lut[lvl]) {
 int sharp = s->filter.sharpness;
@@ -3444,6 +3445,7 @@ static void loopfilter_sb(AVCodecContext *ctx, struct 
VP9Filter *lflvl,
 AVFrame *f = s->frames[CUR_FRAME].tf.f;
 uint8_t *dst = f->data[0] + yoff;
 ptrdiff_t ls_y = f->linesize[0], ls_uv = f->linesize[1];
+uint8_t (*uv_masks)[8][4] = lflvl->mask[s->ss_h | s->ss_v];
 int p;
 
 // FIXME in how far can we interleave the v/h loopfilter calls? E.g.
@@ -3457,8 +3459,8 @@ static void loopfilter_sb(AVCodecContext *ctx, struct 
VP9Filter *lflvl,
 
 for (p = 0; p < 2; p++) {
 dst = f->data[1 + p] + uvoff;
-filter_plane_cols(s, col, 1, lflvl->level, lflvl->mask[1][0], dst, 
ls_uv);
-filter_plane_rows(s, row, 1, lflvl->level, lflvl->mask[1][1], dst, 
ls_uv);
+filter_plane_cols(s, col, s->ss_h, lflvl->level, uv_masks[0], dst, 
ls_uv);
+filter_plane_rows(s, row, s->ss_v, lflvl->level, uv_masks[1], dst, 
ls_uv);
 }
 }
 
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 12/16] vp9: more specifically specify mask destination to mask_edges().

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 52 ++--
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index aeaf5ca..edd963f 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -2853,7 +2853,7 @@ static void inter_recon(AVCodecContext *ctx)
 }
 }
 
-static av_always_inline void mask_edges(struct VP9Filter *lflvl, int is_uv,
+static av_always_inline void mask_edges(uint8_t (*mask)[8][4], int is_uv,
 int row_and_7, int col_and_7,
 int w, int h, int col_end, int row_end,
 enum TxfmMode tx, int skip_inter)
@@ -2894,8 +2894,8 @@ static av_always_inline void mask_edges(struct VP9Filter 
*lflvl, int is_uv,
 for (y = row_and_7; y < h + row_and_7; y++) {
 int col_mask_id = 2 - !(y & 7);
 
-lflvl->mask[is_uv][0][y][1] |= m_row_8;
-lflvl->mask[is_uv][0][y][2] |= m_row_4;
+mask[0][y][1] |= m_row_8;
+mask[0][y][2] |= m_row_4;
 // for odd lines, if the odd col is not being filtered,
 // skip odd row also:
 // .---. <-- a
@@ -2907,9 +2907,9 @@ static av_always_inline void mask_edges(struct VP9Filter 
*lflvl, int is_uv,
 // if a/c are even row/col and b/d are odd, and d is skipped,
 // e.g. right edge of size-66x66.webm, then skip b also (bug)
 if ((col_end & 1) && (y & 1)) {
-lflvl->mask[is_uv][1][y][col_mask_id] |= m_col_odd;
+mask[1][y][col_mask_id] |= m_col_odd;
 } else {
-lflvl->mask[is_uv][1][y][col_mask_id] |= m_col;
+mask[1][y][col_mask_id] |= m_col;
 }
 }
 } else {
@@ -2918,11 +2918,11 @@ static av_always_inline void mask_edges(struct 
VP9Filter *lflvl, int is_uv,
 for (y = row_and_7; y < h + row_and_7; y++) {
 int col_mask_id = 2 - !(y & 3);
 
-lflvl->mask[is_uv][0][y][1] |= m_row_8; // row edge
-lflvl->mask[is_uv][0][y][2] |= m_row_4;
-lflvl->mask[is_uv][1][y][col_mask_id] |= m_col; // col edge
-lflvl->mask[is_uv][0][y][3] |= m_col;
-lflvl->mask[is_uv][1][y][3] |= m_col;
+mask[0][y][1] |= m_row_8; // row edge
+mask[0][y][2] |= m_row_4;
+mask[1][y][col_mask_id] |= m_col; // col edge
+mask[0][y][3] |= m_col;
+mask[1][y][3] |= m_col;
 }
 }
 } else {
@@ -2941,47 +2941,47 @@ static av_always_inline void mask_edges(struct 
VP9Filter *lflvl, int is_uv,
 int m_row_8 = m_row - m_row_16;
 
 for (y = row_and_7; y < h + row_and_7; y++) {
-lflvl->mask[is_uv][0][y][0] |= m_row_16;
-lflvl->mask[is_uv][0][y][1] |= m_row_8;
+mask[0][y][0] |= m_row_16;
+mask[0][y][1] |= m_row_8;
 }
 } else {
 for (y = row_and_7; y < h + row_and_7; y++)
-lflvl->mask[is_uv][0][y][mask_id] |= m_row;
+mask[0][y][mask_id] |= m_row;
 }
 
 if (is_uv && tx > TX_8X8 && (h ^ (h - 1)) == 1) {
 for (y = row_and_7; y < h + row_and_7 - 1; y += step1d)
-lflvl->mask[is_uv][1][y][0] |= m_col;
+mask[1][y][0] |= m_col;
 if (y - row_and_7 == h - 1)
-lflvl->mask[is_uv][1][y][1] |= m_col;
+mask[1][y][1] |= m_col;
 } else {
 for (y = row_and_7; y < h + row_and_7; y += step1d)
-lflvl->mask[is_uv][1][y][mask_id] |= m_col;
+mask[1][y][mask_id] |= m_col;
 }
 } else if (tx != TX_4X4) {
 int mask_id;
 
 mask_id = (tx == TX_8X8) || (is_uv && h == 1);
-lflvl->mask[is_uv][1][row_and_7][mask_id] |= m_col;
+mask[1][row_and_7][mask_id] |= m_col;
 mask_id = (tx == TX_8X8) || (is_uv && w == 1);
 for (y = row_and_7; y < h + row_and_7; y++)
-lflvl->mask[is_uv][0][y][mask_id] |= t;
+mask[0][y][mask_id] |= t;
 } else if (is_uv) {
 int t8 = t & 0x01, t4 = t - t8;
 
 for (y = row_and_7; y < h + row_and_7; y++) {
-lflvl->mask[is_uv][0][y][2] |= t4;
-lflvl->mask[is_uv][0][y][1] |= t8;
+mask[0][y][2] |= t4;
+mask[0][y][1] |= t8;
 }
-lflvl->mask[is_uv][1][row_and_7][2 - !(row_and_7 & 7)] |= m_col;
+mask[1][row_and_7][2 - !(row_and_7 & 7)] |= m_col;
 } else {
 int t8 = t & 0x11, t4 = t - t8;
 
   

[FFmpeg-devel] [PATCH 13/16] vp9: fix mask_edges and filter_plane_rows/cols() for 440.

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9.c | 159 +--
 1 file changed, 72 insertions(+), 87 deletions(-)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index edd963f..d5d8030 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -2853,11 +2853,14 @@ static void inter_recon(AVCodecContext *ctx)
 }
 }
 
-static av_always_inline void mask_edges(uint8_t (*mask)[8][4], int is_uv,
+static av_always_inline void mask_edges(uint8_t (*mask)[8][4], int ss_h, int 
ss_v,
 int row_and_7, int col_and_7,
 int w, int h, int col_end, int row_end,
 enum TxfmMode tx, int skip_inter)
 {
+static const unsigned wide_filter_col_mask[2] = { 0x11, 0x01 };
+static const unsigned wide_filter_row_mask[2] = { 0x03, 0x07 };
+
 // FIXME I'm pretty sure all loops can be replaced by a single LUT if
 // we make VP9Filter.mask uint64_t (i.e. row/col all single variable)
 // and make the LUT 5-indexed (bl, bp, is_uv, tx and row/col), and then
@@ -2868,14 +2871,14 @@ static av_always_inline void mask_edges(uint8_t 
(*mask)[8][4], int is_uv,
 // a time, and we only use the topleft block's mode information to set
 // things like block strength. Thus, for any block size smaller than
 // 16x16, ignore the odd portion of the block.
-if (tx == TX_4X4 && is_uv) {
-if (h == 1) {
+if (tx == TX_4X4 && (ss_v | ss_h)) {
+if (h == ss_v) {
 if (row_and_7 & 1)
 return;
 if (!row_end)
 h += 1;
 }
-if (w == 1) {
+if (w == ss_h) {
 if (col_and_7 & 1)
 return;
 if (!col_end)
@@ -2885,58 +2888,46 @@ static av_always_inline void mask_edges(uint8_t 
(*mask)[8][4], int is_uv,
 
 if (tx == TX_4X4 && !skip_inter) {
 int t = 1 << col_and_7, m_col = (t << w) - t, y;
-int m_col_odd = (t << (w - 1)) - t;
-
 // on 32-px edges, use the 8-px wide loopfilter; else, use 4-px wide
-if (is_uv) {
-int m_row_8 = m_col & 0x01, m_row_4 = m_col - m_row_8;
-
-for (y = row_and_7; y < h + row_and_7; y++) {
-int col_mask_id = 2 - !(y & 7);
-
-mask[0][y][1] |= m_row_8;
-mask[0][y][2] |= m_row_4;
-// for odd lines, if the odd col is not being filtered,
-// skip odd row also:
-// .---. <-- a
-// |   |
-// |___| <-- b
-// ^   ^
-// c   d
-//
-// if a/c are even row/col and b/d are odd, and d is skipped,
-// e.g. right edge of size-66x66.webm, then skip b also (bug)
-if ((col_end & 1) && (y & 1)) {
-mask[1][y][col_mask_id] |= m_col_odd;
-} else {
-mask[1][y][col_mask_id] |= m_col;
-}
+int m_row_8 = m_col & wide_filter_col_mask[ss_h], m_row_4 = m_col - 
m_row_8;
+
+for (y = row_and_7; y < h + row_and_7; y++) {
+int col_mask_id = 2 - !(y & wide_filter_row_mask[ss_v]);
+
+mask[0][y][1] |= m_row_8;
+mask[0][y][2] |= m_row_4;
+// for odd lines, if the odd col is not being filtered,
+// skip odd row also:
+// .---. <-- a
+// |   |
+// |___| <-- b
+// ^   ^
+// c   d
+//
+// if a/c are even row/col and b/d are odd, and d is skipped,
+// e.g. right edge of size-66x66.webm, then skip b also (bug)
+if ((ss_h & ss_v) && (col_end & 1) && (y & 1)) {
+mask[1][y][col_mask_id] |= (t << (w - 1)) - t;
+} else {
+mask[1][y][col_mask_id] |= m_col;
 }
-} else {
-int m_row_8 = m_col & 0x11, m_row_4 = m_col - m_row_8;
-
-for (y = row_and_7; y < h + row_and_7; y++) {
-int col_mask_id = 2 - !(y & 3);
-
-mask[0][y][1] |= m_row_8; // row edge
-mask[0][y][2] |= m_row_4;
-mask[1][y][col_mask_id] |= m_col; // col edge
+if (!ss_h)
 mask[0][y][3] |= m_col;
+if (!ss_v)
 mask[1][y][3] |= m_col;
-}
 }
 } else {
 int y, t = 1 << col_and_7, m_col = (t << w) - t;
 
 if (!skip_inter) {
 int mask_id = (tx == TX_8X8);
-int l2 = tx + is_uv - 1, step1d = 1 << l2;
 static const unsigned masks[4] = { 0xff, 0x55, 0x11, 0x01 };
+int l2 = tx + ss_h - 1, step1d;
 int m_row = m_col & masks[l2];
 
 // at odd UV col/row edges tx16/tx32 loopfilter edges, force
 // 8wd loopfilter to prevent going off the visible edge.
-if (is_uv && tx > TX_8X8 && (w 

[FFmpeg-devel] [PATCH 15/16] vp9: copy bug in libvpx for 4:2:2 chroma bs=8x4/4x4 prediction.

2015-04-30 Thread Ronald S. Bultje
---
 libavcodec/vp9_mc_template.c | 26 ++
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/libavcodec/vp9_mc_template.c b/libavcodec/vp9_mc_template.c
index 11b9500..d79c337 100644
--- a/libavcodec/vp9_mc_template.c
+++ b/libavcodec/vp9_mc_template.c
@@ -77,12 +77,19 @@ static void FN(inter_pred)(AVCodecContext *ctx)
   ref1->data[2], ref1->linesize[2], tref1,
   row << 3, col << (3 - s->ss_h),
   &b->mv[0][0], 8 >> s->ss_h, 4, w1, h1, 0);
+// BUG for 4:2:2 bs=8x4, libvpx uses the wrong block index
+// to get the motion vector for the bottom 4x4 block
+if (s->ss_h == 0) {
+uvmv = b->mv[2][0];
+} else {
+uvmv = ROUNDED_DIV_MVx2(b->mv[0][0], b->mv[2][0]);
+}
 mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][0],
   s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * ls_uv, 
ls_uv,
   ref1->data[1], ref1->linesize[1],
   ref1->data[2], ref1->linesize[2], tref1,
   (row << 3) + 4, col << (3 - s->ss_h),
-  &b->mv[2][0], 8 >> s->ss_h, 4, w1, h1, 0);
+  &uvmv, 8 >> s->ss_h, 4, w1, h1, 0);
 }
 
 if (b->comp) {
@@ -110,12 +117,19 @@ static void FN(inter_pred)(AVCodecContext *ctx)
   ref2->data[2], ref2->linesize[2], tref2,
   row << 3, col << (3 - s->ss_h),
   &b->mv[0][1], 8 >> s->ss_h, 4, w2, h2, 1);
+// BUG for 4:2:2 bs=8x4, libvpx uses the wrong block index
+// to get the motion vector for the bottom 4x4 block
+if (s->ss_h == 0) {
+uvmv = b->mv[2][1];
+} else {
+uvmv = ROUNDED_DIV_MVx2(b->mv[0][1], b->mv[2][1]);
+}
 mc_chroma_dir(s, mc[3 + s->ss_h][b->filter][1],
   s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * 
ls_uv, ls_uv,
   ref2->data[1], ref2->linesize[1],
   ref2->data[2], ref2->linesize[2], tref2,
   (row << 3) + 4, col << (3 - s->ss_h),
-  &b->mv[2][1], 8 >> s->ss_h, 4, w2, h2, 1);
+  &uvmv, 8 >> s->ss_h, 4, w2, h2, 1);
 }
 }
 } else if (b->bs == BS_4x8) {
@@ -239,7 +253,9 @@ static void FN(inter_pred)(AVCodecContext *ctx)
   ref1->data[2], ref1->linesize[2], tref1,
   row << 3, col << 2,
   &uvmv, 4, 4, w1, h1, 0);
-uvmv = ROUNDED_DIV_MVx2(b->mv[2][0], b->mv[3][0]);
+// BUG libvpx uses wrong block index for 4:2:2 bs=4x4
+// bottom block
+uvmv = ROUNDED_DIV_MVx2(b->mv[1][0], b->mv[2][0]);
 mc_chroma_dir(s, mc[4][b->filter][0],
   s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * 
ls_uv, ls_uv,
   ref1->data[1], ref1->linesize[1],
@@ -327,7 +343,9 @@ static void FN(inter_pred)(AVCodecContext *ctx)
   ref2->data[2], ref2->linesize[2], tref2,
   row << 3, col << 2,
   &uvmv, 4, 4, w2, h2, 1);
-uvmv = ROUNDED_DIV_MVx2(b->mv[2][1], b->mv[3][1]);
+// BUG libvpx uses wrong block index for 4:2:2 bs=4x4
+// bottom block
+uvmv = ROUNDED_DIV_MVx2(b->mv[1][1], b->mv[2][1]);
 mc_chroma_dir(s, mc[4][b->filter][1],
   s->dst[1] + 4 * ls_uv, s->dst[2] + 4 * 
ls_uv, ls_uv,
   ref2->data[1], ref2->linesize[1],
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 16/16] vp9: add fat test for 422.

2015-04-30 Thread Ronald S. Bultje
Sample available at:
http://downloads.webmproject.org/test_data/libvpx/vp91-2-04-yuv422.webm
---
 tests/fate/vpx.mak |  1 +
 tests/ref/fate/vp9p1-04-yuv422 | 15 +++
 2 files changed, 16 insertions(+)
 create mode 100644 tests/ref/fate/vp9p1-04-yuv422

diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
index 4c46371..01818ba 100644
--- a/tests/fate/vpx.mak
+++ b/tests/fate/vpx.mak
@@ -107,6 +107,7 @@ $(foreach W,$(VP9_SIZE_B),$(eval $(foreach 
H,$(VP9_SIZE_B),$(eval $(call FATE_VP
 $(eval $(call FATE_VP9_SUITE,03-deltaq))
 $(eval $(call FATE_VP9_PROFILE_SUITE,04-yuv444,1))
 $(eval $(call FATE_VP9_PROFILE_SUITE,04-yuv440,1))
+$(eval $(call FATE_VP9_PROFILE_SUITE,04-yuv422,1))
 $(eval $(call FATE_VP9_SUITE,06-bilinear))
 $(eval $(call FATE_VP9_SUITE,09-lf_deltas))
 $(eval $(call FATE_VP9_SUITE,10-show-existing-frame))
diff --git a/tests/ref/fate/vp9p1-04-yuv422 b/tests/ref/fate/vp9p1-04-yuv422
new file mode 100644
index 000..59abfb0
--- /dev/null
+++ b/tests/ref/fate/vp9p1-04-yuv422
@@ -0,0 +1,15 @@
+#format: frame checksums
+#version: 1
+#hash: MD5
+#tb 0: 1/50
+#stream#, dts,pts, duration, size, hash
+0,  0,  0,1,28800, b81b8a8444ac6ce4a4807c37e0a44c8b
+0,  1,  1,1,28800, 344458b82d35ea9944dc841643fc25c2
+0,  2,  2,1,28800, 376a4bb3944f052191963740b980eb26
+0,  3,  3,1,28800, 2fecb02c842bd7d588415904f2d3a82d
+0,  4,  4,1,28800, 0fda2f1dabba5c179599190f179b9782
+0,  5,  5,1,28800, a88ac885ee59e3a3a01fa483cdd40274
+0,  6,  6,1,28800, e76b488ffa70a05457fc046e7b999c56
+0,  7,  7,1,28800, 74ae5e52162f5bbc95258d44a2dd647c
+0,  8,  8,1,28800, 0c017e2b12e5192c8d598941d9c93306
+0,  9,  9,1,28800, ca3941ee43b7033cb48f8498af127d53
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 14/16] vp9: add yuv440 fate test.

2015-04-30 Thread Ronald S. Bultje
Sample available at:
http://downloads.webmproject.org/test_data/libvpx/vp91-2-04-yuv440.webm
---
 tests/fate/vpx.mak |  1 +
 tests/ref/fate/vp9p1-04-yuv440 | 15 +++
 2 files changed, 16 insertions(+)
 create mode 100644 tests/ref/fate/vp9p1-04-yuv440

diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
index ab6b15d..4c46371 100644
--- a/tests/fate/vpx.mak
+++ b/tests/fate/vpx.mak
@@ -106,6 +106,7 @@ $(foreach W,$(VP9_SIZE_A),$(eval $(foreach 
H,$(VP9_SIZE_A),$(eval $(call FATE_VP
 $(foreach W,$(VP9_SIZE_B),$(eval $(foreach H,$(VP9_SIZE_B),$(eval $(call 
FATE_VP9_SUITE,03-size-$(W)x$(H))
 $(eval $(call FATE_VP9_SUITE,03-deltaq))
 $(eval $(call FATE_VP9_PROFILE_SUITE,04-yuv444,1))
+$(eval $(call FATE_VP9_PROFILE_SUITE,04-yuv440,1))
 $(eval $(call FATE_VP9_SUITE,06-bilinear))
 $(eval $(call FATE_VP9_SUITE,09-lf_deltas))
 $(eval $(call FATE_VP9_SUITE,10-show-existing-frame))
diff --git a/tests/ref/fate/vp9p1-04-yuv440 b/tests/ref/fate/vp9p1-04-yuv440
new file mode 100644
index 000..0c28f36
--- /dev/null
+++ b/tests/ref/fate/vp9p1-04-yuv440
@@ -0,0 +1,15 @@
+#format: frame checksums
+#version: 1
+#hash: MD5
+#tb 0: 1/50
+#stream#, dts,pts, duration, size, hash
+0,  0,  0,1,28800, 61157ad4fb02a254de8f34ae7b8915dc
+0,  1,  1,1,28800, 9431337382bf90d40aa417e297ac05da
+0,  2,  2,1,28800, 56b739049cc9e97a1d82018bba3db0ee
+0,  3,  3,1,28800, 75138a9b6bb905b2f79a1ebb959ddfea
+0,  4,  4,1,28800, 141b2fc9625fad86577838d84a276ef8
+0,  5,  5,1,28800, b364668c44a237d4e532e086a55401a9
+0,  6,  6,1,28800, a4ca6014d5194e4c921a4cb4289eb315
+0,  7,  7,1,28800, cfcacb3d5086d3861f4712a3c87a6b6c
+0,  8,  8,1,28800, 228d3fd3d849d021f3690cc538edb0a3
+0,  9,  9,1,28800, 97ecf281eb1130723d70e3c8803fa814
-- 
2.1.2

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


[FFmpeg-devel] Anybody already working on VDPAU / HEVC support?

2015-04-30 Thread Christian König

Hi list,

since VDPAU has now officially picked up HEVC support I wonder if 
anybody is already working on integrating it into ffmpeg?


Best regards,
Christian.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/4] FFV1 specification: Slice Header specific semantics moved

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 04:31:21PM +0200, Jerome Martinez wrote:
> Le 30/04/2015 16:20, Michael Niedermayer a écrit :
> >is it inteded not to move plane_count ?
> 
> plane_count is actually not part of the bitstream syntax (it is
> computed from chroma_planes and transparency).
> Additionally, the definition (" LyX Document count of planes") is
> misleading (plane_count is 2 in the case of 3 planes, because the
> chroma_planes are counted as 1).
> So I plan to remove it and add a more clear definition of the count
> of quant_table_indexes in a future patch.

ok applied

btw theres a "picure structure", in the moved text

Thank

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I do not agree with what you have to say, but I'll defend to the death your
right to say it. -- Voltaire


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


Re: [FFmpeg-devel] ffserver jpg output

2015-04-30 Thread ill

So can this be applied to ffserver and put in the git?


Ave all

Background:
I'm using ffserver, which feeds of a webcam, to serve .swf and .jpg 
files.


To serve the .jpg files, I use the patch mentioned in 
http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2006-June/013107.html

Over the years I "ported" the patch to more current versions of ffmpeg.

Attached is a patch for 2.6.x, older versions are available at 
http://sarijopen.student.utwente.nl/caligula/ffmpeg/


Greetings Martijn
(Who hopes that ffserver is kept alive)





diff -Nrup ffmpeg-2.6.1--orig/ffserver.c ffmpeg-2.6.1/ffserver.c
--- ffmpeg-2.6.1--orig/ffserver.c2015-03-16 20:25:48.0 +0100
+++ ffmpeg-2.6.1/ffserver.c2015-04-05 02:33:53.0 +0200
@@ -967,6 +967,10 @@ static int handle_connection(HTTPContext
 /* close connection if trailer sent */
 if (c->state == HTTPSTATE_SEND_DATA_TRAILER)
 return -1;
+/* Check if it is a single jpeg frame 123 */
+if (c->stream->single_frame && c->data_count > 
c->cur_frame_bytes && c->cur_frame_bytes > 0) {

+close_connection(c);
+}
 break;
 case HTTPSTATE_RECEIVE_DATA:
 /* no need to read if no events */
diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.c 
ffmpeg-2.6.1/ffserver_config.c
--- ffmpeg-2.6.1--orig/ffserver_config.c2015-03-16 
20:25:48.0 +0100

+++ ffmpeg-2.6.1/ffserver_config.c2015-04-05 02:33:53.0 +0200
@@ -862,8 +862,10 @@ static int ffserver_parse_config_stream(
 } else {
 stream->stream_type = STREAM_TYPE_LIVE;
 /* JPEG cannot be used here, so use single frame MJPEG */
-if (!strcmp(arg, "jpeg"))
-strcpy(arg, "mjpeg");
+if (!strcmp(arg, "jpeg")) {
+strcpy(arg, "singlejpeg");
+stream->single_frame=1; +}
 stream->fmt = ffserver_guess_format(arg, NULL, NULL);
 if (!stream->fmt)
 ERROR("Unknown Format: '%s'\n", arg);
diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.h 
ffmpeg-2.6.1/ffserver_config.h
--- ffmpeg-2.6.1--orig/ffserver_config.h2015-03-16 
20:25:48.0 +0100

+++ ffmpeg-2.6.1/ffserver_config.h2015-04-05 02:33:53.0 +0200
@@ -79,6 +79,7 @@ typedef struct FFServerStream {
 int multicast_port;   /* first port used for multicast */
 int multicast_ttl;
 int loop; /* if true, send the stream in 
loops (only meaningful if file) */

+char single_frame;/* only single frame */

 /* feed specific */
 int feed_opened;  /* true if someone is writing to 
the feed */
diff -Nrup ffmpeg-2.6.1--orig/libavformat/allformats.c 
ffmpeg-2.6.1/libavformat/allformats.c
--- ffmpeg-2.6.1--orig/libavformat/allformats.c2015-03-16 
20:25:52.0 +0100
+++ ffmpeg-2.6.1/libavformat/allformats.c2015-04-05 
02:33:53.0 +0200

@@ -273,6 +273,7 @@ void av_register_all(void)
 REGISTER_MUXER   (SEGMENT,  stream_segment);
 REGISTER_DEMUXER (SHORTEN,  shorten);
 REGISTER_DEMUXER (SIFF, siff);
+REGISTER_MUXER   (SINGLEJPEG,   singlejpeg);
 REGISTER_DEMUXER (SLN,  sln);
 REGISTER_DEMUXER (SMACKER,  smacker);
 REGISTER_MUXDEMUX(SMJPEG,   smjpeg);
diff -Nrup ffmpeg-2.6.1--orig/libavformat/rawenc.c 
ffmpeg-2.6.1/libavformat/rawenc.c
--- ffmpeg-2.6.1--orig/libavformat/rawenc.c2015-03-16 
20:25:54.0 +0100
+++ ffmpeg-2.6.1/libavformat/rawenc.c2015-04-05 02:33:53.0 
+0200

@@ -250,6 +250,17 @@ AVOutputFormat ff_mjpeg_muxer = {
 .write_packet  = ff_raw_write_packet,
 .flags = AVFMT_NOTIMESTAMPS,
 };
+
+AVOutputFormat ff_singlejpeg_muxer = {
+.name  = "singlejpeg",
+.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"),
+.mime_type = "image/jpeg",
+.extensions= "jpg,jpeg",
+.audio_codec   = AV_CODEC_ID_NONE,
+.video_codec   = AV_CODEC_ID_MJPEG,
+.write_packet  = ff_raw_write_packet,
+.flags = AVFMT_NOTIMESTAMPS,
+};
 #endif

 #if CONFIG_MLP_MUXER



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


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


Re: [FFmpeg-devel] Anybody already working on VDPAU / HEVC support?

2015-04-30 Thread Philip Langdale

On 2015-04-30 09:10, Christian König wrote:

Hi list,

since VDPAU has now officially picked up HEVC support I wonder if
anybody is already working on integrating it into ffmpeg?


I was hoping that Stephen Warren from nvidia would pop up again with
the relevant patches, having done the original work for the other 
formats.

For all I know, they might still be working on it.

I'm not aware of anyone else; given the hardware requirements, I 
wouldn't
be surprised if there's no one who's both qualified to do the work and 
has

the hardware to test it.

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


Re: [FFmpeg-devel] [PATCH] lavf/webm_chunk: Use dyn_buf to write chunks

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 09:55:59AM -0700, Vignesh Venkatasubramanian wrote:
> Use dyn_duf to write chunks so that we create the actual chunk
> file only after the entire chunk data is available. This will help
> not confuse other software looking at the chunk file (e.g. a web
> server) by seeing a zero length file when ffmpeg is writing into
> it.
> 
> Signed-off-by: Vignesh Venkatasubramanian 
> ---
>  libavformat/webm_chunk.c | 46 --
>  1 file changed, 28 insertions(+), 18 deletions(-)
> 
> diff --git a/libavformat/webm_chunk.c b/libavformat/webm_chunk.c
> index 6d3d5d6..892fd7f 100644
> --- a/libavformat/webm_chunk.c
> +++ b/libavformat/webm_chunk.c
> @@ -46,7 +46,6 @@ typedef struct WebMChunkContext {
>  int chunk_start_index;
>  char *header_filename;
>  int chunk_duration;
> -int chunk_count;
>  int chunk_index;
>  uint64_t duration_written;
>  int prev_pts;
> @@ -86,18 +85,21 @@ static int chunk_mux_init(AVFormatContext *s)
>  return 0;
>  }
>  
> -static int set_chunk_filename(AVFormatContext *s, int is_header)
> +static int get_chunk_filename(AVFormatContext *s, int is_header, char 
> *filename)
>  {
>  WebMChunkContext *wc = s->priv_data;
>  AVFormatContext *oc = wc->avf;
> +if (!filename) {
> +return AVERROR(EINVAL);
> +}
>  if (is_header) {
>  if (!wc->header_filename) {
>  return AVERROR(EINVAL);
>  }
> -av_strlcpy(oc->filename, wc->header_filename, 
> strlen(wc->header_filename) + 1);
> +av_strlcpy(filename, wc->header_filename, 
> strlen(wc->header_filename) + 1);
>  } else {
> -if (av_get_frame_filename(oc->filename, sizeof(oc->filename),
> -  s->filename, wc->chunk_index) < 0) {

> +if (av_get_frame_filename(filename, 1024,
   
please use a named identifer instead of the litteral number
[...]
> +char filename[1024];

[...]
-- 
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: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec[/format]/webpenc: use WebPAnimEncoder API to generate animated WebP

2015-04-30 Thread Michael Niedermayer
On Wed, Apr 29, 2015 at 11:53:40PM +, Urvang Joshi wrote:
> On Mon, Apr 27, 2015 at 5:03 PM Michael Niedermayer 
> wrote:
> 
> > On Mon, Apr 27, 2015 at 10:18:52PM +, Urvang Joshi wrote:
> > > On Thu, Apr 23, 2015 at 2:51 PM Michael Niedermayer 
> > > wrote:
> > >
> > > > On Thu, Apr 16, 2015 at 10:40:14PM +, Urvang Joshi wrote:
> > > > > On Thu, Apr 16, 2015 at 3:09 PM James Almer 
> > wrote:
> > > > >
> > > > > > On 16/04/15 4:18 PM, Urvang Joshi wrote:
> > > > > > > Hi,
> > > > > > > Here's the patch without whitespace changes.
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Urvang
> > > > > >
> > > > > > This patch doesn't apply cleanly. Looks like something weird with
> > the
> > > > > > indentation still.
> > > > > > Was this patch handmade? It says the hash for libwebpenc.c is
> > 95d56ac
> > > > > > (same as git head),
> > > > > > but the contents of the patch don't match.
> > > > > >
> > > > >
> > > > > Sorry, I should have mentioned that it was created with
> > > > > "--ignore-all-space" option, so using the same option when applying
> > the
> > > > > patch would have worked.
> > > > >
> > > > > But to avoid any confusion, here's the re-created patch, that should
> > > > apply
> > > > > cleanly with just 'git am'.
> > > > >
> > > > >
> > > > > >
> > > > > > After fixing the conflicts and compiling the patch seems to work,
> > but
> > > > the
> > > > > > resulting
> > > > > > animated webp files are smaller than those using the native muxer
> > using
> > > > > > the default
> > > > > > encoding and muxing settings.
> > > > > > Is this because the muxing done by libwebpmux is different, or are
> > the
> > > > > > quality defaults
> > > > > > changed in any way when using this codepath? If the former then
> > that's
> > > > > > pretty good, but
> > > > > > if the latter then it should probably be fixed.
> > > > > >
> > > > >
> > > > > Short answer: muxing done by libwebpmux is different, so it's
> > expected
> > > > that
> > > > > it generates smaller WebP files.
> > > > >
> > > > > Detailed answer:
> > > > > The native muxer is naive, and it always uses X offset and Y offset
> > of 0
> > > > > for all frames. This means the full width x height of all frames are
> > > > > encoded.
> > > >
> > > > > libwebpmux muxer is smart on the other hand: for example, it only
> > encodes
> > > > > the part of the frame which has changed from previous frame.
> > > > > This and other optimizations result in smaller WebP files.
> > > >
> > > > can you show some PSNR vs filesize information ?
> > > >
> > >
> > > As explained below, we aren't changing the underlying encoder -- only the
> > > muxer is being changed.
> > >
> > >
> > > >
> > > >
> > > > >
> > > > > Thanks,
> > > > > Urvang
> > > > >
> > > > >
> > > > > > ___
> > > > > > ffmpeg-devel mailing list
> > > > > > ffmpeg-devel@ffmpeg.org
> > > > > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > > > > >
> > > >
> > > > >  configure   |5 ++
> > > > >  libavcodec/libwebpenc.c |   93
> > > > +++-
> > > > >  libavformat/webpenc.c   |   44 ++
> > > >
> > > > why are there changes to libavformat in a patch changing an encoder?
> > > >
> > >
> > > Note that WebPAnimEncoder API used now internally uses WebP encoder and
> > > WebP muxer.
> > > Earlier, ffmpeg was using WebP encoder with its native muxer.
> > >
> > > So, we are only changing the muxer here, the underlying encoder is still
> > > the WebPEncoder as earlier.
> >
> > Ok, so the patch adds many #ifs to both the muxer and
> > encoder, and there are more changes in the encoder than the muxer
> > the commit message which is 1 single line only speaks about the encoder
> > and the patch is only about the muxer.
> > Did i understand it correctly this time ?
> >
> > assuming iam not entirely wrong here.
> > First question is what does the patch actually try to achive ?
> > replace a native muxer by a new external dependancy ?
> > if so, why would we want that ?
> >
> 
> In theory, here are some of the optimizations that AnimEncoder API (if
> available) does to be more efficient than native muxer:
> - Pick the best dispose/blend method combination for each frame.
> - Based on the dispose/blend method, encode only a sub-rectangle of the
> frame that has changed from the previous (disposed) frame.
> - If some pixels in current frame match the corresponding pixels in the
> previous frame, possibly turn them into transparent pixels (so that they
> see through the previous frame's pixel), if that improves compression.
> - Optionally, it can also insert keyframes at regular intervals (not used
> in this patch; but I plan to add a command-line option to allow this in
> future).

lets try to agree on terminology first:
Code which compresses that rectangular area of pixels called
a picture or frame into a compressed bitstream is called an encoder
deciding how to encode a frame, frame 

Re: [FFmpeg-devel] [PATCH 11/16] vp9: add fate test for profile 1 444.

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 05:48:29PM +0200, Ronald S. Bultje wrote:
> Sample available at:
> http://downloads.webmproject.org/test_data/libvpx/vp91-2-04-yuv444.webm

file uplodaded

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

Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User
questions about the command line tools should be sent to the ffmpeg-user ML.
And questions about how to use libav* should be sent to the libav-user ML.


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


Re: [FFmpeg-devel] [PATCH 14/16] vp9: add yuv440 fate test.

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 05:48:32PM +0200, Ronald S. Bultje wrote:
> Sample available at:
> http://downloads.webmproject.org/test_data/libvpx/vp91-2-04-yuv440.webm

file uploaded

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

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"


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


Re: [FFmpeg-devel] [PATCH 16/16] vp9: add fat test for 422.

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 05:48:34PM +0200, Ronald S. Bultje wrote:
> Sample available at:
> http://downloads.webmproject.org/test_data/libvpx/vp91-2-04-yuv422.webm

file uploaded

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

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato


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


Re: [FFmpeg-devel] Anybody already working on VDPAU / HEVC support?

2015-04-30 Thread Christian König

On 30.04.2015 19:09, Philip Langdale wrote:

On 2015-04-30 09:10, Christian König wrote:

Hi list,

since VDPAU has now officially picked up HEVC support I wonder if
anybody is already working on integrating it into ffmpeg?


I was hoping that Stephen Warren from nvidia would pop up again with
the relevant patches, having done the original work for the other 
formats.

For all I know, they might still be working on it.


I already talked to José Hiram Soltren from NVidia and it unfortunately 
doesn't look like they will do it this time.




I'm not aware of anyone else; given the hardware requirements, I wouldn't
be surprised if there's no one who's both qualified to do the work and 
has

the hardware to test it.


Thanks for the info,
Christian.



--phil


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


Re: [FFmpeg-devel] [PATCH] lavf/webm_chunk: Use dyn_buf to write chunks

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 11:34:44AM -0700, Vignesh Venkatasubramanian wrote:
> Use dyn_duf to write chunks so that we create the actual chunk
> file only after the entire chunk data is available. This will help
> not confuse other software looking at the chunk file (e.g. a web
> server) by seeing a zero length file when ffmpeg is writing into
> it.
> 
> Signed-off-by: Vignesh Venkatasubramanian 

applied

thanks

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

Into a blind darkness they enter who follow after the Ignorance,
they as if into a greater darkness enter who devote themselves
to the Knowledge alone. -- Isha Upanishad


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


Re: [FFmpeg-devel] [PATCH 3/4] FFV1 specification: Slice Header inferred values if not present

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:12:16PM +0200, Jerome Martinez wrote:
> 

>  ffv1.lyx |   36 
>  1 file changed, 36 insertions(+)
> 3d59c5f8062966c9564bb778245a8a874775c39c  
> 0003-Slice-Header-inferred-values-if-not-present.patch
> From 5c6efe277fd8efa590dd9ffe7950c4aebad44c97 Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
> Date: Thu, 30 Apr 2015 13:41:30 +0200
> Subject: [PATCH 3/4] Slice Header inferred values if not present.
> 
> In the case of version 1 or 2, Slice Header does not exist and the 
> specification should explicit the inferred values.

applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

No snowflake in an avalanche ever feels responsible. -- Voltaire


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


[FFmpeg-devel] [PATCH] vp9: fix show-existing-frames for multi-threading.

2015-04-30 Thread Ronald S. Bultje
This also fixes intra-only MT failures (it was the same bug), see trac
4526 and 4527.
---
 libavcodec/vp9.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
index d5d8030..71ed4e6 100644
--- a/libavcodec/vp9.c
+++ b/libavcodec/vp9.c
@@ -3752,6 +3752,13 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
*frame,
 return res;
 ((AVFrame *)frame)->pkt_pts = pkt->pts;
 ((AVFrame *)frame)->pkt_dts = pkt->dts;
+for (i = 0; i < 8; i++) {
+if (s->next_refs[i].f->data[0])
+ff_thread_release_buffer(ctx, &s->next_refs[i]);
+if (s->refs[i].f->data[0] &&
+(res = ff_thread_ref_frame(&s->next_refs[i], &s->refs[i])) < 0)
+return res;
+}
 *got_frame = 1;
 return pkt->size;
 }
-- 
2.1.2

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


Re: [FFmpeg-devel] [PATCH] vp9: fix show-existing-frames for multi-threading.

2015-04-30 Thread James Almer
On 30/04/15 5:03 PM, Ronald S. Bultje wrote:
> This also fixes intra-only MT failures (it was the same bug), see trac
> 4526 and 4527.
> ---
>  libavcodec/vp9.c | 7 +++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> index d5d8030..71ed4e6 100644
> --- a/libavcodec/vp9.c
> +++ b/libavcodec/vp9.c
> @@ -3752,6 +3752,13 @@ static int vp9_decode_frame(AVCodecContext *ctx, void 
> *frame,
>  return res;
>  ((AVFrame *)frame)->pkt_pts = pkt->pts;
>  ((AVFrame *)frame)->pkt_dts = pkt->dts;
> +for (i = 0; i < 8; i++) {
> +if (s->next_refs[i].f->data[0])
> +ff_thread_release_buffer(ctx, &s->next_refs[i]);
> +if (s->refs[i].f->data[0] &&
> +(res = ff_thread_ref_frame(&s->next_refs[i], &s->refs[i])) < 
> 0)
> +return res;
> +}
>  *got_frame = 1;
>  return pkt->size;
>  }
> 

LGTM. Tested and works.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] Fix segfault with x11grab when switching windows.

2015-04-30 Thread Matthew Smiglarski
The segfault occurred when running ffmpeg with x11grab and specifying a
resolution size greater than the screen, alongside an offset:

./ffmpeg  -f x11grab -r 30 -s 1920x1147 -i :0.0+0,53 output.mkv

Signed-off-by: Matt Smiglarski 
---
 libavdevice/xcbgrab.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavdevice/xcbgrab.c b/libavdevice/xcbgrab.c
index 777bd25..79324dd 100644
--- a/libavdevice/xcbgrab.c
+++ b/libavdevice/xcbgrab.c
@@ -309,6 +309,9 @@ static void xcbgrab_draw_mouse(AVFormatContext *s,
AVPacket *pkt,
 xcb_xfixes_get_cursor_image_reply_t *ci;
 int cx, cy, x, y, w, h, c_off, i_off;

+if (!image)
+return;
+
 cc = xcb_xfixes_get_cursor_image(gr->conn);
 ci = xcb_xfixes_get_cursor_image_reply(gr->conn, cc, NULL);
 if (!ci)
-- 
2.1.4
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 4/4] FFV1 specification: reset_contexts bitstream element defined

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:12:56PM +0200, Jerome Martinez wrote:
> 

>  ffv1.lyx |8 
>  1 file changed, 8 insertions(+)
> 7dca2387f8fa849d0b06c2adbfdc805a01c18cd5  
> 0004-reset_contexts-bitstream-element-defined.patch
> From 9e5f9c491b10fcf4d1dd51414d5459cde12fca5b Mon Sep 17 00:00:00 2001
> From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Martinez?= 
> Date: Thu, 30 Apr 2015 13:43:42 +0200
> Subject: [PATCH 4/4] reset_contexts bitstream element defined.
> 
> ---
>  ffv1.lyx | 8 
>  1 file changed, 8 insertions(+)

reworded the commit message and applied

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 3
"Rare item" - "Common item with rare defect or maybe just a lie"
"Professional" - "'Toy' made in china, not functional except as doorstop"
"Experts will know" - "The seller hopes you are not an expert"


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


Re: [FFmpeg-devel] [PATCH] avfilter: add findandcover filter

2015-04-30 Thread Lou Logan
On Thu, 30 Apr 2015 14:11:20 +0200, Michael Niedermayer wrote:

> Signed-off-by: Michael Niedermayer 
> ---
>  configure |1 +
>  doc/filters.texi  |   46 +
>  libavfilter/Makefile  |1 +
>  libavfilter/allfilters.c  |1 +
>  libavfilter/version.h |2 +-
>  libavfilter/vf_findandcover.c |  399 
> +
>  6 files changed, 449 insertions(+), 1 deletion(-)
>  create mode 100644 libavfilter/vf_findandcover.c
> 
[...]
> +@item xmin, ymin, xmax, ymax
> +Specifies the recatangle in which to search.

typo: recatangle/rectangle


[...]
> +{ "ymax", "", OFFSET(ymax), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, 
> FLAGS },
> +{ "mode", "set removial mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = 
> MODE_BLUR}, 0, NB_MODES - 1, FLAGS, "mode" },

typo: removial/removal

This concludes my amazingly useful review.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] vp9: fix show-existing-frames for multi-threading.

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 05:10:35PM -0300, James Almer wrote:
> On 30/04/15 5:03 PM, Ronald S. Bultje wrote:
> > This also fixes intra-only MT failures (it was the same bug), see trac
> > 4526 and 4527.
> > ---
> >  libavcodec/vp9.c | 7 +++
> >  1 file changed, 7 insertions(+)
> > 
> > diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
> > index d5d8030..71ed4e6 100644
> > --- a/libavcodec/vp9.c
> > +++ b/libavcodec/vp9.c
> > @@ -3752,6 +3752,13 @@ static int vp9_decode_frame(AVCodecContext *ctx, 
> > void *frame,
> >  return res;
> >  ((AVFrame *)frame)->pkt_pts = pkt->pts;
> >  ((AVFrame *)frame)->pkt_dts = pkt->dts;
> > +for (i = 0; i < 8; i++) {
> > +if (s->next_refs[i].f->data[0])
> > +ff_thread_release_buffer(ctx, &s->next_refs[i]);
> > +if (s->refs[i].f->data[0] &&
> > +(res = ff_thread_ref_frame(&s->next_refs[i], &s->refs[i])) 
> > < 0)
> > +return res;
> > +}
> >  *got_frame = 1;
> >  return pkt->size;
> >  }
> > 
> 
> LGTM. Tested and works.

applied

thanks

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

The real ebay dictionary, page 1
"Used only once"- "Some unspecified defect prevented a second use"
"In good condition" - "Can be repaird by experienced expert"
"As is" - "You wouldnt want it even if you were payed for it, if you knew ..."


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


Re: [FFmpeg-devel] [PATCH] lavf/webm_chunk: Fix a memory leak.

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 12:56:24PM -0700, Vignesh Venkatasubramanian wrote:
> Fix a duplicate memory allocation. priv_data should be allocated
> in line 64 call to avformat_alloc_output_context2 since we pass
> the correct AVFormat to it. This removes the duplicate allocation.
> 
> Signed-off-by: Vignesh Venkatasubramanian 
> ---
>  libavformat/webm_chunk.c | 5 -
>  1 file changed, 5 deletions(-)

applied

thanks

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

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates


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


Re: [FFmpeg-devel] [PATCH] Fix segfault with x11grab when switching windows.

2015-04-30 Thread Michael Niedermayer
Hi


On Thu, Apr 30, 2015 at 09:27:25PM +0100, Matthew Smiglarski wrote:
> The segfault occurred when running ffmpeg with x11grab and specifying a
> resolution size greater than the screen, alongside an offset:
> 
> ./ffmpeg  -f x11grab -r 30 -s 1920x1147 -i :0.0+0,53 output.mkv
> 
> Signed-off-by: Matt Smiglarski 
> ---
>  libavdevice/xcbgrab.c | 3 +++
>  1 file changed, 3 insertions(+)

is this still needed after dc83733f2bf2f26433bbf23d42fe92a2c7691df1 and 
f5c5aa968c3c96ff3968bd5b060e5a0f2f278732
?

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

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.


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


[FFmpeg-devel] [PATCH]Support linebreaks in onCaption subtitles

2015-04-30 Thread Carl Eugen Hoyos
Hi!

Attached patch improves the samples from ticket #2933.

Please comment, Carl Eugen
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 2552962..9bd69c5 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -500,6 +500,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MICRODVD,  microdvd);
 REGISTER_ENCDEC (MOVTEXT,   movtext);
 REGISTER_DECODER(MPL2,  mpl2);
+REGISTER_DECODER(ONCAPTION, oncaption);
 REGISTER_DECODER(PGSSUB,pgssub);
 REGISTER_DECODER(PJS,   pjs);
 REGISTER_DECODER(REALTEXT,  realtext);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 8c7c420..be91dcb 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -525,6 +525,7 @@ enum AVCodecID {
 AV_CODEC_ID_VPLAYER= MKBETAG('V','P','l','r'),
 AV_CODEC_ID_PJS= MKBETAG('P','h','J','S'),
 AV_CODEC_ID_ASS= MKBETAG('A','S','S',' '),  ///< ASS as defined in 
Matroska
+AV_CODEC_ID_ONCAPTION  = MKBETAG('o','n','C','a'),
 
 /* other specific kind of codecs (generally used for attachments) */
 AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,   ///< A dummy ID pointing at 
the start of various fake codecs.
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index c1694f3..c286a01 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -2705,6 +2705,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
 .long_name = NULL_IF_CONFIG_SMALL("WebVTT subtitle"),
 .props = AV_CODEC_PROP_TEXT_SUB,
 },
+{
+.id= AV_CODEC_ID_ONCAPTION,
+.type  = AVMEDIA_TYPE_SUBTITLE,
+.name  = "oncaption",
+.long_name = NULL_IF_CONFIG_SMALL("OnCaption FLV subtitle"),
+.props = AV_CODEC_PROP_TEXT_SUB,
+},
 
 /* other kind of codecs and pseudo-codecs */
 {
diff --git a/libavcodec/textdec.c b/libavcodec/textdec.c
index c9f02a2..6b46938 100644
--- a/libavcodec/textdec.c
+++ b/libavcodec/textdec.c
@@ -88,6 +88,29 @@ AVCodec ff_text_decoder = {
 };
 #endif
 
+#if CONFIG_ONCAPTION_DECODER
+#define oncaption_options options
+DECLARE_CLASS(oncaption);
+
+static int oncaption_linebreak_init(AVCodecContext *avctx)
+{
+TextContext *text = avctx->priv_data;
+text->linebreaks = "";
+return ff_ass_subtitle_header_default(avctx);
+}
+
+AVCodec ff_oncaption_decoder = {
+.name   = "oncaption",
+.long_name  = NULL_IF_CONFIG_SMALL("OnCaption FLV subtitle"),
+.priv_data_size = sizeof(TextContext),
+.type   = AVMEDIA_TYPE_SUBTITLE,
+.id = AV_CODEC_ID_ONCAPTION,
+.decode = text_decode_frame,
+.init   = oncaption_linebreak_init,
+.priv_class = &oncaption_decoder_class,
+};
+#endif
+
 #if CONFIG_VPLAYER_DECODER || CONFIG_PJS_DECODER || CONFIG_SUBVIEWER1_DECODER 
|| CONFIG_STL_DECODER
 
 static int linebreak_init(AVCodecContext *avctx)
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 07f7b68..bce94ea 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -965,7 +965,7 @@ retry_duration:
 } else if (stream_type == FLV_STREAM_TYPE_VIDEO) {
 size -= flv_set_video_codec(s, st, flags & FLV_VIDEO_CODECID_MASK, 1);
 } else if (stream_type == FLV_STREAM_TYPE_DATA) {
-st->codec->codec_id = AV_CODEC_ID_TEXT;
+st->codec->codec_id = AV_CODEC_ID_ONCAPTION;
 }
 
 if (st->codec->codec_id == AV_CODEC_ID_AAC ||
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] avformat/mpegts: Factorize version checking code out

2015-04-30 Thread Michael Niedermayer
On Wed, Apr 29, 2015 at 10:24:09PM +0200, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mpegts.c |   22 ++
>  1 file changed, 14 insertions(+), 8 deletions(-)

applied

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

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact


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


Re: [FFmpeg-devel] [PATCH] avcodec/mips: MSA (MIPS-SIMD-Arch) optimizations for H264 lpf and weight/biweight functions

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:08:31PM +, Nedeljko Babic wrote:
> LGTM

applied

thanks

[...]
-- 
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.


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


Re: [FFmpeg-devel] [PATCH] Adobe HTTP Dynamic Streaming (HDS) demuxer improvements

2015-04-30 Thread Michael Niedermayer
On Thu, Apr 30, 2015 at 02:37:39PM +0200, Gorilla Maguila wrote:
> New patch with some fixes:
> 
> - Corrected style and formatting.
> - No ugly casts.
> - New hds_probe function
> - No forward declarations in f4fbox.c. I couldn't get rid of the forward
> declaration in amfmetadata.c due to circular dependencies (Ideas welcome)
> - Other minor fixes.
> 
> 
> TODO:
> 
> - Fragment caching.
> - Parsing child manifests
> 
> 2015-04-28 15:00 GMT+02:00 Carl Eugen Hoyos :
> 
> > Gorilla Maguila  gmail.com> writes:
> >
> > > +static int hds_probe(AVProbeData *p)
> > > +{
> > > +if(p->filename && av_stristr(p->filename, ".f4m"))
> > > +return AVPROBE_SCORE_MAX;
> > > +return 0;
> > > +}
> >
> > Remove this function, instead add ".f4m" as
> > .extentions to the AVInputFormat.
> >
> > Carl Eugen
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >

>  Changelog |1 
>  configure |5 
>  libavformat/Makefile  |1 
>  libavformat/allformats.c  |2 
>  libavformat/amfmetadata.c |  228 
>  libavformat/amfmetadata.h |   39 ++
>  libavformat/f4fbox.c  |  399 ++
>  libavformat/f4fbox.h  |   95 +
>  libavformat/f4mmanifest.c |  338 +++
>  libavformat/f4mmanifest.h |   59 +++
>  libavformat/flvtag.c  |  378 +
>  libavformat/flvtag.h  |   32 +
>  libavformat/hdsdec.c  |  815 
> ++
>  13 files changed, 2391 insertions(+), 1 deletion(-)
> 0fe8fe063357dd3288c6c496ecdb3a71b60c259e  0001-hds-demuxer.patch
> From 60067f45dea17c372e28201f8529250373bf002e Mon Sep 17 00:00:00 2001
> From: Developer Mobdro 
> Date: Thu, 30 Apr 2015 14:31:30 +0200
> Subject: [PATCH] hds demuxer

this breaks build without libxml2:

ERROR: libxml-2.0 not found using pkg-config

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
ffmpeg-u...@ffmpeg.org mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "config.log" produced by configure as this will help
solve the problem.

also please see tools/patcheck

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.


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


Re: [FFmpeg-devel] ffserver jpg output

2015-04-30 Thread ill
Who is in charge of committing the patches? This patch fixes bugs, so I 
don't see why it should be ignored.



Ave all

Background:
I'm using ffserver, which feeds of a webcam, to serve .swf and .jpg 
files.


To serve the .jpg files, I use the patch mentioned in 
http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2006-June/013107.html

Over the years I "ported" the patch to more current versions of ffmpeg.

Attached is a patch for 2.6.x, older versions are available at 
http://sarijopen.student.utwente.nl/caligula/ffmpeg/


Greetings Martijn
(Who hopes that ffserver is kept alive)





diff -Nrup ffmpeg-2.6.1--orig/ffserver.c ffmpeg-2.6.1/ffserver.c
--- ffmpeg-2.6.1--orig/ffserver.c2015-03-16 20:25:48.0 +0100
+++ ffmpeg-2.6.1/ffserver.c2015-04-05 02:33:53.0 +0200
@@ -967,6 +967,10 @@ static int handle_connection(HTTPContext
 /* close connection if trailer sent */
 if (c->state == HTTPSTATE_SEND_DATA_TRAILER)
 return -1;
+/* Check if it is a single jpeg frame 123 */
+if (c->stream->single_frame && c->data_count > 
c->cur_frame_bytes && c->cur_frame_bytes > 0) {

+close_connection(c);
+}
 break;
 case HTTPSTATE_RECEIVE_DATA:
 /* no need to read if no events */
diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.c 
ffmpeg-2.6.1/ffserver_config.c
--- ffmpeg-2.6.1--orig/ffserver_config.c2015-03-16 
20:25:48.0 +0100

+++ ffmpeg-2.6.1/ffserver_config.c2015-04-05 02:33:53.0 +0200
@@ -862,8 +862,10 @@ static int ffserver_parse_config_stream(
 } else {
 stream->stream_type = STREAM_TYPE_LIVE;
 /* JPEG cannot be used here, so use single frame MJPEG */
-if (!strcmp(arg, "jpeg"))
-strcpy(arg, "mjpeg");
+if (!strcmp(arg, "jpeg")) {
+strcpy(arg, "singlejpeg");
+stream->single_frame=1; +}
 stream->fmt = ffserver_guess_format(arg, NULL, NULL);
 if (!stream->fmt)
 ERROR("Unknown Format: '%s'\n", arg);
diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.h 
ffmpeg-2.6.1/ffserver_config.h
--- ffmpeg-2.6.1--orig/ffserver_config.h2015-03-16 
20:25:48.0 +0100

+++ ffmpeg-2.6.1/ffserver_config.h2015-04-05 02:33:53.0 +0200
@@ -79,6 +79,7 @@ typedef struct FFServerStream {
 int multicast_port;   /* first port used for multicast */
 int multicast_ttl;
 int loop; /* if true, send the stream in 
loops (only meaningful if file) */

+char single_frame;/* only single frame */

 /* feed specific */
 int feed_opened;  /* true if someone is writing to 
the feed */
diff -Nrup ffmpeg-2.6.1--orig/libavformat/allformats.c 
ffmpeg-2.6.1/libavformat/allformats.c
--- ffmpeg-2.6.1--orig/libavformat/allformats.c2015-03-16 
20:25:52.0 +0100
+++ ffmpeg-2.6.1/libavformat/allformats.c2015-04-05 
02:33:53.0 +0200

@@ -273,6 +273,7 @@ void av_register_all(void)
 REGISTER_MUXER   (SEGMENT,  stream_segment);
 REGISTER_DEMUXER (SHORTEN,  shorten);
 REGISTER_DEMUXER (SIFF, siff);
+REGISTER_MUXER   (SINGLEJPEG,   singlejpeg);
 REGISTER_DEMUXER (SLN,  sln);
 REGISTER_DEMUXER (SMACKER,  smacker);
 REGISTER_MUXDEMUX(SMJPEG,   smjpeg);
diff -Nrup ffmpeg-2.6.1--orig/libavformat/rawenc.c 
ffmpeg-2.6.1/libavformat/rawenc.c
--- ffmpeg-2.6.1--orig/libavformat/rawenc.c2015-03-16 
20:25:54.0 +0100
+++ ffmpeg-2.6.1/libavformat/rawenc.c2015-04-05 02:33:53.0 
+0200

@@ -250,6 +250,17 @@ AVOutputFormat ff_mjpeg_muxer = {
 .write_packet  = ff_raw_write_packet,
 .flags = AVFMT_NOTIMESTAMPS,
 };
+
+AVOutputFormat ff_singlejpeg_muxer = {
+.name  = "singlejpeg",
+.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"),
+.mime_type = "image/jpeg",
+.extensions= "jpg,jpeg",
+.audio_codec   = AV_CODEC_ID_NONE,
+.video_codec   = AV_CODEC_ID_MJPEG,
+.write_packet  = ff_raw_write_packet,
+.flags = AVFMT_NOTIMESTAMPS,
+};
 #endif

 #if CONFIG_MLP_MUXER



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


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