Re: [FFmpeg-devel] [PATCH] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Michael Niedermayer
On Sun, Aug 16, 2015 at 05:45:55PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Sun, Aug 16, 2015 at 5:24 PM, Andreas Cadhalpun <
> andreas.cadhal...@googlemail.com> wrote:
> 
> > On 16.08.2015 22:15, Ronald S. Bultje wrote:
> > > Convert last users to av_opt_get_*() counterparts.
> > > ---
> > >  libavfilter/af_aresample.c | 17 +
> > >  libavutil/opt.h|  3 +++
> > >  2 files changed, 12 insertions(+), 8 deletions(-)
> >
> > I'm fine with this, but the patch is incomplete:
> > libavfilter/x86/vf_spp.c also uses av_get_int.
> > Furthermore the FF_OPT_TYPE_* defines are used in several places.
> 
> 
> Yes I noticed the last one in vf_spp.c, I missed it (don't know how), have
> it locally amended. I'm working on FF_OPT_TYPE_* separately (I'm doing one
> deprecation macro at a time).
> 

> Some really are a mess, Michael can you comment on how on earth you could
> consider adding av_stream_get_end_pts as a replacement for AVFrac without
> deeply frowning at yourself? Can you take some time and fix that correctly?

AVFrac is used to exactly compute timestamps, that is when you have
a timebase a/b in which timestamps are stored (1/100 or 1/9 or
whatever) and frame durations which are not multiples of that like
25000/1001.
If you would convert frame durations into the timebase for the
timestamps and sum them up you would quickly accumulate rounding
errors.
One could use doubles but that would not be bitexact nor exact either
AVFrac uses a 64bit denominator to represent accumulated
durations starting from a timestamp exactly.
AVRational is 32/32bit so it cannot 1:1 replace AVFrac.
Like with everything, of course the code using AVFrac could be
implemented differently. Iam happy to help testing if someone
suceeds in simplifying the code

also i belive there are other places in our codebase which do similar
durations accumulation and which do suffer from accumulation of
rounding errors.


> I also don't know what to do about codec-specific qscales in the pp
> avfilters.

the qscale table and the type of qscale needs to be passed to the
postprocessing filter
The obvious two ways to achive that are a AVFrame field, or side data.
If people dislike how its done currently, by all means, change it!
I can probably help testing the new implementation

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


[FFmpeg-devel] [PATCH 1/2] lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/error_resilience.c |  2 ++
 libavcodec/h263dec.c  |  2 ++
 libavcodec/h264.c |  4 
 libavcodec/h264_picture.c |  4 
 libavcodec/h264_slice.c   | 16 
 libavcodec/mpeg12dec.c| 20 +---
 libavcodec/mpegpicture.c  |  6 +-
 libavcodec/mpegvideo.c| 11 +--
 libavcodec/utils.c|  2 ++
 libavcodec/vc1dec.c   | 28 +---
 10 files changed, 78 insertions(+), 17 deletions(-)

diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index b3b46d1..2c741a4 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -777,7 +777,9 @@ void ff_er_frame_start(ERContext *s)
 static int er_supported(ERContext *s)
 {
 if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice   ||
+#if FF_API_CAP_VDPAU
s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU  ||
+#endif
!s->cur_pic.f  ||
s->cur_pic.field_picture
 )
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 7fa7090..8f28a94 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -603,10 +603,12 @@ retry:
 if (!s->divx_packed && !avctx->hwaccel)
 ff_thread_finish_setup(avctx);
 
+#if FF_API_CAP_VDPAU
 if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & 
AV_CODEC_CAP_HWACCEL_VDPAU)) {
 ff_vdpau_mpeg4_decode_picture(avctx->priv_data, s->gb.buffer, 
s->gb.buffer_end - s->gb.buffer);
 goto frame_end;
 }
+#endif
 
 if (avctx->hwaccel) {
 ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer,
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8b575be..24e209c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1561,9 +1561,11 @@ again:
 if (h->avctx->hwaccel &&
 (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, 
buf_size)) < 0)
 goto end;
+#if FF_API_CAP_VDPAU
 if (CONFIG_H264_VDPAU_DECODER &&
 h->avctx->codec->capabilities & 
AV_CODEC_CAP_HWACCEL_VDPAU)
 ff_vdpau_h264_picture_start(h);
+#endif
 }
 
 if (sl->redundant_pic_count == 0) {
@@ -1573,6 +1575,7 @@ again:
consumed);
 if (ret < 0)
 goto end;
+#if FF_API_CAP_VDPAU
 } else if (CONFIG_H264_VDPAU_DECODER &&
h->avctx->codec->capabilities & 
AV_CODEC_CAP_HWACCEL_VDPAU) {
 ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
@@ -1581,6 +1584,7 @@ again:
 ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
 &buf[buf_index - consumed],
 consumed);
+#endif
 } else
 context_count++;
 }
diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c
index 81d90d7..289c4be 100644
--- a/libavcodec/h264_picture.c
+++ b/libavcodec/h264_picture.c
@@ -157,9 +157,11 @@ int ff_h264_field_end(H264Context *h, H264SliceContext 
*sl, int in_setup)
 int err = 0;
 h->mb_y = 0;
 
+#if FF_API_CAP_VDPAU
 if (CONFIG_H264_VDPAU_DECODER &&
 h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
 ff_vdpau_h264_set_reference_frames(h);
+#endif
 
 if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
 if (!h->droppable) {
@@ -177,9 +179,11 @@ int ff_h264_field_end(H264Context *h, H264SliceContext 
*sl, int in_setup)
"hardware accelerator failed to decode picture\n");
 }
 
+#if FF_API_CAP_VDPAU
 if (CONFIG_H264_VDPAU_DECODER &&
 h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
 ff_vdpau_h264_picture_complete(h);
+#endif
 
 #if CONFIG_ERROR_RESILIENCE
 av_assert0(sl == h->slice_ctx);
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index b088392..25034f7 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -612,8 +612,11 @@ static int h264_frame_start(H264Context *h)
 
 if ((ret = alloc_picture(h, pic)) < 0)
 return ret;
-if(!h->frame_recovered && !h->avctx->hwaccel &&
-   !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU))
+if(!h->frame_recovered && !h->avctx->hwaccel
+#if FF_API_CAP_VDPAU
+   && !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+   )
 avpriv_color_frame(pic->f, c);
 
 h->cur_pic_ptr = pic;
@@ -1048,6 +1051,7 @@ static int h264_slice_header_init(H264Context *h)
 goto fail;
 }
 
+#if FF_API_CAP_VDPAU
 if (h->avctx->codec &&
 h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU &&
   

[FFmpeg-devel] [PATCH 2/2] lavu: comment out wrong value check in get_version() after api bump.

2015-08-17 Thread Ronald S. Bultje
---
 libavutil/utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/utils.c b/libavutil/utils.c
index 2e3b1e0..e337c83 100644
--- a/libavutil/utils.c
+++ b/libavutil/utils.c
@@ -41,7 +41,9 @@ unsigned avutil_version(void)
 if (checks_done)
 return LIBAVUTIL_VERSION_INT;
 
+#if FF_API_VDPAU
 av_assert0(AV_PIX_FMT_VDA_VLD == 81); //check if the pix fmt enum has not 
had anything inserted or removed by mistake
+#endif
 av_assert0(AV_SAMPLE_FMT_DBLP == 9);
 av_assert0(AVMEDIA_TYPE_ATTACHMENT == 4);
 av_assert0(AV_PICTURE_TYPE_BI == 7);
-- 
2.1.2

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


[FFmpeg-devel] [PATCH] lavc: fix compilation with FF_API_XVMC.

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/blockdsp.c  | 4 
 libavcodec/blockdsp.h  | 4 
 libavcodec/x86/blockdsp_init.c | 4 
 3 files changed, 12 deletions(-)

diff --git a/libavcodec/blockdsp.c b/libavcodec/blockdsp.c
index 8480f0b..42e177b 100644
--- a/libavcodec/blockdsp.c
+++ b/libavcodec/blockdsp.c
@@ -72,11 +72,7 @@ av_cold void ff_blockdsp_init(BlockDSPContext *c, 
AVCodecContext *avctx)
 if (ARCH_PPC)
 ff_blockdsp_init_ppc(c, high_bit_depth);
 if (ARCH_X86)
-#if FF_API_XVMC
 ff_blockdsp_init_x86(c, high_bit_depth, avctx);
-#else
-ff_blockdsp_init_x86(c, high_bit_depth);
-#endif /* FF_API_XVMC */
 if (ARCH_MIPS)
 ff_blockdsp_init_mips(c, high_bit_depth);
 }
diff --git a/libavcodec/blockdsp.h b/libavcodec/blockdsp.h
index 32ea107..654ecdc 100644
--- a/libavcodec/blockdsp.h
+++ b/libavcodec/blockdsp.h
@@ -43,12 +43,8 @@ void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext 
*avctx);
 void ff_blockdsp_init_alpha(BlockDSPContext *c, unsigned high_bit_depth);
 void ff_blockdsp_init_arm(BlockDSPContext *c, unsigned high_bit_depth);
 void ff_blockdsp_init_ppc(BlockDSPContext *c, unsigned high_bit_depth);
-#if FF_API_XVMC
 void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
   AVCodecContext *avctx);
-#else
-void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth);
-#endif /* FF_API_XVMC */
 void ff_blockdsp_init_mips(BlockDSPContext *c, unsigned high_bit_depth);
 
 #endif /* AVCODEC_BLOCKDSP_H */
diff --git a/libavcodec/x86/blockdsp_init.c b/libavcodec/x86/blockdsp_init.c
index 7780184..825e29f 100644
--- a/libavcodec/x86/blockdsp_init.c
+++ b/libavcodec/x86/blockdsp_init.c
@@ -31,12 +31,8 @@ void ff_clear_block_sse(int16_t *block);
 void ff_clear_blocks_mmx(int16_t *blocks);
 void ff_clear_blocks_sse(int16_t *blocks);
 
-#if FF_API_XVMC
 av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth,
   AVCodecContext *avctx)
-#else
-av_cold void ff_blockdsp_init_x86(BlockDSPContext *c, unsigned high_bit_depth)
-#endif /* FF_API_XVMC */
 {
 #if HAVE_YASM
 int cpu_flags = av_get_cpu_flags();
-- 
2.1.2

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


[FFmpeg-devel] NVENC dosenot support Tesla M2090

2015-08-17 Thread Steven Liu
Hi Timo Rothenpieler


I have try to transcode the input rtmp stream use nvenc, It give me
the message bellow:

OS info:
[root@localhost ffmpeg]# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)
[root@localhost ffmpeg]#

[root@localhost NVIDIA_CUDA-7.0_Samples]# uname -m && cat /etc/*release
x86_64
CentOS Linux release 7.0.1406 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/";
BUG_REPORT_URL="https://bugs.centos.org/";

CentOS Linux release 7.0.1406 (Core)
CentOS Linux release 7.0.1406 (Core)



[root@localhost release]# ./deviceQuery
./deviceQuery Starting...

 CUDA Device Query (Runtime API) version (CUDART static linking)

Detected 1 CUDA Capable device(s)

Device 0: "Tesla M2090"
  CUDA Driver Version / Runtime Version  7.0 / 7.0
  CUDA Capability Major/Minor version number:2.0
  Total amount of global memory: 5375 MBytes (5636554752
bytes)
  (16) Multiprocessors, ( 32) CUDA Cores/MP: 512 CUDA Cores
  GPU Max Clock rate:1301 MHz (1.30 GHz)
  Memory Clock rate: 1848 Mhz
  Memory Bus Width:  384-bit
  L2 Cache Size: 786432 bytes
  Maximum Texture Dimension Size (x,y,z) 1D=(65536), 2D=(65536,
65535), 3D=(2048, 2048, 2048)
  Maximum Layered 1D Texture Size, (num) layers  1D=(16384), 2048 layers
  Maximum Layered 2D Texture Size, (num) layers  2D=(16384, 16384), 2048
layers
  Total amount of constant memory:   65536 bytes
  Total amount of shared memory per block:   49152 bytes
  Total number of registers available per block: 32768
  Warp size: 32
  Maximum number of threads per multiprocessor:  1536
  Maximum number of threads per block:   1024
  Max dimension size of a thread block (x,y,z): (1024, 1024, 64)
  Max dimension size of a grid size(x,y,z): (65535, 65535, 65535)
  Maximum memory pitch:  2147483647 bytes
  Texture alignment: 512 bytes
  Concurrent copy and kernel execution:  Yes with 2 copy engine(s)
  Run time limit on kernels: No
  Integrated GPU sharing Host Memory:No
  Support host page-locked memory mapping:   Yes
  Alignment requirement for Surfaces:Yes
  Device has ECC support:Enabled
  Device supports Unified Addressing (UVA):  Yes
  Device PCI Domain ID / Bus ID / location ID:   0 / 1 / 0
  Compute Mode:
 < Default (multiple host threads can use ::cudaSetDevice() with device
simultaneously) >

deviceQuery, CUDA Driver = CUDART, CUDA Driver Version = 7.0, CUDA Runtime
Version = 7.0, NumDevs = 1, Device0 = Tesla M2090
Result = PASS
[root@localhost release]#





=ffmpeg output message===

[root@localhost ffmpeg]# ./x86/ffmpeg -v verbose -i rtmp://
192.168.100.5/live/liuqi -vcodec nvenc -b:v 2000k -s 800x480 -preset slow
-an a.mkv
ffmpeg version N-74455-g3afca32 Copyright (c) 2000-2015 the FFmpeg
developers
  built with gcc 4.8.2 (GCC) 20140120 (Red Hat 4.8.2-16)
  configuration: --enable-nvenc --enable-nonfree
  libavutil  54. 30.100 / 54. 30.100
  libavcodec 56. 57.100 / 56. 57.100
  libavformat56. 40.101 / 56. 40.101
  libavdevice56.  4.100 / 56.  4.100
  libavfilter 5. 33.100 /  5. 33.100
  libswscale  3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
[flv @ 0x25684c0] max_analyze_duration 500 reached at 500
microseconds st:0
Input #0, flv, from 'rtmp://192.168.100.5/live/liuqi':
  Metadata:
Server  : NGINX RTMP (github.com/arut/nginx-rtmp-module)
displayWidth: 1280
displayHeight   : 720
fps : 20
profile :
level   :
  Duration: 00:00:00.00, start: 11886.384000, bitrate: N/A
Stream #0:0: Video: h264 (Baseline), 3 reference frames, yuv420p(tv),
1280x720 [SAR 1:1 DAR 16:9], 5120 kb/s, 8 fps, 8 tbr, 1k tbn, 16 tbc
File 'a.mkv' already exists. Overwrite ? [y/N] y
[graph 0 input from stream 0:0 @ 0x2592820] w:1280 h:720 pixfmt:yuv420p
tb:1/1000 fr:8/1 sar:1/1 sws_param:flags=2
[scaler for output stream 0:0 @ 0x25b0180] w:800 h:480 flags:'bicubic'
interl:0
[scaler for output stream 0:0 @ 0x25b0180] w:1280 h:720 fmt:yuv420p sar:1/1
-> w:800 h:480 fmt:yuv420p sar:16/15 flags:0x4
[nvenc @ 0x2591c20] 1 CUDA capable devices found
[nvenc @ 0x2591c20] [ GPU #0 - < Tesla M2090 > has Compute SM 2.0, NVENC
Not Available ]
[nvenc @ 0x2591c20] No NVENC capable devices found
Output #0, matroska, to 'a.mkv':
  Metadata:
Server  : NGINX RTMP (github.com/arut/nginx-rtmp-module)
displayWidth: 1280
displayHeight   : 720
fps : 20
profile :
level   :
Stream

Re: [FFmpeg-devel] [PATCH] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 6:40 AM, Michael Niedermayer  wrote:

> On Sun, Aug 16, 2015 at 05:45:55PM -0400, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Sun, Aug 16, 2015 at 5:24 PM, Andreas Cadhalpun <
> > andreas.cadhal...@googlemail.com> wrote:
> >
> > > On 16.08.2015 22:15, Ronald S. Bultje wrote:
> > > > Convert last users to av_opt_get_*() counterparts.
> > > > ---
> > > >  libavfilter/af_aresample.c | 17 +
> > > >  libavutil/opt.h|  3 +++
> > > >  2 files changed, 12 insertions(+), 8 deletions(-)
> > >
> > > I'm fine with this, but the patch is incomplete:
> > > libavfilter/x86/vf_spp.c also uses av_get_int.
> > > Furthermore the FF_OPT_TYPE_* defines are used in several places.
> >
> >
> > Yes I noticed the last one in vf_spp.c, I missed it (don't know how),
> have
> > it locally amended. I'm working on FF_OPT_TYPE_* separately (I'm doing
> one
> > deprecation macro at a time).
> >
>
> > Some really are a mess, Michael can you comment on how on earth you could
> > consider adding av_stream_get_end_pts as a replacement for AVFrac without
> > deeply frowning at yourself? Can you take some time and fix that
> correctly?
>
> AVFrac is used to exactly compute timestamps


I know what it does.

I'm talking about a developer's decision to take a deprecated field, leave
it actively deprecated and about to be removed and then add a public that
uses exactly this API. How could you do that? How does that in any way help
us deprecate the struct or field? AVStream.pts is still marked as
deprecated and isn't even hidden from the public API in your supposedly
"fixed" implementation. Its API is still exposed in the place where you put
the data. It still doesn't compile after the version bump. In other words,
your patch didn't solve anything.

Can you please fix it properly? Properly means that after bump, it compiles
and passes fate. I'd almost suggest we set up a fate station that tests
that for the next version bump. If we intend to hide AVFrac from the user,
this probably means renaming AVFrac to just Frac, and moving it into some
internal-only data structure not exposed to the user, where it's accessible
for av_stream_get_end_pts to use.

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


Re: [FFmpeg-devel] NVENC dosenot support Tesla M2090

2015-08-17 Thread Timo Rothenpieler

> Device 0: "Tesla M2090"
>CUDA Driver Version / Runtime Version  7.0 / 7.0
>CUDA Capability Major/Minor version number:2.0

> [nvenc @ 0x2591c20] 1 CUDA capable devices found
> [nvenc @ 0x2591c20] [ GPU #0 - < Tesla M2090 > has Compute SM 2.0, NVENC
> Not Available ]

NVENC needs CUDA SM 3.0, your device does not support NVENC.




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


Re: [FFmpeg-devel] [libav-devel] [PATCH 5/6] Postpone API-incompatible changes until the next bump

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 12:06 AM, Michael Niedermayer <
mich...@niedermayer.cc> wrote:

> On Sun, Aug 16, 2015 at 10:12:23PM +0200, Andreas Cadhalpun wrote:
> > Hi,
> >
> > On 16.08.2015 19:27, Ronald S. Bultje wrote:
> > > On Sat, Aug 8, 2015 at 7:37 AM, Andreas Cadhalpun <
> > > andreas.cadhal...@googlemail.com> wrote:
> > >
> > >> +#define FF_API_VOXWARE   (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_AC_VLC(LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_OLD_MSMPEG4   (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_ARCH_ALPHA(LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_NEG_LINESIZES (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_ARCH_SH4  (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_ARCH_SPARC(LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_IDCT_XVIDMMX  (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_AVFILTER_OPEN
> (LIBAVFILTER_VERSION_MAJOR < 7)
> > >> +#define FF_API_AVFILTER_INIT_FILTER
>  (LIBAVFILTER_VERSION_MAJOR < 7)
> > >> +#define FF_API_NOCONST_GET_NAME
>  (LIBAVFILTER_VERSION_MAJOR < 7)
> > >> +#define FF_API_OPT_TYPE_METADATA(LIBAVUTIL_VERSION_MAJOR <
> 56)
> >
> > Removing these now is probably OK, because they seem to be relatively
> > unused.
> >
> > >> +#define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_SET_DIMENSIONS(LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_ASPECT_EXTENDED   (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_ERROR_RATE(LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_MB_TYPE   (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_MAX_BFRAMES   (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_INPUT_PRESERVED   (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_NORMALIZE_AQP (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_GMC   (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_MV0   (LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_CODEC_NAME(LIBAVCODEC_VERSION_MAJOR < 58)
> > >> +#define FF_API_AFD   (LIBAVCODEC_VERSION_MAJOR < 58)
>
> > >> +#define FF_API_OLD_FILTER_OPTS
> (LIBAVFILTER_VERSION_MAJOR < 7)
>
> If thats removed/disabled
> It will also break user scripts, examples from forum posts and
> testcases from tickets, this is not just API


Stackoverflow allows post edits. If you give links to posts to edit, I can
help edit them.

To further help users, we can even keep the warning message (without fixing
it for the user), making it an error, something like:

av_log(filter, AV_LOG_ERROR, "This syntax is deprecated. Use "
   "'|' to separate the list items.\n");
av_log(filter, AV_LOG_ERROR, "Try re-running with args=[%s]\n",
copy);

That should be sufficient to help people move along.

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


Re: [FFmpeg-devel] NVENC dosenot support Tesla M2090

2015-08-17 Thread Steven Liu
2015-08-17 19:53 GMT+08:00 Timo Rothenpieler :

> > Device 0: "Tesla M2090"
> >CUDA Driver Version / Runtime Version  7.0 / 7.0
> >CUDA Capability Major/Minor version number:2.0
>
> > [nvenc @ 0x2591c20] 1 CUDA capable devices found
> > [nvenc @ 0x2591c20] [ GPU #0 - < Tesla M2090 > has Compute SM 2.0, NVENC
> > Not Available ]
>
> NVENC needs CUDA SM 3.0, your device does not support NVENC.
>
>
Can you recommend some devices?

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


[FFmpeg-devel] [PATCH] lavc/ffmpeg: put FF_API_DEBUG_MV around remaining uses of FF_DEBUG_VIS_QP/MB_TYPE.

2015-08-17 Thread Ronald S. Bultje
---
 ffmpeg.c   | 6 +-
 libavcodec/mpegvideo.c | 4 
 libavcodec/options_table.h | 2 ++
 libavcodec/pthread_frame.c | 2 ++
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 434abd4..268ef57 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3422,7 +3422,11 @@ static int check_keyboard_interaction(int64_t cur_time)
 if(key == 'D') {
 debug = input_streams[0]->st->codec->debug<<1;
 if(!debug) debug = 1;
-while(debug & 
(FF_DEBUG_DCT_COEFF|FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE)) //unsupported, would 
just crash
+while(debug & (FF_DEBUG_DCT_COEFF
+#if FF_API_DEBUG_MV
+ 
|FF_DEBUG_VIS_QP|FF_DEBUG_VIS_MB_TYPE
+#endif
+ )) //unsupported, would just crash
 debug += debug;
 }else{
 char buf[32];
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index f28f7e8..e0b1d32 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1502,6 +1502,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int 
ex, int ey,
 }
 }
 
+#if FF_API_DEBUG_MV
 /**
  * Draw an arrow from (ex, ey) -> (sx, sy).
  * @param w width of the image
@@ -1547,6 +1548,7 @@ static void draw_arrow(uint8_t *buf, int sx, int sy, int 
ex,
 draw_line(buf, sx, sy, ex, ey, w, h, stride, color);
 }
 #endif
+#endif
 
 static int add_mb(AVMotionVector *mb, uint32_t mb_type,
   int dst_x, int dst_y,
@@ -1733,6 +1735,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame 
*pict, uint8_t *mbskip_
 }
 }
 
+#if FF_API_DEBUG_MV
 if ((avctx->debug & (FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE)) ||
 (avctx->debug_mv)) {
 int mb_y;
@@ -1945,6 +1948,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame 
*pict, uint8_t *mbskip_
 }
 }
 }
+#endif
 }
 
 void ff_print_debug_info(MpegEncContext *s, Picture *p, AVFrame *pict)
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 0fc343a..5376cbb 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -266,8 +266,10 @@ static const AVOption avcodec_options[] = {
 {"er", "error recognition", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_ER }, 
INT_MIN, INT_MAX, V|D, "debug"},
 {"mmco", "memory management control operations (H.264)", 0, AV_OPT_TYPE_CONST, 
{.i64 = FF_DEBUG_MMCO }, INT_MIN, INT_MAX, V|D, "debug"},
 {"bugs", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_BUGS }, INT_MIN, 
INT_MAX, V|D, "debug"},
+#if FF_API_DEBUG_MV
 {"vis_qp", "visualize quantization parameter (QP), lower QP are tinted 
greener", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DEBUG_VIS_QP }, INT_MIN, INT_MAX, 
V|D, "debug"},
 {"vis_mb_type", "visualize block types", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_DEBUG_VIS_MB_TYPE }, INT_MIN, INT_MAX, V|D, "debug"},
+#endif
 {"buffers", "picture buffer allocations", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_DEBUG_BUFFERS }, INT_MIN, INT_MAX, V|D, "debug"},
 {"thread_ops", "threading operations", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_DEBUG_THREADS }, INT_MIN, INT_MAX, V|A|D, "debug"},
 {"nomc", "skip motion compensation", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_DEBUG_NOMC }, INT_MIN, INT_MAX, V|A|D, "debug"},
diff --git a/libavcodec/pthread_frame.c b/libavcodec/pthread_frame.c
index 5a3214c..d7a75cd 100644
--- a/libavcodec/pthread_frame.c
+++ b/libavcodec/pthread_frame.c
@@ -639,8 +639,10 @@ int ff_frame_thread_init(AVCodecContext *avctx)
 
 if (!thread_count) {
 int nb_cpus = av_cpu_count();
+#if FF_API_DEBUG_MV
 if ((avctx->debug & (FF_DEBUG_VIS_QP | FF_DEBUG_VIS_MB_TYPE)) || 
avctx->debug_mv)
 nb_cpus = 1;
+#endif
 // use number of cores + 1 as thread count if there is more than one
 if (nb_cpus > 1)
 thread_count = avctx->thread_count = FFMIN(nb_cpus + 1, 
MAX_AUTO_THREADS);
-- 
2.1.2

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


Re: [FFmpeg-devel] [PATCH 1/2] lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 07:10:44AM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/error_resilience.c |  2 ++
>  libavcodec/h263dec.c  |  2 ++
>  libavcodec/h264.c |  4 
>  libavcodec/h264_picture.c |  4 
>  libavcodec/h264_slice.c   | 16 
>  libavcodec/mpeg12dec.c| 20 +---
>  libavcodec/mpegpicture.c  |  6 +-
>  libavcodec/mpegvideo.c| 11 +--
>  libavcodec/utils.c|  2 ++
>  libavcodec/vc1dec.c   | 28 +---
>  10 files changed, 78 insertions(+), 17 deletions(-)

with:
@@ -88,7 +88,7 @@
 #define FF_API_LOWRES(LIBAVCODEC_VERSION_MAJOR < 57)
 #endif
 #ifndef FF_API_CAP_VDPAU
-#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 1)
 #endif
 #ifndef FF_API_BUFS_VDPAU
 #define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 57)

build fails

CC  libavcodec/h264.o
libavcodec/h264.c:2016:43: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ undeclared here 
(not in a function)
make: *** [libavcodec/h264.o] Error 1
CC  libavcodec/mpeg12dec.o
libavcodec/mpeg12dec.c: In function ‘setup_hwaccel_for_pixfmt’:
libavcodec/mpeg12dec.c:1279:9: warning: ‘xvmc_acceleration’ is deprecated 
(declared at libavcodec/avcodec.h:2045) [-Wdeprecated-declarations]
libavcodec/mpeg12dec.c: At top level:
libavcodec/mpeg12dec.c:2968:23: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ undeclared 
here (not in a function)
make: *** [libavcodec/mpeg12dec.o] Error 1
CC  libavcodec/mpeg4videodec.o
libavcodec/mpeg4videodec.c:2811:23: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ 
undeclared here (not in a function)
make: *** [libavcodec/mpeg4videodec.o] Error 1
CC  libavcodec/vc1dec.o
libavcodec/vc1dec.c:1169:43: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ undeclared 
here (not in a function)
make: *** [libavcodec/vc1dec.o] Error 1
CC  libavcodec/vdpau.o
libavcodec/vdpau.c: In function ‘ff_vdpau_h264_set_reference_frames’:
libavcodec/vdpau.c:371:17: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:387:26: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:390:48: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:403:30: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:403:72: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:403:117: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:406:37: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:418:24: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:418:66: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:418:111: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c: In function ‘ff_vdpau_add_data_chunk’:
libavcodec/vdpau.c:434:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:435:15: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:436:16: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:437:23: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:437:51: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:440:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:440:37: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:441:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:441:37: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:442:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:442:37: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:443:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c: In function ‘ff_vdpau_h264_picture_start’:
libavcodec/vdpau.c:459:15: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:462:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c: In function ‘ff_vdpau_h264_picture_complete’:
libavcodec/vdpau.c:472:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:473:15: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:476:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:477:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:478:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:479:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:480:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:480:78: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:481:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:482:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:483:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:484:11: error: dereferencing pointer to incomplete type
libavcodec/vdpau.c:485:11: error: dereferencing pointer to incomplete type
libav

Re: [FFmpeg-devel] [PATCH 1/2] lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 8:16 AM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 07:10:44AM -0400, Ronald S. Bultje wrote:
> > ---
> >  libavcodec/error_resilience.c |  2 ++
> >  libavcodec/h263dec.c  |  2 ++
> >  libavcodec/h264.c |  4 
> >  libavcodec/h264_picture.c |  4 
> >  libavcodec/h264_slice.c   | 16 
> >  libavcodec/mpeg12dec.c| 20 +---
> >  libavcodec/mpegpicture.c  |  6 +-
> >  libavcodec/mpegvideo.c| 11 +--
> >  libavcodec/utils.c|  2 ++
> >  libavcodec/vc1dec.c   | 28 +---
> >  10 files changed, 78 insertions(+), 17 deletions(-)
>
> with:
> @@ -88,7 +88,7 @@
>  #define FF_API_LOWRES(LIBAVCODEC_VERSION_MAJOR < 57)
>  #endif
>  #ifndef FF_API_CAP_VDPAU
> -#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
> +#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 1)
>  #endif
>  #ifndef FF_API_BUFS_VDPAU
>  #define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 57)


Change FF_API_VDPAU also. I don't think anything works if you disable only
one or the other, and it's not useful anyway. They're meant to be bumped
together.

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


Re: [FFmpeg-devel] [PATCH] lavc/ffmpeg: put FF_API_DEBUG_MV around remaining uses of FF_DEBUG_VIS_QP/MB_TYPE.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 08:01:56AM -0400, Ronald S. Bultje wrote:
> ---
>  ffmpeg.c   | 6 +-
>  libavcodec/mpegvideo.c | 4 
>  libavcodec/options_table.h | 2 ++
>  libavcodec/pthread_frame.c | 2 ++
>  4 files changed, 13 insertions(+), 1 deletion(-)

please also remove me from maintainers from the affected codecs
in case this code gets actually removed or disabled before a
documented replacement is in place

i use these for maintaining and testing the code

Thanks

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- 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 1/2] lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 08:19:31AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 8:16 AM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 07:10:44AM -0400, Ronald S. Bultje wrote:
> > > ---
> > >  libavcodec/error_resilience.c |  2 ++
> > >  libavcodec/h263dec.c  |  2 ++
> > >  libavcodec/h264.c |  4 
> > >  libavcodec/h264_picture.c |  4 
> > >  libavcodec/h264_slice.c   | 16 
> > >  libavcodec/mpeg12dec.c| 20 +---
> > >  libavcodec/mpegpicture.c  |  6 +-
> > >  libavcodec/mpegvideo.c| 11 +--
> > >  libavcodec/utils.c|  2 ++
> > >  libavcodec/vc1dec.c   | 28 +---
> > >  10 files changed, 78 insertions(+), 17 deletions(-)
> >
> > with:
> > @@ -88,7 +88,7 @@
> >  #define FF_API_LOWRES(LIBAVCODEC_VERSION_MAJOR < 57)
> >  #endif
> >  #ifndef FF_API_CAP_VDPAU
> > -#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
> > +#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 1)
> >  #endif
> >  #ifndef FF_API_BUFS_VDPAU
> >  #define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 57)
> 
> 
> Change FF_API_VDPAU also. I don't think anything works if you disable only
> one or the other, and it's not useful anyway. They're meant to be bumped
> together.

this patch with:

diff --git a/libavcodec/version.h b/libavcodec/version.h
index 262334f..2998cb5 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -88,7 +88,7 @@
 #define FF_API_LOWRES(LIBAVCODEC_VERSION_MAJOR < 57)
 #endif
 #ifndef FF_API_CAP_VDPAU
-#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
+#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 1)
 #endif
 #ifndef FF_API_BUFS_VDPAU
 #define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 57)
diff --git a/libavutil/version.h b/libavutil/version.h
index 653f530..e5a74e3 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -108,7 +108,7 @@
 #define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 55)
 #endif
 #ifndef FF_API_VDPAU
-#define FF_API_VDPAU(LIBAVUTIL_VERSION_MAJOR < 55)
+#define FF_API_VDPAU(LIBAVUTIL_VERSION_MAJOR < 1)
 #endif
 #ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT
 #define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 55)

still fails to build:

CC  libavcodec/h264.o
libavcodec/h264.c:2016:43: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ undeclared here 
(not in a function)
libavcodec/h264.c:2018:48: error: ‘AV_PIX_FMT_VDPAU_H264’ undeclared here (not 
in a function)
make: *** [libavcodec/h264.o] Error 1
CC  libavcodec/mpeg12dec.o
libavcodec/mpeg12dec.c:1190:5: error: ‘AV_PIX_FMT_VDPAU_MPEG1’ undeclared here 
(not in a function)
libavcodec/mpeg12dec.c:1204:5: error: ‘AV_PIX_FMT_VDPAU_MPEG2’ undeclared here 
(not in a function)
libavcodec/mpeg12dec.c:1204:5: error: initializer element is not constant
libavcodec/mpeg12dec.c:1204:5: error: (near initialization for 
‘mpeg2_hwaccel_pixfmt_list_420[0]’)
libavcodec/mpeg12dec.c: In function ‘setup_hwaccel_for_pixfmt’:
libavcodec/mpeg12dec.c:1279:9: warning: ‘xvmc_acceleration’ is deprecated 
(declared at libavcodec/avcodec.h:2045) [-Wdeprecated-declarations]
libavcodec/mpeg12dec.c: At top level:
libavcodec/mpeg12dec.c:2968:23: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ undeclared 
here (not in a function)
libavcodec/mpeg12dec.c:2967:41: error: invalid operands to binary | (have ‘int’ 
and ‘const enum AVPixelFormat *’)
libavcodec/mpeg12dec.c:2968:50: error: invalid operands to binary | (have 
‘const enum AVPixelFormat *’ and ‘int’)
libavcodec/mpeg12dec.c:2968:23: error: initializer element is not constant
libavcodec/mpeg12dec.c:2968:23: error: (near initialization for 
‘ff_mpeg_vdpau_decoder.capabilities’)
libavcodec/mpeg12dec.c:2983:41: error: invalid operands to binary | (have ‘int’ 
and ‘const enum AVPixelFormat *’)
libavcodec/mpeg12dec.c:2984:50: error: invalid operands to binary | (have 
‘const enum AVPixelFormat *’ and ‘int’)
libavcodec/mpeg12dec.c:2984:23: error: initializer element is not constant
libavcodec/mpeg12dec.c:2984:23: error: (near initialization for 
‘ff_mpeg1_vdpau_decoder.capabilities’)
make: *** [libavcodec/mpeg12dec.o] Error 1
CC  libavcodec/mpeg4videodec.o
libavcodec/mpeg4videodec.c:2811:23: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ 
undeclared here (not in a function)
libavcodec/mpeg4videodec.c:2812:48: error: ‘AV_PIX_FMT_VDPAU_MPEG4’ undeclared 
here (not in a function)
make: *** [libavcodec/mpeg4videodec.o] Error 1
CC  libavcodec/vc1dec.o
libavcodec/vc1dec.c:1169:43: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ undeclared 
here (not in a function)
libavcodec/vc1dec.c:1170:47: error: ‘AV_PIX_FMT_VDPAU_WMV3’ undeclared here 
(not in a function)
libavcodec/vc1dec.c:1186:47: error: ‘AV_PIX_FMT_VDPAU_VC1’ undeclared here (not 
in a function)
make: *** [libavcodec/vc1dec.o] Error 1
CC  libavcodec/vdpau.o
lib

Re: [FFmpeg-devel] [PATCH] lavc/ffmpeg: put FF_API_DEBUG_MV around remaining uses of FF_DEBUG_VIS_QP/MB_TYPE.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 8:44 AM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 08:01:56AM -0400, Ronald S. Bultje wrote:
> > ---
> >  ffmpeg.c   | 6 +-
> >  libavcodec/mpegvideo.c | 4 
> >  libavcodec/options_table.h | 2 ++
> >  libavcodec/pthread_frame.c | 2 ++
> >  4 files changed, 13 insertions(+), 1 deletion(-)
>
> please also remove me from maintainers from the affected codecs
> in case this code gets actually removed or disabled before a
> documented replacement is in place
>
> i use these for maintaining and testing the code


(I expected this sort of reply,) so why is it under a deprecation macro?

Why hasn't anyone taken the time to write a filter that places these things
on top of a frame, so it could be shared with other codecs that export the
same information?

Why is all this stuff so utterly hacky?

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


Re: [FFmpeg-devel] [PATCH 1/2] lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 8:55 AM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 08:19:31AM -0400, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Mon, Aug 17, 2015 at 8:16 AM, Michael Niedermayer
>  > > wrote:
> >
> > > On Mon, Aug 17, 2015 at 07:10:44AM -0400, Ronald S. Bultje wrote:
> > > > ---
> > > >  libavcodec/error_resilience.c |  2 ++
> > > >  libavcodec/h263dec.c  |  2 ++
> > > >  libavcodec/h264.c |  4 
> > > >  libavcodec/h264_picture.c |  4 
> > > >  libavcodec/h264_slice.c   | 16 
> > > >  libavcodec/mpeg12dec.c| 20 +---
> > > >  libavcodec/mpegpicture.c  |  6 +-
> > > >  libavcodec/mpegvideo.c| 11 +--
> > > >  libavcodec/utils.c|  2 ++
> > > >  libavcodec/vc1dec.c   | 28 +---
> > > >  10 files changed, 78 insertions(+), 17 deletions(-)
> > >
> > > with:
> > > @@ -88,7 +88,7 @@
> > >  #define FF_API_LOWRES(LIBAVCODEC_VERSION_MAJOR < 57)
> > >  #endif
> > >  #ifndef FF_API_CAP_VDPAU
> > > -#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
> > > +#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 1)
> > >  #endif
> > >  #ifndef FF_API_BUFS_VDPAU
> > >  #define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 57)
> >
> >
> > Change FF_API_VDPAU also. I don't think anything works if you disable
> only
> > one or the other, and it's not useful anyway. They're meant to be bumped
> > together.
>
> this patch with:
>
> diff --git a/libavcodec/version.h b/libavcodec/version.h
> index 262334f..2998cb5 100644
> --- a/libavcodec/version.h
> +++ b/libavcodec/version.h
> @@ -88,7 +88,7 @@
>  #define FF_API_LOWRES(LIBAVCODEC_VERSION_MAJOR < 57)
>  #endif
>  #ifndef FF_API_CAP_VDPAU
> -#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
> +#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 1)
>  #endif
>  #ifndef FF_API_BUFS_VDPAU
>  #define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 57)
> diff --git a/libavutil/version.h b/libavutil/version.h
> index 653f530..e5a74e3 100644
> --- a/libavutil/version.h
> +++ b/libavutil/version.h
> @@ -108,7 +108,7 @@
>  #define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 55)
>  #endif
>  #ifndef FF_API_VDPAU
> -#define FF_API_VDPAU(LIBAVUTIL_VERSION_MAJOR < 55)
> +#define FF_API_VDPAU(LIBAVUTIL_VERSION_MAJOR < 1)
>  #endif
>  #ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT
>  #define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 55)
>
> still fails to build:
>
> CC  libavcodec/h264.o
> libavcodec/h264.c:2016:43: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ undeclared
> here (not in a function)
> libavcodec/h264.c:2018:48: error: ‘AV_PIX_FMT_VDPAU_H264’ undeclared here
> (not in a function)
> make: *** [libavcodec/h264.o] Error 1


Did you apply patch 2/2 also? If not, can you please apply that also and
re-try?

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


Re: [FFmpeg-devel] [PATCH 1/2] lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.

2015-08-17 Thread Ronald S. Bultje
On Mon, Aug 17, 2015 at 9:14 AM, Ronald S. Bultje 
wrote:

> Hi,
>
> On Mon, Aug 17, 2015 at 8:55 AM, Michael Niedermayer <
> mich...@niedermayer.cc> wrote:
>
>> On Mon, Aug 17, 2015 at 08:19:31AM -0400, Ronald S. Bultje wrote:
>> > Hi,
>> >
>> > On Mon, Aug 17, 2015 at 8:16 AM, Michael Niedermayer
>> > > > wrote:
>> >
>> > > On Mon, Aug 17, 2015 at 07:10:44AM -0400, Ronald S. Bultje wrote:
>> > > > ---
>> > > >  libavcodec/error_resilience.c |  2 ++
>> > > >  libavcodec/h263dec.c  |  2 ++
>> > > >  libavcodec/h264.c |  4 
>> > > >  libavcodec/h264_picture.c |  4 
>> > > >  libavcodec/h264_slice.c   | 16 
>> > > >  libavcodec/mpeg12dec.c| 20 +---
>> > > >  libavcodec/mpegpicture.c  |  6 +-
>> > > >  libavcodec/mpegvideo.c| 11 +--
>> > > >  libavcodec/utils.c|  2 ++
>> > > >  libavcodec/vc1dec.c   | 28 +---
>> > > >  10 files changed, 78 insertions(+), 17 deletions(-)
>> > >
>> > > with:
>> > > @@ -88,7 +88,7 @@
>> > >  #define FF_API_LOWRES(LIBAVCODEC_VERSION_MAJOR < 57)
>> > >  #endif
>> > >  #ifndef FF_API_CAP_VDPAU
>> > > -#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
>> > > +#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 1)
>> > >  #endif
>> > >  #ifndef FF_API_BUFS_VDPAU
>> > >  #define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 57)
>> >
>> >
>> > Change FF_API_VDPAU also. I don't think anything works if you disable
>> only
>> > one or the other, and it's not useful anyway. They're meant to be bumped
>> > together.
>>
>> this patch with:
>>
>> diff --git a/libavcodec/version.h b/libavcodec/version.h
>> index 262334f..2998cb5 100644
>> --- a/libavcodec/version.h
>> +++ b/libavcodec/version.h
>> @@ -88,7 +88,7 @@
>>  #define FF_API_LOWRES(LIBAVCODEC_VERSION_MAJOR < 57)
>>  #endif
>>  #ifndef FF_API_CAP_VDPAU
>> -#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 57)
>> +#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 1)
>>  #endif
>>  #ifndef FF_API_BUFS_VDPAU
>>  #define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 57)
>> diff --git a/libavutil/version.h b/libavutil/version.h
>> index 653f530..e5a74e3 100644
>> --- a/libavutil/version.h
>> +++ b/libavutil/version.h
>> @@ -108,7 +108,7 @@
>>  #define FF_API_AVFRAME_LAVC (LIBAVUTIL_VERSION_MAJOR < 55)
>>  #endif
>>  #ifndef FF_API_VDPAU
>> -#define FF_API_VDPAU(LIBAVUTIL_VERSION_MAJOR < 55)
>> +#define FF_API_VDPAU(LIBAVUTIL_VERSION_MAJOR < 1)
>>  #endif
>>  #ifndef FF_API_GET_CHANNEL_LAYOUT_COMPAT
>>  #define FF_API_GET_CHANNEL_LAYOUT_COMPAT (LIBAVUTIL_VERSION_MAJOR < 55)
>>
>> still fails to build:
>>
>> CC  libavcodec/h264.o
>> libavcodec/h264.c:2016:43: error: ‘AV_CODEC_CAP_HWACCEL_VDPAU’ undeclared
>> here (not in a function)
>> libavcodec/h264.c:2018:48: error: ‘AV_PIX_FMT_VDPAU_H264’ undeclared here
>> (not in a function)
>> make: *** [libavcodec/h264.o] Error 1
>
>
> Did you apply patch 2/2 also? If not, can you please apply that also and
> re-try?
>

Oh I see it's the actual decoders themselves. Let me see what I can do.

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


Re: [FFmpeg-devel] [PATCH] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 07:48:07AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 6:40 AM, Michael Niedermayer  > wrote:
> 
> > On Sun, Aug 16, 2015 at 05:45:55PM -0400, Ronald S. Bultje wrote:
> > > Hi,
> > >
> > > On Sun, Aug 16, 2015 at 5:24 PM, Andreas Cadhalpun <
> > > andreas.cadhal...@googlemail.com> wrote:
> > >
> > > > On 16.08.2015 22:15, Ronald S. Bultje wrote:
> > > > > Convert last users to av_opt_get_*() counterparts.
> > > > > ---
> > > > >  libavfilter/af_aresample.c | 17 +
> > > > >  libavutil/opt.h|  3 +++
> > > > >  2 files changed, 12 insertions(+), 8 deletions(-)
> > > >
> > > > I'm fine with this, but the patch is incomplete:
> > > > libavfilter/x86/vf_spp.c also uses av_get_int.
> > > > Furthermore the FF_OPT_TYPE_* defines are used in several places.
> > >
> > >
> > > Yes I noticed the last one in vf_spp.c, I missed it (don't know how),
> > have
> > > it locally amended. I'm working on FF_OPT_TYPE_* separately (I'm doing
> > one
> > > deprecation macro at a time).
> > >
> >
> > > Some really are a mess, Michael can you comment on how on earth you could
> > > consider adding av_stream_get_end_pts as a replacement for AVFrac without
> > > deeply frowning at yourself? Can you take some time and fix that
> > correctly?
> >
> > AVFrac is used to exactly compute timestamps
> 
> 
> I know what it does.
> 
> I'm talking about a developer's decision to take a deprecated field, leave
> it actively deprecated and about to be removed and then add a public that
> uses exactly this API. How could you do that? How does that in any way help
> us deprecate the struct or field? AVStream.pts is still marked as
> deprecated and isn't even hidden from the public API in your supposedly
> "fixed" implementation. Its API is still exposed in the place where you put
> the data. It still doesn't compile after the version bump. In other words,
> your patch didn't solve anything.
> 

> Can you please fix it properly? Properly means that after bump, it compiles
> and passes fate.

> I'd almost suggest we set up a fate station that tests
> that for the next version bump.

no objection but i think first the code should pass fate after a bump
before such a fate machine is added


> If we intend to hide AVFrac from the user,
> this probably means renaming AVFrac to just Frac, and moving it into some
> internal-only data structure not exposed to the user, where it's accessible
> for av_stream_get_end_pts to use.

the AVFrac pts field is in AVStream
internal AVStream fields are simply after the comment:
/*
 * All fields below this line are not part of the public API. They
 * may not be used outside of libavformat and can be changed and
 * removed at will.
 * New public fields should be added right above.
 *
 */

I can move the field after that with appropriate #if, if that
resolves the issue
the AVFrac struct would have to remain in the public header under some
name though or would need to be dynamically allocated

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

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


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


Re: [FFmpeg-devel] [PATCH] lavc/ffmpeg: put FF_API_DEBUG_MV around remaining uses of FF_DEBUG_VIS_QP/MB_TYPE.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 09:13:58AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 8:44 AM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 08:01:56AM -0400, Ronald S. Bultje wrote:
> > > ---
> > >  ffmpeg.c   | 6 +-
> > >  libavcodec/mpegvideo.c | 4 
> > >  libavcodec/options_table.h | 2 ++
> > >  libavcodec/pthread_frame.c | 2 ++
> > >  4 files changed, 13 insertions(+), 1 deletion(-)
> >
> > please also remove me from maintainers from the affected codecs
> > in case this code gets actually removed or disabled before a
> > documented replacement is in place
> >
> > i use these for maintaining and testing the code
> 
> 
> (I expected this sort of reply,) so why is it under a deprecation macro?
> 
> Why hasn't anyone taken the time to write a filter that places these things
> on top of a frame, so it could be shared with other codecs that export the
> same information?

ubitux has written one for the motion vectors (codecview)
so these could probably be removed but the qp/mb_type vissualization
still lacks a replacement

your patch adds qp/mb_type stuff under the #ifs


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

Republics decline into democracies and democracies degenerate into
despotisms. -- 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] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 9:20 AM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 07:48:07AM -0400, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Mon, Aug 17, 2015 at 6:40 AM, Michael Niedermayer
>  > > wrote:
> >
> > > On Sun, Aug 16, 2015 at 05:45:55PM -0400, Ronald S. Bultje wrote:
> > > > Hi,
> > > >
> > > > On Sun, Aug 16, 2015 at 5:24 PM, Andreas Cadhalpun <
> > > > andreas.cadhal...@googlemail.com> wrote:
> > > >
> > > > > On 16.08.2015 22:15, Ronald S. Bultje wrote:
> > > > > > Convert last users to av_opt_get_*() counterparts.
> > > > > > ---
> > > > > >  libavfilter/af_aresample.c | 17 +
> > > > > >  libavutil/opt.h|  3 +++
> > > > > >  2 files changed, 12 insertions(+), 8 deletions(-)
> > > > >
> > > > > I'm fine with this, but the patch is incomplete:
> > > > > libavfilter/x86/vf_spp.c also uses av_get_int.
> > > > > Furthermore the FF_OPT_TYPE_* defines are used in several places.
> > > >
> > > >
> > > > Yes I noticed the last one in vf_spp.c, I missed it (don't know how),
> > > have
> > > > it locally amended. I'm working on FF_OPT_TYPE_* separately (I'm
> doing
> > > one
> > > > deprecation macro at a time).
> > > >
> > >
> > > > Some really are a mess, Michael can you comment on how on earth you
> could
> > > > consider adding av_stream_get_end_pts as a replacement for AVFrac
> without
> > > > deeply frowning at yourself? Can you take some time and fix that
> > > correctly?
> > >
> > > AVFrac is used to exactly compute timestamps
> >
> >
> > I know what it does.
> >
> > I'm talking about a developer's decision to take a deprecated field,
> leave
> > it actively deprecated and about to be removed and then add a public that
> > uses exactly this API. How could you do that? How does that in any way
> help
> > us deprecate the struct or field? AVStream.pts is still marked as
> > deprecated and isn't even hidden from the public API in your supposedly
> > "fixed" implementation. Its API is still exposed in the place where you
> put
> > the data. It still doesn't compile after the version bump. In other
> words,
> > your patch didn't solve anything.
> >
>
> > Can you please fix it properly? Properly means that after bump, it
> compiles
> > and passes fate.
>
> > I'd almost suggest we set up a fate station that tests
> > that for the next version bump.
>
> no objection but i think first the code should pass fate after a bump
> before such a fate machine is added
>

Working on it.

> If we intend to hide AVFrac from the user,
> > this probably means renaming AVFrac to just Frac, and moving it into some
> > internal-only data structure not exposed to the user, where it's
> accessible
> > for av_stream_get_end_pts to use.
>
> the AVFrac pts field is in AVStream
> internal AVStream fields are simply after the comment:
> /*
>  * All fields below this line are not part of the public API. They
>  * may not be used outside of libavformat and can be changed and
>  * removed at will.
>  * New public fields should be added right above.
>  *
>  */
>
> I can move the field after that with appropriate #if, if that
> resolves the issue
> the AVFrac struct would have to remain in the public header under some
> name though or would need to be dynamically allocated


I think it should be dynamically allocated, AVFrac should be removed from
public headers.

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


Re: [FFmpeg-devel] [PATCH] lavc/ffmpeg: put FF_API_DEBUG_MV around remaining uses of FF_DEBUG_VIS_QP/MB_TYPE.

2015-08-17 Thread Clément Bœsch
On Mon, Aug 17, 2015 at 03:31:16PM +0200, Michael Niedermayer wrote:
> On Mon, Aug 17, 2015 at 09:13:58AM -0400, Ronald S. Bultje wrote:
> > Hi,
> > 
> > On Mon, Aug 17, 2015 at 8:44 AM, Michael Niedermayer  > > wrote:
> > 
> > > On Mon, Aug 17, 2015 at 08:01:56AM -0400, Ronald S. Bultje wrote:
> > > > ---
> > > >  ffmpeg.c   | 6 +-
> > > >  libavcodec/mpegvideo.c | 4 
> > > >  libavcodec/options_table.h | 2 ++
> > > >  libavcodec/pthread_frame.c | 2 ++
> > > >  4 files changed, 13 insertions(+), 1 deletion(-)
> > >
> > > please also remove me from maintainers from the affected codecs
> > > in case this code gets actually removed or disabled before a
> > > documented replacement is in place
> > >
> > > i use these for maintaining and testing the code
> > 
> > 
> > (I expected this sort of reply,) so why is it under a deprecation macro?
> > 
> > Why hasn't anyone taken the time to write a filter that places these things
> > on top of a frame, so it could be shared with other codecs that export the
> > same information?
> 
> ubitux has written one for the motion vectors (codecview)
> so these could probably be removed but the qp/mb_type vissualization
> still lacks a replacement
> 

i actually have a WIP on that (to integrate the visualization of qp in
codecview), which i'll try to submit asap

> your patch adds qp/mb_type stuff under the #ifs
> 
> 


-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH]lavc/mjpegdec: Detect more CMYK images

2015-08-17 Thread Carl Eugen Hoyos
Michael Niedermayer  niedermayer.cc> writes:

> > Attached patch fixes ticket #4772 for me.
> > 
> > Please comment, Carl Eugen
> 
> probably ok

Patch applied.

Thank you, Carl Eugen

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


[FFmpeg-devel] [PATCH] avformat: Remove use of AVFrac and AVStream->pts

2015-08-17 Thread Michael Niedermayer
From: Michael Niedermayer 

Move field to internal part of AVStream and struct to internal.h

Signed-off-by: Michael Niedermayer 
---
 libavformat/avformat.h |2 ++
 libavformat/internal.h |   12 
 libavformat/mux.c  |   22 ++
 libavformat/utils.c|6 +-
 4 files changed, 33 insertions(+), 9 deletions(-)

diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 6933624..e83a374 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -1170,6 +1170,8 @@ typedef struct AVStream {
  * - decoding: Set by libavformat to calculate sample_aspect_ratio 
internally
  */
 AVRational display_aspect_ratio;
+
+struct FFFrac *priv_pts;
 } AVStream;
 
 AVRational av_stream_get_r_frame_rate(const AVStream *s);
diff --git a/libavformat/internal.h b/libavformat/internal.h
index 352739e..bd8a0bc 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -49,6 +49,18 @@ typedef struct CodecMime{
 enum AVCodecID id;
 } CodecMime;
 
+/*/
+/* fractional numbers for exact pts handling */
+
+/**
+ * The exact value of the fractional number is: 'val + num / den'.
+ * num is assumed to be 0 <= num < den.
+ */
+typedef struct FFFrac {
+int64_t val, num, den;
+} FFFrac;
+
+
 struct AVFormatInternal {
 /**
  * Number of streams relevant for interleaving.
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 909617f..49afaad 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -61,7 +61,7 @@
  * @param num must be >= 0
  * @param den must be >= 1
  */
-static void frac_init(AVFrac *f, int64_t val, int64_t num, int64_t den)
+static void frac_init(FFFrac *f, int64_t val, int64_t num, int64_t den)
 {
 num += (den >> 1);
 if (num >= den) {
@@ -79,7 +79,7 @@ static void frac_init(AVFrac *f, int64_t val, int64_t num, 
int64_t den)
  * @param f fractional number
  * @param incr increment, can be positive or negative
  */
-static void frac_add(AVFrac *f, int64_t incr)
+static void frac_add(FFFrac *f, int64_t incr)
 {
 int64_t num, den;
 
@@ -414,11 +414,17 @@ static int init_pts(AVFormatContext *s)
 default:
 break;
 }
+
+if (!st->priv_pts)
+st->priv_pts = av_mallocz(sizeof(*st->priv_pts));
+if (!st->priv_pts)
+return AVERROR(ENOMEM);
+
 if (den != AV_NOPTS_VALUE) {
 if (den <= 0)
 return AVERROR_INVALIDDATA;
 
-frac_init(&st->pts, 0, 0, den);
+frac_init(st->priv_pts, 0, 0, den);
 }
 }
 
@@ -502,7 +508,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream 
*st, AVPacket *pkt)
 }
 pkt->dts =
 //pkt->pts= st->cur_dts;
-pkt->pts = st->pts.val;
+pkt->pts = st->priv_pts->val;
 }
 
 //calculate dts from pts
@@ -538,7 +544,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream 
*st, AVPacket *pkt)
 av_ts2str(pkt->pts), av_ts2str(pkt->dts));
 
 st->cur_dts = pkt->dts;
-st->pts.val = pkt->dts;
+st->priv_pts->val = pkt->dts;
 
 /* update pts */
 switch (st->codec->codec_type) {
@@ -550,12 +556,12 @@ static int compute_pkt_fields2(AVFormatContext *s, 
AVStream *st, AVPacket *pkt)
 /* HACK/FIXME, we skip the initial 0 size packets as they are most
  * likely equal to the encoder delay, but it would be better if we
  * had the real timestamps from the encoder */
-if (frame_size >= 0 && (pkt->size || st->pts.num != st->pts.den >> 1 
|| st->pts.val)) {
-frac_add(&st->pts, (int64_t)st->time_base.den * frame_size);
+if (frame_size >= 0 && (pkt->size || st->priv_pts->num != 
st->priv_pts->den >> 1 || st->priv_pts->val)) {
+frac_add(st->priv_pts, (int64_t)st->time_base.den * frame_size);
 }
 break;
 case AVMEDIA_TYPE_VIDEO:
-frac_add(&st->pts, (int64_t)st->time_base.den * 
st->codec->time_base.num);
+frac_add(st->priv_pts, (int64_t)st->time_base.den * 
st->codec->time_base.num);
 break;
 }
 return 0;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index ccc2129..758b940 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -116,7 +116,10 @@ MAKE_ACCESSORS(AVFormatContext, format, AVOpenCallback, 
open_cb)
 
 int64_t av_stream_get_end_pts(const AVStream *st)
 {
-return st->pts.val;
+if (st->priv_pts) {
+return st->priv_pts->val;
+} else
+return AV_NOPTS_VALUE;
 }
 
 struct AVCodecParserContext *av_stream_get_parser(const AVStream *st)
@@ -3668,6 +3671,7 @@ void ff_free_stream(AVFormatContext *s, AVStream *st) {
 av_freep(&st->info->duration_error);
 av_freep(&st->info);
 av_freep(&st->recommended_encoder_configuration);
+av_freep(&st->priv_pts);
 av_freep(&s->streams[ --s->nb_streams ]);
 }
 
-- 
1.7.9.5

___
ffmpeg-devel

Re: [FFmpeg-devel] [PATCH] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 09:28:10AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 9:20 AM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 07:48:07AM -0400, Ronald S. Bultje wrote:
> > > Hi,
> > >
> > > On Mon, Aug 17, 2015 at 6:40 AM, Michael Niedermayer
> >  > > > wrote:
> > >
> > > > On Sun, Aug 16, 2015 at 05:45:55PM -0400, Ronald S. Bultje wrote:
> > > > > Hi,
> > > > >
> > > > > On Sun, Aug 16, 2015 at 5:24 PM, Andreas Cadhalpun <
> > > > > andreas.cadhal...@googlemail.com> wrote:
> > > > >
> > > > > > On 16.08.2015 22:15, Ronald S. Bultje wrote:
> > > > > > > Convert last users to av_opt_get_*() counterparts.
> > > > > > > ---
> > > > > > >  libavfilter/af_aresample.c | 17 +
> > > > > > >  libavutil/opt.h|  3 +++
> > > > > > >  2 files changed, 12 insertions(+), 8 deletions(-)
> > > > > >
> > > > > > I'm fine with this, but the patch is incomplete:
> > > > > > libavfilter/x86/vf_spp.c also uses av_get_int.
> > > > > > Furthermore the FF_OPT_TYPE_* defines are used in several places.
> > > > >
> > > > >
> > > > > Yes I noticed the last one in vf_spp.c, I missed it (don't know how),
> > > > have
> > > > > it locally amended. I'm working on FF_OPT_TYPE_* separately (I'm
> > doing
> > > > one
> > > > > deprecation macro at a time).
> > > > >
> > > >
> > > > > Some really are a mess, Michael can you comment on how on earth you
> > could
> > > > > consider adding av_stream_get_end_pts as a replacement for AVFrac
> > without
> > > > > deeply frowning at yourself? Can you take some time and fix that
> > > > correctly?
> > > >
> > > > AVFrac is used to exactly compute timestamps
> > >
> > >
> > > I know what it does.
> > >
> > > I'm talking about a developer's decision to take a deprecated field,
> > leave
> > > it actively deprecated and about to be removed and then add a public that
> > > uses exactly this API. How could you do that? How does that in any way
> > help
> > > us deprecate the struct or field? AVStream.pts is still marked as
> > > deprecated and isn't even hidden from the public API in your supposedly
> > > "fixed" implementation. Its API is still exposed in the place where you
> > put
> > > the data. It still doesn't compile after the version bump. In other
> > words,
> > > your patch didn't solve anything.
> > >
> >
> > > Can you please fix it properly? Properly means that after bump, it
> > compiles
> > > and passes fate.
> >
> > > I'd almost suggest we set up a fate station that tests
> > > that for the next version bump.
> >
> > no objection but i think first the code should pass fate after a bump
> > before such a fate machine is added
> >
> 
> Working on it.
> 
> > If we intend to hide AVFrac from the user,
> > > this probably means renaming AVFrac to just Frac, and moving it into some
> > > internal-only data structure not exposed to the user, where it's
> > accessible
> > > for av_stream_get_end_pts to use.
> >
> > the AVFrac pts field is in AVStream
> > internal AVStream fields are simply after the comment:
> > /*
> >  * All fields below this line are not part of the public API. They
> >  * may not be used outside of libavformat and can be changed and
> >  * removed at will.
> >  * New public fields should be added right above.
> >  *
> >  */
> >
> > I can move the field after that with appropriate #if, if that
> > resolves the issue
> > the AVFrac struct would have to remain in the public header under some
> > name though or would need to be dynamically allocated
> 
> 
> I think it should be dynamically allocated, AVFrac should be removed from
> public headers.

patch posted

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

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


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


Re: [FFmpeg-devel] [PATCH] lavc/ffmpeg: put FF_API_DEBUG_MV around remaining uses of FF_DEBUG_VIS_QP/MB_TYPE.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 03:45:34PM +0200, Clément Bœsch wrote:
> On Mon, Aug 17, 2015 at 03:31:16PM +0200, Michael Niedermayer wrote:
> > On Mon, Aug 17, 2015 at 09:13:58AM -0400, Ronald S. Bultje wrote:
> > > Hi,
> > > 
> > > On Mon, Aug 17, 2015 at 8:44 AM, Michael Niedermayer 
> > >  > > > wrote:
> > > 
> > > > On Mon, Aug 17, 2015 at 08:01:56AM -0400, Ronald S. Bultje wrote:
> > > > > ---
> > > > >  ffmpeg.c   | 6 +-
> > > > >  libavcodec/mpegvideo.c | 4 
> > > > >  libavcodec/options_table.h | 2 ++
> > > > >  libavcodec/pthread_frame.c | 2 ++
> > > > >  4 files changed, 13 insertions(+), 1 deletion(-)
> > > >
> > > > please also remove me from maintainers from the affected codecs
> > > > in case this code gets actually removed or disabled before a
> > > > documented replacement is in place
> > > >
> > > > i use these for maintaining and testing the code
> > > 
> > > 
> > > (I expected this sort of reply,) so why is it under a deprecation macro?
> > > 
> > > Why hasn't anyone taken the time to write a filter that places these 
> > > things
> > > on top of a frame, so it could be shared with other codecs that export the
> > > same information?
> > 
> > ubitux has written one for the motion vectors (codecview)
> > so these could probably be removed but the qp/mb_type vissualization
> > still lacks a replacement
> > 
> 
> i actually have a WIP on that (to integrate the visualization of qp in
> codecview), which i'll try to submit asap

it also would be nice if these filters would be auto inserted and
used when the old command line options are used
like -deinterlace does with yadif

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] avformat: Remove use of AVFrac and AVStream->pts

2015-08-17 Thread Nicolas George
Le decadi 30 thermidor, an CCXXIII, Michael Niedermayer a écrit :
> From: Michael Niedermayer 
> 
> Move field to internal part of AVStream and struct to internal.h
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/avformat.h |2 ++
>  libavformat/internal.h |   12 
>  libavformat/mux.c  |   22 ++
>  libavformat/utils.c|6 +-
>  4 files changed, 33 insertions(+), 9 deletions(-)

I see there are very few uses of this structure: why not simply replace it
by stand-alone fields?

int64_t pts_int, pts_num, pts_den;

The only use of frac_init() can be inlined:

st->pts_int = 0;
st->pts_num = 0;
st->pts_den = den;

And frac_add() is used only twice, both times directly on &st->pts, it could
become:

void pts_add(AVStream *st, int64_t incr)

Or maybe I am missing something obvious?

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] [libav-devel] [PATCH 5/6] Postpone API-incompatible changes until the next bump

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 07:53:59AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 12:06 AM, Michael Niedermayer <
> mich...@niedermayer.cc> wrote:
> 
> > On Sun, Aug 16, 2015 at 10:12:23PM +0200, Andreas Cadhalpun wrote:
> > > Hi,
> > >
> > > On 16.08.2015 19:27, Ronald S. Bultje wrote:
> > > > On Sat, Aug 8, 2015 at 7:37 AM, Andreas Cadhalpun <
> > > > andreas.cadhal...@googlemail.com> wrote:
> > > >
> > > >> +#define FF_API_VOXWARE   (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_AC_VLC(LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_OLD_MSMPEG4   (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_ARCH_ALPHA(LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_NEG_LINESIZES (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_ARCH_SH4  (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_ARCH_SPARC(LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_IDCT_XVIDMMX  (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_AVFILTER_OPEN
> > (LIBAVFILTER_VERSION_MAJOR < 7)
> > > >> +#define FF_API_AVFILTER_INIT_FILTER
> >  (LIBAVFILTER_VERSION_MAJOR < 7)
> > > >> +#define FF_API_NOCONST_GET_NAME
> >  (LIBAVFILTER_VERSION_MAJOR < 7)
> > > >> +#define FF_API_OPT_TYPE_METADATA(LIBAVUTIL_VERSION_MAJOR <
> > 56)
> > >
> > > Removing these now is probably OK, because they seem to be relatively
> > > unused.
> > >
> > > >> +#define FF_API_BUFS_VDPAU(LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_SET_DIMENSIONS(LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_ASPECT_EXTENDED   (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_ERROR_RATE(LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_MB_TYPE   (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_MAX_BFRAMES   (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_INPUT_PRESERVED   (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_NORMALIZE_AQP (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_GMC   (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_MV0   (LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_CODEC_NAME(LIBAVCODEC_VERSION_MAJOR < 58)
> > > >> +#define FF_API_AFD   (LIBAVCODEC_VERSION_MAJOR < 58)
> >
> > > >> +#define FF_API_OLD_FILTER_OPTS
> > (LIBAVFILTER_VERSION_MAJOR < 7)
> >
> > If thats removed/disabled
> > It will also break user scripts, examples from forum posts and
> > testcases from tickets, this is not just API
> 
> 
> Stackoverflow allows post edits. If you give links to posts to edit, I can
> help edit them.
> 

> To further help users, we can even keep the warning message (without fixing
> it for the user), making it an error, something like:
> 
> av_log(filter, AV_LOG_ERROR, "This syntax is deprecated. Use "
>"'|' to separate the list items.\n");
> av_log(filter, AV_LOG_ERROR, "Try re-running with args=[%s]\n",
> copy);

i am strongly in favor of this, if support for the old syntax is
removed

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

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


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


Re: [FFmpeg-devel] [PATCH] avformat: Remove use of AVFrac and AVStream->pts

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 04:36:52PM +0200, Nicolas George wrote:
> Le decadi 30 thermidor, an CCXXIII, Michael Niedermayer a écrit :
> > From: Michael Niedermayer 
> > 
> > Move field to internal part of AVStream and struct to internal.h
> > 
> > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/avformat.h |2 ++
> >  libavformat/internal.h |   12 
> >  libavformat/mux.c  |   22 ++
> >  libavformat/utils.c|6 +-
> >  4 files changed, 33 insertions(+), 9 deletions(-)
> 
> I see there are very few uses of this structure: why not simply replace it
> by stand-alone fields?
> 
>   int64_t pts_int, pts_num, pts_den;
> 
> The only use of frac_init() can be inlined:
> 
>   st->pts_int = 0;
>   st->pts_num = 0;
>   st->pts_den = den;
> 
> And frac_add() is used only twice, both times directly on &st->pts, it could
> become:
> 
>   void pts_add(AVStream *st, int64_t incr)
> 
> Or maybe I am missing something obvious?

at least on the demuxer side we have a timestamp rounding accumulation
bug that looks like it can be fixed by using *Frac. I dont know if
other places exist but the usecase seems somewhat generic so i
wouldnt be surprised to find more places that could use it.
If we cut the API down to the bare minimum actually used ATM then
using it elsewhere may no longer be possible as other uses
might require the removed parts.
So i think we first should investigate where potetial uses exist
that would become more exact with it and only afterwards cut the
API down if theres something that is nowhere used

[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


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

2015-08-17 Thread Michael Niedermayer
On Sat, Aug 15, 2015 at 06:55:52PM +0200, Michael Niedermayer wrote:
> From: Michael Niedermayer 
> 
> TODO: docs
> 
> This filter can be used to scale one stream to match another or based on
> another, usefull to scale subtitles or other things to be overlayed
> 
> Signed-off-by: Michael Niedermayer 
> ---
>  configure|2 ++
>  libavfilter/Makefile |1 +
>  libavfilter/allfilters.c |1 +
>  libavfilter/vf_scale.c   |   88 
> ++
>  4 files changed, 85 insertions(+), 7 deletions(-)

applied

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

I have never wished to cater to the crowd; for what I know they do not
approve, and what they approve I do not know. -- Epicurus


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


Re: [FFmpeg-devel] [PATCH] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 9:20 AM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 07:48:07AM -0400, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Mon, Aug 17, 2015 at 6:40 AM, Michael Niedermayer
>  > > wrote:
> >
> > > On Sun, Aug 16, 2015 at 05:45:55PM -0400, Ronald S. Bultje wrote:
> > > > Hi,
> > > >
> > > > On Sun, Aug 16, 2015 at 5:24 PM, Andreas Cadhalpun <
> > > > andreas.cadhal...@googlemail.com> wrote:
> > > >
> > > > > On 16.08.2015 22:15, Ronald S. Bultje wrote:
> > > > > > Convert last users to av_opt_get_*() counterparts.
> > > > > > ---
> > > > > >  libavfilter/af_aresample.c | 17 +
> > > > > >  libavutil/opt.h|  3 +++
> > > > > >  2 files changed, 12 insertions(+), 8 deletions(-)
> > > > >
> > > > > I'm fine with this, but the patch is incomplete:
> > > > > libavfilter/x86/vf_spp.c also uses av_get_int.
> > > > > Furthermore the FF_OPT_TYPE_* defines are used in several places.
> > > >
> > > >
> > > > Yes I noticed the last one in vf_spp.c, I missed it (don't know how),
> > > have
> > > > it locally amended. I'm working on FF_OPT_TYPE_* separately (I'm
> doing
> > > one
> > > > deprecation macro at a time).
> > > >
> > >
> > > > Some really are a mess, Michael can you comment on how on earth you
> could
> > > > consider adding av_stream_get_end_pts as a replacement for AVFrac
> without
> > > > deeply frowning at yourself? Can you take some time and fix that
> > > correctly?
> > >
> > > AVFrac is used to exactly compute timestamps
> >
> >
> > I know what it does.
> >
> > I'm talking about a developer's decision to take a deprecated field,
> leave
> > it actively deprecated and about to be removed and then add a public that
> > uses exactly this API. How could you do that? How does that in any way
> help
> > us deprecate the struct or field? AVStream.pts is still marked as
> > deprecated and isn't even hidden from the public API in your supposedly
> > "fixed" implementation. Its API is still exposed in the place where you
> put
> > the data. It still doesn't compile after the version bump. In other
> words,
> > your patch didn't solve anything.
> >
>
> > Can you please fix it properly? Properly means that after bump, it
> compiles
> > and passes fate.
>
> > I'd almost suggest we set up a fate station that tests
> > that for the next version bump.
>
> no objection but i think first the code should pass fate after a bump
> before such a fate machine is added
>
>
> > If we intend to hide AVFrac from the user,
> > this probably means renaming AVFrac to just Frac, and moving it into some
> > internal-only data structure not exposed to the user, where it's
> accessible
> > for av_stream_get_end_pts to use.
>
> the AVFrac pts field is in AVStream
> internal AVStream fields are simply after the comment:
> /*
>  * All fields below this line are not part of the public API. They
>  * may not be used outside of libavformat and can be changed and
>  * removed at will.
>  * New public fields should be added right above.
>  *
>  */
>
> I can move the field after that with appropriate #if, if that
> resolves the issue


How do we enforce this btw? Isn't it much nicer (since we allocate AVStream
inside lavf anyway) if we hide all the items and make them
internally-visible only in a separate struct (typedef struct AVStreamReal {
AVStream parent; [ all other members ] } AVStreamReal;)?

(I bet that mplayer or some other half-assed project uses one of these
members and will complain.)

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


[FFmpeg-devel] [RFC]lavf/mpegtsenc: Allow muxing jpeg2000

2015-08-17 Thread Carl Eugen Hoyos
Hi!

John Högberg has no objections against this patch but I don't know 
how to test (except with FFmpeg).

Please comment, Carl Eugen
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index 45bab1c..76a1cc9 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -314,6 +314,9 @@ static int mpegts_write_pmt(AVFormatContext *s, 
MpegTSService *service)
 case AV_CODEC_ID_TRUEHD:
 stream_type = STREAM_TYPE_AUDIO_TRUEHD;
 break;
+case AV_CODEC_ID_JPEG2000:
+stream_type = 0x21;
+break;
 default:
 stream_type = STREAM_TYPE_PRIVATE_DATA;
 break;
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Hendrik Leppkes
On Mon, Aug 17, 2015 at 5:30 PM, Ronald S. Bultje  wrote:
> Hi,
>
> On Mon, Aug 17, 2015 at 9:20 AM, Michael Niedermayer > wrote:
>
>> On Mon, Aug 17, 2015 at 07:48:07AM -0400, Ronald S. Bultje wrote:
>> > Hi,
>> >
>> > On Mon, Aug 17, 2015 at 6:40 AM, Michael Niedermayer
>> > > > wrote:
>> >
>> > > On Sun, Aug 16, 2015 at 05:45:55PM -0400, Ronald S. Bultje wrote:
>> > > > Hi,
>> > > >
>> > > > On Sun, Aug 16, 2015 at 5:24 PM, Andreas Cadhalpun <
>> > > > andreas.cadhal...@googlemail.com> wrote:
>> > > >
>> > > > > On 16.08.2015 22:15, Ronald S. Bultje wrote:
>> > > > > > Convert last users to av_opt_get_*() counterparts.
>> > > > > > ---
>> > > > > >  libavfilter/af_aresample.c | 17 +
>> > > > > >  libavutil/opt.h|  3 +++
>> > > > > >  2 files changed, 12 insertions(+), 8 deletions(-)
>> > > > >
>> > > > > I'm fine with this, but the patch is incomplete:
>> > > > > libavfilter/x86/vf_spp.c also uses av_get_int.
>> > > > > Furthermore the FF_OPT_TYPE_* defines are used in several places.
>> > > >
>> > > >
>> > > > Yes I noticed the last one in vf_spp.c, I missed it (don't know how),
>> > > have
>> > > > it locally amended. I'm working on FF_OPT_TYPE_* separately (I'm
>> doing
>> > > one
>> > > > deprecation macro at a time).
>> > > >
>> > >
>> > > > Some really are a mess, Michael can you comment on how on earth you
>> could
>> > > > consider adding av_stream_get_end_pts as a replacement for AVFrac
>> without
>> > > > deeply frowning at yourself? Can you take some time and fix that
>> > > correctly?
>> > >
>> > > AVFrac is used to exactly compute timestamps
>> >
>> >
>> > I know what it does.
>> >
>> > I'm talking about a developer's decision to take a deprecated field,
>> leave
>> > it actively deprecated and about to be removed and then add a public that
>> > uses exactly this API. How could you do that? How does that in any way
>> help
>> > us deprecate the struct or field? AVStream.pts is still marked as
>> > deprecated and isn't even hidden from the public API in your supposedly
>> > "fixed" implementation. Its API is still exposed in the place where you
>> put
>> > the data. It still doesn't compile after the version bump. In other
>> words,
>> > your patch didn't solve anything.
>> >
>>
>> > Can you please fix it properly? Properly means that after bump, it
>> compiles
>> > and passes fate.
>>
>> > I'd almost suggest we set up a fate station that tests
>> > that for the next version bump.
>>
>> no objection but i think first the code should pass fate after a bump
>> before such a fate machine is added
>>
>>
>> > If we intend to hide AVFrac from the user,
>> > this probably means renaming AVFrac to just Frac, and moving it into some
>> > internal-only data structure not exposed to the user, where it's
>> accessible
>> > for av_stream_get_end_pts to use.
>>
>> the AVFrac pts field is in AVStream
>> internal AVStream fields are simply after the comment:
>> /*
>>  * All fields below this line are not part of the public API. They
>>  * may not be used outside of libavformat and can be changed and
>>  * removed at will.
>>  * New public fields should be added right above.
>>  *
>>  */
>>
>> I can move the field after that with appropriate #if, if that
>> resolves the issue
>
>
> How do we enforce this btw? Isn't it much nicer (since we allocate AVStream
> inside lavf anyway) if we hide all the items and make them
> internally-visible only in a separate struct (typedef struct AVStreamReal {
> AVStream parent; [ all other members ] } AVStreamReal;)?
>
> (I bet that mplayer or some other half-assed project uses one of these
> members and will complain.)
>

We moved internal things into an opaque sub-struct in other contexts,
so doing it for AVStream is probably a logical next step.
However the usualy way to do this is using AVStreamInternal* at the
end of the AVStream, not using a different internal struct definition
like that.

PS:
Complaints about things explicitly marked "internal" going away should
be flat out ignored.

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


Re: [FFmpeg-devel] [PATCH] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 11:30:15AM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 9:20 AM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 07:48:07AM -0400, Ronald S. Bultje wrote:
> > > Hi,
> > >
> > > On Mon, Aug 17, 2015 at 6:40 AM, Michael Niedermayer
> >  > > > wrote:
> > >
> > > > On Sun, Aug 16, 2015 at 05:45:55PM -0400, Ronald S. Bultje wrote:
> > > > > Hi,
> > > > >
> > > > > On Sun, Aug 16, 2015 at 5:24 PM, Andreas Cadhalpun <
> > > > > andreas.cadhal...@googlemail.com> wrote:
> > > > >
> > > > > > On 16.08.2015 22:15, Ronald S. Bultje wrote:
> > > > > > > Convert last users to av_opt_get_*() counterparts.
> > > > > > > ---
> > > > > > >  libavfilter/af_aresample.c | 17 +
> > > > > > >  libavutil/opt.h|  3 +++
> > > > > > >  2 files changed, 12 insertions(+), 8 deletions(-)
> > > > > >
> > > > > > I'm fine with this, but the patch is incomplete:
> > > > > > libavfilter/x86/vf_spp.c also uses av_get_int.
> > > > > > Furthermore the FF_OPT_TYPE_* defines are used in several places.
> > > > >
> > > > >
> > > > > Yes I noticed the last one in vf_spp.c, I missed it (don't know how),
> > > > have
> > > > > it locally amended. I'm working on FF_OPT_TYPE_* separately (I'm
> > doing
> > > > one
> > > > > deprecation macro at a time).
> > > > >
> > > >
> > > > > Some really are a mess, Michael can you comment on how on earth you
> > could
> > > > > consider adding av_stream_get_end_pts as a replacement for AVFrac
> > without
> > > > > deeply frowning at yourself? Can you take some time and fix that
> > > > correctly?
> > > >
> > > > AVFrac is used to exactly compute timestamps
> > >
> > >
> > > I know what it does.
> > >
> > > I'm talking about a developer's decision to take a deprecated field,
> > leave
> > > it actively deprecated and about to be removed and then add a public that
> > > uses exactly this API. How could you do that? How does that in any way
> > help
> > > us deprecate the struct or field? AVStream.pts is still marked as
> > > deprecated and isn't even hidden from the public API in your supposedly
> > > "fixed" implementation. Its API is still exposed in the place where you
> > put
> > > the data. It still doesn't compile after the version bump. In other
> > words,
> > > your patch didn't solve anything.
> > >
> >
> > > Can you please fix it properly? Properly means that after bump, it
> > compiles
> > > and passes fate.
> >
> > > I'd almost suggest we set up a fate station that tests
> > > that for the next version bump.
> >
> > no objection but i think first the code should pass fate after a bump
> > before such a fate machine is added
> >
> >
> > > If we intend to hide AVFrac from the user,
> > > this probably means renaming AVFrac to just Frac, and moving it into some
> > > internal-only data structure not exposed to the user, where it's
> > accessible
> > > for av_stream_get_end_pts to use.
> >
> > the AVFrac pts field is in AVStream
> > internal AVStream fields are simply after the comment:
> > /*
> >  * All fields below this line are not part of the public API. They
> >  * may not be used outside of libavformat and can be changed and
> >  * removed at will.
> >  * New public fields should be added right above.
> >  *
> >  */
> >
> > I can move the field after that with appropriate #if, if that
> > resolves the issue
> 
> 
> How do we enforce this btw? Isn't it much nicer (since we allocate AVStream
> inside lavf anyway) if we hide all the items and make them
> internally-visible only in a separate struct (typedef struct AVStreamReal {
> AVStream parent; [ all other members ] } AVStreamReal;)?

putting the internal things into a distinct non public struct or
area after AVStream in some form would be nicer yes.

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

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


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


[FFmpeg-devel] [PATCH 2/6] FF_OPT_TYPE_* -> AV_OPT_TYPE_*.

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/dvbsubdec.c   |  6 +++---
 libavcodec/frwu.c|  2 +-
 libavcodec/h264.c|  4 ++--
 libavcodec/libvpxenc.c   |  6 +++---
 libavcodec/mpeg4videodec.c   |  4 ++--
 libavcodec/s302m.c   | 10 +-
 libavcodec/v210dec.c |  2 +-
 libavformat/hls.c|  2 +-
 libavformat/mov.c|  6 +++---
 libavformat/tedcaptionsdec.c |  2 +-
 10 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index ff835ab..8aa203a 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -1718,9 +1718,9 @@ end:
 
 #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
 static const AVOption options[] = {
-{"compute_edt", "compute end of time using pts or timeout", 
offsetof(DVBSubContext, compute_edt), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DS},
-{"compute_clut", "compute clut when not available(-1) or always(1) or 
never(0)", offsetof(DVBSubContext, compute_clut), FF_OPT_TYPE_INT, {.i64 = -1}, 
-1, 1, DS},
-{"dvb_substream", "", offsetof(DVBSubContext, substream), FF_OPT_TYPE_INT, 
{.i64 = -1}, -1, 63, DS},
+{"compute_edt", "compute end of time using pts or timeout", 
offsetof(DVBSubContext, compute_edt), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DS},
+{"compute_clut", "compute clut when not available(-1) or always(1) or 
never(0)", offsetof(DVBSubContext, compute_clut), AV_OPT_TYPE_INT, {.i64 = -1}, 
-1, 1, DS},
+{"dvb_substream", "", offsetof(DVBSubContext, substream), AV_OPT_TYPE_INT, 
{.i64 = -1}, -1, 63, DS},
 {NULL}
 };
 static const AVClass dvbsubdec_class = {
diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c
index db4c1ba..1aabefe 100644
--- a/libavcodec/frwu.c
+++ b/libavcodec/frwu.c
@@ -103,7 +103,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, 
int *got_frame,
 }
 
 static const AVOption frwu_options[] = {
-{"change_field_order", "Change field order", offsetof(FRWUContext, 
change_field_order), FF_OPT_TYPE_INT,
+{"change_field_order", "Change field order", offsetof(FRWUContext, 
change_field_order), AV_OPT_TYPE_INT,
  {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM},
 {NULL}
 };
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 24e209c..ca0a4a5 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1946,8 +1946,8 @@ static av_cold int h264_decode_end(AVCodecContext *avctx)
 #define OFFSET(x) offsetof(H264Context, x)
 #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 static const AVOption h264_options[] = {
-{"is_avc", "is avc", offsetof(H264Context, is_avc), FF_OPT_TYPE_INT, {.i64 
= 0}, 0, 1, 0},
-{"nal_length_size", "nal_length_size", offsetof(H264Context, 
nal_length_size), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
+{"is_avc", "is avc", offsetof(H264Context, is_avc), AV_OPT_TYPE_INT, {.i64 
= 0}, 0, 1, 0},
+{"nal_length_size", "nal_length_size", offsetof(H264Context, 
nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
 { "enable_er", "Enable error resilience on damaged frames (unsafe)", 
OFFSET(enable_er), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VD },
 { NULL },
 };
diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 3db617d..58e8f5d 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -985,9 +985,9 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
 #define LEGACY_OPTIONS \
 {"speed", "", offsetof(VP8Context, cpu_used), AV_OPT_TYPE_INT, {.i64 = 1}, 
-16, 16, VE}, \
 {"quality", "", offsetof(VP8Context, deadline), AV_OPT_TYPE_INT, {.i64 = 
VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, \
-{"vp8flags", "", offsetof(VP8Context, flags), FF_OPT_TYPE_FLAGS, {.i64 = 
0}, 0, UINT_MAX, VE, "flags"}, \
-{"error_resilient", "enable error resilience", 0, FF_OPT_TYPE_CONST, {.dbl 
= VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
-{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
0, FF_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
"flags"}, \
+{"vp8flags", "", offsetof(VP8Context, flags), AV_OPT_TYPE_FLAGS, {.i64 = 
0}, 0, UINT_MAX, VE, "flags"}, \
+{"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, {.dbl 
= VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
+{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
0, AV_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
"flags"}, \
 {"arnr_max_frames", "altref noise reduction max frame count", 
offsetof(VP8Context, arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 15, VE}, 
\
 {"arnr_strength", "altref noise reduction filter strength", 
offsetof(VP8Context, arnr_strength), AV_OPT_TYPE_INT, {.i64 = 3}, 0, 6, VE}, \
 {"arnr_type", "altref noise reduction filter type", offsetof(VP8Context, 
arnr_type), AV_OPT_TYPE_INT, {.i64 = 3}, 1, 3, VE}, \
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg

[FFmpeg-devel] [PATCH 1/6] options: mark av_get_{int, double, q} as deprecated.

2015-08-17 Thread Ronald S. Bultje
Convert last users to av_opt_get_*() counterparts.
---
 libavfilter/af_aresample.c | 17 +
 libavfilter/x86/vf_spp.c   |  4 +++-
 libavutil/opt.h|  3 +++
 3 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index 6cb765d..f6fdd08 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -80,9 +80,8 @@ static av_cold void uninit(AVFilterContext *ctx)
 static int query_formats(AVFilterContext *ctx)
 {
 AResampleContext *aresample = ctx->priv;
-int out_rate   = av_get_int(aresample->swr, "osr", NULL);
-uint64_t out_layout= av_get_int(aresample->swr, "ocl", NULL);
-enum AVSampleFormat out_format = av_get_int(aresample->swr, "osf", NULL);
+enum AVSampleFormat out_format;
+int64_t out_rate, out_layout;
 
 AVFilterLink *inlink  = ctx->inputs[0];
 AVFilterLink *outlink = ctx->outputs[0];
@@ -91,6 +90,9 @@ static int query_formats(AVFilterContext *ctx)
 AVFilterFormats*in_samplerates, *out_samplerates;
 AVFilterChannelLayouts *in_layouts, *out_layouts;
 
+av_opt_get_sample_fmt(aresample->swr, "osf", 0, &out_format);
+av_opt_get_int(aresample->swr, "osr", 0, &out_rate);
+av_opt_get_int(aresample->swr, "ocl", 0, &out_layout);
 
 in_formats  = ff_all_formats(AVMEDIA_TYPE_AUDIO);
 if (!in_formats)
@@ -144,8 +146,7 @@ static int config_output(AVFilterLink *outlink)
 AVFilterContext *ctx = outlink->src;
 AVFilterLink *inlink = ctx->inputs[0];
 AResampleContext *aresample = ctx->priv;
-int out_rate;
-uint64_t out_layout;
+int64_t out_rate, out_layout;
 enum AVSampleFormat out_format;
 char inchl_buf[128], outchl_buf[128];
 
@@ -164,9 +165,9 @@ static int config_output(AVFilterLink *outlink)
 if (ret < 0)
 return ret;
 
-out_rate   = av_get_int(aresample->swr, "osr", NULL);
-out_layout = av_get_int(aresample->swr, "ocl", NULL);
-out_format = av_get_int(aresample->swr, "osf", NULL);
+av_opt_get_int(aresample->swr, "osr", 0, &out_rate);
+av_opt_get_int(aresample->swr, "ocl", 0, &out_layout);
+av_opt_get_sample_fmt(aresample->swr, "osf", 0, &out_format);
 outlink->time_base = (AVRational) {1, out_rate};
 
 av_assert0(outlink->sample_rate == out_rate);
diff --git a/libavfilter/x86/vf_spp.c b/libavfilter/x86/vf_spp.c
index 1cfb9e8..45a9eb0 100644
--- a/libavfilter/x86/vf_spp.c
+++ b/libavfilter/x86/vf_spp.c
@@ -223,8 +223,10 @@ av_cold void ff_spp_init_x86(SPPContext *s)
 int cpu_flags = av_get_cpu_flags();
 
 if (cpu_flags & AV_CPU_FLAG_MMX) {
+int64_t bps;
 s->store_slice = store_slice_mmx;
-if (av_get_int(s->dct, "bits_per_sample", NULL) <= 8) {
+av_opt_get_int(s->dct, "bits_per_sample", 0, &bps);
+if (bps <= 8) {
 switch (s->mode) {
 case 0: s->requantize = hardthresh_mmx; break;
 case 1: s->requantize = softthresh_mmx; break;
diff --git a/libavutil/opt.h b/libavutil/opt.h
index 0bc0d30..481d096 100644
--- a/libavutil/opt.h
+++ b/libavutil/opt.h
@@ -413,8 +413,11 @@ attribute_deprecated const AVOption *av_set_double(void 
*obj, const char *name,
 attribute_deprecated const AVOption *av_set_q(void *obj, const char *name, 
AVRational n);
 attribute_deprecated const AVOption *av_set_int(void *obj, const char *name, 
int64_t n);
 
+attribute_deprecated
 double av_get_double(void *obj, const char *name, const AVOption **o_out);
+attribute_deprecated
 AVRational av_get_q(void *obj, const char *name, const AVOption **o_out);
+attribute_deprecated
 int64_t av_get_int(void *obj, const char *name, const AVOption **o_out);
 attribute_deprecated const char *av_get_string(void *obj, const char *name, 
const AVOption **o_out, char *buf, int buf_len);
 attribute_deprecated const AVOption *av_next_option(FF_CONST_AVUTIL55 void 
*obj, const AVOption *last);
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 6/6] fate: change lavf.ffm ref.

2015-08-17 Thread Ronald S. Bultje
(This should only be applied when we bump version.) Removing the -ab
option changes the codec settings serialization, so the ffm ref changes
whenever we bump version and remove -ab.
---
 tests/ref/lavf/ffm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm
index 5de2f39..76b7716 100644
--- a/tests/ref/lavf/ffm
+++ b/tests/ref/lavf/ffm
@@ -1,3 +1,3 @@
-d5d4e5e3eec336ae6680dde035870564 *./tests/data/lavf/lavf.ffm
+4c3d2892c1d1be292f7b91788a0f7e17 *./tests/data/lavf/lavf.ffm
 376832 ./tests/data/lavf/lavf.ffm
 ./tests/data/lavf/lavf.ffm CRC=0x000e23ae
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 4/6] fate: explicitly specify audio bitrate for adpcm/mp2fixed tests.

2015-08-17 Thread Ronald S. Bultje
They picked up defaults, which changes from 128 to 200 when we remove
FF_API_OLD_AVOPTIONS.
---
 tests/fate/acodec.mak | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
index c1e4c4e..4afc27a 100644
--- a/tests/fate/acodec.mak
+++ b/tests/fate/acodec.mak
@@ -1,6 +1,6 @@
 fate-acodec-%: CODEC = $(@:fate-acodec-%=%)
 fate-acodec-%: SRC = tests/data/asynth-44100-2.wav
-fate-acodec-%: CMD = enc_dec wav $(SRC) $(FMT) "-b 128k -c $(CODEC) 
$(ENCOPTS)" wav "-c pcm_s16le $(DECOPTS)" -keep
+fate-acodec-%: CMD = enc_dec wav $(SRC) $(FMT) "-b:a 128k -c $(CODEC) 
$(ENCOPTS)" wav "-c pcm_s16le $(DECOPTS)" -keep
 fate-acodec-%: CMP_UNIT = 2
 fate-acodec-%: REF = $(SRC_PATH)/tests/ref/acodec/$(@:fate-acodec-%=%)
 
@@ -93,6 +93,7 @@ fate-acodec-mp2: ENCOPTS = -b:a 128k
 FATE_ACODEC-$(call ENCDEC, MP2FIXED MP2 , MP2 MP3) += fate-acodec-mp2fixed
 fate-acodec-mp2fixed: FMT = mp2
 fate-acodec-mp2fixed: CMP_SHIFT = -1924
+fate-acodec-mp2fixed: ENCOPTS = -b:a 384k
 
 FATE_ACODEC-$(call ENCDEC, ALAC, MOV) += fate-acodec-alac
 fate-acodec-alac: FMT = mov
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 5/6] Put FF_API_OLD_AVOPTIONS under last use of av_opt_set_defaults2().

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/options.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/options.c b/libavcodec/options.c
index 37f3792..ed4d826 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -91,7 +91,9 @@ static const AVClass av_codec_context_class = {
 
 int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
 {
+#if FF_API_OLD_AVOPTIONS
 int flags=0;
+#endif
 memset(s, 0, sizeof(AVCodecContext));
 
 s->av_class = &av_codec_context_class;
@@ -102,6 +104,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const 
AVCodec *codec)
 s->codec_id = codec->id;
 }
 
+#if FF_API_OLD_AVOPTIONS
 if(s->codec_type == AVMEDIA_TYPE_AUDIO)
 flags= AV_OPT_FLAG_AUDIO_PARAM;
 else if(s->codec_type == AVMEDIA_TYPE_VIDEO)
@@ -109,6 +112,9 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const 
AVCodec *codec)
 else if(s->codec_type == AVMEDIA_TYPE_SUBTITLE)
 flags= AV_OPT_FLAG_SUBTITLE_PARAM;
 av_opt_set_defaults2(s, flags, flags);
+#else
+av_opt_set_defaults(s);
+#endif
 
 s->time_base   = (AVRational){0,1};
 s->framerate   = (AVRational){ 0, 1 };
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 3/6] lavc: deprecate -ab as part of FF_API_OLD_AVOPTIONS.

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/options_table.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index 5376cbb..fd9c045 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -43,7 +43,9 @@
 
 static const AVOption avcodec_options[] = {
 {"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 
AV_CODEC_DEFAULT_BITRATE }, 0, INT_MAX, A|V|E},
+#if FF_API_OLD_AVOPTIONS
 {"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 
128*1000 }, 0, INT_MAX, A|E},
+#endif
 {"bt", "Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate 
tolerance specifies how far "
"ratecontrol is willing to deviate from the target average bitrate 
value. This is not related "
"to minimum/maximum bitrate. Lowering tolerance too much has an adverse 
effect on quality.",
-- 
2.1.2

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


[FFmpeg-devel] [PATCH] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread Ronald S. Bultje
---
 ffmpeg.c | 15 ---
 libavcodec/ccaption_dec.c| 12 ++--
 libavcodec/libzvbi-teletextdec.c |  8 
 libavcodec/proresdec2.c  |  8 
 libavdevice/lavfi.c  |  6 +++---
 libavdevice/v4l.c|  4 ++--
 libavfilter/src_movie.c  |  4 ++--
 libavfilter/vf_histeq.c  |  4 ++--
 libavfilter/vf_palettegen.c  | 10 ++
 libavfilter/vf_paletteuse.c  |  4 ++--
 libavfilter/vsrc_cellauto.c  |  4 ++--
 libavfilter/vsrc_life.c  |  2 +-
 libavformat/avienc.c |  4 ++--
 libavformat/ffmdec.c | 10 +-
 libavformat/ftp.c| 18 +-
 libavformat/mov.c|  2 +-
 libavformat/mpegts.c |  2 +-
 libavformat/segment.c| 10 +-
 libavformat/swfdec.c |  4 ++--
 19 files changed, 67 insertions(+), 64 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 268ef57..f756b14 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1150,13 +1150,14 @@ static void do_video_out(AVFormatContext *s,
 ost->forced_keyframes_expr_const_values[FKF_T] = pts_time;
 res = av_expr_eval(ost->forced_keyframes_pexpr,
ost->forced_keyframes_expr_const_values, NULL);
-av_dlog(NULL, "force_key_frame: n:%f n_forced:%f prev_forced_n:%f 
t:%f prev_forced_t:%f -> res:%f\n",
-ost->forced_keyframes_expr_const_values[FKF_N],
-ost->forced_keyframes_expr_const_values[FKF_N_FORCED],
-ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N],
-ost->forced_keyframes_expr_const_values[FKF_T],
-ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T],
-res);
+av_log(NULL, AV_LOG_TRACE,
+   "force_key_frame: n:%f n_forced:%f prev_forced_n:%f t:%f 
prev_forced_t:%f -> res:%f\n",
+   ost->forced_keyframes_expr_const_values[FKF_N],
+   ost->forced_keyframes_expr_const_values[FKF_N_FORCED],
+   ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N],
+   ost->forced_keyframes_expr_const_values[FKF_T],
+   ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_T],
+   res);
 if (res) {
 forced_keyframe = 1;
 ost->forced_keyframes_expr_const_values[FKF_PREV_FORCED_N] =
diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 264d21c..2ee97d6 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -451,9 +451,9 @@ static void handle_char(CCaptionSubContext *ctx, char hi, 
char lo, int64_t pts)
 ctx->prev_cmd[0] = 0;
 ctx->prev_cmd[1] = 0;
 if (lo)
-   av_dlog(ctx, "(%c,%c)\n",hi,lo);
+   av_log(ctx, AV_LOG_TRACE, "(%c,%c)\n",hi,lo);
 else
-   av_dlog(ctx, "(%c)\n",hi);
+   av_log(ctx, AV_LOG_TRACE, "(%c)\n",hi);
 }
 
 static int process_cc608(CCaptionSubContext *ctx, int64_t pts, uint8_t hi, 
uint8_t lo)
@@ -493,21 +493,21 @@ static int process_cc608(CCaptionSubContext *ctx, int64_t 
pts, uint8_t hi, uint8
 ret = handle_edm(ctx, pts);
 } else if ( COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x2D ) {
 /* carriage return */
-av_dlog(ctx, "carriage return\n");
+av_log(ctx, AV_LOG_TRACE, "carriage return\n");
 reap_screen(ctx, pts);
 roll_up(ctx);
 ctx->screen_changed = 1;
 ctx->cursor_column = 0;
 } else if ( COR3(hi, 0x14, 0x15, 0x1C) && lo == 0x2F ) {
 /* end of caption */
-av_dlog(ctx, "handle_eoc\n");
+av_log(ctx, AV_LOG_TRACE, "handle_eoc\n");
 ret = handle_eoc(ctx, pts);
 } else if (hi>=0x20) {
 /* Standard characters (always in pairs) */
 handle_char(ctx, hi, lo, pts);
 } else {
 /* Ignoring all other non data code */
-av_dlog(ctx, "Unknown command 0x%hhx 0x%hhx\n", hi, lo);
+av_log(ctx, AV_LOG_TRACE, "Unknown command 0x%hhx 0x%hhx\n", hi, lo);
 }
 
 /* set prev command */
@@ -553,7 +553,7 @@ static int decode(AVCodecContext *avctx, void *data, int 
*got_sub, AVPacket *avp
 {
 int start_time = av_rescale_q(ctx->start_time, avctx->time_base, 
(AVRational){ 1, 100 });
 int end_time = av_rescale_q(ctx->end_time, avctx->time_base, 
(AVRational){ 1, 100 });
-av_dlog(ctx, "cdp writing data (%s)\n",ctx->buffer.str);
+av_log(ctx, AV_LOG_TRACE, "cdp writing data 
(%s)\n",ctx->buffer.str);
 ret = ff_ass_add_rect_bprint(sub, &ctx->buffer, start_time, 
end_time - start_time);
 if (ret < 0)
 return ret;
diff --git a/libavcodec/libzvbi-teletextdec.c b/libavcodec/libzvbi-teletextdec.c
index 32d983c..ba32a49 100644
--- a/libavcodec/libzvbi-teletextdec.c
+++ b/libavcodec/libzvbi-teletextdec.c
@@ -274,7 +274,7 @@ 

[FFmpeg-devel] [PATCH] Put remaining pieces of CODEC_FLAG_EMU_EDGE under FF_API_EMU_EDGE.

2015-08-17 Thread Ronald S. Bultje
The amv one probably looks suspicious, but since it's an intra-only
codec, I couldn't possibly imagine what it would use the edge for,
and the vsyncht fate result doesn't change, so it's probably OK.
---
 ffmpeg_opt.c  | 2 ++
 ffplay.c  | 4 
 libavcodec/mjpegenc.c | 2 ++
 libavcodec/snowenc.c  | 6 +-
 libavcodec/wmv2dec.c  | 2 ++
 5 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 66a43b4..689d12a 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -662,9 +662,11 @@ static void add_input_streams(OptionsContext *o, 
AVFormatContext *ic)
 case AVMEDIA_TYPE_VIDEO:
 if(!ist->dec)
 ist->dec = avcodec_find_decoder(dec->codec_id);
+#if FF_API_EMU_EDGE
 if (av_codec_get_lowres(dec)) {
 dec->flags |= CODEC_FLAG_EMU_EDGE;
 }
+#endif
 
 ist->resample_height  = ist->dec_ctx->height;
 ist->resample_width   = ist->dec_ctx->width;
diff --git a/ffplay.c b/ffplay.c
index cc61dde..3d8673b 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -2550,11 +2550,15 @@ static int stream_component_open(VideoState *is, int 
stream_index)
 }
 av_codec_set_lowres(avctx, stream_lowres);
 
+#if FF_API_EMU_EDGE
 if(stream_lowres) avctx->flags |= CODEC_FLAG_EMU_EDGE;
+#endif
 if (fast)
 avctx->flags2 |= AV_CODEC_FLAG2_FAST;
+#if FF_API_EMU_EDGE
 if(codec->capabilities & AV_CODEC_CAP_DR1)
 avctx->flags |= CODEC_FLAG_EMU_EDGE;
+#endif
 
 opts = filter_codec_opts(codec_opts, avctx->codec_id, ic, 
ic->streams[stream_index], codec);
 if (!av_dict_get(opts, "threads", NULL, 0))
diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c
index ee0b16e..f15de58 100644
--- a/libavcodec/mjpegenc.c
+++ b/libavcodec/mjpegenc.c
@@ -224,9 +224,11 @@ static int amv_encode_picture(AVCodecContext *avctx, 
AVPacket *pkt,
 
 av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift, 
&chroma_v_shift);
 
+#if FF_API_EMU_EDGE
 //CODEC_FLAG_EMU_EDGE have to be cleared
 if(s->avctx->flags & CODEC_FLAG_EMU_EDGE)
 return AVERROR(EINVAL);
+#endif
 
 if ((avctx->height & 15) && avctx->strict_std_compliance > 
FF_COMPLIANCE_UNOFFICIAL) {
 av_log(avctx, AV_LOG_ERROR,
diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c
index 16c7e05..9f74c9e 100644
--- a/libavcodec/snowenc.c
+++ b/libavcodec/snowenc.c
@@ -1602,7 +1602,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
 s->lambda = 0;
 }//else keep previous frame's qlog until after motion estimation
 
-if (s->current_picture->data[0] && !(s->avctx->flags&CODEC_FLAG_EMU_EDGE)) 
{
+if (s->current_picture->data[0]
+#if FF_API_EMU_EDGE
+&& !(s->avctx->flags&CODEC_FLAG_EMU_EDGE)
+#endif
+) {
 int w = s->avctx->width;
 int h = s->avctx->height;
 
diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index f8128dc..cd17358 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -453,7 +453,9 @@ static av_cold int wmv2_decode_init(AVCodecContext *avctx)
 Wmv2Context *const w = avctx->priv_data;
 int ret;
 
+#if FF_API_EMU_EDGE
 avctx->flags |= CODEC_FLAG_EMU_EDGE;
+#endif
 
 if ((ret = ff_msmpeg4_decode_init(avctx)) < 0)
 return ret;
-- 
2.1.2

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


Re: [FFmpeg-devel] [PATCH 3/6] lavc: deprecate -ab as part of FF_API_OLD_AVOPTIONS.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 11:52:16AM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/options_table.h | 2 ++
>  1 file changed, 2 insertions(+)

googling for
ffmpeg "-ab"
has 332.000 matches

ffmpeg "-b:a"
has 64.100 matches

this patch is simply a bad idea


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

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


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


[FFmpeg-devel] [PATCH 0/4] vaapi: improvements & fixes to common infrastructure

2015-08-17 Thread Gwenole Beauchesne
Hi,

This patch series contains a few changes I was wondering for some time
now and had finally some time to work on recently. This is preparatory
and minimal work in view to supporting other (WIP) changes.

For convenience, I have placed the code here:


Regards,
Gwenole Beauchesne (4):
  vaapi: define a single pixel format for VA-API (AV_PIX_FMT_VAAPI).
  vaapi: streamline public context structure.
  vaapi: fix usage of invalid buffer ids.
  vaapi: add interfaces to properly initialize context.

 libavcodec/h263dec.c|  2 +-
 libavcodec/h264_slice.c |  2 +-
 libavcodec/mpeg12dec.c  |  2 +-
 libavcodec/vaapi.c  | 84 -
 libavcodec/vaapi.h  | 75 +---
 libavcodec/vaapi_h264.c | 12 ---
 libavcodec/vaapi_internal.h | 43 +++
 libavcodec/vaapi_mpeg2.c| 10 --
 libavcodec/vaapi_mpeg4.c| 15 +---
 libavcodec/vaapi_vc1.c  | 15 +---
 libavcodec/vc1dec.c |  2 +-
 libavcodec/version.h|  3 ++
 libavutil/pixdesc.c |  9 +
 libavutil/pixfmt.h  | 11 ++
 libavutil/version.h |  3 ++
 15 files changed, 241 insertions(+), 47 deletions(-)

-- 
1.9.1

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


[FFmpeg-devel] [PATCH 2/4] vaapi: streamline public context structure.

2015-08-17 Thread Gwenole Beauchesne
Move libavcodec managed objects from the public struct vaapi_context
to a new privately owned FFVAContext. This is done so that to clean up
and streamline the public structure, but also to prepare for new codec
support, thus requiring new internal data to be added in there.

The AVCodecContext.hwaccel_context, that holds the public vaapi_context,
shall no longer be accessed from within vaapi_*.c codec support files.

Signed-off-by: Gwenole Beauchesne 
---
 libavcodec/vaapi.c  | 34 +-
 libavcodec/vaapi.h  | 16 
 libavcodec/vaapi_h264.c | 10 +++---
 libavcodec/vaapi_internal.h | 42 --
 libavcodec/vaapi_mpeg2.c|  8 ++--
 libavcodec/vaapi_mpeg4.c| 11 +--
 libavcodec/vaapi_vc1.c  | 11 +--
 libavcodec/version.h|  3 +++
 8 files changed, 111 insertions(+), 24 deletions(-)

diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index 6ac22e6..880e3d6 100644
--- a/libavcodec/vaapi.c
+++ b/libavcodec/vaapi.c
@@ -41,7 +41,23 @@ static void destroy_buffers(VADisplay display, VABufferID 
*buffers, unsigned int
 }
 }
 
-int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
+int ff_vaapi_context_init(AVCodecContext *avctx)
+{
+FFVAContext * const vactx = ff_vaapi_get_context(avctx);
+const struct vaapi_context * const user_vactx = avctx->hwaccel_context;
+
+vactx->display  = user_vactx->display;
+vactx->config_id= user_vactx->config_id;
+vactx->context_id   = user_vactx->context_id;
+return 0;
+}
+
+int ff_vaapi_context_fini(AVCodecContext *avctx)
+{
+return 0;
+}
+
+int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID surface)
 {
 VABufferID va_buffers[3];
 unsigned int n_va_buffers = 0;
@@ -81,7 +97,7 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, 
VASurfaceID surface)
 return 0;
 }
 
-int ff_vaapi_commit_slices(struct vaapi_context *vactx)
+int ff_vaapi_commit_slices(FFVAContext *vactx)
 {
 VABufferID *slice_buf_ids;
 VABufferID slice_param_buf_id, slice_data_buf_id;
@@ -121,7 +137,7 @@ int ff_vaapi_commit_slices(struct vaapi_context *vactx)
 return 0;
 }
 
-static void *alloc_buffer(struct vaapi_context *vactx, int type, unsigned int 
size, uint32_t *buf_id)
+static void *alloc_buffer(FFVAContext *vactx, int type, unsigned int size, 
uint32_t *buf_id)
 {
 void *data = NULL;
 
@@ -133,22 +149,22 @@ static void *alloc_buffer(struct vaapi_context *vactx, 
int type, unsigned int si
 return data;
 }
 
-void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int size)
+void *ff_vaapi_alloc_pic_param(FFVAContext *vactx, unsigned int size)
 {
 return alloc_buffer(vactx, VAPictureParameterBufferType, size, 
&vactx->pic_param_buf_id);
 }
 
-void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int size)
+void *ff_vaapi_alloc_iq_matrix(FFVAContext *vactx, unsigned int size)
 {
 return alloc_buffer(vactx, VAIQMatrixBufferType, size, 
&vactx->iq_matrix_buf_id);
 }
 
-uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size)
+uint8_t *ff_vaapi_alloc_bitplane(FFVAContext *vactx, uint32_t size)
 {
 return alloc_buffer(vactx, VABitPlaneBufferType, size, 
&vactx->bitplane_buf_id);
 }
 
-VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context *vactx, 
const uint8_t *buffer, uint32_t size)
+VASliceParameterBufferBase *ff_vaapi_alloc_slice(FFVAContext *vactx, const 
uint8_t *buffer, uint32_t size)
 {
 uint8_t *slice_params;
 VASliceParameterBufferBase *slice_param;
@@ -181,7 +197,7 @@ VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct 
vaapi_context *vactx, co
 
 void ff_vaapi_common_end_frame(AVCodecContext *avctx)
 {
-struct vaapi_context * const vactx = avctx->hwaccel_context;
+FFVAContext * const vactx = ff_vaapi_get_context(avctx);
 
 ff_dlog(avctx, "ff_vaapi_common_end_frame()\n");
 
@@ -202,7 +218,7 @@ void ff_vaapi_common_end_frame(AVCodecContext *avctx)
 CONFIG_VC1_VAAPI_HWACCEL   || CONFIG_WMV3_VAAPI_HWACCEL
 int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
 {
-struct vaapi_context * const vactx = avctx->hwaccel_context;
+FFVAContext * const vactx = ff_vaapi_get_context(avctx);
 MpegEncContext *s = avctx->priv_data;
 int ret;
 
diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
index 815a27e..4448a2e 100644
--- a/libavcodec/vaapi.h
+++ b/libavcodec/vaapi.h
@@ -31,6 +31,8 @@
  */
 
 #include 
+#include 
+#include "version.h"
 
 /**
  * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
@@ -72,12 +74,14 @@ struct vaapi_context {
  */
 uint32_t context_id;
 
+#if FF_API_VAAPI_CONTEXT
 /**
  * VAPictureParameterBuffer ID
  *
  * - encoding: unused
  * - decoding: Set by libavcodec
  */
+attribute_deprecated
 uint32_t pic_param_buf_id;
 
 /**
@@ -86,6 +90,7 @@ struct vaapi_context {
  

[FFmpeg-devel] [PATCH 1/4] vaapi: define a single pixel format for VA-API (AV_PIX_FMT_VAAPI).

2015-08-17 Thread Gwenole Beauchesne
Deprecate older VA pixel formats (MOCO, IDCT) as it is now very unlikely
to ever be useful in the future. Only keep plain AV_PIX_FMT_VAAPI format
that is aliased to the older VLD variant.

Signed-off-by: Gwenole Beauchesne 
---
 libavcodec/h263dec.c |  2 +-
 libavcodec/h264_slice.c  |  2 +-
 libavcodec/mpeg12dec.c   |  2 +-
 libavcodec/vaapi_h264.c  |  2 +-
 libavcodec/vaapi_mpeg2.c |  2 +-
 libavcodec/vaapi_mpeg4.c |  4 ++--
 libavcodec/vaapi_vc1.c   |  4 ++--
 libavcodec/vc1dec.c  |  2 +-
 libavutil/pixdesc.c  |  9 +
 libavutil/pixfmt.h   | 11 +++
 libavutil/version.h  |  3 +++
 11 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 7fa7090..e647e40 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -718,7 +718,7 @@ frame_end:
 
 const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
 #if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
-AV_PIX_FMT_VAAPI_VLD,
+AV_PIX_FMT_VAAPI,
 #endif
 #if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL
 AV_PIX_FMT_VDPAU,
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 48f501b..7b35c08 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -943,7 +943,7 @@ static enum AVPixelFormat get_pixel_format(H264Context *h, 
int force_callback)
 *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
 #endif
 #if CONFIG_H264_VAAPI_HWACCEL
-*fmt++ = AV_PIX_FMT_VAAPI_VLD;
+*fmt++ = AV_PIX_FMT_VAAPI;
 #endif
 #if CONFIG_H264_VDA_HWACCEL
 *fmt++ = AV_PIX_FMT_VDA_VLD;
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index c7a5701..d2bedbc 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1209,7 +1209,7 @@ static const enum AVPixelFormat 
mpeg2_hwaccel_pixfmt_list_420[] = {
 AV_PIX_FMT_D3D11VA_VLD,
 #endif
 #if CONFIG_MPEG2_VAAPI_HWACCEL
-AV_PIX_FMT_VAAPI_VLD,
+AV_PIX_FMT_VAAPI,
 #endif
 #if CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL
 AV_PIX_FMT_VIDEOTOOLBOX,
diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
index 151aca9..55ee2fc 100644
--- a/libavcodec/vaapi_h264.c
+++ b/libavcodec/vaapi_h264.c
@@ -359,7 +359,7 @@ AVHWAccel ff_h264_vaapi_hwaccel = {
 .name   = "h264_vaapi",
 .type   = AVMEDIA_TYPE_VIDEO,
 .id = AV_CODEC_ID_H264,
-.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
+.pix_fmt= AV_PIX_FMT_VAAPI,
 .start_frame= vaapi_h264_start_frame,
 .end_frame  = vaapi_h264_end_frame,
 .decode_slice   = vaapi_h264_decode_slice,
diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
index 87fab89..27c69cd 100644
--- a/libavcodec/vaapi_mpeg2.c
+++ b/libavcodec/vaapi_mpeg2.c
@@ -138,7 +138,7 @@ AVHWAccel ff_mpeg2_vaapi_hwaccel = {
 .name   = "mpeg2_vaapi",
 .type   = AVMEDIA_TYPE_VIDEO,
 .id = AV_CODEC_ID_MPEG2VIDEO,
-.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
+.pix_fmt= AV_PIX_FMT_VAAPI,
 .start_frame= vaapi_mpeg2_start_frame,
 .end_frame  = ff_vaapi_mpeg_end_frame,
 .decode_slice   = vaapi_mpeg2_decode_slice,
diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
index 9b283f7..5b2e9d4 100644
--- a/libavcodec/vaapi_mpeg4.c
+++ b/libavcodec/vaapi_mpeg4.c
@@ -141,7 +141,7 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = {
 .name   = "mpeg4_vaapi",
 .type   = AVMEDIA_TYPE_VIDEO,
 .id = AV_CODEC_ID_MPEG4,
-.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
+.pix_fmt= AV_PIX_FMT_VAAPI,
 .start_frame= vaapi_mpeg4_start_frame,
 .end_frame  = ff_vaapi_mpeg_end_frame,
 .decode_slice   = vaapi_mpeg4_decode_slice,
@@ -153,7 +153,7 @@ AVHWAccel ff_h263_vaapi_hwaccel = {
 .name   = "h263_vaapi",
 .type   = AVMEDIA_TYPE_VIDEO,
 .id = AV_CODEC_ID_H263,
-.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
+.pix_fmt= AV_PIX_FMT_VAAPI,
 .start_frame= vaapi_mpeg4_start_frame,
 .end_frame  = ff_vaapi_mpeg_end_frame,
 .decode_slice   = vaapi_mpeg4_decode_slice,
diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
index 7ef9f2a..63d514d 100644
--- a/libavcodec/vaapi_vc1.c
+++ b/libavcodec/vaapi_vc1.c
@@ -339,7 +339,7 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = {
 .name   = "wmv3_vaapi",
 .type   = AVMEDIA_TYPE_VIDEO,
 .id = AV_CODEC_ID_WMV3,
-.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
+.pix_fmt= AV_PIX_FMT_VAAPI,
 .start_frame= vaapi_vc1_start_frame,
 .end_frame  = ff_vaapi_mpeg_end_frame,
 .decode_slice   = vaapi_vc1_decode_slice,
@@ -350,7 +350,7 @@ AVHWAccel ff_vc1_vaapi_hwaccel = {
 .name   = "vc1_vaapi",
 .type   = AVMEDIA_TYPE_VIDEO,
 .id = AV_CODEC_ID_VC1,
-.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
+.pix_fmt= AV_PIX_FMT_VAAPI,
 .start_frame= vaa

[FFmpeg-devel] [PATCH 3/4] vaapi: fix usage of invalid buffer ids.

2015-08-17 Thread Gwenole Beauchesne
Invalid buffer ids are defined by VA_INVALID_ID. Use that through out
vaapi_*.c support files now that we have private data initialized and
managed by libavcodec. Previously, the only requirement for the public
vaapi_context struct was to be zero-initialized.

This fixes support for 3rdparty VA drivers that strictly conform to
the API whereby an invalid buffer id is VA_INVALID_ID and the first
valid buffer id can actually be zero.

Signed-off-by: Gwenole Beauchesne 
---
 libavcodec/vaapi.c | 20 
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index 880e3d6..1ae71a5 100644
--- a/libavcodec/vaapi.c
+++ b/libavcodec/vaapi.c
@@ -34,9 +34,9 @@ static void destroy_buffers(VADisplay display, VABufferID 
*buffers, unsigned int
 {
 unsigned int i;
 for (i = 0; i < n_buffers; i++) {
-if (buffers[i]) {
+if (buffers[i] != VA_INVALID_ID) {
 vaDestroyBuffer(display, buffers[i]);
-buffers[i] = 0;
+buffers[i] = VA_INVALID_ID;
 }
 }
 }
@@ -49,6 +49,10 @@ int ff_vaapi_context_init(AVCodecContext *avctx)
 vactx->display  = user_vactx->display;
 vactx->config_id= user_vactx->config_id;
 vactx->context_id   = user_vactx->context_id;
+
+vactx->pic_param_buf_id = VA_INVALID_ID;
+vactx->iq_matrix_buf_id = VA_INVALID_ID;
+vactx->bitplane_buf_id  = VA_INVALID_ID;
 return 0;
 }
 
@@ -62,18 +66,18 @@ int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID 
surface)
 VABufferID va_buffers[3];
 unsigned int n_va_buffers = 0;
 
-if (!vactx->pic_param_buf_id)
+if (vactx->pic_param_buf_id == VA_INVALID_ID)
 return 0;
 
 vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
 va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
 
-if (vactx->iq_matrix_buf_id) {
+if (vactx->iq_matrix_buf_id != VA_INVALID_ID) {
 vaUnmapBuffer(vactx->display, vactx->iq_matrix_buf_id);
 va_buffers[n_va_buffers++] = vactx->iq_matrix_buf_id;
 }
 
-if (vactx->bitplane_buf_id) {
+if (vactx->bitplane_buf_id != VA_INVALID_ID) {
 vaUnmapBuffer(vactx->display, vactx->bitplane_buf_id);
 va_buffers[n_va_buffers++] = vactx->bitplane_buf_id;
 }
@@ -113,7 +117,7 @@ int ff_vaapi_commit_slices(FFVAContext *vactx)
 return -1;
 vactx->slice_buf_ids = slice_buf_ids;
 
-slice_param_buf_id = 0;
+slice_param_buf_id = VA_INVALID_ID;
 if (vaCreateBuffer(vactx->display, vactx->context_id,
VASliceParameterBufferType,
vactx->slice_param_size,
@@ -122,7 +126,7 @@ int ff_vaapi_commit_slices(FFVAContext *vactx)
 return -1;
 vactx->slice_count = 0;
 
-slice_data_buf_id = 0;
+slice_data_buf_id = VA_INVALID_ID;
 if (vaCreateBuffer(vactx->display, vactx->context_id,
VASliceDataBufferType,
vactx->slice_data_size,
@@ -141,7 +145,7 @@ static void *alloc_buffer(FFVAContext *vactx, int type, 
unsigned int size, uint3
 {
 void *data = NULL;
 
-*buf_id = 0;
+*buf_id = VA_INVALID_ID;
 if (vaCreateBuffer(vactx->display, vactx->context_id,
type, size, 1, NULL, buf_id) == VA_STATUS_SUCCESS)
 vaMapBuffer(vactx->display, *buf_id, &data);
-- 
1.9.1

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


[FFmpeg-devel] [PATCH 4/4] vaapi: add interfaces to properly initialize context.

2015-08-17 Thread Gwenole Beauchesne
Add av_vaapi_context_init() and av_vaapi_context_alloc() helper functions
so that to properly initialize the vaapi_context structure, and allow for
future extensions without breaking the API/ABI.

The new version and flags fields are inserted after the last known user
initialized field, and actually useful field at all, i.e. VA context_id.
This is safe because the vaapi_context structure was required to be zero
initialized in the past. And, since those new helper functions and changes
cause the AV_VAAPI_CONTEXT_VERSION to be bumped, we can track older struct
requirements from within libavcodec.

Besides, it is now required by design, and actual usage, that the vaapi
context structure be completely initialized once and for all before the
AVCodecContext.get_format() function ever completes.

Signed-off-by: Gwenole Beauchesne 
---
 libavcodec/vaapi.c  | 30 +++
 libavcodec/vaapi.h  | 59 +
 libavcodec/vaapi_internal.h |  1 +
 3 files changed, 85 insertions(+), 5 deletions(-)

diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
index 1ae71a5..4d3e2f3 100644
--- a/libavcodec/vaapi.c
+++ b/libavcodec/vaapi.c
@@ -41,11 +41,41 @@ static void destroy_buffers(VADisplay display, VABufferID 
*buffers, unsigned int
 }
 }
 
+/* Allocates a vaapi_context structure */
+struct vaapi_context *av_vaapi_context_alloc(unsigned int flags)
+{
+struct vaapi_context *vactx;
+
+vactx = av_malloc(sizeof(*vactx));
+if (!vactx)
+return NULL;
+
+av_vaapi_context_init(vactx, AV_VAAPI_CONTEXT_VERSION, flags);
+return vactx;
+}
+
+/* Initializes a vaapi_context structure with safe defaults */
+void av_vaapi_context_init(struct vaapi_context *vactx, unsigned int version,
+   unsigned int flags)
+{
+vactx->display  = NULL;
+vactx->config_id= VA_INVALID_ID;
+vactx->context_id   = VA_INVALID_ID;
+
+if (version > 0) {
+vactx->version  = version;
+vactx->flags= flags;
+}
+}
+
 int ff_vaapi_context_init(AVCodecContext *avctx)
 {
 FFVAContext * const vactx = ff_vaapi_get_context(avctx);
 const struct vaapi_context * const user_vactx = avctx->hwaccel_context;
 
+if (user_vactx->version > 0)
+vactx->flags= user_vactx->flags;
+
 vactx->display  = user_vactx->display;
 vactx->config_id= user_vactx->config_id;
 vactx->context_id   = user_vactx->context_id;
diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
index 4448a2e..1f032a0 100644
--- a/libavcodec/vaapi.h
+++ b/libavcodec/vaapi.h
@@ -40,14 +40,16 @@
  * @{
  */
 
+#define AV_VAAPI_CONTEXT_VERSION 1
+
 /**
  * This structure is used to share data between the FFmpeg library and
  * the client video application.
- * This shall be zero-allocated and available as
- * AVCodecContext.hwaccel_context. All user members can be set once
- * during initialization or through each AVCodecContext.get_buffer()
- * function call. In any case, they must be valid prior to calling
- * decoding functions.
+ *
+ * This shall be initialized with av_vaapi_context_init(), or
+ * indirectly through av_vaapi_context_alloc(), and made available as
+ * AVCodecContext.hwaccel_context. All user members must be properly
+ * initialized before AVCodecContext.get_format() completes.
  */
 struct vaapi_context {
 /**
@@ -74,6 +76,29 @@ struct vaapi_context {
  */
 uint32_t context_id;
 
+/**
+ * This field must be set to AV_VAAPI_CONTEXT_VERSION
+ *
+ * @since Version 1.
+ *
+ * - encoding: unused
+ * - decoding: Set by user, through av_vaapi_context_init()
+ */
+unsigned int version;
+
+/**
+ * A bit field configuring the internal context used by libavcodec
+ *
+ * This is a combination of flags from common AV_HWACCEL_FLAG_xxx and
+ * from VA-API specific AV_VAAPI_FLAG_xxx.
+ *
+ * @since Version 1.
+ *
+ * - encoding: unused
+ * - decoding: Set by user, through av_vaapi_context_init()
+ */
+unsigned int flags;
+
 #if FF_API_VAAPI_CONTEXT
 /**
  * VAPictureParameterBuffer ID
@@ -184,6 +209,30 @@ struct vaapi_context {
 #endif
 };
 
+/**
+ * Allocates a vaapi_context structure.
+ *
+ * This function allocates and initializes a vaapi_context with safe
+ * defaults, e.g. with proper invalid ids for VA config and context.
+ *
+ * The resulting structure can be deallocated with av_freep().
+ *
+ * @param[in]  flagszero, or a combination of AV_HWACCEL_FLAG_xxx or
+ * AV_VAAPI_FLAG_xxx flags OR'd altogether.
+ * @return Newly-allocated struct vaapi_context, or NULL on failure
+ */
+struct vaapi_context *av_vaapi_context_alloc(unsigned int flags);
+
+/**
+ * Initializes a vaapi_context structure with safe defaults.
+ *
+ * @param[in]  version  this must be set to AV_VAAPI_CONTEXT_VERSION
+ * @param[in]  flagszero, or a combination of AV_HWACCEL_FLAG_xxx or
+ * AV_

Re: [FFmpeg-devel] [PATCH 4/4] vaapi: add interfaces to properly initialize context.

2015-08-17 Thread Gwenole Beauchesne
Hi,

2015-08-17 19:17 GMT+02:00 Gwenole Beauchesne :
> Add av_vaapi_context_init() and av_vaapi_context_alloc() helper functions
> so that to properly initialize the vaapi_context structure, and allow for
> future extensions without breaking the API/ABI.
>
> The new version and flags fields are inserted after the last known user
> initialized field, and actually useful field at all, i.e. VA context_id.
> This is safe because the vaapi_context structure was required to be zero
> initialized in the past. And, since those new helper functions and changes
> cause the AV_VAAPI_CONTEXT_VERSION to be bumped, we can track older struct
> requirements from within libavcodec.
>
> Besides, it is now required by design, and actual usage, that the vaapi
> context structure be completely initialized once and for all before the
> AVCodecContext.get_format() function ever completes.
>
> Signed-off-by: Gwenole Beauchesne 
> ---
>  libavcodec/vaapi.c  | 30 +++
>  libavcodec/vaapi.h  | 59 
> +
>  libavcodec/vaapi_internal.h |  1 +
>  3 files changed, 85 insertions(+), 5 deletions(-)
>
> diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
> index 1ae71a5..4d3e2f3 100644
> --- a/libavcodec/vaapi.c
> +++ b/libavcodec/vaapi.c
> @@ -41,11 +41,41 @@ static void destroy_buffers(VADisplay display, VABufferID 
> *buffers, unsigned int
>  }
>  }
>
> +/* Allocates a vaapi_context structure */
> +struct vaapi_context *av_vaapi_context_alloc(unsigned int flags)
> +{
> +struct vaapi_context *vactx;
> +
> +vactx = av_malloc(sizeof(*vactx));
> +if (!vactx)
> +return NULL;
> +
> +av_vaapi_context_init(vactx, AV_VAAPI_CONTEXT_VERSION, flags);
> +return vactx;
> +}
> +
> +/* Initializes a vaapi_context structure with safe defaults */
> +void av_vaapi_context_init(struct vaapi_context *vactx, unsigned int version,
> +   unsigned int flags)
> +{
> +vactx->display  = NULL;
> +vactx->config_id= VA_INVALID_ID;
> +vactx->context_id   = VA_INVALID_ID;
> +
> +if (version > 0) {
> +vactx->version  = version;
> +vactx->flags= flags;
> +}
> +}
> +
>  int ff_vaapi_context_init(AVCodecContext *avctx)
>  {
>  FFVAContext * const vactx = ff_vaapi_get_context(avctx);
>  const struct vaapi_context * const user_vactx = avctx->hwaccel_context;
>
> +if (user_vactx->version > 0)
> +vactx->flags= user_vactx->flags;
> +
>  vactx->display  = user_vactx->display;
>  vactx->config_id= user_vactx->config_id;
>  vactx->context_id   = user_vactx->context_id;
> diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
> index 4448a2e..1f032a0 100644
> --- a/libavcodec/vaapi.h
> +++ b/libavcodec/vaapi.h
> @@ -40,14 +40,16 @@
>   * @{
>   */
>
> +#define AV_VAAPI_CONTEXT_VERSION 1
> +
>  /**
>   * This structure is used to share data between the FFmpeg library and
>   * the client video application.
> - * This shall be zero-allocated and available as
> - * AVCodecContext.hwaccel_context. All user members can be set once
> - * during initialization or through each AVCodecContext.get_buffer()
> - * function call. In any case, they must be valid prior to calling
> - * decoding functions.
> + *
> + * This shall be initialized with av_vaapi_context_init(), or
> + * indirectly through av_vaapi_context_alloc(), and made available as
> + * AVCodecContext.hwaccel_context. All user members must be properly
> + * initialized before AVCodecContext.get_format() completes.
>   */
>  struct vaapi_context {
>  /**
> @@ -74,6 +76,29 @@ struct vaapi_context {
>   */
>  uint32_t context_id;
>
> +/**
> + * This field must be set to AV_VAAPI_CONTEXT_VERSION
> + *
> + * @since Version 1.
> + *
> + * - encoding: unused
> + * - decoding: Set by user, through av_vaapi_context_init()
> + */
> +unsigned int version;
> +
> +/**
> + * A bit field configuring the internal context used by libavcodec
> + *
> + * This is a combination of flags from common AV_HWACCEL_FLAG_xxx and
> + * from VA-API specific AV_VAAPI_FLAG_xxx.
> + *
> + * @since Version 1.
> + *
> + * - encoding: unused
> + * - decoding: Set by user, through av_vaapi_context_init()
> + */
> +unsigned int flags;
> +
>  #if FF_API_VAAPI_CONTEXT
>  /**
>   * VAPictureParameterBuffer ID
> @@ -184,6 +209,30 @@ struct vaapi_context {
>  #endif
>  };
>
> +/**
> + * Allocates a vaapi_context structure.
> + *
> + * This function allocates and initializes a vaapi_context with safe
> + * defaults, e.g. with proper invalid ids for VA config and context.
> + *
> + * The resulting structure can be deallocated with av_freep().
> + *
> + * @param[in]  flagszero, or a combination of AV_HWACCEL_FLAG_xxx or
> + * AV_VAAPI_FLAG_xxx flags OR'd altogether.
> + * @return Newly-allocated struct vaapi_contex

Re: [FFmpeg-devel] [PATCH 2/6] FF_OPT_TYPE_* -> AV_OPT_TYPE_*.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 11:52:15AM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/dvbsubdec.c   |  6 +++---
>  libavcodec/frwu.c|  2 +-
>  libavcodec/h264.c|  4 ++--
>  libavcodec/libvpxenc.c   |  6 +++---
>  libavcodec/mpeg4videodec.c   |  4 ++--
>  libavcodec/s302m.c   | 10 +-
>  libavcodec/v210dec.c |  2 +-
>  libavformat/hls.c|  2 +-
>  libavformat/mov.c|  6 +++---
>  libavformat/tedcaptionsdec.c |  2 +-
>  10 files changed, 22 insertions(+), 22 deletions(-)
> 
> diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
> index ff835ab..8aa203a 100644
> --- a/libavcodec/dvbsubdec.c
> +++ b/libavcodec/dvbsubdec.c
> @@ -1718,9 +1718,9 @@ end:
>  
>  #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
>  static const AVOption options[] = {
> -{"compute_edt", "compute end of time using pts or timeout", 
> offsetof(DVBSubContext, compute_edt), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DS},
> -{"compute_clut", "compute clut when not available(-1) or always(1) or 
> never(0)", offsetof(DVBSubContext, compute_clut), FF_OPT_TYPE_INT, {.i64 = 
> -1}, -1, 1, DS},
> -{"dvb_substream", "", offsetof(DVBSubContext, substream), 
> FF_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS},
> +{"compute_edt", "compute end of time using pts or timeout", 
> offsetof(DVBSubContext, compute_edt), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, DS},
> +{"compute_clut", "compute clut when not available(-1) or always(1) or 
> never(0)", offsetof(DVBSubContext, compute_clut), AV_OPT_TYPE_INT, {.i64 = 
> -1}, -1, 1, DS},
> +{"dvb_substream", "", offsetof(DVBSubContext, substream), 
> AV_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS},
>  {NULL}
>  };
>  static const AVClass dvbsubdec_class = {
> diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c
> index db4c1ba..1aabefe 100644
> --- a/libavcodec/frwu.c
> +++ b/libavcodec/frwu.c
> @@ -103,7 +103,7 @@ static int decode_frame(AVCodecContext *avctx, void 
> *data, int *got_frame,
>  }
>  
>  static const AVOption frwu_options[] = {
> -{"change_field_order", "Change field order", offsetof(FRWUContext, 
> change_field_order), FF_OPT_TYPE_INT,
> +{"change_field_order", "Change field order", offsetof(FRWUContext, 
> change_field_order), AV_OPT_TYPE_INT,
>   {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_VIDEO_PARAM},
>  {NULL}
>  };
> diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> index 24e209c..ca0a4a5 100644
> --- a/libavcodec/h264.c
> +++ b/libavcodec/h264.c
> @@ -1946,8 +1946,8 @@ static av_cold int h264_decode_end(AVCodecContext 
> *avctx)
>  #define OFFSET(x) offsetof(H264Context, x)
>  #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
>  static const AVOption h264_options[] = {
> -{"is_avc", "is avc", offsetof(H264Context, is_avc), FF_OPT_TYPE_INT, 
> {.i64 = 0}, 0, 1, 0},
> -{"nal_length_size", "nal_length_size", offsetof(H264Context, 
> nal_length_size), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
> +{"is_avc", "is avc", offsetof(H264Context, is_avc), AV_OPT_TYPE_INT, 
> {.i64 = 0}, 0, 1, 0},
> +{"nal_length_size", "nal_length_size", offsetof(H264Context, 
> nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
>  { "enable_er", "Enable error resilience on damaged frames (unsafe)", 
> OFFSET(enable_er), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VD },
>  { NULL },
>  };
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 3db617d..58e8f5d 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -985,9 +985,9 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  #define LEGACY_OPTIONS \
>  {"speed", "", offsetof(VP8Context, cpu_used), AV_OPT_TYPE_INT, {.i64 = 
> 1}, -16, 16, VE}, \
>  {"quality", "", offsetof(VP8Context, deadline), AV_OPT_TYPE_INT, {.i64 = 
> VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, \

> -{"vp8flags", "", offsetof(VP8Context, flags), FF_OPT_TYPE_FLAGS, {.i64 = 
> 0}, 0, UINT_MAX, VE, "flags"}, \
> -{"error_resilient", "enable error resilience", 0, FF_OPT_TYPE_CONST, 
> {.dbl = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
> -{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
> 0, FF_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
> "flags"}, \
> +{"vp8flags", "", offsetof(VP8Context, flags), AV_OPT_TYPE_FLAGS, {.i64 = 
> 0}, 0, UINT_MAX, VE, "flags"}, \
> +{"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, 
> {.dbl = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
> +{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
> 0, AV_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
> "flags"}, \

not related to the patch but is .i64 + .dbl correct here ?

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

If you think the mosad wants you dead since a long time then you are eith

Re: [FFmpeg-devel] [PATCH 2/6] FF_OPT_TYPE_* -> AV_OPT_TYPE_*.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 1:25 PM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 11:52:15AM -0400, Ronald S. Bultje wrote:
> > ---
> >  libavcodec/dvbsubdec.c   |  6 +++---
> >  libavcodec/frwu.c|  2 +-
> >  libavcodec/h264.c|  4 ++--
> >  libavcodec/libvpxenc.c   |  6 +++---
> >  libavcodec/mpeg4videodec.c   |  4 ++--
> >  libavcodec/s302m.c   | 10 +-
> >  libavcodec/v210dec.c |  2 +-
> >  libavformat/hls.c|  2 +-
> >  libavformat/mov.c|  6 +++---
> >  libavformat/tedcaptionsdec.c |  2 +-
> >  10 files changed, 22 insertions(+), 22 deletions(-)
> >
> > diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
> > index ff835ab..8aa203a 100644
> > --- a/libavcodec/dvbsubdec.c
> > +++ b/libavcodec/dvbsubdec.c
> > @@ -1718,9 +1718,9 @@ end:
> >
> >  #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
> >  static const AVOption options[] = {
> > -{"compute_edt", "compute end of time using pts or timeout",
> offsetof(DVBSubContext, compute_edt), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1,
> DS},
> > -{"compute_clut", "compute clut when not available(-1) or always(1)
> or never(0)", offsetof(DVBSubContext, compute_clut), FF_OPT_TYPE_INT, {.i64
> = -1}, -1, 1, DS},
> > -{"dvb_substream", "", offsetof(DVBSubContext, substream),
> FF_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS},
> > +{"compute_edt", "compute end of time using pts or timeout",
> offsetof(DVBSubContext, compute_edt), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1,
> DS},
> > +{"compute_clut", "compute clut when not available(-1) or always(1)
> or never(0)", offsetof(DVBSubContext, compute_clut), AV_OPT_TYPE_INT, {.i64
> = -1}, -1, 1, DS},
> > +{"dvb_substream", "", offsetof(DVBSubContext, substream),
> AV_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS},
> >  {NULL}
> >  };
> >  static const AVClass dvbsubdec_class = {
> > diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c
> > index db4c1ba..1aabefe 100644
> > --- a/libavcodec/frwu.c
> > +++ b/libavcodec/frwu.c
> > @@ -103,7 +103,7 @@ static int decode_frame(AVCodecContext *avctx, void
> *data, int *got_frame,
> >  }
> >
> >  static const AVOption frwu_options[] = {
> > -{"change_field_order", "Change field order", offsetof(FRWUContext,
> change_field_order), FF_OPT_TYPE_INT,
> > +{"change_field_order", "Change field order", offsetof(FRWUContext,
> change_field_order), AV_OPT_TYPE_INT,
> >   {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM |
> AV_OPT_FLAG_VIDEO_PARAM},
> >  {NULL}
> >  };
> > diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> > index 24e209c..ca0a4a5 100644
> > --- a/libavcodec/h264.c
> > +++ b/libavcodec/h264.c
> > @@ -1946,8 +1946,8 @@ static av_cold int h264_decode_end(AVCodecContext
> *avctx)
> >  #define OFFSET(x) offsetof(H264Context, x)
> >  #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
> >  static const AVOption h264_options[] = {
> > -{"is_avc", "is avc", offsetof(H264Context, is_avc),
> FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
> > -{"nal_length_size", "nal_length_size", offsetof(H264Context,
> nal_length_size), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
> > +{"is_avc", "is avc", offsetof(H264Context, is_avc),
> AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
> > +{"nal_length_size", "nal_length_size", offsetof(H264Context,
> nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
> >  { "enable_er", "Enable error resilience on damaged frames
> (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VD },
> >  { NULL },
> >  };
> > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > index 3db617d..58e8f5d 100644
> > --- a/libavcodec/libvpxenc.c
> > +++ b/libavcodec/libvpxenc.c
> > @@ -985,9 +985,9 @@ static int vp8_encode(AVCodecContext *avctx,
> AVPacket *pkt,
> >  #define LEGACY_OPTIONS \
> >  {"speed", "", offsetof(VP8Context, cpu_used), AV_OPT_TYPE_INT,
> {.i64 = 1}, -16, 16, VE}, \
> >  {"quality", "", offsetof(VP8Context, deadline), AV_OPT_TYPE_INT,
> {.i64 = VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, \
>
> > -{"vp8flags", "", offsetof(VP8Context, flags), FF_OPT_TYPE_FLAGS,
> {.i64 = 0}, 0, UINT_MAX, VE, "flags"}, \
> > -{"error_resilient", "enable error resilience", 0,
> FF_OPT_TYPE_CONST, {.dbl = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE,
> "flags"}, \
> > -{"altref", "enable use of alternate reference frames (VP8/2-pass
> only)", 0, FF_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX,
> VE, "flags"}, \
> > +{"vp8flags", "", offsetof(VP8Context, flags), AV_OPT_TYPE_FLAGS,
> {.i64 = 0}, 0, UINT_MAX, VE, "flags"}, \
> > +{"error_resilient", "enable error resilience", 0,
> AV_OPT_TYPE_CONST, {.dbl = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE,
> "flags"}, \
> > +{"altref", "enable use of alternate reference frames (VP8/2-pass
> only)", 0, AV_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX,
> VE, "flags"}, \
>
> not related to the pat

Re: [FFmpeg-devel] [PATCH 5/6] Put FF_API_OLD_AVOPTIONS under last use of av_opt_set_defaults2().

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 11:52:18AM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/options.c | 6 ++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/libavcodec/options.c b/libavcodec/options.c
> index 37f3792..ed4d826 100644
> --- a/libavcodec/options.c
> +++ b/libavcodec/options.c
> @@ -91,7 +91,9 @@ static const AVClass av_codec_context_class = {
>  
>  int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec)
>  {
> +#if FF_API_OLD_AVOPTIONS
>  int flags=0;
> +#endif
>  memset(s, 0, sizeof(AVCodecContext));
>  
>  s->av_class = &av_codec_context_class;
> @@ -102,6 +104,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, 
> const AVCodec *codec)
>  s->codec_id = codec->id;
>  }
>  
> +#if FF_API_OLD_AVOPTIONS
>  if(s->codec_type == AVMEDIA_TYPE_AUDIO)
>  flags= AV_OPT_FLAG_AUDIO_PARAM;
>  else if(s->codec_type == AVMEDIA_TYPE_VIDEO)
> @@ -109,6 +112,9 @@ int avcodec_get_context_defaults3(AVCodecContext *s, 
> const AVCodec *codec)
>  else if(s->codec_type == AVMEDIA_TYPE_SUBTITLE)
>  flags= AV_OPT_FLAG_SUBTITLE_PARAM;
>  av_opt_set_defaults2(s, flags, flags);
> +#else
> +av_opt_set_defaults(s);
> +#endif

i would prefer to keep av_opt_set_defaults2()
the avoption system marks options as being for video, for audio and
or subtitles
defaults can differ for video, audio and subtitles

also setting options that arent supposed to be used could result in
bugs being missed, like a video option marked as audio.

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

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


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


Re: [FFmpeg-devel] [PATCH 3/6] lavc: deprecate -ab as part of FF_API_OLD_AVOPTIONS.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 1:12 PM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 11:52:16AM -0400, Ronald S. Bultje wrote:
> > ---
> >  libavcodec/options_table.h | 2 ++
> >  1 file changed, 2 insertions(+)
>
> googling for
> ffmpeg "-ab"
> has 332.000 matches
>
> ffmpeg "-b:a"
> has 64.100 matches
>
> this patch is simply a bad idea


So, there's a few practical problems here. A) if we remove flag/mask from
the set_defaults calls (other patch in this set), the audio is also used
for the video ones (since we ignore media type), and thus we use (after
FF_API_OLD_AVOPTIONS is 0) the audio bitrate as default for video also.
That's bad, and causes some fate failures. We can workaround that by
inverting the ordering of these two, but then, the general one _always_
(even before FF_API_OLD_AVOPTIONS=0) takes precedence over the audio one,
so all fate results without explicit bitrate change from ab=128k to
ab=200k. (I'm working around that by making each fate test set bitrate
explicit where relevant.)

Alternate suggestion: I don't mind if -ab gets a workaround in ffmpeg.c,
but I'd like to remove it from the libav* code.

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


Re: [FFmpeg-devel] [PATCH 5/6] Put FF_API_OLD_AVOPTIONS under last use of av_opt_set_defaults2().

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 1:35 PM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 11:52:18AM -0400, Ronald S. Bultje wrote:
> > ---
> >  libavcodec/options.c | 6 ++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/libavcodec/options.c b/libavcodec/options.c
> > index 37f3792..ed4d826 100644
> > --- a/libavcodec/options.c
> > +++ b/libavcodec/options.c
> > @@ -91,7 +91,9 @@ static const AVClass av_codec_context_class = {
> >
> >  int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec
> *codec)
> >  {
> > +#if FF_API_OLD_AVOPTIONS
> >  int flags=0;
> > +#endif
> >  memset(s, 0, sizeof(AVCodecContext));
> >
> >  s->av_class = &av_codec_context_class;
> > @@ -102,6 +104,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s,
> const AVCodec *codec)
> >  s->codec_id = codec->id;
> >  }
> >
> > +#if FF_API_OLD_AVOPTIONS
> >  if(s->codec_type == AVMEDIA_TYPE_AUDIO)
> >  flags= AV_OPT_FLAG_AUDIO_PARAM;
> >  else if(s->codec_type == AVMEDIA_TYPE_VIDEO)
> > @@ -109,6 +112,9 @@ int avcodec_get_context_defaults3(AVCodecContext *s,
> const AVCodec *codec)
> >  else if(s->codec_type == AVMEDIA_TYPE_SUBTITLE)
> >  flags= AV_OPT_FLAG_SUBTITLE_PARAM;
> >  av_opt_set_defaults2(s, flags, flags);
> > +#else
> > +av_opt_set_defaults(s);
> > +#endif
>
> i would prefer to keep av_opt_set_defaults2()
> the avoption system marks options as being for video, for audio and
> or subtitles
> defaults can differ for video, audio and subtitles


So I'm open for this discussion, but this is a hugely obscure and limiting
way to do it. For example, why do we need "ab" for audio bit "b" for video?
Why aren't both called "b"? (And "ab" handled in ffmpeg.c.)

Why do we have this HUUGE AVCodecContext instead of several derived
structs that each are only for audio, only for video, only for subtitles,
etc., and each have their own media-type-specific options or
media-type-specific defaults for common options?

What about codec-specific defaults? JPEG has higher bitrates than MPEG for
the same quality, for obvious reasons. It's easy to come up with other
examples. Does that work?

And then lastly, why was this marked as deprecated if you intended to keep
it? I can almost understand that app authors ignore our deprecation markers
now...

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


Re: [FFmpeg-devel] [PATCH 1/4] vaapi: define a single pixel format for VA-API (AV_PIX_FMT_VAAPI).

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 1:17 PM, Gwenole Beauchesne 
wrote:

> Deprecate older VA pixel formats (MOCO, IDCT) as it is now very unlikely
> to ever be useful in the future. Only keep plain AV_PIX_FMT_VAAPI format
> that is aliased to the older VLD variant.
>
> Signed-off-by: Gwenole Beauchesne 
> ---
>  libavcodec/h263dec.c |  2 +-
>  libavcodec/h264_slice.c  |  2 +-
>  libavcodec/mpeg12dec.c   |  2 +-
>  libavcodec/vaapi_h264.c  |  2 +-
>  libavcodec/vaapi_mpeg2.c |  2 +-
>  libavcodec/vaapi_mpeg4.c |  4 ++--
>  libavcodec/vaapi_vc1.c   |  4 ++--
>  libavcodec/vc1dec.c  |  2 +-
>  libavutil/pixdesc.c  |  9 +
>  libavutil/pixfmt.h   | 11 +++
>  libavutil/version.h  |  3 +++
>  11 files changed, 33 insertions(+), 10 deletions(-)
>
> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index 7fa7090..e647e40 100644
> --- a/libavcodec/h263dec.c
> +++ b/libavcodec/h263dec.c
> @@ -718,7 +718,7 @@ frame_end:
>
>  const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
>  #if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
> -AV_PIX_FMT_VAAPI_VLD,
> +AV_PIX_FMT_VAAPI,
>  #endif
>  #if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL
>  AV_PIX_FMT_VDPAU,
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index 48f501b..7b35c08 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -943,7 +943,7 @@ static enum AVPixelFormat get_pixel_format(H264Context
> *h, int force_callback)
>  *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
>  #endif
>  #if CONFIG_H264_VAAPI_HWACCEL
> -*fmt++ = AV_PIX_FMT_VAAPI_VLD;
> +*fmt++ = AV_PIX_FMT_VAAPI;
>  #endif
>  #if CONFIG_H264_VDA_HWACCEL
>  *fmt++ = AV_PIX_FMT_VDA_VLD;
> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> index c7a5701..d2bedbc 100644
> --- a/libavcodec/mpeg12dec.c
> +++ b/libavcodec/mpeg12dec.c
> @@ -1209,7 +1209,7 @@ static const enum AVPixelFormat
> mpeg2_hwaccel_pixfmt_list_420[] = {
>  AV_PIX_FMT_D3D11VA_VLD,
>  #endif
>  #if CONFIG_MPEG2_VAAPI_HWACCEL
> -AV_PIX_FMT_VAAPI_VLD,
> +AV_PIX_FMT_VAAPI,
>  #endif
>  #if CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL
>  AV_PIX_FMT_VIDEOTOOLBOX,
> diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
> index 151aca9..55ee2fc 100644
> --- a/libavcodec/vaapi_h264.c
> +++ b/libavcodec/vaapi_h264.c
> @@ -359,7 +359,7 @@ AVHWAccel ff_h264_vaapi_hwaccel = {
>  .name   = "h264_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_H264,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_h264_start_frame,
>  .end_frame  = vaapi_h264_end_frame,
>  .decode_slice   = vaapi_h264_decode_slice,
> diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
> index 87fab89..27c69cd 100644
> --- a/libavcodec/vaapi_mpeg2.c
> +++ b/libavcodec/vaapi_mpeg2.c
> @@ -138,7 +138,7 @@ AVHWAccel ff_mpeg2_vaapi_hwaccel = {
>  .name   = "mpeg2_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_MPEG2VIDEO,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_mpeg2_start_frame,
>  .end_frame  = ff_vaapi_mpeg_end_frame,
>  .decode_slice   = vaapi_mpeg2_decode_slice,
> diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
> index 9b283f7..5b2e9d4 100644
> --- a/libavcodec/vaapi_mpeg4.c
> +++ b/libavcodec/vaapi_mpeg4.c
> @@ -141,7 +141,7 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = {
>  .name   = "mpeg4_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_MPEG4,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_mpeg4_start_frame,
>  .end_frame  = ff_vaapi_mpeg_end_frame,
>  .decode_slice   = vaapi_mpeg4_decode_slice,
> @@ -153,7 +153,7 @@ AVHWAccel ff_h263_vaapi_hwaccel = {
>  .name   = "h263_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_H263,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_mpeg4_start_frame,
>  .end_frame  = ff_vaapi_mpeg_end_frame,
>  .decode_slice   = vaapi_mpeg4_decode_slice,
> diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
> index 7ef9f2a..63d514d 100644
> --- a/libavcodec/vaapi_vc1.c
> +++ b/libavcodec/vaapi_vc1.c
> @@ -339,7 +339,7 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = {
>  .name   = "wmv3_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_WMV3,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_vc1_start_frame,
>  .end_frame  = ff_vaapi_mpeg_end_frame,
>  .decode_slice   = vaapi_vc

Re: [FFmpeg-devel] [PATCH 5/6] Put FF_API_OLD_AVOPTIONS under last use of av_opt_set_defaults2().

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 01:44:43PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 1:35 PM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 11:52:18AM -0400, Ronald S. Bultje wrote:
> > > ---
> > >  libavcodec/options.c | 6 ++
> > >  1 file changed, 6 insertions(+)
> > >
> > > diff --git a/libavcodec/options.c b/libavcodec/options.c
> > > index 37f3792..ed4d826 100644
> > > --- a/libavcodec/options.c
> > > +++ b/libavcodec/options.c
> > > @@ -91,7 +91,9 @@ static const AVClass av_codec_context_class = {
> > >
> > >  int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec
> > *codec)
> > >  {
> > > +#if FF_API_OLD_AVOPTIONS
> > >  int flags=0;
> > > +#endif
> > >  memset(s, 0, sizeof(AVCodecContext));
> > >
> > >  s->av_class = &av_codec_context_class;
> > > @@ -102,6 +104,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s,
> > const AVCodec *codec)
> > >  s->codec_id = codec->id;
> > >  }
> > >
> > > +#if FF_API_OLD_AVOPTIONS
> > >  if(s->codec_type == AVMEDIA_TYPE_AUDIO)
> > >  flags= AV_OPT_FLAG_AUDIO_PARAM;
> > >  else if(s->codec_type == AVMEDIA_TYPE_VIDEO)
> > > @@ -109,6 +112,9 @@ int avcodec_get_context_defaults3(AVCodecContext *s,
> > const AVCodec *codec)
> > >  else if(s->codec_type == AVMEDIA_TYPE_SUBTITLE)
> > >  flags= AV_OPT_FLAG_SUBTITLE_PARAM;
> > >  av_opt_set_defaults2(s, flags, flags);
> > > +#else
> > > +av_opt_set_defaults(s);
> > > +#endif
> >
> > i would prefer to keep av_opt_set_defaults2()
> > the avoption system marks options as being for video, for audio and
> > or subtitles
> > defaults can differ for video, audio and subtitles
> 
> 
> So I'm open for this discussion, but this is a hugely obscure and limiting
> way to do it. For example, why do we need "ab" for audio bit "b" for video?
> Why aren't both called "b"? (And "ab" handled in ffmpeg.c.)
> 
> Why do we have this HUUGE AVCodecContext instead of several derived
> structs that each are only for audio, only for video, only for subtitles,
> etc., and each have their own media-type-specific options or
> media-type-specific defaults for common options?
> 

> What about codec-specific defaults? JPEG has higher bitrates than MPEG for
> the same quality, for obvious reasons. It's easy to come up with other
> examples. Does that work?

there are codec specific defaults, see AVCodecDefault


> 
> And then lastly, why was this marked as deprecated if you intended to keep
> it?

the deprecation came in from a merge.
I did not know what other changes would follow and
probably saw no clear reason to change te deprecation back then



> I can almost understand that app authors ignore our deprecation markers
> now...
> 
> Ronald
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

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


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


Re: [FFmpeg-devel] [PATCH] Put remaining pieces of CODEC_FLAG_EMU_EDGE under FF_API_EMU_EDGE.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 12:25:47PM -0400, Ronald S. Bultje wrote:
> The amv one probably looks suspicious, but since it's an intra-only
> codec, I couldn't possibly imagine what it would use the edge for,
> and the vsyncht fate result doesn't change, so it's probably OK.
> ---
>  ffmpeg_opt.c  | 2 ++
>  ffplay.c  | 4 
>  libavcodec/mjpegenc.c | 2 ++
>  libavcodec/snowenc.c  | 6 +-
>  libavcodec/wmv2dec.c  | 2 ++
>  5 files changed, 15 insertions(+), 1 deletion(-)

fixed mplayer so this wouldnt break it

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

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope


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


Re: [FFmpeg-devel] [PATCH] Put remaining pieces of CODEC_FLAG_EMU_EDGE under FF_API_EMU_EDGE.

2015-08-17 Thread Ronald S. Bultje
On Mon, Aug 17, 2015 at 2:17 PM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 12:25:47PM -0400, Ronald S. Bultje wrote:
> > The amv one probably looks suspicious, but since it's an intra-only
> > codec, I couldn't possibly imagine what it would use the edge for,
> > and the vsyncht fate result doesn't change, so it's probably OK.
> > ---
> >  ffmpeg_opt.c  | 2 ++
> >  ffplay.c  | 4 
> >  libavcodec/mjpegenc.c | 2 ++
> >  libavcodec/snowenc.c  | 6 +-
> >  libavcodec/wmv2dec.c  | 2 ++
> >  5 files changed, 15 insertions(+), 1 deletion(-)
>
> fixed mplayer so this wouldnt break it


Ty.

(I'm curious, how did it break? Did it use CODEC_FLAG_EMU_EDGE, or is it
something more intricate?)

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


Re: [FFmpeg-devel] [PATCH 2/6] FF_OPT_TYPE_* -> AV_OPT_TYPE_*.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 01:34:11PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 1:25 PM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 11:52:15AM -0400, Ronald S. Bultje wrote:
> > > ---
> > >  libavcodec/dvbsubdec.c   |  6 +++---
> > >  libavcodec/frwu.c|  2 +-
> > >  libavcodec/h264.c|  4 ++--
> > >  libavcodec/libvpxenc.c   |  6 +++---
> > >  libavcodec/mpeg4videodec.c   |  4 ++--
> > >  libavcodec/s302m.c   | 10 +-
> > >  libavcodec/v210dec.c |  2 +-
> > >  libavformat/hls.c|  2 +-
> > >  libavformat/mov.c|  6 +++---
> > >  libavformat/tedcaptionsdec.c |  2 +-
> > >  10 files changed, 22 insertions(+), 22 deletions(-)
> > >
> > > diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
> > > index ff835ab..8aa203a 100644
> > > --- a/libavcodec/dvbsubdec.c
> > > +++ b/libavcodec/dvbsubdec.c
> > > @@ -1718,9 +1718,9 @@ end:
> > >
> > >  #define DS AV_OPT_FLAG_DECODING_PARAM | AV_OPT_FLAG_SUBTITLE_PARAM
> > >  static const AVOption options[] = {
> > > -{"compute_edt", "compute end of time using pts or timeout",
> > offsetof(DVBSubContext, compute_edt), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1,
> > DS},
> > > -{"compute_clut", "compute clut when not available(-1) or always(1)
> > or never(0)", offsetof(DVBSubContext, compute_clut), FF_OPT_TYPE_INT, {.i64
> > = -1}, -1, 1, DS},
> > > -{"dvb_substream", "", offsetof(DVBSubContext, substream),
> > FF_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS},
> > > +{"compute_edt", "compute end of time using pts or timeout",
> > offsetof(DVBSubContext, compute_edt), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1,
> > DS},
> > > +{"compute_clut", "compute clut when not available(-1) or always(1)
> > or never(0)", offsetof(DVBSubContext, compute_clut), AV_OPT_TYPE_INT, {.i64
> > = -1}, -1, 1, DS},
> > > +{"dvb_substream", "", offsetof(DVBSubContext, substream),
> > AV_OPT_TYPE_INT, {.i64 = -1}, -1, 63, DS},
> > >  {NULL}
> > >  };
> > >  static const AVClass dvbsubdec_class = {
> > > diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c
> > > index db4c1ba..1aabefe 100644
> > > --- a/libavcodec/frwu.c
> > > +++ b/libavcodec/frwu.c
> > > @@ -103,7 +103,7 @@ static int decode_frame(AVCodecContext *avctx, void
> > *data, int *got_frame,
> > >  }
> > >
> > >  static const AVOption frwu_options[] = {
> > > -{"change_field_order", "Change field order", offsetof(FRWUContext,
> > change_field_order), FF_OPT_TYPE_INT,
> > > +{"change_field_order", "Change field order", offsetof(FRWUContext,
> > change_field_order), AV_OPT_TYPE_INT,
> > >   {.i64 = 0}, 0, 1, AV_OPT_FLAG_DECODING_PARAM |
> > AV_OPT_FLAG_VIDEO_PARAM},
> > >  {NULL}
> > >  };
> > > diff --git a/libavcodec/h264.c b/libavcodec/h264.c
> > > index 24e209c..ca0a4a5 100644
> > > --- a/libavcodec/h264.c
> > > +++ b/libavcodec/h264.c
> > > @@ -1946,8 +1946,8 @@ static av_cold int h264_decode_end(AVCodecContext
> > *avctx)
> > >  #define OFFSET(x) offsetof(H264Context, x)
> > >  #define VD AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
> > >  static const AVOption h264_options[] = {
> > > -{"is_avc", "is avc", offsetof(H264Context, is_avc),
> > FF_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
> > > -{"nal_length_size", "nal_length_size", offsetof(H264Context,
> > nal_length_size), FF_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
> > > +{"is_avc", "is avc", offsetof(H264Context, is_avc),
> > AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, 0},
> > > +{"nal_length_size", "nal_length_size", offsetof(H264Context,
> > nal_length_size), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 4, 0},
> > >  { "enable_er", "Enable error resilience on damaged frames
> > (unsafe)", OFFSET(enable_er), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 1, VD },
> > >  { NULL },
> > >  };
> > > diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> > > index 3db617d..58e8f5d 100644
> > > --- a/libavcodec/libvpxenc.c
> > > +++ b/libavcodec/libvpxenc.c
> > > @@ -985,9 +985,9 @@ static int vp8_encode(AVCodecContext *avctx,
> > AVPacket *pkt,
> > >  #define LEGACY_OPTIONS \
> > >  {"speed", "", offsetof(VP8Context, cpu_used), AV_OPT_TYPE_INT,
> > {.i64 = 1}, -16, 16, VE}, \
> > >  {"quality", "", offsetof(VP8Context, deadline), AV_OPT_TYPE_INT,
> > {.i64 = VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, \
> >
> > > -{"vp8flags", "", offsetof(VP8Context, flags), FF_OPT_TYPE_FLAGS,
> > {.i64 = 0}, 0, UINT_MAX, VE, "flags"}, \
> > > -{"error_resilient", "enable error resilience", 0,
> > FF_OPT_TYPE_CONST, {.dbl = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE,
> > "flags"}, \
> > > -{"altref", "enable use of alternate reference frames (VP8/2-pass
> > only)", 0, FF_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX,
> > VE, "flags"}, \
> > > +{"vp8flags", "", offsetof(VP8Context, flags), AV_OPT_TYPE_FLAGS,
> > {.i64 = 0}, 0, UINT_MAX, VE, "flags"}, \
> > > +{"error_resilient", "enable error resilience", 0,
> > 

Re: [FFmpeg-devel] [PATCH] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 12:00:21PM -0400, Ronald S. Bultje wrote:
[...]
> diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c
> index 47630ad..a56b163 100644
> --- a/libavfilter/vsrc_life.c
> +++ b/libavfilter/vsrc_life.c
> @@ -334,7 +334,7 @@ static void evolve(AVFilterContext *ctx)
>  if (alive) *newbuf = ALIVE_CELL; // new cell is alive
>  else if (cell) *newbuf = cell - 1;   // new cell is dead and in 
> the process of mold
>  else   *newbuf = 0;  // new cell is definitely 
> dead
> -av_dlog(ctx, "i:%d j:%d live_neighbors:%d cell:%d -> cell:%d\n", 
> i, j, n, cell, *newbuf);
> +av_log(ctx, AV_LOG_TRACE, "i:%d j:%d live_neighbors:%d cell:%d 
> -> cell:%d\n", i, j, n, cell, *newbuf);
>  newbuf++;

this is called per pixel so ff_tlog() might be better to avoid
overhead from the call

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

It is dangerous to be right in matters on which the established authorities
are wrong. -- 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] Put remaining pieces of CODEC_FLAG_EMU_EDGE under FF_API_EMU_EDGE.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 02:19:59PM -0400, Ronald S. Bultje wrote:
> On Mon, Aug 17, 2015 at 2:17 PM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 12:25:47PM -0400, Ronald S. Bultje wrote:
> > > The amv one probably looks suspicious, but since it's an intra-only
> > > codec, I couldn't possibly imagine what it would use the edge for,
> > > and the vsyncht fate result doesn't change, so it's probably OK.
> > > ---
> > >  ffmpeg_opt.c  | 2 ++
> > >  ffplay.c  | 4 
> > >  libavcodec/mjpegenc.c | 2 ++
> > >  libavcodec/snowenc.c  | 6 +-
> > >  libavcodec/wmv2dec.c  | 2 ++
> > >  5 files changed, 15 insertions(+), 1 deletion(-)
> >
> > fixed mplayer so this wouldnt break it
> 
> 
> Ty.
> 
> (I'm curious, how did it break? Did it use CODEC_FLAG_EMU_EDGE, or is it
> something more intricate?)

basic switching on/off of emu edge depending on get/release_buffer
being overridden or not

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- 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] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 12:00:21PM -0400, Ronald S. Bultje wrote:
[...]
> diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> index 3c1fcdd..a2522ef 100644
> --- a/libavformat/mpegts.c
> +++ b/libavformat/mpegts.c
> @@ -2458,7 +2458,7 @@ static int mpegts_probe(AVProbeData *p)
>  sumscore = sumscore * CHECK_COUNT / check_count;
>  maxscore = maxscore * CHECK_COUNT / CHECK_BLOCK;
>  
> -av_dlog(0, "TS score: %d %d\n", sumscore, maxscore);
> +av_log(0, AV_LOG_TRACE, "TS score: %d %d\n", sumscore, maxscore);

cosmetic issue ad unrelated to the patch but it should NULL instead of 0

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

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


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


Re: [FFmpeg-devel] [PATCH] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread Clément Bœsch
On Mon, Aug 17, 2015 at 12:00:21PM -0400, Ronald S. Bultje wrote:
[...]
>  libavfilter/vf_palettegen.c  | 10 ++
>  libavfilter/vf_paletteuse.c  |  4 ++--

At least one of them is in the performance relevant inner loop, so I'd
prefer if you comment the av_log.

[...]

-- 
Clément B.


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


[FFmpeg-devel] [PATCH 1/2] Prepare for removal of obsolete FF_IDCT_* members.

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/avcodec.h   | 2 --
 libavcodec/avdct.c | 2 ++
 libavcodec/options_table.h | 2 --
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6b824d5..6f9b026 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2947,9 +2947,7 @@ typedef struct AVCodecContext {
 int dct_algo;
 #define FF_DCT_AUTO0
 #define FF_DCT_FASTINT 1
-#if FF_API_UNUSED_MEMBERS
 #define FF_DCT_INT 2
-#endif /* FF_API_UNUSED_MEMBERS */
 #define FF_DCT_MMX 3
 #define FF_DCT_ALTIVEC 5
 #define FF_DCT_FAAN6
diff --git a/libavcodec/avdct.c b/libavcodec/avdct.c
index f92c691..3b622ba 100644
--- a/libavcodec/avdct.c
+++ b/libavcodec/avdct.c
@@ -58,7 +58,9 @@ static const AVOption avdct_options[] = {
 #if FF_API_ARCH_ALPHA
 {"simplealpha", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"},
 #endif
+#if FF_API_UNUSED_MEMBERS
 {"ipp", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
+#endif
 {"xvid", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
 {"xvidmmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
 {"faani", "floating point AAN IDCT (experimental / for debugging)", 0, 
AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
index fd9c045..8dabb65 100644
--- a/libavcodec/options_table.h
+++ b/libavcodec/options_table.h
@@ -203,9 +203,7 @@ static const AVOption avcodec_options[] = {
 {"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 
0, INT_MAX, V|E, "dct"},
 {"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64 = 
FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"},
 {"fastint", "fast integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FASTINT }, 
INT_MIN, INT_MAX, V|E, "dct"},
-#if FF_API_UNUSED_MEMBERS
 {"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_INT }, 
INT_MIN, INT_MAX, V|E, "dct"},
-#endif /* FF_API_UNUSED_MEMBERS */
 {"mmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_MMX }, INT_MIN, INT_MAX, 
V|E, "dct"},
 {"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_ALTIVEC }, INT_MIN, 
INT_MAX, V|E, "dct"},
 {"faan", "floating point AAN DCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FAAN 
}, INT_MIN, INT_MAX, V|E, "dct"},
-- 
2.1.2

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


[FFmpeg-devel] [PATCH 2/2] Comment out last use of FF_DEBUG_GENPTS.

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/mpeg4videodec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 55ce5d8..d716626 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2320,9 +2320,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, 
GetBitContext *gb)
 pts = ROUNDED_DIV(s->time, s->avctx->framerate.den);
 else
 pts = AV_NOPTS_VALUE;
-if (s->avctx->debug&FF_DEBUG_PTS)
-av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n",
-   pts);
+//av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n", pts);
 
 check_marker(gb, "before vop_coded");
 
-- 
2.1.2

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


[FFmpeg-devel] [PATCH] fate: add -fflags +bitexact in a few places.

2015-08-17 Thread Ronald S. Bultje
This improves results after FF_API_LAVF_BITEXACT=0. It still doesn't
pass, because of mov rtphint track which I don't understand (yet).
---
 tests/fate/ffmpeg.mak | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
index 6af1081..551d8e7 100644
--- a/tests/fate/ffmpeg.mak
+++ b/tests/fate/ffmpeg.mak
@@ -1,14 +1,14 @@
 FATE_MAPCHAN-$(CONFIG_CHANNELMAP_FILTER) += fate-mapchan-6ch-extract-2
 fate-mapchan-6ch-extract-2: tests/data/asynth-22050-6.wav
-fate-mapchan-6ch-extract-2: CMD = ffmpeg -i 
$(TARGET_PATH)/tests/data/asynth-22050-6.wav -map_channel 0.0.0 -flags 
+bitexact -f wav md5: -map_channel 0.0.1 -flags +bitexact -f wav md5:
+fate-mapchan-6ch-extract-2: CMD = ffmpeg -i 
$(TARGET_PATH)/tests/data/asynth-22050-6.wav -map_channel 0.0.0 -fflags 
+bitexact -f wav md5: -map_channel 0.0.1 -fflags +bitexact -f wav md5:
 
 FATE_MAPCHAN-$(CONFIG_CHANNELMAP_FILTER) += 
fate-mapchan-6ch-extract-2-downmix-mono
 fate-mapchan-6ch-extract-2-downmix-mono: tests/data/asynth-22050-6.wav
-fate-mapchan-6ch-extract-2-downmix-mono: CMD = md5 -i 
$(TARGET_PATH)/tests/data/asynth-22050-6.wav -map_channel 0.0.1 -map_channel 
0.0.0 -ac 1 -flags +bitexact -f wav
+fate-mapchan-6ch-extract-2-downmix-mono: CMD = md5 -i 
$(TARGET_PATH)/tests/data/asynth-22050-6.wav -map_channel 0.0.1 -map_channel 
0.0.0 -ac 1 -fflags +bitexact -f wav
 
 FATE_MAPCHAN-$(CONFIG_CHANNELMAP_FILTER) += fate-mapchan-silent-mono
 fate-mapchan-silent-mono: tests/data/asynth-22050-1.wav
-fate-mapchan-silent-mono: CMD = md5 -i 
$(TARGET_PATH)/tests/data/asynth-22050-1.wav -map_channel -1 -map_channel 0.0.0 
-flags +bitexact -f wav
+fate-mapchan-silent-mono: CMD = md5 -i 
$(TARGET_PATH)/tests/data/asynth-22050-1.wav -map_channel -1 -map_channel 0.0.0 
-fflags +bitexact -f wav
 
 FATE_MAPCHAN = $(FATE_MAPCHAN-yes)
 
@@ -16,10 +16,10 @@ FATE_FFMPEG += $(FATE_MAPCHAN)
 fate-mapchan: $(FATE_MAPCHAN)
 
 FATE_FFMPEG-$(CONFIG_COLOR_FILTER) += fate-ffmpeg-filter_complex
-fate-ffmpeg-filter_complex: CMD = framecrc -filter_complex color=d=1:r=5
+fate-ffmpeg-filter_complex: CMD = framecrc -filter_complex color=d=1:r=5 
-fflags +bitexact
 
 FATE_FFMPEG-$(CONFIG_COLOR_FILTER) += fate-ffmpeg-lavfi
-fate-ffmpeg-lavfi: CMD = framecrc -lavfi color=d=1:r=5
+fate-ffmpeg-lavfi: CMD = framecrc -lavfi color=d=1:r=5 -fflags +bitexact
 
 FATE_SAMPLES_FFMPEG-$(CONFIG_RAWVIDEO_DEMUXER) += fate-force_key_frames
 fate-force_key_frames: tests/data/vsynth_lena.yuv
-- 
2.1.2

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


Re: [FFmpeg-devel] [PATCH 1/4] vaapi: define a single pixel format for VA-API (AV_PIX_FMT_VAAPI).

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 19:17:50 +0200
Gwenole Beauchesne  wrote:

> Deprecate older VA pixel formats (MOCO, IDCT) as it is now very unlikely
> to ever be useful in the future. Only keep plain AV_PIX_FMT_VAAPI format
> that is aliased to the older VLD variant.
> 
> Signed-off-by: Gwenole Beauchesne 
> ---
>  libavcodec/h263dec.c |  2 +-
>  libavcodec/h264_slice.c  |  2 +-
>  libavcodec/mpeg12dec.c   |  2 +-
>  libavcodec/vaapi_h264.c  |  2 +-
>  libavcodec/vaapi_mpeg2.c |  2 +-
>  libavcodec/vaapi_mpeg4.c |  4 ++--
>  libavcodec/vaapi_vc1.c   |  4 ++--
>  libavcodec/vc1dec.c  |  2 +-
>  libavutil/pixdesc.c  |  9 +
>  libavutil/pixfmt.h   | 11 +++
>  libavutil/version.h  |  3 +++
>  11 files changed, 33 insertions(+), 10 deletions(-)
> 
> diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
> index 7fa7090..e647e40 100644
> --- a/libavcodec/h263dec.c
> +++ b/libavcodec/h263dec.c
> @@ -718,7 +718,7 @@ frame_end:
>  
>  const enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[] = {
>  #if CONFIG_H263_VAAPI_HWACCEL || CONFIG_MPEG4_VAAPI_HWACCEL
> -AV_PIX_FMT_VAAPI_VLD,
> +AV_PIX_FMT_VAAPI,
>  #endif
>  #if CONFIG_H263_VDPAU_HWACCEL || CONFIG_MPEG4_VDPAU_HWACCEL
>  AV_PIX_FMT_VDPAU,
> diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
> index 48f501b..7b35c08 100644
> --- a/libavcodec/h264_slice.c
> +++ b/libavcodec/h264_slice.c
> @@ -943,7 +943,7 @@ static enum AVPixelFormat get_pixel_format(H264Context 
> *h, int force_callback)
>  *fmt++ = AV_PIX_FMT_D3D11VA_VLD;
>  #endif
>  #if CONFIG_H264_VAAPI_HWACCEL
> -*fmt++ = AV_PIX_FMT_VAAPI_VLD;
> +*fmt++ = AV_PIX_FMT_VAAPI;
>  #endif
>  #if CONFIG_H264_VDA_HWACCEL
>  *fmt++ = AV_PIX_FMT_VDA_VLD;
> diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
> index c7a5701..d2bedbc 100644
> --- a/libavcodec/mpeg12dec.c
> +++ b/libavcodec/mpeg12dec.c
> @@ -1209,7 +1209,7 @@ static const enum AVPixelFormat 
> mpeg2_hwaccel_pixfmt_list_420[] = {
>  AV_PIX_FMT_D3D11VA_VLD,
>  #endif
>  #if CONFIG_MPEG2_VAAPI_HWACCEL
> -AV_PIX_FMT_VAAPI_VLD,
> +AV_PIX_FMT_VAAPI,
>  #endif
>  #if CONFIG_MPEG2_VIDEOTOOLBOX_HWACCEL
>  AV_PIX_FMT_VIDEOTOOLBOX,
> diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c
> index 151aca9..55ee2fc 100644
> --- a/libavcodec/vaapi_h264.c
> +++ b/libavcodec/vaapi_h264.c
> @@ -359,7 +359,7 @@ AVHWAccel ff_h264_vaapi_hwaccel = {
>  .name   = "h264_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_H264,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_h264_start_frame,
>  .end_frame  = vaapi_h264_end_frame,
>  .decode_slice   = vaapi_h264_decode_slice,
> diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c
> index 87fab89..27c69cd 100644
> --- a/libavcodec/vaapi_mpeg2.c
> +++ b/libavcodec/vaapi_mpeg2.c
> @@ -138,7 +138,7 @@ AVHWAccel ff_mpeg2_vaapi_hwaccel = {
>  .name   = "mpeg2_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_MPEG2VIDEO,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_mpeg2_start_frame,
>  .end_frame  = ff_vaapi_mpeg_end_frame,
>  .decode_slice   = vaapi_mpeg2_decode_slice,
> diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c
> index 9b283f7..5b2e9d4 100644
> --- a/libavcodec/vaapi_mpeg4.c
> +++ b/libavcodec/vaapi_mpeg4.c
> @@ -141,7 +141,7 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = {
>  .name   = "mpeg4_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_MPEG4,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_mpeg4_start_frame,
>  .end_frame  = ff_vaapi_mpeg_end_frame,
>  .decode_slice   = vaapi_mpeg4_decode_slice,
> @@ -153,7 +153,7 @@ AVHWAccel ff_h263_vaapi_hwaccel = {
>  .name   = "h263_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_H263,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_mpeg4_start_frame,
>  .end_frame  = ff_vaapi_mpeg_end_frame,
>  .decode_slice   = vaapi_mpeg4_decode_slice,
> diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c
> index 7ef9f2a..63d514d 100644
> --- a/libavcodec/vaapi_vc1.c
> +++ b/libavcodec/vaapi_vc1.c
> @@ -339,7 +339,7 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = {
>  .name   = "wmv3_vaapi",
>  .type   = AVMEDIA_TYPE_VIDEO,
>  .id = AV_CODEC_ID_WMV3,
> -.pix_fmt= AV_PIX_FMT_VAAPI_VLD,
> +.pix_fmt= AV_PIX_FMT_VAAPI,
>  .start_frame= vaapi_vc1_start_frame,
>  .end_frame  = ff_vaapi_mpeg_end_frame,
>  .decode_slice   = vaapi

Re: [FFmpeg-devel] [PATCH]lavf/mov: Support alac extradata in wave atom v2

2015-08-17 Thread Carl Eugen Hoyos
Michael Niedermayer  niedermayer.cc> writes:

> +ffio_ensure_seekback(pb, 8);
> +buffer = avio_rb64(pb);
> +atom.size -= 8;
> +if (  (buffer & 0x) == MKBETAG('f','r','m','a')
> +&& buffer >> 32 <= atom.size
> +&& buffer >> 32 >= 8) {
> +avio_skip(pb,  - 8);
> +atom.size += 8;

I tested that QT expects the frma atom first 
in the wave atom, so this variant is ok as 
far as I can tell.

Thank you, Carl Eugen

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


Re: [FFmpeg-devel] [PATCH 2/4] vaapi: streamline public context structure.

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 19:17:51 +0200
Gwenole Beauchesne  wrote:

> Move libavcodec managed objects from the public struct vaapi_context
> to a new privately owned FFVAContext. This is done so that to clean up
> and streamline the public structure, but also to prepare for new codec
> support, thus requiring new internal data to be added in there.
> 
> The AVCodecContext.hwaccel_context, that holds the public vaapi_context,
> shall no longer be accessed from within vaapi_*.c codec support files.
> 
> Signed-off-by: Gwenole Beauchesne 
> ---
>  libavcodec/vaapi.c  | 34 +-
>  libavcodec/vaapi.h  | 16 
>  libavcodec/vaapi_h264.c | 10 +++---
>  libavcodec/vaapi_internal.h | 42 --
>  libavcodec/vaapi_mpeg2.c|  8 ++--
>  libavcodec/vaapi_mpeg4.c| 11 +--
>  libavcodec/vaapi_vc1.c  | 11 +--
>  libavcodec/version.h|  3 +++
>  8 files changed, 111 insertions(+), 24 deletions(-)
> 
> diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
> index 6ac22e6..880e3d6 100644
> --- a/libavcodec/vaapi.c
> +++ b/libavcodec/vaapi.c
> @@ -41,7 +41,23 @@ static void destroy_buffers(VADisplay display, VABufferID 
> *buffers, unsigned int
>  }
>  }
>  
> -int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
> +int ff_vaapi_context_init(AVCodecContext *avctx)
> +{
> +FFVAContext * const vactx = ff_vaapi_get_context(avctx);
> +const struct vaapi_context * const user_vactx = avctx->hwaccel_context;
> +
> +vactx->display  = user_vactx->display;
> +vactx->config_id= user_vactx->config_id;
> +vactx->context_id   = user_vactx->context_id;
> +return 0;
> +}
> +
> +int ff_vaapi_context_fini(AVCodecContext *avctx)
> +{
> +return 0;
> +}
> +
> +int ff_vaapi_render_picture(FFVAContext *vactx, VASurfaceID surface)
>  {
>  VABufferID va_buffers[3];
>  unsigned int n_va_buffers = 0;
> @@ -81,7 +97,7 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, 
> VASurfaceID surface)
>  return 0;
>  }
>  
> -int ff_vaapi_commit_slices(struct vaapi_context *vactx)
> +int ff_vaapi_commit_slices(FFVAContext *vactx)
>  {
>  VABufferID *slice_buf_ids;
>  VABufferID slice_param_buf_id, slice_data_buf_id;
> @@ -121,7 +137,7 @@ int ff_vaapi_commit_slices(struct vaapi_context *vactx)
>  return 0;
>  }
>  
> -static void *alloc_buffer(struct vaapi_context *vactx, int type, unsigned 
> int size, uint32_t *buf_id)
> +static void *alloc_buffer(FFVAContext *vactx, int type, unsigned int size, 
> uint32_t *buf_id)
>  {
>  void *data = NULL;
>  
> @@ -133,22 +149,22 @@ static void *alloc_buffer(struct vaapi_context *vactx, 
> int type, unsigned int si
>  return data;
>  }
>  
> -void *ff_vaapi_alloc_pic_param(struct vaapi_context *vactx, unsigned int 
> size)
> +void *ff_vaapi_alloc_pic_param(FFVAContext *vactx, unsigned int size)
>  {
>  return alloc_buffer(vactx, VAPictureParameterBufferType, size, 
> &vactx->pic_param_buf_id);
>  }
>  
> -void *ff_vaapi_alloc_iq_matrix(struct vaapi_context *vactx, unsigned int 
> size)
> +void *ff_vaapi_alloc_iq_matrix(FFVAContext *vactx, unsigned int size)
>  {
>  return alloc_buffer(vactx, VAIQMatrixBufferType, size, 
> &vactx->iq_matrix_buf_id);
>  }
>  
> -uint8_t *ff_vaapi_alloc_bitplane(struct vaapi_context *vactx, uint32_t size)
> +uint8_t *ff_vaapi_alloc_bitplane(FFVAContext *vactx, uint32_t size)
>  {
>  return alloc_buffer(vactx, VABitPlaneBufferType, size, 
> &vactx->bitplane_buf_id);
>  }
>  
> -VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct vaapi_context 
> *vactx, const uint8_t *buffer, uint32_t size)
> +VASliceParameterBufferBase *ff_vaapi_alloc_slice(FFVAContext *vactx, const 
> uint8_t *buffer, uint32_t size)
>  {
>  uint8_t *slice_params;
>  VASliceParameterBufferBase *slice_param;
> @@ -181,7 +197,7 @@ VASliceParameterBufferBase *ff_vaapi_alloc_slice(struct 
> vaapi_context *vactx, co
>  
>  void ff_vaapi_common_end_frame(AVCodecContext *avctx)
>  {
> -struct vaapi_context * const vactx = avctx->hwaccel_context;
> +FFVAContext * const vactx = ff_vaapi_get_context(avctx);
>  
>  ff_dlog(avctx, "ff_vaapi_common_end_frame()\n");
>  
> @@ -202,7 +218,7 @@ void ff_vaapi_common_end_frame(AVCodecContext *avctx)
>  CONFIG_VC1_VAAPI_HWACCEL   || CONFIG_WMV3_VAAPI_HWACCEL
>  int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
>  {
> -struct vaapi_context * const vactx = avctx->hwaccel_context;
> +FFVAContext * const vactx = ff_vaapi_get_context(avctx);
>  MpegEncContext *s = avctx->priv_data;
>  int ret;
>  
> diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
> index 815a27e..4448a2e 100644
> --- a/libavcodec/vaapi.h
> +++ b/libavcodec/vaapi.h
> @@ -31,6 +31,8 @@
>   */
>  
>  #include 
> +#include 
> +#include "version.h"
>  
>  /**
>   * @defgroup lavc_codec_hwaccel_vaapi VA API Decoding
> @@

[FFmpeg-devel] [PATCH] fate: move -flags +mv0 -> -mpv_flags +mv0.

2015-08-17 Thread Ronald S. Bultje
Fixes associated fate tests when FF_API_MV0=0.
---
 tests/fate/vcodec.mak | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index 4e4f0ed..11eb4f7 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -164,8 +164,8 @@ fate-vsynth%-mpeg2:  ENCOPTS = -qscale 10
 fate-vsynth%-mpeg2-422:  ENCOPTS = -b:v 1000k   \
-bf 2\
-trellis 1   \
-   -flags +mv0+ildct+ilme   \
-   -mpv_flags +qp_rd\
+   -flags +ildct+ilme   \
+   -mpv_flags +qp_rd+mv0\
-intra_vlc 1 \
-mbd rd  \
-pix_fmt yuv422p
@@ -174,8 +174,7 @@ fate-vsynth%-mpeg2-ilace:ENCOPTS = -qscale 10 
-flags +ildct+ilme
 fate-vsynth%-mpeg2-ivlc-qprd:ENCOPTS = -b:v 500k\
-bf 2\
-trellis 1   \
-   -flags +mv0  \
-   -mpv_flags +qp_rd\
+   -mpv_flags +qp_rd+mv0\
-intra_vlc 1 \
-cmp 2 -subcmp 2 \
-mbd rd
@@ -201,7 +200,8 @@ FATE_VCODEC-$(call ENCDEC, MPEG4, AVI) += 
$(FATE_MPEG4_AVI)
 fate-vsynth%-mpeg4:  ENCOPTS = -qscale 10 -flags +mv4 -mbd bits
 fate-vsynth%-mpeg4:  FMT = mp4
 
-fate-vsynth%-mpeg4-adap: ENCOPTS = -b 550k -bf 2 -flags +mv4+mv0 \
+fate-vsynth%-mpeg4-adap: ENCOPTS = -b 550k -bf 2 -flags +mv4 \
+   -mpv_flags +mv0   \
-trellis 1 -cmp 1 -subcmp 2   \
-mbd rd -scplx_mask 0.3
 
@@ -223,8 +223,9 @@ fate-vsynth%-mpeg4-qpel: ENCOPTS = -qscale 7 -flags 
+mv4+qpel -mbd 2 \
-bf 2 -cmp 1 -subcmp 2
 
 fate-vsynth%-mpeg4-qprd: ENCOPTS = -b 450k -bf 2 -trellis 1  \
-   -flags +mv4+mv0 -mpv_flags +qp_rd \
-   -cmp 2 -subcmp 2 -mbd rd
+   -flags +mv4 -mpv_flags +qp_rd \
+   -cmp 2 -subcmp 2 -mbd rd  \
+   -mpv_flags +mv0
 
 fate-vsynth%-mpeg4-rc:   ENCOPTS = -b 400k -bf 2
 
-- 
2.1.2

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


Re: [FFmpeg-devel] [PATCH 3/4] vaapi: fix usage of invalid buffer ids.

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 19:17:52 +0200
Gwenole Beauchesne  wrote:

> Invalid buffer ids are defined by VA_INVALID_ID. Use that through out
> vaapi_*.c support files now that we have private data initialized and
> managed by libavcodec. Previously, the only requirement for the public
> vaapi_context struct was to be zero-initialized.
> 
> This fixes support for 3rdparty VA drivers that strictly conform to
> the API whereby an invalid buffer id is VA_INVALID_ID and the first
> valid buffer id can actually be zero.
> 
> Signed-off-by: Gwenole Beauchesne 
> ---
>  libavcodec/vaapi.c | 20 
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
> index 880e3d6..1ae71a5 100644
> --- a/libavcodec/vaapi.c
> +++ b/libavcodec/vaapi.c
> @@ -34,9 +34,9 @@ static void destroy_buffers(VADisplay display, VABufferID 
> *buffers, unsigned int
>  {
>  unsigned int i;
>  for (i = 0; i < n_buffers; i++) {
> -if (buffers[i]) {
> +if (buffers[i] != VA_INVALID_ID) {
>  vaDestroyBuffer(display, buffers[i]);
> -buffers[i] = 0;
> +buffers[i] = VA_INVALID_ID;
>  }
>  }
>  }
> @@ -49,6 +49,10 @@ int ff_vaapi_context_init(AVCodecContext *avctx)
>  vactx->display  = user_vactx->display;
>  vactx->config_id= user_vactx->config_id;
>  vactx->context_id   = user_vactx->context_id;
> +
> +vactx->pic_param_buf_id = VA_INVALID_ID;
> +vactx->iq_matrix_buf_id = VA_INVALID_ID;
> +vactx->bitplane_buf_id  = VA_INVALID_ID;
>  return 0;
>  }
>  
> @@ -62,18 +66,18 @@ int ff_vaapi_render_picture(FFVAContext *vactx, 
> VASurfaceID surface)
>  VABufferID va_buffers[3];
>  unsigned int n_va_buffers = 0;
>  
> -if (!vactx->pic_param_buf_id)
> +if (vactx->pic_param_buf_id == VA_INVALID_ID)
>  return 0;
>  
>  vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
>  va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
>  
> -if (vactx->iq_matrix_buf_id) {
> +if (vactx->iq_matrix_buf_id != VA_INVALID_ID) {
>  vaUnmapBuffer(vactx->display, vactx->iq_matrix_buf_id);
>  va_buffers[n_va_buffers++] = vactx->iq_matrix_buf_id;
>  }
>  
> -if (vactx->bitplane_buf_id) {
> +if (vactx->bitplane_buf_id != VA_INVALID_ID) {
>  vaUnmapBuffer(vactx->display, vactx->bitplane_buf_id);
>  va_buffers[n_va_buffers++] = vactx->bitplane_buf_id;
>  }
> @@ -113,7 +117,7 @@ int ff_vaapi_commit_slices(FFVAContext *vactx)
>  return -1;
>  vactx->slice_buf_ids = slice_buf_ids;
>  
> -slice_param_buf_id = 0;
> +slice_param_buf_id = VA_INVALID_ID;
>  if (vaCreateBuffer(vactx->display, vactx->context_id,
> VASliceParameterBufferType,
> vactx->slice_param_size,
> @@ -122,7 +126,7 @@ int ff_vaapi_commit_slices(FFVAContext *vactx)
>  return -1;
>  vactx->slice_count = 0;
>  
> -slice_data_buf_id = 0;
> +slice_data_buf_id = VA_INVALID_ID;
>  if (vaCreateBuffer(vactx->display, vactx->context_id,
> VASliceDataBufferType,
> vactx->slice_data_size,
> @@ -141,7 +145,7 @@ static void *alloc_buffer(FFVAContext *vactx, int type, 
> unsigned int size, uint3
>  {
>  void *data = NULL;
>  
> -*buf_id = 0;
> +*buf_id = VA_INVALID_ID;
>  if (vaCreateBuffer(vactx->display, vactx->context_id,
> type, size, 1, NULL, buf_id) == VA_STATUS_SUCCESS)
>  vaMapBuffer(vactx->display, *buf_id, &data);

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


Re: [FFmpeg-devel] [PATCH 4/4] vaapi: add interfaces to properly initialize context.

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 19:17:53 +0200
Gwenole Beauchesne  wrote:

> Add av_vaapi_context_init() and av_vaapi_context_alloc() helper functions
> so that to properly initialize the vaapi_context structure, and allow for
> future extensions without breaking the API/ABI.
> 
> The new version and flags fields are inserted after the last known user
> initialized field, and actually useful field at all, i.e. VA context_id.
> This is safe because the vaapi_context structure was required to be zero
> initialized in the past. And, since those new helper functions and changes
> cause the AV_VAAPI_CONTEXT_VERSION to be bumped, we can track older struct
> requirements from within libavcodec.
> 
> Besides, it is now required by design, and actual usage, that the vaapi
> context structure be completely initialized once and for all before the
> AVCodecContext.get_format() function ever completes.
> 
> Signed-off-by: Gwenole Beauchesne 
> ---
>  libavcodec/vaapi.c  | 30 +++
>  libavcodec/vaapi.h  | 59 
> +
>  libavcodec/vaapi_internal.h |  1 +
>  3 files changed, 85 insertions(+), 5 deletions(-)
> 
> diff --git a/libavcodec/vaapi.c b/libavcodec/vaapi.c
> index 1ae71a5..4d3e2f3 100644
> --- a/libavcodec/vaapi.c
> +++ b/libavcodec/vaapi.c
> @@ -41,11 +41,41 @@ static void destroy_buffers(VADisplay display, VABufferID 
> *buffers, unsigned int
>  }
>  }
>  
> +/* Allocates a vaapi_context structure */
> +struct vaapi_context *av_vaapi_context_alloc(unsigned int flags)
> +{
> +struct vaapi_context *vactx;
> +
> +vactx = av_malloc(sizeof(*vactx));
> +if (!vactx)
> +return NULL;
> +
> +av_vaapi_context_init(vactx, AV_VAAPI_CONTEXT_VERSION, flags);
> +return vactx;
> +}
> +
> +/* Initializes a vaapi_context structure with safe defaults */
> +void av_vaapi_context_init(struct vaapi_context *vactx, unsigned int version,
> +   unsigned int flags)
> +{
> +vactx->display  = NULL;
> +vactx->config_id= VA_INVALID_ID;
> +vactx->context_id   = VA_INVALID_ID;
> +
> +if (version > 0) {
> +vactx->version  = version;
> +vactx->flags= flags;
> +}
> +}
> +
>  int ff_vaapi_context_init(AVCodecContext *avctx)
>  {
>  FFVAContext * const vactx = ff_vaapi_get_context(avctx);
>  const struct vaapi_context * const user_vactx = avctx->hwaccel_context;
>  
> +if (user_vactx->version > 0)
> +vactx->flags= user_vactx->flags;
> +
>  vactx->display  = user_vactx->display;
>  vactx->config_id= user_vactx->config_id;
>  vactx->context_id   = user_vactx->context_id;
> diff --git a/libavcodec/vaapi.h b/libavcodec/vaapi.h
> index 4448a2e..1f032a0 100644
> --- a/libavcodec/vaapi.h
> +++ b/libavcodec/vaapi.h
> @@ -40,14 +40,16 @@
>   * @{
>   */
>  
> +#define AV_VAAPI_CONTEXT_VERSION 1
> +
>  /**
>   * This structure is used to share data between the FFmpeg library and
>   * the client video application.
> - * This shall be zero-allocated and available as
> - * AVCodecContext.hwaccel_context. All user members can be set once
> - * during initialization or through each AVCodecContext.get_buffer()
> - * function call. In any case, they must be valid prior to calling
> - * decoding functions.
> + *
> + * This shall be initialized with av_vaapi_context_init(), or
> + * indirectly through av_vaapi_context_alloc(), and made available as
> + * AVCodecContext.hwaccel_context. All user members must be properly
> + * initialized before AVCodecContext.get_format() completes.
>   */
>  struct vaapi_context {
>  /**
> @@ -74,6 +76,29 @@ struct vaapi_context {
>   */
>  uint32_t context_id;
>  
> +/**
> + * This field must be set to AV_VAAPI_CONTEXT_VERSION
> + *
> + * @since Version 1.
> + *
> + * - encoding: unused
> + * - decoding: Set by user, through av_vaapi_context_init()
> + */
> +unsigned int version;

Not sure if I see any point in this. Normally, backwards-compatible ABI
additions can add fields in FFmpeg, but the API user doesn't get a way
to check whether a field is really there.

Or in other words, the level of ABI compatibility we target is that
newer libav* libs work with old application binaries, but not the other
way around.

> +
> +/**
> + * A bit field configuring the internal context used by libavcodec
> + *
> + * This is a combination of flags from common AV_HWACCEL_FLAG_xxx and
> + * from VA-API specific AV_VAAPI_FLAG_xxx.
> + *
> + * @since Version 1.
> + *
> + * - encoding: unused
> + * - decoding: Set by user, through av_vaapi_context_init()
> + */
> +unsigned int flags;

I'd say just leave it private, and the user can only initialize it with
av_vaapi_context_init().

> +
>  #if FF_API_VAAPI_CONTEXT
>  /**
>   * VAPictureParameterBuffer ID
> @@ -184,6 +209,30 @@ struct vaapi_context {
>  #endif
>

Re: [FFmpeg-devel] [PATCH] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 20:31:57 +0200
Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 12:00:21PM -0400, Ronald S. Bultje wrote:
> [...]
> > diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
> > index 3c1fcdd..a2522ef 100644
> > --- a/libavformat/mpegts.c
> > +++ b/libavformat/mpegts.c
> > @@ -2458,7 +2458,7 @@ static int mpegts_probe(AVProbeData *p)
> >  sumscore = sumscore * CHECK_COUNT / check_count;
> >  maxscore = maxscore * CHECK_COUNT / CHECK_BLOCK;
> >  
> > -av_dlog(0, "TS score: %d %d\n", sumscore, maxscore);
> > +av_log(0, AV_LOG_TRACE, "TS score: %d %d\n", sumscore, maxscore);
> 
> cosmetic issue ad unrelated to the patch but it should NULL instead of 0
> 
> [...]

They're equivalent, and also NULL contexts shouldn't be used. If we try
to cleanup all these little issues we'll never make progress. (Or BBB
will never make progress... sorry.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] GSoC Weekly report (libswscale)

2015-08-17 Thread Pedro Arthur
2015-08-17 0:19 GMT-03:00 Michael Niedermayer :

> also feel free to split the batch addition into a seperate commit
> (should be easy as you already have a versionn with and without)
>
Attached proper patchs.

also, please send me your public ssh key, i think you should have
> direct write access to ffmpeg git
>
I've sent it privately.
From 8430533c8a41b4abd4ce3b45e4b68627a0f76d58 Mon Sep 17 00:00:00 2001
From: Pedro Arthur 
Date: Mon, 17 Aug 2015 17:03:20 -0300
Subject: [PATCH 1/2] swscale: refactor horizontal scaling

+ split color conversion from scaling
- disabled gamma correction, util it's refactored too
---
 libswscale/Makefile   |   2 +
 libswscale/hscale.c   | 255 ++
 libswscale/swscale.c  |  77 +++--
 libswscale/swscale_internal.h | 100 +
 libswscale/utils.c|   3 +-
 libswscale/x86/swscale.c  |  31 -
 6 files changed, 457 insertions(+), 11 deletions(-)
 create mode 100644 libswscale/hscale.c

diff --git a/libswscale/Makefile b/libswscale/Makefile
index b11e789..b2b6381 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -15,6 +15,8 @@ OBJS = alphablend.o \
swscale_unscaled.o   \
utils.o  \
yuv2rgb.o\
+   slice.o  \
+   hscale.o \
 
 OBJS-$(CONFIG_SHARED)+= log2_tab.o
 
diff --git a/libswscale/hscale.c b/libswscale/hscale.c
new file mode 100644
index 000..bcbc87f
--- /dev/null
+++ b/libswscale/hscale.c
@@ -0,0 +1,255 @@
+#include "swscale_internal.h"
+
+static int lum_h_scale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+FilterContext *instance = desc->instance;
+int srcW = desc->src->width;
+int dstW = desc->dst->width;
+int xInc = instance->xInc;
+
+int i;
+for (i = 0; i < sliceH; ++i) {
+uint8_t ** src = desc->src->plane[0].line;
+uint8_t ** dst = desc->dst->plane[0].line;
+int src_pos = sliceY+i - desc->src->plane[0].sliceY;
+int dst_pos = sliceY+i - desc->dst->plane[0].sliceY;
+
+
+if (c->hyscale_fast) {
+c->hyscale_fast(c, (int16_t*)dst[dst_pos], dstW, src[src_pos], srcW, xInc);
+} else {
+c->hyScale(c, (int16_t*)dst[dst_pos], dstW, (const uint8_t *)src[src_pos], instance->filter,
+   instance->filter_pos, instance->filter_size);
+}
+
+if (c->lumConvertRange)
+c->lumConvertRange((int16_t*)dst[dst_pos], dstW);
+
+desc->dst->plane[0].sliceH += 1;
+
+if (desc->alpha) {
+src = desc->src->plane[3].line;
+dst = desc->dst->plane[3].line;
+
+src_pos = sliceY+i - desc->src->plane[3].sliceY;
+dst_pos = sliceY+i - desc->dst->plane[3].sliceY;
+
+desc->dst->plane[3].sliceH += 1;
+
+if (c->hyscale_fast) {
+c->hyscale_fast(c, (int16_t*)dst[dst_pos], dstW, src[src_pos], srcW, xInc);
+} else {
+c->hyScale(c, (int16_t*)dst[dst_pos], dstW, (const uint8_t *)src[src_pos], instance->filter,
+instance->filter_pos, instance->filter_size);
+}
+}
+}
+
+return sliceH;
+}
+
+static int lum_convert(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+int srcW = desc->src->width;
+ColorContext * instance = desc->instance;
+uint32_t * pal = instance->pal;
+int i;
+
+desc->dst->plane[0].sliceY = sliceY;
+desc->dst->plane[0].sliceH = sliceH;
+desc->dst->plane[3].sliceY = sliceY;
+desc->dst->plane[3].sliceH = sliceH;
+
+for (i = 0; i < sliceH; ++i) {
+int sp0 = sliceY+i - desc->src->plane[0].sliceY;
+int sp1 = ((sliceY+i) >> desc->src->v_chr_sub_sample) - desc->src->plane[1].sliceY;
+const uint8_t * src[4] = { desc->src->plane[0].line[sp0],
+desc->src->plane[1].line[sp1],
+desc->src->plane[2].line[sp1],
+desc->src->plane[3].line[sp0]};
+uint8_t * dst = desc->dst->plane[0].line[i];
+
+if (c->lumToYV12) {
+c->lumToYV12(dst, src[0], src[1], src[2], srcW, pal);
+} else if (c->readLumPlanar) {
+c->readLumPlanar(dst, src, srcW, c->input_rgb2yuv_table);
+} 
+
+
+if (desc->alpha) {
+dst = desc->dst->plane[3].line[i];
+if (c->alpToYV12) {
+c->alpToYV12(dst, src[3], src[1], src[2], srcW, pal);
+} else if (c->readAlpPlanar) {
+c->readAlpPlanar(dst, src, srcW, NULL);
+}
+}
+}
+
+return sliceH;
+}
+
+int ff_init_desc_fmt_convert(SwsFilterDescriptor *desc, SwsSlice * src, SwsSlice *dst, 

Re: [FFmpeg-devel] GSoC Weekly report (libswscale)

2015-08-17 Thread Pedro Arthur
ops, added missing file.


2015-08-17 17:31 GMT-03:00 Pedro Arthur :

>
>
> 2015-08-17 0:19 GMT-03:00 Michael Niedermayer :
>
>> also feel free to split the batch addition into a seperate commit
>> (should be easy as you already have a versionn with and without)
>>
> Attached proper patchs.
>
> also, please send me your public ssh key, i think you should have
>> direct write access to ffmpeg git
>>
> I've sent it privately.
>
From 90c8dc145b64ffc775aadee8c4f851057d45bb69 Mon Sep 17 00:00:00 2001
From: Pedro Arthur 
Date: Mon, 17 Aug 2015 17:03:20 -0300
Subject: [PATCH] swscale: refactor horizontal scaling

+ split color conversion from scaling
- disabled gamma correction, util it's refactored too
---
 libswscale/Makefile   |   2 +
 libswscale/hscale.c   | 255 +++
 libswscale/slice.c| 301 ++
 libswscale/swscale.c  |  77 ++-
 libswscale/swscale_internal.h | 100 ++
 libswscale/utils.c|   3 +-
 libswscale/x86/swscale.c  |  31 -
 7 files changed, 758 insertions(+), 11 deletions(-)
 create mode 100644 libswscale/hscale.c
 create mode 100644 libswscale/slice.c

diff --git a/libswscale/Makefile b/libswscale/Makefile
index b11e789..b2b6381 100644
--- a/libswscale/Makefile
+++ b/libswscale/Makefile
@@ -15,6 +15,8 @@ OBJS = alphablend.o \
swscale_unscaled.o   \
utils.o  \
yuv2rgb.o\
+   slice.o  \
+   hscale.o \
 
 OBJS-$(CONFIG_SHARED)+= log2_tab.o
 
diff --git a/libswscale/hscale.c b/libswscale/hscale.c
new file mode 100644
index 000..bcbc87f
--- /dev/null
+++ b/libswscale/hscale.c
@@ -0,0 +1,255 @@
+#include "swscale_internal.h"
+
+static int lum_h_scale(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+FilterContext *instance = desc->instance;
+int srcW = desc->src->width;
+int dstW = desc->dst->width;
+int xInc = instance->xInc;
+
+int i;
+for (i = 0; i < sliceH; ++i) {
+uint8_t ** src = desc->src->plane[0].line;
+uint8_t ** dst = desc->dst->plane[0].line;
+int src_pos = sliceY+i - desc->src->plane[0].sliceY;
+int dst_pos = sliceY+i - desc->dst->plane[0].sliceY;
+
+
+if (c->hyscale_fast) {
+c->hyscale_fast(c, (int16_t*)dst[dst_pos], dstW, src[src_pos], srcW, xInc);
+} else {
+c->hyScale(c, (int16_t*)dst[dst_pos], dstW, (const uint8_t *)src[src_pos], instance->filter,
+   instance->filter_pos, instance->filter_size);
+}
+
+if (c->lumConvertRange)
+c->lumConvertRange((int16_t*)dst[dst_pos], dstW);
+
+desc->dst->plane[0].sliceH += 1;
+
+if (desc->alpha) {
+src = desc->src->plane[3].line;
+dst = desc->dst->plane[3].line;
+
+src_pos = sliceY+i - desc->src->plane[3].sliceY;
+dst_pos = sliceY+i - desc->dst->plane[3].sliceY;
+
+desc->dst->plane[3].sliceH += 1;
+
+if (c->hyscale_fast) {
+c->hyscale_fast(c, (int16_t*)dst[dst_pos], dstW, src[src_pos], srcW, xInc);
+} else {
+c->hyScale(c, (int16_t*)dst[dst_pos], dstW, (const uint8_t *)src[src_pos], instance->filter,
+instance->filter_pos, instance->filter_size);
+}
+}
+}
+
+return sliceH;
+}
+
+static int lum_convert(SwsContext *c, SwsFilterDescriptor *desc, int sliceY, int sliceH)
+{
+int srcW = desc->src->width;
+ColorContext * instance = desc->instance;
+uint32_t * pal = instance->pal;
+int i;
+
+desc->dst->plane[0].sliceY = sliceY;
+desc->dst->plane[0].sliceH = sliceH;
+desc->dst->plane[3].sliceY = sliceY;
+desc->dst->plane[3].sliceH = sliceH;
+
+for (i = 0; i < sliceH; ++i) {
+int sp0 = sliceY+i - desc->src->plane[0].sliceY;
+int sp1 = ((sliceY+i) >> desc->src->v_chr_sub_sample) - desc->src->plane[1].sliceY;
+const uint8_t * src[4] = { desc->src->plane[0].line[sp0],
+desc->src->plane[1].line[sp1],
+desc->src->plane[2].line[sp1],
+desc->src->plane[3].line[sp0]};
+uint8_t * dst = desc->dst->plane[0].line[i];
+
+if (c->lumToYV12) {
+c->lumToYV12(dst, src[0], src[1], src[2], srcW, pal);
+} else if (c->readLumPlanar) {
+c->readLumPlanar(dst, src, srcW, c->input_rgb2yuv_table);
+} 
+
+
+if (desc->alpha) {
+dst = desc->dst->plane[3].line[i];
+if (c->alpToYV12) {
+c->alpToYV12(dst, src[3], src[1], src[2], srcW, pal);
+} else if (c->readAlpPlanar) {
+  

Re: [FFmpeg-devel] [PATCH] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 2:26 PM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 12:00:21PM -0400, Ronald S. Bultje wrote:
> [...]
> > diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c
> > index 47630ad..a56b163 100644
> > --- a/libavfilter/vsrc_life.c
> > +++ b/libavfilter/vsrc_life.c
> > @@ -334,7 +334,7 @@ static void evolve(AVFilterContext *ctx)
> >  if (alive) *newbuf = ALIVE_CELL; // new cell is alive
> >  else if (cell) *newbuf = cell - 1;   // new cell is dead
> and in the process of mold
> >  else   *newbuf = 0;  // new cell is
> definitely dead
> > -av_dlog(ctx, "i:%d j:%d live_neighbors:%d cell:%d ->
> cell:%d\n", i, j, n, cell, *newbuf);
> > +av_log(ctx, AV_LOG_TRACE, "i:%d j:%d live_neighbors:%d
> cell:%d -> cell:%d\n", i, j, n, cell, *newbuf);
> >  newbuf++;
>
> this is called per pixel so ff_tlog() might be better to avoid
> overhead from the call


Oh I hadn't seen that. ff_tlog seems somewhat useless because it doesn't
assure it keeps compiling, but ff_dlog seems pretty useful and fits the
same scope of av_dlog, so I'll use that instead...

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


[FFmpeg-devel] [PATCH] fate: rename -error option to -error_rate.

2015-08-17 Thread Ronald S. Bultje
This fixes fate when FF_API_ERROR_RATE=0.
---
 tests/fate/vcodec.mak | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index 11eb4f7..d4d0df5 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -211,7 +211,7 @@ fate-vsynth%-mpeg4-adv:  ENCOPTS = -qscale 9 -flags 
+mv4+aic   \
 
 fate-vsynth%-mpeg4-error:ENCOPTS = -qscale 7 -flags +mv4+aic\
-data_partitioning 1 -mbd rd \
-   -ps 250 -error 10
+   -ps 250 -error_rate 10
 
 fate-vsynth%-mpeg4-nr:   ENCOPTS = -qscale 8 -flags +mv4 -mbd rd -nr 
200
 
-- 
2.1.2

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


Re: [FFmpeg-devel] [PATCH] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread Clément Bœsch
On Mon, Aug 17, 2015 at 04:56:10PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 2:26 PM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 12:00:21PM -0400, Ronald S. Bultje wrote:
> > [...]
> > > diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c
> > > index 47630ad..a56b163 100644
> > > --- a/libavfilter/vsrc_life.c
> > > +++ b/libavfilter/vsrc_life.c
> > > @@ -334,7 +334,7 @@ static void evolve(AVFilterContext *ctx)
> > >  if (alive) *newbuf = ALIVE_CELL; // new cell is alive
> > >  else if (cell) *newbuf = cell - 1;   // new cell is dead
> > and in the process of mold
> > >  else   *newbuf = 0;  // new cell is
> > definitely dead
> > > -av_dlog(ctx, "i:%d j:%d live_neighbors:%d cell:%d ->
> > cell:%d\n", i, j, n, cell, *newbuf);
> > > +av_log(ctx, AV_LOG_TRACE, "i:%d j:%d live_neighbors:%d
> > cell:%d -> cell:%d\n", i, j, n, cell, *newbuf);
> > >  newbuf++;
> >
> > this is called per pixel so ff_tlog() might be better to avoid
> > overhead from the call
> 
> 
> Oh I hadn't seen that. ff_tlog seems somewhat useless because it doesn't
> assure it keeps compiling, but ff_dlog seems pretty useful and fits the
> same scope of av_dlog, so I'll use that instead...

You can't use it outside ouf libavcodec (or its dependencies, which
libavfilter isn't part of).

[...]

-- 
Clément B.


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


Re: [FFmpeg-devel] [PATCH] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 5:00 PM, Clément Bœsch  wrote:

> On Mon, Aug 17, 2015 at 04:56:10PM -0400, Ronald S. Bultje wrote:
> > Hi,
> >
> > On Mon, Aug 17, 2015 at 2:26 PM, Michael Niedermayer
>  > > wrote:
> >
> > > On Mon, Aug 17, 2015 at 12:00:21PM -0400, Ronald S. Bultje wrote:
> > > [...]
> > > > diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c
> > > > index 47630ad..a56b163 100644
> > > > --- a/libavfilter/vsrc_life.c
> > > > +++ b/libavfilter/vsrc_life.c
> > > > @@ -334,7 +334,7 @@ static void evolve(AVFilterContext *ctx)
> > > >  if (alive) *newbuf = ALIVE_CELL; // new cell is
> alive
> > > >  else if (cell) *newbuf = cell - 1;   // new cell is dead
> > > and in the process of mold
> > > >  else   *newbuf = 0;  // new cell is
> > > definitely dead
> > > > -av_dlog(ctx, "i:%d j:%d live_neighbors:%d cell:%d ->
> > > cell:%d\n", i, j, n, cell, *newbuf);
> > > > +av_log(ctx, AV_LOG_TRACE, "i:%d j:%d live_neighbors:%d
> > > cell:%d -> cell:%d\n", i, j, n, cell, *newbuf);
> > > >  newbuf++;
> > >
> > > this is called per pixel so ff_tlog() might be better to avoid
> > > overhead from the call
> >
> >
> > Oh I hadn't seen that. ff_tlog seems somewhat useless because it doesn't
> > assure it keeps compiling, but ff_dlog seems pretty useful and fits the
> > same scope of av_dlog, so I'll use that instead...
>
> You can't use it outside ouf libavcodec (or its dependencies, which
> libavfilter isn't part of).


I can move it to lavu/internal.h, right? Or is that bad taste?

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


Re: [FFmpeg-devel] [PATCH] Replace all av_dlog() with av_log(AV_LOG_TRACE).

2015-08-17 Thread Clément Bœsch
On Mon, Aug 17, 2015 at 05:01:10PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 5:00 PM, Clément Bœsch  wrote:
> 
> > On Mon, Aug 17, 2015 at 04:56:10PM -0400, Ronald S. Bultje wrote:
> > > Hi,
> > >
> > > On Mon, Aug 17, 2015 at 2:26 PM, Michael Niedermayer
> >  > > > wrote:
> > >
> > > > On Mon, Aug 17, 2015 at 12:00:21PM -0400, Ronald S. Bultje wrote:
> > > > [...]
> > > > > diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c
> > > > > index 47630ad..a56b163 100644
> > > > > --- a/libavfilter/vsrc_life.c
> > > > > +++ b/libavfilter/vsrc_life.c
> > > > > @@ -334,7 +334,7 @@ static void evolve(AVFilterContext *ctx)
> > > > >  if (alive) *newbuf = ALIVE_CELL; // new cell is
> > alive
> > > > >  else if (cell) *newbuf = cell - 1;   // new cell is dead
> > > > and in the process of mold
> > > > >  else   *newbuf = 0;  // new cell is
> > > > definitely dead
> > > > > -av_dlog(ctx, "i:%d j:%d live_neighbors:%d cell:%d ->
> > > > cell:%d\n", i, j, n, cell, *newbuf);
> > > > > +av_log(ctx, AV_LOG_TRACE, "i:%d j:%d live_neighbors:%d
> > > > cell:%d -> cell:%d\n", i, j, n, cell, *newbuf);
> > > > >  newbuf++;
> > > >
> > > > this is called per pixel so ff_tlog() might be better to avoid
> > > > overhead from the call
> > >
> > >
> > > Oh I hadn't seen that. ff_tlog seems somewhat useless because it doesn't
> > > assure it keeps compiling, but ff_dlog seems pretty useful and fits the
> > > same scope of av_dlog, so I'll use that instead...
> >
> > You can't use it outside ouf libavcodec (or its dependencies, which
> > libavfilter isn't part of).
> 
> 
> I can move it to lavu/internal.h, right? Or is that bad taste?
> 

fine with me; i believe it's better than this trace thing.

-- 
Clément B.


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


[FFmpeg-devel] [PATCH 1/3] lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/error_resilience.c |  2 ++
 libavcodec/h263dec.c  |  2 ++
 libavcodec/h264.c |  4 
 libavcodec/h264_picture.c |  4 
 libavcodec/h264_slice.c   | 16 
 libavcodec/mpeg12dec.c| 20 +---
 libavcodec/mpegpicture.c  |  6 +-
 libavcodec/mpegvideo.c| 11 +--
 libavcodec/utils.c|  2 ++
 libavcodec/vc1dec.c   | 28 +---
 10 files changed, 78 insertions(+), 17 deletions(-)

diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index b3b46d1..2c741a4 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -777,7 +777,9 @@ void ff_er_frame_start(ERContext *s)
 static int er_supported(ERContext *s)
 {
 if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice   ||
+#if FF_API_CAP_VDPAU
s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU  ||
+#endif
!s->cur_pic.f  ||
s->cur_pic.field_picture
 )
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index 7fa7090..8f28a94 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -603,10 +603,12 @@ retry:
 if (!s->divx_packed && !avctx->hwaccel)
 ff_thread_finish_setup(avctx);
 
+#if FF_API_CAP_VDPAU
 if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & 
AV_CODEC_CAP_HWACCEL_VDPAU)) {
 ff_vdpau_mpeg4_decode_picture(avctx->priv_data, s->gb.buffer, 
s->gb.buffer_end - s->gb.buffer);
 goto frame_end;
 }
+#endif
 
 if (avctx->hwaccel) {
 ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer,
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8b575be..24e209c 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1561,9 +1561,11 @@ again:
 if (h->avctx->hwaccel &&
 (ret = h->avctx->hwaccel->start_frame(h->avctx, buf, 
buf_size)) < 0)
 goto end;
+#if FF_API_CAP_VDPAU
 if (CONFIG_H264_VDPAU_DECODER &&
 h->avctx->codec->capabilities & 
AV_CODEC_CAP_HWACCEL_VDPAU)
 ff_vdpau_h264_picture_start(h);
+#endif
 }
 
 if (sl->redundant_pic_count == 0) {
@@ -1573,6 +1575,7 @@ again:
consumed);
 if (ret < 0)
 goto end;
+#if FF_API_CAP_VDPAU
 } else if (CONFIG_H264_VDPAU_DECODER &&
h->avctx->codec->capabilities & 
AV_CODEC_CAP_HWACCEL_VDPAU) {
 ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
@@ -1581,6 +1584,7 @@ again:
 ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
 &buf[buf_index - consumed],
 consumed);
+#endif
 } else
 context_count++;
 }
diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c
index 81d90d7..289c4be 100644
--- a/libavcodec/h264_picture.c
+++ b/libavcodec/h264_picture.c
@@ -157,9 +157,11 @@ int ff_h264_field_end(H264Context *h, H264SliceContext 
*sl, int in_setup)
 int err = 0;
 h->mb_y = 0;
 
+#if FF_API_CAP_VDPAU
 if (CONFIG_H264_VDPAU_DECODER &&
 h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
 ff_vdpau_h264_set_reference_frames(h);
+#endif
 
 if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
 if (!h->droppable) {
@@ -177,9 +179,11 @@ int ff_h264_field_end(H264Context *h, H264SliceContext 
*sl, int in_setup)
"hardware accelerator failed to decode picture\n");
 }
 
+#if FF_API_CAP_VDPAU
 if (CONFIG_H264_VDPAU_DECODER &&
 h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
 ff_vdpau_h264_picture_complete(h);
+#endif
 
 #if CONFIG_ERROR_RESILIENCE
 av_assert0(sl == h->slice_ctx);
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index b088392..25034f7 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -612,8 +612,11 @@ static int h264_frame_start(H264Context *h)
 
 if ((ret = alloc_picture(h, pic)) < 0)
 return ret;
-if(!h->frame_recovered && !h->avctx->hwaccel &&
-   !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU))
+if(!h->frame_recovered && !h->avctx->hwaccel
+#if FF_API_CAP_VDPAU
+   && !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+   )
 avpriv_color_frame(pic->f, c);
 
 h->cur_pic_ptr = pic;
@@ -1048,6 +1051,7 @@ static int h264_slice_header_init(H264Context *h)
 goto fail;
 }
 
+#if FF_API_CAP_VDPAU
 if (h->avctx->codec &&
 h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU &&
   

[FFmpeg-devel] [PATCH 2/3] lavc: move vdpau decoders under FF_API_VDPAU.

2015-08-17 Thread Ronald S. Bultje
From: wm4 

Signed-off-by: Ronald S. Bultje 
---
 libavcodec/allcodecs.c | 10 ++
 libavcodec/h264.c  |  2 +-
 libavcodec/mpeg12dec.c |  8 
 libavcodec/mpeg4videodec.c |  2 +-
 libavcodec/vc1dec.c|  4 ++--
 libavcodec/vdpau.c |  8 
 6 files changed, 22 insertions(+), 12 deletions(-)

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index ed0975e..3a8ea86 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -190,7 +190,9 @@ void avcodec_register_all(void)
 REGISTER_DECODER(H264_MMAL, h264_mmal);
 REGISTER_DECODER(H264_QSV,  h264_qsv);
 REGISTER_DECODER(H264_VDA,  h264_vda);
+#if FF_API_VDPAU
 REGISTER_DECODER(H264_VDPAU,h264_vdpau);
+#endif
 REGISTER_ENCDEC (HAP,   hap);
 REGISTER_DECODER(HEVC,  hevc);
 REGISTER_DECODER(HEVC_QSV,  hevc_qsv);
@@ -227,10 +229,14 @@ void avcodec_register_all(void)
 REGISTER_ENCDEC (MPEG2VIDEO,mpeg2video);
 REGISTER_ENCDEC (MPEG4, mpeg4);
 REGISTER_DECODER(MPEG4_CRYSTALHD,   mpeg4_crystalhd);
+#if FF_API_VDPAU
 REGISTER_DECODER(MPEG4_VDPAU,   mpeg4_vdpau);
+#endif
 REGISTER_DECODER(MPEGVIDEO, mpegvideo);
+#if FF_API_VDPAU
 REGISTER_DECODER(MPEG_VDPAU,mpeg_vdpau);
 REGISTER_DECODER(MPEG1_VDPAU,   mpeg1_vdpau);
+#endif
 REGISTER_DECODER(MPEG2_CRYSTALHD,   mpeg2_crystalhd);
 REGISTER_DECODER(MPEG2_QSV, mpeg2_qsv);
 REGISTER_DECODER(MSA1,  msa1);
@@ -311,7 +317,9 @@ void avcodec_register_all(void)
 REGISTER_DECODER(VBLE,  vble);
 REGISTER_DECODER(VC1,   vc1);
 REGISTER_DECODER(VC1_CRYSTALHD, vc1_crystalhd);
+#if FF_API_VDPAU
 REGISTER_DECODER(VC1_VDPAU, vc1_vdpau);
+#endif
 REGISTER_DECODER(VC1IMAGE,  vc1image);
 REGISTER_DECODER(VC1_QSV,   vc1_qsv);
 REGISTER_DECODER(VCR1,  vcr1);
@@ -331,7 +339,9 @@ void avcodec_register_all(void)
 REGISTER_ENCDEC (WMV2,  wmv2);
 REGISTER_DECODER(WMV3,  wmv3);
 REGISTER_DECODER(WMV3_CRYSTALHD,wmv3_crystalhd);
+#if FF_API_VDPAU
 REGISTER_DECODER(WMV3_VDPAU,wmv3_vdpau);
+#endif
 REGISTER_DECODER(WMV3IMAGE, wmv3image);
 REGISTER_DECODER(WNV1,  wnv1);
 REGISTER_DECODER(XAN_WC3,   xan_wc3);
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 24e209c..4cdbf62 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1995,7 +1995,7 @@ AVCodec ff_h264_decoder = {
 .priv_class= &h264_class,
 };
 
-#if CONFIG_H264_VDPAU_DECODER
+#if CONFIG_H264_VDPAU_DECODER && FF_API_VDPAU
 static const AVClass h264_vdpau_class = {
 .class_name = "H264 VDPAU Decoder",
 .item_name  = av_default_item_name,
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index 983c4c0..f9e7336 100644
--- a/libavcodec/mpeg12dec.c
+++ b/libavcodec/mpeg12dec.c
@@ -1186,7 +1186,7 @@ static const enum AVPixelFormat 
mpeg1_hwaccel_pixfmt_list_420[] = {
 #if CONFIG_MPEG1_XVMC_HWACCEL
 AV_PIX_FMT_XVMC,
 #endif
-#if CONFIG_MPEG1_VDPAU_DECODER
+#if CONFIG_MPEG1_VDPAU_DECODER && FF_API_VDPAU
 AV_PIX_FMT_VDPAU_MPEG1,
 #endif
 #if CONFIG_MPEG1_VDPAU_HWACCEL
@@ -1200,7 +1200,7 @@ static const enum AVPixelFormat 
mpeg2_hwaccel_pixfmt_list_420[] = {
 #if CONFIG_MPEG2_XVMC_HWACCEL
 AV_PIX_FMT_XVMC,
 #endif
-#if CONFIG_MPEG_VDPAU_DECODER
+#if CONFIG_MPEG_VDPAU_DECODER && FF_API_VDPAU
 AV_PIX_FMT_VDPAU_MPEG2,
 #endif
 #if CONFIG_MPEG2_VDPAU_HWACCEL
@@ -2942,7 +2942,7 @@ AVCodec ff_mpeg_xvmc_decoder = {
 #endif
 #endif /* FF_API_XVMC */
 
-#if CONFIG_MPEG_VDPAU_DECODER
+#if CONFIG_MPEG_VDPAU_DECODER && FF_API_VDPAU
 AVCodec ff_mpeg_vdpau_decoder = {
 .name   = "mpegvideo_vdpau",
 .long_name  = NULL_IF_CONFIG_SMALL("MPEG-1/2 video (VDPAU 
acceleration)"),
@@ -2958,7 +2958,7 @@ AVCodec ff_mpeg_vdpau_decoder = {
 };
 #endif
 
-#if CONFIG_MPEG1_VDPAU_DECODER
+#if CONFIG_MPEG1_VDPAU_DECODER && FF_API_VDPAU
 AVCodec ff_mpeg1_vdpau_decoder = {
 .name   = "mpeg1video_vdpau",
 .long_name  = NULL_IF_CONFIG_SMALL("MPEG-1 video (VDPAU 
acceleration)"),
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 7e4f9a2..5a00bac 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2790,7 +2790,7 @@ AVCodec ff_mpeg4_decoder = {
 };
 
 
-#if CONFIG_MPEG4_VDPAU_DECODER
+#if CONFIG_MPEG4_VDPAU_DECODER && FF_API_VDPAU
 static const AVClass mpeg4_vdpau_class = {
 "MPEG4 Video VDPAU Decoder",
 av_default_item_name,
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index e85daef..7bb7756 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -1134,7 +1134,7 @@ AVCodec ff_wmv3_decoder = {
 };
 #endif
 
-#if CONFIG_WMV3_VDPAU_DECODER
+#if CONFIG_WMV3_VDPAU_DECODER && FF_API_VDPAU
 AVCodec ff_wmv3_vdpau_decoder = {
 .name 

[FFmpeg-devel] [PATCH 3/3] lavu: comment out wrong value check in get_version() after api bump.

2015-08-17 Thread Ronald S. Bultje
---
 libavutil/utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavutil/utils.c b/libavutil/utils.c
index 2e3b1e0..e337c83 100644
--- a/libavutil/utils.c
+++ b/libavutil/utils.c
@@ -41,7 +41,9 @@ unsigned avutil_version(void)
 if (checks_done)
 return LIBAVUTIL_VERSION_INT;
 
+#if FF_API_VDPAU
 av_assert0(AV_PIX_FMT_VDA_VLD == 81); //check if the pix fmt enum has not 
had anything inserted or removed by mistake
+#endif
 av_assert0(AV_SAMPLE_FMT_DBLP == 9);
 av_assert0(AVMEDIA_TYPE_ATTACHMENT == 4);
 av_assert0(AV_PICTURE_TYPE_BI == 7);
-- 
2.1.2

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


[FFmpeg-devel] [PATCH] libvpxenc: make flags i64 instead of dbl.

2015-08-17 Thread Ronald S. Bultje
---
 libavcodec/libvpxenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
index 58e8f5d..5f39783 100644
--- a/libavcodec/libvpxenc.c
+++ b/libavcodec/libvpxenc.c
@@ -986,8 +986,8 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket *pkt,
 {"speed", "", offsetof(VP8Context, cpu_used), AV_OPT_TYPE_INT, {.i64 = 1}, 
-16, 16, VE}, \
 {"quality", "", offsetof(VP8Context, deadline), AV_OPT_TYPE_INT, {.i64 = 
VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, \
 {"vp8flags", "", offsetof(VP8Context, flags), AV_OPT_TYPE_FLAGS, {.i64 = 
0}, 0, UINT_MAX, VE, "flags"}, \
-{"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, {.dbl 
= VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
-{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
0, AV_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
"flags"}, \
+{"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, {.i64 
= VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
+{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
0, AV_OPT_TYPE_CONST, {.i64 = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
"flags"}, \
 {"arnr_max_frames", "altref noise reduction max frame count", 
offsetof(VP8Context, arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 15, VE}, 
\
 {"arnr_strength", "altref noise reduction filter strength", 
offsetof(VP8Context, arnr_strength), AV_OPT_TYPE_INT, {.i64 = 3}, 0, 6, VE}, \
 {"arnr_type", "altref noise reduction filter type", offsetof(VP8Context, 
arnr_type), AV_OPT_TYPE_INT, {.i64 = 3}, 1, 3, VE}, \
-- 
2.1.2

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


Re: [FFmpeg-devel] [PATCH 2/2] Comment out last use of FF_DEBUG_GENPTS.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 03:41:04PM -0400, Ronald S. Bultje wrote:
> ---
>  libavcodec/mpeg4videodec.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
> index 55ce5d8..d716626 100644
> --- a/libavcodec/mpeg4videodec.c
> +++ b/libavcodec/mpeg4videodec.c
> @@ -2320,9 +2320,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx, 
> GetBitContext *gb)
>  pts = ROUNDED_DIV(s->time, s->avctx->framerate.den);
>  else
>  pts = AV_NOPTS_VALUE;
> -if (s->avctx->debug&FF_DEBUG_PTS)
> -av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n",
> -   pts);
> +//av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n", pts);

subj: [FFmpeg-devel] [PATCH 2/2] Comment out last use of FF_DEBUG_GENPTS.
  ^^^
typo

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

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data


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


Re: [FFmpeg-devel] [PATCH] lavc/ffmpeg: put FF_API_DEBUG_MV around remaining uses of FF_DEBUG_VIS_QP/MB_TYPE.

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 09:13:58 -0400
"Ronald S. Bultje"  wrote:

> Hi,
> 
> On Mon, Aug 17, 2015 at 8:44 AM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 08:01:56AM -0400, Ronald S. Bultje wrote:
> > > ---
> > >  ffmpeg.c   | 6 +-
> > >  libavcodec/mpegvideo.c | 4 
> > >  libavcodec/options_table.h | 2 ++
> > >  libavcodec/pthread_frame.c | 2 ++
> > >  4 files changed, 13 insertions(+), 1 deletion(-)
> >
> > please also remove me from maintainers from the affected codecs
> > in case this code gets actually removed or disabled before a
> > documented replacement is in place
> >
> > i use these for maintaining and testing the code
> 
> 
> (I expected this sort of reply,) so why is it under a deprecation macro?
> 
> Why hasn't anyone taken the time to write a filter that places these things
> on top of a frame, so it could be shared with other codecs that export the
> same information?
> 
> Why is all this stuff so utterly hacky?

Because features were added without proper design and without thinking
whether certain features were really worth making the codebase more
complicated. And now we have to deal with this...
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] Comment out last use of FF_DEBUG_GENPTS.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 5:17 PM, Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 03:41:04PM -0400, Ronald S. Bultje wrote:
> > ---
> >  libavcodec/mpeg4videodec.c | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
> > index 55ce5d8..d716626 100644
> > --- a/libavcodec/mpeg4videodec.c
> > +++ b/libavcodec/mpeg4videodec.c
> > @@ -2320,9 +2320,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx,
> GetBitContext *gb)
> >  pts = ROUNDED_DIV(s->time, s->avctx->framerate.den);
> >  else
> >  pts = AV_NOPTS_VALUE;
> > -if (s->avctx->debug&FF_DEBUG_PTS)
> > -av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n",
> > -   pts);
> > +//av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n", pts);
>
> subj: [FFmpeg-devel] [PATCH 2/2] Comment out last use of FF_DEBUG_GENPTS.
>   ^^^
> typo


Oh right.

So, now that I've discovered ff_dlog, how about I remove the if and make
this a ff_dlog()? Then at least it keeps existing.

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


Re: [FFmpeg-devel] [RFC]lavf/mpegtsenc: Allow muxing jpeg2000

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 17:10:44 +0200
Carl Eugen Hoyos  wrote:

> Hi!
> 
> John Högberg has no objections against this patch but I don't know 
> how to test (except with FFmpeg).
> 
> Please comment, Carl Eugen

Please make sure that it conforms to the standard.

FFmpeg eating it isn't good enough.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate: move -flags +mv0 -> -mpv_flags +mv0.

2015-08-17 Thread James Almer
On 17/08/15 5:09 PM, Ronald S. Bultje wrote:
> Fixes associated fate tests when FF_API_MV0=0.

fate-vsynth passes so LGTM

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


Re: [FFmpeg-devel] [PATCH 5/6] Put FF_API_OLD_AVOPTIONS under last use of av_opt_set_defaults2().

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 20:10:09 +0200
Michael Niedermayer  wrote:

> On Mon, Aug 17, 2015 at 01:44:43PM -0400, Ronald S. Bultje wrote:
> > Hi,
> > 
> > On Mon, Aug 17, 2015 at 1:35 PM, Michael Niedermayer  > > wrote:
> > 
> > > On Mon, Aug 17, 2015 at 11:52:18AM -0400, Ronald S. Bultje wrote:
> > > > ---
> > > >  libavcodec/options.c | 6 ++
> > > >  1 file changed, 6 insertions(+)
> > > >
> > > > diff --git a/libavcodec/options.c b/libavcodec/options.c
> > > > index 37f3792..ed4d826 100644
> > > > --- a/libavcodec/options.c
> > > > +++ b/libavcodec/options.c
> > > > @@ -91,7 +91,9 @@ static const AVClass av_codec_context_class = {
> > > >
> > > >  int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec
> > > *codec)
> > > >  {
> > > > +#if FF_API_OLD_AVOPTIONS
> > > >  int flags=0;
> > > > +#endif
> > > >  memset(s, 0, sizeof(AVCodecContext));
> > > >
> > > >  s->av_class = &av_codec_context_class;
> > > > @@ -102,6 +104,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s,
> > > const AVCodec *codec)
> > > >  s->codec_id = codec->id;
> > > >  }
> > > >
> > > > +#if FF_API_OLD_AVOPTIONS
> > > >  if(s->codec_type == AVMEDIA_TYPE_AUDIO)
> > > >  flags= AV_OPT_FLAG_AUDIO_PARAM;
> > > >  else if(s->codec_type == AVMEDIA_TYPE_VIDEO)
> > > > @@ -109,6 +112,9 @@ int avcodec_get_context_defaults3(AVCodecContext *s,
> > > const AVCodec *codec)
> > > >  else if(s->codec_type == AVMEDIA_TYPE_SUBTITLE)
> > > >  flags= AV_OPT_FLAG_SUBTITLE_PARAM;
> > > >  av_opt_set_defaults2(s, flags, flags);
> > > > +#else
> > > > +av_opt_set_defaults(s);
> > > > +#endif
> > >
> > > i would prefer to keep av_opt_set_defaults2()
> > > the avoption system marks options as being for video, for audio and
> > > or subtitles
> > > defaults can differ for video, audio and subtitles
> > 
> > 
> > So I'm open for this discussion, but this is a hugely obscure and limiting
> > way to do it. For example, why do we need "ab" for audio bit "b" for video?
> > Why aren't both called "b"? (And "ab" handled in ffmpeg.c.)
> > 
> > Why do we have this HUUGE AVCodecContext instead of several derived
> > structs that each are only for audio, only for video, only for subtitles,
> > etc., and each have their own media-type-specific options or
> > media-type-specific defaults for common options?
> > 

+1

> > What about codec-specific defaults? JPEG has higher bitrates than MPEG for
> > the same quality, for obvious reasons. It's easy to come up with other
> > examples. Does that work?
> 
> there are codec specific defaults, see AVCodecDefault
> 
> 
> > 
> > And then lastly, why was this marked as deprecated if you intended to keep
> > it?
> 
> the deprecation came in from a merge.
> I did not know what other changes would follow and
> probably saw no clear reason to change te deprecation back then

FFmpeg development. What the fuck.

Can we give BBB a bit of leeway to get this stuff done? Why does BBB
have to figure out this stuff?

We can smooth out the details later. You're welcome to send patches to
fix your favorite pet-peeves caused by the deprecation. (The
deprecation which you have accepted for YEARS, and even merged
yourself.)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 1/2] Prepare for removal of obsolete FF_IDCT_* members.

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 15:41:03 -0400
"Ronald S. Bultje"  wrote:

> ---
>  libavcodec/avcodec.h   | 2 --
>  libavcodec/avdct.c | 2 ++
>  libavcodec/options_table.h | 2 --
>  3 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> index 6b824d5..6f9b026 100644
> --- a/libavcodec/avcodec.h
> +++ b/libavcodec/avcodec.h
> @@ -2947,9 +2947,7 @@ typedef struct AVCodecContext {
>  int dct_algo;
>  #define FF_DCT_AUTO0
>  #define FF_DCT_FASTINT 1
> -#if FF_API_UNUSED_MEMBERS
>  #define FF_DCT_INT 2
> -#endif /* FF_API_UNUSED_MEMBERS */
>  #define FF_DCT_MMX 3
>  #define FF_DCT_ALTIVEC 5
>  #define FF_DCT_FAAN6
> diff --git a/libavcodec/avdct.c b/libavcodec/avdct.c
> index f92c691..3b622ba 100644
> --- a/libavcodec/avdct.c
> +++ b/libavcodec/avdct.c
> @@ -58,7 +58,9 @@ static const AVOption avdct_options[] = {
>  #if FF_API_ARCH_ALPHA
>  {"simplealpha", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 
> = FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"},
>  #endif
> +#if FF_API_UNUSED_MEMBERS
>  {"ipp", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = 
> FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
> +#endif
>  {"xvid", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = 
> FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
>  {"xvidmmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = 
> FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
>  {"faani", "floating point AAN IDCT (experimental / for debugging)", 0, 
> AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
> diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> index fd9c045..8dabb65 100644
> --- a/libavcodec/options_table.h
> +++ b/libavcodec/options_table.h
> @@ -203,9 +203,7 @@ static const AVOption avcodec_options[] = {
>  {"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT 
> }, 0, INT_MAX, V|E, "dct"},
>  {"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64 = 
> FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"},
>  {"fastint", "fast integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FASTINT }, 
> INT_MIN, INT_MAX, V|E, "dct"},
> -#if FF_API_UNUSED_MEMBERS
>  {"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_INT }, 
> INT_MIN, INT_MAX, V|E, "dct"},
> -#endif /* FF_API_UNUSED_MEMBERS */
>  {"mmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_MMX }, INT_MIN, INT_MAX, 
> V|E, "dct"},
>  {"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_ALTIVEC }, INT_MIN, 
> INT_MAX, V|E, "dct"},
>  {"faan", "floating point AAN DCT", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FAAN 
> }, INT_MIN, INT_MAX, V|E, "dct"},

I guess these weren't really unused, while "ipp" can go?
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] fate: add -fflags +bitexact in a few places.

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 15:47:29 -0400
"Ronald S. Bultje"  wrote:

> This improves results after FF_API_LAVF_BITEXACT=0. It still doesn't
> pass, because of mov rtphint track which I don't understand (yet).
> ---
>  tests/fate/ffmpeg.mak | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/fate/ffmpeg.mak b/tests/fate/ffmpeg.mak
> index 6af1081..551d8e7 100644
> --- a/tests/fate/ffmpeg.mak
> +++ b/tests/fate/ffmpeg.mak
> @@ -1,14 +1,14 @@
>  FATE_MAPCHAN-$(CONFIG_CHANNELMAP_FILTER) += fate-mapchan-6ch-extract-2
>  fate-mapchan-6ch-extract-2: tests/data/asynth-22050-6.wav
> -fate-mapchan-6ch-extract-2: CMD = ffmpeg -i 
> $(TARGET_PATH)/tests/data/asynth-22050-6.wav -map_channel 0.0.0 -flags 
> +bitexact -f wav md5: -map_channel 0.0.1 -flags +bitexact -f wav md5:
> +fate-mapchan-6ch-extract-2: CMD = ffmpeg -i 
> $(TARGET_PATH)/tests/data/asynth-22050-6.wav -map_channel 0.0.0 -fflags 
> +bitexact -f wav md5: -map_channel 0.0.1 -fflags +bitexact -f wav md5:
>  
>  FATE_MAPCHAN-$(CONFIG_CHANNELMAP_FILTER) += 
> fate-mapchan-6ch-extract-2-downmix-mono
>  fate-mapchan-6ch-extract-2-downmix-mono: tests/data/asynth-22050-6.wav
> -fate-mapchan-6ch-extract-2-downmix-mono: CMD = md5 -i 
> $(TARGET_PATH)/tests/data/asynth-22050-6.wav -map_channel 0.0.1 -map_channel 
> 0.0.0 -ac 1 -flags +bitexact -f wav
> +fate-mapchan-6ch-extract-2-downmix-mono: CMD = md5 -i 
> $(TARGET_PATH)/tests/data/asynth-22050-6.wav -map_channel 0.0.1 -map_channel 
> 0.0.0 -ac 1 -fflags +bitexact -f wav
>  
>  FATE_MAPCHAN-$(CONFIG_CHANNELMAP_FILTER) += fate-mapchan-silent-mono
>  fate-mapchan-silent-mono: tests/data/asynth-22050-1.wav
> -fate-mapchan-silent-mono: CMD = md5 -i 
> $(TARGET_PATH)/tests/data/asynth-22050-1.wav -map_channel -1 -map_channel 
> 0.0.0 -flags +bitexact -f wav
> +fate-mapchan-silent-mono: CMD = md5 -i 
> $(TARGET_PATH)/tests/data/asynth-22050-1.wav -map_channel -1 -map_channel 
> 0.0.0 -fflags +bitexact -f wav
>  
>  FATE_MAPCHAN = $(FATE_MAPCHAN-yes)
>  
> @@ -16,10 +16,10 @@ FATE_FFMPEG += $(FATE_MAPCHAN)
>  fate-mapchan: $(FATE_MAPCHAN)
>  
>  FATE_FFMPEG-$(CONFIG_COLOR_FILTER) += fate-ffmpeg-filter_complex
> -fate-ffmpeg-filter_complex: CMD = framecrc -filter_complex color=d=1:r=5
> +fate-ffmpeg-filter_complex: CMD = framecrc -filter_complex color=d=1:r=5 
> -fflags +bitexact
>  
>  FATE_FFMPEG-$(CONFIG_COLOR_FILTER) += fate-ffmpeg-lavfi
> -fate-ffmpeg-lavfi: CMD = framecrc -lavfi color=d=1:r=5
> +fate-ffmpeg-lavfi: CMD = framecrc -lavfi color=d=1:r=5 -fflags +bitexact
>  
>  FATE_SAMPLES_FFMPEG-$(CONFIG_RAWVIDEO_DEMUXER) += fate-force_key_frames
>  fate-force_key_frames: tests/data/vsynth_lena.yuv

Can't harm, LGTM.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] libvpxenc: make flags i64 instead of dbl.

2015-08-17 Thread wm4
On Mon, 17 Aug 2015 17:11:07 -0400
"Ronald S. Bultje"  wrote:

> ---
>  libavcodec/libvpxenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 58e8f5d..5f39783 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -986,8 +986,8 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  {"speed", "", offsetof(VP8Context, cpu_used), AV_OPT_TYPE_INT, {.i64 = 
> 1}, -16, 16, VE}, \
>  {"quality", "", offsetof(VP8Context, deadline), AV_OPT_TYPE_INT, {.i64 = 
> VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, \
>  {"vp8flags", "", offsetof(VP8Context, flags), AV_OPT_TYPE_FLAGS, {.i64 = 
> 0}, 0, UINT_MAX, VE, "flags"}, \
> -{"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, 
> {.dbl = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
> -{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
> 0, AV_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
> "flags"}, \
> +{"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, 
> {.i64 = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
> +{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
> 0, AV_OPT_TYPE_CONST, {.i64 = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
> "flags"}, \
>  {"arnr_max_frames", "altref noise reduction max frame count", 
> offsetof(VP8Context, arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 15, 
> VE}, \
>  {"arnr_strength", "altref noise reduction filter strength", 
> offsetof(VP8Context, arnr_strength), AV_OPT_TYPE_INT, {.i64 = 3}, 0, 6, VE}, \
>  {"arnr_type", "altref noise reduction filter type", offsetof(VP8Context, 
> arnr_type), AV_OPT_TYPE_INT, {.i64 = 3}, 1, 3, VE}, \

(how did this happen?)

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


Re: [FFmpeg-devel] [PATCH] libvpxenc: make flags i64 instead of dbl.

2015-08-17 Thread James Zern
On Mon, Aug 17, 2015 at 2:11 PM, Ronald S. Bultje  wrote:
> ---
>  libavcodec/libvpxenc.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

lgtm

> diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c
> index 58e8f5d..5f39783 100644
> --- a/libavcodec/libvpxenc.c
> +++ b/libavcodec/libvpxenc.c
> @@ -986,8 +986,8 @@ static int vp8_encode(AVCodecContext *avctx, AVPacket 
> *pkt,
>  {"speed", "", offsetof(VP8Context, cpu_used), AV_OPT_TYPE_INT, {.i64 = 
> 1}, -16, 16, VE}, \
>  {"quality", "", offsetof(VP8Context, deadline), AV_OPT_TYPE_INT, {.i64 = 
> VPX_DL_GOOD_QUALITY}, INT_MIN, INT_MAX, VE, "quality"}, \
>  {"vp8flags", "", offsetof(VP8Context, flags), AV_OPT_TYPE_FLAGS, {.i64 = 
> 0}, 0, UINT_MAX, VE, "flags"}, \
> -{"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, 
> {.dbl = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
> -{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
> 0, AV_OPT_TYPE_CONST, {.dbl = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
> "flags"}, \
> +{"error_resilient", "enable error resilience", 0, AV_OPT_TYPE_CONST, 
> {.i64 = VP8F_ERROR_RESILIENT}, INT_MIN, INT_MAX, VE, "flags"}, \
> +{"altref", "enable use of alternate reference frames (VP8/2-pass only)", 
> 0, AV_OPT_TYPE_CONST, {.i64 = VP8F_AUTO_ALT_REF}, INT_MIN, INT_MAX, VE, 
> "flags"}, \
>  {"arnr_max_frames", "altref noise reduction max frame count", 
> offsetof(VP8Context, arnr_max_frames), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 15, 
> VE}, \
>  {"arnr_strength", "altref noise reduction filter strength", 
> offsetof(VP8Context, arnr_strength), AV_OPT_TYPE_INT, {.i64 = 3}, 0, 6, VE}, \
>  {"arnr_type", "altref noise reduction filter type", offsetof(VP8Context, 
> arnr_type), AV_OPT_TYPE_INT, {.i64 = 3}, 1, 3, VE}, \
> --
> 2.1.2
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] Comment out last use of FF_DEBUG_GENPTS.

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 05:22:46PM -0400, Ronald S. Bultje wrote:
> Hi,
> 
> On Mon, Aug 17, 2015 at 5:17 PM, Michael Niedermayer  > wrote:
> 
> > On Mon, Aug 17, 2015 at 03:41:04PM -0400, Ronald S. Bultje wrote:
> > > ---
> > >  libavcodec/mpeg4videodec.c | 4 +---
> > >  1 file changed, 1 insertion(+), 3 deletions(-)
> > >
> > > diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
> > > index 55ce5d8..d716626 100644
> > > --- a/libavcodec/mpeg4videodec.c
> > > +++ b/libavcodec/mpeg4videodec.c
> > > @@ -2320,9 +2320,7 @@ static int decode_vop_header(Mpeg4DecContext *ctx,
> > GetBitContext *gb)
> > >  pts = ROUNDED_DIV(s->time, s->avctx->framerate.den);
> > >  else
> > >  pts = AV_NOPTS_VALUE;
> > > -if (s->avctx->debug&FF_DEBUG_PTS)
> > > -av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n",
> > > -   pts);
> > > +//av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %"PRId64"\n", pts);
> >
> > subj: [FFmpeg-devel] [PATCH 2/2] Comment out last use of FF_DEBUG_GENPTS.
> >   ^^^
> > typo
> 
> 
> Oh right.
> 
> So, now that I've discovered ff_dlog, how about I remove the if and make
> this a ff_dlog()? Then at least it keeps existing.

agree

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

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


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


Re: [FFmpeg-devel] [PATCH 4/6] fate: explicitly specify audio bitrate for adpcm/mp2fixed tests.

2015-08-17 Thread James Almer
On 17/08/15 12:52 PM, Ronald S. Bultje wrote:
> They picked up defaults, which changes from 128 to 200 when we remove
> FF_API_OLD_AVOPTIONS.
> ---
>  tests/fate/acodec.mak | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/fate/acodec.mak b/tests/fate/acodec.mak
> index c1e4c4e..4afc27a 100644
> --- a/tests/fate/acodec.mak
> +++ b/tests/fate/acodec.mak
> @@ -1,6 +1,6 @@
>  fate-acodec-%: CODEC = $(@:fate-acodec-%=%)
>  fate-acodec-%: SRC = tests/data/asynth-44100-2.wav
> -fate-acodec-%: CMD = enc_dec wav $(SRC) $(FMT) "-b 128k -c $(CODEC) 
> $(ENCOPTS)" wav "-c pcm_s16le $(DECOPTS)" -keep
> +fate-acodec-%: CMD = enc_dec wav $(SRC) $(FMT) "-b:a 128k -c $(CODEC) 
> $(ENCOPTS)" wav "-c pcm_s16le $(DECOPTS)" -keep
>  fate-acodec-%: CMP_UNIT = 2
>  fate-acodec-%: REF = $(SRC_PATH)/tests/ref/acodec/$(@:fate-acodec-%=%)
>  
> @@ -93,6 +93,7 @@ fate-acodec-mp2: ENCOPTS = -b:a 128k
>  FATE_ACODEC-$(call ENCDEC, MP2FIXED MP2 , MP2 MP3) += fate-acodec-mp2fixed
>  fate-acodec-mp2fixed: FMT = mp2
>  fate-acodec-mp2fixed: CMP_SHIFT = -1924
> +fate-acodec-mp2fixed: ENCOPTS = -b:a 384k
>  
>  FATE_ACODEC-$(call ENCDEC, ALAC, MOV) += fate-acodec-alac
>  fate-acodec-alac: FMT = mov
> 

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


Re: [FFmpeg-devel] [PATCH 1/2] Prepare for removal of obsolete FF_IDCT_* members.

2015-08-17 Thread Ronald S. Bultje
Hi,

On Mon, Aug 17, 2015 at 5:45 PM, wm4  wrote:

> On Mon, 17 Aug 2015 15:41:03 -0400
> "Ronald S. Bultje"  wrote:
>
> > ---
> >  libavcodec/avcodec.h   | 2 --
> >  libavcodec/avdct.c | 2 ++
> >  libavcodec/options_table.h | 2 --
> >  3 files changed, 2 insertions(+), 4 deletions(-)
> >
> > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
> > index 6b824d5..6f9b026 100644
> > --- a/libavcodec/avcodec.h
> > +++ b/libavcodec/avcodec.h
> > @@ -2947,9 +2947,7 @@ typedef struct AVCodecContext {
> >  int dct_algo;
> >  #define FF_DCT_AUTO0
> >  #define FF_DCT_FASTINT 1
> > -#if FF_API_UNUSED_MEMBERS
> >  #define FF_DCT_INT 2
> > -#endif /* FF_API_UNUSED_MEMBERS */
> >  #define FF_DCT_MMX 3
> >  #define FF_DCT_ALTIVEC 5
> >  #define FF_DCT_FAAN6
> > diff --git a/libavcodec/avdct.c b/libavcodec/avdct.c
> > index f92c691..3b622ba 100644
> > --- a/libavcodec/avdct.c
> > +++ b/libavcodec/avdct.c
> > @@ -58,7 +58,9 @@ static const AVOption avdct_options[] = {
> >  #if FF_API_ARCH_ALPHA
> >  {"simplealpha", "experimental / for debugging", 0, AV_OPT_TYPE_CONST,
> {.i64 = FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"},
> >  #endif
> > +#if FF_API_UNUSED_MEMBERS
> >  {"ipp", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 =
> FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
> > +#endif
> >  {"xvid", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 =
> FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
> >  {"xvidmmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64
> = FF_IDCT_XVID }, INT_MIN, INT_MAX, V|E|D, "idct"},
> >  {"faani", "floating point AAN IDCT (experimental / for debugging)", 0,
> AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
> > diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h
> > index fd9c045..8dabb65 100644
> > --- a/libavcodec/options_table.h
> > +++ b/libavcodec/options_table.h
> > @@ -203,9 +203,7 @@ static const AVOption avcodec_options[] = {
> >  {"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.i64 =
> DEFAULT }, 0, INT_MAX, V|E, "dct"},
> >  {"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64
> = FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"},
> >  {"fastint", "fast integer", 0, AV_OPT_TYPE_CONST, {.i64 =
> FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, "dct"},
> > -#if FF_API_UNUSED_MEMBERS
> >  {"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_INT },
> INT_MIN, INT_MAX, V|E, "dct"},
> > -#endif /* FF_API_UNUSED_MEMBERS */
> >  {"mmx", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_MMX }, INT_MIN,
> INT_MAX, V|E, "dct"},
> >  {"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_ALTIVEC },
> INT_MIN, INT_MAX, V|E, "dct"},
> >  {"faan", "floating point AAN DCT", 0, AV_OPT_TYPE_CONST, {.i64 =
> FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, "dct"},
>
> I guess these weren't really unused, while "ipp" can go?


Right, "int" is used in various fate tests and I can't be bothered to
figure out whether that's useful or not. "ipp" is unused except for the
mention in avdct.c, so removing that makes everyone happy.

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


[FFmpeg-devel] [PATCH] ffmpeg_opt: introduce compatibility -ab option.

2015-08-17 Thread Ronald S. Bultje
---
 ffmpeg_opt.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index e923a19..effeaf1 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -3328,6 +3328,10 @@ const OptionDef options[] = {
 "force data codec ('copy' to copy stream)", "codec" },
 { "dn", OPT_BOOL | OPT_VIDEO | OPT_OFFSET | OPT_INPUT | OPT_OUTPUT, { .off 
= OFFSET(data_disable) },
 "disable data" },
+#if !FF_API_OLD_AVOPTIONS
+{ "ab", OPT_AUDIO | HAS_ARG | OPT_OUTPUT, { .func_arg = 
opt_old2new },
+"set bitrate (in bits/s)" },
+#endif
 
 { NULL, },
 };
-- 
2.1.2

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


Re: [FFmpeg-devel] GSoC Weekly report (libswscale)

2015-08-17 Thread Michael Niedermayer
On Mon, Aug 17, 2015 at 05:35:32PM -0300, Pedro Arthur wrote:
> ops, added missing file.
> 
> 
> 2015-08-17 17:31 GMT-03:00 Pedro Arthur :
> 
> >
> >
> > 2015-08-17 0:19 GMT-03:00 Michael Niedermayer :
> >
> >> also feel free to split the batch addition into a seperate commit
> >> (should be easy as you already have a versionn with and without)
> >>
> > Attached proper patchs.
> >
> > also, please send me your public ssh key, i think you should have
> >> direct write access to ffmpeg git
> >>
> > I've sent it privately.
> >

applied patches

please add license headers to the new files
also please put variables which are just used by the old code
under #ifndef NEW_FILTER  or something so they do not produce warnings

the comments also could benefit from spellchecking but thats not
important ATM

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

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin


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


Re: [FFmpeg-devel] [PATCH] avfilter/vsrc_testsrc: correct colors for smptebars

2015-08-17 Thread Kieran Kunhya
On 10 August 2015 at 17:38, Paul B Mahol  wrote:
> On 8/9/15, Kieran Kunhya  wrote:
>> On 9 August 2015 at 12:20, Paul B Mahol  wrote:
>>> ---
>>>  libavfilter/vsrc_testsrc.c | 36 +++-
>>>  1 file changed, 23 insertions(+), 13 deletions(-)
>>
>> I'll test the SD version on the scope on Monday (cc'ing dericed who
>> can probably test HD)
>>
>
> Here is one with black and pludges changed too.

Not sure about HD but this is correct for SD. I think it should be committed.

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


[FFmpeg-devel] [PATCH] lavfi: add error message to help users convert to new lavfi syntax.

2015-08-17 Thread Ronald S. Bultje
---
 libavfilter/avfilter.c | 13 -
 libavfilter/version.h  |  3 +++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 7cc4334..4d833f0 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -895,7 +895,7 @@ int avfilter_init_str(AVFilterContext *filter, const char 
*args)
 return AVERROR(EINVAL);
 }
 
-#if FF_API_OLD_FILTER_OPTS
+#if FF_API_OLD_FILTER_OPTS || FF_API_OLD_FILTER_OPTS_ERROR
 if (   !strcmp(filter->filter->name, "format") ||
!strcmp(filter->filter->name, "noformat")   ||
!strcmp(filter->filter->name, "frei0r") ||
@@ -955,12 +955,23 @@ int avfilter_init_str(AVFilterContext *filter, const char 
*args)
 while ((p = strchr(p, ':')))
 *p++ = '|';
 
+#if FF_API_OLD_FILTER_OPTS
 if (deprecated)
 av_log(filter, AV_LOG_WARNING, "This syntax is deprecated. Use 
"
"'|' to separate the list items.\n");
 
 av_log(filter, AV_LOG_DEBUG, "compat: called with args=[%s]\n", 
copy);
 ret = process_options(filter, &options, copy);
+#else
+if (deprecated) {
+av_log(filter, AV_LOG_ERROR, "This syntax is deprecated. Use "
+   "'|' to separate the list items ('%s' instead of 
'%s')\n",
+   copy, args);
+ret = AVERROR(EINVAL);
+} else {
+ret = process_options(filter, &options, copy);
+}
+#endif
 av_freep(©);
 
 if (ret < 0)
diff --git a/libavfilter/version.h b/libavfilter/version.h
index 90a6dc0..6fc4145 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -61,6 +61,9 @@
 #ifndef FF_API_OLD_FILTER_OPTS
 #define FF_API_OLD_FILTER_OPTS  (LIBAVFILTER_VERSION_MAJOR < 6)
 #endif
+#ifndef FF_API_OLD_FILTER_OPTS_ERROR
+#define FF_API_OLD_FILTER_OPTS_ERROR(LIBAVFILTER_VERSION_MAJOR < 7)
+#endif
 #ifndef FF_API_AVFILTER_OPEN
 #define FF_API_AVFILTER_OPEN(LIBAVFILTER_VERSION_MAJOR < 6)
 #endif
-- 
2.1.2

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


  1   2   >