diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 20:54:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 21:06:57 +0200 |
commit | ac627b3d38d370027406c93c2dcaac0b1712a7d4 (patch) | |
tree | d2d1f39e96a75d864681349c4fbd37692e558683 /libavcodec | |
parent | 89715a3cf187c271f7cf4c230b23cd6f6d638e32 (diff) | |
parent | 716d413c13981da15323c7a3821860536eefdbbb (diff) | |
download | ffmpeg-ac627b3d38d370027406c93c2dcaac0b1712a7d4.tar.gz |
Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
* commit '716d413c13981da15323c7a3821860536eefdbbb':
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
Conflicts:
doc/examples/muxing.c
ffmpeg.h
ffmpeg_filter.c
ffmpeg_opt.c
ffplay.c
ffprobe.c
libavcodec/8bps.c
libavcodec/aasc.c
libavcodec/aura.c
libavcodec/avcodec.h
libavcodec/avs.c
libavcodec/bfi.c
libavcodec/bmp.c
libavcodec/bmpenc.c
libavcodec/c93.c
libavcodec/cscd.c
libavcodec/cyuv.c
libavcodec/dpx.c
libavcodec/dpxenc.c
libavcodec/eatgv.c
libavcodec/escape124.c
libavcodec/ffv1.c
libavcodec/flashsv.c
libavcodec/fraps.c
libavcodec/h264.c
libavcodec/huffyuv.c
libavcodec/iff.c
libavcodec/imgconvert.c
libavcodec/indeo3.c
libavcodec/kmvc.c
libavcodec/libopenjpegdec.c
libavcodec/libopenjpegenc.c
libavcodec/libx264.c
libavcodec/ljpegenc.c
libavcodec/mjpegdec.c
libavcodec/mjpegenc.c
libavcodec/motionpixels.c
libavcodec/mpeg12.c
libavcodec/mpeg12enc.c
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo_enc.c
libavcodec/pamenc.c
libavcodec/pcxenc.c
libavcodec/pgssubdec.c
libavcodec/pngdec.c
libavcodec/pngenc.c
libavcodec/pnm.c
libavcodec/pnmdec.c
libavcodec/pnmenc.c
libavcodec/ptx.c
libavcodec/qdrw.c
libavcodec/qpeg.c
libavcodec/qtrleenc.c
libavcodec/raw.c
libavcodec/rawdec.c
libavcodec/rl2.c
libavcodec/sgidec.c
libavcodec/sgienc.c
libavcodec/snowdec.c
libavcodec/snowenc.c
libavcodec/sunrast.c
libavcodec/targa.c
libavcodec/targaenc.c
libavcodec/tiff.c
libavcodec/tiffenc.c
libavcodec/tmv.c
libavcodec/truemotion2.c
libavcodec/utils.c
libavcodec/vb.c
libavcodec/vp3.c
libavcodec/wnv1.c
libavcodec/xl.c
libavcodec/xwddec.c
libavcodec/xwdenc.c
libavcodec/yop.c
libavdevice/v4l2.c
libavdevice/x11grab.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/buffersrc.c
libavfilter/drawutils.c
libavfilter/formats.c
libavfilter/src_movie.c
libavfilter/vf_ass.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_format.c
libavfilter/vf_hflip.c
libavfilter/vf_lut.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_scale.c
libavfilter/vf_transpose.c
libavfilter/vf_yadif.c
libavfilter/video.c
libavfilter/vsrc_testsrc.c
libavformat/movenc.c
libavformat/mxf.h
libavformat/utils.c
libavformat/yuv4mpeg.c
libavutil/imgutils.c
libavutil/pixdesc.c
libswscale/input.c
libswscale/output.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
libswscale/x86/swscale_template.c
libswscale/x86/yuv2rgb.c
libswscale/x86/yuv2rgb_template.c
libswscale/yuv2rgb.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec')
232 files changed, 1576 insertions, 1575 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 1eaae48889..bbf6d902c0 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -950,9 +950,9 @@ static av_cold int decode_init(AVCodecContext *avctx) init_vlcs(f); if (f->version > 2) - avctx->pix_fmt = PIX_FMT_RGB565; + avctx->pix_fmt = AV_PIX_FMT_RGB565; else - avctx->pix_fmt = PIX_FMT_BGR555; + avctx->pix_fmt = AV_PIX_FMT_BGR555; return 0; } diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index af07c6a4ca..a6d0a1b92e 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -40,8 +40,8 @@ #include "avcodec.h" -static const enum PixelFormat pixfmt_rgb24[] = { - PIX_FMT_BGR24, PIX_FMT_RGB32, PIX_FMT_NONE }; +static const enum AVPixelFormat pixfmt_rgb24[] = { + AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE }; /* * Decoder context @@ -164,7 +164,7 @@ static av_cold int decode_init(AVCodecContext *avctx) avcodec_get_frame_defaults(&c->pic); switch (avctx->bits_per_coded_sample) { case 8: - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; c->planes = 1; c->planemap[0] = 0; // 1st plane is palette indexes break; @@ -176,7 +176,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->planemap[2] = 0; // 3rd plane is blue break; case 32: - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; c->planes = 4; #if HAVE_BIGENDIAN c->planemap[0] = 1; // 1st plane is red diff --git a/libavcodec/a64multienc.c b/libavcodec/a64multienc.c index 658a8ab12b..0f6cc7636a 100644 --- a/libavcodec/a64multienc.c +++ b/libavcodec/a64multienc.c @@ -378,7 +378,7 @@ AVCodec ff_a64multi_encoder = { .init = a64multi_init_encoder, .encode2 = a64multi_encode_frame, .close = a64multi_close_encoder, - .pix_fmts = (const enum PixelFormat[]) {PIX_FMT_GRAY8, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"), .capabilities = CODEC_CAP_DELAY, }; @@ -392,7 +392,7 @@ AVCodec ff_a64multi5_encoder = { .init = a64multi_init_encoder, .encode2 = a64multi_encode_frame, .close = a64multi_close_encoder, - .pix_fmts = (const enum PixelFormat[]) {PIX_FMT_GRAY8, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"), .capabilities = CODEC_CAP_DELAY, }; diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index 7b485572db..a759e0d336 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -50,7 +50,7 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx) s->avctx = avctx; switch (avctx->bits_per_coded_sample) { case 8: - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; ptr = avctx->extradata; s->palette_size = FFMIN(avctx->extradata_size, AVPALETTE_SIZE); @@ -60,10 +60,10 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx) } break; case 16: - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; break; case 24: - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; break; default: av_log(avctx, AV_LOG_ERROR, "Unsupported bit depth: %d\n", avctx->bits_per_coded_sample); @@ -127,7 +127,7 @@ static int aasc_decode_frame(AVCodecContext *avctx, return -1; } - if (avctx->pix_fmt == PIX_FMT_PAL8) + if (avctx->pix_fmt == AV_PIX_FMT_PAL8) memcpy(s->frame.data[1], s->palette, s->palette_size); *data_size = sizeof(AVFrame); diff --git a/libavcodec/anm.c b/libavcodec/anm.c index a077367500..22c274b429 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -39,7 +39,7 @@ static av_cold int decode_init(AVCodecContext *avctx) AnmContext *s = avctx->priv_data; int i; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&s->frame); s->frame.reference = 3; diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index d2f7d3be73..6bfd08ce3e 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -76,7 +76,7 @@ typedef struct { static av_cold int decode_init(AVCodecContext *avctx) { AnsiContext *s = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; /* defaults */ s->font = avpriv_vga16_font; diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index 51b924a5fb..ef3e91bb60 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -548,7 +548,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ common_init(avctx); init_vlcs(a); ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab); - avctx->pix_fmt= PIX_FMT_YUV420P; + avctx->pix_fmt= AV_PIX_FMT_YUV420P; if(avctx->extradata_size < 1 || (a->inv_qscale= avctx->extradata[0]) == 0){ av_log(avctx, AV_LOG_ERROR, "illegal qscale 0\n"); @@ -647,7 +647,7 @@ AVCodec ff_asv1_encoder = { .priv_data_size = sizeof(ASV1Context), .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("ASUS V1"), }; #endif @@ -660,7 +660,7 @@ AVCodec ff_asv2_encoder = { .priv_data_size = sizeof(ASV1Context), .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("ASUS V2"), }; #endif diff --git a/libavcodec/aura.c b/libavcodec/aura.c index d79daba72c..669ef480e0 100644 --- a/libavcodec/aura.c +++ b/libavcodec/aura.c @@ -39,7 +39,7 @@ static av_cold int aura_decode_init(AVCodecContext *avctx) /* width needs to be divisible by 4 for this codec to work */ if (avctx->width & 0x3) return -1; - avctx->pix_fmt = PIX_FMT_YUV422P; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; avcodec_get_frame_defaults(&s->frame); return 0; diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index a8fa83423d..6c4b63095c 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -1086,7 +1086,7 @@ typedef struct AVFrame { /** * format of the frame, -1 if unknown or unset - * Values correspond to enum PixelFormat for video frames, + * Values correspond to enum AVPixelFormat for video frames, * enum AVSampleFormat for audio) * - encoding: unused * - decoding: Read by user. @@ -1653,13 +1653,13 @@ typedef struct AVCodecContext { int gop_size; /** - * Pixel format, see PIX_FMT_xxx. + * Pixel format, see AV_PIX_FMT_xxx. * May be set by the demuxer if known from headers. * May be overridden by the decoder if it knows better. * - encoding: Set by user. * - decoding: Set by user if known, overridden by libavcodec if known */ - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; /** * Motion estimation algorithm used for video coding. @@ -1706,7 +1706,7 @@ typedef struct AVCodecContext { * - encoding: unused * - decoding: Set by user, if not set the native format will be chosen. */ - enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt); + enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt); /** * maximum number of B-frames between non-B-frames @@ -3132,7 +3132,7 @@ typedef struct AVCodec { */ int capabilities; const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} - const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 + const enum AVPixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 @@ -3233,7 +3233,7 @@ typedef struct AVHWAccel { * * Only hardware accelerated formats are supported here. */ - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; /** * Hardware accelerated codec capabilities. @@ -4437,7 +4437,7 @@ void av_resample_close(struct AVResampleContext *c); * @param height the height of the picture * @return zero if successful, a negative value if not */ -int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height); +int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height); /** * Free a picture previously allocated by avpicture_alloc(). @@ -4455,7 +4455,7 @@ void avpicture_free(AVPicture *picture); * @see av_image_fill_arrays() */ int avpicture_fill(AVPicture *picture, uint8_t *ptr, - enum PixelFormat pix_fmt, int width, int height); + enum AVPixelFormat pix_fmt, int width, int height); /** * Copy pixel data from an AVPicture into a buffer, always assume a @@ -4463,7 +4463,8 @@ int avpicture_fill(AVPicture *picture, uint8_t *ptr, * * @see av_image_copy_to_buffer() */ -int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height, +int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt, + int width, int height, unsigned char *dest, int dest_size); /** @@ -4473,29 +4474,29 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, * * @see av_image_get_buffer_size(). */ -int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height); +int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height); /** * deinterlace - if not supported return -1 */ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, - enum PixelFormat pix_fmt, int width, int height); + enum AVPixelFormat pix_fmt, int width, int height); /** * Copy image src to dst. Wraps av_image_copy(). */ void av_picture_copy(AVPicture *dst, const AVPicture *src, - enum PixelFormat pix_fmt, int width, int height); + enum AVPixelFormat pix_fmt, int width, int height); /** * Crop image top and left side. */ int av_picture_crop(AVPicture *dst, const AVPicture *src, - enum PixelFormat pix_fmt, int top_band, int left_band); + enum AVPixelFormat pix_fmt, int top_band, int left_band); /** * Pad image. */ -int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt, +int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color); /** @@ -4518,14 +4519,14 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, * @{ */ -void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); +void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift); /** * Return a value representing the fourCC code associated to the * pixel format pix_fmt, or 0 if no associated fourCC code can be * found. */ -unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt); +unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt); #define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ #define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ @@ -4552,7 +4553,7 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt); * @return Combination of flags informing you what kind of losses will occur * (maximum loss for an invalid dst_pix_fmt). */ -int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt, +int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, int has_alpha); #if FF_API_FIND_BEST_PIX_FMT @@ -4571,8 +4572,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ * Note, only the first 64 pixel formats will fit in pix_fmt_mask. * * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * pix_fmt_mask = (1 << PIX_FMT_YUV422P) | (1 << PIX_FMT_RGB24); + * src_pix_fmt = AV_PIX_FMT_YUV420P; + * pix_fmt_mask = (1 << AV_PIX_FMT_YUV422P) | (1 << AV_PIX_FMT_RGB24); * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); * @endcode * @@ -4583,7 +4584,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ * @return The best pixel format to convert to or -1 if none was found. */ attribute_deprecated -enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, +enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); #endif /* FF_API_FIND_BEST_PIX_FMT */ @@ -4598,14 +4599,14 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma * pix_fmt_list parameter. * * - * @param[in] pix_fmt_list PIX_FMT_NONE terminated array of pixel formats to choose from + * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from * @param[in] src_pix_fmt source pixel format * @param[in] has_alpha Whether the source pixel format alpha channel is used. * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. * @return The best pixel format to convert to or -1 if none was found. */ -enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_list, - enum PixelFormat src_pix_fmt, +enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt_list, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); /** @@ -4616,14 +4617,14 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis * converting from some formats to other formats. avcodec_find_best_pix_fmt_of_2() selects which of * the given pixel formats should be used to suffer the least amount of loss. * - * If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be + * If one of the destination formats is AV_PIX_FMT_NONE the other pixel format (if valid) will be * returned. * * @code - * src_pix_fmt = PIX_FMT_YUV420P; - * dst_pix_fmt1= PIX_FMT_RGB24; - * dst_pix_fmt2= PIX_FMT_GRAY8; - * dst_pix_fmt3= PIX_FMT_RGB8; + * src_pix_fmt = AV_PIX_FMT_YUV420P; + * dst_pix_fmt1= AV_PIX_FMT_RGB24; + * dst_pix_fmt2= AV_PIX_FMT_GRAY8; + * dst_pix_fmt3= AV_PIX_FMT_RGB8; * loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored. * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss); * dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss); @@ -4638,21 +4639,21 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis * that occurs when converting from src to selected dst pixel format. * @return The best pixel format to convert to or -1 if none was found. */ -enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2, - enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); +enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); attribute_deprecated #if AV_HAVE_INCOMPATIBLE_FORK_ABI -enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list, - enum PixelFormat src_pix_fmt, - int has_alpha, int *loss_ptr); +enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list, + enum AVPixelFormat src_pix_fmt, + int has_alpha, int *loss_ptr); #else -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); +enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr); #endif -enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt); +enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt); /** * @} diff --git a/libavcodec/avrndec.c b/libavcodec/avrndec.c index cda360de1a..207b7970c1 100644 --- a/libavcodec/avrndec.c +++ b/libavcodec/avrndec.c @@ -45,7 +45,7 @@ static av_cold int init(AVCodecContext *avctx) return -1; avcodec_get_frame_defaults(&a->frame); - avctx->pix_fmt = PIX_FMT_UYVY422; + avctx->pix_fmt = AV_PIX_FMT_UYVY422; if(avctx->extradata_size >= 9 && avctx->extradata[4]+28 < avctx->extradata_size) { int ndx = avctx->extradata[4] + 4; diff --git a/libavcodec/avs.c b/libavcodec/avs.c index 76e8a9aae7..a9ab029fd7 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -160,7 +160,7 @@ avs_decode_frame(AVCodecContext * avctx, static av_cold int avs_decode_init(AVCodecContext * avctx) { AvsContext *const avs = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&avs->picture); avcodec_set_dimensions(avctx, 318, 198); return 0; diff --git a/libavcodec/avuidec.c b/libavcodec/avuidec.c index ba07a58f28..27f0b4c2e0 100644 --- a/libavcodec/avuidec.c +++ b/libavcodec/avuidec.c @@ -25,7 +25,7 @@ static av_cold int avui_decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUVA422P; + avctx->pix_fmt = AV_PIX_FMT_YUVA422P; avctx->coded_frame = avcodec_alloc_frame(); diff --git a/libavcodec/avuienc.c b/libavcodec/avuienc.c index 686e52cfbf..4428232c05 100644 --- a/libavcodec/avuienc.c +++ b/libavcodec/avuienc.c @@ -108,6 +108,6 @@ AVCodec ff_avui_encoder = { .encode2 = avui_encode_frame, .close = avui_encode_close, .capabilities = CODEC_CAP_EXPERIMENTAL, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_UYVY422, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"), }; diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index 39a0047e3f..427d83c453 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -44,7 +44,7 @@ static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx) vid->frame.reference = 3; vid->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index fc5523eab1..8d7aa13c3b 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -40,7 +40,7 @@ typedef struct BFIContext { static av_cold int bfi_decode_init(AVCodecContext *avctx) { BFIContext *bfi = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&bfi->frame); bfi->dst = av_mallocz(avctx->width * avctx->height); return 0; diff --git a/libavcodec/bink.c b/libavcodec/bink.c index 024d289c9c..31e4ac30da 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1288,7 +1288,7 @@ static av_cold int decode_init(AVCodecContext *avctx) return 1; } - avctx->pix_fmt = c->has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P; + avctx->pix_fmt = c->has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; avctx->idct_algo = FF_IDCT_BINK; ff_dsputil_init(&c->dsp, avctx); diff --git a/libavcodec/bintext.c b/libavcodec/bintext.c index ecc090b625..9c36b6ba01 100644 --- a/libavcodec/bintext.c +++ b/libavcodec/bintext.c @@ -49,7 +49,7 @@ static av_cold int decode_init(AVCodecContext *avctx) uint8_t *p; int i; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; p = avctx->extradata; if (p) { s->font_height = p[0]; diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index 7e160ae556..d0f5b745ce 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -140,40 +140,40 @@ static int bmp_decode_frame(AVCodecContext *avctx, avctx->width = width; avctx->height = height > 0? height: -height; - avctx->pix_fmt = PIX_FMT_NONE; + avctx->pix_fmt = AV_PIX_FMT_NONE; switch(depth){ case 32: if(comp == BMP_BITFIELDS){ if (rgb[0] == 0xFF000000 && rgb[1] == 0x00FF0000 && rgb[2] == 0x0000FF00) - avctx->pix_fmt = alpha ? PIX_FMT_ABGR : PIX_FMT_0BGR; + avctx->pix_fmt = alpha ? AV_PIX_FMT_ABGR : AV_PIX_FMT_0BGR; else if (rgb[0] == 0x00FF0000 && rgb[1] == 0x0000FF00 && rgb[2] == 0x000000FF) - avctx->pix_fmt = alpha ? PIX_FMT_BGRA : PIX_FMT_BGR0; + avctx->pix_fmt = alpha ? AV_PIX_FMT_BGRA : AV_PIX_FMT_BGR0; else if (rgb[0] == 0x0000FF00 && rgb[1] == 0x00FF0000 && rgb[2] == 0xFF000000) - avctx->pix_fmt = alpha ? PIX_FMT_ARGB : PIX_FMT_0RGB; + avctx->pix_fmt = alpha ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB; else if (rgb[0] == 0x000000FF && rgb[1] == 0x0000FF00 && rgb[2] == 0x00FF0000) - avctx->pix_fmt = alpha ? PIX_FMT_RGBA : PIX_FMT_RGB0; + avctx->pix_fmt = alpha ? AV_PIX_FMT_RGBA : AV_PIX_FMT_RGB0; else { av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]); return AVERROR(EINVAL); } } else { - avctx->pix_fmt = PIX_FMT_BGRA; + avctx->pix_fmt = AV_PIX_FMT_BGRA; } break; case 24: - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; break; case 16: if(comp == BMP_RGB) - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; else if (comp == BMP_BITFIELDS) { if (rgb[0] == 0xF800 && rgb[1] == 0x07E0 && rgb[2] == 0x001F) - avctx->pix_fmt = PIX_FMT_RGB565; + avctx->pix_fmt = AV_PIX_FMT_RGB565; else if (rgb[0] == 0x7C00 && rgb[1] == 0x03E0 && rgb[2] == 0x001F) - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; else if (rgb[0] == 0x0F00 && rgb[1] == 0x00F0 && rgb[2] == 0x000F) - avctx->pix_fmt = PIX_FMT_RGB444; + avctx->pix_fmt = AV_PIX_FMT_RGB444; else { av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]); return AVERROR(EINVAL); @@ -182,14 +182,14 @@ static int bmp_decode_frame(AVCodecContext *avctx, break; case 8: if(hsize - ihsize - 14 > 0) - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; else - avctx->pix_fmt = PIX_FMT_GRAY8; + avctx->pix_fmt = AV_PIX_FMT_GRAY8; break; case 1: case 4: if(hsize - ihsize - 14 > 0){ - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; }else{ av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1<<depth); return -1; @@ -200,7 +200,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, return -1; } - if(avctx->pix_fmt == PIX_FMT_NONE){ + if(avctx->pix_fmt == AV_PIX_FMT_NONE){ av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n"); return -1; } @@ -240,7 +240,7 @@ static int bmp_decode_frame(AVCodecContext *avctx, linesize = p->linesize[0]; } - if(avctx->pix_fmt == PIX_FMT_PAL8){ + if(avctx->pix_fmt == AV_PIX_FMT_PAL8){ int colors = 1 << depth; memset(p->data[1], 0, 1024); diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c index 3d329d177a..fc3602868f 100644 --- a/libavcodec/bmpenc.c +++ b/libavcodec/bmpenc.c @@ -38,26 +38,26 @@ static av_cold int bmp_encode_init(AVCodecContext *avctx){ avctx->coded_frame = &s->picture; switch (avctx->pix_fmt) { - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: avctx->bits_per_coded_sample = 32; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: avctx->bits_per_coded_sample = 24; break; - case PIX_FMT_RGB555: - case PIX_FMT_RGB565: - case PIX_FMT_RGB444: + case AV_PIX_FMT_RGB555: + case AV_PIX_FMT_RGB565: + case AV_PIX_FMT_RGB444: avctx->bits_per_coded_sample = 16; break; - case PIX_FMT_RGB8: - case PIX_FMT_BGR8: - case PIX_FMT_RGB4_BYTE: - case PIX_FMT_BGR4_BYTE: - case PIX_FMT_GRAY8: - case PIX_FMT_PAL8: + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_PAL8: avctx->bits_per_coded_sample = 8; break; - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOBLACK: avctx->bits_per_coded_sample = 1; break; default: @@ -83,29 +83,29 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, p->pict_type= AV_PICTURE_TYPE_I; p->key_frame= 1; switch (avctx->pix_fmt) { - case PIX_FMT_RGB444: + case AV_PIX_FMT_RGB444: compression = BMP_BITFIELDS; pal = rgb444_masks; // abuse pal to hold color masks pal_entries = 3; break; - case PIX_FMT_RGB565: + case AV_PIX_FMT_RGB565: compression = BMP_BITFIELDS; pal = rgb565_masks; // abuse pal to hold color masks pal_entries = 3; break; - case PIX_FMT_RGB8: - case PIX_FMT_BGR8: - case PIX_FMT_RGB4_BYTE: - case PIX_FMT_BGR4_BYTE: - case PIX_FMT_GRAY8: + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_GRAY8: av_assert1(bit_count == 8); ff_set_systematic_pal2(palette256, avctx->pix_fmt); pal = palette256; break; - case PIX_FMT_PAL8: + case AV_PIX_FMT_PAL8: pal = (uint32_t *)p->data[1]; break; - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOBLACK: pal = monoblack_pal; break; } @@ -172,12 +172,12 @@ AVCodec ff_bmp_encoder = { .priv_data_size = sizeof(BMPContext), .init = bmp_encode_init, .encode2 = bmp_encode_frame, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_BGRA, PIX_FMT_BGR24, - PIX_FMT_RGB565, PIX_FMT_RGB555, PIX_FMT_RGB444, - PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, PIX_FMT_GRAY8, PIX_FMT_PAL8, - PIX_FMT_MONOBLACK, - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565, AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, + AV_PIX_FMT_MONOBLACK, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), }; diff --git a/libavcodec/bmv.c b/libavcodec/bmv.c index 5d33b910c9..48e950838f 100644 --- a/libavcodec/bmv.c +++ b/libavcodec/bmv.c @@ -270,7 +270,7 @@ static av_cold int decode_init(AVCodecContext *avctx) BMVDecContext * const c = avctx->priv_data; c->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; if (avctx->width != SCREEN_WIDE || avctx->height != SCREEN_HIGH) { av_log(avctx, AV_LOG_ERROR, "Invalid dimension %dx%d\n", avctx->width, avctx->height); diff --git a/libavcodec/c93.c b/libavcodec/c93.c index 89f5933c96..28135c091a 100644 --- a/libavcodec/c93.c +++ b/libavcodec/c93.c @@ -51,7 +51,7 @@ static av_cold int decode_init(AVCodecContext *avctx) avcodec_get_frame_defaults(&c93->pictures[0]); avcodec_get_frame_defaults(&c93->pictures[1]); - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/cavs.c b/libavcodec/cavs.c index 9e47163684..65e12dd174 100644 --- a/libavcodec/cavs.c +++ b/libavcodec/cavs.c @@ -712,7 +712,7 @@ av_cold int ff_cavs_init(AVCodecContext *avctx) { ff_cavsdsp_init(&h->cdsp, avctx); s->avctx = avctx; - avctx->pix_fmt= PIX_FMT_YUV420P; + avctx->pix_fmt= AV_PIX_FMT_YUV420P; h->luma_scan[0] = 0; h->luma_scan[1] = 8; diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index 8638dca931..91b2d9072b 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -86,7 +86,7 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx) avctx->width = CDG_FULL_WIDTH; avctx->height = CDG_FULL_HEIGHT; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/cdxl.c b/libavcodec/cdxl.c index ad830ce193..1708266393 100644 --- a/libavcodec/cdxl.c +++ b/libavcodec/cdxl.c @@ -249,11 +249,11 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data, if (c->video_size < aligned_width * avctx->height * c->bpp / 8) return AVERROR_INVALIDDATA; if (!encoding && c->palette_size && c->bpp <= 8) { - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; } else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) { if (c->palette_size != (1 << (c->bpp - 1))) return AVERROR_INVALIDDATA; - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; } else { av_log_ask_for_sample(avctx, "unsupported encoding %d and bpp %d\n", encoding, c->bpp); diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index 391e787075..9ae63b7432 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -412,10 +412,10 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx) // check for paletted data if (avctx->bits_per_coded_sample != 8) { s->palette_video = 0; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; } else { s->palette_video = 1; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; } avcodec_get_frame_defaults(&s->frame); diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 7f31aa5b07..2834ff6b17 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -106,7 +106,7 @@ static int decode_frame(AVCodecContext *avctx, static av_cold int decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUV411P; + avctx->pix_fmt = AV_PIX_FMT_YUV411P; return common_init(avctx); } @@ -203,8 +203,8 @@ AVCodec ff_cljr_encoder = { .priv_data_size = sizeof(CLJRContext), .init = common_init, .encode2 = encode_frame, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV411P, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), .priv_class = &class, }; diff --git a/libavcodec/cllc.c b/libavcodec/cllc.c index 9cb8dfaf06..b58833134d 100644 --- a/libavcodec/cllc.c +++ b/libavcodec/cllc.c @@ -330,7 +330,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data, switch (coding_type) { case 1: case 2: - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; avctx->bits_per_raw_sample = 8; ret = avctx->get_buffer(avctx, pic); @@ -345,7 +345,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data, break; case 3: - avctx->pix_fmt = PIX_FMT_ARGB; + avctx->pix_fmt = AV_PIX_FMT_ARGB; avctx->bits_per_raw_sample = 8; ret = avctx->get_buffer(avctx, pic); diff --git a/libavcodec/cpia.c b/libavcodec/cpia.c index a631a05108..26e067a5cc 100644 --- a/libavcodec/cpia.c +++ b/libavcodec/cpia.c @@ -192,7 +192,7 @@ static int cpia_decode_frame(AVCodecContext* avctx, static av_cold int cpia_decode_init(AVCodecContext *avctx) { // output pixel format - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; /* The default timebase set by the v4l2 demuxer leads to probing which is buggy. * Set some reasonable time_base to skip this. diff --git a/libavcodec/crystalhd.c b/libavcodec/crystalhd.c index 503baaae73..334337e57c 100644 --- a/libavcodec/crystalhd.c +++ b/libavcodec/crystalhd.c @@ -402,7 +402,7 @@ static av_cold int init(AVCodecContext *avctx) av_log(avctx, AV_LOG_VERBOSE, "CrystalHD Init for %s\n", avctx->codec->name); - avctx->pix_fmt = PIX_FMT_YUYV422; + avctx->pix_fmt = AV_PIX_FMT_YUYV422; /* Initialize the library */ priv = avctx->priv_data; @@ -1099,7 +1099,7 @@ AVCodec ff_h264_crystalhd_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (CrystalHD acceleration)"), - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUYV422, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, .priv_class = &h264_class, }; #endif @@ -1123,7 +1123,7 @@ AVCodec ff_mpeg2_crystalhd_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 Video (CrystalHD acceleration)"), - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUYV422, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, .priv_class = &mpeg2_class, }; #endif @@ -1147,7 +1147,7 @@ AVCodec ff_mpeg4_crystalhd_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Part 2 (CrystalHD acceleration)"), - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUYV422, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, .priv_class = &mpeg4_class, }; #endif @@ -1171,7 +1171,7 @@ AVCodec ff_msmpeg4_crystalhd_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL, .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 Part 2 Microsoft variant version 3 (CrystalHD acceleration)"), - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUYV422, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, .priv_class = &msmpeg4_class, }; #endif @@ -1195,7 +1195,7 @@ AVCodec ff_vc1_crystalhd_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1 (CrystalHD acceleration)"), - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUYV422, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, .priv_class = &vc1_class, }; #endif @@ -1219,7 +1219,7 @@ AVCodec ff_wmv3_crystalhd_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY, .flush = flush, .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 (CrystalHD acceleration)"), - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUYV422, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUYV422, AV_PIX_FMT_NONE}, .priv_class = &wmv3_class, }; #endif diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index bdcfdcc052..8ba5de3326 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -127,9 +127,9 @@ static av_cold int decode_init(AVCodecContext *avctx) { CamStudioContext *c = avctx->priv_data; int stride; switch (avctx->bits_per_coded_sample) { - case 16: avctx->pix_fmt = PIX_FMT_RGB555LE; break; - case 24: avctx->pix_fmt = PIX_FMT_BGR24; break; - case 32: avctx->pix_fmt = PIX_FMT_BGRA; break; + case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555LE; break; + case 24: avctx->pix_fmt = AV_PIX_FMT_BGR24; break; + case 32: avctx->pix_fmt = AV_PIX_FMT_BGRA; break; default: av_log(avctx, AV_LOG_ERROR, "CamStudio codec error: invalid depth %i bpp\n", diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index df0a2d206b..74c10777c1 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -93,9 +93,9 @@ static int cyuv_decode_frame(AVCodecContext *avctx, * of 4 pixels. Thus, the total size of the buffer ought to be: * (3 * 16) + height * (width * 3 / 4) */ if (buf_size == 48 + s->height * (s->width * 3 / 4)) { - avctx->pix_fmt = PIX_FMT_YUV411P; + avctx->pix_fmt = AV_PIX_FMT_YUV411P; } else if(buf_size == rawsize ) { - avctx->pix_fmt = PIX_FMT_UYVY422; + avctx->pix_fmt = AV_PIX_FMT_UYVY422; } else { av_log(avctx, AV_LOG_ERROR, "got a buffer with %d bytes when %d were expected\n", buf_size, 48 + s->height * (s->width * 3 / 4)); diff --git a/libavcodec/dfa.c b/libavcodec/dfa.c index 115973132f..8156c3766b 100644 --- a/libavcodec/dfa.c +++ b/libavcodec/dfa.c @@ -38,7 +38,7 @@ static av_cold int dfa_decode_init(AVCodecContext *avctx) { DfaContext *s = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; if (!avctx->width || !avctx->height) return AVERROR_INVALIDDATA; diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index b26fff7b2d..79638acea3 100644 --- a/libavcodec/dirac.c +++ b/libavcodec/dirac.c @@ -106,9 +106,9 @@ static const struct { }; /* [DIRAC_STD] Table 10.2 Supported chroma sampling formats + luma Offset */ -static const enum PixelFormat dirac_pix_fmt[2][3] = { - { PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P }, - { PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P }, +static const enum AVPixelFormat dirac_pix_fmt[2][3] = { + { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P }, + { AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P }, }; /* [DIRAC_STD] 10.3 Parse Source Parameters. diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index bbf89bf938..4f3968aaa7 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -133,7 +133,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height); if (buf[0x21] & 0x40) { - ctx->avctx->pix_fmt = PIX_FMT_YUV422P10; + ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P10; ctx->avctx->bits_per_raw_sample = 10; if (ctx->bit_depth != 10) { ff_dsputil_init(&ctx->dsp, ctx->avctx); @@ -141,7 +141,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si ctx->decode_dct_block = dnxhd_decode_dct_block_10; } } else { - ctx->avctx->pix_fmt = PIX_FMT_YUV422P; + ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P; ctx->avctx->bits_per_raw_sample = 8; if (ctx->bit_depth != 8) { ff_dsputil_init(&ctx->dsp, ctx->avctx); diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index c8b031e739..b5d62bf9a1 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -253,10 +253,10 @@ static int dnxhd_encode_init(AVCodecContext *avctx) int i, index, bit_depth; switch (avctx->pix_fmt) { - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P: bit_depth = 8; break; - case PIX_FMT_YUV422P10: + case AV_PIX_FMT_YUV422P10: bit_depth = 10; break; default: @@ -1021,9 +1021,9 @@ AVCodec ff_dnxhd_encoder = { .encode2 = dnxhd_encode_picture, .close = dnxhd_encode_end, .capabilities = CODEC_CAP_SLICE_THREADS, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV422P, - PIX_FMT_YUV422P10, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV422P10, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"), .priv_class = &class, .defaults = dnxhd_defaults, diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index 71cf4392de..d96e0ec19e 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -125,25 +125,25 @@ static int decode_frame(AVCodecContext *avctx, switch (bits_per_color) { case 8: if (elements == 4) { - avctx->pix_fmt = PIX_FMT_RGBA; + avctx->pix_fmt = AV_PIX_FMT_RGBA; } else { - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; } source_packet_size = elements; target_packet_size = elements; planar = 0; break; case 10: - avctx->pix_fmt = PIX_FMT_GBRP10; + avctx->pix_fmt = AV_PIX_FMT_GBRP10; target_packet_size = 6; source_packet_size = 4; planar = 1; break; case 12: if (endian) { - avctx->pix_fmt = elements == 4 ? PIX_FMT_GBRP12BE : PIX_FMT_GBRP12BE; + avctx->pix_fmt = elements == 4 ? AV_PIX_FMT_GBRP12BE : AV_PIX_FMT_GBRP12BE; } else { - avctx->pix_fmt = elements == 4 ? PIX_FMT_GBRP12LE : PIX_FMT_GBRP12LE; + avctx->pix_fmt = elements == 4 ? AV_PIX_FMT_GBRP12LE : AV_PIX_FMT_GBRP12LE; } target_packet_size = 6; source_packet_size = 6; @@ -151,9 +151,9 @@ static int decode_frame(AVCodecContext *avctx, break; case 16: if (endian) { - avctx->pix_fmt = elements == 4 ? PIX_FMT_RGBA64BE : PIX_FMT_RGB48BE; + avctx->pix_fmt = elements == 4 ? AV_PIX_FMT_RGBA64BE : AV_PIX_FMT_RGB48BE; } else { - avctx->pix_fmt = elements == 4 ? PIX_FMT_RGBA64LE : PIX_FMT_RGB48LE; + avctx->pix_fmt = elements == 4 ? AV_PIX_FMT_RGBA64LE : AV_PIX_FMT_RGB48LE; } target_packet_size = source_packet_size = elements * 2; diff --git a/libavcodec/dpxenc.c b/libavcodec/dpxenc.c index 451b7b976e..8ef057f949 100644 --- a/libavcodec/dpxenc.c +++ b/libavcodec/dpxenc.c @@ -47,31 +47,31 @@ static av_cold int encode_init(AVCodecContext *avctx) s->planar = 0; switch (avctx->pix_fmt) { - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: s->descriptor = 51; /* RGBA */ break; - case PIX_FMT_RGB48LE: + case AV_PIX_FMT_RGB48LE: s->big_endian = 0; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: s->bits_per_component = avctx->bits_per_raw_sample ? avctx->bits_per_raw_sample : 16; break; - case PIX_FMT_RGBA64LE: + case AV_PIX_FMT_RGBA64LE: s->big_endian = 0; - case PIX_FMT_RGBA64BE: + case AV_PIX_FMT_RGBA64BE: s->descriptor = 51; s->bits_per_component = 16; break; - case PIX_FMT_GBRP10LE: + case AV_PIX_FMT_GBRP10LE: s->big_endian = 0; - case PIX_FMT_GBRP10BE: + case AV_PIX_FMT_GBRP10BE: s->bits_per_component = 10; s->planar = 1; break; - case PIX_FMT_GBRP12LE: + case AV_PIX_FMT_GBRP12LE: s->big_endian = 0; - case PIX_FMT_GBRP12BE: + case AV_PIX_FMT_GBRP12BE: s->bits_per_component = 12; s->planar = 1; break; @@ -246,17 +246,17 @@ AVCodec ff_dpx_encoder = { .priv_data_size = sizeof(DPXContext), .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_RGB24, - PIX_FMT_RGBA, - PIX_FMT_RGB48LE, - PIX_FMT_RGB48BE, - PIX_FMT_RGBA64LE, - PIX_FMT_RGBA64BE, - PIX_FMT_GBRP10LE, - PIX_FMT_GBRP10BE, - PIX_FMT_GBRP12LE, - PIX_FMT_GBRP12BE, - PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_RGB24, + AV_PIX_FMT_RGBA, + AV_PIX_FMT_RGB48LE, + AV_PIX_FMT_RGB48BE, + AV_PIX_FMT_RGBA64LE, + AV_PIX_FMT_RGBA64BE, + AV_PIX_FMT_GBRP10LE, + AV_PIX_FMT_GBRP10BE, + AV_PIX_FMT_GBRP12LE, + AV_PIX_FMT_GBRP12BE, + AV_PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("DPX image"), }; diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index 1679bfe819..11afadf03f 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -93,7 +93,7 @@ static av_cold int cinvideo_decode_init(AVCodecContext *avctx) unsigned int i; cin->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&cin->frame); cin->frame.data[0] = NULL; diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 13af692fe0..6c11069ba3 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -137,19 +137,19 @@ static inline void dv_calc_mb_coordinates(const DVprofile *d, int chan, int seq, break; case 720: switch (d->pix_fmt) { - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P: x = shuf3[m] + slot/3; y = serpent1[slot] + ((((seq + off[m]) % d->difseg_size)<<1) + chan)*3; tbl[m] = (x<<1)|(y<<8); break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: x = shuf3[m] + slot/3; y = serpent1[slot] + ((seq + off[m]) % d->difseg_size)*3; tbl[m] = (x<<1)|(y<<9); break; - case PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV411P: i = (seq + off[m]) % d->difseg_size; k = slot + ((m==1||m==2)?3:0); @@ -687,8 +687,8 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y); /* initializing luminance blocks */ - if ((s->sys->pix_fmt == PIX_FMT_YUV420P) || - (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) || + if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) || + (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) || (s->sys->height >= 720 && mb_y != 134)) { y_stride = s->picture.linesize[0] << 3; } else { @@ -713,13 +713,13 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg) enc_blk += 4; /* initializing chrominance blocks */ - c_offset = (((mb_y >> (s->sys->pix_fmt == PIX_FMT_YUV420P)) * s->picture.linesize[1] + - (mb_x >> ((s->sys->pix_fmt == PIX_FMT_YUV411P) ? 2 : 1))) << 3); + c_offset = (((mb_y >> (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->picture.linesize[1] + + (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << 3); for (j = 2; j; j--) { uint8_t *c_ptr = s->picture.data[j] + c_offset; linesize = s->picture.linesize[j]; y_stride = (mb_y == 134) ? 8 : (s->picture.linesize[j] << 3); - if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) { + if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) { uint8_t* d; uint8_t* b = scratch; for (i = 0; i < 8; i++) { @@ -816,7 +816,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, * 2. It is not at all clear what STYPE is used for 4:2:0 PAL * compression scheme (if any). */ - int apt = (c->sys->pix_fmt == PIX_FMT_YUV420P ? 0 : 1); + int apt = (c->sys->pix_fmt == AV_PIX_FMT_YUV420P ? 0 : 1); uint8_t aspect = 0; if ((int)(av_q2d(c->avctx->sample_aspect_ratio) * c->avctx->width / c->avctx->height * 10) >= 17) /* 16:9 */ @@ -992,8 +992,8 @@ AVCodec ff_dvvideo_encoder = { .init = dvvideo_init_encoder, .encode2 = dvvideo_encode_frame, .capabilities = CODEC_CAP_SLICE_THREADS, - .pix_fmts = (const enum PixelFormat[]) { - PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"), }; diff --git a/libavcodec/dv_profile.c b/libavcodec/dv_profile.c index cd06b289a3..05d4abae16 100644 --- a/libavcodec/dv_profile.c +++ b/libavcodec/dv_profile.c @@ -91,7 +91,7 @@ static const DVprofile dv_profiles[] = { .sar = {{8, 9}, {32, 27}}, .work_chunks = &work_chunks_dv25ntsc[0], .idct_factor = &dv_idct_factor_sd[0], - .pix_fmt = PIX_FMT_YUV411P, + .pix_fmt = AV_PIX_FMT_YUV411P, .bpm = 6, .block_sizes = block_sizes_dv2550, .audio_stride = 90, @@ -111,7 +111,7 @@ static const DVprofile dv_profiles[] = { .sar = {{16, 15}, {64, 45}}, .work_chunks = &work_chunks_dv25pal[0], .idct_factor = &dv_idct_factor_sd[0], - .pix_fmt = PIX_FMT_YUV420P, + .pix_fmt = AV_PIX_FMT_YUV420P, .bpm = 6, .block_sizes = block_sizes_dv2550, .audio_stride = 108, @@ -131,7 +131,7 @@ static const DVprofile dv_profiles[] = { .sar = {{16, 15}, {64, 45}}, .work_chunks = &work_chunks_dv25pal411[0], .idct_factor = &dv_idct_factor_sd[0], - .pix_fmt = PIX_FMT_YUV411P, + .pix_fmt = AV_PIX_FMT_YUV411P, .bpm = 6, .block_sizes = block_sizes_dv2550, .audio_stride = 108, @@ -151,7 +151,7 @@ static const DVprofile dv_profiles[] = { .sar = {{8, 9}, {32, 27}}, .work_chunks = &work_chunks_dv50ntsc[0], .idct_factor = &dv_idct_factor_sd[0], - .pix_fmt = PIX_FMT_YUV422P, + .pix_fmt = AV_PIX_FMT_YUV422P, .bpm = 6, .block_sizes = block_sizes_dv2550, .audio_stride = 90, @@ -171,7 +171,7 @@ static const DVprofile dv_profiles[] = { .sar = {{16, 15}, {64, 45}}, .work_chunks = &work_chunks_dv50pal[0], .idct_factor = &dv_idct_factor_sd[0], - .pix_fmt = PIX_FMT_YUV422P, + .pix_fmt = AV_PIX_FMT_YUV422P, .bpm = 6, .block_sizes = block_sizes_dv2550, .audio_stride = 108, @@ -191,7 +191,7 @@ static const DVprofile dv_profiles[] = { .sar = {{1, 1}, {3, 2}}, .work_chunks = &work_chunks_dv100ntsci[0], .idct_factor = &dv_idct_factor_hd1080[0], - .pix_fmt = PIX_FMT_YUV422P, + .pix_fmt = AV_PIX_FMT_YUV422P, .bpm = 8, .block_sizes = block_sizes_dv100, .audio_stride = 90, @@ -211,7 +211,7 @@ static const DVprofile dv_profiles[] = { .sar = {{1, 1}, {4, 3}}, .work_chunks = &work_chunks_dv100pali[0], .idct_factor = &dv_idct_factor_hd1080[0], - .pix_fmt = PIX_FMT_YUV422P, + .pix_fmt = AV_PIX_FMT_YUV422P, .bpm = 8, .block_sizes = block_sizes_dv100, .audio_stride = 108, @@ -231,7 +231,7 @@ static const DVprofile dv_profiles[] = { .sar = {{1, 1}, {4, 3}}, .work_chunks = &work_chunks_dv100ntscp[0], .idct_factor = &dv_idct_factor_hd720[0], - .pix_fmt = PIX_FMT_YUV422P, + .pix_fmt = AV_PIX_FMT_YUV422P, .bpm = 8, .block_sizes = block_sizes_dv100, .audio_stride = 90, @@ -251,7 +251,7 @@ static const DVprofile dv_profiles[] = { .sar = {{1, 1}, {4, 3}}, .work_chunks = &work_chunks_dv100palp[0], .idct_factor = &dv_idct_factor_hd720[0], - .pix_fmt = PIX_FMT_YUV422P, + .pix_fmt = AV_PIX_FMT_YUV422P, .bpm = 8, .block_sizes = block_sizes_dv100, .audio_stride = 90, @@ -271,7 +271,7 @@ static const DVprofile dv_profiles[] = { .sar = {{16, 15}, {64, 45}}, .work_chunks = &work_chunks_dv25pal[0], .idct_factor = &dv_idct_factor_sd[0], - .pix_fmt = PIX_FMT_YUV420P, + .pix_fmt = AV_PIX_FMT_YUV420P, .bpm = 6, .block_sizes = block_sizes_dv2550, .audio_stride = 108, diff --git a/libavcodec/dv_profile.h b/libavcodec/dv_profile.h index 1a2a60fefa..97edce95d2 100644 --- a/libavcodec/dv_profile.h +++ b/libavcodec/dv_profile.h @@ -53,7 +53,7 @@ typedef struct DVprofile { AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */ DVwork_chunk *work_chunks; /* each thread gets its own chunk of frame to work on */ uint32_t *idct_factor; /* set of iDCT factor tables */ - enum PixelFormat pix_fmt; /* picture pixel format */ + enum AVPixelFormat pix_fmt; /* picture pixel format */ int bpm; /* blocks per macroblock */ const uint8_t *block_sizes; /* AC block sizes, in bits */ int audio_stride; /* size of audio_shuffle table */ diff --git a/libavcodec/dvdec.c b/libavcodec/dvdec.c index 6a7424444b..a38d409dc8 100644 --- a/libavcodec/dvdec.c +++ b/libavcodec/dvdec.c @@ -254,8 +254,8 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y); /* idct_put'ting luminance */ - if ((s->sys->pix_fmt == PIX_FMT_YUV420P) || - (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) || + if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) || + (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) || (s->sys->height >= 720 && mb_y != 134)) { y_stride = (s->picture.linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize)); } else { @@ -275,11 +275,11 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg) block += 4*64; /* idct_put'ting chrominance */ - c_offset = (((mb_y >> (s->sys->pix_fmt == PIX_FMT_YUV420P)) * s->picture.linesize[1] + - (mb_x >> ((s->sys->pix_fmt == PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize); + c_offset = (((mb_y >> (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->picture.linesize[1] + + (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize); for (j = 2; j; j--) { uint8_t *c_ptr = s->picture.data[j] + c_offset; - if (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) { + if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) { uint64_t aligned_pixels[64/8]; uint8_t *pixels = (uint8_t*)aligned_pixels; uint8_t *c_ptr1, *ptr1; diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index 389705eb27..215519573e 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -292,7 +292,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { DxaDecContext * const c = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&c->pic); avcodec_get_frame_defaults(&c->prev); diff --git a/libavcodec/dxtory.c b/libavcodec/dxtory.c index 83abc7253a..f741078092 100644 --- a/libavcodec/dxtory.c +++ b/libavcodec/dxtory.c @@ -26,7 +26,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->coded_frame = avcodec_alloc_frame(); if (!avctx->coded_frame) return AVERROR(ENOMEM); diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index fdd8980d0f..f7d4e5d4ec 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -443,7 +443,7 @@ AVHWAccel ff_h264_dxva2_hwaccel = { .name = "h264_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, - .pix_fmt = PIX_FMT_DXVA2_VLD, + .pix_fmt = AV_PIX_FMT_DXVA2_VLD, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c index dc9b103a71..f050ed9d50 100644 --- a/libavcodec/dxva2_mpeg2.c +++ b/libavcodec/dxva2_mpeg2.c @@ -264,7 +264,7 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = { .name = "mpeg2_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = PIX_FMT_DXVA2_VLD, + .pix_fmt = AV_PIX_FMT_DXVA2_VLD, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index a6891d31cd..e47db4d9c1 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -269,7 +269,7 @@ AVHWAccel ff_wmv3_dxva2_hwaccel = { .name = "wmv3_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV3, - .pix_fmt = PIX_FMT_DXVA2_VLD, + .pix_fmt = AV_PIX_FMT_DXVA2_VLD, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, @@ -281,7 +281,7 @@ AVHWAccel ff_vc1_dxva2_hwaccel = { .name = "vc1_dxva2", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VC1, - .pix_fmt = PIX_FMT_DXVA2_VLD, + .pix_fmt = AV_PIX_FMT_DXVA2_VLD, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index 6b23758470..4960011838 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -49,7 +49,7 @@ static av_cold int cmv_decode_init(AVCodecContext *avctx){ avcodec_get_frame_defaults(&s->last2_frame); s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index b3382406cd..280519518d 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -61,7 +61,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { MadContext *s = avctx->priv_data; s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; ff_dsputil_init(&s->dsp, avctx); ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM); ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct); diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index ab2a398ad2..5114b2040a 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -53,7 +53,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx){ ff_init_scantable_permutation(idct_permutation, FF_NO_IDCT_PERM); ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct); avctx->time_base = (AVRational){1, 15}; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; return 0; } diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index 5ca8cf5e53..45f9fc774b 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -54,7 +54,7 @@ static av_cold int tgv_decode_init(AVCodecContext *avctx){ TgvContext *s = avctx->priv_data; s->avctx = avctx; avctx->time_base = (AVRational){1, 15}; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&s->frame); avcodec_get_frame_defaults(&s->last_frame); return 0; diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index 7610acd79c..62833d549e 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -52,7 +52,7 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx) ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); s->qscale = 1; avctx->time_base = (AVRational){1, 15}; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; ff_mpeg12_init_vlcs(); return 0; } diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index e4cc497af8..94eadce521 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -62,7 +62,7 @@ static av_cold int escape124_decode_init(AVCodecContext *avctx) Escape124Context *s = avctx->priv_data; avcodec_get_frame_defaults(&s->frame); - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; s->num_superblocks = ((unsigned)avctx->width / 8) * ((unsigned)avctx->height / 8); diff --git a/libavcodec/escape130.c b/libavcodec/escape130.c index 47e7f11d6c..97547bb102 100644 --- a/libavcodec/escape130.c +++ b/libavcodec/escape130.c @@ -37,7 +37,7 @@ typedef struct Escape130Context { static av_cold int escape130_decode_init(AVCodecContext *avctx) { Escape130Context *s = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; if((avctx->width&1) || (avctx->height&1)){ av_log(avctx, AV_LOG_ERROR, "Dimensions are not a multiple of the block size\n"); diff --git a/libavcodec/exr.c b/libavcodec/exr.c index 7caacd914a..5b4c26db3e 100644 --- a/libavcodec/exr.c +++ b/libavcodec/exr.c @@ -452,9 +452,9 @@ static int decode_frame(AVCodecContext *avctx, case 2: // 32-bit case 1: // 16-bit if (s->channel_offsets[3] >= 0) - avctx->pix_fmt = PIX_FMT_RGBA64; + avctx->pix_fmt = AV_PIX_FMT_RGBA64; else - avctx->pix_fmt = PIX_FMT_RGB48; + avctx->pix_fmt = AV_PIX_FMT_RGB48; break; // 8-bit case 0: diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index b7a993e775..c63a27f8aa 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -943,21 +943,21 @@ static av_cold int encode_init(AVCodecContext *avctx) s->plane_count=3; switch(avctx->pix_fmt){ - case PIX_FMT_YUV444P9: - case PIX_FMT_YUV422P9: - case PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV422P9: + case AV_PIX_FMT_YUV420P9: if (!avctx->bits_per_raw_sample) s->bits_per_raw_sample = 9; - case PIX_FMT_YUV444P10: - case PIX_FMT_YUV420P10: - case PIX_FMT_YUV422P10: + case AV_PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV420P10: + case AV_PIX_FMT_YUV422P10: s->packed_at_lsb = 1; if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 10; - case PIX_FMT_GRAY16: - case PIX_FMT_YUV444P16: - case PIX_FMT_YUV422P16: - case PIX_FMT_YUV420P16: + case AV_PIX_FMT_GRAY16: + case AV_PIX_FMT_YUV444P16: + case AV_PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV420P16: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) { s->bits_per_raw_sample = 16; } else if (!s->bits_per_raw_sample){ @@ -976,40 +976,40 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } s->version= FFMAX(s->version, 1); - case PIX_FMT_GRAY8: - case PIX_FMT_YUV444P: - case PIX_FMT_YUV440P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV420P: - case PIX_FMT_YUV411P: - case PIX_FMT_YUV410P: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_YUV440P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV410P: s->chroma_planes= av_pix_fmt_descriptors[avctx->pix_fmt].nb_components < 3 ? 0 : 1; s->colorspace= 0; break; - case PIX_FMT_YUVA444P: - case PIX_FMT_YUVA422P: - case PIX_FMT_YUVA420P: + case AV_PIX_FMT_YUVA444P: + case AV_PIX_FMT_YUVA422P: + case AV_PIX_FMT_YUVA420P: s->chroma_planes= 1; s->colorspace= 0; s->transparency= 1; break; - case PIX_FMT_RGB32: + case AV_PIX_FMT_RGB32: s->colorspace= 1; s->transparency= 1; break; - case PIX_FMT_0RGB32: + case AV_PIX_FMT_0RGB32: s->colorspace= 1; break; - case PIX_FMT_GBRP9: + case AV_PIX_FMT_GBRP9: if (!avctx->bits_per_raw_sample) s->bits_per_raw_sample = 9; - case PIX_FMT_GBRP10: + case AV_PIX_FMT_GBRP10: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 10; - case PIX_FMT_GBRP12: + case AV_PIX_FMT_GBRP12: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 12; - case PIX_FMT_GBRP14: + case AV_PIX_FMT_GBRP14: if (!avctx->bits_per_raw_sample && !s->bits_per_raw_sample) s->bits_per_raw_sample = 14; else if (!s->bits_per_raw_sample) @@ -1869,26 +1869,26 @@ static int read_header(FFV1Context *f){ if(f->colorspace==0){ if(!f->transparency && !f->chroma_planes){ if (f->avctx->bits_per_raw_sample<=8) - f->avctx->pix_fmt= PIX_FMT_GRAY8; + f->avctx->pix_fmt= AV_PIX_FMT_GRAY8; else - f->avctx->pix_fmt= PIX_FMT_GRAY16; + f->avctx->pix_fmt= AV_PIX_FMT_GRAY16; }else if(f->avctx->bits_per_raw_sample<=8 && !f->transparency){ switch(16*f->chroma_h_shift + f->chroma_v_shift){ - case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break; - case 0x01: f->avctx->pix_fmt= PIX_FMT_YUV440P; break; - case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break; - case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P; break; - case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break; - case 0x22: f->avctx->pix_fmt= PIX_FMT_YUV410P; break; + case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUV444P; break; + case 0x01: f->avctx->pix_fmt= AV_PIX_FMT_YUV440P; break; + case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUV422P; break; + case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUV420P; break; + case 0x20: f->avctx->pix_fmt= AV_PIX_FMT_YUV411P; break; + case 0x22: f->avctx->pix_fmt= AV_PIX_FMT_YUV410P; break; default: av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); return -1; } }else if(f->avctx->bits_per_raw_sample<=8 && f->transparency){ switch(16*f->chroma_h_shift + f->chroma_v_shift){ - case 0x00: f->avctx->pix_fmt= PIX_FMT_YUVA444P; break; - case 0x10: f->avctx->pix_fmt= PIX_FMT_YUVA422P; break; - case 0x11: f->avctx->pix_fmt= PIX_FMT_YUVA420P; break; + case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUVA444P; break; + case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUVA422P; break; + case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUVA420P; break; default: av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); return -1; @@ -1896,9 +1896,9 @@ static int read_header(FFV1Context *f){ }else if(f->avctx->bits_per_raw_sample==9) { f->packed_at_lsb=1; switch(16*f->chroma_h_shift + f->chroma_v_shift){ - case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P9; break; - case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P9; break; - case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P9; break; + case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUV444P9; break; + case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUV422P9; break; + case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUV420P9; break; default: av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); return -1; @@ -1906,18 +1906,18 @@ static int read_header(FFV1Context *f){ }else if(f->avctx->bits_per_raw_sample==10) { f->packed_at_lsb=1; switch(16*f->chroma_h_shift + f->chroma_v_shift){ - case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P10; break; - case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P10; break; - case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P10; break; + case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUV444P10; break; + case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUV422P10; break; + case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUV420P10; break; default: av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); return -1; } }else { switch(16*f->chroma_h_shift + f->chroma_v_shift){ - case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break; - case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P16; break; - case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P16; break; + case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUV444P16; break; + case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUV422P16; break; + case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUV420P16; break; default: av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); return -1; @@ -1929,16 +1929,16 @@ static int read_header(FFV1Context *f){ return -1; } if(f->avctx->bits_per_raw_sample==9) - f->avctx->pix_fmt= PIX_FMT_GBRP9; + f->avctx->pix_fmt= AV_PIX_FMT_GBRP9; else if(f->avctx->bits_per_raw_sample==10) - f->avctx->pix_fmt= PIX_FMT_GBRP10; + f->avctx->pix_fmt= AV_PIX_FMT_GBRP10; else if(f->avctx->bits_per_raw_sample==12) - f->avctx->pix_fmt= PIX_FMT_GBRP12; + f->avctx->pix_fmt= AV_PIX_FMT_GBRP12; else if(f->avctx->bits_per_raw_sample==14) - f->avctx->pix_fmt= PIX_FMT_GBRP14; + f->avctx->pix_fmt= AV_PIX_FMT_GBRP14; else - if(f->transparency) f->avctx->pix_fmt= PIX_FMT_RGB32; - else f->avctx->pix_fmt= PIX_FMT_0RGB32; + if(f->transparency) f->avctx->pix_fmt= AV_PIX_FMT_RGB32; + else f->avctx->pix_fmt= AV_PIX_FMT_0RGB32; }else{ av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n"); return -1; @@ -2192,15 +2192,15 @@ AVCodec ff_ffv1_encoder = { .close = common_end, .capabilities = CODEC_CAP_SLICE_THREADS, .defaults = ffv1_defaults, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUV420P, PIX_FMT_YUVA420P, PIX_FMT_YUVA422P, PIX_FMT_YUV444P, - PIX_FMT_YUVA444P, PIX_FMT_YUV440P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_0RGB32, PIX_FMT_RGB32, PIX_FMT_YUV420P16, - PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, PIX_FMT_YUV444P9, PIX_FMT_YUV422P9, - PIX_FMT_YUV420P9, PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, PIX_FMT_YUV444P10, - PIX_FMT_GRAY16, PIX_FMT_GRAY8, PIX_FMT_GBRP9, PIX_FMT_GBRP10, - PIX_FMT_GBRP12, PIX_FMT_GBRP14, - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_0RGB32, AV_PIX_FMT_RGB32, AV_PIX_FMT_YUV420P16, + AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16, AV_PIX_FMT_YUV444P9, AV_PIX_FMT_YUV422P9, + AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, + AV_PIX_FMT_GRAY16, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, + AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"), .priv_class = &class, diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index 1d94efdb83..367d189bee 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -114,7 +114,7 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret); return 1; } - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; avcodec_get_frame_defaults(&s->frame); s->frame.data[0] = NULL; @@ -462,7 +462,7 @@ AVCodec ff_flashsv_decoder = { .close = flashsv_decode_end, .decode = flashsv_decode_frame, .capabilities = CODEC_CAP_DR1, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"), }; #endif /* CONFIG_FLASHSV_DECODER */ @@ -525,7 +525,7 @@ AVCodec ff_flashsv2_decoder = { .close = flashsv2_decode_end, .decode = flashsv_decode_frame, .capabilities = CODEC_CAP_DR1, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"), }; #endif /* CONFIG_FLASHSV2_DECODER */ diff --git a/libavcodec/flashsv2enc.c b/libavcodec/flashsv2enc.c index a33c9bb6f6..1d0d1963f6 100644 --- a/libavcodec/flashsv2enc.c +++ b/libavcodec/flashsv2enc.c @@ -926,6 +926,6 @@ AVCodec ff_flashsv2_encoder = { .init = flashsv2_encode_init, .encode2 = flashsv2_encode_frame, .close = flashsv2_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video Version 2"), }; diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c index 867c65e6f6..e6b181f2ae 100644 --- a/libavcodec/flashsvenc.c +++ b/libavcodec/flashsvenc.c @@ -283,6 +283,6 @@ AVCodec ff_flashsv_encoder = { .init = flashsv_encode_init, .encode2 = flashsv_encode_frame, .close = flashsv_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"), }; diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index 6a11122698..79695da4ef 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -129,10 +129,10 @@ static av_cold int flic_decode_init(AVCodecContext *avctx) } switch (depth) { - case 8 : avctx->pix_fmt = PIX_FMT_PAL8; break; - case 15 : avctx->pix_fmt = PIX_FMT_RGB555; break; - case 16 : avctx->pix_fmt = PIX_FMT_RGB565; break; - case 24 : avctx->pix_fmt = PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */ + case 8 : avctx->pix_fmt = AV_PIX_FMT_PAL8; break; + case 15 : avctx->pix_fmt = AV_PIX_FMT_RGB555; break; + case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break; + case 24 : avctx->pix_fmt = AV_PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */ av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n"); return -1; default : @@ -768,16 +768,16 @@ static int flic_decode_frame(AVCodecContext *avctx, { const uint8_t *buf = avpkt->data; int buf_size = avpkt->size; - if (avctx->pix_fmt == PIX_FMT_PAL8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { return flic_decode_frame_8BPP(avctx, data, data_size, buf, buf_size); } - else if ((avctx->pix_fmt == PIX_FMT_RGB555) || - (avctx->pix_fmt == PIX_FMT_RGB565)) { + else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) || + (avctx->pix_fmt == AV_PIX_FMT_RGB565)) { return flic_decode_frame_15_16BPP(avctx, data, data_size, buf, buf_size); } - else if (avctx->pix_fmt == PIX_FMT_BGR24) { + else if (avctx->pix_fmt == AV_PIX_FMT_BGR24) { return flic_decode_frame_24BPP(avctx, data, data_size, buf, buf_size); } diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index acd81b3676..a68a6fa1dc 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -94,7 +94,7 @@ AVCodec ff_flv_encoder = { .init = ff_MPV_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"), .priv_class = &flv_class, }; diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index af4e3215e3..da8a50c1fd 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -142,7 +142,7 @@ static int decode_frame(AVCodecContext *avctx, int i, j, is_chroma; const int planes = 3; uint8_t *out; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; header = AV_RL32(buf); version = header & 0xff; @@ -204,7 +204,7 @@ static int decode_frame(AVCodecContext *avctx, f->reference = 0; f->buffer_hints = FF_BUFFER_HINTS_VALID; - pix_fmt = version & 1 ? PIX_FMT_BGR24 : PIX_FMT_YUVJ420P; + pix_fmt = version & 1 ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_YUVJ420P; if (avctx->pix_fmt != pix_fmt && f->data[0]) { avctx->release_buffer(avctx, f); } diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c index 10b80f7a7d..90ffc79a0c 100644 --- a/libavcodec/frwu.c +++ b/libavcodec/frwu.c @@ -29,7 +29,7 @@ static av_cold int decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "frwu needs even width\n"); return AVERROR(EINVAL); } - avctx->pix_fmt = PIX_FMT_UYVY422; + avctx->pix_fmt = AV_PIX_FMT_UYVY422; avctx->coded_frame = avcodec_alloc_frame(); if (!avctx->coded_frame) diff --git a/libavcodec/gif.c b/libavcodec/gif.c index 85760026b6..1ae46618a5 100644 --- a/libavcodec/gif.c +++ b/libavcodec/gif.c @@ -204,9 +204,9 @@ AVCodec ff_gif_encoder = { .init = gif_encode_init, .encode2 = gif_encode_frame, .close = gif_encode_close, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, - PIX_FMT_GRAY8, PIX_FMT_PAL8, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, + AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"), }; diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 40a4c9b6ec..3e7799f9ec 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -294,7 +294,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, A if ((ret = gif_read_header1(s)) < 0) return ret; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; if (av_image_check_size(s->screen_width, s->screen_height, 0, avctx)) return -1; avcodec_set_dimensions(avctx, s->screen_width, s->screen_height); diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index 6be02ae269..9bd6b20bba 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -86,7 +86,7 @@ static av_cold int h261_decode_init(AVCodecContext *avctx){ s->out_format = FMT_H261; s->low_delay= 1; - avctx->pix_fmt= PIX_FMT_YUV420P; + avctx->pix_fmt= AV_PIX_FMT_YUV420P; s->codec_id= avctx->codec->id; diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index a14da0d8fa..29bee5d46e 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -332,7 +332,7 @@ AVCodec ff_h261_encoder = { .init = ff_MPV_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("H.261"), .priv_class = &h261_class, }; diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index fd5047f73a..e6d9ed3962 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -62,7 +62,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx) s->decode_mb= ff_h263_decode_mb; s->low_delay= 1; if (avctx->codec->id == AV_CODEC_ID_MSS2) - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; else avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts); s->unrestricted_mv= 1; diff --git a/libavcodec/h264.c b/libavcodec/h264.c index d05fce67a6..1fd806848c 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -66,12 +66,12 @@ static const uint8_t div6[QP_MAX_NUM + 1] = { 14,14,14,14, }; -static const enum PixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = { - PIX_FMT_DXVA2_VLD, - PIX_FMT_VAAPI_VLD, - PIX_FMT_VDA_VLD, - PIX_FMT_YUVJ420P, - PIX_FMT_NONE +static const enum AVPixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = { + AV_PIX_FMT_DXVA2_VLD, + AV_PIX_FMT_VAAPI_VLD, + AV_PIX_FMT_VDA_VLD, + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_NONE }; int avpriv_h264_has_num_reorder_frames(AVCodecContext *avctx) @@ -2544,60 +2544,60 @@ static int decode_slice_header(H264Context *h, H264Context *h0) case 9: if (CHROMA444) { if (s->avctx->colorspace == AVCOL_SPC_RGB) { - s->avctx->pix_fmt = PIX_FMT_GBRP9; + s->avctx->pix_fmt = AV_PIX_FMT_GBRP9; } else - s->avctx->pix_fmt = PIX_FMT_YUV444P9; + s->avctx->pix_fmt = AV_PIX_FMT_YUV444P9; } else if (CHROMA422) - s->avctx->pix_fmt = PIX_FMT_YUV422P9; + s->avctx->pix_fmt = AV_PIX_FMT_YUV422P9; else - s->avctx->pix_fmt = PIX_FMT_YUV420P9; + s->avctx->pix_fmt = AV_PIX_FMT_YUV420P9; break; case 10: if (CHROMA444) { if (s->avctx->colorspace == AVCOL_SPC_RGB) { - s->avctx->pix_fmt = PIX_FMT_GBRP10; + s->avctx->pix_fmt = AV_PIX_FMT_GBRP10; } else - s->avctx->pix_fmt = PIX_FMT_YUV444P10; + s->avctx->pix_fmt = AV_PIX_FMT_YUV444P10; } else if (CHROMA422) - s->avctx->pix_fmt = PIX_FMT_YUV422P10; + s->avctx->pix_fmt = AV_PIX_FMT_YUV422P10; else - s->avctx->pix_fmt = PIX_FMT_YUV420P10; + s->avctx->pix_fmt = AV_PIX_FMT_YUV420P10; break; case 12: if (CHROMA444) { if (s->avctx->colorspace == AVCOL_SPC_RGB) { - s->avctx->pix_fmt = PIX_FMT_GBRP12; + s->avctx->pix_fmt = AV_PIX_FMT_GBRP12; } else - s->avctx->pix_fmt = PIX_FMT_YUV444P12; + s->avctx->pix_fmt = AV_PIX_FMT_YUV444P12; } else if (CHROMA422) - s->avctx->pix_fmt = PIX_FMT_YUV422P12; + s->avctx->pix_fmt = AV_PIX_FMT_YUV422P12; else - s->avctx->pix_fmt = PIX_FMT_YUV420P12; + s->avctx->pix_fmt = AV_PIX_FMT_YUV420P12; break; case 14: if (CHROMA444) { if (s->avctx->colorspace == AVCOL_SPC_RGB) { - s->avctx->pix_fmt = PIX_FMT_GBRP14; + s->avctx->pix_fmt = AV_PIX_FMT_GBRP14; } else - s->avctx->pix_fmt = PIX_FMT_YUV444P14; + s->avctx->pix_fmt = AV_PIX_FMT_YUV444P14; } else if (CHROMA422) - s->avctx->pix_fmt = PIX_FMT_YUV422P14; + s->avctx->pix_fmt = AV_PIX_FMT_YUV422P14; else - s->avctx->pix_fmt = PIX_FMT_YUV420P14; + s->avctx->pix_fmt = AV_PIX_FMT_YUV420P14; break; case 8: if (CHROMA444) { - s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ444P - : PIX_FMT_YUV444P; + s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P + : AV_PIX_FMT_YUV444P; if (s->avctx->colorspace == AVCOL_SPC_RGB) { - s->avctx->pix_fmt = PIX_FMT_GBR24P; + s->avctx->pix_fmt = AV_PIX_FMT_GBR24P; av_log(h->s.avctx, AV_LOG_DEBUG, "Detected GBR colorspace.\n"); } else if (s->avctx->colorspace == AVCOL_SPC_YCGCO) { av_log(h->s.avctx, AV_LOG_WARNING, "Detected unsupported YCgCo colorspace.\n"); } } else if (CHROMA422) { - s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ422P - : PIX_FMT_YUV422P; + s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P + : AV_PIX_FMT_YUV422P; } else { s->avctx->pix_fmt = s->avctx->get_format(s->avctx, s->avctx->codec->pix_fmts ? @@ -4248,8 +4248,8 @@ AVCodec ff_h264_vdpau_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU, .flush = flush_dpb, .long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)"), - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_VDPAU_H264, - PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VDPAU_H264, + AV_PIX_FMT_NONE}, .profiles = NULL_IF_CONFIG_SMALL(profiles), .priv_class = &h264_vdpau_class, }; diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 2a9ebe1b2c..6e88114412 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -489,28 +489,28 @@ static av_cold int decode_init(AVCodecContext *avctx) switch (s->bitstream_bpp) { case 12: - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; break; case 16: if (s->yuy2) { - avctx->pix_fmt = PIX_FMT_YUYV422; + avctx->pix_fmt = AV_PIX_FMT_YUYV422; } else { - avctx->pix_fmt = PIX_FMT_YUV422P; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; } break; case 24: case 32: if (s->bgr32) { - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; } else { - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; } break; default: return AVERROR_INVALIDDATA; } - if ((avctx->pix_fmt == PIX_FMT_YUV422P || avctx->pix_fmt == PIX_FMT_YUV420P) && avctx->width & 1) { + if ((avctx->pix_fmt == AV_PIX_FMT_YUV422P || avctx->pix_fmt == AV_PIX_FMT_YUV420P) && avctx->width & 1) { av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n"); return AVERROR_INVALIDDATA; } @@ -583,18 +583,18 @@ static av_cold int encode_init(AVCodecContext *avctx) avctx->coded_frame = &s->picture; switch (avctx->pix_fmt) { - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: if (s->width & 1) { av_log(avctx, AV_LOG_ERROR, "width must be even for this colorspace\n"); return AVERROR(EINVAL); } - s->bitstream_bpp = avctx->pix_fmt == PIX_FMT_YUV420P ? 12 : 16; + s->bitstream_bpp = avctx->pix_fmt == AV_PIX_FMT_YUV420P ? 12 : 16; break; - case PIX_FMT_RGB32: + case AV_PIX_FMT_RGB32: s->bitstream_bpp = 32; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: s->bitstream_bpp = 24; break; default: @@ -616,7 +616,7 @@ static av_cold int encode_init(AVCodecContext *avctx) }else s->context= 0; if (avctx->codec->id == AV_CODEC_ID_HUFFYUV) { - if (avctx->pix_fmt == PIX_FMT_YUV420P) { + if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { av_log(avctx, AV_LOG_ERROR, "Error: YV12 is not supported by huffyuv; use " "vcodec=ffvhuff or format=422p\n"); @@ -1299,8 +1299,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, init_put_bits(&s->pb, pkt->data + size, pkt->size - size); - if (avctx->pix_fmt == PIX_FMT_YUV422P || - avctx->pix_fmt == PIX_FMT_YUV420P) { + if (avctx->pix_fmt == AV_PIX_FMT_YUV422P || + avctx->pix_fmt == AV_PIX_FMT_YUV420P) { int lefty, leftu, leftv, y, cy; put_bits(&s->pb, 8, leftv = p->data[2][0]); @@ -1404,7 +1404,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, encode_422_bitstream(s, 0, width); } } - } else if(avctx->pix_fmt == PIX_FMT_RGB32) { + } else if(avctx->pix_fmt == AV_PIX_FMT_RGB32) { uint8_t *data = p->data[0] + (height - 1) * p->linesize[0]; const int stride = -p->linesize[0]; const int fake_stride = -fake_ystride; @@ -1429,7 +1429,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, } encode_bgra_bitstream(s, width, 4); } - }else if(avctx->pix_fmt == PIX_FMT_RGB24){ + }else if(avctx->pix_fmt == AV_PIX_FMT_RGB24){ uint8_t *data = p->data[0] + (height-1)*p->linesize[0]; const int stride = -p->linesize[0]; const int fake_stride = -fake_ystride; @@ -1547,8 +1547,8 @@ AVCodec ff_huffyuv_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUV422P, PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), }; @@ -1563,8 +1563,8 @@ AVCodec ff_ffvhuff_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"), }; diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index 26d408ff5e..f9fe925944 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -151,7 +151,7 @@ static av_cold int idcin_decode_init(AVCodecContext *avctx) unsigned char *histograms; s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; /* make sure the Huffman tables make it */ if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) { diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 2c4ea8f8e6..70f548bf67 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -232,7 +232,7 @@ static int extract_header(AVCodecContext *const avctx, s->masking = bytestream_get_byte(&buf); if (s->masking == MASK_HAS_MASK) { if (s->bpp >= 8) { - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; av_freep(&s->mask_buf); av_freep(&s->mask_palbuf); s->mask_buf = av_malloc((s->planesize * 32) + FF_INPUT_BUFFER_PADDING_SIZE); @@ -328,10 +328,10 @@ static av_cold int decode_init(AVCodecContext *avctx) else palette_size = 0; avctx->pix_fmt = (avctx->bits_per_coded_sample < 8) || - (avctx->extradata_size >= 2 && palette_size) ? PIX_FMT_PAL8 : PIX_FMT_GRAY8; + (avctx->extradata_size >= 2 && palette_size) ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_GRAY8; } else if (avctx->bits_per_coded_sample <= 32) { if (avctx->codec_tag != MKTAG('D','E','E','P')) - avctx->pix_fmt = PIX_FMT_BGR32; + avctx->pix_fmt = AV_PIX_FMT_BGR32; } else { return AVERROR_INVALIDDATA; } @@ -488,14 +488,14 @@ static int decode_frame_ilbm(AVCodecContext *avctx, } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return res; - } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt == PIX_FMT_PAL8) { + } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt == AV_PIX_FMT_PAL8) { if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0) return res; } s->init = 1; if (avctx->codec_tag == MKTAG('A','C','B','M')) { - if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { memset(s->frame.data[0], 0, avctx->height * s->frame.linesize[0]); for (plane = 0; plane < s->bpp; plane++) { for(y = 0; y < avctx->height && buf < buf_end; y++ ) { @@ -504,7 +504,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx, buf += s->planesize; } } - } else if (s->ham) { // HAM to PIX_FMT_BGR32 + } else if (s->ham) { // HAM to AV_PIX_FMT_BGR32 memset(s->frame.data[0], 0, avctx->height * s->frame.linesize[0]); for(y = 0; y < avctx->height; y++) { uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]]; @@ -525,13 +525,13 @@ static int decode_frame_ilbm(AVCodecContext *avctx, uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]]; memcpy(row, buf, FFMIN(raw_width, buf_end - buf)); buf += raw_width; - if (avctx->pix_fmt == PIX_FMT_BGR32) { + if (avctx->pix_fmt == AV_PIX_FMT_BGR32) { for(x = 0; x < avctx->width; x++) row[4 * x + 3] = row[4 * x + 3] & 0xF0 | (row[4 * x + 3] >> 4); } } } else if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved - if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { for(y = 0; y < avctx->height; y++ ) { uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; memset(row, 0, avctx->width); @@ -540,7 +540,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx, buf += s->planesize; } } - } else if (s->ham) { // HAM to PIX_FMT_BGR32 + } else if (s->ham) { // HAM to AV_PIX_FMT_BGR32 for (y = 0; y < avctx->height; y++) { uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; memset(s->ham_buf, 0, s->planesize * 8); @@ -550,7 +550,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx, } decode_ham_plane32((uint32_t *) row, s->ham_buf, s->ham_palbuf, s->planesize); } - } else { // PIX_FMT_BGR32 + } else { // AV_PIX_FMT_BGR32 for(y = 0; y < avctx->height; y++ ) { uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; memset(row, 0, avctx->width << 2); @@ -561,13 +561,13 @@ static int decode_frame_ilbm(AVCodecContext *avctx, } } } else if (avctx->codec_tag == MKTAG('P','B','M',' ')) { // IFF-PBM - if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { for(y = 0; y < avctx->height; y++ ) { uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]]; memcpy(row, buf, FFMIN(avctx->width, buf_end - buf)); buf += avctx->width + (avctx->width % 2); // padding if odd } - } else if (s->ham) { // IFF-PBM: HAM to PIX_FMT_BGR32 + } else if (s->ham) { // IFF-PBM: HAM to AV_PIX_FMT_BGR32 for (y = 0; y < avctx->height; y++) { uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; memcpy(s->ham_buf, buf, FFMIN(avctx->width, buf_end - buf)); @@ -605,17 +605,17 @@ static int decode_frame_byterun1(AVCodecContext *avctx, } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return res; - } else if (avctx->pix_fmt == PIX_FMT_PAL8) { + } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0) return res; - } else if (avctx->pix_fmt == PIX_FMT_RGB32 && avctx->bits_per_coded_sample <= 8) { + } else if (avctx->pix_fmt == AV_PIX_FMT_RGB32 && avctx->bits_per_coded_sample <= 8) { if ((res = ff_cmap_read_palette(avctx, s->mask_palbuf)) < 0) return res; } s->init = 1; if (avctx->codec_tag == MKTAG('I','L','B','M')) { //interleaved - if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { for(y = 0; y < avctx->height ; y++ ) { uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; memset(row, 0, avctx->width); @@ -624,7 +624,7 @@ static int decode_frame_byterun1(AVCodecContext *avctx, decodeplane8(row, s->planebuf, s->planesize, plane); } } - } else if (avctx->bits_per_coded_sample <= 8) { //8-bit (+ mask) to PIX_FMT_BGR32 + } else if (avctx->bits_per_coded_sample <= 8) { //8-bit (+ mask) to AV_PIX_FMT_BGR32 for (y = 0; y < avctx->height ; y++ ) { uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; memset(s->mask_buf, 0, avctx->width * sizeof(uint32_t)); @@ -634,7 +634,7 @@ static int decode_frame_byterun1(AVCodecContext *avctx, } lookup_pal_indicies((uint32_t *) row, s->mask_buf, s->mask_palbuf, avctx->width); } - } else if (s->ham) { // HAM to PIX_FMT_BGR32 + } else if (s->ham) { // HAM to AV_PIX_FMT_BGR32 for (y = 0; y < avctx->height ; y++) { uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; memset(s->ham_buf, 0, s->planesize * 8); @@ -644,7 +644,7 @@ static int decode_frame_byterun1(AVCodecContext *avctx, } decode_ham_plane32((uint32_t *) row, s->ham_buf, s->ham_palbuf, s->planesize); } - } else { //PIX_FMT_BGR32 + } else { //AV_PIX_FMT_BGR32 for(y = 0; y < avctx->height ; y++ ) { uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; memset(row, 0, avctx->width << 2); @@ -655,12 +655,12 @@ static int decode_frame_byterun1(AVCodecContext *avctx, } } } else if (avctx->codec_tag == MKTAG('P','B','M',' ')) { // IFF-PBM - if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { for(y = 0; y < avctx->height ; y++ ) { uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; buf += decode_byterun(row, avctx->width, buf, buf_end); } - } else if (s->ham) { // IFF-PBM: HAM to PIX_FMT_BGR32 + } else if (s->ham) { // IFF-PBM: HAM to AV_PIX_FMT_BGR32 for (y = 0; y < avctx->height ; y++) { uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; buf += decode_byterun(s->ham_buf, avctx->width, buf, buf_end); diff --git a/libavcodec/imgconvert.c b/libavcodec/imgconvert.c index 61ca6a9292..02986831a6 100644 --- a/libavcodec/imgconvert.c +++ b/libavcodec/imgconvert.c @@ -64,349 +64,349 @@ typedef struct PixFmtInfo { } PixFmtInfo; /* this table gives more information about formats */ -static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = { +static const PixFmtInfo pix_fmt_info[AV_PIX_FMT_NB] = { /* YUV formats */ - [PIX_FMT_YUV420P] = { + [AV_PIX_FMT_YUV420P] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P] = { + [AV_PIX_FMT_YUV422P] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P] = { + [AV_PIX_FMT_YUV444P] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUYV422] = { + [AV_PIX_FMT_YUYV422] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_UYVY422] = { + [AV_PIX_FMT_UYVY422] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV410P] = { + [AV_PIX_FMT_YUV410P] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV411P] = { + [AV_PIX_FMT_YUV411P] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV440P] = { + [AV_PIX_FMT_YUV440P] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P9LE] = { + [AV_PIX_FMT_YUV420P9LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P9LE] = { + [AV_PIX_FMT_YUV422P9LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P9LE] = { + [AV_PIX_FMT_YUV444P9LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P9BE] = { + [AV_PIX_FMT_YUV420P9BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P9BE] = { + [AV_PIX_FMT_YUV422P9BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P9BE] = { + [AV_PIX_FMT_YUV444P9BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P10LE] = { + [AV_PIX_FMT_YUV420P10LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P10LE] = { + [AV_PIX_FMT_YUV422P10LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P10LE] = { + [AV_PIX_FMT_YUV444P10LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P10BE] = { + [AV_PIX_FMT_YUV420P10BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P10BE] = { + [AV_PIX_FMT_YUV422P10BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P10BE] = { + [AV_PIX_FMT_YUV444P10BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P12LE] = { + [AV_PIX_FMT_YUV420P12LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P12LE] = { + [AV_PIX_FMT_YUV422P12LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P12LE] = { + [AV_PIX_FMT_YUV444P12LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P12BE] = { + [AV_PIX_FMT_YUV420P12BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P12BE] = { + [AV_PIX_FMT_YUV422P12BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P12BE] = { + [AV_PIX_FMT_YUV444P12BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P14LE] = { + [AV_PIX_FMT_YUV420P14LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P14LE] = { + [AV_PIX_FMT_YUV422P14LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P14LE] = { + [AV_PIX_FMT_YUV444P14LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P14BE] = { + [AV_PIX_FMT_YUV420P14BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P14BE] = { + [AV_PIX_FMT_YUV422P14BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P14BE] = { + [AV_PIX_FMT_YUV444P14BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P16LE] = { + [AV_PIX_FMT_YUV420P16LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P16LE] = { + [AV_PIX_FMT_YUV422P16LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P16LE] = { + [AV_PIX_FMT_YUV444P16LE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV420P16BE] = { + [AV_PIX_FMT_YUV420P16BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV422P16BE] = { + [AV_PIX_FMT_YUV422P16BE] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUV444P16BE] = { + [AV_PIX_FMT_YUV444P16BE] = { .color_type = FF_COLOR_YUV, }, /* YUV formats with alpha plane */ - [PIX_FMT_YUVA420P] = { + [AV_PIX_FMT_YUVA420P] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUVA422P] = { + [AV_PIX_FMT_YUVA422P] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_YUVA444P] = { + [AV_PIX_FMT_YUVA444P] = { .color_type = FF_COLOR_YUV, }, /* JPEG YUV */ - [PIX_FMT_YUVJ420P] = { + [AV_PIX_FMT_YUVJ420P] = { .color_type = FF_COLOR_YUV_JPEG, }, - [PIX_FMT_YUVJ422P] = { + [AV_PIX_FMT_YUVJ422P] = { .color_type = FF_COLOR_YUV_JPEG, }, - [PIX_FMT_YUVJ444P] = { + [AV_PIX_FMT_YUVJ444P] = { .color_type = FF_COLOR_YUV_JPEG, }, - [PIX_FMT_YUVJ440P] = { + [AV_PIX_FMT_YUVJ440P] = { .color_type = FF_COLOR_YUV_JPEG, }, /* RGB formats */ - [PIX_FMT_RGB24] = { + [AV_PIX_FMT_RGB24] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_BGR24] = { + [AV_PIX_FMT_BGR24] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_ARGB] = { + [AV_PIX_FMT_ARGB] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGB48BE] = { + [AV_PIX_FMT_RGB48BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGB48LE] = { + [AV_PIX_FMT_RGB48LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGBA64BE] = { + [AV_PIX_FMT_RGBA64BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGBA64LE] = { + [AV_PIX_FMT_RGBA64LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGB565BE] = { + [AV_PIX_FMT_RGB565BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGB565LE] = { + [AV_PIX_FMT_RGB565LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGB555BE] = { + [AV_PIX_FMT_RGB555BE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_RGB555LE] = { + [AV_PIX_FMT_RGB555LE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_RGB444BE] = { + [AV_PIX_FMT_RGB444BE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_RGB444LE] = { + [AV_PIX_FMT_RGB444LE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, /* gray / mono formats */ - [PIX_FMT_GRAY16BE] = { + [AV_PIX_FMT_GRAY16BE] = { .color_type = FF_COLOR_GRAY, }, - [PIX_FMT_GRAY16LE] = { + [AV_PIX_FMT_GRAY16LE] = { .color_type = FF_COLOR_GRAY, }, - [PIX_FMT_GRAY8] = { + [AV_PIX_FMT_GRAY8] = { .color_type = FF_COLOR_GRAY, }, - [PIX_FMT_GRAY8A] = { + [AV_PIX_FMT_GRAY8A] = { .color_type = FF_COLOR_GRAY, }, - [PIX_FMT_MONOWHITE] = { + [AV_PIX_FMT_MONOWHITE] = { .color_type = FF_COLOR_GRAY, }, - [PIX_FMT_MONOBLACK] = { + [AV_PIX_FMT_MONOBLACK] = { .color_type = FF_COLOR_GRAY, }, /* paletted formats */ - [PIX_FMT_PAL8] = { + [AV_PIX_FMT_PAL8] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_UYYVYY411] = { + [AV_PIX_FMT_UYYVYY411] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_ABGR] = { + [AV_PIX_FMT_ABGR] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_BGR48BE] = { + [AV_PIX_FMT_BGR48BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_BGR48LE] = { + [AV_PIX_FMT_BGR48LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_BGRA64BE] = { + [AV_PIX_FMT_BGRA64BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_BGRA64LE] = { + [AV_PIX_FMT_BGRA64LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_BGR565BE] = { + [AV_PIX_FMT_BGR565BE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_BGR565LE] = { + [AV_PIX_FMT_BGR565LE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_BGR555BE] = { + [AV_PIX_FMT_BGR555BE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_BGR555LE] = { + [AV_PIX_FMT_BGR555LE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_BGR444BE] = { + [AV_PIX_FMT_BGR444BE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_BGR444LE] = { + [AV_PIX_FMT_BGR444LE] = { .color_type = FF_COLOR_RGB, .padded_size = 16, }, - [PIX_FMT_RGB8] = { + [AV_PIX_FMT_RGB8] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGB4] = { + [AV_PIX_FMT_RGB4] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGB4_BYTE] = { + [AV_PIX_FMT_RGB4_BYTE] = { .color_type = FF_COLOR_RGB, .padded_size = 8, }, - [PIX_FMT_BGR8] = { + [AV_PIX_FMT_BGR8] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_BGR4] = { + [AV_PIX_FMT_BGR4] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_BGR4_BYTE] = { + [AV_PIX_FMT_BGR4_BYTE] = { .color_type = FF_COLOR_RGB, .padded_size = 8, }, - [PIX_FMT_NV12] = { + [AV_PIX_FMT_NV12] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_NV21] = { + [AV_PIX_FMT_NV21] = { .color_type = FF_COLOR_YUV, }, - [PIX_FMT_BGRA] = { + [AV_PIX_FMT_BGRA] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_RGBA] = { + [AV_PIX_FMT_RGBA] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP] = { + [AV_PIX_FMT_GBRP] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP9BE] = { + [AV_PIX_FMT_GBRP9BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP9LE] = { + [AV_PIX_FMT_GBRP9LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP10BE] = { + [AV_PIX_FMT_GBRP10BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP10LE] = { + [AV_PIX_FMT_GBRP10LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP12BE] = { + [AV_PIX_FMT_GBRP12BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP12LE] = { + [AV_PIX_FMT_GBRP12LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP14BE] = { + [AV_PIX_FMT_GBRP14BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP14LE] = { + [AV_PIX_FMT_GBRP14LE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP16BE] = { + [AV_PIX_FMT_GBRP16BE] = { .color_type = FF_COLOR_RGB, }, - [PIX_FMT_GBRP16LE] = { + [AV_PIX_FMT_GBRP16LE] = { .color_type = FF_COLOR_RGB, }, }; -void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift) +void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift) { *h_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_w; *v_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h; } -int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt) +int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt) { return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL; } int avpicture_fill(AVPicture *picture, uint8_t *ptr, - enum PixelFormat pix_fmt, int width, int height) + enum AVPixelFormat pix_fmt, int width, int height) { return av_image_fill_arrays(picture->data, picture->linesize, ptr, pix_fmt, width, height, 1); } -int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height, +int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt, int width, int height, unsigned char *dest, int dest_size) { return av_image_copy_to_buffer(dest, dest_size, @@ -414,12 +414,12 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, pix_fmt, width, height, 1); } -int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height) +int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height) { return av_image_get_buffer_size(pix_fmt, width, height, 1); } -static int get_pix_fmt_depth(int *min, int *max, enum PixelFormat pix_fmt) +static int get_pix_fmt_depth(int *min, int *max, enum AVPixelFormat pix_fmt) { const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; int i; @@ -437,7 +437,7 @@ static int get_pix_fmt_depth(int *min, int *max, enum PixelFormat pix_fmt) return 0; } -int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt, +int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt, int has_alpha) { const PixFmtInfo *pf, *ps; @@ -446,7 +446,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ int src_min_depth, src_max_depth, dst_min_depth, dst_max_depth; int ret, loss; - if (dst_pix_fmt >= PIX_FMT_NB || dst_pix_fmt <= PIX_FMT_NONE) + if (dst_pix_fmt >= AV_PIX_FMT_NB || dst_pix_fmt <= AV_PIX_FMT_NONE) return ~0; src_desc = &av_pix_fmt_descriptors[src_pix_fmt]; @@ -499,14 +499,14 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_ loss |= FF_LOSS_CHROMA; if (!pixdesc_has_alpha(dst_desc) && (pixdesc_has_alpha(src_desc) && has_alpha)) loss |= FF_LOSS_ALPHA; - if (dst_pix_fmt == PIX_FMT_PAL8 && - (src_pix_fmt != PIX_FMT_PAL8 && (ps->color_type != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && has_alpha)))) + if (dst_pix_fmt == AV_PIX_FMT_PAL8 && + (src_pix_fmt != AV_PIX_FMT_PAL8 && (ps->color_type != FF_COLOR_GRAY || (pixdesc_has_alpha(src_desc) && has_alpha)))) loss |= FF_LOSS_COLORQUANT; return loss; } -static int avg_bits_per_pixel(enum PixelFormat pix_fmt) +static int avg_bits_per_pixel(enum AVPixelFormat pix_fmt) { const PixFmtInfo *info = &pix_fmt_info[pix_fmt]; const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; @@ -516,17 +516,17 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt) } #if FF_API_FIND_BEST_PIX_FMT -enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, +enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr) { - enum PixelFormat dst_pix_fmt; + enum AVPixelFormat dst_pix_fmt; int i; if (loss_ptr) /* all losses count (for backward compatibility) */ *loss_ptr = 0; - dst_pix_fmt = PIX_FMT_NONE; /* so first iteration doesn't have to be treated special */ - for(i = 0; i< FFMIN(PIX_FMT_NB, 64); i++){ + dst_pix_fmt = AV_PIX_FMT_NONE; /* so first iteration doesn't have to be treated special */ + for(i = 0; i< FFMIN(AV_PIX_FMT_NB, 64); i++){ if (pix_fmt_mask & (1ULL << i)) dst_pix_fmt = avcodec_find_best_pix_fmt_of_2(dst_pix_fmt, i, src_pix_fmt, has_alpha, loss_ptr); } @@ -534,10 +534,10 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma } #endif /* FF_API_FIND_BEST_PIX_FMT */ -enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, enum PixelFormat dst_pix_fmt2, - enum PixelFormat src_pix_fmt, int has_alpha, int *loss_ptr) +enum AVPixelFormat avcodec_find_best_pix_fmt_of_2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr) { - enum PixelFormat dst_pix_fmt; + enum AVPixelFormat dst_pix_fmt; int loss1, loss2, loss_order1, loss_order2, i, loss_mask; static const int loss_mask_order[] = { ~0, /* no loss first */ @@ -555,12 +555,12 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, e }; loss_mask= loss_ptr?~*loss_ptr:~0; /* use loss mask if provided */ - dst_pix_fmt = PIX_FMT_NONE; + dst_pix_fmt = AV_PIX_FMT_NONE; loss1 = avcodec_get_pix_fmt_loss(dst_pix_fmt1, src_pix_fmt, has_alpha) & loss_mask; loss2 = avcodec_get_pix_fmt_loss(dst_pix_fmt2, src_pix_fmt, has_alpha) & loss_mask; /* try with successive loss */ - for(i = 0;loss_mask_order[i] != 0 && dst_pix_fmt == PIX_FMT_NONE;i++) { + for(i = 0;loss_mask_order[i] != 0 && dst_pix_fmt == AV_PIX_FMT_NONE;i++) { loss_order1 = loss1 & loss_mask_order[i]; loss_order2 = loss2 & loss_mask_order[i]; @@ -577,34 +577,34 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_2(enum PixelFormat dst_pix_fmt1, e } #if AV_HAVE_INCOMPATIBLE_FORK_ABI -enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list, - enum PixelFormat src_pix_fmt, +enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr){ return avcodec_find_best_pix_fmt_of_list(pix_fmt_list, src_pix_fmt, has_alpha, loss_ptr); } #else -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) +enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat dst_pix_fmt1, enum AVPixelFormat dst_pix_fmt2, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr) { return avcodec_find_best_pix_fmt_of_2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, has_alpha, loss_ptr); } #endif -enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_list, - enum PixelFormat src_pix_fmt, +enum AVPixelFormat avcodec_find_best_pix_fmt_of_list(enum AVPixelFormat *pix_fmt_list, + enum AVPixelFormat src_pix_fmt, int has_alpha, int *loss_ptr){ int i; - enum PixelFormat best = PIX_FMT_NONE; + enum AVPixelFormat best = AV_PIX_FMT_NONE; - for(i=0; pix_fmt_list[i] != PIX_FMT_NONE; i++) + for(i=0; pix_fmt_list[i] != AV_PIX_FMT_NONE; i++) best = avcodec_find_best_pix_fmt_of_2(best, pix_fmt_list[i], src_pix_fmt, has_alpha, loss_ptr); return best; } void av_picture_copy(AVPicture *dst, const AVPicture *src, - enum PixelFormat pix_fmt, int width, int height) + enum AVPixelFormat pix_fmt, int width, int height) { av_image_copy(dst->data, dst->linesize, (const uint8_t **)src->data, src->linesize, pix_fmt, width, height); @@ -698,7 +698,7 @@ void ff_shrink88(uint8_t *dst, int dst_wrap, int avpicture_alloc(AVPicture *picture, - enum PixelFormat pix_fmt, int width, int height) + enum AVPixelFormat pix_fmt, int width, int height) { int ret; @@ -716,7 +716,7 @@ void avpicture_free(AVPicture *picture) } /* return true if yuv planar */ -static inline int is_yuv_planar(enum PixelFormat fmt) +static inline int is_yuv_planar(enum AVPixelFormat fmt) { const PixFmtInfo *info = &pix_fmt_info[fmt]; const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[fmt]; @@ -739,12 +739,12 @@ static inline int is_yuv_planar(enum PixelFormat fmt) } int av_picture_crop(AVPicture *dst, const AVPicture *src, - enum PixelFormat pix_fmt, int top_band, int left_band) + enum AVPixelFormat pix_fmt, int top_band, int left_band) { int y_shift; int x_shift; - if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB) + if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB) return -1; y_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h; @@ -769,7 +769,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src, } int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, - enum PixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, + enum AVPixelFormat pix_fmt, int padtop, int padbottom, int padleft, int padright, int *color) { uint8_t *optr; @@ -778,7 +778,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, int yheight; int i, y; - if (pix_fmt < 0 || pix_fmt >= PIX_FMT_NB || + if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB || !is_yuv_planar(pix_fmt)) return -1; for (i = 0; i < 3; i++) { @@ -937,17 +937,17 @@ static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap, } int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, - enum PixelFormat pix_fmt, int width, int height) + enum AVPixelFormat pix_fmt, int width, int height) { int i; - if (pix_fmt != PIX_FMT_YUV420P && - pix_fmt != PIX_FMT_YUVJ420P && - pix_fmt != PIX_FMT_YUV422P && - pix_fmt != PIX_FMT_YUVJ422P && - pix_fmt != PIX_FMT_YUV444P && - pix_fmt != PIX_FMT_YUV411P && - pix_fmt != PIX_FMT_GRAY8) + if (pix_fmt != AV_PIX_FMT_YUV420P && + pix_fmt != AV_PIX_FMT_YUVJ420P && + pix_fmt != AV_PIX_FMT_YUV422P && + pix_fmt != AV_PIX_FMT_YUVJ422P && + pix_fmt != AV_PIX_FMT_YUV444P && + pix_fmt != AV_PIX_FMT_YUV411P && + pix_fmt != AV_PIX_FMT_GRAY8) return -1; if ((width & 3) != 0 || (height & 3) != 0) return -1; @@ -955,22 +955,22 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, for(i=0;i<3;i++) { if (i == 1) { switch(pix_fmt) { - case PIX_FMT_YUVJ420P: - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUVJ420P: + case AV_PIX_FMT_YUV420P: width >>= 1; height >>= 1; break; - case PIX_FMT_YUV422P: - case PIX_FMT_YUVJ422P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUVJ422P: width >>= 1; break; - case PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV411P: width >>= 2; break; default: break; } - if (pix_fmt == PIX_FMT_GRAY8) { + if (pix_fmt == AV_PIX_FMT_GRAY8) { break; } } diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 3f8ed42399..4ca6703429 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -201,7 +201,7 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx){ avcodec_get_frame_defaults(&ic->picture); ic->avctx = avctx; - avctx->pix_fmt= PIX_FMT_YUV410P; + avctx->pix_fmt= AV_PIX_FMT_YUV410P; ir2_vlc.table = vlc_tables; ir2_vlc.table_allocated = 1 << CODE_VLC_BITS; diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index d19c6044ab..4cee28f9de 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -1039,7 +1039,7 @@ static av_cold int decode_init(AVCodecContext *avctx) Indeo3DecodeContext *ctx = avctx->priv_data; ctx->avctx = avctx; - avctx->pix_fmt = PIX_FMT_YUV410P; + avctx->pix_fmt = AV_PIX_FMT_YUV410P; avcodec_get_frame_defaults(&ctx->frame); build_requant_tab(); diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c index d1f62b774a..bb5ec10309 100644 --- a/libavcodec/indeo4.c +++ b/libavcodec/indeo4.c @@ -624,7 +624,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->pic_conf.pic_width = 0; ctx->pic_conf.pic_height = 0; - avctx->pix_fmt = PIX_FMT_YUV410P; + avctx->pix_fmt = AV_PIX_FMT_YUV410P; ctx->decode_pic_hdr = decode_pic_hdr; ctx->decode_band_hdr = decode_band_hdr; diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index fd43e33e9d..423d79b53a 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -660,7 +660,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->switch_buffers = switch_buffers; ctx->is_nonnull_frame = is_nonnull_frame; - avctx->pix_fmt = PIX_FMT_YUV410P; + avctx->pix_fmt = AV_PIX_FMT_YUV410P; return 0; } diff --git a/libavcodec/internal.h b/libavcodec/internal.h index f0114dc200..ed38c61d3c 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -36,7 +36,7 @@ typedef struct InternalBuffer { int linesize[AV_NUM_DATA_POINTERS]; int width; int height; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; uint8_t **extended_data; int audio_data_size; int nb_channels; @@ -99,7 +99,7 @@ struct AVCodecDefault { /** * Determine whether pix_fmt is a hardware accelerated format. */ -int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt); +int ff_is_hwaccel_pix_fmt(enum AVPixelFormat pix_fmt); /** * Return the hardware accelerated codec for codec codec_id and @@ -109,7 +109,7 @@ int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt); * @param pix_fmt the pixel format to match * @return the hardware accelerated codec, or NULL if none was found. */ -AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum PixelFormat pix_fmt); +AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum AVPixelFormat pix_fmt); /** * Return the index into tab at which {a,b} match elements {[0],[1]} of tab. diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 3063b8e1c5..6892936c3d 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -941,7 +941,7 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx) s->avctx = avctx; s->is_16bpp = avctx->bits_per_coded_sample == 16; - avctx->pix_fmt = s->is_16bpp ? PIX_FMT_RGB555 : PIX_FMT_PAL8; + avctx->pix_fmt = s->is_16bpp ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_PAL8; ff_dsputil_init(&s->dsp, avctx); diff --git a/libavcodec/j2kdec.c b/libavcodec/j2kdec.c index b3ba8fc0c9..b2624f9f62 100644 --- a/libavcodec/j2kdec.c +++ b/libavcodec/j2kdec.c @@ -260,20 +260,20 @@ static int get_siz(J2kDecoderContext *s) switch(s->ncomponents){ case 1: if (s->precision > 8) { - s->avctx->pix_fmt = PIX_FMT_GRAY16; + s->avctx->pix_fmt = AV_PIX_FMT_GRAY16; } else { - s->avctx->pix_fmt = PIX_FMT_GRAY8; + s->avctx->pix_fmt = AV_PIX_FMT_GRAY8; } break; case 3: if (s->precision > 8) { - s->avctx->pix_fmt = PIX_FMT_RGB48; + s->avctx->pix_fmt = AV_PIX_FMT_RGB48; } else { - s->avctx->pix_fmt = PIX_FMT_RGB24; + s->avctx->pix_fmt = AV_PIX_FMT_RGB24; } break; case 4: - s->avctx->pix_fmt = PIX_FMT_RGBA; + s->avctx->pix_fmt = AV_PIX_FMT_RGBA; break; } diff --git a/libavcodec/j2kenc.c b/libavcodec/j2kenc.c index 6e4ae16032..0c15fb0bf9 100644 --- a/libavcodec/j2kenc.c +++ b/libavcodec/j2kenc.c @@ -286,7 +286,7 @@ static int put_cod(J2kEncoderContext *s) // SGcod bytestream_put_byte(&s->buf, 0); // progression level bytestream_put_be16(&s->buf, 1); // num of layers - if(s->avctx->pix_fmt == PIX_FMT_YUV444P){ + if(s->avctx->pix_fmt == AV_PIX_FMT_YUV444P){ bytestream_put_byte(&s->buf, 2); // ICT }else{ bytestream_put_byte(&s->buf, 0); // unspecified @@ -1010,9 +1010,9 @@ static av_cold int j2kenc_init(AVCodecContext *avctx) for (i = 0; i < 3; i++) s->cbps[i] = 8; - if (avctx->pix_fmt == PIX_FMT_RGB24){ + if (avctx->pix_fmt == AV_PIX_FMT_RGB24){ s->ncomponents = 3; - } else if (avctx->pix_fmt == PIX_FMT_GRAY8){ + } else if (avctx->pix_fmt == AV_PIX_FMT_GRAY8){ s->ncomponents = 1; } else{ // planar YUV s->planar = 1; @@ -1052,11 +1052,11 @@ AVCodec ff_jpeg2000_encoder = { .close = j2kenc_destroy, .capabilities = CODEC_CAP_EXPERIMENTAL, .long_name = NULL_IF_CONFIG_SMALL("JPEG 2000"), - .pix_fmts = (const enum PixelFormat[]) { - PIX_FMT_RGB24, PIX_FMT_YUV444P, PIX_FMT_GRAY8, -/* PIX_FMT_YUV420P, - PIX_FMT_YUV422P, PIX_FMT_YUV444P, - PIX_FMT_YUV410P, PIX_FMT_YUV411P,*/ - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_RGB24, AV_PIX_FMT_YUV444P, AV_PIX_FMT_GRAY8, +/* AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,*/ + AV_PIX_FMT_NONE } }; diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c index 938ce88a00..180f7c905c 100644 --- a/libavcodec/jpeglsenc.c +++ b/libavcodec/jpeglsenc.c @@ -244,7 +244,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, p->pict_type= AV_PICTURE_TYPE_I; p->key_frame= 1; - if(avctx->pix_fmt == PIX_FMT_GRAY8 || avctx->pix_fmt == PIX_FMT_GRAY16) + if(avctx->pix_fmt == AV_PIX_FMT_GRAY8 || avctx->pix_fmt == AV_PIX_FMT_GRAY16) comps = 1; else comps = 3; @@ -262,7 +262,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, put_marker(&pb, SOI); put_marker(&pb, SOF48); put_bits(&pb, 16, 8 + comps * 3); // header size depends on components - put_bits(&pb, 8, (avctx->pix_fmt == PIX_FMT_GRAY16) ? 16 : 8); // bpp + put_bits(&pb, 8, (avctx->pix_fmt == AV_PIX_FMT_GRAY16) ? 16 : 8); // bpp put_bits(&pb, 16, avctx->height); put_bits(&pb, 16, avctx->width); put_bits(&pb, 8, comps); // components @@ -286,7 +286,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, state = av_mallocz(sizeof(JLSState)); /* initialize JPEG-LS state from JPEG parameters */ state->near = near; - state->bpp = (avctx->pix_fmt == PIX_FMT_GRAY16) ? 16 : 8; + state->bpp = (avctx->pix_fmt == AV_PIX_FMT_GRAY16) ? 16 : 8; ff_jpegls_reset_coding_parameters(state, 0); ff_jpegls_init_state(state); @@ -297,7 +297,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, return AVERROR(ENOMEM); last = zero; cur = p->data[0]; - if(avctx->pix_fmt == PIX_FMT_GRAY8){ + if(avctx->pix_fmt == AV_PIX_FMT_GRAY8){ int t = 0; for(i = 0; i < avctx->height; i++) { @@ -306,7 +306,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, last = cur; cur += p->linesize[0]; } - }else if(avctx->pix_fmt == PIX_FMT_GRAY16){ + }else if(avctx->pix_fmt == AV_PIX_FMT_GRAY16){ int t = 0; for(i = 0; i < avctx->height; i++) { @@ -315,7 +315,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, last = cur; cur += p->linesize[0]; } - }else if(avctx->pix_fmt == PIX_FMT_RGB24){ + }else if(avctx->pix_fmt == AV_PIX_FMT_RGB24){ int j, width; int Rc[3] = {0, 0, 0}; @@ -328,7 +328,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt, last = cur; cur += s->picture.linesize[0]; } - }else if(avctx->pix_fmt == PIX_FMT_BGR24){ + }else if(avctx->pix_fmt == AV_PIX_FMT_BGR24){ int j, width; int Rc[3] = {0, 0, 0}; @@ -385,7 +385,7 @@ static av_cold int encode_init_ls(AVCodecContext *ctx) { c->avctx = ctx; ctx->coded_frame = &c->picture; - if(ctx->pix_fmt != PIX_FMT_GRAY8 && ctx->pix_fmt != PIX_FMT_GRAY16 && ctx->pix_fmt != PIX_FMT_RGB24 && ctx->pix_fmt != PIX_FMT_BGR24){ + if(ctx->pix_fmt != AV_PIX_FMT_GRAY8 && ctx->pix_fmt != AV_PIX_FMT_GRAY16 && ctx->pix_fmt != AV_PIX_FMT_RGB24 && ctx->pix_fmt != AV_PIX_FMT_BGR24){ av_log(ctx, AV_LOG_ERROR, "Only grayscale and RGB24/BGR24 images are supported\n"); return -1; } @@ -399,9 +399,9 @@ AVCodec ff_jpegls_encoder = { .priv_data_size = sizeof(JpeglsContext), .init = encode_init_ls, .encode2 = encode_picture_ls, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_BGR24, PIX_FMT_RGB24, PIX_FMT_GRAY8, PIX_FMT_GRAY16, - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"), }; diff --git a/libavcodec/jvdec.c b/libavcodec/jvdec.c index 81345f29ea..cec28cceae 100644 --- a/libavcodec/jvdec.c +++ b/libavcodec/jvdec.c @@ -40,7 +40,7 @@ typedef struct JvContext { static av_cold int decode_init(AVCodecContext *avctx) { JvContext *s = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; ff_dsputil_init(&s->dsp, avctx); return 0; } diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index d416661dcd..1cbd1c3489 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -169,7 +169,7 @@ static av_cold int decode_init(AVCodecContext *avctx) KgvContext * const c = avctx->priv_data; c->avctx = avctx; - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; avctx->flags |= CODEC_FLAG_EMU_EDGE; return 0; diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index cde410e5e1..59ae9f2672 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -415,7 +415,7 @@ static av_cold int decode_init(AVCodecContext * avctx) } avcodec_get_frame_defaults(&c->pic); - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c index 261e39c21f..6af0d09dc5 100644 --- a/libavcodec/lagarith.c +++ b/libavcodec/lagarith.c @@ -259,7 +259,7 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf, if (line == 1) { /* Second line, left predict first pixel, the rest of the line is median predicted * NOTE: In the case of RGB this pixel is top predicted */ - TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L; + TL = l->avctx->pix_fmt == AV_PIX_FMT_YUV420P ? buf[-stride] : L; } else { /* Top left is 2 rows back, last pixel */ TL = buf[width - (2 * stride) - 1]; @@ -482,7 +482,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst, return -1; } - if (l->avctx->pix_fmt != PIX_FMT_YUV422P) { + if (l->avctx->pix_fmt != AV_PIX_FMT_YUV422P) { for (i = 0; i < height; i++) { lag_pred_line(l, dst, width, stride, i); dst += stride; @@ -534,7 +534,7 @@ static int lag_decode_frame(AVCodecContext *avctx, switch (frametype) { case FRAME_SOLID_RGBA: - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; if (ff_thread_get_buffer(avctx, p) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); @@ -549,14 +549,14 @@ static int lag_decode_frame(AVCodecContext *avctx, } break; case FRAME_ARITH_RGBA: - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; planes = 4; offset_ry += 4; offs[3] = AV_RL32(buf + 9); case FRAME_ARITH_RGB24: case FRAME_U_RGB24: if (frametype == FRAME_ARITH_RGB24 || frametype == FRAME_U_RGB24) - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; if (ff_thread_get_buffer(avctx, p) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); @@ -615,7 +615,7 @@ static int lag_decode_frame(AVCodecContext *avctx, } break; case FRAME_ARITH_YUY2: - avctx->pix_fmt = PIX_FMT_YUV422P; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; if (ff_thread_get_buffer(avctx, p) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); @@ -641,7 +641,7 @@ static int lag_decode_frame(AVCodecContext *avctx, buf + offset_bv, buf_size - offset_bv); break; case FRAME_ARITH_YV12: - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; if (ff_thread_get_buffer(avctx, p) < 0) { av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index f180373eae..ab188e28da 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -502,37 +502,37 @@ static av_cold int decode_init(AVCodecContext *avctx) case IMGTYPE_YUV111: c->decomp_size = basesize * 3; max_decomp_size = max_basesize * 3; - avctx->pix_fmt = PIX_FMT_YUV444P; + avctx->pix_fmt = AV_PIX_FMT_YUV444P; av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 1:1:1.\n"); break; case IMGTYPE_YUV422: c->decomp_size = basesize * 2; max_decomp_size = max_basesize * 2; - avctx->pix_fmt = PIX_FMT_YUV422P; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:2.\n"); break; case IMGTYPE_RGB24: c->decomp_size = basesize * 3; max_decomp_size = max_basesize * 3; - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; av_log(avctx, AV_LOG_DEBUG, "Image type is RGB 24.\n"); break; case IMGTYPE_YUV411: c->decomp_size = basesize / 2 * 3; max_decomp_size = max_basesize / 2 * 3; - avctx->pix_fmt = PIX_FMT_YUV411P; + avctx->pix_fmt = AV_PIX_FMT_YUV411P; av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:1:1.\n"); break; case IMGTYPE_YUV211: c->decomp_size = basesize * 2; max_decomp_size = max_basesize * 2; - avctx->pix_fmt = PIX_FMT_YUV422P; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 2:1:1.\n"); break; case IMGTYPE_YUV420: c->decomp_size = basesize / 2 * 3; max_decomp_size = max_basesize / 2 * 3; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:0.\n"); break; default: diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c index af5d6de072..1702136172 100644 --- a/libavcodec/lclenc.c +++ b/libavcodec/lclenc.c @@ -88,7 +88,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, p->pict_type= AV_PICTURE_TYPE_I; p->key_frame= 1; - if(avctx->pix_fmt != PIX_FMT_BGR24){ + if(avctx->pix_fmt != AV_PIX_FMT_BGR24){ av_log(avctx, AV_LOG_ERROR, "Format not supported!\n"); return -1; } @@ -191,6 +191,6 @@ AVCodec ff_zlib_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_BGR24, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"), }; diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 9f01afd1ab..279809849f 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -40,21 +40,21 @@ // pix_fmts with lower bpp have to be listed before // similar pix_fmts with higher bpp. -#define RGB_PIXEL_FORMATS PIX_FMT_RGB24,PIX_FMT_RGBA,PIX_FMT_RGB48,PIX_FMT_RGBA64 -#define GRAY_PIXEL_FORMATS PIX_FMT_GRAY8,PIX_FMT_GRAY8A,PIX_FMT_GRAY16 -#define YUV_PIXEL_FORMATS PIX_FMT_YUV410P,PIX_FMT_YUV411P,PIX_FMT_YUVA420P, \ - PIX_FMT_YUV420P,PIX_FMT_YUV422P,PIX_FMT_YUVA422P, \ - PIX_FMT_YUV440P,PIX_FMT_YUV444P,PIX_FMT_YUVA444P, \ - PIX_FMT_YUV420P9,PIX_FMT_YUV422P9,PIX_FMT_YUV444P9, \ - PIX_FMT_YUV420P10,PIX_FMT_YUV422P10,PIX_FMT_YUV444P10, \ - PIX_FMT_YUV420P12,PIX_FMT_YUV422P12,PIX_FMT_YUV444P12, \ - PIX_FMT_YUV420P14,PIX_FMT_YUV422P14,PIX_FMT_YUV444P14, \ - PIX_FMT_YUV420P16,PIX_FMT_YUV422P16,PIX_FMT_YUV444P16 - -static const enum PixelFormat libopenjpeg_rgb_pix_fmts[] = {RGB_PIXEL_FORMATS}; -static const enum PixelFormat libopenjpeg_gray_pix_fmts[] = {GRAY_PIXEL_FORMATS}; -static const enum PixelFormat libopenjpeg_yuv_pix_fmts[] = {YUV_PIXEL_FORMATS}; -static const enum PixelFormat libopenjpeg_all_pix_fmts[] = {RGB_PIXEL_FORMATS,GRAY_PIXEL_FORMATS,YUV_PIXEL_FORMATS}; +#define RGB_PIXEL_FORMATS AV_PIX_FMT_RGB24,AV_PIX_FMT_RGBA,AV_PIX_FMT_RGB48,AV_PIX_FMT_RGBA64 +#define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8,AV_PIX_FMT_GRAY8A,AV_PIX_FMT_GRAY16 +#define YUV_PIXEL_FORMATS AV_PIX_FMT_YUV410P,AV_PIX_FMT_YUV411P,AV_PIX_FMT_YUVA420P, \ + AV_PIX_FMT_YUV420P,AV_PIX_FMT_YUV422P,AV_PIX_FMT_YUVA422P, \ + AV_PIX_FMT_YUV440P,AV_PIX_FMT_YUV444P,AV_PIX_FMT_YUVA444P, \ + AV_PIX_FMT_YUV420P9,AV_PIX_FMT_YUV422P9,AV_PIX_FMT_YUV444P9, \ + AV_PIX_FMT_YUV420P10,AV_PIX_FMT_YUV422P10,AV_PIX_FMT_YUV444P10, \ + AV_PIX_FMT_YUV420P12,AV_PIX_FMT_YUV422P12,AV_PIX_FMT_YUV444P12, \ + AV_PIX_FMT_YUV420P14,AV_PIX_FMT_YUV422P14,AV_PIX_FMT_YUV444P14, \ + AV_PIX_FMT_YUV420P16,AV_PIX_FMT_YUV422P16,AV_PIX_FMT_YUV444P16 + +static const enum AVPixelFormat libopenjpeg_rgb_pix_fmts[] = {RGB_PIXEL_FORMATS}; +static const enum AVPixelFormat libopenjpeg_gray_pix_fmts[] = {GRAY_PIXEL_FORMATS}; +static const enum AVPixelFormat libopenjpeg_yuv_pix_fmts[] = {YUV_PIXEL_FORMATS}; +static const enum AVPixelFormat libopenjpeg_all_pix_fmts[] = {RGB_PIXEL_FORMATS,GRAY_PIXEL_FORMATS,YUV_PIXEL_FORMATS}; typedef struct { AVClass *class; @@ -63,7 +63,7 @@ typedef struct { int lowqual; } LibOpenJPEGContext; -static inline int libopenjpeg_matches_pix_fmt(const opj_image_t *image, enum PixelFormat pix_fmt) +static inline int libopenjpeg_matches_pix_fmt(const opj_image_t *image, enum AVPixelFormat pix_fmt) { AVPixFmtDescriptor descriptor = av_pix_fmt_descriptors[pix_fmt]; int match = 1; @@ -92,9 +92,9 @@ static inline int libopenjpeg_matches_pix_fmt(const opj_image_t *image, enum Pix return match; } -static inline enum PixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *image) { +static inline enum AVPixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *image) { int index; - const enum PixelFormat *possible_fmts = NULL; + const enum AVPixelFormat *possible_fmts = NULL; int possible_fmts_nb = 0; switch (image->color_space) { @@ -122,13 +122,13 @@ static inline enum PixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *imag } } - return PIX_FMT_NONE; + return AV_PIX_FMT_NONE; } -static inline int libopenjpeg_ispacked(enum PixelFormat pix_fmt) { +static inline int libopenjpeg_ispacked(enum AVPixelFormat pix_fmt) { int i, component_plane; - if (pix_fmt == PIX_FMT_GRAY16) + if (pix_fmt == AV_PIX_FMT_GRAY16) return 0; component_plane = av_pix_fmt_descriptors[pix_fmt].comp[0].plane; @@ -294,14 +294,14 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, avcodec_set_dimensions(avctx, width, height); - if (avctx->pix_fmt != PIX_FMT_NONE) + if (avctx->pix_fmt != AV_PIX_FMT_NONE) if (!libopenjpeg_matches_pix_fmt(image, avctx->pix_fmt)) - avctx->pix_fmt = PIX_FMT_NONE; + avctx->pix_fmt = AV_PIX_FMT_NONE; - if (avctx->pix_fmt == PIX_FMT_NONE) + if (avctx->pix_fmt == AV_PIX_FMT_NONE) avctx->pix_fmt = libopenjpeg_guess_pix_fmt(image); - if (avctx->pix_fmt == PIX_FMT_NONE) { + if (avctx->pix_fmt == AV_PIX_FMT_NONE) { av_log(avctx, AV_LOG_ERROR, "Unable to determine pixel format\n"); goto done; } diff --git a/libavcodec/libopenjpegenc.c b/libavcodec/libopenjpegenc.c index e97dd2b390..0e4a257f11 100644 --- a/libavcodec/libopenjpegenc.c +++ b/libavcodec/libopenjpegenc.c @@ -85,41 +85,41 @@ static opj_image_t *mj2_create_image(AVCodecContext *avctx, opj_cparameters_t *p numcomps = av_pix_fmt_descriptors[avctx->pix_fmt].nb_components; switch (avctx->pix_fmt) { - case PIX_FMT_GRAY8: - case PIX_FMT_GRAY8A: - case PIX_FMT_GRAY16: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8A: + case AV_PIX_FMT_GRAY16: color_space = CLRSPC_GRAY; break; - case PIX_FMT_RGB24: - case PIX_FMT_RGBA: - case PIX_FMT_RGB48: - case PIX_FMT_RGBA64: + case AV_PIX_FMT_RGB24: + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_RGB48: + case AV_PIX_FMT_RGBA64: color_space = CLRSPC_SRGB; break; - case PIX_FMT_YUV410P: - case PIX_FMT_YUV411P: - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV440P: - case PIX_FMT_YUV444P: - case PIX_FMT_YUVA420P: - case PIX_FMT_YUVA422P: - case PIX_FMT_YUVA444P: - case PIX_FMT_YUV420P9: - case PIX_FMT_YUV422P9: - case PIX_FMT_YUV444P9: - case PIX_FMT_YUV420P10: - case PIX_FMT_YUV422P10: - case PIX_FMT_YUV444P10: - case PIX_FMT_YUV420P12: - case PIX_FMT_YUV422P12: - case PIX_FMT_YUV444P12: - case PIX_FMT_YUV420P14: - case PIX_FMT_YUV422P14: - case PIX_FMT_YUV444P14: - case PIX_FMT_YUV420P16: - case PIX_FMT_YUV422P16: - case PIX_FMT_YUV444P16: + case AV_PIX_FMT_YUV410P: + case AV_PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV440P: + case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_YUVA420P: + case AV_PIX_FMT_YUVA422P: + case AV_PIX_FMT_YUVA444P: + case AV_PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV422P9: + case AV_PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV420P10: + case AV_PIX_FMT_YUV422P10: + case AV_PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV420P12: + case AV_PIX_FMT_YUV422P12: + case AV_PIX_FMT_YUV444P12: + case AV_PIX_FMT_YUV420P14: + case AV_PIX_FMT_YUV422P14: + case AV_PIX_FMT_YUV444P14: + case AV_PIX_FMT_YUV420P16: + case AV_PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV444P16: color_space = CLRSPC_SYCC; break; default: @@ -345,43 +345,43 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt, image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1; switch (avctx->pix_fmt) { - case PIX_FMT_RGB24: - case PIX_FMT_RGBA: - case PIX_FMT_GRAY8A: + case AV_PIX_FMT_RGB24: + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_GRAY8A: cpyresult = libopenjpeg_copy_packed8(avctx, frame, image); break; - case PIX_FMT_RGB48: - case PIX_FMT_RGBA64: + case AV_PIX_FMT_RGB48: + case AV_PIX_FMT_RGBA64: cpyresult = libopenjpeg_copy_packed16(avctx, frame, image); break; - case PIX_FMT_GRAY8: - case PIX_FMT_YUV410P: - case PIX_FMT_YUV411P: - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV440P: - case PIX_FMT_YUV444P: - case PIX_FMT_YUVA420P: - case PIX_FMT_YUVA422P: - case PIX_FMT_YUVA444P: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_YUV410P: + case AV_PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV440P: + case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_YUVA420P: + case AV_PIX_FMT_YUVA422P: + case AV_PIX_FMT_YUVA444P: cpyresult = libopenjpeg_copy_unpacked8(avctx, frame, image); break; - case PIX_FMT_GRAY16: - case PIX_FMT_YUV420P9: - case PIX_FMT_YUV422P9: - case PIX_FMT_YUV444P9: - case PIX_FMT_YUV444P10: - case PIX_FMT_YUV422P10: - case PIX_FMT_YUV420P10: - case PIX_FMT_YUV420P12: - case PIX_FMT_YUV422P12: - case PIX_FMT_YUV444P12: - case PIX_FMT_YUV420P14: - case PIX_FMT_YUV422P14: - case PIX_FMT_YUV444P14: - case PIX_FMT_YUV444P16: - case PIX_FMT_YUV422P16: - case PIX_FMT_YUV420P16: + case AV_PIX_FMT_GRAY16: + case AV_PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV422P9: + case AV_PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV422P10: + case AV_PIX_FMT_YUV420P10: + case AV_PIX_FMT_YUV420P12: + case AV_PIX_FMT_YUV422P12: + case AV_PIX_FMT_YUV444P12: + case AV_PIX_FMT_YUV420P14: + case AV_PIX_FMT_YUV422P14: + case AV_PIX_FMT_YUV444P14: + case AV_PIX_FMT_YUV444P16: + case AV_PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV420P16: cpyresult = libopenjpeg_copy_unpacked16(avctx, frame, image); break; default: @@ -479,18 +479,18 @@ AVCodec ff_libopenjpeg_encoder = { .encode2 = libopenjpeg_encode_frame, .close = libopenjpeg_encode_close, .capabilities = 0, - .pix_fmts = (const enum PixelFormat[]) { - PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_RGB48, PIX_FMT_RGBA64, - PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_GRAY16, - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUVA420P, - PIX_FMT_YUV440P, PIX_FMT_YUV444P, PIX_FMT_YUVA422P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUVA444P, - PIX_FMT_YUV420P9, PIX_FMT_YUV422P9, PIX_FMT_YUV444P9, - PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, PIX_FMT_YUV444P10, - PIX_FMT_YUV420P12, PIX_FMT_YUV422P12, PIX_FMT_YUV444P12, - PIX_FMT_YUV420P14, PIX_FMT_YUV422P14, PIX_FMT_YUV444P14, - PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48, AV_PIX_FMT_RGBA64, + AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, AV_PIX_FMT_GRAY16, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA422P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA444P, + AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9, + AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, + AV_PIX_FMT_YUV420P12, AV_PIX_FMT_YUV422P12, AV_PIX_FMT_YUV444P12, + AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14, + AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"), .priv_class = &class, diff --git a/libavcodec/libschroedinger.h b/libavcodec/libschroedinger.h index df8ab985be..f2e513b551 100644 --- a/libavcodec/libschroedinger.h +++ b/libavcodec/libschroedinger.h @@ -101,13 +101,13 @@ void *ff_schro_queue_pop(FFSchroQueue *queue); void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *)); static const struct { - enum PixelFormat ff_pix_fmt; + enum AVPixelFormat ff_pix_fmt; SchroChromaFormat schro_pix_fmt; SchroFrameFormat schro_frame_fmt; } schro_pixel_format_map[] = { - { PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 }, - { PIX_FMT_YUV422P, SCHRO_CHROMA_422, SCHRO_FRAME_FORMAT_U8_422 }, - { PIX_FMT_YUV444P, SCHRO_CHROMA_444, SCHRO_FRAME_FORMAT_U8_444 }, + { AV_PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 }, + { AV_PIX_FMT_YUV422P, SCHRO_CHROMA_422, SCHRO_FRAME_FORMAT_U8_422 }, + { AV_PIX_FMT_YUV444P, SCHRO_CHROMA_444, SCHRO_FRAME_FORMAT_U8_444 }, }; /** diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c index 61e7dcb6ab..4e523dcdf6 100644 --- a/libavcodec/libschroedingerdec.c +++ b/libavcodec/libschroedingerdec.c @@ -134,7 +134,7 @@ static SchroBuffer *find_next_parse_unit(SchroParseUnitContext *parse_ctx) /** * Returns FFmpeg chroma format. */ -static enum PixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt) +static enum AVPixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt) { int num_formats = sizeof(schro_pixel_format_map) / sizeof(schro_pixel_format_map[0]); @@ -143,7 +143,7 @@ static enum PixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt) for (idx = 0; idx < num_formats; ++idx) if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt) return schro_pixel_format_map[idx].ff_pix_fmt; - return PIX_FMT_NONE; + return AV_PIX_FMT_NONE; } static av_cold int libschroedinger_decode_init(AVCodecContext *avccontext) diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c index 447661c3e4..aed7818567 100644 --- a/libavcodec/libschroedingerenc.c +++ b/libavcodec/libschroedingerenc.c @@ -443,8 +443,8 @@ AVCodec ff_libschroedinger_encoder = { .encode2 = libschroedinger_encode_frame, .close = libschroedinger_encode_close, .capabilities = CODEC_CAP_DELAY, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"), }; diff --git a/libavcodec/libstagefright.cpp b/libavcodec/libstagefright.cpp index cdea8e41e7..3c1852715a 100644 --- a/libavcodec/libstagefright.cpp +++ b/libavcodec/libstagefright.cpp @@ -325,13 +325,13 @@ static av_cold int Stagefright_init(AVCodecContext *avctx) outFormat->findInt32(kKeyColorFormat, &colorFormat); if (colorFormat == OMX_QCOM_COLOR_FormatYVU420SemiPlanar || colorFormat == OMX_COLOR_FormatYUV420SemiPlanar) - avctx->pix_fmt = PIX_FMT_NV21; + avctx->pix_fmt = AV_PIX_FMT_NV21; else if (colorFormat == OMX_COLOR_FormatYCbYCr) - avctx->pix_fmt = PIX_FMT_YUYV422; + avctx->pix_fmt = AV_PIX_FMT_YUYV422; else if (colorFormat == OMX_COLOR_FormatCbYCrY) - avctx->pix_fmt = PIX_FMT_UYVY422; + avctx->pix_fmt = AV_PIX_FMT_UYVY422; else - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; outFormat->findCString(kKeyDecoderComponent, &s->decoder_component); if (s->decoder_component) diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index 2d4ec6e7a2..431fa57994 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -187,11 +187,11 @@ static av_cold int encode_init(AVCodecContext* avc_context) else t_info.colorspace = TH_CS_UNSPECIFIED; - if (avc_context->pix_fmt == PIX_FMT_YUV420P) + if (avc_context->pix_fmt == AV_PIX_FMT_YUV420P) t_info.pixel_fmt = TH_PF_420; - else if (avc_context->pix_fmt == PIX_FMT_YUV422P) + else if (avc_context->pix_fmt == AV_PIX_FMT_YUV422P) t_info.pixel_fmt = TH_PF_422; - else if (avc_context->pix_fmt == PIX_FMT_YUV444P) + else if (avc_context->pix_fmt == AV_PIX_FMT_YUV444P) t_info.pixel_fmt = TH_PF_444; else { av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n"); @@ -368,8 +368,8 @@ AVCodec ff_libtheora_encoder = { .close = encode_close, .encode2 = encode_frame, .capabilities = CODEC_CAP_DELAY, // needed to get the statsfile summary - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"), }; diff --git a/libavcodec/libutvideodec.cpp b/libavcodec/libutvideodec.cpp index 4f5b91f02e..f4ba8b3bda 100644 --- a/libavcodec/libutvideodec.cpp +++ b/libavcodec/libutvideodec.cpp @@ -52,19 +52,19 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx) /* Pick format based on FOURCC */ switch (avctx->codec_tag) { case MKTAG('U', 'L', 'Y', '0'): - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; format = UTVF_YV12; break; case MKTAG('U', 'L', 'Y', '2'): - avctx->pix_fmt = PIX_FMT_YUYV422; + avctx->pix_fmt = AV_PIX_FMT_YUYV422; format = UTVF_YUY2; break; case MKTAG('U', 'L', 'R', 'G'): - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; format = UTVF_RGB24_WIN; break; case MKTAG('U', 'L', 'R', 'A'): - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; format = UTVF_RGB32_WIN; break; default: @@ -131,21 +131,21 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data, /* Set the output data depending on the colorspace */ switch (avctx->pix_fmt) { - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: pic->linesize[0] = w; pic->linesize[1] = pic->linesize[2] = w / 2; pic->data[0] = utv->buffer; pic->data[2] = utv->buffer + (w * h); pic->data[1] = pic->data[2] + (w * h / 4); break; - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: pic->linesize[0] = w * 2; pic->data[0] = utv->buffer; break; - case PIX_FMT_BGR24: - case PIX_FMT_RGB32: + case AV_PIX_FMT_BGR24: + case AV_PIX_FMT_RGB32: /* Make the linesize negative, since Ut Video uses bottom-up BGR */ - pic->linesize[0] = -1 * w * (avctx->pix_fmt == PIX_FMT_BGR24 ? 3 : 4); + pic->linesize[0] = -1 * w * (avctx->pix_fmt == AV_PIX_FMT_BGR24 ? 3 : 4); pic->data[0] = utv->buffer + utv->buf_size + pic->linesize[0]; break; } diff --git a/libavcodec/libutvideoenc.cpp b/libavcodec/libutvideoenc.cpp index 989339a279..e9af7dfc90 100644 --- a/libavcodec/libutvideoenc.cpp +++ b/libavcodec/libutvideoenc.cpp @@ -40,22 +40,22 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) uint32_t flags, in_format; switch (avctx->pix_fmt) { - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: in_format = UTVF_YV12; avctx->bits_per_coded_sample = 12; avctx->codec_tag = MKTAG('U', 'L', 'Y', '0'); break; - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: in_format = UTVF_YUYV; avctx->bits_per_coded_sample = 16; avctx->codec_tag = MKTAG('U', 'L', 'Y', '2'); break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: in_format = UTVF_RGB24_WIN; avctx->bits_per_coded_sample = 24; avctx->codec_tag = MKTAG('U', 'L', 'R', 'G'); break; - case PIX_FMT_RGB32: + case AV_PIX_FMT_RGB32: in_format = UTVF_RGB32_WIN; avctx->bits_per_coded_sample = 32; avctx->codec_tag = MKTAG('U', 'L', 'R', 'A'); @@ -137,7 +137,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, /* Move input if needed data into Ut Video friendly buffer */ switch (avctx->pix_fmt) { - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: y = utv->buffer; u = y + w * h; v = u + w * h / 4; @@ -152,15 +152,15 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, v += w >> 1; } break; - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: for (i = 0; i < h; i++) memcpy(utv->buffer + i * (w << 1), pic->data[0] + i * pic->linesize[0], w << 1); break; - case PIX_FMT_BGR24: - case PIX_FMT_RGB32: + case AV_PIX_FMT_BGR24: + case AV_PIX_FMT_RGB32: /* Ut Video takes bottom-up BGR */ - rgb_size = avctx->pix_fmt == PIX_FMT_BGR24 ? 3 : 4; + rgb_size = avctx->pix_fmt == AV_PIX_FMT_BGR24 ? 3 : 4; for (i = 0; i < h; i++) memcpy(utv->buffer + (h - i - 1) * w * rgb_size, pic->data[0] + i * pic->linesize[0], @@ -214,9 +214,9 @@ AVCodec ff_libutvideo_encoder = { AV_CODEC_ID_UTVIDEO, CODEC_CAP_AUTO_THREADS | CODEC_CAP_LOSSLESS, NULL, /* supported_framerates */ - (const enum PixelFormat[]) { - PIX_FMT_YUV420P, PIX_FMT_YUYV422, PIX_FMT_BGR24, - PIX_FMT_RGB32, PIX_FMT_NONE + (const enum AVPixelFormat[]) { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUYV422, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE }, NULL, /* supported_samplerates */ NULL, /* sample_fmts */ diff --git a/libavcodec/libvpxdec.c b/libavcodec/libvpxdec.c index c0f9f36df1..61dbaa7998 100644 --- a/libavcodec/libvpxdec.c +++ b/libavcodec/libvpxdec.c @@ -54,7 +54,7 @@ static av_cold int vp8_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; return 0; } diff --git a/libavcodec/libvpxenc.c b/libavcodec/libvpxenc.c index cf51838bd8..2c9ae9ec9b 100644 --- a/libavcodec/libvpxenc.c +++ b/libavcodec/libvpxenc.c @@ -630,7 +630,7 @@ AVCodec ff_libvpx_encoder = { .encode2 = vp8_encode, .close = vp8_free, .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"), .priv_class = &class, .defaults = defaults, diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index a2d64d1977..8765e56d02 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -132,15 +132,15 @@ static int encode_nals(AVCodecContext *ctx, AVPacket *pkt, static int avfmt2_num_planes(int avfmt) { switch (avfmt) { - case PIX_FMT_YUV420P: - case PIX_FMT_YUVJ420P: - case PIX_FMT_YUV420P9: - case PIX_FMT_YUV420P10: - case PIX_FMT_YUV444P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUVJ420P: + case AV_PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV420P10: + case AV_PIX_FMT_YUV444P: return 3; - case PIX_FMT_BGR24: - case PIX_FMT_RGB24: + case AV_PIX_FMT_BGR24: + case AV_PIX_FMT_RGB24: return 1; default: @@ -247,23 +247,23 @@ static av_cold int X264_close(AVCodecContext *avctx) } \ } while (0) -static int convert_pix_fmt(enum PixelFormat pix_fmt) +static int convert_pix_fmt(enum AVPixelFormat pix_fmt) { switch (pix_fmt) { - case PIX_FMT_YUV420P: - case PIX_FMT_YUVJ420P: - case PIX_FMT_YUV420P9: - case PIX_FMT_YUV420P10: return X264_CSP_I420; - case PIX_FMT_YUV422P: - case PIX_FMT_YUV422P10: return X264_CSP_I422; - case PIX_FMT_YUV444P: - case PIX_FMT_YUV444P9: - case PIX_FMT_YUV444P10: return X264_CSP_I444; + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUVJ420P: + case AV_PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV420P10: return X264_CSP_I420; + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P10: return X264_CSP_I422; + case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV444P10: return X264_CSP_I444; #ifdef X264_CSP_BGR - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: return X264_CSP_BGR; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: return X264_CSP_RGB; #endif }; @@ -517,7 +517,7 @@ static av_cold int X264_init(AVCodecContext *avctx) x4->params.i_slice_count = avctx->slices; - x4->params.vui.b_fullrange = avctx->pix_fmt == PIX_FMT_YUVJ420P; + x4->params.vui.b_fullrange = avctx->pix_fmt == AV_PIX_FMT_YUVJ420P; if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER) x4->params.b_repeat_headers = 0; @@ -562,30 +562,30 @@ static av_cold int X264_init(AVCodecContext *avctx) return 0; } -static const enum PixelFormat pix_fmts_8bit[] = { - PIX_FMT_YUV420P, - PIX_FMT_YUVJ420P, - PIX_FMT_YUV422P, - PIX_FMT_YUV444P, - PIX_FMT_NONE +static const enum AVPixelFormat pix_fmts_8bit[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_NONE }; -static const enum PixelFormat pix_fmts_9bit[] = { - PIX_FMT_YUV420P9, - PIX_FMT_YUV444P9, - PIX_FMT_NONE +static const enum AVPixelFormat pix_fmts_9bit[] = { + AV_PIX_FMT_YUV420P9, + AV_PIX_FMT_YUV444P9, + AV_PIX_FMT_NONE }; -static const enum PixelFormat pix_fmts_10bit[] = { - PIX_FMT_YUV420P10, - PIX_FMT_YUV422P10, - PIX_FMT_YUV444P10, - PIX_FMT_NONE +static const enum AVPixelFormat pix_fmts_10bit[] = { + AV_PIX_FMT_YUV420P10, + AV_PIX_FMT_YUV422P10, + AV_PIX_FMT_YUV444P10, + AV_PIX_FMT_NONE }; -static const enum PixelFormat pix_fmts_8bit_rgb[] = { +static const enum AVPixelFormat pix_fmts_8bit_rgb[] = { #ifdef X264_CSP_BGR - PIX_FMT_BGR24, - PIX_FMT_RGB24, + AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB24, #endif - PIX_FMT_NONE + AV_PIX_FMT_NONE }; static av_cold void X264_init_static(AVCodec *codec) diff --git a/libavcodec/libxavs.c b/libavcodec/libxavs.c index 4d51c8ee64..442fc0eea4 100644 --- a/libavcodec/libxavs.c +++ b/libavcodec/libxavs.c @@ -425,7 +425,7 @@ AVCodec ff_libxavs_encoder = { .encode2 = XAVS_frame, .close = XAVS_close, .capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"), .priv_class = &class, .defaults = xavs_defaults, diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c index a76dfc187d..fa3be7c51f 100644 --- a/libavcodec/libxvid.c +++ b/libavcodec/libxvid.c @@ -656,7 +656,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt, xvid_enc_frame.length = pkt->size; /* Initialize input image fields */ - if( avctx->pix_fmt != PIX_FMT_YUV420P ) { + if( avctx->pix_fmt != AV_PIX_FMT_YUV420P ) { av_log(avctx, AV_LOG_ERROR, "Xvid: Color spaces other than 420p not supported\n"); return -1; } @@ -783,6 +783,6 @@ AVCodec ff_libxvid_encoder = { .init = xvid_encode_init, .encode2 = xvid_encode_frame, .close = xvid_encode_close, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"), }; diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c index 8703a6efdd..d3c292123e 100644 --- a/libavcodec/ljpegenc.c +++ b/libavcodec/ljpegenc.c @@ -51,7 +51,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt, const int mb_height = (height + s->mjpeg_vsample[0] - 1) / s->mjpeg_vsample[0]; int ret, max_pkt_size = FF_MIN_BUFFER_SIZE; - if (avctx->pix_fmt == PIX_FMT_BGRA) + if (avctx->pix_fmt == AV_PIX_FMT_BGRA) max_pkt_size += width * height * 3 * 4; else { max_pkt_size += mb_width * mb_height * 3 * 4 @@ -70,9 +70,9 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt, s->header_bits= put_bits_count(&s->pb); - if(avctx->pix_fmt == PIX_FMT_BGR0 - || avctx->pix_fmt == PIX_FMT_BGRA - || avctx->pix_fmt == PIX_FMT_BGR24){ + if(avctx->pix_fmt == AV_PIX_FMT_BGR0 + || avctx->pix_fmt == AV_PIX_FMT_BGRA + || avctx->pix_fmt == AV_PIX_FMT_BGR24){ int x, y, i; const int linesize= p->linesize[0]; uint16_t (*buffer)[4]= (void *) s->rd_scratchpad; @@ -95,7 +95,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt, top[i]= left[i]= topleft[i]= buffer[0][i]; } for(x = 0; x < width; x++) { - if(avctx->pix_fmt == PIX_FMT_BGR24){ + if(avctx->pix_fmt == AV_PIX_FMT_BGR24){ buffer[x][1] = ptr[3*x+0] - ptr[3*x+1] + 0x100; buffer[x][2] = ptr[3*x+2] - ptr[3*x+1] + 0x100; buffer[x][0] = (ptr[3*x+0] + 2*ptr[3*x+1] + ptr[3*x+2])>>2; @@ -218,10 +218,10 @@ AVCodec ff_ljpeg_encoder = { //FIXME avoid MPV_* lossless JPEG should not need t .init = ff_MPV_encode_init, .encode2 = encode_picture_lossless, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_BGR0, - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR0, + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("Lossless JPEG"), }; diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 3b22b66859..53bdb58b48 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -262,16 +262,16 @@ static av_cold int decode_init(AVCodecContext *avctx){ l->mode = AV_RL32(avctx->extradata + 4); switch(l->mode) { case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY: - avctx->pix_fmt = PIX_FMT_YUV422P; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; break; case LOCO_CRGB: case LOCO_RGB: - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; break; case LOCO_CYV12: case LOCO_YV12: - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; break; case LOCO_CRGBA: case LOCO_RGBA: - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; break; default: av_log(avctx, AV_LOG_INFO, "Unknown colorspace, index = %i\n", l->mode); diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 4d9ee4d552..52b9040a39 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -236,7 +236,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ avctx->idct_algo = FF_IDCT_SIMPLE; p->qstride= 0; p->qscale_table= av_mallocz(a->mb_width); - avctx->pix_fmt= PIX_FMT_YUVJ420P; + avctx->pix_fmt= AV_PIX_FMT_YUVJ420P; return 0; } diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 93d0bbcb5e..25db9ca1ae 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -340,7 +340,7 @@ static int mimic_decode_frame(AVCodecContext *avctx, void *data, ctx->avctx = avctx; avctx->width = width; avctx->height = height; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; for(i = 0; i < 3; i++) { ctx->num_vblocks[i] = -((-height) >> (3 + !!i)); ctx->num_hblocks[i] = width >> (3 + !!i) ; diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 677dfb275f..23d6c9da69 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -342,12 +342,12 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) switch (pix_fmt_id) { case 0x11111100: if (s->rgb) - s->avctx->pix_fmt = PIX_FMT_BGR24; + s->avctx->pix_fmt = AV_PIX_FMT_BGR24; else { if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') { - s->avctx->pix_fmt = PIX_FMT_GBR24P; + s->avctx->pix_fmt = AV_PIX_FMT_GBR24P; } else { - s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P; + s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; } } @@ -355,7 +355,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) break; case 0x12121100: case 0x22122100: - s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P; + s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; s->upscale_v = 2; s->upscale_h = (pix_fmt_id == 0x22122100); @@ -363,14 +363,14 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) break; case 0x21211100: case 0x22211200: - s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P; + s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; s->upscale_v = (pix_fmt_id == 0x22211200); s->upscale_h = 2; s->chroma_height = s->height; break; case 0x22221100: - s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV444P : PIX_FMT_YUVJ444P; + s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; s->upscale_v = 2; s->upscale_h = 2; @@ -378,30 +378,30 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) break; case 0x11000000: if(s->bits <= 8) - s->avctx->pix_fmt = PIX_FMT_GRAY8; + s->avctx->pix_fmt = AV_PIX_FMT_GRAY8; else - s->avctx->pix_fmt = PIX_FMT_GRAY16; + s->avctx->pix_fmt = AV_PIX_FMT_GRAY16; break; case 0x12111100: case 0x22211100: case 0x22112100: - s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV440P : PIX_FMT_YUVJ440P; + s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; s->upscale_h = (pix_fmt_id == 0x22211100) * 2 + (pix_fmt_id == 0x22112100); s->chroma_height = s->height / 2; break; case 0x21111100: - s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P; + s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; break; case 0x22121100: case 0x22111200: - s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV422P : PIX_FMT_YUVJ422P; + s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; s->upscale_v = (pix_fmt_id == 0x22121100) + 1; break; case 0x22111100: - s->avctx->pix_fmt = s->cs_itu601 ? PIX_FMT_YUV420P : PIX_FMT_YUVJ420P; + s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P; s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG; break; default: @@ -415,11 +415,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s) if (s->ls) { s->upscale_h = s->upscale_v = 0; if (s->nb_components > 1) - s->avctx->pix_fmt = PIX_FMT_RGB24; + s->avctx->pix_fmt = AV_PIX_FMT_RGB24; else if (s->bits <= 8) - s->avctx->pix_fmt = PIX_FMT_GRAY8; + s->avctx->pix_fmt = AV_PIX_FMT_GRAY8; else - s->avctx->pix_fmt = PIX_FMT_GRAY16; + s->avctx->pix_fmt = AV_PIX_FMT_GRAY16; } if (s->picture_ptr->data[0]) @@ -1176,9 +1176,9 @@ int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask, && nb_components == 3 && s->nb_components == 3 && i) index = 3 - i; - if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == PIX_FMT_GBR24P) + if(nb_components == 3 && s->nb_components == 3 && s->avctx->pix_fmt == AV_PIX_FMT_GBR24P) index = (i+2)%3; - if(nb_components == 1 && s->nb_components == 3 && s->avctx->pix_fmt == PIX_FMT_GBR24P) + if(nb_components == 1 && s->nb_components == 3 && s->avctx->pix_fmt == AV_PIX_FMT_GBR24P) index = (index+2)%3; s->comp_index[i] = index; @@ -1752,10 +1752,10 @@ eoi_parser: the_end: if (s->upscale_h) { uint8_t *line = s->picture_ptr->data[s->upscale_h]; - av_assert0(avctx->pix_fmt == PIX_FMT_YUVJ444P || - avctx->pix_fmt == PIX_FMT_YUV444P || - avctx->pix_fmt == PIX_FMT_YUVJ440P || - avctx->pix_fmt == PIX_FMT_YUV440P); + av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P || + avctx->pix_fmt == AV_PIX_FMT_YUV444P || + avctx->pix_fmt == AV_PIX_FMT_YUVJ440P || + avctx->pix_fmt == AV_PIX_FMT_YUV440P); for (i = 0; i < s->chroma_height; i++) { for (index = s->width - 1; index; index--) line[index] = (line[index / 2] + line[(index + 1) / 2]) >> 1; @@ -1764,10 +1764,10 @@ the_end: } if (s->upscale_v) { uint8_t *dst = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(s->height - 1) * s->linesize[s->upscale_v]]; - av_assert0(avctx->pix_fmt == PIX_FMT_YUVJ444P || - avctx->pix_fmt == PIX_FMT_YUV444P || - avctx->pix_fmt == PIX_FMT_YUVJ422P || - avctx->pix_fmt == PIX_FMT_YUV422P); + av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P || + avctx->pix_fmt == AV_PIX_FMT_YUV444P || + avctx->pix_fmt == AV_PIX_FMT_YUVJ422P || + avctx->pix_fmt == AV_PIX_FMT_YUV422P); for (i = s->height - 1; i; i--) { uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[i / 2 * s->linesize[s->upscale_v]]; uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(i + 1) / 2 * s->linesize[s->upscale_v]]; diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index b3ead99eab..1d7741b4ea 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -189,9 +189,9 @@ static void jpeg_put_comments(MpegEncContext *s) AV_WB16(ptr, size); } - if( s->avctx->pix_fmt == PIX_FMT_YUV420P - ||s->avctx->pix_fmt == PIX_FMT_YUV422P - ||s->avctx->pix_fmt == PIX_FMT_YUV444P){ + if( s->avctx->pix_fmt == AV_PIX_FMT_YUV420P + ||s->avctx->pix_fmt == AV_PIX_FMT_YUV422P + ||s->avctx->pix_fmt == AV_PIX_FMT_YUV444P){ put_marker(p, COM); flush_put_bits(p); ptr = put_bits_ptr(p); @@ -223,9 +223,9 @@ void ff_mjpeg_encode_picture_header(MpegEncContext *s) } put_bits(&s->pb, 16, 17); - if(lossless && (s->avctx->pix_fmt == PIX_FMT_BGR0 - || s->avctx->pix_fmt == PIX_FMT_BGRA - || s->avctx->pix_fmt == PIX_FMT_BGR24)) + if(lossless && (s->avctx->pix_fmt == AV_PIX_FMT_BGR0 + || s->avctx->pix_fmt == AV_PIX_FMT_BGRA + || s->avctx->pix_fmt == AV_PIX_FMT_BGR24)) put_bits(&s->pb, 8, 9); /* 9 bits/component RCT */ else put_bits(&s->pb, 8, 8); /* 8 bits/component */ @@ -504,8 +504,8 @@ AVCodec ff_mjpeg_encoder = { .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, .capabilities = CODEC_CAP_SLICE_THREADS | CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("MJPEG (Motion JPEG)"), }; @@ -519,8 +519,8 @@ AVCodec ff_amv_encoder = { .init = ff_MPV_encode_init, .encode2 = amv_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("AMV Video"), }; diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index ff8908a7b6..28975e8912 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -58,7 +58,7 @@ static av_cold int mm_decode_init(AVCodecContext *avctx) s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&s->frame); s->frame.reference = 3; diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index 7b6853e2a8..471f63f5a5 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -67,7 +67,7 @@ static av_cold int mp_decode_init(AVCodecContext *avctx) mp->offset_bits_len = av_log2(avctx->width * avctx->height) + 1; mp->vpt = av_mallocz(avctx->height * sizeof(YuvPixel)); mp->hpt = av_mallocz(h4 * w4 / 16 * sizeof(YuvPixel)); - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; avcodec_get_frame_defaults(&mp->frame); return 0; } diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 4683f011db..953cd5ec94 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1192,61 +1192,61 @@ static void quant_matrix_rebuild(uint16_t *matrix, const uint8_t *old_perm, } } -static const enum PixelFormat mpeg1_hwaccel_pixfmt_list_420[] = { +static const enum AVPixelFormat mpeg1_hwaccel_pixfmt_list_420[] = { #if CONFIG_MPEG_XVMC_DECODER - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_XVMC_MPEG2_MC, + AV_PIX_FMT_XVMC_MPEG2_IDCT, + AV_PIX_FMT_XVMC_MPEG2_MC, #endif #if CONFIG_MPEG1_VDPAU_HWACCEL - PIX_FMT_VDPAU_MPEG1, + AV_PIX_FMT_VDPAU_MPEG1, #endif - PIX_FMT_YUV420P, - PIX_FMT_NONE + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE }; -static const enum PixelFormat mpeg2_hwaccel_pixfmt_list_420[] = { +static const enum AVPixelFormat mpeg2_hwaccel_pixfmt_list_420[] = { #if CONFIG_MPEG_XVMC_DECODER - PIX_FMT_XVMC_MPEG2_IDCT, - PIX_FMT_XVMC_MPEG2_MC, + AV_PIX_FMT_XVMC_MPEG2_IDCT, + AV_PIX_FMT_XVMC_MPEG2_MC, #endif #if CONFIG_MPEG2_VDPAU_HWACCEL - PIX_FMT_VDPAU_MPEG2, + AV_PIX_FMT_VDPAU_MPEG2, #endif #if CONFIG_MPEG2_DXVA2_HWACCEL - PIX_FMT_DXVA2_VLD, + AV_PIX_FMT_DXVA2_VLD, #endif #if CONFIG_MPEG2_VAAPI_HWACCEL - PIX_FMT_VAAPI_VLD, + AV_PIX_FMT_VAAPI_VLD, #endif - PIX_FMT_YUV420P, - PIX_FMT_NONE + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE }; static inline int uses_vdpau(AVCodecContext *avctx) { - return avctx->pix_fmt == PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == PIX_FMT_VDPAU_MPEG2; + return avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG1 || avctx->pix_fmt == AV_PIX_FMT_VDPAU_MPEG2; } -static enum PixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) +static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) { Mpeg1Context *s1 = avctx->priv_data; MpegEncContext *s = &s1->mpeg_enc_ctx; if(s->chroma_format < 2) { - enum PixelFormat res; + enum AVPixelFormat res; res = avctx->get_format(avctx, avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO ? mpeg1_hwaccel_pixfmt_list_420 : mpeg2_hwaccel_pixfmt_list_420); - if (res != PIX_FMT_XVMC_MPEG2_IDCT && res != PIX_FMT_XVMC_MPEG2_MC) { + if (res != AV_PIX_FMT_XVMC_MPEG2_IDCT && res != AV_PIX_FMT_XVMC_MPEG2_MC) { avctx->xvmc_acceleration = 0; } else if (!avctx->xvmc_acceleration) { avctx->xvmc_acceleration = 2; } return res; } else if(s->chroma_format == 2) - return PIX_FMT_YUV422P; + return AV_PIX_FMT_YUV422P; else - return PIX_FMT_YUV444P; + return AV_PIX_FMT_YUV444P; } /* Call this function when we know all parameters. @@ -1340,7 +1340,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) avctx->pix_fmt = mpeg_get_pixelformat(avctx); avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt); // until then pix_fmt may be changed right after codec init - if (avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT || + if (avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel ) if (avctx->idct_algo == FF_IDCT_AUTO) avctx->idct_algo = FF_IDCT_SIMPLE; @@ -2078,7 +2078,7 @@ static int vcr2_init_sequence(AVCodecContext *avctx) avctx->pix_fmt = mpeg_get_pixelformat(avctx); avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt); - if( avctx->pix_fmt == PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel ) + if( avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT || avctx->hwaccel ) if (avctx->idct_algo == FF_IDCT_AUTO) avctx->idct_algo = FF_IDCT_SIMPLE; @@ -2655,7 +2655,7 @@ static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx) } mpeg_decode_init(avctx); - avctx->pix_fmt = PIX_FMT_XVMC_MPEG2_IDCT; + avctx->pix_fmt = AV_PIX_FMT_XVMC_MPEG2_IDCT; avctx->xvmc_acceleration = 2; // 2 - the blocks are packed! return 0; diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 73536d5364..42731eb392 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -983,8 +983,8 @@ AVCodec ff_mpeg1video_encoder = { .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, .supported_framerates = avpriv_frame_rate_tab+1, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE }, .capabilities = CODEC_CAP_DELAY, .long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"), .priv_class = &mpeg1_class, @@ -999,8 +999,8 @@ AVCodec ff_mpeg2video_encoder = { .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, .supported_framerates = ff_mpeg2_frame_rate_tab, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, .long_name = NULL_IF_CONFIG_SMALL("MPEG-2 video"), diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 19875a3fc4..122f5f5c0f 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2371,8 +2371,8 @@ AVCodec ff_mpeg4_vdpau_decoder = { .capabilities = CODEC_CAP_DR1 | CODEC_CAP_TRUNCATED | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU, .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 (VDPAU)"), - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_VDPAU_MPEG4, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VDPAU_MPEG4, + AV_PIX_FMT_NONE }, .priv_class = &mpeg4_vdpau_class, }; #endif diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 97a4cd10c7..33115061fe 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -1351,7 +1351,7 @@ AVCodec ff_mpeg4_encoder = { .init = encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2"), .priv_class = &mpeg4enc_class, diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index f4cc0f2652..cd3ce220c0 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -125,17 +125,17 @@ const uint8_t *const ff_mpeg2_dc_scale_table[4] = { mpeg2_dc_scale_table3, }; -const enum PixelFormat ff_pixfmt_list_420[] = { - PIX_FMT_YUV420P, - PIX_FMT_NONE +const enum AVPixelFormat ff_pixfmt_list_420[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE }; -const enum PixelFormat ff_hwaccel_pixfmt_list_420[] = { - PIX_FMT_DXVA2_VLD, - PIX_FMT_VAAPI_VLD, - PIX_FMT_VDA_VLD, - PIX_FMT_YUV420P, - PIX_FMT_NONE +const enum AVPixelFormat ff_hwaccel_pixfmt_list_420[] = { + AV_PIX_FMT_DXVA2_VLD, + AV_PIX_FMT_VAAPI_VLD, + AV_PIX_FMT_VDA_VLD, + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE }; const uint8_t *avpriv_mpv_find_start_code(const uint8_t *av_restrict p, @@ -814,9 +814,9 @@ av_cold int ff_MPV_common_init(MpegEncContext *s) else if (s->codec_id != AV_CODEC_ID_H264) s->mb_height = (s->height + 15) / 16; - if (s->avctx->pix_fmt == PIX_FMT_NONE) { + if (s->avctx->pix_fmt == AV_PIX_FMT_NONE) { av_log(s->avctx, AV_LOG_ERROR, - "decoding to PIX_FMT_NONE is not supported.\n"); + "decoding to AV_PIX_FMT_NONE is not supported.\n"); return -1; } diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index e6cd20df04..f0fa652e89 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -821,8 +821,8 @@ void ff_MPV_motion(MpegEncContext *s, */ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared); -extern const enum PixelFormat ff_pixfmt_list_420[]; -extern const enum PixelFormat ff_hwaccel_pixfmt_list_420[]; +extern const enum AVPixelFormat ff_pixfmt_list_420[]; +extern const enum AVPixelFormat ff_hwaccel_pixfmt_list_420[]; static inline void ff_update_block_index(MpegEncContext *s){ const int block_size= 8 >> s->avctx->lowres; diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index d7aad625c3..78e2068fda 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -293,23 +293,23 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) switch (avctx->codec_id) { case AV_CODEC_ID_MPEG2VIDEO: - if (avctx->pix_fmt != PIX_FMT_YUV420P && - avctx->pix_fmt != PIX_FMT_YUV422P) { + if (avctx->pix_fmt != AV_PIX_FMT_YUV420P && + avctx->pix_fmt != AV_PIX_FMT_YUV422P) { av_log(avctx, AV_LOG_ERROR, "only YUV420 and YUV422 are supported\n"); return -1; } break; case AV_CODEC_ID_LJPEG: - if (avctx->pix_fmt != PIX_FMT_YUVJ420P && - avctx->pix_fmt != PIX_FMT_YUVJ422P && - avctx->pix_fmt != PIX_FMT_YUVJ444P && - avctx->pix_fmt != PIX_FMT_BGR0 && - avctx->pix_fmt != PIX_FMT_BGRA && - avctx->pix_fmt != PIX_FMT_BGR24 && - ((avctx->pix_fmt != PIX_FMT_YUV420P && - avctx->pix_fmt != PIX_FMT_YUV422P && - avctx->pix_fmt != PIX_FMT_YUV444P) || + if (avctx->pix_fmt != AV_PIX_FMT_YUVJ420P && + avctx->pix_fmt != AV_PIX_FMT_YUVJ422P && + avctx->pix_fmt != AV_PIX_FMT_YUVJ444P && + avctx->pix_fmt != AV_PIX_FMT_BGR0 && + avctx->pix_fmt != AV_PIX_FMT_BGRA && + avctx->pix_fmt != AV_PIX_FMT_BGR24 && + ((avctx->pix_fmt != AV_PIX_FMT_YUV420P && + avctx->pix_fmt != AV_PIX_FMT_YUV422P && + avctx->pix_fmt != AV_PIX_FMT_YUV444P) || avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)) { av_log(avctx, AV_LOG_ERROR, "colorspace not supported in LJPEG\n"); return -1; @@ -317,29 +317,29 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) break; case AV_CODEC_ID_MJPEG: case AV_CODEC_ID_AMV: - if (avctx->pix_fmt != PIX_FMT_YUVJ420P && - avctx->pix_fmt != PIX_FMT_YUVJ422P && - ((avctx->pix_fmt != PIX_FMT_YUV420P && - avctx->pix_fmt != PIX_FMT_YUV422P) || + if (avctx->pix_fmt != AV_PIX_FMT_YUVJ420P && + avctx->pix_fmt != AV_PIX_FMT_YUVJ422P && + ((avctx->pix_fmt != AV_PIX_FMT_YUV420P && + avctx->pix_fmt != AV_PIX_FMT_YUV422P) || avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL)) { av_log(avctx, AV_LOG_ERROR, "colorspace not supported in jpeg\n"); return -1; } break; default: - if (avctx->pix_fmt != PIX_FMT_YUV420P) { + if (avctx->pix_fmt != AV_PIX_FMT_YUV420P) { av_log(avctx, AV_LOG_ERROR, "only YUV420 is supported\n"); return -1; } } switch (avctx->pix_fmt) { - case PIX_FMT_YUVJ422P: - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUVJ422P: + case AV_PIX_FMT_YUV422P: s->chroma_format = CHROMA_422; break; - case PIX_FMT_YUVJ420P: - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUVJ420P: + case AV_PIX_FMT_YUV420P: default: s->chroma_format = CHROMA_420; break; @@ -701,9 +701,9 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) s->out_format = FMT_MJPEG; s->intra_only = 1; /* force intra only for jpeg */ if (avctx->codec->id == AV_CODEC_ID_LJPEG && - (avctx->pix_fmt == PIX_FMT_BGR0 - || s->avctx->pix_fmt == PIX_FMT_BGRA - || s->avctx->pix_fmt == PIX_FMT_BGR24)) { + (avctx->pix_fmt == AV_PIX_FMT_BGR0 + || s->avctx->pix_fmt == AV_PIX_FMT_BGRA + || s->avctx->pix_fmt == AV_PIX_FMT_BGR24)) { s->mjpeg_vsample[0] = s->mjpeg_hsample[0] = s->mjpeg_vsample[1] = s->mjpeg_hsample[1] = s->mjpeg_vsample[2] = s->mjpeg_hsample[2] = 1; @@ -1175,7 +1175,7 @@ static int estimate_best_b_count(MpegEncContext *s) c->me_cmp = s->avctx->me_cmp; c->mb_cmp = s->avctx->mb_cmp; c->me_sub_cmp = s->avctx->me_sub_cmp; - c->pix_fmt = PIX_FMT_YUV420P; + c->pix_fmt = AV_PIX_FMT_YUV420P; c->time_base = s->avctx->time_base; c->max_b_frames = s->max_b_frames; @@ -4233,7 +4233,7 @@ AVCodec ff_h263_encoder = { .init = ff_MPV_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, + .pix_fmts= (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE}, .long_name= NULL_IF_CONFIG_SMALL("H.263 / H.263-1996"), .priv_class = &h263_class, }; @@ -4262,7 +4262,7 @@ AVCodec ff_h263p_encoder = { .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, .capabilities = CODEC_CAP_SLICE_THREADS, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("H.263+ / H.263-1998 / H.263 version 2"), .priv_class = &h263p_class, }; @@ -4277,7 +4277,7 @@ AVCodec ff_msmpeg4v2_encoder = { .init = ff_MPV_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 2"), .priv_class = &msmpeg4v2_class, }; @@ -4292,7 +4292,7 @@ AVCodec ff_msmpeg4v3_encoder = { .init = ff_MPV_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("MPEG-4 part 2 Microsoft variant version 3"), .priv_class = &msmpeg4v3_class, }; @@ -4307,7 +4307,7 @@ AVCodec ff_wmv1_encoder = { .init = ff_MPV_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 7"), .priv_class = &wmv1_class, }; diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 7c965d25e2..0e8a0e539d 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -56,14 +56,14 @@ static av_cold int msrle_decode_init(AVCodecContext *avctx) switch (avctx->bits_per_coded_sample) { case 1: - avctx->pix_fmt = PIX_FMT_MONOWHITE; + avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; break; case 4: case 8: - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 24: - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; break; default: av_log(avctx, AV_LOG_ERROR, "unsupported bits per sample\n"); diff --git a/libavcodec/mss1.c b/libavcodec/mss1.c index c90485b512..660dd89709 100644 --- a/libavcodec/mss1.c +++ b/libavcodec/mss1.c @@ -197,7 +197,7 @@ static av_cold int mss1_decode_init(AVCodecContext *avctx) ret = ff_mss12_decode_init(&c->ctx, 0, &c->sc, NULL); - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; return ret; } diff --git a/libavcodec/mss2.c b/libavcodec/mss2.c index ceb0a45fe5..10687f0441 100644 --- a/libavcodec/mss2.c +++ b/libavcodec/mss2.c @@ -396,11 +396,11 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, return AVERROR_INVALIDDATA; } - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; if (ff_MPV_frame_start(s, avctx) < 0) { av_log(v->s.avctx, AV_LOG_ERROR, "ff_MPV_frame_start error\n"); - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; return -1; } @@ -448,7 +448,7 @@ static int decode_wmv9(AVCodecContext *avctx, const uint8_t *buf, int buf_size, f->data[1], f->data[2], f->linesize[1], w, h); - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; return 0; } @@ -519,7 +519,7 @@ static int mss2_decode_frame(AVCodecContext *avctx, void *data, int *data_size, if (is_555 && (has_wmv9 || has_mv || c->slice_split && ctx->split_position)) return AVERROR_INVALIDDATA; - avctx->pix_fmt = is_555 ? PIX_FMT_RGB555 : PIX_FMT_RGB24; + avctx->pix_fmt = is_555 ? AV_PIX_FMT_RGB555 : AV_PIX_FMT_RGB24; if (ctx->pic.data[0] && ctx->pic.format != avctx->pix_fmt) avctx->release_buffer(avctx, &ctx->pic); @@ -848,8 +848,8 @@ static av_cold int mss2_decode_init(AVCodecContext *avctx) } ff_mss2dsp_init(&ctx->dsp); - avctx->pix_fmt = c->free_colours == 127 ? PIX_FMT_RGB555 - : PIX_FMT_RGB24; + avctx->pix_fmt = c->free_colours == 127 ? AV_PIX_FMT_RGB555 + : AV_PIX_FMT_RGB24; return 0; } diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c index 17957731a9..91aceb2758 100644 --- a/libavcodec/mss3.c +++ b/libavcodec/mss3.c @@ -835,7 +835,7 @@ static av_cold int mss3_decode_init(AVCodecContext *avctx) } } - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->coded_frame = &c->pic; init_coders(c); diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c index bee9764bf0..51db721432 100644 --- a/libavcodec/mss4.c +++ b/libavcodec/mss4.c @@ -649,7 +649,7 @@ static av_cold int mss4_decode_init(AVCodecContext *avctx) } } - avctx->pix_fmt = PIX_FMT_YUV444P; + avctx->pix_fmt = AV_PIX_FMT_YUV444P; avctx->coded_frame = &c->pic; return 0; diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index 21ba7d7f8c..8d1164bf8f 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -65,10 +65,10 @@ static av_cold int msvideo1_decode_init(AVCodecContext *avctx) /* figure out the colorspace based on the presence of a palette */ if (s->avctx->bits_per_coded_sample == 8) { s->mode_8bit = 1; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; } else { s->mode_8bit = 0; - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; } avcodec_get_frame_defaults(&s->frame); @@ -173,7 +173,7 @@ static void msvideo1_decode_8bit(Msvideo1Context *s) } /* make the palette available on the way out */ - if (s->avctx->pix_fmt == PIX_FMT_PAL8) + if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8) memcpy(s->frame.data[1], s->pal, AVPALETTE_SIZE); } diff --git a/libavcodec/msvideo1enc.c b/libavcodec/msvideo1enc.c index 852939bbe3..50c0a06dff 100644 --- a/libavcodec/msvideo1enc.c +++ b/libavcodec/msvideo1enc.c @@ -306,6 +306,6 @@ AVCodec ff_msvideo1_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_RGB555, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_RGB555, AV_PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("Microsoft Video-1"), }; diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index c30ba50979..09868e8907 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -75,8 +75,8 @@ static const uint8_t fallback_cquant[] = { static void copy_frame(AVFrame *f, const uint8_t *src, int width, int height) { AVPicture pic; - avpicture_fill(&pic, src, PIX_FMT_YUV420P, width, height); - av_picture_copy((AVPicture *)f, &pic, PIX_FMT_YUV420P, width, height); + avpicture_fill(&pic, src, AV_PIX_FMT_YUV420P, width, height); + av_picture_copy((AVPicture *)f, &pic, AV_PIX_FMT_YUV420P, width, height); } /** @@ -290,7 +290,7 @@ retry: static av_cold int decode_init(AVCodecContext *avctx) { NuvContext *c = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; c->pic.data[0] = NULL; c->decomp_buf = NULL; c->quality = -1; diff --git a/libavcodec/options.c b/libavcodec/options.c index 7b627c9a48..20e9495976 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -117,7 +117,7 @@ int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec) s->execute = avcodec_default_execute; s->execute2 = avcodec_default_execute2; s->sample_aspect_ratio = (AVRational){0,1}; - s->pix_fmt = PIX_FMT_NONE; + s->pix_fmt = AV_PIX_FMT_NONE; s->sample_fmt = AV_SAMPLE_FMT_NONE; s->timecode_frame_start = -1; diff --git a/libavcodec/paf.c b/libavcodec/paf.c index bd7298a952..877b17066f 100644 --- a/libavcodec/paf.c +++ b/libavcodec/paf.c @@ -67,7 +67,7 @@ static av_cold int paf_vid_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&c->pic); c->frame_size = FFALIGN(avctx->height, 256) * avctx->width; diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c index a43aa55ffb..3e47278469 100644 --- a/libavcodec/pamenc.c +++ b/libavcodec/pamenc.c @@ -36,49 +36,49 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, h = avctx->height; w = avctx->width; switch (avctx->pix_fmt) { - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOBLACK: n = w; depth = 1; maxval = 1; tuple_type = "BLACKANDWHITE"; break; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: n = w; depth = 1; maxval = 255; tuple_type = "GRAYSCALE"; break; - case PIX_FMT_GRAY16BE: + case AV_PIX_FMT_GRAY16BE: n = w * 2; depth = 1; maxval = 0xFFFF; tuple_type = "GRAYSCALE"; break; - case PIX_FMT_GRAY8A: + case AV_PIX_FMT_GRAY8A: n = w * 2; depth = 2; maxval = 255; tuple_type = "GRAYSCALE_ALPHA"; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: n = w * 3; depth = 3; maxval = 255; tuple_type = "RGB"; break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: n = w * 4; depth = 4; maxval = 255; tuple_type = "RGB_ALPHA"; break; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: n = w * 6; depth = 3; maxval = 0xFFFF; tuple_type = "RGB"; break; - case PIX_FMT_RGBA64BE: + case AV_PIX_FMT_RGBA64BE: n = w * 8; depth = 4; maxval = 0xFFFF; @@ -107,7 +107,7 @@ static int pam_encode_frame(AVCodecContext *avctx, AVPacket *pkt, ptr = p->data[0]; linesize = p->linesize[0]; - if (avctx->pix_fmt == PIX_FMT_MONOBLACK){ + if (avctx->pix_fmt == AV_PIX_FMT_MONOBLACK){ int j; for (i = 0; i < h; i++) { for (j = 0; j < w; j++) @@ -136,8 +136,8 @@ AVCodec ff_pam_encoder = { .priv_data_size = sizeof(PNMContext), .init = ff_pnm_init, .encode2 = pam_encode_frame, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_RGB48BE, PIX_FMT_RGBA64BE, PIX_FMT_GRAY8, PIX_FMT_GRAY8A, PIX_FMT_GRAY16BE, PIX_FMT_MONOBLACK, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"), }; diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index 1833f6d204..a333994fca 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -122,7 +122,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, switch ((nplanes<<8) + bits_per_pixel) { case 0x0308: - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; break; case 0x0108: case 0x0104: @@ -131,7 +131,7 @@ static int pcx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, case 0x0401: case 0x0301: case 0x0201: - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; break; default: av_log(avctx, AV_LOG_ERROR, "invalid PCX file\n"); diff --git a/libavcodec/pcxenc.c b/libavcodec/pcxenc.c index 63c7d23ddc..0f8a140fbf 100644 --- a/libavcodec/pcxenc.c +++ b/libavcodec/pcxenc.c @@ -120,26 +120,26 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } switch (avctx->pix_fmt) { - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: bpp = 8; nplanes = 3; break; - case PIX_FMT_RGB8: - case PIX_FMT_BGR8: - case PIX_FMT_RGB4_BYTE: - case PIX_FMT_BGR4_BYTE: - case PIX_FMT_GRAY8: + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_GRAY8: bpp = 8; nplanes = 1; ff_set_systematic_pal2(palette256, avctx->pix_fmt); pal = palette256; break; - case PIX_FMT_PAL8: + case AV_PIX_FMT_PAL8: bpp = 8; nplanes = 1; pal = (uint32_t *)pict->data[1]; break; - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOBLACK: bpp = 1; nplanes = 1; pal = monoblack_pal; @@ -214,12 +214,12 @@ AVCodec ff_pcx_encoder = { .priv_data_size = sizeof(PCXContext), .init = pcx_encode_init, .encode2 = pcx_encode_frame, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_RGB24, - PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, - PIX_FMT_GRAY8, PIX_FMT_PAL8, - PIX_FMT_MONOBLACK, - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_RGB24, + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, + AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, + AV_PIX_FMT_MONOBLACK, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("PC Paintbrush PCX image"), }; diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 728f178ebd..d0d4dd6aff 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -73,7 +73,7 @@ typedef struct PGSSubContext { static av_cold int init_decoder(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/pictordec.c b/libavcodec/pictordec.c index 5d1e6eeca4..ad8eae0b15 100644 --- a/libavcodec/pictordec.c +++ b/libavcodec/pictordec.c @@ -144,7 +144,7 @@ static int decode_frame(AVCodecContext *avctx, esize = 0; } - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; if (s->width != avctx->width && s->height != avctx->height) { if (av_image_check_size(s->width, s->height, 0, avctx) < 0) diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index a5faeba42a..a3af924918 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -484,30 +484,30 @@ static int decode_frame(AVCodecContext *avctx, if ((s->bit_depth == 2 || s->bit_depth == 4 || s->bit_depth == 8) && s->color_type == PNG_COLOR_TYPE_RGB) { - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; } else if ((s->bit_depth == 2 || s->bit_depth == 4 || s->bit_depth == 8) && s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { - avctx->pix_fmt = PIX_FMT_RGBA; + avctx->pix_fmt = AV_PIX_FMT_RGBA; } else if ((s->bit_depth == 2 || s->bit_depth == 4 || s->bit_depth == 8) && s->color_type == PNG_COLOR_TYPE_GRAY) { - avctx->pix_fmt = PIX_FMT_GRAY8; + avctx->pix_fmt = AV_PIX_FMT_GRAY8; } else if (s->bit_depth == 16 && s->color_type == PNG_COLOR_TYPE_GRAY) { - avctx->pix_fmt = PIX_FMT_GRAY16BE; + avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; } else if (s->bit_depth == 16 && s->color_type == PNG_COLOR_TYPE_RGB) { - avctx->pix_fmt = PIX_FMT_RGB48BE; + avctx->pix_fmt = AV_PIX_FMT_RGB48BE; } else if (s->bit_depth == 16 && s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { - avctx->pix_fmt = PIX_FMT_RGBA64BE; + avctx->pix_fmt = AV_PIX_FMT_RGBA64BE; } else if ((s->bits_per_pixel == 1 || s->bits_per_pixel == 2 || s->bits_per_pixel == 4 || s->bits_per_pixel == 8) && s->color_type == PNG_COLOR_TYPE_PALETTE) { - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; } else if (s->bit_depth == 1) { - avctx->pix_fmt = PIX_FMT_MONOBLACK; + avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; } else if (s->bit_depth == 8 && s->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { - avctx->pix_fmt = PIX_FMT_Y400A; + avctx->pix_fmt = AV_PIX_FMT_Y400A; } else { av_log(avctx, AV_LOG_ERROR, "unsupported bit depth %d " "and color type %d\n", @@ -541,7 +541,7 @@ static int decode_frame(AVCodecContext *avctx, s->image_buf = p->data[0]; s->image_linesize = p->linesize[0]; /* copy the palette if needed */ - if (avctx->pix_fmt == PIX_FMT_PAL8) + if (avctx->pix_fmt == AV_PIX_FMT_PAL8) memcpy(p->data[1], s->palette, 256 * sizeof(uint32_t)); /* empty row is used if differencing to the first row */ s->last_row = av_mallocz(s->row_size); diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 0d00a0866c..87d18d491a 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -235,43 +235,43 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT); switch(avctx->pix_fmt) { - case PIX_FMT_RGBA64BE: + case AV_PIX_FMT_RGBA64BE: bit_depth = 16; color_type = PNG_COLOR_TYPE_RGB_ALPHA; break; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: bit_depth = 16; color_type = PNG_COLOR_TYPE_RGB; break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: avctx->bits_per_coded_sample = 32; bit_depth = 8; color_type = PNG_COLOR_TYPE_RGB_ALPHA; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: avctx->bits_per_coded_sample = 24; bit_depth = 8; color_type = PNG_COLOR_TYPE_RGB; break; - case PIX_FMT_GRAY16BE: + case AV_PIX_FMT_GRAY16BE: bit_depth = 16; color_type = PNG_COLOR_TYPE_GRAY; break; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: avctx->bits_per_coded_sample = 0x28; bit_depth = 8; color_type = PNG_COLOR_TYPE_GRAY; break; - case PIX_FMT_GRAY8A: + case AV_PIX_FMT_GRAY8A: bit_depth = 8; color_type = PNG_COLOR_TYPE_GRAY_ALPHA; break; - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOBLACK: avctx->bits_per_coded_sample = bit_depth = 1; color_type = PNG_COLOR_TYPE_GRAY; break; - case PIX_FMT_PAL8: + case AV_PIX_FMT_PAL8: avctx->bits_per_coded_sample = bit_depth = 8; color_type = PNG_COLOR_TYPE_PALETTE; @@ -437,7 +437,7 @@ static av_cold int png_enc_init(AVCodecContext *avctx){ ff_dsputil_init(&s->dsp, avctx); s->filter_type = av_clip(avctx->prediction_method, PNG_FILTER_VALUE_NONE, PNG_FILTER_VALUE_MIXED); - if(avctx->pix_fmt == PIX_FMT_MONOBLACK) + if(avctx->pix_fmt == AV_PIX_FMT_MONOBLACK) s->filter_type = PNG_FILTER_VALUE_NONE; return 0; @@ -451,13 +451,13 @@ AVCodec ff_png_encoder = { .init = png_enc_init, .encode2 = encode_frame, .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_RGB24, PIX_FMT_RGBA, - PIX_FMT_RGB48BE, PIX_FMT_RGBA64BE, - PIX_FMT_PAL8, - PIX_FMT_GRAY8, PIX_FMT_GRAY8A, - PIX_FMT_GRAY16BE, - PIX_FMT_MONOBLACK, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, + AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, + AV_PIX_FMT_PAL8, + AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, + AV_PIX_FMT_GRAY16BE, + AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"), }; diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c index a5cf766894..c5c600b841 100644 --- a/libavcodec/pnm.c +++ b/libavcodec/pnm.c @@ -68,14 +68,14 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) return -1; if (s->type==1 || s->type==4) { - avctx->pix_fmt = PIX_FMT_MONOWHITE; + avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; } else if (s->type==2 || s->type==5) { if (avctx->codec_id == AV_CODEC_ID_PGMYUV) - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; else - avctx->pix_fmt = PIX_FMT_GRAY8; + avctx->pix_fmt = AV_PIX_FMT_GRAY8; } else if (s->type==3 || s->type==6) { - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; } else if (s->type==7) { w = -1; h = -1; @@ -115,26 +115,26 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) s->maxval = maxval; if (depth == 1) { if (maxval == 1) { - avctx->pix_fmt = PIX_FMT_MONOBLACK; + avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; } else if (maxval == 255) { - avctx->pix_fmt = PIX_FMT_GRAY8; + avctx->pix_fmt = AV_PIX_FMT_GRAY8; } else { - avctx->pix_fmt = PIX_FMT_GRAY16BE; + avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; } } else if (depth == 2) { if (maxval == 255) - avctx->pix_fmt = PIX_FMT_GRAY8A; + avctx->pix_fmt = AV_PIX_FMT_GRAY8A; } else if (depth == 3) { if (maxval < 256) { - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; } else { - avctx->pix_fmt = PIX_FMT_RGB48BE; + avctx->pix_fmt = AV_PIX_FMT_RGB48BE; } } else if (depth == 4) { if (maxval < 256) { - avctx->pix_fmt = PIX_FMT_RGBA; + avctx->pix_fmt = AV_PIX_FMT_RGBA; } else { - avctx->pix_fmt = PIX_FMT_RGBA64BE; + avctx->pix_fmt = AV_PIX_FMT_RGBA64BE; } } else { return -1; @@ -153,7 +153,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) avctx->width = w; avctx->height = h; - if (avctx->pix_fmt != PIX_FMT_MONOWHITE && avctx->pix_fmt != PIX_FMT_MONOBLACK) { + if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE && avctx->pix_fmt != AV_PIX_FMT_MONOBLACK) { pnm_get(s, buf1, sizeof(buf1)); s->maxval = atoi(buf1); if (s->maxval <= 0) { @@ -161,23 +161,23 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s) s->maxval = 255; } if (s->maxval >= 256) { - if (avctx->pix_fmt == PIX_FMT_GRAY8) { - avctx->pix_fmt = PIX_FMT_GRAY16BE; + if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) { + avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; if (s->maxval != 65535) - avctx->pix_fmt = PIX_FMT_GRAY16; - } else if (avctx->pix_fmt == PIX_FMT_RGB24) { + avctx->pix_fmt = AV_PIX_FMT_GRAY16; + } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) { if (s->maxval > 255) - avctx->pix_fmt = PIX_FMT_RGB48BE; + avctx->pix_fmt = AV_PIX_FMT_RGB48BE; } else { av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n"); - avctx->pix_fmt = PIX_FMT_NONE; + avctx->pix_fmt = AV_PIX_FMT_NONE; return -1; } } }else s->maxval=1; /* more check if YUV420 */ - if (avctx->pix_fmt == PIX_FMT_YUV420P) { + if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { if ((avctx->width & 1) != 0) return -1; h = (avctx->height * 2); diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index c6dfa2c79e..29efaca5ea 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -57,48 +57,48 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, switch (avctx->pix_fmt) { default: return -1; - case PIX_FMT_RGBA64BE: + case AV_PIX_FMT_RGBA64BE: n = avctx->width * 8; components=4; sample_len=16; goto do_read; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: n = avctx->width * 6; components=3; sample_len=16; goto do_read; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: n = avctx->width * 4; components=4; sample_len=8; goto do_read; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: n = avctx->width * 3; components=3; sample_len=8; goto do_read; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: n = avctx->width; components=1; sample_len=8; if (s->maxval < 255) upgrade = 1; goto do_read; - case PIX_FMT_GRAY8A: + case AV_PIX_FMT_GRAY8A: n = avctx->width * 2; components=2; sample_len=8; goto do_read; - case PIX_FMT_GRAY16BE: - case PIX_FMT_GRAY16LE: + case AV_PIX_FMT_GRAY16BE: + case AV_PIX_FMT_GRAY16LE: n = avctx->width * 2; components=1; sample_len=16; if (s->maxval < 65535) upgrade = 2; goto do_read; - case PIX_FMT_MONOWHITE: - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOWHITE: + case AV_PIX_FMT_MONOBLACK: n = (avctx->width + 7) >> 3; components=1; sample_len=1; @@ -155,7 +155,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, } } break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: { unsigned char *ptr1, *ptr2; diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index 00d82f5a62..e311b2ef75 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -48,27 +48,27 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, h = avctx->height; h1 = h; switch (avctx->pix_fmt) { - case PIX_FMT_MONOWHITE: + case AV_PIX_FMT_MONOWHITE: c = '4'; n = (avctx->width + 7) >> 3; break; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: c = '5'; n = avctx->width; break; - case PIX_FMT_GRAY16BE: + case AV_PIX_FMT_GRAY16BE: c = '5'; n = avctx->width * 2; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: c = '6'; n = avctx->width * 3; break; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: c = '6'; n = avctx->width * 6; break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: if (avctx->width & 1) { av_log(avctx, AV_LOG_ERROR, "pgmyuv needs even width\n"); return AVERROR(EINVAL); @@ -83,9 +83,9 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, snprintf(s->bytestream, s->bytestream_end - s->bytestream, "P%c\n%d %d\n", c, avctx->width, h1); s->bytestream += strlen(s->bytestream); - if (avctx->pix_fmt != PIX_FMT_MONOWHITE) { + if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) { snprintf(s->bytestream, s->bytestream_end - s->bytestream, - "%d\n", (avctx->pix_fmt != PIX_FMT_GRAY16BE && avctx->pix_fmt != PIX_FMT_RGB48BE) ? 255 : 65535); + "%d\n", (avctx->pix_fmt != AV_PIX_FMT_GRAY16BE && avctx->pix_fmt != AV_PIX_FMT_RGB48BE) ? 255 : 65535); s->bytestream += strlen(s->bytestream); } @@ -97,7 +97,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt, ptr += linesize; } - if (avctx->pix_fmt == PIX_FMT_YUV420P) { + if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) { h >>= 1; n >>= 1; ptr1 = p->data[1]; @@ -127,8 +127,8 @@ AVCodec ff_pgm_encoder = { .priv_data_size = sizeof(PNMContext), .init = ff_pnm_init, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_GRAY8, PIX_FMT_GRAY16BE, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"), }; @@ -142,7 +142,7 @@ AVCodec ff_pgmyuv_encoder = { .priv_data_size = sizeof(PNMContext), .init = ff_pnm_init, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"), }; #endif @@ -155,8 +155,8 @@ AVCodec ff_ppm_encoder = { .priv_data_size = sizeof(PNMContext), .init = ff_pnm_init, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_RGB24, PIX_FMT_RGB48BE, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"), }; @@ -170,8 +170,8 @@ AVCodec ff_pbm_encoder = { .priv_data_size = sizeof(PNMContext), .init = ff_pnm_init, .encode2 = pnm_encode_frame, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_MONOWHITE, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"), }; #endif diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c index cd487b2824..d14b535211 100644 --- a/libavcodec/proresdec2.c +++ b/libavcodec/proresdec2.c @@ -126,7 +126,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, ctx->frame.top_field_first = ctx->frame_type == 1; } - avctx->pix_fmt = (buf[12] & 0xC0) == 0xC0 ? PIX_FMT_YUV444P10 : PIX_FMT_YUV422P10; + avctx->pix_fmt = (buf[12] & 0xC0) == 0xC0 ? AV_PIX_FMT_YUV444P10 : AV_PIX_FMT_YUV422P10; ptr = buf + 20; flags = buf[19]; @@ -465,7 +465,7 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int chroma_stride = pic->linesize[1] << 1; } - if (avctx->pix_fmt == PIX_FMT_YUV444P10) { + if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10) { mb_x_shift = 5; log2_chroma_blocks_per_mb = 2; } else { diff --git a/libavcodec/proresdec_lgpl.c b/libavcodec/proresdec_lgpl.c index e672ad228c..b5aaa61db2 100644 --- a/libavcodec/proresdec_lgpl.c +++ b/libavcodec/proresdec_lgpl.c @@ -139,10 +139,10 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, ctx->num_chroma_blocks = (1 << ctx->chroma_factor) >> 1; switch (ctx->chroma_factor) { case 2: - avctx->pix_fmt = PIX_FMT_YUV422P10; + avctx->pix_fmt = AV_PIX_FMT_YUV422P10; break; case 3: - avctx->pix_fmt = PIX_FMT_YUV444P10; + avctx->pix_fmt = AV_PIX_FMT_YUV444P10; break; default: av_log(avctx, AV_LOG_ERROR, diff --git a/libavcodec/proresenc_anatoliy.c b/libavcodec/proresenc_anatoliy.c index d77d6eed9c..8c71ca5aea 100644 --- a/libavcodec/proresenc_anatoliy.c +++ b/libavcodec/proresenc_anatoliy.c @@ -540,7 +540,7 @@ static av_cold int prores_encode_init(AVCodecContext *avctx) int i; ProresContext* ctx = avctx->priv_data; - if (avctx->pix_fmt != PIX_FMT_YUV422P10) { + if (avctx->pix_fmt != AV_PIX_FMT_YUV422P10) { av_log(avctx, AV_LOG_ERROR, "need YUV422P10\n"); return -1; } @@ -604,7 +604,7 @@ AVCodec ff_prores_anatoliy_encoder = { .init = prores_encode_init, .close = prores_encode_close, .encode2 = prores_encode_frame, - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV422P10, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY, .profiles = profiles @@ -618,7 +618,7 @@ AVCodec ff_prores_encoder = { .init = prores_encode_init, .close = prores_encode_close, .encode2 = prores_encode_frame, - .pix_fmts = (const enum PixelFormat[]){PIX_FMT_YUV422P10, PIX_FMT_NONE}, + .pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE}, .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes"), .capabilities = CODEC_CAP_FRAME_THREADS | CODEC_CAP_INTRA_ONLY, .profiles = profiles diff --git a/libavcodec/proresenc_kostya.c b/libavcodec/proresenc_kostya.c index 53c74a46f8..0462c74b13 100644 --- a/libavcodec/proresenc_kostya.c +++ b/libavcodec/proresenc_kostya.c @@ -36,7 +36,7 @@ #define MAX_MBS_PER_SLICE 8 -#define MAX_PLANES 3 // should be increased to 4 when there's PIX_FMT_YUV444AP10 +#define MAX_PLANES 3 // should be increased to 4 when there's AV_PIX_FMT_YUV444AP10 enum { PRORES_PROFILE_PROXY = 0, @@ -902,7 +902,7 @@ static av_cold int encode_init(AVCodecContext *avctx) return AVERROR(EINVAL); } - ctx->chroma_factor = avctx->pix_fmt == PIX_FMT_YUV422P10 + ctx->chroma_factor = avctx->pix_fmt == AV_PIX_FMT_YUV422P10 ? CFACTOR_Y422 : CFACTOR_Y444; ctx->profile_info = prores_profile_info + ctx->profile; @@ -1069,8 +1069,8 @@ AVCodec ff_prores_kostya_encoder = { .encode2 = encode_frame, .capabilities = CODEC_CAP_SLICE_THREADS, .long_name = NULL_IF_CONFIG_SMALL("Apple ProRes (iCodec Pro)"), - .pix_fmts = (const enum PixelFormat[]) { - PIX_FMT_YUV422P10, PIX_FMT_YUV444P10, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE }, .priv_class = &proresenc_class, }; diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index 0d6762fcfd..c9adb6d3fa 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -59,7 +59,7 @@ static int ptx_decode_frame(AVCodecContext *avctx, void *data, int *data_size, return -1; } - avctx->pix_fmt = PIX_FMT_BGR555LE; + avctx->pix_fmt = AV_PIX_FMT_BGR555LE; if (buf_end - buf < offset) return AVERROR_INVALIDDATA; diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index 6c61b505a5..55fc930ceb 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -149,7 +149,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ QdrawContext * const a = avctx->priv_data; avcodec_get_frame_defaults(&a->pic); - avctx->pix_fmt= PIX_FMT_PAL8; + avctx->pix_fmt= AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 751d6ce796..4d8781e762 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -307,7 +307,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ avcodec_get_frame_defaults(&a->pic); avcodec_get_frame_defaults(&a->ref); a->avctx = avctx; - avctx->pix_fmt= PIX_FMT_PAL8; + avctx->pix_fmt= AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index a8fe38a7e8..d02dffae6a 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -363,7 +363,7 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) switch (avctx->bits_per_coded_sample) { case 1: case 33: - avctx->pix_fmt = PIX_FMT_MONOWHITE; + avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; break; case 2: @@ -372,19 +372,19 @@ static av_cold int qtrle_decode_init(AVCodecContext *avctx) case 34: case 36: case 40: - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 16: - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; break; case 24: - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; break; case 32: - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; break; default: diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c index 2fb9c1c928..e151c9e1fa 100644 --- a/libavcodec/qtrleenc.c +++ b/libavcodec/qtrleenc.c @@ -73,24 +73,24 @@ static av_cold int qtrle_encode_init(AVCodecContext *avctx) s->logical_width=avctx->width; switch (avctx->pix_fmt) { - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: s->logical_width = avctx->width / 4; s->pixel_size = 4; break; - case PIX_FMT_RGB555BE: + case AV_PIX_FMT_RGB555BE: s->pixel_size = 2; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: s->pixel_size = 3; break; - case PIX_FMT_ARGB: + case AV_PIX_FMT_ARGB: s->pixel_size = 4; break; default: av_log(avctx, AV_LOG_ERROR, "Unsupported colorspace.\n"); break; } - avctx->bits_per_coded_sample = avctx->pix_fmt == PIX_FMT_GRAY8 ? 40 : s->pixel_size*8; + avctx->bits_per_coded_sample = avctx->pix_fmt == AV_PIX_FMT_GRAY8 ? 40 : s->pixel_size*8; s->rlecode_table = av_mallocz(s->logical_width); s->skip_table = av_mallocz(s->logical_width); @@ -232,11 +232,11 @@ static void qtrle_encode_line(QtrleEncContext *s, const AVFrame *p, int line, ui } else if (rlecode > 0) { /* bulk copy */ - if (s->avctx->pix_fmt == PIX_FMT_GRAY8) { + if (s->avctx->pix_fmt == AV_PIX_FMT_GRAY8) { int j; // QT grayscale colorspace has 0=white and 255=black, we will // ignore the palette that is included in the AVFrame because - // PIX_FMT_GRAY8 has defined color mapping + // AV_PIX_FMT_GRAY8 has defined color mapping for (j = 0; j < rlecode*s->pixel_size; ++j) bytestream_put_byte(buf, *(this_line + i*s->pixel_size + j) ^ 0xff); } else { @@ -246,7 +246,7 @@ static void qtrle_encode_line(QtrleEncContext *s, const AVFrame *p, int line, ui } else { /* repeat the bits */ - if (s->avctx->pix_fmt == PIX_FMT_GRAY8) { + if (s->avctx->pix_fmt == AV_PIX_FMT_GRAY8) { int j; // QT grayscale colorspace has 0=white and 255=black, ... for (j = 0; j < s->pixel_size; ++j) @@ -355,8 +355,8 @@ AVCodec ff_qtrle_encoder = { .init = qtrle_encode_init, .encode2 = qtrle_encode_frame, .close = qtrle_encode_end, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_RGB24, PIX_FMT_RGB555BE, PIX_FMT_ARGB, PIX_FMT_GRAY8, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"), }; diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index f8db4a9674..4c78b5341c 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -26,7 +26,7 @@ static av_cold int decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_RGB48; + avctx->pix_fmt = AV_PIX_FMT_RGB48; avctx->bits_per_raw_sample = 10; avctx->coded_frame = avcodec_alloc_frame(); diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c index 9e209fdd0b..39069ab8e7 100644 --- a/libavcodec/r210enc.c +++ b/libavcodec/r210enc.c @@ -94,7 +94,7 @@ AVCodec ff_r210_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_RGB48, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB48, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed RGB 10-bit"), }; #endif @@ -106,7 +106,7 @@ AVCodec ff_r10k_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_RGB48, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB48, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("AJA Kona 10-bit RGB Codec"), }; #endif @@ -118,7 +118,7 @@ AVCodec ff_avrp_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_RGB48, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB48, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Avid 1:1 10-bit RGB Packer"), }; #endif diff --git a/libavcodec/raw.c b/libavcodec/raw.c index 35d98f06ad..5f8bf33b79 100644 --- a/libavcodec/raw.c +++ b/libavcodec/raw.c @@ -29,155 +29,155 @@ #include "libavutil/common.h" const PixelFormatTag ff_raw_pix_fmt_tags[] = { - { PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */ - { PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') }, - { PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') }, - { PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') }, - { PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') }, - { PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') }, - { PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') }, - { PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') }, - { PIX_FMT_YUV422P, MKTAG('Y', 'V', '1', '6') }, + { AV_PIX_FMT_YUV420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */ + { AV_PIX_FMT_YUV420P, MKTAG('I', 'Y', 'U', 'V') }, + { AV_PIX_FMT_YUV420P, MKTAG('Y', 'V', '1', '2') }, + { AV_PIX_FMT_YUV410P, MKTAG('Y', 'U', 'V', '9') }, + { AV_PIX_FMT_YUV410P, MKTAG('Y', 'V', 'U', '9') }, + { AV_PIX_FMT_YUV411P, MKTAG('Y', '4', '1', 'B') }, + { AV_PIX_FMT_YUV422P, MKTAG('Y', '4', '2', 'B') }, + { AV_PIX_FMT_YUV422P, MKTAG('P', '4', '2', '2') }, + { AV_PIX_FMT_YUV422P, MKTAG('Y', 'V', '1', '6') }, /* yuvjXXX formats are deprecated hacks specific to libav*, they are identical to yuvXXX */ - { PIX_FMT_YUVJ420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */ - { PIX_FMT_YUVJ420P, MKTAG('I', 'Y', 'U', 'V') }, - { PIX_FMT_YUVJ420P, MKTAG('Y', 'V', '1', '2') }, - { PIX_FMT_YUVJ422P, MKTAG('Y', '4', '2', 'B') }, - { PIX_FMT_YUVJ422P, MKTAG('P', '4', '2', '2') }, - { PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') }, - { PIX_FMT_GRAY8, MKTAG('Y', '8', ' ', ' ') }, + { AV_PIX_FMT_YUVJ420P, MKTAG('I', '4', '2', '0') }, /* Planar formats */ + { AV_PIX_FMT_YUVJ420P, MKTAG('I', 'Y', 'U', 'V') }, + { AV_PIX_FMT_YUVJ420P, MKTAG('Y', 'V', '1', '2') }, + { AV_PIX_FMT_YUVJ422P, MKTAG('Y', '4', '2', 'B') }, + { AV_PIX_FMT_YUVJ422P, MKTAG('P', '4', '2', '2') }, + { AV_PIX_FMT_GRAY8, MKTAG('Y', '8', '0', '0') }, + { AV_PIX_FMT_GRAY8, MKTAG('Y', '8', ' ', ' ') }, - { PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */ - { PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') }, - { PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') }, - { PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') }, - { PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') }, - { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') }, - { PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') }, - { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') }, - { PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'Y') }, - { PIX_FMT_UYVY422, MKTAG('u', 'y', 'v', '1') }, - { PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', '1') }, - { PIX_FMT_UYVY422, MKTAG('A', 'V', 'R', 'n') }, /* Avid AVI Codec 1:1 */ - { PIX_FMT_UYVY422, MKTAG('A', 'V', '1', 'x') }, /* Avid 1:1x */ - { PIX_FMT_UYVY422, MKTAG('A', 'V', 'u', 'p') }, - { PIX_FMT_UYVY422, MKTAG('V', 'D', 'T', 'Z') }, /* SoftLab-NSK VideoTizer */ - { PIX_FMT_UYVY422, MKTAG('a', 'u', 'v', '2') }, - { PIX_FMT_UYVY422, MKTAG('c', 'y', 'u', 'v') }, /* CYUV is also Creative YUV */ - { PIX_FMT_UYYVYY411, MKTAG('Y', '4', '1', '1') }, - { PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') }, - { PIX_FMT_NV12, MKTAG('N', 'V', '1', '2') }, - { PIX_FMT_NV21, MKTAG('N', 'V', '2', '1') }, + { AV_PIX_FMT_YUYV422, MKTAG('Y', 'U', 'Y', '2') }, /* Packed formats */ + { AV_PIX_FMT_YUYV422, MKTAG('Y', '4', '2', '2') }, + { AV_PIX_FMT_YUYV422, MKTAG('V', '4', '2', '2') }, + { AV_PIX_FMT_YUYV422, MKTAG('V', 'Y', 'U', 'Y') }, + { AV_PIX_FMT_YUYV422, MKTAG('Y', 'U', 'N', 'V') }, + { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'V', 'Y') }, + { AV_PIX_FMT_UYVY422, MKTAG('H', 'D', 'Y', 'C') }, + { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'V') }, + { AV_PIX_FMT_UYVY422, MKTAG('U', 'Y', 'N', 'Y') }, + { AV_PIX_FMT_UYVY422, MKTAG('u', 'y', 'v', '1') }, + { AV_PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', '1') }, + { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'R', 'n') }, /* Avid AVI Codec 1:1 */ + { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', '1', 'x') }, /* Avid 1:1x */ + { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'u', 'p') }, + { AV_PIX_FMT_UYVY422, MKTAG('V', 'D', 'T', 'Z') }, /* SoftLab-NSK VideoTizer */ + { AV_PIX_FMT_UYVY422, MKTAG('a', 'u', 'v', '2') }, + { AV_PIX_FMT_UYVY422, MKTAG('c', 'y', 'u', 'v') }, /* CYUV is also Creative YUV */ + { AV_PIX_FMT_UYYVYY411, MKTAG('Y', '4', '1', '1') }, + { AV_PIX_FMT_GRAY8, MKTAG('G', 'R', 'E', 'Y') }, + { AV_PIX_FMT_NV12, MKTAG('N', 'V', '1', '2') }, + { AV_PIX_FMT_NV21, MKTAG('N', 'V', '2', '1') }, /* nut */ - { PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) }, - { PIX_FMT_BGR555LE, MKTAG('B', 'G', 'R', 15) }, - { PIX_FMT_RGB565LE, MKTAG('R', 'G', 'B', 16) }, - { PIX_FMT_BGR565LE, MKTAG('B', 'G', 'R', 16) }, - { PIX_FMT_RGB555BE, MKTAG(15 , 'B', 'G', 'R') }, - { PIX_FMT_BGR555BE, MKTAG(15 , 'R', 'G', 'B') }, - { PIX_FMT_RGB565BE, MKTAG(16 , 'B', 'G', 'R') }, - { PIX_FMT_BGR565BE, MKTAG(16 , 'R', 'G', 'B') }, - { PIX_FMT_RGB444LE, MKTAG('R', 'G', 'B', 12) }, - { PIX_FMT_BGR444LE, MKTAG('B', 'G', 'R', 12) }, - { PIX_FMT_RGB444BE, MKTAG(12 , 'B', 'G', 'R') }, - { PIX_FMT_BGR444BE, MKTAG(12 , 'R', 'G', 'B') }, - { PIX_FMT_RGBA64LE, MKTAG('R', 'B', 'A', 64 ) }, - { PIX_FMT_BGRA64LE, MKTAG('B', 'R', 'A', 64 ) }, - { PIX_FMT_RGBA64BE, MKTAG(64 , 'R', 'B', 'A') }, - { PIX_FMT_BGRA64BE, MKTAG(64 , 'B', 'R', 'A') }, - { PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') }, - { PIX_FMT_RGB0, MKTAG('R', 'G', 'B', 0 ) }, - { PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') }, - { PIX_FMT_BGR0, MKTAG('B', 'G', 'R', 0 ) }, - { PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') }, - { PIX_FMT_0BGR, MKTAG( 0 , 'B', 'G', 'R') }, - { PIX_FMT_ARGB, MKTAG('A', 'R', 'G', 'B') }, - { PIX_FMT_0RGB, MKTAG( 0 , 'R', 'G', 'B') }, - { PIX_FMT_RGB24, MKTAG('R', 'G', 'B', 24 ) }, - { PIX_FMT_BGR24, MKTAG('B', 'G', 'R', 24 ) }, - { PIX_FMT_YUV411P, MKTAG('4', '1', '1', 'P') }, - { PIX_FMT_YUV422P, MKTAG('4', '2', '2', 'P') }, - { PIX_FMT_YUVJ422P, MKTAG('4', '2', '2', 'P') }, - { PIX_FMT_YUV440P, MKTAG('4', '4', '0', 'P') }, - { PIX_FMT_YUVJ440P, MKTAG('4', '4', '0', 'P') }, - { PIX_FMT_YUV444P, MKTAG('4', '4', '4', 'P') }, - { PIX_FMT_YUVJ444P, MKTAG('4', '4', '4', 'P') }, - { PIX_FMT_MONOWHITE,MKTAG('B', '1', 'W', '0') }, - { PIX_FMT_MONOBLACK,MKTAG('B', '0', 'W', '1') }, - { PIX_FMT_BGR8, MKTAG('B', 'G', 'R', 8 ) }, - { PIX_FMT_RGB8, MKTAG('R', 'G', 'B', 8 ) }, - { PIX_FMT_BGR4, MKTAG('B', 'G', 'R', 4 ) }, - { PIX_FMT_RGB4, MKTAG('R', 'G', 'B', 4 ) }, - { PIX_FMT_RGB4_BYTE,MKTAG('B', '4', 'B', 'Y') }, - { PIX_FMT_BGR4_BYTE,MKTAG('R', '4', 'B', 'Y') }, - { PIX_FMT_RGB48LE, MKTAG('R', 'G', 'B', 48 ) }, - { PIX_FMT_RGB48BE, MKTAG( 48, 'R', 'G', 'B') }, - { PIX_FMT_BGR48LE, MKTAG('B', 'G', 'R', 48 ) }, - { PIX_FMT_BGR48BE, MKTAG( 48, 'B', 'G', 'R') }, - { PIX_FMT_GRAY16LE, MKTAG('Y', '1', 0 , 16 ) }, - { PIX_FMT_GRAY16BE, MKTAG(16 , 0 , '1', 'Y') }, - { PIX_FMT_YUV420P10LE, MKTAG('Y', '3', 11 , 10 ) }, - { PIX_FMT_YUV420P10BE, MKTAG(10 , 11 , '3', 'Y') }, - { PIX_FMT_YUV422P10LE, MKTAG('Y', '3', 10 , 10 ) }, - { PIX_FMT_YUV422P10BE, MKTAG(10 , 10 , '3', 'Y') }, - { PIX_FMT_YUV444P10LE, MKTAG('Y', '3', 0 , 10 ) }, - { PIX_FMT_YUV444P10BE, MKTAG(10 , 0 , '3', 'Y') }, - { PIX_FMT_YUV420P12LE, MKTAG('Y', '3', 11 , 12 ) }, - { PIX_FMT_YUV420P12BE, MKTAG(12 , 11 , '3', 'Y') }, - { PIX_FMT_YUV422P12LE, MKTAG('Y', '3', 10 , 12 ) }, - { PIX_FMT_YUV422P12BE, MKTAG(12 , 10 , '3', 'Y') }, - { PIX_FMT_YUV444P12LE, MKTAG('Y', '3', 0 , 12 ) }, - { PIX_FMT_YUV444P12BE, MKTAG(12 , 0 , '3', 'Y') }, - { PIX_FMT_YUV420P14LE, MKTAG('Y', '3', 11 , 14 ) }, - { PIX_FMT_YUV420P14BE, MKTAG(14 , 11 , '3', 'Y') }, - { PIX_FMT_YUV422P14LE, MKTAG('Y', '3', 10 , 14 ) }, - { PIX_FMT_YUV422P14BE, MKTAG(14 , 10 , '3', 'Y') }, - { PIX_FMT_YUV444P14LE, MKTAG('Y', '3', 0 , 14 ) }, - { PIX_FMT_YUV444P14BE, MKTAG(14 , 0 , '3', 'Y') }, - { PIX_FMT_YUV420P16LE, MKTAG('Y', '3', 11 , 16 ) }, - { PIX_FMT_YUV420P16BE, MKTAG(16 , 11 , '3', 'Y') }, - { PIX_FMT_YUV422P16LE, MKTAG('Y', '3', 10 , 16 ) }, - { PIX_FMT_YUV422P16BE, MKTAG(16 , 10 , '3', 'Y') }, - { PIX_FMT_YUV444P16LE, MKTAG('Y', '3', 0 , 16 ) }, - { PIX_FMT_YUV444P16BE, MKTAG(16 , 0 , '3', 'Y') }, - { PIX_FMT_YUVA420P, MKTAG('Y', '4', 11 , 8 ) }, - { PIX_FMT_YUVA422P, MKTAG('Y', '4', 10 , 8 ) }, - { PIX_FMT_YUVA444P, MKTAG('Y', '4', 0 , 8 ) }, - { PIX_FMT_GRAY8A, MKTAG('Y', '2', 0 , 8 ) }, + { AV_PIX_FMT_RGB555LE, MKTAG('R', 'G', 'B', 15) }, + { AV_PIX_FMT_BGR555LE, MKTAG('B', 'G', 'R', 15) }, + { AV_PIX_FMT_RGB565LE, MKTAG('R', 'G', 'B', 16) }, + { AV_PIX_FMT_BGR565LE, MKTAG('B', 'G', 'R', 16) }, + { AV_PIX_FMT_RGB555BE, MKTAG(15 , 'B', 'G', 'R') }, + { AV_PIX_FMT_BGR555BE, MKTAG(15 , 'R', 'G', 'B') }, + { AV_PIX_FMT_RGB565BE, MKTAG(16 , 'B', 'G', 'R') }, + { AV_PIX_FMT_BGR565BE, MKTAG(16 , 'R', 'G', 'B') }, + { AV_PIX_FMT_RGB444LE, MKTAG('R', 'G', 'B', 12) }, + { AV_PIX_FMT_BGR444LE, MKTAG('B', 'G', 'R', 12) }, + { AV_PIX_FMT_RGB444BE, MKTAG(12 , 'B', 'G', 'R') }, + { AV_PIX_FMT_BGR444BE, MKTAG(12 , 'R', 'G', 'B') }, + { AV_PIX_FMT_RGBA64LE, MKTAG('R', 'B', 'A', 64 ) }, + { AV_PIX_FMT_BGRA64LE, MKTAG('B', 'R', 'A', 64 ) }, + { AV_PIX_FMT_RGBA64BE, MKTAG(64 , 'R', 'B', 'A') }, + { AV_PIX_FMT_BGRA64BE, MKTAG(64 , 'B', 'R', 'A') }, + { AV_PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') }, + { AV_PIX_FMT_RGB0, MKTAG('R', 'G', 'B', 0 ) }, + { AV_PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') }, + { AV_PIX_FMT_BGR0, MKTAG('B', 'G', 'R', 0 ) }, + { AV_PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') }, + { AV_PIX_FMT_0BGR, MKTAG( 0 , 'B', 'G', 'R') }, + { AV_PIX_FMT_ARGB, MKTAG('A', 'R', 'G', 'B') }, + { AV_PIX_FMT_0RGB, MKTAG( 0 , 'R', 'G', 'B') }, + { AV_PIX_FMT_RGB24, MKTAG('R', 'G', 'B', 24 ) }, + { AV_PIX_FMT_BGR24, MKTAG('B', 'G', 'R', 24 ) }, + { AV_PIX_FMT_YUV411P, MKTAG('4', '1', '1', 'P') }, + { AV_PIX_FMT_YUV422P, MKTAG('4', '2', '2', 'P') }, + { AV_PIX_FMT_YUVJ422P, MKTAG('4', '2', '2', 'P') }, + { AV_PIX_FMT_YUV440P, MKTAG('4', '4', '0', 'P') }, + { AV_PIX_FMT_YUVJ440P, MKTAG('4', '4', '0', 'P') }, + { AV_PIX_FMT_YUV444P, MKTAG('4', '4', '4', 'P') }, + { AV_PIX_FMT_YUVJ444P, MKTAG('4', '4', '4', 'P') }, + { AV_PIX_FMT_MONOWHITE,MKTAG('B', '1', 'W', '0') }, + { AV_PIX_FMT_MONOBLACK,MKTAG('B', '0', 'W', '1') }, + { AV_PIX_FMT_BGR8, MKTAG('B', 'G', 'R', 8 ) }, + { AV_PIX_FMT_RGB8, MKTAG('R', 'G', 'B', 8 ) }, + { AV_PIX_FMT_BGR4, MKTAG('B', 'G', 'R', 4 ) }, + { AV_PIX_FMT_RGB4, MKTAG('R', 'G', 'B', 4 ) }, + { AV_PIX_FMT_RGB4_BYTE,MKTAG('B', '4', 'B', 'Y') }, + { AV_PIX_FMT_BGR4_BYTE,MKTAG('R', '4', 'B', 'Y') }, + { AV_PIX_FMT_RGB48LE, MKTAG('R', 'G', 'B', 48 ) }, + { AV_PIX_FMT_RGB48BE, MKTAG( 48, 'R', 'G', 'B') }, + { AV_PIX_FMT_BGR48LE, MKTAG('B', 'G', 'R', 48 ) }, + { AV_PIX_FMT_BGR48BE, MKTAG( 48, 'B', 'G', 'R') }, + { AV_PIX_FMT_GRAY16LE, MKTAG('Y', '1', 0 , 16 ) }, + { AV_PIX_FMT_GRAY16BE, MKTAG(16 , 0 , '1', 'Y') }, + { AV_PIX_FMT_YUV420P10LE, MKTAG('Y', '3', 11 , 10 ) }, + { AV_PIX_FMT_YUV420P10BE, MKTAG(10 , 11 , '3', 'Y') }, + { AV_PIX_FMT_YUV422P10LE, MKTAG('Y', '3', 10 , 10 ) }, + { AV_PIX_FMT_YUV422P10BE, MKTAG(10 , 10 , '3', 'Y') }, + { AV_PIX_FMT_YUV444P10LE, MKTAG('Y', '3', 0 , 10 ) }, + { AV_PIX_FMT_YUV444P10BE, MKTAG(10 , 0 , '3', 'Y') }, + { AV_PIX_FMT_YUV420P12LE, MKTAG('Y', '3', 11 , 12 ) }, + { AV_PIX_FMT_YUV420P12BE, MKTAG(12 , 11 , '3', 'Y') }, + { AV_PIX_FMT_YUV422P12LE, MKTAG('Y', '3', 10 , 12 ) }, + { AV_PIX_FMT_YUV422P12BE, MKTAG(12 , 10 , '3', 'Y') }, + { AV_PIX_FMT_YUV444P12LE, MKTAG('Y', '3', 0 , 12 ) }, + { AV_PIX_FMT_YUV444P12BE, MKTAG(12 , 0 , '3', 'Y') }, + { AV_PIX_FMT_YUV420P14LE, MKTAG('Y', '3', 11 , 14 ) }, + { AV_PIX_FMT_YUV420P14BE, MKTAG(14 , 11 , '3', 'Y') }, + { AV_PIX_FMT_YUV422P14LE, MKTAG('Y', '3', 10 , 14 ) }, + { AV_PIX_FMT_YUV422P14BE, MKTAG(14 , 10 , '3', 'Y') }, + { AV_PIX_FMT_YUV444P14LE, MKTAG('Y', '3', 0 , 14 ) }, + { AV_PIX_FMT_YUV444P14BE, MKTAG(14 , 0 , '3', 'Y') }, + { AV_PIX_FMT_YUV420P16LE, MKTAG('Y', '3', 11 , 16 ) }, + { AV_PIX_FMT_YUV420P16BE, MKTAG(16 , 11 , '3', 'Y') }, + { AV_PIX_FMT_YUV422P16LE, MKTAG('Y', '3', 10 , 16 ) }, + { AV_PIX_FMT_YUV422P16BE, MKTAG(16 , 10 , '3', 'Y') }, + { AV_PIX_FMT_YUV444P16LE, MKTAG('Y', '3', 0 , 16 ) }, + { AV_PIX_FMT_YUV444P16BE, MKTAG(16 , 0 , '3', 'Y') }, + { AV_PIX_FMT_YUVA420P, MKTAG('Y', '4', 11 , 8 ) }, + { AV_PIX_FMT_YUVA422P, MKTAG('Y', '4', 10 , 8 ) }, + { AV_PIX_FMT_YUVA444P, MKTAG('Y', '4', 0 , 8 ) }, + { AV_PIX_FMT_GRAY8A, MKTAG('Y', '2', 0 , 8 ) }, /* quicktime */ - { PIX_FMT_YUV420P, MKTAG('R', '4', '2', '0') }, /* Radius DV YUV PAL */ - { PIX_FMT_YUV411P, MKTAG('R', '4', '1', '1') }, /* Radius DV YUV NTSC */ - { PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') }, - { PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', 'y') }, - { PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */ - { PIX_FMT_UYVY422, MKTAG('b', 'x', 'y', 'v') }, - { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') }, - { PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') }, - { PIX_FMT_YUYV422, MKTAG('D', 'V', 'O', 'O') }, /* Digital Voodoo SD 8 Bit */ - { PIX_FMT_RGB555LE,MKTAG('L', '5', '5', '5') }, - { PIX_FMT_RGB565LE,MKTAG('L', '5', '6', '5') }, - { PIX_FMT_RGB565BE,MKTAG('B', '5', '6', '5') }, - { PIX_FMT_BGR24, MKTAG('2', '4', 'B', 'G') }, - { PIX_FMT_BGR24, MKTAG('b', 'x', 'b', 'g') }, - { PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') }, - { PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') }, - { PIX_FMT_RGB24, MKTAG('b', 'x', 'r', 'g') }, - { PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') }, - { PIX_FMT_GRAY16BE,MKTAG('b', '1', '6', 'g') }, - { PIX_FMT_RGB48BE, MKTAG('b', '4', '8', 'r') }, + { AV_PIX_FMT_YUV420P, MKTAG('R', '4', '2', '0') }, /* Radius DV YUV PAL */ + { AV_PIX_FMT_YUV411P, MKTAG('R', '4', '1', '1') }, /* Radius DV YUV NTSC */ + { AV_PIX_FMT_UYVY422, MKTAG('2', 'v', 'u', 'y') }, + { AV_PIX_FMT_UYVY422, MKTAG('2', 'V', 'u', 'y') }, + { AV_PIX_FMT_UYVY422, MKTAG('A', 'V', 'U', 'I') }, /* FIXME merge both fields */ + { AV_PIX_FMT_UYVY422, MKTAG('b', 'x', 'y', 'v') }, + { AV_PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', '2') }, + { AV_PIX_FMT_YUYV422, MKTAG('y', 'u', 'v', 's') }, + { AV_PIX_FMT_YUYV422, MKTAG('D', 'V', 'O', 'O') }, /* Digital Voodoo SD 8 Bit */ + { AV_PIX_FMT_RGB555LE,MKTAG('L', '5', '5', '5') }, + { AV_PIX_FMT_RGB565LE,MKTAG('L', '5', '6', '5') }, + { AV_PIX_FMT_RGB565BE,MKTAG('B', '5', '6', '5') }, + { AV_PIX_FMT_BGR24, MKTAG('2', '4', 'B', 'G') }, + { AV_PIX_FMT_BGR24, MKTAG('b', 'x', 'b', 'g') }, + { AV_PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') }, + { AV_PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') }, + { AV_PIX_FMT_RGB24, MKTAG('b', 'x', 'r', 'g') }, + { AV_PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') }, + { AV_PIX_FMT_GRAY16BE,MKTAG('b', '1', '6', 'g') }, + { AV_PIX_FMT_RGB48BE, MKTAG('b', '4', '8', 'r') }, /* special */ - { PIX_FMT_RGB565LE,MKTAG( 3 , 0 , 0 , 0 ) }, /* flipped RGB565LE */ - { PIX_FMT_YUV444P, MKTAG('Y', 'V', '2', '4') }, /* YUV444P, swapped UV */ - { PIX_FMT_YUYV422, MKTAG('Y', 'V', 'Y', 'U') }, /* YUYV, swapped UV */ + { AV_PIX_FMT_RGB565LE,MKTAG( 3 , 0 , 0 , 0 ) }, /* flipped RGB565LE */ + { AV_PIX_FMT_YUV444P, MKTAG('Y', 'V', '2', '4') }, /* YUV444P, swapped UV */ + { AV_PIX_FMT_YUYV422, MKTAG('Y', 'V', 'Y', 'U') }, /* YUYV, swapped UV */ - { PIX_FMT_NONE, 0 }, + { AV_PIX_FMT_NONE, 0 }, }; -unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat fmt) +unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat fmt) { const PixelFormatTag *tags = ff_raw_pix_fmt_tags; while (tags->pix_fmt >= 0) { diff --git a/libavcodec/raw.h b/libavcodec/raw.h index 4724cd3547..b704b9cee8 100644 --- a/libavcodec/raw.h +++ b/libavcodec/raw.h @@ -30,11 +30,11 @@ #include "avcodec.h" typedef struct PixelFormatTag { - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; unsigned int fourcc; } PixelFormatTag; extern const PixelFormatTag ff_raw_pix_fmt_tags[]; -enum PixelFormat ff_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc); +enum AVPixelFormat ff_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc); #endif /* AVCODEC_RAW_H */ diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index 8eb0fae48d..98d49b30f2 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -54,40 +54,40 @@ static const AVClass class = { }; static const PixelFormatTag pix_fmt_bps_avi[] = { - { PIX_FMT_MONOWHITE, 1 }, - { PIX_FMT_PAL8, 2 }, - { PIX_FMT_PAL8, 4 }, - { PIX_FMT_PAL8, 8 }, - { PIX_FMT_RGB444, 12 }, - { PIX_FMT_RGB555, 15 }, - { PIX_FMT_RGB555, 16 }, - { PIX_FMT_BGR24, 24 }, - { PIX_FMT_BGRA, 32 }, - { PIX_FMT_NONE, 0 }, + { AV_PIX_FMT_MONOWHITE, 1 }, + { AV_PIX_FMT_PAL8, 2 }, + { AV_PIX_FMT_PAL8, 4 }, + { AV_PIX_FMT_PAL8, 8 }, + { AV_PIX_FMT_RGB444, 12 }, + { AV_PIX_FMT_RGB555, 15 }, + { AV_PIX_FMT_RGB555, 16 }, + { AV_PIX_FMT_BGR24, 24 }, + { AV_PIX_FMT_BGRA, 32 }, + { AV_PIX_FMT_NONE, 0 }, }; static const PixelFormatTag pix_fmt_bps_mov[] = { - { PIX_FMT_MONOWHITE, 1 }, - { PIX_FMT_PAL8, 2 }, - { PIX_FMT_PAL8, 4 }, - { PIX_FMT_PAL8, 8 }, + { AV_PIX_FMT_MONOWHITE, 1 }, + { AV_PIX_FMT_PAL8, 2 }, + { AV_PIX_FMT_PAL8, 4 }, + { AV_PIX_FMT_PAL8, 8 }, // FIXME swscale does not support 16 bit in .mov, sample 16bit.mov // http://developer.apple.com/documentation/QuickTime/QTFF/QTFFChap3/qtff3.html - { PIX_FMT_RGB555BE, 16 }, - { PIX_FMT_RGB24, 24 }, - { PIX_FMT_ARGB, 32 }, - { PIX_FMT_MONOWHITE,33 }, - { PIX_FMT_NONE, 0 }, + { AV_PIX_FMT_RGB555BE, 16 }, + { AV_PIX_FMT_RGB24, 24 }, + { AV_PIX_FMT_ARGB, 32 }, + { AV_PIX_FMT_MONOWHITE,33 }, + { AV_PIX_FMT_NONE, 0 }, }; -enum PixelFormat ff_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc) +enum AVPixelFormat ff_find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc) { while (tags->pix_fmt >= 0) { if (tags->fourcc == fourcc) return tags->pix_fmt; tags++; } - return PIX_FMT_YUV420P; + return AV_PIX_FMT_YUV420P; } static av_cold int raw_init_decoder(AVCodecContext *avctx) @@ -100,17 +100,17 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx) avctx->pix_fmt = ff_find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample); else if (avctx->codec_tag) avctx->pix_fmt = ff_find_pix_fmt(ff_raw_pix_fmt_tags, avctx->codec_tag); - else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample) + else if (avctx->pix_fmt == AV_PIX_FMT_NONE && avctx->bits_per_coded_sample) avctx->pix_fmt = ff_find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample); - if (avctx->pix_fmt == PIX_FMT_NONE) { + if (avctx->pix_fmt == AV_PIX_FMT_NONE) { av_log(avctx, AV_LOG_ERROR, "Pixel format was not specified and cannot be detected\n"); return AVERROR(EINVAL); } ff_set_systematic_pal2(context->palette, avctx->pix_fmt); if((avctx->bits_per_coded_sample == 4 || avctx->bits_per_coded_sample == 2) && - avctx->pix_fmt==PIX_FMT_PAL8 && + avctx->pix_fmt==AV_PIX_FMT_PAL8 && (!avctx->codec_tag || avctx->codec_tag == MKTAG('r','a','w',' '))){ context->length = avpicture_get_size(avctx->pix_fmt, FFALIGN(avctx->width, 16), avctx->height); context->buffer = av_malloc(context->length); @@ -196,7 +196,7 @@ static int raw_decode(AVCodecContext *avctx, avctx->codec_tag == MKTAG('A', 'V', 'u', 'p')) buf += buf_size - context->length; - len = context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? AVPALETTE_SIZE : 0); + len = context->length - (avctx->pix_fmt==AV_PIX_FMT_PAL8 ? AVPALETTE_SIZE : 0); if (buf_size < len) { av_log(avctx, AV_LOG_ERROR, "Invalid buffer size, packet size %d < expected length %d\n", buf_size, len); return AVERROR(EINVAL); @@ -205,11 +205,11 @@ static int raw_decode(AVCodecContext *avctx, if ((res = avpicture_fill(picture, buf, avctx->pix_fmt, avctx->width, avctx->height)) < 0) return res; - if((avctx->pix_fmt==PIX_FMT_PAL8 && buf_size < context->length) || + if((avctx->pix_fmt==AV_PIX_FMT_PAL8 && buf_size < context->length) || (av_pix_fmt_descriptors[avctx->pix_fmt].flags & PIX_FMT_PSEUDOPAL)) { frame->data[1]= (uint8_t*)context->palette; } - if (avctx->pix_fmt == PIX_FMT_PAL8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL); if (pal) { @@ -217,13 +217,13 @@ static int raw_decode(AVCodecContext *avctx, frame->palette_has_changed = 1; } } - if((avctx->pix_fmt==PIX_FMT_BGR24 || - avctx->pix_fmt==PIX_FMT_GRAY8 || - avctx->pix_fmt==PIX_FMT_RGB555LE || - avctx->pix_fmt==PIX_FMT_RGB555BE || - avctx->pix_fmt==PIX_FMT_RGB565LE || - avctx->pix_fmt==PIX_FMT_MONOWHITE || - avctx->pix_fmt==PIX_FMT_PAL8) && + if((avctx->pix_fmt==AV_PIX_FMT_BGR24 || + avctx->pix_fmt==AV_PIX_FMT_GRAY8 || + avctx->pix_fmt==AV_PIX_FMT_RGB555LE || + avctx->pix_fmt==AV_PIX_FMT_RGB555BE || + avctx->pix_fmt==AV_PIX_FMT_RGB565LE || + avctx->pix_fmt==AV_PIX_FMT_MONOWHITE || + avctx->pix_fmt==AV_PIX_FMT_PAL8) && FFALIGN(frame->linesize[0], linesize_align)*avctx->height <= buf_size) frame->linesize[0] = FFALIGN(frame->linesize[0], linesize_align); @@ -237,7 +237,7 @@ static int raw_decode(AVCodecContext *avctx, FFSWAP(uint8_t *, picture->data[1], picture->data[2]); if(avctx->codec_tag == AV_RL32("yuv2") && - avctx->pix_fmt == PIX_FMT_YUYV422) { + avctx->pix_fmt == AV_PIX_FMT_YUYV422) { int x, y; uint8_t *line = picture->data[0]; for(y = 0; y < avctx->height; y++) { @@ -247,7 +247,7 @@ static int raw_decode(AVCodecContext *avctx, } } if(avctx->codec_tag == AV_RL32("YVYU") && - avctx->pix_fmt == PIX_FMT_YUYV422) { + avctx->pix_fmt == AV_PIX_FMT_YUYV422) { int x, y; uint8_t *line = picture->data[0]; for(y = 0; y < avctx->height; y++) { diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index 9d61e81618..abc650e0ba 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -57,7 +57,7 @@ static int raw_encode(AVCodecContext *avctx, AVPacket *pkt, return ret; if(avctx->codec_tag == AV_RL32("yuv2") && ret > 0 && - avctx->pix_fmt == PIX_FMT_YUYV422) { + avctx->pix_fmt == AV_PIX_FMT_YUYV422) { int x; for(x = 1; x < avctx->height*avctx->width*2; x += 2) pkt->data[x] ^= 0x80; diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 151b884a3b..96041a6d55 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -134,7 +134,7 @@ static av_cold int rl2_decode_init(AVCodecContext *avctx) int back_size; int i; s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&s->frame); /** parse extra data */ diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index b4cf454e9a..a6f213c4de 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -175,7 +175,7 @@ static av_cold int roq_decode_init(AVCodecContext *avctx) avcodec_get_frame_defaults(&s->frames[1]); s->last_frame = &s->frames[0]; s->current_frame = &s->frames[1]; - avctx->pix_fmt = PIX_FMT_YUV444P; + avctx->pix_fmt = AV_PIX_FMT_YUV444P; return 0; } diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index eee00466fb..b38ecab561 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -1079,7 +1079,7 @@ AVCodec ff_roq_encoder = { .encode2 = roq_encode_frame, .close = roq_encode_end, .supported_framerates = (const AVRational[]){ {30,1}, {0,0} }, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV444P, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("id RoQ video"), }; diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index b12bf04fa2..498c36e7b8 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -236,7 +236,7 @@ static av_cold int rpza_decode_init(AVCodecContext *avctx) RpzaContext *s = avctx->priv_data; s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; avcodec_get_frame_defaults(&s->frame); s->frame.data[0] = NULL; diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 49072dea9f..21dec46c55 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -493,7 +493,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_DEBUG, "ver:%X ver0:%X\n", rv->sub_id, avctx->extradata_size >= 4 ? ((uint32_t*)avctx->extradata)[0] : -1); } - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; if (ff_MPV_common_init(s) < 0) return -1; diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c index 7a2045ae1e..c4c5c53850 100644 --- a/libavcodec/rv10enc.c +++ b/libavcodec/rv10enc.c @@ -66,7 +66,7 @@ AVCodec ff_rv10_encoder = { .init = ff_MPV_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("RealVideo 1.0"), .priv_class = &rv10_class, }; diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c index 2d21818806..295699a43a 100644 --- a/libavcodec/rv20enc.c +++ b/libavcodec/rv20enc.c @@ -67,7 +67,7 @@ AVCodec ff_rv20_encoder = { .init = ff_MPV_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("RealVideo 2.0"), .priv_class = &rv20_class, }; diff --git a/libavcodec/rv34.c b/libavcodec/rv34.c index 4ca134e208..4226ecb1f8 100644 --- a/libavcodec/rv34.c +++ b/libavcodec/rv34.c @@ -1483,7 +1483,7 @@ av_cold int ff_rv34_decode_init(AVCodecContext *avctx) r->s.avctx = avctx; avctx->flags |= CODEC_FLAG_EMU_EDGE; r->s.flags |= CODEC_FLAG_EMU_EDGE; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->has_b_frames = 1; s->low_delay = 0; diff --git a/libavcodec/sanm.c b/libavcodec/sanm.c index 3736bd74ec..2a04706c2e 100644 --- a/libavcodec/sanm.c +++ b/libavcodec/sanm.c @@ -261,7 +261,7 @@ static av_cold int decode_init(AVCodecContext *avctx) ctx->avctx = avctx; ctx->version = !avctx->extradata_size; - avctx->pix_fmt = ctx->version ? PIX_FMT_RGB565 : PIX_FMT_PAL8; + avctx->pix_fmt = ctx->version ? AV_PIX_FMT_RGB565 : AV_PIX_FMT_PAL8; init_sizes(ctx, avctx->width, avctx->height); if (init_buffers(ctx)) { diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index 370473af7d..e9ada699e4 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -192,11 +192,11 @@ static int decode_frame(AVCodecContext *avctx, } if (s->depth == SGI_GRAYSCALE) { - avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_GRAY16BE : PIX_FMT_GRAY8; + avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY8; } else if (s->depth == SGI_RGB) { - avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_RGB48BE : PIX_FMT_RGB24; + avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGB48BE : AV_PIX_FMT_RGB24; } else if (s->depth == SGI_RGBA) { - avctx->pix_fmt = s->bytes_per_channel == 2 ? PIX_FMT_RGBA64BE : PIX_FMT_RGBA; + avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGBA64BE : AV_PIX_FMT_RGBA; } else { av_log(avctx, AV_LOG_ERROR, "wrong picture format\n"); return -1; diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c index 77b471b986..d03ef52603 100644 --- a/libavcodec/sgienc.c +++ b/libavcodec/sgienc.c @@ -68,39 +68,39 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, put_be = HAVE_BIGENDIAN; switch (avctx->pix_fmt) { - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: dimension = SGI_SINGLE_CHAN; depth = SGI_GRAYSCALE; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: dimension = SGI_MULTI_CHAN; depth = SGI_RGB; break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: dimension = SGI_MULTI_CHAN; depth = SGI_RGBA; break; - case PIX_FMT_GRAY16LE: + case AV_PIX_FMT_GRAY16LE: put_be = !HAVE_BIGENDIAN; - case PIX_FMT_GRAY16BE: + case AV_PIX_FMT_GRAY16BE: avctx->coder_type = FF_CODER_TYPE_RAW; bytes_per_channel = 2; pixmax = 0xFFFF; dimension = SGI_SINGLE_CHAN; depth = SGI_GRAYSCALE; break; - case PIX_FMT_RGB48LE: + case AV_PIX_FMT_RGB48LE: put_be = !HAVE_BIGENDIAN; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: avctx->coder_type = FF_CODER_TYPE_RAW; bytes_per_channel = 2; pixmax = 0xFFFF; dimension = SGI_MULTI_CHAN; depth = SGI_RGB; break; - case PIX_FMT_RGBA64LE: + case AV_PIX_FMT_RGBA64LE: put_be = !HAVE_BIGENDIAN; - case PIX_FMT_RGBA64BE: + case AV_PIX_FMT_RGBA64BE: avctx->coder_type = FF_CODER_TYPE_RAW; bytes_per_channel = 2; pixmax = 0xFFFF; @@ -217,12 +217,12 @@ AVCodec ff_sgi_encoder = { .priv_data_size = sizeof(SgiContext), .init = encode_init, .encode2 = encode_frame, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_RGB24, PIX_FMT_RGBA, - PIX_FMT_RGB48LE, PIX_FMT_RGB48BE, - PIX_FMT_RGBA64LE, PIX_FMT_RGBA64BE, - PIX_FMT_GRAY16LE, PIX_FMT_GRAY16BE, - PIX_FMT_GRAY8, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, + AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE, + AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE, + AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, + AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("SGI image"), }; diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index e02c76c942..fa4812c6d8 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -521,7 +521,7 @@ static av_cold int decode_init(AVCodecContext *avctx) c->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&c->pic); diff --git a/libavcodec/smc.c b/libavcodec/smc.c index 37b7409584..402c8040f0 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -414,7 +414,7 @@ static av_cold int smc_decode_init(AVCodecContext *avctx) SmcContext *s = avctx->priv_data; s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&s->frame); s->frame.data[0] = NULL; diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index 22d4f9200c..f377409678 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -292,15 +292,15 @@ static int decode_header(SnowContext *s){ s->chroma_v_shift= get_symbol(&s->c, s->header_state, 0); if(s->chroma_h_shift == 1 && s->chroma_v_shift==1){ - s->avctx->pix_fmt= PIX_FMT_YUV420P; + s->avctx->pix_fmt= AV_PIX_FMT_YUV420P; }else if(s->chroma_h_shift == 0 && s->chroma_v_shift==0){ - s->avctx->pix_fmt= PIX_FMT_YUV444P; + s->avctx->pix_fmt= AV_PIX_FMT_YUV444P; }else if(s->chroma_h_shift == 2 && s->chroma_v_shift==2){ - s->avctx->pix_fmt= PIX_FMT_YUV410P; + s->avctx->pix_fmt= AV_PIX_FMT_YUV410P; } else { av_log(s, AV_LOG_ERROR, "unsupported color subsample mode %d %d\n", s->chroma_h_shift, s->chroma_v_shift); s->chroma_h_shift = s->chroma_v_shift = 1; - s->avctx->pix_fmt= PIX_FMT_YUV420P; + s->avctx->pix_fmt= AV_PIX_FMT_YUV420P; return AVERROR_INVALIDDATA; } diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index ca422cae1d..cbdf9781a8 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -218,15 +218,15 @@ static av_cold int encode_init(AVCodecContext *avctx) avctx->coded_frame= &s->current_picture; switch(avctx->pix_fmt){ - case PIX_FMT_YUV444P: -// case PIX_FMT_YUV422P: - case PIX_FMT_YUV420P: -// case PIX_FMT_GRAY8: -// case PIX_FMT_YUV411P: - case PIX_FMT_YUV410P: + case AV_PIX_FMT_YUV444P: +// case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV420P: +// case AV_PIX_FMT_GRAY8: +// case AV_PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV410P: s->colorspace_type= 0; break; -/* case PIX_FMT_RGB32: +/* case AV_PIX_FMT_RGB32: s->colorspace= 1; break;*/ default: @@ -1946,9 +1946,9 @@ AVCodec ff_snow_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_YUV420P, PIX_FMT_YUV410P, PIX_FMT_YUV444P, - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Snow"), .priv_class = &snowenc_class, diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index 7724f0fdb2..f20e6820be 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -94,19 +94,19 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, switch (depth) { case 1: - avctx->pix_fmt = maplength ? PIX_FMT_PAL8 : PIX_FMT_MONOWHITE; + avctx->pix_fmt = maplength ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_MONOWHITE; break; case 4: - avctx->pix_fmt = maplength ? PIX_FMT_PAL8 : PIX_FMT_NONE; + avctx->pix_fmt = maplength ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_NONE; break; case 8: - avctx->pix_fmt = maplength ? PIX_FMT_PAL8 : PIX_FMT_GRAY8; + avctx->pix_fmt = maplength ? AV_PIX_FMT_PAL8 : AV_PIX_FMT_GRAY8; break; case 24: - avctx->pix_fmt = (type == RT_FORMAT_RGB) ? PIX_FMT_RGB24 : PIX_FMT_BGR24; + avctx->pix_fmt = (type == RT_FORMAT_RGB) ? AV_PIX_FMT_RGB24 : AV_PIX_FMT_BGR24; break; case 32: - avctx->pix_fmt = (type == RT_FORMAT_RGB) ? PIX_FMT_0RGB : PIX_FMT_0BGR; + avctx->pix_fmt = (type == RT_FORMAT_RGB) ? AV_PIX_FMT_0RGB : AV_PIX_FMT_0BGR; break; default: av_log(avctx, AV_LOG_ERROR, "invalid depth\n"); @@ -195,7 +195,7 @@ static int sunrast_decode_frame(AVCodecContext *avctx, void *data, buf += alen; } } - if (avctx->pix_fmt == PIX_FMT_PAL8 && depth < 8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8 && depth < 8) { uint8_t *ptr_free = ptr2; ptr = p->data[0]; for (y=0; y<h; y++) { diff --git a/libavcodec/sunrastenc.c b/libavcodec/sunrastenc.c index e8caa25ae1..2c7e72f5a3 100644 --- a/libavcodec/sunrastenc.c +++ b/libavcodec/sunrastenc.c @@ -156,16 +156,16 @@ static av_cold int sunrast_encode_init(AVCodecContext *avctx) s->maplength = 0; switch (avctx->pix_fmt) { - case PIX_FMT_MONOWHITE: + case AV_PIX_FMT_MONOWHITE: s->depth = 1; break; - case PIX_FMT_PAL8 : + case AV_PIX_FMT_PAL8 : s->maptype = RMT_EQUAL_RGB; s->maplength = 3 * 256; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: s->depth = 8; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: s->depth = 24; break; default: @@ -215,10 +215,10 @@ AVCodec ff_sunrast_encoder = { .init = sunrast_encode_init, .encode2 = sunrast_encode_frame, .defaults = sunrast_defaults, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_BGR24, - PIX_FMT_PAL8, - PIX_FMT_GRAY8, - PIX_FMT_MONOWHITE, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, + AV_PIX_FMT_PAL8, + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_MONOWHITE, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Sun Rasterfile image"), }; diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 2e5600a54a..3da93f18a0 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -717,7 +717,7 @@ static av_cold int svq1_decode_init(AVCodecContext *avctx) s->width = (avctx->width+3)&~3; s->height = (avctx->height+3)&~3; s->codec_id= avctx->codec->id; - avctx->pix_fmt = PIX_FMT_YUV410P; + avctx->pix_fmt = AV_PIX_FMT_YUV410P; avctx->has_b_frames= 1; // not true, but DP frames and these behave like unidirectional b frames s->flags= avctx->flags; if (ff_MPV_common_init(s) < 0) return -1; @@ -777,6 +777,6 @@ AVCodec ff_svq1_decoder = { .decode = svq1_decode_frame, .capabilities = CODEC_CAP_DR1, .flush = ff_mpeg_flush, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV410P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), }; diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index edd3507227..6c048f0bb0 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -508,7 +508,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt, if ((ret = ff_alloc_packet2(avctx, pkt, s->y_block_width*s->y_block_height*MAX_MB_BYTES*3 + FF_MIN_BUFFER_SIZE) < 0)) return ret; - if(avctx->pix_fmt != PIX_FMT_YUV410P){ + if(avctx->pix_fmt != AV_PIX_FMT_YUV410P){ av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n"); return -1; } @@ -587,6 +587,6 @@ AVCodec ff_svq1_encoder = { .init = svq1_encode_init, .encode2 = svq1_encode_frame, .close = svq1_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV410P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV410P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1"), }; diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 9342935ded..c1c0102a45 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1142,5 +1142,5 @@ AVCodec ff_svq3_decoder = { .capabilities = CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1 | CODEC_CAP_DELAY, .long_name = NULL_IF_CONFIG_SMALL("Sorenson Vector Quantizer 3 / Sorenson Video 3 / SVQ3"), - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUVJ420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE }, }; diff --git a/libavcodec/targa.c b/libavcodec/targa.c index 339d7c43a3..e0c19366a4 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -138,17 +138,17 @@ static int decode_frame(AVCodecContext *avctx, switch(bpp){ case 8: - avctx->pix_fmt = ((compr & (~TGA_RLE)) == TGA_BW) ? PIX_FMT_GRAY8 : PIX_FMT_PAL8; + avctx->pix_fmt = ((compr & (~TGA_RLE)) == TGA_BW) ? AV_PIX_FMT_GRAY8 : AV_PIX_FMT_PAL8; break; case 15: case 16: - avctx->pix_fmt = PIX_FMT_RGB555LE; + avctx->pix_fmt = AV_PIX_FMT_RGB555LE; break; case 24: - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; break; case 32: - avctx->pix_fmt = PIX_FMT_BGRA; + avctx->pix_fmt = AV_PIX_FMT_BGRA; break; default: av_log(avctx, AV_LOG_ERROR, "Bit depth %i is not supported\n", bpp); @@ -189,7 +189,7 @@ static int decode_frame(AVCodecContext *avctx, return -1; } pal_size = colors * pal_sample_size; - if(avctx->pix_fmt != PIX_FMT_PAL8)//should not occur but skip palette anyway + if(avctx->pix_fmt != AV_PIX_FMT_PAL8)//should not occur but skip palette anyway bytestream2_skip(&s->gb, pal_size); else{ int t; diff --git a/libavcodec/targa_y216dec.c b/libavcodec/targa_y216dec.c index 941861137a..bac5aeeddf 100644 --- a/libavcodec/targa_y216dec.c +++ b/libavcodec/targa_y216dec.c @@ -23,7 +23,7 @@ static av_cold int y216_decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUV422P16; + avctx->pix_fmt = AV_PIX_FMT_YUV422P16; avctx->bits_per_raw_sample = 14; avctx->coded_frame = avcodec_alloc_frame(); diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c index 2f22e94785..35e3ea5bdd 100644 --- a/libavcodec/targaenc.c +++ b/libavcodec/targaenc.c @@ -97,13 +97,13 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, AV_WL16(pkt->data+12, avctx->width); AV_WL16(pkt->data+14, avctx->height); /* image descriptor byte: origin is always top-left, bits 0-3 specify alpha */ - pkt->data[17] = 0x20 | (avctx->pix_fmt == PIX_FMT_BGRA ? 8 : 0); + pkt->data[17] = 0x20 | (avctx->pix_fmt == AV_PIX_FMT_BGRA ? 8 : 0); out = pkt->data + 18; /* skip past the header we write */ avctx->bits_per_coded_sample = av_get_bits_per_pixel(&av_pix_fmt_descriptors[avctx->pix_fmt]); switch(avctx->pix_fmt) { - case PIX_FMT_PAL8: + case AV_PIX_FMT_PAL8: pkt->data[1] = 1; /* palette present */ pkt->data[2] = TGA_PAL; /* uncompressed palettised image */ pkt->data[6] = 1; /* palette contains 256 entries */ @@ -113,21 +113,21 @@ static int targa_encode_frame(AVCodecContext *avctx, AVPacket *pkt, AV_WL24(pkt->data + 18 + 3 * i, *(uint32_t *)(p->data[1] + i * 4)); out += 256 * 3; /* skip past the palette we just output */ break; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: pkt->data[2] = TGA_BW; /* uncompressed grayscale image */ avctx->bits_per_coded_sample = 0x28; pkt->data[16] = 8; /* bpp */ break; - case PIX_FMT_RGB555LE: + case AV_PIX_FMT_RGB555LE: pkt->data[2] = TGA_RGB; /* uncompressed true-color image */ avctx->bits_per_coded_sample = pkt->data[16] = 16; /* bpp */ break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: pkt->data[2] = TGA_RGB; /* uncompressed true-color image */ pkt->data[16] = 24; /* bpp */ break; - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: pkt->data[2] = TGA_RGB; /* uncompressed true-color image */ pkt->data[16] = 32; /* bpp */ break; @@ -182,9 +182,9 @@ AVCodec ff_targa_encoder = { .priv_data_size = sizeof(TargaContext), .init = targa_encode_init, .encode2 = targa_encode_frame, - .pix_fmts = (const enum PixelFormat[]){ - PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_RGB555LE, PIX_FMT_GRAY8, PIX_FMT_PAL8, - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]){ + AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, + AV_PIX_FMT_NONE }, .long_name= NULL_IF_CONFIG_SMALL("Truevision Targa image"), }; diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index 75a985da83..e6bf0fdaa7 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -214,7 +214,7 @@ static av_cold int seqvideo_decode_init(AVCodecContext *avctx) SeqVideoContext *seq = avctx->priv_data; seq->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&seq->frame); seq->frame.data[0] = NULL; diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index 351504b4d1..1093180d00 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -417,7 +417,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride, } src = zbuf; for (line = 0; line < lines; line++) { - if(s->bpp < 8 && s->avctx->pix_fmt == PIX_FMT_PAL8){ + if(s->bpp < 8 && s->avctx->pix_fmt == AV_PIX_FMT_PAL8){ horizontal_fill(s->bpp, dst, 1, src, 0, width, 0); }else{ memcpy(dst, src, width); @@ -467,7 +467,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride, s->compr, s->fax_opts); break; } - if (s->bpp < 8 && s->avctx->pix_fmt == PIX_FMT_PAL8) + if (s->bpp < 8 && s->avctx->pix_fmt == AV_PIX_FMT_PAL8) for (line = 0; line < lines; line++) { horizontal_fill(s->bpp, dst, 1, dst, 0, width, 0); dst += stride; @@ -485,7 +485,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride, if (ssrc + size - src < width) return AVERROR_INVALIDDATA; if (!s->fill_order) { - horizontal_fill(s->bpp * (s->avctx->pix_fmt == PIX_FMT_PAL8), + horizontal_fill(s->bpp * (s->avctx->pix_fmt == AV_PIX_FMT_PAL8), dst, 1, src, 0, width, 0); } else { int i; @@ -512,7 +512,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride, av_log(s->avctx, AV_LOG_ERROR, "Read went out of bounds\n"); return AVERROR_INVALIDDATA; } - horizontal_fill(s->bpp * (s->avctx->pix_fmt == PIX_FMT_PAL8), + horizontal_fill(s->bpp * (s->avctx->pix_fmt == AV_PIX_FMT_PAL8), dst, 1, src, 0, code, pixels); src += code; pixels += code; @@ -524,7 +524,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride, return -1; } c = *src++; - horizontal_fill(s->bpp * (s->avctx->pix_fmt == PIX_FMT_PAL8), + horizontal_fill(s->bpp * (s->avctx->pix_fmt == AV_PIX_FMT_PAL8), dst, 0, NULL, c, code, pixels); pixels += code; } @@ -537,7 +537,7 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride, pixels, width); return -1; } - if (s->bpp < 8 && s->avctx->pix_fmt == PIX_FMT_PAL8) + if (s->bpp < 8 && s->avctx->pix_fmt == AV_PIX_FMT_PAL8) horizontal_fill(s->bpp, dst, 1, dst, 0, width, 0); break; } @@ -554,31 +554,31 @@ static int init_image(TiffContext *s) switch (s->bpp * 10 + s->bppcount) { case 11: if (!s->palette_is_set) { - s->avctx->pix_fmt = PIX_FMT_MONOBLACK; + s->avctx->pix_fmt = AV_PIX_FMT_MONOBLACK; break; } case 21: case 41: case 81: - s->avctx->pix_fmt = PIX_FMT_PAL8; + s->avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 243: - s->avctx->pix_fmt = PIX_FMT_RGB24; + s->avctx->pix_fmt = AV_PIX_FMT_RGB24; break; case 161: - s->avctx->pix_fmt = s->le ? PIX_FMT_GRAY16LE : PIX_FMT_GRAY16BE; + s->avctx->pix_fmt = s->le ? AV_PIX_FMT_GRAY16LE : AV_PIX_FMT_GRAY16BE; break; case 162: - s->avctx->pix_fmt = PIX_FMT_GRAY8A; + s->avctx->pix_fmt = AV_PIX_FMT_GRAY8A; break; case 324: - s->avctx->pix_fmt = PIX_FMT_RGBA; + s->avctx->pix_fmt = AV_PIX_FMT_RGBA; break; case 483: - s->avctx->pix_fmt = s->le ? PIX_FMT_RGB48LE : PIX_FMT_RGB48BE; + s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGB48LE : AV_PIX_FMT_RGB48BE; break; case 644: - s->avctx->pix_fmt = s->le ? PIX_FMT_RGBA64LE : PIX_FMT_RGBA64BE; + s->avctx->pix_fmt = s->le ? AV_PIX_FMT_RGBA64LE : AV_PIX_FMT_RGBA64BE; break; default: av_log(s->avctx, AV_LOG_ERROR, @@ -597,7 +597,7 @@ static int init_image(TiffContext *s) av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } - if (s->avctx->pix_fmt == PIX_FMT_PAL8) { + if (s->avctx->pix_fmt == AV_PIX_FMT_PAL8) { if (s->palette_is_set) { memcpy(s->picture.data[1], s->palette, sizeof(s->palette)); } else { @@ -1108,15 +1108,15 @@ static int decode_frame(AVCodecContext *avctx, dst = p->data[0]; soff = s->bpp >> 3; ssize = s->width * soff; - if (s->avctx->pix_fmt == PIX_FMT_RGB48LE || - s->avctx->pix_fmt == PIX_FMT_RGBA64LE) { + if (s->avctx->pix_fmt == AV_PIX_FMT_RGB48LE || + s->avctx->pix_fmt == AV_PIX_FMT_RGBA64LE) { for (i = 0; i < s->height; i++) { for (j = soff; j < ssize; j += 2) AV_WL16(dst + j, AV_RL16(dst + j) + AV_RL16(dst + j - soff)); dst += stride; } - } else if (s->avctx->pix_fmt == PIX_FMT_RGB48BE || - s->avctx->pix_fmt == PIX_FMT_RGBA64BE) { + } else if (s->avctx->pix_fmt == AV_PIX_FMT_RGB48BE || + s->avctx->pix_fmt == AV_PIX_FMT_RGBA64BE) { for (i = 0; i < s->height; i++) { for (j = soff; j < ssize; j += 2) AV_WB16(dst + j, AV_RB16(dst + j) + AV_RB16(dst + j - soff)); @@ -1135,7 +1135,7 @@ static int decode_frame(AVCodecContext *avctx, dst = s->picture.data[0]; for (i = 0; i < s->height; i++) { for (j = 0; j < s->picture.linesize[0]; j++) - dst[j] = (s->avctx->pix_fmt == PIX_FMT_PAL8 ? (1<<s->bpp) - 1 : 255) - dst[j]; + dst[j] = (s->avctx->pix_fmt == AV_PIX_FMT_PAL8 ? (1<<s->bpp) - 1 : 255) - dst[j]; dst += s->picture.linesize[0]; } } diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 689479fd76..8c30ed29dc 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -264,33 +264,33 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt, s->bpp_tab_size = av_pix_fmt_descriptors[avctx->pix_fmt].nb_components; switch (avctx->pix_fmt) { - case PIX_FMT_RGBA64LE: - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA64LE: + case AV_PIX_FMT_RGBA: alpha = 1; - case PIX_FMT_RGB48LE: - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB48LE: + case AV_PIX_FMT_RGB24: s->photometric_interpretation = 2; break; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: avctx->bits_per_coded_sample = 0x28; - case PIX_FMT_GRAY8A: - alpha = avctx->pix_fmt == PIX_FMT_GRAY8A; - case PIX_FMT_GRAY16LE: - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_GRAY8A: + alpha = avctx->pix_fmt == AV_PIX_FMT_GRAY8A; + case AV_PIX_FMT_GRAY16LE: + case AV_PIX_FMT_MONOBLACK: s->photometric_interpretation = 1; break; - case PIX_FMT_PAL8: + case AV_PIX_FMT_PAL8: s->photometric_interpretation = 3; break; - case PIX_FMT_MONOWHITE: + case AV_PIX_FMT_MONOWHITE: s->photometric_interpretation = 0; break; - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV440P: - case PIX_FMT_YUV444P: - case PIX_FMT_YUV410P: - case PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV440P: + case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_YUV410P: + case AV_PIX_FMT_YUV411P: s->photometric_interpretation = 6; avcodec_get_chroma_sub_sample(avctx->pix_fmt, &shift_h, &shift_v); @@ -454,7 +454,7 @@ static int encode_frame(AVCodecContext * avctx, AVPacket *pkt, add_entry(s, TIFF_SOFTWARE_NAME, TIFF_STRING, strlen(LIBAVCODEC_IDENT) + 1, LIBAVCODEC_IDENT); - if (avctx->pix_fmt == PIX_FMT_PAL8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { uint16_t pal[256 * 3]; for (i = 0; i < 256; i++) { uint32_t rgb = *(uint32_t *) (p->data[1] + i * 4); @@ -530,14 +530,14 @@ AVCodec ff_tiff_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .pix_fmts = (const enum PixelFormat[]) { - PIX_FMT_RGB24, PIX_FMT_PAL8, PIX_FMT_GRAY8, - PIX_FMT_GRAY8A, PIX_FMT_GRAY16LE, - PIX_FMT_MONOBLACK, PIX_FMT_MONOWHITE, - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV440P, PIX_FMT_YUV444P, - PIX_FMT_YUV410P, PIX_FMT_YUV411P, PIX_FMT_RGB48LE, - PIX_FMT_RGBA, PIX_FMT_RGBA64LE, - PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_RGB24, AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_GRAY8A, AV_PIX_FMT_GRAY16LE, + AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_MONOWHITE, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_RGB48LE, + AV_PIX_FMT_RGBA, AV_PIX_FMT_RGBA64LE, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("TIFF image"), .priv_class = &tiffenc_class, diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index fae37e6ed6..a0b3f36d92 100644 --- a/libavcodec/tmv.c +++ b/libavcodec/tmv.c @@ -89,7 +89,7 @@ static int tmv_decode_frame(AVCodecContext *avctx, void *data, static av_cold int tmv_decode_init(AVCodecContext *avctx) { TMVContext *tmv = avctx->priv_data; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&tmv->pic); return 0; } diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index fd4a355f12..b46366b837 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -390,10 +390,10 @@ static int truemotion1_decode_header(TrueMotion1Context *s) } if (compression_types[header.compression].algorithm == ALGO_RGB24H) { - new_pix_fmt = PIX_FMT_RGB32; + new_pix_fmt = AV_PIX_FMT_RGB32; width_shift = 1; } else - new_pix_fmt = PIX_FMT_RGB555; // RGB565 is supported as well + new_pix_fmt = AV_PIX_FMT_RGB555; // RGB565 is supported as well s->w >>= width_shift; if (av_image_check_size(s->w, s->h, 0, s->avctx) < 0) @@ -419,7 +419,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s) if (compression_types[header.compression].algorithm == ALGO_RGB24H) gen_vector_table24(s, sel_vector_table); else - if (s->avctx->pix_fmt == PIX_FMT_RGB555) + if (s->avctx->pix_fmt == AV_PIX_FMT_RGB555) gen_vector_table15(s, sel_vector_table); else gen_vector_table16(s, sel_vector_table); @@ -464,9 +464,9 @@ static av_cold int truemotion1_decode_init(AVCodecContext *avctx) // FIXME: it may change ? // if (avctx->bits_per_sample == 24) -// avctx->pix_fmt = PIX_FMT_RGB24; +// avctx->pix_fmt = AV_PIX_FMT_RGB24; // else -// avctx->pix_fmt = PIX_FMT_RGB555; +// avctx->pix_fmt = AV_PIX_FMT_RGB555; avcodec_get_frame_defaults(&s->frame); s->frame.data[0] = NULL; diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index e9fcf4db46..c7b7ac3d74 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -893,7 +893,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ l->avctx = avctx; l->pic.data[0]=NULL; - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; avcodec_get_frame_defaults(&l->pic); ff_dsputil_init(&l->dsp, avctx); diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index e85fdb52b3..1ba3bb97c6 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -110,7 +110,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac } /* make the palette available on the way out */ - if (c->avctx->pix_fmt == PIX_FMT_PAL8) { + if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) { const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, NULL); if (pal) { @@ -147,12 +147,12 @@ static av_cold int decode_init(AVCodecContext *avctx) // Needed if zlib unused or init aborted before inflateInit memset(&c->zstream, 0, sizeof(z_stream)); switch(avctx->bits_per_coded_sample){ - case 8: avctx->pix_fmt = PIX_FMT_PAL8; break; - case 16: avctx->pix_fmt = PIX_FMT_RGB555; break; + case 8: avctx->pix_fmt = AV_PIX_FMT_PAL8; break; + case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555; break; case 24: - avctx->pix_fmt = PIX_FMT_BGR24; + avctx->pix_fmt = AV_PIX_FMT_BGR24; break; - case 32: avctx->pix_fmt = PIX_FMT_RGB32; break; + case 32: avctx->pix_fmt = AV_PIX_FMT_RGB32; break; default: av_log(avctx, AV_LOG_ERROR, "Camtasia error: unknown depth %i bpp\n", avctx->bits_per_coded_sample); return AVERROR_PATCHWELCOME; } diff --git a/libavcodec/tscc2.c b/libavcodec/tscc2.c index d1dd8fd33f..483e97f920 100644 --- a/libavcodec/tscc2.c +++ b/libavcodec/tscc2.c @@ -336,7 +336,7 @@ static av_cold int tscc2_decode_init(AVCodecContext *avctx) c->avctx = avctx; - avctx->pix_fmt = PIX_FMT_YUV444P; + avctx->pix_fmt = AV_PIX_FMT_YUV444P; if ((ret = init_vlcs(c)) < 0) { av_log(avctx, AV_LOG_ERROR, "Cannot initialise VLCs\n"); diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 523e1e62ad..9ca6812a9a 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -69,9 +69,9 @@ static int txd_decode_frame(AVCodecContext *avctx, void *data, int *data_size, } if (depth == 8) { - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; } else if (depth == 16 || depth == 32) { - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; } else { av_log(avctx, AV_LOG_ERROR, "depth of %i is unsupported\n", depth); return -1; diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index 6e2da8b1af..f6d6418961 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -49,7 +49,7 @@ static av_cold int ulti_decode_init(AVCodecContext *avctx) s->width = avctx->width; s->height = avctx->height; s->blocks = (s->width / 8) * (s->height / 8); - avctx->pix_fmt = PIX_FMT_YUV410P; + avctx->pix_fmt = AV_PIX_FMT_YUV410P; avctx->coded_frame = &s->frame; avctx->coded_frame = (AVFrame*) &s->frame; s->ulti_codebook = ulti_codebook; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index be86fa0a6f..97d48cd1c3 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -184,82 +184,82 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, int h_align = 1; switch (s->pix_fmt) { - case PIX_FMT_YUV420P: - case PIX_FMT_YUYV422: - case PIX_FMT_UYVY422: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV440P: - case PIX_FMT_YUV444P: - case PIX_FMT_GBRP: - case PIX_FMT_GRAY8: - case PIX_FMT_GRAY16BE: - case PIX_FMT_GRAY16LE: - case PIX_FMT_YUVJ420P: - case PIX_FMT_YUVJ422P: - case PIX_FMT_YUVJ440P: - case PIX_FMT_YUVJ444P: - case PIX_FMT_YUVA420P: - case PIX_FMT_YUVA422P: - case PIX_FMT_YUVA444P: - case PIX_FMT_YUV420P9LE: - case PIX_FMT_YUV420P9BE: - case PIX_FMT_YUV420P10LE: - case PIX_FMT_YUV420P10BE: - case PIX_FMT_YUV420P12LE: - case PIX_FMT_YUV420P12BE: - case PIX_FMT_YUV420P14LE: - case PIX_FMT_YUV420P14BE: - case PIX_FMT_YUV422P9LE: - case PIX_FMT_YUV422P9BE: - case PIX_FMT_YUV422P10LE: - case PIX_FMT_YUV422P10BE: - case PIX_FMT_YUV422P12LE: - case PIX_FMT_YUV422P12BE: - case PIX_FMT_YUV422P14LE: - case PIX_FMT_YUV422P14BE: - case PIX_FMT_YUV444P9LE: - case PIX_FMT_YUV444P9BE: - case PIX_FMT_YUV444P10LE: - case PIX_FMT_YUV444P10BE: - case PIX_FMT_YUV444P12LE: - case PIX_FMT_YUV444P12BE: - case PIX_FMT_YUV444P14LE: - case PIX_FMT_YUV444P14BE: - case PIX_FMT_GBRP9LE: - case PIX_FMT_GBRP9BE: - case PIX_FMT_GBRP10LE: - case PIX_FMT_GBRP10BE: - case PIX_FMT_GBRP12LE: - case PIX_FMT_GBRP12BE: - case PIX_FMT_GBRP14LE: - case PIX_FMT_GBRP14BE: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUYV422: + case AV_PIX_FMT_UYVY422: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV440P: + case AV_PIX_FMT_YUV444P: + case AV_PIX_FMT_GBRP: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY16BE: + case AV_PIX_FMT_GRAY16LE: + case AV_PIX_FMT_YUVJ420P: + case AV_PIX_FMT_YUVJ422P: + case AV_PIX_FMT_YUVJ440P: + case AV_PIX_FMT_YUVJ444P: + case AV_PIX_FMT_YUVA420P: + case AV_PIX_FMT_YUVA422P: + case AV_PIX_FMT_YUVA444P: + case AV_PIX_FMT_YUV420P9LE: + case AV_PIX_FMT_YUV420P9BE: + case AV_PIX_FMT_YUV420P10LE: + case AV_PIX_FMT_YUV420P10BE: + case AV_PIX_FMT_YUV420P12LE: + case AV_PIX_FMT_YUV420P12BE: + case AV_PIX_FMT_YUV420P14LE: + case AV_PIX_FMT_YUV420P14BE: + case AV_PIX_FMT_YUV422P9LE: + case AV_PIX_FMT_YUV422P9BE: + case AV_PIX_FMT_YUV422P10LE: + case AV_PIX_FMT_YUV422P10BE: + case AV_PIX_FMT_YUV422P12LE: + case AV_PIX_FMT_YUV422P12BE: + case AV_PIX_FMT_YUV422P14LE: + case AV_PIX_FMT_YUV422P14BE: + case AV_PIX_FMT_YUV444P9LE: + case AV_PIX_FMT_YUV444P9BE: + case AV_PIX_FMT_YUV444P10LE: + case AV_PIX_FMT_YUV444P10BE: + case AV_PIX_FMT_YUV444P12LE: + case AV_PIX_FMT_YUV444P12BE: + case AV_PIX_FMT_YUV444P14LE: + case AV_PIX_FMT_YUV444P14BE: + case AV_PIX_FMT_GBRP9LE: + case AV_PIX_FMT_GBRP9BE: + case AV_PIX_FMT_GBRP10LE: + case AV_PIX_FMT_GBRP10BE: + case AV_PIX_FMT_GBRP12LE: + case AV_PIX_FMT_GBRP12BE: + case AV_PIX_FMT_GBRP14LE: + case AV_PIX_FMT_GBRP14BE: w_align = 16; //FIXME assume 16 pixel per macroblock h_align = 16 * 2; // interlaced needs 2 macroblocks height break; - case PIX_FMT_YUV411P: - case PIX_FMT_UYYVYY411: + case AV_PIX_FMT_YUV411P: + case AV_PIX_FMT_UYYVYY411: w_align = 32; h_align = 8; break; - case PIX_FMT_YUV410P: + case AV_PIX_FMT_YUV410P: if (s->codec_id == AV_CODEC_ID_SVQ1) { w_align = 64; h_align = 64; } - case PIX_FMT_RGB555: + case AV_PIX_FMT_RGB555: if (s->codec_id == AV_CODEC_ID_RPZA) { w_align = 4; h_align = 4; } - case PIX_FMT_PAL8: - case PIX_FMT_BGR8: - case PIX_FMT_RGB8: + case AV_PIX_FMT_PAL8: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_RGB8: if (s->codec_id == AV_CODEC_ID_SMC) { w_align = 4; h_align = 4; } break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: if ((s->codec_id == AV_CODEC_ID_MSZH) || (s->codec_id == AV_CODEC_ID_ZLIB)) { w_align = 4; @@ -686,9 +686,9 @@ int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, return 0; } -enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt) +enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat *fmt) { - while (*fmt != PIX_FMT_NONE && ff_is_hwaccel_pix_fmt(*fmt)) + while (*fmt != AV_PIX_FMT_NONE && ff_is_hwaccel_pix_fmt(*fmt)) ++fmt; return fmt[0]; } @@ -964,10 +964,10 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, const AVCodec *code } } if (avctx->codec->pix_fmts) { - for (i = 0; avctx->codec->pix_fmts[i] != PIX_FMT_NONE; i++) + for (i = 0; avctx->codec->pix_fmts[i] != AV_PIX_FMT_NONE; i++) if (avctx->pix_fmt == avctx->codec->pix_fmts[i]) break; - if (avctx->codec->pix_fmts[i] == PIX_FMT_NONE + if (avctx->codec->pix_fmts[i] == AV_PIX_FMT_NONE && !((avctx->codec_id == AV_CODEC_ID_MJPEG || avctx->codec_id == AV_CODEC_ID_LJPEG) && avctx->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL)) { av_log(avctx, AV_LOG_ERROR, "Specified pix_fmt is not supported\n"); @@ -1585,7 +1585,7 @@ int attribute_align_arg avcodec_decode_video2(AVCodecContext *avctx, AVFrame *pi if (!picture->sample_aspect_ratio.num) picture->sample_aspect_ratio = avctx->sample_aspect_ratio; if (!picture->width) picture->width = avctx->width; if (!picture->height) picture->height = avctx->height; - if (picture->format == PIX_FMT_NONE) picture->format = avctx->pix_fmt; + if (picture->format == AV_PIX_FMT_NONE) picture->format = avctx->pix_fmt; } emms_c(); //needed to avoid an emms_c() call before every return; @@ -2002,7 +2002,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) switch (enc->codec_type) { case AVMEDIA_TYPE_VIDEO: - if (enc->pix_fmt != PIX_FMT_NONE) { + if (enc->pix_fmt != AV_PIX_FMT_NONE) { snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %s", av_get_pix_fmt_name(enc->pix_fmt)); @@ -2468,7 +2468,7 @@ AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel) return hwaccel ? hwaccel->next : first_hwaccel; } -AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum PixelFormat pix_fmt) +AVHWAccel *ff_find_hwaccel(enum AVCodecID codec_id, enum AVPixelFormat pix_fmt) { AVHWAccel *hwaccel = NULL; diff --git a/libavcodec/utvideodec.c b/libavcodec/utvideodec.c index d08d6e8b95..cfeb46bbb0 100644 --- a/libavcodec/utvideodec.c +++ b/libavcodec/utvideodec.c @@ -86,7 +86,7 @@ static int decode_plane(UtvideoContext *c, int plane_no, VLC vlc; GetBitContext gb; int prev, fsym; - const int cmask = ~(!plane_no && c->avctx->pix_fmt == PIX_FMT_YUV420P); + const int cmask = ~(!plane_no && c->avctx->pix_fmt == AV_PIX_FMT_YUV420P); if (build_huff(src, &vlc, &fsym)) { av_log(c->avctx, AV_LOG_ERROR, "Cannot build Huffman codes\n"); @@ -391,8 +391,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, } switch (c->avctx->pix_fmt) { - case PIX_FMT_RGB24: - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGB24: + case AV_PIX_FMT_RGBA: for (i = 0; i < c->planes; i++) { ret = decode_plane(c, i, c->pic.data[0] + ff_ut_rgb_order[i], c->planes, c->pic.linesize[0], avctx->width, @@ -416,7 +416,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, restore_rgb_planes(c->pic.data[0], c->planes, c->pic.linesize[0], avctx->width, avctx->height); break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: for (i = 0; i < 3; i++) { ret = decode_plane(c, i, c->pic.data[i], 1, c->pic.linesize[i], avctx->width >> !!i, avctx->height >> !!i, @@ -437,7 +437,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, } } break; - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P: for (i = 0; i < 3; i++) { ret = decode_plane(c, i, c->pic.data[i], 1, c->pic.linesize[i], avctx->width >> !!i, avctx->height, @@ -505,19 +505,19 @@ static av_cold int decode_init(AVCodecContext *avctx) switch (avctx->codec_tag) { case MKTAG('U', 'L', 'R', 'G'): c->planes = 3; - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; break; case MKTAG('U', 'L', 'R', 'A'): c->planes = 4; - avctx->pix_fmt = PIX_FMT_RGBA; + avctx->pix_fmt = AV_PIX_FMT_RGBA; break; case MKTAG('U', 'L', 'Y', '0'): c->planes = 3; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; break; case MKTAG('U', 'L', 'Y', '2'): c->planes = 3; - avctx->pix_fmt = PIX_FMT_YUV422P; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; break; default: av_log(avctx, AV_LOG_ERROR, "Unknown Ut Video FOURCC provided (%08X)\n", diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c index fe5636fd0b..14d301ea8d 100644 --- a/libavcodec/utvideoenc.c +++ b/libavcodec/utvideoenc.c @@ -65,17 +65,17 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) c->slice_stride = FFALIGN(avctx->width, 32); switch (avctx->pix_fmt) { - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: c->planes = 3; avctx->codec_tag = MKTAG('U', 'L', 'R', 'G'); original_format = UTVIDEO_RGB; break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: c->planes = 4; avctx->codec_tag = MKTAG('U', 'L', 'R', 'A'); original_format = UTVIDEO_RGBA; break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: if (avctx->width & 1 || avctx->height & 1) { av_log(avctx, AV_LOG_ERROR, "4:2:0 video requires even width and height.\n"); @@ -85,7 +85,7 @@ static av_cold int utvideo_encode_init(AVCodecContext *avctx) avctx->codec_tag = MKTAG('U', 'L', 'Y', '0'); original_format = UTVIDEO_420; break; - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P: if (avctx->width & 1) { av_log(avctx, AV_LOG_ERROR, "4:2:2 video requires even width.\n"); @@ -534,14 +534,14 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } /* In case of RGB, mangle the planes to Ut Video's format */ - if (avctx->pix_fmt == PIX_FMT_RGBA || avctx->pix_fmt == PIX_FMT_RGB24) + if (avctx->pix_fmt == AV_PIX_FMT_RGBA || avctx->pix_fmt == AV_PIX_FMT_RGB24) mangle_rgb_planes(c->slice_buffer, c->slice_stride, pic->data[0], c->planes, pic->linesize[0], width, height); /* Deal with the planes */ switch (avctx->pix_fmt) { - case PIX_FMT_RGB24: - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGB24: + case AV_PIX_FMT_RGBA: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, c->slice_buffer[i] + 2 * c->slice_stride, c->slice_buffer[i], c->slice_stride, @@ -553,7 +553,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } } break; - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0], pic->linesize[i], width >> !!i, height, &pb); @@ -564,7 +564,7 @@ static int utvideo_encode_frame(AVCodecContext *avctx, AVPacket *pkt, } } break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: for (i = 0; i < c->planes; i++) { ret = encode_plane(avctx, pic->data[i], c->slice_buffer[0], pic->linesize[i], width >> !!i, height >> !!i, @@ -615,9 +615,9 @@ AVCodec ff_utvideo_encoder = { .init = utvideo_encode_init, .encode2 = utvideo_encode_frame, .close = utvideo_encode_close, - .pix_fmts = (const enum PixelFormat[]) { - PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_NONE + .pix_fmts = (const enum AVPixelFormat[]) { + AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Ut Video"), }; diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index ccac0ac9c5..103e136bfa 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -56,7 +56,7 @@ static av_cold int decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "v210 needs even width\n"); return -1; } - avctx->pix_fmt = PIX_FMT_YUV422P10; + avctx->pix_fmt = AV_PIX_FMT_YUV422P10; avctx->bits_per_raw_sample = 10; avctx->coded_frame = avcodec_alloc_frame(); diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c index 34b772ff4a..5527686046 100644 --- a/libavcodec/v210enc.c +++ b/libavcodec/v210enc.c @@ -121,6 +121,6 @@ AVCodec ff_v210_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_close, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV422P10, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:2:2 10-bit"), }; diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c index ca847b7b39..376588c736 100644 --- a/libavcodec/v210x.c +++ b/libavcodec/v210x.c @@ -29,7 +29,7 @@ static av_cold int decode_init(AVCodecContext *avctx) av_log(avctx, AV_LOG_ERROR, "v210x needs even width\n"); return -1; } - avctx->pix_fmt = PIX_FMT_YUV422P16; + avctx->pix_fmt = AV_PIX_FMT_YUV422P16; avctx->bits_per_raw_sample= 10; avctx->coded_frame= avcodec_alloc_frame(); diff --git a/libavcodec/v308dec.c b/libavcodec/v308dec.c index 796518f5c5..fd742cab85 100644 --- a/libavcodec/v308dec.c +++ b/libavcodec/v308dec.c @@ -23,7 +23,7 @@ static av_cold int v308_decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUV444P; + avctx->pix_fmt = AV_PIX_FMT_YUV444P; if (avctx->width & 1) av_log(avctx, AV_LOG_WARNING, "v308 requires width to be even.\n"); diff --git a/libavcodec/v308enc.c b/libavcodec/v308enc.c index 3c98da70ea..7a0ca40576 100644 --- a/libavcodec/v308enc.c +++ b/libavcodec/v308enc.c @@ -90,6 +90,6 @@ AVCodec ff_v308_encoder = { .init = v308_encode_init, .encode2 = v308_encode_frame, .close = v308_encode_close, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV444P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:4:4"), }; diff --git a/libavcodec/v408dec.c b/libavcodec/v408dec.c index 01a5064a2a..8820fc4cbf 100644 --- a/libavcodec/v408dec.c +++ b/libavcodec/v408dec.c @@ -23,7 +23,7 @@ static av_cold int v408_decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUVA444P; + avctx->pix_fmt = AV_PIX_FMT_YUVA444P; avctx->coded_frame = avcodec_alloc_frame(); diff --git a/libavcodec/v408enc.c b/libavcodec/v408enc.c index 27944bcba5..9b0ebcea4a 100644 --- a/libavcodec/v408enc.c +++ b/libavcodec/v408enc.c @@ -96,7 +96,7 @@ AVCodec ff_ayuv_encoder = { .init = v408_encode_init, .encode2 = v408_encode_frame, .close = v408_encode_close, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUVA444P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed MS 4:4:4:4"), }; #endif @@ -108,7 +108,7 @@ AVCodec ff_v408_encoder = { .init = v408_encode_init, .encode2 = v408_encode_frame, .close = v408_encode_close, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUVA444P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVA444P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed QT 4:4:4:4"), }; #endif diff --git a/libavcodec/v410dec.c b/libavcodec/v410dec.c index 180fcc0aea..4d4d625d16 100644 --- a/libavcodec/v410dec.c +++ b/libavcodec/v410dec.c @@ -26,7 +26,7 @@ static av_cold int v410_decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUV444P10; + avctx->pix_fmt = AV_PIX_FMT_YUV444P10; avctx->bits_per_raw_sample = 10; if (avctx->width & 1) { diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c index b697b44ab4..67d8fc9d77 100644 --- a/libavcodec/v410enc.c +++ b/libavcodec/v410enc.c @@ -94,6 +94,6 @@ AVCodec ff_v410_encoder = { .init = v410_encode_init, .encode2 = v410_encode_frame, .close = v410_encode_close, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV444P10, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed 4:4:4 10-bit"), }; diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index 38fc0dac8b..9be51bf24c 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -341,7 +341,7 @@ AVHWAccel ff_h264_vaapi_hwaccel = { .name = "h264_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, - .pix_fmt = PIX_FMT_VAAPI_VLD, + .pix_fmt = AV_PIX_FMT_VAAPI_VLD, .start_frame = start_frame, .end_frame = end_frame, .decode_slice = decode_slice, diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c index 455f68e445..50ba06d3e2 100644 --- a/libavcodec/vaapi_mpeg2.c +++ b/libavcodec/vaapi_mpeg2.c @@ -142,7 +142,7 @@ AVHWAccel ff_mpeg2_vaapi_hwaccel = { .name = "mpeg2_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = PIX_FMT_VAAPI_VLD, + .pix_fmt = AV_PIX_FMT_VAAPI_VLD, .start_frame = vaapi_mpeg2_start_frame, .end_frame = vaapi_mpeg2_end_frame, .decode_slice = vaapi_mpeg2_decode_slice, diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c index f019661dab..31787402e4 100644 --- a/libavcodec/vaapi_mpeg4.c +++ b/libavcodec/vaapi_mpeg4.c @@ -154,7 +154,7 @@ AVHWAccel ff_mpeg4_vaapi_hwaccel = { .name = "mpeg4_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG4, - .pix_fmt = PIX_FMT_VAAPI_VLD, + .pix_fmt = AV_PIX_FMT_VAAPI_VLD, .start_frame = vaapi_mpeg4_start_frame, .end_frame = vaapi_mpeg4_end_frame, .decode_slice = vaapi_mpeg4_decode_slice, @@ -166,7 +166,7 @@ AVHWAccel ff_h263_vaapi_hwaccel = { .name = "h263_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H263, - .pix_fmt = PIX_FMT_VAAPI_VLD, + .pix_fmt = AV_PIX_FMT_VAAPI_VLD, .start_frame = vaapi_mpeg4_start_frame, .end_frame = vaapi_mpeg4_end_frame, .decode_slice = vaapi_mpeg4_decode_slice, diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c index e5d5626d82..af01e51df2 100644 --- a/libavcodec/vaapi_vc1.c +++ b/libavcodec/vaapi_vc1.c @@ -345,7 +345,7 @@ AVHWAccel ff_wmv3_vaapi_hwaccel = { .name = "wmv3_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_WMV3, - .pix_fmt = PIX_FMT_VAAPI_VLD, + .pix_fmt = AV_PIX_FMT_VAAPI_VLD, .start_frame = vaapi_vc1_start_frame, .end_frame = vaapi_vc1_end_frame, .decode_slice = vaapi_vc1_decode_slice, @@ -356,7 +356,7 @@ AVHWAccel ff_vc1_vaapi_hwaccel = { .name = "vc1_vaapi", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_VC1, - .pix_fmt = PIX_FMT_VAAPI_VLD, + .pix_fmt = AV_PIX_FMT_VAAPI_VLD, .start_frame = vaapi_vc1_start_frame, .end_frame = vaapi_vc1_end_frame, .decode_slice = vaapi_vc1_decode_slice, diff --git a/libavcodec/vb.c b/libavcodec/vb.c index a71741d7f6..78ef669c3a 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -250,7 +250,7 @@ static av_cold int decode_init(AVCodecContext *avctx) VBDecContext * const c = avctx->priv_data; c->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&c->pic); c->frame = av_mallocz(avctx->width * avctx->height); diff --git a/libavcodec/vble.c b/libavcodec/vble.c index 63a08d72b6..0c8f36c28e 100644 --- a/libavcodec/vble.c +++ b/libavcodec/vble.c @@ -192,7 +192,7 @@ static av_cold int vble_decode_init(AVCodecContext *avctx) ctx->avctx = avctx; ff_dsputil_init(&ctx->dsp, avctx); - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->bits_per_raw_sample = 8; avctx->coded_frame = avcodec_alloc_frame(); diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index cbf9562d2a..e7085f6d73 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -5151,7 +5151,7 @@ static av_cold int vc1_decode_init(AVCodecContext *avctx) if (!(avctx->flags & CODEC_FLAG_GRAY)) avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts); else - avctx->pix_fmt = PIX_FMT_GRAY8; + avctx->pix_fmt = AV_PIX_FMT_GRAY8; avctx->hwaccel = ff_find_hwaccel(avctx->codec->id, avctx->pix_fmt); v->s.avctx = avctx; avctx->flags |= CODEC_FLAG_EMU_EDGE; @@ -5341,9 +5341,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, if (s->avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU) { if (v->profile < PROFILE_ADVANCED) - avctx->pix_fmt = PIX_FMT_VDPAU_WMV3; + avctx->pix_fmt = AV_PIX_FMT_VDPAU_WMV3; else - avctx->pix_fmt = PIX_FMT_VDPAU_VC1; + avctx->pix_fmt = AV_PIX_FMT_VDPAU_VC1; } //for advanced profile we may need to parse and unescape data @@ -5740,7 +5740,7 @@ AVCodec ff_wmv3_vdpau_decoder = { .decode = vc1_decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU, .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 9 VDPAU"), - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_VDPAU_WMV3, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VDPAU_WMV3, AV_PIX_FMT_NONE }, .profiles = NULL_IF_CONFIG_SMALL(profiles) }; #endif @@ -5756,7 +5756,7 @@ AVCodec ff_vc1_vdpau_decoder = { .decode = vc1_decode_frame, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU, .long_name = NULL_IF_CONFIG_SMALL("SMPTE VC-1 VDPAU"), - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_VDPAU_VC1, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_VDPAU_VC1, AV_PIX_FMT_NONE }, .profiles = NULL_IF_CONFIG_SMALL(profiles) }; #endif diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index cbbec53c2b..2a4a090885 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -48,7 +48,7 @@ static av_cold int vcr1_decode_init(AVCodecContext *avctx) { vcr1_common_init(avctx); - avctx->pix_fmt = PIX_FMT_YUV410P; + avctx->pix_fmt = AV_PIX_FMT_YUV410P; return 0; } diff --git a/libavcodec/vda_h264.c b/libavcodec/vda_h264.c index 4b8c75483e..89960d7d0a 100644 --- a/libavcodec/vda_h264.c +++ b/libavcodec/vda_h264.c @@ -375,7 +375,7 @@ AVHWAccel ff_h264_vda_hwaccel = { .name = "h264_vda", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_H264, - .pix_fmt = PIX_FMT_VDA_VLD, + .pix_fmt = AV_PIX_FMT_VDA_VLD, .start_frame = start_frame, .decode_slice = decode_slice, .end_frame = end_frame, diff --git a/libavcodec/vda_h264_dec.c b/libavcodec/vda_h264_dec.c index 36453c59ab..3cb13e38fb 100644 --- a/libavcodec/vda_h264_dec.c +++ b/libavcodec/vda_h264_dec.c @@ -37,31 +37,31 @@ extern AVCodec ff_h264_decoder, ff_h264_vda_decoder; -static const enum PixelFormat vda_pixfmts_prior_10_7[] = { - PIX_FMT_UYVY422, - PIX_FMT_YUV420P, - PIX_FMT_NONE +static const enum AVPixelFormat vda_pixfmts_prior_10_7[] = { + AV_PIX_FMT_UYVY422, + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE }; -static const enum PixelFormat vda_pixfmts[] = { - PIX_FMT_UYVY422, - PIX_FMT_YUYV422, - PIX_FMT_NV12, - PIX_FMT_YUV420P, - PIX_FMT_NONE +static const enum AVPixelFormat vda_pixfmts[] = { + AV_PIX_FMT_UYVY422, + AV_PIX_FMT_YUYV422, + AV_PIX_FMT_NV12, + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE }; typedef struct { H264Context h264ctx; int h264_initialized; struct vda_context vda_ctx; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; } VDADecoderContext; -static enum PixelFormat get_format(struct AVCodecContext *avctx, - const enum PixelFormat *fmt) +static enum AVPixelFormat get_format(struct AVCodecContext *avctx, + const enum AVPixelFormat *fmt) { - return PIX_FMT_VDA_VLD; + return AV_PIX_FMT_VDA_VLD; } static int get_buffer(AVCodecContext *avctx, AVFrame *pic) @@ -194,16 +194,16 @@ static av_cold int vdadec_init(AVCodecContext *avctx) vda_ctx->use_sync_decoding = 1; ctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts); switch (ctx->pix_fmt) { - case PIX_FMT_UYVY422: + case AV_PIX_FMT_UYVY422: vda_ctx->cv_pix_fmt_type = '2vuy'; break; - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: vda_ctx->cv_pix_fmt_type = 'yuvs'; break; - case PIX_FMT_NV12: + case AV_PIX_FMT_NV12: vda_ctx->cv_pix_fmt_type = '420v'; break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: vda_ctx->cv_pix_fmt_type = 'y420'; break; default: diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index da9ae9ddfb..6ac195ec00 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -390,7 +390,7 @@ AVHWAccel ff_mpeg1_vdpau_hwaccel = { .name = "mpeg1_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG1VIDEO, - .pix_fmt = PIX_FMT_VDPAU_MPEG1, + .pix_fmt = AV_PIX_FMT_VDPAU_MPEG1, .start_frame = vdpau_mpeg2_start_frame, .end_frame = vdpau_mpeg2_end_frame, .decode_slice = vdpau_mpeg2_decode_slice, @@ -400,7 +400,7 @@ AVHWAccel ff_mpeg2_vdpau_hwaccel = { .name = "mpeg2_vdpau", .type = AVMEDIA_TYPE_VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO, - .pix_fmt = PIX_FMT_VDPAU_MPEG2, + .pix_fmt = AV_PIX_FMT_VDPAU_MPEG2, .start_frame = vdpau_mpeg2_start_frame, .end_frame = vdpau_mpeg2_end_frame, .decode_slice = vdpau_mpeg2_decode_slice, diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 3834416857..b0599b99a9 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -378,7 +378,7 @@ static av_cold int vmdvideo_decode_init(AVCodecContext *avctx) unsigned char *raw_palette; s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; /* make sure the VMD header made it */ if (s->avctx->extradata_size != VMD_HEADER_SIZE) { diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index 6d091c1bd2..62a1312de6 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -475,13 +475,13 @@ static av_cold int decode_init(AVCodecContext *avctx) switch(c->bpp){ case 8: - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case 16: - avctx->pix_fmt = PIX_FMT_RGB555; + avctx->pix_fmt = AV_PIX_FMT_RGB555; break; case 32: - avctx->pix_fmt = PIX_FMT_RGB32; + avctx->pix_fmt = AV_PIX_FMT_RGB32; break; default: av_log(avctx, AV_LOG_ERROR, "Unsupported bitdepth %i\n", c->bpp); diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 80d54cc198..2105bb588d 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -1668,7 +1668,7 @@ static av_cold int vp3_decode_init(AVCodecContext *avctx) s->width = FFALIGN(avctx->width, 16); s->height = FFALIGN(avctx->height, 16); if (avctx->codec_id != AV_CODEC_ID_THEORA) - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->chroma_sample_location = AVCHROMA_LOC_CENTER; ff_dsputil_init(&s->dsp, avctx); ff_vp3dsp_init(&s->vp3dsp, avctx->flags); @@ -2110,8 +2110,8 @@ static int vp3_init_thread_copy(AVCodecContext *avctx) } #if CONFIG_THEORA_DECODER -static const enum PixelFormat theora_pix_fmts[4] = { - PIX_FMT_YUV420P, PIX_FMT_NONE, PIX_FMT_YUV422P, PIX_FMT_YUV444P +static const enum AVPixelFormat theora_pix_fmts[4] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P }; static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb) @@ -2316,7 +2316,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) int header_len[3]; int i; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; s->theora = 1; diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index 2ae5f9c2ad..1e373aa6a1 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -688,7 +688,7 @@ av_cold void ff_vp56_init_context(AVCodecContext *avctx, VP56Context *s, int i; s->avctx = avctx; - avctx->pix_fmt = has_alpha ? PIX_FMT_YUVA420P : PIX_FMT_YUV420P; + avctx->pix_fmt = has_alpha ? AV_PIX_FMT_YUVA420P : AV_PIX_FMT_YUV420P; ff_dsputil_init(&s->dsp, avctx); ff_vp3dsp_init(&s->vp3dsp, avctx->flags); diff --git a/libavcodec/vp8.c b/libavcodec/vp8.c index fb541bc6ba..3f07b90b26 100644 --- a/libavcodec/vp8.c +++ b/libavcodec/vp8.c @@ -2017,7 +2017,7 @@ static av_cold int vp8_decode_init(AVCodecContext *avctx) VP8Context *s = avctx->priv_data; s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; ff_dsputil_init(&s->dsp, avctx); ff_h264_pred_init(&s->hpc, AV_CODEC_ID_VP8, 8, 1); diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index e4bad00ca1..93a602edc5 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -124,7 +124,7 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx) int i, j, codebook_index; s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; /* make sure the extradata made it */ if (s->avctx->extradata_size != VQA_HEADER_SIZE) { diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index e696d69c3b..e6e1e678c1 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -219,6 +219,6 @@ AVCodec ff_wmv2_encoder = { .init = wmv2_encode_init, .encode2 = ff_MPV_encode_picture, .close = ff_MPV_encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Windows Media Video 8"), }; diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index e7a8240433..643e871115 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -140,7 +140,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ static VLC_TYPE code_table[1 << CODE_VLC_BITS][2]; l->avctx = avctx; - avctx->pix_fmt = PIX_FMT_YUV422P; + avctx->pix_fmt = AV_PIX_FMT_YUV422P; avcodec_get_frame_defaults(&l->pic); code_vlc.table = code_table; diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 703ee9ea5d..f11f1bf062 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -79,7 +79,7 @@ static av_cold int xan_decode_init(AVCodecContext *avctx) s->avctx = avctx; s->frame_size = 0; - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; s->buffer1_size = avctx->width * avctx->height; s->buffer1 = av_malloc(s->buffer1_size); diff --git a/libavcodec/xbmdec.c b/libavcodec/xbmdec.c index 626e8de040..130328f76d 100644 --- a/libavcodec/xbmdec.c +++ b/libavcodec/xbmdec.c @@ -74,7 +74,7 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data, ptr += strcspn(ptr, "\n\r") + 1; } - avctx->pix_fmt = PIX_FMT_MONOWHITE; + avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; if (p->data[0]) avctx->release_buffer(avctx, p); diff --git a/libavcodec/xbmenc.c b/libavcodec/xbmenc.c index a82ceaaaf9..ee1391b2b2 100644 --- a/libavcodec/xbmenc.c +++ b/libavcodec/xbmenc.c @@ -79,7 +79,7 @@ AVCodec ff_xbm_encoder = { .init = xbm_encode_init, .encode2 = xbm_encode_frame, .close = xbm_encode_close, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_MONOWHITE, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"), }; diff --git a/libavcodec/xl.c b/libavcodec/xl.c index b0f6e939ba..1620c855c8 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -136,7 +136,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ VideoXLContext * const a = avctx->priv_data; avcodec_get_frame_defaults(&a->pic); - avctx->pix_fmt= PIX_FMT_YUV411P; + avctx->pix_fmt= AV_PIX_FMT_YUV411P; return 0; } diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index bef48384bd..d3367b0d6e 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -26,7 +26,7 @@ #include "bytestream.h" static av_cold int decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; return 0; } diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index ea7da84e78..ef99a6bbf8 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -153,22 +153,22 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_PATCHWELCOME; } - avctx->pix_fmt = PIX_FMT_NONE; + avctx->pix_fmt = AV_PIX_FMT_NONE; switch (vclass) { case XWD_STATIC_GRAY: case XWD_GRAY_SCALE: if (bpp != 1 && bpp != 8) return AVERROR_INVALIDDATA; if (pixdepth == 1) { - avctx->pix_fmt = PIX_FMT_MONOWHITE; + avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; } else if (pixdepth == 8) { - avctx->pix_fmt = PIX_FMT_GRAY8; + avctx->pix_fmt = AV_PIX_FMT_GRAY8; } break; case XWD_STATIC_COLOR: case XWD_PSEUDO_COLOR: if (bpp == 8) - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; break; case XWD_TRUE_COLOR: case XWD_DIRECT_COLOR: @@ -176,24 +176,24 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; if (bpp == 16 && pixdepth == 15) { if (rgb[0] == 0x7C00 && rgb[1] == 0x3E0 && rgb[2] == 0x1F) - avctx->pix_fmt = be ? PIX_FMT_RGB555BE : PIX_FMT_RGB555LE; + avctx->pix_fmt = be ? AV_PIX_FMT_RGB555BE : AV_PIX_FMT_RGB555LE; else if (rgb[0] == 0x1F && rgb[1] == 0x3E0 && rgb[2] == 0x7C00) - avctx->pix_fmt = be ? PIX_FMT_BGR555BE : PIX_FMT_BGR555LE; + avctx->pix_fmt = be ? AV_PIX_FMT_BGR555BE : AV_PIX_FMT_BGR555LE; } else if (bpp == 16 && pixdepth == 16) { if (rgb[0] == 0xF800 && rgb[1] == 0x7E0 && rgb[2] == 0x1F) - avctx->pix_fmt = be ? PIX_FMT_RGB565BE : PIX_FMT_RGB565LE; + avctx->pix_fmt = be ? AV_PIX_FMT_RGB565BE : AV_PIX_FMT_RGB565LE; else if (rgb[0] == 0x1F && rgb[1] == 0x7E0 && rgb[2] == 0xF800) - avctx->pix_fmt = be ? PIX_FMT_BGR565BE : PIX_FMT_BGR565LE; + avctx->pix_fmt = be ? AV_PIX_FMT_BGR565BE : AV_PIX_FMT_BGR565LE; } else if (bpp == 24) { if (rgb[0] == 0xFF0000 && rgb[1] == 0xFF00 && rgb[2] == 0xFF) - avctx->pix_fmt = be ? PIX_FMT_RGB24 : PIX_FMT_BGR24; + avctx->pix_fmt = be ? AV_PIX_FMT_RGB24 : AV_PIX_FMT_BGR24; else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000) - avctx->pix_fmt = be ? PIX_FMT_BGR24 : PIX_FMT_RGB24; + avctx->pix_fmt = be ? AV_PIX_FMT_BGR24 : AV_PIX_FMT_RGB24; } else if (bpp == 32) { if (rgb[0] == 0xFF0000 && rgb[1] == 0xFF00 && rgb[2] == 0xFF) - avctx->pix_fmt = be ? PIX_FMT_ARGB : PIX_FMT_BGRA; + avctx->pix_fmt = be ? AV_PIX_FMT_ARGB : AV_PIX_FMT_BGRA; else if (rgb[0] == 0xFF && rgb[1] == 0xFF00 && rgb[2] == 0xFF0000) - avctx->pix_fmt = be ? PIX_FMT_ABGR : PIX_FMT_RGBA; + avctx->pix_fmt = be ? AV_PIX_FMT_ABGR : AV_PIX_FMT_RGBA; } bytestream2_skipu(&gb, ncolors * XWD_CMAP_SIZE); break; @@ -202,7 +202,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - if (avctx->pix_fmt == PIX_FMT_NONE) { + if (avctx->pix_fmt == AV_PIX_FMT_NONE) { av_log_ask_for_sample(avctx, "unknown file: bpp %d, pixdepth %d, vclass %d\n", bpp, pixdepth, vclass); return AVERROR_PATCHWELCOME; } @@ -219,7 +219,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, p->key_frame = 1; p->pict_type = AV_PICTURE_TYPE_I; - if (avctx->pix_fmt == PIX_FMT_PAL8) { + if (avctx->pix_fmt == AV_PIX_FMT_PAL8) { uint32_t *dst = (uint32_t *)p->data[1]; uint8_t red, green, blue; diff --git a/libavcodec/xwdenc.c b/libavcodec/xwdenc.c index e6ddfbb9dd..03391f1003 100644 --- a/libavcodec/xwdenc.c +++ b/libavcodec/xwdenc.c @@ -42,7 +42,7 @@ static av_cold int xwd_encode_init(AVCodecContext *avctx) static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *p, int *got_packet) { - enum PixelFormat pix_fmt = avctx->pix_fmt; + enum AVPixelFormat pix_fmt = avctx->pix_fmt; uint32_t pixdepth, bpp, bpad, ncolors = 0, lsize, vclass, be = 0; uint32_t rgb[3] = { 0 }, bitorder = 0; uint32_t header_size; @@ -53,15 +53,15 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, if (av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BE) be = 1; switch (pix_fmt) { - case PIX_FMT_ARGB: - case PIX_FMT_BGRA: - case PIX_FMT_RGBA: - case PIX_FMT_ABGR: - if (pix_fmt == PIX_FMT_ARGB || - pix_fmt == PIX_FMT_ABGR) + case AV_PIX_FMT_ARGB: + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_ABGR: + if (pix_fmt == AV_PIX_FMT_ARGB || + pix_fmt == AV_PIX_FMT_ABGR) be = 1; - if (pix_fmt == PIX_FMT_ABGR || - pix_fmt == PIX_FMT_RGBA) { + if (pix_fmt == AV_PIX_FMT_ABGR || + pix_fmt == AV_PIX_FMT_RGBA) { rgb[0] = 0xFF; rgb[1] = 0xFF00; rgb[2] = 0xFF0000; @@ -75,9 +75,9 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, vclass = XWD_TRUE_COLOR; bpad = 32; break; - case PIX_FMT_BGR24: - case PIX_FMT_RGB24: - if (pix_fmt == PIX_FMT_RGB24) + case AV_PIX_FMT_BGR24: + case AV_PIX_FMT_RGB24: + if (pix_fmt == AV_PIX_FMT_RGB24) be = 1; bpp = 24; vclass = XWD_TRUE_COLOR; @@ -86,12 +86,12 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, rgb[1] = 0xFF00; rgb[2] = 0xFF; break; - case PIX_FMT_RGB565LE: - case PIX_FMT_RGB565BE: - case PIX_FMT_BGR565LE: - case PIX_FMT_BGR565BE: - if (pix_fmt == PIX_FMT_BGR565LE || - pix_fmt == PIX_FMT_BGR565BE) { + case AV_PIX_FMT_RGB565LE: + case AV_PIX_FMT_RGB565BE: + case AV_PIX_FMT_BGR565LE: + case AV_PIX_FMT_BGR565BE: + if (pix_fmt == AV_PIX_FMT_BGR565LE || + pix_fmt == AV_PIX_FMT_BGR565BE) { rgb[0] = 0x1F; rgb[1] = 0x7E0; rgb[2] = 0xF800; @@ -104,12 +104,12 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, vclass = XWD_TRUE_COLOR; bpad = 16; break; - case PIX_FMT_RGB555LE: - case PIX_FMT_RGB555BE: - case PIX_FMT_BGR555LE: - case PIX_FMT_BGR555BE: - if (pix_fmt == PIX_FMT_BGR555LE || - pix_fmt == PIX_FMT_BGR555BE) { + case AV_PIX_FMT_RGB555LE: + case AV_PIX_FMT_RGB555BE: + case AV_PIX_FMT_BGR555LE: + case AV_PIX_FMT_BGR555BE: + if (pix_fmt == AV_PIX_FMT_BGR555LE || + pix_fmt == AV_PIX_FMT_BGR555BE) { rgb[0] = 0x1F; rgb[1] = 0x3E0; rgb[2] = 0x7C00; @@ -122,22 +122,22 @@ static int xwd_encode_frame(AVCodecContext *avctx, AVPacket *pkt, vclass = XWD_TRUE_COLOR; bpad = 16; break; - case PIX_FMT_RGB8: - case PIX_FMT_BGR8: - case PIX_FMT_RGB4_BYTE: - case PIX_FMT_BGR4_BYTE: - case PIX_FMT_PAL8: + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_PAL8: bpp = 8; vclass = XWD_PSEUDO_COLOR; bpad = 8; ncolors = 256; break; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: bpp = 8; bpad = 8; vclass = XWD_STATIC_GRAY; break; - case PIX_FMT_MONOWHITE: + case AV_PIX_FMT_MONOWHITE: be = 1; bitorder = 1; bpp = 1; @@ -229,27 +229,27 @@ AVCodec ff_xwd_encoder = { .init = xwd_encode_init, .encode2 = xwd_encode_frame, .close = xwd_encode_close, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_BGRA, - PIX_FMT_RGBA, - PIX_FMT_ARGB, - PIX_FMT_ABGR, - PIX_FMT_RGB24, - PIX_FMT_BGR24, - PIX_FMT_RGB565BE, - PIX_FMT_RGB565LE, - PIX_FMT_BGR565BE, - PIX_FMT_BGR565LE, - PIX_FMT_RGB555BE, - PIX_FMT_RGB555LE, - PIX_FMT_BGR555BE, - PIX_FMT_BGR555LE, - PIX_FMT_RGB8, - PIX_FMT_BGR8, - PIX_FMT_RGB4_BYTE, - PIX_FMT_BGR4_BYTE, - PIX_FMT_PAL8, - PIX_FMT_GRAY8, - PIX_FMT_MONOWHITE, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGBA, + AV_PIX_FMT_ARGB, + AV_PIX_FMT_ABGR, + AV_PIX_FMT_RGB24, + AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565BE, + AV_PIX_FMT_RGB565LE, + AV_PIX_FMT_BGR565BE, + AV_PIX_FMT_BGR565LE, + AV_PIX_FMT_RGB555BE, + AV_PIX_FMT_RGB555LE, + AV_PIX_FMT_BGR555BE, + AV_PIX_FMT_BGR555LE, + AV_PIX_FMT_RGB8, + AV_PIX_FMT_BGR8, + AV_PIX_FMT_RGB4_BYTE, + AV_PIX_FMT_BGR4_BYTE, + AV_PIX_FMT_PAL8, + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_MONOWHITE, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"), }; diff --git a/libavcodec/xxan.c b/libavcodec/xxan.c index 08372eeb43..f7ffa4e0f9 100644 --- a/libavcodec/xxan.c +++ b/libavcodec/xxan.c @@ -44,7 +44,7 @@ static av_cold int xan_decode_init(AVCodecContext *avctx) s->avctx = avctx; - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; s->buffer_size = avctx->width * avctx->height; s->y_buffer = av_malloc(s->buffer_size); diff --git a/libavcodec/y41pdec.c b/libavcodec/y41pdec.c index 97bcc990e8..e283690f00 100644 --- a/libavcodec/y41pdec.c +++ b/libavcodec/y41pdec.c @@ -24,7 +24,7 @@ static av_cold int y41p_decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUV411P; + avctx->pix_fmt = AV_PIX_FMT_YUV411P; avctx->bits_per_raw_sample = 12; if (avctx->width & 7) { diff --git a/libavcodec/y41penc.c b/libavcodec/y41penc.c index b8ebfbcb95..f0c212ba2a 100644 --- a/libavcodec/y41penc.c +++ b/libavcodec/y41penc.c @@ -97,7 +97,7 @@ AVCodec ff_y41p_encoder = { .init = y41p_encode_init, .encode2 = y41p_encode_frame, .close = y41p_encode_close, - .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV411P, - PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, + AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed YUV 4:1:1 12-bit"), }; diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 070ba76c62..3e27c1fe27 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -94,7 +94,7 @@ static av_cold int yop_decode_init(AVCodecContext *avctx) return AVERROR_INVALIDDATA; } - avctx->pix_fmt = PIX_FMT_PAL8; + avctx->pix_fmt = AV_PIX_FMT_PAL8; avcodec_get_frame_defaults(&s->frame); s->num_pal_colors = avctx->extradata[0]; diff --git a/libavcodec/yuv4dec.c b/libavcodec/yuv4dec.c index 07696692eb..ce44f1330f 100644 --- a/libavcodec/yuv4dec.c +++ b/libavcodec/yuv4dec.c @@ -24,7 +24,7 @@ static av_cold int yuv4_decode_init(AVCodecContext *avctx) { - avctx->pix_fmt = PIX_FMT_YUV420P; + avctx->pix_fmt = AV_PIX_FMT_YUV420P; avctx->coded_frame = avcodec_alloc_frame(); diff --git a/libavcodec/yuv4enc.c b/libavcodec/yuv4enc.c index 8185d06185..340310a8ab 100644 --- a/libavcodec/yuv4enc.c +++ b/libavcodec/yuv4enc.c @@ -87,6 +87,6 @@ AVCodec ff_yuv4_encoder = { .init = yuv4_encode_init, .encode2 = yuv4_encode_frame, .close = yuv4_encode_close, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Uncompressed packed 4:2:0"), }; diff --git a/libavcodec/zerocodec.c b/libavcodec/zerocodec.c index 789181cb1c..c6a9ba94a2 100644 --- a/libavcodec/zerocodec.c +++ b/libavcodec/zerocodec.c @@ -129,7 +129,7 @@ static av_cold int zerocodec_decode_init(AVCodecContext *avctx) z_stream *zstream = &zc->zstream; int zret; - avctx->pix_fmt = PIX_FMT_UYVY422; + avctx->pix_fmt = AV_PIX_FMT_UYVY422; avctx->bits_per_raw_sample = 8; zc->size = avpicture_get_size(avctx->pix_fmt, diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 0a4f1cdd6c..762d5728a2 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -625,7 +625,7 @@ static av_cold int decode_init(AVCodecContext *avctx) // Needed if zlib unused or init aborted before inflateInit memset(&c->zstream, 0, sizeof(z_stream)); - avctx->pix_fmt = PIX_FMT_RGB24; + avctx->pix_fmt = AV_PIX_FMT_RGB24; c->decomp_size = (avctx->width + 255) * 4 * (avctx->height + 64); /* Allocate decompression buffer */ diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index df5b90f1ce..fb782a408c 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -343,6 +343,6 @@ AVCodec ff_zmbv_encoder = { .init = encode_init, .encode2 = encode_frame, .close = encode_end, - .pix_fmts = (const enum PixelFormat[]){ PIX_FMT_PAL8, PIX_FMT_NONE }, + .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE }, .long_name = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"), }; |