diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-01-28 04:23:26 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-01-28 07:53:34 +0100 |
commit | e37f161e66e042d6c2c7470c4d9881df9427fc4a (patch) | |
tree | 6400fd6453f0525a65724937532d5baa33deead3 /libavcodec | |
parent | f21b6159cf3110a5f018d6addf7382840d427199 (diff) | |
parent | e771e6dd63e837220aa5d959486546d2be972e83 (diff) | |
download | ffmpeg-e37f161e66e042d6c2c7470c4d9881df9427fc4a.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master: (71 commits)
movenc: Allow writing to a non-seekable output if using empty moov
movenc: Support adding isml (smooth streaming live) metadata
libavcodec: Don't crash in avcodec_encode_audio if time_base isn't set
sunrast: Document the different Sun Raster file format types.
sunrast: Add a check for experimental type.
libspeexenc: use AVSampleFormat instead of deprecated/removed SampleFormat
lavf: remove disabled FF_API_SET_PTS_INFO cruft
lavf: remove disabled FF_API_OLD_INTERRUPT_CB cruft
lavf: remove disabled FF_API_REORDER_PRIVATE cruft
lavf: remove disabled FF_API_SEEK_PUBLIC cruft
lavf: remove disabled FF_API_STREAM_COPY cruft
lavf: remove disabled FF_API_PRELOAD cruft
lavf: remove disabled FF_API_NEW_STREAM cruft
lavf: remove disabled FF_API_RTSP_URL_OPTIONS cruft
lavf: remove disabled FF_API_MUXRATE cruft
lavf: remove disabled FF_API_FILESIZE cruft
lavf: remove disabled FF_API_TIMESTAMP cruft
lavf: remove disabled FF_API_LOOP_OUTPUT cruft
lavf: remove disabled FF_API_LOOP_INPUT cruft
lavf: remove disabled FF_API_AVSTREAM_QUALITY cruft
...
Conflicts:
doc/APIchanges
libavcodec/8bps.c
libavcodec/avcodec.h
libavcodec/libx264.c
libavcodec/mjpegbdec.c
libavcodec/options.c
libavcodec/sunrast.c
libavcodec/utils.c
libavcodec/version.h
libavcodec/x86/h264_deblock.asm
libavdevice/libdc1394.c
libavdevice/v4l2.c
libavformat/avformat.h
libavformat/avio.c
libavformat/avio.h
libavformat/aviobuf.c
libavformat/dv.c
libavformat/mov.c
libavformat/utils.c
libavformat/version.h
libavformat/wtv.c
libavutil/Makefile
libavutil/file.c
libswscale/x86/input.asm
libswscale/x86/swscale_mmx.c
libswscale/x86/swscale_template.c
tests/ref/lavf/ffm
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
52 files changed, 359 insertions, 1511 deletions
diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index 9207020c9c..7951bd8db0 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,87 +60,90 @@ 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 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); - - 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 * planes > pixptr_end) - break; - if(dp + count > buf+buf_size) return -1; - while(count--) { - *pixptr = *dp++; - pixptr += planes; - } - } else { - count = 257 - count; - if (pixptr + count * planes > pixptr_end) - break; - while(count--) { - *pixptr = *dp; - pixptr += planes; - } - 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 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); + + 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 * planes > pixptr_end) + break; + if (dp + count > buf + buf_size) + return -1; + while (count--) { + *pixptr = *dp++; + pixptr += planes; + } + } else { + count = 257 - count; + if (pixptr + count * planes > pixptr_end) + break; + while (count--) { + *pixptr = *dp; + pixptr += planes; + } + 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; } @@ -151,47 +154,47 @@ 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; - - avcodec_get_frame_defaults(&c->pic); - 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; + + avcodec_get_frame_defaults(&c->pic); + 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; } @@ -204,12 +207,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; } diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 372b7f1bb9..089b8668b3 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -3,7 +3,7 @@ include $(SUBDIR)../config.mak 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/ac3dec.c b/libavcodec/ac3dec.c index 598255830b..01e08ec0c5 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -162,11 +162,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/audioconvert.c b/libavcodec/audioconvert.c index c48fbb74c5..2cf36bd1ab 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) { @@ -62,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 7d8278fd47..93b9ef1ed7 100644 --- a/libavcodec/audioconvert.h +++ b/libavcodec/audioconvert.h @@ -33,46 +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. - */ -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 62e90be012..ca062eda91 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -34,6 +34,7 @@ #include "libavutil/log.h" #include "libavutil/pixfmt.h" #include "libavutil/rational.h" +#include "libavutil/audioconvert.h" #include "libavcodec/version.h" /** @@ -355,10 +356,6 @@ enum CodecID { CODEC_ID_MACE3, CODEC_ID_MACE6, CODEC_ID_VMDAUDIO, -#if LIBAVCODEC_VERSION_MAJOR == 53 - CODEC_ID_SONIC, - CODEC_ID_SONIC_LS, -#endif CODEC_ID_FLAC, CODEC_ID_MP3ADU, CODEC_ID_MP3ON4, @@ -411,6 +408,8 @@ enum CodecID { CODEC_ID_G723_1= 0x15801, CODEC_ID_FFWAVESYNTH = MKBETAG('F','F','W','S'), CODEC_ID_8SVX_RAW = MKBETAG('8','S','V','X'), + CODEC_ID_SONIC = MKBETAG('S','O','N','C'), + CODEC_ID_SONIC_LS = MKBETAG('S','O','N','L'), /* subtitle codecs */ CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs. @@ -441,66 +440,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" - -/* 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 @@ -604,20 +543,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, @@ -679,51 +604,10 @@ typedef struct RcOverride{ #define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size. #define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding. #define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata. +#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. DEPRECATED!!!! #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. #define CODEC_FLAG2_SHOW_ALL 0x00400000 ///< Show all frames before the first keyframe -/** - * @defgroup deprecated_flags Deprecated codec flags - * 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 -#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 -#if FF_API_LAME_GLOBAL_OPTS -#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible -#endif -/** - * @} - */ /* Unsupported options : * Syntax Arithmetic coding (SAC) @@ -739,10 +623,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 @@ -894,17 +774,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. @@ -1014,11 +883,7 @@ enum AVSideDataParamChangeFlags { * sizeof(AVFrame) must not be used outside libavcodec. */ 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 @@ -1087,13 +952,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 @@ -1707,21 +1565,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. * @@ -1804,16 +1647,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. @@ -2237,22 +2070,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. @@ -2359,15 +2176,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. @@ -2417,19 +2225,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. @@ -2688,24 +2483,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. @@ -2727,15 +2504,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. @@ -2743,50 +2511,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. @@ -2835,43 +2559,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 * - encoding: Set by user, in non drop frame format @@ -2889,17 +2576,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 @@ -3027,87 +2703,8 @@ 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 - /** - * 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 @@ -3137,19 +2734,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, @@ -3441,29 +3025,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, @@ -3764,17 +3325,6 @@ void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int * */ const char *avcodec_get_name(enum CodecID id); -#if FF_API_GET_PIX_FMT_NAME -/** - * Return the short name for a pixel format. - * - * \see av_get_pix_fmt(), av_get_pix_fmt_string(). - * @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); /** @@ -3881,18 +3431,6 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2, 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 */ @@ -3923,15 +3461,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. * @@ -4108,14 +3637,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 @@ -4486,18 +4007,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. * @@ -4506,14 +4015,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/flacenc.c b/libavcodec/flacenc.c index 7345a7eef0..a1c3bca2dd 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/frwu.c b/libavcodec/frwu.c index eee34512b4..b4394a3044 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; } diff --git a/libavcodec/g723_1.c b/libavcodec/g723_1.c index ec70e06f3e..711fa56aec 100644 --- a/libavcodec/g723_1.c +++ b/libavcodec/g723_1.c @@ -2224,7 +2224,7 @@ AVCodec ff_g723_1_encoder = { .init = g723_1_encode_init, .encode = g723_1_encode_frame, .long_name = NULL_IF_CONFIG_SMALL("G.723.1"), - .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}, }; #endif diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 2b18b06f69..962b5dc475 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3695,7 +3695,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){ tprintf(s->avctx, "slice end %d %d\n", get_bits_count(&s->gb), s->gb.size_in_bits); if( get_bits_count(&s->gb) == s->gb.size_in_bits - || get_bits_count(&s->gb) < s->gb.size_in_bits && s->avctx->error_recognition < FF_ER_AGGRESSIVE) { + || get_bits_count(&s->gb) < s->gb.size_in_bits && !(s->avctx->err_recognition & AV_EF_AGGRESSIVE)) { ff_er_add_slice(s, s->resync_mb_x, s->resync_mb_y, s->mb_x-1, s->mb_y, ER_MB_END&part_mask); return 0; diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 8b32230ff4..fac5f52107 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -289,13 +289,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; @@ -753,55 +746,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<height;y++) { - for(x=0;x<width;x++) { - a = palette[p[0]] >> 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/libaacplus.c b/libavcodec/libaacplus.c index 75b792d3c3..fd01f0a7b0 100644 --- a/libavcodec/libaacplus.c +++ b/libavcodec/libaacplus.c @@ -129,6 +129,6 @@ AVCodec ff_libaacplus_encoder = { .init = aacPlus_encode_init, .encode = aacPlus_encode_frame, .close = aacPlus_encode_close, - .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("libaacplus AAC+ (Advanced Audio Codec with SBR+PS)"), }; diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 461dcb5a0f..04498d2271 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -75,9 +75,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/libspeexenc.c b/libavcodec/libspeexenc.c index c89f0748a1..8cdc911c2a 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, diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index 59257f0199..7f817cbb4c 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -314,17 +314,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; @@ -360,55 +349,6 @@ static av_cold int X264_init(AVCodecContext *avctx) } } -#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; - } - if (avctx->flags2) { - 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) @@ -536,9 +476,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) @@ -675,7 +612,7 @@ static const AVCodecDefault x264_defaults[] = { { "qdiff", "-1" }, { "qblur", "-1" }, { "qcomp", "-1" }, - { "rc_lookahead", "-1" }, +// { "rc_lookahead", "-1" }, { "refs", "-1" }, { "sc_threshold", "-1" }, { "trellis", "-1" }, diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index aa93b555f9..acc674dc1a 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/mjpegbdec.c b/libavcodec/mjpegbdec.c index c8b1452e9e..fc77b14b44 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -59,6 +59,9 @@ read_header: 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,7 +114,8 @@ read_header: av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs); if (sos_offs) { - init_get_bits(&s->gb, buf_ptr+sos_offs, FFMIN(field_size, buf_end - (buf_ptr+sos_offs))*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 && diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 2abfea0d6e..fcdcc21caf 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -103,10 +103,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/mpeg12enc.c b/libavcodec/mpeg12enc.c index 5dc7652d12..71c26fa34b 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -135,13 +135,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/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index b57395ae8f..4312689393 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -1493,7 +1493,7 @@ end: if(s->codec_id==CODEC_ID_MPEG4){ int next= mpeg4_is_resync(s); if(next) { - if (s->mb_x + s->mb_y*s->mb_width + 1 > next && s->avctx->error_recognition >= FF_ER_AGGRESSIVE) { + if (s->mb_x + s->mb_y*s->mb_width + 1 > next && (s->avctx->err_recognition & AV_EF_AGGRESSIVE)) { return -1; } else if (s->mb_x + s->mb_y*s->mb_width + 1 >= next) return SLICE_END; diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index a6a5d8632b..da34d84878 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 7b6dcd96a1..083bd97f5a 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/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 45dcea076b..4eaad5d819 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -353,10 +353,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; @@ -385,12 +381,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, "Either both buffer size and max rate or neither must be specified\n"); @@ -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 && @@ -499,11 +473,7 @@ av_cold int MPV_encode_init(AVCodecContext *avctx) avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 255); } - 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; @@ -535,15 +505,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, @@ -558,13 +519,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"); @@ -576,11 +530,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; @@ -727,14 +677,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/opt.h b/libavcodec/opt.h deleted file mode 100644 index 2380e74332..0000000000 --- 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/options.c b/libavcodec/options.c index 6b012963de..e1b8084bc3 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -80,23 +80,14 @@ 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"}, -#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"}, @@ -104,25 +95,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"}, @@ -161,9 +139,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}, @@ -201,14 +176,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, A|V|D, "err_detect"}, {"bitstream", "detect bitstream specification deviations", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_BITSTREAM }, INT_MIN, INT_MAX, A|V|D, "err_detect"}, @@ -219,9 +186,6 @@ static const AVOption options[]={ {"aggressive", "consider things that a sane encoder shouldnt do as an error", 0, AV_OPT_TYPE_CONST, {.dbl = AV_EF_AGGRESSIVE }, INT_MIN, INT_MAX, A|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}, @@ -356,25 +320,8 @@ 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 = 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}, -#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"}, @@ -417,70 +364,21 @@ 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/VP8)", OFFSET(crf), AV_OPT_TYPE_FLOAT, {.dbl = DEFAULT }, 0, 63, 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", OFFSET(keyint_min), AV_OPT_TYPE_INT, {.dbl = 25 }, INT_MIN, INT_MAX, V|E}, {"refs", "reference frames to consider for motion compensation", 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 -{"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}, {"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_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 -#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 -#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"}, @@ -492,26 +390,7 @@ 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}, -{"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/sunrast.c b/libavcodec/sunrast.c index 23999a0743..b602c9dd93 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -23,13 +23,30 @@ #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 { AVFrame picture; } SUNRASTContext; @@ -70,6 +87,10 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, maplength = AV_RB32(buf+28); buf += 32; + if (type == RT_EXPERIMENTAL) { + av_log(avctx, AV_LOG_ERROR, "unsupported (compression) type\n"); + return -1; + } if (type > RT_FORMAT_IFF) { av_log(avctx, AV_LOG_ERROR, "invalid (compression) type\n"); return -1; diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 833acb543b..85976f41c0 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -233,22 +233,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/utils.c b/libavcodec/utils.c index 1d6a829cc5..dec9003e1d 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -107,10 +107,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; @@ -799,23 +796,13 @@ 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; %X\n", - avctx->error_recognition, avctx->err_recognition); - switch(avctx->error_recognition){ - case FF_ER_EXPLODE : avctx->err_recognition |= AV_EF_EXPLODE | AV_EF_COMPLIANT | AV_EF_CAREFUL; - break; - case FF_ER_VERY_AGGRESSIVE: - case FF_ER_AGGRESSIVE : avctx->err_recognition |= AV_EF_AGGRESSIVE; - case FF_ER_COMPLIANT : avctx->err_recognition |= AV_EF_COMPLIANT; - case FF_ER_CAREFUL : avctx->err_recognition |= AV_EF_CAREFUL; + 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; } - av_log(avctx, AV_LOG_DEBUG, "err{or,}_recognition combined: %d; %X\n", - avctx->error_recognition, avctx->err_recognition); -#endif - if (!HAVE_THREADS) av_log(avctx, AV_LOG_WARNING, "Warning: not compiled with thread support, using thread emulation\n"); @@ -1683,10 +1670,10 @@ const char *av_get_profile_name(const AVCodec *codec, int profile) unsigned avcodec_version( void ) { - av_assert0(CODEC_ID_V410==164); +// av_assert0(CODEC_ID_V410==164); av_assert0(CODEC_ID_PCM_S8_PLANAR==65563); av_assert0(CODEC_ID_ADPCM_G722==69660); - av_assert0(CODEC_ID_BMV_AUDIO==86071); +// av_assert0(CODEC_ID_BMV_AUDIO==86071); av_assert0(CODEC_ID_SRT==94216); av_assert0(LIBAVCODEC_VERSION_MICRO >= 100); @@ -1766,12 +1753,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: @@ -1821,12 +1802,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; @@ -1982,14 +1957,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) { AVCodec *c= avcodec_find_decoder(codec_id); diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index 109c009338..177c5082bb 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); } diff --git a/libavcodec/version.h b/libavcodec/version.h index d67ad2f5d2..b27ffc9195 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 60 +#define LIBAVCODEC_VERSION_MAJOR 54 +#define LIBAVCODEC_VERSION_MINOR 0 #define LIBAVCODEC_VERSION_MICRO 100 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ @@ -38,91 +38,22 @@ * 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 -#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 #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 -#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 -#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) +#define FF_API_ALLOC_CONTEXT (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 -#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 -#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 -#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 -#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 -#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 -#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) +#define FF_API_AVCODEC_OPEN (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_OLD_DECODE_AUDIO #define FF_API_OLD_DECODE_AUDIO (LIBAVCODEC_VERSION_MAJOR < 55) #endif #ifndef FF_API_OLD_TIMECODE -#define FF_API_OLD_TIMECODE (LIBAVCODEC_VERSION_MAJOR < 54) +#define FF_API_OLD_TIMECODE (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 diff --git a/libavcodec/x86/ac3dsp.asm b/libavcodec/x86/ac3dsp.asm index 59157b7219..4ada8990ba 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 bd69fe118c..ca44106433 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/diracdsp_yasm.asm b/libavcodec/x86/diracdsp_yasm.asm index 4c5a5d7c3a..60edac999e 100644 --- a/libavcodec/x86/diracdsp_yasm.asm +++ b/libavcodec/x86/diracdsp_yasm.asm @@ -135,7 +135,7 @@ cglobal put_signed_rect_clamped_%1, 5,7,3, dst, dst_stride, src, src_stride, w, add wd, (mmsize-1) and wd, ~(mmsize-1) -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r10d, r5m mov r11d, wd %define wspill r11d @@ -176,7 +176,7 @@ cglobal add_rect_clamped_%1, 7,7,3, dst, src, stride, idwt, idwt_stride, w, h add wd, (mmsize-1) and wd, ~(mmsize-1) -%ifdef ARCH_X86_64 +%if ARCH_X86_64 mov r11d, wd %define wspill r11d %else diff --git a/libavcodec/x86/dsputil_yasm.asm b/libavcodec/x86/dsputil_yasm.asm index dcd6fa4223..6c52ac1ffb 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 c08f53d39d..1be359d667 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 648ba07133..bea31fee9e 100644 --- a/libavcodec/x86/fft_mmx.asm +++ b/libavcodec/x86/fft_mmx.asm @@ -30,7 +30,7 @@ %include "libavutil/x86/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) @@ -535,7 +535,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 @@ -639,7 +639,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 @@ -751,7 +751,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 @@ -770,24 +770,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 @@ -796,7 +796,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] @@ -830,7 +830,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] @@ -840,7 +840,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 @@ -857,6 +857,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 d8838d6922..ca39aa30f8 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 72aecc0163..fc615c7bc7 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 9d075434fe..3f7c513069 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 9595c0ab55..bff6597d55 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 @@ -517,7 +517,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 @@ -528,7 +528,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 @@ -546,7 +546,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 @@ -621,7 +621,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 @@ -648,7 +648,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] @@ -663,7 +663,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 @@ -699,13 +699,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 ) ;----------------------------------------------------------------------------- @@ -785,7 +785,7 @@ DEBLOCK_LUMA_INTRA sse2, v INIT_AVX DEBLOCK_LUMA_INTRA avx , v %endif -%ifndef ARCH_X86_64 +%if ARCH_X86_64 == 0 INIT_MMX DEBLOCK_LUMA_INTRA mmxext, v8 %endif @@ -830,7 +830,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 b34867a36d..680abee06d 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' @@ -437,7 +437,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 @@ -503,7 +503,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 @@ -600,7 +600,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 ) ;----------------------------------------------------------------------------- @@ -796,7 +796,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 @@ -913,7 +913,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 dd13bcd72f..15ba297ee9 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 a9c12da5a2..f94207bb11 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 ed3bda7721..9b99f5287b 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 5a06896afe..79fa23e71d 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 15dd72ca36..51412e3977 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 fbe6ce2139..b2fb663e4d 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 9c4b276e49..481c7cad66 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 ffca3530a4..2482620368 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 @@ -378,7 +378,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 f733bdf7cb..75448e06a9 100644 --- a/libavcodec/x86/proresdsp.asm +++ b/libavcodec/x86/proresdsp.asm @@ -33,7 +33,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 8dac6ab295..99621fb062 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 98d8505c8a..2d409bfca1 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 |