Re: [FFmpeg-devel] [RFC] libavfilter query_format() related functions error handling
On Sat, Mar 14, 2015 at 03:25:19PM +0100, Michael Niedermayer wrote: On Sat, Mar 14, 2015 at 03:11:28PM +0100, Clément Bœsch wrote: On Sat, Mar 14, 2015 at 01:33:12PM +0100, Nicolas George wrote: Le quartidi 24 ventôse, an CCXXIII, Michael Niedermayer a écrit : ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)); ff_set_common_samplerates(ctx, ff_all_samplerates()); What do you do about the 2nd argument being NULL by allocation error here? Should the ctx passed there too? there are many possibilities like returning a specific pointer to a struct indicating errors but passing ret may be more intuitive The more I look at this, the more I feel like I'm going to do the first solution, which will allow an incremental patching, and will be more obvious... -- Clément B. pgpW3L63hVYbZ.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] ac3_fixed: fix computation of spx_noise_blend
On 14.03.2015, at 12:48, Christophe Gisquet christophe.gisq...@gmail.com wrote: It was set to 1 instead of sqrt(3) --- libavcodec/ac3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index ce45186..ae4129f 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -939,7 +939,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) nblend = 0; sblend = 0x80; } else if (nratio 0x7f) { -nblend = 0x80; +nblend = 14529495; // sqrt(3) in FP.23 Wouldn't it be slightly more readable in hexadecimal still? Not that I expect anyone to recognize sqrt(3) either way, but sanity-checking the values (e.g. that it is somewhere between 1 and 1.5) seems much easier in hex. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/5] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
Hi, 2015-03-14 18:38 GMT+01:00 Michael Niedermayer michae...@gmx.at: static void ff_prores_idct_wrap(int16_t *dst){ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); int i; this seems to break build ffmpeg/libavcodec/dct-test.c: In function ‘ff_prores_idct_wrap’: ffmpeg/libavcodec/dct-test.c:69:28: error: expected expression before ‘static’ ffmpeg/libavcodec/dct-test.c:69:13: warning: unused variable ‘la_qmat’ Ok again, I never build dct-test. I guess the issue is the unneeded static (actually you've confirmed it in a later mail). So here's an updated patch. Best regards, Christophe ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] libavdevice/avfoundation: add capture_screen_cursor option
Matthieu Bouron matthieu.bouron at gmail.com writes: Both code blocks are already contained in the following blocks: #if !TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED = 1070 [...] #endif Do you still want the #if !TARGET_OS_IPHONE for consistency ? Not necessarily, sorry for the comment. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/5] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On Sat, Mar 14, 2015 at 07:58:29PM +0100, Christophe Gisquet wrote: Hi, 2015-03-14 19:07 GMT+01:00 Michael Niedermayer michae...@gmx.at: #define PR_WRAP(INSN) \ static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \ -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \ +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); \ +LOCAL_ALIGNED(16, static int16_t, tmp, [64]); \ int i; \ LOCAL_ALIGNED + static looks unintended Same fix then. Best regards, Christophe ac3dsp_init.c |2 +- cavsdsp.c |4 ++-- dct-test.c |4 ++-- h264_qpel.c| 22 +++--- rv40dsp_init.c |2 +- vc1dsp_mmx.c |2 +- vp8dsp_init.c |4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) d9bbc60366078bf5297a7c79aaf91d3ac3cc09d4 0002-x86-lavc-use-LOCAL_ALIGNED-instead-of-DECLARE_ALIGNE.patch From 93a8d803f6b87e2c5bd062724630e1d67804da29 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet christophe.gisq...@gmail.com Date: Sat, 14 Mar 2015 14:30:18 +0100 Subject: [PATCH 2/3] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED The later may yield incorrect code for on-stack variables. applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Breaking DRM is a little like attempting to break through a door even though the window is wide open and the only thing in the house is a bunch of things you dont want and which you would get tomorrow for free anyway signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/5] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On 14.03.2015, at 20:08, Christophe Gisquet christophe.gisq...@gmail.com wrote: 2015-03-14 20:06 GMT+01:00 Michael Niedermayer michae...@gmx.at: So here's an updated patch. yes, but not in the email ;) Crap, I prepared the mail in advance, but forgot to attach the patch after the fate run. I kind of object to making these changes combined. For the static variables the previous code was simply _correct_ in the alignment macro used. Now if we think these variables should not be static that is a different point, but that belongs in a different patch with a commit message that correctly describes what the patch actually does. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] libavformat/mxfenc: write user comment metadata
Hi, This patch enables writing of user comment metadata to mxf files. Any metadata key prefixed with comment_ will get written as a user comment. In avid media composer the value will show up in the bin in a column with the name of the key (minus the comment_ prefix ofcourse). The tag values are also written in utf16le to match the same behavour as avid. example usage: ffmpeg -y -f lavfi -i testsrc=size=1920x1080:rate=23.97 -frames:v 50 \ -metadata comment_example=value \ -vcodec dnxhd -pix_fmt yuv422p -vb 36M -f mxf_opatom out.mxf The tests needed to be update because of the new local tags added to the primer pack. Mark Reid (1): libavformat/mxfenc: write user comment metadata libavformat/mxfenc.c | 66 +-- tests/ref/lavf/mxf| 6 ++--- tests/ref/lavf/mxf_d10| 2 +- tests/ref/lavf/mxf_opatom | 2 +- 4 files changed, 69 insertions(+), 7 deletions(-) -- 2.2.1 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/5] ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On 14/03/15 10:05 PM, Michael Niedermayer wrote: On Sat, Mar 14, 2015 at 08:35:29PM -0300, James Almer wrote: On 14/03/15 3:18 PM, Michael Niedermayer wrote: On Sat, Mar 14, 2015 at 03:30:27PM +, Christophe Gisquet wrote: The later may yield incorrect code for on-stack variables. --- libavcodec/ppc/h264dsp.c| 10 - libavcodec/ppc/h264qpel.c | 50 - libavcodec/ppc/vp8dsp_altivec.c | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) applied thanks This apparently broke compilation for ppc. http://fate.ffmpeg.org/report.cgi?time=20150314231437slot=powerpc-linux-gnu-gcc-4.3.5 /home/fate/fate/slots/powerpc-linux-gnu-gcc-4.3.5/src/libavcodec/ppc/h264dsp.c:270: error: invalid parameter combination for AltiVec intrinsic argh, i tested this, but i had altivec disabled it seems It should use LOCAL_ALIGNED_16() rather than LOCAL_ALIGNED(16,...), which shows that whatever these LOCAL_ALIGNED_# macros do is needed, and the fifth patch in this set is not correct. LOCAL_ALIGNED_# does not work either, ill revert the patch thanks Ah, I see. I assumed it would since those macros are exclusively for x86 and ppc, thus explaining why they exist in the first place. I retract my comment about the fifth patch then. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/5] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
Hi, 2015-03-14 19:07 GMT+01:00 Michael Niedermayer michae...@gmx.at: #define PR_WRAP(INSN) \ static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \ -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \ +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); \ +LOCAL_ALIGNED(16, static int16_t, tmp, [64]); \ int i; \ LOCAL_ALIGNED + static looks unintended Same fix then. Best regards, Christophe From 93a8d803f6b87e2c5bd062724630e1d67804da29 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet christophe.gisq...@gmail.com Date: Sat, 14 Mar 2015 14:30:18 +0100 Subject: [PATCH 2/3] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED The later may yield incorrect code for on-stack variables. --- libavcodec/x86/ac3dsp_init.c | 2 +- libavcodec/x86/cavsdsp.c | 4 ++-- libavcodec/x86/dct-test.c | 4 ++-- libavcodec/x86/h264_qpel.c| 22 +++--- libavcodec/x86/rv40dsp_init.c | 2 +- libavcodec/x86/vc1dsp_mmx.c | 2 +- libavcodec/x86/vp8dsp_init.c | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c index 30a85f9..eea2736 100644 --- a/libavcodec/x86/ac3dsp_init.c +++ b/libavcodec/x86/ac3dsp_init.c @@ -165,7 +165,7 @@ static void ac3_downmix_sse(float **samples, float (*matrix)[2], matrix_cmp[3][0] == matrix_cmp[4][0]) { MIX5(IF1, IF0); } else { -DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4]; +LOCAL_ALIGNED(16, float, matrix_simd, [AC3_MAX_CHANNELS], [2][4]); float *samp[AC3_MAX_CHANNELS]; for (j = 0; j in_ch; j++) diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c index 190f6ee..f142db6 100644 --- a/libavcodec/x86/cavsdsp.c +++ b/libavcodec/x86/cavsdsp.c @@ -139,10 +139,10 @@ static inline void cavs_idct8_1d(int16_t *block, uint64_t bias) static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride) { int i; -DECLARE_ALIGNED(16, int16_t, b2)[64]; +LOCAL_ALIGNED(16, int16_t, b2, [64]); for(i=0; i2; i++){ -DECLARE_ALIGNED(8, uint64_t, tmp); +LOCAL_ALIGNED(8, uint64_t, tmp); cavs_idct8_1d(block+4*i, ff_pw_4.a); diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c index d1a5067..193a69e 100644 --- a/libavcodec/x86/dct-test.c +++ b/libavcodec/x86/dct-test.c @@ -28,8 +28,8 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, #define PR_WRAP(INSN) \ static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \ -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \ +LOCAL_ALIGNED(16, int16_t, qmat, [64]); \ +LOCAL_ALIGNED(16, int16_t, tmp, [64]); \ int i; \ \ for(i=0; i64; i++){ \ diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c index b4cb9b1..33a7fb0 100644 --- a/libavcodec/x86/h264_qpel.c +++ b/libavcodec/x86/h264_qpel.c @@ -282,7 +282,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, const uin #define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \ static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\ }\ @@ -294,7 +294,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, const uin \ static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\ }\ @@ -302,41 +302,41 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const uin #define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \ static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\ }\ \ static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\ ff_ ## OPNAME ##
Re: [FFmpeg-devel] [PATCH 1/4] libavdevice/avfoundation: add framerate and video size options
Matthieu Bouron matthieu.bouron at gmail.com writes: +for (NSObject *format in You may ignore this but I just changed the code to not mix declarations and statements to silence warnings when compiling with old gcc compilers... I don't have access to an older version of OSX which uses gcc. As said, this isn't so important but you can install old XCode on current OSX. I've updated the patch locally to separate declarations and statements. Thank you, Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH] avcodec/ac3dec: Fix undefined shifts
On Wed, Mar 11, 2015 at 04:21:26PM +0100, Michael Niedermayer wrote: Found-by: Clang -fsanitize=shift Reported-by: Thierry Foucu tfo...@google.com Signed-off-by: Michael Niedermayer michae...@gmx.at --- libavcodec/ac3dec.c |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) applied [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/5] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
2015-03-14 20:06 GMT+01:00 Michael Niedermayer michae...@gmx.at: So here's an updated patch. yes, but not in the email ;) Crap, I prepared the mail in advance, but forgot to attach the patch after the fate run. -- Christophe From 46f45c02767dcba473197c2b633e3de69385f371 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet christophe.gisq...@gmail.com Date: Sat, 14 Mar 2015 14:26:16 +0100 Subject: [PATCH 1/3] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED The later may yield incorrect code for on-stack variables. --- libavcodec/dct-test.c | 2 +- libavcodec/h264_loopfilter.c| 10 +- libavcodec/proresenc_anatoliy.c | 3 ++- libavcodec/vp8.c| 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 30eca3e..56e1a62 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -66,7 +66,7 @@ static const struct algo fdct_tab[] = { }; static void ff_prores_idct_wrap(int16_t *dst){ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; +LOCAL_ALIGNED(16, int16_t, qmat, [64]); int i; for(i=0; i64; i++){ diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c index a7b6878..c221f98 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -355,7 +355,7 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h, } return; } else { -LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]); +LOCAL_ALIGNED(8, int16_t, bS, [2], [4][4]); int edges; if( IS_8x8DCT(mb_type) (h-cbp7) == 7 !chroma444 ) { edges = 4; @@ -492,7 +492,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u int j; for(j=0; j2; j++, mbn_xy += h-mb_stride){ -DECLARE_ALIGNED(8, int16_t, bS)[4]; +LOCAL_ALIGNED(8, int16_t, bS, [4]); int qp; if (IS_INTRA(mb_type | h-cur_pic.mb_type[mbn_xy])) { AV_WN64A(bS, 0x0003000300030003ULL); @@ -529,7 +529,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u } } }else{ -DECLARE_ALIGNED(8, int16_t, bS)[4]; +LOCAL_ALIGNED(8, int16_t, bS, [4]); int qp; if( IS_INTRA(mb_type|mbm_type)) { @@ -612,7 +612,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u /* Calculate bS */ for( edge = 1; edge edges; edge++ ) { -DECLARE_ALIGNED(8, int16_t, bS)[4]; +LOCAL_ALIGNED(8, int16_t, bS, [4]); int qp; const int deblock_edge = !IS_8x8DCT(mb_type (edge24)); // (edge1) IS_8x8DCT(mb_type) @@ -719,7 +719,7 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint /* First vertical edge is different in MBAFF frames * There are 8 different bS to compute and 2 different Qp */ -DECLARE_ALIGNED(8, int16_t, bS)[8]; +LOCAL_ALIGNED(8, int16_t, bS, [8]); int qp[2]; int bqp[2]; int rqp[2]; diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 634ff08..bf6e671 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -286,7 +286,8 @@ static int encode_slice_plane(AVCodecContext *avctx, int mb_count, { ProresContext* ctx = avctx-priv_data; FDCTDSPContext *fdsp = ctx-fdsp; -DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH 8], *block; +LOCAL_ALIGNED(16, int16_t, blocks, [DEFAULT_SLICE_MB_WIDTH 8]); +int16_t *block; int i, blocks_per_slice; PutBitContext pb; diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 4b32347..8d6cbe1 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -1615,7 +1615,7 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], for (x = 0; x 4; x++) { int copy = 0, linesize = s-linesize; uint8_t *dst = ptr + 4 * x; -DECLARE_ALIGNED(4, uint8_t, copy_dst)[5 * 8]; +LOCAL_ALIGNED(4, uint8_t, copy_dst, [5 * 8]); if ((y == 0 || x == 3) mb_y == 0) { topright = tr_top; -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/5] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On Sat, Mar 14, 2015 at 07:57:19PM +0100, Christophe Gisquet wrote: Hi, 2015-03-14 18:38 GMT+01:00 Michael Niedermayer michae...@gmx.at: static void ff_prores_idct_wrap(int16_t *dst){ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); int i; this seems to break build ffmpeg/libavcodec/dct-test.c: In function ‘ff_prores_idct_wrap’: ffmpeg/libavcodec/dct-test.c:69:28: error: expected expression before ‘static’ ffmpeg/libavcodec/dct-test.c:69:13: warning: unused variable ‘la_qmat’ Ok again, I never build dct-test. I guess the issue is the unneeded static (actually you've confirmed it in a later mail). So here's an updated patch. yes, but not in the email ;) [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Those who are too smart to engage in politics are punished by being governed by those who are dumber. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/5] ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On Sat, Mar 14, 2015 at 08:35:29PM -0300, James Almer wrote: On 14/03/15 3:18 PM, Michael Niedermayer wrote: On Sat, Mar 14, 2015 at 03:30:27PM +, Christophe Gisquet wrote: The later may yield incorrect code for on-stack variables. --- libavcodec/ppc/h264dsp.c| 10 - libavcodec/ppc/h264qpel.c | 50 - libavcodec/ppc/vp8dsp_altivec.c | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) applied thanks This apparently broke compilation for ppc. http://fate.ffmpeg.org/report.cgi?time=20150314231437slot=powerpc-linux-gnu-gcc-4.3.5 /home/fate/fate/slots/powerpc-linux-gnu-gcc-4.3.5/src/libavcodec/ppc/h264dsp.c:270: error: invalid parameter combination for AltiVec intrinsic argh, i tested this, but i had altivec disabled it seems It should use LOCAL_ALIGNED_16() rather than LOCAL_ALIGNED(16,...), which shows that whatever these LOCAL_ALIGNED_# macros do is needed, and the fifth patch in this set is not correct. LOCAL_ALIGNED_# does not work either, ill revert the patch thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] avformat/mov: Disallow .. in dref unless use_absolute_path is set
as this kind of allows to circumvent it to some extend. We also could add a separate parameter or value to choose this Found-by: ramiro Signed-off-by: Michael Niedermayer michae...@gmx.at --- libavformat/mov.c |3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/mov.c b/libavformat/mov.c index 438cffb..de4004f 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2629,6 +2629,9 @@ static int mov_open_dref(AVIOContext **pb, const char *src, MOVDref *ref, av_strlcat(filename, ../, sizeof(filename)); av_strlcat(filename, ref-path + l + 1, sizeof(filename)); +if (!use_absolute_path) +if(strstr(ref-path + l + 1, ..) || ref-nlvl_from 1) +return AVERROR(ENOENT); if (strlen(filename) + 1 == sizeof(filename)) return AVERROR(ENOENT); -- 1.7.9.5 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2] libavformat/mxfdec: export user comments metadata
On Fri, Mar 13, 2015 at 06:58:38PM -0700, Mark Reid wrote: --- libavformat/mxf.h| 1 + libavformat/mxfdec.c | 94 +--- 2 files changed, 91 insertions(+), 4 deletions(-) applied, tomas seems to have approved the previous revision pretty much already thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Awnsering whenever a program halts or runs forever is On a turing machine, in general impossible (turings halting problem). On any real computer, always possible as a real computer has a finite number of states N, and will either halt in less than N cycles or never halt. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] store cookies returned in HLS key responses
Hello, Neulion has added Set-Cookie fields in the response headers of their HLS key files. Those cookie values must be echoed back in the next key request or authentication on the subsequent key will fail. This fix will exacerbate the existing bug where the cookie field of ffmpeg requests keeps getting larger (since cookies are append when they should be replaced). However, those streams will fail sooner without this fix. Also, I have a fix for that bug too, but I'll start with this. Thanks in advance! -- The mark of an immature man is that he wants to die nobly for a cause, while the mark of the mature man is that he wants to live humbly for one. --W. Stekel From 7f2db07b91407a970b99655da96c8c2532e2c1ad Mon Sep 17 00:00:00 2001 From: Micah Galizia micahgali...@gmail.com Date: Sun, 15 Mar 2015 09:31:59 +1100 Subject: [PATCH] store cookies returned in HLS key response --- libavformat/hls.c | 5 + 1 file changed, 5 insertions(+) diff --git a/libavformat/hls.c b/libavformat/hls.c index 5e8e1b2..5ed7a24 100644 --- a/libavformat/hls.c +++ b/libavformat/hls.c @@ -944,6 +944,11 @@ static int open_input(HLSContext *c, struct playlist *pls) av_log(NULL, AV_LOG_ERROR, Unable to read key file %s\n, seg-key); } +av_freep(c-cookies); +av_opt_get(uc-priv_data, cookies, 0, (uint8_t**)(c-cookies)); +if (c-cookies !strlen(c-cookies)) +av_freep(c-cookies); +av_dict_set(opts, cookies, c-cookies, 0); ffurl_close(uc); } else { av_log(NULL, AV_LOG_ERROR, Unable to open key file %s\n, -- 2.1.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/5] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On Sat, Mar 14, 2015 at 08:08:23PM +0100, Christophe Gisquet wrote: 2015-03-14 20:06 GMT+01:00 Michael Niedermayer michae...@gmx.at: So here's an updated patch. yes, but not in the email ;) Crap, I prepared the mail in advance, but forgot to attach the patch after the fate run. -- Christophe dct-test.c |2 +- h264_loopfilter.c| 10 +- proresenc_anatoliy.c |3 ++- vp8.c|2 +- 4 files changed, 9 insertions(+), 8 deletions(-) 51b59d296bf974e4e06d199ae39168b7f836b742 0001-lavc-use-LOCAL_ALIGNED-instead-of-DECLARE_ALIGNED.patch From 46f45c02767dcba473197c2b633e3de69385f371 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet christophe.gisq...@gmail.com Date: Sat, 14 Mar 2015 14:26:16 +0100 Subject: [PATCH 1/3] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED The later may yield incorrect code for on-stack variables. applied thanks #[...] -- 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
[FFmpeg-devel] [PATCH] avcodec/samidec: process more of the SAMI tags
Made some changes to samidec so that it can process SAMI tags. Processes B and FONT(font face, color). --- libavcodec/samidec.c | 37 +++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/libavcodec/samidec.c b/libavcodec/samidec.c index 47850e2..b47204d 100644 --- a/libavcodec/samidec.c +++ b/libavcodec/samidec.c @@ -25,6 +25,7 @@ */ #include ass.h +#include libavformat/subtitles.h #include libavutil/avstring.h #include libavutil/bprint.h @@ -77,13 +78,45 @@ static int sami_paragraph_to_ass(AVCodecContext *avctx, const char *src) goto end; } -/* extract the text, stripping most of the tags */ +/* extract the text, processing some of the tags */ while (*p) { +int bold = 0; if (*p == '') { -if (!av_strncasecmp(p, P, 2) (p[2] == '' || av_isspace(p[2]))) +if ( !av_strncasecmp(p, P, 2) + (p[2] == '' || av_isspace(p[2])) ) break; +if ( !av_strncasecmp(p, B, 2) + (p[2] == '' || av_isspace(p[2])) ) { +bold = 1; +av_bprintf(dst, {\\b1}); +} +if (!av_strncasecmp(p, /B, 4)) { +bold = 0; +av_bprintf(dst, {\\b0}); +} if (!av_strncasecmp(p, BR, 3)) av_bprintf(dst, \\N); +if (!av_strncasecmp(p, FONT, 5)) { +const char *p_color = ff_smil_get_attr_ptr(p, Color); +const char *p_face = ff_smil_get_attr_ptr(p, Face); +const char *p_face_end = p_face; + +if (p_color) { +/* ASS color code order is BGR, opposite to SAMI */ +av_bprintf(dst, {\\cH%.2s%.2s%.2s}, + p_color+4, p_color+2, p_color); +} +if (p_face) { +while (*p_face_end != '\' *p_face_end != ' ') +p_face_end++; +av_bprintf(dst, {\\fn%.*s}, + (int)(p_face_end - p_face), p_face); +} +} +if (!av_strncasecmp(p, /FONT, 7)) { +av_bprintf(dst, {\\r}); +if (bold) av_bprintf(dst, {\\b1}); +} p++; while (*p *p != '') p++; -- 2.3.2 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/5] ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On 14/03/15 3:18 PM, Michael Niedermayer wrote: On Sat, Mar 14, 2015 at 03:30:27PM +, Christophe Gisquet wrote: The later may yield incorrect code for on-stack variables. --- libavcodec/ppc/h264dsp.c| 10 - libavcodec/ppc/h264qpel.c | 50 - libavcodec/ppc/vp8dsp_altivec.c | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) applied thanks This apparently broke compilation for ppc. http://fate.ffmpeg.org/report.cgi?time=20150314231437slot=powerpc-linux-gnu-gcc-4.3.5 /home/fate/fate/slots/powerpc-linux-gnu-gcc-4.3.5/src/libavcodec/ppc/h264dsp.c:270: error: invalid parameter combination for AltiVec intrinsic It should use LOCAL_ALIGNED_16() rather than LOCAL_ALIGNED(16,...), which shows that whatever these LOCAL_ALIGNED_# macros do is needed, and the fifth patch in this set is not correct. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] libavdevice/avfoundation: add framerate and video size options
On Sat, Mar 14, 2015 at 8:31 AM, Carl Eugen Hoyos ceho...@ag.or.at wrote: matthieu.bouron at gmail.com writes: +for (NSObject *format in You may ignore this but I just changed the code to not mix declarations and statements to silence warnings when compiling with old gcc compilers... I don't have access to an older version of OSX which uses gcc. I've updated the patch locally to separate declarations and statements. +if (framerate == 0.0 Just asking: Does this really work? Nope it doesn't, it's just a glitch i forget to remove when i was not using the AV_OPT_TYPE_IMAGE_SIZE for the framerate option (and the value was defaulting to 0). I've removed it locally. Matthieu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] libavdevice/avfoundation: add framerate and video size options
On Sat, Mar 14, 2015 at 11:01 AM, Matthieu Bouron matthieu.bou...@gmail.com wrote: On Sat, Mar 14, 2015 at 8:31 AM, Carl Eugen Hoyos ceho...@ag.or.at wrote: matthieu.bouron at gmail.com writes: +for (NSObject *format in You may ignore this but I just changed the code to not mix declarations and statements to silence warnings when compiling with old gcc compilers... I don't have access to an older version of OSX which uses gcc. I've updated the patch locally to separate declarations and statements. +if (framerate == 0.0 Just asking: Does this really work? Nope it doesn't, it's just a glitch i forget to remove when i was not using the AV_OPT_TYPE_IMAGE_SIZE for the framerate option (and the value was defaulting to 0). I've removed it locally. New patch attached. 0001-libavdevice-avfoundation-add-framerate-and-video-siz.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] libavdevice/avfoundation: add framerate and video size options
matthieu.bouron at gmail.com writes: +for (NSObject *format in You may ignore this but I just changed the code to not mix declarations and statements to silence warnings when compiling with old gcc compilers... +if (framerate == 0.0 Just asking: Does this really work? Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/2] x86: dct-test: evaluate prores idct avx version
--- libavcodec/x86/dct-test.c | 39 ++- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c index 63a9aeb..d1a5067 100644 --- a/libavcodec/x86/dct-test.c +++ b/libavcodec/x86/dct-test.c @@ -26,21 +26,31 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, int16_t *block, int16_t *qmat); -static void ff_prores_idct_put_10_sse2_wrap(int16_t *dst){ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; -int i; +#define PR_WRAP(INSN) \ +static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \ +DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \ +DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \ +int i; \ + \ +for(i=0; i64; i++){ \ +qmat[i]=4; \ +tmp[i]= dst[i]; \ +} \ +ff_prores_idct_put_10_##INSN (dst, 16, tmp, qmat); \ + \ +for(i=0; i64; i++) { \ + dst[i] -= 512; \ +} \ +} -for(i=0; i64; i++){ -qmat[i]=4; -tmp[i]= dst[i]; -} -ff_prores_idct_put_10_sse2(dst, 16, tmp, qmat); +PR_WRAP(sse2) + +# if HAVE_AVX_EXTERNAL +void ff_prores_idct_put_10_avx(uint16_t *dst, int linesize, + int16_t *block, int16_t *qmat); +PR_WRAP(avx) +# endif -for(i=0; i64; i++) { - dst[i] -= 512; -} -} #endif static const struct algo fdct_tab_arch[] = { @@ -71,6 +81,9 @@ static const struct algo idct_tab_arch[] = { #endif /* CONFIG_MPEG4_DECODER HAVE_YASM */ #if (CONFIG_PRORES_DECODER || CONFIG_PRORES_LGPL_DECODER) ARCH_X86_64 HAVE_YASM { PR-SSE2, ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_SSE2, 1 }, +# if HAVE_AVX_EXTERNAL +{ PR-AVX, ff_prores_idct_put_10_avx_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_AVX, 1 }, +# endif #endif { 0 } }; -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 0/2] dct-test and prores
Some issues found while touching dct-test. Depends on the patch series (rather its first 2 patches, of which one was already applied) for XviD iDCTs. Christophe Gisquet (2): x86: dct-test: fix compilation for prores x86: dct-test: evaluate prores idct avx version libavcodec/x86/dct-test.c | 47 ++- 1 file changed, 30 insertions(+), 17 deletions(-) -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/2] x86: dct-test: fix compilation for prores
When the decoder is deactivated, the x86-optimized versions are not compiled, resulting in a link error. The C version is unaffected, as it is part of the idctdsp subsystem. --- libavcodec/x86/dct-test.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c index 3a4c0df..63a9aeb 100644 --- a/libavcodec/x86/dct-test.c +++ b/libavcodec/x86/dct-test.c @@ -22,7 +22,7 @@ #include xvididct.h #include simple_idct.h -#if ARCH_X86_64 HAVE_MMX HAVE_YASM +#if (CONFIG_PRORES_DECODER || CONFIG_PRORES_LGPL_DECODER) ARCH_X86_64 HAVE_YASM void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, int16_t *block, int16_t *qmat); @@ -67,11 +67,11 @@ static const struct algo idct_tab_arch[] = { #endif #if HAVE_SSE2_EXTERNAL { XVID-SSE2, ff_xvid_idct_sse2, FF_IDCT_PERM_SSE2, AV_CPU_FLAG_SSE2, 1 }, -#if ARCH_X86_64 -{ PR-SSE2, ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_SSE2, 1 }, -#endif #endif #endif /* CONFIG_MPEG4_DECODER HAVE_YASM */ +#if (CONFIG_PRORES_DECODER || CONFIG_PRORES_LGPL_DECODER) ARCH_X86_64 HAVE_YASM +{ PR-SSE2, ff_prores_idct_put_10_sse2_wrap, FF_IDCT_PERM_TRANSPOSE, AV_CPU_FLAG_SSE2, 1 }, +#endif { 0 } }; -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] libavdevice/avfoundation: add capture_screen_cursor option
On Sat, Mar 14, 2015 at 8:29 AM, Carl Eugen Hoyos ceho...@ag.or.at wrote: matthieu.bouron at gmail.com writes: +#if __MAC_OS_X_VERSION_MIN_REQUIRED = 1080 Please make this #if !TARGET_OS_IPHONE ... to avoid warnings when compiling for iOS. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Hello Carl, Both code blocks are already contained in the following blocks: #if !TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED = 1070 [...] #endif Do you still want the #if !TARGET_OS_IPHONE for consistency ? Matthieu ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] libavdevice/avfoundation: add capture_screen_cursor option
On Sat, Mar 14, 2015 at 10:50 AM, Matthieu Bouron matthieu.bou...@gmail.com wrote: On Sat, Mar 14, 2015 at 8:29 AM, Carl Eugen Hoyos ceho...@ag.or.at wrote: matthieu.bouron at gmail.com writes: +#if __MAC_OS_X_VERSION_MIN_REQUIRED = 1080 Please make this #if !TARGET_OS_IPHONE ... to avoid warnings when compiling for iOS. Carl Eugen ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel Hello Carl, Both code blocks are already contained in the following blocks: #if !TARGET_OS_IPHONE __MAC_OS_X_VERSION_MIN_REQUIRED = 1070 [...] #endif Do you still want the #if !TARGET_OS_IPHONE for consistency ? New patch attached with the #if !TARGET_OS_IPHONE condition. 0002-libavdevice-avfoundation-add-capture_screen_cursor-o.patch Description: Binary data ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC] libavfilter query_format() related functions error handling
Le quartidi 24 ventôse, an CCXXIII, Michael Niedermayer a écrit : ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)); ff_set_common_samplerates(ctx, ff_all_samplerates()); return ctx-ff_errno; I wanted to suggest something along this line too. Since the functions are private and can be changed, I suspect the error code would be better carried around in a value passed as argument. Regards, -- Nicolas George signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/2] x86: dct-test: fix compilation for prores
On Sat, Mar 14, 2015 at 07:57:42AM +, Christophe Gisquet wrote: When the decoder is deactivated, the x86-optimized versions are not compiled, resulting in a link error. The C version is unaffected, as it is part of the idctdsp subsystem. --- libavcodec/x86/dct-test.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB When you are offended at any man's fault, turn to yourself and study your own failings. Then you will forget your anger. -- Epictetus signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/2] x86: dct-test: evaluate prores idct avx version
On Sat, Mar 14, 2015 at 07:57:43AM +, Christophe Gisquet wrote: --- libavcodec/x86/dct-test.c | 39 ++- 1 file changed, 26 insertions(+), 13 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Frequently ignored answer#1 FFmpeg bugs should be sent to our bugtracker. User questions about the command line tools should be sent to the ffmpeg-user ML. And questions about how to use libav* should be sent to the libav-user ML. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/4] ac3_fixed: fix out-of-bound read
On Sat, Mar 14, 2015 at 11:48:57AM +, Christophe Gisquet wrote: Should also improve decoding, but actually doesn't... --- libavcodec/ac3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [RFC] libavfilter query_format() related functions error handling
Hi, I'm adding error handling in the following functions: ff_formats_ref() ff_channel_layouts_ref() ff_set_common_formats() ff_set_common_samplerates() ff_set_common_channel_layouts() (I may have forgotten some) So basically these functions would return AVERROR(ENOMEM) (or whatever else) in case of memory allocation. The problem I'm having is that query_formats() functions gets annoyingly verbose. I will take adelay filter as an example in the following. So this is a typical query_format() callback: static int query_formats(AVFilterContext *ctx) { AVFilterChannelLayouts *layouts; AVFilterFormats *formats; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); ff_set_common_channel_layouts(ctx, layouts); formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); ff_set_common_formats(ctx, formats); formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); ff_set_common_samplerates(ctx, formats); return 0; } It's already quite verbose, but with proper error handling, it would look like this: static int query_formats(AVFilterContext *ctx) { int ret; AVFilterChannelLayouts *layouts; AVFilterFormats *formats; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; layouts = ff_all_channel_layouts(); if (!layouts) return AVERROR(ENOMEM); ret = ff_set_common_channel_layouts(ctx, layouts); if (ret 0) return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); ret = ff_set_common_formats(ctx, formats); if (ret 0) return ret; formats = ff_all_samplerates(); if (!formats) return AVERROR(ENOMEM); ret = ff_set_common_samplerates(ctx, formats); if (ret 0) return ret; return 0; } This is generally one of the most straightforward query_formats(), so it's generally even more annoying. One alternative I had in mind was to make the ff_set_common_*() functions return AVERROR(ENOMEM) if the second argument was NULL. This would lead to something like this: static int query_formats(AVFilterContext *ctx) { int ret; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; ret = ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); if (ret 0) return ret; ret = ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)); if (ret 0) return ret; ret = ff_set_common_samplerates(ctx, ff_all_samplerates()); if (ret 0) return ret; return 0; } This sounds mostly OK, even though returning AVERROR(ENOMEM) in case of NULL is kind of hacky, since a NULL could be instead be used to signal accept everything: static int query_formats(AVFilterContext *ctx) { int ret; AVFilterFormats *formats; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; ret = ff_set_common_channel_layouts(ctx, NULL); if (ret 0) return ret; formats = ff_make_format_list(sample_fmts); if (!formats) return AVERROR(ENOMEM); ret = ff_set_common_formats(ctx, formats); if (ret 0) return ret; ret = ff_set_common_samplerates(ctx, NULL); if (ret 0) return ret; return 0; } Notice here that I needed to put back the formats check, because if it fails it would make the filter accepts every format instead of a limited list, causing many bugs or security issues. This last solution looked fine to me at first but it is unfortunately pretty dangerous, so I'd better not pick it. Last solution I had in mind was to just make the ff_set_common_*() functions not do anything if the argument is NULL (because of memory allocation failure in the creation of the list, or another bug), which would make the usage the same as the 3rd proposition: static int query_formats(AVFilterContext *ctx) { int ret; static
Re: [FFmpeg-devel] [PATCH 3/4] eac3dec: fix scaling
On Sat, Mar 14, 2015 at 11:48:59AM +, Christophe Gisquet wrote: This is the remaining error, the output on the SPX samples, respectively csi_miami_stereo_128_spx.eac3 and csi_miami_5.1_256_spx.eac3, goes from: stddev:8.71 PSNR: 77.52 MAXDIFF: 235 stddev:24270.51 PSNR: 22.17 MAXDIFF:47166 to: stddev:0.12 PSNR:114.12 MAXDIFF:1 stddev:0.12 PSNR:114.73 MAXDIFF:1 --- libavcodec/eac3dec.c | 2 ++ 1 file changed, 2 insertions(+) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Rewriting code that is poorly written but fully understood is good. Rewriting code that one doesnt understand is a sign that one is less smart then the original author, trying to rewrite it will not make it better. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] ac3_fixed: fix computation of spx_noise_blend
On Sat, Mar 14, 2015 at 11:48:58AM +, Christophe Gisquet wrote: It was set to 1 instead of sqrt(3) --- libavcodec/ac3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB What does censorship reveal? It reveals fear. -- Julian Assange signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/4] eac3dec: fix scaling
This is the remaining error, the output on the SPX samples, respectively csi_miami_stereo_128_spx.eac3 and csi_miami_5.1_256_spx.eac3, goes from: stddev:8.71 PSNR: 77.52 MAXDIFF: 235 stddev:24270.51 PSNR: 22.17 MAXDIFF:47166 to: stddev:0.12 PSNR:114.12 MAXDIFF:1 stddev:0.12 PSNR:114.73 MAXDIFF:1 --- libavcodec/eac3dec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/eac3dec.c b/libavcodec/eac3dec.c index cd2eec8d..ef815af 100644 --- a/libavcodec/eac3dec.c +++ b/libavcodec/eac3dec.c @@ -143,7 +143,9 @@ static void ff_eac3_apply_spectral_extension(AC3DecodeContext *s) float nscale = s-spx_noise_blend[ch][bnd] * rms_energy[bnd] * (1.0f / INT32_MIN); float sscale = s-spx_signal_blend[ch][bnd]; #if USE_FIXED +// spx_noise_blend and spx_signal_blend are both FP.23 nscale *= 1.0 / (123); +sscale *= 1.0 / (123); #endif for (i = 0; i s-spx_band_sizes[bnd]; i++) { float noise = nscale * (int32_t)av_lfg_get(s-dith_state); -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/4] ac3_fixed: fix computation of spx_noise_blend
It was set to 1 instead of sqrt(3) --- libavcodec/ac3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index ce45186..ae4129f 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -939,7 +939,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) nblend = 0; sblend = 0x80; } else if (nratio 0x7f) { -nblend = 0x80; +nblend = 14529495; // sqrt(3) in FP.23 sblend = 0; } else { nblend = fixed_sqrt(nratio, 23); -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 1/4] ac3_fixed: fix out-of-bound read
Should also improve decoding, but actually doesn't... --- libavcodec/ac3dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 2f78d73..ce45186 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -872,7 +872,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) start_subband += start_subband - 7; end_subband= get_bits(gbc, 3) + 5; #if USE_FIXED -s-spx_dst_end_freq = end_freq_inv_tab[end_subband]; +s-spx_dst_end_freq = end_freq_inv_tab[end_subband-5]; #endif if (end_subband7) end_subband += end_subband - 7; -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/4] ac3dec: cosmetics
--- libavcodec/ac3dec.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index ae4129f..ac53bdc 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -924,14 +924,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) bin = s-spx_src_start_freq; for (bnd = 0; bnd s-num_spx_bands; bnd++) { -int bandsize; +int bandsize = s-spx_band_sizes[bnd]; int spx_coord_exp, spx_coord_mant; INTFLOAT nratio, sblend, nblend; #if USE_FIXED -int64_t accu; /* calculate blending factors */ -bandsize = s-spx_band_sizes[bnd]; -accu = (int64_t)((bin 23) + (bandsize 22)) * s-spx_dst_end_freq; +int64_t accu = ((bin 23) + (bandsize 22)) + * (int64_t)s-spx_dst_end_freq; nratio = (int)(accu 32); nratio -= spx_blend 18; @@ -951,7 +950,6 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) float spx_coord; /* calculate blending factors */ -bandsize = s-spx_band_sizes[bnd]; nratio = ((float)((bin + (bandsize 1))) / s-spx_dst_end_freq) - spx_blend; nratio = av_clipf(nratio, 0.0f, 1.0f); nblend = sqrtf(3.0f * nratio); // noise is scaled by sqrt(3) -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 0/4] Further fixes to EAC3 FP decoder
The SPX blend factors were incorrectly computed. For now, still use floating point operations, with proper scaling, but the interested parties may want to write the proper FP.23 code. Christophe Gisquet (4): ac3_fixed: fix out-of-bound read ac3_fixed: fix computation of spx_noise_blend eac3dec: fix scaling ac3dec: cosmetics libavcodec/ac3dec.c | 12 +--- libavcodec/eac3dec.c | 2 ++ 2 files changed, 7 insertions(+), 7 deletions(-) -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/4] x86: xvid_idct: port MMX IDCT to yasm
On Thu, Mar 12, 2015 at 08:13:53PM +0100, Christophe Gisquet wrote: Hi, 2015-03-11 17:06 GMT+01:00 James Almer jamr...@gmail.com: As discussed before, mmx, mmxext and sse functions that have also an sse2 version, and 3dnow/3dnowext functions that have also an sse version, have no reason to exist in an x86_64 build. I think the reason may have been someone tinkering on some parts, and testing them, could still see he broke the MMX versions. On the other hand, that someone should really test on the appropriate platform, which is easy on x86. They will not be used in any real world scenario. Agreed, so I left the restriction. Patch updated because of the dct-test stuff. Incidentally, I found other issues with dct-test, but they are outside the scope of this patch series. -- Christophe b/libavcodec/x86/Makefile|1 b/libavcodec/x86/dct-test.c |8 b/libavcodec/x86/xvididct.asm| 450 +++ b/libavcodec/x86/xvididct_init.c | 40 ++ libavcodec/x86/xvididct_mmx.c| 549 --- 5 files changed, 484 insertions(+), 564 deletions(-) 9f7d1545c7d4b334ccf3dcf290d2787f98c72509 0002-x86-xvid_idct-port-MMX-iDCT-to-yasm.patch From 866b481ecab3369712ff854ce6c0857b875b50e6 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet christophe.gisq...@gmail.com Date: Tue, 10 Mar 2015 23:11:52 + Subject: [PATCH 2/4] x86: xvid_idct: port MMX iDCT to yasm Also reduce the table duplication with SSE2 code, remove duplicated macro parameters. --- libavcodec/x86/Makefile| 1 - libavcodec/x86/dct-test.c | 8 +- libavcodec/x86/xvididct.asm| 450 - libavcodec/x86/xvididct_init.c | 40 ++- libavcodec/x86/xvididct_mmx.c | 549 - 5 files changed, 484 insertions(+), 564 deletions(-) delete mode 100644 libavcodec/x86/xvididct_mmx.c applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Into a blind darkness they enter who follow after the Ignorance, they as if into a greater darkness enter who devote themselves to the Knowledge alone. -- Isha Upanishad signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC] libavfilter query_format() related functions error handling
On Sat, Mar 14, 2015 at 12:18:51PM +0100, Clément Bœsch wrote: Hi, I'm adding error handling in the following functions: ff_formats_ref() ff_channel_layouts_ref() ff_set_common_formats() ff_set_common_samplerates() ff_set_common_channel_layouts() (I may have forgotten some) [...] What do you think? static int query_formats(AVFilterContext *ctx) { static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }; ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)); ff_set_common_samplerates(ctx, ff_all_samplerates()); return ctx-ff_errno; [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB I am the wisest man alive, for I know one thing, and that is that I know nothing. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/4] x86: xvid_idct: merged idct_put SSE2 versions
On Thu, Mar 12, 2015 at 08:14:47PM +0100, Christophe Gisquet wrote: 2015-03-11 0:11 GMT+01:00 Christophe Gisquet christophe.gisq...@gmail.com: --- libavcodec/x86/xvididct.asm| 202 - libavcodec/x86/xvididct_init.c | 8 +- 2 files changed, 140 insertions(+), 70 deletions(-) Not sure it needed a refresh, but here is one. -- Christophe xvididct.asm| 202 ++-- xvididct_init.c |8 -- 2 files changed, 140 insertions(+), 70 deletions(-) cfbff4ce2cf9fe1be0160f55c52c7d8ecf35600c 0003-x86-xvid_idct-merged-idct_put-SSE2-versions.patch From 2bebf8537cbc0562ed6f6bfeb5b33fda72926969 Mon Sep 17 00:00:00 2001 From: Christophe Gisquet christophe.gisq...@gmail.com Date: Tue, 10 Mar 2015 23:11:53 + Subject: [PATCH 3/4] x86: xvid_idct: merged idct_put SSE2 versions applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Complexity theory is the science of finding the exact solution to an approximation. Benchmarking OTOH is finding an approximation of the exact signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/4] x86: xvid_idct: SSE2 merged add version
On Thu, Mar 12, 2015 at 08:15:23PM +0100, Christophe Gisquet wrote: 2015-03-11 0:11 GMT+01:00 Christophe Gisquet christophe.gisq...@gmail.com: --- libavcodec/x86/xvididct.asm| 92 -- libavcodec/x86/xvididct_init.c | 9 + 2 files changed, 91 insertions(+), 10 deletions(-) Another refresh. xvididct.asm| 92 ++-- xvididct_init.c |9 + 2 files changed, 91 insertions(+), 10 deletions(-) dfa3e9e8d4f96a59c351688ad57cad8cd3c440fe 0004-x86-xvid_idct-SSE2-merged-add-version.patch From 6044cf0ac09c93d363b4a5cf1496d1e330a2fe9b Mon Sep 17 00:00:00 2001 From: Christophe Gisquet christophe.gisq...@gmail.com Date: Tue, 10 Mar 2015 23:11:54 + Subject: [PATCH 4/4] x86: xvid_idct: SSE2 merged add version applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The greatest way to live with honor in this world is to be what we pretend to be. -- Socrates signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC] libavfilter query_format() related functions error handling
On Sat, Mar 14, 2015 at 01:33:12PM +0100, Nicolas George wrote: Le quartidi 24 ventôse, an CCXXIII, Michael Niedermayer a écrit : ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)); ff_set_common_samplerates(ctx, ff_all_samplerates()); What do you do about the 2nd argument being NULL by allocation error here? Should the ctx passed there too? return ctx-ff_errno; I wanted to suggest something along this line too. Since the functions are private and can be changed, I suspect the error code would be better carried around in a value passed as argument. That would also make the calls to query_formats() between filters more easily thread safe. So... int ret = 0; ff_set_common_channel_layouts(ctx, ff_all_channel_layouts(ret), ret); ff_set_common_formats(ctx, ff_make_format_list(sample_fmts, ret), ret); ff_set_common_samplerates(ctx, ff_all_samplerates(ret), ret); return ret; ? -- Clément B. pgpiAf43l8J_r.pgp Description: PGP signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [RFC] libavfilter query_format() related functions error handling
On Sat, Mar 14, 2015 at 03:11:28PM +0100, Clément Bœsch wrote: On Sat, Mar 14, 2015 at 01:33:12PM +0100, Nicolas George wrote: Le quartidi 24 ventôse, an CCXXIII, Michael Niedermayer a écrit : ff_set_common_channel_layouts(ctx, ff_all_channel_layouts()); ff_set_common_formats(ctx, ff_make_format_list(sample_fmts)); ff_set_common_samplerates(ctx, ff_all_samplerates()); What do you do about the 2nd argument being NULL by allocation error here? Should the ctx passed there too? there are many possibilities like returning a specific pointer to a struct indicating errors but passing ret may be more intuitive [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB If a bugfix only changes things apparently unrelated to the bug with no further explanation, that is a good sign that the bugfix is wrong. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 1/5] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On Sat, Mar 14, 2015 at 03:30:24PM +, Christophe Gisquet wrote: The later may yield incorrect code for on-stack variables. --- libavcodec/dct-test.c | 2 +- libavcodec/h264_loopfilter.c| 10 +- libavcodec/proresenc_anatoliy.c | 3 ++- libavcodec/vp8.c| 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 30eca3e..f177dcc 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -66,7 +66,7 @@ static const struct algo fdct_tab[] = { }; static void ff_prores_idct_wrap(int16_t *dst){ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); int i; this seems to break build ffmpeg/libavcodec/dct-test.c: In function ‘ff_prores_idct_wrap’: ffmpeg/libavcodec/dct-test.c:69:28: error: expected expression before ‘static’ ffmpeg/libavcodec/dct-test.c:69:13: warning: unused variable ‘la_qmat’ [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB During times of universal deceit, telling the truth becomes a revolutionary act. -- George Orwell 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/4] ac3dec: cosmetics
On Sat, Mar 14, 2015 at 11:49:00AM +, Christophe Gisquet wrote: --- libavcodec/ac3dec.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- 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] Add ability to pause transcoding via keyboard interaction
On Wed, 11 Mar 2015 08:34:39 -0500 Jeremy Luce jeremyl...@gmail.com wrote: Resubmitting with [PATCH] tag and unified diff. Adds functionality to pause transcoding with 'p' key and upause with 'u' key over stdin. Pauses in the main transcode loop as well as the input_thread loop. did not review patch, idea sounds good. what about ability to pause job to file ? like you have to reboot but you are in the middle of a encoding job. it would write to a file and resume with some option. -compn ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 3/5] ppc: libswscale: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
The later may yield incorrect code for on-stack variables. --- libswscale/ppc/swscale_altivec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c index a1548a7..3034c72 100644 --- a/libswscale/ppc/swscale_altivec.c +++ b/libswscale/ppc/swscale_altivec.c @@ -90,7 +90,7 @@ static void yuv2planeX_16_altivec(const int16_t *filter, int filterSize, const uint8_t *dither, int offset, int x) { register int i, j; -DECLARE_ALIGNED(16, int, val)[16]; +LOCAL_ALIGNED(16, int, val, [16]); vector signed int vo1, vo2, vo3, vo4; vector unsigned short vs1, vs2; vector unsigned char vf; @@ -215,7 +215,7 @@ static void hScale_altivec_real(SwsContext *c, int16_t *dst, int dstW, const int32_t *filterPos, int filterSize) { register int i; -DECLARE_ALIGNED(16, int, tempo)[4]; +LOCAL_ALIGNED(16, int, tempo, [4]); if (filterSize % 4) { for (i = 0; i dstW; i++) { -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 2/5] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
The later may yield incorrect code for on-stack variables. --- libavcodec/x86/ac3dsp_init.c | 2 +- libavcodec/x86/cavsdsp.c | 4 ++-- libavcodec/x86/dct-test.c | 4 ++-- libavcodec/x86/h264_qpel.c| 22 +++--- libavcodec/x86/rv40dsp_init.c | 2 +- libavcodec/x86/vc1dsp_mmx.c | 2 +- libavcodec/x86/vp8dsp_init.c | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/libavcodec/x86/ac3dsp_init.c b/libavcodec/x86/ac3dsp_init.c index 30a85f9..eea2736 100644 --- a/libavcodec/x86/ac3dsp_init.c +++ b/libavcodec/x86/ac3dsp_init.c @@ -165,7 +165,7 @@ static void ac3_downmix_sse(float **samples, float (*matrix)[2], matrix_cmp[3][0] == matrix_cmp[4][0]) { MIX5(IF1, IF0); } else { -DECLARE_ALIGNED(16, float, matrix_simd)[AC3_MAX_CHANNELS][2][4]; +LOCAL_ALIGNED(16, float, matrix_simd, [AC3_MAX_CHANNELS], [2][4]); float *samp[AC3_MAX_CHANNELS]; for (j = 0; j in_ch; j++) diff --git a/libavcodec/x86/cavsdsp.c b/libavcodec/x86/cavsdsp.c index 190f6ee..f142db6 100644 --- a/libavcodec/x86/cavsdsp.c +++ b/libavcodec/x86/cavsdsp.c @@ -139,10 +139,10 @@ static inline void cavs_idct8_1d(int16_t *block, uint64_t bias) static void cavs_idct8_add_mmx(uint8_t *dst, int16_t *block, int stride) { int i; -DECLARE_ALIGNED(16, int16_t, b2)[64]; +LOCAL_ALIGNED(16, int16_t, b2, [64]); for(i=0; i2; i++){ -DECLARE_ALIGNED(8, uint64_t, tmp); +LOCAL_ALIGNED(8, uint64_t, tmp); cavs_idct8_1d(block+4*i, ff_pw_4.a); diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c index d1a5067..8e8da0c 100644 --- a/libavcodec/x86/dct-test.c +++ b/libavcodec/x86/dct-test.c @@ -28,8 +28,8 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, #define PR_WRAP(INSN) \ static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \ -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \ +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); \ +LOCAL_ALIGNED(16, static int16_t, tmp, [64]); \ int i; \ \ for(i=0; i64; i++){ \ diff --git a/libavcodec/x86/h264_qpel.c b/libavcodec/x86/h264_qpel.c index b4cb9b1..33a7fb0 100644 --- a/libavcodec/x86/h264_qpel.c +++ b/libavcodec/x86/h264_qpel.c @@ -282,7 +282,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## MMX(uint8_t *dst, const uin #define H264_MC_V(OPNAME, SIZE, MMX, ALIGN) \ static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src, temp, stride, stride, SIZE);\ }\ @@ -294,7 +294,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## MMX(uint8_t *dst, const uin \ static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ ff_ ## OPNAME ## pixels ## SIZE ## _l2_ ## MMX(dst, src+stride, temp, stride, stride, SIZE);\ }\ @@ -302,41 +302,41 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## MMX(uint8_t *dst, const uin #define H264_MC_HV(OPNAME, SIZE, MMX, ALIGN) \ static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\ }\ \ static void OPNAME ## h264_qpel ## SIZE ## _mc31_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src+1, SIZE, stride);\ ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src, temp, stride, SIZE);\ }\ \ static void OPNAME ## h264_qpel ## SIZE ## _mc13_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN, uint8_t, temp, [SIZE*SIZE]);\ ff_put_h264_qpel ## SIZE ## _v_lowpass_ ## MMX(temp, src, SIZE, stride);\ ff_ ## OPNAME ## h264_qpel ## SIZE ## _h_lowpass_l2_ ## MMX(dst, src+stride, temp, stride, SIZE);\ }\ \ static void OPNAME ## h264_qpel ## SIZE ## _mc33_ ## MMX(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(ALIGN, uint8_t, temp)[SIZE*SIZE];\ +LOCAL_ALIGNED(ALIGN,
[FFmpeg-devel] [PATCH 5/5] lavc/lavu: remove LOCAL_ALIGNED_*
They were duplicating LOCAL_ALIGNED() without benefit. --- configure | 8 +++- libavcodec/aacps.c | 6 +++--- libavcodec/aacsbr.c| 6 +++--- libavcodec/ac3enc.c| 2 +- libavcodec/ac3enc_template.c | 4 ++-- libavcodec/bink.c | 10 +- libavcodec/dcadec.c| 2 +- libavcodec/dnxhdenc.c | 2 +- libavcodec/dvdec.c | 6 +++--- libavcodec/dvenc.c | 4 ++-- libavcodec/imc.c | 2 +- libavcodec/ituh263dec.c| 2 +- libavcodec/me_cmp.c| 16 libavcodec/mips/aacsbr_mips.c | 6 +++--- libavcodec/mpc7.c | 2 +- libavcodec/mpegvideo_enc.c | 2 +- libavcodec/mpegvideo_motion.c | 2 +- libavcodec/ppc/mpegaudiodsp_altivec.c | 8 libavcodec/proresdec2.c| 6 +++--- libavcodec/rv34.c | 4 ++-- libavcodec/vp9.c | 4 ++-- libavcodec/x86/hevcdsp_init.c | 4 ++-- libavcodec/x86/mpegaudiodsp.c | 10 +- libavcodec/x86/mpegvideoenc_template.c | 2 +- libavcodec/x86/simple_idct.c | 2 +- libavcodec/x86/vp9dsp_init.c | 2 +- libavutil/internal.h | 20 +++- 27 files changed, 64 insertions(+), 80 deletions(-) diff --git a/configure b/configure index 7ade46d..2bac433 100755 --- a/configure +++ b/configure @@ -1609,9 +1609,7 @@ ARCH_FEATURES= fast_64bit fast_clz fast_cmov -local_aligned_8 -local_aligned_16 -local_aligned_32 +local_aligned simd_align_16 @@ -4611,7 +4609,7 @@ elif enabled parisc; then elif enabled ppc; then -enable local_aligned_8 local_aligned_16 local_aligned_32 +enable local_aligned check_inline_asm dcbzl 'dcbzl 0, %0 :: r(0)' check_inline_asm ibm_asm 'add 0, 0, 0' @@ -4646,7 +4644,7 @@ elif enabled x86; then check_builtin rdtscintrin.h __rdtsc() check_builtin mm_empty mmintrin.h _mm_empty() -enable local_aligned_8 local_aligned_16 local_aligned_32 +enable local_aligned # check whether EBP is available on x86 # As 'i' is stored on the stack, this program will crash diff --git a/libavcodec/aacps.c b/libavcodec/aacps.c index ea5a5d2..2d00473 100644 --- a/libavcodec/aacps.c +++ b/libavcodec/aacps.c @@ -327,7 +327,7 @@ static void hybrid6_cx(PSDSPContext *dsp, float (*in)[2], float (*out)[32][2], { int i; int N = 8; -LOCAL_ALIGNED_16(float, temp, [8], [2]); +LOCAL_ALIGNED(16, float, temp, [8], [2]); for (i = 0; i len; i++, in++) { dsp-hybrid_analysis(temp, in, (const float (*)[8][2]) filter, 1, N); @@ -628,8 +628,8 @@ static void map_val_20_to_34(float par[PS_MAX_NR_IIDICC]) static void decorrelation(PSContext *ps, float (*out)[32][2], const float (*s)[32][2], int is34) { -LOCAL_ALIGNED_16(float, power, [34], [PS_QMF_TIME_SLOTS]); -LOCAL_ALIGNED_16(float, transient_gain, [34], [PS_QMF_TIME_SLOTS]); +LOCAL_ALIGNED(16, float, power, [34], [PS_QMF_TIME_SLOTS]); +LOCAL_ALIGNED(16, float, transient_gain, [34], [PS_QMF_TIME_SLOTS]); float *peak_decay_nrg = ps-peak_decay_nrg; float *power_smooth = ps-power_smooth; float *peak_decay_diff_smooth = ps-peak_decay_diff_smooth; diff --git a/libavcodec/aacsbr.c b/libavcodec/aacsbr.c index 94a5685..bf60736 100644 --- a/libavcodec/aacsbr.c +++ b/libavcodec/aacsbr.c @@ -1260,7 +1260,7 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp, { int k; for (k = 0; k k0; k++) { -LOCAL_ALIGNED_16(float, phi, [3], [2][2]); +LOCAL_ALIGNED(16, float, phi, [3], [2][2]); float dk; dsp-autocorrelate(X_low[k], phi); @@ -1631,8 +1631,8 @@ static void sbr_hf_assemble(float Y1[38][64][2], for (e = 0; e ch_data-bs_num_env; e++) { for (i = 2 * ch_data-t_env[e]; i 2 * ch_data-t_env[e + 1]; i++) { -LOCAL_ALIGNED_16(float, g_filt_tab, [48]); -LOCAL_ALIGNED_16(float, q_filt_tab, [48]); +LOCAL_ALIGNED(16, float, g_filt_tab, [48]); +LOCAL_ALIGNED(16, float, q_filt_tab, [48]); float *g_filt, *q_filt; if (h_SL e != e_a[0] e != e_a[1]) { diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index dc52908..b3db2df 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1037,7 +1037,7 @@ static void count_mantissa_bits_update_ch(AC3EncodeContext *s, int ch, static int count_mantissa_bits(AC3EncodeContext *s) { int ch, max_end_freq; -LOCAL_ALIGNED_16(uint16_t, mant_cnt, [AC3_MAX_BLOCKS], [16]); +LOCAL_ALIGNED(16, uint16_t, mant_cnt, [AC3_MAX_BLOCKS], [16]); count_mantissa_bits_init(mant_cnt); diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c index
[FFmpeg-devel] [PATCH 1/5] lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
The later may yield incorrect code for on-stack variables. --- libavcodec/dct-test.c | 2 +- libavcodec/h264_loopfilter.c| 10 +- libavcodec/proresenc_anatoliy.c | 3 ++- libavcodec/vp8.c| 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/libavcodec/dct-test.c b/libavcodec/dct-test.c index 30eca3e..f177dcc 100644 --- a/libavcodec/dct-test.c +++ b/libavcodec/dct-test.c @@ -66,7 +66,7 @@ static const struct algo fdct_tab[] = { }; static void ff_prores_idct_wrap(int16_t *dst){ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); int i; for(i=0; i64; i++){ diff --git a/libavcodec/h264_loopfilter.c b/libavcodec/h264_loopfilter.c index a7b6878..c221f98 100644 --- a/libavcodec/h264_loopfilter.c +++ b/libavcodec/h264_loopfilter.c @@ -355,7 +355,7 @@ static av_always_inline void h264_filter_mb_fast_internal(H264Context *h, } return; } else { -LOCAL_ALIGNED_8(int16_t, bS, [2], [4][4]); +LOCAL_ALIGNED(8, int16_t, bS, [2], [4][4]); int edges; if( IS_8x8DCT(mb_type) (h-cbp7) == 7 !chroma444 ) { edges = 4; @@ -492,7 +492,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u int j; for(j=0; j2; j++, mbn_xy += h-mb_stride){ -DECLARE_ALIGNED(8, int16_t, bS)[4]; +LOCAL_ALIGNED(8, int16_t, bS, [4]); int qp; if (IS_INTRA(mb_type | h-cur_pic.mb_type[mbn_xy])) { AV_WN64A(bS, 0x0003000300030003ULL); @@ -529,7 +529,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u } } }else{ -DECLARE_ALIGNED(8, int16_t, bS)[4]; +LOCAL_ALIGNED(8, int16_t, bS, [4]); int qp; if( IS_INTRA(mb_type|mbm_type)) { @@ -612,7 +612,7 @@ static av_always_inline void filter_mb_dir(H264Context *h, int mb_x, int mb_y, u /* Calculate bS */ for( edge = 1; edge edges; edge++ ) { -DECLARE_ALIGNED(8, int16_t, bS)[4]; +LOCAL_ALIGNED(8, int16_t, bS, [4]); int qp; const int deblock_edge = !IS_8x8DCT(mb_type (edge24)); // (edge1) IS_8x8DCT(mb_type) @@ -719,7 +719,7 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint /* First vertical edge is different in MBAFF frames * There are 8 different bS to compute and 2 different Qp */ -DECLARE_ALIGNED(8, int16_t, bS)[8]; +LOCAL_ALIGNED(8, int16_t, bS, [8]); int qp[2]; int bqp[2]; int rqp[2]; diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index 634ff08..bf6e671 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -286,7 +286,8 @@ static int encode_slice_plane(AVCodecContext *avctx, int mb_count, { ProresContext* ctx = avctx-priv_data; FDCTDSPContext *fdsp = ctx-fdsp; -DECLARE_ALIGNED(16, int16_t, blocks)[DEFAULT_SLICE_MB_WIDTH 8], *block; +LOCAL_ALIGNED(16, int16_t, blocks, [DEFAULT_SLICE_MB_WIDTH 8]); +int16_t *block; int i, blocks_per_slice; PutBitContext pb; diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 4b32347..8d6cbe1 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -1615,7 +1615,7 @@ void intra_predict(VP8Context *s, VP8ThreadData *td, uint8_t *dst[3], for (x = 0; x 4; x++) { int copy = 0, linesize = s-linesize; uint8_t *dst = ptr + 4 * x; -DECLARE_ALIGNED(4, uint8_t, copy_dst)[5 * 8]; +LOCAL_ALIGNED(4, uint8_t, copy_dst, [5 * 8]); if ((y == 0 || x == 3) mb_y == 0) { topright = tr_top; -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH 4/5] ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
The later may yield incorrect code for on-stack variables. --- libavcodec/ppc/h264dsp.c| 10 - libavcodec/ppc/h264qpel.c | 50 - libavcodec/ppc/vp8dsp_altivec.c | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/libavcodec/ppc/h264dsp.c b/libavcodec/ppc/h264dsp.c index da118a4..fabdc2f 100644 --- a/libavcodec/ppc/h264dsp.c +++ b/libavcodec/ppc/h264dsp.c @@ -262,7 +262,7 @@ static av_always_inline void h264_idct_dc_add_internal(uint8_t *dst, int16_t *bl vec_u8 dcplus, dcminus, v0, v1, v2, v3, aligner; vec_s32 v_dc32; LOAD_ZERO; -DECLARE_ALIGNED(16, int, dc); +LOCAL_ALIGNED(16, int, dc); int i; dc = (block[0] + 32) 6; @@ -391,7 +391,7 @@ static void h264_idct_add8_altivec(uint8_t **dest, const int *block_offset, static inline void write16x4(uint8_t *dst, int dst_stride, register vec_u8 r0, register vec_u8 r1, register vec_u8 r2, register vec_u8 r3) { -DECLARE_ALIGNED(16, unsigned char, result)[64]; +LOCAL_ALIGNED(16, unsigned char, result, [64]); uint32_t *src_int = (uint32_t *)result, *dst_int = (uint32_t *)dst; int int_dst_stride = dst_stride/4; @@ -571,7 +571,7 @@ static inline vec_u8 h264_deblock_q1(register vec_u8 p0, } #define h264_loop_filter_luma_altivec(p2, p1, p0, q0, q1, q2, alpha, beta, tc0) {\ -DECLARE_ALIGNED(16, unsigned char, temp)[16]; \ +LOCAL_ALIGNED(16, unsigned char, temp, [16]); \ register vec_u8 alphavec; \ register vec_u8 betavec; \ register vec_u8 mask; \ @@ -652,7 +652,7 @@ void weight_h264_W_altivec(uint8_t *block, int stride, int height, vec_u8 vblock; vec_s16 vtemp, vweight, voffset, v0, v1; vec_u16 vlog2_denom; -DECLARE_ALIGNED(16, int32_t, temp)[4]; +LOCAL_ALIGNED(16, int32_t, temp, [4]); LOAD_ZERO; offset = log2_denom; @@ -701,7 +701,7 @@ void biweight_h264_W_altivec(uint8_t *dst, uint8_t *src, int stride, int height, vec_u8 vsrc, vdst; vec_s16 vtemp, vweights, vweightd, voffset, v0, v1, v2, v3; vec_u16 vlog2_denom; -DECLARE_ALIGNED(16, int32_t, temp)[4]; +LOCAL_ALIGNED(16, int32_t, temp, [4]); LOAD_ZERO; offset = ((offset + 1) | 1) log2_denom; diff --git a/libavcodec/ppc/h264qpel.c b/libavcodec/ppc/h264qpel.c index 575f504..ecf99c8 100644 --- a/libavcodec/ppc/h264qpel.c +++ b/libavcodec/ppc/h264qpel.c @@ -73,7 +73,7 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc00_ ## CODETYPE (uint8_t *dst, con \ static void OPNAME ## h264_qpel ## SIZE ## _mc10_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ { \ -DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\ +LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\ put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\ }\ @@ -85,14 +85,14 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc20_ ## CODETYPE(uint8_t *dst, cons \ static void OPNAME ## h264_qpel ## SIZE ## _mc30_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\ +LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\ put_h264_qpel ## SIZE ## _h_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+1, half, stride, stride, SIZE);\ }\ \ static void OPNAME ## h264_qpel ## SIZE ## _mc01_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\ +LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\ put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src, half, stride, stride, SIZE);\ }\ @@ -104,15 +104,15 @@ static void OPNAME ## h264_qpel ## SIZE ## _mc02_ ## CODETYPE(uint8_t *dst, cons \ static void OPNAME ## h264_qpel ## SIZE ## _mc03_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(16, uint8_t, half)[SIZE*SIZE];\ +LOCAL_ALIGNED(16, uint8_t, half, [SIZE*SIZE]);\ put_h264_qpel ## SIZE ## _v_lowpass_ ## CODETYPE(half, src, SIZE, stride);\ OPNAME ## pixels ## SIZE ## _l2_ ## CODETYPE(dst, src+stride, half, stride, stride, SIZE);\ }\ \ static void OPNAME ## h264_qpel ## SIZE ## _mc11_ ## CODETYPE(uint8_t *dst, const uint8_t *src, ptrdiff_t stride)\ {\ -DECLARE_ALIGNED(16, uint8_t, halfH)[SIZE*SIZE];\ -DECLARE_ALIGNED(16, uint8_t, halfV)[SIZE*SIZE];\ +LOCAL_ALIGNED(16, uint8_t, halfH, [SIZE*SIZE]);\ +
Re: [FFmpeg-devel] [PATCH] mxfenc: ensure mxf-body_partition_offset is not NULL before using it
On 14.03.2015 02:17, Mark Reid wrote: On Fri, Mar 13, 2015 at 6:02 AM, Andreas Cadhalpun andreas.cadhal...@googlemail.com wrote: On 13.03.2015 11:59, Tomas Härdin wrote: A better solution would be to figure out why mxf-body_partition_offset becomes NULL so that index tables and such can be rewritten properly. It can always happen that mxf-body_partition_offset is NULL, e.g. if no memory is left, or if something else fails. Try e.g.: ffmpeg -f lavfi -i testsrc -c:v libx264 -f mxf_opatom mxf-body_partition_offset is NULL because currently only AVC Intra 50/100 h264 is supported. Yes. The encoder figures out the h264 format by parsing the h264 packet and doesn't write the body partiton (or even the header partition) untill after it parses the first packet. If the packet is invalid, nothing get written and mxf-body_partition_offset doesn't get allocated. That's correct. perhaps mxf_write_footer should return a error if mxf-body_partition_offset is NULL or just if mxf-header_written == 0 before doing trying to write anything. Well, mxf_write_footer also has to free some allocated memory, which would get leaked if one just returns... ...like it does in any of the currently present 'return err' cases. Attached is a patch fixing the memleaks and another returning an error, if no header was written before the footer. Best regards, Andreas From ac6970e62ddd65fe18be10f1c79f10c6d8ce3a75 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com Date: Sat, 14 Mar 2015 17:48:56 +0100 Subject: [PATCH 2/2] mxfenc: don't try to write footer without header This fixes a crash, when trying to mux h264 into mxf_opatom. Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavformat/mxfenc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index bf680f8..2485741 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -2340,6 +2340,12 @@ static int mxf_write_footer(AVFormatContext *s) AVIOContext *pb = s-pb; int err = 0; +if (!mxf-header_written || +(s-oformat == ff_mxf_opatom_muxer !mxf-body_partition_offset)) { +err = AVERROR_UNKNOWN; +goto end; +} + mxf-duration = mxf-last_indexed_edit_unit + mxf-edit_units_count; mxf_write_klv_fill(s); -- 2.1.4 From 5d9c6182f3f203fcbb286012d13cff76f9083b57 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun andreas.cadhal...@googlemail.com Date: Sat, 14 Mar 2015 17:47:53 +0100 Subject: [PATCH 1/2] mxfenc: fix memleaks in mxf_write_footer Signed-off-by: Andreas Cadhalpun andreas.cadhal...@googlemail.com --- libavformat/mxfenc.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 898951c..bf680f8 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -2338,7 +2338,7 @@ static int mxf_write_footer(AVFormatContext *s) { MXFContext *mxf = s-priv_data; AVIOContext *pb = s-pb; -int err; +int err = 0; mxf-duration = mxf-last_indexed_edit_unit + mxf-edit_units_count; @@ -2346,10 +2346,10 @@ static int mxf_write_footer(AVFormatContext *s) mxf-footer_partition_offset = avio_tell(pb); if (mxf-edit_unit_byte_count s-oformat != ff_mxf_opatom_muxer) { // no need to repeat index if ((err = mxf_write_partition(s, 0, 0, footer_partition_key, 0)) 0) -return err; +goto end; } else { if ((err = mxf_write_partition(s, 0, 2, footer_partition_key, 0)) 0) -return err; +goto end; mxf_write_klv_fill(s); mxf_write_index_table_segment(s); } @@ -2362,21 +2362,22 @@ static int mxf_write_footer(AVFormatContext *s) /* rewrite body partition to update lengths */ avio_seek(pb, mxf-body_partition_offset[0], SEEK_SET); if ((err = mxf_write_opatom_body_partition(s)) 0) -return err; +goto end; } avio_seek(pb, 0, SEEK_SET); if (mxf-edit_unit_byte_count s-oformat != ff_mxf_opatom_muxer) { if ((err = mxf_write_partition(s, 1, 2, header_closed_partition_key, 1)) 0) -return err; +goto end; mxf_write_klv_fill(s); mxf_write_index_table_segment(s); } else { if ((err = mxf_write_partition(s, 0, 0, header_closed_partition_key, 1)) 0) -return err; +goto end; } } +end: ff_audio_interleave_close(s); av_freep(mxf-index_entries); @@ -2386,7 +2387,7 @@ static int mxf_write_footer(AVFormatContext *s) mxf_free(s); -return 0; +return err 0 ? err : 0; } static int mxf_interleave_get_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush) -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org
[FFmpeg-devel] [PATCH 0/5] Of {LOCAL_,DECLARE_}ALIGNED
LOCAL_ALIGNED has been introduced around 2010 because some compilers didn't obey the alignment request for addresses on the stack. Please see d96cd429 or 0bbb1cdc for instance. There are some remnants being fixed in the 4 first patches. The very first one has some issues (merging lavc and lavc/x86 changes). There are however a few caveats unsolved in that patch series: 1) You can't mix LOCAL_ALIGNED and initialization (cases are left as is) 2) LOCAL_ALIGNED is buggy as it allows taking more than 2 dimension arguments (eg ARGS, [DIM0], [DIM1], [DIM2], [DIM3]), but it actually requires dimensions beyond the first to be concatenated (eg ARGS, [DIM0], [DIM1][DIM2][DIM3]). The later can be somewhat improved, but that's through some macro hell that may itself not be supported by all compilers. To avoid further code duplication, the last patch simply removes all LOCAL_ALIGNED_* macros. All changes (core+x86) tested with: fate-vfilter fate-vcodec fate-h264 fate-ac3 fate-vp8 fate-cavs fate-vc1 for Win32 and Win64. Christophe Gisquet (5): lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED ppc: libswscale: use LOCAL_ALIGNED instead of DECLARE_ALIGNED ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED lavc/lavu: remove LOCAL_ALIGNED_* configure | 8 ++ libavcodec/aacps.c | 6 ++-- libavcodec/aacsbr.c| 6 ++-- libavcodec/ac3enc.c| 2 +- libavcodec/ac3enc_template.c | 4 +-- libavcodec/bink.c | 10 +++ libavcodec/dcadec.c| 2 +- libavcodec/dct-test.c | 2 +- libavcodec/dnxhdenc.c | 2 +- libavcodec/dvdec.c | 6 ++-- libavcodec/dvenc.c | 4 +-- libavcodec/h264_loopfilter.c | 10 +++ libavcodec/imc.c | 2 +- libavcodec/ituh263dec.c| 2 +- libavcodec/me_cmp.c| 16 +-- libavcodec/mips/aacsbr_mips.c | 6 ++-- libavcodec/mpc7.c | 2 +- libavcodec/mpegvideo_enc.c | 2 +- libavcodec/mpegvideo_motion.c | 2 +- libavcodec/ppc/h264dsp.c | 10 +++ libavcodec/ppc/h264qpel.c | 50 +- libavcodec/ppc/mpegaudiodsp_altivec.c | 8 +++--- libavcodec/ppc/vp8dsp_altivec.c| 2 +- libavcodec/proresdec2.c| 6 ++-- libavcodec/proresenc_anatoliy.c| 3 +- libavcodec/rv34.c | 4 +-- libavcodec/vp8.c | 2 +- libavcodec/vp9.c | 4 +-- libavcodec/x86/ac3dsp_init.c | 2 +- libavcodec/x86/cavsdsp.c | 4 +-- libavcodec/x86/dct-test.c | 4 +-- libavcodec/x86/h264_qpel.c | 22 +++ libavcodec/x86/hevcdsp_init.c | 4 +-- libavcodec/x86/mpegaudiodsp.c | 10 +++ libavcodec/x86/mpegvideoenc_template.c | 2 +- libavcodec/x86/rv40dsp_init.c | 2 +- libavcodec/x86/simple_idct.c | 2 +- libavcodec/x86/vc1dsp_mmx.c| 2 +- libavcodec/x86/vp8dsp_init.c | 4 +-- libavcodec/x86/vp9dsp_init.c | 2 +- libavutil/internal.h | 20 ++ libswscale/ppc/swscale_altivec.c | 4 +-- 42 files changed, 126 insertions(+), 141 deletions(-) -- 1.9.2.msysgit.0 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 3/5] ppc: libswscale: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On Sat, Mar 14, 2015 at 03:30:26PM +, Christophe Gisquet wrote: The later may yield incorrect code for on-stack variables. --- libswscale/ppc/swscale_altivec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Dictatorship naturally arises out of democracy, and the most aggravated form of tyranny and slavery out of the most extreme liberty. -- Plato signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 2/5] x86: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On Sat, Mar 14, 2015 at 03:30:25PM +, Christophe Gisquet wrote: The later may yield incorrect code for on-stack variables. --- libavcodec/x86/ac3dsp_init.c | 2 +- libavcodec/x86/cavsdsp.c | 4 ++-- libavcodec/x86/dct-test.c | 4 ++-- libavcodec/x86/h264_qpel.c| 22 +++--- libavcodec/x86/rv40dsp_init.c | 2 +- libavcodec/x86/vc1dsp_mmx.c | 2 +- libavcodec/x86/vp8dsp_init.c | 4 ++-- 7 files changed, 20 insertions(+), 20 deletions(-) [...] diff --git a/libavcodec/x86/dct-test.c b/libavcodec/x86/dct-test.c index d1a5067..8e8da0c 100644 --- a/libavcodec/x86/dct-test.c +++ b/libavcodec/x86/dct-test.c @@ -28,8 +28,8 @@ void ff_prores_idct_put_10_sse2(uint16_t *dst, int linesize, #define PR_WRAP(INSN) \ static void ff_prores_idct_put_10_##INSN##_wrap(int16_t *dst){ \ -DECLARE_ALIGNED(16, static int16_t, qmat)[64]; \ -DECLARE_ALIGNED(16, static int16_t, tmp)[64]; \ +LOCAL_ALIGNED(16, static int16_t, qmat, [64]); \ +LOCAL_ALIGNED(16, static int16_t, tmp, [64]); \ int i; \ LOCAL_ALIGNED + static looks unintended [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB There will always be a question for which you do not know the correct answer. signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH 4/5] ppc: lavc: use LOCAL_ALIGNED instead of DECLARE_ALIGNED
On Sat, Mar 14, 2015 at 03:30:27PM +, Christophe Gisquet wrote: The later may yield incorrect code for on-stack variables. --- libavcodec/ppc/h264dsp.c| 10 - libavcodec/ppc/h264qpel.c | 50 - libavcodec/ppc/vp8dsp_altivec.c | 2 +- 3 files changed, 31 insertions(+), 31 deletions(-) applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many that live deserve death. And some that die deserve life. Can you give it to them? Then do not be too eager to deal out death in judgement. For even the very wise cannot see all ends. -- Gandalf signature.asc Description: Digital signature ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel