From d1c4ec7f5e9af61067bc1a604e29e465038be63a Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 10 Feb 2012 20:29:29 +0100 Subject: [PATCH 01/16] build: Set correct dependencies for rtmp* protocols implemented by librtmp. --- configure | 4 ++++ libavformat/allformats.c | 10 ++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/configure b/configure index a1cbd69d78..d816389fe0 100755 --- a/configure +++ b/configure @@ -1504,6 +1504,10 @@ https_protocol_select="tls_protocol" mmsh_protocol_select="http_protocol" mmst_protocol_deps="network" rtmp_protocol_select="tcp_protocol" +rtmpe_protocol_deps="librtmp" +rtmps_protocol_deps="librtmp" +rtmpt_protocol_deps="librtmp" +rtmpte_protocol_deps="librtmp" rtp_protocol_select="udp_protocol" tcp_protocol_deps="network" tls_protocol_deps_any="openssl gnutls" diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 66a8cfec48..9a1f94d13a 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -254,12 +254,10 @@ void av_register_all(void) REGISTER_PROTOCOL (MD5, md5); REGISTER_PROTOCOL (PIPE, pipe); REGISTER_PROTOCOL (RTMP, rtmp); -#if CONFIG_LIBRTMP - REGISTER_PROTOCOL (RTMP, rtmpt); - REGISTER_PROTOCOL (RTMP, rtmpe); - REGISTER_PROTOCOL (RTMP, rtmpte); - REGISTER_PROTOCOL (RTMP, rtmps); -#endif + REGISTER_PROTOCOL (RTMPE, rtmpe); + REGISTER_PROTOCOL (RTMPS, rtmps); + REGISTER_PROTOCOL (RTMPT, rtmpt); + REGISTER_PROTOCOL (RTMPTE, rtmpte); REGISTER_PROTOCOL (RTP, rtp); REGISTER_PROTOCOL (TCP, tcp); REGISTER_PROTOCOL (TLS, tls); From 75f11901b588684dae19eaa9e5896931b30ffdcc Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sat, 11 Feb 2012 21:56:37 +0100 Subject: [PATCH 02/16] mips: Move MMI function declarations to a header. This fixes compilation with -Werror=missing-prototypes. --- libavcodec/ps2/dsputil_mmi.c | 4 ---- libavcodec/ps2/mmi.h | 8 ++++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/libavcodec/ps2/dsputil_mmi.c b/libavcodec/ps2/dsputil_mmi.c index 43f0363669..06e3bdabcb 100644 --- a/libavcodec/ps2/dsputil_mmi.c +++ b/libavcodec/ps2/dsputil_mmi.c @@ -25,10 +25,6 @@ #include "libavcodec/dsputil.h" #include "mmi.h" -void ff_mmi_idct_put(uint8_t *dest, int line_size, DCTELEM *block); -void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block); -void ff_mmi_idct(DCTELEM *block); - static void clear_blocks_mmi(DCTELEM * blocks) { __asm__ volatile( diff --git a/libavcodec/ps2/mmi.h b/libavcodec/ps2/mmi.h index fc8d32819a..cbd0921946 100644 --- a/libavcodec/ps2/mmi.h +++ b/libavcodec/ps2/mmi.h @@ -21,6 +21,14 @@ #ifndef AVCODEC_PS2_MMI_H #define AVCODEC_PS2_MMI_H +#include + +#include "libavcodec/dsputil.h" + +void ff_mmi_idct_put(uint8_t *dest, int line_size, DCTELEM *block); +void ff_mmi_idct_add(uint8_t *dest, int line_size, DCTELEM *block); +void ff_mmi_idct(DCTELEM *block); + #define align16 __attribute__ ((aligned (16))) /* From 0bf184e59cdb9a33883b8a04c8573d132ab5ee7c Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Tue, 7 Feb 2012 15:06:09 +0100 Subject: [PATCH 03/16] Move PS2 MMI code below the mips subdirectory, where it belongs. Also give a more suitable name to the MMI-optimized IDCT; it is not PS2-specific, as the name currently suggests. --- libavcodec/Makefile | 2 +- libavcodec/avcodec.h | 2 +- libavcodec/mips/Makefile | 6 +++--- libavcodec/{ps2 => mips}/dsputil_mmi.c | 2 +- libavcodec/{ps2 => mips}/idct_mmi.c | 0 libavcodec/{ps2 => mips}/mmi.h | 6 +++--- libavcodec/{ps2 => mips}/mpegvideo_mmi.c | 0 libavcodec/options.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) rename libavcodec/{ps2 => mips}/dsputil_mmi.c (98%) rename libavcodec/{ps2 => mips}/idct_mmi.c (100%) rename libavcodec/{ps2 => mips}/mmi.h (98%) rename libavcodec/{ps2 => mips}/mpegvideo_mmi.c (100%) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 6c9673f13d..a891651f26 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -694,7 +694,7 @@ HOSTPROGS = aac_tablegen aacps_tablegen cbrt_tablegen cos_tablegen \ dv_tablegen motionpixels_tablegen mpegaudio_tablegen \ pcm_tablegen qdm2_tablegen sinewin_tablegen -DIRS = alpha arm avr32 bfin ppc ps2 sh4 sparc x86 +DIRS = alpha arm avr32 bfin mips ppc sh4 sparc x86 CLEANFILES = *_tables.c *_tables.h *_tablegen$(HOSTEXESUF) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 26e9c42f9d..6afa140ebd 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1729,7 +1729,7 @@ typedef struct AVCodecContext { #define FF_IDCT_SIMPLE 2 #define FF_IDCT_SIMPLEMMX 3 #define FF_IDCT_LIBMPEG2MMX 4 -#define FF_IDCT_PS2 5 +#define FF_IDCT_MMI 5 #define FF_IDCT_ARM 7 #define FF_IDCT_ALTIVEC 8 #define FF_IDCT_SH4 9 diff --git a/libavcodec/mips/Makefile b/libavcodec/mips/Makefile index 3f4da68ec9..006617687e 100644 --- a/libavcodec/mips/Makefile +++ b/libavcodec/mips/Makefile @@ -1,3 +1,3 @@ -OBJS-$(HAVE_MMI) += ps2/dsputil_mmi.o \ - ps2/idct_mmi.o \ - ps2/mpegvideo_mmi.o \ +OBJS-$(HAVE_MMI) += mips/dsputil_mmi.o \ + mips/idct_mmi.o \ + mips/mpegvideo_mmi.o \ diff --git a/libavcodec/ps2/dsputil_mmi.c b/libavcodec/mips/dsputil_mmi.c similarity index 98% rename from libavcodec/ps2/dsputil_mmi.c rename to libavcodec/mips/dsputil_mmi.c index 06e3bdabcb..20a435a065 100644 --- a/libavcodec/ps2/dsputil_mmi.c +++ b/libavcodec/mips/dsputil_mmi.c @@ -153,7 +153,7 @@ void dsputil_init_mmi(DSPContext* c, AVCodecContext *avctx) } if (avctx->bits_per_raw_sample <= 8 && - (idct_algo==FF_IDCT_AUTO || idct_algo==FF_IDCT_PS2)) { + (idct_algo == FF_IDCT_AUTO || idct_algo == FF_IDCT_MMI)) { c->idct_put= ff_mmi_idct_put; c->idct_add= ff_mmi_idct_add; c->idct = ff_mmi_idct; diff --git a/libavcodec/ps2/idct_mmi.c b/libavcodec/mips/idct_mmi.c similarity index 100% rename from libavcodec/ps2/idct_mmi.c rename to libavcodec/mips/idct_mmi.c diff --git a/libavcodec/ps2/mmi.h b/libavcodec/mips/mmi.h similarity index 98% rename from libavcodec/ps2/mmi.h rename to libavcodec/mips/mmi.h index cbd0921946..48f2778809 100644 --- a/libavcodec/ps2/mmi.h +++ b/libavcodec/mips/mmi.h @@ -18,8 +18,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef AVCODEC_PS2_MMI_H -#define AVCODEC_PS2_MMI_H +#ifndef AVCODEC_MIPS_MMI_H +#define AVCODEC_MIPS_MMI_H #include @@ -176,4 +176,4 @@ void ff_mmi_idct(DCTELEM *block); #define pextlb(rs, rt, rd) \ __asm__ volatile ("pextlb " #rd ", " #rs ", " #rt ) -#endif /* AVCODEC_PS2_MMI_H */ +#endif /* AVCODEC_MIPS_MMI_H */ diff --git a/libavcodec/ps2/mpegvideo_mmi.c b/libavcodec/mips/mpegvideo_mmi.c similarity index 100% rename from libavcodec/ps2/mpegvideo_mmi.c rename to libavcodec/mips/mpegvideo_mmi.c diff --git a/libavcodec/options.c b/libavcodec/options.c index 04fb1b404b..81e910cb7e 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -214,7 +214,7 @@ static const AVOption options[]={ {"simple", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLE }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"simplemmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"libmpeg2mmx", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_LIBMPEG2MMX }, INT_MIN, INT_MAX, V|E|D, "idct"}, -{"ps2", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_PS2 }, INT_MIN, INT_MAX, V|E|D, "idct"}, +{"mmi", NULL, 0, AV_OPT_TYPE_CONST, { .dbl = FF_IDCT_MMI }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"arm", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"altivec", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"}, {"sh4", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"}, From 1ca7dc60d2f2cac8fce1bdb53d3d5bae195161b0 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 12 Feb 2012 15:47:14 -0800 Subject: [PATCH 04/16] swscale: fix invalid memory accesses in yuvpacked1() functions. --- libswscale/output.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index 93a6a03061..5b2ba37993 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -629,20 +629,20 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *abuf0, uint8_t *dest, int dstW, int uvalpha, int y, enum PixelFormat target) { - const int16_t *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], - *vbuf0 = vbuf[0], *vbuf1 = vbuf[1]; + const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; int i; if (uvalpha < 2048) { for (i = 0; i < (dstW >> 1); i++) { int Y1 = buf0[i * 2] >> 7; int Y2 = buf0[i * 2 + 1] >> 7; - int U = ubuf1[i] >> 7; - int V = vbuf1[i] >> 7; + int U = ubuf0[i] >> 7; + int V = vbuf0[i] >> 7; output_pixels(i * 4, Y1, U, Y2, V); } } else { + const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; for (i = 0; i < (dstW >> 1); i++) { int Y1 = buf0[i * 2] >> 7; int Y2 = buf0[i * 2 + 1] >> 7; @@ -775,8 +775,7 @@ yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0, const int32_t *abuf0, uint16_t *dest, int dstW, int uvalpha, int y, enum PixelFormat target) { - const int32_t *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], - *vbuf0 = vbuf[0], *vbuf1 = vbuf[1]; + const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; int i; if (uvalpha < 2048) { @@ -807,6 +806,7 @@ yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0, dest += 6; } } else { + const int32_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; for (i = 0; i < (dstW >> 1); i++) { int Y1 = (buf0[i * 2] ) >> 2; int Y2 = (buf0[i * 2 + 1]) >> 2; @@ -1070,16 +1070,15 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0, int uvalpha, int y, enum PixelFormat target, int hasAlpha) { - const int16_t *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], - *vbuf0 = vbuf[0], *vbuf1 = vbuf[1]; + const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; int i; if (uvalpha < 2048) { for (i = 0; i < (dstW >> 1); i++) { int Y1 = buf0[i * 2] >> 7; int Y2 = buf0[i * 2 + 1] >> 7; - int U = ubuf1[i] >> 7; - int V = vbuf1[i] >> 7; + int U = ubuf0[i] >> 7; + int V = vbuf0[i] >> 7; int A1, A2; const void *r = c->table_rV[V], *g = (c->table_gU[U] + c->table_gV[V]), @@ -1094,6 +1093,7 @@ yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0, r, g, b, y, target, hasAlpha); } } else { + const int16_t *ubuf1 = ubuf[1], *vbuf1 = vbuf[1]; for (i = 0; i < (dstW >> 1); i++) { int Y1 = buf0[i * 2] >> 7; int Y2 = buf0[i * 2 + 1] >> 7; From d63b7d8c37e6d18c36d6e95f76efd934beb704c0 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 12 Feb 2012 15:55:44 -0800 Subject: [PATCH 05/16] swscale: fix incorrect chroma bias in yuv2rgb48_1_c(). --- libswscale/output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index 5b2ba37993..a70cf1fc7c 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -810,8 +810,8 @@ yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0, for (i = 0; i < (dstW >> 1); i++) { int Y1 = (buf0[i * 2] ) >> 2; int Y2 = (buf0[i * 2 + 1]) >> 2; - int U = (ubuf0[i] + ubuf1[i] + (-128 << 11)) >> 3; - int V = (vbuf0[i] + vbuf1[i] + (-128 << 11)) >> 3; + int U = (ubuf0[i] + ubuf1[i] + (-128 << 12)) >> 3; + int V = (vbuf0[i] + vbuf1[i] + (-128 << 12)) >> 3; int R, G, B; Y1 -= c->yuv2rgb_y_offset; From 9d9c84649178468241a65e7e99c095ef192803c0 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 12 Feb 2012 15:48:24 -0800 Subject: [PATCH 06/16] swscale: use yuv2packed1() functions for unscaled chroma also. --- libswscale/swscale.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index ddfafbe530..d05e6819a8 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -589,8 +589,8 @@ static int swScale(SwsContext *c, const uint8_t* src[], } else { assert(lumSrcPtr + vLumFilterSize - 1 < lumPixBuf + vLumBufSize*2); assert(chrUSrcPtr + vChrFilterSize - 1 < chrUPixBuf + vChrBufSize*2); - if (c->yuv2packed1 && vLumFilterSize == 1 && vChrFilterSize == 2) { //unscaled RGB - int chrAlpha = vChrFilter[2 * dstY + 1]; + if (c->yuv2packed1 && vLumFilterSize == 1 && vChrFilterSize <= 2) { //unscaled RGB + int chrAlpha = vChrFilterSize == 1 ? 0 : vChrFilter[2 * dstY + 1]; yuv2packed1(c, *lumSrcPtr, chrUSrcPtr, chrVSrcPtr, alpPixBuf ? *alpSrcPtr : NULL, dest[0], dstW, chrAlpha, dstY); From c0b87359b29ae1267902c41f2576a1c0ca32849f Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 12 Feb 2012 17:07:09 -0800 Subject: [PATCH 07/16] swscale: handle gray16 as a "planar" YUV format (Y-only, of course). This allows removing any gray16-specific code, which is essentially identical to the per-plane code in yuv2plane*(). --- libswscale/output.c | 87 -------------------------------------------- libswscale/swscale.c | 2 +- 2 files changed, 1 insertion(+), 88 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index a70cf1fc7c..d24bb9e9c7 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -295,80 +295,6 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS } } -#define output_pixel(pos, val) \ - if (target == PIX_FMT_GRAY16BE) { \ - AV_WB16(pos, val); \ - } else { \ - AV_WL16(pos, val); \ - } - -static av_always_inline void -yuv2gray16_X_c_template(SwsContext *c, const int16_t *lumFilter, - const int32_t **lumSrc, int lumFilterSize, - const int16_t *chrFilter, const int32_t **chrUSrc, - const int32_t **chrVSrc, int chrFilterSize, - const int32_t **alpSrc, uint16_t *dest, int dstW, - int y, enum PixelFormat target) -{ - int i; - - for (i = 0; i < (dstW >> 1); i++) { - int j; - int Y1 = (1 << 14) - 0x40000000; - int Y2 = (1 << 14) - 0x40000000; - - for (j = 0; j < lumFilterSize; j++) { - Y1 += lumSrc[j][i * 2] * lumFilter[j]; - Y2 += lumSrc[j][i * 2 + 1] * lumFilter[j]; - } - Y1 >>= 15; - Y2 >>= 15; - Y1 = av_clip_int16(Y1); - Y2 = av_clip_int16(Y2); - output_pixel(&dest[i * 2 + 0], 0x8000 + Y1); - output_pixel(&dest[i * 2 + 1], 0x8000 + Y2); - } -} - -static av_always_inline void -yuv2gray16_2_c_template(SwsContext *c, const int32_t *buf[2], - const int32_t *ubuf[2], const int32_t *vbuf[2], - const int32_t *abuf[2], uint16_t *dest, int dstW, - int yalpha, int uvalpha, int y, - enum PixelFormat target) -{ - int yalpha1 = 4095 - yalpha; - int i; - const int32_t *buf0 = buf[0], *buf1 = buf[1]; - - for (i = 0; i < (dstW >> 1); i++) { - int Y1 = (buf0[i * 2 ] * yalpha1 + buf1[i * 2 ] * yalpha) >> 15; - int Y2 = (buf0[i * 2 + 1] * yalpha1 + buf1[i * 2 + 1] * yalpha) >> 15; - - output_pixel(&dest[i * 2 + 0], Y1); - output_pixel(&dest[i * 2 + 1], Y2); - } -} - -static av_always_inline void -yuv2gray16_1_c_template(SwsContext *c, const int32_t *buf0, - const int32_t *ubuf[2], const int32_t *vbuf[2], - const int32_t *abuf0, uint16_t *dest, int dstW, - int uvalpha, int y, enum PixelFormat target) -{ - int i; - - for (i = 0; i < (dstW >> 1); i++) { - int Y1 = buf0[i * 2 ] << 1; - int Y2 = buf0[i * 2 + 1] << 1; - - output_pixel(&dest[i * 2 + 0], Y1); - output_pixel(&dest[i * 2 + 1], Y2); - } -} - -#undef output_pixel - #define YUV2PACKED16WRAPPER(name, base, ext, fmt) \ static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \ const int16_t **_lumSrc, int lumFilterSize, \ @@ -415,9 +341,6 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \ dstW, uvalpha, y, fmt); \ } -YUV2PACKED16WRAPPER(yuv2gray16,, LE, PIX_FMT_GRAY16LE) -YUV2PACKED16WRAPPER(yuv2gray16,, BE, PIX_FMT_GRAY16BE) - #define output_pixel(pos, acc) \ if (target == PIX_FMT_MONOBLACK) { \ pos = acc; \ @@ -1490,16 +1413,6 @@ void ff_sws_init_output_funcs(SwsContext *c, } } switch (dstFormat) { - case PIX_FMT_GRAY16BE: - *yuv2packed1 = yuv2gray16BE_1_c; - *yuv2packed2 = yuv2gray16BE_2_c; - *yuv2packedX = yuv2gray16BE_X_c; - break; - case PIX_FMT_GRAY16LE: - *yuv2packed1 = yuv2gray16LE_1_c; - *yuv2packed2 = yuv2gray16LE_2_c; - *yuv2packedX = yuv2gray16LE_X_c; - break; case PIX_FMT_MONOWHITE: *yuv2packed1 = yuv2monowhite_1_c; *yuv2packed2 = yuv2monowhite_2_c; diff --git a/libswscale/swscale.c b/libswscale/swscale.c index d05e6819a8..d8a2e31620 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -554,7 +554,7 @@ static int swScale(SwsContext *c, const uint8_t* src[], chrVSrcPtr = tmpV; } - if (isPlanarYUV(dstFormat) || dstFormat==PIX_FMT_GRAY8) { //YV12 like + if (isPlanarYUV(dstFormat) || (isGray(dstFormat) && !isALPHA(dstFormat))) { //YV12 like const int chrSkipMask= (1<chrDstVSubSample)-1; if (vLumFilterSize == 1) { From 3cac47565507dba4eb5c21ab70e4950521fa6e71 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sun, 12 Feb 2012 17:10:32 -0800 Subject: [PATCH 08/16] swscale: move YUV2PACKED16WRAPPER() macro down to where it is used. --- libswscale/output.c | 92 ++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index d24bb9e9c7..39d39c79cc 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -295,52 +295,6 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS } } -#define YUV2PACKED16WRAPPER(name, base, ext, fmt) \ -static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \ - const int16_t **_lumSrc, int lumFilterSize, \ - const int16_t *chrFilter, const int16_t **_chrUSrc, \ - const int16_t **_chrVSrc, int chrFilterSize, \ - const int16_t **_alpSrc, uint8_t *_dest, int dstW, \ - int y) \ -{ \ - const int32_t **lumSrc = (const int32_t **) _lumSrc, \ - **chrUSrc = (const int32_t **) _chrUSrc, \ - **chrVSrc = (const int32_t **) _chrVSrc, \ - **alpSrc = (const int32_t **) _alpSrc; \ - uint16_t *dest = (uint16_t *) _dest; \ - name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \ - chrFilter, chrUSrc, chrVSrc, chrFilterSize, \ - alpSrc, dest, dstW, y, fmt); \ -} \ - \ -static void name ## ext ## _2_c(SwsContext *c, const int16_t *_buf[2], \ - const int16_t *_ubuf[2], const int16_t *_vbuf[2], \ - const int16_t *_abuf[2], uint8_t *_dest, int dstW, \ - int yalpha, int uvalpha, int y) \ -{ \ - const int32_t **buf = (const int32_t **) _buf, \ - **ubuf = (const int32_t **) _ubuf, \ - **vbuf = (const int32_t **) _vbuf, \ - **abuf = (const int32_t **) _abuf; \ - uint16_t *dest = (uint16_t *) _dest; \ - name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \ - dest, dstW, yalpha, uvalpha, y, fmt); \ -} \ - \ -static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \ - const int16_t *_ubuf[2], const int16_t *_vbuf[2], \ - const int16_t *_abuf0, uint8_t *_dest, int dstW, \ - int uvalpha, int y) \ -{ \ - const int32_t *buf0 = (const int32_t *) _buf0, \ - **ubuf = (const int32_t **) _ubuf, \ - **vbuf = (const int32_t **) _vbuf, \ - *abuf0 = (const int32_t *) _abuf0; \ - uint16_t *dest = (uint16_t *) _dest; \ - name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \ - dstW, uvalpha, y, fmt); \ -} - #define output_pixel(pos, acc) \ if (target == PIX_FMT_MONOBLACK) { \ pos = acc; \ @@ -763,6 +717,52 @@ yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0, #undef r_b #undef b_r +#define YUV2PACKED16WRAPPER(name, base, ext, fmt) \ +static void name ## ext ## _X_c(SwsContext *c, const int16_t *lumFilter, \ + const int16_t **_lumSrc, int lumFilterSize, \ + const int16_t *chrFilter, const int16_t **_chrUSrc, \ + const int16_t **_chrVSrc, int chrFilterSize, \ + const int16_t **_alpSrc, uint8_t *_dest, int dstW, \ + int y) \ +{ \ + const int32_t **lumSrc = (const int32_t **) _lumSrc, \ + **chrUSrc = (const int32_t **) _chrUSrc, \ + **chrVSrc = (const int32_t **) _chrVSrc, \ + **alpSrc = (const int32_t **) _alpSrc; \ + uint16_t *dest = (uint16_t *) _dest; \ + name ## base ## _X_c_template(c, lumFilter, lumSrc, lumFilterSize, \ + chrFilter, chrUSrc, chrVSrc, chrFilterSize, \ + alpSrc, dest, dstW, y, fmt); \ +} \ + \ +static void name ## ext ## _2_c(SwsContext *c, const int16_t *_buf[2], \ + const int16_t *_ubuf[2], const int16_t *_vbuf[2], \ + const int16_t *_abuf[2], uint8_t *_dest, int dstW, \ + int yalpha, int uvalpha, int y) \ +{ \ + const int32_t **buf = (const int32_t **) _buf, \ + **ubuf = (const int32_t **) _ubuf, \ + **vbuf = (const int32_t **) _vbuf, \ + **abuf = (const int32_t **) _abuf; \ + uint16_t *dest = (uint16_t *) _dest; \ + name ## base ## _2_c_template(c, buf, ubuf, vbuf, abuf, \ + dest, dstW, yalpha, uvalpha, y, fmt); \ +} \ + \ +static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \ + const int16_t *_ubuf[2], const int16_t *_vbuf[2], \ + const int16_t *_abuf0, uint8_t *_dest, int dstW, \ + int uvalpha, int y) \ +{ \ + const int32_t *buf0 = (const int32_t *) _buf0, \ + **ubuf = (const int32_t **) _ubuf, \ + **vbuf = (const int32_t **) _vbuf, \ + *abuf0 = (const int32_t *) _abuf0; \ + uint16_t *dest = (uint16_t *) _dest; \ + name ## base ## _1_c_template(c, buf0, ubuf, vbuf, abuf0, dest, \ + dstW, uvalpha, y, fmt); \ +} + YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE) YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE) YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE) From ddf422803b667215d8ac41da7bb091d861db0c9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Sun, 29 Jan 2012 02:12:06 +0200 Subject: [PATCH 09/16] mpegtsenc: Add an AVOption for forcing a new PAT/PMT/SDT to be written MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When segmenting the output from the mpegts muxer, one can now set this option when cutting to a new segment, to make sure the next segment starts with PAT/PMT/SDT. Signed-off-by: Martin Storsjö --- libavformat/mpegtsenc.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 8232cbc76d..493ae2eb6f 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -76,6 +76,8 @@ typedef struct MpegTSWrite { int pmt_start_pid; int start_pid; + + int reemit_pat_pmt; } MpegTSWrite; /* a PES packet header is generated every DEFAULT_PES_HEADER_FREQ packets */ @@ -96,6 +98,8 @@ static const AVOption options[] = { { "muxrate", NULL, offsetof(MpegTSWrite, mux_rate), AV_OPT_TYPE_INT, {1}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, { "pes_payload_size", "Minimum PES packet payload in bytes", offsetof(MpegTSWrite, pes_payload_size), AV_OPT_TYPE_INT, {DEFAULT_PES_PAYLOAD_SIZE}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, + { "resend_headers", "Reemit PAT/PMT before writing the next packet", + offsetof(MpegTSWrite, reemit_pat_pmt), AV_OPT_TYPE_INT, {0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM}, { NULL }, }; @@ -939,6 +943,12 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) const uint64_t delay = av_rescale(s->max_delay, 90000, AV_TIME_BASE)*2; int64_t dts = AV_NOPTS_VALUE, pts = AV_NOPTS_VALUE; + if (ts->reemit_pat_pmt) { + ts->pat_packet_count = ts->pat_packet_period - 1; + ts->sdt_packet_count = ts->sdt_packet_period - 1; + ts->reemit_pat_pmt = 0; + } + if (pkt->pts != AV_NOPTS_VALUE) pts = pkt->pts + delay; if (pkt->dts != AV_NOPTS_VALUE) From 5d561514b7bb435ce810c72d8502ed0186e51979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 23 Jan 2012 14:58:38 +0200 Subject: [PATCH 10/16] movenc: Support muxing wmapro in ismv/isma MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/movenc.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index ee0d96e534..1c68a93f57 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -350,6 +350,15 @@ static int mov_write_ms_tag(AVIOContext *pb, MOVTrack *track) return update_size(pb, pos); } +static int mov_write_wfex_tag(AVIOContext *pb, MOVTrack *track) +{ + int64_t pos = avio_tell(pb); + avio_wb32(pb, 0); + ffio_wfourcc(pb, "wfex"); + ff_put_wav_header(pb, track->enc); + return update_size(pb, pos); +} + static int mov_write_chan_tag(AVIOContext *pb, MOVTrack *track) { uint32_t layout_tag, bitmap; @@ -514,6 +523,8 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track) mov_write_ac3_tag(pb, track); else if(track->enc->codec_id == CODEC_ID_ALAC) mov_write_extradata_tag(pb, track); + else if (track->enc->codec_id == CODEC_ID_WMAPRO) + mov_write_wfex_tag(pb, track); else if (track->vos_len > 0) mov_write_glbl_tag(pb, track); @@ -763,9 +774,13 @@ static int mov_find_codec_tag(AVFormatContext *s, MOVTrack *track) { int tag = track->enc->codec_tag; - if (track->mode == MODE_MP4 || track->mode == MODE_PSP || track->mode == MODE_ISM) + if (track->mode == MODE_MP4 || track->mode == MODE_PSP) tag = mp4_get_codec_tag(s, track); - else if (track->mode == MODE_IPOD) + else if (track->mode == MODE_ISM) { + tag = mp4_get_codec_tag(s, track); + if (!tag && track->enc->codec_id == CODEC_ID_WMAPRO) + tag = MKTAG('w', 'm', 'a', ' '); + } else if (track->mode == MODE_IPOD) tag = ipod_get_codec_tag(s, track); else if (track->mode & MODE_3GP) tag = ff_codec_get_tag(codec_3gp_tags, track->enc->codec_id); From a8798c7eb934055d6aae51c6c7627559c33317d8 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Mon, 13 Feb 2012 08:24:00 +0100 Subject: [PATCH 11/16] Drop unnecessary av_uninit attributes from some variable declarations. Recent versions of gcc (4.4+) no longer give false positive warnings. --- libavcodec/ac3enc.c | 6 ++---- libavcodec/ac3enc_template.c | 2 +- libavcodec/eatgv.c | 2 +- libavcodec/flacdec.c | 2 +- libavcodec/msrledec.c | 4 ++-- libavcodec/qtrleenc.c | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index b8e23e49f6..3bf5f9405c 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1386,8 +1386,7 @@ static void ac3_output_frame_header(AC3EncodeContext *s) */ static void output_audio_block(AC3EncodeContext *s, int blk) { - int ch, i, baie, bnd, got_cpl; - int av_uninit(ch0); + int ch, i, baie, bnd, got_cpl, ch0; AC3Block *block = &s->blocks[blk]; /* block switching */ @@ -2236,8 +2235,7 @@ static av_cold int validate_options(AC3EncodeContext *s) */ static av_cold void set_bandwidth(AC3EncodeContext *s) { - int blk, ch; - int av_uninit(cpl_start); + int blk, ch, cpl_start; if (s->cutoff) { /* calculate bandwidth based on user-specified cutoff frequency */ diff --git a/libavcodec/ac3enc_template.c b/libavcodec/ac3enc_template.c index 3396ed17b7..bc06c2f46f 100644 --- a/libavcodec/ac3enc_template.c +++ b/libavcodec/ac3enc_template.c @@ -335,7 +335,7 @@ static void compute_rematrixing_strategy(AC3EncodeContext *s) { int nb_coefs; int blk, bnd, i; - AC3Block *block, *av_uninit(block0); + AC3Block *block, *block0; if (s->channel_mode != AC3_CHMODE_STEREO) return; diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index ccdb35ef2b..025188bc89 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -64,7 +64,7 @@ static av_cold int tgv_decode_init(AVCodecContext *avctx){ */ static int unpack(const uint8_t *src, const uint8_t *src_end, unsigned char *dst, int width, int height) { unsigned char *dst_end = dst + width*height; - int size, size1, size2, av_uninit(offset), run; + int size, size1, size2, offset, run; unsigned char *dst_start = dst; if (src[0] & 0x01) diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 58eb66def9..2b7f7eeb9e 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -288,7 +288,7 @@ static int decode_subframe_fixed(FLACContext *s, int channel, int pred_order) { const int blocksize = s->blocksize; int32_t *decoded = s->decoded[channel]; - int av_uninit(a), av_uninit(b), av_uninit(c), av_uninit(d), i; + int a, b, c, d, i; /* warm up samples */ for (i = 0; i < pred_order; i++) { diff --git a/libavcodec/msrledec.c b/libavcodec/msrledec.c index 4714772a20..9854d82fb4 100644 --- a/libavcodec/msrledec.c +++ b/libavcodec/msrledec.c @@ -134,8 +134,8 @@ static int msrle_decode_8_16_24_32(AVCodecContext *avctx, AVPicture *pic, int de uint8_t *output, *output_end; const uint8_t* src = data; int p1, p2, line=avctx->height - 1, pos=0, i; - uint16_t av_uninit(pix16); - uint32_t av_uninit(pix32); + uint16_t pix16; + uint32_t pix32; unsigned int width= FFABS(pic->linesize[0]) / (depth >> 3); output = pic->data[0] + (avctx->height - 1) * pic->linesize[0]; diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c index ede03d2f78..3ffce2bc7f 100644 --- a/libavcodec/qtrleenc.c +++ b/libavcodec/qtrleenc.c @@ -120,7 +120,7 @@ static void qtrle_encode_line(QtrleEncContext *s, AVFrame *p, int line, uint8_t unsigned int skipcount; /* This will be the number of consecutive equal pixels in the current * frame, starting from the ith one also */ - unsigned int av_uninit(repeatcount); + unsigned int repeatcount; /* The cost of the three different possibilities */ int total_bulk_cost; From 92fed11352fae8855b44d99522c86cbfd323a6df Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 10 Feb 2012 15:04:37 +0100 Subject: [PATCH 12/16] swscale: Remove unused variable alpMmxFilter. --- libswscale/swscale.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index d8a2e31620..b231302216 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -322,7 +322,6 @@ static int swScale(SwsContext *c, const uint8_t* src[], int16_t *hChrFilter= c->hChrFilter; int32_t *lumMmxFilter= c->lumMmxFilter; int32_t *chrMmxFilter= c->chrMmxFilter; - int32_t av_unused *alpMmxFilter= c->alpMmxFilter; const int vLumFilterSize= c->vLumFilterSize; const int vChrFilterSize= c->vChrFilterSize; const int hLumFilterSize= c->hLumFilterSize; From 7331b6e718243c276d391898199e08ba3cdb9545 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 10 Feb 2012 15:13:32 +0100 Subject: [PATCH 13/16] Drop some completely unnecessary av_unused attributes. --- libavfilter/vf_gradfun.c | 2 +- libavfilter/vf_yadif.c | 2 +- libavformat/nsvdec.c | 2 +- libswscale/output.c | 6 ++---- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index c6663c4102..9da9b20a70 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -120,7 +120,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) GradFunContext *gf = ctx->priv; float thresh = 1.2; int radius = 16; - av_unused int cpu_flags = av_get_cpu_flags(); + int cpu_flags = av_get_cpu_flags(); if (args) sscanf(args, "%f:%d", &thresh, &radius); diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index ca2adb2906..12b37836f8 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -372,7 +372,7 @@ static int query_formats(AVFilterContext *ctx) static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque) { YADIFContext *yadif = ctx->priv; - av_unused int cpu_flags = av_get_cpu_flags(); + int cpu_flags = av_get_cpu_flags(); yadif->mode = 0; yadif->parity = -1; diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index c5655d20aa..375463e96e 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -273,7 +273,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; - unsigned int av_unused file_size; + unsigned int file_size; unsigned int size; int64_t duration; int strings_size; diff --git a/libswscale/output.c b/libswscale/output.c index 39d39c79cc..b29018f2bb 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -899,12 +899,11 @@ yuv2rgb_X_c_template(SwsContext *c, const int16_t *lumFilter, int i; for (i = 0; i < (dstW >> 1); i++) { - int j; + int j, A1, A2; int Y1 = 1 << 18; int Y2 = 1 << 18; int U = 1 << 18; int V = 1 << 18; - int av_unused A1, A2; const void *r, *g, *b; for (j = 0; j < lumFilterSize; j++) { @@ -1106,8 +1105,7 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, int Y = 0; int U = -128 << 19; int V = -128 << 19; - int av_unused A; - int R, G, B; + int R, G, B, A; for (j = 0; j < lumFilterSize; j++) { Y += lumSrc[j][i] * lumFilter[j]; From 6df5c528ca045ab4b65f2a529a8e8bd2642f47e5 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Fri, 10 Feb 2012 15:10:42 +0100 Subject: [PATCH 14/16] Move some conditionally used variables into the block where they are used. This allows dropping the av_unused argument from them. --- libavformat/asfdec.c | 2 +- libavformat/nsvdec.c | 2 +- libavutil/sha.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index c5391a9d62..bae0eacd10 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -365,8 +365,8 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size) /* This code assumes that extradata contains only palette */ /* This is true for all paletted codecs implemented in libavcodec */ if (st->codec->extradata_size && (st->codec->bits_per_coded_sample <= 8)) { - int av_unused i; #if HAVE_BIGENDIAN + int i; for (i = 0; i < FFMIN(st->codec->extradata_size, AVPALETTE_SIZE)/4; i++) asf_st->palette[i] = av_bswap32(((uint32_t*)st->codec->extradata)[i]); #else diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index 375463e96e..1a160c5de9 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -566,7 +566,6 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header) uint32_t vsize; uint16_t asize; uint16_t auxsize; - uint32_t av_unused auxtag; av_dlog(s, "%s(%d)\n", __FUNCTION__, fill_header); @@ -596,6 +595,7 @@ null_chunk_retry: av_dlog(s, "NSV CHUNK %d aux, %u bytes video, %d bytes audio\n", auxcount, vsize, asize); /* skip aux stuff */ for (i = 0; i < auxcount; i++) { + uint32_t auxtag; auxsize = avio_rl16(pb); auxtag = avio_rl32(pb); av_dlog(s, "NSV aux data: '%c%c%c%c', %d bytes\n", diff --git a/libavutil/sha.c b/libavutil/sha.c index 5af742dc48..cbe1608a26 100644 --- a/libavutil/sha.c +++ b/libavutil/sha.c @@ -181,7 +181,7 @@ static void sha256_transform(uint32_t *state, const uint8_t buffer[64]) { unsigned int i, a, b, c, d, e, f, g, h; uint32_t block[64]; - uint32_t T1, av_unused(T2); + uint32_t T1; a = state[0]; b = state[1]; @@ -193,6 +193,7 @@ static void sha256_transform(uint32_t *state, const uint8_t buffer[64]) h = state[7]; #if CONFIG_SMALL for (i = 0; i < 64; i++) { + uint32_t T2; if (i < 16) T1 = blk0(i); else From 529506b5f618bde1e6a2255b5320501d8e824fc7 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 12 Feb 2012 10:58:46 +0100 Subject: [PATCH 15/16] matroskadec: Mark variable as av_unused. This avoids unused variable warnings when zlib/bzlib are not available. --- libavformat/matroskadec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 8f34289eb5..ca211a2786 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -939,7 +939,7 @@ static int matroska_decode_buffer(uint8_t** buf, int* buf_size, uint8_t* data = *buf; int isize = *buf_size; uint8_t* pkt_data = NULL; - uint8_t* newpktdata; + uint8_t av_unused *newpktdata; int pkt_size = isize; int result = 0; int olen; From 7dfe8f55575a3ae0fdd6f0678fa9627122580b07 Mon Sep 17 00:00:00 2001 From: Matthew Szatmary Date: Wed, 8 Feb 2012 15:00:40 +0200 Subject: [PATCH 16/16] rtpdec: Use 4 byte startcodes for H.264 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If muxing into mpegts, 4 byte startcodes for the first NAL of an access unit is required. Thus it is simplest for the RTP depacketizer to just use 4 byte startcodes everywhere. Signed-off-by: Martin Storsjö --- libavformat/rtpdec_h264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index effdc1fe66..9da79fcbf5 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -113,7 +113,7 @@ static int sdp_parse_fmtp_config_h264(AVStream * stream, h264_data->level_idc = level_idc; } } else if (!strcmp(attr, "sprop-parameter-sets")) { - uint8_t start_sequence[]= { 0, 0, 1 }; + uint8_t start_sequence[] = { 0, 0, 0, 1 }; codec->extradata_size= 0; codec->extradata= NULL; @@ -176,7 +176,7 @@ static int h264_handle_packet(AVFormatContext *ctx, uint8_t nal = buf[0]; uint8_t type = (nal & 0x1f); int result= 0; - uint8_t start_sequence[]= {0, 0, 1}; + uint8_t start_sequence[] = { 0, 0, 0, 1 }; #ifdef DEBUG assert(data);