Re: [FFmpeg-devel] [PATCH] blockdsp: remove high bit depth parameter

2015-10-02 Thread Christophe Gisquet
2015-09-28 18:51 GMT+02:00 Christophe Gisquet :
[SNIP]

Could someone also apply the cosmetic patch for reindentation?

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


Re: [FFmpeg-devel] [PATCH] avformat/flacdec: support fast-seek

2015-10-02 Thread Nicolas George
Le primidi 11 vendémiaire, an CCXXIV, wm4 a écrit :
> > 3. use a static varible to keep the state in flacdec.c
> No global mutable state anywhere in the libs.

For once, I fully agree, but even without that principle, it would be wrong,
since an application can have several FLAC files open simultaneously, and
that would utterly fail in that case.

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] build: restore videotoolbox compilation on iOS

2015-10-02 Thread wm4
On Fri,  2 Oct 2015 10:36:39 +0200
Clément Bœsch  wrote:

> From: Clément Bœsch 
> 
> ---
>  configure | 11 ++-
>  ffmpeg_videotoolbox.c |  8 
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/configure b/configure
> index fd39778..225e7ae 100755
> --- a/configure
> +++ b/configure
> @@ -1804,6 +1804,7 @@ SYSTEM_FUNCS="
>  sysconf
>  sysctl
>  usleep
> +UTGetOSTypeFromString
>  VirtualAlloc
>  wglGetProcAddress
>  "
> @@ -2377,11 +2378,11 @@ crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
>  d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
>  dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
>  vaapi_deps="va_va_h"
> -vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads 
> CoreServices_CoreServices_h"
> -vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration 
> -framework QuartzCore -framework CoreServices"
> +vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
> +vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration 
> -framework QuartzCore"
>  vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
> -videotoolbox_deps="VideoToolbox_VideoToolbox_h pthreads 
> CoreServices_CoreServices_h"
> -videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox 
> -framework CoreMedia -framework QuartzCore -framework CoreServices"
> +videotoolbox_deps="VideoToolbox_VideoToolbox_h pthreads"
> +videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox 
> -framework CoreMedia -framework QuartzCore"
>  xvmc_deps="X11_extensions_XvMClib_h"
>  
>  h263_vaapi_hwaccel_deps="vaapi"
> @@ -5109,7 +5110,6 @@ check_func_headers glob.h glob
>  enabled xlib &&
>  check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" 
> XvGetPortAttribute -lXv -lX11 -lXext
>  
> -check_header CoreServices/CoreServices.h
>  check_header direct.h
>  check_header dirent.h
>  check_header dlfcn.h
> @@ -5142,6 +5142,7 @@ check_header asm/types.h
>  check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
>  check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
>  check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
> +check_lib "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework 
> CoreServices"
>  
>  check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
>  
> diff --git a/ffmpeg_videotoolbox.c b/ffmpeg_videotoolbox.c
> index 0bb0600..70b0d9c 100644
> --- a/ffmpeg_videotoolbox.c
> +++ b/ffmpeg_videotoolbox.c
> @@ -16,7 +16,9 @@
>   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 
> USA
>   */
>  
> +#if HAVE_UTGETOSTYPEFROMSTRING
>  #include 
> +#endif
>  
>  #include "config.h"
>  #include "libavcodec/avcodec.h"
> @@ -209,7 +211,13 @@ int videotoolbox_init(AVCodecContext *s)
>  CFStringRef pixfmt_str = 
> CFStringCreateWithCString(kCFAllocatorDefault,
> 
> videotoolbox_pixfmt,
> 
> kCFStringEncodingUTF8);
> +#if HAVE_UTGETOSTYPEFROMSTRING
>  vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
> +#else
> +av_log(s, loglevel, "UTGetOSTypeFromString() is not available "
> +   "on this platform, %s pixel format can not be honored 
> from "
> +   "the command line\n", videotoolbox_pixfmt);
> +#endif
>  ret = av_vda_default_init2(s, vdactx);
>  CFRelease(pixfmt_str);
>  }

I'd question the use of this in the first place. What does it do at
all? I couldn't find documentation for this option at all.

You could just do a numerical conversion from FourCC or a plain numeric
value, but I question why this needs to be user-settable at all.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH][RFC] avcodec: Don't lock during open if the codec has threadsafe init

2015-10-02 Thread Derek Buitenhuis
On 10/1/2015 3:38 PM, Derek Buitenhuis wrote:
> Signed-off-by: Derek Buitenhuis 
> ---
>  libavcodec/internal.h |  2 +-
>  libavcodec/utils.c| 19 ---
>  2 files changed, 13 insertions(+), 8 deletions(-)

OK'd by wm4 and nev on IRC.

Pushed.

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


Re: [FFmpeg-devel] [PATCH] avformat/flacdec: support fast-seek

2015-10-02 Thread Ching-Yi Chan
I found the problem is no seektable in our test sample acodec-flac.flac,
but application will append the new index entry to AVStream.

So, I need to a variable or some place to mark "no seektable, don't use
fast-seek method", some choices:

1. disable AVFMT_FLAG_FAST_SEEK flag when no seektable
2. use priv_class and keep the state in it
3. use a static varible to keep the state in flacdec.c

Need a suggestion for implementation.

2015-10-01 20:31 GMT+08:00 Michael Niedermayer :

> On Fri, Sep 25, 2015 at 11:58:31AM +0800, Ching-Yi Chan wrote:
> > Thanks for checking.
> >
> > I also check the AVFMT_FLAG_FAST_SEEK flag with parsing headers,
> > to fill the seektable into index entries only if AVFMT_FLAG_FAST_SEEK
> flag
> > is on.
> >
> > If the AVFMT_FLAG_FAST_SEEK flag is not enabled, it will seek in original
> > way.
>
> i think we misunderstand us somehow
>
> your code does not work for me
> seeking to  1.894167 results in a seek to
> pts: 0.00 pos:   8256
>
> seeking to  1.470835 results in a seek to
> pts: 0.809796 pos:  27366
>
> you notice that moving the target to a later point moves the result
> to a earlier one.
>
> please see below for further comments
>
> [...]
>
> > +#define SEEKPOINT_SIZE 18
> > +
> > +static void ff_reset_index_position(int64_t metadata_head_size,
> AVStream *st)
>
> the ff_ prefix is for non static functions
>
>
> [...9
>
> > @@ -249,12 +277,30 @@ static av_unused int64_t
> flac_read_timestamp(AVFormatContext *s, int stream_inde
> >  return pts;
> >  }
> >
> > +static int flac_seek(AVFormatContext *s, int stream_index, int64_t
> timestamp, int flags) {
> > +if (!(s->flags_FLAG_FAST_SEEK)) {
> > +return -1;
> > +}
> > +
> > +int index = av_index_search_timestamp(s->streams[0], timestamp,
> flags);
>
> libavformat/flacdec.c:285:5: warning: ISO C90 forbids mixed declarations
> and code [-Wdeclaration-after-statement]
> libavformat/flacdec.c:289:5: warning: ISO C90 forbids mixed declarations
> and code [-Wdeclaration-after-statement]
>
> please make sure your patch adds no compiler warnings
>
>
> > +if(index<0 || index >= s->streams[0]->nb_index_entries)
> > +return -1;
> > +
> > +AVIndexEntry e = s->streams[0]->index_entries[index];
>
> > +int ret = avio_seek(s->pb, e.pos, SEEK_SET);
>
> this is wrong and must use int64_t otherwise the following >= 0 check
> can be wrong
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Democracy is the form of government in which you can choose your dictator
>
> ___
> 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] [PATCH] avfilter/vf_tinterlace: add mergex2 mode

2015-10-02 Thread tim nicholson
On 02/10/15 11:03, Paul B Mahol wrote:
> On 10/1/15, Paul B Mahol  wrote:
>> Signed-off-by: Paul B Mahol 
>> ---
>>  doc/filters.texi| 23 +++
>>  libavfilter/tinterlace.h|  1 +
>>  libavfilter/vf_tinterlace.c | 17 -
>>  3 files changed, 36 insertions(+), 5 deletions(-)
> 
> 
> So is this ok now? This is supposed to replicate DoubleWeave from
> avisynth/vapoursynth.

No further comments from me, the desired result makes more sense, and I
think the code is correct to achieve that, but I hoped others might
check the logic too.

> [..]

-- 
Tim.
Key Fingerprint 38CF DB09 3ED0 F607 8B67 6CED 0C0B FC44 8B0B FC83
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] vp9: 10/12bpp SIMD (sse2/ssse3/avx) for directional intra prediction.

2015-10-02 Thread Ronald S. Bultje
---
 libavcodec/x86/constants.c|2 +
 libavcodec/x86/constants.h|1 +
 libavcodec/x86/h264_qpel_10bit.asm|4 +-
 libavcodec/x86/vp9dsp_init.h  |4 +
 libavcodec/x86/vp9dsp_init_16bpp.c|   33 +
 libavcodec/x86/vp9intrapred_16bpp.asm | 1520 +
 6 files changed, 1562 insertions(+), 2 deletions(-)

diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c
index 19345f5..3f3ee0f 100644
--- a/libavcodec/x86/constants.c
+++ b/libavcodec/x86/constants.c
@@ -85,3 +85,5 @@ DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_16)   = { 
0x00100010ULL, 0x000
 0x00100010ULL, 
0x00100010ULL };
 DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_32)   = { 0x00200020ULL, 
0x00200020ULL,
 0x00200020ULL, 
0x00200020ULL };
+DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_65535)= { 0xULL, 
0xULL,
+0xULL, 
0xULL };
diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h
index 4a2451d..ee8422e 100644
--- a/libavcodec/x86/constants.h
+++ b/libavcodec/x86/constants.h
@@ -65,5 +65,6 @@ extern const xmm_reg  ff_ps_neg;
 extern const ymm_reg  ff_pd_1;
 extern const ymm_reg  ff_pd_16;
 extern const ymm_reg  ff_pd_32;
+extern const ymm_reg  ff_pd_65535;
 
 #endif /* AVCODEC_X86_CONSTANTS_H */
diff --git a/libavcodec/x86/h264_qpel_10bit.asm 
b/libavcodec/x86/h264_qpel_10bit.asm
index 7e9be36..8722683 100644
--- a/libavcodec/x86/h264_qpel_10bit.asm
+++ b/libavcodec/x86/h264_qpel_10bit.asm
@@ -26,6 +26,7 @@
 
 SECTION_RODATA 32
 
+cextern pd_65535
 cextern pw_1023
 %define pw_pixel_max pw_1023
 cextern pw_16
@@ -42,7 +43,6 @@ unpad: times 8 dw 16*1022/32 ; needs to be mod 16
 tap1: times 4 dw  1, -5
 tap2: times 4 dw 20, 20
 tap3: times 4 dw -5,  1
-pd_0f: times 4 dd 0x
 
 SECTION .text
 
@@ -708,7 +708,7 @@ h%1_loop_op:
 psrad  m1, 10
 psrad  m2, 10
 pslld  m2, 16
-pand   m1, [pd_0f]
+pand   m1, [pd_65535]
 porm1, m2
 %if num_mmregs <= 8
 pxor   m0, m0
diff --git a/libavcodec/x86/vp9dsp_init.h b/libavcodec/x86/vp9dsp_init.h
index 47d2246..5842282 100644
--- a/libavcodec/x86/vp9dsp_init.h
+++ b/libavcodec/x86/vp9dsp_init.h
@@ -165,6 +165,10 @@ filters_8tap_2d_fn(op, 4, align, bpp, bytes, opt4, f_opt)
 init_ipred_func(type, enum, 16, bpp, opt); \
 init_ipred_func(type, enum, 32, bpp, opt)
 
+#define init_ipred_funcs(type, enum, bpp, opt) \
+init_ipred_func(type, enum,  4, bpp, opt); \
+init_8_16_32_ipred_funcs(type, enum, bpp, opt)
+
 void ff_vp9dsp_init_10bpp_x86(VP9DSPContext *dsp);
 void ff_vp9dsp_init_12bpp_x86(VP9DSPContext *dsp);
 void ff_vp9dsp_init_16bpp_x86(VP9DSPContext *dsp);
diff --git a/libavcodec/x86/vp9dsp_init_16bpp.c 
b/libavcodec/x86/vp9dsp_init_16bpp.c
index f4a4a5d..4ceb4d4 100644
--- a/libavcodec/x86/vp9dsp_init_16bpp.c
+++ b/libavcodec/x86/vp9dsp_init_16bpp.c
@@ -51,6 +51,18 @@ decl_ipred_fns(h,   16, mmxext, sse2);
 decl_ipred_fns(dc,  16, mmxext, sse2);
 decl_ipred_fns(dc_top,  16, mmxext, sse2);
 decl_ipred_fns(dc_left, 16, mmxext, sse2);
+
+#define decl_ipred_dir_funcs(type) \
+decl_ipred_fns(type, 16, sse2,  sse2); \
+decl_ipred_fns(type, 16, ssse3, ssse3); \
+decl_ipred_fns(type, 16, avx,   avx)
+
+decl_ipred_dir_funcs(dl);
+decl_ipred_dir_funcs(dr);
+decl_ipred_dir_funcs(vl);
+decl_ipred_dir_funcs(vr);
+decl_ipred_dir_funcs(hu);
+decl_ipred_dir_funcs(hd);
 #endif /* HAVE_YASM */
 
 av_cold void ff_vp9dsp_init_16bpp_x86(VP9DSPContext *dsp)
@@ -88,12 +100,33 @@ av_cold void ff_vp9dsp_init_16bpp_x86(VP9DSPContext *dsp)
 init_8_16_32_ipred_funcs(dc, DC, 16, sse2);
 init_8_16_32_ipred_funcs(dc_top,  TOP_DC,  16, sse2);
 init_8_16_32_ipred_funcs(dc_left, LEFT_DC, 16, sse2);
+init_ipred_funcs(dl, DIAG_DOWN_LEFT, 16, sse2);
+init_ipred_funcs(dr, DIAG_DOWN_RIGHT, 16, sse2);
+init_ipred_funcs(vl, VERT_LEFT, 16, sse2);
+init_ipred_funcs(vr, VERT_RIGHT, 16, sse2);
+init_ipred_funcs(hu, HOR_UP, 16, sse2);
+init_ipred_funcs(hd, HOR_DOWN, 16, sse2);
+}
+
+if (EXTERNAL_SSSE3(cpu_flags)) {
+init_ipred_funcs(dl, DIAG_DOWN_LEFT, 16, ssse3);
+init_ipred_funcs(dr, DIAG_DOWN_RIGHT, 16, ssse3);
+init_ipred_funcs(vl, VERT_LEFT, 16, ssse3);
+init_ipred_funcs(vr, VERT_RIGHT, 16, ssse3);
+init_ipred_funcs(hu, HOR_UP, 16, ssse3);
+init_ipred_funcs(hd, HOR_DOWN, 16, ssse3);
 }
 
 if (EXTERNAL_AVX_FAST(cpu_flags)) {
 init_fpel_func(2, 0,  32, put, , avx);
 init_fpel_func(1, 0,  64, put, , avx);
 init_fpel_func(0, 0, 128, put, , avx);
+init_ipred_funcs(dl, DIAG_DOWN_LEFT, 16, avx);
+init_ipred_funcs(dr, DIAG_DOWN_RIGHT, 16, avx);

[FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-02 Thread Clément Bœsch
From: Clément Bœsch 

---
 configure | 11 ++-
 ffmpeg_videotoolbox.c |  8 
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index fd39778..225e7ae 100755
--- a/configure
+++ b/configure
@@ -1804,6 +1804,7 @@ SYSTEM_FUNCS="
 sysconf
 sysctl
 usleep
+UTGetOSTypeFromString
 VirtualAlloc
 wglGetProcAddress
 "
@@ -2377,11 +2378,11 @@ crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
 d3d11va_deps="d3d11_h dxva_h ID3D11VideoDecoder"
 dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode"
 vaapi_deps="va_va_h"
-vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads 
CoreServices_CoreServices_h"
-vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration 
-framework QuartzCore -framework CoreServices"
+vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
+vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration 
-framework QuartzCore"
 vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
-videotoolbox_deps="VideoToolbox_VideoToolbox_h pthreads 
CoreServices_CoreServices_h"
-videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox 
-framework CoreMedia -framework QuartzCore -framework CoreServices"
+videotoolbox_deps="VideoToolbox_VideoToolbox_h pthreads"
+videotoolbox_extralibs="-framework CoreFoundation -framework VideoToolbox 
-framework CoreMedia -framework QuartzCore"
 xvmc_deps="X11_extensions_XvMClib_h"
 
 h263_vaapi_hwaccel_deps="vaapi"
@@ -5109,7 +5110,6 @@ check_func_headers glob.h glob
 enabled xlib &&
 check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute 
-lXv -lX11 -lXext
 
-check_header CoreServices/CoreServices.h
 check_header direct.h
 check_header dirent.h
 check_header dlfcn.h
@@ -5142,6 +5142,7 @@ check_header asm/types.h
 check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
 check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
 check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
+check_lib "CoreServices/CoreServices.h" UTGetOSTypeFromString "-framework 
CoreServices"
 
 check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
 
diff --git a/ffmpeg_videotoolbox.c b/ffmpeg_videotoolbox.c
index 0bb0600..70b0d9c 100644
--- a/ffmpeg_videotoolbox.c
+++ b/ffmpeg_videotoolbox.c
@@ -16,7 +16,9 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#if HAVE_UTGETOSTYPEFROMSTRING
 #include 
+#endif
 
 #include "config.h"
 #include "libavcodec/avcodec.h"
@@ -209,7 +211,13 @@ int videotoolbox_init(AVCodecContext *s)
 CFStringRef pixfmt_str = 
CFStringCreateWithCString(kCFAllocatorDefault,

videotoolbox_pixfmt,

kCFStringEncodingUTF8);
+#if HAVE_UTGETOSTYPEFROMSTRING
 vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
+#else
+av_log(s, loglevel, "UTGetOSTypeFromString() is not available "
+   "on this platform, %s pixel format can not be honored from "
+   "the command line\n", videotoolbox_pixfmt);
+#endif
 ret = av_vda_default_init2(s, vdactx);
 CFRelease(pixfmt_str);
 }
-- 
2.6.0

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


Re: [FFmpeg-devel] [PATCH]lavf/shortendec: Autodetect raw Shorten streams.

2015-10-02 Thread Paul B Mahol
On 10/2/15, Carl Eugen Hoyos  wrote:
> Hi!
>
> Attached patch implements Shorten auto-detection.
>
> Please comment, Carl Eugen
>

You do not check byte size. and not using init_get_bits8.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] Integration of RTMFP

2015-10-02 Thread Thomas Jammet
Hi all,

I am working on a new library that will implements the RTMFP protocol's
client part. I know librtmp and I will take example on how it is used now
by ffmpeg.

My question is : is there something to know about the integration of a new
protocol in ffmpeg? Does someone could give me some advices?

Thank you

Regards

*--*

*Thomas JAMMET*
Freelancer - MonaServer.ovh
http://fr.linkedin.com/pub/thomas-jammet/5a/411/60b/
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_tinterlace: add mergex2 mode

2015-10-02 Thread Paul B Mahol
On 10/1/15, Paul B Mahol  wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  doc/filters.texi| 23 +++
>  libavfilter/tinterlace.h|  1 +
>  libavfilter/vf_tinterlace.c | 17 -
>  3 files changed, 36 insertions(+), 5 deletions(-)


So is this ok now? This is supposed to replicate DoubleWeave from
avisynth/vapoursynth.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/flacdec: support fast-seek

2015-10-02 Thread Carl Eugen Hoyos
Ching-Yi Chan  gmail.com> writes:

> May I have a copy about the tests code. for improving my patch.

$ make V=1 fate-seek-acodec-flac

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-02 Thread Clément Bœsch
On Fri, Oct 02, 2015 at 11:11:37AM +0200, wm4 wrote:
[...]
> > +#if HAVE_UTGETOSTYPEFROMSTRING
> >  vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
> > +#else
> > +av_log(s, loglevel, "UTGetOSTypeFromString() is not available "
> > +   "on this platform, %s pixel format can not be honored 
> > from "
> > +   "the command line\n", videotoolbox_pixfmt);
> > +#endif
> >  ret = av_vda_default_init2(s, vdactx);
> >  CFRelease(pixfmt_str);
> >  }
> 
> I'd question the use of this in the first place. What does it do at
> all? I couldn't find documentation for this option at all.
> 
> You could just do a numerical conversion from FourCC or a plain numeric
> value, but I question why this needs to be user-settable at all.

This is a CLI option to save a software convert by making VT outputs
directly in a given pixel format (the NV12 → BGRA can be faster than
swscale for instance).

So the function is just to map from the vt pixel format string (user
specified) to the vt pixel format.

What we can do also is to make a mapping from our pixel format strings to
the VT pixel formats, which could make more sense. But this is a behaviour
change, and I'm just trying to fix the build here.

-- 
Clément B.


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


[FFmpeg-devel] [PATCH]lavf/shortendec: Autodetect raw Shorten streams.

2015-10-02 Thread Carl Eugen Hoyos
Hi!

Attached patch implements Shorten auto-detection.

Please comment, Carl Eugen
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 466da51..a9af797 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -403,7 +403,7 @@ OBJS-$(CONFIG_SDP_DEMUXER)   += rtsp.o
 OBJS-$(CONFIG_SDR2_DEMUXER)  += sdr2.o
 OBJS-$(CONFIG_SEGAFILM_DEMUXER)  += segafilm.o
 OBJS-$(CONFIG_SEGMENT_MUXER) += segment.o
-OBJS-$(CONFIG_SHORTEN_DEMUXER)   += rawdec.o
+OBJS-$(CONFIG_SHORTEN_DEMUXER)   += shortendec.o rawdec.o
 OBJS-$(CONFIG_SIFF_DEMUXER)  += siff.o
 OBJS-$(CONFIG_SINGLEJPEG_MUXER)  += rawenc.o
 OBJS-$(CONFIG_SMACKER_DEMUXER)   += smacker.o
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index ef84d37..46ee21e 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -266,18 +266,6 @@ AVInputFormat ff_truehd_demuxer = {
 };
 #endif
 
-#if CONFIG_SHORTEN_DEMUXER
-AVInputFormat ff_shorten_demuxer = {
-.name   = "shn",
-.long_name  = NULL_IF_CONFIG_SMALL("raw Shorten"),
-.read_header= ff_raw_audio_read_header,
-.read_packet= ff_raw_read_partial_packet,
-.flags  = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | 
AVFMT_NO_BYTE_SEEK|AVFMT_NOTIMESTAMPS,
-.extensions = "shn",
-.raw_codec_id   = AV_CODEC_ID_SHORTEN,
-};
-#endif
-
 #if CONFIG_VC1_DEMUXER
 FF_DEF_RAWVIDEO_DEMUXER2(vc1, "raw VC-1", NULL, "vc1", AV_CODEC_ID_VC1, 
AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS)
 #endif
diff --git a/libavformat/shortendec.c b/libavformat/shortendec.c
index e69de29..2b13fb7 100644
--- a/libavformat/shortendec.c
+++ b/libavformat/shortendec.c
@@ -0,0 +1,70 @@
+/*
+ * Shorten demuxer
+ * Copyright (c) 2001 Fabrice Bellard
+ * Copyright (c) 2005 Alex Beregszaszi
+ * Copyright (c) 2015 Carl Eugen Hoyos
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "rawdec.h"
+#include "libavcodec/golomb.h"
+
+static int shn_probe(AVProbeData *p)
+{
+GetBitContext gb;
+int version, internal_ftype, channels, blocksize;
+
+if (AV_RB32(p->buf) != 0x616a6b67)
+return 0;
+version = p->buf[4];
+init_get_bits(, p->buf + 5, p->buf_size - 5);
+if (!version) {
+internal_ftype = get_ur_golomb_shorten(, 4);
+channels = get_ur_golomb_shorten(, 0);
+blocksize = 256;
+} else {
+int k;
+k = get_ur_golomb_shorten(, 2);
+internal_ftype = get_ur_golomb_shorten(, k);
+k = get_ur_golomb_shorten(, 2);
+channels = get_ur_golomb_shorten(, k);
+k = get_ur_golomb_shorten(, 2);
+blocksize = get_ur_golomb_shorten(, k);
+}
+
+if (internal_ftype != 2 && internal_ftype != 3 && internal_ftype != 5)
+return 0;
+if (channels < 1 || channels > 8)
+return 0;
+if (blocksize < 1 || blocksize > 65535)
+return 0;
+
+return AVPROBE_SCORE_EXTENSION + 1;
+}
+
+AVInputFormat ff_shorten_demuxer = {
+.name   = "shn",
+.long_name  = NULL_IF_CONFIG_SMALL("raw Shorten"),
+.read_probe = shn_probe,
+.read_header= ff_raw_audio_read_header,
+.read_packet= ff_raw_read_partial_packet,
+.flags  = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | 
AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS,
+.extensions = "shn",
+.raw_codec_id   = AV_CODEC_ID_SHORTEN,
+};
diff --git a/libavformat/version.h b/libavformat/version.h
index 4c60e50..b4c4d23 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
 #define LIBAVFORMAT_VERSION_MINOR   2
-#define LIBAVFORMAT_VERSION_MICRO 102
+#define LIBAVFORMAT_VERSION_MICRO 103
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-02 Thread Clément Bœsch
On Fri, Oct 02, 2015 at 12:20:10PM +0200, wm4 wrote:
> On Fri, 2 Oct 2015 11:23:59 +0200
> Clément Bœsch  wrote:
> 
> > On Fri, Oct 02, 2015 at 11:11:37AM +0200, wm4 wrote:
> > [...]
> > > > +#if HAVE_UTGETOSTYPEFROMSTRING
> > > >  vdactx->cv_pix_fmt_type = 
> > > > UTGetOSTypeFromString(pixfmt_str);
> > > > +#else
> > > > +av_log(s, loglevel, "UTGetOSTypeFromString() is not 
> > > > available "
> > > > +   "on this platform, %s pixel format can not be 
> > > > honored from "
> > > > +   "the command line\n", videotoolbox_pixfmt);
> > > > +#endif
> > > >  ret = av_vda_default_init2(s, vdactx);
> > > >  CFRelease(pixfmt_str);
> > > >  }
> > > 
> > > I'd question the use of this in the first place. What does it do at
> > > all? I couldn't find documentation for this option at all.
> > > 
> > > You could just do a numerical conversion from FourCC or a plain numeric
> > > value, but I question why this needs to be user-settable at all.
> > 
> > This is a CLI option to save a software convert by making VT outputs
> > directly in a given pixel format (the NV12 → BGRA can be faster than
> > swscale for instance).
> > 
> > So the function is just to map from the vt pixel format string (user
> > specified) to the vt pixel format.
> > 
> > What we can do also is to make a mapping from our pixel format strings to
> > the VT pixel formats, which could make more sense. But this is a behaviour
> > change, and I'm just trying to fix the build here.
> > 
> 
> Why not disable ffmpeg_videotoolbox.c on iOS then? (I don't mind either
> way, but this fix feels slightly wrong. But I don't want to block it.)

I could do that, but it would require to add that build granularity, and I
would still need to fix the link to the CoreServices. I don't think the
diff will be simpler & shorter.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] Revert "avformat/flvdec: Check that sizes match and resync if not"

2015-10-02 Thread wm4
On Fri, 2 Oct 2015 02:22:48 +0200
Michael Niedermayer  wrote:

> On Fri, Oct 02, 2015 at 12:36:24AM +0200, wm4 wrote:
> > On Fri, 2 Oct 2015 00:06:24 +0200
> > Michael Niedermayer  wrote:
> > 
> > > On Thu, Oct 01, 2015 at 11:33:27PM +0200, wm4 wrote:
> > > > On Thu, 1 Oct 2015 21:08:39 + (UTC)
> > > > Carl Eugen Hoyos  wrote:
> > > > 
> > > > > wm4  googlemail.com> writes:
> > > > > 
> > > > > > This reverts commit cbbd906be6150be38dfc14b6bc67dcac8da8aea4.
> > > > > > 
> > > > > > It broke rtmp fatally, at least some cases of it.
> > > > > 
> > > > > You don't want to share some of them with us?
> > > > 
> > > > This is a bit hard, because it's some site accessed through youtube-dl
> > > > (youtube-dl extracts the current URL, encryption keys etc. - just
> > > > handling out an URL won't do). I haven't tested yet if this happens
> > > > with all rtmp URLs.
> > > 
> > > can you provide uncut ffmpeg output from the failure? it should contain
> > > information about the resync/mismatches even if the URLs cannot
> > > be used.
> > 
> > I didn't use ffmpeg, and although it would have been possible, it's
> > complicated to extract and set all these rtmpe extra parameters.
> > 
> > > also what generated the rtmp stream that fails?
> > 
> 
> > I have no idea. But the flv stream is of course produced by
> > libavformat. I've dumped part of this stream: https://0x0.st/z0e.flv
> 
> do these invalid flv files exist elsewhere or is this the only one?

I don't know, but before the commit I pointed out, it could just play
such files, and now it can't. Does that mean the new code is less
robust? It's also conceivable that these files got into the wild
because someone recorded the byte stream ffmpeg outputs for rtmpe, but
I don't know if anyone did that.

Up to you to decide this.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-10-02 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 configure|   4 +
 doc/filters.texi | 171 +++
 libavfilter/Makefile |   1 +
 libavfilter/allfilters.c |   1 +
 libavfilter/vf_zscale.c  | 735 +++
 5 files changed, 912 insertions(+)
 create mode 100644 libavfilter/vf_zscale.c

diff --git a/configure b/configure
index 552f698..c15add2 100755
--- a/configure
+++ b/configure
@@ -269,6 +269,7 @@ External library support:
   --enable-libxcb-shapeenable X11 grabbing shape rendering [autodetect]
   --enable-libxvid enable Xvid encoding via xvidcore,
native MPEG-4/Xvid encoder exists [no]
+  --enable-libzimg enable z.lib, needed for zscale filter [no]
   --enable-libzmq  enable message passing via libzmq [no]
   --enable-libzvbi enable teletext support via libzvbi [no]
   --disable-lzma   disable lzma [autodetect]
@@ -1435,6 +1436,7 @@ EXTERNAL_LIBRARY_LIST="
 libxcb_shape
 libxcb_xfixes
 libxvid
+libzimg
 libzmq
 libzvbi
 lzma
@@ -2817,6 +2819,7 @@ tinterlace_pad_test_deps="tinterlace_filter"
 uspp_filter_deps="gpl avcodec"
 zmq_filter_deps="libzmq"
 zoompan_filter_deps="swscale"
+zscale_filter_deps="libzimg"
 
 # examples
 avio_reading="avformat avcodec avutil"
@@ -5355,6 +5358,7 @@ enabled libx265   && require_pkg_config x265 
x265.h x265_api_get &&
die "ERROR: libx265 version must be >= 57."; }
 enabled libxavs   && require libxavs xavs.h xavs_encoder_encode -lxavs
 enabled libxvid   && require libxvid xvid.h xvid_global -lxvidcore
+enabled libzimg   && require_pkg_config zimg zimg.h 
zimg2_get_api_version
 enabled libzmq&& require_pkg_config libzmq zmq.h zmq_ctx_new
 enabled libzvbi   && require libzvbi libzvbi.h vbi_decoder_new -lzvbi
 enabled mmal  && { check_lib interface/mmal/mmal.h 
mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
diff --git a/doc/filters.texi b/doc/filters.texi
index a4d828e..68e21c7 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -11773,6 +11773,177 @@ 
zoompan=z='min(zoom+0.0015,1.5)':d=700:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)'
 @end example
 @end itemize
 
+@section zscale
+Scale (resize) the input video, using the z.lib library:
+https://github.com/sekrit-twc/zimg.
+
+The zscale filter forces the output display aspect ratio to be the same
+as the input, by changing the output sample aspect ratio.
+
+If the input image format is different from the format requested by
+the next filter, the zscale filter will convert the input to the
+requested format.
+
+@subsection Options
+The filter accepts the following options.
+
+@table @option
+@item width, w
+@item height, h
+Set the output video dimension expression. Default value is the input
+dimension.
+
+If the @var{width} or @var{w} is 0, the input width is used for the output.
+If the @var{height} or @var{h} is 0, the input height is used for the output.
+
+If one of the values is -1, the zscale filter will use a value that
+maintains the aspect ratio of the input image, calculated from the
+other specified dimension. If both of them are -1, the input size is
+used
+
+If one of the values is -n with n > 1, the zscale filter will also use a value
+that maintains the aspect ratio of the input image, calculated from the other
+specified dimension. After that it will, however, make sure that the calculated
+dimension is divisible by n and adjust the value if necessary.
+
+See below for the list of accepted constants for use in the dimension
+expression.
+
+@item size, s
+Set the video size. For the syntax of this option, check the
+@ref{video size syntax,,"Video size" section in the ffmpeg-utils 
manual,ffmpeg-utils}.
+
+@item dither, d
+Set the dither type.
+
+Possible values are:
+@table @var
+@item none
+@item ordered
+@item random
+@item error_diffusion
+@end table
+
+Default is none.
+
+@item filter, f
+Set the resize filter type.
+
+Possible values are:
+@table @var
+@item point
+@item bilinear
+@item bicubic
+@item spline16
+@item spline36
+@item lanczos
+@end table
+
+Default is bilinear.
+
+@item range, r
+Set the color range.
+
+Possible values are:
+@table @var
+@item input
+@item limited
+@item full
+@end table
+
+Default is same as input.
+
+@item primaries, p
+Set the color primaries.
+
+Possible values are:
+@table @var
+@item input
+@item 709
+@item unspecified
+@item 170m
+@item 240m
+@item 2020
+@end table
+
+Default is same as input.
+
+@item transfer, t
+Set the transfer characteristics.
+
+Possible values are:
+@table @var
+@item input
+@item 709
+@item unspecified
+@item 601
+@item linear
+@item 2020_10
+@item 2020_12
+@end table
+
+Default is same as input.
+
+@item matrix, m
+Set the colorspace matrix.
+
+Possible value are:
+@table @var
+@item input
+@item 709
+@item unspecified
+@item 470bg
+@item 170m

Re: [FFmpeg-devel] Integration of RTMFP

2015-10-02 Thread Carl Eugen Hoyos
Thomas Jammet  gmail.com> writes:

> I am working on a new library that will implements 
> the RTMFP protocol's client part.

Can't this be implemented within FFmpeg?

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] build: restore videotoolbox compilation on iOS

2015-10-02 Thread wm4
On Fri, 2 Oct 2015 11:23:59 +0200
Clément Bœsch  wrote:

> On Fri, Oct 02, 2015 at 11:11:37AM +0200, wm4 wrote:
> [...]
> > > +#if HAVE_UTGETOSTYPEFROMSTRING
> > >  vdactx->cv_pix_fmt_type = UTGetOSTypeFromString(pixfmt_str);
> > > +#else
> > > +av_log(s, loglevel, "UTGetOSTypeFromString() is not 
> > > available "
> > > +   "on this platform, %s pixel format can not be honored 
> > > from "
> > > +   "the command line\n", videotoolbox_pixfmt);
> > > +#endif
> > >  ret = av_vda_default_init2(s, vdactx);
> > >  CFRelease(pixfmt_str);
> > >  }
> > 
> > I'd question the use of this in the first place. What does it do at
> > all? I couldn't find documentation for this option at all.
> > 
> > You could just do a numerical conversion from FourCC or a plain numeric
> > value, but I question why this needs to be user-settable at all.
> 
> This is a CLI option to save a software convert by making VT outputs
> directly in a given pixel format (the NV12 → BGRA can be faster than
> swscale for instance).
> 
> So the function is just to map from the vt pixel format string (user
> specified) to the vt pixel format.
> 
> What we can do also is to make a mapping from our pixel format strings to
> the VT pixel formats, which could make more sense. But this is a behaviour
> change, and I'm just trying to fix the build here.
> 

Why not disable ffmpeg_videotoolbox.c on iOS then? (I don't mind either
way, but this fix feels slightly wrong. But I don't want to block it.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH]lavf/shortendec: Autodetect raw Shorten streams.

2015-10-02 Thread Carl Eugen Hoyos
On Friday 02 October 2015 12:48:17 pm Paul B Mahol wrote:
> On 10/2/15, Carl Eugen Hoyos  wrote:
> > Hi!
> >
> > Attached patch implements Shorten auto-detection.
> >
> > Please comment, Carl Eugen
>
> You do not check byte size

I thought both the safe bitstream reader and the minimal 
probe buffer size avoid an overread here.
Is that wrong?

> and not using init_get_bits8. 

Fixed, thank you!

New patch attached, Carl Eugen
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 466da51..a9af797 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -403,7 +403,7 @@ OBJS-$(CONFIG_SDP_DEMUXER)   += rtsp.o
 OBJS-$(CONFIG_SDR2_DEMUXER)  += sdr2.o
 OBJS-$(CONFIG_SEGAFILM_DEMUXER)  += segafilm.o
 OBJS-$(CONFIG_SEGMENT_MUXER) += segment.o
-OBJS-$(CONFIG_SHORTEN_DEMUXER)   += rawdec.o
+OBJS-$(CONFIG_SHORTEN_DEMUXER)   += shortendec.o rawdec.o
 OBJS-$(CONFIG_SIFF_DEMUXER)  += siff.o
 OBJS-$(CONFIG_SINGLEJPEG_MUXER)  += rawenc.o
 OBJS-$(CONFIG_SMACKER_DEMUXER)   += smacker.o
diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c
index ef84d37..46ee21e 100644
--- a/libavformat/rawdec.c
+++ b/libavformat/rawdec.c
@@ -266,18 +266,6 @@ AVInputFormat ff_truehd_demuxer = {
 };
 #endif
 
-#if CONFIG_SHORTEN_DEMUXER
-AVInputFormat ff_shorten_demuxer = {
-.name   = "shn",
-.long_name  = NULL_IF_CONFIG_SMALL("raw Shorten"),
-.read_header= ff_raw_audio_read_header,
-.read_packet= ff_raw_read_partial_packet,
-.flags  = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | 
AVFMT_NO_BYTE_SEEK|AVFMT_NOTIMESTAMPS,
-.extensions = "shn",
-.raw_codec_id   = AV_CODEC_ID_SHORTEN,
-};
-#endif
-
 #if CONFIG_VC1_DEMUXER
 FF_DEF_RAWVIDEO_DEMUXER2(vc1, "raw VC-1", NULL, "vc1", AV_CODEC_ID_VC1, 
AVFMT_GENERIC_INDEX|AVFMT_NOTIMESTAMPS)
 #endif
diff --git a/libavformat/shortendec.c b/libavformat/shortendec.c
index e69de29..42fcdf7 100644
--- a/libavformat/shortendec.c
+++ b/libavformat/shortendec.c
@@ -0,0 +1,71 @@
+/*
+ * Shorten demuxer
+ * Copyright (c) 2001 Fabrice Bellard
+ * Copyright (c) 2005 Alex Beregszaszi
+ * Copyright (c) 2015 Carl Eugen Hoyos
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "avformat.h"
+#include "rawdec.h"
+#include "libavcodec/golomb.h"
+
+static int shn_probe(AVProbeData *p)
+{
+GetBitContext gb;
+int version, internal_ftype, channels, blocksize;
+
+if (AV_RB32(p->buf) != 0x616a6b67)
+return 0;
+version = p->buf[4];
+if (init_get_bits8(, p->buf + 5, p->buf_size - 5 - 
AV_INPUT_BUFFER_PADDING_SIZE) < 0)
+return 0;
+if (!version) {
+internal_ftype = get_ur_golomb_shorten(, 4);
+channels = get_ur_golomb_shorten(, 0);
+blocksize = 256;
+} else {
+int k;
+k = get_ur_golomb_shorten(, 2);
+internal_ftype = get_ur_golomb_shorten(, k);
+k = get_ur_golomb_shorten(, 2);
+channels = get_ur_golomb_shorten(, k);
+k = get_ur_golomb_shorten(, 2);
+blocksize = get_ur_golomb_shorten(, k);
+}
+
+if (internal_ftype != 2 && internal_ftype != 3 && internal_ftype != 5)
+return 0;
+if (channels < 1 || channels > 8)
+return 0;
+if (blocksize < 1 || blocksize > 65535)
+return 0;
+
+return AVPROBE_SCORE_EXTENSION + 1;
+}
+
+AVInputFormat ff_shorten_demuxer = {
+.name   = "shn",
+.long_name  = NULL_IF_CONFIG_SMALL("raw Shorten"),
+.read_probe = shn_probe,
+.read_header= ff_raw_audio_read_header,
+.read_packet= ff_raw_read_partial_packet,
+.flags  = AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | 
AVFMT_NO_BYTE_SEEK | AVFMT_NOTIMESTAMPS,
+.extensions = "shn",
+.raw_codec_id   = AV_CODEC_ID_SHORTEN,
+};
diff --git a/libavformat/version.h b/libavformat/version.h
index 4c60e50..b4c4d23 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -31,7 +31,7 @@
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
 #define LIBAVFORMAT_VERSION_MINOR   2
-#define LIBAVFORMAT_VERSION_MICRO 102
+#define LIBAVFORMAT_VERSION_MICRO 103
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
   

[FFmpeg-devel] [PATCH 09/15] lavfi/vf_w3fdif: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_w3fdif.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index 849a3c0..e394d55 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -354,7 +354,7 @@ static int request_frame(AVFilterLink *outlink)
 AVFilterContext *ctx = outlink->src;
 W3FDIFContext *s = ctx->priv;
 
-do {
+/* TODO reindent */
 int ret;
 
 if (s->eof)
@@ -372,7 +372,6 @@ static int request_frame(AVFilterLink *outlink)
 } else if (ret < 0) {
 return ret;
 }
-} while (!s->cur);
 
 return 0;
 }
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 11/15] lavfi/avf_showspectrum: reindent after last commit.

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/avf_showspectrum.c | 21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 53ba940..11c3246 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -267,18 +267,17 @@ static int request_frame(AVFilterLink *outlink)
 unsigned i;
 int ret;
 
-/* TODO reindent */
-ret = ff_request_frame(inlink);
-if (ret == AVERROR_EOF && s->sliding == FULLFRAME && s->xpos > 0 &&
-s->outpicref) {
-for (i = 0; i < outlink->h; i++) {
-memset(s->outpicref->data[0] + i * s->outpicref->linesize[0] + 
s->xpos,   0, outlink->w - s->xpos);
-memset(s->outpicref->data[1] + i * s->outpicref->linesize[1] + 
s->xpos, 128, outlink->w - s->xpos);
-memset(s->outpicref->data[2] + i * s->outpicref->linesize[2] + 
s->xpos, 128, outlink->w - s->xpos);
-}
-ret = ff_filter_frame(outlink, s->outpicref);
-s->outpicref = NULL;
+ret = ff_request_frame(inlink);
+if (ret == AVERROR_EOF && s->sliding == FULLFRAME && s->xpos > 0 &&
+s->outpicref) {
+for (i = 0; i < outlink->h; i++) {
+memset(s->outpicref->data[0] + i * s->outpicref->linesize[0] + 
s->xpos,   0, outlink->w - s->xpos);
+memset(s->outpicref->data[1] + i * s->outpicref->linesize[1] + 
s->xpos, 128, outlink->w - s->xpos);
+memset(s->outpicref->data[2] + i * s->outpicref->linesize[2] + 
s->xpos, 128, outlink->w - s->xpos);
 }
+ret = ff_filter_frame(outlink, s->outpicref);
+s->outpicref = NULL;
+}
 
 return ret;
 }
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 12/15] lavfi/vf_alphamerge: reindent after last commit.

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_alphamerge.c | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index 3c62b59..a478de5 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -158,11 +158,10 @@ static int request_frame(AVFilterLink *outlink)
 AlphaMergeContext *merge = ctx->priv;
 int in, ret;
 
-/* TODO reindent */
-in = ff_bufqueue_peek(>queue_main, 0) ? 1 : 0;
-ret = ff_request_frame(ctx->inputs[in]);
-if (ret < 0)
-return ret;
+in = ff_bufqueue_peek(>queue_main, 0) ? 1 : 0;
+ret = ff_request_frame(ctx->inputs[in]);
+if (ret < 0)
+return ret;
 return 0;
 }
 
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 10/15] lavfi/vf_yadif: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_yadif.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index d7a2b53..c32c065 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -379,15 +379,15 @@ static int request_frame(AVFilterLink *link)
 {
 AVFilterContext *ctx = link->src;
 YADIFContext *yadif = ctx->priv;
+int ret;
 
 if (yadif->frame_pending) {
 return_frame(ctx, 1);
 return 0;
 }
 
-do {
-int ret;
 
+/* TODO reindent */
 if (yadif->eof)
 return AVERROR_EOF;
 
@@ -406,7 +406,6 @@ static int request_frame(AVFilterLink *link)
 } else if (ret < 0) {
 return ret;
 }
-} while (!yadif->prev);
 
 return 0;
 }
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 06/15] lavfi/vf_fps: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_fps.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
index 6154f6d..0f0ed24 100644
--- a/libavfilter/vf_fps.c
+++ b/libavfilter/vf_fps.c
@@ -129,8 +129,7 @@ static int request_frame(AVFilterLink *outlink)
 int frames_out = s->frames_out;
 int ret = 0;
 
-while (ret >= 0 && s->frames_out == frames_out)
-ret = ff_request_frame(ctx->inputs[0]);
+ret = ff_request_frame(ctx->inputs[0]);
 
 /* flush the fifo */
 if (ret == AVERROR_EOF && av_fifo_size(s->fifo)) {
-- 
2.5.3

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


Re: [FFmpeg-devel] [PATCH 3/3] dnxhddec: init scantable once permutation is set

2015-10-02 Thread Michael Niedermayer
On Thu, Oct 01, 2015 at 10:01:27PM +0200, Christophe Gisquet wrote:
> Otherwise, the dsp may change without its permuation being applied.
> ---
>  libavcodec/dnxhddec.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

applied

thanks

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

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


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


Re: [FFmpeg-devel] Integration of RTMFP

2015-10-02 Thread Thomas Jammet
Hi Carl,

Sorry I have thought about it but it is not possible, we want a standalone
library. In any case I will do the integration in ffmpeg.

Regards

*--*

*Thomas JAMMET*
Freelancer - MonaServer.ovh
14 Place Maschat - 19000 Tulle (France)
Tel : *+336 23 46 39 80*
http://fr.linkedin.com/pub/thomas-jammet/5a/411/60b/

2015-10-02 12:39 GMT+02:00 Carl Eugen Hoyos :

> Thomas Jammet  gmail.com> writes:
>
> > I am working on a new library that will implements
> > the RTMFP protocol's client part.
>
> Can't this be implemented within FFmpeg?
>
> Carl Eugen
>
> ___
> 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] [PATCH 2/3] dnxhddec: use dequantization formula from specs

2015-10-02 Thread Michael Niedermayer
On Thu, Oct 01, 2015 at 10:01:26PM +0200, Christophe Gisquet wrote:
> The current one, while correct, does not yield the best possible
> results. The specificiations suggest another formula, which results
> in quality gains in the decoded output from fate tests. This
> justifies changing said formula.
> ---
>  libavcodec/dnxhddec.c | 3 ++-
>  tests/ref/vsynth/vsynth1-dnxhd-1080i  | 4 ++--
>  tests/ref/vsynth/vsynth1-dnxhd-1080i-colr | 4 ++--
>  tests/ref/vsynth/vsynth1-dnxhd-720p   | 4 ++--
>  tests/ref/vsynth/vsynth1-dnxhd-720p-10bit | 4 ++--
>  tests/ref/vsynth/vsynth1-dnxhd-720p-rd| 4 ++--
>  tests/ref/vsynth/vsynth2-dnxhd-1080i  | 4 ++--
>  tests/ref/vsynth/vsynth2-dnxhd-1080i-colr | 4 ++--
>  tests/ref/vsynth/vsynth2-dnxhd-720p   | 4 ++--
>  tests/ref/vsynth/vsynth2-dnxhd-720p-10bit | 4 ++--
>  tests/ref/vsynth/vsynth2-dnxhd-720p-rd| 4 ++--
>  tests/ref/vsynth/vsynth3-dnxhd-1080i-colr | 2 +-
>  tests/ref/vsynth/vsynth_lena-dnxhd-1080i  | 4 ++--
>  tests/ref/vsynth/vsynth_lena-dnxhd-1080i-colr | 4 ++--
>  tests/ref/vsynth/vsynth_lena-dnxhd-720p   | 4 ++--
>  tests/ref/vsynth/vsynth_lena-dnxhd-720p-10bit | 4 ++--
>  tests/ref/vsynth/vsynth_lena-dnxhd-720p-rd| 4 ++--
>  17 files changed, 33 insertions(+), 32 deletions(-)

applied

thanks

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

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin


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


[FFmpeg-devel] [PATCH 04/15] lavfi/avf_showwaves: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/avf_showwaves.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c
index ec5291a..b75c666 100644
--- a/libavfilter/avf_showwaves.c
+++ b/libavfilter/avf_showwaves.c
@@ -53,7 +53,6 @@ typedef struct {
 int buf_idx;
 int16_t *buf_idy;/* y coordinate of previous sample for each channel */
 AVFrame *outpicref;
-int req_fullfilled;
 int n;
 int sample_count_mod;
 int mode;   ///< ShowWavesMode
@@ -179,8 +178,7 @@ inline static int push_frame(AVFilterLink *outlink)
 int nb_channels = inlink->channels;
 int ret, i;
 
-if ((ret = ff_filter_frame(outlink, showwaves->outpicref)) >= 0)
-showwaves->req_fullfilled = 1;
+ret = ff_filter_frame(outlink, showwaves->outpicref);
 showwaves->outpicref = NULL;
 showwaves->buf_idx = 0;
 for (i = 0; i < nb_channels; i++)
@@ -248,11 +246,7 @@ static int request_frame(AVFilterLink *outlink)
 AVFilterLink *inlink = outlink->src->inputs[0];
 int ret;
 
-showwaves->req_fullfilled = 0;
-do {
-ret = ff_request_frame(inlink);
-} while (!showwaves->req_fullfilled && ret >= 0);
-
+ret = ff_request_frame(inlink);
 if (ret == AVERROR_EOF && showwaves->outpicref) {
 if (showwaves->single_pic)
 push_single_pic(outlink);
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 08/15] lavfi/vf_thumbnail: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_thumbnail.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c
index c378791..64cedd4 100644
--- a/libavfilter/vf_thumbnail.c
+++ b/libavfilter/vf_thumbnail.c
@@ -172,9 +172,7 @@ static int request_frame(AVFilterLink *link)
 AVFilterContext *ctx = link->src;
 ThumbContext *s = ctx->priv;
 
-/* loop until a frame thumbnail is available (when a frame is queued,
- * s->n is reset to zero) */
-do {
+/* TODO reindent */
 int ret = ff_request_frame(ctx->inputs[0]);
 if (ret == AVERROR_EOF && s->n) {
 ret = ff_filter_frame(link, get_best_frame(ctx));
@@ -184,7 +182,6 @@ static int request_frame(AVFilterLink *link)
 }
 if (ret < 0)
 return ret;
-} while (s->n);
 return 0;
 }
 
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 07/15] lavfi/vf_select: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/f_select.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
index 3e7cf78..7613ca1 100644
--- a/libavfilter/f_select.c
+++ b/libavfilter/f_select.c
@@ -383,14 +383,8 @@ static int request_frame(AVFilterLink *outlink)
 SelectContext *select = ctx->priv;
 AVFilterLink *inlink = outlink->src->inputs[0];
 int out_no = FF_OUTLINK_IDX(outlink);
-
-do {
-int ret = ff_request_frame(inlink);
-if (ret < 0)
-return ret;
-} while (select->select_out != out_no);
-
-return 0;
+int ret = ff_request_frame(inlink);
+return ret;
 }
 
 static av_cold void uninit(AVFilterContext *ctx)
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 01/15] lavfi/af_aresample: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/af_aresample.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)


All patches in this series were tested with FATE or manually.


diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index f6fdd08..b5af70e 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -40,7 +40,6 @@ typedef struct {
 double ratio;
 struct SwrContext *swr;
 int64_t next_pts;
-int req_fullfilled;
 int more_data;
 } AResampleContext;
 
@@ -231,7 +230,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame 
*insamplesref)
 outsamplesref->nb_samples  = n_out;
 
 ret = ff_filter_frame(outlink, outsamplesref);
-aresample->req_fullfilled= 1;
 av_frame_free();
 return ret;
 }
@@ -284,10 +282,7 @@ static int request_frame(AVFilterLink *outlink)
 aresample->more_data = 0;
 
 // Second request more data from the input
-aresample->req_fullfilled = 0;
-do{
-ret = ff_request_frame(ctx->inputs[0]);
-}while(!aresample->req_fullfilled && ret>=0);
+ret = ff_request_frame(ctx->inputs[0]);
 
 // Third if we hit the end flush
 if (ret == AVERROR_EOF) {
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 14/15] lavfi/vf_thumbnail: reindent after last commit.

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_thumbnail.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c
index 64cedd4..417ccd5 100644
--- a/libavfilter/vf_thumbnail.c
+++ b/libavfilter/vf_thumbnail.c
@@ -171,17 +171,16 @@ static int request_frame(AVFilterLink *link)
 {
 AVFilterContext *ctx = link->src;
 ThumbContext *s = ctx->priv;
+int ret = ff_request_frame(ctx->inputs[0]);
 
-/* TODO reindent */
-int ret = ff_request_frame(ctx->inputs[0]);
-if (ret == AVERROR_EOF && s->n) {
-ret = ff_filter_frame(link, get_best_frame(ctx));
-if (ret < 0)
-return ret;
-ret = AVERROR_EOF;
-}
+if (ret == AVERROR_EOF && s->n) {
+ret = ff_filter_frame(link, get_best_frame(ctx));
 if (ret < 0)
 return ret;
+ret = AVERROR_EOF;
+}
+if (ret < 0)
+return ret;
 return 0;
 }
 
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 15/15] lavfi/vf_yadif: reindent after last commit.

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_yadif.c | 28 +---
 1 file changed, 13 insertions(+), 15 deletions(-)

diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c
index c32c065..b546a08 100644
--- a/libavfilter/vf_yadif.c
+++ b/libavfilter/vf_yadif.c
@@ -386,26 +386,24 @@ static int request_frame(AVFilterLink *link)
 return 0;
 }
 
+if (yadif->eof)
+return AVERROR_EOF;
 
-/* TODO reindent */
-if (yadif->eof)
-return AVERROR_EOF;
+ret  = ff_request_frame(link->src->inputs[0]);
 
-ret  = ff_request_frame(link->src->inputs[0]);
+if (ret == AVERROR_EOF && yadif->cur) {
+AVFrame *next = av_frame_clone(yadif->next);
 
-if (ret == AVERROR_EOF && yadif->cur) {
-AVFrame *next = av_frame_clone(yadif->next);
-
-if (!next)
-return AVERROR(ENOMEM);
+if (!next)
+return AVERROR(ENOMEM);
 
-next->pts = yadif->next->pts * 2 - yadif->cur->pts;
+next->pts = yadif->next->pts * 2 - yadif->cur->pts;
 
-filter_frame(link->src->inputs[0], next);
-yadif->eof = 1;
-} else if (ret < 0) {
-return ret;
-}
+filter_frame(link->src->inputs[0], next);
+yadif->eof = 1;
+} else if (ret < 0) {
+return ret;
+}
 
 return 0;
 }
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 13/15] lavfi/vf_w3fdif: reindent after last commit.

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_w3fdif.c | 30 ++
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/libavfilter/vf_w3fdif.c b/libavfilter/vf_w3fdif.c
index e394d55..5b105f1 100644
--- a/libavfilter/vf_w3fdif.c
+++ b/libavfilter/vf_w3fdif.c
@@ -353,25 +353,23 @@ static int request_frame(AVFilterLink *outlink)
 {
 AVFilterContext *ctx = outlink->src;
 W3FDIFContext *s = ctx->priv;
+int ret;
 
-/* TODO reindent */
-int ret;
-
-if (s->eof)
-return AVERROR_EOF;
+if (s->eof)
+return AVERROR_EOF;
 
-ret = ff_request_frame(ctx->inputs[0]);
+ret = ff_request_frame(ctx->inputs[0]);
 
-if (ret == AVERROR_EOF && s->cur) {
-AVFrame *next = av_frame_clone(s->next);
-if (!next)
-return AVERROR(ENOMEM);
-next->pts = s->next->pts * 2 - s->cur->pts;
-filter_frame(ctx->inputs[0], next);
-s->eof = 1;
-} else if (ret < 0) {
-return ret;
-}
+if (ret == AVERROR_EOF && s->cur) {
+AVFrame *next = av_frame_clone(s->next);
+if (!next)
+return AVERROR(ENOMEM);
+next->pts = s->next->pts * 2 - s->cur->pts;
+filter_frame(ctx->inputs[0], next);
+s->eof = 1;
+} else if (ret < 0) {
+return ret;
+}
 
 return 0;
 }
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 02/15] lavfi/avf_showcqt: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/avf_showcqt.c | 9 +
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
index 7089758..e939d8f 100644
--- a/libavfilter/avf_showcqt.c
+++ b/libavfilter/avf_showcqt.c
@@ -75,7 +75,6 @@ typedef struct {
 int spectogram_count;
 int spectogram_index;
 int fft_bits;
-int req_fullfilled;
 int remaining_fill;
 char *tlength;
 char *volume;
@@ -423,7 +422,6 @@ static int config_output(AVFilterLink *outlink)
 outlink->w = video_width;
 outlink->h = video_height;
 
-s->req_fullfilled = 0;
 s->spectogram_index = 0;
 s->frame_count = 0;
 s->spectogram_count = 0;
@@ -649,7 +647,6 @@ static int plot_cqt(AVFilterLink *inlink)
 
 s->outpicref->pts = s->frame_count;
 ret = ff_filter_frame(outlink, av_frame_clone(s->outpicref));
-s->req_fullfilled = 1;
 s->frame_count++;
 }
 s->spectogram_count = (s->spectogram_count + 1) % s->count;
@@ -723,11 +720,7 @@ static int request_frame(AVFilterLink *outlink)
 AVFilterLink *inlink = outlink->src->inputs[0];
 int ret;
 
-s->req_fullfilled = 0;
-do {
-ret = ff_request_frame(inlink);
-} while (!s->req_fullfilled && ret >= 0);
-
+ret = ff_request_frame(inlink);
 if (ret == AVERROR_EOF && s->outpicref)
 filter_frame(inlink, NULL);
 return ret;
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 05/15] lavfi/vf_alphamerge: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/vf_alphamerge.c | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c
index 5f0da35..3c62b59 100644
--- a/libavfilter/vf_alphamerge.c
+++ b/libavfilter/vf_alphamerge.c
@@ -36,7 +36,6 @@
 enum { Y, U, V, A };
 
 typedef struct {
-int frame_requested;
 int is_packed_rgb;
 uint8_t rgba_map[4];
 struct FFBufQueue queue_main;
@@ -146,7 +145,6 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
 main_buf = ff_bufqueue_get(>queue_main);
 alpha_buf = ff_bufqueue_get(>queue_alpha);
 
-merge->frame_requested = 0;
 draw_frame(ctx, main_buf, alpha_buf);
 ret = ff_filter_frame(ctx->outputs[0], main_buf);
 av_frame_free(_buf);
@@ -160,13 +158,11 @@ static int request_frame(AVFilterLink *outlink)
 AlphaMergeContext *merge = ctx->priv;
 int in, ret;
 
-merge->frame_requested = 1;
-while (merge->frame_requested) {
+/* TODO reindent */
 in = ff_bufqueue_peek(>queue_main, 0) ? 1 : 0;
 ret = ff_request_frame(ctx->inputs[in]);
 if (ret < 0)
 return ret;
-}
 return 0;
 }
 
-- 
2.5.3

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


Re: [FFmpeg-devel] [PATCH 1/3] dnxhddec: initialize with mb-aligned dimensions

2015-10-02 Thread Michael Niedermayer
On Thu, Oct 01, 2015 at 11:11:16PM +0200, Christophe Gisquet wrote:
> Hi,
> 
> 2015-10-01 22:34 GMT+02:00 Hendrik Leppkes :
> >> +avctx->coded_width  = FFALIGN(avctx->width, 16);
> >> +avctx->coded_height = FFALIGN(avctx->coded_height, 16);
> >
> > Intentional that this is not ->height, but ->coded_height?
> 
> Huh, yes, and the worse is it was intended to fix coded_height.
> 
> Here's an updated patch.
> 
> -- 
> Christophe

>  dnxhddec.c |3 +++
>  1 file changed, 3 insertions(+)
> eb1fc6c12568d69bc0fd161fc86c5b2acb5ae6b4  
> 0001-dnxhddec-initialize-with-mb-aligned-dimensions.patch
> From c10e86ce4469b81ac66b7fa2dd233efd191f508c Mon Sep 17 00:00:00 2001
> From: Christophe Gisquet 
> Date: Wed, 30 Sep 2015 10:14:59 +0200
> Subject: [PATCH 1/3] dnxhddec: initialize with mb-aligned dimensions
> 
> The coded size is a multiple of the macroblock size, which is 16.

applied

thanks

[...]

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


[FFmpeg-devel] [PATCH 03/15] lavfi/avf_showspectrum: remove looping on request_frame().

2015-10-02 Thread Nicolas George
Signed-off-by: Nicolas George 
---
 libavfilter/avf_showspectrum.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index e29687d..53ba940 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -44,7 +44,6 @@ typedef struct {
 const AVClass *class;
 int w, h;
 AVFrame *outpicref;
-int req_fullfilled;
 int nb_display_channels;
 int channel_height;
 int sliding;///< 1 if sliding mode, 0 otherwise
@@ -268,8 +267,7 @@ static int request_frame(AVFilterLink *outlink)
 unsigned i;
 int ret;
 
-s->req_fullfilled = 0;
-do {
+/* TODO reindent */
 ret = ff_request_frame(inlink);
 if (ret == AVERROR_EOF && s->sliding == FULLFRAME && s->xpos > 0 &&
 s->outpicref) {
@@ -280,9 +278,7 @@ static int request_frame(AVFilterLink *outlink)
 }
 ret = ff_filter_frame(outlink, s->outpicref);
 s->outpicref = NULL;
-s->req_fullfilled = 1;
 }
-} while (!s->req_fullfilled && ret >= 0);
 
 return ret;
 }
@@ -468,7 +464,6 @@ static int plot_spectrum_column(AVFilterLink *inlink, 
AVFrame *insamples)
 if (s->xpos >= outlink->w)
 s->xpos = 0;
 if (s->sliding != FULLFRAME || s->xpos == 0) {
-s->req_fullfilled = 1;
 ret = ff_filter_frame(outlink, av_frame_clone(s->outpicref));
 if (ret < 0)
 return ret;
-- 
2.5.3

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


[FFmpeg-devel] [PATCH] avfilter/vf_blend: add x86 SIMD for some modes

2015-10-02 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/blend.h |  70 ++
 libavfilter/vf_blend.c  | 100 +--
 libavfilter/x86/Makefile|   4 +
 libavfilter/x86/vf_blend.asm| 278 
 libavfilter/x86/vf_blend_init.c |  97 ++
 5 files changed, 478 insertions(+), 71 deletions(-)
 create mode 100644 libavfilter/blend.h
 create mode 100644 libavfilter/x86/vf_blend.asm
 create mode 100644 libavfilter/x86/vf_blend_init.c

diff --git a/libavfilter/blend.h b/libavfilter/blend.h
new file mode 100644
index 000..c22ecd2
--- /dev/null
+++ b/libavfilter/blend.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2013 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/eval.h"
+#include "avfilter.h"
+
+enum BlendMode {
+BLEND_UNSET = -1,
+BLEND_NORMAL,
+BLEND_ADDITION,
+BLEND_AND,
+BLEND_AVERAGE,
+BLEND_BURN,
+BLEND_DARKEN,
+BLEND_DIFFERENCE,
+BLEND_DIFFERENCE128,
+BLEND_DIVIDE,
+BLEND_DODGE,
+BLEND_EXCLUSION,
+BLEND_HARDLIGHT,
+BLEND_LIGHTEN,
+BLEND_MULTIPLY,
+BLEND_NEGATION,
+BLEND_OR,
+BLEND_OVERLAY,
+BLEND_PHOENIX,
+BLEND_PINLIGHT,
+BLEND_REFLECT,
+BLEND_SCREEN,
+BLEND_SOFTLIGHT,
+BLEND_SUBTRACT,
+BLEND_VIVIDLIGHT,
+BLEND_XOR,
+BLEND_HARDMIX,
+BLEND_LINEARLIGHT,
+BLEND_GLOW,
+BLEND_ADDITION128,
+BLEND_NB
+};
+
+typedef struct FilterParams {
+enum BlendMode mode;
+double opacity;
+AVExpr *e;
+char *expr_str;
+void (*blend)(const uint8_t *top, ptrdiff_t top_linesize,
+  const uint8_t *bottom, ptrdiff_t bottom_linesize,
+  uint8_t *dst, ptrdiff_t dst_linesize,
+  int width, int start, int end,
+  struct FilterParams *param, double *values);
+} FilterParams;
+
+void ff_blend_init_x86(FilterParams *param, int is_16bit);
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index f6a649b..b19eb6b 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -28,69 +28,12 @@
 #include "internal.h"
 #include "dualinput.h"
 #include "video.h"
+#include "blend.h"
 
 #define TOP0
 #define BOTTOM 1
 
-enum BlendMode {
-BLEND_UNSET = -1,
-BLEND_NORMAL,
-BLEND_ADDITION,
-BLEND_AND,
-BLEND_AVERAGE,
-BLEND_BURN,
-BLEND_DARKEN,
-BLEND_DIFFERENCE,
-BLEND_DIFFERENCE128,
-BLEND_DIVIDE,
-BLEND_DODGE,
-BLEND_EXCLUSION,
-BLEND_HARDLIGHT,
-BLEND_LIGHTEN,
-BLEND_MULTIPLY,
-BLEND_NEGATION,
-BLEND_OR,
-BLEND_OVERLAY,
-BLEND_PHOENIX,
-BLEND_PINLIGHT,
-BLEND_REFLECT,
-BLEND_SCREEN,
-BLEND_SOFTLIGHT,
-BLEND_SUBTRACT,
-BLEND_VIVIDLIGHT,
-BLEND_XOR,
-BLEND_HARDMIX,
-BLEND_LINEARLIGHT,
-BLEND_GLOW,
-BLEND_ADDITION128,
-BLEND_NB
-};
-
-static const char *const var_names[] = {   "X",   "Y",   "W",   "H",   "SW",   
"SH",   "T",   "N",   "A",   "B",   "TOP",   "BOTTOM",NULL };
-enum   { VAR_X, VAR_Y, VAR_W, VAR_H, VAR_SW, 
VAR_SH, VAR_T, VAR_N, VAR_A, VAR_B, VAR_TOP, VAR_BOTTOM, VAR_VARS_NB };
-
-typedef struct FilterParams {
-enum BlendMode mode;
-double opacity;
-AVExpr *e;
-char *expr_str;
-void (*blend)(const uint8_t *top, int top_linesize,
-  const uint8_t *bottom, int bottom_linesize,
-  uint8_t *dst, int dst_linesize,
-  int width, int start, int end,
-  struct FilterParams *param, double *values);
-} FilterParams;
-
-typedef struct ThreadData {
-const AVFrame *top, *bottom;
-AVFrame *dst;
-AVFilterLink *inlink;
-int plane;
-int w, h;
-FilterParams *param;
-} ThreadData;
-
-typedef struct {
+typedef struct BlendContext {
 const AVClass *class;
 FFDualInputContext dinput;
 int hsub, vsub; ///< chroma subsampling values
@@ -104,6 +47,18 @@ typedef struct {
 AVFrame *prev_frame;/* only used with tblend */
 } BlendContext;
 
+static const char *const var_names[] = {   "X",   "Y",   "W",   "H",   "SW",   
"SH",   "T",   "N",   "A",   "B",   "TOP",   "BOTTOM",NULL };
+enum   

[FFmpeg-devel] [PATCH 4/7] avcodec: use new constants in assembly

2015-10-02 Thread James Darnley
---
 libavcodec/x86/ac3dsp.asm   |  2 +-
 libavcodec/x86/bswapdsp.asm |  3 +--
 libavcodec/x86/diracdsp_yasm.asm|  6 +-
 libavcodec/x86/dwt_yasm.asm |  6 +-
 libavcodec/x86/h263_loopfilter.asm  |  2 +-
 libavcodec/x86/h264_chromamc.asm|  6 +-
 libavcodec/x86/h264_chromamc_10bit.asm  |  8 +---
 libavcodec/x86/h264_deblock.asm |  5 +
 libavcodec/x86/h264_deblock_10bit.asm   |  5 +
 libavcodec/x86/h264_idct.asm|  4 +---
 libavcodec/x86/h264_idct_10bit.asm  |  2 +-
 libavcodec/x86/h264_intrapred.asm   | 10 +-
 libavcodec/x86/h264_intrapred_10bit.asm |  8 +---
 libavcodec/x86/h264_qpel_10bit.asm  |  5 +
 libavcodec/x86/h264_qpel_8bit.asm   |  7 +--
 libavcodec/x86/h264_weight_10bit.asm|  3 +--
 libavcodec/x86/hevc_deblock.asm |  7 +--
 libavcodec/x86/hevc_mc.asm  | 10 +-
 libavcodec/x86/hevc_res_add.asm |  2 +-
 libavcodec/x86/hevc_sao.asm |  3 +--
 libavcodec/x86/hevc_sao_10bit.asm   |  4 +---
 libavcodec/x86/hpeldsp.asm  |  4 +---
 libavcodec/x86/huffyuvdsp.asm   |  2 +-
 libavcodec/x86/idctdsp.asm  |  5 +
 libavcodec/x86/me_cmp.asm   |  6 +-
 libavcodec/x86/mpegvideoencdsp.asm  |  5 +
 libavcodec/x86/pngdsp.asm   |  5 +
 libavcodec/x86/proresdsp.asm|  6 +-
 libavcodec/x86/qpeldsp.asm  |  9 +
 libavcodec/x86/rv40dsp.asm  |  6 +-
 libavcodec/x86/v210enc.asm  |  4 +---
 libavcodec/x86/vc1dsp.asm   |  4 +---
 libavcodec/x86/vp3dsp.asm   |  8 +---
 libavcodec/x86/vp6dsp.asm   |  3 +--
 libavcodec/x86/vp8dsp.asm   |  6 +-
 libavcodec/x86/vp8dsp_loopfilter.asm|  8 +---
 libavcodec/x86/vp9intrapred.asm | 17 +
 libavcodec/x86/vp9itxfm.asm |  9 +
 libavcodec/x86/vp9lpf.asm   |  7 +--
 libavcodec/x86/vp9mc.asm|  4 +---
 libavcodec/x86/vp9mc_16bpp.asm  |  3 +--
 41 files changed, 41 insertions(+), 188 deletions(-)

diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm
index 675ade3..167070f 100644
--- a/libavcodec/x86/ac3dsp.asm
+++ b/libavcodec/x86/ac3dsp.asm
@@ -20,6 +20,7 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
 
@@ -32,7 +33,6 @@ pw_bap_mul1: dw 21846, 21846, 0, 32768, 21846, 21846, 0, 32768
 pw_bap_mul2: dw 5, 7, 0, 7, 5, 7, 0, 7
 
 ; used in ff_ac3_extract_exponents()
-cextern pd_1
 pd_151: times 4 dd 151
 
 ; used in ff_apply_window_int16()
diff --git a/libavcodec/x86/bswapdsp.asm b/libavcodec/x86/bswapdsp.asm
index 56d8083..fc5e04d 100644
--- a/libavcodec/x86/bswapdsp.asm
+++ b/libavcodec/x86/bswapdsp.asm
@@ -22,12 +22,11 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
 pb_bswap32: db 3, 2, 1, 0, 7, 6, 5, 4, 11, 10, 9, 8, 15, 14, 13, 12
 
-cextern pb_80
-
 SECTION .text
 
 ; %1 = aligned/unaligned
diff --git a/libavcodec/x86/diracdsp_yasm.asm b/libavcodec/x86/diracdsp_yasm.asm
index 40fe2c8..d763809 100644
--- a/libavcodec/x86/diracdsp_yasm.asm
+++ b/libavcodec/x86/diracdsp_yasm.asm
@@ -19,15 +19,11 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
 pw_7: times 8 dw 7
 
-cextern pw_3
-cextern pw_16
-cextern pw_32
-cextern pb_80
-
 section .text
 
 %macro UNPACK_ADD 6
diff --git a/libavcodec/x86/dwt_yasm.asm b/libavcodec/x86/dwt_yasm.asm
index 658acc1..9b31a1c 100644
--- a/libavcodec/x86/dwt_yasm.asm
+++ b/libavcodec/x86/dwt_yasm.asm
@@ -20,15 +20,11 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
 pw_1991: times 4 dw 9,-1
 
-cextern pw_1
-cextern pw_2
-cextern pw_8
-cextern pw_16
-
 section .text
 
 ; %1 -= (%2 + %3 + 2)>>2 %4 is pw_2
diff --git a/libavcodec/x86/h263_loopfilter.asm 
b/libavcodec/x86/h263_loopfilter.asm
index 77c8cf1..acee44f 100644
--- a/libavcodec/x86/h263_loopfilter.asm
+++ b/libavcodec/x86/h263_loopfilter.asm
@@ -21,9 +21,9 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
-cextern pb_FC
 cextern h263_loop_filter_strength
 
 SECTION .text
diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm
index 107ae51..57864e8 100644
--- a/libavcodec/x86/h264_chromamc.asm
+++ b/libavcodec/x86/h264_chromamc.asm
@@ -21,6 +21,7 

[FFmpeg-devel] [PATCH 6/7] swscale: use new constants in assembly

2015-10-02 Thread James Darnley
---
 libswscale/x86/Makefile  | 1 +
 libswscale/x86/constants.asm | 1 +
 libswscale/x86/output.asm| 5 +
 tests/ref/fate/source| 1 +
 4 files changed, 4 insertions(+), 4 deletions(-)
 create mode 100644 libswscale/x86/constants.asm

diff --git a/libswscale/x86/Makefile b/libswscale/x86/Makefile
index 6901207..b08a3ff 100644
--- a/libswscale/x86/Makefile
+++ b/libswscale/x86/Makefile
@@ -11,3 +11,4 @@ OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o
 YASM-OBJS   += x86/input.o  \
x86/output.o \
x86/scale.o  \
+   x86/constants.o  \
diff --git a/libswscale/x86/constants.asm b/libswscale/x86/constants.asm
new file mode 100644
index 000..c144c6e
--- /dev/null
+++ b/libswscale/x86/constants.asm
@@ -0,0 +1 @@
+%include "libavutil/x86/constants.asm"
diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm
index 9ea4af9..51e80b0 100644
--- a/libswscale/x86/output.asm
+++ b/libswscale/x86/output.asm
@@ -21,6 +21,7 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
 
@@ -32,10 +33,6 @@ yuv2yuvX_10_upper:  times 8 dw 0x3ff
 yuv2yuvX_9_upper:   times 8 dw 0x1ff
 pd_4:  times 4 dd 4
 pd_4min0x4:times 4 dd 4 - (0x4)
-pw_16: times 8 dw 16
-pw_32: times 8 dw 32
-pw_512:times 8 dw 512
-pw_1024:   times 8 dw 1024
 
 SECTION .text
 
diff --git a/tests/ref/fate/source b/tests/ref/fate/source
index 5bff566..781f4cd 100644
--- a/tests/ref/fate/source
+++ b/tests/ref/fate/source
@@ -16,5 +16,6 @@ libavutil/x86/constants.h
 libavutil/x86_cpu.h
 libswresample/log2_tab.c
 libswscale/log2_tab.c
+libswscale/x86/constants.asm
 tools/uncoded_frame.c
 tools/yuvcmp.c
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 7/7] fixup! avfilter: use new constants in assembly

2015-10-02 Thread James Darnley
---
 tests/ref/fate/source | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tests/ref/fate/source b/tests/ref/fate/source
index 781f4cd..c1383dd 100644
--- a/tests/ref/fate/source
+++ b/tests/ref/fate/source
@@ -9,6 +9,7 @@ libavcodec/reverse.c
 libavcodec/x86/constants.asm
 libavdevice/file_open.c
 libavfilter/log2_tab.c
+libavfilter/x86/constants.asm
 libavformat/file_open.c
 libavformat/golomb_tab.c
 libavformat/log2_tab.c
-- 
2.5.3

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


Re: [FFmpeg-devel] [PATCH 0/7] [RFC] x86 assembly constants

2015-10-02 Thread James Darnley
On 2015-10-02 19:16, Timothy Gu wrote:
> On Fri, Oct 2, 2015 at 10:08 AM James Darnley 
> wrote:
> 
>> The third patch uses them in the remaining inline assembly.
>>
> 
> That's the crux of the problem: inline asm uses these constants, but will
> be unable to without yasm. Either we drop compatibility for inline asm for
> x86 platforms w/o yasm, or we can't do this.

Well these constants only appear to be used 28 times in 2 files.  How
hard can it be?  :)

Even if we don't get it solved for avcodec the principle and this
specific execution for the other libs can be discussed.




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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_blend: add x86 SIMD for some modes

2015-10-02 Thread Henrik Gramner
On Fri, Oct 2, 2015 at 6:57 PM, Paul B Mahol  wrote:
> +INIT_XMM sse2
> +cglobal blend_xor, 9, 10, 2, 0, top, top_linesize, bottom, bottom_linesize, 
> dst, dst_linesize, width, start, end
[...]
> +cglobal blend_or, 9, 10, 2, 0, top, top_linesize, bottom, bottom_linesize, 
> dst, dst_linesize, width, start, end
[...]
> +cglobal blend_and, 9, 10, 2, 0, top, top_linesize, bottom, bottom_linesize, 
> dst, dst_linesize, width, start, end

You could do those using floating point operations (xorps, orps,
andps), then you only need SSE instead of SSE2 (and AVX instead of
AVX2 if you want to make versions using ymm registers).

> +cglobal blend_addition, 9, 10, 3, 0, top, top_linesize, bottom, 
> bottom_linesize, dst, dst_linesize, width, start, end
[...]
> +punpcklbw   m0, m2
> +punpcklbw   m1, m2
> +paddw   m0, m1
> +packuswbm0, m0
> +movh[dstq + x], m0
> +add   r10q, mmsize / 2

paddusb

> +cglobal blend_subtract, 9, 10, 3, 0, top, top_linesize, bottom, 
> bottom_linesize, dst, dst_linesize, width, start, end
[...]
> +punpcklbw   m0, m2
> +punpcklbw   m1, m2
> +psubw   m0, m1
> +packuswbm0, m0

psubusb

> +cglobal blend_darken, 9, 10, 2, 0, top, top_linesize, bottom, 
> bottom_linesize, dst, dst_linesize, width, start, end
[...]
> +movhm0, [topq + x]
> +movhm1, [bottomq + x]
> +pminub  m0, m1
> +movh[dstq + x], m0
[...]
> +cglobal blend_lighten, 9, 10, 2, 0, top, top_linesize, bottom, 
> bottom_linesize, dst, dst_linesize, width, start, end
[...]
> +movhm0, [topq + x]
> +movhm1, [bottomq + x]
> +pmaxub  m0, m1
> +movh[dstq + x], m0

You're only utilizing the lower half the registers here.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avfilter/vf_blend: add x86 SIMD for some modes

2015-10-02 Thread Paul B Mahol
Signed-off-by: Paul B Mahol 
---
 libavfilter/blend.h |  70 ++
 libavfilter/vf_blend.c  | 100 +--
 libavfilter/x86/Makefile|   4 +
 libavfilter/x86/vf_blend.asm| 278 
 libavfilter/x86/vf_blend_init.c |  97 ++
 5 files changed, 478 insertions(+), 71 deletions(-)
 create mode 100644 libavfilter/blend.h
 create mode 100644 libavfilter/x86/vf_blend.asm
 create mode 100644 libavfilter/x86/vf_blend_init.c

diff --git a/libavfilter/blend.h b/libavfilter/blend.h
new file mode 100644
index 000..c22ecd2
--- /dev/null
+++ b/libavfilter/blend.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2013 Paul B Mahol
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with FFmpeg; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "libavutil/eval.h"
+#include "avfilter.h"
+
+enum BlendMode {
+BLEND_UNSET = -1,
+BLEND_NORMAL,
+BLEND_ADDITION,
+BLEND_AND,
+BLEND_AVERAGE,
+BLEND_BURN,
+BLEND_DARKEN,
+BLEND_DIFFERENCE,
+BLEND_DIFFERENCE128,
+BLEND_DIVIDE,
+BLEND_DODGE,
+BLEND_EXCLUSION,
+BLEND_HARDLIGHT,
+BLEND_LIGHTEN,
+BLEND_MULTIPLY,
+BLEND_NEGATION,
+BLEND_OR,
+BLEND_OVERLAY,
+BLEND_PHOENIX,
+BLEND_PINLIGHT,
+BLEND_REFLECT,
+BLEND_SCREEN,
+BLEND_SOFTLIGHT,
+BLEND_SUBTRACT,
+BLEND_VIVIDLIGHT,
+BLEND_XOR,
+BLEND_HARDMIX,
+BLEND_LINEARLIGHT,
+BLEND_GLOW,
+BLEND_ADDITION128,
+BLEND_NB
+};
+
+typedef struct FilterParams {
+enum BlendMode mode;
+double opacity;
+AVExpr *e;
+char *expr_str;
+void (*blend)(const uint8_t *top, ptrdiff_t top_linesize,
+  const uint8_t *bottom, ptrdiff_t bottom_linesize,
+  uint8_t *dst, ptrdiff_t dst_linesize,
+  int width, int start, int end,
+  struct FilterParams *param, double *values);
+} FilterParams;
+
+void ff_blend_init_x86(FilterParams *param, int is_16bit);
diff --git a/libavfilter/vf_blend.c b/libavfilter/vf_blend.c
index f6a649b..b19eb6b 100644
--- a/libavfilter/vf_blend.c
+++ b/libavfilter/vf_blend.c
@@ -28,69 +28,12 @@
 #include "internal.h"
 #include "dualinput.h"
 #include "video.h"
+#include "blend.h"
 
 #define TOP0
 #define BOTTOM 1
 
-enum BlendMode {
-BLEND_UNSET = -1,
-BLEND_NORMAL,
-BLEND_ADDITION,
-BLEND_AND,
-BLEND_AVERAGE,
-BLEND_BURN,
-BLEND_DARKEN,
-BLEND_DIFFERENCE,
-BLEND_DIFFERENCE128,
-BLEND_DIVIDE,
-BLEND_DODGE,
-BLEND_EXCLUSION,
-BLEND_HARDLIGHT,
-BLEND_LIGHTEN,
-BLEND_MULTIPLY,
-BLEND_NEGATION,
-BLEND_OR,
-BLEND_OVERLAY,
-BLEND_PHOENIX,
-BLEND_PINLIGHT,
-BLEND_REFLECT,
-BLEND_SCREEN,
-BLEND_SOFTLIGHT,
-BLEND_SUBTRACT,
-BLEND_VIVIDLIGHT,
-BLEND_XOR,
-BLEND_HARDMIX,
-BLEND_LINEARLIGHT,
-BLEND_GLOW,
-BLEND_ADDITION128,
-BLEND_NB
-};
-
-static const char *const var_names[] = {   "X",   "Y",   "W",   "H",   "SW",   
"SH",   "T",   "N",   "A",   "B",   "TOP",   "BOTTOM",NULL };
-enum   { VAR_X, VAR_Y, VAR_W, VAR_H, VAR_SW, 
VAR_SH, VAR_T, VAR_N, VAR_A, VAR_B, VAR_TOP, VAR_BOTTOM, VAR_VARS_NB };
-
-typedef struct FilterParams {
-enum BlendMode mode;
-double opacity;
-AVExpr *e;
-char *expr_str;
-void (*blend)(const uint8_t *top, int top_linesize,
-  const uint8_t *bottom, int bottom_linesize,
-  uint8_t *dst, int dst_linesize,
-  int width, int start, int end,
-  struct FilterParams *param, double *values);
-} FilterParams;
-
-typedef struct ThreadData {
-const AVFrame *top, *bottom;
-AVFrame *dst;
-AVFilterLink *inlink;
-int plane;
-int w, h;
-FilterParams *param;
-} ThreadData;
-
-typedef struct {
+typedef struct BlendContext {
 const AVClass *class;
 FFDualInputContext dinput;
 int hsub, vsub; ///< chroma subsampling values
@@ -104,6 +47,18 @@ typedef struct {
 AVFrame *prev_frame;/* only used with tblend */
 } BlendContext;
 
+static const char *const var_names[] = {   "X",   "Y",   "W",   "H",   "SW",   
"SH",   "T",   "N",   "A",   "B",   "TOP",   "BOTTOM",NULL };
+enum   

[FFmpeg-devel] [PATCH 1/7] avutil: add shared assembly constants

2015-10-02 Thread James Darnley
---
So here is the test file I was working on with the thoughts I had.
---
; This section is intended to possibly be included in x86inc.asm

; Align all constant to 32 bytes whether they are used in AVX code or not.
%assign constant_align 32

; Value to be used as padding to achieve alignment.  Should not be used except
; when a user fails to define a constant as a multiple of 32 bytes.

; The default behavior of nasm/yasm if to pad with NOPs if you don't specify
; what the padding should be.  Would a non-zero be of value to a user trying to
; debug?  I don't know.
%define constant_align_value db 0

; Might it be better to not force alignment?  Without alignment instructions
; that require alignment will cause a crash in development rather than just
; producing garbage or incorrect results.  Of course that only works if the user
; misaligns a constant they use.  Misalignment might not be caught until running
; unrelated code.

; A macro that imitates what x86inc.asm does for function names but without
; needing to deal with registers and stacks.
; - Mangles the name using the private prefix (ff) and also the prefix char (_)
;   when that is needed.
; - It sets a global label to the correct name.
; - It aligns the data before finally placing the label.
; - Then the user just enters their constant data.
%macro global_constant 1
%xdefine %1 mangle(private_prefix %+ _ %+ %1)
global %1
align constant_align,constant_align_value
%1:
%endmacro

; An alternate but compatible form of the macro which lets the user define the
; constants on the same line.  This form would allow easy sorting.  And it is
; this I used in the patch.
%macro global_constant 1-2+
%xdefine %1 mangle(private_prefix %+ _ %+ %1)
global %1
align constant_align,constant_align_value
%1:
%if %0 == 2
%2
%endif
%endmacro

SECTION_RODATA 32

global_constant pb_1 ; As this constant is 11 bytes lone, 21 bytes with value
times 11 db 1; 0x0 will be inserted before the next constant.

global_constant pb_ff ; This allows two labels to reference the same constant.
global_constant pw_m1
times 32 db 0xff

global_constant pb_2, times 10 db 2 ; Here is the two argument macro.

; A sed-like tool could automatically generate the "header" file from the labels
; defined in the constants file.

---
 libavutil/x86/constants.asm | 92 +
 libavutil/x86/constants.h   | 46 +++
 libavutil/x86/constants.inc | 39 +++
 tests/ref/fate/source   |  1 +
 4 files changed, 178 insertions(+)
 create mode 100644 libavutil/x86/constants.asm
 create mode 100644 libavutil/x86/constants.h
 create mode 100644 libavutil/x86/constants.inc

diff --git a/libavutil/x86/constants.asm b/libavutil/x86/constants.asm
new file mode 100644
index 000..fbdb1a2
--- /dev/null
+++ b/libavutil/x86/constants.asm
@@ -0,0 +1,92 @@
+;* MMX/SSE/AVX constants used across x86 dsp optimizations.
+;*
+;* This file is part of FFmpeg.
+;*
+;* FFmpeg is free software; you can redistribute it and/or
+;* modify it under the terms of the GNU Lesser General Public
+;* License as published by the Free Software Foundation; either
+;* version 2.1 of the License, or (at your option) any later version.
+;*
+;* FFmpeg is distributed in the hope that it will be useful,
+;* but WITHOUT ANY WARRANTY; without even the implied warranty of
+;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+;* Lesser General Public License for more details.
+;*
+;* You should have received a copy of the GNU Lesser General Public
+;* License along with FFmpeg; if not, write to the Free Software
+;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+%include "libavutil/x86/x86util.asm"
+
+; This section is intended to possibly be included in x86inc.asm
+
+; Align all constant to 32 bytes whether they are used in AVX code or not.
+%assign constant_align 32
+
+; Value to be used as padding to achieve alignment.  Should not be used except
+; when a user fails to define a comnstant as a multiple of 32 bytes.
+%define constant_align_value db 0x0
+
+; A macro that imitates what x86inc.asm does for function names but without
+; needing to deal with registers and stacks.
+; - Mangles the name using the private prefix (ff) and also the prefix char (_)
+;   when that is needed.
+; - It sets a global label to the correct name.
+; - It aligns the data before finally placing the label.
+; - Then the user just enters their constant data.
+%macro global_constant 1-2+
+%xdefine %1 mangle(private_prefix %+ _ %+ %1)
+global %1
+align constant_align,constant_align_value
+%1:
+%if %0 == 2
+%2
+%endif
+%endmacro
+
+SECTION_RODATA 32
+
+global_constant pb_0, times 32 db 0
+global_constant pb_1, times 32 db 1
+global_constant pb_2, times 32 db 2
+global_constant pb_3, times 32 db 3
+global_constant pb_15, times 32 db 15
+global_constant pb_80, times 

[FFmpeg-devel] [PATCH 3/7] avcodec: use new constants in C inline assembly

2015-10-02 Thread James Darnley
---
 libavcodec/x86/cavsdsp.c|  2 +-
 libavcodec/x86/constants.h  | 66 -
 libavcodec/x86/inline_asm.h |  2 +-
 libavcodec/x86/vc1dsp_mmx.c |  2 +-
 4 files changed, 3 insertions(+), 69 deletions(-)
 delete mode 100644 libavcodec/x86/constants.h

diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c
index 4b20e65..1fee172 100644
--- a/libavcodec/x86/cavsdsp.c
+++ b/libavcodec/x86/cavsdsp.c
@@ -29,7 +29,7 @@
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/cavsdsp.h"
 #include "libavcodec/idctdsp.h"
-#include "constants.h"
+#include "libavutil/x86/constants.h"
 #include "fpel.h"
 #include "idctdsp.h"
 #include "config.h"
diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h
deleted file mode 100644
index 33dbb65..000
--- a/libavcodec/x86/constants.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * MMX/SSE constants used across x86 dsp optimizations.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_X86_CONSTANTS_H
-#define AVCODEC_X86_CONSTANTS_H
-
-#include 
-
-#include "libavutil/x86/asm.h"
-
-extern const ymm_reg  ff_pw_1;
-extern const ymm_reg  ff_pw_2;
-extern const xmm_reg  ff_pw_3;
-extern const xmm_reg  ff_pw_4;
-extern const xmm_reg  ff_pw_5;
-extern const xmm_reg  ff_pw_8;
-extern const xmm_reg  ff_pw_9;
-extern const uint64_t ff_pw_15;
-extern const xmm_reg  ff_pw_16;
-extern const xmm_reg  ff_pw_18;
-extern const xmm_reg  ff_pw_20;
-extern const xmm_reg  ff_pw_32;
-extern const uint64_t ff_pw_42;
-extern const uint64_t ff_pw_53;
-extern const xmm_reg  ff_pw_64;
-extern const uint64_t ff_pw_96;
-extern const uint64_t ff_pw_128;
-extern const ymm_reg  ff_pw_255;
-extern const ymm_reg  ff_pw_512;
-extern const ymm_reg  ff_pw_1023;
-extern const ymm_reg  ff_pw_1024;
-extern const ymm_reg  ff_pw_2048;
-extern const ymm_reg  ff_pw_4096;
-extern const ymm_reg  ff_pw_8192;
-extern const ymm_reg  ff_pw_m1;
-
-extern const ymm_reg  ff_pb_0;
-extern const ymm_reg  ff_pb_1;
-extern const ymm_reg  ff_pb_2;
-extern const ymm_reg  ff_pb_3;
-extern const xmm_reg  ff_pb_80;
-extern const xmm_reg  ff_pb_FE;
-extern const uint64_t ff_pb_FC;
-
-extern const xmm_reg  ff_ps_neg;
-
-extern const ymm_reg  ff_pd_1;
-
-#endif /* AVCODEC_X86_CONSTANTS_H */
diff --git a/libavcodec/x86/inline_asm.h b/libavcodec/x86/inline_asm.h
index 3e65a76..ab323f3 100644
--- a/libavcodec/x86/inline_asm.h
+++ b/libavcodec/x86/inline_asm.h
@@ -21,7 +21,7 @@
 #ifndef AVCODEC_X86_INLINE_ASM_H
 #define AVCODEC_X86_INLINE_ASM_H
 
-#include "constants.h"
+#include "libavutil/x86/constants.h"
 
 #define MOVQ_WONE(regd) \
 __asm__ volatile ( \
diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c
index a7eb59d..2ec07af 100644
--- a/libavcodec/x86/vc1dsp_mmx.c
+++ b/libavcodec/x86/vc1dsp_mmx.c
@@ -29,7 +29,7 @@
 #include "libavutil/x86/asm.h"
 #include "libavutil/x86/cpu.h"
 #include "libavcodec/vc1dsp.h"
-#include "constants.h"
+#include "libavutil/x86/constants.h"
 #include "fpel.h"
 #include "vc1dsp.h"
 
-- 
2.5.3

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


[FFmpeg-devel] [PATCH 5/7] avfilter: use new constants in assembly

2015-10-02 Thread James Darnley
---
 libavfilter/x86/Makefile   | 2 ++
 libavfilter/x86/af_volume.asm  | 3 +--
 libavfilter/x86/constants.asm  | 1 +
 libavfilter/x86/vf_fspp.asm| 3 +--
 libavfilter/x86/vf_removegrain.asm | 3 +--
 libavfilter/x86/vf_ssim.asm| 2 +-
 libavfilter/x86/vf_yadif.asm   | 6 +-
 libavfilter/x86/yadif-10.asm   | 5 +
 libavfilter/x86/yadif-16.asm   | 3 +--
 9 files changed, 10 insertions(+), 18 deletions(-)
 create mode 100644 libavfilter/x86/constants.asm

diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile
index 5382027..8b33989 100644
--- a/libavfilter/x86/Makefile
+++ b/libavfilter/x86/Makefile
@@ -1,3 +1,5 @@
+YASM-OBJS+= x86/constants.o
+
 OBJS-$(CONFIG_EQ_FILTER) += x86/vf_eq.o
 OBJS-$(CONFIG_FSPP_FILTER)   += x86/vf_fspp_init.o
 OBJS-$(CONFIG_GRADFUN_FILTER)+= x86/vf_gradfun_init.o
diff --git a/libavfilter/x86/af_volume.asm b/libavfilter/x86/af_volume.asm
index 723ab1f..fc5ce83 100644
--- a/libavfilter/x86/af_volume.asm
+++ b/libavfilter/x86/af_volume.asm
@@ -20,13 +20,12 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA 32
 
 pd_1_256: times 4 dq 0x3F70
 pd_int32_max: times 4 dq 0x41DFFFC0
-pw_1: times 8 dw 1
-pw_128:   times 8 dw 128
 pq_128:   times 2 dq 128
 
 SECTION .text
diff --git a/libavfilter/x86/constants.asm b/libavfilter/x86/constants.asm
new file mode 100644
index 000..c144c6e
--- /dev/null
+++ b/libavfilter/x86/constants.asm
@@ -0,0 +1 @@
+%include "libavutil/x86/constants.asm"
diff --git a/libavfilter/x86/vf_fspp.asm b/libavfilter/x86/vf_fspp.asm
index c7f8f64..32cae8e 100644
--- a/libavfilter/x86/vf_fspp.asm
+++ b/libavfilter/x86/vf_fspp.asm
@@ -22,6 +22,7 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
 
@@ -39,8 +40,6 @@ pw_AC62: times 4 dw 0xAC62 ; FIX64(-2.613125930, 13)
 pw_3642: times 4 dw 0x3642 ; FIX64(0.847759065, 14)
 pw_2441: times 4 dw 0x2441 ; FIX64(0.566454497, 14)
 pw_0CBB: times 4 dw 0x0CBB ; FIX64(0.198912367, 14)
-pw_4:times 4 dw 4
-pw_2:times 4 dw 2
 
 SECTION .text
 
diff --git a/libavfilter/x86/vf_removegrain.asm 
b/libavfilter/x86/vf_removegrain.asm
index 0cc6e5f..3bef1c0 100644
--- a/libavfilter/x86/vf_removegrain.asm
+++ b/libavfilter/x86/vf_removegrain.asm
@@ -26,11 +26,10 @@
 ; row +1: a6 a7 a8
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA 32
 
-pw_4:times 16 dw 4
-pw_8:times 16 dw 8
 pw_div9: times 16 dw ((1<<16)+4)/9
 
 SECTION .text
diff --git a/libavfilter/x86/vf_ssim.asm b/libavfilter/x86/vf_ssim.asm
index 3293e66..feecf29 100644
--- a/libavfilter/x86/vf_ssim.asm
+++ b/libavfilter/x86/vf_ssim.asm
@@ -21,10 +21,10 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
 
-pw_1: times 8 dw 1
 ssim_c1: times 4 dd 416 ;(.01*.01*255*255*64 + .5)
 ssim_c2: times 4 dd 235963 ;(.03*.03*255*255*64*63 + .5)
 
diff --git a/libavfilter/x86/vf_yadif.asm b/libavfilter/x86/vf_yadif.asm
index a29620c..9f7eb7f 100644
--- a/libavfilter/x86/vf_yadif.asm
+++ b/libavfilter/x86/vf_yadif.asm
@@ -22,11 +22,7 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pb_1: times 16 db 1
-pw_1: times  8 dw 1
+%include "libavutil/x86/constants.inc"
 
 SECTION .text
 
diff --git a/libavfilter/x86/yadif-10.asm b/libavfilter/x86/yadif-10.asm
index 8853e0d..c53fb0b 100644
--- a/libavfilter/x86/yadif-10.asm
+++ b/libavfilter/x86/yadif-10.asm
@@ -23,10 +23,7 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
-
-SECTION_RODATA
-
-pw_1: times 8 dw 1
+%include "libavutil/x86/constants.inc"
 
 SECTION .text
 
diff --git a/libavfilter/x86/yadif-16.asm b/libavfilter/x86/yadif-16.asm
index 79d127d..d679752 100644
--- a/libavfilter/x86/yadif-16.asm
+++ b/libavfilter/x86/yadif-16.asm
@@ -23,12 +23,11 @@
 ;**
 
 %include "libavutil/x86/x86util.asm"
+%include "libavutil/x86/constants.inc"
 
 SECTION_RODATA
 
-pw_1:times 8 dw 1
 pw_8000: times 8 dw 0x8000
-pd_1:times 4 dd 1
 pd_8000: times 4 dd 0x8000
 
 SECTION .text
-- 
2.5.3

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


Re: [FFmpeg-devel] [PATCH 0/7] [RFC] x86 assembly constants

2015-10-02 Thread Timothy Gu
On Fri, Oct 2, 2015 at 10:08 AM James Darnley 
wrote:

> The third patch uses them in the remaining inline assembly.
>

That's the crux of the problem: inline asm uses these constants, but will
be unable to without yasm. Either we drop compatibility for inline asm for
x86 platforms w/o yasm, or we can't do this.

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


Re: [FFmpeg-devel] [PATCH 2/2] avcodec/videotoolbox: fix decoding of some h264 bitstreams

2015-10-02 Thread wm4
On Thu,  1 Oct 2015 18:13:21 +0200
wm4  wrote:

> This affects Annex B streams (such as demuxed from .ts and others). It
> also handles the format change in reinit-large_420_8-to-small_420_8.h264
> correctly.
> 
> Instead of passing through the extradata, create it on the fly it from
> the currently active SPS and PPS. Since reconstructing the PPS and SPS
> NALs would be very complicated and verbose, we use the NALs as they
> originally appeared in the bitstream.
> 
> The code for writing the extradata is somewhat derived from
> libavformat/avc.c, but it's small and different enough that sharing it
> is not really worth it.
> ---
> Even though it requires changes in the general h264 decoder (previous
> patch), this solution is much cleaner and more robust than my patch
> from yesterday.
> ---
>  libavcodec/videotoolbox.c | 48 
> +--
>  1 file changed, 30 insertions(+), 18 deletions(-)
> 

Both patches applied, with some requested amends (here, IRC) applied.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 2/7] avcodec: replace old C file with new assembly constants

2015-10-02 Thread James Darnley
---
 libavcodec/x86/Makefile  |  2 +-
 libavcodec/x86/constants.asm |  1 +
 libavcodec/x86/constants.c   | 81 
 tests/ref/fate/source|  1 +
 4 files changed, 3 insertions(+), 82 deletions(-)
 create mode 100644 libavcodec/x86/constants.asm
 delete mode 100644 libavcodec/x86/constants.c

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index febaccd..d497d12 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -1,4 +1,4 @@
-OBJS   += x86/constants.o   \
+YASM-OBJS  += x86/constants.o   \
 
 # subsystems
 OBJS-$(CONFIG_AC3DSP)  += x86/ac3dsp_init.o
diff --git a/libavcodec/x86/constants.asm b/libavcodec/x86/constants.asm
new file mode 100644
index 000..c144c6e
--- /dev/null
+++ b/libavcodec/x86/constants.asm
@@ -0,0 +1 @@
+%include "libavutil/x86/constants.asm"
diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c
deleted file mode 100644
index 553dd49..000
--- a/libavcodec/x86/constants.c
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * MMX/SSE/AVX constants used across x86 dsp optimizations.
- *
- * This file is part of FFmpeg.
- *
- * FFmpeg is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * FFmpeg is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "libavutil/mem.h"
-#include "libavutil/x86/asm.h" // for xmm_reg
-#include "constants.h"
-
-DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_1)= { 0x0001000100010001ULL, 
0x0001000100010001ULL,
-0x0001000100010001ULL, 
0x0001000100010001ULL };
-DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_2)= { 0x0002000200020002ULL, 
0x0002000200020002ULL,
-0x0002000200020002ULL, 
0x0002000200020002ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_3)= { 0x0003000300030003ULL, 
0x0003000300030003ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_4)= { 0x0004000400040004ULL, 
0x0004000400040004ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_5)= { 0x0005000500050005ULL, 
0x0005000500050005ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_8)= { 0x0008000800080008ULL, 
0x0008000800080008ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_9)= { 0x0009000900090009ULL, 
0x0009000900090009ULL };
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_15)   =   0x000F000F000F000FULL;
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_16)   = { 0x0010001000100010ULL, 
0x0010001000100010ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_17)   = { 0x0011001100110011ULL, 
0x0011001100110011ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_18)   = { 0x0012001200120012ULL, 
0x0012001200120012ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_20)   = { 0x0014001400140014ULL, 
0x0014001400140014ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_32)   = { 0x0020002000200020ULL, 
0x0020002000200020ULL };
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_42)   =   0x002A002A002A002AULL;
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_53)   =   0x0035003500350035ULL;
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_64)   = { 0x0040004000400040ULL, 
0x0040004000400040ULL };
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_96)   =   0x0060006000600060ULL;
-DECLARE_ALIGNED(8,  const uint64_t, ff_pw_128)  =   0x0080008000800080ULL;
-DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_255)  = { 0x00ff00ff00ff00ffULL, 
0x00ff00ff00ff00ffULL,
-0x00ff00ff00ff00ffULL, 
0x00ff00ff00ff00ffULL };
-DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_256)  = { 0x0100010001000100ULL, 
0x0100010001000100ULL,
-0x0100010001000100ULL, 
0x0100010001000100ULL };
-DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_512)  = { 0x0200020002000200ULL, 
0x0200020002000200ULL,
-0x0200020002000200ULL, 
0x0200020002000200ULL };
-DECLARE_ALIGNED(16, const xmm_reg,  ff_pw_1019) = { 0x03FB03FB03FB03FBULL, 
0x03FB03FB03FB03FBULL };
-DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_1023) = { 0x03ff03ff03ff03ffULL, 
0x03ff03ff03ff03ffULL,
-0x03ff03ff03ff03ffULL, 
0x03ff03ff03ff03ffULL};
-DECLARE_ALIGNED(32, const ymm_reg,  ff_pw_1024) = { 0x0400040004000400ULL, 

Re: [FFmpeg-devel] [PATCH] avformat/flacdec: support fast-seek

2015-10-02 Thread Ching-Yi Chan
Here is a new patch:

1. fix compilation warning
2. remove ff_ prefix on my patch
3. toggle AVFMT_FLAG_FAST_SEEK when no seektalbe in the flac metadata (this
will disable flac_seek when no seekpoint)


0001-avformat-flacdec-support-fast-seek.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avfilter/vf_blend: add x86 SIMD for some modes

2015-10-02 Thread Paul B Mahol
On 10/2/15, Paul B Mahol  wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/blend.h |  70 ++
>  libavfilter/vf_blend.c  | 100 +--
>  libavfilter/x86/Makefile|   4 +
>  libavfilter/x86/vf_blend.asm| 278
> 
>  libavfilter/x86/vf_blend_init.c |  97 ++
>  5 files changed, 478 insertions(+), 71 deletions(-)
>  create mode 100644 libavfilter/blend.h
>  create mode 100644 libavfilter/x86/vf_blend.asm
>  create mode 100644 libavfilter/x86/vf_blend_init.c
>

[..]

> +
> +cglobal blend_darken, 9, 10, 2, 0, top, top_linesize, bottom,
> bottom_linesize, dst, dst_linesize, width, start, end
> +add  topq, widthq
> +add   bottomq, widthq
> +add  dstq, widthq
> +sub  endq, startq
> +negwidthq
> +.nextrow:
> +mov   r10q, widthq
> +%define  x  r10q
> +
> +.loop:
> +movhm0, [topq + x]
> +movhm1, [bottomq + x]
> +pminub  m0, m1
> +movh[dstq + x], m0
> +add   r10q, mmsize / 2

Removed division.

> +jl .loop
> +
> +add  topq, top_linesizeq
> +add   bottomq, bottom_linesizeq
> +add  dstq, dst_linesizeq
> +sub  endd, 1
> +jg .nextrow
> +REP_RET
> +
> +cglobal blend_lighten, 9, 10, 2, 0, top, top_linesize, bottom,
> bottom_linesize, dst, dst_linesize, width, start, end
> +add  topq, widthq
> +add   bottomq, widthq
> +add  dstq, widthq
> +sub  endq, startq
> +negwidthq
> +.nextrow:
> +mov   r10q, widthq
> +%define  x  r10q
> +
> +.loop:
> +movhm0, [topq + x]
> +movhm1, [bottomq + x]
> +pmaxub  m0, m1
> +movh[dstq + x], m0
> +add   r10q, mmsize / 2

Removed division.

> +jl .loop
> +
> +add  topq, top_linesizeq
> +add   bottomq, bottom_linesizeq
> +add  dstq, dst_linesizeq
> +sub  endd, 1
> +jg .nextrow
> +REP_RET
> +
> +%endif

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


[FFmpeg-devel] [PATCH 0/7] [RFC] x86 assembly constants

2015-10-02 Thread James Darnley
So... big patches.

A little history first.  Last time I was writing some assembly it was sugested
that I reuse existing constants in my code.  I would have except that the
suggestion was to use the ones in avcodec but I was working in avfilter.  IIRC
we are not allowed to share data like that across libraries.  At the time I said
that I had an idea about deduplicating the constants.  This is the much delayed
result.

In the first patch I propose a macro for defining global constants.  It ensures
that the name is properly mangled by reusing the macros from the x264asm layer.
It also ensures that they are aligned to 32-byte addresses.  I will annotate a
few comments into that email.

The second patch replaces the old C file and the constants within with these new
assembly ones.

The third patch uses them in the remaining inline assembly.

The following patches adds the constants to avcodec, avfilter, and swscale.  I
briefly checked the other libs for places to use this but didn't find any.

NOTE: I had to make one-line files including the file from avutil because I
couldn't force make to build constants.o across the library boundaries. If
someone can show me how to do that it would eliminate those almost pointless
files.

-- 


James Darnley (7):
  avutil: add shared assembly constants
  avcodec: replace old C file with new assembly constants
  avcodec: use new constants in C inline assembly
  avcodec: use new constants in assembly
  avfilter: use new constants in assembly
  swscale: use new constants in assembly
  fixup! avfilter: use new constants in assembly

 libavcodec/x86/Makefile |  2 +-
 libavcodec/x86/ac3dsp.asm   |  2 +-
 libavcodec/x86/bswapdsp.asm |  3 +-
 libavcodec/x86/cavsdsp.c|  2 +-
 libavcodec/x86/constants.asm|  1 +
 libavcodec/x86/constants.c  | 81 -
 libavcodec/x86/constants.h  | 66 ---
 libavcodec/x86/diracdsp_yasm.asm|  6 +--
 libavcodec/x86/dwt_yasm.asm |  6 +--
 libavcodec/x86/h263_loopfilter.asm  |  2 +-
 libavcodec/x86/h264_chromamc.asm|  6 +--
 libavcodec/x86/h264_chromamc_10bit.asm  |  8 +--
 libavcodec/x86/h264_deblock.asm |  5 +-
 libavcodec/x86/h264_deblock_10bit.asm   |  5 +-
 libavcodec/x86/h264_idct.asm|  4 +-
 libavcodec/x86/h264_idct_10bit.asm  |  2 +-
 libavcodec/x86/h264_intrapred.asm   | 10 +---
 libavcodec/x86/h264_intrapred_10bit.asm |  8 +--
 libavcodec/x86/h264_qpel_10bit.asm  |  5 +-
 libavcodec/x86/h264_qpel_8bit.asm   |  7 +--
 libavcodec/x86/h264_weight_10bit.asm|  3 +-
 libavcodec/x86/hevc_deblock.asm |  7 +--
 libavcodec/x86/hevc_mc.asm  | 10 +---
 libavcodec/x86/hevc_res_add.asm |  2 +-
 libavcodec/x86/hevc_sao.asm |  3 +-
 libavcodec/x86/hevc_sao_10bit.asm   |  4 +-
 libavcodec/x86/hpeldsp.asm  |  4 +-
 libavcodec/x86/huffyuvdsp.asm   |  2 +-
 libavcodec/x86/idctdsp.asm  |  5 +-
 libavcodec/x86/inline_asm.h |  2 +-
 libavcodec/x86/me_cmp.asm   |  6 +--
 libavcodec/x86/mpegvideoencdsp.asm  |  5 +-
 libavcodec/x86/pngdsp.asm   |  5 +-
 libavcodec/x86/proresdsp.asm|  6 +--
 libavcodec/x86/qpeldsp.asm  |  9 +---
 libavcodec/x86/rv40dsp.asm  |  6 +--
 libavcodec/x86/v210enc.asm  |  4 +-
 libavcodec/x86/vc1dsp.asm   |  4 +-
 libavcodec/x86/vc1dsp_mmx.c |  2 +-
 libavcodec/x86/vp3dsp.asm   |  8 +--
 libavcodec/x86/vp6dsp.asm   |  3 +-
 libavcodec/x86/vp8dsp.asm   |  6 +--
 libavcodec/x86/vp8dsp_loopfilter.asm|  8 +--
 libavcodec/x86/vp9intrapred.asm | 17 +-
 libavcodec/x86/vp9itxfm.asm |  9 +---
 libavcodec/x86/vp9lpf.asm   |  7 +--
 libavcodec/x86/vp9mc.asm|  4 +-
 libavcodec/x86/vp9mc_16bpp.asm  |  3 +-
 libavfilter/x86/Makefile|  2 +
 libavfilter/x86/af_volume.asm   |  3 +-
 libavfilter/x86/constants.asm   |  1 +
 libavfilter/x86/vf_fspp.asm |  3 +-
 libavfilter/x86/vf_removegrain.asm  |  3 +-
 libavfilter/x86/vf_ssim.asm |  2 +-
 libavfilter/x86/vf_yadif.asm|  6 +--
 libavfilter/x86/yadif-10.asm|  5 +-
 libavfilter/x86/yadif-16.asm|  3 +-
 libavutil/x86/constants.asm | 92 +
 libavutil/x86/constants.h   | 46 +
 libavutil/x86/constants.inc | 39 ++
 libswscale/x86/Makefile |  1 +
 libswscale/x86/constants.asm|  1 +
 libswscale/x86/output.asm   |  5 +-
 tests/ref/fate/source   |  4 ++
 64 files changed, 240 insertions(+), 361 deletions(-)
 create mode 100644 libavcodec/x86/constants.asm
 delete mode 100644 

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

2015-10-02 Thread Moritz Barsnick
On Fri, Oct 02, 2015 at 19:47:12 +0200, Paul B Mahol wrote:
> fps filter duplicated or removes frames to produce cfr output.
> This filter changes fps and do not remove or duplicate single
> frame so output becomes faster or slower when played when
> fps increase or decrease.

Ah! So, in other words, it takes input frames, totally disregads their
pts/dts, and puts each one into a cfr output stream at the given fps?

That solves a lot of problems and ridiculous math. :-) I will try it.

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


Re: [FFmpeg-devel] [PATCH 09/15] lavfi/vf_w3fdif: remove looping on request_frame().

2015-10-02 Thread Paul B Mahol
On 10/2/15, Nicolas George  wrote:
> Signed-off-by: Nicolas George 
> ---
>  libavfilter/vf_w3fdif.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>

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


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

2015-10-02 Thread Moritz Barsnick
On Tue, Sep 29, 2015 at 23:39:10 +0200, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol 
> ---
>  libavfilter/Makefile |   1 +
>  libavfilter/allfilters.c |   1 +
>  libavfilter/vf_setfps.c  | 119 
> +++
>  3 files changed, 121 insertions(+)
>  create mode 100644 libavfilter/vf_setfps.c

I'd love to comment on this new filter (if nobody else does), but I
don't quite understand the difference to the "fps" filter. I didn't try
*really* hard to wrap my head around it though.

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


Re: [FFmpeg-devel] [PATCH 13/15] lavfi/vf_w3fdif: reindent after last commit.

2015-10-02 Thread Paul B Mahol
On 10/2/15, Nicolas George  wrote:
> Signed-off-by: Nicolas George 
> ---
>  libavfilter/vf_w3fdif.c | 30 ++
>  1 file changed, 14 insertions(+), 16 deletions(-)
>

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


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

2015-10-02 Thread Paul B Mahol
On 10/2/15, Moritz Barsnick  wrote:
> On Tue, Sep 29, 2015 at 23:39:10 +0200, Paul B Mahol wrote:
>> Signed-off-by: Paul B Mahol 
>> ---
>>  libavfilter/Makefile |   1 +
>>  libavfilter/allfilters.c |   1 +
>>  libavfilter/vf_setfps.c  | 119
>> +++
>>  3 files changed, 121 insertions(+)
>>  create mode 100644 libavfilter/vf_setfps.c
>
> I'd love to comment on this new filter (if nobody else does), but I
> don't quite understand the difference to the "fps" filter. I didn't try
> *really* hard to wrap my head around it though.

fps filter duplicated or removes frames to produce cfr output.
This filter changes fps and do not remove or duplicate single
frame so output becomes faster or slower when played when
fps increase or decrease.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 1/5] dnxhd: add decoder support for DNxHR

2015-10-02 Thread Christophe Gisquet
From: Jeremy James 

Signed-off-by: Christophe Gisquet 
---
 libavcodec/dnxhddata.c | 7 +++
 libavcodec/dnxhddec.c  | 5 +++--
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 0cbc57b..e39208d 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -1058,6 +1058,13 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1237_ac_flags,
   dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
   { 80, 90, 100, 110 } },
+{ 1274, 0, 0, 0, 0, 0, 4, 8, 3,
+  dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
+  dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
+  dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
+  dnxhd_1237_ac_flags,
+  dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
+  { 0 } },
 };
 
 int ff_dnxhd_get_cid_table(int cid)
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 296f7f7..1c8660e 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -152,6 +152,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 {
 static const uint8_t header_prefix[]= { 0x00, 0x00, 0x02, 0x80, 0x01 };
 static const uint8_t header_prefix444[] = { 0x00, 0x00, 0x02, 0x80, 0x02 };
+static const uint8_t header_prefixhr[] = { 0x00, 0x00, 0x02, 0x80, 0x03 };
 int i, cid, ret;
 int old_bit_depth = ctx->bit_depth;
 
@@ -161,7 +162,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 return AVERROR_INVALIDDATA;
 }
 
-if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5)) {
+if (memcmp(buf, header_prefix, 5) && memcmp(buf, header_prefix444, 5) && 
memcmp(buf, header_prefixhr, 5)) {
 av_log(ctx->avctx, AV_LOG_ERROR,
"unknown header 0x%02X 0x%02X 0x%02X 0x%02X 0x%02X\n",
buf[0], buf[1], buf[2], buf[3], buf[4]);
@@ -229,7 +230,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 
 // make sure profile size constraints are respected
 // DNx100 allows 1920->1440 and 1280->960 subsampling
-if (ctx->width != ctx->cid_table->width) {
+if (ctx->width != ctx->cid_table->width && ctx->cid_table->width != 0) {
 av_reduce(>avctx->sample_aspect_ratio.num,
   >avctx->sample_aspect_ratio.den,
   ctx->width, ctx->cid_table->width, 255);
-- 
2.5.2

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


[FFmpeg-devel] [PATCH] dnxhdenc: fix usage of discording scans

2015-10-02 Thread Christophe Gisquet
Forward and inverse DCTs may not have the same permutation table,
resulting in a bitstream where the AC coefficients are encoded in
an unexpected order.
---
 libavcodec/dnxhdenc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 7d96cd4..adfdbf3 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -471,7 +471,7 @@ void dnxhd_encode_block(DNXHDEncContext *ctx, int16_t 
*block,
 ctx->m.last_dc[n] = block[0];
 
 for (i = 1; i <= last_index; i++) {
-j = ctx->m.intra_scantable.permutated[i];
+j = ctx->m.intra_scantable.scantable[i];
 slevel = block[j];
 if (slevel) {
 int run_level = i - last_non_zero - 1;
@@ -498,7 +498,7 @@ void dnxhd_unquantize_c(DNXHDEncContext *ctx, int16_t 
*block, int n,
 : ctx->cid_table->luma_weight;
 
 for (i = 1; i <= last_index; i++) {
-int j = ctx->m.intra_scantable.permutated[i];
+int j = ctx->m.intra_scantable.scantable[i];
 level = block[j];
 if (level) {
 if (level < 0) {
@@ -546,7 +546,7 @@ int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, int16_t 
*block, int last_index)
 int bits = 0;
 int i, j, level;
 for (i = 1; i <= last_index; i++) {
-j = ctx->m.intra_scantable.permutated[i];
+j = ctx->m.intra_scantable.scantable[i];
 level = block[j];
 if (level) {
 int run_level = i - last_non_zero - 1;
-- 
2.5.2

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


[FFmpeg-devel] [PATCH 0/5] Initial support for DNxHR

2015-10-02 Thread Christophe Gisquet
CIDs 1270 (10 & 12bits) to 1274, as produced by Avid Media Composer,
have been tested. I merged and adapted a bit Jeremy's work (but it's
mostly his code), hence the signing-off.

Christophe Gisquet (3):
  isom: add support for DNxHR codec family
  dnxhd: add CID 1270
  dnxhddec: replace some 0s by DNXHD_VARIABLE

Jeremy James (2):
  dnxhd: add decoder support for DNxHR
  dnxhd: add better support for CIDs 1270 to 1274

 libavcodec/dnxhddata.c |  89 ++
 libavcodec/dnxhddata.h |   3 +
 libavcodec/dnxhddec.c  | 146 +
 libavformat/isom.c |   1 +
 4 files changed, 169 insertions(+), 70 deletions(-)

-- 
2.5.2

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


[FFmpeg-devel] [PATCH 5/5] dnxhddec: replace some 0s by DNXHD_VARIABLE

2015-10-02 Thread Christophe Gisquet
A series of 0 in a table can be confusing, and the corresponding checks
strange, so using a macro instead of that magic is more readable.
---
 libavcodec/dnxhddata.c | 10 +-
 libavcodec/dnxhddata.h |  3 +++
 libavcodec/dnxhddec.c  |  6 --
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index 32e10ab..b97b19f 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -1064,35 +1064,35 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1237_ac_flags,
   dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
   { 80, 90, 100, 110 } },
-{ 1270, 0, 0, 0, 0, 0, 6, 0, 4,
+{ 1270, DNXHD_VARIABLE, DNXHD_VARIABLE, 0, DNXHD_VARIABLE, DNXHD_VARIABLE, 
6, DNXHD_VARIABLE, 4,
   dnxhd_1235_luma_weight, dnxhd_1235_luma_weight,
   dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
   dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
   dnxhd_1235_ac_flags,
   dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
   { 0 } },
-{ 1271, 0, 0, 0, 0, 0, 6, 0, 4,
+{ 1271, DNXHD_VARIABLE, DNXHD_VARIABLE, 0, DNXHD_VARIABLE, DNXHD_VARIABLE, 
6, DNXHD_VARIABLE, 4,
   dnxhd_1241_luma_weight, dnxhd_1241_chroma_weight,
   dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
   dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
   dnxhd_1235_ac_flags,
   dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
   { 0 } },
-{ 1272, 0, 0, 0, 0, 0, 4, 8, 4,
+{ 1272, DNXHD_VARIABLE, DNXHD_VARIABLE, 0, DNXHD_VARIABLE, DNXHD_VARIABLE, 
4, 8, 4,
   dnxhd_1238_luma_weight, dnxhd_1238_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1238_ac_codes, dnxhd_1238_ac_bits, dnxhd_1238_ac_level,
   dnxhd_1238_ac_flags,
   dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1238_run,
   { 0 } },
-{ 1273, 0, 0, 0, 0, 0, 4, 8, 3,
+{ 1273, DNXHD_VARIABLE, DNXHD_VARIABLE, 0, DNXHD_VARIABLE, DNXHD_VARIABLE, 
4, 8, 3,
   dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
   dnxhd_1237_ac_flags,
   dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
   { 0 } },
-{ 1274, 0, 0, 0, 0, 0, 4, 8, 3,
+{ 1274, DNXHD_VARIABLE, DNXHD_VARIABLE, 0, DNXHD_VARIABLE, DNXHD_VARIABLE, 
4, 8, 3,
   dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
   dnxhd_1237_ac_codes, dnxhd_1237_ac_bits, dnxhd_1237_ac_level,
diff --git a/libavcodec/dnxhddata.h b/libavcodec/dnxhddata.h
index 8cc27e8..62926ce 100644
--- a/libavcodec/dnxhddata.h
+++ b/libavcodec/dnxhddata.h
@@ -26,6 +26,9 @@
 #include "avcodec.h"
 #include "libavutil/internal.h"
 
+/** Indicate that a CIDEntry value must be read in the bitstream */
+#define DNXHD_VARIABLE 0
+
 typedef struct CIDEntry {
 int cid;
 unsigned int width, height;
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 8cd4db9..9bbbd84 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -111,7 +111,8 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, uint32_t cid)
 av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
 return AVERROR(ENOSYS);
 }
-if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth && 
ff_dnxhd_cid_table[index].bit_depth != 0) {
+if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth &&
+ff_dnxhd_cid_table[index].bit_depth != DNXHD_VARIABLE) {
 av_log(ctx->avctx, AV_LOG_ERROR, "bit depth mismatches %d %d\n", 
ff_dnxhd_cid_table[index].bit_depth, ctx->bit_depth);
 return AVERROR_INVALIDDATA;
 }
@@ -245,7 +246,8 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 
 // make sure profile size constraints are respected
 // DNx100 allows 1920->1440 and 1280->960 subsampling
-if (ctx->width != ctx->cid_table->width && ctx->cid_table->width != 0) {
+if (ctx->width != ctx->cid_table->width &&
+ctx->cid_table->width != DNXHD_VARIABLE) {
 av_reduce(>avctx->sample_aspect_ratio.num,
   >avctx->sample_aspect_ratio.den,
   ctx->width, ctx->cid_table->width, 255);
-- 
2.5.2

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


Re: [FFmpeg-devel] [PATCH] avfilter/vf_blend: add x86 SIMD for some modes

2015-10-02 Thread Paul B Mahol
On 10/2/15, Henrik Gramner  wrote:
> On Fri, Oct 2, 2015 at 6:57 PM, Paul B Mahol  wrote:
>> +INIT_XMM sse2
>> +cglobal blend_xor, 9, 10, 2, 0, top, top_linesize, bottom,
>> bottom_linesize, dst, dst_linesize, width, start, end
> [...]
>> +cglobal blend_or, 9, 10, 2, 0, top, top_linesize, bottom,
>> bottom_linesize, dst, dst_linesize, width, start, end
> [...]
>> +cglobal blend_and, 9, 10, 2, 0, top, top_linesize, bottom,
>> bottom_linesize, dst, dst_linesize, width, start, end
>
> You could do those using floating point operations (xorps, orps,
> andps), then you only need SSE instead of SSE2 (and AVX instead of
> AVX2 if you want to make versions using ymm registers).
>
>> +cglobal blend_addition, 9, 10, 3, 0, top, top_linesize, bottom,
>> bottom_linesize, dst, dst_linesize, width, start, end
> [...]
>> +punpcklbw   m0, m2
>> +punpcklbw   m1, m2
>> +paddw   m0, m1
>> +packuswbm0, m0
>> +movh[dstq + x], m0
>> +add   r10q, mmsize / 2
>
> paddusb
>

fixed locally.

>> +cglobal blend_subtract, 9, 10, 3, 0, top, top_linesize, bottom,
>> bottom_linesize, dst, dst_linesize, width, start, end
> [...]
>> +punpcklbw   m0, m2
>> +punpcklbw   m1, m2
>> +psubw   m0, m1
>> +packuswbm0, m0
>
> psubusb

fixed locally.

>
>> +cglobal blend_darken, 9, 10, 2, 0, top, top_linesize, bottom,
>> bottom_linesize, dst, dst_linesize, width, start, end
> [...]
>> +movhm0, [topq + x]
>> +movhm1, [bottomq + x]
>> +pminub  m0, m1
>> +movh[dstq + x], m0
> [...]
>> +cglobal blend_lighten, 9, 10, 2, 0, top, top_linesize, bottom,
>> bottom_linesize, dst, dst_linesize, width, start, end
> [...]
>> +movhm0, [topq + x]
>> +movhm1, [bottomq + x]
>> +pmaxub  m0, m1
>> +movh[dstq + x], m0
>
> You're only utilizing the lower half the registers here.

fixed locally.

> ___
> 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


[FFmpeg-devel] [PATCH] avcodec/h264_ps: Fix copying oversized pps data

2015-10-02 Thread Michael Niedermayer
From: Michael Niedermayer 

Fixes: https://trac.ffmpeg.org/attachment/ticket/685/movie.264

In the available testcase the actual PPS only uses a few bits
while there are 7kbyte of apparently random data after it

Signed-off-by: Michael Niedermayer 
---
 libavcodec/h264_ps.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index fd16a95..0dca5f0 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -611,8 +611,8 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, 
int bit_length)
 return AVERROR(ENOMEM);
 pps->data_size = h->gb.buffer_end - h->gb.buffer;
 if (pps->data_size > sizeof(pps->data)) {
-ret = AVERROR_INVALIDDATA;
-goto fail;
+av_log(h->avctx, AV_LOG_WARNING, "Truncating likely oversized PPS\n");
+pps->data_size = sizeof(pps->data);
 }
 memcpy(pps->data, h->gb.buffer, pps->data_size);
 pps->sps_id = get_ue_golomb_31(>gb);
-- 
1.7.9.5

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


Re: [FFmpeg-devel] [PATCH] avcodec/h264_ps: Fix copying oversized pps data

2015-10-02 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 09:23:04PM +0200, wm4 wrote:
> On Fri,  2 Oct 2015 21:14:57 +0200
> Michael Niedermayer  wrote:
> 
> > From: Michael Niedermayer 
> > 
> > Fixes: https://trac.ffmpeg.org/attachment/ticket/685/movie.264
> > 
> > In the available testcase the actual PPS only uses a few bits
> > while there are 7kbyte of apparently random data after it
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavcodec/h264_ps.c |4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
> > index fd16a95..0dca5f0 100644
> > --- a/libavcodec/h264_ps.c
> > +++ b/libavcodec/h264_ps.c
> > @@ -611,8 +611,8 @@ int ff_h264_decode_picture_parameter_set(H264Context 
> > *h, int bit_length)
> >  return AVERROR(ENOMEM);
> >  pps->data_size = h->gb.buffer_end - h->gb.buffer;
> >  if (pps->data_size > sizeof(pps->data)) {
> > -ret = AVERROR_INVALIDDATA;
> > -goto fail;
> > +av_log(h->avctx, AV_LOG_WARNING, "Truncating likely oversized 
> > PPS\n");
> > +pps->data_size = sizeof(pps->data);
> >  }
> >  memcpy(pps->data, h->gb.buffer, pps->data_size);
> >  pps->sps_id = get_ue_golomb_31(>gb);
> 
> That was quick.
> 

> Should the same be done for SPS?

i dont know

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

What does censorship reveal? It reveals fear. -- Julian Assange


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


[FFmpeg-devel] [PATCH] avcodec: remove old vdpau decoder implementation

2015-10-02 Thread wm4
This is all duplicated functionality with the vdpau hwaccel API, which
was introduced almost 3 years ago.

API users had time enough to switch to the new API. But note that the
API stubs are kept, and old programs will still compile against modern
libavcodec.
---
 configure |  11 --
 libavcodec/allcodecs.c|  16 --
 libavcodec/error_resilience.c |   3 -
 libavcodec/h263dec.c  |   8 -
 libavcodec/h264.c |  43 +-
 libavcodec/h264_picture.c |  13 --
 libavcodec/h264_slice.c   |  23 +--
 libavcodec/mpeg12dec.c|  64 +---
 libavcodec/mpeg4videodec.c|  26 
 libavcodec/mpegpicture.c  |   6 +-
 libavcodec/mpegvideo.c|  13 +-
 libavcodec/utils.c|   4 -
 libavcodec/vc1dec.c   |  71 +
 libavcodec/vdpau.c| 340 --
 libavcodec/vdpau_compat.h |  48 --
 15 files changed, 10 insertions(+), 679 deletions(-)
 delete mode 100644 libavcodec/vdpau_compat.h

diff --git a/configure b/configure
index 552f698..b23baf6 100755
--- a/configure
+++ b/configure
@@ -2422,8 +2422,6 @@ h264_vda_hwaccel_deps="vda"
 h264_vda_hwaccel_select="h264_decoder"
 h264_vda_old_hwaccel_deps="vda"
 h264_vda_old_hwaccel_select="h264_decoder"
-h264_vdpau_decoder_deps="vdpau"
-h264_vdpau_decoder_select="h264_decoder"
 h264_vdpau_hwaccel_deps="vdpau"
 h264_vdpau_hwaccel_select="h264_decoder"
 h264_videotoolbox_hwaccel_deps="videotoolbox"
@@ -2437,12 +2435,8 @@ hevc_vaapi_hwaccel_deps="vaapi 
VAPictureParameterBufferHEVC"
 hevc_vaapi_hwaccel_select="hevc_decoder"
 hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
 hevc_vdpau_hwaccel_select="hevc_decoder"
-mpeg_vdpau_decoder_deps="vdpau"
-mpeg_vdpau_decoder_select="mpeg2video_decoder"
 mpeg_xvmc_hwaccel_deps="xvmc"
 mpeg_xvmc_hwaccel_select="mpeg2video_decoder"
-mpeg1_vdpau_decoder_deps="vdpau"
-mpeg1_vdpau_decoder_select="mpeg1video_decoder"
 mpeg1_vdpau_hwaccel_deps="vdpau"
 mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
 mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
@@ -2467,8 +2461,6 @@ mpeg2_xvmc_hwaccel_select="mpeg2video_decoder"
 mpeg4_crystalhd_decoder_select="crystalhd"
 mpeg4_vaapi_hwaccel_deps="vaapi"
 mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
-mpeg4_vdpau_decoder_deps="vdpau"
-mpeg4_vdpau_decoder_select="mpeg4_decoder"
 mpeg4_vdpau_hwaccel_deps="vdpau"
 mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
 mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
@@ -2481,8 +2473,6 @@ vc1_dxva2_hwaccel_deps="dxva2"
 vc1_dxva2_hwaccel_select="vc1_decoder"
 vc1_vaapi_hwaccel_deps="vaapi"
 vc1_vaapi_hwaccel_select="vc1_decoder"
-vc1_vdpau_decoder_deps="vdpau"
-vc1_vdpau_decoder_select="vc1_decoder"
 vc1_vdpau_hwaccel_deps="vdpau"
 vc1_vdpau_hwaccel_select="vc1_decoder"
 vc1_qsv_hwaccel_deps="libmfx"
@@ -2491,7 +2481,6 @@ wmv3_crystalhd_decoder_select="crystalhd"
 wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
 wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
 wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
-wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
 wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
 
 # parsers
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index f33e457..21fa589 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -192,9 +192,6 @@ void avcodec_register_all(void)
 REGISTER_DECODER(H264_MMAL, h264_mmal);
 REGISTER_DECODER(H264_QSV,  h264_qsv);
 REGISTER_DECODER(H264_VDA,  h264_vda);
-#if FF_API_VDPAU
-REGISTER_DECODER(H264_VDPAU,h264_vdpau);
-#endif
 REGISTER_ENCDEC (HAP,   hap);
 REGISTER_DECODER(HEVC,  hevc);
 REGISTER_DECODER(HEVC_QSV,  hevc_qsv);
@@ -231,14 +228,7 @@ void avcodec_register_all(void)
 REGISTER_ENCDEC (MPEG2VIDEO,mpeg2video);
 REGISTER_ENCDEC (MPEG4, mpeg4);
 REGISTER_DECODER(MPEG4_CRYSTALHD,   mpeg4_crystalhd);
-#if FF_API_VDPAU
-REGISTER_DECODER(MPEG4_VDPAU,   mpeg4_vdpau);
-#endif
 REGISTER_DECODER(MPEGVIDEO, mpegvideo);
-#if FF_API_VDPAU
-REGISTER_DECODER(MPEG_VDPAU,mpeg_vdpau);
-REGISTER_DECODER(MPEG1_VDPAU,   mpeg1_vdpau);
-#endif
 REGISTER_DECODER(MPEG2_CRYSTALHD,   mpeg2_crystalhd);
 REGISTER_DECODER(MPEG2_QSV, mpeg2_qsv);
 REGISTER_DECODER(MSA1,  msa1);
@@ -319,9 +309,6 @@ void avcodec_register_all(void)
 REGISTER_DECODER(VBLE,  vble);
 REGISTER_DECODER(VC1,   vc1);
 REGISTER_DECODER(VC1_CRYSTALHD, vc1_crystalhd);
-#if FF_API_VDPAU
-REGISTER_DECODER(VC1_VDPAU, vc1_vdpau);
-#endif
 REGISTER_DECODER(VC1IMAGE,  vc1image);
 REGISTER_DECODER(VC1_QSV,   vc1_qsv);
 REGISTER_DECODER(VCR1,  vcr1);
@@ -341,9 +328,6 @@ void avcodec_register_all(void)
 REGISTER_ENCDEC (WMV2,  wmv2);
 REGISTER_DECODER(WMV3,  wmv3);
 REGISTER_DECODER(WMV3_CRYSTALHD,

[FFmpeg-devel] [PATCH 3/5] dnxhd: add CID 1270

2015-10-02 Thread Christophe Gisquet
This a 4:4:4 10 bits profile, where image size is not fixed by the
profile, and which strays a bit outside the old frame header parsing
code.

Fixes ticket #4581 (DNxHR is not stricly supported, but that sequence is).
---
 libavcodec/dnxhddata.c | 23 +
 libavcodec/dnxhddec.c  | 56 +-
 2 files changed, 43 insertions(+), 36 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index e39208d..afe6705 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -25,7 +25,7 @@
 
 /* The quantization tables below are in zigzag order! */
 
-/* Used in CID 1235, 1256 */
+/* Used in CID 1235, 1256, 1270 */
 static const uint8_t dnxhd_1235_luma_weight[] = {
  0, 32, 32, 32, 33, 32, 32, 32,
 32, 31, 32, 33, 33, 33, 33, 35,
@@ -250,12 +250,12 @@ static const uint8_t dnxhd_1260_chroma_weight[] = {
 56, 56, 53, 53, 53, 54, 58, 58,
 };
 
-/* Used in CID 1235, 1241, 1250, 1256 */
+/* Used in CID 1235, 1236, 1241, 1250, 1256, 1257, 1270, 1271 */
 static const uint8_t dnxhd_1235_dc_codes[14] = {
 10, 62, 11, 12, 13, 0, 1, 2, 3, 4, 14, 30, 126, 127,
 };
 
-/* Used in CID 1235, 1241, 1250, 1256 */
+/* Used in CID 1235, 1236, 1241, 1250, 1256, 1257, 1270, 1271 */
 static const uint8_t dnxhd_1235_dc_bits[14] = {
 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7,
 };
@@ -370,7 +370,7 @@ static const uint8_t dnxhd_1237_ac_flags[257] = {
 3,
 };
 
-/* Used in CID 1238, 1243 */
+/* Used in CID 1238, 1240, 1243, 1272 */
 static const uint16_t dnxhd_1238_ac_codes[257] = {
 0, 1, 4,10,11,24,25,26,
54,55,56,57,   116,   117,   118,   119,
@@ -407,7 +407,7 @@ static const uint16_t dnxhd_1238_ac_codes[257] = {
 65535,
 };
 
-/* Used in CID 1238, 1243 */
+/* Used in CID 1238, 1240, 1243, 1272 */
 static const uint8_t dnxhd_1238_ac_bits[257] = {
  2,  2,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,
  8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9,  9, 10, 10,
@@ -428,7 +428,7 @@ static const uint8_t dnxhd_1238_ac_bits[257] = {
 16,
 };
 
-/* Used in CID 1238, 1243 */
+/* Used in CID 1238, 1240, 1243, 1272 */
 static const uint8_t dnxhd_1238_ac_level[257] = {
   3,  3,  5,  7,  0,  9, 11,  5, 13, 15, 17,  7, 19, 21, 23,  9,
  25, 27, 29, 31, 33, 11, 35, 37, 39, 41, 43, 45, 13, 15, 47, 49,
@@ -469,7 +469,7 @@ static const uint8_t dnxhd_1238_ac_flags[257] = {
 3,
 };
 
-/* Used in CID 1235, 1241, 1256 */
+/* Used in CID 1235, 1236, 1241, 1256, 1257, 1270, 1271 */
 static const uint16_t dnxhd_1235_ac_codes[257] = {
 0, 1, 4,10,11,24,25,26,
54,55,56,57,   116,   117,   118,   119,
@@ -506,7 +506,7 @@ static const uint16_t dnxhd_1235_ac_codes[257] = {
 65535,
 };
 
-/* Used in CID 1235, 1241, 1256 */
+/* Used in CID 1235, 1236, 1241, 1256, 1257, 1270, 1271 */
 static const uint8_t dnxhd_1235_ac_bits[257] = {
  2,  2,  3,  4,  4,  5,  5,  5,  6,  6,  6,  6,  7,  7,  7,  7,
  8,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9,  9,  9, 10, 10, 10,
@@ -1058,6 +1058,13 @@ const CIDEntry ff_dnxhd_cid_table[] = {
   dnxhd_1237_ac_flags,
   dnxhd_1237_run_codes, dnxhd_1237_run_bits, dnxhd_1237_run,
   { 80, 90, 100, 110 } },
+{ 1270, 0, 0, 0, 0, 0, 6, 10, 4,
+  dnxhd_1235_luma_weight, dnxhd_1235_luma_weight,
+  dnxhd_1235_dc_codes, dnxhd_1235_dc_bits,
+  dnxhd_1235_ac_codes, dnxhd_1235_ac_bits, dnxhd_1235_ac_level,
+  dnxhd_1235_ac_flags,
+  dnxhd_1235_run_codes, dnxhd_1235_run_bits, dnxhd_1235_run,
+  { 0 } },
 { 1274, 0, 0, 0, 0, 0, 4, 8, 3,
   dnxhd_1237_luma_weight, dnxhd_1237_chroma_weight,
   dnxhd_1237_dc_codes, dnxhd_1237_dc_bits,
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 1c8660e..b744e71 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -177,35 +177,35 @@ static int dnxhd_decode_header(DNXHDContext *ctx, AVFrame 
*frame,
 } else {
 ctx->cur_field = 0;
 }
-ctx->mbaff = buf[0x6] & 32;
+ctx->mbaff = (buf[0x6] >> 5) & 1;
 
 ctx->height = AV_RB16(buf + 0x18);
 ctx->width  = AV_RB16(buf + 0x1a);
 
-ff_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
-
-if (buf[0x21] == 0x58) { /* 10 bit */
-ctx->bit_depth = ctx->avctx->bits_per_raw_sample = 10;
+switch(buf[0x21] >> 5) {
+case 1: ctx->bit_depth = 8; break;
+case 2: ctx->bit_depth = 10; break;
+default:
+av_log(ctx->avctx, AV_LOG_ERROR,
+   "Unknown bitdepth indicator (%d)\n", buf[0x21] >> 5);
+return AVERROR_INVALIDDATA;
+}
+ctx->avctx->bits_per_raw_sample = ctx->bit_depth;
 
-if (buf[0x4] == 0x2) {
-ctx->decode_dct_block = dnxhd_decode_dct_block_10_444;
-ctx->pix_fmt = AV_PIX_FMT_YUV444P10;
-ctx->is_444 = 1;
-} else {
-ctx->decode_dct_block = 

[FFmpeg-devel] [PATCH 4/5] dnxhd: add better support for CIDs 1270 to 1274

2015-10-02 Thread Christophe Gisquet
From: Jeremy James 

These are DNxHR profiles with the following properties:
- Variable size in a profile, requiring variable-sized macroblock table
- Variable bitdepth, up to 12 bits

Signed-off-by: Christophe Gisquet 
---
 libavcodec/dnxhddata.c | 61 ++-
 libavcodec/dnxhddec.c  | 97 ++
 2 files changed, 118 insertions(+), 40 deletions(-)

diff --git a/libavcodec/dnxhddata.c b/libavcodec/dnxhddata.c
index afe6705..32e10ab 100644
--- a/libavcodec/dnxhddata.c
+++ b/libavcodec/dnxhddata.c
@@ -48,7 +48,7 @@ static const uint8_t dnxhd_1235_chroma_weight[] = {
 90, 90, 85, 79, 73, 73, 73, 73,
 };
 
-/* Used in CID 1237, 1253, 1259 */
+/* Used in CID 1237, 1253, 1259, 1273, 1274 */
 static const uint8_t dnxhd_1237_luma_weight[] = {
  0,  32,  33,  34, 34, 36, 37, 36,
 36,  37,  38,  38, 38, 39, 41, 44,
@@ -60,7 +60,7 @@ static const uint8_t dnxhd_1237_luma_weight[] = {
 97, 100, 104, 102, 98, 98, 99, 99,
 };
 
-/* Used in CID 1237, 1253, 1259 */
+/* Used in CID 1237, 1253, 1259, 1273, 1274 */
 static const uint8_t dnxhd_1237_chroma_weight[] = {
  0,  32,  36,  39, 39, 38, 39,  41,
 45,  51,  57,  58, 53, 48, 47,  51,
@@ -72,6 +72,7 @@ static const uint8_t dnxhd_1237_chroma_weight[] = {
 97, 100, 104, 102, 98, 98, 99,  99,
 };
 
+/* Used in CID 1238, 1272 */
 static const uint8_t dnxhd_1238_luma_weight[] = {
  0, 32, 32, 33, 34, 33, 33, 33,
 33, 33, 33, 33, 33, 35, 37, 37,
@@ -83,6 +84,7 @@ static const uint8_t dnxhd_1238_luma_weight[] = {
 51, 53, 55, 57, 58, 59, 57, 57,
 };
 
+/* Used in CID 1238, 1272 */
 static const uint8_t dnxhd_1238_chroma_weight[] = {
  0, 32, 35, 35, 35, 34, 34, 35,
 39, 43, 45, 45, 41, 39, 40, 41,
@@ -94,6 +96,7 @@ static const uint8_t dnxhd_1238_chroma_weight[] = {
 82, 77, 80, 86, 84, 82, 82, 82,
 };
 
+/* Used in CID 1241, 1271 */
 static const uint8_t dnxhd_1241_luma_weight[] = {
  0, 32, 33, 34, 34, 35, 36, 37,
 36, 37, 38, 38, 38, 39, 39, 40,
@@ -105,6 +108,7 @@ static const uint8_t dnxhd_1241_luma_weight[] = {
 48, 46, 47, 48, 48, 49, 49, 49,
 };
 
+/* Used in CID 1241, 1271 */
 static const uint8_t dnxhd_1241_chroma_weight[] = {
  0, 32, 36, 38, 37, 37, 40, 41,
 40, 40, 42, 42, 41, 41, 41, 41,
@@ -260,17 +264,17 @@ static const uint8_t dnxhd_1235_dc_bits[14] = {
 4, 6, 4, 4, 4, 3, 3, 3, 3, 3, 4, 5, 7, 7,
 };
 
-/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260 */
+/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260, 
1272, 1273, 1274 */
 static const uint8_t dnxhd_1237_dc_codes[12] = {
 0, 12, 13, 1, 2, 3, 4, 5, 14, 30, 62, 63,
 };
 
-/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260 */
+/* Used in CID 1237, 1238, 1242, 1243, 1251, 1252, 1253, 1258, 1259, 1260, 
1272, 1273, 1274 */
 static const uint8_t dnxhd_1237_dc_bits[12] = {
 3, 4, 4, 3, 3, 3, 3, 3, 4, 5, 6, 6,
 };
 
-/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
 static const uint16_t dnxhd_1237_ac_codes[257] = {
 0, 1, 4, 5,12,26,27,56,
57,58,59,   120,   121,   244,   245,   246,
@@ -307,7 +311,7 @@ static const uint16_t dnxhd_1237_ac_codes[257] = {
 65535,
 };
 
-/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
 static const uint8_t dnxhd_1237_ac_bits[257] = {
  2,  2,  3,  3,  4,  5,  5,  6,  6,  6,  6,  7,  7,  8,  8,  8,
  8,  8,  9,  9,  9,  9,  9, 10, 10, 10, 10, 10, 10, 11, 11, 11,
@@ -328,7 +332,7 @@ static const uint8_t dnxhd_1237_ac_bits[257] = {
 16,
 };
 
-/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
 static const uint8_t dnxhd_1237_ac_level[257] = {
   3,  3,  5,  0,  7,  9,  5, 11, 13, 15,  7, 17, 19, 21, 23, 25,
   9, 11, 27, 29, 31, 33, 13, 35, 37, 39, 41, 43, 15, 45, 47, 49,
@@ -349,7 +353,7 @@ static const uint8_t dnxhd_1237_ac_level[257] = {
 129,
 };
 
-/* Used in CID 1237, 1242, 1253, 1259, 1260 */
+/* Used in CID 1237, 1242, 1253, 1259, 1260, 1273, 1274 */
 static const uint8_t dnxhd_1237_ac_flags[257] = {
 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0,
 2, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0,
@@ -449,6 +453,7 @@ static const uint8_t dnxhd_1238_ac_level[257] = {
 129,
 }; /* 0 is EOB */
 
+/* Used in CID 1238, 1243, 1272 */
 static const uint8_t dnxhd_1238_ac_flags[257] = {
 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 2,
 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 2, 0, 0,
@@ -527,7 +532,7 @@ static const uint8_t dnxhd_1235_ac_bits[257] = {
 16,
 };
 
-/* Used in CID 1235, 1241, 1256 */
+/* Used in CID 1235, 1241, 1256, 1270, 1271 */
 static const uint8_t dnxhd_1235_ac_level[257] = {
   3,  3,  5,  7,  0,  9, 11,  5, 13, 15, 17,  

[FFmpeg-devel] [PATCH 2/5] isom: add support for DNxHR codec family

2015-10-02 Thread Christophe Gisquet
This is actually similar to DNxHD.
---
 libavformat/isom.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/isom.c b/libavformat/isom.c
index eff04ff..e55738b 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -240,6 +240,7 @@ const AVCodecTag ff_codec_movvideo_tags[] = {
 
 { AV_CODEC_ID_DIRAC, MKTAG('d', 'r', 'a', 'c') },
 { AV_CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'n') }, /* AVID DNxHD */
+{ AV_CODEC_ID_DNXHD, MKTAG('A', 'V', 'd', 'h') }, /* AVID DNxHR */
 { AV_CODEC_ID_H263,  MKTAG('H', '2', '6', '3') },
 { AV_CODEC_ID_MSMPEG4V3, MKTAG('3', 'I', 'V', 'D') }, /* 3ivx DivX Doctor 
*/
 { AV_CODEC_ID_RAWVIDEO,  MKTAG('A', 'V', '1', 'x') }, /* AVID 1:1x */
-- 
2.5.2

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


Re: [FFmpeg-devel] [PATCH] avcodec/h264_ps: Fix copying oversized pps data

2015-10-02 Thread wm4
On Fri,  2 Oct 2015 21:14:57 +0200
Michael Niedermayer  wrote:

> From: Michael Niedermayer 
> 
> Fixes: https://trac.ffmpeg.org/attachment/ticket/685/movie.264
> 
> In the available testcase the actual PPS only uses a few bits
> while there are 7kbyte of apparently random data after it
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavcodec/h264_ps.c |4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
> index fd16a95..0dca5f0 100644
> --- a/libavcodec/h264_ps.c
> +++ b/libavcodec/h264_ps.c
> @@ -611,8 +611,8 @@ int ff_h264_decode_picture_parameter_set(H264Context *h, 
> int bit_length)
>  return AVERROR(ENOMEM);
>  pps->data_size = h->gb.buffer_end - h->gb.buffer;
>  if (pps->data_size > sizeof(pps->data)) {
> -ret = AVERROR_INVALIDDATA;
> -goto fail;
> +av_log(h->avctx, AV_LOG_WARNING, "Truncating likely oversized 
> PPS\n");
> +pps->data_size = sizeof(pps->data);
>  }
>  memcpy(pps->data, h->gb.buffer, pps->data_size);
>  pps->sps_id = get_ue_golomb_31(>gb);

That was quick.

Should the same be done for SPS?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


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

2015-10-02 Thread Paul B Mahol
On 10/2/15, Nicholas Robbins  wrote:
> On Friday, October 2, 2015 2:00 PM, Moritz Barsnick 
> wrote:
>>
>>
>>On Fri, Oct 02, 2015 at 19:47:12 +0200, Paul B Mahol wrote:
>>> fps filter duplicated or removes frames to produce cfr output.
>>> This filter changes fps and do not remove or duplicate single
>>> frame so output becomes faster or slower when played when
>>> fps increase or decrease.
>>
>>Ah! So, in other words, it takes input frames, totally disregads their
>>pts/dts, and puts each one into a cfr output stream at the given fps?
>>
>>That solves a lot of problems and ridiculous math. :-) I will try it.
>>
>>Cheers,
>>
>>Moritz
>
>
>
> Can't this be accomplished by the setpts filter?

setpts filter doesnt change framerate, so generally no.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avcodec/h264_ps: Fix copying oversized pps data

2015-10-02 Thread wm4
On Fri, 2 Oct 2015 21:41:59 +0200
Michael Niedermayer  wrote:

> On Fri, Oct 02, 2015 at 09:23:04PM +0200, wm4 wrote:
> > On Fri,  2 Oct 2015 21:14:57 +0200
> > Michael Niedermayer  wrote:
> > 
> > > From: Michael Niedermayer 
> > > 
> > > Fixes: https://trac.ffmpeg.org/attachment/ticket/685/movie.264
> > > 
> > > In the available testcase the actual PPS only uses a few bits
> > > while there are 7kbyte of apparently random data after it
> > > 
> > > Signed-off-by: Michael Niedermayer 
> > > ---
> > >  libavcodec/h264_ps.c |4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
> > > index fd16a95..0dca5f0 100644
> > > --- a/libavcodec/h264_ps.c
> > > +++ b/libavcodec/h264_ps.c
> > > @@ -611,8 +611,8 @@ int ff_h264_decode_picture_parameter_set(H264Context 
> > > *h, int bit_length)
> > >  return AVERROR(ENOMEM);
> > >  pps->data_size = h->gb.buffer_end - h->gb.buffer;
> > >  if (pps->data_size > sizeof(pps->data)) {
> > > -ret = AVERROR_INVALIDDATA;
> > > -goto fail;
> > > +av_log(h->avctx, AV_LOG_WARNING, "Truncating likely oversized 
> > > PPS\n");
> > > +pps->data_size = sizeof(pps->data);
> > >  }
> > >  memcpy(pps->data, h->gb.buffer, pps->data_size);
> > >  pps->sps_id = get_ue_golomb_31(>gb);
> > 
> > That was quick.
> > 
> 
> > Should the same be done for SPS?
> 
> i dont know
> 

I'd say it would be good for symmetry.

Or we could just switch back to allocating 64K for the data, or maybe
even dynamically allocate it. (I wanted to avoid the latter because
it's a bit messy, but maybe it's the best solution?)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] lavf: add chromaprint muxer

2015-10-02 Thread Rodger Combs
---
 Changelog|  1 +
 configure|  4 
 doc/muxers.texi  | 35 +++
 libavformat/Makefile |  1 +
 libavformat/allformats.c |  1 +
 libavformat/version.h|  2 +-
 6 files changed, 43 insertions(+), 1 deletion(-)

diff --git a/Changelog b/Changelog
index 515d649..1b7e44d 100644
--- a/Changelog
+++ b/Changelog
@@ -13,6 +13,7 @@ version :
 - agate filter
 - chromakey filter
 - maskedmerge filter
+- chromaprint fingerprinting muxer
 
 
 version 2.8:
diff --git a/configure b/configure
index 361c024..b9731c0 100755
--- a/configure
+++ b/configure
@@ -197,6 +197,7 @@ Individual component options:
 External library support:
   --enable-avisynthenable reading of AviSynth script files [no]
   --disable-bzlib  disable bzlib [autodetect]
+  --enable-chromaprint enable audio fingerprinting with chromaprint [no]
   --enable-fontconfig  enable fontconfig, useful for drawtext filter [no]
   --enable-frei0r  enable frei0r video filtering [no]
   --enable-gnutls  enable gnutls, needed for https support
@@ -1367,6 +1368,7 @@ EXAMPLE_LIST="
 EXTERNAL_LIBRARY_LIST="
 avisynth
 bzlib
+chromaprint
 crystalhd
 decklink
 frei0r
@@ -2505,6 +2507,7 @@ vc1_parser_select="mpegvideo startcode vc1_decoder"
 mjpeg2jpeg_bsf_select="jpegtables"
 
 # external libraries
+chromaprint_muxer_deps="chromaprint"
 libaacplus_encoder_deps="libaacplus"
 libcelt_decoder_deps="libcelt"
 libdcadec_decoder_deps="libdcadec"
@@ -5242,6 +5245,7 @@ enabled avfoundation_indev && { check_lib2 
CoreGraphics/CoreGraphics.h CGGetActi
 enabled avisynth  && { { check_lib2 "windows.h" LoadLibrary; } ||
{ check_lib2 "dlfcn.h" dlopen -ldl; } ||
die "ERROR: LoadLibrary/dlopen not found for 
avisynth"; }
+enabled chromaprint   && require chromaprint chromaprint.h 
chromaprint_get_version -lchromaprint
 enabled decklink  && { check_header DeckLinkAPI.h || die "ERROR: 
DeckLinkAPI.h header not found"; }
 enabled frei0r&& { check_header frei0r.h || die "ERROR: frei0r.h 
header not found"; }
 enabled gnutls&& require_pkg_config gnutls gnutls/gnutls.h 
gnutls_global_init
diff --git a/doc/muxers.texi b/doc/muxers.texi
index 86ca4ad..91d131f 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -37,6 +37,41 @@ ID3v2.3 and ID3v2.4) are supported. The default is version 4.
 
 @end table
 
+@anchor{chromaprint}
+@section chromaprint
+
+Chromaprint fingerprinter
+
+This muxer feeds audio data to the Chromaprint library, which generates
+a fingerprint for the provided audio data. It takes a single signed
+native-endian 16-bit raw audio stream.
+
+@subsection Options
+
+@table @option
+@item silence_threshold
+Threshold for detecting silence, ranges from 0 to 32767. -1 for default
+(required for use with the AcoustID service).
+
+@item algorithm
+Algorithm index to fingerprint with.
+
+@item fp_format
+Format to output the fingerprint as. Accepts the following options:
+@table @samp
+@item raw
+Binary raw fingerprint
+
+@item compressed
+Binary compressed fingerprint
+
+@item base64
+Base64 compressed fingerprint
+
+@end table
+
+@end table
+
 @anchor{crc}
 @section crc
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 466da51..c9bf20f 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -487,6 +487,7 @@ OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER)+= yuv4mpegenc.o
 OBJS-$(CONFIG_YUV4MPEGPIPE_DEMUXER)  += yuv4mpegdec.o
 
 # external libraries
+OBJS-$(CONFIG_CHROMAPRINT_MUXER) += chromaprint.o
 OBJS-$(CONFIG_LIBGME_DEMUXER)+= libgme.o
 OBJS-$(CONFIG_LIBMODPLUG_DEMUXER)+= libmodplug.o
 OBJS-$(CONFIG_LIBNUT_DEMUXER)+= libnut.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 0a24ac7..0ccde9d 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -391,6 +391,7 @@ void av_register_all(void)
 REGISTER_PROTOCOL(UNIX, unix);
 
 /* external libraries */
+REGISTER_MUXER   (CHROMAPRINT,  chromaprint);
 REGISTER_DEMUXER (LIBGME,   libgme);
 REGISTER_DEMUXER (LIBMODPLUG,   libmodplug);
 REGISTER_MUXDEMUX(LIBNUT,   libnut);
diff --git a/libavformat/version.h b/libavformat/version.h
index 743617e..f7a2e09 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -30,7 +30,7 @@
 #include "libavutil/version.h"
 
 #define LIBAVFORMAT_VERSION_MAJOR  57
-#define LIBAVFORMAT_VERSION_MINOR   2
+#define LIBAVFORMAT_VERSION_MINOR   3
 #define LIBAVFORMAT_VERSION_MICRO 100
 
 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-- 
2.6.0

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


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

2015-10-02 Thread Nicholas Robbins
On Friday, October 2, 2015 2:00 PM, Moritz Barsnick  wrote:
>
>
>On Fri, Oct 02, 2015 at 19:47:12 +0200, Paul B Mahol wrote:
>> fps filter duplicated or removes frames to produce cfr output.
>> This filter changes fps and do not remove or duplicate single
>> frame so output becomes faster or slower when played when
>> fps increase or decrease.
>
>Ah! So, in other words, it takes input frames, totally disregads their
>pts/dts, and puts each one into a cfr output stream at the given fps?
>
>That solves a lot of problems and ridiculous math. :-) I will try it.
>
>Cheers,
>
>Moritz



Can't this be accomplished by the setpts filter?


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


[FFmpeg-devel] [PATCH] lavf: add chromaprint muxer

2015-10-02 Thread Rodger Combs
---
 Changelog |   1 +
 configure |   4 +
 doc/muxers.texi   |  35 +
 libavformat/Makefile  |   1 +
 libavformat/allformats.c  |   1 +
 libavformat/chromaprint.c | 195 ++
 libavformat/version.h |   2 +-
 7 files changed, 238 insertions(+), 1 deletion(-)
 create mode 100644 libavformat/chromaprint.c

diff --git a/Changelog b/Changelog
index 515d649..1b7e44d 100644
--- a/Changelog
+++ b/Changelog
@@ -13,6 +13,7 @@ version :
 - agate filter
 - chromakey filter
 - maskedmerge filter
+- chromaprint fingerprinting muxer
 
 
 version 2.8:
diff --git a/configure b/configure
index 361c024..b9731c0 100755
--- a/configure
+++ b/configure
@@ -197,6 +197,7 @@ Individual component options:
 External library support:
   --enable-avisynthenable reading of AviSynth script files [no]
   --disable-bzlib  disable bzlib [autodetect]
+  --enable-chromaprint enable audio fingerprinting with chromaprint [no]
   --enable-fontconfig  enable fontconfig, useful for drawtext filter [no]
   --enable-frei0r  enable frei0r video filtering [no]
   --enable-gnutls  enable gnutls, needed for https support
@@ -1367,6 +1368,7 @@ EXAMPLE_LIST="
 EXTERNAL_LIBRARY_LIST="
 avisynth
 bzlib
+chromaprint
 crystalhd
 decklink
 frei0r
@@ -2505,6 +2507,7 @@ vc1_parser_select="mpegvideo startcode vc1_decoder"
 mjpeg2jpeg_bsf_select="jpegtables"
 
 # external libraries
+chromaprint_muxer_deps="chromaprint"
 libaacplus_encoder_deps="libaacplus"
 libcelt_decoder_deps="libcelt"
 libdcadec_decoder_deps="libdcadec"
@@ -5242,6 +5245,7 @@ enabled avfoundation_indev && { check_lib2 
CoreGraphics/CoreGraphics.h CGGetActi
 enabled avisynth  && { { check_lib2 "windows.h" LoadLibrary; } ||
{ check_lib2 "dlfcn.h" dlopen -ldl; } ||
die "ERROR: LoadLibrary/dlopen not found for 
avisynth"; }
+enabled chromaprint   && require chromaprint chromaprint.h 
chromaprint_get_version -lchromaprint
 enabled decklink  && { check_header DeckLinkAPI.h || die "ERROR: 
DeckLinkAPI.h header not found"; }
 enabled frei0r&& { check_header frei0r.h || die "ERROR: frei0r.h 
header not found"; }
 enabled gnutls&& require_pkg_config gnutls gnutls/gnutls.h 
gnutls_global_init
diff --git a/doc/muxers.texi b/doc/muxers.texi
index 86ca4ad..91d131f 100644
--- a/doc/muxers.texi
+++ b/doc/muxers.texi
@@ -37,6 +37,41 @@ ID3v2.3 and ID3v2.4) are supported. The default is version 4.
 
 @end table
 
+@anchor{chromaprint}
+@section chromaprint
+
+Chromaprint fingerprinter
+
+This muxer feeds audio data to the Chromaprint library, which generates
+a fingerprint for the provided audio data. It takes a single signed
+native-endian 16-bit raw audio stream.
+
+@subsection Options
+
+@table @option
+@item silence_threshold
+Threshold for detecting silence, ranges from 0 to 32767. -1 for default
+(required for use with the AcoustID service).
+
+@item algorithm
+Algorithm index to fingerprint with.
+
+@item fp_format
+Format to output the fingerprint as. Accepts the following options:
+@table @samp
+@item raw
+Binary raw fingerprint
+
+@item compressed
+Binary compressed fingerprint
+
+@item base64
+Base64 compressed fingerprint
+
+@end table
+
+@end table
+
 @anchor{crc}
 @section crc
 
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 466da51..c9bf20f 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -487,6 +487,7 @@ OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER)+= yuv4mpegenc.o
 OBJS-$(CONFIG_YUV4MPEGPIPE_DEMUXER)  += yuv4mpegdec.o
 
 # external libraries
+OBJS-$(CONFIG_CHROMAPRINT_MUXER) += chromaprint.o
 OBJS-$(CONFIG_LIBGME_DEMUXER)+= libgme.o
 OBJS-$(CONFIG_LIBMODPLUG_DEMUXER)+= libmodplug.o
 OBJS-$(CONFIG_LIBNUT_DEMUXER)+= libnut.o
diff --git a/libavformat/allformats.c b/libavformat/allformats.c
index 0a24ac7..0ccde9d 100644
--- a/libavformat/allformats.c
+++ b/libavformat/allformats.c
@@ -391,6 +391,7 @@ void av_register_all(void)
 REGISTER_PROTOCOL(UNIX, unix);
 
 /* external libraries */
+REGISTER_MUXER   (CHROMAPRINT,  chromaprint);
 REGISTER_DEMUXER (LIBGME,   libgme);
 REGISTER_DEMUXER (LIBMODPLUG,   libmodplug);
 REGISTER_MUXDEMUX(LIBNUT,   libnut);
diff --git a/libavformat/chromaprint.c b/libavformat/chromaprint.c
new file mode 100644
index 000..19cef55
--- /dev/null
+++ b/libavformat/chromaprint.c
@@ -0,0 +1,195 @@
+/*
+ * Chromaprint fingerprinting muxer
+ * Copyright (c) 2015 Rodger Combs
+ *
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * FFmpeg 

Re: [FFmpeg-devel] [PATCH] vp9: 16bpp tm/dc/h/v intra pred simd (mostly sse2) functions.

2015-10-02 Thread Henrik Gramner
On Fri, Sep 25, 2015 at 11:24 PM, Ronald S. Bultje  wrote:
> +++ b/libavcodec/x86/vp9intrapred_16bpp.asm

> +cglobal vp9_ipred_v_4x4_16, 2, 4, 1, dst, stride, l, a
> +cglobal vp9_ipred_v_8x8_16, 2, 4, 1, dst, stride, l, a
> +cglobal vp9_ipred_v_16x16_16, 2, 4, 2, dst, stride, l, a
> +cglobal vp9_ipred_v_32x32_16, 2, 4, 4, dst, stride, l, a

Those look pretty generic. Isn't some H.264 pred very similar if not
identical? I didn't check, but if they are you can just use those
instead.

> +cglobal vp9_ipred_h_8x8_16, 3, 4, 5, dst, stride, l, a

Seemed a bit inefficient so i rewrote it. Around 2x as fast and fewer regs:

cglobal vp9_ipred_h_8x8_16, 3, 3, 4, dst, stride, l, a
movam2, [lq]
DEFINE_ARGS dst, stride, stride3
lea   stride3q, [strideq*3]
punpckhwd   m3, m2, m2
pshufd  m0, m3, q
pshufd  m1, m3, q
mova  [dstq+strideq*0], m0
mova  [dstq+strideq*1], m1
pshufd  m0, m3, q
pshufd  m1, m3, q
mova  [dstq+strideq*2], m0
mova  [dstq+stride3q ], m1
lea   dstq, [dstq+strideq*4]
punpcklwd   m2, m2
pshufd  m0, m2, q
pshufd  m1, m2, q
mova  [dstq+strideq*0], m0
mova  [dstq+strideq*1], m1
pshufd  m0, m2, q
pshufd  m1, m2, q
mova  [dstq+strideq*2], m0
mova  [dstq+stride3q ], m1
RET

> +cglobal vp9_ipred_h_16x16_16, 3, 4, 6, dst, stride, l, a
> +cglobal vp9_ipred_h_32x32_16, 3, 5, 8, dst, stride, l, a

Should be possible to change those to be more similar to the 8x8 above.

> +cglobal vp9_ipred_dc_4x4_16, 4, 4, 2, dst, stride, l, a
[...]
> +pshufw  m1, m0, q3232
> +paddd   m0, m1
> +paddd   m0, [pd_4]

Swap the last two rows to allow the shuffle and the pd_4 add to
execute in parallel. The same issue exists in pretty much every other
dc function as well.

> +cglobal vp9_ipred_dc_32x32_16, 4, 4, 2, dst, stride, l, a
[...]
> +.loop:
> +mova   [dstq+strideq*0+ 0], m0
> +mova   [dstq+strideq*0+16], m0
> +mova   [dstq+strideq*0+32], m0
> +mova   [dstq+strideq*0+48], m0
> +mova   [dstq+strideq*1+ 0], m0
> +mova   [dstq+strideq*1+16], m0
> +mova   [dstq+strideq*1+32], m0
> +mova   [dstq+strideq*1+48], m0
> +mova   [dstq+strideq*2+ 0], m0
> +mova   [dstq+strideq*2+16], m0
> +mova   [dstq+strideq*2+32], m0
> +mova   [dstq+strideq*2+48], m0
> +mova   [dstq+stride3q + 0], m0
> +mova   [dstq+stride3q +16], m0
> +mova   [dstq+stride3q +32], m0
> +mova   [dstq+stride3q +48], m0
> +lea   dstq, [dstq+strideq*4]
> +dec   cntd
> +jg .loop

Cut the number of stores per iteration in half and double the number
of iterations instead.

> +cglobal vp9_ipred_dc_%1_32x32_16, 4, 4, 2, dst, stride, l, a
[...]
> +.loop:
> +mova   [dstq+strideq*0+ 0], m0
> +mova   [dstq+strideq*0+16], m0
> +mova   [dstq+strideq*0+32], m0
> +mova   [dstq+strideq*0+48], m0
> +mova   [dstq+strideq*1+ 0], m0
> +mova   [dstq+strideq*1+16], m0
> +mova   [dstq+strideq*1+32], m0
> +mova   [dstq+strideq*1+48], m0
> +mova   [dstq+strideq*2+ 0], m0
> +mova   [dstq+strideq*2+16], m0
> +mova   [dstq+strideq*2+32], m0
> +mova   [dstq+strideq*2+48], m0
> +mova   [dstq+stride3q + 0], m0
> +mova   [dstq+stride3q +16], m0
> +mova   [dstq+stride3q +32], m0
> +mova   [dstq+stride3q +48], m0
> +lea   dstq, [dstq+strideq*4]
> +dec   cntd
> +jg .loop

Ditto.

> +cglobal vp9_ipred_tm_4x4_10, 4, 4, 6, dst, stride, l, a
[...]
> +movdm0, [aq-2]
> +pshufw  m0, m0, q

Unaligned load penalty, either movd from [aq-4] or pshufw directly from [aq-8].

> +cglobal vp9_ipred_tm_8x8_10, 4, 4, 8, dst, stride, l, a
[...]
> +movdm0, [aq-2]
> +pshuflw m0, m0, q

Ditto, except you don't want to pshuflw directly from memory in this
case unlike with MMX. You can use vpbroadcastw instead though if you
want to write AVX2. This issue exists in multiple other places as
well.

> +pshufhw m0, m4, q
> +pshufhw m1, m4, q
> +pshufhw m2, m4, q
> +pshufhw m3, m4, q
> +punpckhqdq  m0, m0
> +punpckhqdq  m1, m1
> +punpckhqdq  m2, m2
> +punpckhqdq  m3, m3

Use punpckhwd + pshufd instead, same as in vp9_ipred_h_8x8_16 above.

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


Re: [FFmpeg-devel] [PATCH] libavformat/mov.c: Add parsing for DDTS atom for DTS audio

2015-10-02 Thread Shawn Singh
FYI I haven't forgotten about this.  Just traveling these next few days.
Thanks.

On Wed, Sep 30, 2015 at 8:22 AM, Yusuke Nakamura <
muken.the.vfrman...@gmail.com> wrote:

> 2015-09-30 12:05 GMT+09:00 Michael Niedermayer :
>
> > On Tue, Sep 29, 2015 at 02:44:38PM -0700, Shawn Singh wrote:
> > > The DDTS atom is defined in ETSI TS 102 114, v1.4.1, Annex E.
> > > This is useful for DTS-HD formats, some of which cannot be
> > > decoded by dcadec.c or libdcadec.
> > >
> > > Signed-off-by: Shawn Singh 
> > > ---
> > >  libavformat/mov.c | 56
> > +++
> > >  1 file changed, 56 insertions(+)
> >
> > applied
> >
> > btw do you have a sample that you can share ?
> >
> >
> DASH-IF's test vectors contain DTS-in-ISOBMFF samples.
> http://dashif.org/test-vectors/
> You can get them from URLs in MPD files.
>
>
> > 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
> > ..."
> >
> > ___
> > 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
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/15] lavfi/vf_fps: remove looping on request_frame().

2015-10-02 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 05:13:17PM +0200, Nicolas George wrote:
> Signed-off-by: Nicolas George 
> ---
>  libavfilter/vf_fps.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c
> index 6154f6d..0f0ed24 100644
> --- a/libavfilter/vf_fps.c
> +++ b/libavfilter/vf_fps.c
> @@ -129,8 +129,7 @@ static int request_frame(AVFilterLink *outlink)
>  int frames_out = s->frames_out;

>  int ret = 0;

init is unneeded after this


>  
> -while (ret >= 0 && s->frames_out == frames_out)
> -ret = ff_request_frame(ctx->inputs[0]);
> +ret = ff_request_frame(ctx->inputs[0]);

frames_out becomes unused

no more comments from me

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

DNS cache poisoning attacks, popular search engine, Google internet authority
dont be evil, please


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


Re: [FFmpeg-devel] [PATCH 0/7] [RFC] x86 assembly constants

2015-10-02 Thread Hendrik Leppkes
On Fri, Oct 2, 2015 at 7:16 PM, Timothy Gu  wrote:
> On Fri, Oct 2, 2015 at 10:08 AM James Darnley 
> wrote:
>
>> The third patch uses them in the remaining inline assembly.
>>
>
> That's the crux of the problem: inline asm uses these constants, but will
> be unable to without yasm. Either we drop compatibility for inline asm for
> x86 platforms w/o yasm, or we can't do this.
>

A build without yasm is gimped as it is, so disabling inline asm in
the same go doesn't seem like a too terrible thing.

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


Re: [FFmpeg-devel] [PATCH 10/15] lavfi/vf_yadif: remove looping on request_frame().

2015-10-02 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 05:13:21PM +0200, Nicolas George wrote:
> Signed-off-by: Nicolas George 
> ---
>  libavfilter/vf_yadif.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

LGTM

thanks

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

Awnsering whenever a program halts or runs forever is
On a turing machine, in general impossible (turings halting problem).
On any real computer, always possible as a real computer has a finite number
of states N, and will either halt in less than N cycles or never halt.


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/h264_ps: Fix copying oversized pps data

2015-10-02 Thread Hendrik Leppkes
On Fri, Oct 2, 2015 at 9:49 PM, wm4  wrote:
> On Fri, 2 Oct 2015 21:41:59 +0200
> Michael Niedermayer  wrote:
>
>> On Fri, Oct 02, 2015 at 09:23:04PM +0200, wm4 wrote:
>> > On Fri,  2 Oct 2015 21:14:57 +0200
>> > Michael Niedermayer  wrote:
>> >
>> > > From: Michael Niedermayer 
>> > >
>> > > Fixes: https://trac.ffmpeg.org/attachment/ticket/685/movie.264
>> > >
>> > > In the available testcase the actual PPS only uses a few bits
>> > > while there are 7kbyte of apparently random data after it
>> > >
>> > > Signed-off-by: Michael Niedermayer 
>> > > ---
>> > >  libavcodec/h264_ps.c |4 ++--
>> > >  1 file changed, 2 insertions(+), 2 deletions(-)
>> > >
>> > > diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
>> > > index fd16a95..0dca5f0 100644
>> > > --- a/libavcodec/h264_ps.c
>> > > +++ b/libavcodec/h264_ps.c
>> > > @@ -611,8 +611,8 @@ int ff_h264_decode_picture_parameter_set(H264Context 
>> > > *h, int bit_length)
>> > >  return AVERROR(ENOMEM);
>> > >  pps->data_size = h->gb.buffer_end - h->gb.buffer;
>> > >  if (pps->data_size > sizeof(pps->data)) {
>> > > -ret = AVERROR_INVALIDDATA;
>> > > -goto fail;
>> > > +av_log(h->avctx, AV_LOG_WARNING, "Truncating likely oversized 
>> > > PPS\n");
>> > > +pps->data_size = sizeof(pps->data);
>> > >  }
>> > >  memcpy(pps->data, h->gb.buffer, pps->data_size);
>> > >  pps->sps_id = get_ue_golomb_31(>gb);
>> >
>> > That was quick.
>> >
>>
>> > Should the same be done for SPS?
>>
>> i dont know
>>
>
> I'd say it would be good for symmetry.
>

Its a new error condition which wouldn't affect 99% of all users, so
its probably best to switch it to a warning as well and hope for the
best.

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


Re: [FFmpeg-devel] [PATCH 01/15] lavfi/af_aresample: remove looping on request_frame().

2015-10-02 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 05:13:12PM +0200, Nicolas George wrote:
> Signed-off-by: Nicolas George 
> ---
>  libavfilter/af_aresample.c | 7 +--
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> 
> All patches in this series were tested with FATE or manually.

LGTM

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 07/15] lavfi/vf_select: remove looping on request_frame().

2015-10-02 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 05:13:18PM +0200, Nicolas George wrote:
> Signed-off-by: Nicolas George 
> ---
>  libavfilter/f_select.c | 10 ++
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/libavfilter/f_select.c b/libavfilter/f_select.c
> index 3e7cf78..7613ca1 100644
> --- a/libavfilter/f_select.c
> +++ b/libavfilter/f_select.c
> @@ -383,14 +383,8 @@ static int request_frame(AVFilterLink *outlink)
>  SelectContext *select = ctx->priv;
>  AVFilterLink *inlink = outlink->src->inputs[0];
>  int out_no = FF_OUTLINK_IDX(outlink);
> -
> -do {
> -int ret = ff_request_frame(inlink);
> -if (ret < 0)
> -return ret;
> -} while (select->select_out != out_no);
> -
> -return 0;
> +int ret = ff_request_frame(inlink);
> +return ret;

out_no and select become unused

no further comments from me

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

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein


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


[FFmpeg-devel] [PATCH] vp9: 16bpp tm/dc/h/v intra pred simd (mostly sse2) functions.

2015-10-02 Thread Ronald S. Bultje
---
 libavcodec/x86/Makefile |   1 +
 libavcodec/x86/constants.c  |   4 +
 libavcodec/x86/constants.h  |   2 +
 libavcodec/x86/h264_idct_10bit.asm  |   5 +-
 libavcodec/x86/h264_intrapred_10bit.asm |   2 +-
 libavcodec/x86/vp9dsp_init.h|  23 +
 libavcodec/x86/vp9dsp_init_16bpp.c  |  15 +
 libavcodec/x86/vp9dsp_init_16bpp_template.c |   7 +
 libavcodec/x86/vp9intrapred_16bpp.asm   | 624 
 9 files changed, 678 insertions(+), 5 deletions(-)
 create mode 100644 libavcodec/x86/vp9intrapred_16bpp.asm

diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile
index 01e5f18..5ff3a77 100644
--- a/libavcodec/x86/Makefile
+++ b/libavcodec/x86/Makefile
@@ -158,6 +158,7 @@ YASM-OBJS-$(CONFIG_VC1_DECODER)+= x86/vc1dsp.o
 YASM-OBJS-$(CONFIG_VORBIS_DECODER) += x86/vorbisdsp.o
 YASM-OBJS-$(CONFIG_VP6_DECODER)+= x86/vp6dsp.o
 YASM-OBJS-$(CONFIG_VP9_DECODER)+= x86/vp9intrapred.o\
+  x86/vp9intrapred_16bpp.o  \
   x86/vp9itxfm.o\
   x86/vp9lpf.o  \
   x86/vp9lpf_16bpp.o\
diff --git a/libavcodec/x86/constants.c b/libavcodec/x86/constants.c
index 9f3c8b4..19345f5 100644
--- a/libavcodec/x86/constants.c
+++ b/libavcodec/x86/constants.c
@@ -81,3 +81,7 @@ DECLARE_ALIGNED(16, const xmm_reg,  ff_ps_neg)  = { 
0x80008000ULL, 0x800
 
 DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_1)= { 0x00010001ULL, 
0x00010001ULL,
 0x00010001ULL, 
0x00010001ULL };
+DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_16)   = { 0x00100010ULL, 
0x00100010ULL,
+0x00100010ULL, 
0x00100010ULL };
+DECLARE_ALIGNED(32, const ymm_reg,  ff_pd_32)   = { 0x00200020ULL, 
0x00200020ULL,
+0x00200020ULL, 
0x00200020ULL };
diff --git a/libavcodec/x86/constants.h b/libavcodec/x86/constants.h
index 37a1869..4a2451d 100644
--- a/libavcodec/x86/constants.h
+++ b/libavcodec/x86/constants.h
@@ -63,5 +63,7 @@ extern const uint64_t ff_pb_FC;
 extern const xmm_reg  ff_ps_neg;
 
 extern const ymm_reg  ff_pd_1;
+extern const ymm_reg  ff_pd_16;
+extern const ymm_reg  ff_pd_32;
 
 #endif /* AVCODEC_X86_CONSTANTS_H */
diff --git a/libavcodec/x86/h264_idct_10bit.asm 
b/libavcodec/x86/h264_idct_10bit.asm
index cc115b0..f1c2c81 100644
--- a/libavcodec/x86/h264_idct_10bit.asm
+++ b/libavcodec/x86/h264_idct_10bit.asm
@@ -24,14 +24,11 @@
 
 %include "libavutil/x86/x86util.asm"
 
-SECTION_RODATA
-
-pd_32:times 4 dd 32
-
 SECTION .text
 
 cextern pw_1023
 %define pw_pixel_max pw_1023
+cextern pd_32
 
 ;-
 ; void ff_h264_idct_add_10(pixel *dst, int16_t *block, int stride)
diff --git a/libavcodec/x86/h264_intrapred_10bit.asm 
b/libavcodec/x86/h264_intrapred_10bit.asm
index 9aeb702..9e40cfe 100644
--- a/libavcodec/x86/h264_intrapred_10bit.asm
+++ b/libavcodec/x86/h264_intrapred_10bit.asm
@@ -34,11 +34,11 @@ cextern pw_8
 cextern pw_4
 cextern pw_2
 cextern pw_1
+cextern pd_16
 
 pw_m32101234: dw -3, -2, -1, 0, 1, 2, 3, 4
 pw_m3:times 8 dw -3
 pd_17:times 4 dd 17
-pd_16:times 4 dd 16
 
 SECTION .text
 
diff --git a/libavcodec/x86/vp9dsp_init.h b/libavcodec/x86/vp9dsp_init.h
index d1a9514..47d2246 100644
--- a/libavcodec/x86/vp9dsp_init.h
+++ b/libavcodec/x86/vp9dsp_init.h
@@ -41,6 +41,18 @@ decl_mc_func(avg, sz, h, opt, type, fsz, bpp); \
 decl_mc_func(put, sz, v, opt, type, fsz, bpp); \
 decl_mc_func(avg, sz, v, opt, type, fsz, bpp)
 
+#define decl_ipred_fn(type, sz, bpp, opt) \
+void ff_vp9_ipred_##type##_##sz##x##sz##_##bpp##_##opt(uint8_t *dst, \
+   ptrdiff_t stride, \
+   const uint8_t *l, \
+   const uint8_t *a)
+
+#define decl_ipred_fns(type, bpp, opt4, opt8_16_32) \
+decl_ipred_fn(type,  4, bpp, opt4); \
+decl_ipred_fn(type,  8, bpp, opt8_16_32); \
+decl_ipred_fn(type, 16, bpp, opt8_16_32); \
+decl_ipred_fn(type, 32, bpp, opt8_16_32)
+
 #define mc_rep_func(avg, sz, hsz, hszb, dir, opt, type, f_sz, bpp) \
 static av_always_inline void \
 ff_vp9_##avg##_8tap_1d_##dir##_##sz##_##bpp##_##opt(uint8_t *dst, ptrdiff_t 
dst_stride, \
@@ -142,6 +154,17 @@ filters_8tap_2d_fn(op, 4, align, bpp, bytes, opt4, f_opt)
 init_subpel3_8to64(idx, type, bpp, opt); \
 init_subpel2(4, idx,  4, type, bpp, opt)
 
+#define cat(a, bpp, b) a##bpp##b
+
+#define init_ipred_func(type, enum, sz, bpp, opt) \
+

Re: [FFmpeg-devel] [PATCH]lavf/rawdec: Simplify mlp/thd probe function

2015-10-02 Thread Michael Niedermayer
On Fri, Oct 02, 2015 at 03:29:05AM +0200, Carl Eugen Hoyos wrote:
> Hi!
> 
> Attached patch intends to slightly simplify the probe function.
> 
> Please review, Carl Eugen

>  rawdec.c |   13 ++---
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 2ac4375102534142befdaf1482543dceb73ae306  patchmlpprobe.diff

LGTM

thx
 
[...]

-- 
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] vp9: 16bpp tm/dc/h/v intra pred simd (mostly sse2) functions.

2015-10-02 Thread Ronald S. Bultje
Hi,

On Fri, Oct 2, 2015 at 5:31 PM, Henrik Gramner  wrote:

> On Fri, Sep 25, 2015 at 11:24 PM, Ronald S. Bultje 
> wrote:
> > +++ b/libavcodec/x86/vp9intrapred_16bpp.asm
>
> > +cglobal vp9_ipred_v_4x4_16, 2, 4, 1, dst, stride, l, a
> > +cglobal vp9_ipred_v_8x8_16, 2, 4, 1, dst, stride, l, a
> > +cglobal vp9_ipred_v_16x16_16, 2, 4, 2, dst, stride, l, a
> > +cglobal vp9_ipred_v_32x32_16, 2, 4, 4, dst, stride, l, a
>
> Those look pretty generic. Isn't some H.264 pred very similar if not
> identical? I didn't check, but if they are you can just use those
> instead.


Well, they prototype is different. For H/V, it's not critical, but for the
directional ones, the edge handling is very quirky so I wanted to do that
in C, so l/a are arguments instead of part of the source buffer.

(And because we do in-loop filtering, doing V as-is from h264 won't work,
since a can be post-loopfilter, whereas in h264 it's required to be pre-,
and we don't swap in vp9.)

> +cglobal vp9_ipred_h_8x8_16, 3, 4, 5, dst, stride, l, a
>
> Seemed a bit inefficient so i rewrote it. Around 2x as fast and fewer regs:
>
> cglobal vp9_ipred_h_8x8_16, 3, 3, 4, dst, stride, l, a
> movam2, [lq]
> DEFINE_ARGS dst, stride, stride3
> lea   stride3q, [strideq*3]
> punpckhwd   m3, m2, m2
> pshufd  m0, m3, q
> pshufd  m1, m3, q
> mova  [dstq+strideq*0], m0
> mova  [dstq+strideq*1], m1
> pshufd  m0, m3, q
> pshufd  m1, m3, q
> mova  [dstq+strideq*2], m0
> mova  [dstq+stride3q ], m1
> lea   dstq, [dstq+strideq*4]
> punpcklwd   m2, m2
> pshufd  m0, m2, q
> pshufd  m1, m2, q
> mova  [dstq+strideq*0], m0
> mova  [dstq+strideq*1], m1
> pshufd  m0, m2, q
> pshufd  m1, m2, q
> mova  [dstq+strideq*2], m0
> mova  [dstq+stride3q ], m1
> RET
>
> > +cglobal vp9_ipred_h_16x16_16, 3, 4, 6, dst, stride, l, a
> > +cglobal vp9_ipred_h_32x32_16, 3, 5, 8, dst, stride, l, a
>
> Should be possible to change those to be more similar to the 8x8 above.
>
> > +cglobal vp9_ipred_dc_4x4_16, 4, 4, 2, dst, stride, l, a
> [...]
> > +pshufw  m1, m0, q3232
> > +paddd   m0, m1
> > +paddd   m0, [pd_4]
>
> Swap the last two rows to allow the shuffle and the pd_4 add to
> execute in parallel. The same issue exists in pretty much every other
> dc function as well.
>
> > +cglobal vp9_ipred_dc_32x32_16, 4, 4, 2, dst, stride, l, a
> [...]
> > +.loop:
> > +mova   [dstq+strideq*0+ 0], m0
> > +mova   [dstq+strideq*0+16], m0
> > +mova   [dstq+strideq*0+32], m0
> > +mova   [dstq+strideq*0+48], m0
> > +mova   [dstq+strideq*1+ 0], m0
> > +mova   [dstq+strideq*1+16], m0
> > +mova   [dstq+strideq*1+32], m0
> > +mova   [dstq+strideq*1+48], m0
> > +mova   [dstq+strideq*2+ 0], m0
> > +mova   [dstq+strideq*2+16], m0
> > +mova   [dstq+strideq*2+32], m0
> > +mova   [dstq+strideq*2+48], m0
> > +mova   [dstq+stride3q + 0], m0
> > +mova   [dstq+stride3q +16], m0
> > +mova   [dstq+stride3q +32], m0
> > +mova   [dstq+stride3q +48], m0
> > +lea   dstq, [dstq+strideq*4]
> > +dec   cntd
> > +jg .loop
>
> Cut the number of stores per iteration in half and double the number
> of iterations instead.
>
> > +cglobal vp9_ipred_dc_%1_32x32_16, 4, 4, 2, dst, stride, l, a
> [...]
> > +.loop:
> > +mova   [dstq+strideq*0+ 0], m0
> > +mova   [dstq+strideq*0+16], m0
> > +mova   [dstq+strideq*0+32], m0
> > +mova   [dstq+strideq*0+48], m0
> > +mova   [dstq+strideq*1+ 0], m0
> > +mova   [dstq+strideq*1+16], m0
> > +mova   [dstq+strideq*1+32], m0
> > +mova   [dstq+strideq*1+48], m0
> > +mova   [dstq+strideq*2+ 0], m0
> > +mova   [dstq+strideq*2+16], m0
> > +mova   [dstq+strideq*2+32], m0
> > +mova   [dstq+strideq*2+48], m0
> > +mova   [dstq+stride3q + 0], m0
> > +mova   [dstq+stride3q +16], m0
> > +mova   [dstq+stride3q +32], m0
> > +mova   [dstq+stride3q +48], m0
> > +lea   dstq, [dstq+strideq*4]
> > +dec   cntd
> > +jg .loop
>
> Ditto.
>
> > +cglobal vp9_ipred_tm_4x4_10, 4, 4, 6, dst, stride, l, a
> [...]
> > +movdm0, [aq-2]
> > +pshufw  m0, m0, q
>
> Unaligned load penalty, either movd from [aq-4] or pshufw directly from
> [aq-8].
>
> > +cglobal vp9_ipred_tm_8x8_10, 4, 4, 8, dst, stride, l, a
> [...]
> > +movdm0, [aq-2]
> > +pshuflw m0, m0, q
>
> Ditto, except you don't want to pshuflw directly from memory in this
> case unlike with MMX. You can use vpbroadcastw instead 

Re: [FFmpeg-devel] [PATCH] avformat/flacdec: support fast-seek

2015-10-02 Thread Ching-Yi Chan
2015-10-01 20:31 GMT+08:00 Michael Niedermayer :

> On Fri, Sep 25, 2015 at 11:58:31AM +0800, Ching-Yi Chan wrote:
> > Thanks for checking.
> >
> > I also check the AVFMT_FLAG_FAST_SEEK flag with parsing headers,
> > to fill the seektable into index entries only if AVFMT_FLAG_FAST_SEEK
> flag
> > is on.
> >
> > If the AVFMT_FLAG_FAST_SEEK flag is not enabled, it will seek in original
> > way.
>
> i think we misunderstand us somehow
>
> your code does not work for me
> seeking to  1.894167 results in a seek to
> pts: 0.00 pos:   8256
>
> seeking to  1.470835 results in a seek to
> pts: 0.809796 pos:  27366
>
> you notice that moving the target to a later point moves the result
> to a earlier one.
>
>
oops !
May I have a copy about the tests code. for improving my patch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 0/7] [RFC] x86 assembly constants

2015-10-02 Thread Ronald S. Bultje
Hi,

On Fri, Oct 2, 2015 at 4:58 PM, Hendrik Leppkes  wrote:

> On Fri, Oct 2, 2015 at 7:16 PM, Timothy Gu  wrote:
> > On Fri, Oct 2, 2015 at 10:08 AM James Darnley 
> > wrote:
> >
> >> The third patch uses them in the remaining inline assembly.
> >>
> >
> > That's the crux of the problem: inline asm uses these constants, but will
> > be unable to without yasm. Either we drop compatibility for inline asm
> for
> > x86 platforms w/o yasm, or we can't do this.
> >
>
> A build without yasm is gimped as it is, so disabling inline asm in
> the same go doesn't seem like a too terrible thing.


I'm leaning towards this as well.

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


[FFmpeg-devel] [PATCH] lavf/utils: avoid giving up probing early with long subtitle events

2015-10-02 Thread Rodger Combs
---
 libavformat/utils.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index dc83608..be1472b 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3347,7 +3347,10 @@ int avformat_find_stream_info(AVFormatContext *ic, 
AVDictionary **options)
 break;
 }
 if (pkt->duration) {
-st->info->codec_info_duration+= pkt->duration;
+if (pkt->pts != AV_NOPTS_VALUE && pkt->pts >= st->start_time)
+st->info->codec_info_duration = FFMIN(pkt->pts - 
st->start_time, st->info->codec_info_duration + pkt->duration);
+else
+st->info->codec_info_duration += pkt->duration;
 st->info->codec_info_duration_fields += st->parser && 
st->need_parsing && st->codec->ticks_per_frame ==2 ? st->parser->repeat_pict + 
1 : 2;
 }
 }
-- 
2.6.0

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