[FFmpeg-devel] [PATCH v2] avformat/apngdec: validate frame dimensions.

2014-11-26 Thread Benoit Fouet
---
 libavformat/apngdec.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index dac71f1..1b59b82 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -295,7 +295,11 @@ static int decode_fctl_chunk(AVFormatContext *s, 
APNGDemuxContext *ctx, AVPacket
 height != s-streams[0]-codec-height ||
 x_offset != 0 ||
 y_offset != 0) {
-if (sequence_number == 0)
+if (sequence_number == 0 ||
+x_offset = s-streams[0]-codec-width ||
+width  s-streams[0]-codec-width - x_offset ||
+y_offset = s-streams[0]-codec-height ||
+height  s-streams[0]-codec-height - y_offset)
 return AVERROR_INVALIDDATA;
 ctx-is_key_frame = 0;
 } else {
-- 
2.2.0.rc2.23.gca0107e

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


Re: [FFmpeg-devel] [PATCH] lavf/apngdec: use AVStream.time_base instead of r_frame_rate

2014-11-26 Thread Benoit Fouet
Hi,

- Mail original -
 On 25/11/14 6:53 PM, Benoit Fouet wrote:
  i suggest to use set_pts_info to set a reasonable precisse
  timebase something like one millionth or billionth or similar in
  base 2. and then set pts based on these delays and the previous
  timestamp
  
  James, do you want to have a look at this approach or do you want
  me to do it?
 
 I'll leave it to you.
 

OK

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


[FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Timo Rothenpieler

This patch adds support for encoding with Nvidia NVENC on Windows and Linux.

I'm not sure if this needs to be flagged as nonfree. As far as I'm 
aware, it should not affect how the resulting binaries can be redistributed.


The only dependency this has is the nvEncodeAPI.h from the NVENC SDK, 
which can be downloaded from Nvidia:


https://developer.nvidia.com/nvidia-video-codec-sdk

The header is somewhat hidden in the Samples directory.

I attached the current version of the patch.
It can also be found on my github fork:

https://github.com/BtbN/FFmpeg/tree/nvenc
From e59915fc771ca1c5afd0c5c7ed04227933206a39 Mon Sep 17 00:00:00 2001
From: Timo Rothenpieler t...@rothenpieler.org
Date: Wed, 26 Nov 2014 11:08:11 +0100
Subject: [PATCH] Add NVENC encoder

---
 configure   |   11 +-
 libavcodec/Makefile |1 +
 libavcodec/allcodecs.c  |1 +
 libavcodec/nvenc.c  | 1015 +++
 libavcodec/nvenc.h  |   25 ++
 libavcodec/nvenc_api.c  |  330 +++
 libavcodec/nvenc_api.h  |   38 ++
 libavcodec/nvenc_cuda.h |   62 +++
 8 files changed, 1481 insertions(+), 2 deletions(-)
 create mode 100644 libavcodec/nvenc.c
 create mode 100644 libavcodec/nvenc.h
 create mode 100644 libavcodec/nvenc_api.c
 create mode 100644 libavcodec/nvenc_api.h
 create mode 100644 libavcodec/nvenc_cuda.h

diff --git a/configure b/configure
index 38619c4..d0b790c 100755
--- a/configure
+++ b/configure
@@ -261,6 +261,7 @@ External library support:
   --enable-libzvbi enable teletext support via libzvbi [no]
   --disable-lzma   disable lzma [autodetect]
   --enable-decklinkenable Blackmagick DeckLink I/O support [no]
+  --enable-nvenc   enable NVIDIA NVENC support [no]
   --enable-openal  enable OpenAL 1.1 capture support [no]
   --enable-opencl  enable OpenCL code
   --enable-opengl  enable OpenGL rendering [no]
@@ -1393,6 +1394,7 @@ EXTERNAL_LIBRARY_LIST=
 libzmq
 libzvbi
 lzma
+nvenc
 openal
 opencl
 opengl
@@ -2389,6 +2391,7 @@ libxvid_encoder_deps=libxvid
 libutvideo_decoder_deps=libutvideo
 libutvideo_encoder_deps=libutvideo
 libzvbi_teletext_decoder_deps=libzvbi
+nvenc_encoder_deps=nvenc
 
 # demuxers / muxers
 ac3_demuxer_select=ac3_parser
@@ -2569,9 +2572,7 @@ drawtext_filter_deps=libfreetype
 ebur128_filter_deps=gpl
 flite_filter_deps=libflite
 frei0r_filter_deps=frei0r dlopen
-frei0r_filter_extralibs='$ldl'
 frei0r_src_filter_deps=frei0r dlopen
-frei0r_src_filter_extralibs='$ldl'
 geq_filter_deps=gpl
 histeq_filter_deps=gpl
 hqdn3d_filter_deps=gpl
@@ -4650,6 +4651,11 @@ elif check_func dlopen -ldl; then
 ldl=-ldl
 fi
 
+# set a few flags which depend on ldl and can't be set earlier
+nvenc_encoder_extralibs='$ldl'
+frei0r_filter_extralibs='$ldl'
+frei0r_src_filter_extralibs='$ldl'
+
 if ! disabled network; then
 check_func getaddrinfo $network_extralibs
 check_func getservbyport $network_extralibs
@@ -4913,6 +4919,7 @@ enabled libxavsrequire libxavs xavs.h xavs_encoder_encode -lxavs
 enabled libxvidrequire libxvid xvid.h xvid_global -lxvidcore
 enabled libzmq require_pkg_config libzmq zmq.h zmq_ctx_new
 enabled libzvbirequire libzvbi libzvbi.h vbi_decoder_new -lzvbi
+enabled nvenc  { check_header nvEncodeAPI.h || die ERROR: nvEncodeAPI.h not found.; }
 enabled openal { { for al_libs in ${OPENAL_LIBS} -lopenal -lOpenAL32; do
check_lib 'AL/al.h' alGetError ${al_libs}  break; done } ||
die ERROR: openal not found; } 
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fa0f53d..cc41564 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -347,6 +347,7 @@ OBJS-$(CONFIG_MXPEG_DECODER)   += mxpegdec.o
 OBJS-$(CONFIG_NELLYMOSER_DECODER)  += nellymoserdec.o nellymoser.o
 OBJS-$(CONFIG_NELLYMOSER_ENCODER)  += nellymoserenc.o nellymoser.o
 OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
+OBJS-$(CONFIG_NVENC_ENCODER)   += nvenc.o nvenc_api.o
 OBJS-$(CONFIG_ON2AVC_DECODER)  += on2avc.o on2avcdata.o
 OBJS-$(CONFIG_OPUS_DECODER)+= opusdec.o opus.o opus_celt.o \
   opus_imdct.o opus_silk.o \
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0d39d33..8ceee2f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -223,6 +223,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MVC2,  mvc2);
 REGISTER_DECODER(MXPEG, mxpeg);
 REGISTER_DECODER(NUV,   nuv);
+REGISTER_ENCODER(NVENC, nvenc);
 REGISTER_DECODER(PAF_VIDEO, paf_video);
 REGISTER_ENCDEC (PAM,   pam);
 REGISTER_ENCDEC (PBM,   pbm);
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
new file mode 100644
index 000..d659cf8
--- /dev/null

[FFmpeg-devel] [PATCH] avformat/apngdec: use packet pts and duration instead of altering stream framerate.

2014-11-26 Thread Benoit Fouet
---
 libavformat/apngdec.c | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/libavformat/apngdec.c b/libavformat/apngdec.c
index 1b59b82..276d765 100644
--- a/libavformat/apngdec.c
+++ b/libavformat/apngdec.c
@@ -44,6 +44,9 @@ typedef struct APNGDemuxContext {
 int max_fps;
 int default_fps;
 
+int64_t pkt_pts;
+int pkt_duration;
+
 int is_key_frame;
 
 /*
@@ -163,6 +166,9 @@ static int apng_read_header(AVFormatContext *s)
 if (!st)
 return AVERROR(ENOMEM);
 
+/* set the timebase to something large enough (1/100,000 of second)
+ * to hopefully cope with all sane frame durations */
+avpriv_set_pts_info(st, 64, 1, 10);
 st-codec-codec_type = AVMEDIA_TYPE_VIDEO;
 st-codec-codec_id   = AV_CODEC_ID_APNG;
 st-codec-width  = avio_rb32(pb);
@@ -266,9 +272,9 @@ static int decode_fctl_chunk(AVFormatContext *s, 
APNGDemuxContext *ctx, AVPacket
 delay_num = 1;
 delay_den = ctx-default_fps;
 }
-s-streams[0]-r_frame_rate.num = delay_den;
-s-streams[0]-r_frame_rate.den = delay_num;
-pkt-duration = 1;
+ctx-pkt_duration = av_rescale_q(delay_num,
+ (AVRational){ 1, delay_den },
+ s-streams[0]-time_base);
 
 av_log(s, AV_LOG_DEBUG, %s: 
 sequence_number: %PRId32, 
@@ -383,6 +389,9 @@ static int apng_read_packet(AVFormatContext *s, AVPacket 
*pkt)
 
 if (ctx-is_key_frame)
 pkt-flags |= AV_PKT_FLAG_KEY;
+pkt-pts = ctx-pkt_pts;
+pkt-duration = ctx-pkt_duration;
+ctx-pkt_pts += ctx-pkt_duration;
 return ret;
 case MKTAG('I', 'E', 'N', 'D'):
 ctx-cur_loop++;
-- 
2.2.0.rc2.23.gca0107e

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


Re: [FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Carl Eugen Hoyos
Timo Rothenpieler timo at rothenpieler.org writes:

 I'm not sure if this needs to be flagged as nonfree.

Please mark it as non-free, the header clearly says 
that it must not be used for open-source software.

Please use tools/patcheck on your patchfile: It shows 
many issues most of which you should be able to fix 
quickly, skip the ones that make no sense to you, the 
tool is not error-free.
(Tabs and trailing whitespace cannot be committed.)

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Hendrik Leppkes
On Wed, Nov 26, 2014 at 11:38 AM, Carl Eugen Hoyos ceho...@ag.or.at wrote:

 Timo Rothenpieler timo at rothenpieler.org writes:

  I'm not sure if this needs to be flagged as nonfree.

 Please mark it as non-free, the header clearly says
 that it must not be used for open-source software


Where does it say that?

Its just a API header, using a certain API doesn't make your code non-free,
you are not including any code or other protected things in the
distribution.
Only the header itself is subject to the NVIDIA license, a compiled program
that uses the header, but doesn't distribute it, is not.

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


Re: [FFmpeg-devel] [PATCH] avformat/apngdec: use packet pts and duration instead of altering stream framerate.

2014-11-26 Thread Michael Niedermayer
On Wed, Nov 26, 2014 at 11:22:45AM +0100, Benoit Fouet wrote:
 ---
  libavformat/apngdec.c | 15 ---
  1 file changed, 12 insertions(+), 3 deletions(-)

applied

thanks

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

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


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


Re: [FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Timo Rothenpieler

Please mark it as non-free, the header clearly says
that it must not be used for open-source software.


It only says not to distribute the header, the compiled binary and the 
code using it should be free to distribute.



Please use tools/patcheck on your patchfile: It shows
many issues most of which you should be able to fix
quickly, skip the ones that make no sense to you, the
tool is not error-free.
(Tabs and trailing whitespace cannot be committed.)


Fixed now, new patch is attached and on github.

From 4239af3cf66cdaa9ad99386bf728af4c1d1aca8a Mon Sep 17 00:00:00 2001
From: Timo Rothenpieler t...@rothenpieler.org
Date: Wed, 26 Nov 2014 11:08:11 +0100
Subject: [PATCH] Add NVENC encoder

---
 Changelog   |   1 +
 configure   |  11 +-
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/nvenc.c  | 932 
 libavcodec/nvenc_api.c  | 275 ++
 libavcodec/nvenc_api.h  |  35 ++
 libavcodec/nvenc_cuda.h |  62 
 8 files changed, 1316 insertions(+), 2 deletions(-)
 create mode 100644 libavcodec/nvenc.c
 create mode 100644 libavcodec/nvenc_api.c
 create mode 100644 libavcodec/nvenc_api.h
 create mode 100644 libavcodec/nvenc_cuda.h

diff --git a/Changelog b/Changelog
index 7172d0c..d26b7fa 100644
--- a/Changelog
+++ b/Changelog
@@ -17,6 +17,7 @@ version next:
 - WebP muxer with animated WebP support
 - zygoaudio decoding support
 - APNG demuxer
+- nvenc encoder
 
 
 version 2.4:
diff --git a/configure b/configure
index 38619c4..d0b790c 100755
--- a/configure
+++ b/configure
@@ -261,6 +261,7 @@ External library support:
   --enable-libzvbi enable teletext support via libzvbi [no]
   --disable-lzma   disable lzma [autodetect]
   --enable-decklinkenable Blackmagick DeckLink I/O support [no]
+  --enable-nvenc   enable NVIDIA NVENC support [no]
   --enable-openal  enable OpenAL 1.1 capture support [no]
   --enable-opencl  enable OpenCL code
   --enable-opengl  enable OpenGL rendering [no]
@@ -1393,6 +1394,7 @@ EXTERNAL_LIBRARY_LIST=
 libzmq
 libzvbi
 lzma
+nvenc
 openal
 opencl
 opengl
@@ -2389,6 +2391,7 @@ libxvid_encoder_deps=libxvid
 libutvideo_decoder_deps=libutvideo
 libutvideo_encoder_deps=libutvideo
 libzvbi_teletext_decoder_deps=libzvbi
+nvenc_encoder_deps=nvenc
 
 # demuxers / muxers
 ac3_demuxer_select=ac3_parser
@@ -2569,9 +2572,7 @@ drawtext_filter_deps=libfreetype
 ebur128_filter_deps=gpl
 flite_filter_deps=libflite
 frei0r_filter_deps=frei0r dlopen
-frei0r_filter_extralibs='$ldl'
 frei0r_src_filter_deps=frei0r dlopen
-frei0r_src_filter_extralibs='$ldl'
 geq_filter_deps=gpl
 histeq_filter_deps=gpl
 hqdn3d_filter_deps=gpl
@@ -4650,6 +4651,11 @@ elif check_func dlopen -ldl; then
 ldl=-ldl
 fi
 
+# set a few flags which depend on ldl and can't be set earlier
+nvenc_encoder_extralibs='$ldl'
+frei0r_filter_extralibs='$ldl'
+frei0r_src_filter_extralibs='$ldl'
+
 if ! disabled network; then
 check_func getaddrinfo $network_extralibs
 check_func getservbyport $network_extralibs
@@ -4913,6 +4919,7 @@ enabled libxavsrequire libxavs xavs.h xavs_encoder_encode -lxavs
 enabled libxvidrequire libxvid xvid.h xvid_global -lxvidcore
 enabled libzmq require_pkg_config libzmq zmq.h zmq_ctx_new
 enabled libzvbirequire libzvbi libzvbi.h vbi_decoder_new -lzvbi
+enabled nvenc  { check_header nvEncodeAPI.h || die ERROR: nvEncodeAPI.h not found.; }
 enabled openal { { for al_libs in ${OPENAL_LIBS} -lopenal -lOpenAL32; do
check_lib 'AL/al.h' alGetError ${al_libs}  break; done } ||
die ERROR: openal not found; } 
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fa0f53d..cc41564 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -347,6 +347,7 @@ OBJS-$(CONFIG_MXPEG_DECODER)   += mxpegdec.o
 OBJS-$(CONFIG_NELLYMOSER_DECODER)  += nellymoserdec.o nellymoser.o
 OBJS-$(CONFIG_NELLYMOSER_ENCODER)  += nellymoserenc.o nellymoser.o
 OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
+OBJS-$(CONFIG_NVENC_ENCODER)   += nvenc.o nvenc_api.o
 OBJS-$(CONFIG_ON2AVC_DECODER)  += on2avc.o on2avcdata.o
 OBJS-$(CONFIG_OPUS_DECODER)+= opusdec.o opus.o opus_celt.o \
   opus_imdct.o opus_silk.o \
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0d39d33..8ceee2f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -223,6 +223,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MVC2,  mvc2);
 REGISTER_DECODER(MXPEG, mxpeg);
 REGISTER_DECODER(NUV,   nuv);
+REGISTER_ENCODER(NVENC, nvenc);
 REGISTER_DECODER(PAF_VIDEO, paf_video);
 REGISTER_ENCDEC (PAM,   pam);
 

Re: [FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Carl Eugen Hoyos
Timo Rothenpieler timo at rothenpieler.org writes:

  Please mark it as non-free, the header clearly says
  that it must not be used for open-source software.
 
 It only says not to distribute the header, the 
 compiled binary and the code using it should be free 
 to distribute.

I cannot read it like this but I am not a native 
speaker.
Maybe you could mark it as non-free until the FSF 
tells us their interpretation?

  Please use tools/patcheck on your patchfile

 Fixed now, new patch is attached and on github.

Thank you.

ff_nvenc_encoder is missing pix_fmts afaict but 
consider waiting for a real review.

Carl Eugen

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


Re: [FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Timo Rothenpieler

I cannot read it like this but I am not a native
speaker.
Maybe you could mark it as non-free until the FSF
tells us their interpretation?


Allright, new patch is attached.


ff_nvenc_encoder is missing pix_fmts afaict but
consider waiting for a real review.


Yes, that's intended.
It uses init_static_data to dynamicaly ask the nvidia driver for the 
supported pixel formats instead.
From 793271822a5f52c3aed876fcedc7c6d8edd3c10c Mon Sep 17 00:00:00 2001
From: Timo Rothenpieler t...@rothenpieler.org
Date: Wed, 26 Nov 2014 11:08:11 +0100
Subject: [PATCH] Add NVENC encoder

---
 Changelog   |   1 +
 configure   |  12 +-
 libavcodec/Makefile |   1 +
 libavcodec/allcodecs.c  |   1 +
 libavcodec/nvenc.c  | 932 
 libavcodec/nvenc_api.c  | 275 ++
 libavcodec/nvenc_api.h  |  35 ++
 libavcodec/nvenc_cuda.h |  62 
 8 files changed, 1317 insertions(+), 2 deletions(-)
 create mode 100644 libavcodec/nvenc.c
 create mode 100644 libavcodec/nvenc_api.c
 create mode 100644 libavcodec/nvenc_api.h
 create mode 100644 libavcodec/nvenc_cuda.h

diff --git a/Changelog b/Changelog
index 7172d0c..d26b7fa 100644
--- a/Changelog
+++ b/Changelog
@@ -17,6 +17,7 @@ version next:
 - WebP muxer with animated WebP support
 - zygoaudio decoding support
 - APNG demuxer
+- nvenc encoder
 
 
 version 2.4:
diff --git a/configure b/configure
index 38619c4..05bce5d 100755
--- a/configure
+++ b/configure
@@ -261,6 +261,7 @@ External library support:
   --enable-libzvbi enable teletext support via libzvbi [no]
   --disable-lzma   disable lzma [autodetect]
   --enable-decklinkenable Blackmagick DeckLink I/O support [no]
+  --enable-nvenc   enable NVIDIA NVENC support [no]
   --enable-openal  enable OpenAL 1.1 capture support [no]
   --enable-opencl  enable OpenCL code
   --enable-opengl  enable OpenGL rendering [no]
@@ -1393,6 +1394,7 @@ EXTERNAL_LIBRARY_LIST=
 libzmq
 libzvbi
 lzma
+nvenc
 openal
 opencl
 opengl
@@ -2389,6 +2391,7 @@ libxvid_encoder_deps=libxvid
 libutvideo_decoder_deps=libutvideo
 libutvideo_encoder_deps=libutvideo
 libzvbi_teletext_decoder_deps=libzvbi
+nvenc_encoder_deps=nvenc
 
 # demuxers / muxers
 ac3_demuxer_select=ac3_parser
@@ -2569,9 +2572,7 @@ drawtext_filter_deps=libfreetype
 ebur128_filter_deps=gpl
 flite_filter_deps=libflite
 frei0r_filter_deps=frei0r dlopen
-frei0r_filter_extralibs='$ldl'
 frei0r_src_filter_deps=frei0r dlopen
-frei0r_src_filter_extralibs='$ldl'
 geq_filter_deps=gpl
 histeq_filter_deps=gpl
 hqdn3d_filter_deps=gpl
@@ -4344,6 +4345,7 @@ die_license_disabled gpl x11grab
 
 die_license_disabled nonfree libaacplus
 die_license_disabled nonfree libfaac
+die_license_disabled nonfree nvenc
 enabled gpl  die_license_disabled_gpl nonfree libfdk_aac
 enabled gpl  die_license_disabled_gpl nonfree openssl
 
@@ -4650,6 +4652,11 @@ elif check_func dlopen -ldl; then
 ldl=-ldl
 fi
 
+# set a few flags which depend on ldl and can't be set earlier
+nvenc_encoder_extralibs='$ldl'
+frei0r_filter_extralibs='$ldl'
+frei0r_src_filter_extralibs='$ldl'
+
 if ! disabled network; then
 check_func getaddrinfo $network_extralibs
 check_func getservbyport $network_extralibs
@@ -4913,6 +4920,7 @@ enabled libxavsrequire libxavs xavs.h xavs_encoder_encode -lxavs
 enabled libxvidrequire libxvid xvid.h xvid_global -lxvidcore
 enabled libzmq require_pkg_config libzmq zmq.h zmq_ctx_new
 enabled libzvbirequire libzvbi libzvbi.h vbi_decoder_new -lzvbi
+enabled nvenc  { check_header nvEncodeAPI.h || die ERROR: nvEncodeAPI.h not found.; }
 enabled openal { { for al_libs in ${OPENAL_LIBS} -lopenal -lOpenAL32; do
check_lib 'AL/al.h' alGetError ${al_libs}  break; done } ||
die ERROR: openal not found; } 
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index fa0f53d..cc41564 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -347,6 +347,7 @@ OBJS-$(CONFIG_MXPEG_DECODER)   += mxpegdec.o
 OBJS-$(CONFIG_NELLYMOSER_DECODER)  += nellymoserdec.o nellymoser.o
 OBJS-$(CONFIG_NELLYMOSER_ENCODER)  += nellymoserenc.o nellymoser.o
 OBJS-$(CONFIG_NUV_DECODER) += nuv.o rtjpeg.o
+OBJS-$(CONFIG_NVENC_ENCODER)   += nvenc.o nvenc_api.o
 OBJS-$(CONFIG_ON2AVC_DECODER)  += on2avc.o on2avcdata.o
 OBJS-$(CONFIG_OPUS_DECODER)+= opusdec.o opus.o opus_celt.o \
   opus_imdct.o opus_silk.o \
diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 0d39d33..8ceee2f 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -223,6 +223,7 @@ void avcodec_register_all(void)
 REGISTER_DECODER(MVC2,  mvc2);
 REGISTER_DECODER(MXPEG, mxpeg);
 REGISTER_DECODER(NUV,   nuv);
+

Re: [FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Hendrik Leppkes
On Wed, Nov 26, 2014 at 2:35 PM, Carl Eugen Hoyos ceho...@ag.or.at wrote:

 Timo Rothenpieler timo at rothenpieler.org writes:

   Please mark it as non-free, the header clearly says
   that it must not be used for open-source software.
 
  It only says not to distribute the header, the
  compiled binary and the code using it should be free
  to distribute.

 I cannot read it like this but I am not a native
 speaker.
 Maybe you could mark it as non-free until the FSF
 tells us their interpretation?


Thats just wrong. There is not one line of proprietary/non-free code that
gets included or linked in libavcodec.
Additionally, the API in use is part of the GPU driver, which I would
strongly consider to be a system library (if a driver is not system, what
is?), and as such falls under the system library exemption in any case.

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


Re: [FFmpeg-devel] [PATCH 2/2] ffserver: dont leak pb_buffer

2014-11-26 Thread Reynaldo H. Verdejo Pinochet
Feel free to push please.

Thanks a lot

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


Re: [FFmpeg-devel] [PATCH 1/2] ffserver: dont leak child arguments

2014-11-26 Thread Reynaldo H. Verdejo Pinochet
Hi

On 11/20/2014 08:51 PM, Lukasz Marek wrote:
 [..]
   }
 diff --git a/ffserver_config.c b/ffserver_config.c
 index 02c8431..a235142 100644
 --- a/ffserver_config.c
 +++ b/ffserver_config.c
 @@ -31,6 +31,8 @@
   #include cmdutils.h
   #include ffserver_config.h

 +#define MAX_CHILD_ARGS 64
 +
   static int ffserver_save_avoption(AVCodecContext *ctx, const char
 *opt, const char *arg,
 AVDictionary **dict, int type,
 FFServerConfig *config, int line_num);
   static void vreport_config_error(const char *filename, int line_num,
 int log_level,
 @@ -603,7 +605,7 @@ static int
 ffserver_parse_config_feed(FFServerConfig *config, const char *cmd, c
   if (!av_strcasecmp(cmd, Launch)) {
   int i;

 -feed-child_argv = av_mallocz(64 * sizeof(char *));
 +feed-child_argv = av_mallocz_array(MAX_CHILD_ARGS,
 sizeof(char *));
   if (!feed-child_argv)
   return AVERROR(ENOMEM);
   for (i = 0; i  62; i++) {
 
 Right after submit I notice this hardcoded 62 so I changed locally to
 MAX_CHILD_ARGS - 2 :]

Cool. Feel free to push please.

Thanks a lot

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


Re: [FFmpeg-devel] [PATCH 08/11] ffserver: export recommented encoder configuration

2014-11-26 Thread Reynaldo H. Verdejo Pinochet
Hi Lukasz. Sorry for the delay.

Patch looks good. Feel free to push.

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] v210enc: Add SIMD optimised 8-bit and 10-bit encoders

2014-11-26 Thread Kieran Kunhya
---
 libavcodec/v210enc.c  | 191 +-
 libavcodec/v210enc.h  |  33 
 libavcodec/x86/Makefile   |   2 +
 libavcodec/x86/v210enc.asm| 146 
 libavcodec/x86/v210enc_init.c |  37 
 libavutil/x86/x86util.asm |   5 ++
 6 files changed, 373 insertions(+), 41 deletions(-)
 create mode 100644 libavcodec/v210enc.h
 create mode 100644 libavcodec/x86/v210enc.asm
 create mode 100644 libavcodec/x86/v210enc_init.c

diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c
index 1e53bdb..0d40f99 100644
--- a/libavcodec/v210enc.c
+++ b/libavcodec/v210enc.c
@@ -24,82 +24,190 @@
 #include avcodec.h
 #include bytestream.h
 #include internal.h
+#include v210enc.h
+
+#define CLIP(v) av_clip(v, 4, 1019)
+#define CLIP8(v) av_clip(v, 1, 254)
+
+#define WRITE_PIXELS(a, b, c)   \
+do {\
+val =   CLIP(*a++); \
+val |= (CLIP(*b++)  10) | \
+   (CLIP(*c++)  20);  \
+AV_WL32(dst, val);  \
+dst += 4;   \
+} while (0)
+
+#define WRITE_PIXELS8(a, b, c)  \
+do {\
+val =  (CLIP8(*a++)  2);   \
+val |= (CLIP8(*b++)  12) | \
+   (CLIP8(*c++)  22);  \
+AV_WL32(dst, val);  \
+dst += 4;   \
+} while (0)
+
+static void v210_planar_pack_8_c(const uint8_t *y, const uint8_t *u,
+ const uint8_t *v, uint8_t *dst, ptrdiff_t 
width)
+{
+uint32_t val;
+int i;
+
+/* unroll this to match the assembly */
+for( i = 0; i  width-11; i += 12 ){
+WRITE_PIXELS8(u, y, v);
+WRITE_PIXELS8(y, u, y);
+WRITE_PIXELS8(v, y, u);
+WRITE_PIXELS8(y, v, y);
+WRITE_PIXELS8(u, y, v);
+WRITE_PIXELS8(y, u, y);
+WRITE_PIXELS8(v, y, u);
+WRITE_PIXELS8(y, v, y);
+}
+}
+
+static void v210_planar_pack_10_c(const uint16_t *y, const uint16_t *u,
+  const uint16_t *v, uint8_t *dst, ptrdiff_t 
width)
+{
+uint32_t val;
+int i;
+
+for( i = 0; i  width-5; i += 6 ){
+WRITE_PIXELS(u, y, v);
+WRITE_PIXELS(y, u, y);
+WRITE_PIXELS(v, y, u);
+WRITE_PIXELS(y, v, y);
+}
+}
 
 static av_cold int encode_init(AVCodecContext *avctx)
 {
+V210EncContext *s = avctx-priv_data;
+
 if (avctx-width  1) {
 av_log(avctx, AV_LOG_ERROR, v210 needs even width\n);
 return AVERROR(EINVAL);
 }
 
-if (avctx-bits_per_raw_sample != 10)
-av_log(avctx, AV_LOG_WARNING, bits per raw sample: %d != 10-bit\n,
-   avctx-bits_per_raw_sample);
-
 avctx-coded_frame = av_frame_alloc();
 if (!avctx-coded_frame)
 return AVERROR(ENOMEM);
 
 avctx-coded_frame-pict_type = AV_PICTURE_TYPE_I;
 
+s-pack_line_8  = v210_planar_pack_8_c;
+s-pack_line_10 = v210_planar_pack_10_c;
+
+if (ARCH_X86)
+ff_v210enc_init_x86(s);
+
 return 0;
 }
 
 static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 const AVFrame *pic, int *got_packet)
 {
+V210EncContext *s = avctx-priv_data;
+
 int aligned_width = ((avctx-width + 47) / 48) * 48;
 int stride = aligned_width * 8 / 3;
 int line_padding = stride - ((avctx-width * 8 + 11) / 12) * 4;
 int h, w, ret;
-const uint16_t *y = (const uint16_t*)pic-data[0];
-const uint16_t *u = (const uint16_t*)pic-data[1];
-const uint16_t *v = (const uint16_t*)pic-data[2];
-PutByteContext p;
+uint8_t *dst;
 
-if ((ret = ff_alloc_packet2(avctx, pkt, avctx-height * stride))  0)
+if ((ret = ff_alloc_packet(pkt, avctx-height * stride))  0) {
+av_log(avctx, AV_LOG_ERROR, Error getting output packet.\n);
 return ret;
+}
 
-bytestream2_init_writer(p, pkt-data, pkt-size);
+dst = pkt-data;
+
+if (pic-format == AV_PIX_FMT_YUV422P10) {
+const uint16_t *y = (const uint16_t*)pic-data[0];
+const uint16_t *u = (const uint16_t*)pic-data[1];
+const uint16_t *v = (const uint16_t*)pic-data[2];
+for (h = 0; h  avctx-height; h++) {
+uint32_t val;
+w = (avctx-width / 6) * 6;
+s-pack_line_10(y, u, v, dst, w);
+
+y += w;
+u += w  1;
+v += w  1;
+dst += (w / 6) * 16;
+if (w  avctx-width - 1) {
+WRITE_PIXELS(u, y, v);
+
+val = CLIP(*y++);
+if (w == avctx-width - 2) {
+AV_WL32(dst, val);
+dst += 4;
+}
+}
+if (w  avctx-width - 3) {
+val |= (CLIP(*u++)  10) | (CLIP(*y++)  20);
+AV_WL32(dst, val);
+dst += 4;
 
-#define CLIP(v) av_clip(v, 4, 1019)
+

Re: [FFmpeg-devel] [PATCH] v210enc: Add SIMD optimised 8-bit and 10-bit encoders

2014-11-26 Thread Michael Niedermayer
On Wed, Nov 26, 2014 at 03:59:14PM +, Kieran Kunhya wrote:
 ---
  libavcodec/v210enc.c  | 191 
 +-
  libavcodec/v210enc.h  |  33 
  libavcodec/x86/Makefile   |   2 +
  libavcodec/x86/v210enc.asm| 146 
  libavcodec/x86/v210enc_init.c |  37 
  libavutil/x86/x86util.asm |   5 ++
  6 files changed, 373 insertions(+), 41 deletions(-)
  create mode 100644 libavcodec/v210enc.h
  create mode 100644 libavcodec/x86/v210enc.asm
  create mode 100644 libavcodec/x86/v210enc_init.c

breaks fate, also judging purely from the numbers it would be worse
quality wise

--- ./tests/ref/vsynth/vsynth1-v210 2014-11-26 16:30:08.642024147 +0100
+++ tests/data/fate/vsynth1-v2102014-11-26 17:41:43.134114620 +0100
@@ -1,4 +1,4 @@
-895d30660eb4da017568141a8d1df4e8 *tests/data/fate/vsynth1-v210.avi
+a98ae536d6362c6841744ef42e9ea8e1 *tests/data/fate/vsynth1-v210.avi
 14752448 tests/data/fate/vsynth1-v210.avi
-50973792d3f1abe04a51ee0121f077f2 *tests/data/fate/vsynth1-v210.out.rawvideo
-stddev:1.85 PSNR: 42.78 MAXDIFF:   29 bytes:  7603200/  7603200
+fc1d9531a1d2c05b0099fb93a47f4e05 *tests/data/fate/vsynth1-v210.out.rawvideo
+stddev:9.56 PSNR: 28.52 MAXDIFF:  196 bytes:  7603200/  7603200

PS: Thanks for posting a patch which applied cleanly!

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

No human being will ever know the Truth, for even if they happen to say it
by chance, they would not even known they had done so. -- Xenophanes


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


Re: [FFmpeg-devel] [PATCH] v210enc: Add SIMD optimised 8-bit and 10-bit encoders

2014-11-26 Thread Michael Niedermayer
On Wed, Nov 26, 2014 at 05:44:37PM +0100, Michael Niedermayer wrote:
 On Wed, Nov 26, 2014 at 03:59:14PM +, Kieran Kunhya wrote:
  ---
   libavcodec/v210enc.c  | 191 
  +-
   libavcodec/v210enc.h  |  33 
   libavcodec/x86/Makefile   |   2 +
   libavcodec/x86/v210enc.asm| 146 
   libavcodec/x86/v210enc_init.c |  37 
   libavutil/x86/x86util.asm |   5 ++
   6 files changed, 373 insertions(+), 41 deletions(-)
   create mode 100644 libavcodec/v210enc.h
   create mode 100644 libavcodec/x86/v210enc.asm
   create mode 100644 libavcodec/x86/v210enc_init.c
 
 breaks fate, also judging purely from the numbers it would be worse
 quality wise
 
 --- ./tests/ref/vsynth/vsynth1-v210 2014-11-26 16:30:08.642024147 +0100
 +++ tests/data/fate/vsynth1-v2102014-11-26 17:41:43.134114620 +0100
 @@ -1,4 +1,4 @@
 -895d30660eb4da017568141a8d1df4e8 *tests/data/fate/vsynth1-v210.avi
 +a98ae536d6362c6841744ef42e9ea8e1 *tests/data/fate/vsynth1-v210.avi
  14752448 tests/data/fate/vsynth1-v210.avi
 -50973792d3f1abe04a51ee0121f077f2 *tests/data/fate/vsynth1-v210.out.rawvideo
 -stddev:1.85 PSNR: 42.78 MAXDIFF:   29 bytes:  7603200/  7603200
 +fc1d9531a1d2c05b0099fb93a47f4e05 *tests/data/fate/vsynth1-v210.out.rawvideo
 +stddev:9.56 PSNR: 28.52 MAXDIFF:  196 bytes:  7603200/  7603200

this fixes it (only remainig is some ronding difference from sws and
v210 converting a bit different

diff --git a/libavcodec/x86/v210enc.asm b/libavcodec/x86/v210enc.asm
index 9442bb2..3245de3 100644
--- a/libavcodec/x86/v210enc.asm
+++ b/libavcodec/x86/v210enc.asm
@@ -39,7 +39,7 @@ v210_enc_luma_shuf_8: db 
6,-1,7,-1,8,-1,9,-1,10,-1,11,-1,-1,-1,-1,-1
 v210_enc_luma_mult_8: dw 16,4,64,16,4,64,0,0

 v210_enc_chroma_shuf1_8: db 0,-1,1,-1,2,-1,3,-1,8,-1,9,-1,10,-1,11,-1
-v210_enc_chroma_shuf2_8: db 4,-1,5,-1,6,-1,7,-1,12,-1,13,-1,14,-1,15,-1
+v210_enc_chroma_shuf2_8: db 3,-1,4,-1,5,-1,7,-1,11,-1,12,-1,13,-1,15,-1

 v210_enc_chroma_mult_8: dw 4,16,64,0,64,4,16,0







 
 PS: Thanks for posting a patch which applied cleanly!
 
 [...]
 -- 
 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
 
 No human being will ever know the Truth, for even if they happen to say it
 by chance, they would not even known they had done so. -- Xenophanes



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


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


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


Re: [FFmpeg-devel] [PATCH] v210enc: Add SIMD optimised 8-bit and 10-bit encoders

2014-11-26 Thread Kieran Kunhya
  v210_enc_chroma_shuf1_8: db 0,-1,1,-1,2,-1,3,-1,8,-1,9,-1,10,-1,11,-1
 -v210_enc_chroma_shuf2_8: db 4,-1,5,-1,6,-1,7,-1,12,-1,13,-1,14,-1,15,-1
 +v210_enc_chroma_shuf2_8: db 3,-1,4,-1,5,-1,7,-1,11,-1,12,-1,13,-1,15,-1

  v210_enc_chroma_mult_8: dw 4,16,64,0,64,4,16,0

Thanks

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


Re: [FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Nicolas George
Le sextidi 6 frimaire, an CCXXIII, Hendrik Leppkes a écrit :
 Thats just wrong. There is not one line of proprietary/non-free code that
 gets included or linked in libavcodec.

(IANAL)

I do not think it works that way. You could apply the same reasoning when
linking a proprietary software with a GPL shared library and deduce that it
is ok to distribute the resulting binary: this is not the usual doctrine.

For things to make sense, I believe you have to consider that the assembly
code for a function call is a mix between the source code for the function
call and the function prototype; therefore, the license for the prototype
applies.

(For linking, just copying the SONAME from the library to the binary is
probably not enough to elicit copyright; I do not know what happens exactly
with symbols versioning.)

 Additionally, the API in use is part of the GPU driver, which I would
 strongly consider to be a system library (if a driver is not system, what
 is?), and as such falls under the system library exemption in any case.

This one looks valid to me. It only covers the GPL side of the question
though.

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] [PATCHv3] v210enc: Add SIMD optimised 8-bit and 10-bit encoders

2014-11-26 Thread James Almer
On 26/11/14 4:33 PM, Kieran Kunhya wrote:
 ---
  libavcodec/v210enc.c  | 191 
 +-
  libavcodec/v210enc.h  |  33 
  libavcodec/x86/Makefile   |   2 +
  libavcodec/x86/v210enc.asm| 146 
  libavcodec/x86/v210enc_init.c |  37 
  libavutil/x86/x86util.asm |   5 ++
  6 files changed, 373 insertions(+), 41 deletions(-)
  create mode 100644 libavcodec/v210enc.h
  create mode 100644 libavcodec/x86/v210enc.asm
  create mode 100644 libavcodec/x86/v210enc_init.c

Shouldn't the fate test be updated?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCHv3] v210enc: Add SIMD optimised 8-bit and 10-bit encoders

2014-11-26 Thread Michael Niedermayer
On Wed, Nov 26, 2014 at 04:48:09PM -0300, James Almer wrote:
 On 26/11/14 4:33 PM, Kieran Kunhya wrote:
  ---
   libavcodec/v210enc.c  | 191 
  +-
   libavcodec/v210enc.h  |  33 
   libavcodec/x86/Makefile   |   2 +
   libavcodec/x86/v210enc.asm| 146 
   libavcodec/x86/v210enc_init.c |  37 
   libavutil/x86/x86util.asm |   5 ++
   6 files changed, 373 insertions(+), 41 deletions(-)
   create mode 100644 libavcodec/v210enc.h
   create mode 100644 libavcodec/x86/v210enc.asm
   create mode 100644 libavcodec/x86/v210enc_init.c
 
 Shouldn't the fate test be updated?

updated
applied

thanks too all

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus


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] lavfi/ebur128: add support for smaller video sizes

2014-11-26 Thread Clément Bœsch
On Sat, Nov 22, 2014 at 03:28:06PM +0100, Marton Balint wrote:
 
 
 On Fri, 21 Nov 2014, Clément Bœsch wrote:
 
 (sorry for the delay)
 
 On Sun, Nov 16, 2014 at 10:53:15PM +0100, Marton Balint wrote:
 Signed-off-by: Marton Balint c...@passwd.hu
 ---
  doc/filters.texi|  4 ++--
  libavfilter/f_ebur128.c | 11 ---
  2 files changed, 10 insertions(+), 5 deletions(-)
 
 diff --git a/doc/filters.texi b/doc/filters.texi
 index 53f4cb2..713989c 100644
 --- a/doc/filters.texi
 +++ b/doc/filters.texi
 @@ -10146,8 +10146,8 @@ activated. Default is @code{0}.
 
  @item size
  Set the video size. This option is for video only. For the syntax of this
 -option, check the Video size section in the ffmpeg-utils manual. Default
 -and minimum resolution is @code{640x480}.
 +option, check the Video size section in the ffmpeg-utils manual. The 
 default
 +resolution is @code{640x480}, the minimum is @code{480x102}.
 
 
 Quoting the EBU 3341:
  An ‘EBU Mode’ meter shall offer two scales, for when a scale is shown,
  selectable by the user:
  1. range -18.0 LU to +9.0 LU (-41.0 LUFS to -14.0 LUFS), named ‘EBU +9
  scale’
  2. range -36.0 LU to +18.0 LU (-59.0 LUFS to -5.0 LUFS), named ‘EBU +18
  scale’
 
 When you go down to 480x102, the printed range becomes [-16;+8] LU for +9
 scale and [-32;+16] LU for +18 scale (see meter option). I think these
 range boundaries should be preserved in the output.
 
 
 The proper range is still shown in the graph, only the legend lacks the
 value for the up and the bottom of the graph.
 
 If you insist on showing the values for the top and the bottom of the graph,
 then in order for the lines to remain simmetrical, you will have to start
 showing rounded or non-whole values. Or if you insist on whole values, you
 may will not be able to show the lines with the same distance from each
 other.
 
 What would be the approach you prefer in order to be able to show smaller
 graphs?

I think the boundaries are important, so what about printing a warning if
the grain of the legend can't be kept?

(note: sorry about the delay between my replies)

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] avcodec/samidec: fix misposition of subtitles caused by rounding

2014-11-26 Thread Clément Bœsch
On Tue, Nov 25, 2014 at 06:07:30PM +0900, Jeong-Hoon Seo wrote:
 SAMI and ASS have different precision of duration in FFMPEG
 (SAMI: millisecond, ASS: centisecond)
 Sometimes, start-time of current subtitle is overrun with end-time of 
 previous one by rounding process
 This led to misposition of subtitles
   exmple
   - input SAMI
   sync start=1155
 p class=ENCC start
   sync start=2850
 p class=ENCC end
   sync start=3850
 p class=ENCC !
   - convert ASS
   Dialogue: 0,0:00:01:16,0:00:02:86,Default,start
   Dialogue: 0,0:00:02:85,0:00:03:85,Default,end
   ...
 
   each values in ASS means Format: Layer,Start,End,Style,Text
   End value = sync start + rounding(difference of sync start)
   0:00:02:86 = 0:00:01:16 + rounding(2850-1151)
 
 in the converted ASS,
 start-time of 2nd Text is overrun by end-time of 1st Text,
 and some frames will overlaid with multi-line text
 (during 0:00:02:85~0:00:02:86, 2nd one is on top of 1st one)
 After 1st text end-time(expired), 2nd one keep previous position(misposition)
 ---
  libavcodec/samidec.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c
 index 7705f93..92a9863 100644
 --- a/libavcodec/samidec.c
 +++ b/libavcodec/samidec.c
 @@ -119,9 +119,9 @@ static int sami_decode_frame(AVCodecContext *avctx,
  SAMIContext *sami = avctx-priv_data;
  
  if (ptr  avpkt-size  0  !sami_paragraph_to_ass(avctx, ptr)) {
 -int ts_start = av_rescale_q(avpkt-pts, avctx-time_base, 
 (AVRational){1,100});
 +int ts_start = av_rescale_q_rnd(avpkt-pts, avctx-time_base, 
 (AVRational){1,100}, AV_ROUND_ZERO);
  int ts_duration  = avpkt-duration != -1 ?
 -   av_rescale_q(avpkt-duration, avctx-time_base, 
 (AVRational){1,100}) : -1;
 +   av_rescale_q_rnd(avpkt-duration, 
 avctx-time_base, (AVRational){1,100}, AV_ROUND_ZERO) : -1;
  int ret = ff_ass_add_rect_bprint(sub, sami-full, ts_start, 
 ts_duration);
  if (ret  0)
  return ret;

Well I'm fine with this but:
 - does the FATE test need updates?
 - this change is required in other text subtitles decoders as well
 - the subtitles decoders shouldn't have this code in the first place, so
   be aware this isn't the proper fix (but is an acceptable change in
   itself)

Note: I'm working on dropping that code altogether, but it takes some
time

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH 01/10] avfilter/signalstats: fix different buffers for out frame if burn is enabled

2014-11-26 Thread Clément Bœsch
Patchset applied.

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] Add NVENC encoder

2014-11-26 Thread Reimar Döffinger
On 26.11.2014, at 14:58, Timo Rothenpieler t...@rothenpieler.org wrote:
 I cannot read it like this but I am not a native
 speaker.
 Maybe you could mark it as non-free until the FSF
 tells us their interpretation?
 
 Allright, new patch is attached.
 
 ff_nvenc_encoder is missing pix_fmts afaict but
 consider waiting for a real review.
 
 Yes, that's intended.
 It uses init_static_data to dynamicaly ask the nvidia driver for the 
 supported pixel formats instead.

I haven't looked in detail, but this doesn't seem like a good idea to me.
For example it can't handle having different encoders using different 
cards/hardware.
I don't know what other options there might be, maybe this is the best, but it 
seems not particularly good.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/mov: strengthen some table allocations

2014-11-26 Thread Clément Bœsch
From: Clément Bœsch clem...@stupeflix.com

---
 libavformat/mov.c | 48 +++-
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index a71e36d..5be683e 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1272,14 +1272,12 @@ static int mov_read_stco(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 
 if (!entries)
 return 0;
-if (entries = UINT_MAX/sizeof(int64_t))
-return AVERROR_INVALIDDATA;
 
 if (sc-chunk_offsets)
 av_log(c-fc, AV_LOG_WARNING, Duplicate STCO atom\n);
 av_free(sc-chunk_offsets);
 sc-chunk_count = 0;
-sc-chunk_offsets = av_malloc(entries * sizeof(int64_t));
+sc-chunk_offsets = av_malloc_array(entries, sizeof(*sc-chunk_offsets));
 if (!sc-chunk_offsets)
 return AVERROR(ENOMEM);
 sc-chunk_count = entries;
@@ -1873,13 +1871,11 @@ static int mov_read_stsc(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 
 if (!entries)
 return 0;
-if (entries = UINT_MAX / sizeof(*sc-stsc_data))
-return AVERROR_INVALIDDATA;
 if (sc-stsc_data)
 av_log(c-fc, AV_LOG_WARNING, Duplicate STSC atom\n);
 av_free(sc-stsc_data);
 sc-stsc_count = 0;
-sc-stsc_data = av_malloc(entries * sizeof(*sc-stsc_data));
+sc-stsc_data = av_malloc_array(entries, sizeof(*sc-stsc_data));
 if (!sc-stsc_data)
 return AVERROR(ENOMEM);
 
@@ -1911,9 +1907,11 @@ static int mov_read_stps(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 avio_rb32(pb); // version + flags
 
 entries = avio_rb32(pb);
-if (entries = UINT_MAX / sizeof(*sc-stps_data))
-return AVERROR_INVALIDDATA;
-sc-stps_data = av_malloc(entries * sizeof(*sc-stps_data));
+if (sc-stps_data)
+av_log(c-fc, AV_LOG_WARNING, Duplicate STPS atom\n);
+av_free(sc-stps_data);
+sc-stps_count = 0;
+sc-stps_data = av_malloc_array(entries, sizeof(*sc-stps_data));
 if (!sc-stps_data)
 return AVERROR(ENOMEM);
 
@@ -1955,9 +1953,11 @@ static int mov_read_stss(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 st-need_parsing = AVSTREAM_PARSE_HEADERS;
 return 0;
 }
-if (entries = UINT_MAX / sizeof(int))
-return AVERROR_INVALIDDATA;
-sc-keyframes = av_malloc(entries * sizeof(int));
+if (sc-keyframes)
+av_log(c-fc, AV_LOG_WARNING, Duplicate STSS atom\n);
+av_free(sc-keyframes);
+sc-keyframe_count = 0;
+sc-keyframes = av_malloc_array(entries, sizeof(*sc-keyframes));
 if (!sc-keyframes)
 return AVERROR(ENOMEM);
 
@@ -2016,9 +2016,13 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 
 if (!entries)
 return 0;
-if (entries = UINT_MAX / sizeof(int) || entries = (UINT_MAX - 4) / 
field_size)
+if (entries = (UINT_MAX - 4) / field_size)
 return AVERROR_INVALIDDATA;
-sc-sample_sizes = av_malloc(entries * sizeof(int));
+if (sc-sample_sizes)
+av_log(c-fc, AV_LOG_WARNING, Duplicate STSZ atom\n);
+av_free(sc-sample_sizes);
+sc-sample_count = 0;
+sc-sample_sizes = av_malloc_array(entries, sizeof(*sc-sample_sizes));
 if (!sc-sample_sizes)
 return AVERROR(ENOMEM);
 
@@ -2072,11 +2076,11 @@ static int mov_read_stts(MOVContext *c, AVIOContext 
*pb, MOVAtom atom)
 av_dlog(c-fc, track[%i].stts.entries = %i\n,
 c-fc-nb_streams-1, entries);
 
-if (entries = UINT_MAX / sizeof(*sc-stts_data))
-return -1;
-
+if (sc-stts_data)
+av_log(c-fc, AV_LOG_WARNING, Duplicate STTS atom\n);
 av_free(sc-stts_data);
-sc-stts_data = av_malloc(entries * sizeof(*sc-stts_data));
+sc-stts_count = 0;
+sc-stts_data = av_malloc_array(entries, sizeof(*sc-stts_data));
 if (!sc-stts_data)
 return AVERROR(ENOMEM);
 
@@ -2215,9 +2219,11 @@ static int mov_read_sbgp(MOVContext *c, AVIOContext *pb, 
MOVAtom atom)
 entries = avio_rb32(pb);
 if (!entries)
 return 0;
-if (entries = UINT_MAX / sizeof(*sc-rap_group))
-return AVERROR_INVALIDDATA;
-sc-rap_group = av_malloc(entries * sizeof(*sc-rap_group));
+if (sc-rap_group)
+av_log(c-fc, AV_LOG_WARNING, Duplicate SBGP atom\n);
+av_free(sc-rap_group);
+sc-rap_group_count = 0;
+sc-rap_group = av_malloc_array(entries, sizeof(*sc-rap_group));
 if (!sc-rap_group)
 return AVERROR(ENOMEM);
 
-- 
2.1.3

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


Re: [FFmpeg-devel] [PATCH 03/11] ffserver_config: map ffserver options to AVOptions

2014-11-26 Thread Reynaldo H. Verdejo Pinochet
Hi

On 11/21/2014 09:16 PM, Lukasz Marek wrote:
 [...]
 @@ -497,6 +500,14 @@ static int ffserver_save_avoption(const char *opt, const 
 char *arg, int type, FF
  return 0;
  }
  
 +static int ffserver_save_avoption_int(const char *opt, int64_t arg,
 +  int type, FFServerConfig *config)
 +{
 +char buf[30];

char buf[20] should be plenty considering INT64_MAX. Feel free to push
after this minor fix unless someone else holds you.

Bests,

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 04/11] ffserver_config: remove ffserver_apply_stream_config function

2014-11-26 Thread Reynaldo H. Verdejo Pinochet
Hi. LGTM, feel free to push please.

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test

2014-11-26 Thread Reynaldo H. Verdejo Pinochet
Hi Lukasz. Are you sending an updated patch for this one
or I missed it somehow?

-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test

2014-11-26 Thread Lukasz Marek

On 26.11.2014 23:27, Reynaldo H. Verdejo Pinochet wrote:

Hi Lukasz. Are you sending an updated patch for this one
or I missed it somehow?


maybe I should avoid commenting patches in other threads, but I removed 
this for now. I will repost it when it is finished.
I submitted it just to present test results against base of all changes 
regarding configuration parsing. (plenty of things in stream 
configuration has changed) and some hint about Makefile, but the test 
was in quite early state and I've had not time to continue on it yet.


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


Re: [FFmpeg-devel] [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test

2014-11-26 Thread Reynaldo H. Verdejo Pinochet
Hi

On 11/26/2014 07:35 PM, Lukasz Marek wrote:
 [..]
 maybe I should avoid commenting patches in other threads, but I removed

Yeah ;)

 this for now. I will repost it when it is finished.
 [..]

All good then. Please CC me when you do to make sure I don't
miss it.

Thanks a lot!

Bests,


-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH] avformat/hlsenc: added HLS encryption

2014-11-26 Thread Christian Suloway
Signed-off-by: Christian Suloway csulo...@globaleagleent.com
---
 libavformat/crypto.c | 233 ---
 libavformat/hlsenc.c | 387 ++-
 2 files changed, 567 insertions(+), 53 deletions(-)

diff --git a/libavformat/crypto.c b/libavformat/crypto.c
index a9b6e47..dc3dc88 100644
--- a/libavformat/crypto.c
+++ b/libavformat/crypto.c
@@ -38,17 +38,35 @@ typedef struct {
 int indata, indata_used, outdata;
 int eof;
 uint8_t *key;
-int keylen;
+int key_len;
 uint8_t *iv;
-int ivlen;
-struct AVAES *aes;
+int iv_len;
+uint8_t *decrypt_key;
+int decrypt_key_len;
+uint8_t *decrypt_iv;
+int decrypt_iv_len;
+uint8_t *encrypt_key;
+int encrypt_key_len;
+uint8_t *encrypt_iv;
+int encrypt_iv_len;
+struct AVAES *aes_decrypt;
+struct AVAES *aes_encrypt;
+
+uint8_t pad[BLOCKSIZE];
+int pad_len;
+
 } CryptoContext;
 
 #define OFFSET(x) offsetof(CryptoContext, x)
 #define D AV_OPT_FLAG_DECODING_PARAM
+#define E AV_OPT_FLAG_ENCODING_PARAM
 static const AVOption options[] = {
-{key, AES decryption key, OFFSET(key), AV_OPT_TYPE_BINARY, .flags = D 
},
-{iv,  AES decryption initialization vector, OFFSET(iv), 
AV_OPT_TYPE_BINARY, .flags = D },
+{key, AES encryption/decryption key,   OFFSET(key),
 AV_OPT_TYPE_BINARY, .flags = D|E },
+{iv,  AES encryption/decryption initialization vector, OFFSET(iv), 
 AV_OPT_TYPE_BINARY, .flags = D|E },
+{decryption_key, AES decryption key,   
OFFSET(decrypt_key), AV_OPT_TYPE_BINARY, .flags = D },
+{decryption_iv,  AES decryption initialization vector, 
OFFSET(decrypt_iv),  AV_OPT_TYPE_BINARY, .flags = D },
+{encryption_key, AES encryption key,   
OFFSET(encrypt_key), AV_OPT_TYPE_BINARY, .flags = E },
+{encryption_iv,  AES encryption initialization vector, 
OFFSET(encrypt_iv),  AV_OPT_TYPE_BINARY, .flags = E },
 { NULL }
 };
 
@@ -72,28 +90,145 @@ static int crypto_open2(URLContext *h, const char *uri, 
int flags, AVDictionary
 goto err;
 }
 
-if (c-keylen  BLOCKSIZE || c-ivlen  BLOCKSIZE) {
-av_log(h, AV_LOG_ERROR, Key or IV not set\n);
-ret = AVERROR(EINVAL);
-goto err;
+if (flags  AVIO_FLAG_READ) {
+if (!c-decrypt_key_len) {
+if (!c-key_len) {
+av_log(h, AV_LOG_ERROR, decryption key not set\n);
+ret = AVERROR(EINVAL);
+goto err;
+} else if (c-key_len != BLOCKSIZE) {
+av_log(h, AV_LOG_ERROR, invalid key size 
+(%d bytes, block size is %d)\n,
+c-key_len, BLOCKSIZE);
+ret = AVERROR(EINVAL);
+goto err;
+}
+c-decrypt_key = av_malloc(c-key_len);
+if (!c-decrypt_key) {
+ret = AVERROR(ENOMEM);
+goto err;
+}
+memcpy(c-decrypt_key, c-key, c-key_len);
+c-decrypt_key_len = c-key_len;
+} else if (c-decrypt_key_len != BLOCKSIZE) {
+av_log(h, AV_LOG_ERROR, invalid decryption key size 
+(%d bytes, block size is %d)\n,
+c-decrypt_key_len, BLOCKSIZE);
+ret = AVERROR(EINVAL);
+goto err;
+}
+if (!c-decrypt_iv_len) {
+if (!c-iv_len) {
+av_log(h, AV_LOG_ERROR, decryption IV not set\n);
+ret = AVERROR(EINVAL);
+goto err;
+} else if (c-iv_len != BLOCKSIZE) {
+av_log(h, AV_LOG_ERROR, invalid IV size 
+(%d bytes, block size is %d)\n,
+c-iv_len, BLOCKSIZE);
+ret = AVERROR(EINVAL);
+goto err;
+}
+c-decrypt_iv = av_malloc(c-iv_len);
+if (!c-decrypt_iv) {
+ret = AVERROR(ENOMEM);
+goto err;
+}
+memcpy(c-decrypt_iv, c-iv, c-iv_len);
+c-decrypt_iv_len = c-iv_len;
+} else if (c-decrypt_iv_len != BLOCKSIZE) {
+av_log(h, AV_LOG_ERROR, invalid decryption IV size 
+(%d bytes, block size is %d)\n,
+c-decrypt_iv_len, BLOCKSIZE);
+ret = AVERROR(EINVAL);
+goto err;
+}
 }
+
 if (flags  AVIO_FLAG_WRITE) {
-av_log(h, AV_LOG_ERROR, Only decryption is supported currently\n);
-ret = AVERROR(ENOSYS);
-goto err;
+if (!c-encrypt_key_len) {
+if (!c-key_len) {
+av_log(h, AV_LOG_ERROR, encryption key not set\n);
+ret = AVERROR(EINVAL);
+goto err;
+} else if (c-key_len != BLOCKSIZE) {
+ 

Re: [FFmpeg-devel] [PATCH 08/11] ffserver: export recommented encoder configuration

2014-11-26 Thread Lukasz Marek

On 26.11.2014 16:21, Reynaldo H. Verdejo Pinochet wrote:

Hi Lukasz. Sorry for the delay.

Patch looks good. Feel free to push.


Pushed whole patchset until this one inclusive.
Skipped [PATCH 06/11] [WIP][RFC]tools: add ffserver_config_test

The rest is not commented/approved. I will resend it in new thread for 
convenience.

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


Re: [FFmpeg-devel] [PATCH 1/2] lavc/options: fix leaks in avcodec_free_context

2014-11-26 Thread Lukasz Marek

On 24.11.2014 21:40, Michael Niedermayer wrote:

On Mon, Nov 24, 2014 at 05:16:49AM +0100, Lukasz Marek wrote:

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavcodec/options.c | 3 +++
  1 file changed, 3 insertions(+)


LGTM


pushed this one

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


Re: [FFmpeg-devel] [PATCH 2/2] ffserver: dont leak pb_buffer

2014-11-26 Thread Lukasz Marek

On 26.11.2014 16:18, Reynaldo H. Verdejo Pinochet wrote:

Feel free to push please.


Pushed both

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


Re: [FFmpeg-devel] [PATCH 03/11] ffserver_config: map ffserver options to AVOptions

2014-11-26 Thread Lukasz Marek

On 26.11.2014 23:22, Reynaldo H. Verdejo Pinochet wrote:

Hi

On 11/21/2014 09:16 PM, Lukasz Marek wrote:

[...]
@@ -497,6 +500,14 @@ static int ffserver_save_avoption(const char *opt, const 
char *arg, int type, FF
  return 0;
  }

+static int ffserver_save_avoption_int(const char *opt, int64_t arg,
+  int type, FFServerConfig *config)
+{
+char buf[30];


char buf[20] should be plenty considering INT64_MAX. Feel free to push
after this minor fix unless someone else holds you.


In fact 20 is too small. INT64_MIN has 19 digits, '-' sign and 
terminating 0. So 21 is a minimum. I put 22, the same as av_dict_set_int.



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


[FFmpeg-devel] [PATCH 1/3] lavf/ffmdec: add common options to recommended encoder configuration

2014-11-26 Thread Lukasz Marek
Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 libavformat/ffmdec.c | 36 +++-
 1 file changed, 31 insertions(+), 5 deletions(-)

diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 7ae906b..987f419 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -24,6 +24,8 @@
 #include libavutil/intreadwrite.h
 #include libavutil/intfloat.h
 #include libavutil/opt.h
+#include libavutil/avassert.h
+#include libavutil/avstring.h
 #include avformat.h
 #include internal.h
 #include ffm.h
@@ -231,6 +233,27 @@ static int ffm_close(AVFormatContext *s)
 return 0;
 }
 
+static int ffm_append_recommended_configuration(AVStream *st, char **conf)
+{
+int ret;
+size_t newsize;
+av_assert0(conf  st);
+if (!*conf)
+return 0;
+if (!st-recommended_encoder_configuration) {
+st-recommended_encoder_configuration = *conf;
+*conf = 0;
+return 0;
+}
+newsize = strlen(*conf) + strlen(st-recommended_encoder_configuration) + 
2;
+if ((ret = av_reallocp(st-recommended_encoder_configuration, newsize))  
0)
+return ret;
+av_strlcat(st-recommended_encoder_configuration, ,, newsize);
+av_strlcat(st-recommended_encoder_configuration, *conf, newsize);
+av_freep(conf);
+return 0;
+}
+
 static int ffm2_read_header(AVFormatContext *s)
 {
 FFMContext *ffm = s-priv_data;
@@ -367,12 +390,14 @@ static int ffm2_read_header(AVFormatContext *s)
 }
 enc = avcodec_find_encoder(codec-codec_id);
 if (enc  enc-priv_data_size  enc-priv_class) {
-st-recommended_encoder_configuration = av_malloc(size + 1);
-if (!st-recommended_encoder_configuration) {
+buffer = av_malloc(size + 1);
+if (!buffer) {
 ret = AVERROR(ENOMEM);
 goto fail;
 }
-avio_get_str(pb, size, st-recommended_encoder_configuration, 
size + 1);
+avio_get_str(pb, size, buffer, size + 1);
+if ((ret = ffm_append_recommended_configuration(st, buffer)) 
 0)
+goto fail;
 }
 break;
 case MKBETAG('S', '2', 'V', 'I'):
@@ -387,7 +412,8 @@ static int ffm2_read_header(AVFormatContext *s)
 }
 avio_get_str(pb, INT_MAX, buffer, size);
 av_set_options_string(codec, buffer, =, ,);
-av_freep(buffer);
+if ((ret = ffm_append_recommended_configuration(st, buffer))  0)
+goto fail;
 break;
 case MKBETAG('S', '2', 'A', 'U'):
 if (f_stau++) {
@@ -401,7 +427,7 @@ static int ffm2_read_header(AVFormatContext *s)
 }
 avio_get_str(pb, INT_MAX, buffer, size);
 av_set_options_string(codec, buffer, =, ,);
-av_freep(buffer);
+ffm_append_recommended_configuration(st, buffer);
 break;
 }
 avio_seek(pb, next, SEEK_SET);
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 2/3] lavf/ffmenc: store recommended encoder configuration

2014-11-26 Thread Lukasz Marek
ffmenc will store recommended encoder configuration if present.
This will allow the user to base on local defaults and
apply only explicitly set options.

If recommended encoder configuration is not present, then
non-default context's options are stored.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 libavformat/ffmenc.c | 74 +---
 1 file changed, 70 insertions(+), 4 deletions(-)

diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index c64c26b..e6d1a31 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -162,6 +162,60 @@ static int ffm_write_header_codec_ctx(AVIOContext *pb, 
AVCodecContext *ctx, unsi
 #undef ENC
 }
 
+static int ffm_write_recommended_config(AVIOContext *pb, AVCodecContext *ctx, 
unsigned tag,
+const char *configuration)
+{
+int ret;
+const AVCodec *enc = ctx-codec ? ctx-codec : 
avcodec_find_encoder(ctx-codec_id);
+AVIOContext *tmp;
+AVDictionaryEntry *t = NULL;
+AVDictionary *all = NULL, *comm = NULL, *prv = NULL;
+char *buf = NULL;
+
+if (!enc || !enc-priv_class || !enc-priv_data_size) {
+/* codec is not known/has no private options, so save everything as 
common options */
+if (avio_open_dyn_buf(tmp)  0)
+return AVERROR(ENOMEM);
+avio_put_str(tmp, configuration);
+write_header_chunk(pb, tmp, tag);
+return 0;
+}
+
+if ((ret = av_dict_parse_string(all, configuration, =, ,, 0))  0)
+return ret;
+
+while ((t = av_dict_get(all, , t, AV_DICT_IGNORE_SUFFIX))) {
+if (av_opt_find((void *)enc-priv_class, t-key, NULL, 0, 
AV_OPT_SEARCH_FAKE_OBJ)) {
+if ((ret = av_dict_set(prv, t-key, t-value, 0))  0)
+goto fail;
+} else if ((ret = av_dict_set(comm, t-key, t-value, 0))  0)
+goto fail;
+}
+
+if (comm) {
+if ((ret = av_dict_get_string(comm, buf, '=', ','))  0 ||
+(ret = avio_open_dyn_buf(tmp))  0)
+goto fail;
+avio_put_str(tmp, buf);
+av_freep(buf);
+write_header_chunk(pb, tmp, tag);
+}
+if (prv) {
+if ((ret = av_dict_get_string(prv, buf, '=', ','))  0 ||
+(ret = avio_open_dyn_buf(tmp))  0)
+goto fail;
+avio_put_str(tmp, buf);
+write_header_chunk(pb, tmp, MKBETAG('C', 'P', 'R', 'V'));
+}
+
+  fail:
+av_free(buf);
+av_dict_free(all);
+av_dict_free(comm);
+av_dict_free(prv);
+return ret;
+}
+
 static int ffm_write_header(AVFormatContext *s)
 {
 FFMContext *ffm = s-priv_data;
@@ -220,13 +274,25 @@ static int ffm_write_header(AVFormatContext *s)
 /* specific info */
 switch(codec-codec_type) {
 case AVMEDIA_TYPE_VIDEO:
-if ((ret = ffm_write_header_codec_ctx(s-pb, codec, MKBETAG('S', 
'2', 'V', 'I'), AV_OPT_FLAG_VIDEO_PARAM))  0 ||
-(ret = ffm_write_header_codec_private_ctx(s-pb, codec, 
AV_OPT_FLAG_VIDEO_PARAM))  0)
+if (st-recommended_encoder_configuration) {
+av_log(NULL, AV_LOG_DEBUG, writing recommended configuration: 
%s\n,
+   st-recommended_encoder_configuration);
+if ((ret = ffm_write_recommended_config(s-pb, codec, 
MKBETAG('S', '2', 'V', 'I'),
+
st-recommended_encoder_configuration))  0)
+return ret;
+} else if ((ret = ffm_write_header_codec_ctx(s-pb, codec, 
MKBETAG('S', '2', 'V', 'I'), AV_OPT_FLAG_VIDEO_PARAM))  0 ||
+   (ret = ffm_write_header_codec_private_ctx(s-pb, codec, 
AV_OPT_FLAG_VIDEO_PARAM))  0)
 return ret;
 break;
 case AVMEDIA_TYPE_AUDIO:
-if ((ret = ffm_write_header_codec_ctx(s-pb, codec, MKBETAG('S', 
'2', 'A', 'U'), AV_OPT_FLAG_AUDIO_PARAM))  0 ||
-(ret = ffm_write_header_codec_private_ctx(s-pb, codec, 
AV_OPT_FLAG_AUDIO_PARAM))  0)
+if (st-recommended_encoder_configuration) {
+av_log(NULL, AV_LOG_DEBUG, writing recommended configuration: 
%s\n,
+   st-recommended_encoder_configuration);
+if ((ret = ffm_write_recommended_config(s-pb, codec, 
MKBETAG('S', '2', 'A', 'U'),
+
st-recommended_encoder_configuration))  0)
+return ret;
+} else if ((ret = ffm_write_header_codec_ctx(s-pb, codec, 
MKBETAG('S', '2', 'A', 'U'), AV_OPT_FLAG_AUDIO_PARAM))  0 ||
+ (ret = ffm_write_header_codec_private_ctx(s-pb, codec, 
AV_OPT_FLAG_AUDIO_PARAM))  0)
 return ret;
 break;
 default:
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 3/3] ffmpeg_opt: make use of recommended encoder configuration

2014-11-26 Thread Lukasz Marek
So far ffmpeg used recommended configuration only for codec priv options.
ffmpeg will use now codec defaults and then apply recommended configuration
for all options. Recommended configuration possibly contains minimal
set of options to filful user configuration.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 ffmpeg_opt.c | 41 -
 1 file changed, 12 insertions(+), 29 deletions(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 85466c7..03e049b 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1617,31 +1617,6 @@ static int copy_chapters(InputFile *ifile, OutputFile 
*ofile, int copy_metadata)
 return 0;
 }
 
-static int ffserver_streams_copy_context(AVCodecContext *dest, const 
AVCodecContext *src,
- const char *configuration)
-{
-int ret;
-if ((ret = avcodec_copy_context(dest, src))  0)
-return ret;
-dest-codec = avcodec_find_encoder(src-codec_id);
-if (!dest-codec)
-return AVERROR(EINVAL);
-if (!dest-codec-priv_class || !dest-codec-priv_data_size)
-return 0;
-if (!dest-priv_data) {
-dest-priv_data = av_mallocz(dest-codec-priv_data_size);
-if (!dest-priv_data)
-return AVERROR(ENOMEM);
-*(const AVClass**)dest-priv_data = dest-codec-priv_class;
-}
-av_opt_set_defaults(dest-priv_data);
-if (av_set_options_string(dest-priv_data, configuration, =, ,)  0) {
-av_log(dest, AV_LOG_WARNING, Cannot copy private codec options. Using 
defaults.\n);
-av_opt_set_defaults(dest-priv_data);
-}
-return 0;
-}
-
 static int read_ffserver_streams(OptionsContext *o, AVFormatContext *s, const 
char *filename)
 {
 int i, err;
@@ -1656,6 +1631,7 @@ static int read_ffserver_streams(OptionsContext *o, 
AVFormatContext *s, const ch
 AVStream *st;
 OutputStream *ost;
 AVCodec *codec;
+const char *enc_config;
 
 codec = avcodec_find_encoder(ic-streams[i]-codec-codec_id);
 if (!codec) {
@@ -1669,15 +1645,22 @@ static int read_ffserver_streams(OptionsContext *o, 
AVFormatContext *s, const ch
 ost   = new_output_stream(o, s, codec-type, -1);
 st= ost-st;
 
-ffserver_streams_copy_context(st-codec, ic-streams[i]-codec,
-  
av_stream_get_recommended_encoder_configuration(ic-streams[i]));
+avcodec_get_context_defaults3(st-codec, codec);
+enc_config = 
av_stream_get_recommended_encoder_configuration(ic-streams[i]);
+if (enc_config) {
+AVDictionary *opts = NULL;
+av_dict_parse_string(opts, enc_config, =, ,, 0);
+av_opt_set_dict2(st-codec, opts, AV_OPT_SEARCH_CHILDREN);
+av_dict_free(opts);
+}
 
 if (st-codec-codec_type == AVMEDIA_TYPE_AUDIO  !ost-stream_copy)
 choose_sample_fmt(st, codec);
 else if (st-codec-codec_type == AVMEDIA_TYPE_VIDEO  
!ost-stream_copy)
 choose_pixel_fmt(st, st-codec, codec, st-codec-pix_fmt);
-ffserver_streams_copy_context(ost-enc_ctx, st-codec,
-  
av_stream_get_recommended_encoder_configuration(ic-streams[i]));
+avcodec_copy_context(ost-enc_ctx, st-codec);
+if (enc_config)
+av_dict_parse_string(ost-encoder_opts, enc_config, =, ,, 0);
 }
 
 avformat_close_input(ic);
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH 03/11] ffserver_config: map ffserver options to AVOptions

2014-11-26 Thread Reynaldo H. Verdejo Pinochet


On 11/26/2014 07:52 PM, Lukasz Marek wrote:
 [..]
 
 In fact 20 is too small. INT64_MIN has 19 digits, '-' sign and
 terminating 0. So 21 is a minimum. I put 22, the same as av_dict_set_int.

True, forgot about the sign. Go ahead after fixing please.

Thanks,


-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/3] lavf/ffmdec: add common options to recommended encoder configuration

2014-11-26 Thread Michael Niedermayer
On Wed, Nov 26, 2014 at 11:53:40PM +0100, Lukasz Marek wrote:
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  libavformat/ffmdec.c | 36 +++-
  1 file changed, 31 insertions(+), 5 deletions(-)

should be ok

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


Re: [FFmpeg-devel] [PATCH] avformat/mov: strengthen some table allocations

2014-11-26 Thread Michael Niedermayer
On Wed, Nov 26, 2014 at 10:48:10PM +0100, Clément Bœsch wrote:
 From: Clément Bœsch clem...@stupeflix.com
 
 ---
  libavformat/mov.c | 48 +++-
  1 file changed, 27 insertions(+), 21 deletions(-)

LGTM

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] [PATCH] lavu/opt: add const to av_opt_copy arg

2014-11-26 Thread Lukasz Marek

On 24.11.2014 02:06, Michael Niedermayer wrote:

On Sun, Nov 23, 2014 at 10:25:39PM +0100, Lukasz Marek wrote:

On 23.11.2014 02:29, Michael Niedermayer wrote:

On Sun, Nov 23, 2014 at 01:01:19AM +0100, Lukasz Marek wrote:

On 23.11.2014 00:58, Lukasz Marek wrote:

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavutil/opt.c | 2 +-
  libavutil/opt.h | 2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 0546a37..47b1f0c 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -1570,7 +1570,7 @@ static int opt_size(enum AVOptionType type)
  return 0;
  }

-int av_opt_copy(void *dst, void *src)
+int av_opt_copy(void *dst, FF_CONST_AVUTIL53 void *src)
  {
  const AVOption *o = NULL;
  const AVClass *c;
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 7338e78..6b6c996 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -825,7 +825,7 @@ int av_opt_query_ranges(AVOptionRanges **, void *obj, const 
char *key, int flags
   * @param src  Object to copy into
   * @return 0 on success, negative on error
   */
-int av_opt_copy(void *dest, void *src);
+int av_opt_copy(void *dest, FF_CONST_AVUTIL53 void *src);

  /**
   * Get a default list of allowed ranges for the given option.



I added FF_CONST_AVUTILS53 macro, but is this really needed? Cannot
be just const?
I'm asking because I think it doesn't fix anything.
I guess is it API/ABI thing, but why?


a user application could have a function pointer like

all_ffmpeg_functions-opt_copy = av_opt_copy;

and if we add const the prototype changes and this can fail to build
with some compiler flags or C++ or whatever

and yes i have seen an application that had function pointers to
ffmpeg functions


Thx for explanation. It would be good to have option to disable this
compability mode too. Sometimes it is not helping but annoying for
most users.

I attached updated patch. I add const to av_next_option and
av_opt_next to avoid warnings. It have to be applied on top of
[PATCH 1/2] lavu/opt: handle NULL obj in av_opt_next

There is much more places it could be added in opt.c, but this would
again trigger adding in other files (like log.h) to avoid warnings.




  opt.c |6 +++---
  opt.h |6 +++---
  2 files changed, 6 insertions(+), 6 deletions(-)
8a3df1768aaaef53aa632d5515b5041e7ba7c8f0  
0001-lavu-opt-add-const-to-av_opt_copy-arg-and-dependenci.patch
 From a8989702029f8c536b2153d3e6b52b1c3a9cc20f Mon Sep 17 00:00:00 2001
From: Lukasz Marek lukasz.m.lu...@gmail.com
Date: Sat, 22 Nov 2014 20:41:21 +0100
Subject: [PATCH] lavu/opt: add const to av_opt_copy arg and dependencies

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavutil/opt.c | 6 +++---
  libavutil/opt.h | 6 +++---
  2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 5b26a00..5b305a4 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -42,13 +42,13 @@
  #include float.h

  #if FF_API_OLD_AVOPTIONS
-const AVOption *av_next_option(void *obj, const AVOption *last)
+const AVOption *av_next_option(FF_CONST_AVUTIL53 void *obj, const AVOption 
*last)


FF_CONST_AVUTIL53 is already set to const, a new
FF_CONST_AVUTIL55 would be needed


Updated version attached.
const could be added almost everywhere, but av_opt_find2 is blocking a lot.

From 49c6d2bd65ee36bc7c6a5947be442f1c49b0d4f7 Mon Sep 17 00:00:00 2001
From: Lukasz Marek lukasz.m.lu...@gmail.com
Date: Thu, 27 Nov 2014 00:11:01 +0100
Subject: [PATCH] lavu/opt: add consts where possible

---
 libavutil/opt.c | 8 
 libavutil/opt.h | 7 ---
 libavutil/version.h | 7 +++
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/libavutil/opt.c b/libavutil/opt.c
index adf40ee..9494d4b 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -42,13 +42,13 @@
 #include float.h
 
 #if FF_API_OLD_AVOPTIONS
-const AVOption *av_next_option(void *obj, const AVOption *last)
+const AVOption *av_next_option(FF_CONST_AVUTIL55 void *obj, const AVOption *last)
 {
 return av_opt_next(obj, last);
 }
 #endif
 
-const AVOption *av_opt_next(void *obj, const AVOption *last)
+const AVOption *av_opt_next(FF_CONST_AVUTIL55 void *obj, const AVOption *last)
 {
 const AVClass *class;
 if (!obj)
@@ -61,7 +61,7 @@ const AVOption *av_opt_next(void *obj, const AVOption *last)
 return NULL;
 }
 
-static int read_number(const AVOption *o, void *dst, double *num, int *den, int64_t *intnum)
+static int read_number(const AVOption *o, const void *dst, double *num, int *den, int64_t *intnum)
 {
 switch (o-type) {
 case AV_OPT_TYPE_FLAGS: *intnum = *(unsigned int*)dst;return 0;
@@ -1573,7 +1573,7 @@ static int opt_size(enum AVOptionType type)
 return 0;
 }
 
-int av_opt_copy(void *dst, void *src)
+int av_opt_copy(void *dst, FF_CONST_AVUTIL55 void *src)
 {
 const AVOption *o = NULL;
 const AVClass *c;
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 777fc3b..30e51a6 100644
--- 

Re: [FFmpeg-devel] [PATCH 2/2] lavc/options: fix leaks in avcodec_copy_context

2014-11-26 Thread Lukasz Marek

On 24.11.2014 05:16, Lukasz Marek wrote:

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
  libavcodec/options.c | 23 +++
  1 file changed, 11 insertions(+), 12 deletions(-)

diff --git a/libavcodec/options.c b/libavcodec/options.c
index 7f9fb07..8ba997c 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -190,6 +190,11 @@ int avcodec_copy_context(AVCodecContext *dest, const 
AVCodecContext *src)
  }

  av_opt_free(dest);
+av_freep(dest-rc_override);
+av_freep(dest-intra_matrix);
+av_freep(dest-inter_matrix);
+av_freep(dest-extradata);
+av_freep(dest-subtitle_header);

  memcpy(dest, src, sizeof(*dest));
  av_opt_copy(dest, src);
@@ -205,13 +210,7 @@ int avcodec_copy_context(AVCodecContext *dest, const 
AVCodecContext *src)
  dest-slice_offset= NULL;
  dest-hwaccel = NULL;
  dest-internal= NULL;
-
-/* reallocate values that should be allocated separately */
-dest-extradata   = NULL;
-dest-intra_matrix= NULL;
-dest-inter_matrix= NULL;
-dest-rc_override = NULL;
-dest-subtitle_header = NULL;



This should stay. Updated version attched

From 722d7e837093212d6e6e6b17814ed408300d25a6 Mon Sep 17 00:00:00 2001
From: Lukasz Marek lukasz.m.lu...@gmail.com
Date: Thu, 27 Nov 2014 00:41:16 +0100
Subject: [PATCH] lavc/options: fix leaks in avcodec_copy_context

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 libavcodec/options.c | 16 +++-
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/libavcodec/options.c b/libavcodec/options.c
index 7698434..d637a14 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -190,6 +190,11 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
 }
 
 av_opt_free(dest);
+av_freep(dest-rc_override);
+av_freep(dest-intra_matrix);
+av_freep(dest-inter_matrix);
+av_freep(dest-extradata);
+av_freep(dest-subtitle_header);
 
 memcpy(dest, src, sizeof(*dest));
 av_opt_copy(dest, src);
@@ -205,6 +210,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
 dest-slice_offset= NULL;
 dest-hwaccel = NULL;
 dest-internal= NULL;
+dest-coded_frame = NULL;
 
 /* reallocate values that should be allocated separately */
 dest-extradata   = NULL;
@@ -224,6 +230,7 @@ int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src)
 }
 alloc_and_copy_or_fail(extradata,src-extradata_size,
FF_INPUT_BUFFER_PADDING_SIZE);
+dest-extradata_size  = src-extradata_size;
 alloc_and_copy_or_fail(intra_matrix, 64 * sizeof(int16_t), 0);
 alloc_and_copy_or_fail(inter_matrix, 64 * sizeof(int16_t), 0);
 alloc_and_copy_or_fail(rc_override,  src-rc_override_count * sizeof(*src-rc_override), 0);
@@ -238,11 +245,10 @@ fail:
 av_freep(dest-intra_matrix);
 av_freep(dest-inter_matrix);
 av_freep(dest-extradata);
-#if FF_API_MPV_OPT
-FF_DISABLE_DEPRECATION_WARNINGS
-av_freep(dest-rc_eq);
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
+av_freep(dest-subtitle_header);
+dest-subtitle_header_size = 0;
+dest-extradata_size = 0;
+av_opt_free(dest);
 return AVERROR(ENOMEM);
 }
 
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 3/3] ffserver_config: print warning when using default value

2014-11-26 Thread Lukasz Marek
Some of the defaults may be harmful (like buffer size).
It is good user is aware of that.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 ffserver_config.c | 38 +++---
 1 file changed, 35 insertions(+), 3 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index eb705c4..6e1f2f0 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -40,6 +40,11 @@ static void vreport_config_error(const char *filename, int 
line_num, int log_lev
 static void report_config_error(const char *filename, int line_num, int 
log_level,
 int *errors, const char *fmt, ...);
 
+#define ERROR(...)   report_config_error(config-filename, config-line_num,\
+ AV_LOG_ERROR, config-errors,  
__VA_ARGS__)
+#define WARNING(...) report_config_error(config-filename, config-line_num,\
+ AV_LOG_WARNING, config-warnings, 
__VA_ARGS__)
+
 /* FIXME: make ffserver work with IPv6 */
 /* resolve host with also IP address parsing */
 static int resolve_host(struct in_addr *sin_addr, const char *hostname)
@@ -203,50 +208,80 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
 if (!av_dict_get(recommended, ab, NULL, 0)) {
 av-bit_rate = 64000;
 av_dict_set_int(recommended, ab, av-bit_rate, 0);
+WARNING(Setting default value for audio bit rate = %d. 
+Use NoDefaults to disable it.\n,
+av-bit_rate);
 }
 if (!av_dict_get(recommended, ar, NULL, 0)) {
 av-sample_rate = 22050;
 av_dict_set_int(recommended, ar, av-sample_rate, 0);
+WARNING(Setting default value for audio sample rate = %d. 
+Use NoDefaults to disable it.\n,
+av-sample_rate);
 }
 if (!av_dict_get(recommended, ac, NULL, 0)) {
 av-channels = 1;
 av_dict_set_int(recommended, ac, av-channels, 0);
+WARNING(Setting default value for audio channel count = %d. 
+Use NoDefaults to disable it.\n,
+av-channels);
 }
 break;
 case AVMEDIA_TYPE_VIDEO:
 if (!av_dict_get(recommended, b, NULL, 0)) {
 av-bit_rate = 64000;
 av_dict_set_int(recommended, b, av-bit_rate, 0);
+WARNING(Setting default value for video bit rate = %d. 
+Use NoDefaults to disable it.\n,
+av-bit_rate);
 }
 if (!av_dict_get(recommended, time_base, NULL, 0)){
 av-time_base.den = 5;
 av-time_base.num = 1;
 av_dict_set(recommended, time_base, 1/5, 0);
+WARNING(Setting default value for video frame rate = %d. 
+Use NoDefaults to disable it.\n,
+av-time_base.den);
 }
 if (!av_dict_get(recommended, video_size, NULL, 0)) {
 av-width = 160;
 av-height = 128;
 av_dict_set(recommended, video_size, 160x128, 0);
+WARNING(Setting default value for video size = %dx%d. 
+Use NoDefaults to disable it.\n,
+av-width, av-height);
 }
 /* Bitrate tolerance is less for streaming */
 if (!av_dict_get(recommended, bt, NULL, 0)) {
 av-bit_rate_tolerance = FFMAX(av-bit_rate / 4,
   
(int64_t)av-bit_rate*av-time_base.num/av-time_base.den);
 av_dict_set_int(recommended, bt, av-bit_rate_tolerance, 0);
+WARNING(Setting default value for video bit rate tolerance = %d. 
+Use NoDefaults to disable it.\n,
+av-bit_rate_tolerance);
 }
 
 if (!av_dict_get(recommended, rc_eq, NULL, 0)) {
 av-rc_eq = av_strdup(tex^qComp);
 av_dict_set(recommended, rc_eq, tex^qComp, 0);
+WARNING(Setting default value for video rate control equation = 
%s. 
+Use NoDefaults to disable it.\n,
+av-rc_eq);
 }
 if (!av_dict_get(recommended, maxrate, NULL, 0)) {
 av-rc_max_rate = av-bit_rate * 2;
 av_dict_set_int(recommended, maxrate, av-rc_max_rate, 0);
+WARNING(Setting default value for video max rate = %d. 
+Use NoDefaults to disable it.\n,
+av-rc_max_rate);
 }
 
 if (av-rc_max_rate  !av_dict_get(recommended, bufsize, NULL, 0)) {
 av-rc_buffer_size = av-rc_max_rate;
 av_dict_set_int(recommended, bufsize, av-rc_buffer_size, 0);
+WARNING(Setting default value for video buffer size = %d. 
+Use NoDefaults to disable it.\n,
+av-rc_buffer_size);
 }
 break;
 default:
@@ -537,9 +572,6 @@ static int ffserver_save_avoption_int(const char *opt, 

[FFmpeg-devel] [PATCH 1/3] ffserver_config: remove useless defaults

2014-11-26 Thread Lukasz Marek
Options are already set to its defaults by AVOption API.
The only difference is for qmin, new default is 2, ffserver set to 3.
It is dead code because if condition is not meet unless user set option to 0.
Meeting condition would mean that ffserver overwrites explicity set option.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 ffserver_config.c | 45 -
 1 file changed, 45 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 5538aa4..8283188 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -234,56 +234,11 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
   
(int64_t)av-bit_rate*av-time_base.num/av-time_base.den);
 av_dict_set_int(recommended, bt, av-bit_rate_tolerance, 0);
 }
-if (av-qmin == 0) {
-av-qmin = 3;
-av_dict_set_int(recommended, qmin, av-qmin, 0);
-}
-if (av-qmax == 0) {
-av-qmax = 31;
-av_dict_set_int(recommended, qmax, av-qmax, 0);
-}
-if (av-max_qdiff == 0) {
-av-max_qdiff = 3;
-av_dict_set_int(recommended, qdiff, av-max_qdiff, 0);
-}
-/*FIXME: 0.5 is a default for these two, it is a dead code */
-av-qcompress = 0.5;
-av_dict_set(recommended, qcomp, 0.5, 0);
-av-qblur = 0.5;
-av_dict_set(recommended, qblur, 0.5, 0);
-
-if (!av-nsse_weight) {
-av-nsse_weight = 8;
-av_dict_set_int(recommended, nssew, av-nsse_weight, 0);
-}
-
-av-frame_skip_cmp = FF_CMP_DCTMAX;
-av_dict_set_int(recommended, skipcmp, FF_CMP_DCTMAX, 0);
-if (!av-me_method) {
-av-me_method = ME_EPZS;
-av_dict_set_int(recommended, me_method, ME_EPZS, 0);
-}
-
-/* FIXME: rc_buffer_aggressivity and rc_eq are deprecated */
-av-rc_buffer_aggressivity = 1.0;
-av_dict_set(recommended, rc_buf_aggressivity, 1.0, 0);
 
 if (!av-rc_eq) {
 av-rc_eq = av_strdup(tex^qComp);
 av_dict_set(recommended, rc_eq, tex^qComp, 0);
 }
-if (!av-i_quant_factor) {
-av-i_quant_factor = -0.8;
-av_dict_set(recommended, i_qfactor, -0.8, 0);
-}
-if (!av-b_quant_factor) {
-av-b_quant_factor = 1.25;
-av_dict_set(recommended, b_qfactor, 1.25, 0);
-}
-if (!av-b_quant_offset) {
-av-b_quant_offset = 1.25;
-av_dict_set(recommended, b_qoffset, 1.25, 0);
-}
 if (!av-rc_max_rate) {
 av-rc_max_rate = av-bit_rate * 2;
 av_dict_set_int(recommended, maxrate, av-rc_max_rate, 0);
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 2/3] ffserver_config: set defaults basing on absence of set value

2014-11-26 Thread Lukasz Marek
This prevents the situation when user set option to 0 and ffserver
threats it as not set value, so applies the default.

Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
---
 ffserver_config.c | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/ffserver_config.c b/ffserver_config.c
index 8283188..eb705c4 100644
--- a/ffserver_config.c
+++ b/ffserver_config.c
@@ -200,51 +200,51 @@ static void add_codec(FFServerStream *stream, 
AVCodecContext *av,
 /* compute default parameters */
 switch(av-codec_type) {
 case AVMEDIA_TYPE_AUDIO:
-if (av-bit_rate == 0) {
+if (!av_dict_get(recommended, ab, NULL, 0)) {
 av-bit_rate = 64000;
 av_dict_set_int(recommended, ab, av-bit_rate, 0);
 }
-if (av-sample_rate == 0) {
+if (!av_dict_get(recommended, ar, NULL, 0)) {
 av-sample_rate = 22050;
 av_dict_set_int(recommended, ar, av-sample_rate, 0);
 }
-if (av-channels == 0) {
+if (!av_dict_get(recommended, ac, NULL, 0)) {
 av-channels = 1;
 av_dict_set_int(recommended, ac, av-channels, 0);
 }
 break;
 case AVMEDIA_TYPE_VIDEO:
-if (av-bit_rate == 0) {
+if (!av_dict_get(recommended, b, NULL, 0)) {
 av-bit_rate = 64000;
 av_dict_set_int(recommended, b, av-bit_rate, 0);
 }
-if (av-time_base.num == 0){
+if (!av_dict_get(recommended, time_base, NULL, 0)){
 av-time_base.den = 5;
 av-time_base.num = 1;
 av_dict_set(recommended, time_base, 1/5, 0);
 }
-if (av-width == 0 || av-height == 0) {
+if (!av_dict_get(recommended, video_size, NULL, 0)) {
 av-width = 160;
 av-height = 128;
 av_dict_set(recommended, video_size, 160x128, 0);
 }
 /* Bitrate tolerance is less for streaming */
-if (av-bit_rate_tolerance == 0) {
+if (!av_dict_get(recommended, bt, NULL, 0)) {
 av-bit_rate_tolerance = FFMAX(av-bit_rate / 4,
   
(int64_t)av-bit_rate*av-time_base.num/av-time_base.den);
 av_dict_set_int(recommended, bt, av-bit_rate_tolerance, 0);
 }
 
-if (!av-rc_eq) {
+if (!av_dict_get(recommended, rc_eq, NULL, 0)) {
 av-rc_eq = av_strdup(tex^qComp);
 av_dict_set(recommended, rc_eq, tex^qComp, 0);
 }
-if (!av-rc_max_rate) {
+if (!av_dict_get(recommended, maxrate, NULL, 0)) {
 av-rc_max_rate = av-bit_rate * 2;
 av_dict_set_int(recommended, maxrate, av-rc_max_rate, 0);
 }
 
-if (av-rc_max_rate  !av-rc_buffer_size) {
+if (av-rc_max_rate  !av_dict_get(recommended, bufsize, NULL, 0)) {
 av-rc_buffer_size = av-rc_max_rate;
 av_dict_set_int(recommended, bufsize, av-rc_buffer_size, 0);
 }
-- 
1.9.1

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


Re: [FFmpeg-devel] [PATCH 2/3] lavf/ffmenc: store recommended encoder configuration

2014-11-26 Thread Michael Niedermayer
On Wed, Nov 26, 2014 at 11:53:41PM +0100, Lukasz Marek wrote:
 ffmenc will store recommended encoder configuration if present.
 This will allow the user to base on local defaults and
 apply only explicitly set options.
 
 If recommended encoder configuration is not present, then
 non-default context's options are stored.
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  libavformat/ffmenc.c | 74 
 +---
  1 file changed, 70 insertions(+), 4 deletions(-)

this should bump micro or minor version of avformat

otherwise looks ok

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

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


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


Re: [FFmpeg-devel] [PATCH 3/3] ffmpeg_opt: make use of recommended encoder configuration

2014-11-26 Thread Michael Niedermayer
On Wed, Nov 26, 2014 at 11:53:42PM +0100, Lukasz Marek wrote:
 So far ffmpeg used recommended configuration only for codec priv options.
 ffmpeg will use now codec defaults and then apply recommended configuration
 for all options. Recommended configuration possibly contains minimal
 set of options to filful user configuration.

LGTM

thx

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

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


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


Re: [FFmpeg-devel] [PATCH] lavu/opt: add const to av_opt_copy arg

2014-11-26 Thread Michael Niedermayer
On Thu, Nov 27, 2014 at 12:37:38AM +0100, Lukasz Marek wrote:
 On 24.11.2014 02:06, Michael Niedermayer wrote:
 On Sun, Nov 23, 2014 at 10:25:39PM +0100, Lukasz Marek wrote:
 On 23.11.2014 02:29, Michael Niedermayer wrote:
 On Sun, Nov 23, 2014 at 01:01:19AM +0100, Lukasz Marek wrote:
 On 23.11.2014 00:58, Lukasz Marek wrote:
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavutil/opt.c | 2 +-
   libavutil/opt.h | 2 +-
   2 files changed, 2 insertions(+), 2 deletions(-)
 
 diff --git a/libavutil/opt.c b/libavutil/opt.c
 index 0546a37..47b1f0c 100644
 --- a/libavutil/opt.c
 +++ b/libavutil/opt.c
 @@ -1570,7 +1570,7 @@ static int opt_size(enum AVOptionType type)
   return 0;
   }
 
 -int av_opt_copy(void *dst, void *src)
 +int av_opt_copy(void *dst, FF_CONST_AVUTIL53 void *src)
   {
   const AVOption *o = NULL;
   const AVClass *c;
 diff --git a/libavutil/opt.h b/libavutil/opt.h
 index 7338e78..6b6c996 100644
 --- a/libavutil/opt.h
 +++ b/libavutil/opt.h
 @@ -825,7 +825,7 @@ int av_opt_query_ranges(AVOptionRanges **, void 
 *obj, const char *key, int flags
* @param src  Object to copy into
* @return 0 on success, negative on error
*/
 -int av_opt_copy(void *dest, void *src);
 +int av_opt_copy(void *dest, FF_CONST_AVUTIL53 void *src);
 
   /**
* Get a default list of allowed ranges for the given option.
 
 
 I added FF_CONST_AVUTILS53 macro, but is this really needed? Cannot
 be just const?
 I'm asking because I think it doesn't fix anything.
 I guess is it API/ABI thing, but why?
 
 a user application could have a function pointer like
 
 all_ffmpeg_functions-opt_copy = av_opt_copy;
 
 and if we add const the prototype changes and this can fail to build
 with some compiler flags or C++ or whatever
 
 and yes i have seen an application that had function pointers to
 ffmpeg functions
 
 Thx for explanation. It would be good to have option to disable this
 compability mode too. Sometimes it is not helping but annoying for
 most users.
 
 I attached updated patch. I add const to av_next_option and
 av_opt_next to avoid warnings. It have to be applied on top of
 [PATCH 1/2] lavu/opt: handle NULL obj in av_opt_next
 
 There is much more places it could be added in opt.c, but this would
 again trigger adding in other files (like log.h) to avoid warnings.
 
 
   opt.c |6 +++---
   opt.h |6 +++---
   2 files changed, 6 insertions(+), 6 deletions(-)
 8a3df1768aaaef53aa632d5515b5041e7ba7c8f0  
 0001-lavu-opt-add-const-to-av_opt_copy-arg-and-dependenci.patch
  From a8989702029f8c536b2153d3e6b52b1c3a9cc20f Mon Sep 17 00:00:00 2001
 From: Lukasz Marek lukasz.m.lu...@gmail.com
 Date: Sat, 22 Nov 2014 20:41:21 +0100
 Subject: [PATCH] lavu/opt: add const to av_opt_copy arg and dependencies
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavutil/opt.c | 6 +++---
   libavutil/opt.h | 6 +++---
   2 files changed, 6 insertions(+), 6 deletions(-)
 
 diff --git a/libavutil/opt.c b/libavutil/opt.c
 index 5b26a00..5b305a4 100644
 --- a/libavutil/opt.c
 +++ b/libavutil/opt.c
 @@ -42,13 +42,13 @@
   #include float.h
 
   #if FF_API_OLD_AVOPTIONS
 -const AVOption *av_next_option(void *obj, const AVOption *last)
 +const AVOption *av_next_option(FF_CONST_AVUTIL53 void *obj, const AVOption 
 *last)
 
 FF_CONST_AVUTIL53 is already set to const, a new
 FF_CONST_AVUTIL55 would be needed
 
 Updated version attached.
 const could be added almost everywhere, but av_opt_find2 is blocking a lot.
 
  opt.c |8 
  opt.h |7 ---
  version.h |7 +++
  3 files changed, 15 insertions(+), 7 deletions(-)
 dcd1e5a4a60083437e69810821b1b856f0a328dd  
 0001-lavu-opt-add-consts-where-possible.patch
 From 49c6d2bd65ee36bc7c6a5947be442f1c49b0d4f7 Mon Sep 17 00:00:00 2001
 From: Lukasz Marek lukasz.m.lu...@gmail.com
 Date: Thu, 27 Nov 2014 00:11:01 +0100
 Subject: [PATCH] lavu/opt: add consts where possible

LGTM

thanks

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH 2/2] lavc/options: fix leaks in avcodec_copy_context

2014-11-26 Thread Michael Niedermayer
On Thu, Nov 27, 2014 at 12:43:57AM +0100, Lukasz Marek wrote:
 On 24.11.2014 05:16, Lukasz Marek wrote:
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
   libavcodec/options.c | 23 +++
   1 file changed, 11 insertions(+), 12 deletions(-)
 
 diff --git a/libavcodec/options.c b/libavcodec/options.c
 index 7f9fb07..8ba997c 100644
 --- a/libavcodec/options.c
 +++ b/libavcodec/options.c
 @@ -190,6 +190,11 @@ int avcodec_copy_context(AVCodecContext *dest, const 
 AVCodecContext *src)
   }
 
   av_opt_free(dest);
 +av_freep(dest-rc_override);
 +av_freep(dest-intra_matrix);
 +av_freep(dest-inter_matrix);
 +av_freep(dest-extradata);
 +av_freep(dest-subtitle_header);
 
   memcpy(dest, src, sizeof(*dest));
   av_opt_copy(dest, src);
 @@ -205,13 +210,7 @@ int avcodec_copy_context(AVCodecContext *dest, const 
 AVCodecContext *src)
   dest-slice_offset= NULL;
   dest-hwaccel = NULL;
   dest-internal= NULL;
 -
 -/* reallocate values that should be allocated separately */
 -dest-extradata   = NULL;
 -dest-intra_matrix= NULL;
 -dest-inter_matrix= NULL;
 -dest-rc_override = NULL;
 -dest-subtitle_header = NULL;
 
 
 This should stay. Updated version attched
 

  options.c |   16 +++-
  1 file changed, 11 insertions(+), 5 deletions(-)
 971d1769e50d2e853d7359003f8c924092a96e6b  
 0001-lavc-options-fix-leaks-in-avcodec_copy_context.patch
 From 722d7e837093212d6e6e6b17814ed408300d25a6 Mon Sep 17 00:00:00 2001
 From: Lukasz Marek lukasz.m.lu...@gmail.com
 Date: Thu, 27 Nov 2014 00:41:16 +0100
 Subject: [PATCH] lavc/options: fix leaks in avcodec_copy_context
 
 Signed-off-by: Lukasz Marek lukasz.m.lu...@gmail.com
 ---
  libavcodec/options.c | 16 +++-
  1 file changed, 11 insertions(+), 5 deletions(-)

breaks make fate-lavf-yuv4mpeg

--- ./tests/ref/lavf/yuv4mpeg   2014-11-26 20:04:48.466295490 +0100
+++ tests/data/fate/lavf-yuv4mpeg   2014-11-27 04:16:07.234916526 +0100
@@ -1,2 +0,0 @@
-ec8178cb152f9cdbfd9cb724d977db2e *./tests/data/lavf/lavf.y4m
-3801808 ./tests/data/lavf/lavf.y4m
Test lavf-yuv4mpeg failed. Look at tests/data/fate/lavf-yuv4mpeg.err for 
details.
make: *** [fate-lavf-yuv4mpeg] Error 139

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many that live deserve death. And some that die deserve life. Can you give
it to them? Then do not be too eager to deal out death in judgement. For
even the very wise cannot see all ends. -- Gandalf


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


[FFmpeg-devel] [Patch 1/5]Fix h264 on POWER LE: libavutil/ppc/util_altivec.h

2014-11-26 Thread rongyan
Hi,
We present 5 patches to fix h264 bugs for POWER8 little endian, which are sent 
in 5 seperate emails.
 This is the first, to add marcos vcswapi2s(), vcswapc(), VEC_LD2(), 
VEC_SPLAT16(), and VEC_SLD16().
 The fate test result after merge these 5 patches can be found on website by 
searching ibmcrl, also attached in the below to facilitate the review. The 
passed test cases change from  2017/2243 to 2209/2245.

  
 Thanks.
  
 Rong Yan

0001-libavutil-ppc-util_altivec.h-fix-load_with_perm_vec.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [Patch 2/5]Fix h264 on POWER LE: libavcodec/ppc/h264dsp.c

2014-11-26 Thread rongyan
Hi,
We present 5 patches to fix h264 bugs for POWER8 little endian, which are sent 
in 5 seperate emails.
This is the second, to fix the functions  
h264_idct8_add_altivec();
 
h264_idct_dc_add_internal();
 
h264_loop_filter_luma_altivec();
 
write16x4() VEC_1D_DCT();
 
weight_h264_W_altivec();
 
biweight_h264_W_altivec();
 
VEC_LOAD_U8_ADD_S16_STORE_U8();
 
ALTIVEC_STORE_SUM_CLIP();
 
And add marcos  GET_2PERM(), dstv_load(),vdst_load(), dest_unligned_store().

The fate test result after merge these 5 patches can be found on website by 
searching ibmcrl, also attached in the below to facilitate the review. The 
passed test cases change from  2017/2243 to 2209/2245.
 
Thanks.
 Rong Yan
  
  --
  The world has enough for everyone's need, but not enough for everyone's greed.

0002-libavcodec-ppc-h264dsp.c-fix-h264_idct8_add_altivec.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [Patch 3/5]Fix h264 on POWER LE: libavcodec/ppc/h264chroma_template.c

2014-11-26 Thread rongyan
Hi,
We present 5 patches to fix h264 bugs for POWER8 little endian, which are sent 
in 5 seperate emails.
This is the third, to fix the functions PREFIX_h264_chroma_mc8_altivec(), 
PREFIX_no_rnd_vc1_chroma_mc8_altivec(), CHROMA_MC8_ALTIVEC_CORE_SIMPLE(),  
CHROMA_MC8_ALTIVEC_CORE(), add marcos GET_VSRC1(), GET_VSRC().
 The fate test result after merge these 5 patches can be found on website by 
searching ibmcrl, also attached in the below to facilitate the review. The 
passed test cases change from  2017/2243 to 2209/2245.
 
  
Thanks.
 Rong Yan

  
  --
  The world has enough for everyone's need, but not enough for everyone's greed.

0003-libavcodec-ppc-h264chroma_template.c-fix-PREFIX_h264.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [Patch 5/5]Fix h264 on POWER LE: libavcodec/ppc/h264qpel.c

2014-11-26 Thread rongyan
Hi,
We present 5 patches to fix h264 bugs for POWER8 little endian, which are sent 
in 5 seperate emails.
This is the fifth, to fix the functions put_pixels16_l2_altivec(), 
avg_pixels16_l2_altivec(), add marcos put_unligned_store(), 
avg_unligned_store().
 The fate test result after merge these 5 patches can be found on website by 
searching ibmcrl, also attached in the below to facilitate the review. The 
passed test cases change from  2017/2243 to 2209/2245.
 
Thanks.
 Rong Yan
  --
  The world has enough for everyone's need, but not enough for everyone's greed.

0005-libavcodec-ppc-h264qpel.c-fix-put_pixels16_l2_altive.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [Patch 4/5]Fix h264 on POWER LE: libavcodec/ppc/h264qpel_template.c

2014-11-26 Thread rongyan
Hi,
We present 5 patches to fix h264 bugs for POWER8 little endian, which are sent 
in 5 seperate emails.
This is the first, to fix functions PREFIX_h264_qpel16_h_lowpass_altivec(), 
PREFIX_h264_qpel16_v_lowpass_altivec(), 
PREFIX_h264_qpel16_hv_lowpass_altivec(), add marcos load_alignment().
The fate test result after merge these 5 patches can be found on website by 
searching ibmcrl, also attached in the below to facilitate the review. The 
passed test cases change from  2017/2243 to 2209/2245.
 
Thanks.
 Rong Yan

0004-libavcodec-ppc-h264qpel_template.c-fix-PREFIX_h264_q.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel