Re: [libav-devel] [PATCH] rangecoder-test: Return in case of an error
On Fri, Oct 12, 2012 at 09:15:27PM +0200, Diego Biurrun wrote: > --- > libavcodec/rangecoder.c |4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) ping Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 02/15] configure: simplify argument handling in check_ld
On Mon, Oct 15, 2012 at 04:11:15AM +0100, Mans Rullgard wrote: > Use the existing filter functions instead of open-coding the > separation of general flags and libraries. > > Signed-off-by: Mans Rullgard > --- > configure | 7 ++- > 1 file changed, 2 insertions(+), 5 deletions(-) LGTM Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 12/15] tiny_psnr: fix range calculation for sample size of 32 bits
On 10/14/2012 11:11 PM, Mans Rullgard wrote: > For a sample size of 32 bits, the shift would overflow producing > undefined results. Incidentally, in the only test currently using > 32-bit samples, the output matches the reference exactly on most > systems meaning the bad 'max' value is never used. > > Signed-off-by: Mans Rullgard > --- > tests/tiny_psnr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c > index a53a670..b1bcc16 100644 > --- a/tests/tiny_psnr.c > +++ b/tests/tiny_psnr.c > @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) > } > } > > -max = (1 << (8 * len)) - 1; > +max = (1LL << (8 * len)) - 1; > > f[0] = fopen(argv[1], "rb"); > f[1] = fopen(argv[2], "rb"); LGTM -Justin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 09/15] swscale: avoid pointless use of compound literals
On Sun, Oct 14, 2012 at 8:11 PM, Mans Rullgard wrote: > Some compilers (e.g. old gcc) have trouble with these. > > Signed-off-by: Mans Rullgard > --- > libswscale/swscale_unscaled.c | 17 + > 1 file changed, 9 insertions(+), 8 deletions(-) > > diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c > index 70eff72..5efc647 100644 > --- a/libswscale/swscale_unscaled.c > +++ b/libswscale/swscale_unscaled.c > @@ -396,6 +396,11 @@ static int planarRgbToRgbWrapper(SwsContext *c, const > uint8_t *src[], > uint8_t *dst[], int dstStride[]) > { > int alpha_first = 0; > +const uint8_t *src102[] = { src[1], src[0], src[2] }; > +const uint8_t *src201[] = { src[2], src[0], src[1] }; > +int stride102[] = { srcStride[1], srcStride[0], srcStride[2] }; > +int stride201[] = { srcStride[2], srcStride[0], srcStride[1] }; > + > if (c->srcFormat != AV_PIX_FMT_GBRP) { > av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> > %s\n", > av_get_pix_fmt_name(c->srcFormat), > @@ -405,15 +410,13 @@ static int planarRgbToRgbWrapper(SwsContext *c, const > uint8_t *src[], > > switch (c->dstFormat) { > case AV_PIX_FMT_BGR24: > -gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] }, > - (int []) { srcStride[1], srcStride[0], srcStride[2] > }, > +gbr24ptopacked24(src102, stride102, > dst[0] + srcSliceY * dstStride[0], dstStride[0], > srcSliceH, c->srcW); > break; I find it slightly hilarious that there is no way in hell this would have gotten in had the compiler's name been "gcc". Why don't you use c99-to-c89 for this so-called "compiler"? Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 08/15] libm: add fallbacks for various single-precision functions
Signed-off-by: Mans Rullgard --- configure | 16 libavcodec/aacps_tablegen.h | 1 + libavutil/libm.h| 40 3 files changed, 57 insertions(+) diff --git a/configure b/configure index 5426c92..90df2c2 100755 --- a/configure +++ b/configure @@ -1136,6 +1136,8 @@ HAVE_LIST=" arpa_inet_h asm_mod_q asm_mod_y +atanf +atan2f attribute_may_alias attribute_packed cbrtf @@ -1143,6 +1145,7 @@ HAVE_LIST=" cmov cpunop CryptGenRandom +cosf dcbzl dev_bktr_ioctl_bt848_h dev_bktr_ioctl_meteor_h @@ -1156,6 +1159,7 @@ HAVE_LIST=" dxva_h ebp_available ebx_available +expf exp2 exp2f fast_64bit @@ -1182,6 +1186,7 @@ HAVE_LIST=" isnan jack_port_get_latency_range ldbrx +ldexpf libdc1394_1 libdc1394_2 llrint @@ -1191,6 +1196,7 @@ HAVE_LIST=" localtime_r log2 log2f +log10f loongson lrint lrintf @@ -1207,6 +1213,7 @@ HAVE_LIST=" nanosleep poll_h posix_memalign +powf rdtsc rint round @@ -1216,6 +1223,7 @@ HAVE_LIST=" sdl_video_size setmode setrlimit +sinf Sleep sndio_h socklen_t @@ -3295,20 +3303,28 @@ done check_lib math.h sin -lm && LIBM="-lm" enabled vaapi && require vaapi va/va.h vaInitialize -lva +check_mathfunc atanf +check_mathfunc atan2f check_mathfunc cbrtf +check_mathfunc cosf +check_mathfunc expf check_mathfunc exp2 check_mathfunc exp2f check_mathfunc isinf check_mathfunc isnan +check_mathfunc ldexpf check_mathfunc llrint check_mathfunc llrintf check_mathfunc log2 check_mathfunc log2f +check_mathfunc log10f check_mathfunc lrint check_mathfunc lrintf +check_mathfunc powf check_mathfunc rint check_mathfunc round check_mathfunc roundf +check_mathfunc sinf check_mathfunc trunc check_mathfunc truncf diff --git a/libavcodec/aacps_tablegen.h b/libavcodec/aacps_tablegen.h index bd4e695..0c610ed 100644 --- a/libavcodec/aacps_tablegen.h +++ b/libavcodec/aacps_tablegen.h @@ -31,6 +31,7 @@ #include "libavcodec/aacps_tables.h" #else #include "libavutil/common.h" +#include "libavutil/libm.h" #include "libavutil/mathematics.h" #include "libavutil/mem.h" #define NR_ALLPASS_BANDS20 30 diff --git a/libavutil/libm.h b/libavutil/libm.h index 8305b7c..d6c2cf8 100644 --- a/libavutil/libm.h +++ b/libavutil/libm.h @@ -29,6 +29,21 @@ #include "attributes.h" #include "intfloat.h" +#if !HAVE_ATANF +#undef atanf +#define atanf(x) ((float)atan(x)) +#endif + +#if !HAVE_ATAN2F +#undef atan2f +#define atan2f(y, x) ((float)atan2(y, x)) +#endif + +#if !HAVE_POWF +#undef powf +#define powf(x, y) ((float)pow(x, y)) +#endif + #if !HAVE_CBRTF static av_always_inline float cbrtf(float x) { @@ -36,6 +51,16 @@ static av_always_inline float cbrtf(float x) } #endif +#if !HAVE_COSF +#undef cosf +#define cosf(x) ((float)cos(x)) +#endif + +#if !HAVE_EXPF +#undef expf +#define expf(x) ((float)exp(x)) +#endif + #if !HAVE_EXP2 #undef exp2 #define exp2(x) exp((x) * 0.693147180559945) @@ -66,6 +91,11 @@ static av_always_inline av_const int isnan(float x) } #endif /* HAVE_ISNAN */ +#if !HAVE_LDEXPF +#undef ldexpf +#define ldexpf(x, exp) ((float)ldexp(x, exp)) +#endif + #if !HAVE_LLRINT #undef llrint #define llrint(x) ((long long)rint(x)) @@ -86,6 +116,16 @@ static av_always_inline av_const int isnan(float x) #define log2f(x) ((float)log2(x)) #endif /* HAVE_LOG2F */ +#if !HAVE_LOG10F +#undef log10f +#define log10f(x) ((float)log10(x)) +#endif + +#if !HAVE_SINF +#undef sinf +#define sinf(x) ((float)sin(x)) +#endif + #if !HAVE_RINT static inline double rint(double x) { -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 15/15] build: Plan 9 support
This adds support for building on Plan 9 x86-32. The compat/plan9 directory contains a few different items: - replacements for the 'head' and 'printf' shell commands - minor fixups for a couple of system headers - wrapper for main() to disable FPU exceptions Larger required changes to the system are described in the documentation. Signed-off-by: Mans Rullgard --- compat/plan9/head | 10 compat/plan9/main.c | 16 compat/plan9/printf | 2 ++ compat/plan9/sys/select.h | 2 ++ compat/plan9/sys/socket.h | 7 ++ configure | 22 - doc/platform.texi | 62 +++ 7 files changed, 120 insertions(+), 1 deletion(-) create mode 100755 compat/plan9/head create mode 100644 compat/plan9/main.c create mode 100755 compat/plan9/printf create mode 100644 compat/plan9/sys/select.h create mode 100644 compat/plan9/sys/socket.h diff --git a/compat/plan9/head b/compat/plan9/head new file mode 100755 index 000..2840b2d --- /dev/null +++ b/compat/plan9/head @@ -0,0 +1,10 @@ +#!/bin/sh + +n=10 + +case "$1" in +-n) n=$2; shift 2 ;; +-n*) n=${1#-n}; shift ;; +esac + +exec sed ${n}q "$@" diff --git a/compat/plan9/main.c b/compat/plan9/main.c new file mode 100644 index 000..ece3349 --- /dev/null +++ b/compat/plan9/main.c @@ -0,0 +1,16 @@ +int plan9_main(int argc, char **argv); + +#undef main +int main(int argc, char **argv) +{ +/* The setfcr() function in lib9 is broken, must use asm. */ +#ifdef __i386 +short fcr; +__asm__ volatile ("fstcw%0 \n" + "or $63, %0 \n" + "fldcw%0 \n" + : "=m"(fcr)); +#endif + +return plan9_main(argc, argv); +} diff --git a/compat/plan9/printf b/compat/plan9/printf new file mode 100755 index 000..1a70a9e --- /dev/null +++ b/compat/plan9/printf @@ -0,0 +1,2 @@ +#!/bin/sh +exec awk "BEGIN { for (i = 2; i < ARGC; i++) printf \"$1\", ARGV[i] }" "$@" diff --git a/compat/plan9/sys/select.h b/compat/plan9/sys/select.h new file mode 100644 index 000..385fa63 --- /dev/null +++ b/compat/plan9/sys/select.h @@ -0,0 +1,2 @@ +#include_next +#define FD_SETSIZE 96 diff --git a/compat/plan9/sys/socket.h b/compat/plan9/sys/socket.h new file mode 100644 index 000..29399fa --- /dev/null +++ b/compat/plan9/sys/socket.h @@ -0,0 +1,7 @@ +#define HAVE_SOCK_OPTS +#include_next + +/* first two are fake, only SHUT_RDWR is implemented */ +#define SHUT_RD 0 +#define SHUT_WR 1 +#define SHUT_RDWR 2 diff --git a/configure b/configure index 0acaf3e..25e2e83 100755 --- a/configure +++ b/configure @@ -956,7 +956,7 @@ apply(){ cp_if_changed(){ cmp -s "$1" "$2" && echo "$2 is unchanged" && return mkdir -p "$(dirname $2)" -cp -f "$1" "$2" +$cp_f "$1" "$2" } # CONFIG_LIST contains configurable options, while HAVE_LIST is for @@ -1790,6 +1790,7 @@ shlibdir_default="$libdir_default" ar_default="ar" cc_default="gcc" host_cc_default="gcc" +cp_f="cp -f" ln_s="ln -sf" nm_default="nm -g" objformat="elf" @@ -2898,6 +2899,19 @@ case $target_os in ;; minix) ;; +plan9) +add_host_cflags -I${source_path}/compat/plan9 +add_cppflags -I${source_path}/compat/plan9 \ + -D_C99_SNPRINTF_EXTENSION \ + -D_REENTRANT_SOURCE \ + -D_RESEARCH_SOURCE +add_compat strtod.o strtod=avpriv_strtod +network_extralibs='-lbsd' +exeobjs=compat/plan9/main.o +disable avserver +ln_s='ln -s -f' +cp_f='cp' +;; none) ;; *) @@ -3571,6 +3585,12 @@ elif enabled msvc; then enabled x86_32 && disable aligned_stack fi +case $target_os in +plan9) +add_cppflags -Dmain=plan9_main +;; +esac + enabled_any $THREADS_LIST && enable threads enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; } diff --git a/doc/platform.texi b/doc/platform.texi index 3bb9f79..f6787a7 100644 --- a/doc/platform.texi +++ b/doc/platform.texi @@ -292,4 +292,66 @@ and for a build with shared libraries ./configure --target-os=mingw32 --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin @end example +@chapter Plan 9 + +The native @uref{http://plan9.bell-labs.com/plan9/, Plan 9} compiler +does not implement all the C99 features needed by Libav so the gcc +port must be used. Furthermore, a few items missing from the C +library and shell environment need to be fixed. + +@itemize + +@item GNU awk, grep, make, and sed + +Working packages of these tools can be found at +@uref{http://code.google.com/p/ports2plan9/downloads/list, ports2plan9}. +They can be installed with @uref{http://9front.org/, 9front's} @code{pkg} +utility by setting @code{pkgpath} to +@code{http://ports2plan9.googlecode.com/files/}. + +@item Missing/broken @code{head} and @code{printf} commands + +
[libav-devel] [PATCH 14/15] build: allow targets to specify extra objects to link with executables
This allows targets to include special objects when linking executables without including them in (shared) libraries. Signed-off-by: Mans Rullgard --- Makefile| 8 configure | 1 + library.mak | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 4c2553f..2cce848 100644 --- a/Makefile +++ b/Makefile @@ -62,7 +62,7 @@ PROGS-$(CONFIG_AVPROBE) += avprobe PROGS-$(CONFIG_AVSERVER) += avserver PROGS := $(PROGS-yes:%=%$(EXESUF)) -OBJS= cmdutils.o +OBJS= cmdutils.o $(EXEOBJS) OBJS-avconv = avconv_opt.o avconv_filter.o TESTTOOLS = audiogen videogen rotozoom tiny_psnr base64 HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options @@ -93,8 +93,8 @@ FF_DEP_LIBS := $(DEP_LIBS) all: $(PROGS) -$(TOOLS): %$(EXESUF): %.o - $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS) +$(TOOLS): %$(EXESUF): %.o $(EXEOBJS) + $(LD) $(LDFLAGS) $(LD_O) $^ $(ELIBS) tools/cws2fws$(EXESUF): ELIBS = $(ZLIB) @@ -127,7 +127,7 @@ endef $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D define DOPROG -OBJS-$(1) += $(1).o cmdutils.o +OBJS-$(1) += $(1).o cmdutils.o $(EXEOBJS) $(1)$(EXESUF): $$(OBJS-$(1)) $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1)) $(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1)) diff --git a/configure b/configure index 90df2c2..0acaf3e 100755 --- a/configure +++ b/configure @@ -3779,6 +3779,7 @@ ZLIB=$($ldflags_filter -lz) LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD EXTRALIBS=$extralibs COMPAT_OBJS=$compat_objs +EXEOBJS=$exeobjs INSTALL=install LIBTARGET=${LIBTARGET} SLIBNAME=${SLIBNAME} diff --git a/library.mak b/library.mak index d4308c8..19e683f 100644 --- a/library.mak +++ b/library.mak @@ -40,7 +40,7 @@ define RULES $(EXAMPLES) $(TOOLS): THISLIB = $(FULLNAME:%=$(LD_LIB)) $(TESTPROGS): THISLIB = $(SUBDIR)$(LIBNAME) -$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o +$(EXAMPLES) $(TESTPROGS) $(TOOLS): %$(EXESUF): %.o $(EXEOBJS) $$(LD) $(LDFLAGS) $$(LD_O) $$(filter %.o,$$^) $$(THISLIB) $(FFEXTRALIBS) $$(ELIBS) $(SUBDIR)$(SLIBNAME): $(SUBDIR)$(SLIBNAME_WITH_MAJOR) -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 13/15] build: simplify linking tools with cmdutils.o
This avoids repeating cmdutils.o in both the prerequisites and the link command. Signed-off-by: Mans Rullgard --- Makefile | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9abb835..4c2553f 100644 --- a/Makefile +++ b/Makefile @@ -127,8 +127,8 @@ endef $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D define DOPROG -OBJS-$(1) += $(1).o -$(1)$(EXESUF): $(OBJS-$(1)) +OBJS-$(1) += $(1).o cmdutils.o +$(1)$(EXESUF): $$(OBJS-$(1)) $$(OBJS-$(1)): CFLAGS += $(CFLAGS-$(1)) $(1)$(EXESUF): LDFLAGS += $(LDFLAGS-$(1)) $(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1)) @@ -137,8 +137,8 @@ endef $(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P -$(PROGS): %$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS) - $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS) +$(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS) + $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS) OBJDIRS += tools -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 10/15] fate: improve md5sum utility selection
The 'md5sum' command is used with the -b flag so the presence test must also use this flag. Signed-off-by: Mans Rullgard --- tests/md5.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/md5.sh b/tests/md5.sh index 4b95127..0b382b1 100644 --- a/tests/md5.sh +++ b/tests/md5.sh @@ -1,6 +1,6 @@ # try to find an md5 program -if [ X"$(echo | md5sum 2> /dev/null)" != X ]; then +if [ X"$(echo | md5sum -b 2> /dev/null)" != X ]; then do_md5sum() { md5sum -b $1; } elif [ X"$(echo | command md5 2> /dev/null)" != X ]; then do_md5sum() { command md5 $1 | sed 's#MD5 (\(.*\)) = \(.*\)#\2 *\1#'; } -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 11/15] tiny_psnr: check for specified sample size less than 1
A zero or negative sample size is impossible and should be reported as an error. Signed-off-by: Mans Rullgard --- tests/tiny_psnr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c index 5db2662..a53a670 100644 --- a/tests/tiny_psnr.c +++ b/tests/tiny_psnr.c @@ -139,7 +139,7 @@ int main(int argc, char *argv[]) } else { char *end; len = strtol(argv[3], &end, 0); -if (*end || len > 2) { +if (*end || len < 1 || len > 2) { fprintf(stderr, "Unsupported sample format: %s\n", argv[3]); return 1; } -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 06/15] network: add fallbacks for INADDR_LOOPBACK and INET_ADDRSTRLEN
Signed-off-by: Mans Rullgard --- libavformat/network.h | 8 1 file changed, 8 insertions(+) diff --git a/libavformat/network.h b/libavformat/network.h index da9d926..5160767 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -188,6 +188,14 @@ const char *ff_gai_strerror(int ecode); #define gai_strerror ff_gai_strerror #endif +#ifndef INADDR_LOOPBACK +#define INADDR_LOOPBACK 0x7f01 +#endif + +#ifndef INET_ADDRSTRLEN +#define INET_ADDRSTRLEN 16 +#endif + #ifndef INET6_ADDRSTRLEN #define INET6_ADDRSTRLEN INET_ADDRSTRLEN #endif -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 09/15] swscale: avoid pointless use of compound literals
Some compilers (e.g. old gcc) have trouble with these. Signed-off-by: Mans Rullgard --- libswscale/swscale_unscaled.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 70eff72..5efc647 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -396,6 +396,11 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], uint8_t *dst[], int dstStride[]) { int alpha_first = 0; +const uint8_t *src102[] = { src[1], src[0], src[2] }; +const uint8_t *src201[] = { src[2], src[0], src[1] }; +int stride102[] = { srcStride[1], srcStride[0], srcStride[2] }; +int stride201[] = { srcStride[2], srcStride[0], srcStride[1] }; + if (c->srcFormat != AV_PIX_FMT_GBRP) { av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n", av_get_pix_fmt_name(c->srcFormat), @@ -405,15 +410,13 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], switch (c->dstFormat) { case AV_PIX_FMT_BGR24: -gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] }, - (int []) { srcStride[1], srcStride[0], srcStride[2] }, +gbr24ptopacked24(src102, stride102, dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, c->srcW); break; case AV_PIX_FMT_RGB24: -gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] }, - (int []) { srcStride[2], srcStride[0], srcStride[1] }, +gbr24ptopacked24(src201, stride201, dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, c->srcW); break; @@ -421,8 +424,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], case AV_PIX_FMT_ARGB: alpha_first = 1; case AV_PIX_FMT_RGBA: -gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] }, - (int []) { srcStride[2], srcStride[0], srcStride[1] }, +gbr24ptopacked32(src201, stride201, dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, alpha_first, c->srcW); break; @@ -430,8 +432,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], case AV_PIX_FMT_ABGR: alpha_first = 1; case AV_PIX_FMT_BGRA: -gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] }, - (int []) { srcStride[1], srcStride[0], srcStride[2] }, +gbr24ptopacked32(src102, stride102, dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, alpha_first, c->srcW); break; -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 12/15] tiny_psnr: fix range calculation for sample size of 32 bits
For a sample size of 32 bits, the shift would overflow producing undefined results. Incidentally, in the only test currently using 32-bit samples, the output matches the reference exactly on most systems meaning the bad 'max' value is never used. Signed-off-by: Mans Rullgard --- tests/tiny_psnr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c index a53a670..b1bcc16 100644 --- a/tests/tiny_psnr.c +++ b/tests/tiny_psnr.c @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) } } -max = (1 << (8 * len)) - 1; +max = (1LL << (8 * len)) - 1; f[0] = fopen(argv[1], "rb"); f[1] = fopen(argv[2], "rb"); -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 07/15] network: use getservbyport() only if available
The absence of this function will only give a less informative string back from our fallback implementation of getnameinfo(). Signed-off-by: Mans Rullgard --- configure| 2 ++ libavformat/os_support.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/configure b/configure index defc2bf..5426c92 100755 --- a/configure +++ b/configure @@ -1171,6 +1171,7 @@ HAVE_LIST=" GetProcessTimes GetSystemTimeAsFileTime getrusage +getservbyport gettimeofday gnu_as ibm_asm @@ -3177,6 +3178,7 @@ if enabled network; then check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len check_type netinet/sctp.h "struct sctp_event_subscribe" check_func getaddrinfo $network_extralibs +check_func getservbyport $network_extralibs # Prefer arpa/inet.h over winsock2 if check_header arpa/inet.h ; then check_func closesocket diff --git a/libavformat/os_support.c b/libavformat/os_support.c index 7618708..451801f 100644 --- a/libavformat/os_support.c +++ b/libavformat/os_support.c @@ -235,8 +235,10 @@ int ff_getnameinfo(const struct sockaddr *sa, int salen, if (serv && servlen > 0) { struct servent *ent = NULL; +#if HAVE_GETSERVBYPORT if (!(flags & NI_NUMERICSERV)) ent = getservbyport(sin->sin_port, flags & NI_DGRAM ? "udp" : "tcp"); +#endif if (ent) snprintf(serv, servlen, "%s", ent->s_name); -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 03/15] build: simplify enabling of compat objects
Add a configure function to pull in a compat object and set up redirects in one operation. This avoids duplicating conditions across configure and makefiles. Signed-off-by: Mans Rullgard --- configure | 15 +++ libavutil/Makefile | 3 +-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configure b/configure index eeefeaf..defc2bf 100755 --- a/configure +++ b/configure @@ -641,6 +641,12 @@ add_host_ldflags(){ append host_ldflags $($host_ldflags_filter "$@") } +add_compat(){ +append compat_objs $1 +shift +map 'add_cppflags -D$v' "$@" +} + check_cmd(){ log "$@" "$@" >> $logfile 2>&1 @@ -2906,10 +2912,10 @@ elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then libc_type=newlib elif check_func_headers stdlib.h _get_doserrno; then libc_type=msvcrt -add_cflags -Dstrtod=avpriv_strtod -add_cflags -Dsnprintf=avpriv_snprintf \ - -D_snprintf=avpriv_snprintf \ - -Dvsnprintf=avpriv_vsnprintf +add_compat strtod.o strtod=avpriv_strtod +add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \ + _snprintf=avpriv_snprintf \ + vsnprintf=avpriv_vsnprintf elif check_cpp_condition stddef.h "defined __KLIBC__"; then libc_type=klibc fi @@ -3754,6 +3760,7 @@ CFLAGS-avplay=$sdl_cflags ZLIB=$($ldflags_filter -lz) LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD EXTRALIBS=$extralibs +COMPAT_OBJS=$compat_objs INSTALL=install LIBTARGET=${LIBTARGET} SLIBNAME=${SLIBNAME} diff --git a/libavutil/Makefile b/libavutil/Makefile index e2b84e0..a85d3ae 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -88,8 +88,7 @@ OBJS = adler32.o \ utils.o \ xtea.o \ -OBJS-$(HAVE_MSVCRT) += ../compat/msvcrt/snprintf.o \ - ../compat/strtod.o +OBJS += $(COMPAT_OBJS:%=../compat/%) SKIPHEADERS = old_pix_fmts.h -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 04/15] Include sys/time.h before sys/resource.h
Some systems require sys/time.h being explicitly included before sys/resource.h. The configure check already does this. Signed-off-by: Mans Rullgard --- avconv.c | 1 + cmdutils.c | 1 + 2 files changed, 2 insertions(+) diff --git a/avconv.c b/avconv.c index 4d9c7c0..20d873e 100644 --- a/avconv.c +++ b/avconv.c @@ -53,6 +53,7 @@ # include "libavfilter/buffersink.h" #if HAVE_SYS_RESOURCE_H +#include #include #include #elif HAVE_GETPROCESSTIMES diff --git a/cmdutils.c b/cmdutils.c index 34c52ca..6570968 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -49,6 +49,7 @@ #include "libavformat/network.h" #endif #if HAVE_SYS_RESOURCE_H +#include #include #endif -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 02/15] configure: simplify argument handling in check_ld
Use the existing filter functions instead of open-coding the separation of general flags and libraries. Signed-off-by: Mans Rullgard --- configure | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 3bb8fff..eeefeaf 100755 --- a/configure +++ b/configure @@ -704,11 +704,8 @@ ld_o(){ check_ld(){ log check_ld "$@" -flags='' -libs='' -for f; do -test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f" -done +flags=$(filter_out '-l*' "$@") +libs=$(filter '-l*' "$@") check_cc $($cflags_filter $flags) || return flags=$($ldflags_filter $flags) libs=$($ldflags_filter $libs) -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 05/15] network: #include stdint.h in network.h
This header uses various types provided by stdint.h without explicitly including it. Signed-off-by: Mans Rullgard --- libavformat/network.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/network.h b/libavformat/network.h index 19c5a92..da9d926 100644 --- a/libavformat/network.h +++ b/libavformat/network.h @@ -22,6 +22,7 @@ #define AVFORMAT_NETWORK_H #include +#include #include "config.h" #include "libavutil/error.h" -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 01/15] configure: simplify get_version() function
awk alone can do this, no need for grep. Signed-off-by: Mans Rullgard --- configure | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure b/configure index 700e99d..3bb8fff 100755 --- a/configure +++ b/configure @@ -3775,7 +3775,7 @@ get_version(){ lcname=$1 name=$(toupper $lcname) file=$source_path/$lcname/version.h -eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }') +eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file") eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak -- 1.7.12.3 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] build: support asan and tsan toolchain shortcuts
--- configure | 10 ++ 1 file changed, 10 insertions(+) diff --git a/configure b/configure index d8a5728..cb29f13 100755 --- a/configure +++ b/configure @@ -2053,6 +2053,16 @@ case "$toolchain" in nm_default="dumpbin -symbols" ar_default="lib" ;; +clang-asan) +cc_default="clang" +add_cflags -faddress-sanitizer +add_ldflags -faddress-sanitizer +;; +clang-tsan) +cc_default="clang" +add_cflags -fthread-sanitizer +add_ldflags -fthread-sanitizer +;; ?*) die "Unknown toolchain $toolchain" ;; -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] build: support asan and tsan toolchain shortcuts
Luca Barbato writes: > --- > configure | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/configure b/configure > index 26cd7ea..b4a1f96 100755 > --- a/configure > +++ b/configure > @@ -2053,6 +2053,16 @@ case "$toolchain" in > nm_default="dumpbin -symbols" > ar_default="lib" > ;; > +asan) > +cc_default="clang" > +add_cflags -faddress-sanitizer > +add_ldflags -faddress-sanitizer > +;; > +tsan) > +cc_default="clang" > +add_cflags -fthread-sanitizer > +add_ldflags -fthread-sanitizer > +;; > ?*) > die "Unknown toolchain $toolchain" > ;; > -- I suggest naming them clang-asan/clang-tsan. Also imagine Diego saying something about vertical alignment. -- 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] build: support asan and tsan toolchain shortcuts
On 10/14/2012 07:55 AM, Luca Barbato wrote: > --- > configure | 10 ++ > 1 file changed, 10 insertions(+) > > diff --git a/configure b/configure > index 26cd7ea..b4a1f96 100755 > --- a/configure > +++ b/configure > @@ -2053,6 +2053,16 @@ case "$toolchain" in > nm_default="dumpbin -symbols" > ar_default="lib" > ;; > +asan) > +cc_default="clang" > +add_cflags -faddress-sanitizer > +add_ldflags -faddress-sanitizer > +;; > +tsan) > +cc_default="clang" > +add_cflags -fthread-sanitizer > +add_ldflags -fthread-sanitizer > +;; > ?*) > die "Unknown toolchain $toolchain" > ;; Ping. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] swscale: support gray to 9bit and 10bit formats
--- Some code duplication, still not solving all the issues with yuva. libswscale/swscale.c | 37 +++-- libswscale/swscale_unscaled.c | 32 ++-- 2 files changed, 65 insertions(+), 4 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 3f54e4d..72e0542 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -61,6 +61,28 @@ static av_always_inline void fillPlane(uint8_t *plane, int stride, int width, } } +static void fill_plane9or10(uint8_t *plane, int stride, int width, +int height, int y, uint8_t val, +const int dst_depth, const int big_endian) +{ +int i, j; +uint16_t *dst = (uint16_t *) plane; +#define FILL8TO9_OR_10(wfunc) \ +for (i = 0; i < height; i++) { \ +for (j = 0; j < width; j++) { \ +wfunc(&dst[j], (val << (dst_depth - 8)) | \ + (val >> (16 - dst_depth))); \ +} \ +dst += stride / 2; \ +} +if (big_endian) { +FILL8TO9_OR_10(AV_WB16); +} else { +FILL8TO9_OR_10(AV_WL16); +} +} + + static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW, const uint8_t *_src, const int16_t *filter, const int32_t *filterPos, int filterSize) @@ -658,8 +680,19 @@ static int swScale(SwsContext *c, const uint8_t *src[], } } -if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) -fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, 255); +if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) { +int length = dstW; +int height = dstY - lastDstY; +if (is9_OR_10BPS(dstFormat)) { +const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(dstFormat); +fill_plane9or10(dst[3], dstStride[3], length, height, lastDstY, +255, desc->comp[3].depth_minus1 + 1, +isBE(dstFormat)); +} else if (is16BPS(c->dstFormat)) + length *= 2; + +fillPlane(dst[3], dstStride[3], length, height, lastDstY, 255); +} #if HAVE_MMXEXT_INLINE if (av_get_cpu_flags() & AV_CPU_FLAG_MMXEXT) diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 70eff72..e6ec7b5 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -98,6 +98,27 @@ static void fillPlane(uint8_t *plane, int stride, int width, int height, int y, } } +static void fill_plane9or10(uint8_t *plane, int stride, int width, +int height, int y, uint8_t val, +const int dst_depth, const int big_endian) +{ +int i, j; +uint16_t *dst = (uint16_t *) plane; +#define FILL8TO9_OR_10(wfunc) \ +for (i = 0; i < height; i++) { \ +for (j = 0; j < width; j++) { \ +wfunc(&dst[j], (val << (dst_depth - 8)) | \ + (val >> (16 - dst_depth))); \ +} \ +dst += stride / 2; \ +} +if (big_endian) { +FILL8TO9_OR_10(AV_WB16); +} else { +FILL8TO9_OR_10(AV_WL16); +} +} + static void copyPlane(const uint8_t *src, int srcStride, int srcSliceY, int srcSliceH, int width, uint8_t *dst, int dstStride) @@ -676,10 +697,17 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], // ignore palette for GRAY8 if (plane == 1 && !dst[2]) continue; if (!src[plane] || (plane == 1 && !src[2])) { +int val = (plane == 3) ? 255 : 128; if (is16BPS(c->dstFormat)) length *= 2; -fillPlane(dst[plane], dstStride[plane], length, height, y, - (plane == 3) ? 255 : 128); +if (is9_OR_10BPS(c->dstFormat)) { +fill_plane9or10(dst[plane], dstStride[plane], +length, height, y, val, +desc_dst->comp[plane].depth_minus1 + 1, +isBE(c->dstFormat)); +} else +fillPlane(dst[plane], dstStride[plane], length, height, y, + val); } else { if (is9_OR_10BPS(c->srcFormat)) { const int src_depth = desc_src->comp[plane].depth_minus1 + 1; -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] rmdec: Move code shared with Matroska demuxer to RealMedia common code
"Ronald S. Bultje" writes: > Hi, > > On Sun, Oct 14, 2012 at 3:02 PM, Diego Biurrun wrote: >> This removes a dependency of the Matroska demuxer on the RealMedia >> demuxer while only minimally bloating a RealMedia muxer only build. >> --- >> libavformat/Makefile |4 ++-- >> libavformat/rm.c | 41 + >> libavformat/rmdec.c | 41 - >> 3 files changed, 43 insertions(+), 43 deletions(-) > > I'm a little confused, rm.c contains code that is to be shared between > rmdec and rmenc. Shouldn't you add a new file (e.g. sipr.c) that > contains sipr-specific code to be shared between different demuxers > (e.g. rmdec and matroskadec)? That would make sense. -- 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] Add support for building shared libraries with MSVC
Martin Storsjö writes: > On Sat, 13 Oct 2012, Måns Rullgård wrote: > >> Martin Storsjö writes: >> >>> +#if CONFIG_SHARED && defined(_WIN32) && !defined(COMPILING_avcodec) >>> +#define avcodec_exportdata __declspec(dllimport) >>> +#else >>> +#define avcodec_exportdata >>> +#endif >> >> I want to think about this some more. > > Any further comments on this part? Probably. Do not push it yet. -- Måns Rullgård m...@mansr.com ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] index: report just the latest 10 news items
Limit the space taken to 30 lines anyway. --- Now with a more custom style. Makefile | 7 --- htdocs/css/bootstrap.css | 13 +++-- sed_commands | 13 - split.awk| 20 4 files changed, 31 insertions(+), 22 deletions(-) delete mode 100644 sed_commands create mode 100644 split.awk diff --git a/Makefile b/Makefile index e843bef..bf95afa 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,12 @@ all: $(TARGETS) clean: rm -f $(TARGETS) -htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) +htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) split.awk cat src/template_head1 $<_title \ src/template_head2 \ - src/template_head3 $< src/news \ - src/template_footer > $@ + src/template_head3 $< > $@ + awk -f split.awk src/news >> $@ + cat src/template_footer >> $@ htdocs/%.html: src/% src/%_title $(PAGE_DEPS) cat src/template_head1 $<_title \ diff --git a/htdocs/css/bootstrap.css b/htdocs/css/bootstrap.css index a398f84..ca4ec73 100644 --- a/htdocs/css/bootstrap.css +++ b/htdocs/css/bootstrap.css @@ -1166,16 +1166,17 @@ legend small { .pager a, .pager span { display: inline-block; - padding: 5px 14px; + padding: 4px 10px; background-color: #fff; - border: 1px solid #ddd; - -webkit-border-radius: 15px; - -moz-border-radius: 15px; - border-radius: 15px; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + color: #356635; + border: 1px solid #D0E6BE; } .pager a:hover { text-decoration: none; - background-color: #f5f5f5; + background-color: #DFF0D8; } .pager .next a, .pager .next span { diff --git a/sed_commands b/sed_commands deleted file mode 100644 index d0bd7fa..000 --- a/sed_commands +++ /dev/null @@ -1,13 +0,0 @@ -/LIBAV_ABOUT_NAVBAR/a\ -\ -About/ \ -Projects Using Libav\ - -/LIBAV_ABOUT_NAVBAR/d - -/LIBAV_LEGAL_NAVBAR/a\ -\ -License and Legal Issues\ -Hall of Shame\ - -/LIBAV_LEGAL_NAVBAR/d diff --git a/split.awk b/split.awk new file mode 100644 index 000..e3b4950 --- /dev/null +++ b/split.awk @@ -0,0 +1,20 @@ +BEGIN { +url = ARGV[1] ".html" +sub(/^.*\//, "", url) +} + +/ 5 || NR > 30) { +print "read more"; +exit 0; +} +} +{ print } -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] swscale: support gray to 9bit and 10bit formats
--- libswscale/swscale_unscaled.c | 32 ++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 70eff72..e6ec7b5 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -98,6 +98,27 @@ static void fillPlane(uint8_t *plane, int stride, int width, int height, int y, } } +static void fill_plane9or10(uint8_t *plane, int stride, int width, +int height, int y, uint8_t val, +const int dst_depth, const int big_endian) +{ +int i, j; +uint16_t *dst = (uint16_t *) plane; +#define FILL8TO9_OR_10(wfunc) \ +for (i = 0; i < height; i++) { \ +for (j = 0; j < width; j++) { \ +wfunc(&dst[j], (val << (dst_depth - 8)) | \ + (val >> (16 - dst_depth))); \ +} \ +dst += stride / 2; \ +} +if (big_endian) { +FILL8TO9_OR_10(AV_WB16); +} else { +FILL8TO9_OR_10(AV_WL16); +} +} + static void copyPlane(const uint8_t *src, int srcStride, int srcSliceY, int srcSliceH, int width, uint8_t *dst, int dstStride) @@ -676,10 +697,17 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], // ignore palette for GRAY8 if (plane == 1 && !dst[2]) continue; if (!src[plane] || (plane == 1 && !src[2])) { +int val = (plane == 3) ? 255 : 128; if (is16BPS(c->dstFormat)) length *= 2; -fillPlane(dst[plane], dstStride[plane], length, height, y, - (plane == 3) ? 255 : 128); +if (is9_OR_10BPS(c->dstFormat)) { +fill_plane9or10(dst[plane], dstStride[plane], +length, height, y, val, +desc_dst->comp[plane].depth_minus1 + 1, +isBE(c->dstFormat)); +} else +fillPlane(dst[plane], dstStride[plane], length, height, y, + val); } else { if (is9_OR_10BPS(c->srcFormat)) { const int src_depth = desc_src->comp[plane].depth_minus1 + 1; -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] rmdec: Move code shared with Matroska demuxer to RealMedia common code
Hi, On Sun, Oct 14, 2012 at 3:02 PM, Diego Biurrun wrote: > This removes a dependency of the Matroska demuxer on the RealMedia > demuxer while only minimally bloating a RealMedia muxer only build. > --- > libavformat/Makefile |4 ++-- > libavformat/rm.c | 41 + > libavformat/rmdec.c | 41 - > 3 files changed, 43 insertions(+), 43 deletions(-) I'm a little confused, rm.c contains code that is to be shared between rmdec and rmenc. Shouldn't you add a new file (e.g. sipr.c) that contains sipr-specific code to be shared between different demuxers (e.g. rmdec and matroskadec)? Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 2/2] Add support for building shared libraries with MSVC
On Sat, 13 Oct 2012, Måns Rullgård wrote: Martin Storsjö writes: +#if CONFIG_SHARED && defined(_WIN32) && !defined(COMPILING_avcodec) +#define avcodec_exportdata __declspec(dllimport) +#else +#define avcodec_exportdata +#endif I want to think about this some more. Any further comments on this part? // Martin___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH 4/4] vorbisdec: use float planar sample format
On 10/14/2012 05:55 PM, Luca Barbato wrote: > On 10/14/2012 11:40 PM, Justin Ruggles wrote: >> --- >> libavcodec/vorbisdec.c | 81 >> ++- >> 1 files changed, 31 insertions(+), 50 deletions(-) > > Looks ok, how did you test it? make fate-vorbis and some individual decoding tests with valgrind -Justin ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] rmdec: Move code shared with Matroska demuxer to RealMedia common code
On 10/15/2012 12:02 AM, Diego Biurrun wrote: > This removes a dependency of the Matroska demuxer on the RealMedia > demuxer while only minimally bloating a RealMedia muxer only build. > --- > libavformat/Makefile |4 ++-- > libavformat/rm.c | 41 + > libavformat/rmdec.c | 41 - > 3 files changed, 43 insertions(+), 43 deletions(-) Looks fine. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] rmdec: Move code shared with Matroska demuxer to RealMedia common code
This removes a dependency of the Matroska demuxer on the RealMedia demuxer while only minimally bloating a RealMedia muxer only build. --- libavformat/Makefile |4 ++-- libavformat/rm.c | 41 + libavformat/rmdec.c | 41 - 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/libavformat/Makefile b/libavformat/Makefile index 5d89a2e..42281b2 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -135,8 +135,8 @@ OBJS-$(CONFIG_LMLM4_DEMUXER) += lmlm4.o OBJS-$(CONFIG_LXF_DEMUXER) += lxfdec.o OBJS-$(CONFIG_M4V_DEMUXER) += m4vdec.o rawdec.o OBJS-$(CONFIG_M4V_MUXER) += rawenc.o -OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o \ -isom.o rmdec.o rm.o +OBJS-$(CONFIG_MATROSKA_DEMUXER) += matroskadec.o matroska.o \ +isom.o rm.o OBJS-$(CONFIG_MATROSKA_MUXER)+= matroskaenc.o matroska.o \ isom.o avc.o \ flacenc_header.o avlanguage.o diff --git a/libavformat/rm.c b/libavformat/rm.c index 761be3f..63b3c3e 100644 --- a/libavformat/rm.c +++ b/libavformat/rm.c @@ -45,3 +45,44 @@ const AVCodecTag ff_rm_codec_tags[] = { { AV_CODEC_ID_RALF, MKTAG('L','S','D',':') }, { AV_CODEC_ID_NONE }, }; + +const unsigned char ff_sipr_subpk_size[4] = { 29, 19, 37, 20 }; + +static const unsigned char sipr_swaps[38][2] = { +{ 0, 63 }, { 1, 22 }, { 2, 44 }, { 3, 90 }, +{ 5, 81 }, { 7, 31 }, { 8, 86 }, { 9, 58 }, +{ 10, 36 }, { 12, 68 }, { 13, 39 }, { 14, 73 }, +{ 15, 53 }, { 16, 69 }, { 17, 57 }, { 19, 88 }, +{ 20, 34 }, { 21, 71 }, { 24, 46 }, { 25, 94 }, +{ 26, 54 }, { 28, 75 }, { 29, 50 }, { 32, 70 }, +{ 33, 92 }, { 35, 74 }, { 38, 85 }, { 40, 56 }, +{ 42, 87 }, { 43, 65 }, { 45, 59 }, { 48, 79 }, +{ 49, 93 }, { 51, 89 }, { 55, 95 }, { 61, 76 }, +{ 67, 83 }, { 77, 80 } +}; + +/** + * Perform 4-bit block reordering for SIPR data. + * @todo This can be optimized, e.g. use memcpy() if data blocks are aligned + */ +void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize) +{ +int n, bs = sub_packet_h * framesize * 2 / 96; // nibbles per subpacket + +for (n = 0; n < 38; n++) { +int j; +int i = bs * sipr_swaps[n][0]; +int o = bs * sipr_swaps[n][1]; + +/* swap 4bit-nibbles of block 'i' with 'o' */ +for (j = 0; j < bs; j++, i++, o++) { +int x = (buf[i >> 1] >> (4 * (i & 1))) & 0xF, +y = (buf[o >> 1] >> (4 * (o & 1))) & 0xF; + +buf[o >> 1] = (x << (4 * (o & 1))) | +(buf[o >> 1] & (0xF << (4 * !(o & 1; +buf[i >> 1] = (y << (4 * (i & 1))) | +(buf[i >> 1] & (0xF << (4 * !(i & 1; +} +} +} diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index eefd2c5..a8c29dc 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -59,21 +59,6 @@ typedef struct { int audio_pkt_cnt; ///< Output packet counter } RMDemuxContext; -static const unsigned char sipr_swaps[38][2] = { -{ 0, 63 }, { 1, 22 }, { 2, 44 }, { 3, 90 }, -{ 5, 81 }, { 7, 31 }, { 8, 86 }, { 9, 58 }, -{ 10, 36 }, { 12, 68 }, { 13, 39 }, { 14, 73 }, -{ 15, 53 }, { 16, 69 }, { 17, 57 }, { 19, 88 }, -{ 20, 34 }, { 21, 71 }, { 24, 46 }, { 25, 94 }, -{ 26, 54 }, { 28, 75 }, { 29, 50 }, { 32, 70 }, -{ 33, 92 }, { 35, 74 }, { 38, 85 }, { 40, 56 }, -{ 42, 87 }, { 43, 65 }, { 45, 59 }, { 48, 79 }, -{ 49, 93 }, { 51, 89 }, { 55, 95 }, { 61, 76 }, -{ 67, 83 }, { 77, 80 } -}; - -const unsigned char ff_sipr_subpk_size[4] = { 29, 19, 37, 20 }; - static inline void get_strl(AVIOContext *pb, char *buf, int buf_size, int len) { int i; @@ -719,32 +704,6 @@ rm_ac3_swap_bytes (AVStream *st, AVPacket *pkt) } } -/** - * Perform 4-bit block reordering for SIPR data. - * @todo This can be optimized, e.g. use memcpy() if data blocks are aligned - */ -void ff_rm_reorder_sipr_data(uint8_t *buf, int sub_packet_h, int framesize) -{ -int n, bs = sub_packet_h * framesize * 2 / 96; // nibbles per subpacket - -for (n = 0; n < 38; n++) { -int j; -int i = bs * sipr_swaps[n][0]; -int o = bs * sipr_swaps[n][1]; - -/* swap 4bit-nibbles of block 'i' with 'o' */ -for (j = 0; j < bs; j++, i++, o++) { -int x = (buf[i >> 1] >> (4 * (i & 1))) & 0xF, -y = (buf[o >> 1] >> (4 * (o & 1))) & 0xF; - -buf[o >> 1] = (x << (4 * (o & 1))) | -(buf[o >> 1] & (0xF << (4 * !(o & 1; -buf[i >> 1] = (y << (4 * (i & 1))) | -(buf[i >> 1] & (0xF << (4 * !(i & 1; -} -} -} - int ff_rm_parse_packet (AVFormatContext *s, AVIOCont
Re: [libav-devel] [PATCH 4/4] vorbisdec: use float planar sample format
On 10/14/2012 11:40 PM, Justin Ruggles wrote: > --- > libavcodec/vorbisdec.c | 81 ++- > 1 files changed, 31 insertions(+), 50 deletions(-) Looks ok, how did you test it? lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC] pixfmt: support more yuva formats
On 10/14/2012 11:36 PM, Ronald S. Bultje wrote: > Well yes, can we first sort out this stuff without nut? I mean, I Sure! > really don't have much reason to trust nut at this moment. When you > test a typical conversion (convert that thing to nut without > colorspace conversion, and then ./avplay -vf format=yuv420p10le), it > works, so the colorspace conversion itself is correct. I tried yuv420p10le yuv420p9le and yuv420p16le, only 16 works for me here. I'll try to have a clean from some far commit so I can bisect when it broke. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 2/4] mpegaudiodec: use planar sample format
--- Fix sample format for mp3on4. libavcodec/mpegaudiodec.c | 95 +++ libavcodec/mpegaudiodec_float.c | 14 ++ 2 files changed, 61 insertions(+), 48 deletions(-) diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 80acdad..6c750a4 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -93,7 +93,8 @@ typedef struct MPADecodeContext { # define MULH3(x, y, s) ((s)*(y)*(x)) # define MULLx(x, y, s) ((y)*(x)) # define RENAME(a) a ## _float -# define OUT_FMT AV_SAMPLE_FMT_FLT +# define OUT_FMT AV_SAMPLE_FMT_FLT +# define OUT_FMT_P AV_SAMPLE_FMT_FLTP #else # define SHR(a,b) ((a)>>(b)) /* WARNING: only correct for positive numbers */ @@ -103,7 +104,8 @@ typedef struct MPADecodeContext { # define MULH3(x, y, s) MULH((s)*(x), y) # define MULLx(x, y, s) MULL(x,y,s) # define RENAME(a) a ## _fixed -# define OUT_FMT AV_SAMPLE_FMT_S16 +# define OUT_FMT AV_SAMPLE_FMT_S16 +# define OUT_FMT_P AV_SAMPLE_FMT_S16P #endif // @@ -434,7 +436,11 @@ static av_cold int decode_init(AVCodecContext * avctx) ff_mpadsp_init(&s->mpadsp); ff_dsputil_init(&s->dsp, avctx); -avctx->sample_fmt= OUT_FMT; +if (avctx->request_sample_fmt == OUT_FMT && +avctx->codec_id != AV_CODEC_ID_MP3ON4) +avctx->sample_fmt = OUT_FMT; +else +avctx->sample_fmt = OUT_FMT_P; s->err_recognition = avctx->err_recognition; if (avctx->codec_id == AV_CODEC_ID_MP3ADU) @@ -1545,7 +1551,7 @@ static int mp_decode_layer3(MPADecodeContext *s) return nb_granules * 18; } -static int mp_decode_frame(MPADecodeContext *s, OUT_INT *samples, +static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples, const uint8_t *buf, int buf_size) { int i, nb_frames, ch, ret; @@ -1605,20 +1611,26 @@ static int mp_decode_frame(MPADecodeContext *s, OUT_INT *samples, av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } -samples = (OUT_INT *)s->frame.data[0]; +samples = (OUT_INT **)s->frame.extended_data; } /* apply the synthesis filter */ for (ch = 0; ch < s->nb_channels; ch++) { -samples_ptr = samples + ch; +int sample_stride; +if (s->avctx->sample_fmt == OUT_FMT_P) { +samples_ptr = samples[ch]; +sample_stride = 1; +} else { +samples_ptr = samples[0] + ch; +sample_stride = s->nb_channels; +} for (i = 0; i < nb_frames; i++) { -RENAME(ff_mpa_synth_filter)( - &s->mpadsp, - s->synth_buf[ch], &(s->synth_buf_offset[ch]), - RENAME(ff_mpa_synth_window), &s->dither_state, - samples_ptr, s->nb_channels, - s->sb_samples[ch][i]); -samples_ptr += 32 * s->nb_channels; +RENAME(ff_mpa_synth_filter)(&s->mpadsp, s->synth_buf[ch], +&(s->synth_buf_offset[ch]), +RENAME(ff_mpa_synth_window), +&s->dither_state, samples_ptr, +sample_stride, s->sb_samples[ch][i]); +samples_ptr += 32 * sample_stride; } } @@ -1751,7 +1763,6 @@ typedef struct MP3On4DecodeContext { int syncword; ///< syncword patch const uint8_t *coff;///< channel offsets in output buffer MPADecodeContext *mp3decctx[5]; ///< MPADecodeContext for every decoder instance -OUT_INT *decoded_buf; ///< output buffer for decoded samples } MP3On4DecodeContext; #include "mpeg4audio.h" @@ -1793,8 +1804,6 @@ static av_cold int decode_close_mp3on4(AVCodecContext * avctx) for (i = 0; i < s->frames; i++) av_free(s->mp3decctx[i]); -av_freep(&s->decoded_buf); - return 0; } @@ -1855,14 +1864,6 @@ static int decode_init_mp3on4(AVCodecContext * avctx) s->mp3decctx[i]->mpadsp = s->mp3decctx[0]->mpadsp; } -/* Allocate buffer for multi-channel output if needed */ -if (s->frames > 1) { -s->decoded_buf = av_malloc(MPA_FRAME_SIZE * MPA_MAX_CHANNELS * - sizeof(*s->decoded_buf)); -if (!s->decoded_buf) -goto alloc_fail; -} - return 0; alloc_fail: decode_close_mp3on4(avctx); @@ -1892,9 +1893,9 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data, MPADecodeContext *m; int fsize, len = buf_size, out_size = 0; uint32_t header; -OUT_INT *out_samples; -OUT_INT *outptr, *bp; -int fr, j, n, ch, ret; +OUT_INT **out_samples; +OUT_INT *outptr[2]; +int fr, ch, ret; /* get output buffer */ s->frame->nb_samples = MPA_FRAME_SIZE; @@ -1902,15 +1903,12 @@ static
[libav-devel] [PATCH 4/4] vorbisdec: use float planar sample format
--- libavcodec/vorbisdec.c | 81 ++- 1 files changed, 31 insertions(+), 50 deletions(-) diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index f5a541a..496d4c3 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -151,9 +151,7 @@ typedef struct vorbis_context_s { uint8_t mode_number; // mode number for the current packet uint8_t previous_window; float*channel_residues; -float*channel_floors; float*saved; -float scale_bias; // for float->int conversion } vorbis_context; /* Helper functions */ @@ -192,7 +190,6 @@ static void vorbis_free(vorbis_context *vc) int i; av_freep(&vc->channel_residues); -av_freep(&vc->channel_floors); av_freep(&vc->saved); for (i = 0; i < vc->residue_count; i++) @@ -951,12 +948,11 @@ static int vorbis_parse_id_hdr(vorbis_context *vc) } vc->channel_residues = av_malloc((vc->blocksize[1] / 2) * vc->audio_channels * sizeof(*vc->channel_residues)); -vc->channel_floors = av_malloc((vc->blocksize[1] / 2) * vc->audio_channels * sizeof(*vc->channel_floors)); vc->saved= av_mallocz((vc->blocksize[1] / 4) * vc->audio_channels * sizeof(*vc->saved)); vc->previous_window = 0; -ff_mdct_init(&vc->mdct[0], bl0, 1, -vc->scale_bias); -ff_mdct_init(&vc->mdct[1], bl1, 1, -vc->scale_bias); +ff_mdct_init(&vc->mdct[0], bl0, 1, -1.0); +ff_mdct_init(&vc->mdct[1], bl1, 1, -1.0); av_dlog(NULL, " vorbis version %d \n audio_channels %d \n audio_samplerate %d \n bitrate_max %d \n bitrate_nom %d \n bitrate_min %d \n blk_0 %d blk_1 %d \n ", vc->version, vc->audio_channels, vc->audio_samplerate, vc->bitrate_maximum, vc->bitrate_nominal, vc->bitrate_minimum, vc->blocksize[0], vc->blocksize[1]); @@ -988,13 +984,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext) avpriv_float_dsp_init(&vc->fdsp, avccontext->flags & CODEC_FLAG_BITEXACT); ff_fmt_convert_init(&vc->fmt_conv, avccontext); -if (avccontext->request_sample_fmt == AV_SAMPLE_FMT_FLT) { -avccontext->sample_fmt = AV_SAMPLE_FMT_FLT; -vc->scale_bias = 1.0f; -} else { -avccontext->sample_fmt = AV_SAMPLE_FMT_S16; -vc->scale_bias = 32768.0f; -} +avccontext->sample_fmt = AV_SAMPLE_FMT_FLTP; if (!headers_len) { av_log(avccontext, AV_LOG_ERROR, "Extradata missing.\n"); @@ -1485,7 +1475,7 @@ void ff_vorbis_inverse_coupling(float *mag, float *ang, int blocksize) // Decode the audio packet using the functions above -static int vorbis_parse_audio_packet(vorbis_context *vc) +static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr) { GetBitContext *gb = &vc->gb; FFTContext *mdct; @@ -1496,7 +1486,6 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) uint8_t do_not_decode[255]; vorbis_mapping *mapping; float *ch_res_ptr = vc->channel_residues; -float *ch_floor_ptr = vc->channel_floors; uint8_t res_chan[255]; unsigned res_num = 0; int retlen = 0; @@ -1528,7 +1517,8 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) } memset(ch_res_ptr, 0, sizeof(float) * vc->audio_channels * vlen); //FIXME can this be removed ? -memset(ch_floor_ptr, 0, sizeof(float) * vc->audio_channels * vlen); //FIXME can this be removed ? +for (i = 0; i < vc->audio_channels; ++i) +memset(floor_ptr[i], 0, vlen * sizeof(floor_ptr[0][0])); //FIXME can this be removed ? // Decode floor @@ -1541,14 +1531,13 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) floor = &vc->floors[mapping->submap_floor[0]]; } -ret = floor->decode(vc, &floor->data, ch_floor_ptr); +ret = floor->decode(vc, &floor->data, floor_ptr[i]); if (ret < 0) { av_log(vc->avccontext, AV_LOG_ERROR, "Invalid codebook in vorbis_floor_decode.\n"); return AVERROR_INVALIDDATA; } no_residue[i] = ret; -ch_floor_ptr += vlen; } // Nonzero vector propagate @@ -1612,10 +1601,9 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) mdct = &vc->mdct[blockflag]; for (j = vc->audio_channels-1;j >= 0; j--) { -ch_floor_ptr = vc->channel_floors + j * blocksize / 2; ch_res_ptr = vc->channel_residues + res_chan[j] * blocksize / 2; -vc->fdsp.vector_fmul(ch_floor_ptr, ch_floor_ptr, ch_res_ptr, blocksize / 2); -mdct->imdct_half(mdct, ch_res_ptr, ch_floor_ptr); +vc->fdsp.vector_fmul(floor_ptr[j], floor_ptr[j], ch_res_ptr, blocksize / 2); +mdct->imdct_half(mdct, ch_res_ptr, floor_ptr[j]); } // Overlap/add, save data for next overlapping @@ -1626,7 +1614,7 @@ static int vorbis_parse_audio_packet(vorbis_context *vc) unsigned bs1 = vc->blocksize[1]; float *residue=
[libav-devel] [PATCH 2/4] mpegaudiodec: use planar sample format
--- libavcodec/mpegaudiodec.c | 95 +++ libavcodec/mpegaudiodec_float.c | 14 ++ 2 files changed, 61 insertions(+), 48 deletions(-) diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 80acdad..66cbca1 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -93,7 +93,8 @@ typedef struct MPADecodeContext { # define MULH3(x, y, s) ((s)*(y)*(x)) # define MULLx(x, y, s) ((y)*(x)) # define RENAME(a) a ## _float -# define OUT_FMT AV_SAMPLE_FMT_FLT +# define OUT_FMT AV_SAMPLE_FMT_FLT +# define OUT_FMT_P AV_SAMPLE_FMT_FLTP #else # define SHR(a,b) ((a)>>(b)) /* WARNING: only correct for positive numbers */ @@ -103,7 +104,8 @@ typedef struct MPADecodeContext { # define MULH3(x, y, s) MULH((s)*(x), y) # define MULLx(x, y, s) MULL(x,y,s) # define RENAME(a) a ## _fixed -# define OUT_FMT AV_SAMPLE_FMT_S16 +# define OUT_FMT AV_SAMPLE_FMT_S16 +# define OUT_FMT_P AV_SAMPLE_FMT_S16P #endif // @@ -434,7 +436,11 @@ static av_cold int decode_init(AVCodecContext * avctx) ff_mpadsp_init(&s->mpadsp); ff_dsputil_init(&s->dsp, avctx); -avctx->sample_fmt= OUT_FMT; +if (avctx->request_sample_fmt == OUT_FMT || +avctx->codec_id == AV_CODEC_ID_MP3ON4) +avctx->sample_fmt = OUT_FMT; +else +avctx->sample_fmt = OUT_FMT_P; s->err_recognition = avctx->err_recognition; if (avctx->codec_id == AV_CODEC_ID_MP3ADU) @@ -1545,7 +1551,7 @@ static int mp_decode_layer3(MPADecodeContext *s) return nb_granules * 18; } -static int mp_decode_frame(MPADecodeContext *s, OUT_INT *samples, +static int mp_decode_frame(MPADecodeContext *s, OUT_INT **samples, const uint8_t *buf, int buf_size) { int i, nb_frames, ch, ret; @@ -1605,20 +1611,26 @@ static int mp_decode_frame(MPADecodeContext *s, OUT_INT *samples, av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } -samples = (OUT_INT *)s->frame.data[0]; +samples = (OUT_INT **)s->frame.extended_data; } /* apply the synthesis filter */ for (ch = 0; ch < s->nb_channels; ch++) { -samples_ptr = samples + ch; +int sample_stride; +if (s->avctx->sample_fmt == OUT_FMT_P) { +samples_ptr = samples[ch]; +sample_stride = 1; +} else { +samples_ptr = samples[0] + ch; +sample_stride = s->nb_channels; +} for (i = 0; i < nb_frames; i++) { -RENAME(ff_mpa_synth_filter)( - &s->mpadsp, - s->synth_buf[ch], &(s->synth_buf_offset[ch]), - RENAME(ff_mpa_synth_window), &s->dither_state, - samples_ptr, s->nb_channels, - s->sb_samples[ch][i]); -samples_ptr += 32 * s->nb_channels; +RENAME(ff_mpa_synth_filter)(&s->mpadsp, s->synth_buf[ch], +&(s->synth_buf_offset[ch]), +RENAME(ff_mpa_synth_window), +&s->dither_state, samples_ptr, +sample_stride, s->sb_samples[ch][i]); +samples_ptr += 32 * sample_stride; } } @@ -1751,7 +1763,6 @@ typedef struct MP3On4DecodeContext { int syncword; ///< syncword patch const uint8_t *coff;///< channel offsets in output buffer MPADecodeContext *mp3decctx[5]; ///< MPADecodeContext for every decoder instance -OUT_INT *decoded_buf; ///< output buffer for decoded samples } MP3On4DecodeContext; #include "mpeg4audio.h" @@ -1793,8 +1804,6 @@ static av_cold int decode_close_mp3on4(AVCodecContext * avctx) for (i = 0; i < s->frames; i++) av_free(s->mp3decctx[i]); -av_freep(&s->decoded_buf); - return 0; } @@ -1855,14 +1864,6 @@ static int decode_init_mp3on4(AVCodecContext * avctx) s->mp3decctx[i]->mpadsp = s->mp3decctx[0]->mpadsp; } -/* Allocate buffer for multi-channel output if needed */ -if (s->frames > 1) { -s->decoded_buf = av_malloc(MPA_FRAME_SIZE * MPA_MAX_CHANNELS * - sizeof(*s->decoded_buf)); -if (!s->decoded_buf) -goto alloc_fail; -} - return 0; alloc_fail: decode_close_mp3on4(avctx); @@ -1892,9 +1893,9 @@ static int decode_frame_mp3on4(AVCodecContext *avctx, void *data, MPADecodeContext *m; int fsize, len = buf_size, out_size = 0; uint32_t header; -OUT_INT *out_samples; -OUT_INT *outptr, *bp; -int fr, j, n, ch, ret; +OUT_INT **out_samples; +OUT_INT *outptr[2]; +int fr, ch, ret; /* get output buffer */ s->frame->nb_samples = MPA_FRAME_SIZE; @@ -1902,15 +1903,12 @@ static int decode_frame_mp3on4(AVCode
[libav-devel] [PATCH 3/4] pcmdec: use planar sample format for pcm_s16le_planar
--- libavcodec/pcm.c | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index c6c6bc0..da0e696 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -340,15 +340,16 @@ static int pcm_decode_frame(AVCodecContext *avctx, void *data, break; case AV_CODEC_ID_PCM_S16LE_PLANAR: { -const uint8_t *src2[MAX_CHANNELS]; n /= avctx->channels; -for (c = 0; c < avctx->channels; c++) -src2[c] = &src[c * n * 2]; -for (; n > 0; n--) -for (c = 0; c < avctx->channels; c++) { -AV_WN16A(samples, bytestream_get_le16(&src2[c])); -samples += 2; -} +for (c = 0; c < avctx->channels; c++) { +samples = s->frame.extended_data[c]; +#if HAVE_BIGENDIAN +DECODE(16, le16, src, samples, n, 0, 0) +#else +memcpy(samples, src, n * 2); +#endif +src += n * 2; +} break; } case AV_CODEC_ID_PCM_U16LE: @@ -527,7 +528,7 @@ PCM_CODEC (AV_CODEC_ID_PCM_MULAW, AV_SAMPLE_FMT_S16, pcm_mulaw," PCM_CODEC (AV_CODEC_ID_PCM_S8, AV_SAMPLE_FMT_U8, pcm_s8, "PCM signed 8-bit"); PCM_CODEC (AV_CODEC_ID_PCM_S16BE,AV_SAMPLE_FMT_S16, pcm_s16be, "PCM signed 16-bit big-endian"); PCM_CODEC (AV_CODEC_ID_PCM_S16LE,AV_SAMPLE_FMT_S16, pcm_s16le, "PCM signed 16-bit little-endian"); -PCM_DECODER(AV_CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16, pcm_s16le_planar, "PCM 16-bit little-endian planar"); +PCM_DECODER(AV_CODEC_ID_PCM_S16LE_PLANAR, AV_SAMPLE_FMT_S16P, pcm_s16le_planar, "PCM 16-bit little-endian planar"); PCM_CODEC (AV_CODEC_ID_PCM_S24BE,AV_SAMPLE_FMT_S32, pcm_s24be, "PCM signed 24-bit big-endian"); PCM_CODEC (AV_CODEC_ID_PCM_S24DAUD, AV_SAMPLE_FMT_S16, pcm_s24daud, "PCM D-Cinema audio signed 24-bit"); PCM_CODEC (AV_CODEC_ID_PCM_S24LE,AV_SAMPLE_FMT_S32, pcm_s24le, "PCM signed 24-bit little-endian"); -- 1.7.1 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH 1/4] aacdec: use float planar sample format for output
--- libavcodec/aac.h|7 ++- libavcodec/aacdec.c | 104 +++ libavcodec/aacsbr.c |6 +-- 3 files changed, 69 insertions(+), 48 deletions(-) diff --git a/libavcodec/aac.h b/libavcodec/aac.h index 32baf9d..70470dd 100644 --- a/libavcodec/aac.h +++ b/libavcodec/aac.h @@ -237,9 +237,10 @@ typedef struct SingleChannelElement { uint8_t zeroes[128];///< band is not coded (used by encoder) DECLARE_ALIGNED(32, float, coeffs)[1024]; ///< coefficients for IMDCT DECLARE_ALIGNED(32, float, saved)[1024]; ///< overlap -DECLARE_ALIGNED(32, float, ret)[2048];///< PCM output +DECLARE_ALIGNED(32, float, ret_buf)[2048];///< PCM output buffer DECLARE_ALIGNED(16, float, ltp_state)[3072]; ///< time signal for LTP PredictorState predictor_state[MAX_PREDICTORS]; +float *ret; ///< PCM output } SingleChannelElement; /** @@ -298,10 +299,10 @@ typedef struct AACContext { /** @} */ /** - * @name Members used for output interleaving + * @name Members used for output * @{ */ -float *output_data[MAX_CHANNELS]; ///< Points to each element's 'ret' buffer (PCM output). +SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement /** @} */ DECLARE_ALIGNED(32, float, temp)[128]; diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 4a6d390..af617c3 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -149,10 +149,10 @@ static av_cold int che_configure(AACContext *ac, ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr); } if (type != TYPE_CCE) { -ac->output_data[(*channels)++] = ac->che[type][id]->ch[0].ret; +ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0]; if (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) { -ac->output_data[(*channels)++] = ac->che[type][id]->ch[1].ret; +ac->output_element[(*channels)++] = &ac->che[type][id]->ch[1]; } } } else { @@ -163,6 +163,42 @@ static av_cold int che_configure(AACContext *ac, return 0; } +static int frame_configure_elements(AVCodecContext *avctx, int get_new_frame) +{ +AACContext *ac = avctx->priv_data; +int type, id; + +/* set channel pointers to internal buffers by default */ +for (type = 0; type < 4; type++) { +for (id = 0; id < MAX_ELEM_ID; id++) { +ChannelElement *che = ac->che[type][id]; +if (che) { +che->ch[0].ret = che->ch[0].ret_buf; +che->ch[1].ret = che->ch[1].ret_buf; +} +} +} + +if (get_new_frame) { +int ch, ret; + +/* get output buffer */ +ac->frame.nb_samples = 2048; +if ((ret = avctx->get_buffer(avctx, &ac->frame)) < 0) { +av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); +return ret; +} + +/* map output channel pointers to AVFrame data */ +for (ch = 0; ch < avctx->channels; ch++) { +if (ac->output_element[ch]) +ac->output_element[ch]->ret = (float *)ac->frame.extended_data[ch]; +} +} + +return 0; +} + struct elem_to_channel { uint64_t av_position; uint8_t syn_ele; @@ -378,8 +414,9 @@ static void pop_output_configuration(AACContext *ac) { * @return Returns error status. 0 - OK, !0 - error */ static int output_configure(AACContext *ac, -uint8_t layout_map[MAX_ELEM_ID*4][3], int tags, -int channel_config, enum OCStatus oc_type) +uint8_t layout_map[MAX_ELEM_ID*4][3], int tags, +int channel_config, enum OCStatus oc_type, +int get_new_frame) { AVCodecContext *avctx = ac->avctx; int i, channels = 0, ret; @@ -417,6 +454,9 @@ static int output_configure(AACContext *ac, avctx->channels = ac->oc[1].channels = channels; ac->oc[1].status = oc_type; +if ((ret = frame_configure_elements(ac->avctx, get_new_frame)) < 0) +return ret; + return 0; } @@ -457,7 +497,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id) 2) < 0) return NULL; if (output_configure(ac, layout_map, layout_map_tags, - 2, OC_TRIAL_FRAME) < 0) + 2, OC_TRIAL_FRAME, 1) < 0) return NULL; ac->oc[1].m4ac.chan_config = 2; @@ -473,7 +513,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id) 1) < 0) return NULL; if (output_configure(ac, layout_map, layout_map_tags
Re: [libav-devel] [RFC] pixfmt: support more yuva formats
Hi, On Sun, Oct 14, 2012 at 2:12 PM, Luca Barbato wrote: > On 10/14/2012 10:43 PM, Ronald S. Bultje wrote: >> Hi, >> >> On Sun, Oct 14, 2012 at 1:39 PM, Luca Barbato wrote: >>> On 10/14/2012 09:54 PM, Ronald S. Bultje wrote: Hi, On Sun, Oct 14, 2012 at 12:53 PM, Ronald S. Bultje wrote: > Hi, > > On Sat, Oct 13, 2012 at 11:13 PM, Ronald S. Bultje > wrote: >> Hi, >> >> On Sat, Oct 13, 2012 at 11:06 PM, Luca Barbato >> wrote: >>> --- >>> >>> Here an initial patch to support many yuva, apparently either I botched >>> adding them (since I did lots of cut and paste) or they manage the >>> expose some >>> flaws in swscale. valgrind manages to spot something and might be nice >>> if >>> other people try this and see if the values for the fate-lavfi change >>> after >>> each round. >> >> If this is what I think it is, search for YUVA420P in swscale and >> replace it with a generic alpha check. > > Oh I see now. > > swscale.c:661 > if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) > fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, > 255); > This only works for 8bit. For 9bit, you need a word fill with a value > of (1 << numbits) - 1. Which actually leads to a question: does any of this exist in the real world? I've never, ever, ever seen an image with non-8bpc alpha planes. I hate to invent stuff that has no utility but does carry implementation burden. >>> >>> You asked me to add those ^^; >> >> Uhm, ok, maybe I meant something else? I mean, there really isn't much >> use for 9-15bpp alpha channels as far as I know. 8bpp is obvious and I >> can sort of see 16bpp being useful (although I don't think I've ever >> seen it used). >> >>> BTW while I was investigating I noticed >>> all the previous 9 and 10 formats look strange, if you have time we >>> could have a look. >> >> Can you elaborate? > > try this command > > ./avconv -v quiet -nostats -y -cpuflags all -i ./tests/vsynth1/%02d.pgm > -vcodec rawvideo -pix_fmt yuv420p10 -f nut - | ./avplay - > > You will see it blue tinted while it should be gray. > > (you might need to apply my yet to be reviewed patch to fix nut with > rawvideo). Well yes, can we first sort out this stuff without nut? I mean, I really don't have much reason to trust nut at this moment. When you test a typical conversion (convert that thing to nut without colorspace conversion, and then ./avplay -vf format=yuv420p10le), it works, so the colorspace conversion itself is correct. Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC] pixfmt: support more yuva formats
On 10/14/2012 10:43 PM, Ronald S. Bultje wrote: > Hi, > > On Sun, Oct 14, 2012 at 1:39 PM, Luca Barbato wrote: >> On 10/14/2012 09:54 PM, Ronald S. Bultje wrote: >>> Hi, >>> >>> On Sun, Oct 14, 2012 at 12:53 PM, Ronald S. Bultje >>> wrote: Hi, On Sat, Oct 13, 2012 at 11:13 PM, Ronald S. Bultje wrote: > Hi, > > On Sat, Oct 13, 2012 at 11:06 PM, Luca Barbato wrote: >> --- >> >> Here an initial patch to support many yuva, apparently either I botched >> adding them (since I did lots of cut and paste) or they manage the >> expose some >> flaws in swscale. valgrind manages to spot something and might be nice if >> other people try this and see if the values for the fate-lavfi change >> after >> each round. > > If this is what I think it is, search for YUVA420P in swscale and > replace it with a generic alpha check. Oh I see now. swscale.c:661 if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, 255); This only works for 8bit. For 9bit, you need a word fill with a value of (1 << numbits) - 1. >>> >>> Which actually leads to a question: does any of this exist in the real >>> world? I've never, ever, ever seen an image with non-8bpc alpha >>> planes. I hate to invent stuff that has no utility but does carry >>> implementation burden. >> >> You asked me to add those ^^; > > Uhm, ok, maybe I meant something else? I mean, there really isn't much > use for 9-15bpp alpha channels as far as I know. 8bpp is obvious and I > can sort of see 16bpp being useful (although I don't think I've ever > seen it used). > >> BTW while I was investigating I noticed >> all the previous 9 and 10 formats look strange, if you have time we >> could have a look. > > Can you elaborate? try this command ./avconv -v quiet -nostats -y -cpuflags all -i ./tests/vsynth1/%02d.pgm -vcodec rawvideo -pix_fmt yuv420p10 -f nut - | ./avplay - You will see it blue tinted while it should be gray. (you might need to apply my yet to be reviewed patch to fix nut with rawvideo). lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] FFv1.3 support
On 10/14/2012 09:20 PM, Luca Barbato wrote: > > Could you please provide me a small sample of it? > You can generate it, using "red_kayak" from xiph/derf's collection: http://media.xiph.org/video/derf/y4m/red_kayak_1080p.y4m Using the current git of ffmpeg, create the FFv1.3 video as follows: // $ ffmpeg -i red_kayak_1080p.y4m -an -vcodec ffv1 -strict experimental -level 3 -g 1 -slices 24 -slicecrc 1 red_kayak_1080p-ffv1.avi // Trying to use "avplay" to view "red_kayak_1080p-ffv1.avi" returns the previously posted error. Thanks, Pb ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC] pixfmt: support more yuva formats
Hi, On Sun, Oct 14, 2012 at 1:39 PM, Luca Barbato wrote: > On 10/14/2012 09:54 PM, Ronald S. Bultje wrote: >> Hi, >> >> On Sun, Oct 14, 2012 at 12:53 PM, Ronald S. Bultje >> wrote: >>> Hi, >>> >>> On Sat, Oct 13, 2012 at 11:13 PM, Ronald S. Bultje >>> wrote: Hi, On Sat, Oct 13, 2012 at 11:06 PM, Luca Barbato wrote: > --- > > Here an initial patch to support many yuva, apparently either I botched > adding them (since I did lots of cut and paste) or they manage the expose > some > flaws in swscale. valgrind manages to spot something and might be nice if > other people try this and see if the values for the fate-lavfi change > after > each round. If this is what I think it is, search for YUVA420P in swscale and replace it with a generic alpha check. >>> >>> Oh I see now. >>> >>> swscale.c:661 >>> if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) >>> fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, >>> 255); >>> This only works for 8bit. For 9bit, you need a word fill with a value >>> of (1 << numbits) - 1. >> >> Which actually leads to a question: does any of this exist in the real >> world? I've never, ever, ever seen an image with non-8bpc alpha >> planes. I hate to invent stuff that has no utility but does carry >> implementation burden. > > You asked me to add those ^^; Uhm, ok, maybe I meant something else? I mean, there really isn't much use for 9-15bpp alpha channels as far as I know. 8bpp is obvious and I can sort of see 16bpp being useful (although I don't think I've ever seen it used). > BTW while I was investigating I noticed > all the previous 9 and 10 formats look strange, if you have time we > could have a look. Can you elaborate? Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC] pixfmt: support more yuva formats
On 10/14/2012 09:54 PM, Ronald S. Bultje wrote: > Hi, > > On Sun, Oct 14, 2012 at 12:53 PM, Ronald S. Bultje wrote: >> Hi, >> >> On Sat, Oct 13, 2012 at 11:13 PM, Ronald S. Bultje >> wrote: >>> Hi, >>> >>> On Sat, Oct 13, 2012 at 11:06 PM, Luca Barbato wrote: --- Here an initial patch to support many yuva, apparently either I botched adding them (since I did lots of cut and paste) or they manage the expose some flaws in swscale. valgrind manages to spot something and might be nice if other people try this and see if the values for the fate-lavfi change after each round. >>> >>> If this is what I think it is, search for YUVA420P in swscale and >>> replace it with a generic alpha check. >> >> Oh I see now. >> >> swscale.c:661 >> if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) >> fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, >> 255); >> This only works for 8bit. For 9bit, you need a word fill with a value >> of (1 << numbits) - 1. > > Which actually leads to a question: does any of this exist in the real > world? I've never, ever, ever seen an image with non-8bpc alpha > planes. I hate to invent stuff that has no utility but does carry > implementation burden. You asked me to add those ^^; BTW while I was investigating I noticed all the previous 9 and 10 formats look strange, if you have time we could have a look. And that reminds me that I could enjoy having color+ir and bayer+ir formats and those are used =) lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] about: update to the current state
On 10/14/2012 10:12 PM, Diego Biurrun wrote: > On Sun, Oct 14, 2012 at 06:11:54PM +0200, Luca Barbato wrote: > Please commit the patch with those changes while I finish the pager styling =) lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] about: update to the current state
On Sun, Oct 14, 2012 at 06:11:54PM +0200, Luca Barbato wrote: > --- a/src/about > +++ b/src/about > @@ -13,7 +13,7 @@ to go forward. > > We are committed to provide major releases yearly and point releases > at least on a quaterly rate. We try to maintain at least two major release > -at time (currently 0.5 and 0.6), while developing the next one (0.7). > +at time (currently 0.7 and 0.8), while developing the next one (9). Drop the numbers, this is brittle. > @@ -33,9 +33,8 @@ provide point releases. > > In order to make the transition as smooth as possible, the removal of > deprecated function can span more than whole release cycle. > - Currently 0.7 will replace and deprecate most of the buffered and > -unbuffered IO subsystem functions, the 0.6 compatibility will be preserved > -until the 0.8 release. > + Release 0.7 replaced and deprecated most of the buffered and unbuffered > +IO subsystem functions, the 0.6 compatibility is preserved until the 0.8. Same here - mentioning specific release details just makes the page go stale quickly... > @@ -52,12 +51,11 @@ reports please contact us. > > We strive to implement and provide useful and innovative features in > a timely fashion, provide stable release and interact to the best of our > -abilities with our downstream such as distributors and end users. For > -instance, most of the ffmpeg-mt work has been merged into Libav -href="http://git.libav.org/?p=libav.git;a=commit;h=37b00b47cbeecd66bb34c5c7c534d016d6e8da24";> > -for quite some time. This work is still ongoing, we are still > -working hard to fix the remaining issues such as with multi-threaded > -h264 decoding. > +abilities with our downstream such as distributors and end users. > +Supporting a large variety of system and compilers had been a quite long systems has been a long time trend > +time trend, as stated by our http://fate.libav.org"; title="FATE > Automated Testing Environment">FATE page. Thanks to the dedication of many line length > +developers even difficult targets such as Microsoft Visual C compiler is such as the Diego ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC] pixfmt: support more yuva formats
Hi, On Sun, Oct 14, 2012 at 12:53 PM, Ronald S. Bultje wrote: > Hi, > > On Sat, Oct 13, 2012 at 11:13 PM, Ronald S. Bultje wrote: >> Hi, >> >> On Sat, Oct 13, 2012 at 11:06 PM, Luca Barbato wrote: >>> --- >>> >>> Here an initial patch to support many yuva, apparently either I botched >>> adding them (since I did lots of cut and paste) or they manage the expose >>> some >>> flaws in swscale. valgrind manages to spot something and might be nice if >>> other people try this and see if the values for the fate-lavfi change after >>> each round. >> >> If this is what I think it is, search for YUVA420P in swscale and >> replace it with a generic alpha check. > > Oh I see now. > > swscale.c:661 > if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) > fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, 255); > This only works for 8bit. For 9bit, you need a word fill with a value > of (1 << numbits) - 1. Which actually leads to a question: does any of this exist in the real world? I've never, ever, ever seen an image with non-8bpc alpha planes. I hate to invent stuff that has no utility but does carry implementation burden. Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC] pixfmt: support more yuva formats
Hi, On Sat, Oct 13, 2012 at 11:13 PM, Ronald S. Bultje wrote: > Hi, > > On Sat, Oct 13, 2012 at 11:06 PM, Luca Barbato wrote: >> --- >> >> Here an initial patch to support many yuva, apparently either I botched >> adding them (since I did lots of cut and paste) or they manage the expose >> some >> flaws in swscale. valgrind manages to spot something and might be nice if >> other people try this and see if the values for the fate-lavfi change after >> each round. > > If this is what I think it is, search for YUVA420P in swscale and > replace it with a generic alpha check. Oh I see now. swscale.c:661 if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) fillPlane(dst[3], dstStride[3], dstW, dstY - lastDstY, lastDstY, 255); This only works for 8bit. For 9bit, you need a word fill with a value of (1 << numbits) - 1. Ronald ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] FFv1.3 support
On 10/14/2012 08:39 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 >> > It compiles, but when I tray to playback a ffv1.3 file created with > ffmpeg, it bails out: > > // -- > $ avplay red_kayak_1080p-ffv1.avi > // -- > avplay version c9e04a1, Copyright (c) 2003-2011 the Libav developers > built on Oct 14 2012 20:30:24 with gcc 4.6.1 > [ffv1 @ 0x2a34620] read_quant_table error > Last message repeated 5 times > Input #0, avi, from 'red_kayak_1080p-ffv1.avi': > Metadata: > encoder : Lavf54.29.105 > Duration: 00:00:19.01, start: 0.00, bitrate: 243608 kb/s > Stream #0.0: Video: ffv1, 1920x1080, PAR 1:1 DAR 16:9, 29.97 fps, > 29.97 tbr, 29.97 tbn, 29.97 tbc > [ffv1 @ 0x2a34620] read_quant_table error > red_kayak_1080p-ffv1.avi: could not open codecs > 1350239842.67 A-V: 0.000 s:0.0 aq=0KB vq=0KB sq=0B f=0/0 > // -- > > I'll repeat the test with a ffv1.3 file created with avconf. Could you please provide me a small sample of it? lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] lavc: update documentation for AVFrame.extended_data
On Sun, 14 Oct 2012 14:32:08 -0400, Justin Ruggles wrote: > --- > libavcodec/avcodec.h |2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h > index 51270e6..cda6703 100644 > --- a/libavcodec/avcodec.h > +++ b/libavcodec/avcodec.h > @@ -990,7 +990,7 @@ typedef struct AVFrame { > * extended_data must be used by the decoder in order to access all > * channels. > * > - * encoding: unused > + * encoding: set by user > * decoding: set by AVCodecContext.get_buffer() > */ > uint8_t **extended_data; > -- > 1.7.1 > Ok -- Anton Khirnov ___ 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 > It compiles, but when I tray to playback a ffv1.3 file created with ffmpeg, it bails out: // -- $ avplay red_kayak_1080p-ffv1.avi // -- avplay version c9e04a1, Copyright (c) 2003-2011 the Libav developers built on Oct 14 2012 20:30:24 with gcc 4.6.1 [ffv1 @ 0x2a34620] read_quant_table error Last message repeated 5 times Input #0, avi, from 'red_kayak_1080p-ffv1.avi': Metadata: encoder : Lavf54.29.105 Duration: 00:00:19.01, start: 0.00, bitrate: 243608 kb/s Stream #0.0: Video: ffv1, 1920x1080, PAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 29.97 tbn, 29.97 tbc [ffv1 @ 0x2a34620] read_quant_table error red_kayak_1080p-ffv1.avi: could not open codecs 1350239842.67 A-V: 0.000 s:0.0 aq=0KB vq=0KB sq=0B f=0/0 // -- I'll repeat the test with a ffv1.3 file created with avconf. Thanks, Pb ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] lavc: update documentation for AVFrame.extended_data
--- libavcodec/avcodec.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 51270e6..cda6703 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -990,7 +990,7 @@ typedef struct AVFrame { * extended_data must be used by the decoder in order to access all * channels. * - * encoding: unused + * encoding: set by user * decoding: set by AVCodecContext.get_buffer() */ uint8_t **extended_data; -- 1.7.1 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] index: report just the latest 10 news items
On 10/14/2012 07:30 PM, Måns Rullgård wrote: > Luca Barbato writes: > +sub(/\".*/, "", name); +name = url "#" name; +} + +/\/ { >>> >>> That pattern looks wrong. What are you actually trying to match? >> >> "\<" is wrong, to match any h3 " > I was mainly thinking of the [^h3] part. This will prevent matching > anything with an 'h' or a '3' in the title. Somehow I don't think > that's what you meant. Indeed +count++; +if (count > 5 || NR > 30) { +print ">>> "\">more"; >>> >>> Why the ? >> >> evil bootstrap stock pager done according the evil html5 guideline, I >> can make it a centered div, but was feeling lazy on doing custom css. > > When you start working for your tools... Debating would make void the time I spared not having to write custom css and coming up with an irregular syntax for an element standardized in the current spec^draft... lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] aacdec: use float planar sample format for output
--- Simpler version that keeps the output configuration handling as-is. libavcodec/aac.h|7 ++- libavcodec/aacdec.c | 104 +++ libavcodec/aacsbr.c |6 +-- 3 files changed, 69 insertions(+), 48 deletions(-) diff --git a/libavcodec/aac.h b/libavcodec/aac.h index 32baf9d..70470dd 100644 --- a/libavcodec/aac.h +++ b/libavcodec/aac.h @@ -237,9 +237,10 @@ typedef struct SingleChannelElement { uint8_t zeroes[128];///< band is not coded (used by encoder) DECLARE_ALIGNED(32, float, coeffs)[1024]; ///< coefficients for IMDCT DECLARE_ALIGNED(32, float, saved)[1024]; ///< overlap -DECLARE_ALIGNED(32, float, ret)[2048];///< PCM output +DECLARE_ALIGNED(32, float, ret_buf)[2048];///< PCM output buffer DECLARE_ALIGNED(16, float, ltp_state)[3072]; ///< time signal for LTP PredictorState predictor_state[MAX_PREDICTORS]; +float *ret; ///< PCM output } SingleChannelElement; /** @@ -298,10 +299,10 @@ typedef struct AACContext { /** @} */ /** - * @name Members used for output interleaving + * @name Members used for output * @{ */ -float *output_data[MAX_CHANNELS]; ///< Points to each element's 'ret' buffer (PCM output). +SingleChannelElement *output_element[MAX_CHANNELS]; ///< Points to each SingleChannelElement /** @} */ DECLARE_ALIGNED(32, float, temp)[128]; diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 4a6d390..af617c3 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -149,10 +149,10 @@ static av_cold int che_configure(AACContext *ac, ff_aac_sbr_ctx_init(ac, &ac->che[type][id]->sbr); } if (type != TYPE_CCE) { -ac->output_data[(*channels)++] = ac->che[type][id]->ch[0].ret; +ac->output_element[(*channels)++] = &ac->che[type][id]->ch[0]; if (type == TYPE_CPE || (type == TYPE_SCE && ac->oc[1].m4ac.ps == 1)) { -ac->output_data[(*channels)++] = ac->che[type][id]->ch[1].ret; +ac->output_element[(*channels)++] = &ac->che[type][id]->ch[1]; } } } else { @@ -163,6 +163,42 @@ static av_cold int che_configure(AACContext *ac, return 0; } +static int frame_configure_elements(AVCodecContext *avctx, int get_new_frame) +{ +AACContext *ac = avctx->priv_data; +int type, id; + +/* set channel pointers to internal buffers by default */ +for (type = 0; type < 4; type++) { +for (id = 0; id < MAX_ELEM_ID; id++) { +ChannelElement *che = ac->che[type][id]; +if (che) { +che->ch[0].ret = che->ch[0].ret_buf; +che->ch[1].ret = che->ch[1].ret_buf; +} +} +} + +if (get_new_frame) { +int ch, ret; + +/* get output buffer */ +ac->frame.nb_samples = 2048; +if ((ret = avctx->get_buffer(avctx, &ac->frame)) < 0) { +av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); +return ret; +} + +/* map output channel pointers to AVFrame data */ +for (ch = 0; ch < avctx->channels; ch++) { +if (ac->output_element[ch]) +ac->output_element[ch]->ret = (float *)ac->frame.extended_data[ch]; +} +} + +return 0; +} + struct elem_to_channel { uint64_t av_position; uint8_t syn_ele; @@ -378,8 +414,9 @@ static void pop_output_configuration(AACContext *ac) { * @return Returns error status. 0 - OK, !0 - error */ static int output_configure(AACContext *ac, -uint8_t layout_map[MAX_ELEM_ID*4][3], int tags, -int channel_config, enum OCStatus oc_type) +uint8_t layout_map[MAX_ELEM_ID*4][3], int tags, +int channel_config, enum OCStatus oc_type, +int get_new_frame) { AVCodecContext *avctx = ac->avctx; int i, channels = 0, ret; @@ -417,6 +454,9 @@ static int output_configure(AACContext *ac, avctx->channels = ac->oc[1].channels = channels; ac->oc[1].status = oc_type; +if ((ret = frame_configure_elements(ac->avctx, get_new_frame)) < 0) +return ret; + return 0; } @@ -457,7 +497,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id) 2) < 0) return NULL; if (output_configure(ac, layout_map, layout_map_tags, - 2, OC_TRIAL_FRAME) < 0) + 2, OC_TRIAL_FRAME, 1) < 0) return NULL; ac->oc[1].m4ac.chan_config = 2; @@ -473,7 +513,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id) 1) < 0) retur
Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag
On 10/14/2012 06:28 PM, John Stebbins wrote: > On 10/14/2012 05:17 PM, Måns Rullgård wrote: >> Luca Barbato writes: >> >>> On 10/14/2012 04:52 PM, John Stebbins wrote: +uint8_t forced; >>> why uint8_t ? I guess it would require a version bump btw. >> Add a flags member instead so more things can be added later without >> changing ABI incompatibly again. >> > ubitux rightly points out on irc that the forced flag should be per rect. Although libav currently only fills one rect per PGS sub it could and should support multiple, and each can be flagged as forced. ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] index: report just the latest 10 news items
Luca Barbato writes: >>> +sub(/\".*/, "", name); >>> +name = url "#" name; >>> +} >>> + >>> +/\/ { >> >> That pattern looks wrong. What are you actually trying to match? > > "\<" is wrong, to match any h3 ">> +count++; >>> +if (count > 5 || NR > 30) { >>> +print ">> "\">more"; >> >> Why the ? > > evil bootstrap stock pager done according the evil html5 guideline, I > can make it a centered div, but was feeling lazy on doing custom css. When you start working for your tools... -- 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] about: update to the current state
On 10/14/2012 06:27 PM, Måns Rullgård wrote: > Luca Barbato writes: > >> --- >> src/about | 18 -- >> 1 file changed, 8 insertions(+), 10 deletions(-) >> >> diff --git a/src/about b/src/about >> index 607a8b7..2e63812 100644 >> --- a/src/about >> +++ b/src/about >> @@ -13,7 +13,7 @@ to go forward. >> >> We are committed to provide major releases yearly and point releases >> at least on a quaterly rate. We try to maintain at least two major release >> -at time (currently 0.5 and 0.6), while developing the next one (0.7). >> +at time (currently 0.7 and 0.8), while developing the next one (9). > > Maybe it's better not to mention any specific version numbers here. I do agree dropping the () would be enough or do you think about rephrasing it? lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] index: report just the latest 10 news items
On 10/14/2012 06:25 PM, Måns Rullgård wrote: > Luca Barbato writes: > >> Limit the space taken to 30 lines anyway. >> --- >> >> This should make Diego happy =P >> The pager is a little ugly so I guess I'll change it to something more square >> and green. >> >> Makefile | 7 --- >> awk_split| 20 >> sed_commands | 13 - >> 3 files changed, 24 insertions(+), 16 deletions(-) >> create mode 100644 awk_split >> delete mode 100644 sed_commands >> >> diff --git a/Makefile b/Makefile >> index e843bef..6832efe 100644 >> --- a/Makefile >> +++ b/Makefile >> @@ -16,11 +16,12 @@ all: $(TARGETS) >> clean: >> rm -f $(TARGETS) >> >> -htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) >> +htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) awk_split >> cat src/template_head1 $<_title \ >> src/template_head2 \ >> -src/template_head3 $< src/news \ >> -src/template_footer > $@ >> +src/template_head3 $< > $@ >> +awk -f awk_split src/news >> $@ >> +cat src/template_footer >> $@ >> >> htdocs/%.html: src/% src/%_title $(PAGE_DEPS) >> cat src/template_head1 $<_title \ >> diff --git a/awk_split b/awk_split >> new file mode 100644 >> index 000..2b034c3 >> --- /dev/null >> +++ b/awk_split > > Why not split.awk? > no reason, I'll rename. >> @@ -0,0 +1,20 @@ >> +BEGIN { >> +url = ARGV[1] ".html" >> +sub(/^.*\//, "", url) >> +} >> + >> +/> +name = $2; >> +sub(/[^\"]*\"/, "", name ); > > Stray space before ) Righ > >> +sub(/\".*/, "", name); >> +name = url "#" name; >> +} >> + >> +/\/ { > > That pattern looks wrong. What are you actually trying to match? "\<" is wrong, to match any h3 "> +count++; >> +if (count > 5 || NR > 30) { >> +print "> "\">more"; > > Why the ? evil bootstrap stock pager done according the evil html5 guideline, I can make it a centered div, but was feeling lazy on doing custom css. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag
On 10/14/2012 05:17 PM, Måns Rullgård wrote: > Luca Barbato writes: > >> On 10/14/2012 04:52 PM, John Stebbins wrote: >>> +uint8_t forced; >> why uint8_t ? I guess it would require a version bump btw. > Add a flags member instead so more things can be added later without > changing ABI incompatibly again. > Updated patch with flags as suggested. >From 65614697aaa618bfae3f2db97b85db49ee0d9707 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Sun, 14 Oct 2012 18:24:10 +0200 Subject: [PATCH] PGS subtitles: Expose forced flag Useful for detection of subtitles displayed during foreign language scenes. --- libavcodec/avcodec.h |3 +++ libavcodec/pgssubdec.c | 11 --- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 51270e6..78f007d 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3161,6 +3161,8 @@ typedef struct AVSubtitleRect { char *ass; } AVSubtitleRect; +#define AV_SUBTITLE_FLAG_FORCED 0x0001 + typedef struct AVSubtitle { uint16_t format; /* 0 = graphics */ uint32_t start_display_time; /* relative to packet pts, in ms */ @@ -3168,6 +3170,7 @@ typedef struct AVSubtitle { unsigned num_rects; AVSubtitleRect **rects; int64_t pts;///< Same as packet pts, in AV_TIME_BASE +int flags; } AVSubtitle; /** diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 9fd26d8..8d42230 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -45,6 +45,7 @@ typedef struct PGSSubPresentation { int y; int id_number; int object_number; +uint8_t composition_flag; } PGSSubPresentation; typedef struct PGSSubPicture { @@ -299,16 +300,17 @@ static void parse_presentation_segment(AVCodecContext *avctx, buf += 3; ctx->presentation.object_number = bytestream_get_byte(&buf); +ctx->presentation.composition_flag = 0; if (!ctx->presentation.object_number) return; /* - * Skip 4 bytes of unknown: + * Skip 3 bytes of unknown: * object_id_ref (2 bytes), * window_id_ref, - * composition_flag (0x80 - object cropped, 0x40 - object forced) */ -buf += 4; +buf += 3; +ctx->presentation.composition_flag = bytestream_get_byte(&buf); x = bytestream_get_be16(&buf); y = bytestream_get_be16(&buf); @@ -356,6 +358,9 @@ static int display_end_segment(AVCodecContext *avctx, void *data, */ memset(sub, 0, sizeof(*sub)); +if (ctx->presentation.composition_flag & 0x40) +sub->flags |= AV_SUBTITLE_FLAG_FORCED; + // Blank if last object_number was 0. // Note that this may be wrong for more complex subtitles. if (!ctx->presentation.object_number) -- 1.7.9.5 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] about: update to the current state
Luca Barbato writes: > --- > src/about | 18 -- > 1 file changed, 8 insertions(+), 10 deletions(-) > > diff --git a/src/about b/src/about > index 607a8b7..2e63812 100644 > --- a/src/about > +++ b/src/about > @@ -13,7 +13,7 @@ to go forward. > > We are committed to provide major releases yearly and point releases > at least on a quaterly rate. We try to maintain at least two major release > -at time (currently 0.5 and 0.6), while developing the next one (0.7). > +at time (currently 0.7 and 0.8), while developing the next one (9). Maybe it's better not to mention any specific version numbers here. -- 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] index: report just the latest 10 news items
Luca Barbato writes: > Limit the space taken to 30 lines anyway. > --- > > This should make Diego happy =P > The pager is a little ugly so I guess I'll change it to something more square > and green. > > Makefile | 7 --- > awk_split| 20 > sed_commands | 13 - > 3 files changed, 24 insertions(+), 16 deletions(-) > create mode 100644 awk_split > delete mode 100644 sed_commands > > diff --git a/Makefile b/Makefile > index e843bef..6832efe 100644 > --- a/Makefile > +++ b/Makefile > @@ -16,11 +16,12 @@ all: $(TARGETS) > clean: > rm -f $(TARGETS) > > -htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) > +htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) awk_split > cat src/template_head1 $<_title \ > src/template_head2 \ > - src/template_head3 $< src/news \ > - src/template_footer > $@ > + src/template_head3 $< > $@ > + awk -f awk_split src/news >> $@ > + cat src/template_footer >> $@ > > htdocs/%.html: src/% src/%_title $(PAGE_DEPS) > cat src/template_head1 $<_title \ > diff --git a/awk_split b/awk_split > new file mode 100644 > index 000..2b034c3 > --- /dev/null > +++ b/awk_split Why not split.awk? > @@ -0,0 +1,20 @@ > +BEGIN { > +url = ARGV[1] ".html" > +sub(/^.*\//, "", url) > +} > + > +/ +name = $2; > +sub(/[^\"]*\"/, "", name ); Stray space before ) > +sub(/\".*/, "", name); > +name = url "#" name; > +} > + > +/\/ { That pattern looks wrong. What are you actually trying to match? > +count++; > +if (count > 5 || NR > 30) { > +print " "\">more"; Why the ? > +exit 0; > +} > +} > +{ print } -- 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] PGS subtitles: Exposed forced flag
On 10/14/2012 05:41 PM, John Stebbins wrote: > On 10/14/2012 05:14 PM, Luca Barbato wrote: >> On 10/14/2012 04:52 PM, John Stebbins wrote: >>> +uint8_t forced; >> why uint8_t ? I guess it would require a version bump btw. >> >> In itself looks a good feature (and probably the players would enjoy >> having this information) >> >> lu >> > > > Is the version number bump something I should do in the patch, or do you > prefer handling that yourselves? We can do ourselves, it is better point it in case somebody forgets. lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] about: update to the current state
--- src/about | 18 -- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/about b/src/about index 607a8b7..2e63812 100644 --- a/src/about +++ b/src/about @@ -13,7 +13,7 @@ to go forward. We are committed to provide major releases yearly and point releases at least on a quaterly rate. We try to maintain at least two major release -at time (currently 0.5 and 0.6), while developing the next one (0.7). +at time (currently 0.7 and 0.8), while developing the next one (9). Point releases @@ -33,9 +33,8 @@ provide point releases. In order to make the transition as smooth as possible, the removal of deprecated function can span more than whole release cycle. - Currently 0.7 will replace and deprecate most of the buffered and -unbuffered IO subsystem functions, the 0.6 compatibility will be preserved -until the 0.8 release. + Release 0.7 replaced and deprecated most of the buffered and unbuffered +IO subsystem functions, the 0.6 compatibility is preserved until the 0.8. Snapshots @@ -52,12 +51,11 @@ reports please contact us. We strive to implement and provide useful and innovative features in a timely fashion, provide stable release and interact to the best of our -abilities with our downstream such as distributors and end users. For -instance, most of the ffmpeg-mt work has been merged into Libav http://git.libav.org/?p=libav.git;a=commit;h=37b00b47cbeecd66bb34c5c7c534d016d6e8da24";> -for quite some time. This work is still ongoing, we are still -working hard to fix the remaining issues such as with multi-threaded -h264 decoding. +abilities with our downstream such as distributors and end users. +Supporting a large variety of system and compilers had been a quite long +time trend, as stated by our http://fate.libav.org"; title="FATE Automated Testing Environment">FATE page. Thanks to the dedication of many +developers even difficult targets such as Microsoft Visual C compiler is +supported through a series of toolchain wrappers. We are not afraid to overhaul radically our code in order to provide a better foundation for future works and we prefer to spend effort to get -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] index: report just the latest 10 news items
Limit the space taken to 30 lines anyway. --- This should make Diego happy =P The pager is a little ugly so I guess I'll change it to something more square and green. Makefile | 7 --- awk_split| 20 sed_commands | 13 - 3 files changed, 24 insertions(+), 16 deletions(-) create mode 100644 awk_split delete mode 100644 sed_commands diff --git a/Makefile b/Makefile index e843bef..6832efe 100644 --- a/Makefile +++ b/Makefile @@ -16,11 +16,12 @@ all: $(TARGETS) clean: rm -f $(TARGETS) -htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) +htdocs/index.html: src/index src/news src/index_title $(PAGE_DEPS) awk_split cat src/template_head1 $<_title \ src/template_head2 \ - src/template_head3 $< src/news \ - src/template_footer > $@ + src/template_head3 $< > $@ + awk -f awk_split src/news >> $@ + cat src/template_footer >> $@ htdocs/%.html: src/% src/%_title $(PAGE_DEPS) cat src/template_head1 $<_title \ diff --git a/awk_split b/awk_split new file mode 100644 index 000..2b034c3 --- /dev/null +++ b/awk_split @@ -0,0 +1,20 @@ +BEGIN { +url = ARGV[1] ".html" +sub(/^.*\//, "", url) +} + +// { +count++; +if (count > 5 || NR > 30) { +print "more"; +exit 0; +} +} +{ print } diff --git a/sed_commands b/sed_commands deleted file mode 100644 index d0bd7fa..000 --- a/sed_commands +++ /dev/null @@ -1,13 +0,0 @@ -/LIBAV_ABOUT_NAVBAR/a\ -\ -About/ \ -Projects Using Libav\ - -/LIBAV_ABOUT_NAVBAR/d - -/LIBAV_LEGAL_NAVBAR/a\ -\ -License and Legal Issues\ -Hall of Shame\ - -/LIBAV_LEGAL_NAVBAR/d -- 1.7.12 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag
On 10/14/2012 05:14 PM, Luca Barbato wrote: > On 10/14/2012 04:52 PM, John Stebbins wrote: >> +uint8_t forced; > why uint8_t ? I guess it would require a version bump btw. > > In itself looks a good feature (and probably the players would enjoy > having this information) > > lu > Is the version number bump something I should do in the patch, or do you prefer handling that yourselves? ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag
On 10/14/2012 05:17 PM, Måns Rullgård wrote: > Luca Barbato writes: > >> On 10/14/2012 04:52 PM, John Stebbins wrote: >>> +uint8_t forced; >> why uint8_t ? I guess it would require a version bump btw. > Add a flags member instead so more things can be added later without > changing ABI incompatibly again. Ok. What data type would you like for this? uint32_t to allow more flags? ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag
On 10/14/2012 05:14 PM, Luca Barbato wrote: > On 10/14/2012 04:52 PM, John Stebbins wrote: >> +uint8_t forced; > why uint8_t ? I guess it would require a version bump btw. > > In itself looks a good feature (and probably the players would enjoy > having this information) > > uint8_t appears to be used in a lot of places for boolean values. Is there something more appropriate? ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] PGS subtitles: Exposed forced flag
Luca Barbato writes: > On 10/14/2012 04:52 PM, John Stebbins wrote: >> +uint8_t forced; > > why uint8_t ? I guess it would require a version bump btw. Add a flags member instead so more things can be added later without changing ABI incompatibly again. -- 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] PGS subtitles: Exposed forced flag
On 10/14/2012 04:52 PM, John Stebbins wrote: > +uint8_t forced; why uint8_t ? I guess it would require a version bump btw. In itself looks a good feature (and probably the players would enjoy having this information) lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] PGS subtitles: Set AVSubtitle pts value
>From bbbd5c3a085b88fbf8362fd720cb4b884802d41a Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Sun, 14 Oct 2012 16:37:06 +0200 Subject: [PATCH 2/2] PGS subtitles: Set AVSubtitle pts value pts should be that of the packet containing the presentation segment. --- libavcodec/pgssubdec.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index bc72643..5fd219b 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -46,6 +46,7 @@ typedef struct PGSSubPresentation { int id_number; int object_number; uint8_t composition_flag; +int64_t pts; } PGSSubPresentation; typedef struct PGSSubPicture { @@ -272,7 +273,8 @@ static void parse_palette_segment(AVCodecContext *avctx, * @todo TODO: Implement forcing of subtitles */ static void parse_presentation_segment(AVCodecContext *avctx, - const uint8_t *buf, int buf_size) + const uint8_t *buf, int buf_size, + int64_t pts) { PGSSubContext *ctx = avctx->priv_data; @@ -281,6 +283,8 @@ static void parse_presentation_segment(AVCodecContext *avctx, int w = bytestream_get_be16(&buf); int h = bytestream_get_be16(&buf); +ctx->presentation.pts = pts; + av_dlog(avctx, "Video Dimensions %dx%d\n", w, h); if (av_image_check_size(w, h, 0, avctx) >= 0) @@ -358,6 +362,7 @@ static int display_end_segment(AVCodecContext *avctx, void *data, */ memset(sub, 0, sizeof(*sub)); +sub->pts = ctx->presentation.pts; sub->forced = (ctx->presentation.composition_flag & 0x40) != 0; // Blank if last object_number was 0. @@ -445,7 +450,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, parse_picture_segment(avctx, buf, segment_length); break; case PRESENTATION_SEGMENT: -parse_presentation_segment(avctx, buf, segment_length); +parse_presentation_segment(avctx, buf, segment_length, avpkt->pts); break; case WINDOW_SEGMENT: /* -- 1.7.9.5 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
[libav-devel] [PATCH] PGS subtitles: Exposed forced flag
>From d8ffaee164efaf8d9bc97b4b63549cff5105 Mon Sep 17 00:00:00 2001 From: John Stebbins Date: Sun, 14 Oct 2012 16:28:48 +0200 Subject: [PATCH 1/2] PGS subtitles: Expose "forced" flag Useful for detection of subtitles displayed during foreign language scenes. --- libavcodec/avcodec.h |1 + libavcodec/pgssubdec.c | 10 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 51270e6..bcf6f81 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3168,6 +3168,7 @@ typedef struct AVSubtitle { unsigned num_rects; AVSubtitleRect **rects; int64_t pts;///< Same as packet pts, in AV_TIME_BASE +uint8_t forced; } AVSubtitle; /** diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 9fd26d8..bc72643 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -45,6 +45,7 @@ typedef struct PGSSubPresentation { int y; int id_number; int object_number; +uint8_t composition_flag; } PGSSubPresentation; typedef struct PGSSubPicture { @@ -299,16 +300,17 @@ static void parse_presentation_segment(AVCodecContext *avctx, buf += 3; ctx->presentation.object_number = bytestream_get_byte(&buf); +ctx->presentation.composition_flag = 0; if (!ctx->presentation.object_number) return; /* - * Skip 4 bytes of unknown: + * Skip 3 bytes of unknown: * object_id_ref (2 bytes), * window_id_ref, - * composition_flag (0x80 - object cropped, 0x40 - object forced) */ -buf += 4; +buf += 3; +ctx->presentation.composition_flag = bytestream_get_byte(&buf); x = bytestream_get_be16(&buf); y = bytestream_get_be16(&buf); @@ -356,6 +358,8 @@ static int display_end_segment(AVCodecContext *avctx, void *data, */ memset(sub, 0, sizeof(*sub)); +sub->forced = (ctx->presentation.composition_flag & 0x40) != 0; + // Blank if last object_number was 0. // Note that this may be wrong for more complex subtitles. if (!ctx->presentation.object_number) -- 1.7.9.5 ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [RFC] pixfmt: support more yuva formats
On 10/14/2012 08:13 AM, Ronald S. Bultje wrote: > Hi, > > On Sat, Oct 13, 2012 at 11:06 PM, Luca Barbato wrote: >> --- >> >> Here an initial patch to support many yuva, apparently either I botched >> adding them (since I did lots of cut and paste) or they manage the expose >> some >> flaws in swscale. valgrind manages to spot something and might be nice if >> other people try this and see if the values for the fate-lavfi change after >> each round. > > If this is what I think it is, search for YUVA420P in swscale and > replace it with a generic alpha check. libswscale/swscale_unscaled.c:if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) && libswscale/swscale_unscaled.c: srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) && libswscale/swscale_unscaled.c:(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && libswscale/swscale_unscaled.c:(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && libswscale/swscale_unscaled.c:if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) { libswscale/swscale_unscaled.c: (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) libswscale/swscale_unscaled.c: (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) libswscale/swscale_unscaled.c:(srcFormat == AV_PIX_FMT_YUVA420P && dstFormat == AV_PIX_FMT_YUV420P) || libswscale/swscale_unscaled.c:(srcFormat == AV_PIX_FMT_YUV420P && dstFormat == AV_PIX_FMT_YUVA420P) || All of those seem to just consider yuva420 as yuv420 libswscale/x86/yuv2rgb.c:c->srcFormat != AV_PIX_FMT_YUVA420P) libswscale/x86/yuv2rgb.c:if (c->srcFormat == AV_PIX_FMT_YUVA420P) { libswscale/x86/yuv2rgb.c:if (c->srcFormat == AV_PIX_FMT_YUVA420P) { libswscale/yuv2rgb.c:if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P) libswscale/yuv2rgb.c:if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P) And this is about yuva -> any not any -> yuva What is strange is that building with clang+asan makes the problem disappear... lu ___ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel
Re: [libav-devel] [PATCH] announce plain 9 beta 1 release
On Sat, 13 Oct 2012 10:18:24 -0400, Reinhard Tartler wrote: > --- > src/download | 22 > src/news | 82 > ++ > 2 files changed, 104 insertions(+) > > This is my first shot at the news site entry. Please revise and push at your > will. > > Reinhard > > diff --git a/src/download b/src/download > index 0e88eaa..9039cbd 100644 > --- a/src/download > +++ b/src/download > @@ -203,6 +203,28 @@ selected changes from the development branch, which > therefore receives much more > and much faster bug fixes such as additional features and security patches. > > > +Libav 9 "plain 9" > + > +While 9 is not released yet, we already provide you with a > +preview beta release. Please accept this opportunity to test and provide > +us with feedback about your impressions with this release and use our > +new Bugzilla for filing bugs: > +https://bugzilla.libav.org";>https://bugzilla.libav.org/ > + > + > + > +Download bzip2 > tarball > +MD5 > +SHA1 > +PGP signature > +Download gzip tarball > +MD5 > +SHA1 > +PGP signature > +Changelog > +Release Notes > + > + > Libav 0.8.3 "Forbidden Fruit" > > 0.8.3 was released on 2012-06-09. It is the latest point release from > diff --git a/src/news b/src/news > index 673672a..e532057 100644 > --- a/src/news > +++ b/src/news > @@ -1,5 +1,87 @@ > News > > +October 11, 2012 > + > +With the next upcoming release, we change our versioning scheme to > +follow our workflow better. This means that major releases will update > +the major component of the version number, stable releases the minor > +component. With this in mind, we are happy to provide a first preview of > +our next release version 9. > + > + I don't quite like the wording here, it dances around the issue, but never quite mentions what we actually did -- drop the leading zero. I'd rewrite the second sentence as: This means that the leading zero, present in our previous version numbers, is dropped. Version numbers from now on will be in major.minor form, with major releases updating the major component and stable releases the minor component. > + > +A new library arrived in Libav during this development cycle -- its name is > +libavresample and it handles audio conversion and mixing. All > +users are encouraged to use it instead of the old, now deprecated, audio > +conversion API in libavcodec. > + > + > + > +The libpostproc library now resides in a separate tree. It was fully > +independent of the other Libav libraries, not used by any of the tools > +and saw very little development. For these reasons we decided that it > +has no place in Libav. A standalone Git tree is available > +at http://git.videolan.org/?p=libpostproc.git";>videolan for > +people wishing to use libpostproc. > + > + > + > +The major versions of the libavcodec, libavformat > +and libavfilter libraries have been bumped, so they are not API > +or ABI compatible with the 0.8 release. The ffmpeg transcoding tool, > +kept for compatibility in 0.8, has also been dropped. > + > + > + > +This release brings a number of significant changes in > +the libavfilter library. Firstly, all the API dealing with > +filter internals is no longer public. The result is that creating > +user-side filters will not be supported until libavfilter is more > +mature. Secondly, full audio filtering support is now available along > +with a set of basic audio filters. We hope that their number will soon > +grow significantly. The avconv transcoding tool has of course been > +extended to handle audio filtering as well. There were a number of > +other API changes, most importantly the addition of the buffer sink > +public API. > + > + > + > +In the libavcodec library, one of the most notable changes is > +added support for planar audio (i.e. not interleaved). Many decoders and > +encoders, that previously did inefficient (de)interleaving internally, > +now only work with planar audio formats. Libavresample can be used for > +optimized conversion between interleaved and planar formats. > + > + > + > +As usual, this release also contains support for some new formats, many > +smaller new features and countless bug fixes. We can highlight Opus > +decoding / encoding through libopus, encoders for Apple ProRes and Ut > +Video, WMA Lossless and RealAudio Lossless decoders, fragmented MOV/MP4 > +and ISMV (Smooth Streaming) muxers, a large number of RTMP improvements > +and support for cover art in ID3v2, WMA, MP4 and FLAC. > + > + > + > +See > +the href="http://git.libav.org/?p=libav.git;a=blob_plain;f=Changelog;h=b4b5294755d7f67f0bf3b091112f688ae8df886d;hb=e578f8f4680f7ad290de64270dc152fb1adb6e6a";>Changelog > +file for a list of significant changes. > + > + > + > +Please note that our policy on bug reports has not changed. We still > +only accept bug reports against HEAD of the Libav trunk > +repository. If you are experiencing issues with any formally released > +version of Libav, pleas