[FFmpeg-devel] segments dropped when recording HLS

2017-06-29 Thread Chen You Fu
Hi there,

This problem is exactly the same as that reported in
https://github.com/soimort/you-get/issues/1270

When I try to download HLS with FFMPEG, FFMPEG automatically skip those
segments with the same #EXTINF value. However, it makes the downloaded
video stutter, suggesting that these segments are actually needed. I am not
sure if these old segments should be replaced by those new coming segments
but I guess so. So if I want to implement such function how should I modify
libavformat/hlsproto.c?

Thanks so much

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


Re: [FFmpeg-devel] [PATCH v10] - Added Turing codec interface for ffmpeg

2017-06-29 Thread wm4
On Tue, 16 May 2017 07:45:14 +
Saverio Blasi  wrote:

> Dear all,
> 
> We would appreciate if you could let us know the procedure and expected 
> timeline for integration of our patch related with the Turing codec within 
> the ffmpeg project.

FFmpeg is a project by volunteers and open source enthusiasts (with
some people being paid for implementing specific features or fixing
specific bugs), so there is no planning, no roadmaps, no project
management, no predictable behavior, no guarantees, and no official
responses of any kind. In the end, nobody felt responsible or compelled
to apply it.

Since we made you go through all that review, I'd apply your patch,
though. Can you send it again as a new thread (since some time has
passed)? Then I'd apply it after a 3 day timeout.

Also, please don't top post.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] hevcdec: properly export some side data with frame threading

2017-06-29 Thread wm4
I noticed this with mastering display data. If frame threading is
enabled, this side data is exported only for some frames. It turns out
it's not properly propagated to the worker threads.

I didn't touch A53 captions, because that involves memory allocation and
freeing the data as side data is exported.
---
 libavcodec/hevcdec.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 3b24fb9bec..cc8ac82164 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3355,6 +3355,12 @@ static int hevc_update_thread_context(AVCodecContext 
*dst,
 s->max_ra = INT_MAX;
 }
 
+s->sei.frame_packing= s0->sei.frame_packing;
+s->sei.display_orientation  = s0->sei.display_orientation;
+s->sei.mastering_display= s0->sei.mastering_display;
+s->sei.content_light= s0->sei.content_light;
+s->sei.alternative_transfer = s0->sei.alternative_transfer;
+
 return 0;
 }
 
-- 
2.11.0

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


[FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread Saverio Blasi
- This patch contains the changes to interface the Turing codec 
(http://turingcodec.org/) with ffmpeg. The patch was modified to address the 
comments in the review as follows:
  - Added a pkg-config file to list all dependencies required by libturing. 
This should address the issue pointed out by Hendrik Leppkes on Fri 18/11/2016
  - As per suggestions of wm4, two functions (add_option and finalise_options) 
have been created. The former appends new options while the latter sets up the 
argv array of pointers to char* accordingly. add_option re-allocates the buffer 
for options using av_realloc
  - Additionally, both these functions handle the errors in case the memory 
wasn't allocated correctly
  - malloc|free|realloc have been substituted with their corresponding 
av_{malloc|free|realloc} version
  - Check on bit-depth has been removed since the ffmpeg already casts the 
right pix_fmt and bit depth
  - pix_fmts is now set in ff_libturing_encoder as in h264dec.c.
  - Changed usage of av_free with av_freep and fixed calls to free arrays
  - Added brackets to all if and for statements
  - Avoid repetition of code to free arrays in case of failure to initialise 
the libturing encoder
  - Some fixes to address the review from wm4 and Mark Thompson received on Wed 
08/02/2017
  - Fixed indentation
---
 LICENSE.md |   1 +
 configure  |   6 +
 libavcodec/Makefile|   1 +
 libavcodec/allcodecs.c |   1 +
 libavcodec/libturing.c | 313 +
 5 files changed, 322 insertions(+)
 create mode 100755 libavcodec/libturing.c

diff --git a/LICENSE.md b/LICENSE.md
index ba65b05..03787c0 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -84,6 +84,7 @@ The following libraries are under GPL:
 - frei0r
 - libcdio
 - librubberband
+- libturing
 - libvidstab
 - libx264
 - libx265
diff --git a/configure b/configure
index 2e1786a..0adc4da 100755
--- a/configure
+++ b/configure
@@ -256,6 +256,7 @@ External library support:
   --enable-libssh  enable SFTP protocol via libssh [no]
   --enable-libtesseractenable Tesseract, needed for ocr filter [no]
   --enable-libtheora   enable Theora encoding via libtheora [no]
+  --enable-libturing   enable H.265/HEVC encoding via libturing [no]
   --enable-libtwolame  enable MP2 encoding via libtwolame [no]
   --enable-libv4l2 enable libv4l2/v4l-utils [no]
   --enable-libvidstab  enable video stabilization using vid.stab [no]
@@ -1497,6 +1498,7 @@ EXTERNAL_LIBRARY_GPL_LIST="
 frei0r
 libcdio
 librubberband
+libturing
 libvidstab
 libx264
 libx265
@@ -2875,6 +2877,7 @@ libspeex_decoder_deps="libspeex"
 libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
 libtheora_encoder_deps="libtheora"
+libturing_encoder_deps="libturing"
 libtwolame_encoder_deps="libtwolame"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
 libvorbis_decoder_deps="libvorbis"
@@ -5831,6 +5834,9 @@ enabled libssh&& require_pkg_config libssh 
libssh/sftp.h sftp_init
 enabled libspeex  && require_pkg_config speex speex/speex.h 
speex_decoder_init -lspeex
 enabled libtesseract  && require_pkg_config tesseract tesseract/capi.h 
TessBaseAPICreate
 enabled libtheora && require libtheora theora/theoraenc.h th_info_init 
-ltheoraenc -ltheoradec -logg
+enabled libturing && require_pkg_config libturing turing.h 
turing_version &&
+ { check_cpp_condition turing.h 
"TURING_API_VERSION > 1" ||
+ die "ERROR: libturing requires turing api version 
2 or greater."; }
 enabled libtwolame&& require libtwolame twolame.h twolame_init 
-ltwolame &&
  { check_lib libtwolame twolame.h 
twolame_encode_buffer_float32_interleaved -ltwolame ||
die "ERROR: libtwolame must be installed and 
version must be >= 0.3.10"; }
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 44acc95..0a11a6b 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -909,6 +909,7 @@ OBJS-$(CONFIG_LIBSHINE_ENCODER)   += libshine.o
 OBJS-$(CONFIG_LIBSPEEX_DECODER)   += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)   += libspeexenc.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)  += libtheoraenc.o
+OBJS-$(CONFIG_LIBTURING_ENCODER)  += libturing.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
 OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
 OBJS-$(CONFIG_LIBVORBIS_DECODER)  += libvorbisdec.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 7fcc26f..c729b8d 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -620,6 +620,7 @@ static void register_all(void)
 REGISTER_ENCODER(LIBSHINE,  libshine);
 REGISTER_ENCDEC (LIBSPEEX,  libspeex);
 REGISTER_ENCODER(LIBTHEORA, libtheora);
+REGISTER_ENCODER(LIBTURING, libturing);
  

Re: [FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread wm4
On Thu, 29 Jun 2017 13:54:51 +
Saverio Blasi  wrote:

> - This patch contains the changes to interface the Turing codec 
> (http://turingcodec.org/) with ffmpeg. The patch was modified to address the 
> comments in the review as follows:
>   - Added a pkg-config file to list all dependencies required by libturing. 
> This should address the issue pointed out by Hendrik Leppkes on Fri 18/11/2016
>   - As per suggestions of wm4, two functions (add_option and 
> finalise_options) have been created. The former appends new options while the 
> latter sets up the argv array of pointers to char* accordingly. add_option 
> re-allocates the buffer for options using av_realloc
>   - Additionally, both these functions handle the errors in case the memory 
> wasn't allocated correctly
>   - malloc|free|realloc have been substituted with their corresponding 
> av_{malloc|free|realloc} version
>   - Check on bit-depth has been removed since the ffmpeg already casts the 
> right pix_fmt and bit depth
>   - pix_fmts is now set in ff_libturing_encoder as in h264dec.c.
>   - Changed usage of av_free with av_freep and fixed calls to free arrays
>   - Added brackets to all if and for statements
>   - Avoid repetition of code to free arrays in case of failure to initialise 
> the libturing encoder
>   - Some fixes to address the review from wm4 and Mark Thompson received on 
> Wed 08/02/2017
>   - Fixed indentation
> ---


I meant as a new thread, not as a reply to the existing thread (so,
without a In-Reply-To header). Just so that everyone sees this, instead
of being buried in an older thread.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread Saverio Blasi
- This patch contains the changes to interface the Turing codec 
(http://turingcodec.org/) with ffmpeg. The patch was modified to address the 
comments in the review as follows:
  - Added a pkg-config file to list all dependencies required by libturing. 
This should address the issue pointed out by Hendrik Leppkes on Fri 18/11/2016
  - As per suggestions of wm4, two functions (add_option and finalise_options) 
have been created. The former appends new options while the latter sets up the 
argv array of pointers to char* accordingly. add_option re-allocates the buffer 
for options using av_realloc
  - Additionally, both these functions handle the errors in case the memory 
wasn't allocated correctly
  - malloc|free|realloc have been substituted with their corresponding 
av_{malloc|free|realloc} version
  - Check on bit-depth has been removed since the ffmpeg already casts the 
right pix_fmt and bit depth
  - pix_fmts is now set in ff_libturing_encoder as in h264dec.c.
  - Changed usage of av_free with av_freep and fixed calls to free arrays
  - Added brackets to all if and for statements
  - Avoid repetition of code to free arrays in case of failure to initialise 
the libturing encoder
  - Some fixes to address the review from wm4 and Mark Thompson received on Wed 
08/02/2017
  - Fixed indentation
---
 LICENSE.md |   1 +
 configure  |   6 +
 libavcodec/Makefile|   1 +
 libavcodec/allcodecs.c |   1 +
 libavcodec/libturing.c | 313 +
 5 files changed, 322 insertions(+)
 create mode 100755 libavcodec/libturing.c

diff --git a/LICENSE.md b/LICENSE.md
index ba65b05..03787c0 100644
--- a/LICENSE.md
+++ b/LICENSE.md
@@ -84,6 +84,7 @@ The following libraries are under GPL:
 - frei0r
 - libcdio
 - librubberband
+- libturing
 - libvidstab
 - libx264
 - libx265
diff --git a/configure b/configure
index 2e1786a..0adc4da 100755
--- a/configure
+++ b/configure
@@ -256,6 +256,7 @@ External library support:
   --enable-libssh  enable SFTP protocol via libssh [no]
   --enable-libtesseractenable Tesseract, needed for ocr filter [no]
   --enable-libtheora   enable Theora encoding via libtheora [no]
+  --enable-libturing   enable H.265/HEVC encoding via libturing [no]
   --enable-libtwolame  enable MP2 encoding via libtwolame [no]
   --enable-libv4l2 enable libv4l2/v4l-utils [no]
   --enable-libvidstab  enable video stabilization using vid.stab [no]
@@ -1497,6 +1498,7 @@ EXTERNAL_LIBRARY_GPL_LIST="
 frei0r
 libcdio
 librubberband
+libturing
 libvidstab
 libx264
 libx265
@@ -2875,6 +2877,7 @@ libspeex_decoder_deps="libspeex"
 libspeex_encoder_deps="libspeex"
 libspeex_encoder_select="audio_frame_queue"
 libtheora_encoder_deps="libtheora"
+libturing_encoder_deps="libturing"
 libtwolame_encoder_deps="libtwolame"
 libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
 libvorbis_decoder_deps="libvorbis"
@@ -5831,6 +5834,9 @@ enabled libssh&& require_pkg_config libssh 
libssh/sftp.h sftp_init
 enabled libspeex  && require_pkg_config speex speex/speex.h 
speex_decoder_init -lspeex
 enabled libtesseract  && require_pkg_config tesseract tesseract/capi.h 
TessBaseAPICreate
 enabled libtheora && require libtheora theora/theoraenc.h th_info_init 
-ltheoraenc -ltheoradec -logg
+enabled libturing && require_pkg_config libturing turing.h 
turing_version &&
+ { check_cpp_condition turing.h 
"TURING_API_VERSION > 1" ||
+ die "ERROR: libturing requires turing api version 
2 or greater."; }
 enabled libtwolame&& require libtwolame twolame.h twolame_init 
-ltwolame &&
  { check_lib libtwolame twolame.h 
twolame_encode_buffer_float32_interleaved -ltwolame ||
die "ERROR: libtwolame must be installed and 
version must be >= 0.3.10"; }
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 44acc95..0a11a6b 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -909,6 +909,7 @@ OBJS-$(CONFIG_LIBSHINE_ENCODER)   += libshine.o
 OBJS-$(CONFIG_LIBSPEEX_DECODER)   += libspeexdec.o
 OBJS-$(CONFIG_LIBSPEEX_ENCODER)   += libspeexenc.o
 OBJS-$(CONFIG_LIBTHEORA_ENCODER)  += libtheoraenc.o
+OBJS-$(CONFIG_LIBTURING_ENCODER)  += libturing.o
 OBJS-$(CONFIG_LIBTWOLAME_ENCODER) += libtwolame.o
 OBJS-$(CONFIG_LIBVO_AMRWBENC_ENCODER) += libvo-amrwbenc.o
 OBJS-$(CONFIG_LIBVORBIS_DECODER)  += libvorbisdec.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 7fcc26f..c729b8d 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -620,6 +620,7 @@ static void register_all(void)
 REGISTER_ENCODER(LIBSHINE,  libshine);
 REGISTER_ENCDEC (LIBSPEEX,  libspeex);
 REGISTER_ENCODER(LIBTHEORA, libtheora);
+REGISTER_ENCODER(LIBTURING, libturing);
  

Re: [FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread wm4
On Thu, 29 Jun 2017 14:06:21 +
Saverio Blasi  wrote:

> - This patch contains the changes to interface the Turing codec 
> (http://turingcodec.org/) with ffmpeg. The patch was modified to address the 
> comments in the review as follows:
>   - Added a pkg-config file to list all dependencies required by libturing. 
> This should address the issue pointed out by Hendrik Leppkes on Fri 18/11/2016
>   - As per suggestions of wm4, two functions (add_option and 
> finalise_options) have been created. The former appends new options while the 
> latter sets up the argv array of pointers to char* accordingly. add_option 
> re-allocates the buffer for options using av_realloc
>   - Additionally, both these functions handle the errors in case the memory 
> wasn't allocated correctly
>   - malloc|free|realloc have been substituted with their corresponding 
> av_{malloc|free|realloc} version
>   - Check on bit-depth has been removed since the ffmpeg already casts the 
> right pix_fmt and bit depth
>   - pix_fmts is now set in ff_libturing_encoder as in h264dec.c.
>   - Changed usage of av_free with av_freep and fixed calls to free arrays
>   - Added brackets to all if and for statements
>   - Avoid repetition of code to free arrays in case of failure to initialise 
> the libturing encoder
>   - Some fixes to address the review from wm4 and Mark Thompson received on 
> Wed 08/02/2017
>   - Fixed indentation
> ---

Will apply in 3 days (Monday) unless someone objects.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/5 v2] movenc: use correct tag list for AVOutputFormat.codec_tag

2017-06-29 Thread Derek Buitenhuis
On 6/29/2017 7:51 AM, Paul B Mahol wrote:
> EVRC is audio codec. Shouldn't be mp4a.

Yes.

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


[FFmpeg-devel] [PATCH 1/5 v3] movenc: use correct tag list for AVOutputFormat.codec_tag

2017-06-29 Thread Derek Buitenhuis
From: John Stebbins 

ff_mp4_obj_type contains the wrong type of tags for
AVOutputFormat.codec_tag. AVOutputFormat.codec_tag is used to
validate AVCodecParameters.codec_tag so needs to be the same
type of tag.

Creates new tag lists for mp4 and ismv.  New tag lists support
same list of codecs found in ff_mp4_obj_type. psp uses the same
tag list as mp4 since these both use mp4_get_codec_tag to look up tags.

(cherry picked from commit 713efb2c0d013a42be4051adb7cd90a7c2cbbb4f)
Signed-off-by: Derek Buitenhuis 
---
With fixed EVRC.
---
 libavformat/movenc.c | 42 +++---
 1 file changed, 39 insertions(+), 3 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index ca389e3..f0262e3 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -6488,6 +6488,41 @@ static int mov_check_bitstream(struct AVFormatContext 
*s, const AVPacket *pkt)
 return ret;
 }
 
+const AVCodecTag codec_mp4_tags[] = {
+{ AV_CODEC_ID_MPEG4   , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_H264, MKTAG('a', 'v', 'c', '1') },
+{ AV_CODEC_ID_HEVC, MKTAG('h', 'e', 'v', '1') },
+{ AV_CODEC_ID_MPEG2VIDEO  , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_MPEG1VIDEO  , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_MJPEG   , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_PNG , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_JPEG2000, MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_VC1 , MKTAG('v', 'c', '-', '1') },
+{ AV_CODEC_ID_DIRAC   , MKTAG('d', 'r', 'a', 'c') },
+{ AV_CODEC_ID_TSCC2   , MKTAG('m', 'p', '4', 'v') },
+{ AV_CODEC_ID_VP9 , MKTAG('v', 'p', '0', '9') },
+{ AV_CODEC_ID_AAC , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_MP4ALS  , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_MP3 , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_MP2 , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_AC3 , MKTAG('a', 'c', '-', '3') },
+{ AV_CODEC_ID_EAC3, MKTAG('a', 'c', '-', '3') },
+{ AV_CODEC_ID_DTS , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_FLAC, MKTAG('f', 'L', 'a', 'C') },
+{ AV_CODEC_ID_OPUS, MKTAG('O', 'p', 'u', 's') },
+{ AV_CODEC_ID_VORBIS  , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_QCELP   , MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_EVRC, MKTAG('m', 'p', '4', 'a') },
+{ AV_CODEC_ID_DVD_SUBTITLE, MKTAG('m', 'p', '4', 's') },
+{ AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'x', '3', 'g') },
+{ AV_CODEC_ID_NONE,0 },
+};
+
+const AVCodecTag codec_ism_tags[] = {
+{ AV_CODEC_ID_WMAPRO  , MKTAG('w', 'm', 'a', ' ') },
+{ AV_CODEC_ID_NONE,0 },
+};
+
 #if CONFIG_MOV_MUXER
 MOV_CLASS(mov)
 AVOutputFormat ff_mov_muxer = {
@@ -6548,7 +6583,7 @@ AVOutputFormat ff_mp4_muxer = {
 .write_trailer = mov_write_trailer,
 .deinit= mov_free,
 .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | 
AVFMT_TS_NEGATIVE,
-.codec_tag = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
+.codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, 0 },
 .check_bitstream   = mov_check_bitstream,
 .priv_class= &mp4_muxer_class,
 };
@@ -6569,7 +6604,7 @@ AVOutputFormat ff_psp_muxer = {
 .write_trailer = mov_write_trailer,
 .deinit= mov_free,
 .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | 
AVFMT_TS_NEGATIVE,
-.codec_tag = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
+.codec_tag = (const AVCodecTag* const []){ codec_mp4_tags, 0 },
 .check_bitstream   = mov_check_bitstream,
 .priv_class= &psp_muxer_class,
 };
@@ -6631,7 +,8 @@ AVOutputFormat ff_ismv_muxer = {
 .write_trailer = mov_write_trailer,
 .deinit= mov_free,
 .flags = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | 
AVFMT_TS_NEGATIVE,
-.codec_tag = (const AVCodecTag* const []){ ff_mp4_obj_type, 0 },
+.codec_tag = (const AVCodecTag* const []){
+codec_mp4_tags, codec_ism_tags, 0 },
 .check_bitstream   = mov_check_bitstream,
 .priv_class= &ismv_muxer_class,
 };
-- 
1.8.3.1

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


Re: [FFmpeg-devel] [PATCH] lavu/cpu: disable MMX warning on non x86 platforms

2017-06-29 Thread James Almer
On 6/28/2017 10:21 AM, Clément Bœsch wrote:
> We have AV_CPU_FLAG_ARMV8 == AV_CPU_FLAG_SSE3 which causes a trigger of
> this MMX warning on AArch64.
> ---
>  libavutil/cpu.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> index 16e0c9278f..a22da0fa8c 100644
> --- a/libavutil/cpu.c
> +++ b/libavutil/cpu.c
> @@ -61,7 +61,8 @@ static int get_cpu_flags(void)
>  }
>  
>  void av_force_cpu_flags(int arg){
> -if (   (arg & ( AV_CPU_FLAG_3DNOW|
> +if (ARCH_X86 &&
> +   (arg & ( AV_CPU_FLAG_3DNOW|
>  AV_CPU_FLAG_3DNOWEXT |
>  AV_CPU_FLAG_MMXEXT   |
>  AV_CPU_FLAG_SSE  |
> 

LGTM of course. Goes to show how the CLI or anything where log messages
are clearly visible are barely used on non-x86 targets.

This should be backported as well. It's not simply a warning as it
blindly sets the first bit of the cpuflags variable (MMX on x86, altivec
on PPC, armv6 on arm, etc).
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] lavu/cpu: disable MMX warning on non x86 platforms

2017-06-29 Thread Clément Bœsch
On Thu, Jun 29, 2017 at 12:47:58PM -0300, James Almer wrote:
> On 6/28/2017 10:21 AM, Clément Bœsch wrote:
> > We have AV_CPU_FLAG_ARMV8 == AV_CPU_FLAG_SSE3 which causes a trigger of
> > this MMX warning on AArch64.
> > ---
> >  libavutil/cpu.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavutil/cpu.c b/libavutil/cpu.c
> > index 16e0c9278f..a22da0fa8c 100644
> > --- a/libavutil/cpu.c
> > +++ b/libavutil/cpu.c
> > @@ -61,7 +61,8 @@ static int get_cpu_flags(void)
> >  }
> >  
> >  void av_force_cpu_flags(int arg){
> > -if (   (arg & ( AV_CPU_FLAG_3DNOW|
> > +if (ARCH_X86 &&
> > +   (arg & ( AV_CPU_FLAG_3DNOW|
> >  AV_CPU_FLAG_3DNOWEXT |
> >  AV_CPU_FLAG_MMXEXT   |
> >  AV_CPU_FLAG_SSE  |
> > 
> 
> LGTM of course. Goes to show how the CLI or anything where log messages
> are clearly visible are barely used on non-x86 targets.
> 
> This should be backported as well. It's not simply a warning as it
> blindly sets the first bit of the cpuflags variable (MMX on x86, altivec
> on PPC, armv6 on arm, etc).

applied, feel free to backport

-- 
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 3/3] avformat: add SMPTE 337M demuxer

2017-06-29 Thread Paul B Mahol
On 6/27/17, foo86  wrote:
> ---
>  Changelog|   1 +
>  doc/general.texi |   1 +
>  libavformat/Makefile |   1 +
>  libavformat/allformats.c |   1 +
>  libavformat/s337m.c  | 205
> +++
>  libavformat/version.h|   2 +-
>  6 files changed, 210 insertions(+), 1 deletion(-)
>  create mode 100644 libavformat/s337m.c
>

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


Re: [FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread Derek Buitenhuis
On 6/29/2017 3:06 PM, Saverio Blasi wrote:
> ---
>  LICENSE.md |   1 +
>  configure  |   6 +
>  libavcodec/Makefile|   1 +
>  libavcodec/allcodecs.c |   1 +
>  libavcodec/libturing.c | 313 
> +
>  5 files changed, 322 insertions(+)
>  create mode 100755 libavcodec/libturing.c

1. Missing version bump.

2. patcheck says:
Possible security issue, make sure this is safe or use snprintf/av_strl*
patcheck.stdout:186:+strcpy(option_ctx->s, current_option);

3. libturing git HEAD won't even build with this patch, because it's broken:

END /tmp/ffconf.VbgfCWVe/test.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE 
-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c11 -fomit-frame-pointer 
-pthread -I/usr/local/include -L/usr/local/lib -L/usr/local/lib/boost -c -o 
/tmp/ffconf.VbgfCWVe/test.o /tmp/ffconf.VbgfCWVe/test.c
In file included from /tmp/ffconf.VbgfCWVe/test.c:1:0:
/usr/local/include/turing.h:87:1: error: unknown type name 'bool'
 bool turing_check_binary_option(const char *option);
 ^
ERROR: libturing not found using pkg-config

The API apparently uses C++ bool or C99 stdbool (but doesn't include stdbool.h),
neither of which is OK in FFmpeg, AFAIK. Keep in mind that C99 bool and C++
bool are not compatible.
   

> +if (option_ctx->buffer_filled + option_length + 1 > 
> option_ctx->options_buffer_size) {
> +if (!(option_ctx->options)) {
> +option_ctx->options = av_malloc(option_length + 1);
> +if (!(option_ctx->options)) {
> +return AVERROR(ENOMEM);
> +}
> +} else {
> +temp_ptr = av_realloc(option_ctx->options, 
> option_ctx->options_buffer_size + option_length + 1);
> +if (!(temp_ptr)) {
> +return AVERROR(ENOMEM);
> +}
> +option_ctx->options = temp_ptr;
> +}

You are not allowed to pass memory allocated with av_malloc to av_realloc. This 
is explicitly
stated in the documentation.

> +if (turing_check_binary_option(en->key)) {
> +snprintf(option_string, MAX_OPTION_LENGTH, "--%s", 
> en->key);
> +} else {
> +snprintf(option_string, MAX_OPTION_LENGTH, 
> "--%s=%s", en->key, en->value);
> +}
> +if (error_code = add_option(option_string, 
> &encoder_options)) {
> +goto fail;

dict gets leaked here.
> +} else {
> +output = turing_encode_picture(ctx->encoder, 0);

NULL instead of 0.

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


Re: [FFmpeg-devel] [PATCH 3/3] avformat: add SMPTE 337M demuxer

2017-06-29 Thread Derek Buitenhuis
On 6/27/2017 10:59 AM, foo86 wrote:
> +static int s337m_get_offset_and_codec(AVFormatContext *s,
> +  uint64_t state,
> +  int data_type, int data_size,
> +  int *offset, int *codec)

NIT: Technically, codec should be of type enum AVCodecID.

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


Re: [FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread wm4
On Thu, 29 Jun 2017 20:45:10 +0100
Derek Buitenhuis  wrote:

> Keep in mind that C99 bool and C++
> bool are not compatible.  
>  

(Actually they are.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread Derek Buitenhuis
On 6/29/2017 9:09 PM, wm4 wrote:
> On Thu, 29 Jun 2017 20:45:10 +0100
> Derek Buitenhuis  wrote:
> 
>> Keep in mind that C99 bool and C++
>> bool are not compatible. 
>>   
> 
> (Actually they are.)

Source? Because, from e.g. glibc:

/* Supporting  in C++ is a GCC extension.  */

And AFAICT, there is *nothing* that guarantees C99's _Bool matches
C++'s bool in size or alignment. It's compiler and ABI dependent
and just happens to work with GCC/G++, no?

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


Re: [FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread wm4
On Thu, 29 Jun 2017 21:26:47 +0100
Derek Buitenhuis  wrote:

> On 6/29/2017 9:09 PM, wm4 wrote:
> > On Thu, 29 Jun 2017 20:45:10 +0100
> > Derek Buitenhuis  wrote:
> >   
> >> Keep in mind that C99 bool and C++
> >> bool are not compatible.   
> >>   
> > 
> > (Actually they are.)  
> 
> Source? Because, from e.g. glibc:
> 
> /* Supporting  in C++ is a GCC extension.  */
> 
> And AFAICT, there is *nothing* that guarantees C99's _Bool matches
> C++'s bool in size or alignment. It's compiler and ABI dependent
> and just happens to work with GCC/G++, no?

I meant that both "bool" types are meant to be ABI compatible. (And it
holds up even on Windows with MSVC vs. GCC.)

But yeah, this would at least require including the correct header for
whatever language is used, and C would be forced to at least C99.

(FFmpeg uses C99 though.)

Anyway, getting offtopic. A build failure seems a bit like a deal
breaker, and maybe the strcpy should be killed.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/5 v3] movenc: use correct tag list for AVOutputFormat.codec_tag

2017-06-29 Thread Michael Niedermayer
On Thu, Jun 29, 2017 at 03:52:05PM +0100, Derek Buitenhuis wrote:
> From: John Stebbins 
> 
> ff_mp4_obj_type contains the wrong type of tags for
> AVOutputFormat.codec_tag. AVOutputFormat.codec_tag is used to
> validate AVCodecParameters.codec_tag so needs to be the same
> type of tag.
> 
> Creates new tag lists for mp4 and ismv.  New tag lists support
> same list of codecs found in ff_mp4_obj_type. psp uses the same
> tag list as mp4 since these both use mp4_get_codec_tag to look up tags.
> 
> (cherry picked from commit 713efb2c0d013a42be4051adb7cd90a7c2cbbb4f)
> Signed-off-by: Derek Buitenhuis 
> ---
> With fixed EVRC.
> ---
>  libavformat/movenc.c | 42 +++---
>  1 file changed, 39 insertions(+), 3 deletions(-)

this seems to break:
./ffmpeg -i matrixbench_mpeg2.mpg -f dash file-fdash.dash

[mp4 @ 0x42b6040] Tag [33][0][0][0] incompatible with output codec id '28' 
(avc1)
Could not write header for output file #0 (incorrect codec parameters ?): 
Invalid data found when processing input
Error initializing output stream 0:0 --

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


Re: [FFmpeg-devel] [PATCH 1/5 v3] movenc: use correct tag list for AVOutputFormat.codec_tag

2017-06-29 Thread James Almer
On 6/29/2017 5:51 PM, Michael Niedermayer wrote:
> On Thu, Jun 29, 2017 at 03:52:05PM +0100, Derek Buitenhuis wrote:
>> From: John Stebbins 
>>
>> ff_mp4_obj_type contains the wrong type of tags for
>> AVOutputFormat.codec_tag. AVOutputFormat.codec_tag is used to
>> validate AVCodecParameters.codec_tag so needs to be the same
>> type of tag.
>>
>> Creates new tag lists for mp4 and ismv.  New tag lists support
>> same list of codecs found in ff_mp4_obj_type. psp uses the same
>> tag list as mp4 since these both use mp4_get_codec_tag to look up tags.
>>
>> (cherry picked from commit 713efb2c0d013a42be4051adb7cd90a7c2cbbb4f)
>> Signed-off-by: Derek Buitenhuis 
>> ---
>> With fixed EVRC.
>> ---
>>  libavformat/movenc.c | 42 +++---
>>  1 file changed, 39 insertions(+), 3 deletions(-)
> 
> this seems to break:
> ./ffmpeg -i matrixbench_mpeg2.mpg -f dash file-fdash.dash
> 
> [mp4 @ 0x42b6040] Tag [33][0][0][0] incompatible with output codec id '28' 
> (avc1)
> Could not write header for output file #0 (incorrect codec parameters ?): 
> Invalid data found when processing input
> Error initializing output stream 0:0 --

dashenc is also using ff_mp4_obj_type. Guess it should be a matter of
changing that as well. It would require making the new codec_mp4_tags[]
shared in isom.c
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/5 v3] movenc: use correct tag list for AVOutputFormat.codec_tag

2017-06-29 Thread James Almer
On 6/29/2017 6:17 PM, James Almer wrote:
> On 6/29/2017 5:51 PM, Michael Niedermayer wrote:
>> On Thu, Jun 29, 2017 at 03:52:05PM +0100, Derek Buitenhuis wrote:
>>> From: John Stebbins 
>>>
>>> ff_mp4_obj_type contains the wrong type of tags for
>>> AVOutputFormat.codec_tag. AVOutputFormat.codec_tag is used to
>>> validate AVCodecParameters.codec_tag so needs to be the same
>>> type of tag.
>>>
>>> Creates new tag lists for mp4 and ismv.  New tag lists support
>>> same list of codecs found in ff_mp4_obj_type. psp uses the same
>>> tag list as mp4 since these both use mp4_get_codec_tag to look up tags.
>>>
>>> (cherry picked from commit 713efb2c0d013a42be4051adb7cd90a7c2cbbb4f)
>>> Signed-off-by: Derek Buitenhuis 
>>> ---
>>> With fixed EVRC.
>>> ---
>>>  libavformat/movenc.c | 42 +++---
>>>  1 file changed, 39 insertions(+), 3 deletions(-)
>>
>> this seems to break:
>> ./ffmpeg -i matrixbench_mpeg2.mpg -f dash file-fdash.dash
>>
>> [mp4 @ 0x42b6040] Tag [33][0][0][0] incompatible with output codec id '28' 
>> (avc1)
>> Could not write header for output file #0 (incorrect codec parameters ?): 
>> Invalid data found when processing input
>> Error initializing output stream 0:0 --
> 
> dashenc is also using ff_mp4_obj_type. Guess it should be a matter of
> changing that as well. It would require making the new codec_mp4_tags[]
> shared in isom.c

For the record, this also affects libav. dashenc is currently broken
there because of this patch.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH v11] - Added Turing codec interface for ffmpeg

2017-06-29 Thread Hendrik Leppkes
Am 29.06.2017 21:45 schrieb "Derek Buitenhuis" :

On 6/29/2017 3:06 PM, Saverio Blasi wrote:
> ---
>  LICENSE.md |   1 +
>  configure  |   6 +
>  libavcodec/Makefile|   1 +
>  libavcodec/allcodecs.c |   1 +
>  libavcodec/libturing.c | 313 ++
+++
>  5 files changed, 322 insertions(+)
>  create mode 100755 libavcodec/libturing.c

1. Missing version bump.

2. patcheck says:
Possible security issue, make sure this is safe or use snprintf/av_strl*
patcheck.stdout:186:+strcpy(option_ctx->s, current_option);

3. libturing git HEAD won't even build with this patch, because it's broken:

END /tmp/ffconf.VbgfCWVe/test.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
-D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -std=c11 -fomit-frame-pointer
-pthread -I/usr/local/include -L/usr/local/lib -L/usr/local/lib/boost -c -o
/tmp/ffconf.VbgfCWVe/test.o /tmp/ffconf.VbgfCWVe/test.c
In file included from /tmp/ffconf.VbgfCWVe/test.c:1:0:
/usr/local/include/turing.h:87:1: error: unknown type name 'bool'
 bool turing_check_binary_option(const char *option);
 ^
ERROR: libturing not found using pkg-config

The API apparently uses C++ bool or C99 stdbool (but doesn't include
stdbool.h),
neither of which is OK in FFmpeg, AFAIK. Keep in mind that C99 bool and C++
bool are not compatible.

> +if (option_ctx->buffer_filled + option_length + 1 >
option_ctx->options_buffer_size) {
> +if (!(option_ctx->options)) {
> +option_ctx->options = av_malloc(option_length + 1);
> +if (!(option_ctx->options)) {
> +return AVERROR(ENOMEM);
> +}
> +} else {
> +temp_ptr = av_realloc(option_ctx->options,
option_ctx->options_buffer_size + option_length + 1);
> +if (!(temp_ptr)) {
> +return AVERROR(ENOMEM);
> +}
> +option_ctx->options = temp_ptr;
> +}

You are not allowed to pass memory allocated with av_malloc to av_realloc.
This is explicitly
stated in the documentation.


This requirement is no longer documented for ffmpeg as no systems are known
that actually require this.


> +if (turing_check_binary_option(en->key)) {
> +snprintf(option_string, MAX_OPTION_LENGTH,
"--%s", en->key);
> +} else {
> +snprintf(option_string, MAX_OPTION_LENGTH,
"--%s=%s", en->key, en->value);
> +}
> +if (error_code = add_option(option_string,
&encoder_options)) {
> +goto fail;

dict gets leaked here.
> +} else {
> +output = turing_encode_picture(ctx->encoder, 0);

NULL instead of 0.

- Derek
___
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] Add FITS Decoder

2017-06-29 Thread Michael Niedermayer
On Wed, Jun 28, 2017 at 07:22:01PM +0530, Paras Chadha wrote:
> Added code to export metadata as frame metadata
> 
> Signed-off-by: Paras Chadha 
> -
[...]
> +/**
> + * function reads the fits header and stores the values in FITSDecContext 
> pointed by header
> + * @param avctx - AVCodec context
> + * @param ptr - pointer to pointer to the data
> + * @param header - pointer to the FITSDecContext
> + * @param end - pointer to end of packet
> + * @return 1, if calculated successfully, otherwise AVERROR_INVALIDDATA
> + */
> +static int fits_read_header(AVCodecContext *avctx, const uint8_t **ptr, 
> FITSDecContext * header,
> +const uint8_t * end, AVDictionary **meta)
> +{
> +const uint8_t *ptr8 = *ptr;
> +int lines_read = 0, i, dim_no, t, data_min_found = 0, data_max_found = 
> 0, ret;
> +uint64_t size=1;
> +double d;
> +AVDictionary *metadata = NULL;
> +char keyword[10], value[72];
> +
> +header->blank = LLONG_MIN;
> +header->bscale = 1.0;
> +header->bzero = 0;
> +header->rgb = 0;
> +
> +if (end - ptr8 < 80)
> +return AVERROR_INVALIDDATA;
> +
> +if (sscanf(ptr8, "SIMPLE = %c", &header->simple) == 1) {
> +if (header->simple == 'F') {
> +av_log(avctx, AV_LOG_WARNING, "not a standard FITS file\n");
> +av_dict_set(&metadata, "SIMPLE", "F", 0);
> +} else if (header->simple != 'T') {
> +av_log(avctx, AV_LOG_ERROR, "invalid SIMPLE value, SIMPLE = 
> %c\n", header->simple);
> +return AVERROR_INVALIDDATA;
> +} else {
> +av_dict_set(&metadata, "SIMPLE", "T", 0);
> +}
> +header->xtension = 0;
> +} else if (!strncmp(ptr8, "XTENSION= 'IMAGE", 16)) {
> +header->xtension = 1;
> +av_dict_set(&metadata, "XTENSION", "'IMAGE   '", 0);
> +} else {
> +av_log(avctx, AV_LOG_ERROR, "missing SIMPLE keyword or invalid 
> XTENSION\n");
> +return AVERROR_INVALIDDATA;
> +}
> +
> +ptr8 += 80;
> +lines_read++;
> +
> +if (end - ptr8 < 80)
> +return AVERROR_INVALIDDATA;
> +
> +if (sscanf(ptr8, "BITPIX = %d", &header->bitpix) != 1) {
> +av_log(avctx, AV_LOG_ERROR, "missing BITPIX keyword\n");
> +return AVERROR_INVALIDDATA;
> +}
> +
> +av_dict_set_int(&metadata, "BITPIX", header->bitpix, 0);
> +size = abs(header->bitpix) >> 3;
> +ptr8 += 80;
> +lines_read++;
> +
> +if (end - ptr8 < 80)
> +return AVERROR_INVALIDDATA;
> +
> +if (sscanf(ptr8, "NAXIS = %d", &header->naxis) != 1) {
> +av_log(avctx, AV_LOG_ERROR, "missing NAXIS keyword\n");
> +return AVERROR_INVALIDDATA;
> +}
> +
> +if (!header->naxis) {
> +av_log(avctx, AV_LOG_ERROR, "No image data found, NAXIS = %d\n", 
> header->naxis);
> +return AVERROR_INVALIDDATA;
> +}
> +
> +if (header->naxis != 2 && header->naxis != 3) {
> +av_log(avctx, AV_LOG_ERROR, "unsupported number of dimensions, NAXIS 
> = %d\n", header->naxis);
> +return AVERROR_INVALIDDATA;
> +}
> +
> +av_dict_set_int(&metadata, "NAXIS", header->naxis, 0);
> +ptr8 += 80;
> +lines_read++;
> +
> +for (i = 0; i < header->naxis; i++) {
> +if (end - ptr8 < 80)
> +return AVERROR_INVALIDDATA;
> +
> +if (sscanf(ptr8, "NAXIS%d = %d", &dim_no, &header->naxisn[i]) != 2 
> || dim_no != i+1) {
> +av_log(avctx, AV_LOG_ERROR, "missing NAXIS%d keyword\n", i+1);
> +return AVERROR_INVALIDDATA;
> +}
> +

> +sprintf(keyword, "NAXIS%d", dim_no);

snprintf()


[...]
> +static int fits_decode_frame(AVCodecContext *avctx, void *data, int 
> *got_frame, AVPacket *avpkt)
> +{
> +AVFrame *p=data;
> +const uint8_t *ptr8 = avpkt->data, *end;
> +int16_t t16;
> +int32_t t32;
> +int64_t t64;
> +float   tflt;
> +double  tdbl;
> +int ret, i, j;
> +uint8_t *dst8;
> +uint16_t *dst16;
> +uint32_t *dst32;
> +uint64_t *dst64, size, r, g, b, a, t;
> +FITSDecContext * header = avctx->priv_data;
> +
> +end = ptr8 + avpkt->size;

> +if (ret = fits_read_header(avctx, &ptr8, header, end, &p->metadata) < 0)

missing ()

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

Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch


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


Re: [FFmpeg-devel] [PATCH 1/2] checkasm: add sbrdsp tests

2017-06-29 Thread Michael Niedermayer
On Wed, Jun 28, 2017 at 02:48:55PM +0200, Matthieu Bouron wrote:
> On Fri, Jun 23, 2017 at 05:01:35PM +0200, Matthieu Bouron wrote:
> > On Thu, Jun 22, 2017 at 12:53:52PM -0300, James Almer wrote:
> > > On 6/22/2017 9:56 AM, Matthieu Bouron wrote:
> > > > ---
> > > > 
> > > > The following patchset applies on top of Clément's aacpsdsp patchset.
> > > > 
> > > > ---
> > > >  tests/checkasm/Makefile   |   3 +-
> > > >  tests/checkasm/checkasm.c |   1 +
> > > >  tests/checkasm/checkasm.h |   1 +
> > > >  tests/checkasm/sbrdsp.c   | 297 
> > > > ++
> > > >  4 files changed, 301 insertions(+), 1 deletion(-)
> > > >  create mode 100644 tests/checkasm/sbrdsp.c
> > > > 
> > > > diff --git a/tests/checkasm/Makefile b/tests/checkasm/Makefile
> > > > index 638e811931..60e80ab738 100644
> > > > --- a/tests/checkasm/Makefile
> > > > +++ b/tests/checkasm/Makefile
> > > > @@ -13,7 +13,8 @@ AVCODECOBJS-$(CONFIG_VP8DSP)+= vp8dsp.o
> > > >  AVCODECOBJS-$(CONFIG_VIDEODSP)  += videodsp.o
> > > >  
> > > >  # decoders/encoders
> > > > -AVCODECOBJS-$(CONFIG_AAC_DECODER)   += aacpsdsp.o
> > > > +AVCODECOBJS-$(CONFIG_AAC_DECODER)   += aacpsdsp.o \
> > > > +   sbrdsp.o
> > > >  AVCODECOBJS-$(CONFIG_ALAC_DECODER)  += alacdsp.o
> > > >  AVCODECOBJS-$(CONFIG_DCA_DECODER)   += synth_filter.o
> > > >  AVCODECOBJS-$(CONFIG_JPEG2000_DECODER)  += jpeg2000dsp.o
> > > > diff --git a/tests/checkasm/checkasm.c b/tests/checkasm/checkasm.c
> > > > index e66744b162..29f201b1b3 100644
> > > > --- a/tests/checkasm/checkasm.c
> > > > +++ b/tests/checkasm/checkasm.c
> > > > @@ -67,6 +67,7 @@ static const struct {
> > > >  #if CONFIG_AVCODEC
> > > >  #if CONFIG_AAC_DECODER
> > > >  { "aacpsdsp", checkasm_check_aacpsdsp },
> > > > +{ "sbrdsp",   checkasm_check_sbrdsp },
> > > >  #endif
> > > >  #if CONFIG_ALAC_DECODER
> > > >  { "alacdsp", checkasm_check_alacdsp },
> > > > diff --git a/tests/checkasm/checkasm.h b/tests/checkasm/checkasm.h
> > > > index dfb0ce561c..fa51e71e4b 100644
> > > > --- a/tests/checkasm/checkasm.h
> > > > +++ b/tests/checkasm/checkasm.h
> > > > @@ -50,6 +50,7 @@ void checkasm_check_hevc_idct(void);
> > > >  void checkasm_check_jpeg2000dsp(void);
> > > >  void checkasm_check_llviddsp(void);
> > > >  void checkasm_check_pixblockdsp(void);
> > > > +void checkasm_check_sbrdsp(void);
> > > >  void checkasm_check_synth_filter(void);
> > > >  void checkasm_check_v210enc(void);
> > > >  void checkasm_check_vp8dsp(void);
> > > > diff --git a/tests/checkasm/sbrdsp.c b/tests/checkasm/sbrdsp.c
> > > > new file mode 100644
> > > > index 00..8333510c6b
> > > > --- /dev/null
> > > > +++ b/tests/checkasm/sbrdsp.c
> > > > @@ -0,0 +1,297 @@
> > > > +/*
> > > > + * This file is part of FFmpeg.
> > > > + *
> > > > + * FFmpeg is free software; you can redistribute it and/or modify
> > > > + * it under the terms of the GNU General Public License as published by
> > > > + * the Free Software Foundation; either version 2 of the License, or
> > > > + * (at your option) any later version.
> > > > + *
> > > > + * FFmpeg is distributed in the hope that it will be useful,
> > > > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > > > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > > > + * GNU General Public License for more details.
> > > > + *
> > > > + * You should have received a copy of the GNU General Public License 
> > > > along
> > > > + * with FFmpeg; if not, write to the Free Software Foundation, Inc.,
> > > > + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> > > > + */
> > > > +
> > > > +#include "libavcodec/sbrdsp.h"
> > > > +
> > > > +#include "checkasm.h"
> > > > +
> > > > +#define randomize(buf, len) do {\
> > > > +int i;  \
> > > > +for (i = 0; i < len; i++) { \
> > > > +const INTFLOAT f = (INTFLOAT)rnd() / UINT_MAX;  \
> > > > +(buf)[i] = f;   \
> > > > +}   \
> > > > +} while (0)
> > > > +
> > > > +#define EPS 0.0001
> > > > +
> > > > +static void test_sum64x5(void)
> > > > +{
> > > > +LOCAL_ALIGNED_16(INTFLOAT, dst0, [64 + 256]);
> > > > +LOCAL_ALIGNED_16(INTFLOAT, dst1, [64 + 256]);
> > > > +
> > > > +declare_func(void, INTFLOAT *z);
> > > > +
> > > > +randomize((INTFLOAT *)dst0, 64 + 256);
> > > > +memcpy(dst1, dst0, (64 + 256) * sizeof(INTFLOAT));
> > > > +call_ref(dst0);
> > > > +call_new(dst1);
> > > > +if (!float_near_abs_eps_array(dst0, dst1, EPS, 64 + 256))
> > > > +fail();
> > > > +bench_new(dst1);
> > > > +}
> > > > +
> > > > +static void test_sum_square(void)
> > > > +{
> > > > +INTFLOAT res0;
> > > > +INTFLOAT res

Re: [FFmpeg-devel] patch 1. Correction of loop behaviour in ffpeg.c

2017-06-29 Thread Michael Niedermayer
On Wed, Jun 28, 2017 at 03:02:42PM +0300, ffm...@a.legko.ru wrote:
> 
> subject: when input sample stops, input thread stops too (withous
> restart), thus, breaking the streaming and loop mode does not affect
> this. touches only multistream (multiprog) mode, when threads are
> used.
> 

>  ffmpeg.c |   27 +++
>  1 file changed, 27 insertions(+)
> 0884edd00a6d3466d157519a0d48763545f44087  
> 0001-add-support-for-samples-looping-threaded-mode-thread.patch
> From d8310311a3c1a1828eacd4b45b31f9a723b5ee2b Mon Sep 17 00:00:00 2001

> From: root 

Missing name (unless you do not want to have your name in the Author
field)


> Date: Wed, 28 Jun 2017 14:53:40 +0300
> Subject: [PATCH 1/3] add support for samples looping (threaded mode; thread
>  stops after decoding input)
> 
> ---
>  ffmpeg.c | 27 +++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/ffmpeg.c b/ffmpeg.c
> index a783e6e..2866754 100644
> --- a/ffmpeg.c
> +++ b/ffmpeg.c
> @@ -4013,6 +4013,29 @@ static void free_input_threads(void)
>  }
>  }
>  
> +static int init_input_thread(int i)
> +{
> +int ret;
> +  
> +if (nb_input_files == 1)
> +   return 0;
> +

> +InputFile *f = input_files[i];

mixing declaration and statment


> +if (f->ctx->pb ? !f->ctx->pb->seekable :
> +   strcmp(f->ctx->iformat->name, "lavfi"))
> +   f->non_blocking = 1;
> +ret = av_thread_message_queue_alloc(&f->in_thread_queue,
> +   f->thread_queue_size, sizeof(AVPacket));
> +if (ret < 0)
> +   return ret;
> +if ((ret = pthread_create(&f->thread, NULL, input_thread, f))) {
> +   av_log(NULL, AV_LOG_ERROR, "pthread_create failed: %s. Try to 
> increase `ulimit -v` or decrease `ulimit -s`.\n", strerror(ret));
> +   av_thread_message_queue_free(&f->in_thread_queue);

> +   return AVERROR(ret);
> +}
> +return 0;

the indention is inconsistent


> +}
> + 
>  static int init_input_threads(void)
>  {
>  int i, ret;
> @@ -4191,9 +4214,13 @@ static int process_input(int file_index)
>  ifile->eagain = 1;
>  return ret;
>  }
> +
>  if (ret < 0 && ifile->loop) {
>  if ((ret = seek_to_start(ifile, is)) < 0)
>  return ret;
> +#if HAVE_PTHREADS

> +init_input_thread(file_index);

The function returns an error code which is never used


> +#endif
>  ret = get_input_packet(ifile, &pkt);
>  if (ret == AVERROR(EAGAIN)) {
>  ifile->eagain = 1;
> -- 
> 2.7.4
> 

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


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The worst form of inequality is to try to make unequal things equal.
-- Aristotle


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


[FFmpeg-devel] Using FFMPEG to encode multiple outputs in 'parallel' (doesn't work?)

2017-06-29 Thread Shalin Mehta
I am posting this question in development community because the feature
that I am looking for is not supported as per my understanding. I would
like to know what ffmpeg developers think about implementing this. I hope
this is the right place for such question.

So this is how it goes:

Quoting from the ffmpeg's wiki for creating multiple outputs.
https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs
*Parallel encoding*:
Outputting and re encoding multiple times in the same FFmpeg process will
typically slow down to the "slowest encoder" in your list. Some encoders
(like libx264) perform their encoding "threaded and in the background" so
they will effectively allow for parallel encodings.

Unfortunately, my results are not correlating with what is mentioned above.
By that I mean, I am not seeing encodings being performed in parallel on
multiple outputs even when using libx264.

To simplify the problem and to understand it easily, here's what I am doing
for strictly benchmarking purposes.

Option1: Run 3 instances of ffmpeg in parallel as 3 separate processes.
ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null -
ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null -
ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null -

Option2: run all three encodes in single ffmpeg process
ffmpeg -i input.mp4 -c:v libx264 -b:v 12M -f null - -c:v libx264 -b:v 12M
-f null - -c:v libx264 -b:v 12M -f null -

I am executing this workload on 32 core platform on google cloud.
Option1 gives me nearly 100% cpu utilization. In case of Option 2 cpu
utilization doesn't go beyond 50% and also fps is about 70% of the option1.

Then why don't I just use Option1?
Because Option2 decodes the input only once. I need to generate many
streams (up to 25 streams) from the same input file which could be 4K or
even bigger. So I want to avoid the overhead of decoding the same input so
many times in Option1.
So basically, I want to make Option2 work but I am not understanding why
it's not running all the encodes in parallel to give me better fps and
maximum cpu utilization.

After taking a quick look at the code, it doesn't seem like ffmpeg is
creating multiple threads to run multiple x264 encode sessions in parallel.
I know x264 library itself will create multiple threads but that's for a
single output. What I am looking for is output level parallelism.
Can some one explain if this is possible?
Or may be, I can use some different kind of command line to achieve such
output level parallelism?
If this is not currently supported in ffmpeg what would be your estimate to
implement some thing like this given that it is even possible to begin with.

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


Re: [FFmpeg-devel] [PATCH 1/2] checkasm: add sbrdsp tests

2017-06-29 Thread Henrik Gramner
On Fri, Jun 30, 2017 at 1:58 AM, Michael Niedermayer
 wrote:
> Program received signal SIGSEGV, Segmentation fault.
> 0x00684919 in ff_sbr_hf_gen_sse ()

>0x00684909 :   sub%r9,%r8

> => 0x00684919 :   movaps (%rsi,%r8,1),%xmm0

> r9 0xdeadbeef0080   -2401053092612145024

Another case of a 32-bit int being used as part of a 64-bit operation.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] checkasm: add sbrdsp tests

2017-06-29 Thread James Almer
On 6/29/2017 10:14 PM, Henrik Gramner wrote:
> On Fri, Jun 30, 2017 at 1:58 AM, Michael Niedermayer
>  wrote:
>> Program received signal SIGSEGV, Segmentation fault.
>> 0x00684919 in ff_sbr_hf_gen_sse ()
> 
>>0x00684909 :   sub%r9,%r8
> 
>> => 0x00684919 :   movaps (%rsi,%r8,1),%xmm0
> 
>> r9 0xdeadbeef0080   -2401053092612145024
> 
> Another case of a 32-bit int being used as part of a 64-bit operation.

I can't reproduce it on my ArchLinux x86_64 environment for some reason,
but based on what you said i assume the attached patch should fix it.
From f4646091b450b7c4c5479fbb4163ef89615a4a8d Mon Sep 17 00:00:00 2001
From: James Almer 
Date: Thu, 29 Jun 2017 22:51:04 -0300
Subject: [PATCH] x86/sbrdsp: zero extend start and end gprs in
 ff_sbr_hf_gen_sse

Signed-off-by: James Almer 
---
 libavcodec/x86/sbrdsp.asm | 26 +-
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/libavcodec/x86/sbrdsp.asm b/libavcodec/x86/sbrdsp.asm
index d0f774b277..c716184b14 100644
--- a/libavcodec/x86/sbrdsp.asm
+++ b/libavcodec/x86/sbrdsp.asm
@@ -149,19 +149,19 @@ cglobal sbr_hf_gen, 4,4,8, X_high, X_low, alpha0, alpha1, 
BW, S, E
 ; start and end 6th and 7th args on stack
 movr2d, Sm
 movr3d, Em
-%define  start r2q
-%define  end   r3q
+DEFINE_ARGS X_high, X_low, start, end
 %else
 ; BW does not actually occupy a register, so shift by 1
-%define  start BWq
-%define  end   Sq
+DEFINE_ARGS X_high, X_low, alpha0, alpha1, start, end
+movsxd  startq, startd
+movsxdendq, endd
 %endif
-sub  start, end  ; neg num of loops
-leaX_highq, [X_highq + end*2*4]
-lea X_lowq, [X_lowq  + end*2*4 - 2*2*4]
-shl  start, 3; offset from num loops
+sub startq, endq ; neg num of loops
+leaX_highq, [X_highq + endq*2*4]
+lea X_lowq, [X_lowq  + endq*2*4 - 2*2*4]
+shl startq, 3; offset from num loops
 
-movam0, [X_lowq + start]
+movam0, [X_lowq + startq]
 shufps  m3, m3, q
 shufps  m4, m4, q
 xorps   m3, [ps_mask]
@@ -169,7 +169,7 @@ cglobal sbr_hf_gen, 4,4,8, X_high, X_low, alpha0, alpha1, 
BW, S, E
 shufps  m2, m2, q
 xorps   m4, [ps_mask]
 .loop2:
-movum7, [X_lowq + start + 8]; BbCc
+movum7, [X_lowq + startq + 8]   ; BbCc
 movam6, m0
 movam5, m7
 shufps  m0, m0, q2301   ; aAbB
@@ -179,12 +179,12 @@ cglobal sbr_hf_gen, 4,4,8, X_high, X_low, alpha0, alpha1, 
BW, S, E
 mulps   m6, m2
 mulps   m5, m1
 addps   m7, m0
-movam0, [X_lowq + start +16]; CcDd
+movam0, [X_lowq + startq + 16]  ; CcDd
 addps   m7, m0
 addps   m6, m5
 addps   m7, m6
-mova  [X_highq + start], m7
-add start, 16
+mova  [X_highq + startq], m7
+add startq, 16
 jnz .loop2
 RET
 
-- 
2.13.0

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


[FFmpeg-devel] [BUG] RTSP protocol not waiting for response after sending ending TEARDOWN

2017-06-29 Thread Jérôme Carretero
Hi,


I noticed (using Wireshark) that FFMPEG (3.1.8) would sometimes close
an RTSP control connection (TCP FIN) before it tries to get a response
to the TEARDOWN request.


There is an open bug (https://trac.ffmpeg.org/ticket/4929) about not
sending TEARDOWN, it's probably still not solving this problem.


Regards,

-- 
Jérôme
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] x86/utvideodsp: make restore_rgb_planes functions work on x86_32

2017-06-29 Thread James Almer
Signed-off-by: James Almer 
---
 libavcodec/x86/utvideodsp.asm| 20 ++--
 libavcodec/x86/utvideodsp_init.c |  2 +-
 2 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/libavcodec/x86/utvideodsp.asm b/libavcodec/x86/utvideodsp.asm
index a74d6e9ec1..e44c1ea471 100644
--- a/libavcodec/x86/utvideodsp.asm
+++ b/libavcodec/x86/utvideodsp.asm
@@ -21,8 +21,6 @@
 
 %include "libavutil/x86/x86util.asm"
 
-%if ARCH_X86_64
-
 SECTION_RODATA
 
 pb_128:  times 16 db 128
@@ -36,12 +34,18 @@ INIT_XMM sse2
 ; void restore_rgb_planes(uint8_t *src_r, uint8_t *src_g, uint8_t *src_b,
 ; ptrdiff_t linesize_r, ptrdiff_t linesize_g, 
ptrdiff_t linesize_b,
 ; int width, int height)
-cglobal restore_rgb_planes, 8,9,4, src_r, src_g, src_b, linesize_r, 
linesize_g, linesize_b, w, h, x
+cglobal restore_rgb_planes, 7 + ARCH_X86_64, 7 + ARCH_X86_64 * 2, 4, src_r, 
src_g, src_b, linesize_r, linesize_g, linesize_b, w, h, x
 movsxdifnidn wq, wd
 add  src_rq, wq
 add  src_gq, wq
 add  src_bq, wq
 neg  wq
+%if ARCH_X86_64 == 0
+mov  wm, wq
+DEFINE_ARGS src_r, src_g, src_b, linesize_r, linesize_g, linesize_b, x
+%define wq r6m
+%define hd r7mp
+%endif
 mova m3, [pb_128]
 .nextrow:
 mov  xq, wq
@@ -65,7 +69,7 @@ cglobal restore_rgb_planes, 8,9,4, src_r, src_g, src_b, 
linesize_r, linesize_g,
 jg .nextrow
 REP_RET
 
-cglobal restore_rgb_planes10, 8,9,5, src_r, src_g, src_b, linesize_r, 
linesize_g, linesize_b, w, h, x
+cglobal restore_rgb_planes10, 7 + ARCH_X86_64, 7 + ARCH_X86_64 * 2, 5, src_r, 
src_g, src_b, linesize_r, linesize_g, linesize_b, w, h, x
 shl  wd, 1
 shl linesize_rq, 1
 shl linesize_gq, 1
@@ -76,6 +80,12 @@ cglobal restore_rgb_planes10, 8,9,5, src_r, src_g, src_b, 
linesize_r, linesize_g
 mova m3, [pw_512]
 mova m4, [pw_1023]
 neg  wq
+%if ARCH_X86_64 == 0
+mov  wm, wq
+DEFINE_ARGS src_r, src_g, src_b, linesize_r, linesize_g, linesize_b, x
+%define wq r6m
+%define hd r7mp
+%endif
 .nextrow:
 mov  xq, wq
 
@@ -99,5 +109,3 @@ cglobal restore_rgb_planes10, 8,9,5, src_r, src_g, src_b, 
linesize_r, linesize_g
 subhd, 1
 jg .nextrow
 REP_RET
-
-%endif
diff --git a/libavcodec/x86/utvideodsp_init.c b/libavcodec/x86/utvideodsp_init.c
index d4156926bd..f8b2a9b074 100644
--- a/libavcodec/x86/utvideodsp_init.c
+++ b/libavcodec/x86/utvideodsp_init.c
@@ -36,7 +36,7 @@ av_cold void ff_utvideodsp_init_x86(UTVideoDSPContext *c)
 {
 int cpu_flags = av_get_cpu_flags();
 
-if (ARCH_X86_64 && EXTERNAL_SSE2(cpu_flags)) {
+if (EXTERNAL_SSE2(cpu_flags)) {
 c->restore_rgb_planes   = ff_restore_rgb_planes_sse2;
 c->restore_rgb_planes10 = ff_restore_rgb_planes10_sse2;
 }
-- 
2.13.0

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


[FFmpeg-devel] [PATCH] Add FITS Decoder

2017-06-29 Thread Paras Chadha
Made the changes suggested above

Signed-off-by: Paras Chadha 
---
 Changelog   |   1 +
 doc/general.texi|   2 +
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/avcodec.h|   1 +
 libavcodec/codec_desc.c |   8 +
 libavcodec/fitsdec.c| 580 
 libavcodec/version.h|   4 +-
 libavformat/img2.c  |   1 +
 9 files changed, 597 insertions(+), 2 deletions(-)
 create mode 100644 libavcodec/fitsdec.c

diff --git a/Changelog b/Changelog
index a8726c6..2c2bdec 100644
--- a/Changelog
+++ b/Changelog
@@ -26,6 +26,7 @@ version :
   --x86asmexe=yasm to configure to restore the old behavior.
 - additional frame format support for Interplay MVE movies
 - support for decoding through D3D11VA in ffmpeg
+- FITS demuxer and decoder

 version 3.3:
 - CrystalHD decoder moved to new decode API
diff --git a/doc/general.texi b/doc/general.texi
index 8f582d5..c00ce32 100644
--- a/doc/general.texi
+++ b/doc/general.texi
@@ -591,6 +591,8 @@ following image formats are supported:
 @tab Digital Picture Exchange
 @item EXR  @tab   @tab X
 @tab OpenEXR
+@item FITS @tab   @tab X
+@tab Flexible Image Transport System
 @item JPEG @tab X @tab X
 @tab Progressive JPEG is not supported.
 @item JPEG 2000@tab X @tab X
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index b440a00..729e95e 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -291,6 +291,7 @@ OBJS-$(CONFIG_FFV1_DECODER)+= ffv1dec.o ffv1.o
 OBJS-$(CONFIG_FFV1_ENCODER)+= ffv1enc.o ffv1.o
 OBJS-$(CONFIG_FFWAVESYNTH_DECODER) += ffwavesynth.o
 OBJS-$(CONFIG_FIC_DECODER) += fic.o
+OBJS-$(CONFIG_FITS_DECODER)+= fitsdec.o
 OBJS-$(CONFIG_FLAC_DECODER)+= flacdec.o flacdata.o flac.o
 OBJS-$(CONFIG_FLAC_ENCODER)+= flacenc.o flacdata.o flac.o 
vorbis_data.o
 OBJS-$(CONFIG_FLASHSV_DECODER) += flashsv.o
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0243f47..a4cfd80 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -192,6 +192,7 @@ static void register_all(void)
 REGISTER_ENCDEC (FFV1,  ffv1);
 REGISTER_ENCDEC (FFVHUFF,   ffvhuff);
 REGISTER_DECODER(FIC,   fic);
+REGISTER_DECODER(FITS,  fits);
 REGISTER_ENCDEC (FLASHSV,   flashsv);
 REGISTER_ENCDEC (FLASHSV2,  flashsv2);
 REGISTER_DECODER(FLIC,  flic);
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index b697afa..8eba460 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -447,6 +447,7 @@ enum AVCodecID {
 AV_CODEC_ID_SRGC,
 AV_CODEC_ID_SVG,
 AV_CODEC_ID_GDV,
+AV_CODEC_ID_FITS,

 /* various PCM "codecs" */
 AV_CODEC_ID_FIRST_AUDIO = 0x1, ///< A dummy id pointing at the 
start of audio codecs
diff --git a/libavcodec/codec_desc.c b/libavcodec/codec_desc.c
index cf1246e..0112517 100644
--- a/libavcodec/codec_desc.c
+++ b/libavcodec/codec_desc.c
@@ -1464,6 +1464,14 @@ static const AVCodecDescriptor codec_descriptors[] = {
  AV_CODEC_PROP_LOSSLESS,
 },
 {
+.id= AV_CODEC_ID_FITS,
+.type  = AVMEDIA_TYPE_VIDEO,
+.name  = "fits",
+.long_name = NULL_IF_CONFIG_SMALL("Flexible Image Transport System"),
+.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSY |
+ AV_CODEC_PROP_LOSSLESS,
+},
+{
 .id= AV_CODEC_ID_GIF,
 .type  = AVMEDIA_TYPE_VIDEO,
 .name  = "gif",
diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c
new file mode 100644
index 000..4eaf3c8
--- /dev/null
+++ b/libavcodec/fitsdec.c
@@ -0,0 +1,580 @@
+/*
+ * FITS image decoder
+ * Copyright (c) 2017 Paras Chadha
+ *
+ * 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
+ */
+
+/**
+ * @file
+ * FITS image decoder
+ * It supports all 2-d images alongwith, bzero, bscale and blank keywords.
+ * RGBA images are supported as NAXIS3 = 3 or 4 i.e. Planes in RGBA order. 
Also CTYPE = 'RGB ' should be present.
+ * Also to interpret data, values are linearly scaled using min-max scaling 
but not RGB images.

[FFmpeg-devel] [PATCH] libavformat/avformat.h: Move docs inside of #if

2017-06-29 Thread Max Weber
Otherwise AVTimebaseSource gets av_apply_bitstream_filters' documentation in 
doxygen.

Signed-off-by: Max Weber 
---
 libavformat/avformat.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 4ab217dc17..b0de66ac14 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -2954,6 +2954,7 @@ int avformat_match_stream_specifier(AVFormatContext *s, 
AVStream *st,
 
 int avformat_queue_attached_pictures(AVFormatContext *s);
 
+#if FF_API_OLD_BSF
 /**
  * Apply a list of bitstream filters to a packet.
  *
@@ -2965,7 +2966,6 @@ int avformat_queue_attached_pictures(AVFormatContext *s);
  * @return  >=0 on success;
  *  AVERROR code on failure
  */
-#if FF_API_OLD_BSF
 attribute_deprecated
 int av_apply_bitstream_filters(AVCodecContext *codec, AVPacket *pkt,
AVBitStreamFilterContext *bsfc);
-- 
2.11.0.windows.1

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