diff --git a/configure b/configure index 857eb57862..4b86c8ee87 100755 --- a/configure +++ b/configure @@ -1552,6 +1552,7 @@ eatqi_decoder_select="aandcttables error_resilience mpegvideo" exr_decoder_select="zlib" ffv1_decoder_select="golomb rangecoder" ffv1_encoder_select="rangecoder" +ffvhuff_encoder_select="huffman" flac_decoder_select="golomb" flac_encoder_select="golomb lpc" flashsv_decoder_select="zlib" diff --git a/libavcodec/audio_frame_queue.c b/libavcodec/audio_frame_queue.c index ec515d949a..274588c9cb 100644 --- a/libavcodec/audio_frame_queue.c +++ b/libavcodec/audio_frame_queue.c @@ -40,6 +40,22 @@ void ff_af_queue_close(AudioFrameQueue *afq) memset(afq, 0, sizeof(*afq)); } +#ifdef DEBUG +static void af_queue_log_state(AudioFrameQueue *afq) +{ + AudioFrame *f; + av_dlog(afq->avctx, "remaining delay = %d\n", afq->remaining_delay); + av_dlog(afq->avctx, "remaining samples = %d\n", afq->remaining_samples); + av_dlog(afq->avctx, "frames:\n"); + f = afq->frame_queue; + while (f) { + av_dlog(afq->avctx, " [ pts=%9"PRId64" duration=%d ]\n", + f->pts, f->duration); + f = f->next; + } +} +#endif /* DEBUG */ + int ff_af_queue_add(AudioFrameQueue *afq, const AVFrame *f) { AudioFrame *new = av_fast_realloc(afq->frames, &afq->frame_alloc, sizeof(*afq->frames)*(afq->frame_count+1)); @@ -108,4 +124,3 @@ void ff_af_queue_remove(AudioFrameQueue *afq, int nb_samples, int64_t *pts, if (duration) *duration = ff_samples_to_time_base(afq->avctx, removed_samples); } - diff --git a/libavcodec/huffman.c b/libavcodec/huffman.c index c8d37d78b6..27fed9f022 100644 --- a/libavcodec/huffman.c +++ b/libavcodec/huffman.c @@ -31,6 +31,63 @@ /* symbol for Huffman tree node */ #define HNODE -1 +typedef struct { + uint64_t val; + int name; +} HeapElem; + +static void heap_sift(HeapElem *h, int root, int size) +{ + while (root * 2 + 1 < size) { + int child = root * 2 + 1; + if (child < size - 1 && h[child].val > h[child+1].val) + child++; + if (h[root].val > h[child].val) { + FFSWAP(HeapElem, h[root], h[child]); + root = child; + } else + break; + } +} + +void ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats) +{ + HeapElem h[256]; + int up[2*256]; + int len[2*256]; + int offset, i, next; + int size = 256; + + for (offset = 1; ; offset <<= 1) { + for (i=0; i < size; i++) { + h[i].name = i; + h[i].val = (stats[i] << 8) + offset; + } + for (i = size / 2 - 1; i >= 0; i--) + heap_sift(h, i, size); + + for (next = size; next < size * 2 - 1; next++) { + // merge the two smallest entries, and put it back in the heap + uint64_t min1v = h[0].val; + up[h[0].name] = next; + h[0].val = INT64_MAX; + heap_sift(h, 0, size); + up[h[0].name] = next; + h[0].name = next; + h[0].val += min1v; + heap_sift(h, 0, size); + } + + len[2 * size - 2] = 0; + for (i = 2 * size - 3; i >= size; i--) + len[i] = len[up[i]] + 1; + for (i = 0; i < size; i++) { + dst[i] = len[up[i]] + 1; + if (dst[i] >= 32) break; + } + if (i==size) break; + } +} static void get_tree_codes(uint32_t *bits, int16_t *lens, uint8_t *xlat, Node *nodes, int node, @@ -117,60 +174,3 @@ int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes, } return 0; } - -typedef struct { - uint64_t val; - int name; -} HeapElem; - -static void heap_sift(HeapElem *h, int root, int size) -{ - while(root*2+1 < size) { - int child = root*2+1; - if(child < size-1 && h[child].val > h[child+1].val) - child++; - if(h[root].val > h[child].val) { - FFSWAP(HeapElem, h[root], h[child]); - root = child; - } else - break; - } -} - -void ff_generate_len_table(uint8_t *dst, const uint64_t *stats){ - HeapElem h[256]; - int up[2*256]; - int len[2*256]; - int offset, i, next; - int size = 256; - - for(offset=1; ; offset<<=1){ - for(i=0; i=0; i--) - heap_sift(h, i, size); - - for(next=size; next=size; i--) - len[i] = len[up[i]] + 1; - for(i=0; i= 32) break; - } - if(i==size) break; - } -} diff --git a/libavcodec/huffman.h b/libavcodec/huffman.h index 956ac1fbce..2fdf88d405 100644 --- a/libavcodec/huffman.h +++ b/libavcodec/huffman.h @@ -42,6 +42,6 @@ typedef int (*HuffCmp)(const void *va, const void *vb); int ff_huff_build_tree(AVCodecContext *avctx, VLC *vlc, int nb_codes, Node *nodes, HuffCmp cmp, int flags); -void ff_generate_len_table(uint8_t *dst, const uint64_t *stats); +void ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats); #endif /* AVCODEC_HUFFMAN_H */ diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index e770b6353f..2a9ebe1b2c 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -676,7 +676,7 @@ static av_cold int encode_init(AVCodecContext *avctx) } for (i = 0; i < 3; i++) { - ff_generate_len_table(s->len[i], s->stats[i]); + ff_huff_gen_len_table(s->len[i], s->stats[i]); if (generate_bits_table(s->bits[i], s->len[i]) < 0) { return -1; @@ -1286,7 +1286,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, if (s->context) { for (i = 0; i < 3; i++) { - ff_generate_len_table(s->len[i], s->stats[i]); + ff_huff_gen_len_table(s->len[i], s->stats[i]); if (generate_bits_table(s->bits[i], s->len[i]) < 0) return -1; size += store_table(s, s->len[i], &pkt->data[size]); diff --git a/libavcodec/motion-test.c b/libavcodec/motion-test.c index 1959d38721..3504ccfd68 100644 --- a/libavcodec/motion-test.c +++ b/libavcodec/motion-test.c @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include "config.h" #include "dsputil.h" diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index e497333d06..5cebd910aa 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -441,7 +441,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src, } /* Calculate huffman lengths */ - ff_generate_len_table(lengths, counts); + ff_huff_gen_len_table(lengths, counts); /* * Write the plane's header into the output packet: diff --git a/libavcodec/x86/Makefile b/libavcodec/x86/Makefile index 3334080225..74b7a891f9 100644 --- a/libavcodec/x86/Makefile +++ b/libavcodec/x86/Makefile @@ -4,26 +4,26 @@ OBJS-$(CONFIG_VP3DSP) += x86/vp3dsp_init.o OBJS-$(CONFIG_XMM_CLOBBER_TEST) += x86/w64xmmtest.o MMX-OBJS += x86/dsputil_mmx.o \ - x86/fdct_mmx.o \ + x86/fdct.o \ x86/fmtconvert_init.o \ x86/idct_mmx_xvid.o \ x86/idct_sse2_xvid.o \ - x86/motion_est_mmx.o \ - x86/simple_idct_mmx.o \ + x86/motion_est.o \ + x86/simple_idct.o \ MMX-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp_init.o MMX-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp_init.o -MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp_mmx.o +MMX-OBJS-$(CONFIG_CAVS_DECODER) += x86/cavsdsp.o MMX-OBJS-$(CONFIG_DNXHD_ENCODER) += x86/dnxhdenc.o -MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp_mmx.o \ +MMX-OBJS-$(CONFIG_DWT) += x86/snowdsp.o \ x86/dwt.o MMX-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc_mmx.o MMX-OBJS-$(CONFIG_FFT) += x86/fft_init.o MMX-OBJS-$(CONFIG_GPL) += x86/idct_mmx.o MMX-OBJS-$(CONFIG_H264DSP) += x86/h264dsp_init.o MMX-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred_init.o -MMX-OBJS-$(CONFIG_LPC) += x86/lpc_mmx.o -MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec_mmx.o +MMX-OBJS-$(CONFIG_LPC) += x86/lpc.o +MMX-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/mpegaudiodec.o MMX-OBJS-$(CONFIG_MPEGVIDEO) += x86/mpegvideo.o MMX-OBJS-$(CONFIG_MPEGVIDEOENC) += x86/mpegvideoenc.o MMX-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp_init.o @@ -40,11 +40,11 @@ MMX-OBJS-$(CONFIG_VP8_DECODER) += x86/vp8dsp_init.o YASM-OBJS-$(CONFIG_AAC_DECODER) += x86/sbrdsp.o YASM-OBJS-$(CONFIG_AC3DSP) += x86/ac3dsp.o -YASM-OBJS-$(CONFIG_DCT) += x86/dct32_sse.o +YASM-OBJS-$(CONFIG_DCT) += x86/dct32.o YASM-OBJS-$(CONFIG_DIRAC_DECODER) += x86/diracdsp_mmx.o x86/diracdsp_yasm.o YASM-OBJS-$(CONFIG_DWT) += x86/dwt_yasm.o YASM-OBJS-$(CONFIG_ENCODERS) += x86/dsputilenc.o -YASM-OBJS-$(CONFIG_FFT) += x86/fft_mmx.o +YASM-OBJS-$(CONFIG_FFT) += x86/fft.o YASM-OBJS-$(CONFIG_H264CHROMA) += x86/h264_chromamc.o \ x86/h264_chromamc_10bit.o YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \ @@ -56,7 +56,7 @@ YASM-OBJS-$(CONFIG_H264DSP) += x86/h264_deblock.o \ YASM-OBJS-$(CONFIG_H264PRED) += x86/h264_intrapred.o \ x86/h264_intrapred_10bit.o YASM-OBJS-$(CONFIG_H264QPEL) += x86/h264_qpel_10bit.o -YASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36_sse.o +YASM-OBJS-$(CONFIG_MPEGAUDIODSP) += x86/imdct36.o YASM-OBJS-$(CONFIG_PNG_DECODER) += x86/pngdsp.o YASM-OBJS-$(CONFIG_PRORES_DECODER) += x86/proresdsp.o YASM-OBJS-$(CONFIG_PRORES_LGPL_DECODER) += x86/proresdsp.o diff --git a/libavcodec/x86/cavsdsp_mmx.c b/libavcodec/x86/cavsdsp.c similarity index 100% rename from libavcodec/x86/cavsdsp_mmx.c rename to libavcodec/x86/cavsdsp.c diff --git a/libavcodec/x86/dct32_sse.asm b/libavcodec/x86/dct32.asm similarity index 100% rename from libavcodec/x86/dct32_sse.asm rename to libavcodec/x86/dct32.asm diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index 170cbbedf2..db3c78dff3 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -2101,7 +2101,7 @@ PREFETCH(prefetch_3dnow, prefetch) #endif /* HAVE_INLINE_ASM */ -#include "h264_qpel_mmx.c" +#include "h264_qpel.c" void ff_put_h264_chroma_mc8_mmx_rnd (uint8_t *dst, uint8_t *src, int stride, int h, int x, int y); diff --git a/libavcodec/x86/fdct_mmx.c b/libavcodec/x86/fdct.c similarity index 100% rename from libavcodec/x86/fdct_mmx.c rename to libavcodec/x86/fdct.c diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft.asm similarity index 100% rename from libavcodec/x86/fft_mmx.asm rename to libavcodec/x86/fft.asm diff --git a/libavcodec/x86/h264_qpel_mmx.c b/libavcodec/x86/h264_qpel.c similarity index 100% rename from libavcodec/x86/h264_qpel_mmx.c rename to libavcodec/x86/h264_qpel.c diff --git a/libavcodec/x86/imdct36_sse.asm b/libavcodec/x86/imdct36.asm similarity index 98% rename from libavcodec/x86/imdct36_sse.asm rename to libavcodec/x86/imdct36.asm index 336e9f0c54..63cac10d2b 100644 --- a/libavcodec/x86/imdct36_sse.asm +++ b/libavcodec/x86/imdct36.asm @@ -2,20 +2,20 @@ ;* 36 point SSE-optimized IMDCT transform ;* Copyright (c) 2011 Vitor Sessak ;* -;* This file is part of Libav. +;* This file is part of FFmpeg. ;* -;* Libav is free software; you can redistribute it and/or +;* FFmpeg is free software; you can redistribute it and/or ;* modify it under the terms of the GNU Lesser General Public ;* License as published by the Free Software Foundation; either ;* version 2.1 of the License, or (at your option) any later version. ;* -;* Libav is distributed in the hope that it will be useful, +;* FFmpeg is distributed in the hope that it will be useful, ;* but WITHOUT ANY WARRANTY; without even the implied warranty of ;* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;* Lesser General Public License for more details. ;* ;* You should have received a copy of the GNU Lesser General Public -;* License along with Libav; if not, write to the Free Software +;* License along with FFmpeg; if not, write to the Free Software ;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;****************************************************************************** diff --git a/libavcodec/x86/lpc_mmx.c b/libavcodec/x86/lpc.c similarity index 100% rename from libavcodec/x86/lpc_mmx.c rename to libavcodec/x86/lpc.c diff --git a/libavcodec/x86/motion_est_mmx.c b/libavcodec/x86/motion_est.c similarity index 100% rename from libavcodec/x86/motion_est_mmx.c rename to libavcodec/x86/motion_est.c diff --git a/libavcodec/x86/mpegaudiodec_mmx.c b/libavcodec/x86/mpegaudiodec.c similarity index 100% rename from libavcodec/x86/mpegaudiodec_mmx.c rename to libavcodec/x86/mpegaudiodec.c diff --git a/libavcodec/x86/simple_idct_mmx.c b/libavcodec/x86/simple_idct.c similarity index 100% rename from libavcodec/x86/simple_idct_mmx.c rename to libavcodec/x86/simple_idct.c diff --git a/libavcodec/x86/snowdsp_mmx.c b/libavcodec/x86/snowdsp.c similarity index 100% rename from libavcodec/x86/snowdsp_mmx.c rename to libavcodec/x86/snowdsp.c diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index 61e038afeb..083f8e89b2 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -369,7 +369,6 @@ static int parse_h264_sdp_line(AVFormatContext *s, int st_index, // set our parameters codec->width = atoi(buf1); codec->height = atoi(p + 1); // skip the - - codec->pix_fmt = PIX_FMT_YUV420P; } else if (av_strstart(p, "fmtp:", &p)) { return ff_parse_fmtp(stream, h264_data, p, sdp_parse_fmtp_config_h264); } else if (av_strstart(p, "cliprect:", &p)) { diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 48dfb86649..9d7dc0be0d 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -154,9 +154,11 @@ static char *extradata2psets(AVCodecContext *c) { char *psets, *p; const uint8_t *r; - const char *pset_string = "; sprop-parameter-sets="; + static const char pset_string[] = "; sprop-parameter-sets="; + static const char profile_string[] = "; profile-level-id="; uint8_t *orig_extradata = NULL; int orig_extradata_size = 0; + const uint8_t *sps = NULL, *sps_end; if (c->extradata_size > MAX_EXTRADATA_SIZE) { av_log(c, AV_LOG_ERROR, "Too much extradata!\n"); @@ -210,6 +212,10 @@ static char *extradata2psets(AVCodecContext *c) *p = ','; p++; } + if (!sps) { + sps = r; + sps_end = r1; + } if (av_base64_encode(p, MAX_PSET_SIZE - (p - psets), r, r1 - r) == NULL) { av_log(c, AV_LOG_ERROR, "Cannot Base64-encode %td %td!\n", MAX_PSET_SIZE - (p - psets), r1 - r); av_free(psets); @@ -219,6 +225,12 @@ static char *extradata2psets(AVCodecContext *c) p += strlen(p); r = r1; } + if (sps && sps_end - sps >= 4) { + memcpy(p, profile_string, strlen(profile_string)); + p += strlen(p); + ff_data_to_hex(p, sps + 1, 3, 0); + p[6] = '\0'; + } if (orig_extradata) { av_free(c->extradata); c->extradata = orig_extradata; diff --git a/libswscale/colorspace-test.c b/libswscale/colorspace-test.c index 962861c0cc..42a915bfe6 100644 --- a/libswscale/colorspace-test.c +++ b/libswscale/colorspace-test.c @@ -20,7 +20,6 @@ #include #include /* for memset() */ -#include #include #include diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 67cf19ec03..073fa665cf 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -149,15 +149,15 @@ const int *sws_getCoefficients(int colorspace) while (h_size--) { \ int av_unused U, V, Y; \ -#define ENDYUV2RGBLINE(dst_delta) \ - pu += 4; \ - pv += 4; \ - py_1 += 8; \ - py_2 += 8; \ - dst_1 += dst_delta; \ - dst_2 += dst_delta; \ +#define ENDYUV2RGBLINE(dst_delta, ss) \ + pu += 4 >> ss; \ + pv += 4 >> ss; \ + py_1 += 8 >> ss; \ + py_2 += 8 >> ss; \ + dst_1 += dst_delta >> ss; \ + dst_2 += dst_delta >> ss; \ } \ - if (c->dstW & 4) { \ + if (c->dstW & (4 >> ss)) { \ int av_unused Y, U, V; \ #define ENDYUV2RGBFUNC() \ @@ -167,7 +167,7 @@ const int *sws_getCoefficients(int colorspace) } #define CLOSEYUV2RGBFUNC(dst_delta) \ - ENDYUV2RGBLINE(dst_delta) \ + ENDYUV2RGBLINE(dst_delta, 0) \ ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0) @@ -186,7 +186,7 @@ YUV2RGBFUNC(yuv2rgb_c_48, uint8_t, 0) LOADCHROMA(3); PUTRGB48(dst_2, py_2, 3); PUTRGB48(dst_1, py_1, 3); -ENDYUV2RGBLINE(48) +ENDYUV2RGBLINE(48, 0) LOADCHROMA(0); PUTRGB48(dst_1, py_1, 0); PUTRGB48(dst_2, py_2, 0); @@ -194,6 +194,10 @@ ENDYUV2RGBLINE(48) LOADCHROMA(1); PUTRGB48(dst_2, py_2, 1); PUTRGB48(dst_1, py_1, 1); +ENDYUV2RGBLINE(48, 1) + LOADCHROMA(0); + PUTRGB48(dst_1, py_1, 0); + PUTRGB48(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0) @@ -212,7 +216,7 @@ YUV2RGBFUNC(yuv2rgb_c_bgr48, uint8_t, 0) LOADCHROMA(3); PUTBGR48(dst_2, py_2, 3); PUTBGR48(dst_1, py_1, 3); -ENDYUV2RGBLINE(48) +ENDYUV2RGBLINE(48, 0) LOADCHROMA(0); PUTBGR48(dst_1, py_1, 0); PUTBGR48(dst_2, py_2, 0); @@ -220,6 +224,10 @@ ENDYUV2RGBLINE(48) LOADCHROMA(1); PUTBGR48(dst_2, py_2, 1); PUTBGR48(dst_1, py_1, 1); +ENDYUV2RGBLINE(48, 1) + LOADCHROMA(0); + PUTBGR48(dst_1, py_1, 0); + PUTBGR48(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0) @@ -238,7 +246,7 @@ YUV2RGBFUNC(yuv2rgb_c_32, uint32_t, 0) LOADCHROMA(3); PUTRGB(dst_2, py_2, 3); PUTRGB(dst_1, py_1, 3); -ENDYUV2RGBLINE(8) +ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGB(dst_1, py_1, 0); PUTRGB(dst_2, py_2, 0); @@ -246,6 +254,10 @@ ENDYUV2RGBLINE(8) LOADCHROMA(1); PUTRGB(dst_2, py_2, 1); PUTRGB(dst_1, py_1, 1); +ENDYUV2RGBLINE(8, 1) + LOADCHROMA(0); + PUTRGB(dst_1, py_1, 0); + PUTRGB(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) @@ -266,7 +278,7 @@ YUV2RGBFUNC(yuva2rgba_c, uint32_t, 1) PUTRGBA(dst_1, py_1, pa_2, 3, 24); pa_1 += 8; \ pa_2 += 8; \ -ENDYUV2RGBLINE(8) +ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 24); PUTRGBA(dst_2, py_2, pa_2, 0, 24); @@ -274,6 +286,12 @@ ENDYUV2RGBLINE(8) LOADCHROMA(1); PUTRGBA(dst_2, py_2, pa_1, 1, 24); PUTRGBA(dst_1, py_1, pa_2, 1, 24); + pa_1 += 4; \ + pa_2 += 4; \ +ENDYUV2RGBLINE(8, 1) + LOADCHROMA(0); + PUTRGBA(dst_1, py_1, pa_1, 0, 24); + PUTRGBA(dst_2, py_2, pa_2, 0, 24); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) @@ -294,7 +312,7 @@ YUV2RGBFUNC(yuva2argb_c, uint32_t, 1) PUTRGBA(dst_1, py_1, pa_1, 3, 0); pa_1 += 8; \ pa_2 += 8; \ -ENDYUV2RGBLINE(8) +ENDYUV2RGBLINE(8, 0) LOADCHROMA(0); PUTRGBA(dst_1, py_1, pa_1, 0, 0); PUTRGBA(dst_2, py_2, pa_2, 0, 0); @@ -302,6 +320,12 @@ ENDYUV2RGBLINE(8) LOADCHROMA(1); PUTRGBA(dst_2, py_2, pa_2, 1, 0); PUTRGBA(dst_1, py_1, pa_1, 1, 0); + pa_1 += 4; \ + pa_2 += 4; \ +ENDYUV2RGBLINE(8, 1) + LOADCHROMA(0); + PUTRGBA(dst_1, py_1, pa_1, 0, 0); + PUTRGBA(dst_2, py_2, pa_2, 0, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0) @@ -320,7 +344,7 @@ YUV2RGBFUNC(yuv2rgb_c_24_rgb, uint8_t, 0) LOADCHROMA(3); PUTRGB24(dst_2, py_2, 3); PUTRGB24(dst_1, py_1, 3); -ENDYUV2RGBLINE(24) +ENDYUV2RGBLINE(24, 0) LOADCHROMA(0); PUTRGB24(dst_1, py_1, 0); PUTRGB24(dst_2, py_2, 0); @@ -328,6 +352,10 @@ ENDYUV2RGBLINE(24) LOADCHROMA(1); PUTRGB24(dst_2, py_2, 1); PUTRGB24(dst_1, py_1, 1); +ENDYUV2RGBLINE(24, 1) + LOADCHROMA(0); + PUTRGB24(dst_1, py_1, 0); + PUTRGB24(dst_2, py_2, 0); ENDYUV2RGBFUNC() // only trivial mods from yuv2rgb_c_24_rgb @@ -347,7 +375,7 @@ YUV2RGBFUNC(yuv2rgb_c_24_bgr, uint8_t, 0) LOADCHROMA(3); PUTBGR24(dst_2, py_2, 3); PUTBGR24(dst_1, py_1, 3); -ENDYUV2RGBLINE(24) +ENDYUV2RGBLINE(24, 0) LOADCHROMA(0); PUTBGR24(dst_1, py_1, 0); PUTBGR24(dst_2, py_2, 0); @@ -355,6 +383,10 @@ ENDYUV2RGBLINE(24) LOADCHROMA(1); PUTBGR24(dst_2, py_2, 1); PUTBGR24(dst_1, py_1, 1); +ENDYUV2RGBLINE(24, 1) + LOADCHROMA(0); + PUTBGR24(dst_1, py_1, 0); + PUTBGR24(dst_2, py_2, 0); ENDYUV2RGBFUNC() YUV2RGBFUNC(yuv2rgb_c_16_ordered_dither, uint16_t, 0) diff --git a/tools/cws2fws.c b/tools/cws2fws.c index 68f7953b56..74588c10a6 100644 --- a/tools/cws2fws.c +++ b/tools/cws2fws.c @@ -6,11 +6,17 @@ * This utility converts compressed Macromedia Flash files to uncompressed ones. */ +#include "config.h" #include #include #include #include +#if HAVE_UNISTD_H #include +#endif +#if HAVE_IO_H +#include +#endif #include #ifdef DEBUG diff --git a/tools/graph2dot.c b/tools/graph2dot.c index fa21ede933..14f0e7a024 100644 --- a/tools/graph2dot.c +++ b/tools/graph2dot.c @@ -18,7 +18,10 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "config.h" +#if HAVE_UNISTD_H #include /* getopt */ +#endif #include #include @@ -27,6 +30,10 @@ #include "libavutil/audioconvert.h" #include "libavfilter/avfiltergraph.h" +#if !HAVE_GETOPT +#include "compat/getopt.c" +#endif + static void usage(void) { printf("Convert a libavfilter graph to a dot file\n"); diff --git a/tools/ismindex.c b/tools/ismindex.c index 1b69e289d8..b801d43e8d 100644 --- a/tools/ismindex.c +++ b/tools/ismindex.c @@ -36,8 +36,8 @@ #include #include #ifdef _WIN32 -#include -#define mkdir(a, b) mkdir(a) +#include +#define mkdir(a, b) _mkdir(a) #endif #include "libavformat/avformat.h" diff --git a/tools/pktdumper.c b/tools/pktdumper.c index 1711210eb4..3fb94f6e9a 100644 --- a/tools/pktdumper.c +++ b/tools/pktdumper.c @@ -18,12 +18,18 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "config.h" #include #include #include #include #include +#if HAVE_UNISTD_H #include +#endif +#if HAVE_IO_H +#include +#endif #include "libavutil/time.h" #include "libavformat/avformat.h" diff --git a/tools/qt-faststart.c b/tools/qt-faststart.c index bb8e02eac9..ebbe95237c 100644 --- a/tools/qt-faststart.c +++ b/tools/qt-faststart.c @@ -32,6 +32,9 @@ #ifdef __MINGW32__ #define fseeko(x, y, z) fseeko64(x, y, z) #define ftello(x) ftello64(x) +#elif defined(_WIN32) +#define fseeko(x, y, z) _fseeki64(x, y, z) +#define ftello(x) _ftelli64(x) #endif #define BE_16(x) ((((uint8_t*)(x))[0] << 8) | ((uint8_t*)(x))[1])