From 324e818093194b31112805239efd2ebc69945921 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Thu, 26 Jan 2012 19:21:15 +0000 Subject: [PATCH 01/71] 8bps: K&R formatting cosmetics Signed-off-by: Diego Biurrun --- libavcodec/8bps.c | 263 +++++++++++++++++++++++----------------------- 1 file changed, 133 insertions(+), 130 deletions(-) diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index de8dd8ee84f76..e1c03f9b964c0 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -38,20 +38,20 @@ #include "avcodec.h" -static const enum PixelFormat pixfmt_rgb24[] = {PIX_FMT_BGR24, PIX_FMT_RGB32, PIX_FMT_NONE}; +static const enum PixelFormat pixfmt_rgb24[] = { + PIX_FMT_BGR24, PIX_FMT_RGB32, PIX_FMT_NONE }; /* * Decoder context */ typedef struct EightBpsContext { + AVCodecContext *avctx; + AVFrame pic; - AVCodecContext *avctx; - AVFrame pic; + unsigned char planes; + unsigned char planemap[4]; - unsigned char planes; - unsigned char planemap[4]; - - uint32_t pal[256]; + uint32_t pal[256]; } EightBpsContext; @@ -60,94 +60,97 @@ typedef struct EightBpsContext { * Decode a frame * */ -static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) +static int decode_frame(AVCodecContext *avctx, void *data, + int *data_size, AVPacket *avpkt) { - const uint8_t *buf = avpkt->data; - int buf_size = avpkt->size; - EightBpsContext * const c = avctx->priv_data; - const unsigned char *encoded = buf; - unsigned char *pixptr, *pixptr_end; - unsigned int height = avctx->height; // Real image height - unsigned int dlen, p, row; - const unsigned char *lp, *dp; - unsigned char count; - unsigned int px_inc; - unsigned int planes = c->planes; - unsigned char *planemap = c->planemap; - - if(c->pic.data[0]) - avctx->release_buffer(avctx, &c->pic); - - c->pic.reference = 0; - c->pic.buffer_hints = FF_BUFFER_HINTS_VALID; - if(avctx->get_buffer(avctx, &c->pic) < 0){ - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); - return -1; - } - - /* Set data pointer after line lengths */ - dp = encoded + planes * (height << 1); - - /* Ignore alpha plane, don't know what to do with it */ - if (planes == 4) - planes--; - - px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32); - - for (p = 0; p < planes; p++) { - /* Lines length pointer for this plane */ - lp = encoded + p * (height << 1); - - /* Decode a plane */ - for(row = 0; row < height; row++) { - pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p]; - pixptr_end = pixptr + c->pic.linesize[0]; - dlen = av_be2ne16(*(const unsigned short *)(lp+row*2)); - /* Decode a row of this plane */ - while(dlen > 0) { - if(dp + 1 >= buf+buf_size) return -1; - if ((count = *dp++) <= 127) { - count++; - dlen -= count + 1; - if (pixptr + count * px_inc > pixptr_end) - break; - if(dp + count > buf+buf_size) return -1; - while(count--) { - *pixptr = *dp++; - pixptr += px_inc; - } - } else { - count = 257 - count; - if (pixptr + count * px_inc > pixptr_end) - break; - while(count--) { - *pixptr = *dp; - pixptr += px_inc; - } - dp++; - dlen -= 2; - } - } + const uint8_t *buf = avpkt->data; + int buf_size = avpkt->size; + EightBpsContext * const c = avctx->priv_data; + const unsigned char *encoded = buf; + unsigned char *pixptr, *pixptr_end; + unsigned int height = avctx->height; // Real image height + unsigned int dlen, p, row; + const unsigned char *lp, *dp; + unsigned char count; + unsigned int px_inc; + unsigned int planes = c->planes; + unsigned char *planemap = c->planemap; + + if (c->pic.data[0]) + avctx->release_buffer(avctx, &c->pic); + + c->pic.reference = 0; + c->pic.buffer_hints = FF_BUFFER_HINTS_VALID; + if (avctx->get_buffer(avctx, &c->pic) < 0){ + av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + return -1; + } + + /* Set data pointer after line lengths */ + dp = encoded + planes * (height << 1); + + /* Ignore alpha plane, don't know what to do with it */ + if (planes == 4) + planes--; + + px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32); + + for (p = 0; p < planes; p++) { + /* Lines length pointer for this plane */ + lp = encoded + p * (height << 1); + + /* Decode a plane */ + for (row = 0; row < height; row++) { + pixptr = c->pic.data[0] + row * c->pic.linesize[0] + planemap[p]; + pixptr_end = pixptr + c->pic.linesize[0]; + dlen = av_be2ne16(*(const unsigned short *)(lp + row * 2)); + /* Decode a row of this plane */ + while (dlen > 0) { + if (dp + 1 >= buf + buf_size) + return -1; + if ((count = *dp++) <= 127) { + count++; + dlen -= count + 1; + if (pixptr + count * px_inc > pixptr_end) + break; + if (dp + count > buf + buf_size) + return -1; + while (count--) { + *pixptr = *dp++; + pixptr += px_inc; + } + } else { + count = 257 - count; + if (pixptr + count * px_inc > pixptr_end) + break; + while (count--) { + *pixptr = *dp; + pixptr += px_inc; + } + dp++; + dlen -= 2; } + } } - - if (avctx->bits_per_coded_sample <= 8) { - const uint8_t *pal = av_packet_get_side_data(avpkt, - AV_PKT_DATA_PALETTE, - NULL); - if (pal) { - c->pic.palette_has_changed = 1; - memcpy(c->pal, pal, AVPALETTE_SIZE); - } - - memcpy (c->pic.data[1], c->pal, AVPALETTE_SIZE); + } + + if (avctx->bits_per_coded_sample <= 8) { + const uint8_t *pal = av_packet_get_side_data(avpkt, + AV_PKT_DATA_PALETTE, + NULL); + if (pal) { + c->pic.palette_has_changed = 1; + memcpy(c->pal, pal, AVPALETTE_SIZE); } - *data_size = sizeof(AVFrame); - *(AVFrame*)data = c->pic; + memcpy (c->pic.data[1], c->pal, AVPALETTE_SIZE); + } + + *data_size = sizeof(AVFrame); + *(AVFrame*)data = c->pic; - /* always report that the buffer was completely consumed */ - return buf_size; + /* always report that the buffer was completely consumed */ + return buf_size; } @@ -158,46 +161,46 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac */ static av_cold int decode_init(AVCodecContext *avctx) { - EightBpsContext * const c = avctx->priv_data; - - c->avctx = avctx; - - c->pic.data[0] = NULL; - - switch (avctx->bits_per_coded_sample) { - case 8: - avctx->pix_fmt = PIX_FMT_PAL8; - c->planes = 1; - c->planemap[0] = 0; // 1st plane is palette indexes - break; - case 24: - avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24); - c->planes = 3; - c->planemap[0] = 2; // 1st plane is red - c->planemap[1] = 1; // 2nd plane is green - c->planemap[2] = 0; // 3rd plane is blue - break; - case 32: - avctx->pix_fmt = PIX_FMT_RGB32; - c->planes = 4; + EightBpsContext * const c = avctx->priv_data; + + c->avctx = avctx; + c->pic.data[0] = NULL; + + switch (avctx->bits_per_coded_sample) { + case 8: + avctx->pix_fmt = PIX_FMT_PAL8; + c->planes = 1; + c->planemap[0] = 0; // 1st plane is palette indexes + break; + case 24: + avctx->pix_fmt = avctx->get_format(avctx, pixfmt_rgb24); + c->planes = 3; + c->planemap[0] = 2; // 1st plane is red + c->planemap[1] = 1; // 2nd plane is green + c->planemap[2] = 0; // 3rd plane is blue + break; + case 32: + avctx->pix_fmt = PIX_FMT_RGB32; + c->planes = 4; #if HAVE_BIGENDIAN - c->planemap[0] = 1; // 1st plane is red - c->planemap[1] = 2; // 2nd plane is green - c->planemap[2] = 3; // 3rd plane is blue - c->planemap[3] = 0; // 4th plane is alpha??? + c->planemap[0] = 1; // 1st plane is red + c->planemap[1] = 2; // 2nd plane is green + c->planemap[2] = 3; // 3rd plane is blue + c->planemap[3] = 0; // 4th plane is alpha??? #else - c->planemap[0] = 2; // 1st plane is red - c->planemap[1] = 1; // 2nd plane is green - c->planemap[2] = 0; // 3rd plane is blue - c->planemap[3] = 3; // 4th plane is alpha??? + c->planemap[0] = 2; // 1st plane is red + c->planemap[1] = 1; // 2nd plane is green + c->planemap[2] = 0; // 3rd plane is blue + c->planemap[3] = 3; // 4th plane is alpha??? #endif - break; - default: - av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n", avctx->bits_per_coded_sample); - return -1; - } - - return 0; + break; + default: + av_log(avctx, AV_LOG_ERROR, "Error: Unsupported color depth: %u.\n", + avctx->bits_per_coded_sample); + return -1; + } + + return 0; } @@ -210,12 +213,12 @@ static av_cold int decode_init(AVCodecContext *avctx) */ static av_cold int decode_end(AVCodecContext *avctx) { - EightBpsContext * const c = avctx->priv_data; + EightBpsContext * const c = avctx->priv_data; - if (c->pic.data[0]) - avctx->release_buffer(avctx, &c->pic); + if (c->pic.data[0]) + avctx->release_buffer(avctx, &c->pic); - return 0; + return 0; } From 299ab0fd17a1738e21f3d036128db23ec14b2f3a Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Wed, 25 Jan 2012 20:13:17 +0100 Subject: [PATCH 02/71] libavutil: Remove pointless file test program. --- libavutil/Makefile | 2 +- libavutil/file.c | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/libavutil/Makefile b/libavutil/Makefile index 6896846081d67..63d848a3439e2 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -75,7 +75,7 @@ OBJS-$(ARCH_ARM) += arm/cpu.o OBJS-$(ARCH_PPC) += ppc/cpu.o OBJS-$(ARCH_X86) += x86/cpu.o -TESTPROGS = adler32 aes avstring base64 cpu crc des eval file fifo lfg lls \ +TESTPROGS = adler32 aes avstring base64 cpu crc des eval fifo lfg lls \ md5 opt parseutils rational sha tree TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo diff --git a/libavutil/file.c b/libavutil/file.c index 649bb767a0a63..77aaca0fc0c6d 100644 --- a/libavutil/file.c +++ b/libavutil/file.c @@ -129,21 +129,3 @@ void av_file_unmap(uint8_t *bufptr, size_t size) av_free(bufptr); #endif } - -#ifdef TEST - -#undef printf - -int main(void) -{ - uint8_t *buf; - size_t size; - if (av_file_map("file.c", &buf, &size, 0, NULL) < 0) - return 1; - - buf[0] = 's'; - printf("%s", buf); - av_file_unmap(buf, size); - return 0; -} -#endif From b57d262412204e54a7ef8fa1b23ff4dcede622e5 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Wed, 25 Jan 2012 13:39:24 -0800 Subject: [PATCH 03/71] mjpegbdec: Fix overflow in SOS. Based in part by a fix from Michael Niedermayer Fixes CVE-2011-3947 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind --- libavcodec/mjpegbdec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c index 4ad17ab3ce301..c89a5bd4046c6 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -59,6 +59,9 @@ static int mjpegb_decode_frame(AVCodecContext *avctx, s->restart_count = 0; s->mjpb_skiptosod = 0; + if (buf_end - buf_ptr >= 1 << 28) + return AVERROR_INVALIDDATA; + init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8); skip_bits(&hgb, 32); /* reserved zeros */ @@ -111,8 +114,8 @@ static int mjpegb_decode_frame(AVCodecContext *avctx, av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs); if (sos_offs) { -// init_get_bits(&s->gb, buf+sos_offs, (buf_end - (buf+sos_offs))*8); - init_get_bits(&s->gb, buf_ptr+sos_offs, field_size*8); + init_get_bits(&s->gb, buf_ptr + sos_offs, + 8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs)); s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16)); s->start_code = SOS; if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 && From fc115c80b7bf6f1f5a937ee7f6e14630d99eb4dd Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 27 Jan 2012 00:43:23 +0000 Subject: [PATCH 04/71] sws/pixfmt/pixdesc: add support for yuva444p Signed-off-by: Ronald S. Bultje --- libavutil/avutil.h | 2 +- libavutil/pixdesc.c | 13 +++++++++++++ libavutil/pixfmt.h | 1 + libswscale/utils.c | 1 + tests/ref/lavfi/pixdesc | 1 + tests/ref/lavfi/pixfmts_copy | 1 + tests/ref/lavfi/pixfmts_null | 1 + tests/ref/lavfi/pixfmts_scale | 1 + tests/ref/lavfi/pixfmts_vflip | 1 + 9 files changed, 21 insertions(+), 1 deletion(-) diff --git a/libavutil/avutil.h b/libavutil/avutil.h index f0be5c110a4d6..0e62b4a13fb81 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -154,7 +154,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 21 +#define LIBAVUTIL_VERSION_MINOR 22 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index 6e1f23b97fae7..eeab7a76ed1fa 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -521,6 +521,19 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, + [PIX_FMT_YUVA444P] = { + .name = "yuva444p", + .nb_components = 4, + .log2_chroma_w = 0, + .log2_chroma_h = 0, + .comp = { + { 0, 0, 1, 0, 7 }, /* Y */ + { 1, 0, 1, 0, 7 }, /* U */ + { 2, 0, 1, 0, 7 }, /* V */ + { 3, 0, 1, 0, 7 }, /* A */ + }, + .flags = PIX_FMT_PLANAR, + }, [PIX_FMT_VDPAU_H264] = { .name = "vdpau_h264", .log2_chroma_w = 1, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index bd898bdc8ed68..7d1d291e05674 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -157,6 +157,7 @@ enum PixelFormat { PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian + PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; diff --git a/libswscale/utils.c b/libswscale/utils.c index b49f924244ebc..3d944999861bc 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -104,6 +104,7 @@ static const FormatEntry format_entries[PIX_FMT_NB] = { [PIX_FMT_YUV440P] = { 1 , 1 }, [PIX_FMT_YUVJ440P] = { 1 , 1 }, [PIX_FMT_YUVA420P] = { 1 , 1 }, + [PIX_FMT_YUVA444P] = { 1 , 1 }, [PIX_FMT_RGB48BE] = { 1 , 1 }, [PIX_FMT_RGB48LE] = { 1 , 1 }, [PIX_FMT_RGB565BE] = { 1 , 1 }, diff --git a/tests/ref/lavfi/pixdesc b/tests/ref/lavfi/pixdesc index 5dfa2700212e9..3d6efeafef27e 100644 --- a/tests/ref/lavfi/pixdesc +++ b/tests/ref/lavfi/pixdesc @@ -57,6 +57,7 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4 yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054 yuv444p9le f0606604a5c08becab6ba500124c4b7c yuva420p a29884f3f3dfe1e00b961bc17bef3d47 +yuva444p bc92270d1b97ba23a9640d806daa7b07 yuvj420p 32eec78ba51857b16ce9b813a49b7189 yuvj422p 0dfa0ed434f73be51428758c69e082cb yuvj440p 657501a28004e27a592757a7509f5189 diff --git a/tests/ref/lavfi/pixfmts_copy b/tests/ref/lavfi/pixfmts_copy index 5dfa2700212e9..3d6efeafef27e 100644 --- a/tests/ref/lavfi/pixfmts_copy +++ b/tests/ref/lavfi/pixfmts_copy @@ -57,6 +57,7 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4 yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054 yuv444p9le f0606604a5c08becab6ba500124c4b7c yuva420p a29884f3f3dfe1e00b961bc17bef3d47 +yuva444p bc92270d1b97ba23a9640d806daa7b07 yuvj420p 32eec78ba51857b16ce9b813a49b7189 yuvj422p 0dfa0ed434f73be51428758c69e082cb yuvj440p 657501a28004e27a592757a7509f5189 diff --git a/tests/ref/lavfi/pixfmts_null b/tests/ref/lavfi/pixfmts_null index 5dfa2700212e9..3d6efeafef27e 100644 --- a/tests/ref/lavfi/pixfmts_null +++ b/tests/ref/lavfi/pixfmts_null @@ -57,6 +57,7 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4 yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054 yuv444p9le f0606604a5c08becab6ba500124c4b7c yuva420p a29884f3f3dfe1e00b961bc17bef3d47 +yuva444p bc92270d1b97ba23a9640d806daa7b07 yuvj420p 32eec78ba51857b16ce9b813a49b7189 yuvj422p 0dfa0ed434f73be51428758c69e082cb yuvj440p 657501a28004e27a592757a7509f5189 diff --git a/tests/ref/lavfi/pixfmts_scale b/tests/ref/lavfi/pixfmts_scale index 4a5bf676d964d..1fdd909fba57a 100644 --- a/tests/ref/lavfi/pixfmts_scale +++ b/tests/ref/lavfi/pixfmts_scale @@ -57,6 +57,7 @@ yuv444p16le a0c5d3c7bf3f181db503cf8e450d1335 yuv444p9be 9ac2643ce7f7e5c4e17c8c9fd8494d4a yuv444p9le 896a1cc9cccca1ba410dd53942d33cc4 yuva420p 8673a9131fb47de69788863f93a50eb7 +yuva444p d74a2339d1973fb25e53efc2102f8a08 yuvj420p 30427bd6caf5bda93a173dbebe759e09 yuvj422p fc8288f64fd149573f73cf8da05d8e6d yuvj440p 508ac7a9ddeb6d1794a1100ba7a1664c diff --git a/tests/ref/lavfi/pixfmts_vflip b/tests/ref/lavfi/pixfmts_vflip index f21927bdadf13..cec9e1508ee92 100644 --- a/tests/ref/lavfi/pixfmts_vflip +++ b/tests/ref/lavfi/pixfmts_vflip @@ -57,6 +57,7 @@ yuv444p16le 8e83323cf102d6c823a03ae8a7b7e033 yuv444p9be 6ac92b7dc9ab2fc59bee99204886899a yuv444p9le 85aef13a654953d3455d89770b0d74bd yuva420p c705d1cf061d8c6580ac690b55f92276 +yuva444p 8ed70261961cf596e7b80e89b1ed2b08 yuvj420p 41fd02b204da0ab62452cd14b595e2e4 yuvj422p 7f6ca9bc1812cde02036d7d29a7cce43 yuvj440p 25711c3c0fd15ec19c59a10784fcfb96 From d51d6ae9c41310d62f4582c07c2fad26d41eeca6 Mon Sep 17 00:00:00 2001 From: Mashiat Sarker Shakkhar Date: Thu, 26 Jan 2012 15:53:24 -0800 Subject: [PATCH 05/71] vc1dec.c: Don't use uninitialized values of dmv_[x, y] MVDATA may or may not be transmitted. If it is not, both dmv_x and dmv_y is to be assumed zero. This may not trigger wrong picture in all systems, but it's a bug nevertheless. Fixes SA10116.vc1 on my 64-bit Windows 7. Signed-off-by: Ronald S. Bultje --- libavcodec/vc1dec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index fa952739bb38d..325cc64fefd65 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -3954,6 +3954,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) vc1_mc_4mv_chroma4(v); } else { mvbp = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][2]; + dmv_x = dmv_y = 0; if (mvbp) { get_mvdata_interlaced(v, &dmv_x, &dmv_y, 0); } From 5eda82aac9b400f0435293db9b102bd4e9749a7b Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Fri, 27 Jan 2012 01:13:48 +0000 Subject: [PATCH 06/71] frwu: check if allocation was successful Signed-off-by: Paul B Mahol Signed-off-by: Ronald S. Bultje --- libavcodec/frwu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c index 061c4600407c1..eba0530e3c8ff 100644 --- a/libavcodec/frwu.c +++ b/libavcodec/frwu.c @@ -33,6 +33,8 @@ static av_cold int decode_init(AVCodecContext *avctx) avctx->pix_fmt = PIX_FMT_UYVY422; avctx->coded_frame = avcodec_alloc_frame(); + if (!avctx->coded_frame) + return AVERROR(ENOMEM); return 0; } From 08628b6afbc9b708b46f871f25a7a6be76ba4337 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Thu, 26 Jan 2012 18:06:57 -0800 Subject: [PATCH 07/71] Revert "sws/pixfmt/pixdesc: add support for yuva444p" This reverts commit fc115c80b7bf6f1f5a937ee7f6e14630d99eb4dd. Tests are broken. --- libavutil/avutil.h | 2 +- libavutil/pixdesc.c | 13 ------------- libavutil/pixfmt.h | 1 - libswscale/utils.c | 1 - tests/ref/lavfi/pixdesc | 1 - tests/ref/lavfi/pixfmts_copy | 1 - tests/ref/lavfi/pixfmts_null | 1 - tests/ref/lavfi/pixfmts_scale | 1 - tests/ref/lavfi/pixfmts_vflip | 1 - 9 files changed, 1 insertion(+), 21 deletions(-) diff --git a/libavutil/avutil.h b/libavutil/avutil.h index 0e62b4a13fb81..f0be5c110a4d6 100644 --- a/libavutil/avutil.h +++ b/libavutil/avutil.h @@ -154,7 +154,7 @@ */ #define LIBAVUTIL_VERSION_MAJOR 51 -#define LIBAVUTIL_VERSION_MINOR 22 +#define LIBAVUTIL_VERSION_MINOR 21 #define LIBAVUTIL_VERSION_MICRO 0 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index eeab7a76ed1fa..6e1f23b97fae7 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -521,19 +521,6 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUVA444P] = { - .name = "yuva444p", - .nb_components = 4, - .log2_chroma_w = 0, - .log2_chroma_h = 0, - .comp = { - { 0, 0, 1, 0, 7 }, /* Y */ - { 1, 0, 1, 0, 7 }, /* U */ - { 2, 0, 1, 0, 7 }, /* V */ - { 3, 0, 1, 0, 7 }, /* A */ - }, - .flags = PIX_FMT_PLANAR, - }, [PIX_FMT_VDPAU_H264] = { .name = "vdpau_h264", .log2_chroma_w = 1, diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 7d1d291e05674..bd898bdc8ed68 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -157,7 +157,6 @@ enum PixelFormat { PIX_FMT_GBRP10LE, ///< planar GBR 4:4:4 30bpp, little endian PIX_FMT_GBRP16BE, ///< planar GBR 4:4:4 48bpp, big endian PIX_FMT_GBRP16LE, ///< planar GBR 4:4:4 48bpp, little endian - PIX_FMT_YUVA444P, ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples) PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions }; diff --git a/libswscale/utils.c b/libswscale/utils.c index 3d944999861bc..b49f924244ebc 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -104,7 +104,6 @@ static const FormatEntry format_entries[PIX_FMT_NB] = { [PIX_FMT_YUV440P] = { 1 , 1 }, [PIX_FMT_YUVJ440P] = { 1 , 1 }, [PIX_FMT_YUVA420P] = { 1 , 1 }, - [PIX_FMT_YUVA444P] = { 1 , 1 }, [PIX_FMT_RGB48BE] = { 1 , 1 }, [PIX_FMT_RGB48LE] = { 1 , 1 }, [PIX_FMT_RGB565BE] = { 1 , 1 }, diff --git a/tests/ref/lavfi/pixdesc b/tests/ref/lavfi/pixdesc index 3d6efeafef27e..5dfa2700212e9 100644 --- a/tests/ref/lavfi/pixdesc +++ b/tests/ref/lavfi/pixdesc @@ -57,7 +57,6 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4 yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054 yuv444p9le f0606604a5c08becab6ba500124c4b7c yuva420p a29884f3f3dfe1e00b961bc17bef3d47 -yuva444p bc92270d1b97ba23a9640d806daa7b07 yuvj420p 32eec78ba51857b16ce9b813a49b7189 yuvj422p 0dfa0ed434f73be51428758c69e082cb yuvj440p 657501a28004e27a592757a7509f5189 diff --git a/tests/ref/lavfi/pixfmts_copy b/tests/ref/lavfi/pixfmts_copy index 3d6efeafef27e..5dfa2700212e9 100644 --- a/tests/ref/lavfi/pixfmts_copy +++ b/tests/ref/lavfi/pixfmts_copy @@ -57,7 +57,6 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4 yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054 yuv444p9le f0606604a5c08becab6ba500124c4b7c yuva420p a29884f3f3dfe1e00b961bc17bef3d47 -yuva444p bc92270d1b97ba23a9640d806daa7b07 yuvj420p 32eec78ba51857b16ce9b813a49b7189 yuvj422p 0dfa0ed434f73be51428758c69e082cb yuvj440p 657501a28004e27a592757a7509f5189 diff --git a/tests/ref/lavfi/pixfmts_null b/tests/ref/lavfi/pixfmts_null index 3d6efeafef27e..5dfa2700212e9 100644 --- a/tests/ref/lavfi/pixfmts_null +++ b/tests/ref/lavfi/pixfmts_null @@ -57,7 +57,6 @@ yuv444p16le 20f86bc2f68d2b3f1f2b48b97b2189f4 yuv444p9be 6ab31f4c12b533ce318ecdff83cdd054 yuv444p9le f0606604a5c08becab6ba500124c4b7c yuva420p a29884f3f3dfe1e00b961bc17bef3d47 -yuva444p bc92270d1b97ba23a9640d806daa7b07 yuvj420p 32eec78ba51857b16ce9b813a49b7189 yuvj422p 0dfa0ed434f73be51428758c69e082cb yuvj440p 657501a28004e27a592757a7509f5189 diff --git a/tests/ref/lavfi/pixfmts_scale b/tests/ref/lavfi/pixfmts_scale index 1fdd909fba57a..4a5bf676d964d 100644 --- a/tests/ref/lavfi/pixfmts_scale +++ b/tests/ref/lavfi/pixfmts_scale @@ -57,7 +57,6 @@ yuv444p16le a0c5d3c7bf3f181db503cf8e450d1335 yuv444p9be 9ac2643ce7f7e5c4e17c8c9fd8494d4a yuv444p9le 896a1cc9cccca1ba410dd53942d33cc4 yuva420p 8673a9131fb47de69788863f93a50eb7 -yuva444p d74a2339d1973fb25e53efc2102f8a08 yuvj420p 30427bd6caf5bda93a173dbebe759e09 yuvj422p fc8288f64fd149573f73cf8da05d8e6d yuvj440p 508ac7a9ddeb6d1794a1100ba7a1664c diff --git a/tests/ref/lavfi/pixfmts_vflip b/tests/ref/lavfi/pixfmts_vflip index cec9e1508ee92..f21927bdadf13 100644 --- a/tests/ref/lavfi/pixfmts_vflip +++ b/tests/ref/lavfi/pixfmts_vflip @@ -57,7 +57,6 @@ yuv444p16le 8e83323cf102d6c823a03ae8a7b7e033 yuv444p9be 6ac92b7dc9ab2fc59bee99204886899a yuv444p9le 85aef13a654953d3455d89770b0d74bd yuva420p c705d1cf061d8c6580ac690b55f92276 -yuva444p 8ed70261961cf596e7b80e89b1ed2b08 yuvj420p 41fd02b204da0ab62452cd14b595e2e4 yuvj422p 7f6ca9bc1812cde02036d7d29a7cce43 yuvj440p 25711c3c0fd15ec19c59a10784fcfb96 From 3b15a6d742edd368696a1feb6fa99892768e8a73 Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 23 Jan 2012 17:45:58 +0800 Subject: [PATCH 08/71] config.asm: change %ifdef directives to %if directives. This allows combining multiple conditionals in a single statement. --- configure | 3 +- libavcodec/x86/ac3dsp.asm | 10 ++--- libavcodec/x86/dct32_sse.asm | 4 +- libavcodec/x86/dsputil_yasm.asm | 54 +++++++++++----------- libavcodec/x86/dsputilenc_yasm.asm | 4 +- libavcodec/x86/fft_mmx.asm | 28 ++++++------ libavcodec/x86/fmtconvert.asm | 10 ++--- libavcodec/x86/h264_chromamc.asm | 16 +++---- libavcodec/x86/h264_chromamc_10bit.asm | 4 +- libavcodec/x86/h264_deblock.asm | 30 ++++++------- libavcodec/x86/h264_deblock_10bit.asm | 12 ++--- libavcodec/x86/h264_idct.asm | 60 ++++++++++++------------- libavcodec/x86/h264_idct_10bit.asm | 26 +++++------ libavcodec/x86/h264_intrapred.asm | 20 ++++----- libavcodec/x86/h264_intrapred_10bit.asm | 26 +++++------ libavcodec/x86/h264_qpel_10bit.asm | 8 ++-- libavcodec/x86/h264_weight.asm | 4 +- libavcodec/x86/h264_weight_10bit.asm | 2 +- libavcodec/x86/imdct36_sse.asm | 8 ++-- libavcodec/x86/proresdsp.asm | 2 +- libavcodec/x86/vp3dsp.asm | 18 ++++---- libavcodec/x86/vp56dsp.asm | 2 +- libavutil/x86/x86inc.asm | 28 ++++++------ libavutil/x86/x86util.asm | 2 +- libswscale/x86/input.asm | 8 ++-- libswscale/x86/output.asm | 16 +++---- libswscale/x86/scale.asm | 8 ++-- 27 files changed, 208 insertions(+), 205 deletions(-) diff --git a/configure b/configure index 1c96393a36c5f..49f9af2e7383b 100755 --- a/configure +++ b/configure @@ -541,7 +541,8 @@ print_config_mak(){ } print_config_asm(){ - enabled $1 && echo "%define $2" + enabled $1 && v=1 || v=0 + echo "%define $2 $v" } print_config(){ diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm index c1b0906a85986..e1761fa806ace 100644 --- a/libavcodec/x86/ac3dsp.asm +++ b/libavcodec/x86/ac3dsp.asm @@ -69,12 +69,12 @@ cglobal ac3_exponent_min_%1, 3,4,2, exp, reuse_blks, expn, offset %define LOOP_ALIGN INIT_MMX AC3_EXPONENT_MIN mmx -%ifdef HAVE_MMX2 +%if HAVE_MMX2 %define PMINUB PMINUB_MMXEXT %define LOOP_ALIGN ALIGN 16 AC3_EXPONENT_MIN mmxext %endif -%ifdef HAVE_SSE +%if HAVE_SSE INIT_XMM AC3_EXPONENT_MIN sse2 %endif @@ -367,7 +367,7 @@ cglobal ac3_compute_mantissa_size_sse2, 1,2,4, mant_cnt, sum pabsd %1, %1 %endmacro -%ifdef HAVE_AMD3DNOW +%if HAVE_AMD3DNOW INIT_MMX cglobal ac3_extract_exponents_3dnow, 3,3,0, exp, coef, len add expq, lenq @@ -439,11 +439,11 @@ cglobal ac3_extract_exponents_%1, 3,3,5, exp, coef, len REP_RET %endmacro -%ifdef HAVE_SSE +%if HAVE_SSE INIT_XMM %define PABSD PABSD_MMX AC3_EXTRACT_EXPONENTS sse2 -%ifdef HAVE_SSSE3 +%if HAVE_SSSE3 %define PABSD PABSD_SSSE3 AC3_EXTRACT_EXPONENTS ssse3 %endif diff --git a/libavcodec/x86/dct32_sse.asm b/libavcodec/x86/dct32_sse.asm index 720a061078d77..e3c8a455459ee 100644 --- a/libavcodec/x86/dct32_sse.asm +++ b/libavcodec/x86/dct32_sse.asm @@ -211,7 +211,7 @@ ps_p1p1m1m1: dd 0, 0, 0x80000000, 0x80000000, 0, 0, 0x80000000, 0x80000000 INIT_YMM SECTION_TEXT -%ifdef HAVE_AVX +%if HAVE_AVX ; void ff_dct32_float_avx(FFTSample *out, const FFTSample *in) cglobal dct32_float_avx, 2,3,8, out, in, tmp ; pass 1 @@ -289,7 +289,7 @@ INIT_XMM %define BUTTERFLY BUTTERFLY_SSE %define BUTTERFLY0 BUTTERFLY0_SSE -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define SPILL SWAP %define UNSPILL SWAP diff --git a/libavcodec/x86/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm index 4d2fb6a373c60..4607ff15d77d6 100644 --- a/libavcodec/x86/dsputil_yasm.asm +++ b/libavcodec/x86/dsputil_yasm.asm @@ -138,7 +138,7 @@ align 16 %endif %define t0 [v1q + orderq] %define t1 [v1q + orderq + mmsize] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mova m8, t0 mova m9, t1 %define t0 m8 @@ -474,7 +474,7 @@ cglobal scalarproduct_float_sse, 3,3,2, v1, v2, offset movss xmm1, xmm0 shufps xmm0, xmm0, 1 addss xmm0, xmm1 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 movd r0m, xmm0 fld dword r0m %endif @@ -498,7 +498,7 @@ cglobal scalarproduct_float_sse, 3,3,2, v1, v2, offset ; function implementations. Fast are fixed-width, slow is variable-width %macro EMU_EDGE_FUNC 0 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define w_reg r10 cglobal emu_edge_core, 6, 7, 1 mov r11, r5 ; save block_h @@ -513,14 +513,14 @@ cglobal emu_edge_core, 2, 7, 0 mov w_reg, r7m sub w_reg, r6m ; w = start_x - end_x sub r5, r4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 sub r4, r3 %else sub r4, dword r3m %endif cmp w_reg, 22 jg .slow_v_extend_loop -%ifdef ARCH_X86_32 +%if ARCH_X86_32 mov r2, r2m ; linesize %endif sal w_reg, 7 ; w * 128 @@ -536,7 +536,7 @@ cglobal emu_edge_core, 2, 7, 0 ; horizontal extend (left/right) mov w_reg, r6m ; start_x sub r0, w_reg -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r3, r0 ; backup of buf+block_h*linesize mov r5, r11 %else @@ -564,7 +564,7 @@ cglobal emu_edge_core, 2, 7, 0 ; now r3(64)/r0(32)=buf,r2=linesize,r11/r5=block_h,r6/r3=val, r10/r6=end_x, r1=block_w .right_extend: -%ifdef ARCH_X86_32 +%if ARCH_X86_32 mov r0, r0m mov r5, r5m %endif @@ -589,13 +589,13 @@ cglobal emu_edge_core, 2, 7, 0 .h_extend_end: RET -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define vall al %define valh ah %define valw ax %define valw2 r10w %define valw3 r3w -%ifdef WIN64 +%if WIN64 %define valw4 r4w %else ; unix64 %define valw4 r3w @@ -643,7 +643,7 @@ cglobal emu_edge_core, 2, 7, 0 %endrep ; %2/16 %endif -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %if (%2-%%src_off) == 8 mov rax, [r1+%%src_off] %assign %%src_off %%src_off+8 @@ -692,7 +692,7 @@ cglobal emu_edge_core, 2, 7, 0 %endrep ; %2/16 %endif -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %if (%2-%%dst_off) == 8 mov [r0+%%dst_off], rax %assign %%dst_off %%dst_off+8 @@ -740,7 +740,7 @@ cglobal emu_edge_core, 2, 7, 0 ALIGN 128 .emuedge_v_extend_ %+ %%n: ; extend pixels above body -%ifdef ARCH_X86_64 +%if ARCH_X86_64 test r3 , r3 ; if (!start_y) jz .emuedge_copy_body_ %+ %%n %+ _loop ; goto body %else ; ARCH_X86_32 @@ -751,7 +751,7 @@ ALIGN 128 .emuedge_extend_top_ %+ %%n %+ _loop: ; do { WRITE_NUM_BYTES top, %%n ; write bytes add r0 , r2 ; dst += linesize -%ifdef ARCH_X86_64 +%if ARCH_X86_64 dec r3d %else ; ARCH_X86_32 dec dword r3m @@ -779,7 +779,7 @@ ALIGN 128 jnz .emuedge_extend_bottom_ %+ %%n %+ _loop ; } while (--block_h) .emuedge_v_extend_end_ %+ %%n: -%ifdef ARCH_X86_64 +%if ARCH_X86_64 ret %else ; ARCH_X86_32 rep ret @@ -841,7 +841,7 @@ ALIGN 64 WRITE_V_PIXEL %%n, r0 ; write pixels dec r5 jnz .emuedge_extend_left_ %+ %%n ; } while (--block_h) -%ifdef ARCH_X86_64 +%if ARCH_X86_64 ret %else ; ARCH_X86_32 rep ret @@ -856,7 +856,7 @@ ALIGN 64 %rep 11 ALIGN 64 .emuedge_extend_right_ %+ %%n: ; do { -%ifdef ARCH_X86_64 +%if ARCH_X86_64 sub r3, r2 ; dst -= linesize READ_V_PIXEL %%n, [r3+w_reg-1] ; read pixels WRITE_V_PIXEL %%n, r3+r4-%%n ; write pixels @@ -868,7 +868,7 @@ ALIGN 64 dec r5 %endif ; ARCH_X86_64/32 jnz .emuedge_extend_right_ %+ %%n ; } while (--block_h) -%ifdef ARCH_X86_64 +%if ARCH_X86_64 ret %else ; ARCH_X86_32 rep ret @@ -876,7 +876,7 @@ ALIGN 64 %assign %%n %%n+2 %endrep -%ifdef ARCH_X86_32 +%if ARCH_X86_32 %define stack_offset 0x10 %endif %endmacro ; RIGHT_EXTEND @@ -916,7 +916,7 @@ ALIGN 64 V_COPY_NPX %1, mm0, movq, 8, 0xFFFFFFF8 %else ; sse V_COPY_NPX %1, xmm0, movups, 16, 0xFFFFFFF0 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define linesize r2 V_COPY_NPX %1, rax , mov, 8 %else ; ARCH_X86_32 @@ -940,7 +940,7 @@ ALIGN 64 .slow_v_extend_loop: ; r0=buf,r1=src,r2(64)/r2m(32)=linesize,r3(64)/r3m(32)=start_x,r4=end_y,r5=block_h ; r11(64)/r3(later-64)/r2(32)=cnt_reg,r6(64)/r3(32)=val_reg,r10(64)/r6(32)=w=end_x-start_x -%ifdef ARCH_X86_64 +%if ARCH_X86_64 push r11 ; save old value of block_h test r3, r3 %define cnt_reg r11 @@ -956,18 +956,18 @@ ALIGN 64 .do_body_copy: V_COPY_ROW body, r4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 pop r11 ; restore old value of block_h %define cnt_reg r3 %endif test r5, r5 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 jz .v_extend_end %else jz .skip_bottom_extend %endif V_COPY_ROW bottom, r5 -%ifdef ARCH_X86_32 +%if ARCH_X86_32 .skip_bottom_extend: mov r2, r2m %endif @@ -996,7 +996,7 @@ ALIGN 64 .left_extend_loop_end: dec r5 jnz .slow_left_extend_loop -%ifdef ARCH_X86_32 +%if ARCH_X86_32 mov r2, r2m %endif jmp .right_extend @@ -1006,7 +1006,7 @@ ALIGN 64 .slow_right_extend_loop: ; r3(64)/r0(32)=buf+block_h*linesize,r2=linesize,r4=block_w,r11(64)/r5(32)=block_h, ; r10(64)/r6(32)=end_x,r6/r3=val,r1=cntr -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define buf_reg r3 %define bh_reg r11 %else @@ -1047,7 +1047,7 @@ SLOW_RIGHT_EXTEND %endmacro emu_edge sse -%ifdef ARCH_X86_32 +%if ARCH_X86_32 emu_edge mmx %endif @@ -1138,7 +1138,7 @@ VECTOR_CLIP_INT32 6, 1, 0, 0 %macro BUTTERFLIES_FLOAT_INTERLEAVE 0 cglobal butterflies_float_interleave, 4,4,3, dst, src0, src1, len -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd lenq, lend %endif test lenq, lenq diff --git a/libavcodec/x86/dsputilenc_yasm.asm b/libavcodec/x86/dsputilenc_yasm.asm index 6063ff104079d..cfd4e6d28bec5 100644 --- a/libavcodec/x86/dsputilenc_yasm.asm +++ b/libavcodec/x86/dsputilenc_yasm.asm @@ -245,7 +245,7 @@ hadamard8x8_diff_%1: lea r0, [r3*3] DIFF_PIXELS_8 r1, r2, 0, r3, r0, rsp+gprsize HADAMARD8 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8 %else TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [rsp+gprsize], [rsp+mmsize+gprsize] @@ -270,7 +270,7 @@ HADAMARD8_DIFF_MMX mmx2 INIT_XMM %define ABS2 ABS2_MMX2 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define ABS_SUM_8x8 ABS_SUM_8x8_64 %else %define ABS_SUM_8x8 ABS_SUM_8x8_32 diff --git a/libavcodec/x86/fft_mmx.asm b/libavcodec/x86/fft_mmx.asm index d6d07b825f6a7..a2f26cca339ef 100644 --- a/libavcodec/x86/fft_mmx.asm +++ b/libavcodec/x86/fft_mmx.asm @@ -30,7 +30,7 @@ %include "x86inc.asm" -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define pointer resq %else %define pointer resd @@ -73,7 +73,7 @@ cextern cos_ %+ i %assign i i<<1 %endrep -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define pointer dq %else %define pointer dd @@ -299,7 +299,7 @@ IF%1 mova Z(1), m5 INIT_YMM -%ifdef HAVE_AVX +%if HAVE_AVX align 16 fft8_avx: mova m0, Z(0) @@ -534,7 +534,7 @@ DEFINE_ARGS z, w, n, o1, o3 INIT_YMM -%ifdef HAVE_AVX +%if HAVE_AVX %macro INTERL_AVX 5 vunpckhps %3, %2, %1 vunpcklps %2, %2, %1 @@ -638,7 +638,7 @@ cglobal fft_dispatch%3%2, 2,5,8, z, nbits RET %endmacro ; DECL_FFT -%ifdef HAVE_AVX +%if HAVE_AVX INIT_YMM DECL_FFT 6, _avx DECL_FFT 6, _avx, _interleave @@ -750,7 +750,7 @@ INIT_XMM %macro DECL_IMDCT 2 cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample *input -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define rrevtab r10 %define rtcos r11 %define rtsin r12 @@ -769,24 +769,24 @@ cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample * mov rtsin, [r0+FFTContext.tsin] add rtcos, r3 add rtsin, r3 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 push rtcos push rtsin %endif shr r3, 1 mov rrevtab, [r0+FFTContext.revtab] add rrevtab, r3 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 push rrevtab %endif sub r3, 4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 xor r4, r4 sub r4, r3 %endif .pre: -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 ;unspill xor r4, r4 sub r4, r3 @@ -795,7 +795,7 @@ cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample * %endif PREROTATER r4, r3, r2, rtcos, rtsin -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movzx r5, word [rrevtab+r4-4] movzx r6, word [rrevtab+r4-2] movzx r13, word [rrevtab+r3] @@ -829,7 +829,7 @@ cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample * mov r0d, [r5+FFTContext.mdctsize] add r6, r0 shr r0, 1 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 %define rtcos r2 %define rtsin r3 mov rtcos, [esp+8] @@ -839,7 +839,7 @@ cglobal imdct_half%1, 3,7,8; FFTContext *s, FFTSample *output, const FFTSample * mov r1, -mmsize sub r1, r0 %2 r0, r1, r6, rtcos, rtsin -%ifdef ARCH_X86_64 +%if ARCH_X86_64 pop r14 pop r13 pop r12 @@ -856,6 +856,6 @@ DECL_IMDCT _sse, POSROTATESHUF INIT_YMM -%ifdef HAVE_AVX +%if HAVE_AVX DECL_IMDCT _avx, POSROTATESHUF_AVX %endif diff --git a/libavcodec/x86/fmtconvert.asm b/libavcodec/x86/fmtconvert.asm index d6210897f6c4b..3f39c7e5643b5 100644 --- a/libavcodec/x86/fmtconvert.asm +++ b/libavcodec/x86/fmtconvert.asm @@ -28,14 +28,14 @@ SECTION_TEXT ; void int32_to_float_fmul_scalar(float *dst, const int *src, float mul, int len); ;--------------------------------------------------------------------------------- %macro INT32_TO_FLOAT_FMUL_SCALAR 2 -%ifdef UNIX64 +%if UNIX64 cglobal int32_to_float_fmul_scalar_%1, 3,3,%2, dst, src, len %else cglobal int32_to_float_fmul_scalar_%1, 4,4,%2, dst, src, mul, len %endif -%ifdef WIN64 +%if WIN64 SWAP 0, 2 -%elifdef ARCH_X86_32 +%elif ARCH_X86_32 movss m0, mulm %endif SPLATD m0 @@ -180,7 +180,7 @@ FLOAT_TO_INT16_INTERLEAVE2 sse2 %macro FLOAT_TO_INT16_INTERLEAVE6 1 ; void float_to_int16_interleave6_sse(int16_t *dst, const float **src, int len) cglobal float_to_int16_interleave6_%1, 2,7,0, dst, src, src1, src2, src3, src4, src5 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define lend r10d mov lend, r2d %else @@ -241,7 +241,7 @@ FLOAT_TO_INT16_INTERLEAVE6 3dn2 %macro FLOAT_INTERLEAVE6 2 cglobal float_interleave6_%1, 2,7,%2, dst, src, src1, src2, src3, src4, src5 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define lend r10d mov lend, r2d %else diff --git a/libavcodec/x86/h264_chromamc.asm b/libavcodec/x86/h264_chromamc.asm index 16cf2ec43ee12..8b621fa8bb93c 100644 --- a/libavcodec/x86/h264_chromamc.asm +++ b/libavcodec/x86/h264_chromamc.asm @@ -94,7 +94,7 @@ SECTION .text ; put/avg_h264_chroma_mc8_mmx_*(uint8_t *dst /*align 8*/, uint8_t *src /*align 1*/, ; int stride, int h, int mx, int my) cglobal %1_%2_chroma_mc8_%3, 6, 7, 0 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r2, r2d %endif mov r6d, r5d @@ -113,7 +113,7 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7, 0 %define rnd_1d_rv40 rnd_rv40_1d_tbl %define rnd_2d_rv40 rnd_rv40_2d_tbl %endif -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r10, r5 and r10, 6 ; &~1 for mx/my=[0,7] lea r10, [r10*4+r4] @@ -147,7 +147,7 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7, 0 %ifdef PIC lea r11, [rnd_rv40_1d_tbl] %endif -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r5, r0m %endif %endif @@ -198,7 +198,7 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7, 0 %ifdef PIC lea r11, [rnd_rv40_2d_tbl] %endif -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r5, r0m %endif %endif @@ -279,7 +279,7 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7, 0 %macro chroma_mc4_mmx_func 3 cglobal %1_%2_chroma_mc4_%3, 6, 6, 0 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r2, r2d %endif pxor m7, m7 @@ -364,7 +364,7 @@ cglobal %1_%2_chroma_mc4_%3, 6, 6, 0 %macro chroma_mc2_mmx_func 3 cglobal %1_%2_chroma_mc2_%3, 6, 7, 0 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r2, r2d %endif @@ -452,7 +452,7 @@ chroma_mc4_mmx_func avg, rv40, 3dnow %macro chroma_mc8_ssse3_func 3 cglobal %1_%2_chroma_mc8_%3, 6, 7, 8 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r2, r2d %endif mov r6d, r5d @@ -600,7 +600,7 @@ cglobal %1_%2_chroma_mc8_%3, 6, 7, 8 %macro chroma_mc4_ssse3_func 3 cglobal %1_%2_chroma_mc4_%3, 6, 7, 0 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r2, r2d %endif mov r6, r4 diff --git a/libavcodec/x86/h264_chromamc_10bit.asm b/libavcodec/x86/h264_chromamc_10bit.asm index 9d075434fe418..3f7c513069c16 100644 --- a/libavcodec/x86/h264_chromamc_10bit.asm +++ b/libavcodec/x86/h264_chromamc_10bit.asm @@ -252,7 +252,7 @@ cglobal %1_h264_chroma_mc2_10_%2, 6,7 %define CHROMAMC_AVG NOTHING INIT_XMM CHROMA_MC8 put, sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX CHROMA_MC8 put, avx %endif @@ -264,7 +264,7 @@ CHROMA_MC2 put, mmxext %define PAVG pavgw INIT_XMM CHROMA_MC8 avg, sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX CHROMA_MC8 avg, avx %endif diff --git a/libavcodec/x86/h264_deblock.asm b/libavcodec/x86/h264_deblock.asm index 92f91acade6bd..f264edb65fc30 100644 --- a/libavcodec/x86/h264_deblock.asm +++ b/libavcodec/x86/h264_deblock.asm @@ -200,7 +200,7 @@ cextern pb_A1 ; out: %4 = |%1-%2|>%3 ; clobbers: %5 %macro DIFF_GT2 5 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 psubusb %5, %2, %1 psubusb %4, %1, %2 %else @@ -278,7 +278,7 @@ cextern pb_A1 mova %4, %2 %endmacro -%ifdef ARCH_X86_64 +%if ARCH_X86_64 ;----------------------------------------------------------------------------- ; void deblock_v_luma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) ;----------------------------------------------------------------------------- @@ -333,7 +333,7 @@ cglobal deblock_h_luma_8_%1, 5,7 lea r11, [r10+r10*2] lea r6, [r0-4] lea r5, [r0-4+r11] -%ifdef WIN64 +%if WIN64 sub rsp, 0x98 %define pix_tmp rsp+0x30 %else @@ -352,7 +352,7 @@ cglobal deblock_h_luma_8_%1, 5,7 ; don't backup r6, r5, r10, r11 because deblock_v_luma_sse2 doesn't use them lea r0, [pix_tmp+0x30] mov r1d, 0x10 -%ifdef WIN64 +%if WIN64 mov [rsp+0x20], r4 %endif call deblock_v_luma_8_%1 @@ -376,7 +376,7 @@ cglobal deblock_h_luma_8_%1, 5,7 movq m3, [pix_tmp+0x40] TRANSPOSE8x4B_STORE PASS8ROWS(r6, r5, r10, r11) -%ifdef WIN64 +%if WIN64 add rsp, 0x98 %else add rsp, 0x68 @@ -513,7 +513,7 @@ DEBLOCK_LUMA avx, v, 16 %macro LUMA_INTRA_P012 4 ; p0..p3 in memory -%ifdef ARCH_X86_64 +%if ARCH_X86_64 pavgb t0, p2, p1 pavgb t1, p0, q0 %else @@ -524,7 +524,7 @@ DEBLOCK_LUMA avx, v, 16 %endif pavgb t0, t1 ; ((p2+p1+1)/2 + (p0+q0+1)/2 + 1)/2 mova t5, t1 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 paddb t2, p2, p1 paddb t3, p0, q0 %else @@ -542,7 +542,7 @@ DEBLOCK_LUMA avx, v, 16 pand t2, mpb_1 psubb t0, t2 ; p1' = (p2+p1+p0+q0+2)/4; -%ifdef ARCH_X86_64 +%if ARCH_X86_64 pavgb t1, p2, q1 psubb t2, p2, q1 %else @@ -617,7 +617,7 @@ DEBLOCK_LUMA avx, v, 16 %define t1 m5 %define t2 m6 %define t3 m7 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define p2 m8 %define q2 m9 %define t4 m10 @@ -644,7 +644,7 @@ DEBLOCK_LUMA avx, v, 16 ; void deblock_v_luma_intra( uint8_t *pix, int stride, int alpha, int beta ) ;----------------------------------------------------------------------------- cglobal deblock_%2_luma_intra_8_%1, 4,6,16 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 sub esp, 0x60 %endif lea r4, [r1*4] @@ -659,7 +659,7 @@ cglobal deblock_%2_luma_intra_8_%1, 4,6,16 mova p0, [r4+r5] mova q0, [r0] mova q1, [r0+r1] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 pxor mpb_0, mpb_0 mova mpb_1, [pb_1] LOAD_MASK r2d, r3d, t5 ; m5=beta-1, t5=alpha-1, m7=mask0 @@ -695,13 +695,13 @@ cglobal deblock_%2_luma_intra_8_%1, 4,6,16 LUMA_INTRA_SWAP_PQ LUMA_INTRA_P012 [r0], [r0+r1], [r0+2*r1], [r0+r5] .end: -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 add esp, 0x60 %endif RET INIT_MMX -%ifdef ARCH_X86_64 +%if ARCH_X86_64 ;----------------------------------------------------------------------------- ; void deblock_h_luma_intra( uint8_t *pix, int stride, int alpha, int beta ) ;----------------------------------------------------------------------------- @@ -779,7 +779,7 @@ INIT_XMM DEBLOCK_LUMA_INTRA sse2, v INIT_AVX DEBLOCK_LUMA_INTRA avx , v -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 INIT_MMX DEBLOCK_LUMA_INTRA mmxext, v8 %endif @@ -824,7 +824,7 @@ cglobal deblock_v_chroma_8_mmxext, 5,6 ; void ff_deblock_h_chroma( uint8_t *pix, int stride, int alpha, int beta, int8_t *tc0 ) ;----------------------------------------------------------------------------- cglobal deblock_h_chroma_8_mmxext, 5,7 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define buf0 [rsp-24] %define buf1 [rsp-16] %else diff --git a/libavcodec/x86/h264_deblock_10bit.asm b/libavcodec/x86/h264_deblock_10bit.asm index baac725eec439..a4ccafc68f0fa 100644 --- a/libavcodec/x86/h264_deblock_10bit.asm +++ b/libavcodec/x86/h264_deblock_10bit.asm @@ -302,7 +302,7 @@ cglobal deblock_h_luma_10_%1, 5,6,8*(mmsize/16) %endmacro INIT_XMM -%ifdef ARCH_X86_64 +%if ARCH_X86_64 ; in: m0=p1, m1=p0, m2=q0, m3=q1, m8=p2, m9=q2 ; m12=alpha, m13=beta ; out: m0=p1', m3=q1', m1=p0', m2=q0' @@ -435,7 +435,7 @@ DEBLOCK_LUMA_64 avx ; %1=p0 %2=p1 %3=p2 %4=p3 %5=q0 %6=q1 %7=mask0 ; %8=mask1p %9=2 %10=p0' %11=p1' %12=p2' %macro LUMA_INTRA_P012 12 ; p0..p3 in memory -%ifdef ARCH_X86_64 +%if ARCH_X86_64 paddw t0, %3, %2 mova t2, %4 paddw t2, %3 @@ -501,7 +501,7 @@ DEBLOCK_LUMA_64 avx LOAD_AB t0, t1, r2d, r3d mova %1, t0 LOAD_MASK m0, m1, m2, m3, %1, t1, t0, t2, t3 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mova %2, t0 ; mask0 psrlw t3, %1, 2 %else @@ -598,7 +598,7 @@ DEBLOCK_LUMA_64 avx %endif %endmacro -%ifdef ARCH_X86_64 +%if ARCH_X86_64 ;----------------------------------------------------------------------------- ; void deblock_v_luma_intra( uint16_t *pix, int stride, int alpha, int beta ) ;----------------------------------------------------------------------------- @@ -792,7 +792,7 @@ cglobal deblock_h_luma_intra_10_%1, 4,7,8*(mmsize/16) RET %endmacro -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 INIT_MMX DEBLOCK_LUMA mmxext DEBLOCK_LUMA_INTRA mmxext @@ -907,7 +907,7 @@ cglobal deblock_v_chroma_intra_10_%1, 4,6-(mmsize/16),8*(mmsize/16) %endif %endmacro -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 INIT_MMX DEBLOCK_CHROMA mmxext %endif diff --git a/libavcodec/x86/h264_idct.asm b/libavcodec/x86/h264_idct.asm index 37c2c904764c5..a132480022a10 100644 --- a/libavcodec/x86/h264_idct.asm +++ b/libavcodec/x86/h264_idct.asm @@ -198,14 +198,14 @@ cglobal h264_idct8_add_8_mmx, 3, 4, 0 ; %1=uint8_t *dst, %2=int16_t *block, %3=int stride %macro IDCT8_ADD_SSE 4 IDCT8_1D_FULL %2 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8 %else TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [%2], [%2+16] %endif paddw m0, [pw_32] -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mova [%2 ], m0 mova [%2+16], m4 IDCT8_1D [%2], [%2+ 16] @@ -225,7 +225,7 @@ cglobal h264_idct8_add_8_mmx, 3, 4, 0 STORE_DIFF m1, m6, m7, [%1+%3 ] STORE_DIFF m2, m6, m7, [%1+%3*2] STORE_DIFF m3, m6, m7, [%1+%4 ] -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mova m0, [%2 ] mova m1, [%2+16] %else @@ -371,7 +371,7 @@ cglobal h264_idct_add16_8_mmx2, 5, 7, 0 test r6, r6 jz .no_dc DC_ADD_MMX2_INIT r2, r3, r6 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define dst_reg r10 %define dst_regd r10d %else @@ -381,7 +381,7 @@ cglobal h264_idct_add16_8_mmx2, 5, 7, 0 mov dst_regd, dword [r1+r5*4] lea dst_reg, [r0+dst_reg] DC_ADD_MMX2_OP movh, dst_reg, r3, r6 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r1, r1m %endif inc r5 @@ -448,7 +448,7 @@ cglobal h264_idct_add16intra_8_mmx2, 5, 7, 0 test r6, r6 jz .skipblock DC_ADD_MMX2_INIT r2, r3, r6 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define dst_reg r10 %define dst_regd r10d %else @@ -458,7 +458,7 @@ cglobal h264_idct_add16intra_8_mmx2, 5, 7, 0 mov dst_regd, dword [r1+r5*4] add dst_reg, r0 DC_ADD_MMX2_OP movh, dst_reg, r3, r6 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r1, r1m %endif .skipblock @@ -489,7 +489,7 @@ cglobal h264_idct8_add4_8_mmx2, 5, 7, 0 test r6, r6 jz .no_dc DC_ADD_MMX2_INIT r2, r3, r6 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define dst_reg r10 %define dst_regd r10d %else @@ -501,7 +501,7 @@ cglobal h264_idct8_add4_8_mmx2, 5, 7, 0 DC_ADD_MMX2_OP mova, dst_reg, r3, r6 lea dst_reg, [dst_reg+r3*4] DC_ADD_MMX2_OP mova, dst_reg, r3, r6 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r1, r1m %endif add r5, 4 @@ -550,7 +550,7 @@ cglobal h264_idct8_add4_8_sse2, 5, 7, 10 jz .no_dc INIT_MMX DC_ADD_MMX2_INIT r2, r3, r6 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define dst_reg r10 %define dst_regd r10d %else @@ -562,7 +562,7 @@ INIT_MMX DC_ADD_MMX2_OP mova, dst_reg, r3, r6 lea dst_reg, [dst_reg+r3*4] DC_ADD_MMX2_OP mova, dst_reg, r3, r6 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r1, r1m %endif add r5, 4 @@ -575,7 +575,7 @@ INIT_XMM mov dst_regd, dword [r1+r5*4] add dst_reg, r0 IDCT8_ADD_SSE dst_reg, r2, r3, r6 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r1, r1m %endif .skipblock @@ -593,7 +593,7 @@ h264_idct_add8_mmx_plane: or r6w, word [r2] test r6, r6 jz .skipblock -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r0d, dword [r1+r5*4] add r0, [r10] %else @@ -617,13 +617,13 @@ cglobal h264_idct_add8_8_mmx, 5, 7, 0 %ifdef PIC lea r11, [scan8_mem] %endif -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r10, r0 %endif call h264_idct_add8_mmx_plane mov r5, 32 add r2, 384 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 add r10, gprsize %else add r0mp, gprsize @@ -637,7 +637,7 @@ h264_idct_add8_mmx2_plane movzx r6, byte [r4+r6] test r6, r6 jz .try_dc -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r0d, dword [r1+r5*4] add r0, [r10] %else @@ -656,7 +656,7 @@ h264_idct_add8_mmx2_plane test r6, r6 jz .skipblock DC_ADD_MMX2_INIT r2, r3, r6 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r0d, dword [r1+r5*4] add r0, [r10] %else @@ -677,7 +677,7 @@ h264_idct_add8_mmx2_plane cglobal h264_idct_add8_8_mmx2, 5, 7, 0 mov r5, 16 add r2, 512 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r10, r0 %endif %ifdef PIC @@ -686,7 +686,7 @@ cglobal h264_idct_add8_8_mmx2, 5, 7, 0 call h264_idct_add8_mmx2_plane mov r5, 32 add r2, 384 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 add r10, gprsize %else add r0mp, gprsize @@ -738,7 +738,7 @@ x264_add8x4_idct_sse2: test r0, r0 jz .cycle%1end mov r0d, dword [r1+%1*8] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 add r0, r10 %else add r0, r0m @@ -753,7 +753,7 @@ x264_add8x4_idct_sse2: ; ff_h264_idct_add16_sse2(uint8_t *dst, const int *block_offset, ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add16_8_sse2, 5, 5, 8 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r10, r0 %endif ; unrolling of the loop leads to an average performance gain of @@ -773,7 +773,7 @@ cglobal h264_idct_add16_8_sse2, 5, 5, 8 test r0, r0 jz .try%1dc mov r0d, dword [r1+%1*8] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 add r0, r10 %else add r0, r0m @@ -785,7 +785,7 @@ cglobal h264_idct_add16_8_sse2, 5, 5, 8 or r0w, word [r2+32] jz .cycle%1end mov r0d, dword [r1+%1*8] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 add r0, r10 %else add r0, r0m @@ -800,7 +800,7 @@ cglobal h264_idct_add16_8_sse2, 5, 5, 8 ; ff_h264_idct_add16intra_sse2(uint8_t *dst, const int *block_offset, ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add16intra_8_sse2, 5, 7, 8 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r10, r0 %endif add16intra_sse2_cycle 0, 0xc @@ -817,7 +817,7 @@ cglobal h264_idct_add16intra_8_sse2, 5, 7, 8 movzx r0, word [r4+%2] test r0, r0 jz .try%1dc -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r0d, dword [r1+(%1&1)*8+64*(1+(%1>>1))] add r0, [r10] %else @@ -831,7 +831,7 @@ cglobal h264_idct_add16intra_8_sse2, 5, 7, 8 movsx r0, word [r2 ] or r0w, word [r2+32] jz .cycle%1end -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r0d, dword [r1+(%1&1)*8+64*(1+(%1>>1))] add r0, [r10] %else @@ -852,12 +852,12 @@ cglobal h264_idct_add16intra_8_sse2, 5, 7, 8 ; DCTELEM *block, int stride, const uint8_t nnzc[6*8]) cglobal h264_idct_add8_8_sse2, 5, 7, 8 add r2, 512 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r10, r0 %endif add8_sse2_cycle 0, 0x34 add8_sse2_cycle 1, 0x3c -%ifdef ARCH_X86_64 +%if ARCH_X86_64 add r10, gprsize %else add r0mp, gprsize @@ -977,11 +977,11 @@ cglobal h264_luma_dc_dequant_idct_%1, 3,4,%2 WALSH4_1D 0,1,2,3,4 ; shift, tmp, output, qmul -%ifdef WIN64 +%if WIN64 DECLARE_REG_TMP 0,3,1,2 ; we can't avoid this, because r0 is the shift register (ecx) on win64 xchg r0, t2 -%elifdef ARCH_X86_64 +%elif ARCH_X86_64 DECLARE_REG_TMP 3,1,0,2 %else DECLARE_REG_TMP 1,3,0,2 diff --git a/libavcodec/x86/h264_idct_10bit.asm b/libavcodec/x86/h264_idct_10bit.asm index 54636a95d09e1..62a528b340f17 100644 --- a/libavcodec/x86/h264_idct_10bit.asm +++ b/libavcodec/x86/h264_idct_10bit.asm @@ -98,7 +98,7 @@ cglobal h264_idct_add_10_%1, 3,3 INIT_XMM IDCT_ADD_10 sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX IDCT_ADD_10 avx %endif @@ -128,7 +128,7 @@ add4x4_idct_%1: INIT_XMM ALIGN 16 ADD4x4IDCT sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX ALIGN 16 ADD4x4IDCT avx @@ -168,7 +168,7 @@ cglobal h264_idct_add16_10_%1, 5,6 INIT_XMM IDCT_ADD16_10 sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX IDCT_ADD16_10 avx %endif @@ -234,7 +234,7 @@ cglobal h264_idct8_dc_add_10_%1,3,3,7 INIT_XMM IDCT8_DC_ADD sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX IDCT8_DC_ADD avx %endif @@ -305,7 +305,7 @@ cglobal h264_idct_add16intra_10_%1,5,7,8 INIT_XMM IDCT_ADD16INTRA_10 sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX IDCT_ADD16INTRA_10 avx %endif @@ -316,7 +316,7 @@ IDCT_ADD16INTRA_10 avx ;----------------------------------------------------------------------------- %macro IDCT_ADD8 1 cglobal h264_idct_add8_10_%1,5,7 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r10, r0 %endif add r2, 1024 @@ -324,7 +324,7 @@ cglobal h264_idct_add8_10_%1,5,7 ADD16_OP_INTRA %1, 16, 4+ 6*8 ADD16_OP_INTRA %1, 18, 4+ 7*8 add r2, 1024-128*2 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r0, [r10+gprsize] %else mov r0, r0m @@ -342,7 +342,7 @@ cglobal h264_idct_add8_10_%1,5,7 INIT_XMM IDCT_ADD8 sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX IDCT_ADD8 avx %endif @@ -411,7 +411,7 @@ IDCT_ADD8 avx ; %1=int16_t *block, %2=int16_t *dstblock %macro IDCT8_ADD_SSE_START 2 IDCT8_1D_FULL %1 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 TRANSPOSE4x4D 0,1,2,3,8 mova [%2 ], m0 TRANSPOSE4x4D 4,5,6,7,8 @@ -452,7 +452,7 @@ IDCT_ADD8 avx %macro IDCT8_ADD 1 cglobal h264_idct8_add_10_%1, 3,4,16 -%ifndef UNIX64 +%if UNIX64 == 0 %assign pad 16-gprsize-(stack_offset&15) sub rsp, pad call h264_idct8_add1_10_%1 @@ -467,7 +467,7 @@ h264_idct8_add1_10_%1: sub rsp, pad add dword [r1], 32 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 IDCT8_ADD_SSE_START r1, rsp SWAP 1, 9 SWAP 2, 10 @@ -519,7 +519,7 @@ h264_idct8_add1_10_%1: INIT_XMM IDCT8_ADD sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX IDCT8_ADD avx %endif @@ -559,7 +559,7 @@ cglobal h264_idct8_add4_10_%1, 0,7,16 INIT_XMM IDCT8_ADD4 sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX IDCT8_ADD4 avx %endif diff --git a/libavcodec/x86/h264_intrapred.asm b/libavcodec/x86/h264_intrapred.asm index c1cd5c4d2581d..61c69c6488b30 100644 --- a/libavcodec/x86/h264_intrapred.asm +++ b/libavcodec/x86/h264_intrapred.asm @@ -348,7 +348,7 @@ cglobal pred16x16_plane_%3_%1, 2, 7, %2 lea r3, [r0+r2*4-1] add r4, r2 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define e_reg r11 %else %define e_reg r0 @@ -369,7 +369,7 @@ cglobal pred16x16_plane_%3_%1, 2, 7, %2 lea r5, [r5+r6*4] movzx e_reg, byte [r3 ] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movzx r10, byte [r4+r2 ] sub r10, e_reg %else @@ -385,7 +385,7 @@ cglobal pred16x16_plane_%3_%1, 2, 7, %2 movzx r4, byte [e_reg+r2 ] movzx r6, byte [r3 ] sub r6, r4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 lea r6, [r10+r6*2] lea r5, [r5+r6*2] add r5, r6 @@ -395,7 +395,7 @@ cglobal pred16x16_plane_%3_%1, 2, 7, %2 %endif movzx r4, byte [e_reg ] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movzx r10, byte [r3 +r2 ] sub r10, r4 sub r5, r10 @@ -409,7 +409,7 @@ cglobal pred16x16_plane_%3_%1, 2, 7, %2 movzx r4, byte [e_reg+r1 ] movzx r6, byte [r3 +r2*2] sub r6, r4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 add r6, r10 %endif lea r5, [r5+r6*8] @@ -420,7 +420,7 @@ cglobal pred16x16_plane_%3_%1, 2, 7, %2 lea r5, [r5+r6*4] add r5, r6 ; sum of V coefficients -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r0, r0m %endif @@ -641,7 +641,7 @@ cglobal pred8x8_plane_%1, 2, 7, %2 lea r3, [r0 -1] add r4, r2 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define e_reg r11 %else %define e_reg r0 @@ -652,7 +652,7 @@ cglobal pred8x8_plane_%1, 2, 7, %2 sub r5, e_reg movzx e_reg, byte [r3 ] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movzx r10, byte [r4+r2 ] sub r10, e_reg sub r5, r10 @@ -666,7 +666,7 @@ cglobal pred8x8_plane_%1, 2, 7, %2 movzx e_reg, byte [r3+r1 ] movzx r6, byte [r4+r2*2 ] sub r6, e_reg -%ifdef ARCH_X86_64 +%if ARCH_X86_64 add r6, r10 %endif lea r5, [r5+r6*4] @@ -680,7 +680,7 @@ cglobal pred8x8_plane_%1, 2, 7, %2 lea r5, [r5+r6*8] sar r5, 5 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 mov r0, r0m %endif diff --git a/libavcodec/x86/h264_intrapred_10bit.asm b/libavcodec/x86/h264_intrapred_10bit.asm index e14e31a38c157..1423b561accc6 100644 --- a/libavcodec/x86/h264_intrapred_10bit.asm +++ b/libavcodec/x86/h264_intrapred_10bit.asm @@ -84,7 +84,7 @@ INIT_XMM PRED4x4_DR sse2 %define PALIGNR PALIGNR_SSSE3 PRED4x4_DR ssse3 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED4x4_DR avx %endif @@ -124,7 +124,7 @@ INIT_XMM PRED4x4_VR sse2 %define PALIGNR PALIGNR_SSSE3 PRED4x4_VR ssse3 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED4x4_VR avx %endif @@ -167,7 +167,7 @@ INIT_XMM PRED4x4_HD sse2 %define PALIGNR PALIGNR_SSSE3 PRED4x4_HD ssse3 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED4x4_HD avx %endif @@ -238,7 +238,7 @@ cglobal pred4x4_down_left_10_%1, 3,3 INIT_XMM PRED4x4_DL sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED4x4_DL avx %endif @@ -267,7 +267,7 @@ cglobal pred4x4_vertical_left_10_%1, 3,3 INIT_XMM PRED4x4_VL sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED4x4_VL avx %endif @@ -577,7 +577,7 @@ cglobal pred8x8l_top_dc_10_%1, 4,4,6 INIT_XMM PRED8x8L_TOP_DC sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED8x8L_TOP_DC avx %endif @@ -636,7 +636,7 @@ cglobal pred8x8l_dc_10_%1, 4,6,6 INIT_XMM PRED8x8L_DC sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED8x8L_DC avx %endif @@ -671,7 +671,7 @@ cglobal pred8x8l_vertical_10_%1, 4,4,6 INIT_XMM PRED8x8L_VERTICAL sse2 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED8x8L_VERTICAL avx %endif @@ -728,7 +728,7 @@ INIT_XMM PRED8x8L_HORIZONTAL sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_HORIZONTAL ssse3 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED8x8L_HORIZONTAL avx %endif @@ -797,7 +797,7 @@ INIT_XMM PRED8x8L_DOWN_LEFT sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_DOWN_LEFT ssse3 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED8x8L_DOWN_LEFT avx %endif @@ -872,7 +872,7 @@ INIT_XMM PRED8x8L_DOWN_RIGHT sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_DOWN_RIGHT ssse3 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED8x8L_DOWN_RIGHT avx %endif @@ -943,7 +943,7 @@ INIT_XMM PRED8x8L_VERTICAL_RIGHT sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_VERTICAL_RIGHT ssse3 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED8x8L_VERTICAL_RIGHT avx %endif @@ -1005,7 +1005,7 @@ INIT_XMM PRED8x8L_HORIZONTAL_UP sse2 %define PALIGNR PALIGNR_SSSE3 PRED8x8L_HORIZONTAL_UP ssse3 -%ifdef HAVE_AVX +%if HAVE_AVX INIT_AVX PRED8x8L_HORIZONTAL_UP avx %endif diff --git a/libavcodec/x86/h264_qpel_10bit.asm b/libavcodec/x86/h264_qpel_10bit.asm index 15dd72ca3662f..51412e3977ca0 100644 --- a/libavcodec/x86/h264_qpel_10bit.asm +++ b/libavcodec/x86/h264_qpel_10bit.asm @@ -111,7 +111,7 @@ INIT_XMM %endmacro %macro MCAxA 8 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %ifnidn %1,mmxext MCAxA_OP %1,%2,%3,%4,%5,%6,%7,%8 %endif @@ -122,7 +122,7 @@ MCAxA_OP %1,%2,%3,%4,%5,%6,%7,%8 %macro MCAxA_OP 8 cglobal %2_h264_qpel%5_%3_10_%1, %6,%7,%8 -%ifdef ARCH_X86_32 +%if ARCH_X86_32 call stub_%2_h264_qpel%4_%3_10_%1 mov r0, r0m mov r1, r1m @@ -152,7 +152,7 @@ cglobal %2_h264_qpel%5_%3_10_%1, %6,%7,%8 call stub_%2_h264_qpel%4_%3_10_%1 lea r0, [r10+r2*%4+%4*2] lea r1, [r11+r2*%4+%4*2] -%ifndef UNIX64 ; fall through to function +%if UNIX64 == 0 ; fall through to function call stub_%2_h264_qpel%4_%3_10_%1 RET %endif @@ -165,7 +165,7 @@ cglobal %2_h264_qpel%5_%3_10_%1, %6,%7,%8 MCAxA %1, %2, %3, %4, i, %5,%6,%7 cglobal %2_h264_qpel%4_%3_10_%1, %5,%6,%7 -%ifndef UNIX64 ; no prologue or epilogue for UNIX64 +%if UNIX64 == 0 ; no prologue or epilogue for UNIX64 call stub_%2_h264_qpel%4_%3_10_%1 RET %endif diff --git a/libavcodec/x86/h264_weight.asm b/libavcodec/x86/h264_weight.asm index bd0d9d632c6d0..1c40e49eaa2f5 100644 --- a/libavcodec/x86/h264_weight.asm +++ b/libavcodec/x86/h264_weight.asm @@ -126,7 +126,7 @@ INIT_XMM WEIGHT_FUNC_HALF_MM 8, 8, sse2 %macro BIWEIGHT_SETUP 0 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define off_regd r11d %else %define off_regd r3d @@ -244,7 +244,7 @@ INIT_XMM BIWEIGHT_FUNC_HALF_MM 8, 8, sse2 %macro BIWEIGHT_SSSE3_SETUP 0 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define off_regd r11d %else %define off_regd r3d diff --git a/libavcodec/x86/h264_weight_10bit.asm b/libavcodec/x86/h264_weight_10bit.asm index 9c4b276e49c66..481c7cad667d1 100644 --- a/libavcodec/x86/h264_weight_10bit.asm +++ b/libavcodec/x86/h264_weight_10bit.asm @@ -152,7 +152,7 @@ WEIGHT_FUNC_HALF_MM sse4 ; void h264_biweight(uint8_t *dst, uint8_t *src, int stride, int height, ; int log2_denom, int weightd, int weights, int offset); ;----------------------------------------------------------------------------- -%ifdef ARCH_X86_32 +%if ARCH_X86_32 DECLARE_REG_TMP 3 %else DECLARE_REG_TMP 10 diff --git a/libavcodec/x86/imdct36_sse.asm b/libavcodec/x86/imdct36_sse.asm index 2908459db764e..abdd3af5b6838 100644 --- a/libavcodec/x86/imdct36_sse.asm +++ b/libavcodec/x86/imdct36_sse.asm @@ -219,13 +219,13 @@ cglobal imdct36_float, 4,4,9, out, buf, in, win subps m5, m0, m3 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 SWAP m5, m8 %endif mulps m7, m2, [ps_val1] -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mulps m5, m8, [ps_val2] %else mulps m5, m5, [ps_val2] @@ -235,7 +235,7 @@ cglobal imdct36_float, 4,4,9, out, buf, in, win mulps m5, m6, [ps_val1] subps m7, m7, m5 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 SWAP m5, m8 %else subps m5, m0, m3 @@ -376,7 +376,7 @@ DEFINE_IMDCT INIT_XMM sse -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define SPILL SWAP %define UNSPILL SWAP %define SPILLED(x) m %+ x diff --git a/libavcodec/x86/proresdsp.asm b/libavcodec/x86/proresdsp.asm index 9365bf1ea4b85..9b2e11eb5d2d9 100644 --- a/libavcodec/x86/proresdsp.asm +++ b/libavcodec/x86/proresdsp.asm @@ -32,7 +32,7 @@ %define W6sh2 8867 ; W6 = 35468 = 8867<<2 %define W7sh2 4520 ; W7 = 18081 = 4520<<2 + 1 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 SECTION_RODATA diff --git a/libavcodec/x86/vp3dsp.asm b/libavcodec/x86/vp3dsp.asm index 23574383a1253..791cc8ec355fb 100644 --- a/libavcodec/x86/vp3dsp.asm +++ b/libavcodec/x86/vp3dsp.asm @@ -106,7 +106,7 @@ SECTION .text INIT_MMX cglobal vp3_v_loop_filter_mmx2, 3, 4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r1, r1d %endif mov r3, r1 @@ -123,7 +123,7 @@ cglobal vp3_v_loop_filter_mmx2, 3, 4 RET cglobal vp3_h_loop_filter_mmx2, 3, 4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r1, r1d %endif lea r3, [r1*3] @@ -510,7 +510,7 @@ cglobal vp3_h_loop_filter_mmx2, 3, 4 %define SHIFT(x) %define ADD(x) VP3_1D_IDCT_SSE2 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, 8 %else TRANSPOSE8x8W 0, 1, 2, 3, 4, 5, 6, 7, [%1], [%1+16] @@ -530,7 +530,7 @@ cglobal vp3_idct_%1, 1, 1, %2 cglobal vp3_idct_put_%1, 3, %3, %2 VP3_IDCT_%1 r2 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r3, r2 mov r2, r1 mov r1, r0 @@ -540,7 +540,7 @@ cglobal vp3_idct_put_%1, 3, %3, %2 mov r1m, r0 mov r2m, r1 %endif -%ifdef WIN64 +%if WIN64 call put_signed_pixels_clamped_mmx RET %else @@ -549,7 +549,7 @@ cglobal vp3_idct_put_%1, 3, %3, %2 cglobal vp3_idct_add_%1, 3, %3, %2 VP3_IDCT_%1 r2 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r3, r2 mov r2, r1 mov r1, r0 @@ -559,7 +559,7 @@ cglobal vp3_idct_add_%1, 3, %3, %2 mov r1m, r0 mov r2m, r1 %endif -%ifdef WIN64 +%if WIN64 call add_pixels_clamped_mmx RET %else @@ -567,7 +567,7 @@ cglobal vp3_idct_add_%1, 3, %3, %2 %endif %endmacro -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define REGS 4 %else %define REGS 3 @@ -599,7 +599,7 @@ vp3_idct_funcs sse2, 9, REGS INIT_MMX cglobal vp3_idct_dc_add_mmx2, 3, 4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r1, r1d %endif lea r3, [r1*3] diff --git a/libavcodec/x86/vp56dsp.asm b/libavcodec/x86/vp56dsp.asm index c70ed60d762da..66a97f1593a2f 100644 --- a/libavcodec/x86/vp56dsp.asm +++ b/libavcodec/x86/vp56dsp.asm @@ -127,7 +127,7 @@ cglobal vp6_filter_diag4_%1, 5, 7, %2 sub rsp, 8*15 movq m6, [pw_64] %endif -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r2, r2d %endif diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index 6941c1ac2ff14..9bbe4461fc56a 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -35,11 +35,13 @@ %define program_name ff -%ifdef ARCH_X86_64 +%define UNIX64 0 +%define WIN64 0 +%if ARCH_X86_64 %ifidn __OUTPUT_FORMAT__,win32 - %define WIN64 + %define WIN64 1 %else - %define UNIX64 + %define UNIX64 1 %endif %endif @@ -79,9 +81,9 @@ %endif %endmacro -%ifdef WIN64 +%if WIN64 %define PIC -%elifndef ARCH_X86_64 +%elif !ARCH_X86_64 ; x86_32 doesn't require PIC. ; Some distros prefer shared objects to be PIC, but nothing breaks if ; the code contains a few textrels, so we'll skip that complexity. @@ -132,7 +134,7 @@ %define r%1m %6 %ifid %6 ; i.e. it's a register %define r%1mp %2 - %elifdef ARCH_X86_64 ; memory + %elif ARCH_X86_64 ; memory %define r%1mp qword %6 %else %define r%1mp dword %6 @@ -149,7 +151,7 @@ %define e%1w %1 %define r%1b %2 %define e%1b %2 -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 %define r%1 e%1 %endif %endmacro @@ -185,7 +187,7 @@ DECLARE_REG_SIZE bp, bpl DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 %define gprsize 8 %else %define gprsize 4 @@ -261,7 +263,7 @@ DECLARE_REG_TMP_SIZE 0,1,2,3,4,5,6,7,8,9 %assign n_arg_names %%i %endmacro -%ifdef WIN64 ; Windows x64 ;================================================= +%if WIN64 ; Windows x64 ;================================================= DECLARE_REG 0, rcx, ecx, cx, cl, ecx DECLARE_REG 1, rdx, edx, dx, dl, edx @@ -346,7 +348,7 @@ DECLARE_REG 6, rax, eax, ax, al, [rsp + stack_offset + 56] %endif %endmacro -%elifdef ARCH_X86_64 ; *nix x64 ;============================================= +%elif ARCH_X86_64 ; *nix x64 ;============================================= DECLARE_REG 0, rdi, edi, di, dil, edi DECLARE_REG 1, rsi, esi, si, sil, esi @@ -447,7 +449,7 @@ DECLARE_REG 6, ebp, ebp, bp, null, [esp + stack_offset + 28] %endif ;====================================================================== -%ifndef WIN64 +%if WIN64 == 0 %macro WIN64_SPILL_XMM 1 %endmacro %macro WIN64_RESTORE_XMM 1 @@ -617,7 +619,7 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits %define RESET_MM_PERMUTATION INIT_XMM %1 %define mmsize 16 %define num_mmregs 8 - %ifdef ARCH_X86_64 + %if ARCH_X86_64 %define num_mmregs 16 %endif %define mova movdqa @@ -646,7 +648,7 @@ SECTION .note.GNU-stack noalloc noexec nowrite progbits %define RESET_MM_PERMUTATION INIT_YMM %1 %define mmsize 32 %define num_mmregs 8 - %ifdef ARCH_X86_64 + %if ARCH_X86_64 %define num_mmregs 16 %endif %define mova vmovaps diff --git a/libavutil/x86/x86util.asm b/libavutil/x86/x86util.asm index 874443a2ef30a..a9c75645c0a0a 100644 --- a/libavutil/x86/x86util.asm +++ b/libavutil/x86/x86util.asm @@ -95,7 +95,7 @@ %endmacro %macro TRANSPOSE8x8W 9-11 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 SBUTTERFLY wd, %1, %2, %9 SBUTTERFLY wd, %3, %4, %9 SBUTTERFLY wd, %5, %6, %9 diff --git a/libswscale/x86/input.asm b/libswscale/x86/input.asm index a23cf05301128..e6dde7c875adc 100644 --- a/libswscale/x86/input.asm +++ b/libswscale/x86/input.asm @@ -64,7 +64,7 @@ SECTION .text ; split the loop in an aligned and unaligned case %macro YUYV_TO_Y_FN 2-3 cglobal %2ToY, 3, 3, %1, dst, src, w -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd wq, wd %endif add dstq, wq @@ -134,7 +134,7 @@ cglobal %2ToY, 3, 3, %1, dst, src, w ; split the loop in an aligned and unaligned case %macro YUYV_TO_UV_FN 2-3 cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd wq, dword r4m %else ; x86-32 mov wq, r4m @@ -189,7 +189,7 @@ cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w ; %2 = nv12 or nv21 %macro NVXX_TO_UV_FN 2 cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd wq, dword r4m %else ; x86-32 mov wq, r4m @@ -215,7 +215,7 @@ cglobal %2ToUV, 3, 4, %1, dstU, dstV, src, w %endif ; mmsize == 8/16 %endmacro -%ifdef ARCH_X86_32 +%if ARCH_X86_32 INIT_MMX mmx YUYV_TO_Y_FN 0, yuyv YUYV_TO_Y_FN 0, uyvy diff --git a/libswscale/x86/output.asm b/libswscale/x86/output.asm index ae2929c84ebc6..a288f088671b0 100644 --- a/libswscale/x86/output.asm +++ b/libswscale/x86/output.asm @@ -58,7 +58,7 @@ SECTION .text %macro yuv2planeX_fn 3 -%ifdef ARCH_X86_32 +%if ARCH_X86_32 %define cntr_reg r1 %define movsx mov %else @@ -72,7 +72,7 @@ cglobal yuv2planeX_%1, %3, 7, %2 %endif ; %1 == 8/9/10 %if %1 == 8 -%ifdef ARCH_X86_32 +%if ARCH_X86_32 %assign pad 0x2c - (stack_offset & 15) SUB rsp, pad %define m_dith m7 @@ -91,7 +91,7 @@ cglobal yuv2planeX_%1, %3, 7, %2 .no_rot: %if mmsize == 16 punpcklbw m_dith, m6 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 punpcklwd m8, m_dith, m6 pslld m8, 12 %else ; x86-32 @@ -100,7 +100,7 @@ cglobal yuv2planeX_%1, %3, 7, %2 %endif ; x86-32/64 punpckhwd m_dith, m6 pslld m_dith, 12 -%ifdef ARCH_X86_32 +%if ARCH_X86_32 mova [rsp+ 0], m5 mova [rsp+16], m_dith %endif @@ -135,7 +135,7 @@ cglobal yuv2planeX_%1, %3, 7, %2 %endif ; %1 == 8 %if %1 == 8 -%ifdef ARCH_X86_32 +%if ARCH_X86_32 mova m2, [rsp+mmsize*(0+%%i)] mova m1, [rsp+mmsize*(1+%%i)] %else ; x86-64 @@ -233,7 +233,7 @@ cglobal yuv2planeX_%1, %3, 7, %2 jg .pixelloop %if %1 == 8 -%ifdef ARCH_X86_32 +%if ARCH_X86_32 ADD rsp, pad RET %else ; x86-64 @@ -245,7 +245,7 @@ cglobal yuv2planeX_%1, %3, 7, %2 %endmacro %define PALIGNR PALIGNR_MMX -%ifdef ARCH_X86_32 +%if ARCH_X86_32 INIT_MMX mmx2 yuv2planeX_fn 8, 0, 7 yuv2planeX_fn 9, 0, 5 @@ -382,7 +382,7 @@ cglobal yuv2plane1_%1, %3, %3, %2 REP_RET %endmacro -%ifdef ARCH_X86_32 +%if ARCH_X86_32 INIT_MMX mmx yuv2plane1_fn 8, 0, 5 yuv2plane1_fn 16, 0, 3 diff --git a/libswscale/x86/scale.asm b/libswscale/x86/scale.asm index d35589419cf9d..0d367f7a14e60 100644 --- a/libswscale/x86/scale.asm +++ b/libswscale/x86/scale.asm @@ -51,7 +51,7 @@ SECTION .text ; SCALE_FUNC source_width, intermediate_nbits, filtersize, filtersuffix, opt, n_args, n_xmm %macro SCALE_FUNC 7 cglobal hscale%1to%2_%4_%5, %6, 7, %7 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 movsxd r2, r2d %endif ; x86-64 %if %2 == 19 @@ -237,7 +237,7 @@ cglobal hscale%1to%2_%4_%5, %6, 7, %7 %else ; %4 == X || %4 == X8 %define r6sub 0 %endif ; %4 ==/!= X4 -%ifdef ARCH_X86_64 +%if ARCH_X86_64 push r12 movsxd r6, r6d ; filterSize lea r12, [r3+(r6-r6sub)*srcmul] ; &src[filterSize&~4] @@ -384,7 +384,7 @@ cglobal hscale%1to%2_%4_%5, %6, 7, %7 %ifnidn %3, X REP_RET %else ; %3 == X -%ifdef ARCH_X86_64 +%if ARCH_X86_64 pop r12 RET %else ; x86-32 @@ -419,7 +419,7 @@ SCALE_FUNCS 10, 19, %1, %3 SCALE_FUNCS 16, 19, %1, %4 %endmacro -%ifdef ARCH_X86_32 +%if ARCH_X86_32 INIT_MMX SCALE_FUNCS2 mmx, 0, 0, 0 %endif From b5d08c27c37a40887b02728913ca1fa706a6e35c Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 27 Jan 2012 10:52:55 +0800 Subject: [PATCH 09/71] swscale: convert rgb/bgr24ToY/UV_mmx functions from inline asm to yasm. Also implement sse2/ssse3/avx versions. --- libswscale/x86/input.asm | 271 ++++++++++++++++++++++++++++++ libswscale/x86/swscale_mmx.c | 48 +++--- libswscale/x86/swscale_template.c | 159 +----------------- 3 files changed, 300 insertions(+), 178 deletions(-) diff --git a/libswscale/x86/input.asm b/libswscale/x86/input.asm index e6dde7c875adc..7404b19dc2b94 100644 --- a/libswscale/x86/input.asm +++ b/libswscale/x86/input.asm @@ -26,8 +26,279 @@ SECTION_RODATA +%define RY 0x20DE +%define GY 0x4087 +%define BY 0x0C88 +%define RU 0xECFF +%define GU 0xDAC8 +%define BU 0x3838 +%define RV 0x3838 +%define GV 0xD0E3 +%define BV 0xF6E4 + +rgb_Yrnd: times 4 dd 0x84000 ; 16.5 << 15 +rgb_UVrnd: times 4 dd 0x404000 ; 128.5 << 15 +bgr_Ycoeff_12x4: times 2 dw BY, GY, 0, BY +bgr_Ycoeff_3x56: times 2 dw RY, 0, GY, RY +rgb_Ycoeff_12x4: times 2 dw RY, GY, 0, RY +rgb_Ycoeff_3x56: times 2 dw BY, 0, GY, BY +bgr_Ucoeff_12x4: times 2 dw BU, GU, 0, BU +bgr_Ucoeff_3x56: times 2 dw RU, 0, GU, RU +rgb_Ucoeff_12x4: times 2 dw RU, GU, 0, RU +rgb_Ucoeff_3x56: times 2 dw BU, 0, GU, BU +bgr_Vcoeff_12x4: times 2 dw BV, GV, 0, BV +bgr_Vcoeff_3x56: times 2 dw RV, 0, GV, RV +rgb_Vcoeff_12x4: times 2 dw RV, GV, 0, RV +rgb_Vcoeff_3x56: times 2 dw BV, 0, GV, BV + +shuf_rgb_12x4: db 0, 0x80, 1, 0x80, 2, 0x80, 3, 0x80, \ + 6, 0x80, 7, 0x80, 8, 0x80, 9, 0x80 +shuf_rgb_3x56: db 2, 0x80, 3, 0x80, 4, 0x80, 5, 0x80, \ + 8, 0x80, 9, 0x80, 10, 0x80, 11, 0x80 + SECTION .text +;----------------------------------------------------------------------------- +; RGB to Y/UV. +; +; void ToY_(uint8_t *dst, const uint8_t *src, int w); +; and +; void toUV_(uint8_t *dstU, uint8_t *dstV, const uint8_t *src, +; const uint8_t *unused, int w); +;----------------------------------------------------------------------------- + +; %1 = nr. of XMM registers +; %2 = rgb or bgr +%macro RGB24_TO_Y_FN 2-3 +cglobal %2 %+ 24ToY, 3, 3, %1, dst, src, w +%if mmsize == 8 + mova m5, [%2_Ycoeff_12x4] + mova m6, [%2_Ycoeff_3x56] +%define coeff1 m5 +%define coeff2 m6 +%elif ARCH_X86_64 + mova m8, [%2_Ycoeff_12x4] + mova m9, [%2_Ycoeff_3x56] +%define coeff1 m8 +%define coeff2 m9 +%else ; x86-32 && mmsize == 16 +%define coeff1 [%2_Ycoeff_12x4] +%define coeff2 [%2_Ycoeff_3x56] +%endif ; x86-32/64 && mmsize == 8/16 +%if (ARCH_X86_64 || mmsize == 8) && %0 == 3 + jmp mangle(program_name %+ _ %+ %3 %+ 24ToY %+ SUFFIX).body +%else ; (ARCH_X86_64 && %0 == 3) || mmsize == 8 +.body: +%if cpuflag(ssse3) + mova m7, [shuf_rgb_12x4] +%define shuf_rgb1 m7 +%if ARCH_X86_64 + mova m10, [shuf_rgb_3x56] +%define shuf_rgb2 m10 +%else ; x86-32 +%define shuf_rgb2 [shuf_rgb_3x56] +%endif ; x86-32/64 +%endif ; cpuflag(ssse3) +%if ARCH_X86_64 + movsxd wq, wd +%endif + add dstq, wq + neg wq +%if notcpuflag(ssse3) + pxor m7, m7 +%endif ; !cpuflag(ssse3) + mova m4, [rgb_Yrnd] +.loop: +%if cpuflag(ssse3) + movu m0, [srcq+0] ; (byte) { Bx, Gx, Rx }[0-3] + movu m2, [srcq+12] ; (byte) { Bx, Gx, Rx }[4-7] + pshufb m1, m0, shuf_rgb2 ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 } + pshufb m0, shuf_rgb1 ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 } + pshufb m3, m2, shuf_rgb2 ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 } + pshufb m2, shuf_rgb1 ; (word) { B4, G4, R4, B5, B6, G6, R6, B7 } +%else ; !cpuflag(ssse3) + movd m0, [srcq+0] ; (byte) { B0, G0, R0, B1 } + movd m1, [srcq+2] ; (byte) { R0, B1, G1, R1 } + movd m2, [srcq+6] ; (byte) { B2, G2, R2, B3 } + movd m3, [srcq+8] ; (byte) { R2, B3, G3, R3 } +%if mmsize == 16 ; i.e. sse2 + punpckldq m0, m2 ; (byte) { B0, G0, R0, B1, B2, G2, R2, B3 } + punpckldq m1, m3 ; (byte) { R0, B1, G1, R1, R2, B3, G3, R3 } + movd m2, [srcq+12] ; (byte) { B4, G4, R4, B5 } + movd m3, [srcq+14] ; (byte) { R4, B5, G5, R5 } + movd m5, [srcq+18] ; (byte) { B6, G6, R6, B7 } + movd m6, [srcq+20] ; (byte) { R6, B7, G7, R7 } + punpckldq m2, m5 ; (byte) { B4, G4, R4, B5, B6, G6, R6, B7 } + punpckldq m3, m6 ; (byte) { R4, B5, G5, R5, R6, B7, G7, R7 } +%endif ; mmsize == 16 + punpcklbw m0, m7 ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 } + punpcklbw m1, m7 ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 } + punpcklbw m2, m7 ; (word) { B4, G4, R4, B5, B6, G6, R6, B7 } + punpcklbw m3, m7 ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 } +%endif ; cpuflag(ssse3) + add srcq, 3 * mmsize / 2 + pmaddwd m0, coeff1 ; (dword) { B0*BY + G0*GY, B1*BY, B2*BY + G2*GY, B3*BY } + pmaddwd m1, coeff2 ; (dword) { R0*RY, G1+GY + R1*RY, R2*RY, G3+GY + R3*RY } + pmaddwd m2, coeff1 ; (dword) { B4*BY + G4*GY, B5*BY, B6*BY + G6*GY, B7*BY } + pmaddwd m3, coeff2 ; (dword) { R4*RY, G5+GY + R5*RY, R6*RY, G7+GY + R7*RY } + paddd m0, m1 ; (dword) { Bx*BY + Gx*GY + Rx*RY }[0-3] + paddd m2, m3 ; (dword) { Bx*BY + Gx*GY + Rx*RY }[4-7] + paddd m0, m4 ; += rgb_Yrnd, i.e. (dword) { Y[0-3] } + paddd m2, m4 ; += rgb_Yrnd, i.e. (dword) { Y[4-7] } + psrad m0, 15 + psrad m2, 15 + packssdw m0, m2 ; (word) { Y[0-7] } + packuswb m0, m0 ; (byte) { Y[0-7] } + movh [dstq+wq], m0 + add wq, mmsize / 2 + jl .loop + REP_RET +%endif ; (ARCH_X86_64 && %0 == 3) || mmsize == 8 +%endmacro + +; %1 = nr. of XMM registers +; %2 = rgb or bgr +%macro RGB24_TO_UV_FN 2-3 +cglobal %2 %+ 24ToUV, 3, 4, %1, dstU, dstV, src, w +%if ARCH_X86_64 + mova m8, [%2_Ucoeff_12x4] + mova m9, [%2_Ucoeff_3x56] + mova m10, [%2_Vcoeff_12x4] + mova m11, [%2_Vcoeff_3x56] +%define coeffU1 m8 +%define coeffU2 m9 +%define coeffV1 m10 +%define coeffV2 m11 +%else ; x86-32 +%define coeffU1 [%2_Ucoeff_12x4] +%define coeffU2 [%2_Ucoeff_3x56] +%define coeffV1 [%2_Vcoeff_12x4] +%define coeffV2 [%2_Vcoeff_3x56] +%endif ; x86-32/64 +%if ARCH_X86_64 && %0 == 3 + jmp mangle(program_name %+ _ %+ %3 %+ 24ToUV %+ SUFFIX).body +%else ; ARCH_X86_64 && %0 == 3 +.body: +%if cpuflag(ssse3) + mova m7, [shuf_rgb_12x4] +%define shuf_rgb1 m7 +%if ARCH_X86_64 + mova m12, [shuf_rgb_3x56] +%define shuf_rgb2 m12 +%else ; x86-32 +%define shuf_rgb2 [shuf_rgb_3x56] +%endif ; x86-32/64 +%endif ; cpuflag(ssse3) +%if ARCH_X86_64 + movsxd wq, dword r4m +%else ; x86-32 + mov wq, r4m +%endif + add dstUq, wq + add dstVq, wq + neg wq + mova m6, [rgb_UVrnd] +%if notcpuflag(ssse3) + pxor m7, m7 +%endif +.loop: +%if cpuflag(ssse3) + movu m0, [srcq+0] ; (byte) { Bx, Gx, Rx }[0-3] + movu m4, [srcq+12] ; (byte) { Bx, Gx, Rx }[4-7] + pshufb m1, m0, shuf_rgb2 ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 } + pshufb m0, shuf_rgb1 ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 } +%else ; !cpuflag(ssse3) + movd m0, [srcq+0] ; (byte) { B0, G0, R0, B1 } + movd m1, [srcq+2] ; (byte) { R0, B1, G1, R1 } + movd m4, [srcq+6] ; (byte) { B2, G2, R2, B3 } + movd m5, [srcq+8] ; (byte) { R2, B3, G3, R3 } +%if mmsize == 16 + punpckldq m0, m4 ; (byte) { B0, G0, R0, B1, B2, G2, R2, B3 } + punpckldq m1, m5 ; (byte) { R0, B1, G1, R1, R2, B3, G3, R3 } + movd m4, [srcq+12] ; (byte) { B4, G4, R4, B5 } + movd m5, [srcq+14] ; (byte) { R4, B5, G5, R5 } +%endif ; mmsize == 16 + punpcklbw m0, m7 ; (word) { B0, G0, R0, B1, B2, G2, R2, B3 } + punpcklbw m1, m7 ; (word) { R0, B1, G1, R1, R2, B3, G3, R3 } +%endif ; cpuflag(ssse3) + pmaddwd m2, m0, coeffV1 ; (dword) { B0*BV + G0*GV, B1*BV, B2*BV + G2*GV, B3*BV } + pmaddwd m3, m1, coeffV2 ; (dword) { R0*BV, G1*GV + R1*BV, R2*BV, G3*GV + R3*BV } + pmaddwd m0, coeffU1 ; (dword) { B0*BU + G0*GU, B1*BU, B2*BU + G2*GU, B3*BU } + pmaddwd m1, coeffU2 ; (dword) { R0*BU, G1*GU + R1*BU, R2*BU, G3*GU + R3*BU } + paddd m0, m1 ; (dword) { Bx*BU + Gx*GU + Rx*RU }[0-3] + paddd m2, m3 ; (dword) { Bx*BV + Gx*GV + Rx*RV }[0-3] +%if cpuflag(ssse3) + pshufb m5, m4, shuf_rgb2 ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 } + pshufb m4, shuf_rgb1 ; (word) { B4, G4, R4, B5, B6, G6, R6, B7 } +%else ; !cpuflag(ssse3) +%if mmsize == 16 + movd m1, [srcq+18] ; (byte) { B6, G6, R6, B7 } + movd m3, [srcq+20] ; (byte) { R6, B7, G7, R7 } + punpckldq m4, m1 ; (byte) { B4, G4, R4, B5, B6, G6, R6, B7 } + punpckldq m5, m3 ; (byte) { R4, B5, G5, R5, R6, B7, G7, R7 } +%endif ; mmsize == 16 && !cpuflag(ssse3) + punpcklbw m4, m7 ; (word) { B4, G4, R4, B5, B6, G6, R6, B7 } + punpcklbw m5, m7 ; (word) { R4, B5, G5, R5, R6, B7, G7, R7 } +%endif ; cpuflag(ssse3) + add srcq, 3 * mmsize / 2 + pmaddwd m1, m4, coeffU1 ; (dword) { B4*BU + G4*GU, B5*BU, B6*BU + G6*GU, B7*BU } + pmaddwd m3, m5, coeffU2 ; (dword) { R4*BU, G5*GU + R5*BU, R6*BU, G7*GU + R7*BU } + pmaddwd m4, coeffV1 ; (dword) { B4*BV + G4*GV, B5*BV, B6*BV + G6*GV, B7*BV } + pmaddwd m5, coeffV2 ; (dword) { R4*BV, G5*GV + R5*BV, R6*BV, G7*GV + R7*BV } + paddd m1, m3 ; (dword) { Bx*BU + Gx*GU + Rx*RU }[4-7] + paddd m4, m5 ; (dword) { Bx*BV + Gx*GV + Rx*RV }[4-7] + paddd m0, m6 ; += rgb_UVrnd, i.e. (dword) { U[0-3] } + paddd m2, m6 ; += rgb_UVrnd, i.e. (dword) { V[0-3] } + paddd m1, m6 ; += rgb_UVrnd, i.e. (dword) { U[4-7] } + paddd m4, m6 ; += rgb_UVrnd, i.e. (dword) { V[4-7] } + psrad m0, 15 + psrad m2, 15 + psrad m1, 15 + psrad m4, 15 + packssdw m0, m1 ; (word) { U[0-7] } + packssdw m2, m4 ; (word) { V[0-7] } +%if mmsize == 8 + packuswb m0, m0 ; (byte) { U[0-3] } + packuswb m2, m2 ; (byte) { V[0-3] } + movh [dstUq+wq], m0 + movh [dstVq+wq], m2 +%else ; mmsize == 16 + packuswb m0, m2 ; (byte) { U[0-7], V[0-7] } + movh [dstUq+wq], m0 + movhps [dstVq+wq], m0 +%endif ; mmsize == 8/16 + add wq, mmsize / 2 + jl .loop + REP_RET +%endif ; ARCH_X86_64 && %0 == 3 +%endmacro + +%if ARCH_X86_32 +INIT_MMX mmx +RGB24_TO_Y_FN 0, rgb +RGB24_TO_Y_FN 0, bgr, rgb +RGB24_TO_UV_FN 0, rgb +RGB24_TO_UV_FN 0, bgr, rgb +%endif + +INIT_XMM sse2 +RGB24_TO_Y_FN 10, rgb +RGB24_TO_Y_FN 10, bgr, rgb +RGB24_TO_UV_FN 12, rgb +RGB24_TO_UV_FN 12, bgr, rgb + +INIT_XMM ssse3 +RGB24_TO_Y_FN 11, rgb +RGB24_TO_Y_FN 11, bgr, rgb +RGB24_TO_UV_FN 13, rgb +RGB24_TO_UV_FN 13, bgr, rgb + +INIT_XMM avx +RGB24_TO_Y_FN 11, rgb +RGB24_TO_Y_FN 11, bgr, rgb +RGB24_TO_UV_FN 13, rgb +RGB24_TO_UV_FN 13, bgr, rgb + ;----------------------------------------------------------------------------- ; YUYV/UYVY/NV12/NV21 packed pixel shuffling. ; diff --git a/libswscale/x86/swscale_mmx.c b/libswscale/x86/swscale_mmx.c index 867a9f124452d..bd7664094e985 100644 --- a/libswscale/x86/swscale_mmx.c +++ b/libswscale/x86/swscale_mmx.c @@ -31,10 +31,6 @@ DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL; DECLARE_ASM_CONST(8, uint64_t, bFC)= 0xFCFCFCFCFCFCFCFCLL; DECLARE_ASM_CONST(8, uint64_t, w10)= 0x0010001000100010LL; DECLARE_ASM_CONST(8, uint64_t, w02)= 0x0002000200020002LL; -DECLARE_ASM_CONST(8, uint64_t, bm00001111)=0x00000000FFFFFFFFLL; -DECLARE_ASM_CONST(8, uint64_t, bm00000111)=0x0000000000FFFFFFLL; -DECLARE_ASM_CONST(8, uint64_t, bm11111000)=0xFFFFFFFFFF000000LL; -DECLARE_ASM_CONST(8, uint64_t, bm01010101)=0x00FF00FF00FF00FFLL; const DECLARE_ALIGNED(8, uint64_t, ff_dither4)[2] = { 0x0103010301030103LL, @@ -68,19 +64,6 @@ DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YOffset) = 0x1010101010101010ULL; DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL; DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL; -DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY1Coeff) = 0x0C88000040870C88ULL; -DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toY2Coeff) = 0x20DE4087000020DEULL; -DECLARE_ASM_CONST(8, uint64_t, ff_rgb24toY1Coeff) = 0x20DE0000408720DEULL; -DECLARE_ASM_CONST(8, uint64_t, ff_rgb24toY2Coeff) = 0x0C88408700000C88ULL; -DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toYOffset) = 0x0008400000084000ULL; - -DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUV)[2][4] = { - {0x38380000DAC83838ULL, 0xECFFDAC80000ECFFULL, 0xF6E40000D0E3F6E4ULL, 0x3838D0E300003838ULL}, - {0xECFF0000DAC8ECFFULL, 0x3838DAC800003838ULL, 0x38380000D0E33838ULL, 0xF6E4D0E30000F6E4ULL}, -}; - -DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUVOffset)= 0x0040400000404000ULL; - //MMX versions #if HAVE_MMX #undef RENAME @@ -244,24 +227,29 @@ VSCALE_FUNCS(sse2, sse2); VSCALE_FUNC(16, sse4); VSCALE_FUNCS(avx, avx); +#define INPUT_Y_FUNC(fmt, opt) \ +extern void ff_ ## fmt ## ToY_ ## opt(uint8_t *dst, const uint8_t *src, \ + int w, uint32_t *unused) #define INPUT_UV_FUNC(fmt, opt) \ extern void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \ const uint8_t *src, const uint8_t *unused1, \ int w, uint32_t *unused2) #define INPUT_FUNC(fmt, opt) \ -extern void ff_ ## fmt ## ToY_ ## opt(uint8_t *dst, const uint8_t *src, \ - int w, uint32_t *unused); \ + INPUT_Y_FUNC(fmt, opt); \ INPUT_UV_FUNC(fmt, opt) #define INPUT_FUNCS(opt) \ INPUT_FUNC(uyvy, opt); \ INPUT_FUNC(yuyv, opt); \ INPUT_UV_FUNC(nv12, opt); \ - INPUT_UV_FUNC(nv21, opt) + INPUT_UV_FUNC(nv21, opt); \ + INPUT_FUNC(rgb24, opt); \ + INPUT_FUNC(bgr24, opt) #if ARCH_X86_32 INPUT_FUNCS(mmx); #endif INPUT_FUNCS(sse2); +INPUT_FUNCS(ssse3); INPUT_FUNCS(avx); void ff_sws_init_swScale_mmx(SwsContext *c) @@ -311,6 +299,12 @@ switch(c->dstBpc){ \ case 9: if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_9_ ## opt2; break; \ default: vscalefn = ff_yuv2plane1_8_ ## opt1; break; \ } +#define case_rgb(x, X, opt) \ + case PIX_FMT_ ## X: \ + c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \ + if (!c->chrSrcHSubSample) \ + c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \ + break #if ARCH_X86_32 if (cpu_flags & AV_CPU_FLAG_MMX) { ASSIGN_MMX_SCALE_FUNC(c->hyScale, c->hLumFilterSize, mmx, mmx); @@ -337,6 +331,8 @@ switch(c->dstBpc){ \ case PIX_FMT_NV21: c->chrToYV12 = ff_nv21ToUV_mmx; break; + case_rgb(rgb24, RGB24, mmx); + case_rgb(bgr24, BGR24, mmx); default: break; } @@ -379,11 +375,21 @@ switch(c->dstBpc){ \ case PIX_FMT_NV21: c->chrToYV12 = ff_nv21ToUV_sse2; break; + case_rgb(rgb24, RGB24, sse2); + case_rgb(bgr24, BGR24, sse2); + default: + break; } } if (cpu_flags & AV_CPU_FLAG_SSSE3) { ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, ssse3, ssse3); ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, ssse3, ssse3); + switch (c->srcFormat) { + case_rgb(rgb24, RGB24, ssse3); + case_rgb(bgr24, BGR24, ssse3); + default: + break; + } } if (cpu_flags & AV_CPU_FLAG_SSE4) { /* Xto15 don't need special sse4 functions */ @@ -412,6 +418,8 @@ switch(c->dstBpc){ \ case PIX_FMT_NV21: c->chrToYV12 = ff_nv21ToUV_avx; break; + case_rgb(rgb24, RGB24, avx); + case_rgb(bgr24, BGR24, avx); default: break; } diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c index e38f58b5d0939..ea2e83750ec0a 100644 --- a/libswscale/x86/swscale_template.c +++ b/libswscale/x86/swscale_template.c @@ -1361,148 +1361,6 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0, } } -static av_always_inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, - int width, enum PixelFormat srcFormat) -{ - - if(srcFormat == PIX_FMT_BGR24) { - __asm__ volatile( - "movq "MANGLE(ff_bgr24toY1Coeff)", %%mm5 \n\t" - "movq "MANGLE(ff_bgr24toY2Coeff)", %%mm6 \n\t" - : - ); - } else { - __asm__ volatile( - "movq "MANGLE(ff_rgb24toY1Coeff)", %%mm5 \n\t" - "movq "MANGLE(ff_rgb24toY2Coeff)", %%mm6 \n\t" - : - ); - } - - __asm__ volatile( - "movq "MANGLE(ff_bgr24toYOffset)", %%mm4 \n\t" - "mov %2, %%"REG_a" \n\t" - "pxor %%mm7, %%mm7 \n\t" - "1: \n\t" - PREFETCH" 64(%0) \n\t" - "movd (%0), %%mm0 \n\t" - "movd 2(%0), %%mm1 \n\t" - "movd 6(%0), %%mm2 \n\t" - "movd 8(%0), %%mm3 \n\t" - "add $12, %0 \n\t" - "punpcklbw %%mm7, %%mm0 \n\t" - "punpcklbw %%mm7, %%mm1 \n\t" - "punpcklbw %%mm7, %%mm2 \n\t" - "punpcklbw %%mm7, %%mm3 \n\t" - "pmaddwd %%mm5, %%mm0 \n\t" - "pmaddwd %%mm6, %%mm1 \n\t" - "pmaddwd %%mm5, %%mm2 \n\t" - "pmaddwd %%mm6, %%mm3 \n\t" - "paddd %%mm1, %%mm0 \n\t" - "paddd %%mm3, %%mm2 \n\t" - "paddd %%mm4, %%mm0 \n\t" - "paddd %%mm4, %%mm2 \n\t" - "psrad $15, %%mm0 \n\t" - "psrad $15, %%mm2 \n\t" - "packssdw %%mm2, %%mm0 \n\t" - "packuswb %%mm0, %%mm0 \n\t" - "movd %%mm0, (%1, %%"REG_a") \n\t" - "add $4, %%"REG_a" \n\t" - " js 1b \n\t" - : "+r" (src) - : "r" (dst+width), "g" ((x86_reg)-width) - : "%"REG_a - ); -} - -static void RENAME(bgr24ToY)(uint8_t *dst, const uint8_t *src, - int width, uint32_t *unused) -{ - RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_BGR24); -} - -static void RENAME(rgb24ToY)(uint8_t *dst, const uint8_t *src, - int width, uint32_t *unused) -{ - RENAME(bgr24ToY_mmx)(dst, src, width, PIX_FMT_RGB24); -} - -static av_always_inline void RENAME(bgr24ToUV_mmx)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *src, int width, - enum PixelFormat srcFormat) -{ - __asm__ volatile( - "movq 24(%4), %%mm6 \n\t" - "mov %3, %%"REG_a" \n\t" - "pxor %%mm7, %%mm7 \n\t" - "1: \n\t" - PREFETCH" 64(%0) \n\t" - "movd (%0), %%mm0 \n\t" - "movd 2(%0), %%mm1 \n\t" - "punpcklbw %%mm7, %%mm0 \n\t" - "punpcklbw %%mm7, %%mm1 \n\t" - "movq %%mm0, %%mm2 \n\t" - "movq %%mm1, %%mm3 \n\t" - "pmaddwd (%4), %%mm0 \n\t" - "pmaddwd 8(%4), %%mm1 \n\t" - "pmaddwd 16(%4), %%mm2 \n\t" - "pmaddwd %%mm6, %%mm3 \n\t" - "paddd %%mm1, %%mm0 \n\t" - "paddd %%mm3, %%mm2 \n\t" - - "movd 6(%0), %%mm1 \n\t" - "movd 8(%0), %%mm3 \n\t" - "add $12, %0 \n\t" - "punpcklbw %%mm7, %%mm1 \n\t" - "punpcklbw %%mm7, %%mm3 \n\t" - "movq %%mm1, %%mm4 \n\t" - "movq %%mm3, %%mm5 \n\t" - "pmaddwd (%4), %%mm1 \n\t" - "pmaddwd 8(%4), %%mm3 \n\t" - "pmaddwd 16(%4), %%mm4 \n\t" - "pmaddwd %%mm6, %%mm5 \n\t" - "paddd %%mm3, %%mm1 \n\t" - "paddd %%mm5, %%mm4 \n\t" - - "movq "MANGLE(ff_bgr24toUVOffset)", %%mm3 \n\t" - "paddd %%mm3, %%mm0 \n\t" - "paddd %%mm3, %%mm2 \n\t" - "paddd %%mm3, %%mm1 \n\t" - "paddd %%mm3, %%mm4 \n\t" - "psrad $15, %%mm0 \n\t" - "psrad $15, %%mm2 \n\t" - "psrad $15, %%mm1 \n\t" - "psrad $15, %%mm4 \n\t" - "packssdw %%mm1, %%mm0 \n\t" - "packssdw %%mm4, %%mm2 \n\t" - "packuswb %%mm0, %%mm0 \n\t" - "packuswb %%mm2, %%mm2 \n\t" - "movd %%mm0, (%1, %%"REG_a") \n\t" - "movd %%mm2, (%2, %%"REG_a") \n\t" - "add $4, %%"REG_a" \n\t" - " js 1b \n\t" - : "+r" (src) - : "r" (dstU+width), "r" (dstV+width), "g" ((x86_reg)-width), "r"(ff_bgr24toUV[srcFormat == PIX_FMT_RGB24]) - : "%"REG_a - ); -} - -static void RENAME(bgr24ToUV)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) -{ - RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_BGR24); - assert(src1 == src2); -} - -static void RENAME(rgb24ToUV)(uint8_t *dstU, uint8_t *dstV, - const uint8_t *src1, const uint8_t *src2, - int width, uint32_t *unused) -{ - assert(src1==src2); - RENAME(bgr24ToUV_mmx)(dstU, dstV, src1, width, PIX_FMT_RGB24); -} - #if COMPILE_TEMPLATE_MMX2 static void RENAME(hyscale_fast)(SwsContext *c, int16_t *dst, int dstWidth, const uint8_t *src, @@ -1689,8 +1547,7 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, static av_cold void RENAME(sws_init_swScale)(SwsContext *c) { - enum PixelFormat srcFormat = c->srcFormat, - dstFormat = c->dstFormat; + enum PixelFormat dstFormat = c->dstFormat; if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21) { @@ -1762,18 +1619,4 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) } #endif /* COMPILE_TEMPLATE_MMX2 */ } - - if (!c->chrSrcHSubSample) { - switch(srcFormat) { - case PIX_FMT_BGR24 : c->chrToYV12 = RENAME(bgr24ToUV); break; - case PIX_FMT_RGB24 : c->chrToYV12 = RENAME(rgb24ToUV); break; - default: break; - } - } - - switch (srcFormat) { - case PIX_FMT_BGR24 : c->lumToYV12 = RENAME(bgr24ToY); break; - case PIX_FMT_RGB24 : c->lumToYV12 = RENAME(rgb24ToY); break; - default: break; - } } From 412b248edb43d435e31d7502e49b9ba9cad50b2d Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Fri, 27 Jan 2012 10:50:12 +0800 Subject: [PATCH 10/71] x86inc.asm: fix typo. Assemblers don't understand ! in %if statements. --- libavutil/x86/x86inc.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm index 9bbe4461fc56a..06a1c9fd7eb16 100644 --- a/libavutil/x86/x86inc.asm +++ b/libavutil/x86/x86inc.asm @@ -83,7 +83,7 @@ %if WIN64 %define PIC -%elif !ARCH_X86_64 +%elif ARCH_X86_64 == 0 ; x86_32 doesn't require PIC. ; Some distros prefer shared objects to be PIC, but nothing breaks if ; the code contains a few textrels, so we'll skip that complexity. From 570f6aaab12e2bcf6605e9e3a5e1204b3cfccfc1 Mon Sep 17 00:00:00 2001 From: Alexandra Khirnova Date: Fri, 27 Jan 2012 08:59:00 +0000 Subject: [PATCH 11/71] cmdutils: fix options starting with 'no'. E.g. non_linear_quant mpeg2video private option. Signed-off-by: Anton Khirnov --- cmdutils.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmdutils.c b/cmdutils.c index 0a87deedbbfd4..e8f1732416b10 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -233,14 +233,12 @@ int parse_option(void *optctx, const char *opt, const char *arg, if (!po->name && opt[0] == 'n' && opt[1] == 'o') { /* handle 'no' bool option */ po = find_option(options, opt + 2); - if (!(po->name && (po->flags & OPT_BOOL))) - goto unknown_opt; - bool_val = 0; + if ((po->name && (po->flags & OPT_BOOL))) + bool_val = 0; } if (!po->name) po = find_option(options, "default"); if (!po->name) { -unknown_opt: av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt); return AVERROR(EINVAL); } From 7063b6eaee5b10afc3e3157e10e4be0c04537107 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 11:17:23 +0100 Subject: [PATCH 12/71] lavc: increase major version to 54. The lavf-ffm test results change because ffmenc writes AVCodecContext.flags/flags2 and the defaults for those change. --- doc/APIchanges | 2 +- libavcodec/version.h | 4 ++-- tests/ref/lavf/ffm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index aa5729196e1ac..706acfb0099e5 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,7 +2,7 @@ Never assume the API of libav* to be stable unless at least 1 month has passed since the last major version increase. The last version increases were: -libavcodec: 2011-04-18 +libavcodec: 2012-01-27 libavdevice: 2011-04-18 libavfilter: 2011-04-18 libavformat: 2011-04-18 diff --git a/libavcodec/version.h b/libavcodec/version.h index 95d0baa6121ef..5042f4dc54552 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -20,8 +20,8 @@ #ifndef AVCODEC_VERSION_H #define AVCODEC_VERSION_H -#define LIBAVCODEC_VERSION_MAJOR 53 -#define LIBAVCODEC_VERSION_MINOR 36 +#define LIBAVCODEC_VERSION_MAJOR 54 +#define LIBAVCODEC_VERSION_MINOR 0 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ diff --git a/tests/ref/lavf/ffm b/tests/ref/lavf/ffm index cdfec4d1fb03f..73e94ddfd6d4a 100644 --- a/tests/ref/lavf/ffm +++ b/tests/ref/lavf/ffm @@ -1,3 +1,3 @@ -bf46c0b53fc318d0a60fa9bf446b2e4f *./tests/data/lavf/lavf.ffm +4ef091d638bb20b8eaef5b3a0d6f97b7 *./tests/data/lavf/lavf.ffm 376832 ./tests/data/lavf/lavf.ffm ./tests/data/lavf/lavf.ffm CRC=0xf361ed74 From 7773161b8f4993a83a66cc465d0024c92ceb4fb6 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 12:49:31 +0100 Subject: [PATCH 13/71] codec-regression: use private options instead of deprecated codec flags. --- tests/codec-regression.sh | 14 +++++++------- tests/lavf-regression.sh | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/codec-regression.sh b/tests/codec-regression.sh index 5fd90f51d589e..faa61e65fb11b 100755 --- a/tests/codec-regression.sh +++ b/tests/codec-regression.sh @@ -38,13 +38,13 @@ fi if [ -n "$do_mpeg2_ivlc_qprd" ]; then # mpeg2 encoding intra vlc qprd -do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -trellis 1 -flags +qprd+mv0 -flags2 +ivlc -cmp 2 -subcmp 2 -mbd rd -vcodec mpeg2video -f mpeg2video" +do_video_encoding mpeg2ivlc-qprd.mpg "-vb 500k -bf 2 -trellis 1 -flags +qprd+mv0 -intra_vlc 1 -cmp 2 -subcmp 2 -mbd rd -vcodec mpeg2video -f mpeg2video" do_video_decoding fi if [ -n "$do_mpeg2_422" ]; then #mpeg2 4:2:2 encoding -do_video_encoding mpeg2_422.mpg "-vb 1000k -bf 2 -trellis 1 -flags +qprd+mv0+ildct+ilme -flags2 +ivlc -mbd rd -vcodec mpeg2video -pix_fmt yuv422p -f mpeg2video" +do_video_encoding mpeg2_422.mpg "-vb 1000k -bf 2 -trellis 1 -flags +qprd+mv0+ildct+ilme -intra_vlc 1 -mbd rd -vcodec mpeg2video -pix_fmt yuv422p -f mpeg2video" do_video_decoding fi @@ -68,7 +68,7 @@ fi if [ -n "$do_mpeg2thread_ilace" ]; then # mpeg2 encoding interlaced using intra vlc -do_video_encoding mpeg2threadivlc.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -flags2 +ivlc -threads 2 -slices 2" +do_video_encoding mpeg2threadivlc.mpg "-qscale 10 -vcodec mpeg2video -f mpeg1video -bf 2 -flags +ildct+ilme -intra_vlc 1 -threads 2 -slices 2" do_video_decoding fi @@ -103,7 +103,7 @@ do_video_decoding fi if [ -n "$do_h263p" ] ; then -do_video_encoding h263p.avi "-qscale 2 -flags +umv+aiv+aic -s 352x288 -an -vcodec h263p -ps 300" +do_video_encoding h263p.avi "-qscale 2 -flags +aic -umv 1 -aiv 1 -s 352x288 -an -vcodec h263p -ps 300" do_video_decoding fi @@ -123,7 +123,7 @@ do_video_decoding fi if [ -n "$do_mpeg4adv" ] ; then -do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -an -vcodec mpeg4" +do_video_encoding mpeg4-adv.avi "-qscale 9 -flags +mv4+aic -data_partitioning 1 -trellis 1 -mbd bits -ps 200 -an -vcodec mpeg4" do_video_decoding fi @@ -143,12 +143,12 @@ do_video_decoding fi if [ -n "$do_mpeg4thread" ] ; then -do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+part+aic -trellis 1 -mbd bits -ps 200 -bf 2 -an -vcodec mpeg4 -threads 2 -slices 2" +do_video_encoding mpeg4-thread.avi "-b 500k -flags +mv4+aic -data_partitioning 1 -trellis 1 -mbd bits -ps 200 -bf 2 -an -vcodec mpeg4 -threads 2 -slices 2" do_video_decoding fi if [ -n "$do_error" ] ; then -do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+part+aic -mbd rd -ps 250 -error 10 -an -vcodec mpeg4" +do_video_encoding error-mpeg4-adv.avi "-qscale 7 -flags +mv4+aic -data_partitioning 1 -mbd rd -ps 250 -error 10 -an -vcodec mpeg4" do_video_decoding fi diff --git a/tests/lavf-regression.sh b/tests/lavf-regression.sh index db240b6a7190e..75029edcfd1db 100755 --- a/tests/lavf-regression.sh +++ b/tests/lavf-regression.sh @@ -67,7 +67,7 @@ do_lavf mxf "-ar 48000 -bf 2 -timecode_frame_start 264363" fi if [ -n "$do_mxf_d10" ]; then -do_lavf mxf_d10 "-ar 48000 -ac 2 -r 25 -s 720x576 -vf pad=720:608:0:32 -vcodec mpeg2video -g 0 -flags +ildct+low_delay -dc 10 -flags2 +ivlc+non_linear_q -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10" +do_lavf mxf_d10 "-ar 48000 -ac 2 -r 25 -s 720x576 -vf pad=720:608:0:32 -vcodec mpeg2video -g 0 -flags +ildct+low_delay -dc 10 -non_linear_quant 1 -intra_vlc 1 -qscale 1 -ps 1 -qmin 1 -rc_max_vbv_use 1 -rc_min_vbv_use 1 -pix_fmt yuv422p -minrate 30000k -maxrate 30000k -b 30000k -bufsize 1200000 -top 1 -rc_init_occupancy 1200000 -qmax 12 -f mxf_d10" fi if [ -n "$do_ts" ] ; then From 041cd5a0c55e02dd3b9a2419644b03103819c3d3 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:47:48 +0100 Subject: [PATCH 14/71] lavc: remove the deprecated "ab" option. --- libavcodec/options.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/options.c b/libavcodec/options.c index 2689d32a92724..f8a499cebe2a0 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -76,7 +76,6 @@ static const AVClass *codec_child_class_next(const AVClass *prev) static const AVOption options[]={ {"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE }, INT_MIN, INT_MAX, V|A|E}, -{"ab", "this option is deprecated, use b", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE }, INT_MIN, INT_MAX, A|E}, {"bt", "set video bitrate tolerance (in bits/s)", OFFSET(bit_rate_tolerance), AV_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE*20 }, 1, INT_MAX, V|E}, {"flags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, UINT_MAX, V|A|E|D, "flags"}, {"mv4", "use four motion vector by macroblock (mpeg4)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, "flags"}, From 7460398b8944bc7d3554b4cfa6cfd8f43a6e132f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:48:52 +0100 Subject: [PATCH 15/71] lavc: remove the deprecated opt.h header. --- libavcodec/Makefile | 2 +- libavcodec/opt.h | 34 ---------------------------------- libavcodec/version.h | 3 --- 3 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 libavcodec/opt.h diff --git a/libavcodec/Makefile b/libavcodec/Makefile index fbb8112eea851..ef2aa9626f326 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -1,7 +1,7 @@ NAME = avcodec FFLIBS = avutil -HEADERS = avcodec.h avfft.h dxva2.h opt.h vaapi.h vda.h vdpau.h version.h xvmc.h +HEADERS = avcodec.h avfft.h dxva2.h vaapi.h vda.h vdpau.h version.h xvmc.h OBJS = allcodecs.o \ audioconvert.o \ diff --git a/libavcodec/opt.h b/libavcodec/opt.h deleted file mode 100644 index 2380e74332c28..0000000000000 --- a/libavcodec/opt.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * This file is part of Libav. - * - * Libav 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, - * 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 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * @file - * This header is provided for compatibility only and will be removed - * on next major bump - */ - -#ifndef AVCODEC_OPT_H -#define AVCODEC_OPT_H - -#include "libavcodec/version.h" - -#if FF_API_OPT_H -#include "libavutil/opt.h" -#endif - -#endif /* AVCODEC_OPT_H */ diff --git a/libavcodec/version.h b/libavcodec/version.h index 5042f4dc54552..e36cba88dad86 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -53,9 +53,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_OPT_H -#define FF_API_OPT_H (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_THREAD_INIT #define FF_API_THREAD_INIT (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 7232bfbd9345e12fe31b2cf0b4a813f4fb0961ab Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 16/71] lavc: remove disabled FF_API_X264_GLOBAL_OPTS cruft. --- libavcodec/avcodec.h | 147 ------------------------------------------- libavcodec/libx264.c | 61 ------------------ libavcodec/libxavs.c | 36 ----------- libavcodec/options.c | 51 +-------------- libavcodec/version.h | 3 - 5 files changed, 1 insertion(+), 297 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 1c2766316e3e4..3e38d3acf288f 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -682,19 +682,6 @@ typedef struct RcOverride{ #if FF_API_MJPEG_GLOBAL_OPTS #define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG). #endif -#if FF_API_X264_GLOBAL_OPTS -#define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow B-frames to be used as references. -#define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames -#define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock -#define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform -#define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip -#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters -#define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization -#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only) -#define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations. -#define CODEC_FLAG2_SSIM 0x00100000 ///< Compute SSIM during encoding, error[] values are undefined. -#define CODEC_FLAG2_INTRA_REFRESH 0x00200000 ///< Use periodic insertion of intra blocks instead of keyframes. -#endif #if FF_API_SNOW_GLOBAL_OPTS #define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC). #endif @@ -2636,24 +2623,6 @@ typedef struct AVCodecContext { */ int brd_scale; -#if FF_API_X264_GLOBAL_OPTS - /** - * constant rate factor - quality-based VBR - values ~correspond to qps - * - encoding: Set by user. - * - decoding: unused - * @deprecated use 'crf' libx264 private option - */ - attribute_deprecated float crf; - - /** - * constant quantization parameter rate control method - * - encoding: Set by user. - * - decoding: unused - * @deprecated use 'cqp' libx264 private option - */ - attribute_deprecated int cqp; -#endif - /** * minimum GOP size * - encoding: Set by user. @@ -2675,15 +2644,6 @@ typedef struct AVCodecContext { */ int chromaoffset; -#if FF_API_X264_GLOBAL_OPTS - /** - * Influence how often B-frames are used. - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int bframebias; -#endif - /** * trellis RD quantization * - encoding: Set by user. @@ -2691,50 +2651,6 @@ typedef struct AVCodecContext { */ int trellis; -#if FF_API_X264_GLOBAL_OPTS - /** - * Reduce fluctuations in qp (before curve compression). - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated float complexityblur; - - /** - * in-loop deblocking filter alphac0 parameter - * alpha is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int deblockalpha; - - /** - * in-loop deblocking filter beta parameter - * beta is in the range -6...6 - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int deblockbeta; - - /** - * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int partitions; -#define X264_PART_I4X4 0x001 /* Analyze i4x4 */ -#define X264_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */ -#define X264_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */ -#define X264_PART_P4X4 0x020 /* Analyze p8x4, p4x8, p4x4 */ -#define X264_PART_B8X8 0x100 /* Analyze b16x8, b8x16 and b8x8 */ - - /** - * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int directpred; -#endif - /** * Audio cutoff bandwidth (0 means "automatic") * - encoding: Set by user. @@ -2975,69 +2891,6 @@ typedef struct AVCodecContext { */ int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); -#if FF_API_X264_GLOBAL_OPTS - /** - * explicit P-frame weighted prediction analysis method - * 0: off - * 1: fast blind weighting (one reference duplicate with -1 offset) - * 2: smart weighting (full fade detection analysis) - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int weighted_p_pred; - - /** - * AQ mode - * 0: Disabled - * 1: Variance AQ (complexity mask) - * 2: Auto-variance AQ (experimental) - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated int aq_mode; - - /** - * AQ strength - * Reduces blocking and blurring in flat and textured areas. - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated float aq_strength; - - /** - * PSY RD - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated float psy_rd; - - /** - * PSY trellis - * Strength of psychovisual optimization - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated float psy_trellis; - - /** - * RC lookahead - * Number of frames for frametype and ratecontrol lookahead - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated int rc_lookahead; - - /** - * Constant rate factor maximum - * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse - * than crf_max, even if doing so would violate VBV restrictions. - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated float crf_max; -#endif - int log_level_offset; #if FF_API_FLAC_GLOBAL_OPTS diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index b3581f168f205..12882808bd6a8 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -246,17 +246,6 @@ static av_cold int X264_init(AVCodecContext *avctx) if (avctx->flags & CODEC_FLAG_PASS2) { x4->params.rc.b_stat_read = 1; } else { -#if FF_API_X264_GLOBAL_OPTS - if (avctx->crf) { - x4->params.rc.i_rc_method = X264_RC_CRF; - x4->params.rc.f_rf_constant = avctx->crf; - x4->params.rc.f_rf_constant_max = avctx->crf_max; - } else if (avctx->cqp > -1) { - x4->params.rc.i_rc_method = X264_RC_CQP; - x4->params.rc.i_qp_constant = avctx->cqp; - } -#endif - if (x4->crf >= 0) { x4->params.rc.i_rc_method = X264_RC_CRF; x4->params.rc.f_rf_constant = x4->crf; @@ -279,53 +268,6 @@ static av_cold int X264_init(AVCodecContext *avctx) x4->params.rc.f_pb_factor = avctx->b_quant_factor; x4->params.analyse.i_chroma_qp_offset = avctx->chromaoffset; -#if FF_API_X264_GLOBAL_OPTS - if (avctx->aq_mode >= 0) - x4->params.rc.i_aq_mode = avctx->aq_mode; - if (avctx->aq_strength >= 0) - x4->params.rc.f_aq_strength = avctx->aq_strength; - if (avctx->psy_rd >= 0) - x4->params.analyse.f_psy_rd = avctx->psy_rd; - if (avctx->psy_trellis >= 0) - x4->params.analyse.f_psy_trellis = avctx->psy_trellis; - if (avctx->rc_lookahead >= 0) - x4->params.rc.i_lookahead = avctx->rc_lookahead; - if (avctx->weighted_p_pred >= 0) - x4->params.analyse.i_weighted_pred = avctx->weighted_p_pred; - if (avctx->bframebias) - x4->params.i_bframe_bias = avctx->bframebias; - if (avctx->deblockalpha) - x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha; - if (avctx->deblockbeta) - x4->params.i_deblocking_filter_beta = avctx->deblockbeta; - if (avctx->complexityblur >= 0) - x4->params.rc.f_complexity_blur = avctx->complexityblur; - if (avctx->directpred >= 0) - x4->params.analyse.i_direct_mv_pred = avctx->directpred; - if (avctx->partitions) { - if (avctx->partitions & X264_PART_I4X4) - x4->params.analyse.inter |= X264_ANALYSE_I4x4; - if (avctx->partitions & X264_PART_I8X8) - x4->params.analyse.inter |= X264_ANALYSE_I8x8; - if (avctx->partitions & X264_PART_P8X8) - x4->params.analyse.inter |= X264_ANALYSE_PSUB16x16; - if (avctx->partitions & X264_PART_P4X4) - x4->params.analyse.inter |= X264_ANALYSE_PSUB8x8; - if (avctx->partitions & X264_PART_B8X8) - x4->params.analyse.inter |= X264_ANALYSE_BSUB16x16; - } - x4->params.analyse.b_ssim = avctx->flags2 & CODEC_FLAG2_SSIM; - x4->params.b_intra_refresh = avctx->flags2 & CODEC_FLAG2_INTRA_REFRESH; - x4->params.i_bframe_pyramid = avctx->flags2 & CODEC_FLAG2_BPYRAMID ? X264_B_PYRAMID_NORMAL : X264_B_PYRAMID_NONE; - x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED; - x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS; - x4->params.analyse.b_transform_8x8 = avctx->flags2 & CODEC_FLAG2_8X8DCT; - x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP; - x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD; - x4->params.analyse.b_psy = avctx->flags2 & CODEC_FLAG2_PSY; - x4->params.rc.b_mb_tree = !!(avctx->flags2 & CODEC_FLAG2_MBTREE); -#endif - if (avctx->me_method == ME_EPZS) x4->params.analyse.i_me_method = X264_ME_DIA; else if (avctx->me_method == ME_HEX) @@ -452,9 +394,6 @@ static av_cold int X264_init(AVCodecContext *avctx) avctx->max_b_frames = 0; avctx->bit_rate = x4->params.rc.i_bitrate*1000; -#if FF_API_X264_GLOBAL_OPTS - avctx->crf = x4->params.rc.f_rf_constant; -#endif x4->enc = x264_encoder_open(&x4->params); if (!x4->enc) diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index 1a16bd9ae77e7..f65be72b3c732 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -203,16 +203,6 @@ static av_cold int XAVS_init(AVCodecContext *avctx) if (avctx->flags & CODEC_FLAG_PASS2) { x4->params.rc.b_stat_read = 1; } else { -#if FF_API_X264_GLOBAL_OPTS - if (avctx->crf) { - x4->params.rc.i_rc_method = XAVS_RC_CRF; - x4->params.rc.f_rf_constant = avctx->crf; - } else if (avctx->cqp > -1) { - x4->params.rc.i_rc_method = XAVS_RC_CQP; - x4->params.rc.i_qp_constant = avctx->cqp; - } -#endif - if (x4->crf >= 0) { x4->params.rc.i_rc_method = XAVS_RC_CRF; x4->params.rc.f_rf_constant = x4->crf; @@ -222,32 +212,6 @@ static av_cold int XAVS_init(AVCodecContext *avctx) } } -#if FF_API_X264_GLOBAL_OPTS - if (avctx->bframebias) - x4->params.i_bframe_bias = avctx->bframebias; - if (avctx->deblockalpha) - x4->params.i_deblocking_filter_alphac0 = avctx->deblockalpha; - if (avctx->deblockbeta) - x4->params.i_deblocking_filter_beta = avctx->deblockbeta; - if (avctx->complexityblur >= 0) - x4->params.rc.f_complexity_blur = avctx->complexityblur; - if (avctx->directpred >= 0) - x4->params.analyse.i_direct_mv_pred = avctx->directpred; - if (avctx->partitions) { - if (avctx->partitions & XAVS_PART_I8X8) - x4->params.analyse.inter |= XAVS_ANALYSE_I8x8; - if (avctx->partitions & XAVS_PART_P8X8) - x4->params.analyse.inter |= XAVS_ANALYSE_PSUB16x16; - if (avctx->partitions & XAVS_PART_B8X8) - x4->params.analyse.inter |= XAVS_ANALYSE_BSUB16x16; - } - x4->params.rc.b_mb_tree = !!(avctx->flags2 & CODEC_FLAG2_MBTREE); - x4->params.b_aud = avctx->flags2 & CODEC_FLAG2_AUD; - x4->params.analyse.b_mixed_references = avctx->flags2 & CODEC_FLAG2_MIXED_REFS; - x4->params.analyse.b_fast_pskip = avctx->flags2 & CODEC_FLAG2_FASTPSKIP; - x4->params.analyse.b_weighted_bipred = avctx->flags2 & CODEC_FLAG2_WPRED; -#endif - if (x4->aud >= 0) x4->params.b_aud = x4->aud; if (x4->mbtree >= 0) diff --git a/libavcodec/options.c b/libavcodec/options.c index f8a499cebe2a0..201eb9b228cfa 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -159,9 +159,6 @@ static const AVOption options[]={ {"b_qfactor", "qp factor between p and b frames", OFFSET(b_quant_factor), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E}, {"rc_strategy", "ratecontrol method", OFFSET(rc_strategy), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"b_strategy", "strategy to choose between I/P/B-frames", OFFSET(b_frame_strategy), AV_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX, V|E}, -#if FF_API_X264_GLOBAL_OPTS -{"wpredp", "weighted prediction analysis method", OFFSET(weighted_p_pred), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E}, -#endif {"ps", "rtp payload size in bytes", OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"mv_bits", NULL, OFFSET(mv_bits), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"header_bits", NULL, OFFSET(header_bits), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, @@ -351,17 +348,12 @@ static const AVOption options[]={ {"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"inter_threshold", NULL, OFFSET(inter_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#if FF_API_X264_GLOBAL_OPTS -#define X264_DEFAULTS CODEC_FLAG2_FASTPSKIP|CODEC_FLAG2_PSY|CODEC_FLAG2_MBTREE -#else -#define X264_DEFAULTS 0 -#endif #if FF_API_LAME_GLOBAL_OPTS #define LAME_DEFAULTS CODEC_FLAG2_BIT_RESERVOIR #else #define LAME_DEFAULTS 0 #endif -{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.dbl = X264_DEFAULTS|LAME_DEFAULTS }, 0, UINT_MAX, V|A|E|D, "flags2"}, +{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.dbl = LAME_DEFAULTS }, 0, UINT_MAX, V|A|E|D, "flags2"}, {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, #if FF_API_ANTIALIAS_ALGO {"antialias", "MP3 antialias algorithm", OFFSET(antialias_algo), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D, "aa"}, @@ -412,38 +404,11 @@ static const AVOption options[]={ {"all" , NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AVDISCARD_ALL }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"bidir_refine", "refine the two motion vectors used in bidirectional macroblocks", OFFSET(bidir_refine), AV_OPT_TYPE_INT, {.dbl = 1 }, 0, 4, V|E}, {"brd_scale", "downscales frames for dynamic B-frame decision", OFFSET(brd_scale), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, 10, V|E}, -#if FF_API_X264_GLOBAL_OPTS -{"crf", "enables constant quality mode, and selects the quality (x264)", OFFSET(crf), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 51, V|E}, -{"cqp", "constant quantization parameter rate control method", OFFSET(cqp), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E}, -#endif {"keyint_min", "minimum interval between IDR-frames (x264)", OFFSET(keyint_min), AV_OPT_TYPE_INT, {.dbl = 25 }, INT_MIN, INT_MAX, V|E}, {"refs", "reference frames to consider for motion compensation (Snow)", OFFSET(refs), AV_OPT_TYPE_INT, {.dbl = 1 }, INT_MIN, INT_MAX, V|E}, {"chromaoffset", "chroma qp offset from luma", OFFSET(chromaoffset), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#if FF_API_X264_GLOBAL_OPTS -{"bframebias", "influences how often B-frames are used", OFFSET(bframebias), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#endif {"trellis", "rate-distortion optimal quantization", OFFSET(trellis), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, -#if FF_API_X264_GLOBAL_OPTS -{"directpred", "direct mv prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto)", OFFSET(directpred), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, V|E}, -{"bpyramid", "allows B-frames to be used as references for predicting", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BPYRAMID }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"wpred", "weighted biprediction for b-frames (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_WPRED }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"mixed_refs", "one reference per partition, as opposed to one reference per macroblock", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MIXED_REFS }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"dct8x8", "high profile 8x8 transform (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_8X8DCT }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"fastpskip", "fast pskip (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FASTPSKIP }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"aud", "access unit delimiters (H.264)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_AUD }, INT_MIN, INT_MAX, V|E, "flags2"}, -#endif {"skiprd", "RD optimal MB level residual skipping", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"}, -#if FF_API_X264_GLOBAL_OPTS -{"complexityblur", "reduce fluctuations in qp (before curve compression)", OFFSET(complexityblur), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E}, -{"deblockalpha", "in-loop deblocking filter alphac0 parameter", OFFSET(deblockalpha), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E}, -{"deblockbeta", "in-loop deblocking filter beta parameter", OFFSET(deblockbeta), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, -6, 6, V|E}, -{"partitions", "macroblock subpartition sizes to consider", OFFSET(partitions), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E, "partitions"}, -{"parti4x4", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_I4X4 }, INT_MIN, INT_MAX, V|E, "partitions"}, -{"parti8x8", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_I8X8 }, INT_MIN, INT_MAX, V|E, "partitions"}, -{"partp4x4", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_P4X4 }, INT_MIN, INT_MAX, V|E, "partitions"}, -{"partp8x8", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_P8X8 }, INT_MIN, INT_MAX, V|E, "partitions"}, -{"partb8x8", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = X264_PART_B8X8 }, INT_MIN, INT_MAX, V|E, "partitions"}, -#endif {"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), AV_OPT_TYPE_INT, {.dbl = 6 }, 0, INT_MAX, V|E}, {"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.dbl = 256 }, 0, INT_MAX, V|E}, #if FF_API_MPEGVIDEO_GLOBAL_OPTS @@ -473,9 +438,6 @@ static const AVOption options[]={ #if FF_API_LAME_GLOBAL_OPTS {"reservoir", "use bit reservoir", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BIT_RESERVOIR }, INT_MIN, INT_MAX, A|E, "flags2"}, #endif -#if FF_API_X264_GLOBAL_OPTS -{"mbtree", "use macroblock tree ratecontrol (x264 only)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_MBTREE }, INT_MIN, INT_MAX, V|E, "flags2"}, -#endif {"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"channel_layout", NULL, OFFSET(channel_layout), AV_OPT_TYPE_INT64, {.dbl = DEFAULT }, 0, INT64_MAX, A|E|D, "channel_layout"}, {"request_channel_layout", NULL, OFFSET(request_channel_layout), AV_OPT_TYPE_INT64, {.dbl = DEFAULT }, 0, INT64_MAX, A|D, "request_channel_layout"}, @@ -487,17 +449,6 @@ static const AVOption options[]={ {"colorspace", NULL, OFFSET(colorspace), AV_OPT_TYPE_INT, {.dbl = AVCOL_SPC_UNSPECIFIED }, 1, AVCOL_SPC_NB-1, V|E|D}, {"color_range", NULL, OFFSET(color_range), AV_OPT_TYPE_INT, {.dbl = AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D}, {"chroma_sample_location", NULL, OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.dbl = AVCHROMA_LOC_UNSPECIFIED }, 0, AVCHROMA_LOC_NB-1, V|E|D}, -#if FF_API_X264_GLOBAL_OPTS -{"psy", "use psycho visual optimization", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_PSY }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"psy_rd", "specify psycho visual strength", OFFSET(psy_rd), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E}, -{"psy_trellis", "specify psycho visual trellis", OFFSET(psy_trellis), AV_OPT_TYPE_FLOAT, {.dbl = -1 }, -1, FLT_MAX, V|E}, -{"aq_mode", "specify aq method", OFFSET(aq_mode), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E}, -{"aq_strength", "specify aq strength", OFFSET(aq_strength), AV_OPT_TYPE_FLOAT, {.dbl = -1.0 }, -1, FLT_MAX, V|E}, -{"rc_lookahead", "specify number of frames to look ahead for frametype", OFFSET(rc_lookahead), AV_OPT_TYPE_INT, {.dbl = -1 }, -1, INT_MAX, V|E}, -{"ssim", "ssim will be calculated during encoding", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SSIM }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"intra_refresh", "use periodic insertion of intra blocks instead of keyframes", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_REFRESH }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"crf_max", "in crf mode, prevents vbv from lowering quality beyond this point", OFFSET(crf_max), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 51, V|E}, -#endif {"log_level_offset", "set the log level offset", OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX }, #if FF_API_FLAC_GLOBAL_OPTS {"lpc_type", "deprecated, use flac-specific options", OFFSET(lpc_type), AV_OPT_TYPE_INT, {.dbl = AV_LPC_TYPE_DEFAULT }, AV_LPC_TYPE_DEFAULT, AV_LPC_TYPE_NB-1, A|E}, diff --git a/libavcodec/version.h b/libavcodec/version.h index e36cba88dad86..e750c5d2c8d0a 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -80,9 +80,6 @@ #ifndef FF_API_AVCODEC_INIT #define FF_API_AVCODEC_INIT (LIBAVCODEC_VERSION_MAJOR < 54) #endif -#ifndef FF_API_X264_GLOBAL_OPTS -#define FF_API_X264_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_MPEGVIDEO_GLOBAL_OPTS #define FF_API_MPEGVIDEO_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 9ce2a91b842bdb99fae0f153c5317d786a3f38d8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 17/71] lavc: remove disabled FF_API_MPEGVIDEO_GLOBAL_OPTS cruft. --- libavcodec/avcodec.h | 12 -------- libavcodec/mpeg12enc.c | 7 ----- libavcodec/mpegvideo_enc.c | 62 ++------------------------------------ libavcodec/options.c | 26 ---------------- libavcodec/version.h | 3 -- 5 files changed, 2 insertions(+), 108 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 3e38d3acf288f..08a79f992c322 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -667,18 +667,6 @@ typedef struct RcOverride{ * Use corresponding private codec options instead. * @{ */ -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -#define CODEC_FLAG_OBMC 0x00000001 ///< OBMC -#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC -#define CODEC_FLAG_PART 0x0080 ///< Use data partitioning. -#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan. -#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector -#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000 -#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data. -#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table. -#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. -#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer. -#endif #if FF_API_MJPEG_GLOBAL_OPTS #define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG). #endif diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 17097db9097c0..81d366d8100b6 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -134,13 +134,6 @@ static av_cold int encode_init(AVCodecContext *avctx) if(MPV_encode_init(avctx) < 0) return -1; -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - if (avctx->flags2 & CODEC_FLAG2_DROP_FRAME_TIMECODE) - s->drop_frame_timecode = 1; - if (avctx->flags & CODEC_FLAG_SVCD_SCAN_OFFSET) - s->scan_offset = 1; -#endif - if(find_frame_rate_index(s) < 0){ if(s->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL){ av_log(avctx, AV_LOG_ERROR, "MPEG1/2 does not support %d/%d fps\n", avctx->time_base.den, avctx->time_base.num); diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 08484a7a9c687..2e0e9820f93c6 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -351,10 +351,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) s->luma_elim_threshold = avctx->luma_elim_threshold; s->chroma_elim_threshold = avctx->chroma_elim_threshold; s->strict_std_compliance = avctx->strict_std_compliance; -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - if (avctx->flags & CODEC_FLAG_PART) - s->data_partitioning = 1; -#endif s->quarter_sample = (avctx->flags & CODEC_FLAG_QPEL) != 0; s->mpeg_quant = avctx->mpeg_quant; s->rtp_mode = !!avctx->rtp_payload_size; @@ -383,12 +379,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) !s->fixed_qscale; s->loop_filter = !!(s->flags & CODEC_FLAG_LOOP_FILTER); -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - s->alternate_scan = !!(s->flags & CODEC_FLAG_ALT_SCAN); - s->intra_vlc_format = !!(s->flags2 & CODEC_FLAG2_INTRA_VLC); - s->q_scale_type = !!(s->flags2 & CODEC_FLAG2_NON_LINEAR_QUANT); - s->obmc = !!(s->flags & CODEC_FLAG_OBMC); -#endif if (avctx->rc_max_rate && !avctx->rc_buffer_size) { av_log(avctx, AV_LOG_ERROR, @@ -458,27 +448,11 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) return -1; } -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - if (s->obmc && s->codec_id != CODEC_ID_H263 && - s->codec_id != CODEC_ID_H263P) { - av_log(avctx, AV_LOG_ERROR, "OBMC is only supported with H263(+)\n"); - return -1; - } -#endif - if (s->quarter_sample && s->codec_id != CODEC_ID_MPEG4) { av_log(avctx, AV_LOG_ERROR, "qpel not supported by codec\n"); return -1; } -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - if (s->data_partitioning && s->codec_id != CODEC_ID_MPEG4) { - av_log(avctx, AV_LOG_ERROR, - "data partitioning not supported by codec\n"); - return -1; - } -#endif - if (s->max_b_frames && s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG1VIDEO && @@ -498,11 +472,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) return -1; } - if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - | CODEC_FLAG_ALT_SCAN -#endif - )) && + if ((s->flags & (CODEC_FLAG_INTERLACED_DCT | CODEC_FLAG_INTERLACED_ME)) && s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG2VIDEO) { av_log(avctx, AV_LOG_ERROR, "interlacing not supported by codec\n"); return -1; @@ -534,15 +504,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) return -1; } -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - if ((s->flags2 & CODEC_FLAG2_INTRA_VLC) && - s->codec_id != CODEC_ID_MPEG2VIDEO) { - av_log(avctx, AV_LOG_ERROR, - "intra vlc table not supported by codec\n"); - return -1; - } -#endif - if (s->flags & CODEC_FLAG_LOW_DELAY) { if (s->codec_id != CODEC_ID_MPEG2VIDEO) { av_log(avctx, AV_LOG_ERROR, @@ -557,13 +518,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) } if (s->q_scale_type == 1) { -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - if (s->codec_id != CODEC_ID_MPEG2VIDEO) { - av_log(avctx, AV_LOG_ERROR, - "non linear quant is only available for mpeg2\n"); - return -1; - } -#endif if (avctx->qmax > 12) { av_log(avctx, AV_LOG_ERROR, "non linear quant only supports qmax <= 12 currently\n"); @@ -575,11 +529,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) s->codec_id != CODEC_ID_MPEG4 && s->codec_id != CODEC_ID_MPEG1VIDEO && s->codec_id != CODEC_ID_MPEG2VIDEO && - (s->codec_id != CODEC_ID_H263P -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - || !(s->flags & CODEC_FLAG_H263P_SLICE_STRUCT) -#endif - )) { + (s->codec_id != CODEC_ID_H263P)) { av_log(avctx, AV_LOG_ERROR, "multi threaded encoding not supported by codec\n"); return -1; @@ -725,14 +675,6 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) s->out_format = FMT_H263; s->h263_plus = 1; /* Fx */ -#if FF_API_MPEGVIDEO_GLOBAL_OPTS - if (avctx->flags & CODEC_FLAG_H263P_UMV) - s->umvplus = 1; - if (avctx->flags & CODEC_FLAG_H263P_AIV) - s->alt_inter_vlc = 1; - if (avctx->flags & CODEC_FLAG_H263P_SLICE_STRUCT) - s->h263_slice_structured = 1; -#endif s->h263_aic = (avctx->flags & CODEC_FLAG_AC_PRED) ? 1 : 0; s->modified_quant = s->h263_aic; s->loop_filter = (avctx->flags & CODEC_FLAG_LOOP_FILTER) ? 1 : 0; diff --git a/libavcodec/options.c b/libavcodec/options.c index 201eb9b228cfa..fe15fc3b8b0bf 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -79,17 +79,11 @@ static const AVOption options[]={ {"bt", "set video bitrate tolerance (in bits/s)", OFFSET(bit_rate_tolerance), AV_OPT_TYPE_INT, {.dbl = AV_CODEC_DEFAULT_BITRATE*20 }, 1, INT_MAX, V|E}, {"flags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, 0, UINT_MAX, V|A|E|D, "flags"}, {"mv4", "use four motion vector by macroblock (mpeg4)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_4MV }, INT_MIN, INT_MAX, V|E, "flags"}, -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -{"obmc", "use overlapped block motion compensation (h263+)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_OBMC }, INT_MIN, INT_MAX, V|E, "flags"}, -#endif {"qpel", "use 1/4 pel motion compensation", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QPEL }, INT_MIN, INT_MAX, V|E, "flags"}, {"loop", "use loop filter", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_LOOP_FILTER }, INT_MIN, INT_MAX, V|E, "flags"}, {"qscale", "use fixed qscale", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QSCALE }, INT_MIN, INT_MAX, 0, "flags"}, {"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"}, {"mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"}, -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -{"part", "use data partitioning", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PART }, INT_MIN, INT_MAX, V|E, "flags"}, -#endif {"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"}, {"pass1", "use internal 2pass ratecontrol in first pass mode", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"}, {"pass2", "use internal 2pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"}, @@ -103,25 +97,12 @@ static const AVOption options[]={ {"naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_NORMALIZE_AQP }, INT_MIN, INT_MAX, V|E, "flags"}, {"ildct", "use interlaced dct", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_DCT }, INT_MIN, INT_MAX, V|E, "flags"}, {"low_delay", "force low delay", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_LOW_DELAY }, INT_MIN, INT_MAX, V|D|E, "flags"}, -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -{"alt", "enable alternate scantable (mpeg2/mpeg4)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_ALT_SCAN }, INT_MIN, INT_MAX, V|E, "flags"}, -#endif {"global_header", "place global headers in extradata instead of every keyframe", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GLOBAL_HEADER }, INT_MIN, INT_MAX, V|A|E, "flags"}, {"bitexact", "use only bitexact stuff (except (i)dct)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_BITEXACT }, INT_MIN, INT_MAX, A|V|S|D|E, "flags"}, {"aic", "h263 advanced intra coding / mpeg4 ac prediction", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_AC_PRED }, INT_MIN, INT_MAX, V|E, "flags"}, -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -{"umv", "use unlimited motion vectors", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_UMV }, INT_MIN, INT_MAX, V|E, "flags"}, -#endif {"cbp", "use rate distortion optimization for cbp", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CBP_RD }, INT_MIN, INT_MAX, V|E, "flags"}, {"qprd", "use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_QP_RD }, INT_MIN, INT_MAX, V|E, "flags"}, -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -{"aiv", "h263 alternative inter vlc", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_AIV }, INT_MIN, INT_MAX, V|E, "flags"}, -{"slice", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_H263P_SLICE_STRUCT }, INT_MIN, INT_MAX, V|E, "flags"}, -#endif {"ilme", "interlaced motion estimation", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INTERLACED_ME }, INT_MIN, INT_MAX, V|E, "flags"}, -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -{"scan_offset", "will reserve space for svcd scan offset user data", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_SVCD_SCAN_OFFSET }, INT_MIN, INT_MAX, V|E, "flags"}, -#endif {"cgop", "closed gop", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_CLOSED_GOP }, INT_MIN, INT_MAX, V|E, "flags"}, {"fast", "allow non spec compliant speedup tricks", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_FAST }, INT_MIN, INT_MAX, V|E, "flags2"}, {"sgop", "strictly enforce gop size", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_STRICT_GOP }, INT_MIN, INT_MAX, V|E, "flags2"}, @@ -411,9 +392,6 @@ static const AVOption options[]={ {"skiprd", "RD optimal MB level residual skipping", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_SKIP_RD }, INT_MIN, INT_MAX, V|E, "flags2"}, {"sc_factor", "multiplied by qscale for each frame and added to scene_change_score", OFFSET(scenechange_factor), AV_OPT_TYPE_INT, {.dbl = 6 }, 0, INT_MAX, V|E}, {"mv0_threshold", NULL, OFFSET(mv0_threshold), AV_OPT_TYPE_INT, {.dbl = 256 }, 0, INT_MAX, V|E}, -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -{"ivlc", "intra vlc table", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_INTRA_VLC }, INT_MIN, INT_MAX, V|E, "flags2"}, -#endif {"b_sensitivity", "adjusts sensitivity of b_frame_strategy 1", OFFSET(b_sensitivity), AV_OPT_TYPE_INT, {.dbl = 40 }, 1, INT_MAX, V|E}, {"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.dbl = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E}, {"min_prediction_order", NULL, OFFSET(min_prediction_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, @@ -425,10 +403,6 @@ static const AVOption options[]={ {"max_partition_order", "deprecated, use flac-specific options", OFFSET(max_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, #endif {"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.dbl = 0 }, 0, INT64_MAX, V|E}, -#if FF_API_MPEGVIDEO_GLOBAL_OPTS -{"drop_frame_timecode", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_DROP_FRAME_TIMECODE }, INT_MIN, INT_MAX, V|E, "flags2"}, -{"non_linear_q", "use non linear quantizer", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_NON_LINEAR_QUANT }, INT_MIN, INT_MAX, V|E, "flags2"}, -#endif #if FF_API_REQUEST_CHANNELS {"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D}, #endif diff --git a/libavcodec/version.h b/libavcodec/version.h index e750c5d2c8d0a..570c415835cf8 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -80,9 +80,6 @@ #ifndef FF_API_AVCODEC_INIT #define FF_API_AVCODEC_INIT (LIBAVCODEC_VERSION_MAJOR < 54) #endif -#ifndef FF_API_MPEGVIDEO_GLOBAL_OPTS -#define FF_API_MPEGVIDEO_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_LAME_GLOBAL_OPTS #define FF_API_LAME_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 6c8dab98b87040ab3d5d31b91a46eb4aed8f1f30 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 18/71] lavc: remove disabled FF_API_PALETTE_CONTROL cruft. --- libavcodec/avcodec.h | 32 -------------------------------- libavcodec/version.h | 3 --- 2 files changed, 35 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 08a79f992c322..5a5c4be6bb931 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2282,15 +2282,6 @@ typedef struct AVCodecContext { */ int lmax; -#if FF_API_PALETTE_CONTROL - /** - * palette control structure - * - encoding: ??? (no palette-enabled encoder yet) - * - decoding: Set by user. - */ - struct AVPaletteControl *palctrl; -#endif - /** * noise reduction strength * - encoding: Set by user. @@ -3214,29 +3205,6 @@ typedef struct AVPicture { #define AVPALETTE_SIZE 1024 #define AVPALETTE_COUNT 256 -#if FF_API_PALETTE_CONTROL -/** - * AVPaletteControl - * This structure defines a method for communicating palette changes - * between and demuxer and a decoder. - * - * @deprecated Use AVPacket to send palette changes instead. - * This is totally broken. - */ -typedef struct AVPaletteControl { - - /* Demuxer sets this to 1 to indicate the palette has changed; - * decoder resets to 0. */ - int palette_changed; - - /* 4-byte ARGB palette entries, stored in native byte order; note that - * the individual palette components should be on a 8-bit scale; if - * the palette data comes from an IBM VGA native format, the component - * data is probably 6 bits in size and needs to be scaled. */ - unsigned int palette[AVPALETTE_COUNT]; - -} AVPaletteControl attribute_deprecated; -#endif enum AVSubtitleType { SUBTITLE_NONE, diff --git a/libavcodec/version.h b/libavcodec/version.h index 570c415835cf8..f3a8be6294295 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -38,9 +38,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_PALETTE_CONTROL -#define FF_API_PALETTE_CONTROL (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_OLD_SAMPLE_FMT #define FF_API_OLD_SAMPLE_FMT (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 284e65d64ea91dc172dea1b843d162b22ed48730 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 19/71] lavc: remove disabled FF_API_OLD_SAMPLE_FMT cruft. --- libavcodec/audioconvert.c | 17 ----------------- libavcodec/audioconvert.h | 20 -------------------- libavcodec/avcodec.h | 20 -------------------- libavcodec/utils.c | 6 ------ libavcodec/version.h | 3 --- 5 files changed, 66 deletions(-) diff --git a/libavcodec/audioconvert.c b/libavcodec/audioconvert.c index a24434547effa..9cb465ce7cd0d 100644 --- a/libavcodec/audioconvert.c +++ b/libavcodec/audioconvert.c @@ -31,23 +31,6 @@ #include "avcodec.h" #include "audioconvert.h" -#if FF_API_OLD_SAMPLE_FMT -const char *avcodec_get_sample_fmt_name(int sample_fmt) -{ - return av_get_sample_fmt_name(sample_fmt); -} - -enum AVSampleFormat avcodec_get_sample_fmt(const char* name) -{ - return av_get_sample_fmt(name); -} - -void avcodec_sample_fmt_string (char *buf, int buf_size, int sample_fmt) -{ - av_get_sample_fmt_string(buf, buf_size, sample_fmt); -} -#endif - uint64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name) { switch(nb_channels) { diff --git a/libavcodec/audioconvert.h b/libavcodec/audioconvert.h index f50eb3e1bba02..0a63130a4a32c 100644 --- a/libavcodec/audioconvert.h +++ b/libavcodec/audioconvert.h @@ -33,26 +33,6 @@ #include "avcodec.h" #include "libavutil/audioconvert.h" -#if FF_API_OLD_SAMPLE_FMT -/** - * @deprecated Use av_get_sample_fmt_string() instead. - */ -attribute_deprecated -void avcodec_sample_fmt_string(char *buf, int buf_size, int sample_fmt); - -/** - * @deprecated Use av_get_sample_fmt_name() instead. - */ -attribute_deprecated -const char *avcodec_get_sample_fmt_name(int sample_fmt); - -/** - * @deprecated Use av_get_sample_fmt() instead. - */ -attribute_deprecated -enum AVSampleFormat avcodec_get_sample_fmt(const char* name); -#endif - #if FF_API_OLD_AUDIOCONVERT /** * @deprecated Use av_get_channel_layout() instead. diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 5a5c4be6bb931..a31c63e09b9a9 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -424,18 +424,6 @@ enum CodecID { CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. }; -#if FF_API_OLD_SAMPLE_FMT -#define SampleFormat AVSampleFormat - -#define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE -#define SAMPLE_FMT_U8 AV_SAMPLE_FMT_U8 -#define SAMPLE_FMT_S16 AV_SAMPLE_FMT_S16 -#define SAMPLE_FMT_S32 AV_SAMPLE_FMT_S32 -#define SAMPLE_FMT_FLT AV_SAMPLE_FMT_FLT -#define SAMPLE_FMT_DBL AV_SAMPLE_FMT_DBL -#define SAMPLE_FMT_NB AV_SAMPLE_FMT_NB -#endif - #if FF_API_OLD_AUDIOCONVERT #include "libavutil/audioconvert.h" @@ -4197,14 +4185,6 @@ char av_get_pict_type_char(int pict_type); */ int av_get_bits_per_sample(enum CodecID codec_id); -#if FF_API_OLD_SAMPLE_FMT -/** - * @deprecated Use av_get_bytes_per_sample() instead. - */ -attribute_deprecated -int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt); -#endif - /* frame parsing */ typedef struct AVCodecParserContext { void *priv_data; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 184f67e5661ab..bcdb71a474ef3 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1658,12 +1658,6 @@ int av_get_bits_per_sample(enum CodecID codec_id){ } } -#if FF_API_OLD_SAMPLE_FMT -int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt) { - return av_get_bytes_per_sample(sample_fmt) << 3; -} -#endif - #if !HAVE_THREADS int ff_thread_init(AVCodecContext *s){ return -1; diff --git a/libavcodec/version.h b/libavcodec/version.h index f3a8be6294295..20c84372538c1 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -38,9 +38,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_OLD_SAMPLE_FMT -#define FF_API_OLD_SAMPLE_FMT (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_OLD_AUDIOCONVERT #define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 62dfea653564a09be78d0a8361ee968e525b33bf Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 20/71] lavc: remove disabled FF_API_OLD_AUDIOCONVERT cruft. --- libavcodec/audioconvert.c | 17 -------------- libavcodec/audioconvert.h | 20 ---------------- libavcodec/avcodec.h | 48 --------------------------------------- libavcodec/version.h | 3 --- 4 files changed, 88 deletions(-) diff --git a/libavcodec/audioconvert.c b/libavcodec/audioconvert.c index 9cb465ce7cd0d..0e1160d8e3e01 100644 --- a/libavcodec/audioconvert.c +++ b/libavcodec/audioconvert.c @@ -45,23 +45,6 @@ uint64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, co } } -#if FF_API_OLD_AUDIOCONVERT -int64_t avcodec_get_channel_layout(const char *name) -{ - return av_get_channel_layout(name); -} - -void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout) -{ - av_get_channel_layout_string(buf, buf_size, nb_channels, channel_layout); -} - -int avcodec_channel_layout_num_channels(int64_t channel_layout) -{ - return av_get_channel_layout_nb_channels(channel_layout); -} -#endif - struct AVAudioConvert { int in_channels, out_channels; int fmt_pair; diff --git a/libavcodec/audioconvert.h b/libavcodec/audioconvert.h index 0a63130a4a32c..590dc8d8d7a98 100644 --- a/libavcodec/audioconvert.h +++ b/libavcodec/audioconvert.h @@ -33,26 +33,6 @@ #include "avcodec.h" #include "libavutil/audioconvert.h" -#if FF_API_OLD_AUDIOCONVERT -/** - * @deprecated Use av_get_channel_layout() instead. - */ -attribute_deprecated -int64_t avcodec_get_channel_layout(const char *name); - -/** - * @deprecated Use av_get_channel_layout_string() instead. - */ -attribute_deprecated -void avcodec_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout); - -/** - * @deprecated Use av_get_channel_layout_nb_channels() instead. - */ -attribute_deprecated -int avcodec_channel_layout_num_channels(int64_t channel_layout); -#endif - /** * Guess the channel layout * @param nb_channels diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a31c63e09b9a9..73262e76e62aa 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -424,54 +424,6 @@ enum CodecID { CODEC_ID_FFMETADATA = 0x21000, ///< Dummy codec for streams containing only metadata information. }; -#if FF_API_OLD_AUDIOCONVERT -#include "libavutil/audioconvert.h" - -/* Audio channel masks */ -#define CH_FRONT_LEFT AV_CH_FRONT_LEFT -#define CH_FRONT_RIGHT AV_CH_FRONT_RIGHT -#define CH_FRONT_CENTER AV_CH_FRONT_CENTER -#define CH_LOW_FREQUENCY AV_CH_LOW_FREQUENCY -#define CH_BACK_LEFT AV_CH_BACK_LEFT -#define CH_BACK_RIGHT AV_CH_BACK_RIGHT -#define CH_FRONT_LEFT_OF_CENTER AV_CH_FRONT_LEFT_OF_CENTER -#define CH_FRONT_RIGHT_OF_CENTER AV_CH_FRONT_RIGHT_OF_CENTER -#define CH_BACK_CENTER AV_CH_BACK_CENTER -#define CH_SIDE_LEFT AV_CH_SIDE_LEFT -#define CH_SIDE_RIGHT AV_CH_SIDE_RIGHT -#define CH_TOP_CENTER AV_CH_TOP_CENTER -#define CH_TOP_FRONT_LEFT AV_CH_TOP_FRONT_LEFT -#define CH_TOP_FRONT_CENTER AV_CH_TOP_FRONT_CENTER -#define CH_TOP_FRONT_RIGHT AV_CH_TOP_FRONT_RIGHT -#define CH_TOP_BACK_LEFT AV_CH_TOP_BACK_LEFT -#define CH_TOP_BACK_CENTER AV_CH_TOP_BACK_CENTER -#define CH_TOP_BACK_RIGHT AV_CH_TOP_BACK_RIGHT -#define CH_STEREO_LEFT AV_CH_STEREO_LEFT -#define CH_STEREO_RIGHT AV_CH_STEREO_RIGHT - -/** Channel mask value used for AVCodecContext.request_channel_layout - to indicate that the user requests the channel order of the decoder output - to be the native codec channel order. */ -#define CH_LAYOUT_NATIVE AV_CH_LAYOUT_NATIVE - -/* Audio channel convenience macros */ -#define CH_LAYOUT_MONO AV_CH_LAYOUT_MONO -#define CH_LAYOUT_STEREO AV_CH_LAYOUT_STEREO -#define CH_LAYOUT_2_1 AV_CH_LAYOUT_2_1 -#define CH_LAYOUT_SURROUND AV_CH_LAYOUT_SURROUND -#define CH_LAYOUT_4POINT0 AV_CH_LAYOUT_4POINT0 -#define CH_LAYOUT_2_2 AV_CH_LAYOUT_2_2 -#define CH_LAYOUT_QUAD AV_CH_LAYOUT_QUAD -#define CH_LAYOUT_5POINT0 AV_CH_LAYOUT_5POINT0 -#define CH_LAYOUT_5POINT1 AV_CH_LAYOUT_5POINT1 -#define CH_LAYOUT_5POINT0_BACK AV_CH_LAYOUT_5POINT0_BACK -#define CH_LAYOUT_5POINT1_BACK AV_CH_LAYOUT_5POINT1_BACK -#define CH_LAYOUT_7POINT0 AV_CH_LAYOUT_7POINT0 -#define CH_LAYOUT_7POINT1 AV_CH_LAYOUT_7POINT1 -#define CH_LAYOUT_7POINT1_WIDE AV_CH_LAYOUT_7POINT1_WIDE -#define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX -#endif - #if FF_API_OLD_DECODE_AUDIO /* in bytes */ #define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio diff --git a/libavcodec/version.h b/libavcodec/version.h index 20c84372538c1..1ca303b406081 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -38,9 +38,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_OLD_AUDIOCONVERT -#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_ANTIALIAS_ALGO #define FF_API_ANTIALIAS_ALGO (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 7831a7e4ec2c4e247095ec4167b90411bc5166e1 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 21/71] lavc: remove disabled FF_API_ANTIALIAS_ALGO cruft. --- libavcodec/avcodec.h | 13 ------------- libavcodec/options.c | 7 ------- libavcodec/version.h | 3 --- 3 files changed, 23 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 73262e76e62aa..38df95f6b336c 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2271,19 +2271,6 @@ typedef struct AVCodecContext { */ int error_rate; -#if FF_API_ANTIALIAS_ALGO - /** - * MP3 antialias algorithm, see FF_AA_* below. - * - encoding: unused - * - decoding: Set by user. - */ - attribute_deprecated int antialias_algo; -#define FF_AA_AUTO 0 -#define FF_AA_FASTINT 1 //not implemented yet -#define FF_AA_INT 2 -#define FF_AA_FLOAT 3 -#endif - /** * quantizer noise shaping * - encoding: Set by user. diff --git a/libavcodec/options.c b/libavcodec/options.c index fe15fc3b8b0bf..33d6953537561 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -336,13 +336,6 @@ static const AVOption options[]={ #endif {"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.dbl = LAME_DEFAULTS }, 0, UINT_MAX, V|A|E|D, "flags2"}, {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#if FF_API_ANTIALIAS_ALGO -{"antialias", "MP3 antialias algorithm", OFFSET(antialias_algo), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|D, "aa"}, -{"auto", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_AUTO }, INT_MIN, INT_MAX, V|D, "aa"}, -{"fastint", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_FASTINT }, INT_MIN, INT_MAX, V|D, "aa"}, -{"int", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_INT }, INT_MIN, INT_MAX, V|D, "aa"}, -{"float", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_AA_FLOAT }, INT_MIN, INT_MAX, V|D, "aa"}, -#endif {"qns", "quantizer noise shaping", OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.dbl = 1 }, 0, INT_MAX, V|E|D, "threads"}, {"auto", "detect a good number of threads", 0, AV_OPT_TYPE_CONST, {.dbl = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"}, diff --git a/libavcodec/version.h b/libavcodec/version.h index 1ca303b406081..77c512ce17d1c 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -38,9 +38,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_ANTIALIAS_ALGO -#define FF_API_ANTIALIAS_ALGO (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif From 9a79bb552a518f26bec1b5306a03b76076bcf8eb Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 22/71] lavc: remove disabled FF_API_THREAD_INIT cruft. --- libavcodec/avcodec.h | 8 -------- libavcodec/utils.c | 8 -------- libavcodec/version.h | 3 --- 3 files changed, 19 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 38df95f6b336c..778b328674880 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3726,14 +3726,6 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt); -#if FF_API_THREAD_INIT -/** - * @deprecated Set s->thread_count before calling avcodec_open2() instead of calling this. - */ -attribute_deprecated -int avcodec_thread_init(AVCodecContext *s, int thread_count); -#endif - int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); //FIXME func typedef diff --git a/libavcodec/utils.c b/libavcodec/utils.c index bcdb71a474ef3..7f8009d7f9e6c 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1810,14 +1810,6 @@ void ff_thread_await_progress(AVFrame *f, int progress, int field) #endif -#if FF_API_THREAD_INIT -int avcodec_thread_init(AVCodecContext *s, int thread_count) -{ - s->thread_count = thread_count; - return ff_thread_init(s); -} -#endif - enum AVMediaType avcodec_get_type(enum CodecID codec_id) { if (codec_id <= CODEC_ID_NONE) diff --git a/libavcodec/version.h b/libavcodec/version.h index 77c512ce17d1c..7b2bd188de18e 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_THREAD_INIT -#define FF_API_THREAD_INIT (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_OLD_FF_PICT_TYPES #define FF_API_OLD_FF_PICT_TYPES (LIBAVCODEC_VERSION_MAJOR < 54) #endif From fbca04e6f6567bcdb81549450f7e8345a6a8df11 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 23/71] lavc: remove disabled FF_API_OLD_FF_PICT_TYPES cruft. --- libavcodec/avcodec.h | 23 ----------------------- libavcodec/utils.c | 6 ------ libavcodec/version.h | 3 --- 3 files changed, 32 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 778b328674880..1cbc56df30e5d 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -783,17 +783,6 @@ typedef struct AVPanScan{ #define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared. #define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything. -#if FF_API_OLD_FF_PICT_TYPES -/* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values */ -#define FF_I_TYPE AV_PICTURE_TYPE_I ///< Intra -#define FF_P_TYPE AV_PICTURE_TYPE_P ///< Predicted -#define FF_B_TYPE AV_PICTURE_TYPE_B ///< Bi-dir predicted -#define FF_S_TYPE AV_PICTURE_TYPE_S ///< S(GMC)-VOP MPEG4 -#define FF_SI_TYPE AV_PICTURE_TYPE_SI ///< Switching Intra -#define FF_SP_TYPE AV_PICTURE_TYPE_SP ///< Switching Predicted -#define FF_BI_TYPE AV_PICTURE_TYPE_BI -#endif - #define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore). #define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer. #define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content. @@ -4096,18 +4085,6 @@ void avcodec_default_free_buffers(AVCodecContext *s); /* misc useful functions */ -#if FF_API_OLD_FF_PICT_TYPES -/** - * Return a single letter to describe the given picture type pict_type. - * - * @param[in] pict_type the picture type - * @return A single character representing the picture type. - * @deprecated Use av_get_picture_type_char() instead. - */ -attribute_deprecated -char av_get_pict_type_char(int pict_type); -#endif - /** * Return codec bits per sample. * diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7f8009d7f9e6c..2101df145dffd 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1603,12 +1603,6 @@ void avcodec_default_free_buffers(AVCodecContext *avctx) } } -#if FF_API_OLD_FF_PICT_TYPES -char av_get_pict_type_char(int pict_type){ - return av_get_picture_type_char(pict_type); -} -#endif - int av_get_bits_per_sample(enum CodecID codec_id){ switch(codec_id){ case CODEC_ID_ADPCM_SBPRO_2: diff --git a/libavcodec/version.h b/libavcodec/version.h index 7b2bd188de18e..ace2f355e12db 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_OLD_FF_PICT_TYPES -#define FF_API_OLD_FF_PICT_TYPES (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_FLAC_GLOBAL_OPTS #define FF_API_FLAC_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 0dc6bab092f207f237b166a543cd9ea118825272 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 24/71] lavc: remove disabled FF_API_FLAC_GLOBAL_OPTS cruft. --- libavcodec/avcodec.h | 67 ------------------------------------------- libavcodec/flacenc.c | 68 -------------------------------------------- libavcodec/options.c | 14 --------- libavcodec/version.h | 3 -- 4 files changed, 152 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 1cbc56df30e5d..d6a40fa048f57 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -525,20 +525,6 @@ enum AVChromaLocation{ AVCHROMA_LOC_NB , ///< Not part of ABI }; -#if FF_API_FLAC_GLOBAL_OPTS -/** - * LPC analysis type - */ -enum AVLPCType { - AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type - AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients - AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients - AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion - AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization - AV_LPC_TYPE_NB , ///< Not part of ABI -}; -#endif - enum AVAudioServiceType { AV_AUDIO_SERVICE_TYPE_MAIN = 0, AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, @@ -2594,43 +2580,6 @@ typedef struct AVCodecContext { */ int max_prediction_order; -#if FF_API_FLAC_GLOBAL_OPTS - /** - * @name FLAC options - * @deprecated Use FLAC encoder private options instead. - * @{ - */ - - /** - * LPC coefficient precision - used by FLAC encoder - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int lpc_coeff_precision; - - /** - * search method for selecting prediction order - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int prediction_order_method; - - /** - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int min_partition_order; - - /** - * - encoding: Set by user. - * - decoding: unused - */ - attribute_deprecated int max_partition_order; - /** - * @} - */ -#endif - /** * GOP timecode frame start number, in non drop frame format * - encoding: Set by user. @@ -2788,22 +2737,6 @@ typedef struct AVCodecContext { int log_level_offset; -#if FF_API_FLAC_GLOBAL_OPTS - /** - * Determine which LPC analysis algorithm to use. - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated enum AVLPCType lpc_type; - - /** - * Number of passes to use for Cholesky factorization during LPC analysis - * - encoding: Set by user - * - decoding: unused - */ - attribute_deprecated int lpc_passes; -#endif - /** * Number of slices. * Indicates number of picture subdivisions. Used for parallelized diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index 94e381d17e78b..47fcca1b40dbe 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -295,29 +295,6 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) if (s->options.max_partition_order < 0) s->options.max_partition_order = ((int[]){ 2, 2, 3, 3, 3, 8, 8, 8, 8, 8, 8, 8, 8})[level]; - /* set compression option overrides from AVCodecContext */ -#if FF_API_FLAC_GLOBAL_OPTS - if (avctx->lpc_type > FF_LPC_TYPE_DEFAULT) { - if (avctx->lpc_type > FF_LPC_TYPE_CHOLESKY) { - av_log(avctx, AV_LOG_ERROR, "unknown lpc type: %d\n", avctx->lpc_type); - return -1; - } - s->options.lpc_type = avctx->lpc_type; - if (s->options.lpc_type == FF_LPC_TYPE_CHOLESKY) { - if (avctx->lpc_passes < 0) { - // default number of passes for Cholesky - s->options.lpc_passes = 2; - } else if (avctx->lpc_passes == 0) { - av_log(avctx, AV_LOG_ERROR, "invalid number of lpc passes: %d\n", - avctx->lpc_passes); - return -1; - } else { - s->options.lpc_passes = avctx->lpc_passes; - } - } - } -#endif - if (s->options.lpc_type == FF_LPC_TYPE_NONE) { s->options.min_prediction_order = 0; } else if (avctx->min_prediction_order >= 0) { @@ -358,39 +335,6 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) return -1; } -#if FF_API_FLAC_GLOBAL_OPTS - if (avctx->prediction_order_method >= 0) { - if (avctx->prediction_order_method > ORDER_METHOD_LOG) { - av_log(avctx, AV_LOG_ERROR, "invalid prediction order method: %d\n", - avctx->prediction_order_method); - return -1; - } - s->options.prediction_order_method = avctx->prediction_order_method; - } - - if (avctx->min_partition_order >= 0) { - if (avctx->min_partition_order > MAX_PARTITION_ORDER) { - av_log(avctx, AV_LOG_ERROR, "invalid min partition order: %d\n", - avctx->min_partition_order); - return -1; - } - s->options.min_partition_order = avctx->min_partition_order; - } - if (avctx->max_partition_order >= 0) { - if (avctx->max_partition_order > MAX_PARTITION_ORDER) { - av_log(avctx, AV_LOG_ERROR, "invalid max partition order: %d\n", - avctx->max_partition_order); - return -1; - } - s->options.max_partition_order = avctx->max_partition_order; - } - if (s->options.max_partition_order < s->options.min_partition_order) { - av_log(avctx, AV_LOG_ERROR, "invalid partition orders: min=%d max=%d\n", - s->options.min_partition_order, s->options.max_partition_order); - return -1; - } -#endif - if (avctx->frame_size > 0) { if (avctx->frame_size < FLAC_MIN_BLOCKSIZE || avctx->frame_size > FLAC_MAX_BLOCKSIZE) { @@ -403,18 +347,6 @@ static av_cold int flac_encode_init(AVCodecContext *avctx) } s->max_blocksize = s->avctx->frame_size; -#if FF_API_FLAC_GLOBAL_OPTS - /* set LPC precision */ - if (avctx->lpc_coeff_precision > 0) { - if (avctx->lpc_coeff_precision > MAX_LPC_PRECISION) { - av_log(avctx, AV_LOG_ERROR, "invalid lpc coeff precision: %d\n", - avctx->lpc_coeff_precision); - return -1; - } - s->options.lpc_coeff_precision = avctx->lpc_coeff_precision; - } -#endif - /* set maximum encoded frame size in verbatim mode */ s->max_framesize = ff_flac_get_max_frame_size(s->avctx->frame_size, s->channels, 16); diff --git a/libavcodec/options.c b/libavcodec/options.c index 33d6953537561..703563c284e6a 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -389,12 +389,6 @@ static const AVOption options[]={ {"compression_level", NULL, OFFSET(compression_level), AV_OPT_TYPE_INT, {.dbl = FF_COMPRESSION_DEFAULT }, INT_MIN, INT_MAX, V|A|E}, {"min_prediction_order", NULL, OFFSET(min_prediction_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, {"max_prediction_order", NULL, OFFSET(max_prediction_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -#if FF_API_FLAC_GLOBAL_OPTS -{"lpc_coeff_precision", "deprecated, use flac-specific options", OFFSET(lpc_coeff_precision), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|E}, -{"prediction_order_method", "deprecated, use flac-specific options", OFFSET(prediction_order_method), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -{"min_partition_order", "deprecated, use flac-specific options", OFFSET(min_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -{"max_partition_order", "deprecated, use flac-specific options", OFFSET(max_partition_order), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -#endif {"timecode_frame_start", "GOP timecode frame start number, in non drop frame format", OFFSET(timecode_frame_start), AV_OPT_TYPE_INT64, {.dbl = 0 }, 0, INT64_MAX, V|E}, #if FF_API_REQUEST_CHANNELS {"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D}, @@ -417,14 +411,6 @@ static const AVOption options[]={ {"color_range", NULL, OFFSET(color_range), AV_OPT_TYPE_INT, {.dbl = AVCOL_RANGE_UNSPECIFIED }, 0, AVCOL_RANGE_NB-1, V|E|D}, {"chroma_sample_location", NULL, OFFSET(chroma_sample_location), AV_OPT_TYPE_INT, {.dbl = AVCHROMA_LOC_UNSPECIFIED }, 0, AVCHROMA_LOC_NB-1, V|E|D}, {"log_level_offset", "set the log level offset", OFFSET(log_level_offset), AV_OPT_TYPE_INT, {.dbl = 0 }, INT_MIN, INT_MAX }, -#if FF_API_FLAC_GLOBAL_OPTS -{"lpc_type", "deprecated, use flac-specific options", OFFSET(lpc_type), AV_OPT_TYPE_INT, {.dbl = AV_LPC_TYPE_DEFAULT }, AV_LPC_TYPE_DEFAULT, AV_LPC_TYPE_NB-1, A|E}, -{"none", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_NONE }, INT_MIN, INT_MAX, A|E, "lpc_type"}, -{"fixed", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_FIXED }, INT_MIN, INT_MAX, A|E, "lpc_type"}, -{"levinson", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_LEVINSON }, INT_MIN, INT_MAX, A|E, "lpc_type"}, -{"cholesky", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = AV_LPC_TYPE_CHOLESKY }, INT_MIN, INT_MAX, A|E, "lpc_type"}, -{"lpc_passes", "deprecated, use flac-specific options", OFFSET(lpc_passes), AV_OPT_TYPE_INT, {.dbl = -1 }, INT_MIN, INT_MAX, A|E}, -#endif {"slices", "number of slices, used in parallelized encoding", OFFSET(slices), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, V|E}, {"thread_type", "select multithreading type", OFFSET(thread_type), AV_OPT_TYPE_FLAGS, {.dbl = FF_THREAD_SLICE|FF_THREAD_FRAME }, 0, INT_MAX, V|E|D, "thread_type"}, {"slice", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_THREAD_SLICE }, INT_MIN, INT_MAX, V|E|D, "thread_type"}, diff --git a/libavcodec/version.h b/libavcodec/version.h index ace2f355e12db..01b25d29c8fbc 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_FLAC_GLOBAL_OPTS -#define FF_API_FLAC_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_GET_PIX_FMT_NAME #define FF_API_GET_PIX_FMT_NAME (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 8e5746d46102d7ae3137cfd881e2974b4fca0c89 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 25/71] lavc: remove disabled FF_API_GET_PIX_FMT_NAME cruft. --- libavcodec/avcodec.h | 8 -------- libavcodec/imgconvert.c | 7 ------- libavcodec/version.h | 3 --- 3 files changed, 18 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index d6a40fa048f57..95458fa3e064a 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3343,14 +3343,6 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height); void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); -#if FF_API_GET_PIX_FMT_NAME -/** - * @deprecated Deprecated in favor of av_get_pix_fmt_name(). - */ -attribute_deprecated -const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); -#endif - void avcodec_set_dimensions(AVCodecContext *s, int width, int height); /** diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index eab051baccb25..eeffc3f133b91 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -414,13 +414,6 @@ void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int * *v_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h; } -#if FF_API_GET_PIX_FMT_NAME -const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt) -{ - return av_get_pix_fmt_name(pix_fmt); -} -#endif - int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) { return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL; diff --git a/libavcodec/version.h b/libavcodec/version.h index 01b25d29c8fbc..68411e23d6fb4 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_GET_PIX_FMT_NAME -#define FF_API_GET_PIX_FMT_NAME (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_ALLOC_CONTEXT #define FF_API_ALLOC_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 54) #endif From ec104eef51d16974f7d90dfb2ab705df3f47e6bb Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 26/71] lavc: remove disabled FF_API_ALLOC_CONTEXT cruft. --- libavcodec/avcodec.h | 35 ----------------------------------- libavcodec/options.c | 27 --------------------------- libavcodec/version.h | 3 --- 3 files changed, 65 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 95458fa3e064a..c8fde8d0d06b3 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3516,22 +3516,6 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); */ const char *av_get_profile_name(const AVCodec *codec, int profile); -#if FF_API_ALLOC_CONTEXT -/** - * Set the fields of the given AVCodecContext to default values. - * - * @param s The AVCodecContext of which the fields should be set to default values. - * @deprecated use avcodec_get_context_defaults3 - */ -attribute_deprecated -void avcodec_get_context_defaults(AVCodecContext *s); - -/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! */ -attribute_deprecated -void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType); -#endif - /** * Set the fields of the given AVCodecContext to default values corresponding * to the given codec (defaults may be codec-dependent). @@ -3543,25 +3527,6 @@ void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType); */ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec); -#if FF_API_ALLOC_CONTEXT -/** - * Allocate an AVCodecContext and set its fields to default values. The - * resulting struct can be deallocated by simply calling av_free(). - * - * @return An AVCodecContext filled with default values or NULL on failure. - * @see avcodec_get_context_defaults - * - * @deprecated use avcodec_alloc_context3() - */ -attribute_deprecated -AVCodecContext *avcodec_alloc_context(void); - -/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! - * we WILL change its arguments and name a few times! */ -attribute_deprecated -AVCodecContext *avcodec_alloc_context2(enum AVMediaType); -#endif - /** * Allocate an AVCodecContext and set its fields to default values. The * resulting struct can be deallocated by simply calling av_free(). diff --git a/libavcodec/options.c b/libavcodec/options.c index 703563c284e6a..5024829b82b81 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -451,13 +451,6 @@ static const AVClass av_codec_context_class = { .child_class_next = codec_child_class_next, }; -#if FF_API_ALLOC_CONTEXT -void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){ - avcodec_get_context_defaults3(s, NULL); - s->codec_type = codec_type; -} -#endif - int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){ memset(s, 0, sizeof(AVCodecContext)); @@ -515,26 +508,6 @@ AVCodecContext *avcodec_alloc_context3(AVCodec *codec){ return avctx; } -#if FF_API_ALLOC_CONTEXT -AVCodecContext *avcodec_alloc_context2(enum AVMediaType codec_type){ - AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); - - if(avctx==NULL) return NULL; - - avcodec_get_context_defaults2(avctx, codec_type); - - return avctx; -} - -void avcodec_get_context_defaults(AVCodecContext *s){ - avcodec_get_context_defaults2(s, AVMEDIA_TYPE_UNKNOWN); -} - -AVCodecContext *avcodec_alloc_context(void){ - return avcodec_alloc_context2(AVMEDIA_TYPE_UNKNOWN); -} -#endif - int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src) { if (dest->codec) { // check that the dest context is uninitialized diff --git a/libavcodec/version.h b/libavcodec/version.h index 68411e23d6fb4..f6f1cbcaafa5d 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_ALLOC_CONTEXT -#define FF_API_ALLOC_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_AVCODEC_OPEN #define FF_API_AVCODEC_OPEN (LIBAVCODEC_VERSION_MAJOR < 54) #endif From d2d931500b24900dcff2527b94ce0dfc36f9d6f2 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 27/71] lavc: remove disabled FF_API_AVCODEC_OPEN cruft. --- libavcodec/avcodec.h | 34 ---------------------------------- libavcodec/utils.c | 7 ------- libavcodec/version.h | 3 --- 3 files changed, 44 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index c8fde8d0d06b3..c647265459b52 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3609,40 +3609,6 @@ int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, v int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); //FIXME func typedef -#if FF_API_AVCODEC_OPEN -/** - * Initialize the AVCodecContext to use the given AVCodec. Prior to using this - * function the context has to be allocated. - * - * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), - * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for - * retrieving a codec. - * - * @warning This function is not thread safe! - * - * @code - * avcodec_register_all(); - * codec = avcodec_find_decoder(CODEC_ID_H264); - * if (!codec) - * exit(1); - * - * context = avcodec_alloc_context3(codec); - * - * if (avcodec_open(context, codec) < 0) - * exit(1); - * @endcode - * - * @param avctx The context which will be set up to use the given codec. - * @param codec The codec to use within the context. - * @return zero on success, a negative value on error - * @see avcodec_alloc_context3, avcodec_find_decoder, avcodec_find_encoder, avcodec_close - * - * @deprecated use avcodec_open2 - */ -attribute_deprecated -int avcodec_open(AVCodecContext *avctx, AVCodec *codec); -#endif - /** * Initialize the AVCodecContext to use the given AVCodec. Prior to using this * function the context has to be allocated with avcodec_alloc_context3(). diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 2101df145dffd..6236f79831ae5 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -625,13 +625,6 @@ AVFrame *avcodec_alloc_frame(void){ return pic; } -#if FF_API_AVCODEC_OPEN -int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) -{ - return avcodec_open2(avctx, codec, NULL); -} -#endif - int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) { int ret = 0; diff --git a/libavcodec/version.h b/libavcodec/version.h index f6f1cbcaafa5d..63a04dfa2ca53 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_AVCODEC_OPEN -#define FF_API_AVCODEC_OPEN (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_DRC_SCALE #define FF_API_DRC_SCALE (LIBAVCODEC_VERSION_MAJOR < 54) #endif From f326501a65ad1b949f9e623e1665c81e8ce628f8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 28/71] lavc: remove disabled FF_API_DRC_SCALE cruft. --- libavcodec/ac3dec.c | 5 ----- libavcodec/avcodec.h | 11 ----------- libavcodec/options.c | 3 --- libavcodec/version.h | 3 --- 4 files changed, 22 deletions(-) diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 662ea91d1f99d..b50ec2abe6238 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -174,11 +174,6 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx) AC3DecodeContext *s = avctx->priv_data; s->avctx = avctx; -#if FF_API_DRC_SCALE - if (avctx->drc_scale) - s->drc_scale = avctx->drc_scale; -#endif - ff_ac3_common_init(); ac3_tables_init(); ff_mdct_init(&s->imdct_256, 8, 1, 1.0); diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index c647265459b52..d4a1939f70e38 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2597,17 +2597,6 @@ typedef struct AVCodecContext { int request_channels; #endif -#if FF_API_DRC_SCALE - /** - * Percentage of dynamic range compression to be applied by the decoder. - * The default value is 1.0, corresponding to full compression. - * - encoding: unused - * - decoding: Set by user. - * @deprecated use AC3 decoder private option instead. - */ - attribute_deprecated float drc_scale; -#endif - /** * opaque 64bit number (generally a PTS) that will be reordered and * output in AVFrame.reordered_opaque diff --git a/libavcodec/options.c b/libavcodec/options.c index 5024829b82b81..1ccc73fe887c5 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -393,9 +393,6 @@ static const AVOption options[]={ #if FF_API_REQUEST_CHANNELS {"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D}, #endif -#if FF_API_DRC_SCALE -{"drc_scale", "percentage of dynamic range compression to apply", OFFSET(drc_scale), AV_OPT_TYPE_FLOAT, {.dbl = 0.0 }, 0.0, 1.0, A|D}, -#endif #if FF_API_LAME_GLOBAL_OPTS {"reservoir", "use bit reservoir", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BIT_RESERVOIR }, INT_MIN, INT_MAX, A|E, "flags2"}, #endif diff --git a/libavcodec/version.h b/libavcodec/version.h index 63a04dfa2ca53..363d79a9240d2 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_DRC_SCALE -#define FF_API_DRC_SCALE (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_ER #define FF_API_ER (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 491f443e1f7ebcc8bf8be434ad7c383f5647aff9 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 29/71] lavc: remove disabled FF_API_ER cruft. --- libavcodec/avcodec.h | 15 --------------- libavcodec/options.c | 8 -------- libavcodec/utils.c | 10 ---------- libavcodec/version.h | 3 --- 4 files changed, 36 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index d4a1939f70e38..fa9dba7277b20 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1545,21 +1545,6 @@ typedef struct AVCodecContext { */ float b_quant_offset; -#if FF_API_ER - /** - * Error recognition; higher values will detect more errors but may - * misdetect some more or less valid parts as errors. - * - encoding: unused - * - decoding: Set by user. - */ - attribute_deprecated int error_recognition; -#define FF_ER_CAREFUL 1 -#define FF_ER_COMPLIANT 2 -#define FF_ER_AGGRESSIVE 3 -#define FF_ER_VERY_AGGRESSIVE 4 -#define FF_ER_EXPLODE 5 -#endif /* FF_API_ER */ - /** * Called at the beginning of each frame to get a buffer for it. * diff --git a/libavcodec/options.c b/libavcodec/options.c index 1ccc73fe887c5..17aa69ae35584 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -177,14 +177,6 @@ static const AVOption options[]={ {"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, V|D|E, "strict"}, {"experimental", "allow non standardized experimental things", 0, AV_OPT_TYPE_CONST, {.dbl = FF_COMPLIANCE_EXPERIMENTAL }, INT_MIN, INT_MAX, V|D|E, "strict"}, {"b_qoffset", "qp offset between P and B frames", OFFSET(b_quant_offset), AV_OPT_TYPE_FLOAT, {.dbl = 1.25 }, -FLT_MAX, FLT_MAX, V|E}, -#if FF_API_ER -{"er", "set error detection aggressivity", OFFSET(error_recognition), AV_OPT_TYPE_INT, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, A|V|D, "er"}, -{"careful", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_CAREFUL }, INT_MIN, INT_MAX, V|D, "er"}, -{"compliant", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_COMPLIANT }, INT_MIN, INT_MAX, V|D, "er"}, -{"aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"}, -{"very_aggressive", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_VERY_AGGRESSIVE }, INT_MIN, INT_MAX, V|D, "er"}, -{"explode", "abort decoding on error recognition", 0, AV_OPT_TYPE_CONST, {.dbl = FF_ER_EXPLODE }, INT_MIN, INT_MAX, V|D, "er"}, -#endif /* FF_API_ER */ {"err_detect", "set error detection flags", OFFSET(err_recognition), AV_OPT_TYPE_FLAGS, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, A|V|D, "err_detect"}, {"crccheck", "verify embedded CRCs", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_CRCCHECK }, INT_MIN, INT_MAX, V|D, "err_detect"}, {"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, V|D, "err_detect"}, diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 6236f79831ae5..7c0f18aa3434e 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -716,16 +716,6 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD goto free_and_end; } avctx->frame_number = 0; -#if FF_API_ER - - av_log(avctx, AV_LOG_DEBUG, "err{or,}_recognition separate: %d; %d\n", - avctx->error_recognition, avctx->err_recognition); - /* FF_ER_CAREFUL (==1) implies AV_EF_CRCCHECK (== 1<<1 - 1), - FF_ER_COMPLIANT (==2) implies AV_EF_{CRCCHECK,BITSTREAM} (== 1<<2 - 1), et cetera} */ - avctx->err_recognition |= (1<<(avctx->error_recognition-(avctx->error_recognition>=FF_ER_VERY_AGGRESSIVE))) - 1; - av_log(avctx, AV_LOG_DEBUG, "err{or,}_recognition combined: %d; %d\n", - avctx->error_recognition, avctx->err_recognition); -#endif if (HAVE_THREADS && !avctx->thread_opaque) { ret = ff_thread_init(avctx); diff --git a/libavcodec/version.h b/libavcodec/version.h index 363d79a9240d2..e19de49d16e19 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_ER -#define FF_API_ER (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_AVCODEC_INIT #define FF_API_AVCODEC_INIT (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 3211932c513338566b31d990d06957e15a644d13 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 30/71] lavc: remove disabled FF_API_AVCODEC_INIT cruft. --- libavcodec/avcodec.h | 9 --------- libavcodec/utils.c | 5 +---- libavcodec/version.h | 3 --- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index fa9dba7277b20..d724ea1b2c9c2 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3429,15 +3429,6 @@ const char *avcodec_configuration(void); */ const char *avcodec_license(void); -#if FF_API_AVCODEC_INIT -/** - * @deprecated this function is called automatically from avcodec_register() - * and avcodec_register_all(), there is no need to call it manually - */ -attribute_deprecated -void avcodec_init(void); -#endif - /** * Register the codec codec and initialize libavcodec. * diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 7c0f18aa3434e..fadfb0c0aacbd 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -88,10 +88,7 @@ AVCodec *av_codec_next(AVCodec *c){ else return first_avcodec; } -#if !FF_API_AVCODEC_INIT -static -#endif -void avcodec_init(void) +static void avcodec_init(void) { static int initialized = 0; diff --git a/libavcodec/version.h b/libavcodec/version.h index e19de49d16e19..4a7a07ba340cc 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_AVCODEC_INIT -#define FF_API_AVCODEC_INIT (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_LAME_GLOBAL_OPTS #define FF_API_LAME_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) #endif From b9de160c3ef5979bc6c4358c25a17a13706cf410 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 31/71] lavc: remove disabled FF_API_LAME_GLOBAL_OPTS cruft. --- libavcodec/avcodec.h | 3 --- libavcodec/libmp3lame.c | 3 --- libavcodec/options.c | 10 +--------- libavcodec/version.h | 3 --- 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index d724ea1b2c9c2..bc5e09c3fb46e 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -599,9 +599,6 @@ typedef struct RcOverride{ #if FF_API_SNOW_GLOBAL_OPTS #define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC). #endif -#if FF_API_LAME_GLOBAL_OPTS -#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible -#endif /** * @} */ diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index f3c4528c0741f..3ac033f758c8f 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -68,9 +68,6 @@ static av_cold int MP3lame_encode_init(AVCodecContext *avctx) lame_set_VBR_quality(s->gfp, avctx->global_quality / (float)FF_QP2LAMBDA); } lame_set_bWriteVbrTag(s->gfp,0); -#if FF_API_LAME_GLOBAL_OPTS - s->reservoir = avctx->flags2 & CODEC_FLAG2_BIT_RESERVOIR; -#endif lame_set_disable_reservoir(s->gfp, !s->reservoir); if (lame_init_params(s->gfp) < 0) goto err_close; diff --git a/libavcodec/options.c b/libavcodec/options.c index 17aa69ae35584..10041812a9b6d 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -321,12 +321,7 @@ static const AVOption options[]={ {"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"inter_threshold", NULL, OFFSET(inter_threshold), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, -#if FF_API_LAME_GLOBAL_OPTS -#define LAME_DEFAULTS CODEC_FLAG2_BIT_RESERVOIR -#else -#define LAME_DEFAULTS 0 -#endif -{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.dbl = LAME_DEFAULTS }, 0, UINT_MAX, V|A|E|D, "flags2"}, +{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"}, {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"qns", "quantizer noise shaping", OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.dbl = 1 }, 0, INT_MAX, V|E|D, "threads"}, @@ -385,9 +380,6 @@ static const AVOption options[]={ #if FF_API_REQUEST_CHANNELS {"request_channels", "set desired number of audio channels", OFFSET(request_channels), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, A|D}, #endif -#if FF_API_LAME_GLOBAL_OPTS -{"reservoir", "use bit reservoir", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG2_BIT_RESERVOIR }, INT_MIN, INT_MAX, A|E, "flags2"}, -#endif {"bits_per_raw_sample", NULL, OFFSET(bits_per_raw_sample), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"channel_layout", NULL, OFFSET(channel_layout), AV_OPT_TYPE_INT64, {.dbl = DEFAULT }, 0, INT64_MAX, A|E|D, "channel_layout"}, {"request_channel_layout", NULL, OFFSET(request_channel_layout), AV_OPT_TYPE_INT64, {.dbl = DEFAULT }, 0, INT64_MAX, A|D, "request_channel_layout"}, diff --git a/libavcodec/version.h b/libavcodec/version.h index 4a7a07ba340cc..3265ceb9b656f 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_LAME_GLOBAL_OPTS -#define FF_API_LAME_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_SNOW_GLOBAL_OPTS #define FF_API_SNOW_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 96e9b96fcd394dcaeebf7da3f94b0b7de663ecec Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 32/71] lavc: remove disabled FF_API_SNOW_GLOBAL_OPTS cruft. --- libavcodec/avcodec.h | 3 --- libavcodec/version.h | 3 --- 2 files changed, 6 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index bc5e09c3fb46e..0455b7b03abeb 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -596,9 +596,6 @@ typedef struct RcOverride{ #if FF_API_MJPEG_GLOBAL_OPTS #define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG). #endif -#if FF_API_SNOW_GLOBAL_OPTS -#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC). -#endif /** * @} */ diff --git a/libavcodec/version.h b/libavcodec/version.h index 3265ceb9b656f..9eee5c6cf7287 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_SNOW_GLOBAL_OPTS -#define FF_API_SNOW_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_MJPEG_GLOBAL_OPTS #define FF_API_MJPEG_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 99ace37e68c122f0b051ac2937535960238b38f4 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 33/71] lavc: remove disabled FF_API_MJPEG_GLOBAL_OPTS cruft. --- libavcodec/avcodec.h | 11 ----------- libavcodec/mjpegdec.c | 4 ---- libavcodec/options.c | 3 --- libavcodec/version.h | 3 --- 4 files changed, 21 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 0455b7b03abeb..d844170c169ed 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -588,17 +588,6 @@ typedef struct RcOverride{ #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata. #define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping #define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. -/** - * @defgroup deprecated_flags Deprecated codec flags - * Use corresponding private codec options instead. - * @{ - */ -#if FF_API_MJPEG_GLOBAL_OPTS -#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG). -#endif -/** - * @} - */ /* Unsupported options : * Syntax Arithmetic coding (SAC) diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 2ae502ddeb631..d6ed43bbaa817 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -101,10 +101,6 @@ av_cold int ff_mjpeg_decode_init(AVCodecContext *avctx) build_basic_mjpeg_vlc(s); -#if FF_API_MJPEG_GLOBAL_OPTS - if (avctx->flags & CODEC_FLAG_EXTERN_HUFF) - s->extern_huff = 1; -#endif if (s->extern_huff) { av_log(avctx, AV_LOG_INFO, "mjpeg: using external huffman table\n"); init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size * 8); diff --git a/libavcodec/options.c b/libavcodec/options.c index 10041812a9b6d..659f19868ab5f 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -87,9 +87,6 @@ static const AVOption options[]={ {"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"}, {"pass1", "use internal 2pass ratecontrol in first pass mode", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS1 }, INT_MIN, INT_MAX, 0, "flags"}, {"pass2", "use internal 2pass ratecontrol in second pass mode", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PASS2 }, INT_MIN, INT_MAX, 0, "flags"}, -#if FF_API_MJPEG_GLOBAL_OPTS -{"extern_huff", "use external huffman table (for mjpeg)", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_EXTERN_HUFF }, INT_MIN, INT_MAX, 0, "flags"}, -#endif {"gray", "only decode/encode grayscale", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_GRAY }, INT_MIN, INT_MAX, V|E|D, "flags"}, {"emu_edge", "don't draw edges", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_EMU_EDGE }, INT_MIN, INT_MAX, 0, "flags"}, {"psnr", "error[?] variables will be set during encoding", 0, AV_OPT_TYPE_CONST, {.dbl = CODEC_FLAG_PSNR }, INT_MIN, INT_MAX, V|E, "flags"}, diff --git a/libavcodec/version.h b/libavcodec/version.h index 9eee5c6cf7287..150c465d55cf4 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_MJPEG_GLOBAL_OPTS -#define FF_API_MJPEG_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_GET_ALPHA_INFO #define FF_API_GET_ALPHA_INFO (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 8b9b6041d7d4fe284deecc6075a3ce68d715e971 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 34/71] lavc: remove disabled FF_API_GET_ALPHA_INFO cruft. --- libavcodec/avcodec.h | 13 ----------- libavcodec/imgconvert.c | 49 ----------------------------------------- libavcodec/version.h | 3 --- 3 files changed, 65 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index d844170c169ed..6ba2ac982aea6 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -3370,19 +3370,6 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); -#if FF_API_GET_ALPHA_INFO -#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */ -#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */ - -/** - * Tell if an image really has transparent alpha values. - * @return ored mask of FF_ALPHA_xxx constants - */ -attribute_deprecated -int img_get_alpha_info(const AVPicture *src, - enum PixelFormat pix_fmt, int width, int height); -#endif - /* deinterlace a picture */ /* deinterlace - if not supported return -1 */ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index eeffc3f133b91..07b7edfd52dfa 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -855,55 +855,6 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, return 0; } -#if FF_API_GET_ALPHA_INFO -/* NOTE: we scan all the pixels to have an exact information */ -static int get_alpha_info_pal8(const AVPicture *src, int width, int height) -{ - const unsigned char *p; - int src_wrap, ret, x, y; - unsigned int a; - uint32_t *palette = (uint32_t *)src->data[1]; - - p = src->data[0]; - src_wrap = src->linesize[0] - width; - ret = 0; - for(y=0;y> 24; - if (a == 0x00) { - ret |= FF_ALPHA_TRANSP; - } else if (a != 0xff) { - ret |= FF_ALPHA_SEMI_TRANSP; - } - p++; - } - p += src_wrap; - } - return ret; -} - -int img_get_alpha_info(const AVPicture *src, - enum PixelFormat pix_fmt, int width, int height) -{ - const PixFmtInfo *pf = &pix_fmt_info[pix_fmt]; - int ret; - - /* no alpha can be represented in format */ - if (!pf->is_alpha) - return 0; - switch(pix_fmt) { - case PIX_FMT_PAL8: - ret = get_alpha_info_pal8(src, width, height); - break; - default: - /* we do not know, so everything is indicated */ - ret = FF_ALPHA_TRANSP | FF_ALPHA_SEMI_TRANSP; - break; - } - return ret; -} -#endif - #if !(HAVE_MMX && HAVE_YASM) /* filter parameters: [-1 4 2 4 -1] // 8 */ static void deinterlace_line_c(uint8_t *dst, diff --git a/libavcodec/version.h b/libavcodec/version.h index 150c465d55cf4..230f53446f44c 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_GET_ALPHA_INFO -#define FF_API_GET_ALPHA_INFO (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_PARSE_FRAME #define FF_API_PARSE_FRAME (LIBAVCODEC_VERSION_MAJOR < 54) #endif From ac84395d6a31fc990fd28895bcdb5789de7606b8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 35/71] lavc: remove disabled FF_API_PARSE_FRAME cruft. --- libavcodec/avcodec.h | 14 -------------- libavcodec/mpegaudiodec.c | 21 --------------------- libavcodec/mpegaudiodec_float.c | 16 ---------------- libavcodec/options.c | 3 --- libavcodec/version.h | 3 --- 5 files changed, 57 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 6ba2ac982aea6..a9bce7a746fb9 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -603,10 +603,6 @@ typedef struct RcOverride{ * assume the buffer was allocated by avcodec_default_get_buffer. */ #define CODEC_CAP_DR1 0x0002 -#if FF_API_PARSE_FRAME -/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */ -#define CODEC_CAP_PARSE_ONLY 0x0004 -#endif #define CODEC_CAP_TRUNCATED 0x0008 /* Codec can export data for HW decoding (XvMC). */ #define CODEC_CAP_HWACCEL 0x0010 @@ -1610,16 +1606,6 @@ typedef struct AVCodecContext { */ int block_align; -#if FF_API_PARSE_FRAME - /** - * If true, only parsing is done. The frame data is returned. - * Only MPEG audio decoders support this now. - * - encoding: unused - * - decoding: Set by user - */ - attribute_deprecated int parse_only; -#endif - /** * 0-> h263 quant 1-> mpeg quant * - encoding: Set by user. diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index a83b1621fd9de..4ea5146ed6856 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -1727,11 +1727,6 @@ static int decode_frame_adu(AVCodecContext *avctx, void *data, s->frame_size = len; -#if FF_API_PARSE_FRAME - if (avctx->parse_only) - out_size = buf_size; - else -#endif out_size = mp_decode_frame(s, NULL, buf, buf_size); *got_frame_ptr = 1; @@ -1979,11 +1974,7 @@ AVCodec ff_mp1_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, -#if FF_API_PARSE_FRAME - .capabilities = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1, -#else .capabilities = CODEC_CAP_DR1, -#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), }; @@ -1996,11 +1987,7 @@ AVCodec ff_mp2_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, -#if FF_API_PARSE_FRAME - .capabilities = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1, -#else .capabilities = CODEC_CAP_DR1, -#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), }; @@ -2013,11 +2000,7 @@ AVCodec ff_mp3_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, -#if FF_API_PARSE_FRAME - .capabilities = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1, -#else .capabilities = CODEC_CAP_DR1, -#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), }; @@ -2030,11 +2013,7 @@ AVCodec ff_mp3adu_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame_adu, -#if FF_API_PARSE_FRAME - .capabilities = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1, -#else .capabilities = CODEC_CAP_DR1, -#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), }; diff --git a/libavcodec/mpegaudiodec_float.c b/libavcodec/mpegaudiodec_float.c index 02c83afb4cab0..dd37bbc26c8a8 100644 --- a/libavcodec/mpegaudiodec_float.c +++ b/libavcodec/mpegaudiodec_float.c @@ -30,11 +30,7 @@ AVCodec ff_mp1float_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, -#if FF_API_PARSE_FRAME - .capabilities = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1, -#else .capabilities = CODEC_CAP_DR1, -#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP1 (MPEG audio layer 1)"), }; @@ -47,11 +43,7 @@ AVCodec ff_mp2float_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, -#if FF_API_PARSE_FRAME - .capabilities = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1, -#else .capabilities = CODEC_CAP_DR1, -#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP2 (MPEG audio layer 2)"), }; @@ -64,11 +56,7 @@ AVCodec ff_mp3float_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame, -#if FF_API_PARSE_FRAME - .capabilities = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1, -#else .capabilities = CODEC_CAP_DR1, -#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MP3 (MPEG audio layer 3)"), }; @@ -81,11 +69,7 @@ AVCodec ff_mp3adufloat_decoder = { .priv_data_size = sizeof(MPADecodeContext), .init = decode_init, .decode = decode_frame_adu, -#if FF_API_PARSE_FRAME - .capabilities = CODEC_CAP_PARSE_ONLY | CODEC_CAP_DR1, -#else .capabilities = CODEC_CAP_DR1, -#endif .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("ADU (Application Data Unit) MP3 (MPEG audio layer 3)"), }; diff --git a/libavcodec/options.c b/libavcodec/options.c index 659f19868ab5f..c416b4aa4f18b 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -181,9 +181,6 @@ static const AVOption options[]={ {"explode", "abort decoding on minor error detection", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_EXPLODE }, INT_MIN, INT_MAX, V|D, "err_detect"}, {"has_b_frames", NULL, OFFSET(has_b_frames), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, {"block_align", NULL, OFFSET(block_align), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, -#if FF_API_PARSE_FRAME -{"parse_only", NULL, OFFSET(parse_only), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX}, -#endif {"mpeg_quant", "use MPEG quantizers instead of H.263", OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, INT_MIN, INT_MAX, V|E}, {"stats_out", NULL, OFFSET(stats_out), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX}, {"stats_in", NULL, OFFSET(stats_in), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX}, diff --git a/libavcodec/version.h b/libavcodec/version.h index 230f53446f44c..fc3c0c8652456 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_PARSE_FRAME -#define FF_API_PARSE_FRAME (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_INTERNAL_CONTEXT #define FF_API_INTERNAL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 370e923e0b6de85efc84443bc2c9a71f242b2623 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 36/71] lavc: remove disabled FF_API_INTERNAL_CONTEXT cruft. --- libavcodec/avcodec.h | 29 ----------------------------- libavcodec/version.h | 3 --- 2 files changed, 32 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a9bce7a746fb9..8a048d2d93354 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -2029,22 +2029,6 @@ typedef struct AVCodecContext { */ int color_table_id; -#if FF_API_INTERNAL_CONTEXT - /** - * internal_buffer count - * Don't touch, used by libavcodec default_get_buffer(). - * @deprecated this field was moved to an internal context - */ - attribute_deprecated int internal_buffer_count; - - /** - * internal_buffers - * Don't touch, used by libavcodec default_get_buffer(). - * @deprecated this field was moved to an internal context - */ - attribute_deprecated void *internal_buffer; -#endif - /** * Global quality for codecs which cannot change it per frame. * This should be proportional to MPEG-1/2/4 qscale. @@ -2709,19 +2693,6 @@ typedef struct AVCodecContext { */ AVPacket *pkt; -#if FF_API_INTERNAL_CONTEXT - /** - * Whether this is a copy of the context which had init() called on it. - * This is used by multithreading - shared tables and picture pointers - * should be freed from the original context only. - * - encoding: Set by libavcodec. - * - decoding: Set by libavcodec. - * - * @deprecated this field has been moved to an internal context - */ - attribute_deprecated int is_copy; -#endif - /** * Which multithreading methods to use. * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, diff --git a/libavcodec/version.h b/libavcodec/version.h index fc3c0c8652456..b3b999b2cb68f 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_INTERNAL_CONTEXT -#define FF_API_INTERNAL_CONTEXT (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_TIFFENC_COMPLEVEL #define FF_API_TIFFENC_COMPLEVEL (LIBAVCODEC_VERSION_MAJOR < 54) #endif From 10e1ae5efffb8dd2a1932b4d965dbc6dd3338e70 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 37/71] lavc: remove disabled FF_API_TIFFENC_COMPLEVEL cruft. --- libavcodec/tiffenc.c | 16 ---------------- libavcodec/version.h | 3 --- 2 files changed, 19 deletions(-) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 3b2b82991b945..0aa9740a99c6e 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -231,22 +231,6 @@ static int encode_frame(AVCodecContext * avctx, unsigned char *buf, p->key_frame = 1; avctx->coded_frame= &s->picture; -#if FF_API_TIFFENC_COMPLEVEL - if (avctx->compression_level != FF_COMPRESSION_DEFAULT) - av_log(avctx, AV_LOG_WARNING, "Using compression_level to set compression " - "algorithm is deprecated. Please use the compression_algo private " - "option instead.\n"); - if (avctx->compression_level == 0) { - s->compr = TIFF_RAW; - } else if(avctx->compression_level == 2) { - s->compr = TIFF_LZW; -#if CONFIG_ZLIB - } else if ((avctx->compression_level >= 3)) { - s->compr = TIFF_DEFLATE; -#endif - } -#endif - s->width = avctx->width; s->height = avctx->height; s->subsampling[0] = 1; diff --git a/libavcodec/version.h b/libavcodec/version.h index b3b999b2cb68f..b725bb00578ee 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_TIFFENC_COMPLEVEL -#define FF_API_TIFFENC_COMPLEVEL (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_DATA_POINTERS #define FF_API_DATA_POINTERS (LIBAVCODEC_VERSION_MAJOR < 54) #endif From d803775e81bdff4e7f639b3e47c0a6e6f05219c3 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 38/71] lavc: remove disabled FF_API_DATA_POINTERS cruft. --- libavcodec/avcodec.h | 4 ---- libavcodec/version.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 8a048d2d93354..217bef2cc5c8d 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -854,11 +854,7 @@ enum AVSideDataParamChangeFlags { * sizeof(AVFrame) must not be used outside libav*. */ typedef struct AVFrame { -#if FF_API_DATA_POINTERS -#define AV_NUM_DATA_POINTERS 4 -#else #define AV_NUM_DATA_POINTERS 8 -#endif /** * pointer to the picture/channel planes. * This might be different from the first allocated byte diff --git a/libavcodec/version.h b/libavcodec/version.h index b725bb00578ee..c630bf2e57804 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -41,9 +41,6 @@ #ifndef FF_API_REQUEST_CHANNELS #define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_DATA_POINTERS -#define FF_API_DATA_POINTERS (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_OLD_DECODE_AUDIO #define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55) #endif From 3b4aaa61906321b44e9724d9fed11e552406ea50 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 22 Jan 2012 10:56:42 +0100 Subject: [PATCH 39/71] lavc: remove disabled FF_API_AVFRAME_AGE cruft. --- libavcodec/avcodec.h | 7 ------- libavcodec/version.h | 3 --- 2 files changed, 10 deletions(-) diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 217bef2cc5c8d..18db7c55d95b8 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -923,13 +923,6 @@ typedef struct AVFrame { */ int quality; -#if FF_API_AVFRAME_AGE - /** - * @deprecated unused - */ - attribute_deprecated int age; -#endif - /** * is this picture used as reference * The values for this are the same as the MpegEncContext.picture_structure diff --git a/libavcodec/version.h b/libavcodec/version.h index c630bf2e57804..c8ed77e44c744 100644 --- a/libavcodec/version.h +++ b/libavcodec/version.h @@ -44,9 +44,6 @@ #ifndef FF_API_OLD_DECODE_AUDIO #define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55) #endif -#ifndef FF_API_AVFRAME_AGE -#define FF_API_AVFRAME_AGE (LIBAVCODEC_VERSION_MAJOR < 54) -#endif #ifndef FF_API_OLD_ENCODE_AUDIO #define FF_API_OLD_ENCODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55) #endif From 6e9651d1064b6a3e18c24f15d5b03bb9c5fc3393 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:20:36 +0100 Subject: [PATCH 40/71] lavf: remove AVFormatParameters from AVFormatContext.read_header signature --- libavdevice/alsa-audio-dec.c | 3 +-- libavdevice/bktr.c | 2 +- libavdevice/dv1394.c | 2 +- libavdevice/fbdev.c | 3 +-- libavdevice/jack_audio.c | 2 +- libavdevice/libcdio.c | 2 +- libavdevice/libdc1394.c | 10 +++++----- libavdevice/oss_audio.c | 2 +- libavdevice/pulse.c | 3 +-- libavdevice/sndio_dec.c | 3 +-- libavdevice/v4l2.c | 6 +++--- libavdevice/vfwcap.c | 2 +- libavdevice/x11grab.c | 2 +- libavformat/4xm.c | 3 +-- libavformat/aacdec.c | 3 +-- libavformat/adxdec.c | 2 +- libavformat/aea.c | 3 +-- libavformat/aiffdec.c | 3 +-- libavformat/amr.c | 3 +-- libavformat/anm.c | 3 +-- libavformat/apc.c | 2 +- libavformat/ape.c | 2 +- libavformat/applehttp.c | 2 +- libavformat/asfdec.c | 2 +- libavformat/assdec.c | 2 +- libavformat/au.c | 3 +-- libavformat/avformat.h | 3 +-- libavformat/avidec.c | 2 +- libavformat/avisynth.c | 2 +- libavformat/avs.c | 2 +- libavformat/bethsoftvid.c | 3 +-- libavformat/bfi.c | 2 +- libavformat/bink.c | 2 +- libavformat/bmv.c | 2 +- libavformat/c93.c | 3 +-- libavformat/cafdec.c | 3 +-- libavformat/cdg.c | 2 +- libavformat/daud.c | 2 +- libavformat/dfa.c | 3 +-- libavformat/dsicin.c | 2 +- libavformat/dv.c | 3 +-- libavformat/dxa.c | 2 +- libavformat/eacdata.c | 2 +- libavformat/electronicarts.c | 3 +-- libavformat/ffmdec.c | 2 +- libavformat/ffmetadec.c | 2 +- libavformat/filmstripdec.c | 3 +-- libavformat/flacdec.c | 3 +-- libavformat/flic.c | 3 +-- libavformat/flvdec.c | 3 +-- libavformat/gsmdec.c | 2 +- libavformat/gxf.c | 2 +- libavformat/idcin.c | 3 +-- libavformat/idroqdec.c | 3 +-- libavformat/iff.c | 3 +-- libavformat/img2.c | 2 +- libavformat/ipmovie.c | 3 +-- libavformat/iss.c | 2 +- libavformat/iv8.c | 2 +- libavformat/ivfdec.c | 2 +- libavformat/jvdec.c | 3 +-- libavformat/libnut.c | 2 +- libavformat/lmlm4.c | 2 +- libavformat/lxfdec.c | 2 +- libavformat/matroskadec.c | 2 +- libavformat/mm.c | 3 +-- libavformat/mmf.c | 3 +-- libavformat/mov.c | 2 +- libavformat/mp3dec.c | 3 +-- libavformat/mpc.c | 2 +- libavformat/mpc8.c | 2 +- libavformat/mpeg.c | 3 +-- libavformat/mpegts.c | 3 +-- libavformat/msnwc_tcp.c | 2 +- libavformat/mtv.c | 2 +- libavformat/mvi.c | 2 +- libavformat/mxfdec.c | 2 +- libavformat/mxg.c | 2 +- libavformat/ncdec.c | 2 +- libavformat/nsvdec.c | 12 ++++++------ libavformat/nutdec.c | 2 +- libavformat/nuv.c | 2 +- libavformat/oggdec.c | 2 +- libavformat/omadec.c | 3 +-- libavformat/pmpdec.c | 2 +- libavformat/psxstr.c | 3 +-- libavformat/pva.c | 2 +- libavformat/qcp.c | 2 +- libavformat/r3d.c | 2 +- libavformat/rawdec.c | 8 +++----- libavformat/rawdec.h | 6 +++--- libavformat/rl2.c | 3 +-- libavformat/rmdec.c | 2 +- libavformat/rpl.c | 2 +- libavformat/rsodec.c | 2 +- libavformat/rtsp.c | 7 +++---- libavformat/rtspdec.c | 3 +-- libavformat/sapdec.c | 3 +-- libavformat/segafilm.c | 3 +-- libavformat/sierravmd.c | 3 +-- libavformat/siff.c | 2 +- libavformat/smacker.c | 2 +- libavformat/smjpegdec.c | 2 +- libavformat/sol.c | 3 +-- libavformat/soxdec.c | 3 +-- libavformat/spdifdec.c | 2 +- libavformat/srtdec.c | 2 +- libavformat/swfdec.c | 2 +- libavformat/thp.c | 3 +-- libavformat/tiertexseq.c | 2 +- libavformat/tmv.c | 2 +- libavformat/tta.c | 2 +- libavformat/tty.c | 3 +-- libavformat/txd.c | 2 +- libavformat/utils.c | 3 +-- libavformat/vc1test.c | 3 +-- libavformat/vocdec.c | 2 +- libavformat/vqf.c | 2 +- libavformat/wav.c | 5 ++--- libavformat/wc3movie.c | 3 +-- libavformat/westwood_aud.c | 3 +-- libavformat/westwood_vqa.c | 3 +-- libavformat/wtv.c | 2 +- libavformat/wv.c | 3 +-- libavformat/xa.c | 3 +-- libavformat/xmv.c | 3 +-- libavformat/xwma.c | 2 +- libavformat/yop.c | 2 +- libavformat/yuv4mpeg.c | 2 +- 129 files changed, 147 insertions(+), 202 deletions(-) diff --git a/libavdevice/alsa-audio-dec.c b/libavdevice/alsa-audio-dec.c index 5344b1988dbc2..b6a7ac20feeeb 100644 --- a/libavdevice/alsa-audio-dec.c +++ b/libavdevice/alsa-audio-dec.c @@ -52,8 +52,7 @@ #include "alsa-audio.h" -static av_cold int audio_read_header(AVFormatContext *s1, - AVFormatParameters *ap) +static av_cold int audio_read_header(AVFormatContext *s1) { AlsaData *s = s1->priv_data; AVStream *st; diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index 8abe5ef18ff90..b35ec7cc87a4c 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -243,7 +243,7 @@ static int grab_read_packet(AVFormatContext *s1, AVPacket *pkt) return video_buf_size; } -static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) +static int grab_read_header(AVFormatContext *s1) { VideoData *s = s1->priv_data; AVStream *st; diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c index 69e59ec19b6af..f48d2b1506931 100644 --- a/libavdevice/dv1394.c +++ b/libavdevice/dv1394.c @@ -81,7 +81,7 @@ static int dv1394_start(struct dv1394_data *dv) return 0; } -static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap) +static int dv1394_read_header(AVFormatContext * context) { struct dv1394_data *dv = context->priv_data; diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c index 7444f47e570da..f1889ef79e25b 100644 --- a/libavdevice/fbdev.c +++ b/libavdevice/fbdev.c @@ -95,8 +95,7 @@ typedef struct { uint8_t *data; ///< framebuffer data } FBDevContext; -av_cold static int fbdev_read_header(AVFormatContext *avctx, - AVFormatParameters *ap) +av_cold static int fbdev_read_header(AVFormatContext *avctx) { FBDevContext *fbdev = avctx->priv_data; AVStream *st = NULL; diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c index e68559e4d3323..9f1bb23c3b6a7 100644 --- a/libavdevice/jack_audio.c +++ b/libavdevice/jack_audio.c @@ -221,7 +221,7 @@ static void stop_jack(JackData *self) ff_timefilter_destroy(self->timefilter); } -static int audio_read_header(AVFormatContext *context, AVFormatParameters *params) +static int audio_read_header(AVFormatContext *context) { JackData *self = context->priv_data; AVStream *stream; diff --git a/libavdevice/libcdio.c b/libavdevice/libcdio.c index e00272c115993..747adf9141fb5 100644 --- a/libavdevice/libcdio.c +++ b/libavdevice/libcdio.c @@ -46,7 +46,7 @@ typedef struct CDIOContext { int paranoia_mode; } CDIOContext; -static av_cold int read_header(AVFormatContext *ctx, AVFormatParameters *ap) +static av_cold int read_header(AVFormatContext *ctx) { CDIOContext *s = ctx->priv_data; AVStream *st; diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c index ac4bb093d421d..934e128f68d08 100644 --- a/libavdevice/libdc1394.c +++ b/libavdevice/libdc1394.c @@ -117,7 +117,7 @@ static const AVClass libdc1394_class = { }; -static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap, +static inline int dc1394_read_common(AVFormatContext *c, struct dc1394_frame_format **select_fmt, struct dc1394_frame_rate **select_fps) { dc1394_data* dc1394 = c->priv_data; @@ -191,7 +191,7 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap, } #if HAVE_LIBDC1394_1 -static int dc1394_v1_read_header(AVFormatContext *c, AVFormatParameters * ap) +static int dc1394_v1_read_header(AVFormatContext *c) { dc1394_data* dc1394 = c->priv_data; AVStream* vst; @@ -200,7 +200,7 @@ static int dc1394_v1_read_header(AVFormatContext *c, AVFormatParameters * ap) struct dc1394_frame_format *fmt = NULL; struct dc1394_frame_rate *fps = NULL; - if (dc1394_read_common(c,ap,&fmt,&fps) != 0) + if (dc1394_read_common(c, &fmt, &fps) != 0) return -1; /* Now let us prep the hardware. */ @@ -285,7 +285,7 @@ static int dc1394_v1_close(AVFormatContext * context) } #elif HAVE_LIBDC1394_2 -static int dc1394_v2_read_header(AVFormatContext *c, AVFormatParameters * ap) +static int dc1394_v2_read_header(AVFormatContext *c) { dc1394_data* dc1394 = c->priv_data; dc1394camera_list_t *list; @@ -293,7 +293,7 @@ static int dc1394_v2_read_header(AVFormatContext *c, AVFormatParameters * ap) struct dc1394_frame_format *fmt = NULL; struct dc1394_frame_rate *fps = NULL; - if (dc1394_read_common(c,ap,&fmt,&fps) != 0) + if (dc1394_read_common(c, &fmt, &fps) != 0) return -1; /* Now let us prep the hardware. */ diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index 308fc0df970b9..e592c32849e23 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -204,7 +204,7 @@ static int audio_write_trailer(AVFormatContext *s1) /* grab support */ -static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap) +static int audio_read_header(AVFormatContext *s1) { AudioData *s = s1->priv_data; AVStream *st; diff --git a/libavdevice/pulse.c b/libavdevice/pulse.c index bffe3914b8107..da6ee72e8e097 100644 --- a/libavdevice/pulse.c +++ b/libavdevice/pulse.c @@ -66,8 +66,7 @@ static pa_sample_format_t codec_id_to_pulse_format(int codec_id) { } } -static av_cold int pulse_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static av_cold int pulse_read_header(AVFormatContext *s) { PulseData *pd = s->priv_data; AVStream *st; diff --git a/libavdevice/sndio_dec.c b/libavdevice/sndio_dec.c index cc74c38a39838..840dd097a387e 100644 --- a/libavdevice/sndio_dec.c +++ b/libavdevice/sndio_dec.c @@ -28,8 +28,7 @@ #include "sndio_common.h" -static av_cold int audio_read_header(AVFormatContext *s1, - AVFormatParameters *ap) +static av_cold int audio_read_header(AVFormatContext *s1) { SndioData *s = s1->priv_data; AVStream *st; diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 191decde2aa8e..b9941d212c58e 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -543,7 +543,7 @@ static void mmap_close(struct video_data *s) av_free(s->buf_len); } -static int v4l2_set_parameters(AVFormatContext *s1, AVFormatParameters *ap) +static int v4l2_set_parameters(AVFormatContext *s1) { struct video_data *s = s1->priv_data; struct v4l2_input input = { 0 }; @@ -678,7 +678,7 @@ static uint32_t device_try_init(AVFormatContext *s1, return desired_format; } -static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) +static int v4l2_read_header(AVFormatContext *s1) { struct video_data *s = s1->priv_data; AVStream *st; @@ -766,7 +766,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) s->frame_format = desired_format; - if ((res = v4l2_set_parameters(s1, ap) < 0)) + if ((res = v4l2_set_parameters(s1) < 0)) goto out; st->codec->pix_fmt = fmt_v4l2ff(desired_format, codec_id); diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index b5baee3b79352..44cb813bd95e6 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -238,7 +238,7 @@ static int vfw_read_close(AVFormatContext *s) return 0; } -static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int vfw_read_header(AVFormatContext *s) { struct vfw_ctx *ctx = s->priv_data; AVCodecContext *codec; diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index 9d12b2f731e15..bf3011bac8fce 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -154,7 +154,7 @@ x11grab_region_win_init(struct x11_grab *s) * */ static int -x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) +x11grab_read_header(AVFormatContext *s1) { struct x11_grab *x11grab = s1->priv_data; Display *dpy; diff --git a/libavformat/4xm.c b/libavformat/4xm.c index ccbe3add3f497..fa6a26bcc2aab 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -91,8 +91,7 @@ static int fourxm_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int fourxm_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int fourxm_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; unsigned int fourcc_tag; diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index 25c59108fe6a8..df94d15831b31 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -61,8 +61,7 @@ static int adts_aac_probe(AVProbeData *p) else return 0; } -static int adts_aac_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int adts_aac_read_header(AVFormatContext *s) { AVStream *st; diff --git a/libavformat/adxdec.c b/libavformat/adxdec.c index ab11d832d8b1d..243160940ce0d 100644 --- a/libavformat/adxdec.c +++ b/libavformat/adxdec.c @@ -62,7 +62,7 @@ static int adx_read_packet(AVFormatContext *s, AVPacket *pkt) return 0; } -static int adx_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int adx_read_header(AVFormatContext *s) { ADXDemuxerContext *c = s->priv_data; AVCodecContext *avctx; diff --git a/libavformat/aea.c b/libavformat/aea.c index b33b45f927ded..b62e56030a1cb 100644 --- a/libavformat/aea.c +++ b/libavformat/aea.c @@ -54,8 +54,7 @@ static int aea_read_probe(AVProbeData *p) return 0; } -static int aea_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int aea_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index 0e69d02c8c7c4..46396cda6f036 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -174,8 +174,7 @@ static int aiff_probe(AVProbeData *p) } /* aiff input */ -static int aiff_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int aiff_read_header(AVFormatContext *s) { int size, filesize; int64_t offset = 0; diff --git a/libavformat/amr.c b/libavformat/amr.c index b52ac491289ef..708eace1f9a0b 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -76,8 +76,7 @@ static int amr_probe(AVProbeData *p) } /* amr input */ -static int amr_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int amr_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/anm.c b/libavformat/anm.c index 7ceb2d8918d2f..f236ce6eeda64 100644 --- a/libavformat/anm.c +++ b/libavformat/anm.c @@ -76,8 +76,7 @@ static int find_record(const AnmDemuxContext *anm, int record) return AVERROR_INVALIDDATA; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AnmDemuxContext *anm = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/apc.c b/libavformat/apc.c index 47ab5c821b2e8..30ddae3665b67 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -30,7 +30,7 @@ static int apc_probe(AVProbeData *p) return 0; } -static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int apc_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/ape.c b/libavformat/ape.c index a60626e133a20..080e0ba8f6d9e 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -152,7 +152,7 @@ static void ape_dumpinfo(AVFormatContext * s, APEContext * ape_ctx) #endif } -static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) +static int ape_read_header(AVFormatContext * s) { AVIOContext *pb = s->pb; APEContext *ape = s->priv_data; diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c index f62e2d074f1d7..32a51fede1ada 100644 --- a/libavformat/applehttp.c +++ b/libavformat/applehttp.c @@ -443,7 +443,7 @@ static int read_data(void *opaque, uint8_t *buf, int buf_size) goto restart; } -static int applehttp_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int applehttp_read_header(AVFormatContext *s) { AppleHTTPContext *c = s->priv_data; int ret = 0, i, j, stream_offset = 0; diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 91d285e8b5c4a..c5391a9d628d5 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -580,7 +580,7 @@ static int asf_read_marker(AVFormatContext *s, int64_t size) return 0; } -static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int asf_read_header(AVFormatContext *s) { ASFContext *asf = s->priv_data; ff_asf_guid g; diff --git a/libavformat/assdec.c b/libavformat/assdec.c index b100f2c5d1219..bb1f525616c57 100644 --- a/libavformat/assdec.c +++ b/libavformat/assdec.c @@ -73,7 +73,7 @@ static int event_cmp(uint8_t **a, uint8_t **b) return get_pts(*a) - get_pts(*b); } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { int i, len, header_remaining; ASSContext *ass = s->priv_data; diff --git a/libavformat/au.c b/libavformat/au.c index c6fb8dbaa95d3..e56869b4b9217 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -118,8 +118,7 @@ static int au_probe(AVProbeData *p) } /* au input */ -static int au_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int au_read_header(AVFormatContext *s) { int size; unsigned int tag; diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 18a80ac29172f..ec343ba90d500 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -491,8 +491,7 @@ typedef struct AVInputFormat { * additional parameters. Only used in raw format right * now. 'av_new_stream' should be called to create new streams. */ - int (*read_header)(struct AVFormatContext *, - AVFormatParameters *ap); + int (*read_header)(struct AVFormatContext *); /** * Read one packet and put it in 'pkt'. pts and flags are also diff --git a/libavformat/avidec.c b/libavformat/avidec.c index b4ccfb50f8a92..26ccaadd12b4e 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -325,7 +325,7 @@ static void avi_read_nikon(AVFormatContext *s, uint64_t end) } } -static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int avi_read_header(AVFormatContext *s) { AVIContext *avi = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index 9449c1b608a47..3b695a9a0aaa1 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -41,7 +41,7 @@ typedef struct { int next_stream; } AVISynthContext; -static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int avisynth_read_header(AVFormatContext *s) { AVISynthContext *avs = s->priv_data; HRESULT res; diff --git a/libavformat/avs.c b/libavformat/avs.c index c6ccbb2cd22da..32e7546d60c4c 100644 --- a/libavformat/avs.c +++ b/libavformat/avs.c @@ -55,7 +55,7 @@ static int avs_probe(AVProbeData * p) return 0; } -static int avs_read_header(AVFormatContext * s, AVFormatParameters * ap) +static int avs_read_header(AVFormatContext * s) { AvsFormat *avs = s->priv_data; diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c index 7705fcb5f644f..2c8a980730dab 100644 --- a/libavformat/bethsoftvid.c +++ b/libavformat/bethsoftvid.c @@ -57,8 +57,7 @@ static int vid_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int vid_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int vid_read_header(AVFormatContext *s) { BVID_DemuxContext *vid = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/bfi.c b/libavformat/bfi.c index bb02e85581d88..718e721356446 100644 --- a/libavformat/bfi.c +++ b/libavformat/bfi.c @@ -47,7 +47,7 @@ static int bfi_probe(AVProbeData * p) return 0; } -static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap) +static int bfi_read_header(AVFormatContext * s) { BFIContext *bfi = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/bink.c b/libavformat/bink.c index ecf6905843636..d6af54f96e892 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -68,7 +68,7 @@ static int probe(AVProbeData *p) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { BinkDemuxContext *bink = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/bmv.c b/libavformat/bmv.c index 1077efa5738d6..ebf59e9f23527 100644 --- a/libavformat/bmv.c +++ b/libavformat/bmv.c @@ -38,7 +38,7 @@ typedef struct BMVContext { int64_t audio_pos; } BMVContext; -static int bmv_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int bmv_read_header(AVFormatContext *s) { AVStream *st, *ast; BMVContext *c = s->priv_data; diff --git a/libavformat/c93.c b/libavformat/c93.c index d82086d29647a..21058da727fd8 100644 --- a/libavformat/c93.c +++ b/libavformat/c93.c @@ -57,8 +57,7 @@ static int probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream *video; AVIOContext *pb = s->pb; diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index 4efc40f1af8a9..abde78d56cc50 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -194,8 +194,7 @@ static void read_info_chunk(AVFormatContext *s, int64_t size) } } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; CaffContext *caf = s->priv_data; diff --git a/libavformat/cdg.c b/libavformat/cdg.c index 0980df7ebfe08..c0adf3b917ee2 100644 --- a/libavformat/cdg.c +++ b/libavformat/cdg.c @@ -26,7 +26,7 @@ #define CDG_COMMAND 0x09 #define CDG_MASK 0x3F -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream *vst; int ret; diff --git a/libavformat/daud.c b/libavformat/daud.c index 9deca33bdef66..8de4aad119da0 100644 --- a/libavformat/daud.c +++ b/libavformat/daud.c @@ -20,7 +20,7 @@ */ #include "avformat.h" -static int daud_header(AVFormatContext *s, AVFormatParameters *ap) { +static int daud_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) return AVERROR(ENOMEM); diff --git a/libavformat/dfa.c b/libavformat/dfa.c index ac49b6104b147..283a60716852b 100644 --- a/libavformat/dfa.c +++ b/libavformat/dfa.c @@ -31,8 +31,7 @@ static int dfa_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int dfa_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int dfa_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index 801ca6af223eb..f8ba68d9624b2 100644 --- a/libavformat/dsicin.c +++ b/libavformat/dsicin.c @@ -91,7 +91,7 @@ static int cin_read_file_header(CinDemuxContext *cin, AVIOContext *pb) { return 0; } -static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int cin_read_header(AVFormatContext *s) { int rc; CinDemuxContext *cin = s->priv_data; diff --git a/libavformat/dv.c b/libavformat/dv.c index 805f25271c540..4106dfdce3760 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -402,8 +402,7 @@ typedef struct RawDVContext { uint8_t buf[DV_MAX_FRAME_SIZE]; } RawDVContext; -static int dv_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int dv_read_header(AVFormatContext *s) { unsigned state, marker_pos = 0; RawDVContext *c = s->priv_data; diff --git a/libavformat/dxa.c b/libavformat/dxa.c index 0cc803d7bfc0e..13d206046579c 100644 --- a/libavformat/dxa.c +++ b/libavformat/dxa.c @@ -51,7 +51,7 @@ static int dxa_probe(AVProbeData *p) return 0; } -static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int dxa_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; DXAContext *c = s->priv_data; diff --git a/libavformat/eacdata.c b/libavformat/eacdata.c index 8fe144e6a9b32..ff9f1c8ef5285 100644 --- a/libavformat/eacdata.c +++ b/libavformat/eacdata.c @@ -45,7 +45,7 @@ static int cdata_probe(AVProbeData *p) return 0; } -static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int cdata_read_header(AVFormatContext *s) { CdataDemuxContext *cdata = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index 01ba479fac6e7..a10e64592c823 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -400,8 +400,7 @@ static int ea_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int ea_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int ea_read_header(AVFormatContext *s) { EaDemuxContext *ea = s->priv_data; AVStream *st; diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index 9cee3ad64fb33..259b6ead3fa74 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -259,7 +259,7 @@ static int ffm_close(AVFormatContext *s) } -static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int ffm_read_header(AVFormatContext *s) { FFMContext *ffm = s->priv_data; AVStream *st; diff --git a/libavformat/ffmetadec.c b/libavformat/ffmetadec.c index 21e5ee9da4193..9774e946b25f4 100644 --- a/libavformat/ffmetadec.c +++ b/libavformat/ffmetadec.c @@ -123,7 +123,7 @@ static int read_tag(uint8_t *line, AVDictionary **m) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVDictionary **m = &s->metadata; uint8_t line[1024]; diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c index 648fb4f384d6b..8d7b3044720ea 100644 --- a/libavformat/filmstripdec.c +++ b/libavformat/filmstripdec.c @@ -34,8 +34,7 @@ typedef struct { int leading; } FilmstripDemuxContext; -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { FilmstripDemuxContext *film = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index 9e083d116c5c9..d127dc209f0b4 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -27,8 +27,7 @@ #include "vorbiscomment.h" #include "libavcodec/bytestream.h" -static int flac_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int flac_read_header(AVFormatContext *s) { int ret, metadata_last=0, metadata_type, metadata_size, found_streaminfo=0; uint8_t header[4]; diff --git a/libavformat/flic.c b/libavformat/flic.c index 7edc46e2a7b2a..849ec6912da13 100644 --- a/libavformat/flic.c +++ b/libavformat/flic.c @@ -83,8 +83,7 @@ static int flic_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int flic_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int flic_read_header(AVFormatContext *s) { FlicDemuxContext *flic = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 2f770b30f24f8..9296ef9d31469 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -368,8 +368,7 @@ static AVStream *create_stream(AVFormatContext *s, int is_audio){ return st; } -static int flv_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int flv_read_header(AVFormatContext *s) { int offset, flags; diff --git a/libavformat/gsmdec.c b/libavformat/gsmdec.c index 443f820ad8ad0..5d6495860ae10 100644 --- a/libavformat/gsmdec.c +++ b/libavformat/gsmdec.c @@ -54,7 +54,7 @@ static int gsm_read_packet(AVFormatContext *s, AVPacket *pkt) return 0; } -static int gsm_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int gsm_read_header(AVFormatContext *s) { GSMDemuxerContext *c = s->priv_data; AVStream *st = avformat_new_stream(s, NULL); diff --git a/libavformat/gxf.c b/libavformat/gxf.c index ebc4eeafa529b..fcf6c9385810b 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -259,7 +259,7 @@ static void gxf_read_index(AVFormatContext *s, int pkt_len) { avio_skip(pb, pkt_len); } -static int gxf_header(AVFormatContext *s, AVFormatParameters *ap) { +static int gxf_header(AVFormatContext *s) { AVIOContext *pb = s->pb; GXFPktType pkt_type; int map_len; diff --git a/libavformat/idcin.c b/libavformat/idcin.c index b26f2aaa8b68c..eb2cb8bf55f67 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -138,8 +138,7 @@ static int idcin_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2; } -static int idcin_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int idcin_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; IdcinDemuxContext *idcin = s->priv_data; diff --git a/libavformat/idroqdec.c b/libavformat/idroqdec.c index d63c395b791dc..5c1528de0fc85 100644 --- a/libavformat/idroqdec.c +++ b/libavformat/idroqdec.c @@ -66,8 +66,7 @@ static int roq_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int roq_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int roq_read_header(AVFormatContext *s) { RoqDemuxContext *roq = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/iff.c b/libavformat/iff.c index b895cf2e67886..f5f39f06aa877 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -107,8 +107,7 @@ static int iff_probe(AVProbeData *p) return 0; } -static int iff_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int iff_read_header(AVFormatContext *s) { IffDemuxContext *iff = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/img2.c b/libavformat/img2.c index e3e7d11e43d73..7203cb62d99cf 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -205,7 +205,7 @@ enum CodecID av_guess_image2_codec(const char *filename){ } #endif -static int read_header(AVFormatContext *s1, AVFormatParameters *ap) +static int read_header(AVFormatContext *s1) { VideoData *s = s1->priv_data; int first_index, last_index, ret = 0; diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index daa44b173f61f..152b40ec7ba35 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -535,8 +535,7 @@ static int ipmovie_probe(AVProbeData *p) return 0; } -static int ipmovie_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int ipmovie_read_header(AVFormatContext *s) { IPMVEContext *ipmovie = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/iss.c b/libavformat/iss.c index ec6509c8b0333..c2ba1f0eb5306 100644 --- a/libavformat/iss.c +++ b/libavformat/iss.c @@ -65,7 +65,7 @@ static int iss_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap) +static av_cold int iss_read_header(AVFormatContext *s) { IssDemuxContext *iss = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/iv8.c b/libavformat/iv8.c index 4f25441e8cc74..903de6f8a4d48 100644 --- a/libavformat/iv8.c +++ b/libavformat/iv8.c @@ -37,7 +37,7 @@ static int probe(AVProbeData *p) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream *st; diff --git a/libavformat/ivfdec.c b/libavformat/ivfdec.c index 03f799556de99..ae84a6fd81625 100644 --- a/libavformat/ivfdec.c +++ b/libavformat/ivfdec.c @@ -32,7 +32,7 @@ static int probe(AVProbeData *p) return 0; } -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { AVStream *st; AVRational time_base; diff --git a/libavformat/jvdec.c b/libavformat/jvdec.c index c24b0c2b1ae50..82d96ca071545 100644 --- a/libavformat/jvdec.c +++ b/libavformat/jvdec.c @@ -58,8 +58,7 @@ static int read_probe(AVProbeData *pd) return 0; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { JVDemuxContext *jv = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/libnut.c b/libavformat/libnut.c index 56e8bfc98d5a8..3bb355852e6f5 100644 --- a/libavformat/libnut.c +++ b/libavformat/libnut.c @@ -186,7 +186,7 @@ static off_t av_seek(void * h, long long pos, int whence) { return avio_seek(bc, pos, whence); } -static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) { +static int nut_read_header(AVFormatContext * avf) { NUTContext * priv = avf->priv_data; AVIOContext * bc = avf->pb; nut_demuxer_opts_tt dopts = { diff --git a/libavformat/lmlm4.c b/libavformat/lmlm4.c index 5f26c4becaae5..8daf7b45c45b8 100644 --- a/libavformat/lmlm4.c +++ b/libavformat/lmlm4.c @@ -58,7 +58,7 @@ static int lmlm4_probe(AVProbeData * pd) { return 0; } -static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) { +static int lmlm4_read_header(AVFormatContext *s) { AVStream *st; if (!(st = avformat_new_stream(s, NULL))) diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c index b3afa7e857b3a..ee12dfbb98af9 100644 --- a/libavformat/lxfdec.c +++ b/libavformat/lxfdec.c @@ -196,7 +196,7 @@ static int get_packet_header(AVFormatContext *s, uint8_t *header, uint32_t *form return ret; } -static int lxf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int lxf_read_header(AVFormatContext *s) { LXFDemuxContext *lxf = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 5b919449f5ada..8f34289eb54f3 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1269,7 +1269,7 @@ static int matroska_aac_sri(int samplerate) return sri; } -static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int matroska_read_header(AVFormatContext *s) { MatroskaDemuxContext *matroska = s->priv_data; EbmlList *attachements_list = &matroska->attachments; diff --git a/libavformat/mm.c b/libavformat/mm.c index 341cf26a1cc25..d25c978ac41d1 100644 --- a/libavformat/mm.c +++ b/libavformat/mm.c @@ -81,8 +81,7 @@ static int probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2; } -static int read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { MmDemuxContext *mm = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mmf.c b/libavformat/mmf.c index 8e4f2de7670c9..4d34cf2ac433f 100644 --- a/libavformat/mmf.c +++ b/libavformat/mmf.c @@ -180,8 +180,7 @@ static int mmf_probe(AVProbeData *p) } /* mmf input */ -static int mmf_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int mmf_read_header(AVFormatContext *s) { MMFContext *mmf = s->priv_data; unsigned int tag; diff --git a/libavformat/mov.c b/libavformat/mov.c index 9fb4a21c8c39d..b7d8a5593347b 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -2551,7 +2551,7 @@ static void mov_read_chapters(AVFormatContext *s) avio_seek(sc->pb, cur_pos, SEEK_SET); } -static int mov_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mov_read_header(AVFormatContext *s) { MOVContext *mov = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 185d7b8676108..11f57ce1a9f1a 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -132,8 +132,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base) return 0; } -static int mp3_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int mp3_read_header(AVFormatContext *s) { AVStream *st; int64_t off; diff --git a/libavformat/mpc.c b/libavformat/mpc.c index 943121e5fde31..86e6f8e5b8c5e 100644 --- a/libavformat/mpc.c +++ b/libavformat/mpc.c @@ -52,7 +52,7 @@ static int mpc_probe(AVProbeData *p) return 0; } -static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mpc_read_header(AVFormatContext *s) { MPCContext *c = s->priv_data; AVStream *st; diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index d9560496f760d..3c51ccd037bde 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -188,7 +188,7 @@ static void mpc8_handle_chunk(AVFormatContext *s, int tag, int64_t chunk_pos, in } } -static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mpc8_read_header(AVFormatContext *s) { MPCContext *c = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index f740a25f89f96..6a26d6d292a26 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -104,8 +104,7 @@ typedef struct MpegDemuxContext { int sofdec; } MpegDemuxContext; -static int mpegps_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int mpegps_read_header(AVFormatContext *s) { MpegDemuxContext *m = s->priv_data; const char *sofdec = "Sofdec"; diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 15688a9747375..b105d8c108be5 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1870,8 +1870,7 @@ static int parse_pcr(int64_t *ppcr_high, int *ppcr_low, return 0; } -static int mpegts_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int mpegts_read_header(AVFormatContext *s) { MpegTSContext *ts = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/msnwc_tcp.c b/libavformat/msnwc_tcp.c index 7e76c07ca6916..9c0c3c79f4d9c 100644 --- a/libavformat/msnwc_tcp.c +++ b/libavformat/msnwc_tcp.c @@ -70,7 +70,7 @@ static int msnwc_tcp_probe(AVProbeData *p) return -1; } -static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap) +static int msnwc_tcp_read_header(AVFormatContext *ctx) { AVIOContext *pb = ctx->pb; AVCodecContext *codec; diff --git a/libavformat/mtv.c b/libavformat/mtv.c index 224373381211a..2af9c2dd56696 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -75,7 +75,7 @@ static int mtv_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mtv_read_header(AVFormatContext *s) { MTVDemuxContext *mtv = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mvi.c b/libavformat/mvi.c index 4782aad479719..6e937b2acda18 100644 --- a/libavformat/mvi.c +++ b/libavformat/mvi.c @@ -36,7 +36,7 @@ typedef struct MviDemuxContext { int video_frame_size; } MviDemuxContext; -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { MviDemuxContext *mvi = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index bbe862ff6aa0e..96b662f4313f6 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1648,7 +1648,7 @@ static inline void compute_partition_essence_offset(AVFormatContext *s, } } -static int mxf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mxf_read_header(AVFormatContext *s) { MXFContext *mxf = s->priv_data; KLVPacket klv; diff --git a/libavformat/mxg.c b/libavformat/mxg.c index a74036436f7ff..3f8c3e339e49b 100644 --- a/libavformat/mxg.c +++ b/libavformat/mxg.c @@ -37,7 +37,7 @@ typedef struct MXGContext { unsigned int cache_size; } MXGContext; -static int mxg_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int mxg_read_header(AVFormatContext *s) { AVStream *video_st, *audio_st; MXGContext *mxg = s->priv_data; diff --git a/libavformat/ncdec.c b/libavformat/ncdec.c index ab1d302a82102..44e227ad8f7c6 100644 --- a/libavformat/ncdec.c +++ b/libavformat/ncdec.c @@ -44,7 +44,7 @@ static int nc_probe(AVProbeData *probe_packet) return 0; } -static int nc_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int nc_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index 18dfde2867ee4..b5bc87aa8c873 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -269,7 +269,7 @@ static int nsv_resync(AVFormatContext *s) return -1; } -static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) +static int nsv_parse_NSVf_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; @@ -391,7 +391,7 @@ static int nsv_parse_NSVf_header(AVFormatContext *s, AVFormatParameters *ap) return 0; } -static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) +static int nsv_parse_NSVs_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; AVIOContext *pb = s->pb; @@ -512,7 +512,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) return -1; } -static int nsv_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int nsv_read_header(AVFormatContext *s) { NSVContext *nsv = s->priv_data; int i, err; @@ -527,10 +527,10 @@ static int nsv_read_header(AVFormatContext *s, AVFormatParameters *ap) if (nsv_resync(s) < 0) return -1; if (nsv->state == NSV_FOUND_NSVF) - err = nsv_parse_NSVf_header(s, ap); + err = nsv_parse_NSVf_header(s); /* we need the first NSVs also... */ if (nsv->state == NSV_FOUND_NSVS) { - err = nsv_parse_NSVs_header(s, ap); + err = nsv_parse_NSVs_header(s); break; /* we just want the first one */ } } @@ -571,7 +571,7 @@ static int nsv_read_chunk(AVFormatContext *s, int fill_header) if (err < 0) return err; if (nsv->state == NSV_FOUND_NSVS) - err = nsv_parse_NSVs_header(s, NULL); + err = nsv_parse_NSVs_header(s); if (err < 0) return err; if (nsv->state != NSV_HAS_READ_NSVS && nsv->state != NSV_FOUND_BEEF) diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 9cec89e622119..8d1b17ddc9178 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -596,7 +596,7 @@ static int find_and_decode_index(NUTContext *nut){ return ret; } -static int nut_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int nut_read_header(AVFormatContext *s) { NUTContext *nut = s->priv_data; AVIOContext *bc = s->pb; diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 262c4c58e95d8..86be778e4c06b 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -122,7 +122,7 @@ static int get_codec_data(AVIOContext *pb, AVStream *vst, return 0; } -static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { +static int nuv_header(AVFormatContext *s) { NUVContext *ctx = s->priv_data; AVIOContext *pb = s->pb; char id_string[12]; diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 36e2c452da467..79aa98f83d3a9 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -494,7 +494,7 @@ static int ogg_get_length(AVFormatContext *s) return 0; } -static int ogg_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int ogg_read_header(AVFormatContext *s) { struct ogg *ogg = s->priv_data; int ret, i; diff --git a/libavformat/omadec.c b/libavformat/omadec.c index 0beed7165d172..3bff790a56721 100644 --- a/libavformat/omadec.c +++ b/libavformat/omadec.c @@ -256,8 +256,7 @@ static int decrypt_init(AVFormatContext *s, ID3v2ExtraMeta *em, uint8_t *header) return 0; } -static int oma_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int oma_read_header(AVFormatContext *s) { int ret, framesize, jsflag, samplerate; uint32_t codec_params; diff --git a/libavformat/pmpdec.c b/libavformat/pmpdec.c index 96c7048570669..9df39be0a19cd 100644 --- a/libavformat/pmpdec.c +++ b/libavformat/pmpdec.c @@ -39,7 +39,7 @@ static int pmp_probe(AVProbeData *p) return 0; } -static int pmp_header(AVFormatContext *s, AVFormatParameters *ap) +static int pmp_header(AVFormatContext *s) { PMPContext *pmp = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index d22de0887f921..988d1f095e3a0 100644 --- a/libavformat/psxstr.c +++ b/libavformat/psxstr.c @@ -96,8 +96,7 @@ static int str_probe(AVProbeData *p) return 50; } -static int str_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int str_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; StrDemuxContext *str = s->priv_data; diff --git a/libavformat/pva.c b/libavformat/pva.c index 263fb5fdc1262..21373a5367219 100644 --- a/libavformat/pva.c +++ b/libavformat/pva.c @@ -41,7 +41,7 @@ static int pva_probe(AVProbeData * pd) { return 0; } -static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) { +static int pva_read_header(AVFormatContext *s) { AVStream *st; if (!(st = avformat_new_stream(s, NULL))) diff --git a/libavformat/qcp.c b/libavformat/qcp.c index 191e9dd85b846..6545a1cdfdc2e 100644 --- a/libavformat/qcp.c +++ b/libavformat/qcp.c @@ -80,7 +80,7 @@ static int qcp_probe(AVProbeData *pd) return 0; } -static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int qcp_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; QCPContext *c = s->priv_data; diff --git a/libavformat/r3d.c b/libavformat/r3d.c index 73e73986ffb2c..7f0e8de0e462b 100644 --- a/libavformat/r3d.c +++ b/libavformat/r3d.c @@ -159,7 +159,7 @@ static void r3d_read_reos(AVFormatContext *s) avio_skip(s->pb, 6*4); } -static int r3d_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int r3d_read_header(AVFormatContext *s) { R3DContext *r3d = s->priv_data; Atom atom; diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index 3e2dd059404e5..9400a0bd32703 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -29,7 +29,7 @@ #include "libavutil/pixdesc.h" /* raw input */ -int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap) +int ff_raw_read_header(AVFormatContext *s) { AVStream *st; enum CodecID id; @@ -120,8 +120,7 @@ int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt) return ret; } -int ff_raw_audio_read_header(AVFormatContext *s, - AVFormatParameters *ap) +int ff_raw_audio_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) @@ -136,8 +135,7 @@ int ff_raw_audio_read_header(AVFormatContext *s, } /* MPEG-1/H.263 input */ -int ff_raw_video_read_header(AVFormatContext *s, - AVFormatParameters *ap) +int ff_raw_video_read_header(AVFormatContext *s) { AVStream *st; FFRawVideoDemuxerContext *s1 = s->priv_data; diff --git a/libavformat/rawdec.h b/libavformat/rawdec.h index 136f6c2d48931..cfb1689cd9701 100644 --- a/libavformat/rawdec.h +++ b/libavformat/rawdec.h @@ -41,13 +41,13 @@ typedef struct FFRawVideoDemuxerContext { extern const AVOption ff_rawvideo_options[]; -int ff_raw_read_header(AVFormatContext *s, AVFormatParameters *ap); +int ff_raw_read_header(AVFormatContext *s); int ff_raw_read_partial_packet(AVFormatContext *s, AVPacket *pkt); -int ff_raw_audio_read_header(AVFormatContext *s, AVFormatParameters *ap); +int ff_raw_audio_read_header(AVFormatContext *s); -int ff_raw_video_read_header(AVFormatContext *s, AVFormatParameters *ap); +int ff_raw_video_read_header(AVFormatContext *s); #define FF_RAWVIDEO_DEMUXER_CLASS(name)\ static const AVClass name ## _demuxer_class = {\ diff --git a/libavformat/rl2.c b/libavformat/rl2.c index b2be7c0ca9b3a..8ec76ff9212b5 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -72,8 +72,7 @@ static int rl2_probe(AVProbeData *p) * @param ap format parameters * @return 0 on success, AVERROR otherwise */ -static av_cold int rl2_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static av_cold int rl2_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 75e4833c4c5ce..ee8abdd80037a 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -403,7 +403,7 @@ static int rm_read_header_old(AVFormatContext *s) return rm_read_audio_stream_info(s, s->pb, st, st->priv_data, 1); } -static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int rm_read_header(AVFormatContext *s) { RMDemuxContext *rm = s->priv_data; AVStream *st; diff --git a/libavformat/rpl.c b/libavformat/rpl.c index 0fa00f3f52a42..3454fbe49140e 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -110,7 +110,7 @@ static AVRational read_fps(const char* line, int* error) return result; } -static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int rpl_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; RPLContext *rpl = s->priv_data; diff --git a/libavformat/rsodec.c b/libavformat/rsodec.c index 54a3faa076137..c148b2ee57c2c 100644 --- a/libavformat/rsodec.c +++ b/libavformat/rsodec.c @@ -27,7 +27,7 @@ #include "riff.h" #include "rso.h" -static int rso_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int rso_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; int id, rate, bps; diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 487e910c17688..0c42829d39a50 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1849,7 +1849,7 @@ static int sdp_probe(AVProbeData *p1) return 0; } -static int sdp_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int sdp_read_header(AVFormatContext *s) { RTSPState *rt = s->priv_data; RTSPStream *rtsp_st; @@ -1935,8 +1935,7 @@ static int rtp_probe(AVProbeData *p) return 0; } -static int rtp_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int rtp_read_header(AVFormatContext *s) { uint8_t recvbuf[1500]; char host[500], sdp[500]; @@ -2013,7 +2012,7 @@ static int rtp_read_header(AVFormatContext *s, rt->media_type_mask = (1 << (AVMEDIA_TYPE_DATA+1)) - 1; - ret = sdp_read_header(s, ap); + ret = sdp_read_header(s); s->pb = NULL; return ret; diff --git a/libavformat/rtspdec.c b/libavformat/rtspdec.c index 1b4982f212248..785d162b413dc 100644 --- a/libavformat/rtspdec.c +++ b/libavformat/rtspdec.c @@ -150,8 +150,7 @@ static int rtsp_probe(AVProbeData *p) return 0; } -static int rtsp_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int rtsp_read_header(AVFormatContext *s) { RTSPState *rt = s->priv_data; int ret; diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c index 531cfd204dad4..aa176c73ee0f7 100644 --- a/libavformat/sapdec.c +++ b/libavformat/sapdec.c @@ -60,8 +60,7 @@ static int sap_read_close(AVFormatContext *s) return 0; } -static int sap_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int sap_read_header(AVFormatContext *s) { struct SAPState *sap = s->priv_data; char host[1024], path[1024], url[1024]; diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index 5c346a75bb60a..83ba4f06adda5 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -75,8 +75,7 @@ static int film_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int film_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int film_read_header(AVFormatContext *s) { FilmDemuxContext *film = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 81ff46fea0e95..48b192e04cb12 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -78,8 +78,7 @@ static int vmd_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2; } -static int vmd_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int vmd_read_header(AVFormatContext *s) { VmdDemuxContext *vmd = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/siff.c b/libavformat/siff.c index 9f4d73374c79c..7e5b0b4d8cde0 100644 --- a/libavformat/siff.c +++ b/libavformat/siff.c @@ -153,7 +153,7 @@ static int siff_parse_soun(AVFormatContext *s, SIFFContext *c, AVIOContext *pb) return create_audio_stream(s, c); } -static int siff_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int siff_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; SIFFContext *c = s->priv_data; diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 770f5364d3014..adc67e727e5d6 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -98,7 +98,7 @@ static int smacker_probe(AVProbeData *p) return 0; } -static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int smacker_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; SmackerContext *smk = s->priv_data; diff --git a/libavformat/smjpegdec.c b/libavformat/smjpegdec.c index d7ff9799efeff..05a92839da717 100644 --- a/libavformat/smjpegdec.c +++ b/libavformat/smjpegdec.c @@ -41,7 +41,7 @@ static int smjpeg_probe(AVProbeData *p) return 0; } -static int smjpeg_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int smjpeg_read_header(AVFormatContext *s) { SMJPEGContext *sc = s->priv_data; AVStream *ast = NULL, *vst = NULL; diff --git a/libavformat/sol.c b/libavformat/sol.c index 31c84ceba06c4..4b3a5adbc08f8 100644 --- a/libavformat/sol.c +++ b/libavformat/sol.c @@ -82,8 +82,7 @@ static int sol_channels(int magic, int type) return 2; } -static int sol_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int sol_read_header(AVFormatContext *s) { unsigned int magic,tag; AVIOContext *pb = s->pb; diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c index 1074b3fb2a505..29d13d4f7b9a7 100644 --- a/libavformat/soxdec.c +++ b/libavformat/soxdec.c @@ -44,8 +44,7 @@ static int sox_probe(AVProbeData *p) return 0; } -static int sox_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int sox_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; unsigned header_size, comment_size; diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c index 3daf23fb6914d..106dd8f479f28 100644 --- a/libavformat/spdifdec.c +++ b/libavformat/spdifdec.c @@ -155,7 +155,7 @@ static int spdif_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 8; } -static int spdif_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int spdif_read_header(AVFormatContext *s) { s->ctx_flags |= AVFMTCTX_NOHEADER; return 0; diff --git a/libavformat/srtdec.c b/libavformat/srtdec.c index ca0a3049931fe..d170f9f856493 100644 --- a/libavformat/srtdec.c +++ b/libavformat/srtdec.c @@ -40,7 +40,7 @@ static int srt_probe(AVProbeData *p) return 0; } -static int srt_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int srt_read_header(AVFormatContext *s) { AVStream *st = avformat_new_stream(s, NULL); if (!st) diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index 1fc301b696236..842cda3349c63 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -52,7 +52,7 @@ static int swf_probe(AVProbeData *p) return 0; } -static int swf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int swf_read_header(AVFormatContext *s) { SWFContext *swf = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/thp.c b/libavformat/thp.c index 25efcbba825ed..731f5af968609 100644 --- a/libavformat/thp.c +++ b/libavformat/thp.c @@ -54,8 +54,7 @@ static int thp_probe(AVProbeData *p) return 0; } -static int thp_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int thp_read_header(AVFormatContext *s) { ThpDemuxContext *thp = s->priv_data; AVStream *st; diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c index 0590190312763..194c83abc1099 100644 --- a/libavformat/tiertexseq.c +++ b/libavformat/tiertexseq.c @@ -181,7 +181,7 @@ static int seq_parse_frame_data(SeqDemuxContext *seq, AVIOContext *pb) return 0; } -static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int seq_read_header(AVFormatContext *s) { int i, rc; SeqDemuxContext *seq = s->priv_data; diff --git a/libavformat/tmv.c b/libavformat/tmv.c index 73b44bbc1dc8b..0f8ab597ad424 100644 --- a/libavformat/tmv.c +++ b/libavformat/tmv.c @@ -63,7 +63,7 @@ static int tmv_probe(AVProbeData *p) return 0; } -static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int tmv_read_header(AVFormatContext *s) { TMVContext *tmv = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/tta.c b/libavformat/tta.c index 6bf097975a616..4d6bc0aff29c3 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -38,7 +38,7 @@ static int tta_probe(AVProbeData *p) return 0; } -static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int tta_read_header(AVFormatContext *s) { TTAContext *c = s->priv_data; AVStream *st; diff --git a/libavformat/tty.c b/libavformat/tty.c index 8041900987496..84f99377da478 100644 --- a/libavformat/tty.c +++ b/libavformat/tty.c @@ -72,8 +72,7 @@ static int efi_read(AVFormatContext *avctx, uint64_t start_pos) return 0; } -static int read_header(AVFormatContext *avctx, - AVFormatParameters *ap) +static int read_header(AVFormatContext *avctx) { TtyDemuxContext *s = avctx->priv_data; int width = 0, height = 0, ret = 0; diff --git a/libavformat/txd.c b/libavformat/txd.c index a601ea0853741..acf15554ffb19 100644 --- a/libavformat/txd.c +++ b/libavformat/txd.c @@ -37,7 +37,7 @@ static int txd_probe(AVProbeData * pd) { return 0; } -static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) { +static int txd_read_header(AVFormatContext *s) { AVStream *st; st = avformat_new_stream(s, NULL); diff --git a/libavformat/utils.c b/libavformat/utils.c index 17eec072d0a22..51774e0ff2810 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -608,7 +608,6 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma { AVFormatContext *s = *ps; int ret = 0; - AVFormatParameters ap = { { 0 } }; AVDictionary *tmp = NULL; if (!s && !(s = avformat_alloc_context())) @@ -655,7 +654,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputForma ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC); if (s->iformat->read_header) - if ((ret = s->iformat->read_header(s, &ap)) < 0) + if ((ret = s->iformat->read_header(s)) < 0) goto fail; if (s->pb && !s->data_offset) diff --git a/libavformat/vc1test.c b/libavformat/vc1test.c index 6789b9d283a54..3354ad4b8fe9e 100644 --- a/libavformat/vc1test.c +++ b/libavformat/vc1test.c @@ -42,8 +42,7 @@ static int vc1t_probe(AVProbeData *p) return AVPROBE_SCORE_MAX/2; } -static int vc1t_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int vc1t_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c index 638c15ae4b1ee..6b3438f758c94 100644 --- a/libavformat/vocdec.c +++ b/libavformat/vocdec.c @@ -38,7 +38,7 @@ static int voc_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int voc_read_header(AVFormatContext *s) { VocDecContext *voc = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/vqf.c b/libavformat/vqf.c index 4f8f07c9193b9..08ffa734c1d6e 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -86,7 +86,7 @@ static const AVMetadataConv vqf_metadata_conv[] = { { 0 }, }; -static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int vqf_read_header(AVFormatContext *s) { VqfContext *c = s->priv_data; AVStream *st = avformat_new_stream(s, NULL); diff --git a/libavformat/wav.c b/libavformat/wav.c index 47cb5f8040e14..7b3a0f44f37cd 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -379,8 +379,7 @@ static const AVMetadataConv wav_metadata_conv[] = { }; /* wav input */ -static int wav_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wav_read_header(AVFormatContext *s) { int64_t size, av_uninit(data_size); int64_t sample_count=0; @@ -621,7 +620,7 @@ static int w64_probe(AVProbeData *p) return 0; } -static int w64_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int w64_read_header(AVFormatContext *s) { int64_t size; AVIOContext *pb = s->pb; diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c index af5470f6f2b3c..05e25fc44dfc6 100644 --- a/libavformat/wc3movie.c +++ b/libavformat/wc3movie.c @@ -83,8 +83,7 @@ static int wc3_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int wc3_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wc3_read_header(AVFormatContext *s) { Wc3DemuxContext *wc3 = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/westwood_aud.c b/libavformat/westwood_aud.c index f083a86baf37f..a7148eb08b716 100644 --- a/libavformat/westwood_aud.c +++ b/libavformat/westwood_aud.c @@ -81,8 +81,7 @@ static int wsaud_probe(AVProbeData *p) return AVPROBE_SCORE_MAX / 2; } -static int wsaud_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wsaud_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; AVStream *st; diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c index c2aebe5e807be..c4e19a99810c1 100644 --- a/libavformat/westwood_vqa.c +++ b/libavformat/westwood_vqa.c @@ -73,8 +73,7 @@ static int wsvqa_probe(AVProbeData *p) return AVPROBE_SCORE_MAX; } -static int wsvqa_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wsvqa_read_header(AVFormatContext *s) { WsVqaDemuxContext *wsvqa = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/wtv.c b/libavformat/wtv.c index c6198680c7489..07549b2cc53fb 100644 --- a/libavformat/wtv.c +++ b/libavformat/wtv.c @@ -945,7 +945,7 @@ static const uint8_t timeline_table_0_entries_Events_le16[] = {'t'_'i'_'m'_'e'_'l'_'i'_'n'_'e'_'.'_'t'_'a'_'b'_'l'_'e'_'.'_'0'_'.'_'e'_'n'_'t'_'r'_'i'_'e'_'s'_'.'_'E'_'v'_'e'_'n'_'t'_'s', 0}; #undef _ -static int read_header(AVFormatContext *s, AVFormatParameters *ap) +static int read_header(AVFormatContext *s) { WtvContext *wtv = s->priv_data; int root_sector, root_size; diff --git a/libavformat/wv.c b/libavformat/wv.c index 5f7b3b442a2be..c39cc6843c484 100644 --- a/libavformat/wv.c +++ b/libavformat/wv.c @@ -203,8 +203,7 @@ static int wv_read_block_header(AVFormatContext *ctx, AVIOContext *pb, int appen return 0; } -static int wv_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int wv_read_header(AVFormatContext *s) { AVIOContext *pb = s->pb; WVContext *wc = s->priv_data; diff --git a/libavformat/xa.c b/libavformat/xa.c index 0a1ad59f2cfab..c5e5cf5864f5c 100644 --- a/libavformat/xa.c +++ b/libavformat/xa.c @@ -63,8 +63,7 @@ static int xa_probe(AVProbeData *p) return AVPROBE_SCORE_MAX/2; } -static int xa_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int xa_read_header(AVFormatContext *s) { MaxisXADemuxContext *xa = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/xmv.c b/libavformat/xmv.c index bc4b23917a7d5..6fa9a6a0a7fb3 100644 --- a/libavformat/xmv.c +++ b/libavformat/xmv.c @@ -126,8 +126,7 @@ static int xmv_probe(AVProbeData *p) return 0; } -static int xmv_read_header(AVFormatContext *s, - AVFormatParameters *ap) +static int xmv_read_header(AVFormatContext *s) { XMVDemuxContext *xmv = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/xwma.c b/libavformat/xwma.c index 5839bdcd2226c..2c6ee114bd8f3 100644 --- a/libavformat/xwma.c +++ b/libavformat/xwma.c @@ -40,7 +40,7 @@ static int xwma_probe(AVProbeData *p) return 0; } -static int xwma_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int xwma_read_header(AVFormatContext *s) { int64_t size, av_uninit(data_size); int ret; diff --git a/libavformat/yop.c b/libavformat/yop.c index e5ace8b8052d4..e50025970d8b5 100644 --- a/libavformat/yop.c +++ b/libavformat/yop.c @@ -47,7 +47,7 @@ static int yop_probe(AVProbeData *probe_packet) return 0; } -static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int yop_read_header(AVFormatContext *s) { YopDecContext *yop = s->priv_data; AVIOContext *pb = s->pb; diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index 698ee6814d6eb..afb5bfaab2c20 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -190,7 +190,7 @@ AVOutputFormat ff_yuv4mpegpipe_muxer = { #define MAX_YUV4_HEADER 80 #define MAX_FRAME_HEADER 80 -static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int yuv4_read_header(AVFormatContext *s) { char header[MAX_YUV4_HEADER + 10]; // Include headroom for // the longest option From a17479dfce67fbea2d0a1bf303010dce1e79059f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 11:21:02 +0100 Subject: [PATCH 41/71] lavf: increase major version from 53 to 54. --- doc/APIchanges | 2 +- libavformat/version.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 706acfb0099e5..7e5efe8846590 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -5,7 +5,7 @@ The last version increases were: libavcodec: 2012-01-27 libavdevice: 2011-04-18 libavfilter: 2011-04-18 -libavformat: 2011-04-18 +libavformat: 2012-01-27 libpostproc: 2011-04-18 (deprecated, to be removed later) libswscale: 2011-06-20 libavutil: 2011-04-18 diff --git a/libavformat/version.h b/libavformat/version.h index cdea318eba948..af3bb03a97898 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -29,8 +29,8 @@ #include "libavutil/avutil.h" -#define LIBAVFORMAT_VERSION_MAJOR 53 -#define LIBAVFORMAT_VERSION_MINOR 23 +#define LIBAVFORMAT_VERSION_MAJOR 54 +#define LIBAVFORMAT_VERSION_MINOR 0 #define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ From 2439f2ca82e28aa38b8aa2512bdb5a328e946cb9 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 42/71] lavf: remove disabled FF_API_OLD_AVIO cruft --- libavformat/avio.c | 111 ---------------- libavformat/avio.h | 261 ------------------------------------- libavformat/aviobuf.c | 290 +----------------------------------------- libavformat/options.c | 6 - libavformat/url.h | 2 - libavformat/version.h | 3 - 6 files changed, 1 insertion(+), 672 deletions(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index ee4dfb6c8c8fd..f2fec5bdefcbc 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -89,13 +89,6 @@ static int default_interrupt_cb(void); int (*url_interrupt_cb)(void) = default_interrupt_cb; #endif -#if FF_API_OLD_AVIO -URLProtocol *av_protocol_next(URLProtocol *p) -{ - return ffurl_protocol_next(p); -} -#endif - const char *avio_enum_protocols(void **opaque, int output) { URLProtocol **p = opaque; @@ -168,9 +161,7 @@ static int url_alloc_for_protocol (URLContext **puc, struct URLProtocol *up, int ffurl_connect(URLContext* uc, AVDictionary **options) { int err = -#if !FF_API_OLD_AVIO uc->prot->url_open2 ? uc->prot->url_open2(uc, uc->filename, uc->flags, options) : -#endif uc->prot->url_open(uc, uc->filename, uc->flags); if (err) return err; @@ -183,81 +174,6 @@ int ffurl_connect(URLContext* uc, AVDictionary **options) return 0; } -#if FF_API_OLD_AVIO -int url_open_protocol (URLContext **puc, struct URLProtocol *up, - const char *filename, int flags) -{ - int ret; - - ret = url_alloc_for_protocol(puc, up, filename, flags, NULL); - if (ret) - goto fail; - ret = ffurl_connect(*puc, NULL); - if (!ret) - return 0; - fail: - ffurl_close(*puc); - *puc = NULL; - return ret; -} -int url_alloc(URLContext **puc, const char *filename, int flags) -{ - return ffurl_alloc(puc, filename, flags, NULL); -} -int url_connect(URLContext* uc) -{ - return ffurl_connect(uc, NULL); -} -int url_open(URLContext **puc, const char *filename, int flags) -{ - return ffurl_open(puc, filename, flags, NULL, NULL); -} -int url_read(URLContext *h, unsigned char *buf, int size) -{ - return ffurl_read(h, buf, size); -} -int url_read_complete(URLContext *h, unsigned char *buf, int size) -{ - return ffurl_read_complete(h, buf, size); -} -int url_write(URLContext *h, const unsigned char *buf, int size) -{ - return ffurl_write(h, buf, size); -} -int64_t url_seek(URLContext *h, int64_t pos, int whence) -{ - return ffurl_seek(h, pos, whence); -} -int url_close(URLContext *h) -{ - return ffurl_close(h); -} -int64_t url_filesize(URLContext *h) -{ - return ffurl_size(h); -} -int url_get_file_handle(URLContext *h) -{ - return ffurl_get_file_handle(h); -} -int url_get_max_packet_size(URLContext *h) -{ - return h->max_packet_size; -} -void url_get_filename(URLContext *h, char *buf, int buf_size) -{ - av_strlcpy(buf, h->filename, buf_size); -} -void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) -{ - avio_set_interrupt_cb(interrupt_cb); -} -int av_register_protocol2(URLProtocol *protocol, int size) -{ - return ffurl_register_protocol(protocol, size); -} -#endif - #define URL_SCHEME_CHARS \ "abcdefghijklmnopqrstuvwxyz" \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ @@ -393,17 +309,6 @@ int ffurl_close(URLContext *h) return ret; } -#if FF_API_OLD_AVIO -int url_exist(const char *filename) -{ - URLContext *h; - if (ffurl_open(&h, filename, AVIO_FLAG_READ, NULL, NULL) < 0) - return 0; - ffurl_close(h); - return 1; -} -#endif - int avio_check(const char *url, int flags) { URLContext *h; @@ -471,19 +376,3 @@ int ff_check_interrupt(AVIOInterruptCB *cb) #endif } -#if FF_API_OLD_AVIO -int av_url_read_pause(URLContext *h, int pause) -{ - if (!h->prot->url_read_pause) - return AVERROR(ENOSYS); - return h->prot->url_read_pause(h, pause); -} - -int64_t av_url_read_seek(URLContext *h, - int stream_index, int64_t timestamp, int flags) -{ - if (!h->prot->url_read_seek) - return AVERROR(ENOSYS); - return h->prot->url_read_seek(h, stream_index, timestamp, flags); -} -#endif diff --git a/libavformat/avio.h b/libavformat/avio.h index 78935d9416ecd..ad96775910a77 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -66,7 +66,6 @@ typedef struct { * function pointers specified in avio_alloc_context() */ typedef struct { -#if !FF_API_OLD_AVIO /** * A class for private options. * @@ -80,7 +79,6 @@ typedef struct { * to any av_opt_* functions in that case. */ AVClass *av_class; -#endif unsigned char *buffer; /**< Start of the buffer. */ int buffer_size; /**< Maximum buffer size */ unsigned char *buf_ptr; /**< Current position in the buffer */ @@ -97,9 +95,6 @@ typedef struct { int must_flush; /**< true if the next seek should flush */ int eof_reached; /**< true if eof reached */ int write_flag; /**< true if open for writing */ -#if FF_API_OLD_AVIO - attribute_deprecated int is_streamed; -#endif int max_packet_size; unsigned long checksum; unsigned char *checksum_ptr; @@ -124,262 +119,6 @@ typedef struct { /* unbuffered I/O */ -#if FF_API_OLD_AVIO -/** - * URL Context. - * New fields can be added to the end with minor version bumps. - * Removal, reordering and changes to existing fields require a major - * version bump. - * sizeof(URLContext) must not be used outside libav*. - * @deprecated This struct will be made private - */ -typedef struct URLContext { - const AVClass *av_class; ///< information for av_log(). Set by url_open(). - struct URLProtocol *prot; - int flags; - int is_streamed; /**< true if streamed (no seek possible), default = false */ - int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */ - void *priv_data; - char *filename; /**< specified URL */ - int is_connected; - AVIOInterruptCB interrupt_callback; -} URLContext; - -#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */ -#define URL_PROTOCOL_FLAG_NETWORK 2 /*< The protocol uses network */ - -/** - * @deprecated This struct is to be made private. Use the higher-level - * AVIOContext-based API instead. - */ -typedef struct URLProtocol { - const char *name; - int (*url_open)(URLContext *h, const char *url, int flags); - int (*url_read)(URLContext *h, unsigned char *buf, int size); - int (*url_write)(URLContext *h, const unsigned char *buf, int size); - int64_t (*url_seek)(URLContext *h, int64_t pos, int whence); - int (*url_close)(URLContext *h); - struct URLProtocol *next; - int (*url_read_pause)(URLContext *h, int pause); - int64_t (*url_read_seek)(URLContext *h, int stream_index, - int64_t timestamp, int flags); - int (*url_get_file_handle)(URLContext *h); - int priv_data_size; - const AVClass *priv_data_class; - int flags; - int (*url_check)(URLContext *h, int mask); -} URLProtocol; - -typedef struct URLPollEntry { - URLContext *handle; - int events; - int revents; -} URLPollEntry; - -/* not implemented */ -attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout); - -/** - * @name URL open modes - * The flags argument to url_open and cosins must be one of the following - * constants, optionally ORed with other flags. - * @{ - */ -#define URL_RDONLY 1 /**< read-only */ -#define URL_WRONLY 2 /**< write-only */ -#define URL_RDWR (URL_RDONLY|URL_WRONLY) /**< read-write */ -/** - * @} - */ - -/** - * Use non-blocking mode. - * If this flag is set, operations on the context will return - * AVERROR(EAGAIN) if they can not be performed immediately. - * If this flag is not set, operations on the context will never return - * AVERROR(EAGAIN). - * Note that this flag does not affect the opening/connecting of the - * context. Connecting a protocol will always block if necessary (e.g. on - * network protocols) but never hang (e.g. on busy devices). - * Warning: non-blocking protocols is work-in-progress; this flag may be - * silently ignored. - */ -#define URL_FLAG_NONBLOCK 8 - -typedef int URLInterruptCB(void); -extern URLInterruptCB *url_interrupt_cb; - -/** - * @defgroup old_url_funcs Old url_* functions - * The following functions are deprecated. Use the buffered API based on #AVIOContext instead. - * @{ - * @ingroup lavf_io - */ -attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up, - const char *url, int flags); -attribute_deprecated int url_alloc(URLContext **h, const char *url, int flags); -attribute_deprecated int url_connect(URLContext *h); -attribute_deprecated int url_open(URLContext **h, const char *url, int flags); -attribute_deprecated int url_read(URLContext *h, unsigned char *buf, int size); -attribute_deprecated int url_read_complete(URLContext *h, unsigned char *buf, int size); -attribute_deprecated int url_write(URLContext *h, const unsigned char *buf, int size); -attribute_deprecated int64_t url_seek(URLContext *h, int64_t pos, int whence); -attribute_deprecated int url_close(URLContext *h); -attribute_deprecated int64_t url_filesize(URLContext *h); -attribute_deprecated int url_get_file_handle(URLContext *h); -attribute_deprecated int url_get_max_packet_size(URLContext *h); -attribute_deprecated void url_get_filename(URLContext *h, char *buf, int buf_size); -attribute_deprecated int av_url_read_pause(URLContext *h, int pause); -attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index, - int64_t timestamp, int flags); -attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void)); -/** - * If protocol is NULL, returns the first registered protocol, - * if protocol is non-NULL, returns the next registered protocol after protocol, - * or NULL if protocol is the last one. - */ -attribute_deprecated URLProtocol *av_protocol_next(URLProtocol *p); -/** - * Register the URLProtocol protocol. - * - * @param size the size of the URLProtocol struct referenced - */ -attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size); -/** - * @} - */ - - -typedef attribute_deprecated AVIOContext ByteIOContext; - -attribute_deprecated int init_put_byte(AVIOContext *s, - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)); -attribute_deprecated AVIOContext *av_alloc_put_byte( - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)); - -/** - * @defgroup old_avio_funcs Old put_/get_*() functions - * The following functions are deprecated. Use the "avio_"-prefixed functions instead. - * @{ - * @ingroup lavf_io - */ -attribute_deprecated int get_buffer(AVIOContext *s, unsigned char *buf, int size); -attribute_deprecated int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size); -attribute_deprecated int get_byte(AVIOContext *s); -attribute_deprecated unsigned int get_le16(AVIOContext *s); -attribute_deprecated unsigned int get_le24(AVIOContext *s); -attribute_deprecated unsigned int get_le32(AVIOContext *s); -attribute_deprecated uint64_t get_le64(AVIOContext *s); -attribute_deprecated unsigned int get_be16(AVIOContext *s); -attribute_deprecated unsigned int get_be24(AVIOContext *s); -attribute_deprecated unsigned int get_be32(AVIOContext *s); -attribute_deprecated uint64_t get_be64(AVIOContext *s); - -attribute_deprecated void put_byte(AVIOContext *s, int b); -attribute_deprecated void put_nbyte(AVIOContext *s, int b, int count); -attribute_deprecated void put_buffer(AVIOContext *s, const unsigned char *buf, int size); -attribute_deprecated void put_le64(AVIOContext *s, uint64_t val); -attribute_deprecated void put_be64(AVIOContext *s, uint64_t val); -attribute_deprecated void put_le32(AVIOContext *s, unsigned int val); -attribute_deprecated void put_be32(AVIOContext *s, unsigned int val); -attribute_deprecated void put_le24(AVIOContext *s, unsigned int val); -attribute_deprecated void put_be24(AVIOContext *s, unsigned int val); -attribute_deprecated void put_le16(AVIOContext *s, unsigned int val); -attribute_deprecated void put_be16(AVIOContext *s, unsigned int val); -attribute_deprecated void put_tag(AVIOContext *s, const char *tag); -/** - * @} - */ - -attribute_deprecated int av_url_read_fpause(AVIOContext *h, int pause); -attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h, int stream_index, - int64_t timestamp, int flags); - -/** - * @defgroup old_url_f_funcs Old url_f* functions - * The following functions are deprecated, use the "avio_"-prefixed functions instead. - * @{ - * @ingroup lavf_io - */ -attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags); -attribute_deprecated int url_fclose(AVIOContext *s); -attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence); -attribute_deprecated int url_fskip(AVIOContext *s, int64_t offset); -attribute_deprecated int64_t url_ftell(AVIOContext *s); -attribute_deprecated int64_t url_fsize(AVIOContext *s); -#define URL_EOF (-1) -attribute_deprecated int url_fgetc(AVIOContext *s); -attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size); -attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3); -attribute_deprecated void put_flush_packet(AVIOContext *s); -attribute_deprecated int url_open_dyn_buf(AVIOContext **s); -attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); -attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); -attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h); -/** - * @} - */ - -/** - * @deprecated use AVIOContext.eof_reached - */ -attribute_deprecated int url_feof(AVIOContext *s); -attribute_deprecated int url_ferror(AVIOContext *s); - -attribute_deprecated int udp_set_remote_url(URLContext *h, const char *uri); -attribute_deprecated int udp_get_local_port(URLContext *h); - -attribute_deprecated void init_checksum(AVIOContext *s, - unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), - unsigned long checksum); -attribute_deprecated unsigned long get_checksum(AVIOContext *s); -attribute_deprecated void put_strz(AVIOContext *s, const char *buf); -/** @note unlike fgets, the EOL character is not returned and a whole - line is parsed. return NULL if first char read was EOF */ -attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size); -/** - * @deprecated use avio_get_str instead - */ -attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen); -/** - * @deprecated Use AVIOContext.seekable field directly. - */ -attribute_deprecated static inline int url_is_streamed(AVIOContext *s) -{ - return !s->seekable; -} -attribute_deprecated URLContext *url_fileno(AVIOContext *s); - -/** - * @deprecated use AVIOContext.max_packet_size directly. - */ -attribute_deprecated int url_fget_max_packet_size(AVIOContext *s); - -attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags); - -/** return the written or read size */ -attribute_deprecated int url_close_buf(AVIOContext *s); - -/** - * Return a non-zero value if the resource indicated by url - * exists, 0 otherwise. - * @deprecated Use avio_check instead. - */ -attribute_deprecated int url_exist(const char *url); -#endif // FF_API_OLD_AVIO - /** * Return AVIO_FLAG_* access flags corresponding to the access permissions * of the resource in url, or a negative value corresponding to an diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 6cd2cefa7c67a..01a36475b2f73 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -40,7 +40,6 @@ */ #define SHORT_SEEK_THRESHOLD 4096 -#if !FF_API_OLD_AVIO static void *ffio_url_child_next(void *obj, void *prev) { AVIOContext *s = obj; @@ -64,7 +63,7 @@ const AVClass ffio_url_class = { .child_next = ffio_url_child_next, .child_class_next = ffio_url_child_class_next, }; -#endif + static void fill_buffer(AVIOContext *s); static int url_resetbuf(AVIOContext *s, int flags); @@ -89,9 +88,6 @@ int ffio_init_context(AVIOContext *s, s->must_flush = 0; s->eof_reached = 0; s->error = 0; -#if FF_API_OLD_AVIO - s->is_streamed = 0; -#endif s->seekable = AVIO_SEEKABLE_NORMAL; s->max_packet_size = 0; s->update_checksum= NULL; @@ -104,33 +100,6 @@ int ffio_init_context(AVIOContext *s, return 0; } -#if FF_API_OLD_AVIO -int init_put_byte(AVIOContext *s, - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)) -{ - return ffio_init_context(s, buffer, buffer_size, write_flag, opaque, - read_packet, write_packet, seek); -} -AVIOContext *av_alloc_put_byte( - unsigned char *buffer, - int buffer_size, - int write_flag, - void *opaque, - int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), - int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), - int64_t (*seek)(void *opaque, int64_t offset, int whence)) -{ - return avio_alloc_context(buffer, buffer_size, write_flag, opaque, - read_packet, write_packet, seek); -} -#endif - AVIOContext *avio_alloc_context( unsigned char *buffer, int buffer_size, @@ -265,19 +234,6 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) return offset; } -#if FF_API_OLD_AVIO -int url_fskip(AVIOContext *s, int64_t offset) -{ - int64_t ret = avio_seek(s, offset, SEEK_CUR); - return ret < 0 ? ret : 0; -} - -int64_t url_ftell(AVIOContext *s) -{ - return avio_seek(s, 0, SEEK_CUR); -} -#endif - int64_t avio_size(AVIOContext *s) { int64_t size; @@ -297,22 +253,6 @@ int64_t avio_size(AVIOContext *s) return size; } -#if FF_API_OLD_AVIO -int url_feof(AVIOContext *s) -{ - if(!s) - return 0; - return s->eof_reached; -} - -int url_ferror(AVIOContext *s) -{ - if(!s) - return 0; - return s->error; -} -#endif - void avio_wl32(AVIOContext *s, unsigned int val) { avio_w8(s, val); @@ -329,143 +269,6 @@ void avio_wb32(AVIOContext *s, unsigned int val) avio_w8(s, val); } -#if FF_API_OLD_AVIO -void put_strz(AVIOContext *s, const char *str) -{ - avio_put_str(s, str); -} - -#define GET(name, type) \ - type get_be ##name(AVIOContext *s) \ -{\ - return avio_rb ##name(s);\ -}\ - type get_le ##name(AVIOContext *s) \ -{\ - return avio_rl ##name(s);\ -} - -GET(16, unsigned int) -GET(24, unsigned int) -GET(32, unsigned int) -GET(64, uint64_t) - -#undef GET - -#define PUT(name, type ) \ - void put_le ##name(AVIOContext *s, type val)\ -{\ - avio_wl ##name(s, val);\ -}\ - void put_be ##name(AVIOContext *s, type val)\ -{\ - avio_wb ##name(s, val);\ -} - -PUT(16, unsigned int) -PUT(24, unsigned int) -PUT(32, unsigned int) -PUT(64, uint64_t) -#undef PUT - -int get_byte(AVIOContext *s) -{ - return avio_r8(s); -} -int get_buffer(AVIOContext *s, unsigned char *buf, int size) -{ - return avio_read(s, buf, size); -} -int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size) -{ - return ffio_read_partial(s, buf, size); -} -void put_byte(AVIOContext *s, int val) -{ - avio_w8(s, val); -} -void put_buffer(AVIOContext *s, const unsigned char *buf, int size) -{ - avio_write(s, buf, size); -} -void put_nbyte(AVIOContext *s, int b, int count) -{ - ffio_fill(s, b, count); -} - -int url_fopen(AVIOContext **s, const char *filename, int flags) -{ - return avio_open(s, filename, flags); -} -int url_fclose(AVIOContext *s) -{ - return avio_close(s); -} -int64_t url_fseek(AVIOContext *s, int64_t offset, int whence) -{ - return avio_seek(s, offset, whence); -} -int64_t url_fsize(AVIOContext *s) -{ - return avio_size(s); -} -int url_setbufsize(AVIOContext *s, int buf_size) -{ - return ffio_set_buf_size(s, buf_size); -} -int url_fprintf(AVIOContext *s, const char *fmt, ...) -{ - va_list ap; - char buf[4096]; - int ret; - - va_start(ap, fmt); - ret = vsnprintf(buf, sizeof(buf), fmt, ap); - va_end(ap); - avio_write(s, buf, strlen(buf)); - return ret; -} -void put_flush_packet(AVIOContext *s) -{ - avio_flush(s); -} -int av_url_read_fpause(AVIOContext *s, int pause) -{ - return avio_pause(s, pause); -} -int64_t av_url_read_fseek(AVIOContext *s, int stream_index, - int64_t timestamp, int flags) -{ - return avio_seek_time(s, stream_index, timestamp, flags); -} -void init_checksum(AVIOContext *s, - unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), - unsigned long checksum) -{ - ffio_init_checksum(s, update_checksum, checksum); -} -unsigned long get_checksum(AVIOContext *s) -{ - return ffio_get_checksum(s); -} -int url_open_dyn_buf(AVIOContext **s) -{ - return avio_open_dyn_buf(s); -} -int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size) -{ - return ffio_open_dyn_packet_buf(s, max_packet_size); -} -int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) -{ - return avio_close_dyn_buf(s, pbuffer); -} -int url_fdopen(AVIOContext **s, URLContext *h) -{ - return ffio_fdopen(s, h); -} -#endif - int avio_put_str(AVIOContext *s, const char *str) { int len = 1; @@ -548,15 +351,6 @@ void avio_wb24(AVIOContext *s, unsigned int val) avio_w8(s, val); } -#if FF_API_OLD_AVIO -void put_tag(AVIOContext *s, const char *tag) -{ - while (*tag) { - avio_w8(s, *tag++); - } -} -#endif - /* Input stream */ static void fill_buffer(AVIOContext *s) @@ -638,17 +432,6 @@ int avio_r8(AVIOContext *s) return 0; } -#if FF_API_OLD_AVIO -int url_fgetc(AVIOContext *s) -{ - if (s->buf_ptr >= s->buf_end) - fill_buffer(s); - if (s->buf_ptr < s->buf_end) - return *s->buf_ptr++; - return URL_EOF; -} -#endif - int avio_read(AVIOContext *s, unsigned char *buf, int size) { int len, size1; @@ -774,14 +557,6 @@ unsigned int avio_rb32(AVIOContext *s) return val; } -#if FF_API_OLD_AVIO -char *get_strz(AVIOContext *s, char *buf, int maxlen) -{ - avio_get_str(s, INT_MAX, buf, maxlen); - return buf; -} -#endif - int ff_get_line(AVIOContext *s, char *buf, int maxlen) { int i = 0; @@ -879,18 +654,13 @@ int ffio_fdopen(AVIOContext **s, URLContext *h) av_free(buffer); return AVERROR(ENOMEM); } -#if FF_API_OLD_AVIO - (*s)->is_streamed = h->is_streamed; -#endif (*s)->seekable = h->is_streamed ? 0 : AVIO_SEEKABLE_NORMAL; (*s)->max_packet_size = max_packet_size; if(h->prot) { (*s)->read_pause = (int (*)(void *, int))h->prot->url_read_pause; (*s)->read_seek = (int64_t (*)(void *, int, int64_t, int))h->prot->url_read_seek; } -#if !FF_API_OLD_AVIO (*s)->av_class = &ffio_url_class; -#endif return 0; } @@ -993,13 +763,6 @@ int avio_close(AVIOContext *s) return ffurl_close(h); } -#if FF_API_OLD_AVIO -URLContext *url_fileno(AVIOContext *s) -{ - return s->opaque; -} -#endif - int avio_printf(AVIOContext *s, const char *fmt, ...) { va_list ap; @@ -1013,34 +776,6 @@ int avio_printf(AVIOContext *s, const char *fmt, ...) return ret; } -#if FF_API_OLD_AVIO -char *url_fgets(AVIOContext *s, char *buf, int buf_size) -{ - int c; - char *q; - - c = avio_r8(s); - if (s->eof_reached) - return NULL; - q = buf; - for(;;) { - if (s->eof_reached || c == '\n') - break; - if ((q - buf) < buf_size - 1) - *q++ = c; - c = avio_r8(s); - } - if (buf_size > 0) - *q = '\0'; - return buf; -} - -int url_fget_max_packet_size(AVIOContext *s) -{ - return s->max_packet_size; -} -#endif - int avio_pause(AVIOContext *s, int pause) { if (!s->read_pause) @@ -1068,29 +803,6 @@ int64_t avio_seek_time(AVIOContext *s, int stream_index, return ret; } -/* buffer handling */ -#if FF_API_OLD_AVIO -int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags) -{ - int ret; - *s = av_mallocz(sizeof(AVIOContext)); - if(!*s) - return AVERROR(ENOMEM); - ret = ffio_init_context(*s, buf, buf_size, - flags & AVIO_FLAG_WRITE, - NULL, NULL, NULL, NULL); - if(ret != 0) - av_freep(s); - return ret; -} - -int url_close_buf(AVIOContext *s) -{ - avio_flush(s); - return s->buf_ptr - s->buffer; -} -#endif - /* output in a dynamic buffer */ typedef struct DynBuffer { diff --git a/libavformat/options.c b/libavformat/options.c index 7c75bf48fc4d7..32cd43adb5179 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -41,10 +41,8 @@ static void *format_child_next(void *obj, void *prev) ((s->iformat && s->iformat->priv_class) || s->oformat && s->oformat->priv_class)) return s->priv_data; -#if !FF_API_OLD_AVIO if (s->pb && s->pb->av_class && prev != s->pb) return s->pb; -#endif return NULL; } @@ -54,11 +52,7 @@ static const AVClass *format_child_class_next(const AVClass *prev) AVOutputFormat *ofmt = NULL; if (!prev) -#if !FF_API_OLD_AVIO return &ffio_url_class; -#else - prev = (void *)&ifmt; // Dummy pointer; -#endif while ((ifmt = av_iformat_next(ifmt))) if (ifmt->priv_class == prev) diff --git a/libavformat/url.h b/libavformat/url.h index 14832af79b232..265a8ab2b6fb8 100644 --- a/libavformat/url.h +++ b/libavformat/url.h @@ -31,7 +31,6 @@ #include "libavutil/dict.h" #include "libavutil/log.h" -#if !FF_API_OLD_AVIO #define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */ #define URL_PROTOCOL_FLAG_NETWORK 2 /*< The protocol uses network */ @@ -74,7 +73,6 @@ typedef struct URLProtocol { int flags; int (*url_check)(URLContext *h, int mask); } URLProtocol; -#endif /** * Create a URLContext for accessing to the resource indicated by diff --git a/libavformat/version.h b/libavformat/version.h index af3bb03a97898..b15e03fd2ca13 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -50,9 +50,6 @@ #ifndef FF_API_OLD_METADATA2 #define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54) #endif -#ifndef FF_API_OLD_AVIO -#define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_DUMP_FORMAT #define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 38233fc13106627e05add93df227ec72a11ed24a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 43/71] lavf: remove disabled FF_API_OLD_METADATA2 cruft --- libavformat/avformat.h | 76 ------------------------------------------ libavformat/metadata.c | 29 ---------------- libavformat/metadata.h | 7 ++-- libavformat/version.h | 3 -- 4 files changed, 2 insertions(+), 113 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ec343ba90d500..11002e4c29711 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -220,74 +220,6 @@ struct AVFormatContext; * @} */ -#if FF_API_OLD_METADATA2 -/** - * @defgroup old_metadata Old metadata API - * The following functions are deprecated, use - * their equivalents from libavutil/dict.h instead. - * @{ - */ - -#define AV_METADATA_MATCH_CASE AV_DICT_MATCH_CASE -#define AV_METADATA_IGNORE_SUFFIX AV_DICT_IGNORE_SUFFIX -#define AV_METADATA_DONT_STRDUP_KEY AV_DICT_DONT_STRDUP_KEY -#define AV_METADATA_DONT_STRDUP_VAL AV_DICT_DONT_STRDUP_VAL -#define AV_METADATA_DONT_OVERWRITE AV_DICT_DONT_OVERWRITE - -typedef attribute_deprecated AVDictionary AVMetadata; -typedef attribute_deprecated AVDictionaryEntry AVMetadataTag; - -typedef struct AVMetadataConv AVMetadataConv; - -/** - * Get a metadata element with matching key. - * - * @param prev Set to the previous matching element to find the next. - * If set to NULL the first matching element is returned. - * @param flags Allows case as well as suffix-insensitive comparisons. - * @return Found tag or NULL, changing key or value leads to undefined behavior. - */ -attribute_deprecated AVDictionaryEntry * -av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags); - -/** - * Set the given tag in *pm, overwriting an existing tag. - * - * @param pm pointer to a pointer to a metadata struct. If *pm is NULL - * a metadata struct is allocated and put in *pm. - * @param key tag key to add to *pm (will be av_strduped depending on flags) - * @param value tag value to add to *pm (will be av_strduped depending on flags). - * Passing a NULL value will cause an existing tag to be deleted. - * @return >= 0 on success otherwise an error code <0 - */ -attribute_deprecated int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags); - -/** - * This function is provided for compatibility reason and currently does nothing. - */ -attribute_deprecated void av_metadata_conv(struct AVFormatContext *ctx, const AVMetadataConv *d_conv, - const AVMetadataConv *s_conv); - -/** - * Copy metadata from one AVDictionary struct into another. - * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL, - * this function will allocate a struct for you and put it in *dst - * @param src pointer to source AVDictionary struct - * @param flags flags to use when setting metadata in *dst - * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag - */ -attribute_deprecated void av_metadata_copy(AVDictionary **dst, AVDictionary *src, int flags); - -/** - * Free all the memory allocated for an AVDictionary struct. - */ -attribute_deprecated void av_metadata_free(AVDictionary **m); -/** - * @} - */ -#endif - - /* packet functions */ @@ -434,10 +366,6 @@ typedef struct AVOutputFormat { enum CodecID subtitle_codec; /**< default subtitle codec */ -#if FF_API_OLD_METADATA2 - const AVMetadataConv *metadata_conv; -#endif - const AVClass *priv_class; ///< AVClass for the private context /** @@ -569,10 +497,6 @@ typedef struct AVInputFormat { */ int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); -#if FF_API_OLD_METADATA2 - const AVMetadataConv *metadata_conv; -#endif - const AVClass *priv_class; ///< AVClass for the private context /* private fields */ diff --git a/libavformat/metadata.c b/libavformat/metadata.c index 7d85363cfe30b..7f283146983c8 100644 --- a/libavformat/metadata.c +++ b/libavformat/metadata.c @@ -23,35 +23,6 @@ #include "libavutil/dict.h" #include "libavutil/avstring.h" -#if FF_API_OLD_METADATA2 -AVDictionaryEntry * -av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags) -{ - return av_dict_get(m, key, prev, flags); -} - -int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) -{ - return av_dict_set(pm, key, value, flags); -} - -void av_metadata_conv(AVFormatContext *ctx, const AVMetadataConv *d_conv, - const AVMetadataConv *s_conv) -{ - return; -} - -void av_metadata_free(AVDictionary **pm) -{ - av_dict_free(pm); -} - -void av_metadata_copy(AVDictionary **dst, AVDictionary *src, int flags) -{ - av_dict_copy(dst, src, flags); -} -#endif - void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv) { diff --git a/libavformat/metadata.h b/libavformat/metadata.h index 33e0d1ff6cc3d..eee3ee4391e97 100644 --- a/libavformat/metadata.h +++ b/libavformat/metadata.h @@ -31,13 +31,10 @@ #include "avformat.h" #include "libavutil/dict.h" -struct AVMetadataConv{ +typedef struct AVMetadataConv { const char *native; const char *generic; -}; -#if !FF_API_OLD_METADATA2 -typedef struct AVMetadataConv AVMetadataConv; -#endif +} AVMetadataConv; void ff_metadata_conv(AVDictionary **pm, const AVMetadataConv *d_conv, const AVMetadataConv *s_conv); diff --git a/libavformat/version.h b/libavformat/version.h index b15e03fd2ca13..b362352f2edfa 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_OLD_METADATA2 -#define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_DUMP_FORMAT #define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 2fb7501938b7103624c9bef740ca498258cacdab Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:38:58 +0100 Subject: [PATCH 44/71] lavf: remove disabled FF_API_FORMAT_PARAMETERS cruft Also remove now unused AVFormatParameters struct and AVOutputFormat.set_parameters(). --- libavformat/avformat.h | 102 --------------------------- libavformat/utils.c | 155 ----------------------------------------- libavformat/version.h | 3 - 3 files changed, 260 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 11002e4c29711..629f738ac1563 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -277,25 +277,6 @@ typedef struct AVProbeData { #define AVPROBE_SCORE_MAX 100 ///< maximum score, half of that is used for file-extension-based detection #define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer -typedef struct AVFormatParameters { -#if FF_API_FORMAT_PARAMETERS - attribute_deprecated AVRational time_base; - attribute_deprecated int sample_rate; - attribute_deprecated int channels; - attribute_deprecated int width; - attribute_deprecated int height; - attribute_deprecated enum PixelFormat pix_fmt; - attribute_deprecated int channel; /**< Used to select DV channel. */ - attribute_deprecated const char *standard; /**< deprecated, use demuxer-specific options instead. */ - attribute_deprecated unsigned int mpeg2ts_raw:1; /**< deprecated, use mpegtsraw demuxer */ - /**< deprecated, use mpegtsraw demuxer-specific options instead */ - attribute_deprecated unsigned int mpeg2ts_compute_pcr:1; - attribute_deprecated unsigned int initial_pause:1; /**< Do not begin to play the stream - immediately (RTSP only). */ - attribute_deprecated unsigned int prealloced_context:1; -#endif -} AVFormatParameters; - /// Demuxer will use avio_open, no opened file should be provided by the caller. #define AVFMT_NOFILE 0x0001 #define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */ @@ -354,7 +335,6 @@ typedef struct AVOutputFormat { /** * Currently only used to set pixel format if not YUV420P. */ - int (*set_parameters)(struct AVFormatContext *, AVFormatParameters *); int (*interleave_packet)(struct AVFormatContext *, AVPacket *out, AVPacket *in, int flush); @@ -1272,36 +1252,6 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size); -#if FF_API_FORMAT_PARAMETERS -/** - * Allocate all the structures needed to read an input stream. - * This does not open the needed codecs for decoding the stream[s]. - * @deprecated use avformat_open_input instead. - */ -attribute_deprecated int av_open_input_stream(AVFormatContext **ic_ptr, - AVIOContext *pb, const char *filename, - AVInputFormat *fmt, AVFormatParameters *ap); - -/** - * Open a media file as input. The codecs are not opened. Only the file - * header (if present) is read. - * - * @param ic_ptr The opened media file handle is put here. - * @param filename filename to open - * @param fmt If non-NULL, force the file format to use. - * @param buf_size optional buffer size (zero if default is OK) - * @param ap Additional parameters needed when opening the file - * (NULL if default). - * @return 0 if OK, AVERROR_xxx otherwise - * - * @deprecated use avformat_open_input instead. - */ -attribute_deprecated int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, - AVInputFormat *fmt, - int buf_size, - AVFormatParameters *ap); -#endif - /** * Open an input stream and read the header. The codecs are not opened. * The stream must be closed with av_close_input_file(). @@ -1323,26 +1273,6 @@ attribute_deprecated int av_open_input_file(AVFormatContext **ic_ptr, const char */ int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options); -#if FF_API_FORMAT_PARAMETERS -/** - * Read packets of a media file to get stream information. This - * is useful for file formats with no headers such as MPEG. This - * function also computes the real framerate in case of MPEG-2 repeat - * frame mode. - * The logical file position is not changed by this function; - * examined packets may be buffered for later processing. - * - * @param ic media file handle - * @return >=0 if OK, AVERROR_xxx on error - * @todo Let the user decide somehow what information is needed so that - * we do not waste time getting stuff the user does not need. - * - * @deprecated use avformat_find_stream_info. - */ -attribute_deprecated -int av_find_stream_info(AVFormatContext *ic); -#endif - /** * Read packets of a media file to get stream information. This * is useful for file formats with no headers such as MPEG. This @@ -1490,16 +1420,6 @@ int av_read_play(AVFormatContext *s); */ int av_read_pause(AVFormatContext *s); -#if FF_API_FORMAT_PARAMETERS -/** - * Free a AVFormatContext allocated by av_open_input_stream. - * @param s context to free - * @deprecated use av_close_input_file() - */ -attribute_deprecated -void av_close_input_stream(AVFormatContext *s); -#endif - #if FF_API_CLOSE_INPUT_FILE /** * @deprecated use avformat_close_input() @@ -1564,13 +1484,6 @@ int64_t av_gen_search(AVFormatContext *s, int stream_index, int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )); #endif -#if FF_API_FORMAT_PARAMETERS -/** - * @deprecated pass the options to avformat_write_header directly. - */ -attribute_deprecated int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap); -#endif - /** * @addtogroup lavf_encoding * @{ @@ -1592,21 +1505,6 @@ attribute_deprecated int av_set_parameters(AVFormatContext *s, AVFormatParameter */ int avformat_write_header(AVFormatContext *s, AVDictionary **options); -#if FF_API_FORMAT_PARAMETERS -/** - * Allocate the stream private data and write the stream header to an - * output media file. - * @note: this sets stream time-bases, if possible to stream->codec->time_base - * but for some formats it might also be some other time base - * - * @param s media file handle - * @return 0 if OK, AVERROR_xxx on error - * - * @deprecated use avformat_write_header. - */ -attribute_deprecated int av_write_header(AVFormatContext *s); -#endif - /** * Write a packet to an output media file. * diff --git a/libavformat/utils.c b/libavformat/utils.c index 51774e0ff2810..8860d47690069 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -400,93 +400,6 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, AVProbeDa /************************************************************/ /* input media file */ -#if FF_API_FORMAT_PARAMETERS -static AVDictionary *convert_format_parameters(AVFormatParameters *ap) -{ - char buf[1024]; - AVDictionary *opts = NULL; - - if (!ap) - return NULL; - - if (ap->time_base.num) { - snprintf(buf, sizeof(buf), "%d/%d", ap->time_base.den, ap->time_base.num); - av_dict_set(&opts, "framerate", buf, 0); - } - if (ap->sample_rate) { - snprintf(buf, sizeof(buf), "%d", ap->sample_rate); - av_dict_set(&opts, "sample_rate", buf, 0); - } - if (ap->channels) { - snprintf(buf, sizeof(buf), "%d", ap->channels); - av_dict_set(&opts, "channels", buf, 0); - } - if (ap->width || ap->height) { - snprintf(buf, sizeof(buf), "%dx%d", ap->width, ap->height); - av_dict_set(&opts, "video_size", buf, 0); - } - if (ap->pix_fmt != PIX_FMT_NONE) { - av_dict_set(&opts, "pixel_format", av_get_pix_fmt_name(ap->pix_fmt), 0); - } - if (ap->channel) { - snprintf(buf, sizeof(buf), "%d", ap->channel); - av_dict_set(&opts, "channel", buf, 0); - } - if (ap->standard) { - av_dict_set(&opts, "standard", ap->standard, 0); - } - if (ap->mpeg2ts_compute_pcr) { - av_dict_set(&opts, "mpeg2ts_compute_pcr", "1", 0); - } - if (ap->initial_pause) { - av_dict_set(&opts, "initial_pause", "1", 0); - } - return opts; -} - -/** - * Open a media file from an IO stream. 'fmt' must be specified. - */ -int av_open_input_stream(AVFormatContext **ic_ptr, - AVIOContext *pb, const char *filename, - AVInputFormat *fmt, AVFormatParameters *ap) -{ - int err; - AVDictionary *opts; - AVFormatContext *ic; - AVFormatParameters default_ap; - - if(!ap){ - ap=&default_ap; - memset(ap, 0, sizeof(default_ap)); - } - opts = convert_format_parameters(ap); - - if(!ap->prealloced_context) - ic = avformat_alloc_context(); - else - ic = *ic_ptr; - if (!ic) { - err = AVERROR(ENOMEM); - goto fail; - } - if (pb && fmt && fmt->flags & AVFMT_NOFILE) - av_log(ic, AV_LOG_WARNING, "Custom AVIOContext makes no sense and " - "will be ignored with AVFMT_NOFILE format.\n"); - else - ic->pb = pb; - - if ((err = avformat_open_input(&ic, filename, fmt, &opts)) < 0) - goto fail; - ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above - -fail: - *ic_ptr = ic; - av_dict_free(&opts); - return err; -} -#endif - /** size of probe buffer, for guessing file type from file contents */ #define PROBE_BUF_MIN 2048 #define PROBE_BUF_MAX (1<<20) @@ -558,25 +471,6 @@ int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, return ret; } -#if FF_API_FORMAT_PARAMETERS -int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, - AVInputFormat *fmt, - int buf_size, - AVFormatParameters *ap) -{ - int err; - AVDictionary *opts = convert_format_parameters(ap); - - if (!ap || !ap->prealloced_context) - *ic_ptr = NULL; - - err = avformat_open_input(ic_ptr, filename, fmt, &opts); - - av_dict_free(&opts); - return err; -} -#endif - /* open input file and probe the format if necessary */ static int init_input(AVFormatContext *s, const char *filename, AVDictionary **options) { @@ -2273,13 +2167,6 @@ static int tb_unreliable(AVCodecContext *c){ return 0; } -#if FF_API_FORMAT_PARAMETERS -int av_find_stream_info(AVFormatContext *ic) -{ - return avformat_find_stream_info(ic, NULL); -} -#endif - int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) { int i, count, ret, read_size, j; @@ -2680,16 +2567,6 @@ int av_read_pause(AVFormatContext *s) return AVERROR(ENOSYS); } -#if FF_API_FORMAT_PARAMETERS -void av_close_input_stream(AVFormatContext *s) -{ - flush_packet_queue(s); - if (s->iformat->read_close) - s->iformat->read_close(s); - avformat_free_context(s); -} -#endif - void avformat_free_context(AVFormatContext *s) { int i; @@ -2863,31 +2740,6 @@ AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base, /************************************************************/ /* output media file */ -#if FF_API_FORMAT_PARAMETERS -int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap) -{ - int ret; - - if (s->oformat->priv_data_size > 0) { - s->priv_data = av_mallocz(s->oformat->priv_data_size); - if (!s->priv_data) - return AVERROR(ENOMEM); - if (s->oformat->priv_class) { - *(const AVClass**)s->priv_data= s->oformat->priv_class; - av_opt_set_defaults(s->priv_data); - } - } else - s->priv_data = NULL; - - if (s->oformat->set_parameters) { - ret = s->oformat->set_parameters(s, ap); - if (ret < 0) - return ret; - } - return 0; -} -#endif - static int validate_codec_tag(AVFormatContext *s, AVStream *st) { const AVCodecTag *avctag; @@ -2921,13 +2773,6 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st) return 1; } -#if FF_API_FORMAT_PARAMETERS -int av_write_header(AVFormatContext *s) -{ - return avformat_write_header(s, NULL); -} -#endif - int avformat_write_header(AVFormatContext *s, AVDictionary **options) { int ret = 0, i; diff --git a/libavformat/version.h b/libavformat/version.h index b362352f2edfa..f55fc019c1fa6 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -65,9 +65,6 @@ #ifndef FF_API_SDP_CREATE #define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54) #endif -#ifndef FF_API_FORMAT_PARAMETERS -#define FF_API_FORMAT_PARAMETERS (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_FLAG_RTP_HINT #define FF_API_FLAG_RTP_HINT (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 997420abf2e5856f5b9e9267ca5cce6fe5c8a406 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 45/71] lavf: remove disabled FF_API_DUMP_FORMAT cruft --- libavformat/avformat.h | 6 ------ libavformat/utils.c | 10 ---------- libavformat/version.h | 3 --- 3 files changed, 19 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 629f738ac1563..9156be03d4165 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1731,12 +1731,6 @@ void av_url_split(char *proto, int proto_size, char *path, int path_size, const char *url); -#if FF_API_DUMP_FORMAT -attribute_deprecated void dump_format(AVFormatContext *ic, - int index, - const char *url, - int is_output); -#endif void av_dump_format(AVFormatContext *ic, int index, diff --git a/libavformat/utils.c b/libavformat/utils.c index 8860d47690069..2f4a6d127d24e 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3282,16 +3282,6 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out dump_metadata(NULL, st->metadata, " "); } -#if FF_API_DUMP_FORMAT -void dump_format(AVFormatContext *ic, - int index, - const char *url, - int is_output) -{ - av_dump_format(ic, index, url, is_output); -} -#endif - void av_dump_format(AVFormatContext *ic, int index, const char *url, diff --git a/libavformat/version.h b/libavformat/version.h index f55fc019c1fa6..e1daff2771a6d 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_DUMP_FORMAT -#define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_PARSE_DATE #define FF_API_PARSE_DATE (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From ecd5f41a0695238d52e4134136265d3b63bd8656 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 46/71] lavf: remove disabled FF_API_PARSE_DATE cruft --- libavformat/avformat.h | 12 ------------ libavformat/utils.c | 11 ----------- libavformat/version.h | 3 --- 3 files changed, 26 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 9156be03d4165..19a8a97d2615a 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1737,18 +1737,6 @@ void av_dump_format(AVFormatContext *ic, const char *url, int is_output); -#if FF_API_PARSE_DATE -/** - * Parse datestr and return a corresponding number of microseconds. - * - * @param datestr String representing a date or a duration. - * See av_parse_time() for the syntax of the provided string. - * @deprecated in favor of av_parse_time() - */ -attribute_deprecated -int64_t parse_date(const char *datestr, int duration); -#endif - /** * Get the current time in microseconds. */ diff --git a/libavformat/utils.c b/libavformat/utils.c index 2f4a6d127d24e..5131fadfaaba0 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3373,17 +3373,6 @@ uint64_t ff_ntp_time(void) return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US; } -#if FF_API_PARSE_DATE -#include "libavutil/parseutils.h" - -int64_t parse_date(const char *timestr, int duration) -{ - int64_t timeval; - av_parse_time(&timeval, timestr, duration); - return timeval; -} -#endif - #if FF_API_FIND_INFO_TAG #include "libavutil/parseutils.h" diff --git a/libavformat/version.h b/libavformat/version.h index e1daff2771a6d..ffb04bb6bf111 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_PARSE_DATE -#define FF_API_PARSE_DATE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_FIND_INFO_TAG #define FF_API_FIND_INFO_TAG (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From cc10ab79ec68697b961aebb7e1cb9eb5f529db60 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 47/71] lavf: remove disabled FF_API_FIND_INFO_TAG cruft --- libavformat/avformat.h | 7 ------- libavformat/utils.c | 9 --------- libavformat/version.h | 3 --- 3 files changed, 19 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 19a8a97d2615a..cbb139feca068 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1742,13 +1742,6 @@ void av_dump_format(AVFormatContext *ic, */ int64_t av_gettime(void); -#if FF_API_FIND_INFO_TAG -/** - * @deprecated use av_find_info_tag in libavutil instead. - */ -attribute_deprecated int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); -#endif - /** * Return in 'buf' the path with '%d' replaced by a number. * diff --git a/libavformat/utils.c b/libavformat/utils.c index 5131fadfaaba0..185418f53dc81 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3373,15 +3373,6 @@ uint64_t ff_ntp_time(void) return (av_gettime() / 1000) * 1000 + NTP_OFFSET_US; } -#if FF_API_FIND_INFO_TAG -#include "libavutil/parseutils.h" - -int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info) -{ - return av_find_info_tag(arg, arg_size, tag1, info); -} -#endif - int av_get_frame_filename(char *buf, int buf_size, const char *path, int number) { diff --git a/libavformat/version.h b/libavformat/version.h index ffb04bb6bf111..7696cd64a5523 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_FIND_INFO_TAG -#define FF_API_FIND_INFO_TAG (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_PKT_DUMP #define FF_API_PKT_DUMP (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 21824e5b88c4f5796e47847c0331bae223a21e49 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 48/71] lavf: remove disabled FF_API_PKT_DUMP cruft --- libavformat/avformat.h | 7 ------- libavformat/utils.c | 16 ---------------- libavformat/version.h | 3 --- 3 files changed, 26 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index cbb139feca068..fe2b0cfdb7c91 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1195,13 +1195,6 @@ AVProgram *av_new_program(AVFormatContext *s, int id); attribute_deprecated enum CodecID av_guess_image2_codec(const char *filename); #endif -#if FF_API_PKT_DUMP -attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload); -attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, - int dump_payload); -#endif - - /** * @addtogroup lavf_decoding * @{ diff --git a/libavformat/utils.c b/libavformat/utils.c index 185418f53dc81..d241200d81ac8 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3493,27 +3493,11 @@ static void pkt_dump_internal(void *avcl, FILE *f, int level, AVPacket *pkt, int av_hex_dump(f, pkt->data, pkt->size); } -#if FF_API_PKT_DUMP -void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload) -{ - AVRational tb = { 1, AV_TIME_BASE }; - pkt_dump_internal(NULL, f, 0, pkt, dump_payload, tb); -} -#endif - void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st) { pkt_dump_internal(NULL, f, 0, pkt, dump_payload, st->time_base); } -#if FF_API_PKT_DUMP -void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, int dump_payload) -{ - AVRational tb = { 1, AV_TIME_BASE }; - pkt_dump_internal(avcl, NULL, level, pkt, dump_payload, tb); -} -#endif - void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload, AVStream *st) { diff --git a/libavformat/version.h b/libavformat/version.h index 7696cd64a5523..097fdaa4275f1 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_PKT_DUMP -#define FF_API_PKT_DUMP (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_GUESS_IMG2_CODEC #define FF_API_GUESS_IMG2_CODEC (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 64f6f6f83662f0a307b3d59d6c0672e0aae96830 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 49/71] lavf: remove disabled FF_API_GUESS_IMG2_CODEC cruft --- libavformat/avformat.h | 4 ---- libavformat/img2.c | 6 ------ libavformat/version.h | 3 --- 3 files changed, 13 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index fe2b0cfdb7c91..d71ae2ff6bcbf 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1191,10 +1191,6 @@ AVProgram *av_new_program(AVFormatContext *s, int id); */ -#if FF_API_GUESS_IMG2_CODEC -attribute_deprecated enum CodecID av_guess_image2_codec(const char *filename); -#endif - /** * @addtogroup lavf_decoding * @{ diff --git a/libavformat/img2.c b/libavformat/img2.c index 7203cb62d99cf..4ff47670a5db8 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -199,12 +199,6 @@ enum CodecID ff_guess_image2_codec(const char *filename) return av_str2id(img_tags, filename); } -#if FF_API_GUESS_IMG2_CODEC -enum CodecID av_guess_image2_codec(const char *filename){ - return av_str2id(img_tags, filename); -} -#endif - static int read_header(AVFormatContext *s1) { VideoData *s = s1->priv_data; diff --git a/libavformat/version.h b/libavformat/version.h index 097fdaa4275f1..5279f9722b056 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_GUESS_IMG2_CODEC -#define FF_API_GUESS_IMG2_CODEC (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_SDP_CREATE #define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 1d911bb404f547599d69312325a2bb63888e8408 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 50/71] lavf: remove disabled FF_API_SDP_CREATE cruft --- libavformat/avformat.h | 4 ---- libavformat/sdp.c | 6 ------ libavformat/version.h | 3 --- 3 files changed, 13 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index d71ae2ff6bcbf..a7d17126b2255 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1770,10 +1770,6 @@ int av_filename_number_test(const char *filename); */ int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size); -#if FF_API_SDP_CREATE -attribute_deprecated int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size); -#endif - /** * Return a positive value if the given filename has one of the given * extensions, 0 otherwise. diff --git a/libavformat/sdp.c b/libavformat/sdp.c index d89591fe80d5b..ddf28bd7ab4d4 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -643,9 +643,3 @@ void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *des } #endif -#if FF_API_SDP_CREATE -int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size) -{ - return av_sdp_create(ac, n_files, buff, size); -} -#endif diff --git a/libavformat/version.h b/libavformat/version.h index 5279f9722b056..c422b998c89c1 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_SDP_CREATE -#define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_FLAG_RTP_HINT #define FF_API_FLAG_RTP_HINT (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 2d70912cc22239538593ff027dbb32d13409b888 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 51/71] lavf: remove disabled FF_API_FLAG_RTP_HINT cruft --- libavformat/avformat.h | 3 --- libavformat/movenc.c | 8 -------- libavformat/options.c | 3 --- libavformat/version.h | 3 --- 4 files changed, 17 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index a7d17126b2255..f875c3df06428 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -903,9 +903,6 @@ typedef struct AVFormatContext { #define AVFMT_FLAG_IGNDTS 0x0008 ///< Ignore DTS on frames that contain both DTS & PTS #define AVFMT_FLAG_NOFILLIN 0x0010 ///< Do not infer any values from other values, just return what is stored in the container #define AVFMT_FLAG_NOPARSE 0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled -#if FF_API_FLAG_RTP_HINT -#define AVFMT_FLAG_RTP_HINT 0x0040 ///< Deprecated, use the -movflags rtphint muxer specific AVOption instead -#endif #define AVFMT_FLAG_CUSTOM_IO 0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it. #define AVFMT_FLAG_DISCARD_CORRUPT 0x0100 ///< Discard frames marked corrupted diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 48b474bfc6188..f23a63b06e614 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2685,14 +2685,6 @@ static int mov_write_header(AVFormatContext *s) if (mov->mode & (MODE_MOV|MODE_IPOD) && s->nb_chapters) mov->chapter_track = mov->nb_streams++; -#if FF_API_FLAG_RTP_HINT - if (s->flags & AVFMT_FLAG_RTP_HINT) { - av_log(s, AV_LOG_WARNING, "The RTP_HINT flag is deprecated, enable it " - "via the -movflags rtphint muxer option " - "instead.\n"); - mov->flags |= FF_MOV_FLAG_RTP_HINT; - } -#endif if (mov->flags & FF_MOV_FLAG_RTP_HINT) { /* Add hint tracks for each audio and video stream */ hint_track = mov->nb_streams; diff --git a/libavformat/options.c b/libavformat/options.c index 32cd43adb5179..7dbb8711a7cac 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -92,9 +92,6 @@ static const AVOption options[]={ {"nofillin", "do not fill in missing values that can be exactly calculated", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_NOFILLIN }, INT_MIN, INT_MAX, D, "fflags"}, {"noparse", "disable AVParsers, this needs nofillin too", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_NOPARSE }, INT_MIN, INT_MAX, D, "fflags"}, {"igndts", "ignore dts", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_IGNDTS }, INT_MIN, INT_MAX, D, "fflags"}, -#if FF_API_FLAG_RTP_HINT -{"rtphint", "add rtp hinting (deprecated, use the -movflags rtphint option instead)", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_RTP_HINT }, INT_MIN, INT_MAX, E, "fflags"}, -#endif {"discardcorrupt", "discard corrupted frames", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_DISCARD_CORRUPT }, INT_MIN, INT_MAX, D, "fflags"}, {"analyzeduration", "how many microseconds are analyzed to estimate duration", OFFSET(max_analyze_duration), AV_OPT_TYPE_INT, {.dbl = 5*AV_TIME_BASE }, 0, INT_MAX, D}, {"cryptokey", "decryption key", OFFSET(key), AV_OPT_TYPE_BINARY, {.dbl = 0}, 0, 0, D}, diff --git a/libavformat/version.h b/libavformat/version.h index c422b998c89c1..3246707309883 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_FLAG_RTP_HINT -#define FF_API_FLAG_RTP_HINT (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_AVSTREAM_QUALITY #define FF_API_AVSTREAM_QUALITY (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From b32e30faa17939a8b98062f6219cc4574517f697 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 52/71] lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft --- libavformat/avformat.h | 9 --------- libavformat/version.h | 3 --- 2 files changed, 12 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index f875c3df06428..8f02941c099f5 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -569,15 +569,6 @@ typedef struct AVStream { #endif enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed. -#if FF_API_AVSTREAM_QUALITY - //FIXME move stuff to a flags field? - /** - * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. - * MN: dunno if that is the right place for it - */ - attribute_deprecated float quality; -#endif - /** * Decoding: pts of the first frame of the stream, in stream time base. * Only set this if you are absolutely 100% sure that the value you set diff --git a/libavformat/version.h b/libavformat/version.h index 3246707309883..d6bf49b4f1091 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_AVSTREAM_QUALITY -#define FF_API_AVSTREAM_QUALITY (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_LOOP_INPUT #define FF_API_LOOP_INPUT (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 6dc345555f3bd91065c217ed8a06f8f07d399ced Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 53/71] lavf: remove disabled FF_API_LOOP_INPUT cruft --- libavformat/avformat.h | 7 ------- libavformat/img2.c | 5 ----- libavformat/version.h | 3 --- 3 files changed, 15 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 8f02941c099f5..8a99535024969 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -897,13 +897,6 @@ typedef struct AVFormatContext { #define AVFMT_FLAG_CUSTOM_IO 0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it. #define AVFMT_FLAG_DISCARD_CORRUPT 0x0100 ///< Discard frames marked corrupted -#if FF_API_LOOP_INPUT - /** - * @deprecated, use the 'loop' img2 demuxer private option. - */ - attribute_deprecated int loop_input; -#endif - /** * decoding: size of data to probe; encoding: unused. */ diff --git a/libavformat/img2.c b/libavformat/img2.c index 4ff47670a5db8..f7a9fa5e30287 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -228,11 +228,6 @@ static int read_header(AVFormatContext *s1) return ret; } -#if FF_API_LOOP_INPUT - if (s1->loop_input) - s->loop = s1->loop_input; -#endif - av_strlcpy(s->path, s1->filename, sizeof(s->path)); s->img_number = 0; s->img_count = 0; diff --git a/libavformat/version.h b/libavformat/version.h index d6bf49b4f1091..197dc37c32a79 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_LOOP_INPUT -#define FF_API_LOOP_INPUT (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_LOOP_OUTPUT #define FF_API_LOOP_OUTPUT (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 3bbfd3026c6d692696066b041f4ba4ed9c938e5d Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 54/71] lavf: remove disabled FF_API_LOOP_OUTPUT cruft --- libavformat/avformat.h | 11 ----------- libavformat/gif.c | 5 ----- libavformat/version.h | 3 --- 3 files changed, 19 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 8a99535024969..5c53972851df2 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -876,17 +876,6 @@ typedef struct AVFormatContext { #endif int max_delay; -#if FF_API_LOOP_OUTPUT -#define AVFMT_NOOUTPUTLOOP -1 -#define AVFMT_INFINITEOUTPUTLOOP 0 - /** - * number of times to loop output in formats that support it - * - * @deprecated use the 'loop' private option in the gif muxer. - */ - attribute_deprecated int loop_output; -#endif - int flags; #define AVFMT_FLAG_GENPTS 0x0001 ///< Generate missing pts even if it requires parsing future frames. #define AVFMT_FLAG_IGNIDX 0x0002 ///< Ignore index. diff --git a/libavformat/gif.c b/libavformat/gif.c index 3ef7ebe9be431..eb1e9f04fb707 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -288,11 +288,6 @@ static int gif_write_header(AVFormatContext *s) return AVERROR(EIO); } -#if FF_API_LOOP_OUTPUT - if (s->loop_output) - gif->loop = s->loop_output; -#endif - gif_image_write_header(pb, width, height, gif->loop, NULL); avio_flush(s->pb); diff --git a/libavformat/version.h b/libavformat/version.h index 197dc37c32a79..4725892239a6f 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_LOOP_OUTPUT -#define FF_API_LOOP_OUTPUT (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_TIMESTAMP #define FF_API_TIMESTAMP (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From df0bb26aca7ff42bf57dfc8a5f7e19baf0e1c689 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 55/71] lavf: remove disabled FF_API_TIMESTAMP cruft --- libavformat/avformat.h | 7 ------- libavformat/dvenc.c | 5 ----- libavformat/gxfenc.c | 5 ----- libavformat/movenc.c | 5 ----- libavformat/mxfenc.c | 5 ----- libavformat/version.h | 3 --- 6 files changed, 30 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 5c53972851df2..c2ce5b89484bf 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -809,13 +809,6 @@ typedef struct AVFormatContext { char filename[1024]; /**< input or output filename */ /* stream info */ -#if FF_API_TIMESTAMP - /** - * @deprecated use 'creation_time' metadata tag instead - */ - attribute_deprecated int64_t timestamp; -#endif - int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */ #if FF_API_REORDER_PRIVATE /* private data for pts handling (do not modify directly). */ diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index bffad44b9f043..56db4d26910e9 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -338,11 +338,6 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s) c->frames = 0; c->has_audio = 0; c->has_video = 0; -#if FF_API_TIMESTAMP - if (s->timestamp) - c->start_time = s->timestamp; - else -#endif if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) c->start_time = ff_iso8601_to_unix_time(t->value); diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 124064fc550c0..dcd2a8c84db54 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -399,11 +399,6 @@ static int gxf_write_umf_material_description(AVFormatContext *s) AVDictionaryEntry *t; uint32_t timecode; -#if FF_API_TIMESTAMP - if (s->timestamp) - timestamp = s->timestamp; - else -#endif if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) timestamp = ff_iso8601_to_unix_time(t->value); diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f23a63b06e614..eee426f69217b 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2807,11 +2807,6 @@ static int mov_write_header(AVFormatContext *s) if (!(mov->flags & FF_MOV_FLAG_EMPTY_MOOV)) mov_write_mdat_tag(pb, mov); -#if FF_API_TIMESTAMP - if (s->timestamp) - mov->time = s->timestamp; - else -#endif if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) mov->time = ff_iso8601_to_unix_time(t->value); if (mov->time) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 65935ab8ffc23..597a4f7d720ff 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1519,11 +1519,6 @@ static int mxf_write_header(AVFormatContext *s) sc->order = AV_RB32(sc->track_essence_element_key+12); } -#if FF_API_TIMESTAMP - if (s->timestamp) - timestamp = s->timestamp; - else -#endif if (t = av_dict_get(s->metadata, "creation_time", NULL, 0)) timestamp = ff_iso8601_to_unix_time(t->value); if (timestamp) diff --git a/libavformat/version.h b/libavformat/version.h index 4725892239a6f..59b252db4f352 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_TIMESTAMP -#define FF_API_TIMESTAMP (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_FILESIZE #define FF_API_FILESIZE (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 2f5e728b58c564b89f565fa2149dbbb6ccfce734 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 56/71] lavf: remove disabled FF_API_FILESIZE cruft --- libavformat/avformat.h | 7 ------- libavformat/version.h | 3 --- 2 files changed, 10 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index c2ce5b89484bf..4f95ecc1dc544 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -835,13 +835,6 @@ typedef struct AVFormatContext { */ int64_t duration; -#if FF_API_FILESIZE - /** - * decoding: total file size, 0 if unknown - */ - attribute_deprecated int64_t file_size; -#endif - /** * Decoding: total stream bitrate in bit/s, 0 if not * available. Never set it directly if the file_size and the diff --git a/libavformat/version.h b/libavformat/version.h index 59b252db4f352..9b7ad49d2343c 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_FILESIZE -#define FF_API_FILESIZE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_MUXRATE #define FF_API_MUXRATE (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From f0cb13958d8b45800f29b067ce2bc6e9f5f58740 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 57/71] lavf: remove disabled FF_API_MUXRATE cruft --- libavformat/avformat.h | 6 ------ libavformat/mpegenc.c | 5 ----- libavformat/mpegtsenc.c | 5 ----- libavformat/options.c | 3 --- libavformat/version.h | 3 --- 5 files changed, 22 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 4f95ecc1dc544..970ca340d73a5 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -850,12 +850,6 @@ typedef struct AVFormatContext { int64_t data_offset; /**< offset of the first packet */ #endif -#if FF_API_MUXRATE - /** - * use mpeg muxer private options instead - */ - attribute_deprecated int mux_rate; -#endif unsigned int packet_size; #if FF_API_PRELOAD attribute_deprecated int preload; diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index b2ca35a3df197..9416f03129612 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -421,11 +421,6 @@ static int mpeg_mux_init(AVFormatContext *ctx) video_bitrate += codec_rate; } -#if FF_API_MUXRATE - if(ctx->mux_rate){ - s->mux_rate= (ctx->mux_rate + (8 * 50) - 1) / (8 * 50); - } else -#endif if (!s->mux_rate) { /* we increase slightly the bitrate to take into account the headers. XXX: compute it exactly */ diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 90f223273efc6..c05f7f690e7b2 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -549,11 +549,6 @@ static int mpegts_write_header(AVFormatContext *s) service->pcr_pid = ts_st->pid; } -#if FF_API_MUXRATE - if (s->mux_rate) - ts->mux_rate = s->mux_rate; -#endif - if (ts->mux_rate > 1) { service->pcr_packet_period = (ts->mux_rate * PCR_RETRANS_TIME) / (TS_PACKET_SIZE * 8 * 1000); diff --git a/libavformat/options.c b/libavformat/options.c index 7dbb8711a7cac..dcc3d609950c9 100644 --- a/libavformat/options.c +++ b/libavformat/options.c @@ -82,9 +82,6 @@ static const AVClass *format_child_class_next(const AVClass *prev) static const AVOption options[]={ {"probesize", "set probing size", OFFSET(probesize), AV_OPT_TYPE_INT, {.dbl = 5000000 }, 32, INT_MAX, D}, -#if FF_API_MUXRATE -{"muxrate", "set mux rate", OFFSET(mux_rate), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E}, -#endif {"packetsize", "set packet size", OFFSET(packet_size), AV_OPT_TYPE_INT, {.dbl = DEFAULT }, 0, INT_MAX, E}, {"fflags", NULL, OFFSET(flags), AV_OPT_TYPE_FLAGS, {.dbl = DEFAULT }, INT_MIN, INT_MAX, D|E, "fflags"}, {"ignidx", "ignore index", 0, AV_OPT_TYPE_CONST, {.dbl = AVFMT_FLAG_IGNIDX }, INT_MIN, INT_MAX, D, "fflags"}, diff --git a/libavformat/version.h b/libavformat/version.h index 9b7ad49d2343c..e2e82fd0e8857 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_MUXRATE -#define FF_API_MUXRATE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_RTSP_URL_OPTIONS #define FF_API_RTSP_URL_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From adad5b88f8e0c9227862dadb09c74c379f609c8c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 58/71] lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft --- libavformat/rtsp.c | 45 ------------------------------------------- libavformat/version.h | 3 --- 2 files changed, 48 deletions(-) diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 0c42829d39a50..c47cb0e4f106d 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -1394,51 +1394,6 @@ int ff_rtsp_connect(AVFormatContext *s) if (port < 0) port = RTSP_DEFAULT_PORT; -#if FF_API_RTSP_URL_OPTIONS - /* search for options */ - option_list = strrchr(path, '?'); - if (option_list) { - /* Strip out the RTSP specific options, write out the rest of - * the options back into the same string. */ - filename = option_list; - while (option_list) { - int handled = 1; - /* move the option pointer */ - option = ++option_list; - option_list = strchr(option_list, '&'); - if (option_list) - *option_list = 0; - - /* handle the options */ - if (!strcmp(option, "udp")) { - lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_UDP); - } else if (!strcmp(option, "multicast")) { - lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_UDP_MULTICAST); - } else if (!strcmp(option, "tcp")) { - lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_TCP); - } else if(!strcmp(option, "http")) { - lower_transport_mask |= (1<< RTSP_LOWER_TRANSPORT_TCP); - rt->control_transport = RTSP_MODE_TUNNEL; - } else if (!strcmp(option, "filter_src")) { - rt->rtsp_flags |= RTSP_FLAG_FILTER_SRC; - } else { - /* Write options back into the buffer, using memmove instead - * of strcpy since the strings may overlap. */ - int len = strlen(option); - memmove(++filename, option, len); - filename += len; - if (option_list) *filename = '&'; - handled = 0; - } - if (handled) - av_log(s, AV_LOG_WARNING, "Options passed via URL are " - "deprecated, use -rtsp_transport " - "and -rtsp_flags instead.\n"); - } - *filename = 0; - } -#endif - if (!lower_transport_mask) lower_transport_mask = (1 << RTSP_LOWER_TRANSPORT_NB) - 1; diff --git a/libavformat/version.h b/libavformat/version.h index e2e82fd0e8857..0e1be85cbb768 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_RTSP_URL_OPTIONS -#define FF_API_RTSP_URL_OPTIONS (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_NEW_STREAM #define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 1329827e79766e21277a575d7abfdd0f07eb854c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 59/71] lavf: remove disabled FF_API_NEW_STREAM cruft --- libavformat/avformat.h | 15 --------------- libavformat/utils.c | 10 ---------- libavformat/version.h | 3 --- 3 files changed, 28 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 970ca340d73a5..1bd2c49c10c08 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1379,21 +1379,6 @@ void avformat_close_input(AVFormatContext **s); * @} */ -#if FF_API_NEW_STREAM -/** - * Add a new stream to a media file. - * - * Can only be called in the read_header() function. If the flag - * AVFMTCTX_NOHEADER is in the format context, then new streams - * can be added in read_packet too. - * - * @param s media file handle - * @param id file-format-dependent stream ID - */ -attribute_deprecated -AVStream *av_new_stream(AVFormatContext *s, int id); -#endif - #if FF_API_SET_PTS_INFO /** * @deprecated this function is not supposed to be called outside of lavf diff --git a/libavformat/utils.c b/libavformat/utils.c index d241200d81ac8..24e0e8f6d75d8 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2630,16 +2630,6 @@ void avformat_close_input(AVFormatContext **ps) avio_close(pb); } -#if FF_API_NEW_STREAM -AVStream *av_new_stream(AVFormatContext *s, int id) -{ - AVStream *st = avformat_new_stream(s, NULL); - if (st) - st->id = id; - return st; -} -#endif - AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { AVStream *st; diff --git a/libavformat/version.h b/libavformat/version.h index 0e1be85cbb768..a54a075624d62 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_NEW_STREAM -#define FF_API_NEW_STREAM (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_PRELOAD #define FF_API_PRELOAD (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 2a0f868cfacd548d39665392cf4791c67bc2ea06 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 60/71] lavf: remove disabled FF_API_PRELOAD cruft --- libavformat/avformat.h | 3 --- libavformat/mpegenc.c | 4 ---- libavformat/version.h | 3 --- 3 files changed, 10 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 1bd2c49c10c08..7420dabc376ce 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -851,9 +851,6 @@ typedef struct AVFormatContext { #endif unsigned int packet_size; -#if FF_API_PRELOAD - attribute_deprecated int preload; -#endif int max_delay; int flags; diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index 9416f03129612..852b3f13c97f4 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -1158,10 +1158,6 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) int preload; const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & AV_PKT_FLAG_KEY); -#if FF_API_PRELOAD - if (ctx->preload) - s->preload = ctx->preload; -#endif preload = av_rescale(s->preload, 90000, AV_TIME_BASE); pts= pkt->pts; diff --git a/libavformat/version.h b/libavformat/version.h index a54a075624d62..36f43665314d5 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_PRELOAD -#define FF_API_PRELOAD (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_STREAM_COPY #define FF_API_STREAM_COPY (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From bd4c51312bf5b9cc37d98e8a66adf4fa06f8604c Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 61/71] lavf: remove disabled FF_API_STREAM_COPY cruft --- libavformat/avformat.h | 4 ---- libavformat/version.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 7420dabc376ce..65f6730c36005 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -562,10 +562,6 @@ typedef struct AVStream { AVRational time_base; #if FF_API_REORDER_PRIVATE int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */ -#endif -#if FF_API_STREAM_COPY - /* ffmpeg.c private use */ - attribute_deprecated int stream_copy; /**< If set, just copy stream. */ #endif enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed. diff --git a/libavformat/version.h b/libavformat/version.h index 36f43665314d5..7b9790adb82e7 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_STREAM_COPY -#define FF_API_STREAM_COPY (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_SEEK_PUBLIC #define FF_API_SEEK_PUBLIC (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From fd87ba322073c7635a8907574e8aa8b24a632e03 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 62/71] lavf: remove disabled FF_API_SEEK_PUBLIC cruft --- libavformat/avformat.h | 15 --------------- libavformat/utils.c | 25 ------------------------- libavformat/version.h | 3 --- 3 files changed, 43 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 65f6730c36005..ef7149a73385a 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1386,21 +1386,6 @@ void av_set_pts_info(AVStream *s, int pts_wrap_bits, #define AVSEEK_FLAG_ANY 4 ///< seek to any frame, even non-keyframes #define AVSEEK_FLAG_FRAME 8 ///< seeking based on frame number -#if FF_API_SEEK_PUBLIC -attribute_deprecated -int av_seek_frame_binary(AVFormatContext *s, int stream_index, - int64_t target_ts, int flags); -attribute_deprecated -void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp); -attribute_deprecated -int64_t av_gen_search(AVFormatContext *s, int stream_index, - int64_t target_ts, int64_t pos_min, - int64_t pos_max, int64_t pos_limit, - int64_t ts_min, int64_t ts_max, - int flags, int64_t *ts_ret, - int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )); -#endif - /** * @addtogroup lavf_encoding * @{ diff --git a/libavformat/utils.c b/libavformat/utils.c index 24e0e8f6d75d8..0f910691b9d55 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1283,13 +1283,6 @@ void ff_read_frame_flush(AVFormatContext *s) } } -#if FF_API_SEEK_PUBLIC -void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp) -{ - ff_update_cur_dts(s, ref_st, timestamp); -} -#endif - void ff_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp) { int i; @@ -1411,12 +1404,6 @@ int av_index_search_timestamp(AVStream *st, int64_t wanted_timestamp, wanted_timestamp, flags); } -#if FF_API_SEEK_PUBLIC -int av_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags){ - return ff_seek_frame_binary(s, stream_index, target_ts, flags); -} -#endif - int ff_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts, int flags) { AVInputFormat *avif= s->iformat; @@ -1478,18 +1465,6 @@ int ff_seek_frame_binary(AVFormatContext *s, int stream_index, int64_t target_ts return 0; } -#if FF_API_SEEK_PUBLIC -int64_t av_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts, - int64_t pos_min, int64_t pos_max, int64_t pos_limit, - int64_t ts_min, int64_t ts_max, int flags, int64_t *ts_ret, - int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )) -{ - return ff_gen_search(s, stream_index, target_ts, pos_min, pos_max, - pos_limit, ts_min, ts_max, flags, ts_ret, - read_timestamp); -} -#endif - int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts, int64_t pos_min, int64_t pos_max, int64_t pos_limit, int64_t ts_min, int64_t ts_max, int flags, int64_t *ts_ret, diff --git a/libavformat/version.h b/libavformat/version.h index 7b9790adb82e7..7459fce95246f 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_SEEK_PUBLIC -#define FF_API_SEEK_PUBLIC (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_REORDER_PRIVATE #define FF_API_REORDER_PRIVATE (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From bf868727d7100246c5bdf74570829d44bbb335be Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 63/71] lavf: remove disabled FF_API_REORDER_PRIVATE cruft --- libavformat/avformat.h | 104 ----------------------------------------- libavformat/version.h | 3 -- 2 files changed, 107 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index ef7149a73385a..26d008d03dfbd 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -542,11 +542,6 @@ typedef struct AVStream { AVRational r_frame_rate; void *priv_data; -#if FF_API_REORDER_PRIVATE - /* internal data used in av_find_stream_info() */ - int64_t first_dts; -#endif - /** * encoding: pts generation when outputting stream */ @@ -560,9 +555,6 @@ typedef struct AVStream { * encoding: set by libavformat in av_write_header */ AVRational time_base; -#if FF_API_REORDER_PRIVATE - int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */ -#endif enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed. /** @@ -580,31 +572,10 @@ typedef struct AVStream { */ int64_t duration; -#if FF_API_REORDER_PRIVATE - /* av_read_frame() support */ - enum AVStreamParseType need_parsing; - struct AVCodecParserContext *parser; - - int64_t cur_dts; - int last_IP_duration; - int64_t last_IP_pts; - /* av_seek_frame() support */ - AVIndexEntry *index_entries; /**< Only used if the format does not - support seeking natively. */ - int nb_index_entries; - unsigned int index_entries_allocated_size; -#endif - int64_t nb_frames; ///< number of frames in this stream if known or 0 int disposition; /**< AV_DISPOSITION_* bit field */ -#if FF_API_REORDER_PRIVATE - AVProbeData probe_data; -#define MAX_REORDER_DELAY 16 - int64_t pts_buffer[MAX_REORDER_DELAY+1]; -#endif - /** * sample aspect ratio (0 if unknown) * - encoding: Set by user. @@ -614,38 +585,6 @@ typedef struct AVStream { AVDictionary *metadata; -#if FF_API_REORDER_PRIVATE - /* Intended mostly for av_read_frame() support. Not supposed to be used by */ - /* external applications; try to use something else if at all possible. */ - const uint8_t *cur_ptr; - int cur_len; - AVPacket cur_pkt; - - // Timestamp generation support: - /** - * Timestamp corresponding to the last dts sync point. - * - * Initialized when AVCodecParserContext.dts_sync_point >= 0 and - * a DTS is received from the underlying container. Otherwise set to - * AV_NOPTS_VALUE by default. - */ - int64_t reference_dts; - - /** - * Number of packets to buffer for codec probing - * NOT PART OF PUBLIC API - */ -#define MAX_PROBE_PACKETS 2500 - int probe_packets; - - /** - * last packet in packet_buffer for this stream when muxing. - * Used internally, NOT PART OF PUBLIC API, do not read or - * write from outside of libav* - */ - struct AVPacketList *last_in_packet_buffer; -#endif - /** * Average framerate */ @@ -676,7 +615,6 @@ typedef struct AVStream { int64_t codec_info_duration; int nb_decoded_frames; } *info; -#if !FF_API_REORDER_PRIVATE const uint8_t *cur_ptr; int cur_len; AVPacket cur_pkt; @@ -718,7 +656,6 @@ typedef struct AVStream { unsigned int index_entries_allocated_size; int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */ -#endif } AVStream; #define AV_PROGRAM_RUNNING 1 @@ -806,15 +743,6 @@ typedef struct AVFormatContext { char filename[1024]; /**< input or output filename */ /* stream info */ int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */ -#if FF_API_REORDER_PRIVATE - /* private data for pts handling (do not modify directly). */ - /** - * This buffer is only needed when packets were already buffered but - * not decoded, for example to get the codec parameters in MPEG - * streams. - */ - struct AVPacketList *packet_buffer; -#endif /** * Decoding: position of the first frame of the component, in @@ -838,14 +766,6 @@ typedef struct AVFormatContext { */ int bit_rate; -#if FF_API_REORDER_PRIVATE - /* av_read_frame() support */ - AVStream *cur_st; - - /* av_seek_frame() support */ - int64_t data_offset; /**< offset of the first packet */ -#endif - unsigned int packet_size; int max_delay; @@ -921,30 +841,8 @@ typedef struct AVFormatContext { int debug; #define FF_FDEBUG_TS 0x0001 -#if FF_API_REORDER_PRIVATE - /** - * Raw packets from the demuxer, prior to parsing and decoding. - * This buffer is used for buffering packets until the codec can - * be identified, as parsing cannot be done without knowing the - * codec. - */ - struct AVPacketList *raw_packet_buffer; - struct AVPacketList *raw_packet_buffer_end; - - struct AVPacketList *packet_buffer_end; -#endif - AVDictionary *metadata; -#if FF_API_REORDER_PRIVATE - /** - * Remaining size available for raw_packet_buffer, in bytes. - * NOT PART OF PUBLIC API - */ -#define RAW_PACKET_BUFFER_SIZE 2500000 - int raw_packet_buffer_remaining_size; -#endif - /** * Start time of the stream in real world time, in microseconds * since the unix epoch (00:00 1st January 1970). That is, pts=0 @@ -985,7 +883,6 @@ typedef struct AVFormatContext { * New public fields should be added right above. ***************************************************************** */ -#if !FF_API_REORDER_PRIVATE /** * Raw packets from the demuxer, prior to parsing and decoding. * This buffer is used for buffering packets until the codec can @@ -1013,7 +910,6 @@ typedef struct AVFormatContext { /* av_seek_frame() support */ int64_t data_offset; /**< offset of the first packet */ -#endif } AVFormatContext; typedef struct AVPacketList { diff --git a/libavformat/version.h b/libavformat/version.h index 7459fce95246f..3051042d1ddcc 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_REORDER_PRIVATE -#define FF_API_REORDER_PRIVATE (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_OLD_INTERRUPT_CB #define FF_API_OLD_INTERRUPT_CB (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From 374e469b8dcef1c3d9a7769fad178cbed210da73 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 64/71] lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft --- libavformat/avio.c | 23 ----------------------- libavformat/avio.h | 12 ------------ libavformat/version.h | 3 --- 3 files changed, 38 deletions(-) diff --git a/libavformat/avio.c b/libavformat/avio.c index f2fec5bdefcbc..067f2958e02d7 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -84,11 +84,6 @@ const AVClass ffurl_context_class = { /*@}*/ -#if FF_API_OLD_INTERRUPT_CB -static int default_interrupt_cb(void); -int (*url_interrupt_cb)(void) = default_interrupt_cb; -#endif - const char *avio_enum_protocols(void **opaque, int output) { URLProtocol **p = opaque; @@ -350,29 +345,11 @@ int ffurl_get_file_handle(URLContext *h) return h->prot->url_get_file_handle(h); } -#if FF_API_OLD_INTERRUPT_CB -static int default_interrupt_cb(void) -{ - return 0; -} - -void avio_set_interrupt_cb(int (*interrupt_cb)(void)) -{ - if (!interrupt_cb) - interrupt_cb = default_interrupt_cb; - url_interrupt_cb = interrupt_cb; -} -#endif - int ff_check_interrupt(AVIOInterruptCB *cb) { int ret; if (cb && cb->callback && (ret = cb->callback(cb->opaque))) return ret; -#if FF_API_OLD_INTERRUPT_CB - return url_interrupt_cb(); -#else return 0; -#endif } diff --git a/libavformat/avio.h b/libavformat/avio.h index ad96775910a77..0ab92c32e50da 100644 --- a/libavformat/avio.h +++ b/libavformat/avio.h @@ -133,18 +133,6 @@ typedef struct { */ int avio_check(const char *url, int flags); -#if FF_API_OLD_INTERRUPT_CB -/** - * The callback is called in blocking functions to test regulary if - * asynchronous interruption is needed. AVERROR_EXIT is returned - * in this case by the interrupted function. 'NULL' means no interrupt - * callback is given. - * @deprecated Use interrupt_callback in AVFormatContext/avio_open2 - * instead. - */ -attribute_deprecated void avio_set_interrupt_cb(int (*interrupt_cb)(void)); -#endif - /** * Allocate and initialize an AVIOContext for buffered I/O. It must be later * freed with av_free(). diff --git a/libavformat/version.h b/libavformat/version.h index 3051042d1ddcc..4a6f74bc98068 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_OLD_INTERRUPT_CB -#define FF_API_OLD_INTERRUPT_CB (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_SET_PTS_INFO #define FF_API_SET_PTS_INFO (LIBAVFORMAT_VERSION_MAJOR < 54) #endif From c5254755c0154dcc7bb1191a84e6e7cf0106343b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 12 Jan 2012 13:31:55 +0100 Subject: [PATCH 65/71] lavf: remove disabled FF_API_SET_PTS_INFO cruft --- libavformat/avformat.h | 9 --------- libavformat/utils.c | 8 -------- libavformat/version.h | 3 --- 3 files changed, 20 deletions(-) diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 26d008d03dfbd..a78c1e3b726d1 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1268,15 +1268,6 @@ void avformat_close_input(AVFormatContext **s); * @} */ -#if FF_API_SET_PTS_INFO -/** - * @deprecated this function is not supposed to be called outside of lavf - */ -attribute_deprecated -void av_set_pts_info(AVStream *s, int pts_wrap_bits, - unsigned int pts_num, unsigned int pts_den); -#endif - #define AVSEEK_FLAG_BACKWARD 1 ///< seek backward #define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes #define AVSEEK_FLAG_ANY 4 ///< seek to any frame, even non-keyframes diff --git a/libavformat/utils.c b/libavformat/utils.c index 0f910691b9d55..41450971af536 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -3579,14 +3579,6 @@ int ff_hex_to_data(uint8_t *data, const char *p) return len; } -#if FF_API_SET_PTS_INFO -void av_set_pts_info(AVStream *s, int pts_wrap_bits, - unsigned int pts_num, unsigned int pts_den) -{ - avpriv_set_pts_info(s, pts_wrap_bits, pts_num, pts_den); -} -#endif - void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits, unsigned int pts_num, unsigned int pts_den) { diff --git a/libavformat/version.h b/libavformat/version.h index 4a6f74bc98068..6f3b387ddc536 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -47,9 +47,6 @@ * Those FF_API_* defines are not part of public API. * They may change, break or disappear at any time. */ -#ifndef FF_API_SET_PTS_INFO -#define FF_API_SET_PTS_INFO (LIBAVFORMAT_VERSION_MAJOR < 54) -#endif #ifndef FF_API_CLOSE_INPUT_FILE #define FF_API_CLOSE_INPUT_FILE (LIBAVFORMAT_VERSION_MAJOR < 55) #endif From 2c577155a7e6a5c63279a165d2dd67af4a10e346 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Fri, 27 Jan 2012 11:28:21 -0500 Subject: [PATCH 66/71] libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat Fixes build with --enable-libspeex --- libavcodec/libspeexenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c index 290718c5f1247..bccf9c810d1e1 100644 --- a/libavcodec/libspeexenc.c +++ b/libavcodec/libspeexenc.c @@ -319,7 +319,7 @@ AVCodec ff_libspeex_encoder = { .encode = encode_frame, .close = encode_close, .capabilities = CODEC_CAP_DELAY, - .sample_fmts = (const enum SampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, + .sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libspeex Speex"), .priv_class = &class, .defaults = defaults, From 1bbb173652605053ed9ed2fea20ee7205ea19e0e Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Fri, 27 Jan 2012 00:11:07 +0530 Subject: [PATCH 67/71] sunrast: Add a check for experimental type. Signed-off-by: Justin Ruggles --- libavcodec/sunrast.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index 455619e39e6c9..6da57d138c2aa 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -29,6 +29,7 @@ #define RT_FORMAT_RGB 3 #define RT_FORMAT_TIFF 4 #define RT_FORMAT_IFF 5 +#define RT_EXPERIMENTAL 0xffff typedef struct SUNRASTContext { AVFrame picture; @@ -70,7 +71,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, maplength = AV_RB32(buf+28); buf += 32; - if (type == RT_FORMAT_TIFF || type == RT_FORMAT_IFF) { + if (type == RT_FORMAT_TIFF || type == RT_FORMAT_IFF || type == RT_EXPERIMENTAL) { av_log(avctx, AV_LOG_ERROR, "unsupported (compression) type\n"); return -1; } From bca77a1a64a658beb616adcdd59fb3000c7a737b Mon Sep 17 00:00:00 2001 From: Aneesh Dogra Date: Fri, 27 Jan 2012 23:45:58 +0530 Subject: [PATCH 68/71] sunrast: Document the different Sun Raster file format types. Signed-off-by: Justin Ruggles --- libavcodec/sunrast.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index 6da57d138c2aa..a471aee3ed96c 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -23,12 +23,28 @@ #include "libavutil/imgutils.h" #include "avcodec.h" +/* The Old and Standard format types indicate that the image data is + * uncompressed. There is no difference between the two formats. */ #define RT_OLD 0 #define RT_STANDARD 1 + +/* The Byte-Encoded format type indicates that the image data is compressed + * using a run-length encoding scheme. */ #define RT_BYTE_ENCODED 2 + +/* The RGB format type indicates that the image is uncompressed with reverse + * component order from Old and Standard (RGB vs BGR). */ #define RT_FORMAT_RGB 3 + +/* The TIFF and IFF format types indicate that the raster file was originally + * converted from either of these file formats. We do not have any samples or + * documentation of the format details. */ #define RT_FORMAT_TIFF 4 #define RT_FORMAT_IFF 5 + +/* The Experimental format type is implementation-specific and is generally an + * indication that the image file does not conform to the Sun Raster file + * format specification. */ #define RT_EXPERIMENTAL 0xffff typedef struct SUNRASTContext { From 9a7dc618c50902e7a171f2deda6430d52c277a95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 26 Jan 2012 21:37:38 +0200 Subject: [PATCH 69/71] libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Earlier, calling avcodec_encode_audio worked fine even if time_base wasn't set. Now it crashes due to trying to scale the output pts to the codec context time base. This affects e.g. VLC. If no time_base is set for audio codecs, set it to the sample rate. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö --- libavcodec/utils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libavcodec/utils.c b/libavcodec/utils.c index fadfb0c0aacbd..707ecb5fef26d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -714,6 +714,12 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD } avctx->frame_number = 0; + if (avctx->codec_type == AVMEDIA_TYPE_AUDIO && + (!avctx->time_base.num || !avctx->time_base.den)) { + avctx->time_base.num = 1; + avctx->time_base.den = avctx->sample_rate; + } + if (HAVE_THREADS && !avctx->thread_opaque) { ret = ff_thread_init(avctx); if (ret < 0) { From f53221049933627a31fb4a530c290802715ccf65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Fri, 20 Jan 2012 13:02:18 +0200 Subject: [PATCH 70/71] movenc: Support adding isml (smooth streaming live) metadata MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This metadata is required for pushing a live stream to an IIS publishing point. Signed-off-by: Martin Storsjö --- libavformat/movenc.c | 130 +++++++++++++++++++++++++++++++++++++++++++ libavformat/movenc.h | 1 + 2 files changed, 131 insertions(+) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index eee426f69217b..8a40345716ecb 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -49,6 +49,7 @@ static const AVOption options[] = { { "frag_keyframe", "Fragment at video keyframes", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_FRAG_KEYFRAME}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "separate_moof", "Write separate moof/mdat atoms for each track", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_SEPARATE_MOOF}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, { "frag_custom", "Flush fragments on caller requests", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_FRAG_CUSTOM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, + { "isml", "Create a live smooth streaming feed (for pushing to a publishing point)", 0, AV_OPT_TYPE_CONST, {.dbl = FF_MOV_FLAG_ISML}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" }, FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags), { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM}, { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.dbl = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM}, @@ -1920,6 +1921,128 @@ static int mov_write_moov_tag(AVIOContext *pb, MOVMuxContext *mov, return updateSize(pb, pos); } +static void param_write_int(AVIOContext *pb, const char *name, int value) +{ + avio_printf(pb, "\n", name, value); +} + +static void param_write_string(AVIOContext *pb, const char *name, const char *value) +{ + avio_printf(pb, "\n", name, value); +} + +static void param_write_hex(AVIOContext *pb, const char *name, const uint8_t *value, int len) +{ + char buf[150]; + len = FFMIN(sizeof(buf)/2 - 1, len); + ff_data_to_hex(buf, value, len, 0); + buf[2*len] = '\0'; + avio_printf(pb, "\n", name, buf); +} + +static void write_h264_extradata(AVIOContext *pb, AVCodecContext *enc) +{ + uint16_t sps_size, pps_size, len; + char buf[150]; + sps_size = AV_RB16(&enc->extradata[6]); + if (11 + sps_size > enc->extradata_size) + return; + pps_size = AV_RB16(&enc->extradata[9 + sps_size]); + if (11 + sps_size + pps_size > enc->extradata_size) + return; + len = FFMIN(sizeof(buf)/2 - 1, sps_size); + ff_data_to_hex(buf, &enc->extradata[8], len, 0); + buf[2*len] = '\0'; + avio_printf(pb, "extradata[11 + sps_size], len, 0); + buf[2*len] = '\0'; + avio_printf(pb, "00000001%s\" valuetype=\"data\"/>\n", buf); +} + +static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov) +{ + int64_t pos = avio_tell(pb); + int i; + const uint8_t uuid[] = { + 0xa5, 0xd4, 0x0b, 0x30, 0xe8, 0x14, 0x11, 0xdd, + 0xba, 0x2f, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 + }; + + avio_wb32(pb, 0); + ffio_wfourcc(pb, "uuid"); + avio_write(pb, uuid, sizeof(uuid)); + avio_wb32(pb, 0); + + avio_printf(pb, "\n"); + avio_printf(pb, "\n"); + avio_printf(pb, "\n"); + avio_printf(pb, "\n", + LIBAVFORMAT_IDENT); + avio_printf(pb, "\n"); + avio_printf(pb, "\n"); + avio_printf(pb, "\n"); + for (i = 0; i < mov->nb_streams; i++) { + MOVTrack *track = &mov->tracks[i]; + const char *type; + /* track->trackID is initialized in write_moov, and thus isn't known + * here yet */ + int track_id = i + 1; + + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { + type = "video"; + } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) { + type = "audio"; + } else { + continue; + } + avio_printf(pb, "<%s systemBitrate=\"%d\">\n", type, + track->enc->bit_rate); + param_write_int(pb, "systemBitrate", track->enc->bit_rate); + param_write_int(pb, "trackID", track_id); + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { + if (track->enc->codec_id == CODEC_ID_H264 && + track->enc->extradata_size >= 11 && + track->enc->extradata[0] == 1) { + write_h264_extradata(pb, track->enc); + } else { + param_write_hex(pb, "CodecPrivateData", track->enc->extradata, + track->enc->extradata_size); + } + if (track->enc->codec_id == CODEC_ID_H264) { + param_write_string(pb, "FourCC", "H264"); + } else if (track->enc->codec_id == CODEC_ID_VC1) { + param_write_string(pb, "FourCC", "WVC1"); + } + param_write_int(pb, "MaxWidth", track->enc->width); + param_write_int(pb, "MaxHeight", track->enc->height); + param_write_int(pb, "DisplayWidth", track->enc->width); + param_write_int(pb, "DisplayHeight", track->enc->height); + } else { + if (track->enc->codec_id == CODEC_ID_AAC) { + param_write_string(pb, "FourCC", "AACL"); + } else if (track->enc->codec_id == CODEC_ID_WMAPRO) { + param_write_string(pb, "FourCC", "WMAP"); + } + param_write_hex(pb, "CodecPrivateData", track->enc->extradata, + track->enc->extradata_size); + param_write_int(pb, "AudioTag", ff_codec_get_tag(ff_codec_wav_tags, + track->enc->codec_id)); + param_write_int(pb, "Channels", track->enc->channels); + param_write_int(pb, "SamplingRate", track->enc->sample_rate); + param_write_int(pb, "BitsPerSample", 16); + param_write_int(pb, "PacketSize", track->enc->block_align ? + track->enc->block_align : 4); + } + avio_printf(pb, "\n", type); + } + avio_printf(pb, "\n"); + avio_printf(pb, "\n"); + avio_printf(pb, "\n"); + + return updateSize(pb, pos); +} + static int mov_write_mfhd_tag(AVIOContext *pb, MOVMuxContext *mov) { avio_wb32(pb, 16); @@ -2190,6 +2313,10 @@ static int mov_write_mfra_tag(AVIOContext *pb, MOVMuxContext *mov) avio_wb32(pb, 0); /* size placeholder */ ffio_wfourcc(pb, "mfra"); + /* An empty mfra atom is enough to indicate to the publishing point that + * the stream has ended. */ + if (mov->flags & FF_MOV_FLAG_ISML) + return updateSize(pb, pos); for (i = 0; i < mov->nb_streams; i++) { MOVTrack *track = &mov->tracks[i]; @@ -2829,6 +2956,9 @@ static int mov_write_header(AVFormatContext *s) avio_flush(pb); + if (mov->flags & FF_MOV_FLAG_ISML) + mov_write_isml_manifest(pb, mov); + if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV) { mov_write_moov_tag(pb, mov, s); mov->fragments++; diff --git a/libavformat/movenc.h b/libavformat/movenc.h index a1e504dca544c..0b74a61d067d6 100644 --- a/libavformat/movenc.h +++ b/libavformat/movenc.h @@ -150,6 +150,7 @@ typedef struct MOVMuxContext { #define FF_MOV_FLAG_FRAG_KEYFRAME 8 #define FF_MOV_FLAG_SEPARATE_MOOF 16 #define FF_MOV_FLAG_FRAG_CUSTOM 32 +#define FF_MOV_FLAG_ISML 64 int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt); From e771e6dd63e837220aa5d959486546d2be972e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 19 Jan 2012 11:17:13 +0200 Subject: [PATCH 71/71] movenc: Allow writing to a non-seekable output if using empty moov MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In this mode, no seeks will be done except for within moov/moof fragments, which should fit within the AVIOContext buffer. This allows pushing live smooth streaming format data to a live publishing point on IIS over http. Signed-off-by: Martin Storsjö --- libavformat/movenc.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 8a40345716ecb..22e8d842f4aac 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -2518,6 +2518,7 @@ static int mov_flush_fragment(AVFormatContext *s) mov->tracks[i].cluster[0].dts; mov->tracks[i].entry = 0; } + avio_flush(s->pb); return 0; } @@ -2557,6 +2558,7 @@ static int mov_flush_fragment(AVFormatContext *s) if (write_moof) { MOVFragmentInfo *info; + avio_flush(s->pb); track->nb_frag_info++; track->frag_info = av_realloc(track->frag_info, sizeof(*track->frag_info) * @@ -2589,6 +2591,7 @@ static int mov_flush_fragment(AVFormatContext *s) mov->mdat_size = 0; + avio_flush(s->pb); return 0; } @@ -2602,7 +2605,9 @@ static int mov_write_packet_internal(AVFormatContext *s, AVPacket *pkt) int size= pkt->size; uint8_t *reformatted_data = NULL; - if (!s->pb->seekable) return 0; /* Can't handle that */ + if (!s->pb->seekable && !(mov->flags & FF_MOV_FLAG_EMPTY_MOOV)) + return 0; /* Can't handle that */ + if (!size) return 0; /* Discard 0 sized packets */ if ((mov->max_fragment_duration && trk->entry && @@ -2782,7 +2787,13 @@ static int mov_write_header(AVFormatContext *s) AVDictionaryEntry *t; int i, hint_track = 0; - if (!s->pb->seekable) { + /* Non-seekable output is ok if EMPTY_MOOV is set, or if using the ismv + * format (which sets EMPTY_MOOV later in this function). If ism_lookahead + * is enabled, we don't support non-seekable output at all. */ + if (!s->pb->seekable && + ((!(mov->flags & FF_MOV_FLAG_EMPTY_MOOV) && + !(s->oformat && !strcmp(s->oformat->name, "ismv"))) + || mov->ism_lookahead)) { av_log(s, AV_LOG_ERROR, "muxer does not support non seekable output\n"); return -1; }