Re: [libav-devel] [PATCH 2/2] avplay: support mid-stream sample rate changes
On Mon, 8 Oct 2012 00:04:22 -0400, Justin Ruggles justin.rugg...@gmail.com wrote: Resample to the rate that was configured in SDL. --- avplay.c | 35 +-- 1 files changed, 21 insertions(+), 14 deletions(-) diff --git a/avplay.c b/avplay.c index 9985c1d..3e5456f 100644 --- a/avplay.c +++ b/avplay.c @@ -164,8 +164,10 @@ typedef struct VideoState { enum AVSampleFormat sdl_sample_fmt; uint64_t sdl_channel_layout; int sdl_channels; +int sdl_sample_rate; enum AVSampleFormat resample_sample_fmt; uint64_t resample_channel_layout; +int resample_sample_rate; AVAudioResampleContext *avr; AVFrame *frame; @@ -758,7 +760,7 @@ static void video_audio_display(VideoState *s) the last buffer computation */ if (audio_callback_time) { time_diff = av_gettime() - audio_callback_time; -delay -= (time_diff * s-audio_st-codec-sample_rate) / 100; +delay -= (time_diff * s-sdl_sample_rate) / 100; } delay += 2 * data_used; @@ -960,7 +962,7 @@ static double get_audio_clock(VideoState *is) hw_buf_size = audio_write_get_buf_size(is); bytes_per_sec = 0; if (is-audio_st) { -bytes_per_sec = is-audio_st-codec-sample_rate * is-sdl_channels * +bytes_per_sec = is-sdl_sample_rate * is-sdl_channels * av_get_bytes_per_sample(is-sdl_sample_fmt); } if (bytes_per_sec) @@ -1821,7 +1823,7 @@ static int synchronize_audio(VideoState *is, short *samples, avg_diff = is-audio_diff_cum * (1.0 - is-audio_diff_avg_coef); if (fabs(avg_diff) = is-audio_diff_threshold) { -wanted_size = samples_size + ((int)(diff * is-audio_st-codec-sample_rate) * n); +wanted_size = samples_size + ((int)(diff * is-sdl_sample_rate) * n); nb_samples = samples_size / n; min_size = ((nb_samples * (100 - SAMPLE_CORRECTION_PERCENT_MAX)) / 100) * n; @@ -1911,11 +1913,13 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr) is-frame-nb_samples, is-frame-format, 1); -audio_resample = is-frame-format != is-sdl_sample_fmt || - is-frame-channel_layout != is-sdl_channel_layout; +audio_resample = is-frame-format != is-sdl_sample_fmt || + is-frame-channel_layout != is-sdl_channel_layout || + is-frame-sample_rate!= is-sdl_sample_rate; -resample_changed = is-frame-format != is-resample_sample_fmt || - is-frame-channel_layout != is-resample_channel_layout; +resample_changed = is-frame-format != is-resample_sample_fmt || + is-frame-channel_layout != is-resample_channel_layout || + is-frame-sample_rate!= is-resample_sample_rate; if ((!is-avr audio_resample) || resample_changed) { int ret; @@ -1932,9 +1936,9 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr) av_opt_set_int(is-avr, in_channel_layout, is-frame-channel_layout, 0); av_opt_set_int(is-avr, in_sample_fmt, is-frame-format, 0); av_opt_set_int(is-avr, in_sample_rate, is-frame-sample_rate,0); -av_opt_set_int(is-avr, out_channel_layout, is-sdl_channel_layout, 0); -av_opt_set_int(is-avr, out_sample_fmt, is-sdl_sample_fmt, 0); -av_opt_set_int(is-avr, out_sample_rate, dec-sample_rate, 0); +av_opt_set_int(is-avr, out_channel_layout, is-sdl_channel_layout,0); +av_opt_set_int(is-avr, out_sample_fmt, is-sdl_sample_fmt,0); +av_opt_set_int(is-avr, out_sample_rate, is-sdl_sample_rate, 0); if ((ret = avresample_open(is-avr)) 0) { fprintf(stderr, error initializing libavresample\n); @@ -1943,6 +1947,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr) } is-resample_sample_fmt = is-frame-format; is-resample_channel_layout = is-frame-channel_layout; +is-resample_sample_rate= is-frame-sample_rate; } if (audio_resample) { @@ -1981,7 +1986,7 @@ static int audio_decode_frame(VideoState *is, double *pts_ptr) *pts_ptr = pts; n = is-sdl_channels * av_get_bytes_per_sample(is-sdl_sample_fmt);
Re: [libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.
On Thu, 11 Oct 2012, Diego Biurrun wrote: --- Now w/o accidentally renaming the copy in libavutil... libavcodec/asvdec.c |7 --- libavcodec/asvenc.c |7 --- libavcodec/bitstream.c |9 + libavcodec/indeo2.c |6 -- libavcodec/ivi_common.c |7 --- libavcodec/mathops.h|1 + libavcodec/mathtables.c | 19 +++ libavcodec/pcm.c| 11 ++- libavcodec/s302m.c | 39 --- libavcodec/tiff.c |7 --- libavcodec/vble.c |3 ++- libavcodec/wnv1.c |6 +++--- libavcodec/xbmenc.c |4 ++-- libavutil/common.h |4 libavutil/mathematics.c |4 libavutil/version.h |3 +++ 16 files changed, 89 insertions(+), 48 deletions(-) diff --git a/libavutil/common.h b/libavutil/common.h index 433e8e4..a8140dc 100644 --- a/libavutil/common.h +++ b/libavutil/common.h @@ -34,7 +34,9 @@ #include stdio.h #include stdlib.h #include string.h + #include attributes.h +#include version.h #include libavutil/avconfig.h #if AV_HAVE_BIGENDIAN @@ -62,7 +64,9 @@ /* misc math functions */ extern const uint8_t ff_log2_tab[256]; +#if FF_API_AV_REVERSE extern const uint8_t av_reverse[256]; +#endif Please add attribute_deprecated here as well. // Martin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] rtspdec: Set the default port for listen mode, if none is specified
--- libavformat/rtspdec.c |4 1 file changed, 4 insertions(+) diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 7476c45..c0797ad 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -621,6 +621,10 @@ static int rtsp_listen(AVFormatContext *s) /* ff_url_join. No authorization by now (NULL) */ ff_url_join(rt-control_uri, sizeof(rt-control_uri), rtsp, NULL, host, port, %s, path); + +if (port 0) +port = RTSP_DEFAULT_PORT; + /* Create TCP connection */ ff_url_join(tcpname, sizeof(tcpname), tcp, NULL, host, port, ?listenlisten_timeout=%d, rt-initial_timeout * 1000); -- 1.7.9.4 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] tscc2: Fix an out of array access
From: Michael Niedermayer michae...@gmx.at --- libavcodec/tscc2.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 1b2a3a4..3628713 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -173,7 +173,7 @@ static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set, if (ac == 0x1000) ac = get_bits(gb, 12); bpos += ac 0xF; -if (bpos = 64) +if (bpos = 16) return AVERROR_INVALIDDATA; val = sign_extend(ac 4, 8); c-block[tscc2_zigzag[bpos++]] = val; -- 1.7.9.4 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] tscc2: Fix an out of array access
On Fri, Oct 12, 2012 at 11:19:24AM +0300, Martin Storsjö wrote: From: Michael Niedermayer michae...@gmx.at --- libavcodec/tscc2.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index 1b2a3a4..3628713 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -173,7 +173,7 @@ static int tscc2_decode_mb(TSCC2Context *c, int *q, int vlc_set, if (ac == 0x1000) ac = get_bits(gb, 12); bpos += ac 0xF; -if (bpos = 64) +if (bpos = 16) return AVERROR_INVALIDDATA; val = sign_extend(ac 4, 8); c-block[tscc2_zigzag[bpos++]] = val; -- OK ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] mov: Do not apply dts shift from edit lists coming from data tracks.
On 10/12/2012 06:52 AM, Alex Converse wrote: Some files in the wild have time code tracks with very negative initial offsets. --- libavformat/mov.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) I guess ok, how that data track should be managed though? lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 1/2] rtspdec: Fix use of uninitialized byte
On 10/12/2012 10:07 AM, Martin Storsjö wrote: From: Michael Niedermayer michae...@gmx.at ffurl_read_complete can return 0 as well as negative error codes. --- libavformat/rtspdec.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 7476c45..d46f1a4 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -76,8 +76,8 @@ static inline int read_line(AVFormatContext *s, char *rbuf, const int rbufsize, do { ret = ffurl_read_complete(rt-rtsp_hd, rbuf + idx, 1); -if (ret 0) -return ret; +if (ret = 0) +return ret ? ret : AVERROR_EOF; if (rbuf[idx] == '\r') { /* Ignore */ } else if (rbuf[idx] == '\n') { I wonder why 0 should appear here, we are asking 1, we should get an eagain. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 1/2] rtspdec: Fix use of uninitialized byte
On 10/12/2012 11:20 AM, Luca Barbato wrote: I wonder why 0 should appear here, we are asking 1, we should get an eagain. Should but does not, patch ok I guess. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] rtspdec: Set the default port for listen mode, if none is specified
On 10/12/2012 10:10 AM, Martin Storsjö wrote: --- libavformat/rtspdec.c |4 1 file changed, 4 insertions(+) OK. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 1/2] rtspdec: Fix use of uninitialized byte
On Fri, 12 Oct 2012, Luca Barbato wrote: On 10/12/2012 11:20 AM, Luca Barbato wrote: I wonder why 0 should appear here, we are asking 1, we should get an eagain. Should but does not, patch ok I guess. Yeah - you don't get eagain for blocking reads. For the normal ffurl_read, you can get less than what you asked for, while ffurl_read_complete tries to avoid that. It still can return less than what you asked for (on EOF), including 0. // Martin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] mov: Do not apply dts shift from edit lists coming from data tracks.
Alex Converse alex.conve...@gmail.com writes: Some files in the wild have time code tracks with very negative initial offsets. Do you have a sample? -- Måns Rullgård m...@mansr.com ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/2] rtmpproto: Fix an out of array write
On 10/12/2012 10:07 AM, Martin Storsjö wrote: From: Michael Niedermayer michae...@gmx.at Ok. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] nut: support high depth pcm codecs
On 2012-10-12 02:15:33 +0200, Luca Barbato wrote: Give priority to the native tags when encoding. Update fate refs due the change of tags in use. --- Made sure fate remains green. libavformat/nut.c| 20 +++ libavformat/nut.h| 1 + libavformat/nutdec.c | 9 +++- libavformat/nutenc.c | 20 --- tests/ref/lavfi/crop | 2 +- tests/ref/lavfi/crop_scale | 2 +- tests/ref/lavfi/crop_scale_vflip | 2 +- tests/ref/lavfi/crop_vflip | 2 +- tests/ref/lavfi/null | 2 +- tests/ref/lavfi/pixdesc | 114 +++ tests/ref/lavfi/pixfmts_copy | 114 +++ tests/ref/lavfi/pixfmts_crop | 82 ++-- tests/ref/lavfi/pixfmts_hflip| 82 ++-- tests/ref/lavfi/pixfmts_null | 114 +++ tests/ref/lavfi/pixfmts_pad | 34 ++-- tests/ref/lavfi/pixfmts_scale| 114 +++ tests/ref/lavfi/pixfmts_vflip| 114 +++ tests/ref/lavfi/scale200 | 2 +- tests/ref/lavfi/scale500 | 2 +- tests/ref/lavfi/vflip| 2 +- tests/ref/lavfi/vflip_crop | 2 +- tests/ref/lavfi/vflip_vflip | 2 +- ok I guess. have you looked at some tests and verified that only the tags change? Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] avutil: add yuva422p and yuva444p formats
On 2012-10-12 01:31:02 +0200, Luca Barbato wrote: On 10/12/2012 01:24 AM, Janne Grunau wrote: On 2012-10-12 01:08:10 +0200, Luca Barbato wrote: --- diff --git a/libswscale/utils.c b/libswscale/utils.c index fcdd04a..8d04e27 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -108,6 +108,8 @@ static const FormatEntry format_entries[AV_PIX_FMT_NB] = { [AV_PIX_FMT_YUV440P] = { 1, 1 }, [AV_PIX_FMT_YUVJ440P]= { 1, 1 }, [AV_PIX_FMT_YUVA420P]= { 1, 1 }, +[AV_PIX_FMT_YUVA422P]= { 1, 1 }, +[AV_PIX_FMT_YUVA444P]= { 1, 1 }, [AV_PIX_FMT_RGB48BE] = { 1, 1 }, [AV_PIX_FMT_RGB48LE] = { 1, 1 }, [AV_PIX_FMT_RGB565BE]= { 1, 1 }, is this really enough to support new pixel formats? swscale can use pixel format descriptor in the general scaler? Yes, but just for the non-rgb-planar formats (that's why Derek patch had problems and I'm not happy yet with my solution to support it) the rest is ok as well then Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] FFv1.3 support
On 10/12/2012 12:24 AM, Luca Barbato wrote: On 10/05/2012 05:31 PM, Peter B. wrote: On 10/01/2012 05:30 PM, Luca Barbato wrote: I'm rebasing old patches supporting some pixel formats and possibly I'll have a look at ffv1 to see what really changed. In order to avoid misunderstandings, I wanted to ask if you are trying to merge the new FFv1.3 code into libav, or just the colorspaces? It took me a bit of time, here the not clean yet version. https://github.com/lu-zero/libav/tree/ffv1.3 Sorry, was out of country and away from my computer I will take a look at this ASAP. Hopefully on the weekend already. Thanks, Pb ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] FFv1.3 support
On 10/12/2012 03:14 PM, Peter B. wrote: On 10/12/2012 12:24 AM, Luca Barbato wrote: On 10/05/2012 05:31 PM, Peter B. wrote: On 10/01/2012 05:30 PM, Luca Barbato wrote: I'm rebasing old patches supporting some pixel formats and possibly I'll have a look at ffv1 to see what really changed. In order to avoid misunderstandings, I wanted to ask if you are trying to merge the new FFv1.3 code into libav, or just the colorspaces? It took me a bit of time, here the not clean yet version. https://github.com/lu-zero/libav/tree/ffv1.3 Sorry, was out of country and away from my computer I will take a look at this ASAP. Hopefully on the weekend already. I'd like you to test few different things later. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] Fix for FFMPEG vp8dec loopfilter delta values reset at keyframes
Hi all, while testing a VP8 encoder I found a mismatch between FFMPEG and libvpx VP8 decoders. The reason for this mismatch is that FFMPEG doesn't reset loopfilter delta values at keyframes. Patch that fixes the issue is below. I've verified that the output of ffmpeg after this patch matches libvpx. If you need I can send you a stream that shows the issue. Br, Sami Pietila diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 3f07b90..0bb5495 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -353,6 +353,7 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size) memcpy(s-prob-pred8x8c , vp8_pred8x8c_prob_inter , sizeof(s-prob-pred8x8c)); memcpy(s-prob-mvc , vp8_mv_default_prob , sizeof(s-prob-mvc)); memset(s-segmentation, 0, sizeof(s-segmentation)); +memset(s-lf_delta, 0, sizeof(s-lf_delta)); } ff_vp56_init_range_decoder(c, buf, header_size); ffmpeg_vp8dec_lf_delta_keyframe.patch Description: Binary data ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.
--- Now with attribute_deprecated and w/o stupid copy and paste bug. libavcodec/asvdec.c |7 --- libavcodec/asvenc.c |7 --- libavcodec/bitstream.c |9 + libavcodec/indeo2.c |6 -- libavcodec/ivi_common.c |7 --- libavcodec/mathops.h|1 + libavcodec/mathtables.c | 19 +++ libavcodec/pcm.c| 11 ++- libavcodec/s302m.c | 39 --- libavcodec/tiff.c |7 --- libavcodec/vble.c |3 ++- libavcodec/wnv1.c |6 +++--- libavcodec/xbmenc.c |4 ++-- libavutil/common.h |6 +- libavutil/mathematics.c |4 libavutil/version.h |3 +++ 16 files changed, 90 insertions(+), 49 deletions(-) diff --git a/libavcodec/asvdec.c b/libavcodec/asvdec.c index ceb8f63..a546d24 100644 --- a/libavcodec/asvdec.c +++ b/libavcodec/asvdec.c @@ -23,13 +23,14 @@ * ASUS V1/V2 decoder. */ -#include libavutil/common.h +#include libavutil/attributes.h #include libavutil/mem.h #include asv.h #include avcodec.h #include put_bits.h #include dsputil.h +#include mathops.h #include mpeg12data.h //#undef NDEBUG @@ -70,7 +71,7 @@ static av_cold void init_vlcs(ASV1Context *a){ //FIXME write a reversed bitstream reader to avoid the double reverse static inline int asv2_get_bits(GetBitContext *gb, int n){ -return av_reverse[ get_bits(gb, n) (8-n) ]; +return ff_reverse[ get_bits(gb, n) (8-n) ]; } static inline int asv1_get_level(GetBitContext *gb){ @@ -210,7 +211,7 @@ static int decode_frame(AVCodecContext *avctx, else{ int i; for(i=0; ibuf_size; i++) -a-bitstream_buffer[i]= av_reverse[ buf[i] ]; +a-bitstream_buffer[i]= ff_reverse[ buf[i] ]; } init_get_bits(a-gb, a-bitstream_buffer, buf_size*8); diff --git a/libavcodec/asvenc.c b/libavcodec/asvenc.c index bf2cdaf..4ab9ddb 100644 --- a/libavcodec/asvenc.c +++ b/libavcodec/asvenc.c @@ -23,15 +23,16 @@ * ASUS V1/V2 encoder. */ -#include libavutil/common.h +#include libavutil/attributes.h #include libavutil/mem.h #include asv.h #include avcodec.h +#include mathops.h #include mpeg12data.h static inline void asv2_put_bits(PutBitContext *pb, int n, int v){ -put_bits(pb, n, av_reverse[ v (8-n) ]); +put_bits(pb, n, ff_reverse[ v (8-n) ]); } static inline void asv1_put_level(PutBitContext *pb, int level){ @@ -226,7 +227,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, else{ int i; for(i=0; i4*size; i++) -pkt-data[i] = av_reverse[pkt-data[i]]; +pkt-data[i] = ff_reverse[pkt-data[i]]; } pkt-size = size*4; diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 93ea9e2..eec2f6d 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -29,6 +29,7 @@ */ #include avcodec.h +#include mathops.h #include get_bits.h #include put_bits.h @@ -114,10 +115,10 @@ static int alloc_table(VLC *vlc, int size, int use_static) } static av_always_inline uint32_t bitswap_32(uint32_t x) { -return (uint32_t)av_reverse[x0xFF]24 - | (uint32_t)av_reverse[(x8)0xFF]16 - | (uint32_t)av_reverse[(x16)0xFF]8 - | (uint32_t)av_reverse[x24]; +return (uint32_t)ff_reverse[x0xFF]24 + | (uint32_t)ff_reverse[(x8)0xFF]16 + | (uint32_t)ff_reverse[(x16)0xFF]8 + | (uint32_t)ff_reverse[x24]; } typedef struct { diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 0fa7922..76592d6 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -23,11 +23,13 @@ * @file * Intel Indeo 2 decoder. */ + #define BITSTREAM_READER_LE +#include libavutil/attributes.h #include avcodec.h #include get_bits.h #include indeo2data.h -#include libavutil/common.h +#include mathops.h typedef struct Ir2Context{ AVCodecContext *avctx; @@ -168,7 +170,7 @@ static int ir2_decode_frame(AVCodecContext *avctx, /* decide whether frame uses deltas or not */ #ifndef BITSTREAM_READER_LE for (i = 0; i buf_size; i++) -buf[i] = av_reverse[buf[i]]; +buf[i] = ff_reverse[buf[i]]; #endif init_get_bits(s-gb, buf + start, (buf_size - start) * 8); diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index d48014c..149fffe 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -27,10 +27,11 @@ */ #define BITSTREAM_READER_LE +#include libavutil/attributes.h #include avcodec.h #include get_bits.h +#include mathops.h #include ivi_common.h -#include libavutil/common.h #include ivi_dsp.h extern const IVIHuffDesc ff_ivi_mb_huff_desc[8]; /// static macroblock huffman tables @@ -48,9 +49,9 @@ static uint16_t inv_bits(uint16_t val, int nbits) uint16_t res; if (nbits = 8) { -res = av_reverse[val] (8-nbits); +res = ff_reverse[val] (8-nbits); } else -res = ((av_reverse[val 0xFF]
Re: [libav-devel] Fix for FFMPEG vp8dec loopfilter delta values reset at keyframes
On 10/12/2012 12:42 PM, Sami Pietilä wrote: Hi all, while testing a VP8 encoder I found a mismatch between FFMPEG and libvpx VP8 decoders. The reason for this mismatch is that FFMPEG doesn't reset loopfilter delta values at keyframes. Patch that fixes the issue is below. I've verified that the output of ffmpeg after this patch matches libvpx. If you need I can send you a stream that shows the issue. Would be nice to have a small vector to add it to fate, indeed. The patch itself looks like that this specific detail hadn't been considered, while implementing it. If you can point me where in the specification it is stated I'd like to point it in the commit message. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] Nut updates
This time I split the initial patch to ease re-review as Janne asked. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 1/5] nut: prioritize native tags
Use native tags instead of avi ones, simplifies a lot raw video codecs handling. --- libavformat/nutenc.c | 20 --- tests/ref/lavfi/crop | 2 +- tests/ref/lavfi/crop_scale | 2 +- tests/ref/lavfi/crop_scale_vflip | 2 +- tests/ref/lavfi/crop_vflip | 2 +- tests/ref/lavfi/null | 2 +- tests/ref/lavfi/pixdesc | 114 +++ tests/ref/lavfi/pixfmts_copy | 114 +++ tests/ref/lavfi/pixfmts_crop | 82 ++-- tests/ref/lavfi/pixfmts_hflip| 82 ++-- tests/ref/lavfi/pixfmts_null | 114 +++ tests/ref/lavfi/pixfmts_pad | 34 ++-- tests/ref/lavfi/pixfmts_scale| 114 +++ tests/ref/lavfi/pixfmts_vflip| 114 +++ tests/ref/lavfi/scale200 | 2 +- tests/ref/lavfi/scale500 | 2 +- tests/ref/lavfi/vflip| 2 +- tests/ref/lavfi/vflip_crop | 2 +- tests/ref/lavfi/vflip_vflip | 2 +- 19 files changed, 408 insertions(+), 400 deletions(-) diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 4b1e663..78ef0ea 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -371,9 +371,16 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc){ } } +static const AVCodecTag * const nut_codec_tags[] = { +ff_nut_video_tags, ff_nut_subtitle_tags, +ff_codec_bmp_tags, ff_codec_wav_tags, 0 +}; + static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){ NUTContext *nut = avctx-priv_data; AVCodecContext *codec = st-codec; +unsigned codec_tag = av_codec_get_tag(nut_codec_tags, codec-codec_id); + ff_put_v(bc, i); switch(codec-codec_type){ case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break; @@ -382,8 +389,12 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream default : ff_put_v(bc, 3); break; } ff_put_v(bc, 4); -if (codec-codec_tag){ -avio_wl32(bc, codec-codec_tag); + +if (!codec_tag) +codec_tag = codec-codec_tag; + +if (codec_tag) { +avio_wl32(bc, codec_tag); } else { av_log(avctx, AV_LOG_ERROR, No codec tag defined for stream %d\n, i); return AVERROR(EINVAL); @@ -873,8 +884,5 @@ AVOutputFormat ff_nut_muxer = { .write_packet = nut_write_packet, .write_trailer = nut_write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, -.codec_tag = (const AVCodecTag * const []){ -ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 -}, +.codec_tag = nut_codec_tags, }; diff --git a/tests/ref/lavfi/crop b/tests/ref/lavfi/crop index 32041c2..81ce4d1 100644 --- a/tests/ref/lavfi/crop +++ b/tests/ref/lavfi/crop @@ -1 +1 @@ -crop3d163f156eaddf41d2be20736f973539 +crop64e8f986d4cc67ec6797f5adb486e43f diff --git a/tests/ref/lavfi/crop_scale b/tests/ref/lavfi/crop_scale index 82e5394..4eb20c8 100644 --- a/tests/ref/lavfi/crop_scale +++ b/tests/ref/lavfi/crop_scale @@ -1 +1 @@ -crop_scale 0a3d45d58b805b8c47416b9239535f94 +crop_scale 011cb96fad3d86823e4441e305814834 diff --git a/tests/ref/lavfi/crop_scale_vflip b/tests/ref/lavfi/crop_scale_vflip index 07c729a..a89297a 100644 --- a/tests/ref/lavfi/crop_scale_vflip +++ b/tests/ref/lavfi/crop_scale_vflip @@ -1 +1 @@ -crop_scale_vflipe88a4dfb960d0bb28ee875567bedde5d +crop_scale_vflipf2b3800ab986d147b8ed5ebae67152df diff --git a/tests/ref/lavfi/crop_vflip b/tests/ref/lavfi/crop_vflip index a3f8200..759d744 100644 --- a/tests/ref/lavfi/crop_vflip +++ b/tests/ref/lavfi/crop_vflip @@ -1 +1 @@ -crop_vflip 628542e17b6900ee79b1429183ae01b0 +crop_vflip f9a15b41ea4034a15d39a2b6f649f1c5 diff --git a/tests/ref/lavfi/null b/tests/ref/lavfi/null index 3c3b7b7..dcb6bdf 100644 --- a/tests/ref/lavfi/null +++ b/tests/ref/lavfi/null @@ -1 +1 @@ -nulleba2f135a08829387e2f698ff72a2939 +null46235acb958138b6a77976601b7045ec diff --git a/tests/ref/lavfi/pixdesc b/tests/ref/lavfi/pixdesc index dc1b857..c142ba2 100644 --- a/tests/ref/lavfi/pixdesc +++ b/tests/ref/lavfi/pixdesc @@ -1,66 +1,66 @@ -abgr037bf9df6a765520ad6d490066bf4b89 -argbc442a8261c2265a07212ef0f72e35f5a -bgr24 0d0cb38ab3fa0b2ec0865c14f78b217b -bgr444bed9ea9307d21b162225b8b2c524cf9477 -bgr444le88035350e9da3a8f67387890b956f0bc -bgr48be 00624e6c7ec7ab19897ba2f0a3257fe8 -bgr48le d02c235ebba7167881ca2d576497ff84 -bgr4_byte 50d23cc82d9dcef2fd12adb81fb9b806 -bgr555be49f01b1f1f0c84fd9e776dd34cc3c280 -bgr555le378d6ac4223651a1adcbf94a3d0d807b -bgr565be
[libav-devel] [PATCH 2/5] nut: support higher depth pcm codecs
--- libavformat/nut.c| 20 libavformat/nut.h| 1 + libavformat/nutdec.c | 9 +++-- libavformat/nutenc.c | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/libavformat/nut.c b/libavformat/nut.c index 6a68e28..ea6ff23 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -89,6 +89,26 @@ const AVCodecTag ff_nut_video_tags[] = { { AV_CODEC_ID_NONE, 0 } }; +const AVCodecTag ff_nut_audio_tags[] = { +{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_NONE, 0 } +}; + void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){ int i; for(i=0; inut-avf-nb_streams; i++){ diff --git a/libavformat/nut.h b/libavformat/nut.h index 3f09689..933b9c5 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -105,6 +105,7 @@ typedef struct NUTContext { extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag ff_nut_audio_tags[]; typedef struct Dispositions { char str[9]; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index dd02aad..a3ff2e6 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut) break; case 1: st-codec-codec_type = AVMEDIA_TYPE_AUDIO; -st-codec-codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp); +st-codec-codec_id = av_codec_get_id((const AVCodecTag * const []) { +ff_codec_wav_tags, +ff_nut_audio_tags, +0 +}, +tmp); break; case 2: st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE; @@ -993,6 +998,6 @@ AVInputFormat ff_nut_demuxer = { .extensions = nut, .codec_tag = (const AVCodecTag * const []) { ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 +ff_nut_subtitle_tags, ff_nut_audio_tags, 0 }, }; diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 78ef0ea..ba79d8f 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -372,7 +372,7 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc){ } static const AVCodecTag * const nut_codec_tags[] = { -ff_nut_video_tags, ff_nut_subtitle_tags, +ff_nut_audio_tags, ff_nut_video_tags, ff_nut_subtitle_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0 }; -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 3/5] nut: support float PCM
--- libavformat/nut.c | 4 1 file changed, 4 insertions(+) diff --git a/libavformat/nut.c b/libavformat/nut.c index ea6ff23..d686fba 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -92,6 +92,10 @@ const AVCodecTag ff_nut_video_tags[] = { const AVCodecTag ff_nut_audio_tags[] = { { AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, { AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_F32BE, MKTAG(32 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F32LE, MKTAG('P', 'F', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_F64BE, MKTAG(64 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F64LE, MKTAG('P', 'F', 'D', 64 ) }, { AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') }, { AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) }, { AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') }, -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 4/5] nut: pcm planar support
--- doc/nut.texi | 2 +- libavformat/nut.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/nut.texi b/doc/nut.texi index dafbb39..1c23934 100644 --- a/doc/nut.texi +++ b/doc/nut.texi @@ -50,7 +50,7 @@ to be read big-endian. @end multitable type is S for signed integer, U for unsigned integer, F for IEEE float -interleaving is D for default, as a historical artefact. +interleaving is D for default, P is for planar. bits is 8/16/24/32 @example diff --git a/libavformat/nut.c b/libavformat/nut.c index d686fba..d56ad51 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -110,6 +110,8 @@ const AVCodecTag ff_nut_audio_tags[] = { { AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') }, { AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) }, { AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_S8_PLANAR,MKTAG('P', 'S', 'P', 8 ) }, +{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) }, { AV_CODEC_ID_NONE, 0 } }; -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 5/5] nut: cosmetic
Align the tags in ff_nut_audio_tags. --- libavformat/nut.c | 46 +++--- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/libavformat/nut.c b/libavformat/nut.c index d56ad51..89ebbd0 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -90,29 +90,29 @@ const AVCodecTag ff_nut_video_tags[] = { }; const AVCodecTag ff_nut_audio_tags[] = { -{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, -{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') }, -{ AV_CODEC_ID_PCM_F32BE, MKTAG(32 , 'D', 'F', 'P') }, -{ AV_CODEC_ID_PCM_F32LE, MKTAG('P', 'F', 'D', 32 ) }, -{ AV_CODEC_ID_PCM_F64BE, MKTAG(64 , 'D', 'F', 'P') }, -{ AV_CODEC_ID_PCM_F64LE, MKTAG('P', 'F', 'D', 64 ) }, -{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') }, -{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) }, -{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') }, -{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) }, -{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') }, -{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) }, -{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D', 8 ) }, -{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') }, -{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) }, -{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') }, -{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) }, -{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') }, -{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) }, -{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D', 8 ) }, -{ AV_CODEC_ID_PCM_S8_PLANAR,MKTAG('P', 'S', 'P', 8 ) }, -{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) }, -{ AV_CODEC_ID_NONE, 0 } +{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_MULAW,MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_F32BE,MKTAG(32 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F32LE,MKTAG('P', 'F', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_F64BE,MKTAG(64 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F64LE,MKTAG('P', 'F', 'D', 64 ) }, +{ AV_CODEC_ID_PCM_S16BE,MKTAG(16 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S16LE,MKTAG('P', 'S', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_S24BE,MKTAG(24 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S24LE,MKTAG('P', 'S', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_S32BE,MKTAG(32 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S32LE,MKTAG('P', 'S', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_S8, MKTAG('P', 'S', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_U16BE,MKTAG(16 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U16LE,MKTAG('P', 'U', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_U24BE,MKTAG(24 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U24LE,MKTAG('P', 'U', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_U32BE,MKTAG(32 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U32LE,MKTAG('P', 'U', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_U8, MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_S8_PLANAR,MKTAG('P', 'S', 'P', 8 ) }, +{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) }, +{ AV_CODEC_ID_NONE, 0 } }; void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){ -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] Fix for FFMPEG vp8dec loopfilter delta values reset at keyframes
Hi, On Fri, Oct 12, 2012 at 7:12 AM, Luca Barbato lu_z...@gentoo.org wrote: On 10/12/2012 12:42 PM, Sami Pietilä wrote: Hi all, while testing a VP8 encoder I found a mismatch between FFMPEG and libvpx VP8 decoders. The reason for this mismatch is that FFMPEG doesn't reset loopfilter delta values at keyframes. Patch that fixes the issue is below. I've verified that the output of ffmpeg after this patch matches libvpx. If you need I can send you a stream that shows the issue. Would be nice to have a small vector to add it to fate, indeed. The patch itself looks like that this specific detail hadn't been considered, while implementing it. If you can point me where in the specification it is stated I'd like to point it in the commit message. It's only natural for all codec state to be reset in a keyframe. It is supposed to be a re-entry point where all values are reset to defaults. The patch itself is LGTM, I was about to push it myself just now. Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 1/5] nut: prioritize native tags
On 2012-10-12 16:14:39 +0200, Luca Barbato wrote: Use native tags instead of avi ones, simplifies a lot raw video codecs handling. --- libavformat/nutenc.c | 20 --- tests/ref/lavfi/crop | 2 +- tests/ref/lavfi/crop_scale | 2 +- tests/ref/lavfi/crop_scale_vflip | 2 +- tests/ref/lavfi/crop_vflip | 2 +- tests/ref/lavfi/null | 2 +- tests/ref/lavfi/pixdesc | 114 +++ tests/ref/lavfi/pixfmts_copy | 114 +++ tests/ref/lavfi/pixfmts_crop | 82 ++-- tests/ref/lavfi/pixfmts_hflip| 82 ++-- tests/ref/lavfi/pixfmts_null | 114 +++ tests/ref/lavfi/pixfmts_pad | 34 ++-- tests/ref/lavfi/pixfmts_scale| 114 +++ tests/ref/lavfi/pixfmts_vflip| 114 +++ tests/ref/lavfi/scale200 | 2 +- tests/ref/lavfi/scale500 | 2 +- tests/ref/lavfi/vflip| 2 +- tests/ref/lavfi/vflip_crop | 2 +- tests/ref/lavfi/vflip_vflip | 2 +- 19 files changed, 408 insertions(+), 400 deletions(-) diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 4b1e663..78ef0ea 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -371,9 +371,16 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc){ } } +static const AVCodecTag * const nut_codec_tags[] = { +ff_nut_video_tags, ff_nut_subtitle_tags, +ff_codec_bmp_tags, ff_codec_wav_tags, 0 +}; + static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){ NUTContext *nut = avctx-priv_data; AVCodecContext *codec = st-codec; +unsigned codec_tag = av_codec_get_tag(nut_codec_tags, codec-codec_id); + ff_put_v(bc, i); switch(codec-codec_type){ case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break; @@ -382,8 +389,12 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream default : ff_put_v(bc, 3); break; } ff_put_v(bc, 4); -if (codec-codec_tag){ -avio_wl32(bc, codec-codec_tag); + +if (!codec_tag) +codec_tag = codec-codec_tag; + +if (codec_tag) { +avio_wl32(bc, codec_tag); } else { av_log(avctx, AV_LOG_ERROR, No codec tag defined for stream %d\n, i); return AVERROR(EINVAL); @@ -873,8 +884,5 @@ AVOutputFormat ff_nut_muxer = { .write_packet = nut_write_packet, .write_trailer = nut_write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, -.codec_tag = (const AVCodecTag * const []){ -ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 -}, +.codec_tag = nut_codec_tags, ok if you have verified that indeed only the tags cause the fate ref changes. Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] avfilter: call x86 init functions under if (ARCH_X86), not if (HAVE_MMX)
--- libavfilter/vf_gradfun.c |2 +- libavfilter/vf_yadif.c |2 +- libavfilter/x86/Makefile |5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 7fbcf1a..2ee8b5d 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -135,7 +135,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) gf-blur_line = ff_gradfun_blur_line_c; gf-filter_line = ff_gradfun_filter_line_c; -if (HAVE_MMX) +if (ARCH_X86) ff_gradfun_init_x86(gf); av_log(ctx, AV_LOG_VERBOSE, threshold:%.2f radius:%d\n, thresh, gf-radius); diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index 947aaac..1c605d9 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -400,7 +400,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) yadif-filter_line = filter_line_c; -if (HAVE_MMX) +if (ARCH_X86) ff_yadif_init_x86(yadif); av_log(ctx, AV_LOG_VERBOSE, mode:%d parity:%d auto_enable:%d\n, diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile index 46fc84f..4289f92 100644 --- a/libavfilter/x86/Makefile +++ b/libavfilter/x86/Makefile @@ -1,3 +1,4 @@ -MMX-OBJS-$(CONFIG_YADIF_FILTER) += x86/yadif.o -MMX-OBJS-$(CONFIG_GRADFUN_FILTER)+= x86/gradfun.o +OBJS-$(CONFIG_GRADFUN_FILTER)+= x86/gradfun.o +OBJS-$(CONFIG_YADIF_FILTER) += x86/yadif.o + YASM-OBJS-$(CONFIG_HQDN3D_FILTER)+= x86/hqdn3d.o -- 1.7.1 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] Fix for FFMPEG vp8dec loopfilter delta values reset at keyframes
On 10/12/2012 04:15 PM, Ronald S. Bultje wrote: If you can point me where in the specification it is stated I'd like to point it in the commit message. It's only natural for all codec state to be reset in a keyframe. It is supposed to be a re-entry point where all values are reset to defaults. The patch itself is LGTM, I was about to push it myself just now. Please do =) ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.
On 10/12/2012 04:04 PM, Diego Biurrun wrote: Please format the commit message as avcodec: move av_reverse table in libavcodec It is only used there. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] Fix for FFMPEG vp8dec loopfilter delta values reset at keyframes
Hi Sami, On Fri, Oct 12, 2012 at 3:42 AM, Sami Pietilä samipiet...@google.com wrote: Hi all, while testing a VP8 encoder I found a mismatch between FFMPEG and libvpx VP8 decoders. The reason for this mismatch is that FFMPEG doesn't reset loopfilter delta values at keyframes. Patch that fixes the issue is below. I've verified that the output of ffmpeg after this patch matches libvpx. If you need I can send you a stream that shows the issue. Br, Sami Pietila diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index 3f07b90..0bb5495 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -353,6 +353,7 @@ static int decode_frame_header(VP8Context *s, const uint8_t *buf, int buf_size) memcpy(s-prob-pred8x8c , vp8_pred8x8c_prob_inter , sizeof(s-prob-pred8x8c)); memcpy(s-prob-mvc , vp8_mv_default_prob , sizeof(s-prob-mvc)); memset(s-segmentation, 0, sizeof(s-segmentation)); +memset(s-lf_delta, 0, sizeof(s-lf_delta)); } Nice catch, thanks for noticing. I've applied it upstream (will flow to ffmpeg-devel in a few hours), and I'll update Chrome's tree ASAP. As Luca said on libav-devel, a test vector would be nice for archiving/regression testing purposes if it's not too much of a hassle. Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] Fix for FFMPEG vp8dec loopfilter delta values reset at keyframes
Hi, On Fri, Oct 12, 2012 at 7:18 AM, Luca Barbato lu_z...@gentoo.org wrote: On 10/12/2012 04:15 PM, Ronald S. Bultje wrote: If you can point me where in the specification it is stated I'd like to point it in the commit message. It's only natural for all codec state to be reset in a keyframe. It is supposed to be a re-entry point where all values are reset to defaults. The patch itself is LGTM, I was about to push it myself just now. Please do =) Pushed. Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] x86: call remaining init functions under if (ARCH_X86), not if (HAVE_MMX)
On Thu, Oct 11, 2012 at 01:45:54AM +0200, Janne Grunau wrote: On 2012-10-10 23:47:27 +0200, Diego Biurrun wrote: --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -1,9 +1,17 @@ -OBJS += x86/fmtconvert_init.o +OBJS += x86/dsputil_mmx.o \ + x86/fdct.o\ + x86/fmtconvert_init.o \ + x86/idct_mmx_xvid.o \ + x86/idct_sse2_xvid.o \ + x86/simple_idct.o \ all added files have inline mmx*/sse2 asm only under #if HAVE_INLINE_ASM resulting in bloat or build errors with historic compilers not supporting those instructions. That's arguably already the case if only MMX is enabled/supported. But unconditionally compiling unused code seems wrong. What compilers would that be? Something supporting gcc inline assembly, but not SSE instructions? --- a/libswscale/x86/Makefile +++ b/libswscale/x86/Makefile @@ -1,9 +1,9 @@ -OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o - -MMX-OBJS+= x86/rgb2rgb.o\ +OBJS+= x86/rgb2rgb.o\ this one has the same problem as the libavcodec files x86/swscale.o\ x86/yuv2rgb.o\ those are ok after fixing my remark below +OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o + YASM-OBJS += x86/input.o \ x86/output.o \ x86/scale.o \ diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index ba7990e..4b9ed19 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -302,18 +302,18 @@ INPUT_FUNCS(sse2); INPUT_FUNCS(ssse3); INPUT_FUNCS(avx); updateMMXDitherTables further above in the file should be wrapped with #if HAVE_MMX_INLINE Why? It's called under that condition, so with --disable-mmx it will be unused, but that should be harmless... Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/5] nut: support higher depth pcm codecs
On 2012-10-12 16:14:40 +0200, Luca Barbato wrote: --- libavformat/nut.c| 20 libavformat/nut.h| 1 + libavformat/nutdec.c | 9 +++-- libavformat/nutenc.c | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/libavformat/nut.c b/libavformat/nut.c index 6a68e28..ea6ff23 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -89,6 +89,26 @@ const AVCodecTag ff_nut_video_tags[] = { { AV_CODEC_ID_NONE, 0 } }; +const AVCodecTag ff_nut_audio_tags[] = { +{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_NONE, 0 } +}; + void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){ int i; for(i=0; inut-avf-nb_streams; i++){ diff --git a/libavformat/nut.h b/libavformat/nut.h index 3f09689..933b9c5 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -105,6 +105,7 @@ typedef struct NUTContext { extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag ff_nut_audio_tags[]; typedef struct Dispositions { char str[9]; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index dd02aad..a3ff2e6 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut) break; case 1: st-codec-codec_type = AVMEDIA_TYPE_AUDIO; -st-codec-codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp); +st-codec-codec_id = av_codec_get_id((const AVCodecTag * const []) { +ff_codec_wav_tags, +ff_nut_audio_tags, +0 +}, +tmp); wouldn't it make more sense to prefer ff_nut_audio_tags here too? Not that duplicates are expected just for consistency reasons. break; case 2: st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE; @@ -993,6 +998,6 @@ AVInputFormat ff_nut_demuxer = { .extensions = nut, .codec_tag = (const AVCodecTag * const []) { ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 +ff_nut_subtitle_tags, ff_nut_audio_tags, 0 same here I guess. is there a reason why it doesn't share the list with the muxer? }, }; diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 78ef0ea..ba79d8f 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -372,7 +372,7 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc){ } static const AVCodecTag * const nut_codec_tags[] = { -ff_nut_video_tags, ff_nut_subtitle_tags, +ff_nut_audio_tags, ff_nut_video_tags, ff_nut_subtitle_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0 }; ok Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] avutil: Duplicate ff_log2_tab instead of sharing it across libs
On Wed, 10 Oct 2012, Diego Biurrun wrote: The table is so small that the space gain is not worth the performance overhead of cross-library access. --- Now dropping an instance into libavformat as well, which also accesses the table directly. libavcodec/Makefile |1 + libavcodec/log2_tab.c |1 + libavformat/Makefile|1 + libavformat/log2_tab.c |1 + libavutil/Makefile |1 + libavutil/log2_tab.c| 30 ++ libavutil/mathematics.c | 11 --- 7 files changed, 35 insertions(+), 11 deletions(-) create mode 100644 libavcodec/log2_tab.c create mode 100644 libavformat/log2_tab.c create mode 100644 libavutil/log2_tab.c LGTM // Martin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/5] nut: support float PCM
On 2012-10-12 16:14:41 +0200, Luca Barbato wrote: --- libavformat/nut.c | 4 1 file changed, 4 insertions(+) diff --git a/libavformat/nut.c b/libavformat/nut.c index ea6ff23..d686fba 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -92,6 +92,10 @@ const AVCodecTag ff_nut_video_tags[] = { const AVCodecTag ff_nut_audio_tags[] = { { AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, { AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_F32BE, MKTAG(32 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F32LE, MKTAG('P', 'F', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_F64BE, MKTAG(64 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F64LE, MKTAG('P', 'F', 'D', 64 ) }, { AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') }, { AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) }, { AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') }, this and patch 4/5 and 5/5 are already oked and are still ok Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.
On Fri, 12 Oct 2012, Diego Biurrun wrote: --- Now with attribute_deprecated and w/o stupid copy and paste bug. libavcodec/asvdec.c |7 --- libavcodec/asvenc.c |7 --- libavcodec/bitstream.c |9 + libavcodec/indeo2.c |6 -- libavcodec/ivi_common.c |7 --- libavcodec/mathops.h|1 + libavcodec/mathtables.c | 19 +++ libavcodec/pcm.c| 11 ++- libavcodec/s302m.c | 39 --- libavcodec/tiff.c |7 --- libavcodec/vble.c |3 ++- libavcodec/wnv1.c |6 +++--- libavcodec/xbmenc.c |4 ++-- libavutil/common.h |6 +- libavutil/mathematics.c |4 libavutil/version.h |3 +++ 16 files changed, 90 insertions(+), 49 deletions(-) LGTM // Martin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] avfilter: call x86 init functions under if (ARCH_X86), not if (HAVE_MMX)
On 2012-10-12 16:18:13 +0200, Diego Biurrun wrote: --- libavfilter/vf_gradfun.c |2 +- libavfilter/vf_yadif.c |2 +- libavfilter/x86/Makefile |5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 7fbcf1a..2ee8b5d 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -135,7 +135,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) gf-blur_line = ff_gradfun_blur_line_c; gf-filter_line = ff_gradfun_filter_line_c; -if (HAVE_MMX) +if (ARCH_X86) ff_gradfun_init_x86(gf); av_log(ctx, AV_LOG_VERBOSE, threshold:%.2f radius:%d\n, thresh, gf-radius); diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index 947aaac..1c605d9 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -400,7 +400,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) yadif-filter_line = filter_line_c; -if (HAVE_MMX) +if (ARCH_X86) ff_yadif_init_x86(yadif); av_log(ctx, AV_LOG_VERBOSE, mode:%d parity:%d auto_enable:%d\n, diff --git a/libavfilter/x86/Makefile b/libavfilter/x86/Makefile index 46fc84f..4289f92 100644 --- a/libavfilter/x86/Makefile +++ b/libavfilter/x86/Makefile @@ -1,3 +1,4 @@ -MMX-OBJS-$(CONFIG_YADIF_FILTER) += x86/yadif.o -MMX-OBJS-$(CONFIG_GRADFUN_FILTER)+= x86/gradfun.o +OBJS-$(CONFIG_GRADFUN_FILTER)+= x86/gradfun.o +OBJS-$(CONFIG_YADIF_FILTER) += x86/yadif.o + YASM-OBJS-$(CONFIG_HQDN3D_FILTER)+= x86/hqdn3d.o ok Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] Move av_reverse table to libavcodec; it is only used there.
Luca Barbato lu_z...@gentoo.org writes: On 10/12/2012 04:04 PM, Diego Biurrun wrote: Please format the commit message as avcodec: move av_reverse table in libavcodec Move _to_. -- Måns Rullgård m...@mansr.com ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] x86: call remaining init functions under if (ARCH_X86), not if (HAVE_MMX)
On 2012-10-12 16:23:54 +0200, Diego Biurrun wrote: On Thu, Oct 11, 2012 at 01:45:54AM +0200, Janne Grunau wrote: On 2012-10-10 23:47:27 +0200, Diego Biurrun wrote: --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -1,9 +1,17 @@ -OBJS += x86/fmtconvert_init.o +OBJS += x86/dsputil_mmx.o \ + x86/fdct.o\ + x86/fmtconvert_init.o \ + x86/idct_mmx_xvid.o \ + x86/idct_sse2_xvid.o \ + x86/simple_idct.o \ all added files have inline mmx*/sse2 asm only under #if HAVE_INLINE_ASM resulting in bloat or build errors with historic compilers not supporting those instructions. That's arguably already the case if only MMX is enabled/supported. But unconditionally compiling unused code seems wrong. What compilers would that be? Something supporting gcc inline assembly, but not SSE instructions? probably only old gcc versions --- a/libswscale/x86/Makefile +++ b/libswscale/x86/Makefile @@ -1,9 +1,9 @@ -OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o - -MMX-OBJS+= x86/rgb2rgb.o\ +OBJS+= x86/rgb2rgb.o\ this one has the same problem as the libavcodec files x86/swscale.o\ x86/yuv2rgb.o\ those are ok after fixing my remark below +OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o + YASM-OBJS += x86/input.o \ x86/output.o \ x86/scale.o \ diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index ba7990e..4b9ed19 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -302,18 +302,18 @@ INPUT_FUNCS(sse2); INPUT_FUNCS(ssse3); INPUT_FUNCS(avx); updateMMXDitherTables further above in the file should be wrapped with #if HAVE_MMX_INLINE Why? It's called under that condition, so with --disable-mmx it will be unused, but that should be harmless... same as above Janne ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/5] nut: support higher depth pcm codecs
On 10/12/2012 04:22 PM, Janne Grunau wrote: On 2012-10-12 16:14:40 +0200, Luca Barbato wrote: --- libavformat/nut.c| 20 libavformat/nut.h| 1 + libavformat/nutdec.c | 9 +++-- libavformat/nutenc.c | 2 +- 4 files changed, 29 insertions(+), 3 deletions(-) diff --git a/libavformat/nut.c b/libavformat/nut.c index 6a68e28..ea6ff23 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -89,6 +89,26 @@ const AVCodecTag ff_nut_video_tags[] = { { AV_CODEC_ID_NONE, 0 } }; +const AVCodecTag ff_nut_audio_tags[] = { +{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_NONE, 0 } +}; + void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){ int i; for(i=0; inut-avf-nb_streams; i++){ diff --git a/libavformat/nut.h b/libavformat/nut.h index 3f09689..933b9c5 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -105,6 +105,7 @@ typedef struct NUTContext { extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag ff_nut_audio_tags[]; typedef struct Dispositions { char str[9]; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index dd02aad..a3ff2e6 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut) break; case 1: st-codec-codec_type = AVMEDIA_TYPE_AUDIO; -st-codec-codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp); +st-codec-codec_id = av_codec_get_id((const AVCodecTag * const []) { +ff_codec_wav_tags, +ff_nut_audio_tags, +0 +}, +tmp); wouldn't it make more sense to prefer ff_nut_audio_tags here too? Not that duplicates are expected just for consistency reasons. Currently it doesn't change the result, I can switch them for consistency though. same here I guess. is there a reason why it doesn't share the list with the muxer? Can be done easily I guess should I split another patch for this purpose? lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/3] nut: pcm planar support
On 10/11/2012 07:01 PM, Luca Barbato wrote: --- doc/nut.texi | 2 +- libavformat/nut.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/nut.texi b/doc/nut.texi index dafbb39..1c23934 100644 --- a/doc/nut.texi +++ b/doc/nut.texi @@ -50,7 +50,7 @@ to be read big-endian. @end multitable type is S for signed integer, U for unsigned integer, F for IEEE float -interleaving is D for default, as a historical artefact. +interleaving is D for default, P is for planar. bits is 8/16/24/32 @example diff --git a/libavformat/nut.c b/libavformat/nut.c index 72b7575..cf63fc9 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -110,6 +110,8 @@ const AVCodecTag ff_nut_audio_tags[] = { { AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') }, { AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) }, { AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_S8_PLANAR,MKTAG('P', 'S', 'P', 8 ) }, No, PCM_S8_PLANAR is not a normal pcm codec. It is a variant of 8svx. It will not as expected work in NUT. -Justin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 2/2] nut: support high depth pcm codecs
--- libavformat/nut.c| 22 +- libavformat/nut.h| 1 + libavformat/nutdec.c | 7 ++- 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/libavformat/nut.c b/libavformat/nut.c index b666bff..7f64fea 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -90,8 +90,28 @@ const AVCodecTag ff_nut_video_tags[] = { { AV_CODEC_ID_NONE, 0 } }; +const AVCodecTag ff_nut_audio_tags[] = { +{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_MULAW, MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_S16BE, MKTAG(16 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S16LE, MKTAG('P', 'S', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_S24BE, MKTAG(24 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S24LE, MKTAG('P', 'S', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_S32BE, MKTAG(32 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S32LE, MKTAG('P', 'S', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_S8,MKTAG('P', 'S', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_U16BE, MKTAG(16 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U16LE, MKTAG('P', 'U', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_U24BE, MKTAG(24 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U24LE, MKTAG('P', 'U', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_U32BE, MKTAG(32 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U32LE, MKTAG('P', 'U', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_U8,MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_NONE, 0 } +}; + const AVCodecTag * const ff_nut_codec_tags[] = { -ff_nut_video_tags, ff_nut_subtitle_tags, +ff_nut_video_tags, ff_nut_audio_tags, ff_nut_subtitle_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0 }; diff --git a/libavformat/nut.h b/libavformat/nut.h index 335eceb..a91a109 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -105,6 +105,7 @@ typedef struct NUTContext { extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag ff_nut_audio_tags[]; extern const AVCodecTag * const ff_nut_codec_tags[]; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 8448e13..9b1891f 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut) break; case 1: st-codec-codec_type = AVMEDIA_TYPE_AUDIO; -st-codec-codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp); +st-codec-codec_id = av_codec_get_id((const AVCodecTag * const []) { +ff_nut_audio_tags, +ff_codec_wav_tags, +0 +}, +tmp); break; case 2: st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE; -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 1/2] nut: prioritize native tags
Use native tags instead of avi ones, simplifies a lot raw video codecs handling. --- libavformat/nut.c| 6 +++ libavformat/nut.h| 2 + libavformat/nutdec.c | 7 +-- libavformat/nutenc.c | 15 +++--- tests/ref/lavfi/crop | 2 +- tests/ref/lavfi/crop_scale | 2 +- tests/ref/lavfi/crop_scale_vflip | 2 +- tests/ref/lavfi/crop_vflip | 2 +- tests/ref/lavfi/null | 2 +- tests/ref/lavfi/pixdesc | 114 +++ tests/ref/lavfi/pixfmts_copy | 114 +++ tests/ref/lavfi/pixfmts_crop | 82 ++-- tests/ref/lavfi/pixfmts_hflip| 82 ++-- tests/ref/lavfi/pixfmts_null | 114 +++ tests/ref/lavfi/pixfmts_pad | 34 ++-- tests/ref/lavfi/pixfmts_scale| 114 +++ tests/ref/lavfi/pixfmts_vflip| 114 +++ tests/ref/lavfi/scale200 | 2 +- tests/ref/lavfi/scale500 | 2 +- tests/ref/lavfi/vflip| 2 +- tests/ref/lavfi/vflip_crop | 2 +- tests/ref/lavfi/vflip_vflip | 2 +- 22 files changed, 413 insertions(+), 405 deletions(-) diff --git a/libavformat/nut.c b/libavformat/nut.c index 6a68e28..b666bff 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -22,6 +22,7 @@ #include libavutil/mathematics.h #include libavutil/tree.h #include nut.h +#include riff.h #include internal.h const AVCodecTag ff_nut_subtitle_tags[] = { @@ -89,6 +90,11 @@ const AVCodecTag ff_nut_video_tags[] = { { AV_CODEC_ID_NONE, 0 } }; +const AVCodecTag * const ff_nut_codec_tags[] = { +ff_nut_video_tags, ff_nut_subtitle_tags, +ff_codec_bmp_tags, ff_codec_wav_tags, 0 +}; + void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){ int i; for(i=0; inut-avf-nb_streams; i++){ diff --git a/libavformat/nut.h b/libavformat/nut.h index 3f09689..335eceb 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -106,6 +106,8 @@ typedef struct NUTContext { extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag * const ff_nut_codec_tags[]; + typedef struct Dispositions { char str[9]; int flag; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index dd02aad..8448e13 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -350,8 +350,8 @@ static int decode_stream_header(NUTContext *nut) case 0: st-codec-codec_type = AVMEDIA_TYPE_VIDEO; st-codec-codec_id = av_codec_get_id((const AVCodecTag * const []) { -ff_codec_bmp_tags, ff_nut_video_tags, +ff_codec_bmp_tags, 0 }, tmp); @@ -991,8 +991,5 @@ AVInputFormat ff_nut_demuxer = { .read_close = nut_read_close, .read_seek = read_seek, .extensions = nut, -.codec_tag = (const AVCodecTag * const []) { -ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 -}, +.codec_tag = ff_nut_codec_tags, }; diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 4b1e663..6338924 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -374,6 +374,8 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc){ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){ NUTContext *nut = avctx-priv_data; AVCodecContext *codec = st-codec; +unsigned codec_tag = av_codec_get_tag(ff_nut_codec_tags, codec-codec_id); + ff_put_v(bc, i); switch(codec-codec_type){ case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break; @@ -382,8 +384,12 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream default : ff_put_v(bc, 3); break; } ff_put_v(bc, 4); -if (codec-codec_tag){ -avio_wl32(bc, codec-codec_tag); + +if (!codec_tag) +codec_tag = codec-codec_tag; + +if (codec_tag) { +avio_wl32(bc, codec_tag); } else { av_log(avctx, AV_LOG_ERROR, No codec tag defined for stream %d\n, i); return AVERROR(EINVAL); @@ -873,8 +879,5 @@ AVOutputFormat ff_nut_muxer = { .write_packet = nut_write_packet, .write_trailer = nut_write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, -.codec_tag = (const AVCodecTag * const []){ -ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 -}, +.codec_tag
Re: [libav-devel] [PATCH 3/3] nut: pcm planar support
On 10/12/2012 05:22 PM, Justin Ruggles wrote: will not as expected work in NUT. Which planar codecs should we support? just S16? ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/3] nut: pcm planar support
On 10/12/2012 11:45 AM, Luca Barbato wrote: On 10/12/2012 05:22 PM, Justin Ruggles wrote: will not as expected work in NUT. Which planar codecs should we support? just S16? Sure, S16LE_PLANAR looks like it would work fine. -Justin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/3] nut: pcm planar support
On 10/12/2012 05:52 PM, Justin Ruggles wrote: On 10/12/2012 11:45 AM, Luca Barbato wrote: On 10/12/2012 05:22 PM, Justin Ruggles wrote: will not as expected work in NUT. Which planar codecs should we support? just S16? Sure, S16LE_PLANAR looks like it would work fine. If the remaining audio patches are fine I'd fold them. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] Nut improvements v2
Audio changes squashed in a single one. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 1/2] nut: prioritize native tags
Use native tags instead of avi ones, simplifies a lot raw video codecs handling. --- libavformat/nut.c| 6 +++ libavformat/nut.h| 2 + libavformat/nutdec.c | 7 +-- libavformat/nutenc.c | 15 +++--- tests/ref/lavfi/crop | 2 +- tests/ref/lavfi/crop_scale | 2 +- tests/ref/lavfi/crop_scale_vflip | 2 +- tests/ref/lavfi/crop_vflip | 2 +- tests/ref/lavfi/null | 2 +- tests/ref/lavfi/pixdesc | 114 +++ tests/ref/lavfi/pixfmts_copy | 114 +++ tests/ref/lavfi/pixfmts_crop | 82 ++-- tests/ref/lavfi/pixfmts_hflip| 82 ++-- tests/ref/lavfi/pixfmts_null | 114 +++ tests/ref/lavfi/pixfmts_pad | 34 ++-- tests/ref/lavfi/pixfmts_scale| 114 +++ tests/ref/lavfi/pixfmts_vflip| 114 +++ tests/ref/lavfi/scale200 | 2 +- tests/ref/lavfi/scale500 | 2 +- tests/ref/lavfi/vflip| 2 +- tests/ref/lavfi/vflip_crop | 2 +- tests/ref/lavfi/vflip_vflip | 2 +- 22 files changed, 413 insertions(+), 405 deletions(-) diff --git a/libavformat/nut.c b/libavformat/nut.c index 6a68e28..b666bff 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -22,6 +22,7 @@ #include libavutil/mathematics.h #include libavutil/tree.h #include nut.h +#include riff.h #include internal.h const AVCodecTag ff_nut_subtitle_tags[] = { @@ -89,6 +90,11 @@ const AVCodecTag ff_nut_video_tags[] = { { AV_CODEC_ID_NONE, 0 } }; +const AVCodecTag * const ff_nut_codec_tags[] = { +ff_nut_video_tags, ff_nut_subtitle_tags, +ff_codec_bmp_tags, ff_codec_wav_tags, 0 +}; + void ff_nut_reset_ts(NUTContext *nut, AVRational time_base, int64_t val){ int i; for(i=0; inut-avf-nb_streams; i++){ diff --git a/libavformat/nut.h b/libavformat/nut.h index 3f09689..335eceb 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -106,6 +106,8 @@ typedef struct NUTContext { extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag * const ff_nut_codec_tags[]; + typedef struct Dispositions { char str[9]; int flag; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index dd02aad..8448e13 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -350,8 +350,8 @@ static int decode_stream_header(NUTContext *nut) case 0: st-codec-codec_type = AVMEDIA_TYPE_VIDEO; st-codec-codec_id = av_codec_get_id((const AVCodecTag * const []) { -ff_codec_bmp_tags, ff_nut_video_tags, +ff_codec_bmp_tags, 0 }, tmp); @@ -991,8 +991,5 @@ AVInputFormat ff_nut_demuxer = { .read_close = nut_read_close, .read_seek = read_seek, .extensions = nut, -.codec_tag = (const AVCodecTag * const []) { -ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 -}, +.codec_tag = ff_nut_codec_tags, }; diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 4b1e663..6338924 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -374,6 +374,8 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc){ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){ NUTContext *nut = avctx-priv_data; AVCodecContext *codec = st-codec; +unsigned codec_tag = av_codec_get_tag(ff_nut_codec_tags, codec-codec_id); + ff_put_v(bc, i); switch(codec-codec_type){ case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break; @@ -382,8 +384,12 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream default : ff_put_v(bc, 3); break; } ff_put_v(bc, 4); -if (codec-codec_tag){ -avio_wl32(bc, codec-codec_tag); + +if (!codec_tag) +codec_tag = codec-codec_tag; + +if (codec_tag) { +avio_wl32(bc, codec_tag); } else { av_log(avctx, AV_LOG_ERROR, No codec tag defined for stream %d\n, i); return AVERROR(EINVAL); @@ -873,8 +879,5 @@ AVOutputFormat ff_nut_muxer = { .write_packet = nut_write_packet, .write_trailer = nut_write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, -.codec_tag = (const AVCodecTag * const []){ -ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 -}, +.codec_tag
[libav-devel] [PATCH 2/2] nut: support pcm codecs not mapped in avi
The native tags will be used all when available. --- doc/nut.texi | 2 +- libavformat/nut.c| 27 ++- libavformat/nut.h| 1 + libavformat/nutdec.c | 7 ++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/doc/nut.texi b/doc/nut.texi index dafbb39..1c23934 100644 --- a/doc/nut.texi +++ b/doc/nut.texi @@ -50,7 +50,7 @@ to be read big-endian. @end multitable type is S for signed integer, U for unsigned integer, F for IEEE float -interleaving is D for default, as a historical artefact. +interleaving is D for default, P is for planar. bits is 8/16/24/32 @example diff --git a/libavformat/nut.c b/libavformat/nut.c index b666bff..e367d1c 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -90,8 +90,33 @@ const AVCodecTag ff_nut_video_tags[] = { { AV_CODEC_ID_NONE, 0 } }; +const AVCodecTag ff_nut_audio_tags[] = { +{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_MULAW,MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_F32BE,MKTAG(32 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F32LE,MKTAG('P', 'F', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_F64BE,MKTAG(64 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F64LE,MKTAG('P', 'F', 'D', 64 ) }, +{ AV_CODEC_ID_PCM_S16BE,MKTAG(16 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S16LE,MKTAG('P', 'S', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_S24BE,MKTAG(24 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S24LE,MKTAG('P', 'S', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_S32BE,MKTAG(32 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S32LE,MKTAG('P', 'S', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_S8, MKTAG('P', 'S', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_U16BE,MKTAG(16 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U16LE,MKTAG('P', 'U', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_U24BE,MKTAG(24 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U24LE,MKTAG('P', 'U', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_U32BE,MKTAG(32 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U32LE,MKTAG('P', 'U', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_U8, MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) }, +{ AV_CODEC_ID_NONE, 0 } +}; + const AVCodecTag * const ff_nut_codec_tags[] = { -ff_nut_video_tags, ff_nut_subtitle_tags, +ff_nut_video_tags, ff_nut_audio_tags, ff_nut_subtitle_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0 }; diff --git a/libavformat/nut.h b/libavformat/nut.h index 335eceb..a91a109 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -105,6 +105,7 @@ typedef struct NUTContext { extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag ff_nut_audio_tags[]; extern const AVCodecTag * const ff_nut_codec_tags[]; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 8448e13..9b1891f 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut) break; case 1: st-codec-codec_type = AVMEDIA_TYPE_AUDIO; -st-codec-codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp); +st-codec-codec_id = av_codec_get_id((const AVCodecTag * const []) { +ff_nut_audio_tags, +ff_codec_wav_tags, +0 +}, +tmp); break; case 2: st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE; -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] Use proper return values in case of missing features
--- Alignment in alsdec.c changed as requested by Kostya. libavcodec/aac_adtstoasc_bsf.c |4 ++-- libavcodec/aacdec.c|8 libavcodec/ac3dec.c|2 +- libavcodec/alsdec.c|6 +++--- libavcodec/amrnbdec.c |2 +- libavcodec/amrwbdec.c |2 +- libavcodec/eac3dec.c |2 +- libavcodec/flacdec.c |2 +- libavcodec/mpc8.c |2 +- libavcodec/tta.c |2 +- libavcodec/wmaprodec.c |2 +- libavcodec/wmavoice.c |2 +- libavformat/rtpdec_qt.c|6 +++--- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/libavcodec/aac_adtstoasc_bsf.c b/libavcodec/aac_adtstoasc_bsf.c index a659934..df9a395 100644 --- a/libavcodec/aac_adtstoasc_bsf.c +++ b/libavcodec/aac_adtstoasc_bsf.c @@ -62,7 +62,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc, if (!hdr.crc_absent hdr.num_aac_frames 1) { av_log_missing_feature(avctx, Multiple RDBs per frame with CRC, 0); -return -1; +return AVERROR_PATCHWELCOME; } buf += AAC_ADTS_HEADER_SIZE + 2*!hdr.crc_absent; @@ -75,7 +75,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc, init_get_bits(gb, buf, buf_size * 8); if (get_bits(gb, 3) != 5) { av_log_missing_feature(avctx, PCE based channel configuration, where the PCE is not the first syntax element, 0); -return -1; +return AVERROR_PATCHWELCOME; } init_put_bits(pb, pce_data, MAX_PCE_SIZE); pce_size = avpriv_copy_pce_data(pb, gb)/8; diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 859414a..4a6d390 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -634,7 +634,7 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx, if (get_bits1(gb)) { // frameLengthFlag av_log_missing_feature(avctx, 960/120 MDCT window, 1); -return -1; +return AVERROR_PATCHWELCOME; } if (get_bits1(gb)) // dependsOnCoreCoder @@ -1635,7 +1635,7 @@ static int decode_ics(AACContext *ac, SingleChannelElement *sce, return -1; if (get_bits1(gb)) { av_log_missing_feature(ac-avctx, SSR, 1); -return -1; +return AVERROR_PATCHWELCOME; } } @@ -2324,7 +2324,7 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb) if (size 0) { if (hdr_info.num_aac_frames != 1) { av_log_missing_feature(ac-avctx, More than one AAC RDB per ADTS frame, 0); -return -1; +return AVERROR_PATCHWELCOME; } push_output_configuration(ac); if (hdr_info.chan_config) { @@ -2609,7 +2609,7 @@ static int latm_decode_audio_specific_config(struct LATMContext *latmctx, if (config_start_bit % 8) { av_log_missing_feature(latmctx-aac_ctx.avctx, Non-byte-aligned audio-specific config, 1); -return AVERROR_INVALIDDATA; +return AVERROR_PATCHWELCOME; } if (asclen = 0) return AVERROR_INVALIDDATA; diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 12770db..4336ca5 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -876,7 +876,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk) if (s-eac3 get_bits1(gbc)) { /* TODO: parse enhanced coupling strategy info */ av_log_missing_feature(s-avctx, Enhanced coupling, 1); -return -1; +return AVERROR_PATCHWELCOME; } /* determine which channels are coupled */ diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 1c3f0cb..ba9f3bb 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -427,9 +427,9 @@ static int check_specific_config(ALSDecContext *ctx) } \ } -MISSING_ERR(sconf-floating, Floating point decoding, -1); -MISSING_ERR(sconf-rlslms, Adaptive RLS-LMS prediction, -1); -MISSING_ERR(sconf-chan_sort,Channel sorting, 0); +MISSING_ERR(sconf-floating, Floating point decoding, AVERROR_PATCHWELCOME); +MISSING_ERR(sconf-rlslms,Adaptive RLS-LMS prediction, AVERROR_PATCHWELCOME); +MISSING_ERR(sconf-chan_sort, Channel sorting, 0); return error; } diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index d0ad76c..2cb06a6 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -951,7 +951,7 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data, } if (p-cur_frame_mode == MODE_DTX) { av_log_missing_feature(avctx, dtx mode, 1); -return -1; +return AVERROR_PATCHWELCOME; } if
Re: [libav-devel] [PATCH] Remove libmpeg2 #define remnants
On Thu, Oct 11, 2012 at 05:29:39PM +0200, Diego Biurrun wrote: --- libavcodec/avcodec.h |2 ++ libavcodec/version.h |3 +++ 2 files changed, 5 insertions(+), 0 deletions(-) OKed by Kostya on IRC. Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] De-doxygenize some top-level files
On Thu, Sep 06, 2012 at 10:09:04PM +0200, Diego Biurrun wrote: The Doxygen comments in those files are of purely file-internal interest. --- parse_meta_type() in avconv_opt.c still has Doxygen comments that are actually somewhat useful, suggestions welcome. avconv.c| 17 ++--- avconv.h| 14 ++ avconv_filter.c |6 ++ avconv_opt.c|8 +++- avplay.c| 30 +- 5 files changed, 30 insertions(+), 45 deletions(-) OKed by Kostya on IRC. Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/4] rangecoder: KR formatting cosmetics
On Fri, Oct 05, 2012 at 07:19:56PM +0200, Diego Biurrun wrote: --- libavcodec/rangecoder.c | 114 +++--- libavcodec/rangecoder.h | 92 -- 2 files changed, 106 insertions(+), 100 deletions(-) OKed by Kostya on IRC. Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 4/4] rangecoder-test: Set error message log level to error, instead of debug
On Fri, Oct 05, 2012 at 07:19:57PM +0200, Diego Biurrun wrote: --- libavcodec/rangecoder.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) OKed by Kostya on IRC. Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] Use proper return values in case of missing features
On Fri, Oct 12, 2012 at 08:29:15PM +0200, Diego Biurrun wrote: --- Alignment in alsdec.c changed as requested by Kostya. libavcodec/aac_adtstoasc_bsf.c |4 ++-- libavcodec/aacdec.c|8 libavcodec/ac3dec.c|2 +- libavcodec/alsdec.c|6 +++--- libavcodec/amrnbdec.c |2 +- libavcodec/amrwbdec.c |2 +- libavcodec/eac3dec.c |2 +- libavcodec/flacdec.c |2 +- libavcodec/mpc8.c |2 +- libavcodec/tta.c |2 +- libavcodec/wmaprodec.c |2 +- libavcodec/wmavoice.c |2 +- libavformat/rtpdec_qt.c|6 +++--- 13 files changed, 21 insertions(+), 21 deletions(-) OKed by Kostya on IRC. Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 3/3] fate: add avstring FATE test
On Fri, Oct 05, 2012 at 09:08:41PM +0200, Diego Biurrun wrote: --- tests/fate/libavutil.mak |4 tests/ref/fate/avstring | 27 +++ 2 files changed, 31 insertions(+), 0 deletions(-) create mode 100644 tests/ref/fate/avstring OKed by Kostya on IRC. Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] rangecoder-test: Return in case of an error
--- libavcodec/rangecoder.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/libavcodec/rangecoder.c b/libavcodec/rangecoder.c index b9095ba..fcadfe4 100644 --- a/libavcodec/rangecoder.c +++ b/libavcodec/rangecoder.c @@ -146,8 +146,10 @@ int main(void) memset(state, 128, sizeof(state)); for (i = 0; i SIZE; i++) -if ((r[i] 1) != get_rac(c, state)) +if ((r[i] 1) != get_rac(c, state)) { av_log(NULL, AV_LOG_ERROR, rac failure at %d\n, i); +return 1; +} return 0; } -- 1.7.1 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/2] nut: support pcm codecs not mapped in avi
On 10/12/2012 12:27 PM, Luca Barbato wrote: The native tags will be used all when available. --- doc/nut.texi | 2 +- libavformat/nut.c| 27 ++- libavformat/nut.h| 1 + libavformat/nutdec.c | 7 ++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/doc/nut.texi b/doc/nut.texi index dafbb39..1c23934 100644 --- a/doc/nut.texi +++ b/doc/nut.texi @@ -50,7 +50,7 @@ to be read big-endian. @end multitable type is S for signed integer, U for unsigned integer, F for IEEE float -interleaving is D for default, as a historical artefact. +interleaving is D for default, P is for planar. bits is 8/16/24/32 @example diff --git a/libavformat/nut.c b/libavformat/nut.c index b666bff..e367d1c 100644 --- a/libavformat/nut.c +++ b/libavformat/nut.c @@ -90,8 +90,33 @@ const AVCodecTag ff_nut_video_tags[] = { { AV_CODEC_ID_NONE, 0 } }; +const AVCodecTag ff_nut_audio_tags[] = { +{ AV_CODEC_ID_PCM_ALAW, MKTAG('A', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_MULAW,MKTAG('U', 'L', 'A', 'W') }, +{ AV_CODEC_ID_PCM_F32BE,MKTAG(32 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F32LE,MKTAG('P', 'F', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_F64BE,MKTAG(64 , 'D', 'F', 'P') }, +{ AV_CODEC_ID_PCM_F64LE,MKTAG('P', 'F', 'D', 64 ) }, +{ AV_CODEC_ID_PCM_S16BE,MKTAG(16 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S16LE,MKTAG('P', 'S', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_S24BE,MKTAG(24 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S24LE,MKTAG('P', 'S', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_S32BE,MKTAG(32 , 'D', 'S', 'P') }, +{ AV_CODEC_ID_PCM_S32LE,MKTAG('P', 'S', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_S8, MKTAG('P', 'S', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_U16BE,MKTAG(16 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U16LE,MKTAG('P', 'U', 'D', 16 ) }, +{ AV_CODEC_ID_PCM_U24BE,MKTAG(24 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U24LE,MKTAG('P', 'U', 'D', 24 ) }, +{ AV_CODEC_ID_PCM_U32BE,MKTAG(32 , 'D', 'U', 'P') }, +{ AV_CODEC_ID_PCM_U32LE,MKTAG('P', 'U', 'D', 32 ) }, +{ AV_CODEC_ID_PCM_U8, MKTAG('P', 'U', 'D', 8 ) }, +{ AV_CODEC_ID_PCM_S16LE_PLANAR, MKTAG('P', 'S', 'P', 16 ) }, +{ AV_CODEC_ID_NONE, 0 } +}; + const AVCodecTag * const ff_nut_codec_tags[] = { -ff_nut_video_tags, ff_nut_subtitle_tags, +ff_nut_video_tags, ff_nut_audio_tags, ff_nut_subtitle_tags, ff_codec_bmp_tags, ff_codec_wav_tags, 0 }; diff --git a/libavformat/nut.h b/libavformat/nut.h index 335eceb..a91a109 100644 --- a/libavformat/nut.h +++ b/libavformat/nut.h @@ -105,6 +105,7 @@ typedef struct NUTContext { extern const AVCodecTag ff_nut_subtitle_tags[]; extern const AVCodecTag ff_nut_video_tags[]; +extern const AVCodecTag ff_nut_audio_tags[]; extern const AVCodecTag * const ff_nut_codec_tags[]; diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 8448e13..9b1891f 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -358,7 +358,12 @@ static int decode_stream_header(NUTContext *nut) break; case 1: st-codec-codec_type = AVMEDIA_TYPE_AUDIO; -st-codec-codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp); +st-codec-codec_id = av_codec_get_id((const AVCodecTag * const []) { +ff_nut_audio_tags, +ff_codec_wav_tags, +0 +}, +tmp); break; case 2: st-codec-codec_type = AVMEDIA_TYPE_SUBTITLE; LGTM if tested. -Justin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] lavr: handle clipping in the float to s32 conversion
We cannot clip to INT_MAX because that value cannot be exactly represented by a float value and ends up overflowing during conversion anyway. We need to use a slightly smaller float value, which ends up with slightly inaccurate results for samples which clip or nearly clip, but it is close enough. Using doubles as intermediates in the conversion would be more accurate, but it takes about twice as much time. --- libavresample/x86/audio_convert.asm |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/libavresample/x86/audio_convert.asm b/libavresample/x86/audio_convert.asm index 2ebdbc1..25166af 100644 --- a/libavresample/x86/audio_convert.asm +++ b/libavresample/x86/audio_convert.asm @@ -28,6 +28,7 @@ SECTION_RODATA 32 pf_s32_inv_scale: times 8 dd 0x3000 pf_s32_scale: times 8 dd 0x4f00 +pf_s32_clip: times 8 dd 0x4eff pf_s16_inv_scale: times 4 dd 0x3800 pf_s16_scale: times 4 dd 0x4700 pb_shuf_unpack_even: db -1, -1, 0, 1, -1, -1, 2, 3, -1, -1, 8, 9, -1, -1, 10, 11 @@ -197,17 +198,22 @@ cglobal conv_flt_to_s16, 3,3,5, dst, src, len ;-- %macro CONV_FLT_TO_S32 0 -cglobal conv_flt_to_s32, 3,3,5, dst, src, len +cglobal conv_flt_to_s32, 3,3,6, dst, src, len lea lenq, [lend*4] add srcq, lenq add dstq, lenq neg lenq mova m4, [pf_s32_scale] +mova m5, [pf_s32_clip] .loop: mulps m0, m4, [srcq+lenq ] mulps m1, m4, [srcq+lenq+1*mmsize] mulps m2, m4, [srcq+lenq+2*mmsize] mulps m3, m4, [srcq+lenq+3*mmsize] +minps m0, m0, m5 +minps m1, m1, m5 +minps m2, m2, m5 +minps m3, m3, m5 cvtps2dq m0, m0 cvtps2dq m1, m1 cvtps2dq m2, m2 -- 1.7.1 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] lavr: handle clipping in the float to s32 conversion
On 10/12/2012 09:46 PM, Justin Ruggles wrote: We cannot clip to INT_MAX because that value cannot be exactly represented by a float value and ends up overflowing during conversion anyway. We need to use a slightly smaller float value, which ends up with slightly inaccurate results for samples which clip or nearly clip, but it is close enough. Using doubles as intermediates in the conversion would be more accurate, but it takes about twice as much time. --- libavresample/x86/audio_convert.asm |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) Works decently for my testcase. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] avstring-test: fix memory leaks
Signed-off-by: Mans Rullgard m...@mansr.com --- libavutil/avstring.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavutil/avstring.c b/libavutil/avstring.c index 9b88c0b..6b3a65c 100644 --- a/libavutil/avstring.c +++ b/libavutil/avstring.c @@ -197,10 +197,12 @@ int main(void) }; for (i=0; i FF_ARRAY_ELEMS(strings); i++) { -const char *p= strings[i]; +const char *p = strings[i], *q; printf(|%s|, p); -printf( - |%s|, av_get_token(p, :)); +q = av_get_token(p, :); +printf( - |%s|, q); printf( + |%s|\n, p); +av_free(q); } } -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] avstring-test: fix memory leaks
On 10/12/2012 11:28 PM, Mans Rullgard wrote: Signed-off-by: Mans Rullgard m...@mansr.com --- libavutil/avstring.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) Ok. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] eval-test: make table static const
Signed-off-by: Mans Rullgard m...@mansr.com --- libavutil/eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavutil/eval.c b/libavutil/eval.c index 9d17930..7a28dbe 100644 --- a/libavutil/eval.c +++ b/libavutil/eval.c @@ -564,7 +564,8 @@ int main(int argc, char **argv) { int i; double d; -const char **expr, *exprs[] = { +const char *const *expr; +static const char *const exprs[] = { , 1;2, -20, -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] eval-test: make table static const
On 10/13/2012 12:50 AM, Mans Rullgard wrote: Signed-off-by: Mans Rullgard m...@mansr.com --- libavutil/eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Ok. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 1/5] nut: prioritize native tags
On 10/12/2012 04:15 PM, Janne Grunau wrote: On 2012-10-12 16:14:39 +0200, Luca Barbato wrote: Use native tags instead of avi ones, simplifies a lot raw video codecs handling. --- libavformat/nutenc.c | 20 --- tests/ref/lavfi/crop | 2 +- tests/ref/lavfi/crop_scale | 2 +- tests/ref/lavfi/crop_scale_vflip | 2 +- tests/ref/lavfi/crop_vflip | 2 +- tests/ref/lavfi/null | 2 +- tests/ref/lavfi/pixdesc | 114 +++ tests/ref/lavfi/pixfmts_copy | 114 +++ tests/ref/lavfi/pixfmts_crop | 82 ++-- tests/ref/lavfi/pixfmts_hflip| 82 ++-- tests/ref/lavfi/pixfmts_null | 114 +++ tests/ref/lavfi/pixfmts_pad | 34 ++-- tests/ref/lavfi/pixfmts_scale| 114 +++ tests/ref/lavfi/pixfmts_vflip| 114 +++ tests/ref/lavfi/scale200 | 2 +- tests/ref/lavfi/scale500 | 2 +- tests/ref/lavfi/vflip| 2 +- tests/ref/lavfi/vflip_crop | 2 +- tests/ref/lavfi/vflip_vflip | 2 +- 19 files changed, 408 insertions(+), 400 deletions(-) diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 4b1e663..78ef0ea 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -371,9 +371,16 @@ static void write_mainheader(NUTContext *nut, AVIOContext *bc){ } } +static const AVCodecTag * const nut_codec_tags[] = { +ff_nut_video_tags, ff_nut_subtitle_tags, +ff_codec_bmp_tags, ff_codec_wav_tags, 0 +}; + static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream *st, int i){ NUTContext *nut = avctx-priv_data; AVCodecContext *codec = st-codec; +unsigned codec_tag = av_codec_get_tag(nut_codec_tags, codec-codec_id); + ff_put_v(bc, i); switch(codec-codec_type){ case AVMEDIA_TYPE_VIDEO: ff_put_v(bc, 0); break; @@ -382,8 +389,12 @@ static int write_streamheader(AVFormatContext *avctx, AVIOContext *bc, AVStream default : ff_put_v(bc, 3); break; } ff_put_v(bc, 4); -if (codec-codec_tag){ -avio_wl32(bc, codec-codec_tag); + +if (!codec_tag) +codec_tag = codec-codec_tag; + +if (codec_tag) { +avio_wl32(bc, codec_tag); } else { av_log(avctx, AV_LOG_ERROR, No codec tag defined for stream %d\n, i); return AVERROR(EINVAL); @@ -873,8 +884,5 @@ AVOutputFormat ff_nut_muxer = { .write_packet = nut_write_packet, .write_trailer = nut_write_trailer, .flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS, -.codec_tag = (const AVCodecTag * const []){ -ff_codec_bmp_tags, ff_nut_video_tags, ff_codec_wav_tags, -ff_nut_subtitle_tags, 0 -}, +.codec_tag = nut_codec_tags, ok if you have verified that indeed only the tags cause the fate ref changes. checked. pushing in a while the v2 set. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 1/3] configure: tms470: add mapping for -mfpu=vfpv3-d16 flag
Signed-off-by: Mans Rullgard m...@mansr.com --- configure | 1 + 1 file changed, 1 insertion(+) diff --git a/configure b/configure index 2890ab2..f770ca7 100755 --- a/configure +++ b/configure @@ -2219,6 +2219,7 @@ tms470_flags(){ -mfpu=neon) echo --float_support=vfpv3 --neon ;; -mfpu=vfp) echo --float_support=vfpv2;; -mfpu=vfpv3)echo --float_support=vfpv3;; +-mfpu=vfpv3-d16) echo --float_support=vfpv3d16;; -msoft-float) echo --float_support=vfplib ;; -O[0-3]|-mf=*) echo $flag;; -g) echo -g -mn ;; -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 3/3] build: tms470: work around glibc math.h problems
The glibc definitions of INFINITY and NAN do not work with the tms470 compiler, nor do our usual fallbacks. Signed-off-by: Mans Rullgard m...@mansr.com --- compat/tms470/math.h | 7 +++ configure| 1 + 2 files changed, 8 insertions(+) create mode 100644 compat/tms470/math.h diff --git a/compat/tms470/math.h b/compat/tms470/math.h new file mode 100644 index 000..1104d74 --- /dev/null +++ b/compat/tms470/math.h @@ -0,0 +1,7 @@ +#include_next math.h + +#undef INFINITY +#undef NAN + +#define INFINITY (*(const float*)((const unsigned []){ 0x7f80 })) +#define NAN (*(const float*)((const unsigned []){ 0x7fc0 })) diff --git a/configure b/configure index 5c03c02..7a6d8b6 100755 --- a/configure +++ b/configure @@ -2919,6 +2919,7 @@ test -n $libc_type enable $libc_type # hacks for compiler/libc/os combinations if enabled_all tms470 glibc; then +CPPFLAGS=-I${source_path}/compat/tms470 ${CPPFLAGS} add_cppflags -D__USER_LABEL_PREFIX__= add_cppflags -D__builtin_memset=memset add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 2/3] configure: improve tms470 compiler usage with glibc
Apply flags to work around glibc quirks only if glibc is detected, and add a few more such flags. Do not mess with as/ld settings in probe_cc. This is not the proper place. Signed-off-by: Mans Rullgard m...@mansr.com --- configure | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/configure b/configure index f770ca7..5c03c02 100755 --- a/configure +++ b/configure @@ -2299,11 +2299,8 @@ probe_cc(){ _type=tms470 _ident=$($_cc -version | head -n 1 | tr -s ' ') _flags='--gcc --abi=eabi -me' -_cflags='-D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=' _cc_e='-ppl -fe=$@' _cc_o='-fe=$@' -as_default=${cross_prefix}gcc -ld_default=${cross_prefix}gcc _depflags='-ppa -ppd=$(@:.o=.d)' _cflags_speed='-O3 -mf=5' _cflags_size='-O3 -mf=2' @@ -2919,6 +2916,15 @@ fi test -n $libc_type enable $libc_type +# hacks for compiler/libc/os combinations + +if enabled_all tms470 glibc; then +add_cppflags -D__USER_LABEL_PREFIX__= +add_cppflags -D__builtin_memset=memset +add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED +add_cflags -pds=48# incompatible redefinition of macro +fi + esc(){ echo $* | sed 's/%/%25/g;s/:/%3a/g' } -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] configure: separate option-arguments from options to POSIX commands
POSIX says this about option syntax: If the SYNOPSIS of a standard utility shows an option with a mandatory option-argument, a conforming application shall use separate arguments for that option and its option-argument. However, a conforming implementation shall also permit applications to specify the option and option-argument in the same argument string without intervening blank characters. Signed-off-by: Mans Rullgard m...@mansr.com --- configure | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/configure b/configure index 20bd3ae..2890ab2 100755 --- a/configure +++ b/configure @@ -2241,14 +2241,14 @@ probe_cc(){ if $_cc -v 21 | grep -q '^gcc.*LLVM'; then _type=llvm_gcc -gcc_extra_ver=$(expr $($_cc --version | head -n1) : '.*\((.*)\)') +gcc_extra_ver=$(expr $($_cc --version | head -n 1) : '.*\((.*)\)') _ident=llvm-gcc $($_cc -dumpversion) $gcc_extra_ver _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O3' _cflags_size='-Os' elif $_cc -v 21 | grep -qi ^gcc; then _type=gcc -gcc_version=$($_cc --version | head -n1) +gcc_version=$($_cc --version | head -n 1) gcc_basever=$($_cc -dumpversion) gcc_pkg_ver=$(expr $gcc_version : '[^ ]* \(([^)]*)\)') gcc_ext_ver=$(expr $gcc_version : .*$gcc_pkg_ver $gcc_basever \\(.*\\)) @@ -2260,19 +2260,19 @@ probe_cc(){ _cflags_size='-Os' elif $_cc --version 2/dev/null | grep -q Intel; then _type=icc -_ident=$($_cc --version | head -n1) +_ident=$($_cc --version | head -n 1) _depflags='-MMD' _cflags_speed='-O3' _cflags_size='-Os' _cflags_noopt='-O1' elif $_cc -v 21 | grep -q xlc; then _type=xlc -_ident=$($_cc -qversion 2/dev/null | head -n1) +_ident=$($_cc -qversion 2/dev/null | head -n 1) _cflags_speed='-O5' _cflags_size='-O5 -qcompact' elif $_cc -V 2/dev/null | grep -q Compaq; then _type=ccc -_ident=$($_cc -V | head -n1 | cut -d' ' -f1-3) +_ident=$($_cc -V | head -n 1 | cut -d ' ' -f 1-3) _DEPFLAGS='-M' debuglevel=3 _ldflags='-Wl,-z,now' # calls to libots crash without this @@ -2281,7 +2281,7 @@ probe_cc(){ elif $_cc --vsn 2/dev/null | grep -q ARM C/C++ Compiler; then test -d $sysroot || die No valid sysroot specified. _type=armcc -_ident=$($_cc --vsn | head -n1) +_ident=$($_cc --vsn | head -n 1) armcc_conf=$PWD/armcc.conf $_cc --arm_linux_configure \ --arm_linux_config_file=$armcc_conf \ @@ -2296,7 +2296,7 @@ probe_cc(){ _cflags_size='-Os' elif $_cc -version 2/dev/null | grep -Eq 'TMS470|TI ARM'; then _type=tms470 -_ident=$($_cc -version | head -n1 | tr -s ' ') +_ident=$($_cc -version | head -n 1 | tr -s ' ') _flags='--gcc --abi=eabi -me' _cflags='-D__gnuc_va_list=va_list -D__USER_LABEL_PREFIX__=' _cc_e='-ppl -fe=$@' @@ -2309,13 +2309,13 @@ probe_cc(){ _flags_filter=tms470_flags elif $_cc -v 21 | grep -q clang; then _type=clang -_ident=$($_cc --version | head -n1) +_ident=$($_cc --version | head -n 1) _depflags='-MMD' _cflags_speed='-O3' _cflags_size='-Os' elif $_cc -V 21 | grep -q Sun; then _type=suncc -_ident=$($_cc -V 21 | head -n1 | cut -d' ' -f 2-) +_ident=$($_cc -V 21 | head -n 1 | cut -d ' ' -f 2-) _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $ | sed -e 1s,^.*: ,$@: , -e \$$!s,\$$, \\\, -e 1!s,^.*: , , $(@:.o=.d)' _DEPFLAGS='-xM1 -xc99' _ldflags='-std=c99' @@ -2324,14 +2324,14 @@ probe_cc(){ _flags_filter=suncc_flags elif $_cc -v 21 | grep -q 'PathScale\|Path64'; then _type=pathscale -_ident=$($_cc -v 21 | head -n1 | tr -d :) +_ident=$($_cc -v 21 | head -n 1 | tr -d :) _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O2' _cflags_size='-Os' _flags_filter=pathscale_flags elif $_cc -v 21 | grep -q Open64; then _type=open64 -_ident=$($_cc -v 21 | head -n1 | tr -d :) +_ident=$($_cc -v 21 | head -n 1 | tr -d :) _depflags='-MMD -MF $(@:.o=.d) -MT $@' _cflags_speed='-O2' _cflags_size='-Os' @@ -2346,7 +2346,7 @@ probe_cc(){ _flags_filter=pgi_flags elif $_cc 21 | grep -q Microsoft; then _type=msvc -_ident=$($cc 21 | head -n1) +_ident=$($cc 21 | head -n 1) _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $ 21 | awk '\''/including/ { sub(/^.*file: */, ); gsub(/\\/, /); if (!match($$0, / /)) print $@:, $$0 }'\'' $(@:.o=.d)' _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs' _cflags_speed=-O2 @@ -2847,7 +2847,7 @@ case
[libav-devel] [PATCH 1/2] configure: work around bug in ash shell
The ash 'test' builtin misbehaves if the first operand of a binary operator looks like a unary operator. Signed-off-by: Mans Rullgard m...@mansr.com --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index bc3a218..b076945 100755 --- a/configure +++ b/configure @@ -592,7 +592,7 @@ print_config(){ } print_enabled(){ -test $1 = -n end= shift || end=\n +test x$1 = x-n end= shift || end=\n suf=$1 shift for v; do -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 2/2] configure: recognise Minix as OS
No special setup is required for Minix. Signed-off-by: Mans Rullgard m...@mansr.com --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index b076945..66806bf 100755 --- a/configure +++ b/configure @@ -2877,6 +2877,8 @@ case $target_os in add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT AVSERVERLDFLAGS= ;; +minix) +;; none) ;; *) -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] vc1: Use codec ID from AVCodecContext while parsing frame header
On 10/11/2012 1:23 PM, Kostya Shishkov wrote: On Thu, Oct 11, 2012 at 01:13:56PM -0400, Mashiat Sarker Shakkhar wrote: This fixes a segfault with samples that I have (both of them MPEG-TS). Looks like avctx-codec is not being set during parsing. --- libavcodec/vc1.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vc1.c b/libavcodec/vc1.c index c7edc25..a8dd38a 100644 --- a/libavcodec/vc1.c +++ b/libavcodec/vc1.c @@ -576,7 +576,7 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) if (v-finterpflag) v-interpfrm = get_bits1(gb); -if (v-s.avctx-codec-id == AV_CODEC_ID_MSS2) +if (v-s.avctx-codec_id == AV_CODEC_ID_MSS2) v-respic = v-rangered = v-multires = get_bits(gb, 2) == 1; -- probably OK Someone's gotta push it. It's been OK'd and it's trivial. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel