From: Michael Niedermayer Date: Tue, 14 Feb 2012 00:53:31 +0000 (+0100) Subject: Merge remote-tracking branch 'qatar/master' X-Git-Tag: android-x86-4.4-r1~13408 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=04b53746ad296b9167002ec5d16a9cfb9de7985b;p=android-x86%2Fexternal-ffmpeg.git Merge remote-tracking branch 'qatar/master' * qatar/master: rtpdec: Use 4 byte startcodes for H.264 matroskadec: Mark variable as av_unused. Move some conditionally used variables into the block where they are used. Drop some completely unnecessary av_unused attributes. swscale: Remove unused variable alpMmxFilter. Drop unnecessary av_uninit attributes from some variable declarations. movenc: Support muxing wmapro in ismv/isma mpegtsenc: Add an AVOption for forcing a new PAT/PMT/SDT to be written swscale: move YUV2PACKED16WRAPPER() macro down to where it is used. swscale: handle gray16 as a "planar" YUV format (Y-only, of course). swscale: use yuv2packed1() functions for unscaled chroma also. swscale: fix incorrect chroma bias in yuv2rgb48_1_c(). swscale: fix invalid memory accesses in yuvpacked1() functions. Move PS2 MMI code below the mips subdirectory, where it belongs. mips: Move MMI function declarations to a header. build: Set correct dependencies for rtmp* protocols implemented by librtmp. Conflicts: libavcodec/ac3enc_template.c libavformat/mpegtsenc.c libswscale/output.c Merged-by: Michael Niedermayer --- 04b53746ad296b9167002ec5d16a9cfb9de7985b diff --cc libavcodec/ac3enc_template.c index 60472550d1,bc06c2f46f..554e0b007b --- a/libavcodec/ac3enc_template.c +++ b/libavcodec/ac3enc_template.c @@@ -337,8 -334,8 +337,8 @@@ static void apply_channel_coupling(AC3E static void compute_rematrixing_strategy(AC3EncodeContext *s) { int nb_coefs; - int blk, bnd, i; + int blk, bnd; - AC3Block *block, *av_uninit(block0); + AC3Block *block, *block0; if (s->channel_mode != AC3_CHMODE_STEREO) return; diff --cc libavformat/mpegtsenc.c index 4b303def4b,493ae2eb6f..b0047a216e --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@@ -77,7 -76,8 +77,9 @@@ typedef struct MpegTSWrite int pmt_start_pid; int start_pid; + int m2ts_mode; + + int reemit_pat_pmt; } MpegTSWrite; /* a PES packet header is generated every DEFAULT_PES_HEADER_FREQ packets */ diff --cc libswscale/output.c index d0bd72b350,b29018f2bb..180927892d --- a/libswscale/output.c +++ b/libswscale/output.c @@@ -1075,12 -999,12 +996,12 @@@ yuv2rgb_1_c_template(SwsContext *c, con 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]), - *b = c->table_bU[U]; + const void *r = c->table_rV[V + YUVRGB_TABLE_HEADROOM], + *g = (c->table_gU[U + YUVRGB_TABLE_HEADROOM] + c->table_gV[V + YUVRGB_TABLE_HEADROOM]), + *b = c->table_bU[U + YUVRGB_TABLE_HEADROOM]; if (hasAlpha) { A1 = abuf0[i * 2 ] >> 7; @@@ -1177,11 -1102,10 +1099,10 @@@ yuv2rgb_full_X_c_template(SwsContext *c for (i = 0; i < dstW; i++) { int j; - int Y = 0; - int U = -128 << 19; - int V = -128 << 19; + int Y = 1<<9; + int U = (1<<9)-(128 << 19); + int V = (1<<9)-(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]; diff --cc libswscale/swscale.c index 12ec19bea0,b231302216..0578e2dacc --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@@ -532,33 -506,56 +531,33 @@@ static int swScale(SwsContext *c, cons } { - const int16_t **lumSrcPtr= (const int16_t **) lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize; - const int16_t **chrUSrcPtr= (const int16_t **) chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize; - const int16_t **chrVSrcPtr= (const int16_t **) chrVPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize; - const int16_t **alpSrcPtr= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? (const int16_t **) alpPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL; - - if (firstLumSrcY < 0 || firstLumSrcY + vLumFilterSize > c->srcH) { - const int16_t **tmpY = (const int16_t **) lumPixBuf + 2 * vLumBufSize; - int neg = -firstLumSrcY, i, end = FFMIN(c->srcH - firstLumSrcY, vLumFilterSize); - for (i = 0; i < neg; i++) - tmpY[i] = lumSrcPtr[neg]; - for ( ; i < end; i++) - tmpY[i] = lumSrcPtr[i]; - for ( ; i < vLumFilterSize; i++) - tmpY[i] = tmpY[i-1]; - lumSrcPtr = tmpY; - - if (alpSrcPtr) { - const int16_t **tmpA = (const int16_t **) alpPixBuf + 2 * vLumBufSize; - for (i = 0; i < neg; i++) - tmpA[i] = alpSrcPtr[neg]; - for ( ; i < end; i++) - tmpA[i] = alpSrcPtr[i]; - for ( ; i < vLumFilterSize; i++) - tmpA[i] = tmpA[i - 1]; - alpSrcPtr = tmpA; - } - } - if (firstChrSrcY < 0 || firstChrSrcY + vChrFilterSize > c->chrSrcH) { - const int16_t **tmpU = (const int16_t **) chrUPixBuf + 2 * vChrBufSize, - **tmpV = (const int16_t **) chrVPixBuf + 2 * vChrBufSize; - int neg = -firstChrSrcY, i, end = FFMIN(c->chrSrcH - firstChrSrcY, vChrFilterSize); - for (i = 0; i < neg; i++) { - tmpU[i] = chrUSrcPtr[neg]; - tmpV[i] = chrVSrcPtr[neg]; - } - for ( ; i < end; i++) { - tmpU[i] = chrUSrcPtr[i]; - tmpV[i] = chrVSrcPtr[i]; - } - for ( ; i < vChrFilterSize; i++) { - tmpU[i] = tmpU[i - 1]; - tmpV[i] = tmpV[i - 1]; - } - chrUSrcPtr = tmpU; - chrVSrcPtr = tmpV; - } + const int16_t **lumSrcPtr= (const int16_t **)(void*) lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize; + const int16_t **chrUSrcPtr= (const int16_t **)(void*) chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize; + const int16_t **chrVSrcPtr= (const int16_t **)(void*) chrVPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize; + const int16_t **alpSrcPtr= (CONFIG_SWSCALE_ALPHA && alpPixBuf) ? (const int16_t **)(void*) alpPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize : NULL; + int16_t *vLumFilter= c->vLumFilter; + int16_t *vChrFilter= c->vChrFilter; - if (isPlanarYUV(dstFormat) || dstFormat==PIX_FMT_GRAY8) { //YV12 like + if (isPlanarYUV(dstFormat) || (isGray(dstFormat) && !isALPHA(dstFormat))) { //YV12 like const int chrSkipMask= (1<chrDstVSubSample)-1; + vLumFilter += dstY * vLumFilterSize; + vChrFilter += chrDstY * vChrFilterSize; + +// av_assert0(use_mmx_vfilter != ( +// yuv2planeX == yuv2planeX_10BE_c +// || yuv2planeX == yuv2planeX_10LE_c +// || yuv2planeX == yuv2planeX_9BE_c +// || yuv2planeX == yuv2planeX_9LE_c +// || yuv2planeX == yuv2planeX_16BE_c +// || yuv2planeX == yuv2planeX_16LE_c +// || yuv2planeX == yuv2planeX_8_c) || !ARCH_X86); + + if(use_mmx_vfilter){ + vLumFilter= c->lumMmxFilter; + vChrFilter= c->chrMmxFilter; + } + if (vLumFilterSize == 1) { yuv2plane1(lumSrcPtr[0], dest[0], dstW, c->lumDither8, 0); } else {