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 | |
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>
373 files changed, 3414 insertions, 3410 deletions
diff --git a/cmdutils.c b/cmdutils.c index 61843b4f11..a8200012e5 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -851,8 +851,8 @@ static void print_codec(const AVCodec *c) } printf("\n"); } - PRINT_CODEC_SUPPORTED(c, pix_fmts, enum PixelFormat, "pixel formats", - PIX_FMT_NONE, GET_PIX_FMT_NAME); + PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats", + AV_PIX_FMT_NONE, GET_PIX_FMT_NAME); PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0, GET_SAMPLE_RATE_NAME); PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats", @@ -1094,7 +1094,7 @@ int show_filters(void *optctx, const char *opt, const char *arg) int show_pix_fmts(void *optctx, const char *opt, const char *arg) { - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; printf("Pixel formats:\n" "I.... = Supported Input format for conversion\n" @@ -1110,7 +1110,7 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg) # define sws_isSupportedOutput(x) 0 #endif - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) { + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) { const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt]; if(!pix_desc->name) continue; diff --git a/cmdutils.h b/cmdutils.h index 2fd2fb4c39..3885d9412c 100644 --- a/cmdutils.h +++ b/cmdutils.h @@ -426,7 +426,7 @@ typedef struct FrameBuffer { int linesize[4]; int h, w; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; int refcount; struct FrameBuffer **pool; ///< head of the buffer pool diff --git a/doc/examples/decoding_encoding.c b/doc/examples/decoding_encoding.c index fcd7dfbe07..24b9b6b7e6 100644 --- a/doc/examples/decoding_encoding.c +++ b/doc/examples/decoding_encoding.c @@ -356,7 +356,7 @@ static void video_encode_example(const char *filename, int codec_id) c->time_base= (AVRational){1,25}; c->gop_size = 10; /* emit one intra frame every ten frames */ c->max_b_frames=1; - c->pix_fmt = PIX_FMT_YUV420P; + c->pix_fmt = AV_PIX_FMT_YUV420P; if(codec_id == AV_CODEC_ID_H264) av_opt_set(c->priv_data, "preset", "slow", 0); diff --git a/doc/examples/filtering_video.c b/doc/examples/filtering_video.c index ee5073a1ba..ca0266e775 100644 --- a/doc/examples/filtering_video.c +++ b/doc/examples/filtering_video.c @@ -87,7 +87,7 @@ static int init_filters(const char *filters_descr) AVFilter *buffersink = avfilter_get_by_name("ffbuffersink"); AVFilterInOut *outputs = avfilter_inout_alloc(); AVFilterInOut *inputs = avfilter_inout_alloc(); - enum PixelFormat pix_fmts[] = { PIX_FMT_GRAY8, PIX_FMT_NONE }; + enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; AVBufferSinkParams *buffersink_params; filter_graph = avfilter_graph_alloc(); diff --git a/doc/examples/muxing.c b/doc/examples/muxing.c index f43a85e8ee..f46f0be386 100644 --- a/doc/examples/muxing.c +++ b/doc/examples/muxing.c @@ -41,7 +41,7 @@ #define STREAM_DURATION 200.0 #define STREAM_FRAME_RATE 25 /* 25 images/s */ #define STREAM_NB_FRAMES ((int)(STREAM_DURATION * STREAM_FRAME_RATE)) -#define STREAM_PIX_FMT PIX_FMT_YUV420P /* default pix_fmt */ +#define STREAM_PIX_FMT AV_PIX_FMT_YUV420P /* default pix_fmt */ static int sws_flags = SWS_BICUBIC; @@ -277,8 +277,8 @@ static void open_video(AVFormatContext *oc, AVCodec *codec, AVStream *st) /* If the output format is not YUV420P, then a temporary YUV420P * picture is needed too. It is then converted to the required * output format. */ - if (c->pix_fmt != PIX_FMT_YUV420P) { - ret = avpicture_alloc(&src_picture, PIX_FMT_YUV420P, c->width, c->height); + if (c->pix_fmt != AV_PIX_FMT_YUV420P) { + ret = avpicture_alloc(&src_picture, AV_PIX_FMT_YUV420P, c->width, c->height); if (ret < 0) { fprintf(stderr, "Could not allocate temporary picture\n"); exit(1); @@ -322,11 +322,11 @@ static void write_video_frame(AVFormatContext *oc, AVStream *st) * frames if using B-frames, so we get the last frames by * passing the same picture again. */ } else { - if (c->pix_fmt != PIX_FMT_YUV420P) { + if (c->pix_fmt != AV_PIX_FMT_YUV420P) { /* as we only generate a YUV420P picture, we must convert it * to the codec pixel format if needed */ if (!sws_ctx) { - sws_ctx = sws_getContext(c->width, c->height, PIX_FMT_YUV420P, + sws_ctx = sws_getContext(c->width, c->height, AV_PIX_FMT_YUV420P, c->width, c->height, c->pix_fmt, sws_flags, NULL, NULL, NULL); if (!sws_ctx) { diff --git a/doc/examples/scaling_video.c b/doc/examples/scaling_video.c index 686af0cc72..e380131edd 100644 --- a/doc/examples/scaling_video.c +++ b/doc/examples/scaling_video.c @@ -55,7 +55,7 @@ int main(int argc, char **argv) uint8_t *src_data[4], *dst_data[4]; int src_linesize[4], dst_linesize[4]; int src_w = 320, src_h = 240, dst_w, dst_h; - enum PixelFormat src_pix_fmt = PIX_FMT_YUV420P, dst_pix_fmt = PIX_FMT_RGB24; + enum AVPixelFormat src_pix_fmt = AV_PIX_FMT_YUV420P, dst_pix_fmt = AV_PIX_FMT_RGB24; const char *dst_size = NULL; const char *dst_filename = NULL; FILE *dst_file; diff --git a/doc/filters.texi b/doc/filters.texi index ddff12fa58..f7f9ee70b1 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -3738,7 +3738,7 @@ will instruct the source to accept video frames with size 320x240 and with format "yuv410p", assuming 1/24 as the timestamps timebase and square pixels (1:1 sample aspect ratio). Since the pixel format with name "yuv410p" corresponds to the number 6 -(check the enum PixelFormat definition in @file{libavutil/pixfmt.h}), +(check the enum AVPixelFormat definition in @file{libavutil/pixfmt.h}), this example corresponds to: @example buffer=size=320x240:pixfmt=6:time_base=1/24:pixel_aspect=1/1 @@ -398,7 +398,7 @@ void assert_avoptions(AVDictionary *m); int guess_input_channel_layout(InputStream *ist); -enum PixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum PixelFormat target); +enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFormat target); void choose_sample_fmt(AVStream *st, AVCodec *codec); int configure_filtergraph(FilterGraph *fg); diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c index 318143d479..eb09b778b6 100644 --- a/ffmpeg_filter.c +++ b/ffmpeg_filter.c @@ -33,27 +33,27 @@ #include "libavutil/imgutils.h" #include "libavutil/samplefmt.h" -enum PixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum PixelFormat target) +enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFormat target) { if (codec && codec->pix_fmts) { - const enum PixelFormat *p = codec->pix_fmts; + const enum AVPixelFormat *p = codec->pix_fmts; int has_alpha= av_pix_fmt_descriptors[target].nb_components % 2 == 0; - enum PixelFormat best= PIX_FMT_NONE; + enum AVPixelFormat best= AV_PIX_FMT_NONE; if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) { if (st->codec->codec_id == AV_CODEC_ID_MJPEG) { - p = (const enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE }; + p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }; } else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) { - p = (const enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUV420P, - PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_BGRA, PIX_FMT_NONE }; + p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE }; } } - for (; *p != PIX_FMT_NONE; p++) { + for (; *p != AV_PIX_FMT_NONE; p++) { best= avcodec_find_best_pix_fmt_of_2(best, *p, target, has_alpha, NULL); if (*p == target) break; } - if (*p == PIX_FMT_NONE) { - if (target != PIX_FMT_NONE) + if (*p == AV_PIX_FMT_NONE) { + if (target != AV_PIX_FMT_NONE) av_log(NULL, AV_LOG_WARNING, "Incompatible pixel format '%s' for codec '%s', auto-selecting format '%s'\n", av_pix_fmt_descriptors[target].name, @@ -93,14 +93,14 @@ static char *choose_pix_fmts(OutputStream *ost) if (ost->filter) avfilter_graph_set_auto_convert(ost->filter->graph->graph, AVFILTER_AUTO_CONVERT_NONE); - if (ost->st->codec->pix_fmt == PIX_FMT_NONE) + if (ost->st->codec->pix_fmt == AV_PIX_FMT_NONE) return NULL; return av_strdup(av_get_pix_fmt_name(ost->st->codec->pix_fmt)); } - if (ost->st->codec->pix_fmt != PIX_FMT_NONE) { + if (ost->st->codec->pix_fmt != AV_PIX_FMT_NONE) { return av_strdup(av_get_pix_fmt_name(choose_pixel_fmt(ost->st, ost->enc, ost->st->codec->pix_fmt))); } else if (ost->enc && ost->enc->pix_fmts) { - const enum PixelFormat *p; + const enum AVPixelFormat *p; AVIOContext *s = NULL; uint8_t *ret; int len; @@ -111,14 +111,14 @@ static char *choose_pix_fmts(OutputStream *ost) p = ost->enc->pix_fmts; if (ost->st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) { if (ost->st->codec->codec_id == AV_CODEC_ID_MJPEG) { - p = (const enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE }; + p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }; } else if (ost->st->codec->codec_id == AV_CODEC_ID_LJPEG) { - p = (const enum PixelFormat[]) { PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUV420P, - PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_BGRA, PIX_FMT_NONE }; + p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE }; } } - for (; *p != PIX_FMT_NONE; p++) { + for (; *p != AV_PIX_FMT_NONE; p++) { const char *name = av_get_pix_fmt_name(*p); avio_printf(s, "%s:", name); } @@ -159,7 +159,7 @@ static char *choose_ ## var ## s(OutputStream *ost) \ return NULL; \ } -// DEF_CHOOSE_FORMAT(enum PixelFormat, pix_fmt, pix_fmts, PIX_FMT_NONE, +// DEF_CHOOSE_FORMAT(enum AVPixelFormat, pix_fmt, pix_fmts, AV_PIX_FMT_NONE, // GET_PIX_FMT_NAME, ":") DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts, @@ -526,17 +526,17 @@ static int sub2video_prepare(InputStream *ist) ist->sub2video.w = ist->st->codec->width = w; ist->sub2video.h = ist->st->codec->height = h; - /* rectangles are PIX_FMT_PAL8, but we have no guarantee that the + /* rectangles are AV_PIX_FMT_PAL8, but we have no guarantee that the palettes for all rectangles are identical or compatible */ - ist->st->codec->pix_fmt = PIX_FMT_RGB32; + ist->st->codec->pix_fmt = AV_PIX_FMT_RGB32; - ret = av_image_alloc(image, linesize, w, h, PIX_FMT_RGB32, 32); + ret = av_image_alloc(image, linesize, w, h, AV_PIX_FMT_RGB32, 32); if (ret < 0) return ret; memset(image[0], 0, h * linesize[0]); ist->sub2video.ref = avfilter_get_video_buffer_ref_from_arrays( image, linesize, AV_PERM_READ | AV_PERM_PRESERVE, - w, h, PIX_FMT_RGB32); + w, h, AV_PIX_FMT_RGB32); if (!ist->sub2video.ref) { av_free(image[0]); return AVERROR(ENOMEM); diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index 323ae8b869..26dcdff856 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -1078,7 +1078,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in if (!*++frame_pix_fmt) frame_pix_fmt = NULL; } - if (frame_pix_fmt && (video_enc->pix_fmt = av_get_pix_fmt(frame_pix_fmt)) == PIX_FMT_NONE) { + if (frame_pix_fmt && (video_enc->pix_fmt = av_get_pix_fmt(frame_pix_fmt)) == AV_PIX_FMT_NONE) { av_log(NULL, AV_LOG_FATAL, "Unknown pixel format requested: %s.\n", frame_pix_fmt); exit(1); } @@ -1463,7 +1463,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_ sws_flags = av_get_int(sws_opts, "sws_flags", NULL); is->img_convert_ctx = sws_getCachedContext(is->img_convert_ctx, vp->width, vp->height, src_frame->format, vp->width, vp->height, - PIX_FMT_YUV420P, sws_flags, NULL, NULL, NULL); + AV_PIX_FMT_YUV420P, sws_flags, NULL, NULL, NULL); if (is->img_convert_ctx == NULL) { fprintf(stderr, "Cannot initialize the conversion context\n"); exit(1); @@ -1599,7 +1599,7 @@ fail: static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters) { - static const enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; char sws_flags_str[128]; char buffersrc_args[256]; int ret; @@ -1671,7 +1671,7 @@ static int video_thread(void *arg) AVFilterContext *filt_out = NULL, *filt_in = NULL; int last_w = 0; int last_h = 0; - enum PixelFormat last_format = -2; + enum AVPixelFormat last_format = -2; if (codec->codec->capabilities & CODEC_CAP_DR1) { is->use_dr1 = 1; 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"), }; diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index 27705513d4..e83c44ae29 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -273,7 +273,7 @@ static int grab_read_header(AVFormatContext *s1) s->per_frame = ((uint64_t)1000000 * framerate.den) / framerate.num; st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - st->codec->pix_fmt = PIX_FMT_YUV420P; + st->codec->pix_fmt = AV_PIX_FMT_YUV420P; st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; st->codec->width = s->width; st->codec->height = s->height; diff --git a/libavdevice/caca.c b/libavdevice/caca.c index c47906ecd9..6cd0306d18 100644 --- a/libavdevice/caca.c +++ b/libavdevice/caca.c @@ -126,7 +126,7 @@ static int caca_write_header(AVFormatContext *s) return AVERROR(EINVAL); } - if (encctx->pix_fmt != PIX_FMT_RGB24) { + if (encctx->pix_fmt != AV_PIX_FMT_RGB24) { av_log(s, AV_LOG_ERROR, "Unsupported pixel format '%s', choose rgb24\n", av_get_pix_fmt_name(encctx->pix_fmt)); diff --git a/libavdevice/dshow.c b/libavdevice/dshow.c index 1e867325d0..3bd90b0c6f 100644 --- a/libavdevice/dshow.c +++ b/libavdevice/dshow.c @@ -53,7 +53,7 @@ struct dshow_ctx { IMediaControl *control; - enum PixelFormat pixel_format; + enum AVPixelFormat pixel_format; enum AVCodecID video_codec_id; char *framerate; @@ -66,33 +66,33 @@ struct dshow_ctx { int channels; }; -static enum PixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount) +static enum AVPixelFormat dshow_pixfmt(DWORD biCompression, WORD biBitCount) { switch(biCompression) { case MKTAG('U', 'Y', 'V', 'Y'): - return PIX_FMT_UYVY422; + return AV_PIX_FMT_UYVY422; case MKTAG('Y', 'U', 'Y', '2'): - return PIX_FMT_YUYV422; + return AV_PIX_FMT_YUYV422; case MKTAG('I', '4', '2', '0'): - return PIX_FMT_YUV420P; + return AV_PIX_FMT_YUV420P; case BI_BITFIELDS: case BI_RGB: switch(biBitCount) { /* 1-8 are untested */ case 1: - return PIX_FMT_MONOWHITE; + return AV_PIX_FMT_MONOWHITE; case 4: - return PIX_FMT_RGB4; + return AV_PIX_FMT_RGB4; case 8: - return PIX_FMT_RGB8; + return AV_PIX_FMT_RGB8; case 16: - return PIX_FMT_RGB555; + return AV_PIX_FMT_RGB555; case 24: - return PIX_FMT_BGR24; + return AV_PIX_FMT_BGR24; case 32: - return PIX_FMT_RGB32; + return AV_PIX_FMT_RGB32; } } - return PIX_FMT_NONE; + return AV_PIX_FMT_NONE; } static enum AVCodecID dshow_codecid(DWORD biCompression) @@ -373,8 +373,8 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, goto next; } if (!pformat_set) { - enum PixelFormat pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount); - if (pix_fmt == PIX_FMT_NONE) { + enum AVPixelFormat pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount); + if (pix_fmt == AV_PIX_FMT_NONE) { enum AVCodecID codec_id = dshow_codecid(bih->biCompression); AVCodec *codec = avcodec_find_decoder(codec_id); if (codec_id == AV_CODEC_ID_NONE || !codec) { @@ -396,7 +396,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype, if (ctx->video_codec_id != dshow_codecid(bih->biCompression)) goto next; } - if (ctx->pixel_format != PIX_FMT_NONE && + if (ctx->pixel_format != AV_PIX_FMT_NONE && ctx->pixel_format != dshow_pixfmt(bih->biCompression, bih->biBitCount)) { goto next; } @@ -535,7 +535,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype, int set_format = (devtype == VideoDevice && (ctx->framerate || (ctx->requested_width && ctx->requested_height) || - ctx->pixel_format != PIX_FMT_NONE || + ctx->pixel_format != AV_PIX_FMT_NONE || ctx->video_codec_id != AV_CODEC_ID_RAWVIDEO)) || (devtype == AudioDevice && (ctx->channels || ctx->sample_rate)); int format_set = 0; @@ -779,7 +779,7 @@ dshow_add_device(AVFormatContext *avctx, codec->width = bih->biWidth; codec->height = bih->biHeight; codec->pix_fmt = dshow_pixfmt(bih->biCompression, bih->biBitCount); - if (codec->pix_fmt == PIX_FMT_NONE) { + if (codec->pix_fmt == AV_PIX_FMT_NONE) { codec->codec_id = dshow_codecid(bih->biCompression); if (codec->codec_id == AV_CODEC_ID_NONE) { av_log(avctx, AV_LOG_ERROR, "Unknown compression type. " @@ -878,7 +878,7 @@ static int dshow_read_header(AVFormatContext *avctx) ctx->video_codec_id = avctx->video_codec_id ? avctx->video_codec_id : AV_CODEC_ID_RAWVIDEO; - if (ctx->pixel_format != PIX_FMT_NONE) { + if (ctx->pixel_format != AV_PIX_FMT_NONE) { if (ctx->video_codec_id != AV_CODEC_ID_RAWVIDEO) { av_log(avctx, AV_LOG_ERROR, "Pixel format may only be set when " "video codec is not set or set to rawvideo\n"); diff --git a/libavdevice/fbdev.c b/libavdevice/fbdev.c index d97749576d..386ee72b68 100644 --- a/libavdevice/fbdev.c +++ b/libavdevice/fbdev.c @@ -48,20 +48,20 @@ struct rgb_pixfmt_map_entry { int bits_per_pixel; int red_offset, green_offset, blue_offset, alpha_offset; - enum PixelFormat pixfmt; + enum AVPixelFormat pixfmt; }; static const struct rgb_pixfmt_map_entry rgb_pixfmt_map[] = { // bpp, red_offset, green_offset, blue_offset, alpha_offset, pixfmt - { 32, 0, 8, 16, 24, PIX_FMT_RGBA }, - { 32, 16, 8, 0, 24, PIX_FMT_BGRA }, - { 32, 8, 16, 24, 0, PIX_FMT_ARGB }, - { 32, 3, 2, 8, 0, PIX_FMT_ABGR }, - { 24, 0, 8, 16, 0, PIX_FMT_RGB24 }, - { 24, 16, 8, 0, 0, PIX_FMT_BGR24 }, + { 32, 0, 8, 16, 24, AV_PIX_FMT_RGBA }, + { 32, 16, 8, 0, 24, AV_PIX_FMT_BGRA }, + { 32, 8, 16, 24, 0, AV_PIX_FMT_ARGB }, + { 32, 3, 2, 8, 0, AV_PIX_FMT_ABGR }, + { 24, 0, 8, 16, 0, AV_PIX_FMT_RGB24 }, + { 24, 16, 8, 0, 0, AV_PIX_FMT_BGR24 }, }; -static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo) +static enum AVPixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *varinfo) { int i; @@ -74,7 +74,7 @@ static enum PixelFormat get_pixfmt_from_fb_varinfo(struct fb_var_screeninfo *var return entry->pixfmt; } - return PIX_FMT_NONE; + return AV_PIX_FMT_NONE; } typedef struct { @@ -99,7 +99,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx) { FBDevContext *fbdev = avctx->priv_data; AVStream *st = NULL; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; int ret, flags = O_RDONLY; ret = av_parse_video_rate(&fbdev->framerate_q, fbdev->framerate); @@ -139,7 +139,7 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx) } pix_fmt = get_pixfmt_from_fb_varinfo(&fbdev->varinfo); - if (pix_fmt == PIX_FMT_NONE) { + if (pix_fmt == AV_PIX_FMT_NONE) { ret = AVERROR(EINVAL); av_log(avctx, AV_LOG_ERROR, "Framebuffer pixel format not supported.\n"); diff --git a/libavdevice/lavfi.c b/libavdevice/lavfi.c index e080857c80..860c055a05 100644 --- a/libavdevice/lavfi.c +++ b/libavdevice/lavfi.c @@ -86,7 +86,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx) LavfiContext *lavfi = avctx->priv_data; AVFilterInOut *input_links = NULL, *output_links = NULL, *inout; AVFilter *buffersink, *abuffersink; - int *pix_fmts = create_all_formats(PIX_FMT_NB); + int *pix_fmts = create_all_formats(AV_PIX_FMT_NB); enum AVMediaType type; int ret = 0, i, n; diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c index 82dd3c5603..bae1497c4b 100644 --- a/libavdevice/libdc1394.c +++ b/libavdevice/libdc1394.c @@ -73,12 +73,12 @@ typedef struct dc1394_data { struct dc1394_frame_format { int width; int height; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; int frame_size_id; } dc1394_frame_formats[] = { - { 320, 240, PIX_FMT_UYVY422, DC1394_VIDEO_MODE_320x240_YUV422 }, - { 640, 480, PIX_FMT_UYYVYY411, DC1394_VIDEO_MODE_640x480_YUV411 }, - { 640, 480, PIX_FMT_UYVY422, DC1394_VIDEO_MODE_640x480_YUV422 }, + { 320, 240, AV_PIX_FMT_UYVY422, DC1394_VIDEO_MODE_320x240_YUV422 }, + { 640, 480, AV_PIX_FMT_UYYVYY411, DC1394_VIDEO_MODE_640x480_YUV411 }, + { 640, 480, AV_PIX_FMT_UYVY422, DC1394_VIDEO_MODE_640x480_YUV422 }, { 0, 0, 0, 0 } /* gotta be the last one */ }; @@ -124,12 +124,12 @@ static inline int dc1394_read_common(AVFormatContext *c, AVStream* vst; struct dc1394_frame_format *fmt; struct dc1394_frame_rate *fps; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; int width, height; AVRational framerate; int ret = 0; - if ((pix_fmt = av_get_pix_fmt(dc1394->pixel_format)) == PIX_FMT_NONE) { + if ((pix_fmt = av_get_pix_fmt(dc1394->pixel_format)) == AV_PIX_FMT_NONE) { av_log(c, AV_LOG_ERROR, "No such pixel format: %s.\n", dc1394->pixel_format); ret = AVERROR(EINVAL); goto out; diff --git a/libavdevice/sdl.c b/libavdevice/sdl.c index 5d135a5494..1867139457 100644 --- a/libavdevice/sdl.c +++ b/libavdevice/sdl.c @@ -44,12 +44,12 @@ typedef struct { } SDLContext; static const struct sdl_overlay_pix_fmt_entry { - enum PixelFormat pix_fmt; int overlay_fmt; + enum AVPixelFormat pix_fmt; int overlay_fmt; } sdl_overlay_pix_fmt_map[] = { - { PIX_FMT_YUV420P, SDL_IYUV_OVERLAY }, - { PIX_FMT_YUYV422, SDL_YUY2_OVERLAY }, - { PIX_FMT_UYVY422, SDL_UYVY_OVERLAY }, - { PIX_FMT_NONE, 0 }, + { AV_PIX_FMT_YUV420P, SDL_IYUV_OVERLAY }, + { AV_PIX_FMT_YUYV422, SDL_YUY2_OVERLAY }, + { AV_PIX_FMT_UYVY422, SDL_UYVY_OVERLAY }, + { AV_PIX_FMT_NONE, 0 }, }; static int sdl_write_trailer(AVFormatContext *s) @@ -104,7 +104,7 @@ static int sdl_write_header(AVFormatContext *s) goto fail; } - for (i = 0; sdl_overlay_pix_fmt_map[i].pix_fmt != PIX_FMT_NONE; i++) { + for (i = 0; sdl_overlay_pix_fmt_map[i].pix_fmt != AV_PIX_FMT_NONE; i++) { if (sdl_overlay_pix_fmt_map[i].pix_fmt == encctx->pix_fmt) { sdl->overlay_fmt = sdl_overlay_pix_fmt_map[i].overlay_fmt; break; diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c index 3d75110d82..e2f37d6d95 100644 --- a/libavdevice/v4l.c +++ b/libavdevice/v4l.c @@ -60,16 +60,16 @@ typedef struct { static const struct { int palette; int depth; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; } video_formats [] = { - {.palette = VIDEO_PALETTE_YUV420P, .depth = 12, .pix_fmt = PIX_FMT_YUV420P }, - {.palette = VIDEO_PALETTE_YUV422, .depth = 16, .pix_fmt = PIX_FMT_YUYV422 }, - {.palette = VIDEO_PALETTE_UYVY, .depth = 16, .pix_fmt = PIX_FMT_UYVY422 }, - {.palette = VIDEO_PALETTE_YUYV, .depth = 16, .pix_fmt = PIX_FMT_YUYV422 }, + {.palette = VIDEO_PALETTE_YUV420P, .depth = 12, .pix_fmt = AV_PIX_FMT_YUV420P }, + {.palette = VIDEO_PALETTE_YUV422, .depth = 16, .pix_fmt = AV_PIX_FMT_YUYV422 }, + {.palette = VIDEO_PALETTE_UYVY, .depth = 16, .pix_fmt = AV_PIX_FMT_UYVY422 }, + {.palette = VIDEO_PALETTE_YUYV, .depth = 16, .pix_fmt = AV_PIX_FMT_YUYV422 }, /* NOTE: v4l uses BGR24, not RGB24 */ - {.palette = VIDEO_PALETTE_RGB24, .depth = 24, .pix_fmt = PIX_FMT_BGR24 }, - {.palette = VIDEO_PALETTE_RGB565, .depth = 16, .pix_fmt = PIX_FMT_BGR565 }, - {.palette = VIDEO_PALETTE_GREY, .depth = 8, .pix_fmt = PIX_FMT_GRAY8 }, + {.palette = VIDEO_PALETTE_RGB24, .depth = 24, .pix_fmt = AV_PIX_FMT_BGR24 }, + {.palette = VIDEO_PALETTE_RGB565, .depth = 16, .pix_fmt = AV_PIX_FMT_BGR565 }, + {.palette = VIDEO_PALETTE_GREY, .depth = 8, .pix_fmt = AV_PIX_FMT_GRAY8 }, }; diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 193b8e9c98..cd6aeb225a 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -27,7 +27,7 @@ * (http://v4l2spec.bytesex.org/v4l2spec/capture.c) * * Thanks to Michael Niedermayer for providing the mapping between - * V4L2_PIX_FMT_* and PIX_FMT_* + * V4L2_PIX_FMT_* and AV_PIX_FMT_* */ #undef __STRICT_ANSI__ //workaround due to broken kernel headers @@ -124,34 +124,34 @@ struct buff_data { }; struct fmt_map { - enum PixelFormat ff_fmt; + enum AVPixelFormat ff_fmt; enum AVCodecID codec_id; uint32_t v4l2_fmt; }; static struct fmt_map fmt_conversion_table[] = { //ff_fmt codec_id v4l2_fmt - { PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 }, - { PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420 }, - { PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P }, - { PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV }, - { PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY }, - { PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P }, - { PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 }, - { PIX_FMT_RGB555LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 }, - { PIX_FMT_RGB555BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555X }, - { PIX_FMT_RGB565LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 }, - { PIX_FMT_RGB565BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X }, - { PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 }, - { PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 }, - { PIX_FMT_BGR0, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 }, - { PIX_FMT_0RGB, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32 }, - { PIX_FMT_GRAY8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY }, - { PIX_FMT_NV12, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 }, - { PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG }, - { PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG }, + { AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV420 }, + { AV_PIX_FMT_YUV420P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YVU420 }, + { AV_PIX_FMT_YUV422P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV422P }, + { AV_PIX_FMT_YUYV422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUYV }, + { AV_PIX_FMT_UYVY422, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_UYVY }, + { AV_PIX_FMT_YUV411P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV411P }, + { AV_PIX_FMT_YUV410P, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_YUV410 }, + { AV_PIX_FMT_RGB555LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 }, + { AV_PIX_FMT_RGB555BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555X }, + { AV_PIX_FMT_RGB565LE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 }, + { AV_PIX_FMT_RGB565BE,AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565X }, + { AV_PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 }, + { AV_PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 }, + { AV_PIX_FMT_BGR0, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 }, + { AV_PIX_FMT_0RGB, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB32 }, + { AV_PIX_FMT_GRAY8, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_GREY }, + { AV_PIX_FMT_NV12, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_NV12 }, + { AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_MJPEG }, + { AV_PIX_FMT_NONE, AV_CODEC_ID_MJPEG, V4L2_PIX_FMT_JPEG }, #ifdef V4L2_PIX_FMT_CPIA1 - { PIX_FMT_NONE, AV_CODEC_ID_CPIA, V4L2_PIX_FMT_CPIA1 }, + { AV_PIX_FMT_NONE, AV_CODEC_ID_CPIA, V4L2_PIX_FMT_CPIA1 }, #endif }; @@ -267,14 +267,14 @@ static int first_field(int fd) return 1; } -static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt, enum AVCodecID codec_id) +static uint32_t fmt_ff2v4l(enum AVPixelFormat pix_fmt, enum AVCodecID codec_id) { int i; for (i = 0; i < FF_ARRAY_ELEMS(fmt_conversion_table); i++) { if ((codec_id == AV_CODEC_ID_NONE || fmt_conversion_table[i].codec_id == codec_id) && - (pix_fmt == PIX_FMT_NONE || + (pix_fmt == AV_PIX_FMT_NONE || fmt_conversion_table[i].ff_fmt == pix_fmt)) { return fmt_conversion_table[i].v4l2_fmt; } @@ -283,7 +283,7 @@ static uint32_t fmt_ff2v4l(enum PixelFormat pix_fmt, enum AVCodecID codec_id) return 0; } -static enum PixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id) +static enum AVPixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id) { int i; @@ -294,7 +294,7 @@ static enum PixelFormat fmt_v4l2ff(uint32_t v4l2_fmt, enum AVCodecID codec_id) } } - return PIX_FMT_NONE; + return AV_PIX_FMT_NONE; } static enum AVCodecID fmt_v4l2codec(uint32_t v4l2_fmt) @@ -342,7 +342,7 @@ static void list_formats(AVFormatContext *ctx, int fd, int type) while(!ioctl(fd, VIDIOC_ENUM_FMT, &vfd)) { enum AVCodecID codec_id = fmt_v4l2codec(vfd.pixelformat); - enum PixelFormat pix_fmt = fmt_v4l2ff(vfd.pixelformat, codec_id); + enum AVPixelFormat pix_fmt = fmt_v4l2ff(vfd.pixelformat, codec_id); vfd.index++; @@ -739,7 +739,7 @@ static int v4l2_set_parameters(AVFormatContext *s1) } static uint32_t device_try_init(AVFormatContext *s1, - enum PixelFormat pix_fmt, + enum AVPixelFormat pix_fmt, int *width, int *height, enum AVCodecID *codec_id) @@ -778,7 +778,7 @@ static int v4l2_read_header(AVFormatContext *s1) int res = 0; uint32_t desired_format; enum AVCodecID codec_id = AV_CODEC_ID_NONE; - enum PixelFormat pix_fmt = PIX_FMT_NONE; + enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE; st = avformat_new_stream(s1, NULL); if (!st) { @@ -808,7 +808,7 @@ static int v4l2_read_header(AVFormatContext *s1) pix_fmt = av_get_pix_fmt(s->pixel_format); - if (pix_fmt == PIX_FMT_NONE && !codec) { + if (pix_fmt == AV_PIX_FMT_NONE && !codec) { av_log(s1, AV_LOG_ERROR, "No such input format: %s.\n", s->pixel_format); diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index 3b348ffade..66b02befda 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -45,32 +45,32 @@ struct vfw_ctx { char *framerate; /**< Set by a private option. */ }; -static enum PixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount) +static enum AVPixelFormat vfw_pixfmt(DWORD biCompression, WORD biBitCount) { switch(biCompression) { case MKTAG('U', 'Y', 'V', 'Y'): - return PIX_FMT_UYVY422; + return AV_PIX_FMT_UYVY422; case MKTAG('Y', 'U', 'Y', '2'): - return PIX_FMT_YUYV422; + return AV_PIX_FMT_YUYV422; case MKTAG('I', '4', '2', '0'): - return PIX_FMT_YUV420P; + return AV_PIX_FMT_YUV420P; case BI_RGB: switch(biBitCount) { /* 1-8 are untested */ case 1: - return PIX_FMT_MONOWHITE; + return AV_PIX_FMT_MONOWHITE; case 4: - return PIX_FMT_RGB4; + return AV_PIX_FMT_RGB4; case 8: - return PIX_FMT_RGB8; + return AV_PIX_FMT_RGB8; case 16: - return PIX_FMT_RGB555; + return AV_PIX_FMT_RGB555; case 24: - return PIX_FMT_BGR24; + return AV_PIX_FMT_BGR24; case 32: - return PIX_FMT_RGB32; + return AV_PIX_FMT_RGB32; } } - return PIX_FMT_NONE; + return AV_PIX_FMT_NONE; } static enum AVCodecID vfw_codecid(DWORD biCompression) @@ -377,7 +377,7 @@ static int vfw_read_header(AVFormatContext *s) codec->width = bi->bmiHeader.biWidth; codec->height = bi->bmiHeader.biHeight; codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount); - if(codec->pix_fmt == PIX_FMT_NONE) { + if(codec->pix_fmt == AV_PIX_FMT_NONE) { codec->codec_id = vfw_codecid(biCompression); if(codec->codec_id == AV_CODEC_ID_NONE) { av_log(s, AV_LOG_ERROR, "Unknown compression type. " diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index b6bd4860f1..91c62d93e7 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -157,7 +157,7 @@ x11grab_read_header(AVFormatContext *s1) struct x11grab *x11grab = s1->priv_data; Display *dpy; AVStream *st = NULL; - enum PixelFormat input_pixfmt; + enum AVPixelFormat input_pixfmt; XImage *image; int x_off = 0; int y_off = 0; @@ -260,19 +260,19 @@ x11grab_read_header(AVFormatContext *s1) switch (image->bits_per_pixel) { case 8: av_log (s1, AV_LOG_DEBUG, "8 bit palette\n"); - input_pixfmt = PIX_FMT_PAL8; + input_pixfmt = AV_PIX_FMT_PAL8; break; case 16: if ( image->red_mask == 0xf800 && image->green_mask == 0x07e0 && image->blue_mask == 0x001f ) { av_log (s1, AV_LOG_DEBUG, "16 bit RGB565\n"); - input_pixfmt = PIX_FMT_RGB565; + input_pixfmt = AV_PIX_FMT_RGB565; } else if (image->red_mask == 0x7c00 && image->green_mask == 0x03e0 && image->blue_mask == 0x001f ) { av_log(s1, AV_LOG_DEBUG, "16 bit RGB555\n"); - input_pixfmt = PIX_FMT_RGB555; + input_pixfmt = AV_PIX_FMT_RGB555; } else { av_log(s1, AV_LOG_ERROR, "RGB ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel); av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask); @@ -284,11 +284,11 @@ x11grab_read_header(AVFormatContext *s1) if ( image->red_mask == 0xff0000 && image->green_mask == 0x00ff00 && image->blue_mask == 0x0000ff ) { - input_pixfmt = PIX_FMT_BGR24; + input_pixfmt = AV_PIX_FMT_BGR24; } else if ( image->red_mask == 0x0000ff && image->green_mask == 0x00ff00 && image->blue_mask == 0xff0000 ) { - input_pixfmt = PIX_FMT_RGB24; + input_pixfmt = AV_PIX_FMT_RGB24; } else { av_log(s1, AV_LOG_ERROR,"rgb ordering at image depth %i not supported ... aborting\n", image->bits_per_pixel); av_log(s1, AV_LOG_ERROR, "color masks: r 0x%.6lx g 0x%.6lx b 0x%.6lx\n", image->red_mask, image->green_mask, image->blue_mask); @@ -297,7 +297,7 @@ x11grab_read_header(AVFormatContext *s1) } break; case 32: - input_pixfmt = PIX_FMT_0RGB32; + input_pixfmt = AV_PIX_FMT_0RGB32; break; default: av_log(s1, AV_LOG_ERROR, "image depth %i not supported ... aborting\n", image->bits_per_pixel); diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c index 3a5e0262e7..641c27f9bf 100644 --- a/libavfilter/avf_showspectrum.c +++ b/libavfilter/avf_showspectrum.c @@ -88,7 +88,7 @@ static int query_formats(AVFilterContext *ctx) AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16P, -1 }; - static const enum PixelFormat pix_fmts[] = { PIX_FMT_RGB24, -1 }; + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGB24, -1 }; /* set input audio formats */ formats = ff_make_format_list(sample_fmts); diff --git a/libavfilter/avf_showwaves.c b/libavfilter/avf_showwaves.c index dcbe8b8a61..2e3bfba458 100644 --- a/libavfilter/avf_showwaves.c +++ b/libavfilter/avf_showwaves.c @@ -88,7 +88,7 @@ static int query_formats(AVFilterContext *ctx) AVFilterLink *inlink = ctx->inputs[0]; AVFilterLink *outlink = ctx->outputs[0]; static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, -1 }; - static const enum PixelFormat pix_fmts[] = { PIX_FMT_GRAY8, -1 }; + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, -1 }; /* set input audio formats */ formats = ff_make_format_list(sample_fmts); diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 9f49a8b2b1..670a3a3dd0 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -142,7 +142,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad, link->srcpad = &src->output_pads[srcpad]; link->dstpad = &dst->input_pads[dstpad]; link->type = src->output_pads[srcpad].type; - av_assert0(PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1); + av_assert0(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1); link->format = -1; return 0; diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index d66bc000be..510f28a8de 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -753,7 +753,7 @@ int avfilter_config_links(AVFilterContext *filter); */ AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms, - int w, int h, enum PixelFormat format); + int w, int h, enum AVPixelFormat format); /** * Create an audio buffer reference wrapped around an already diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index b745c3c991..ab37faeaf7 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -425,10 +425,10 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref) if (link->type == AVMEDIA_TYPE_VIDEO) { if(ref && ref->type == AVMEDIA_TYPE_VIDEO){ int has_alpha= av_pix_fmt_descriptors[ref->format].nb_components % 2 == 0; - enum PixelFormat best= PIX_FMT_NONE; + enum AVPixelFormat best= AV_PIX_FMT_NONE; int i; for (i=0; i<link->in_formats->format_count; i++) { - enum PixelFormat p = link->in_formats->formats[i]; + enum AVPixelFormat p = link->in_formats->formats[i]; best= avcodec_find_best_pix_fmt_of_2(best, p, ref->format, has_alpha, NULL); } av_log(link->src,AV_LOG_DEBUG, "picking %s out of %d ref:%s alpha:%d\n", diff --git a/libavfilter/buffersink.h b/libavfilter/buffersink.h index acafa76d6e..a4019375d9 100644 --- a/libavfilter/buffersink.h +++ b/libavfilter/buffersink.h @@ -30,7 +30,7 @@ * Struct to use for initializing a buffersink context. */ typedef struct { - const enum PixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by PIX_FMT_NONE + const enum AVPixelFormat *pixel_fmts; ///< list of allowed pixel formats, terminated by AV_PIX_FMT_NONE } AVBufferSinkParams; /** diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index db2db3a482..85f7063669 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -48,7 +48,7 @@ typedef struct { /* video only */ int w, h; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; AVRational pixel_aspect; char *sws_param; diff --git a/libavfilter/drawutils.c b/libavfilter/drawutils.c index 08b26592bc..4214fc8413 100644 --- a/libavfilter/drawutils.c +++ b/libavfilter/drawutils.c @@ -30,19 +30,19 @@ enum { RED = 0, GREEN, BLUE, ALPHA }; -int ff_fill_rgba_map(uint8_t *rgba_map, enum PixelFormat pix_fmt) +int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt) { switch (pix_fmt) { - case PIX_FMT_0RGB: - case PIX_FMT_ARGB: rgba_map[ALPHA] = 0; rgba_map[RED ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break; - case PIX_FMT_0BGR: - case PIX_FMT_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break; - case PIX_FMT_RGB0: - case PIX_FMT_RGBA: - case PIX_FMT_RGB24: rgba_map[RED ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break; - case PIX_FMT_BGRA: - case PIX_FMT_BGR0: - case PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break; + case AV_PIX_FMT_0RGB: + case AV_PIX_FMT_ARGB: rgba_map[ALPHA] = 0; rgba_map[RED ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break; + case AV_PIX_FMT_0BGR: + case AV_PIX_FMT_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break; + case AV_PIX_FMT_RGB0: + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_RGB24: rgba_map[RED ] = 0; rgba_map[GREEN] = 1; rgba_map[BLUE ] = 2; rgba_map[ALPHA] = 3; break; + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_BGR0: + case AV_PIX_FMT_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break; default: /* unsupported */ return AVERROR(EINVAL); } @@ -50,7 +50,7 @@ int ff_fill_rgba_map(uint8_t *rgba_map, enum PixelFormat pix_fmt) } int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], - enum PixelFormat pix_fmt, uint8_t rgba_color[4], + enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba, uint8_t rgba_map_ptr[4]) { uint8_t rgba_map[4] = {0}; @@ -132,7 +132,7 @@ void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4], } } -int ff_draw_init(FFDrawContext *draw, enum PixelFormat format, unsigned flags) +int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags) { const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[format]; const AVComponentDescriptor *c; @@ -193,7 +193,7 @@ void ff_draw_color(FFDrawContext *draw, FFDrawColor *color, const uint8_t rgba[4 color->comp[1].u8[0] = RGB_TO_U_CCIR(rgba[0], rgba[1], rgba[2], 0); color->comp[2].u8[0] = RGB_TO_V_CCIR(rgba[0], rgba[1], rgba[2], 0); color->comp[3].u8[0] = rgba[3]; - } else if (draw->format == PIX_FMT_GRAY8 || draw->format == PIX_FMT_GRAY8A) { + } else if (draw->format == AV_PIX_FMT_GRAY8 || draw->format == AV_PIX_FMT_GRAY8A) { color->comp[0].u8[0] = RGB_TO_Y_CCIR(rgba[0], rgba[1], rgba[2]); color->comp[1].u8[0] = rgba[3]; } else { @@ -501,14 +501,14 @@ int ff_draw_round_to_sub(FFDrawContext *draw, int sub_dir, int round_dir, AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags) { - enum PixelFormat i, pix_fmts[PIX_FMT_NB + 1]; + enum AVPixelFormat i, pix_fmts[AV_PIX_FMT_NB + 1]; unsigned n = 0; FFDrawContext draw; - for (i = 0; i < PIX_FMT_NB; i++) + for (i = 0; i < AV_PIX_FMT_NB; i++) if (ff_draw_init(&draw, i, flags) >= 0) pix_fmts[n++] = i; - pix_fmts[n++] = PIX_FMT_NONE; + pix_fmts[n++] = AV_PIX_FMT_NONE; return ff_make_format_list(pix_fmts); } @@ -518,13 +518,13 @@ AVFilterFormats *ff_draw_supported_pixel_formats(unsigned flags) int main(void) { - enum PixelFormat f; + enum AVPixelFormat f; const AVPixFmtDescriptor *desc; FFDrawContext draw; FFDrawColor color; int r, i; - for (f = 0; f < PIX_FMT_NB; f++) { + for (f = 0; f < AV_PIX_FMT_NB; f++) { desc = &av_pix_fmt_descriptors[f]; if (!desc->name) continue; diff --git a/libavfilter/drawutils.h b/libavfilter/drawutils.h index 211810a203..df4169575b 100644 --- a/libavfilter/drawutils.h +++ b/libavfilter/drawutils.h @@ -28,11 +28,11 @@ #include "avfilter.h" #include "libavutil/pixfmt.h" -int ff_fill_rgba_map(uint8_t *rgba_map, enum PixelFormat pix_fmt); +int ff_fill_rgba_map(uint8_t *rgba_map, enum AVPixelFormat pix_fmt); int ff_fill_line_with_color(uint8_t *line[4], int pixel_step[4], int w, uint8_t dst_color[4], - enum PixelFormat pix_fmt, uint8_t rgba_color[4], + enum AVPixelFormat pix_fmt, uint8_t rgba_color[4], int *is_packed_rgba, uint8_t rgba_map[4]); void ff_draw_rectangle(uint8_t *dst[4], int dst_linesize[4], @@ -47,7 +47,7 @@ void ff_copy_rectangle(uint8_t *dst[4], int dst_linesize[4], typedef struct FFDrawContext { const struct AVPixFmtDescriptor *desc; - enum PixelFormat format; + enum AVPixelFormat format; unsigned nb_planes; int pixelstep[MAX_PLANES]; /*< offset between pixels */ uint8_t comp_mask[MAX_PLANES]; /*< bitmask of used non-alpha components */ @@ -74,7 +74,7 @@ typedef struct FFDrawColor { * No flags currently defined. * @return 0 for success, < 0 for error */ -int ff_draw_init(FFDrawContext *draw, enum PixelFormat format, unsigned flags); +int ff_draw_init(FFDrawContext *draw, enum AVPixelFormat format, unsigned flags); /** * Prepare a color. diff --git a/libavfilter/f_ebur128.c b/libavfilter/f_ebur128.c index ff403c8b05..5c5aecab9f 100644 --- a/libavfilter/f_ebur128.c +++ b/libavfilter/f_ebur128.c @@ -651,7 +651,7 @@ static int query_formats(AVFilterContext *ctx) static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_DBL, -1 }; static const int input_srate[] = {48000, -1}; // ITU-R BS.1770 provides coeff only for 48kHz - static const enum PixelFormat pix_fmts[] = { PIX_FMT_RGB24, -1 }; + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_RGB24, -1 }; /* set input audio formats */ formats = ff_make_format_list(sample_fmts); diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 735f21b119..c90fb35d6f 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -265,7 +265,7 @@ AVFilterFormats *ff_all_formats(enum AVMediaType type) { AVFilterFormats *ret = NULL; int fmt; - int num_formats = type == AVMEDIA_TYPE_VIDEO ? PIX_FMT_NB : + int num_formats = type == AVMEDIA_TYPE_VIDEO ? AV_PIX_FMT_NB : type == AVMEDIA_TYPE_AUDIO ? AV_SAMPLE_FMT_NB : 0; for (fmt = 0; fmt < num_formats; fmt++) @@ -458,13 +458,13 @@ int ff_default_query_formats(AVFilterContext *ctx) /* internal functions for parsing audio format arguments */ -int ff_parse_pixel_format(enum PixelFormat *ret, const char *arg, void *log_ctx) +int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx) { char *tail; int pix_fmt = av_get_pix_fmt(arg); - if (pix_fmt == PIX_FMT_NONE) { + if (pix_fmt == AV_PIX_FMT_NONE) { pix_fmt = strtol(arg, &tail, 0); - if (*tail || (unsigned)pix_fmt >= PIX_FMT_NB) { + if (*tail || (unsigned)pix_fmt >= AV_PIX_FMT_NB) { av_log(log_ctx, AV_LOG_ERROR, "Invalid pixel format '%s'\n", arg); return AVERROR(EINVAL); } diff --git a/libavfilter/internal.h b/libavfilter/internal.h index e82f04dbb9..8d03913d7e 100644 --- a/libavfilter/internal.h +++ b/libavfilter/internal.h @@ -223,7 +223,7 @@ int64_t *ff_copy_int64_list(const int64_t * const list); * @param log_ctx log context * @return 0 in case of success, a negative AVERROR code on error */ -int ff_parse_pixel_format(enum PixelFormat *ret, const char *arg, void *log_ctx); +int ff_parse_pixel_format(enum AVPixelFormat *ret, const char *arg, void *log_ctx); /** * Parse a sample rate. diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c index 70f7e7169a..a4711f93d9 100644 --- a/libavfilter/lavfutils.c +++ b/libavfilter/lavfutils.c @@ -22,7 +22,7 @@ #include "lavfutils.h" int ff_load_image(uint8_t *data[4], int linesize[4], - int *w, int *h, enum PixelFormat *pix_fmt, + int *w, int *h, enum AVPixelFormat *pix_fmt, const char *filename, void *log_ctx) { AVInputFormat *iformat = NULL; diff --git a/libavfilter/lavfutils.h b/libavfilter/lavfutils.h index c0943e20f8..a310e83384 100644 --- a/libavfilter/lavfutils.h +++ b/libavfilter/lavfutils.h @@ -37,7 +37,7 @@ * @return 0 in case of success, a negative error code otherwise. */ int ff_load_image(uint8_t *data[4], int linesize[4], - int *w, int *h, enum PixelFormat *pix_fmt, + int *w, int *h, enum AVPixelFormat *pix_fmt, const char *filename, void *log_ctx); #endif /* AVFILTER_LAVFUTILS_H */ diff --git a/libavfilter/libmpcodecs/vf_mcdeint.c b/libavfilter/libmpcodecs/vf_mcdeint.c index 2679289f33..01a3cb30ba 100644 --- a/libavfilter/libmpcodecs/vf_mcdeint.c +++ b/libavfilter/libmpcodecs/vf_mcdeint.c @@ -202,7 +202,7 @@ static int config(struct vf_instance *vf, avctx_enc->time_base= (AVRational){1,25}; // meaningless avctx_enc->gop_size = 300; avctx_enc->max_b_frames= 0; - avctx_enc->pix_fmt = PIX_FMT_YUV420P; + avctx_enc->pix_fmt = AV_PIX_FMT_YUV420P; avctx_enc->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY; avctx_enc->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; avctx_enc->global_quality= 1; diff --git a/libavfilter/libmpcodecs/vf_sab.c b/libavfilter/libmpcodecs/vf_sab.c index 4dadeb798e..807b726588 100644 --- a/libavfilter/libmpcodecs/vf_sab.c +++ b/libavfilter/libmpcodecs/vf_sab.c @@ -104,7 +104,7 @@ static int allocStuff(FilterParam *f, int width, int height){ swsF.lumH= swsF.lumV= vec; swsF.chrH= swsF.chrV= NULL; f->preFilterContext= sws_getContext( - width, height, PIX_FMT_GRAY8, width, height, PIX_FMT_GRAY8, SWS_POINT, &swsF, NULL, NULL); + width, height, AV_PIX_FMT_GRAY8, width, height, AV_PIX_FMT_GRAY8, SWS_POINT, &swsF, NULL, NULL); sws_freeVec(vec); vec = sws_getGaussianVec(f->strength, 5.0); diff --git a/libavfilter/libmpcodecs/vf_uspp.c b/libavfilter/libmpcodecs/vf_uspp.c index cc9a3db8dd..1c683f72cf 100644 --- a/libavfilter/libmpcodecs/vf_uspp.c +++ b/libavfilter/libmpcodecs/vf_uspp.c @@ -230,7 +230,7 @@ static int config(struct vf_instance *vf, avctx_enc->time_base= (AVRational){1,25}; // meaningless avctx_enc->gop_size = 300; avctx_enc->max_b_frames= 0; - avctx_enc->pix_fmt = PIX_FMT_YUV420P; + avctx_enc->pix_fmt = AV_PIX_FMT_YUV420P; avctx_enc->flags = CODEC_FLAG_QSCALE | CODEC_FLAG_LOW_DELAY; avctx_enc->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL; avctx_enc->global_quality= 123; diff --git a/libavfilter/lswsutils.c b/libavfilter/lswsutils.c index 2c98f3a13e..6902ee9df7 100644 --- a/libavfilter/lswsutils.c +++ b/libavfilter/lswsutils.c @@ -20,9 +20,9 @@ #include "lswsutils.h" int ff_scale_image(uint8_t *dst_data[4], int dst_linesize[4], - int dst_w, int dst_h, enum PixelFormat dst_pix_fmt, + int dst_w, int dst_h, enum AVPixelFormat dst_pix_fmt, uint8_t * const src_data[4], int src_linesize[4], - int src_w, int src_h, enum PixelFormat src_pix_fmt, + int src_w, int src_h, enum AVPixelFormat src_pix_fmt, void *log_ctx) { int ret; diff --git a/libavfilter/lswsutils.h b/libavfilter/lswsutils.h index 060048319e..f5f5320247 100644 --- a/libavfilter/lswsutils.h +++ b/libavfilter/lswsutils.h @@ -30,9 +30,9 @@ * Scale image using libswscale. */ int ff_scale_image(uint8_t *dst_data[4], int dst_linesize[4], - int dst_w, int dst_h, enum PixelFormat dst_pix_fmt, + int dst_w, int dst_h, enum AVPixelFormat dst_pix_fmt, uint8_t *const src_data[4], int src_linesize[4], - int src_w, int src_h, enum PixelFormat src_pix_fmt, + int src_w, int src_h, enum AVPixelFormat src_pix_fmt, void *log_ctx); #endif /* AVFILTER_LSWSUTILS_H */ diff --git a/libavfilter/sink_buffer.c b/libavfilter/sink_buffer.c index 83e43cf396..7d3958856f 100644 --- a/libavfilter/sink_buffer.c +++ b/libavfilter/sink_buffer.c @@ -61,7 +61,7 @@ typedef struct { unsigned warning_limit; /* only used for video */ - enum PixelFormat *pixel_fmts; ///< list of accepted pixel formats, must be terminated with -1 + enum AVPixelFormat *pixel_fmts; ///< list of accepted pixel formats, must be terminated with -1 /* only used for audio */ enum AVSampleFormat *sample_fmts; ///< list of accepted sample formats, terminated by AV_SAMPLE_FMT_NONE diff --git a/libavfilter/src_buffer.c b/libavfilter/src_buffer.c index c88928710b..354a516e20 100644 --- a/libavfilter/src_buffer.c +++ b/libavfilter/src_buffer.c @@ -45,7 +45,7 @@ typedef struct { /* Video only */ AVFilterContext *scale; int h, w; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; AVRational sample_aspect_ratio; char sws_param[256]; diff --git a/libavfilter/vf_alphaextract.c b/libavfilter/vf_alphaextract.c index f6ce1b3a78..102af9d38a 100644 --- a/libavfilter/vf_alphaextract.c +++ b/libavfilter/vf_alphaextract.c @@ -40,12 +40,12 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - enum PixelFormat in_fmts[] = { - PIX_FMT_YUVA444P, PIX_FMT_YUVA422P, PIX_FMT_YUVA420P, - PIX_FMT_RGBA, PIX_FMT_BGRA, PIX_FMT_ARGB, PIX_FMT_ABGR, - PIX_FMT_NONE + enum AVPixelFormat in_fmts[] = { + AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, + AV_PIX_FMT_NONE }; - enum PixelFormat out_fmts[] = { PIX_FMT_GRAY8, PIX_FMT_NONE }; + enum AVPixelFormat out_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; ff_formats_ref(ff_make_format_list(in_fmts), &ctx->inputs[0]->out_formats); ff_formats_ref(ff_make_format_list(out_fmts), &ctx->outputs[0]->in_formats); return 0; diff --git a/libavfilter/vf_alphamerge.c b/libavfilter/vf_alphamerge.c index 613ca897d6..51868dee01 100644 --- a/libavfilter/vf_alphamerge.c +++ b/libavfilter/vf_alphamerge.c @@ -52,12 +52,12 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat main_fmts[] = { - PIX_FMT_YUVA444P, PIX_FMT_YUVA422P, PIX_FMT_YUVA420P, - PIX_FMT_RGBA, PIX_FMT_BGRA, PIX_FMT_ARGB, PIX_FMT_ABGR, - PIX_FMT_NONE + enum AVPixelFormat main_fmts[] = { + AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, + AV_PIX_FMT_NONE }; - enum PixelFormat alpha_fmts[] = { PIX_FMT_GRAY8, PIX_FMT_NONE }; + enum AVPixelFormat alpha_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; AVFilterFormats *main_formats = ff_make_format_list(main_fmts); AVFilterFormats *alpha_formats = ff_make_format_list(alpha_fmts); ff_formats_ref(main_formats, &ctx->inputs[0]->out_formats); diff --git a/libavfilter/vf_bbox.c b/libavfilter/vf_bbox.c index a3b8a23758..07ac5505bb 100644 --- a/libavfilter/vf_bbox.c +++ b/libavfilter/vf_bbox.c @@ -43,13 +43,13 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, - PIX_FMT_YUV444P, - PIX_FMT_YUV440P, - PIX_FMT_YUV422P, - PIX_FMT_YUV411P, - PIX_FMT_NONE, + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV411P, + AV_PIX_FMT_NONE, }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_blackdetect.c b/libavfilter/vf_blackdetect.c index cf1b9244b3..17f5acb04d 100644 --- a/libavfilter/vf_blackdetect.c +++ b/libavfilter/vf_blackdetect.c @@ -63,19 +63,19 @@ static const AVOption blackdetect_options[] = { AVFILTER_DEFINE_CLASS(blackdetect); #define YUVJ_FORMATS \ - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P -static enum PixelFormat yuvj_formats[] = { - YUVJ_FORMATS, PIX_FMT_NONE +static enum AVPixelFormat yuvj_formats[] = { + YUVJ_FORMATS, AV_PIX_FMT_NONE }; static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV410P, PIX_FMT_YUV420P, PIX_FMT_GRAY8, PIX_FMT_NV12, - PIX_FMT_NV21, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NV12, + AV_PIX_FMT_NV21, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, YUVJ_FORMATS, - PIX_FMT_NONE + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_blackframe.c b/libavfilter/vf_blackframe.c index 5064040735..59beab94d3 100644 --- a/libavfilter/vf_blackframe.c +++ b/libavfilter/vf_blackframe.c @@ -47,10 +47,10 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV410P, PIX_FMT_YUV420P, PIX_FMT_GRAY8, PIX_FMT_NV12, - PIX_FMT_NV21, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NV12, + AV_PIX_FMT_NV21, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_boxblur.c b/libavfilter/vf_boxblur.c index c5056c5732..4f1a52471a 100644 --- a/libavfilter/vf_boxblur.c +++ b/libavfilter/vf_boxblur.c @@ -124,13 +124,13 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUVA420P, - PIX_FMT_YUV440P, PIX_FMT_GRAY8, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, - PIX_FMT_YUVJ440P, - PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_colormatrix.c b/libavfilter/vf_colormatrix.c index ca5a39d6ec..f331204482 100644 --- a/libavfilter/vf_colormatrix.c +++ b/libavfilter/vf_colormatrix.c @@ -320,11 +320,11 @@ static int config_input(AVFilterLink *inlink) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV422P, - PIX_FMT_YUV420P, - PIX_FMT_UYVY422, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_UYVY422, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); @@ -356,9 +356,9 @@ static int end_frame(AVFilterLink *link) ColorMatrixContext *color = ctx->priv; AVFilterBufferRef *out = color->outpicref; - if (link->cur_buf->format == PIX_FMT_YUV422P) + if (link->cur_buf->format == AV_PIX_FMT_YUV422P) process_frame_yuv422p(color, out, link->cur_buf); - else if (link->cur_buf->format == PIX_FMT_YUV420P) + else if (link->cur_buf->format == AV_PIX_FMT_YUV420P) process_frame_yuv420p(color, out, link->cur_buf); else process_frame_uyvy422(color, out, link->cur_buf); diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index 4e794df91e..40970b1266 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -92,30 +92,30 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGB48BE, PIX_FMT_RGB48LE, - PIX_FMT_BGR48BE, PIX_FMT_BGR48LE, - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, - PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, - PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, - PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, - PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, - PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, - PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE, - PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, - PIX_FMT_RGB8, PIX_FMT_BGR8, - PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, - PIX_FMT_PAL8, PIX_FMT_GRAY8, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGB48LE, + AV_PIX_FMT_BGR48BE, AV_PIX_FMT_BGR48LE, + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE, + AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE, + AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE, + AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE, + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE, + AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE, + AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE, + AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, + 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_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_cropdetect.c b/libavfilter/vf_cropdetect.c index bed4bfdd47..f0f1270af0 100644 --- a/libavfilter/vf_cropdetect.c +++ b/libavfilter/vf_cropdetect.c @@ -43,13 +43,13 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV422P, PIX_FMT_YUVJ422P, - PIX_FMT_YUV444P, PIX_FMT_YUVJ444P, - PIX_FMT_YUV411P, PIX_FMT_GRAY8, - PIX_FMT_NV12, PIX_FMT_NV21, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NV12, AV_PIX_FMT_NV21, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_decimate.c b/libavfilter/vf_decimate.c index bf3d7fe7a3..b4abfa3ddb 100644 --- a/libavfilter/vf_decimate.c +++ b/libavfilter/vf_decimate.c @@ -161,14 +161,14 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_delogo.c b/libavfilter/vf_delogo.c index d4e9014b54..ca9a05ee6e 100644 --- a/libavfilter/vf_delogo.c +++ b/libavfilter/vf_delogo.c @@ -157,11 +157,11 @@ AVFILTER_DEFINE_CLASS(delogo); static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVA420P, PIX_FMT_GRAY8, - PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_deshake.c b/libavfilter/vf_deshake.c index ac0a0139c0..e86d5bc61e 100644 --- a/libavfilter/vf_deshake.c +++ b/libavfilter/vf_deshake.c @@ -386,10 +386,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_YUV410P, - PIX_FMT_YUV411P, PIX_FMT_YUV440P, PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_drawbox.c b/libavfilter/vf_drawbox.c index 3067f21cff..a7d21928c1 100644 --- a/libavfilter/vf_drawbox.c +++ b/libavfilter/vf_drawbox.c @@ -66,12 +66,12 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, - PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_edgedetect.c b/libavfilter/vf_edgedetect.c index 60112cb11c..d3d8ca1380 100644 --- a/libavfilter/vf_edgedetect.c +++ b/libavfilter/vf_edgedetect.c @@ -68,7 +68,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = {PIX_FMT_GRAY8, PIX_FMT_NONE}; + static const enum AVPixelFormat pix_fmts[] = {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; } diff --git a/libavfilter/vf_fade.c b/libavfilter/vf_fade.c index 3c5516e8b4..d80b4205cc 100644 --- a/libavfilter/vf_fade.c +++ b/libavfilter/vf_fade.c @@ -146,34 +146,34 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_ARGB, PIX_FMT_ABGR, - PIX_FMT_RGBA, PIX_FMT_BGRA, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, + AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; } -const static enum PixelFormat studio_level_pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, - PIX_FMT_YUV411P, PIX_FMT_YUV410P, - PIX_FMT_YUV440P, - PIX_FMT_NONE +const static enum AVPixelFormat studio_level_pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV440P, + AV_PIX_FMT_NONE }; -static enum PixelFormat alpha_pix_fmts[] = { - PIX_FMT_YUVA420P, - PIX_FMT_ARGB, PIX_FMT_ABGR, - PIX_FMT_RGBA, PIX_FMT_BGRA, - PIX_FMT_NONE +static enum AVPixelFormat alpha_pix_fmts[] = { + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, + AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, + AV_PIX_FMT_NONE }; static int config_props(AVFilterLink *inlink) diff --git a/libavfilter/vf_fieldorder.c b/libavfilter/vf_fieldorder.c index 8026580827..a722731dcf 100644 --- a/libavfilter/vf_fieldorder.c +++ b/libavfilter/vf_fieldorder.c @@ -71,14 +71,14 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { AVFilterFormats *formats; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; int ret; /** accept any input pixel format that is not hardware accelerated, not * a bitstream format, and does not have vertically sub-sampled chroma */ if (ctx->inputs[0]) { formats = NULL; - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if (!( av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL || av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_BITSTREAM) && av_pix_fmt_descriptors[pix_fmt].nb_components diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c index ccd829f13c..56dacdb1da 100644 --- a/libavfilter/vf_format.c +++ b/libavfilter/vf_format.c @@ -39,18 +39,18 @@ typedef struct { * List of flags telling if a given image format has been listed * as argument to the filter. */ - int listed_pix_fmt_flags[PIX_FMT_NB]; + int listed_pix_fmt_flags[AV_PIX_FMT_NB]; } FormatContext; -#define PIX_FMT_NAME_MAXSIZE 32 +#define AV_PIX_FMT_NAME_MAXSIZE 32 static av_cold int init(AVFilterContext *ctx, const char *args) { FormatContext *format = ctx->priv; const char *cur, *sep; - char pix_fmt_name[PIX_FMT_NAME_MAXSIZE]; + char pix_fmt_name[AV_PIX_FMT_NAME_MAXSIZE]; int pix_fmt_name_len, ret; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; /* parse the list of formats */ for (cur = args; cur; cur = sep ? sep+1 : NULL) { @@ -58,7 +58,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) pix_fmt_name_len = strlen(cur); else pix_fmt_name_len = sep - cur; - if (pix_fmt_name_len >= PIX_FMT_NAME_MAXSIZE) { + if (pix_fmt_name_len >= AV_PIX_FMT_NAME_MAXSIZE) { av_log(ctx, AV_LOG_ERROR, "Format name too long\n"); return -1; } @@ -78,12 +78,12 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static AVFilterFormats *make_format_list(FormatContext *format, int flag) { AVFilterFormats *formats; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; formats = av_mallocz(sizeof(AVFilterFormats)); - formats->formats = av_malloc(sizeof(enum PixelFormat) * PIX_FMT_NB); + formats->formats = av_malloc(sizeof(enum AVPixelFormat) * AV_PIX_FMT_NB); - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if (format->listed_pix_fmt_flags[pix_fmt] == flag) formats->formats[formats->format_count++] = pix_fmt; diff --git a/libavfilter/vf_frei0r.c b/libavfilter/vf_frei0r.c index cd0cd6b778..0845702238 100644 --- a/libavfilter/vf_frei0r.c +++ b/libavfilter/vf_frei0r.c @@ -329,12 +329,12 @@ static int query_formats(AVFilterContext *ctx) AVFilterFormats *formats = NULL; if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_BGRA8888) { - ff_add_format(&formats, PIX_FMT_BGRA); + ff_add_format(&formats, AV_PIX_FMT_BGRA); } else if (frei0r->plugin_info.color_model == F0R_COLOR_MODEL_RGBA8888) { - ff_add_format(&formats, PIX_FMT_RGBA); + ff_add_format(&formats, AV_PIX_FMT_RGBA); } else { /* F0R_COLOR_MODEL_PACKED32 */ - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_BGRA, PIX_FMT_ARGB, PIX_FMT_ABGR, PIX_FMT_ARGB, PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, AV_PIX_FMT_ARGB, AV_PIX_FMT_NONE }; formats = ff_make_format_list(pix_fmts); } diff --git a/libavfilter/vf_gradfun.c b/libavfilter/vf_gradfun.c index 5c49060c9d..c403331972 100644 --- a/libavfilter/vf_gradfun.c +++ b/libavfilter/vf_gradfun.c @@ -151,12 +151,12 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV410P, PIX_FMT_YUV420P, - PIX_FMT_GRAY8, PIX_FMT_NV12, - PIX_FMT_NV21, PIX_FMT_YUV444P, - PIX_FMT_YUV422P, PIX_FMT_YUV411P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV420P, + AV_PIX_FMT_GRAY8, AV_PIX_FMT_NV12, + AV_PIX_FMT_NV21, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_hflip.c b/libavfilter/vf_hflip.c index eada9a03ac..ed42f9298c 100644 --- a/libavfilter/vf_hflip.c +++ b/libavfilter/vf_hflip.c @@ -42,32 +42,32 @@ typedef struct { static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGB48BE, PIX_FMT_RGB48LE, - PIX_FMT_BGR48BE, PIX_FMT_BGR48LE, - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, - PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, - PIX_FMT_RGB444BE, PIX_FMT_RGB444LE, - PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, - PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, - PIX_FMT_BGR444BE, PIX_FMT_BGR444LE, - PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, - PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, - PIX_FMT_YUV422P16LE, PIX_FMT_YUV422P16BE, - PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ440P, - PIX_FMT_YUVA420P, - PIX_FMT_RGB8, PIX_FMT_BGR8, - PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, - PIX_FMT_PAL8, PIX_FMT_GRAY8, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGB48LE, + AV_PIX_FMT_BGR48BE, AV_PIX_FMT_BGR48LE, + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE, + AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE, + AV_PIX_FMT_RGB444BE, AV_PIX_FMT_RGB444LE, + AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE, + AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE, + AV_PIX_FMT_BGR444BE, AV_PIX_FMT_BGR444LE, + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE, + AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE, + AV_PIX_FMT_YUV422P16LE, AV_PIX_FMT_YUV422P16BE, + AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUVA420P, + 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_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_hqdn3d.c b/libavfilter/vf_hqdn3d.c index 2fe70563a1..a454207b61 100644 --- a/libavfilter/vf_hqdn3d.c +++ b/libavfilter/vf_hqdn3d.c @@ -263,27 +263,27 @@ static void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, - PIX_FMT_YUV422P, - PIX_FMT_YUV444P, - PIX_FMT_YUV410P, - PIX_FMT_YUV411P, - PIX_FMT_YUV440P, - PIX_FMT_YUVJ420P, - PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ444P, - PIX_FMT_YUVJ440P, - AV_NE( PIX_FMT_YUV420P9BE, PIX_FMT_YUV420P9LE ), - AV_NE( PIX_FMT_YUV422P9BE, PIX_FMT_YUV422P9LE ), - AV_NE( PIX_FMT_YUV444P9BE, PIX_FMT_YUV444P9LE ), - AV_NE( PIX_FMT_YUV420P10BE, PIX_FMT_YUV420P10LE ), - AV_NE( PIX_FMT_YUV422P10BE, PIX_FMT_YUV422P10LE ), - AV_NE( PIX_FMT_YUV444P10BE, PIX_FMT_YUV444P10LE ), - AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ), - AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ), - AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ), - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ444P, + AV_PIX_FMT_YUVJ440P, + AV_NE( AV_PIX_FMT_YUV420P9BE, AV_PIX_FMT_YUV420P9LE ), + AV_NE( AV_PIX_FMT_YUV422P9BE, AV_PIX_FMT_YUV422P9LE ), + AV_NE( AV_PIX_FMT_YUV444P9BE, AV_PIX_FMT_YUV444P9LE ), + AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ), + AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ), + AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ), + AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ), + AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ), + AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ), + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_hue.c b/libavfilter/vf_hue.c index 3048a596ca..71d5cc88ad 100644 --- a/libavfilter/vf_hue.c +++ b/libavfilter/vf_hue.c @@ -236,12 +236,12 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_YUVA420P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_idet.c b/libavfilter/vf_idet.c index 8942ced4f3..4d14241bb5 100644 --- a/libavfilter/vf_idet.c +++ b/libavfilter/vf_idet.c @@ -261,27 +261,27 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, - PIX_FMT_YUV422P, - PIX_FMT_YUV444P, - PIX_FMT_YUV410P, - PIX_FMT_YUV411P, - PIX_FMT_GRAY8, - PIX_FMT_YUVJ420P, - PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ444P, - AV_NE( PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE ), - PIX_FMT_YUV440P, - PIX_FMT_YUVJ440P, - AV_NE( PIX_FMT_YUV420P10BE, PIX_FMT_YUV420P10LE ), - AV_NE( PIX_FMT_YUV422P10BE, PIX_FMT_YUV422P10LE ), - AV_NE( PIX_FMT_YUV444P10BE, PIX_FMT_YUV444P10LE ), - AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ), - AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ), - AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ), - PIX_FMT_YUVA420P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV411P, + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ444P, + AV_NE( AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE ), + AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ440P, + AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ), + AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ), + AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ), + AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ), + AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ), + AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ), + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c index e0041a7c4e..62c79de946 100644 --- a/libavfilter/vf_libopencv.c +++ b/libavfilter/vf_libopencv.c @@ -34,14 +34,14 @@ #include "formats.h" #include "video.h" -static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *picref, enum PixelFormat pixfmt) +static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *picref, enum AVPixelFormat pixfmt) { IplImage *tmpimg; int depth, channels_nb; - if (pixfmt == PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; channels_nb = 1; } - else if (pixfmt == PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; channels_nb = 4; } - else if (pixfmt == PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; channels_nb = 3; } + if (pixfmt == AV_PIX_FMT_GRAY8) { depth = IPL_DEPTH_8U; channels_nb = 1; } + else if (pixfmt == AV_PIX_FMT_BGRA) { depth = IPL_DEPTH_8U; channels_nb = 4; } + else if (pixfmt == AV_PIX_FMT_BGR24) { depth = IPL_DEPTH_8U; channels_nb = 3; } else return; tmpimg = cvCreateImageHeader((CvSize){picref->video->w, picref->video->h}, depth, channels_nb); @@ -52,7 +52,7 @@ static void fill_iplimage_from_picref(IplImage *img, const AVFilterBufferRef *pi img->widthStep = picref->linesize[0]; } -static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage *img, enum PixelFormat pixfmt) +static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage *img, enum AVPixelFormat pixfmt) { picref->linesize[0] = img->widthStep; picref->data[0] = img->imageData; @@ -60,8 +60,8 @@ static void fill_picref_from_iplimage(AVFilterBufferRef *picref, const IplImage static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_BGR24, PIX_FMT_BGRA, PIX_FMT_GRAY8, PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_lut.c b/libavfilter/vf_lut.c index 4a7bf62238..6fa9e3637e 100644 --- a/libavfilter/vf_lut.c +++ b/libavfilter/vf_lut.c @@ -106,26 +106,26 @@ static av_cold void uninit(AVFilterContext *ctx) } #define YUV_FORMATS \ - PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, \ - PIX_FMT_YUV411P, PIX_FMT_YUV410P, PIX_FMT_YUV440P, \ - PIX_FMT_YUVA420P, \ - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P, \ - PIX_FMT_YUVJ440P + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, \ + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, \ + AV_PIX_FMT_YUVA420P, \ + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P, \ + AV_PIX_FMT_YUVJ440P #define RGB_FORMATS \ - PIX_FMT_ARGB, PIX_FMT_RGBA, \ - PIX_FMT_ABGR, PIX_FMT_BGRA, \ - PIX_FMT_RGB24, PIX_FMT_BGR24 + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, \ + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, \ + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24 -static const enum PixelFormat yuv_pix_fmts[] = { YUV_FORMATS, PIX_FMT_NONE }; -static const enum PixelFormat rgb_pix_fmts[] = { RGB_FORMATS, PIX_FMT_NONE }; -static const enum PixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, PIX_FMT_NONE }; +static const enum AVPixelFormat yuv_pix_fmts[] = { YUV_FORMATS, AV_PIX_FMT_NONE }; +static const enum AVPixelFormat rgb_pix_fmts[] = { RGB_FORMATS, AV_PIX_FMT_NONE }; +static const enum AVPixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, AV_PIX_FMT_NONE }; static int query_formats(AVFilterContext *ctx) { LutContext *lut = ctx->priv; - const enum PixelFormat *pix_fmts = lut->is_rgb ? rgb_pix_fmts : + const enum AVPixelFormat *pix_fmts = lut->is_rgb ? rgb_pix_fmts : lut->is_yuv ? yuv_pix_fmts : all_pix_fmts; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); @@ -186,13 +186,13 @@ static int config_props(AVFilterLink *inlink) lut->var_values[VAR_H] = inlink->h; switch (inlink->format) { - 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 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: min[Y] = min[U] = min[V] = 16; max[Y] = 235; max[U] = max[V] = 240; @@ -209,12 +209,12 @@ static int config_props(AVFilterLink *inlink) if (lut->is_rgb) { switch (inlink->format) { - case PIX_FMT_ARGB: rgba_map[0] = A; rgba_map[1] = R; rgba_map[2] = G; rgba_map[3] = B; break; - case PIX_FMT_ABGR: rgba_map[0] = A; rgba_map[1] = B; rgba_map[2] = G; rgba_map[3] = R; break; - case PIX_FMT_RGBA: - case PIX_FMT_RGB24: rgba_map[0] = R; rgba_map[1] = G; rgba_map[2] = B; rgba_map[3] = A; break; - case PIX_FMT_BGRA: - case PIX_FMT_BGR24: rgba_map[0] = B; rgba_map[1] = G; rgba_map[2] = R; rgba_map[3] = A; break; + case AV_PIX_FMT_ARGB: rgba_map[0] = A; rgba_map[1] = R; rgba_map[2] = G; rgba_map[3] = B; break; + case AV_PIX_FMT_ABGR: rgba_map[0] = A; rgba_map[1] = B; rgba_map[2] = G; rgba_map[3] = R; break; + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_RGB24: rgba_map[0] = R; rgba_map[1] = G; rgba_map[2] = B; rgba_map[3] = A; break; + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_BGR24: rgba_map[0] = B; rgba_map[1] = G; rgba_map[2] = R; rgba_map[3] = A; break; } lut->step = av_get_bits_per_pixel(desc) >> 3; } diff --git a/libavfilter/vf_mp.c b/libavfilter/vf_mp.c index d57a6fe521..377a8b54eb 100644 --- a/libavfilter/vf_mp.c +++ b/libavfilter/vf_mp.c @@ -47,79 +47,79 @@ //XXX: identical pix_fmt must be following with each others static const struct { int fmt; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; } conversion_map[] = { - {IMGFMT_ARGB, PIX_FMT_ARGB}, - {IMGFMT_BGRA, PIX_FMT_BGRA}, - {IMGFMT_BGR24, PIX_FMT_BGR24}, - {IMGFMT_BGR16BE, PIX_FMT_RGB565BE}, - {IMGFMT_BGR16LE, PIX_FMT_RGB565LE}, - {IMGFMT_BGR15BE, PIX_FMT_RGB555BE}, - {IMGFMT_BGR15LE, PIX_FMT_RGB555LE}, - {IMGFMT_BGR12BE, PIX_FMT_RGB444BE}, - {IMGFMT_BGR12LE, PIX_FMT_RGB444LE}, - {IMGFMT_BGR8, PIX_FMT_RGB8}, - {IMGFMT_BGR4, PIX_FMT_RGB4}, - {IMGFMT_BGR1, PIX_FMT_MONOBLACK}, - {IMGFMT_RGB1, PIX_FMT_MONOBLACK}, - {IMGFMT_RG4B, PIX_FMT_BGR4_BYTE}, - {IMGFMT_BG4B, PIX_FMT_RGB4_BYTE}, - {IMGFMT_RGB48LE, PIX_FMT_RGB48LE}, - {IMGFMT_RGB48BE, PIX_FMT_RGB48BE}, - {IMGFMT_ABGR, PIX_FMT_ABGR}, - {IMGFMT_RGBA, PIX_FMT_RGBA}, - {IMGFMT_RGB24, PIX_FMT_RGB24}, - {IMGFMT_RGB16BE, PIX_FMT_BGR565BE}, - {IMGFMT_RGB16LE, PIX_FMT_BGR565LE}, - {IMGFMT_RGB15BE, PIX_FMT_BGR555BE}, - {IMGFMT_RGB15LE, PIX_FMT_BGR555LE}, - {IMGFMT_RGB12BE, PIX_FMT_BGR444BE}, - {IMGFMT_RGB12LE, PIX_FMT_BGR444LE}, - {IMGFMT_RGB8, PIX_FMT_BGR8}, - {IMGFMT_RGB4, PIX_FMT_BGR4}, - {IMGFMT_BGR8, PIX_FMT_PAL8}, - {IMGFMT_YUY2, PIX_FMT_YUYV422}, - {IMGFMT_UYVY, PIX_FMT_UYVY422}, - {IMGFMT_NV12, PIX_FMT_NV12}, - {IMGFMT_NV21, PIX_FMT_NV21}, - {IMGFMT_Y800, PIX_FMT_GRAY8}, - {IMGFMT_Y8, PIX_FMT_GRAY8}, - {IMGFMT_YVU9, PIX_FMT_YUV410P}, - {IMGFMT_IF09, PIX_FMT_YUV410P}, - {IMGFMT_YV12, PIX_FMT_YUV420P}, - {IMGFMT_I420, PIX_FMT_YUV420P}, - {IMGFMT_IYUV, PIX_FMT_YUV420P}, - {IMGFMT_411P, PIX_FMT_YUV411P}, - {IMGFMT_422P, PIX_FMT_YUV422P}, - {IMGFMT_444P, PIX_FMT_YUV444P}, - {IMGFMT_440P, PIX_FMT_YUV440P}, - - {IMGFMT_420A, PIX_FMT_YUVA420P}, - - {IMGFMT_420P16_LE, PIX_FMT_YUV420P16LE}, - {IMGFMT_420P16_BE, PIX_FMT_YUV420P16BE}, - {IMGFMT_422P16_LE, PIX_FMT_YUV422P16LE}, - {IMGFMT_422P16_BE, PIX_FMT_YUV422P16BE}, - {IMGFMT_444P16_LE, PIX_FMT_YUV444P16LE}, - {IMGFMT_444P16_BE, PIX_FMT_YUV444P16BE}, + {IMGFMT_ARGB, AV_PIX_FMT_ARGB}, + {IMGFMT_BGRA, AV_PIX_FMT_BGRA}, + {IMGFMT_BGR24, AV_PIX_FMT_BGR24}, + {IMGFMT_BGR16BE, AV_PIX_FMT_RGB565BE}, + {IMGFMT_BGR16LE, AV_PIX_FMT_RGB565LE}, + {IMGFMT_BGR15BE, AV_PIX_FMT_RGB555BE}, + {IMGFMT_BGR15LE, AV_PIX_FMT_RGB555LE}, + {IMGFMT_BGR12BE, AV_PIX_FMT_RGB444BE}, + {IMGFMT_BGR12LE, AV_PIX_FMT_RGB444LE}, + {IMGFMT_BGR8, AV_PIX_FMT_RGB8}, + {IMGFMT_BGR4, AV_PIX_FMT_RGB4}, + {IMGFMT_BGR1, AV_PIX_FMT_MONOBLACK}, + {IMGFMT_RGB1, AV_PIX_FMT_MONOBLACK}, + {IMGFMT_RG4B, AV_PIX_FMT_BGR4_BYTE}, + {IMGFMT_BG4B, AV_PIX_FMT_RGB4_BYTE}, + {IMGFMT_RGB48LE, AV_PIX_FMT_RGB48LE}, + {IMGFMT_RGB48BE, AV_PIX_FMT_RGB48BE}, + {IMGFMT_ABGR, AV_PIX_FMT_ABGR}, + {IMGFMT_RGBA, AV_PIX_FMT_RGBA}, + {IMGFMT_RGB24, AV_PIX_FMT_RGB24}, + {IMGFMT_RGB16BE, AV_PIX_FMT_BGR565BE}, + {IMGFMT_RGB16LE, AV_PIX_FMT_BGR565LE}, + {IMGFMT_RGB15BE, AV_PIX_FMT_BGR555BE}, + {IMGFMT_RGB15LE, AV_PIX_FMT_BGR555LE}, + {IMGFMT_RGB12BE, AV_PIX_FMT_BGR444BE}, + {IMGFMT_RGB12LE, AV_PIX_FMT_BGR444LE}, + {IMGFMT_RGB8, AV_PIX_FMT_BGR8}, + {IMGFMT_RGB4, AV_PIX_FMT_BGR4}, + {IMGFMT_BGR8, AV_PIX_FMT_PAL8}, + {IMGFMT_YUY2, AV_PIX_FMT_YUYV422}, + {IMGFMT_UYVY, AV_PIX_FMT_UYVY422}, + {IMGFMT_NV12, AV_PIX_FMT_NV12}, + {IMGFMT_NV21, AV_PIX_FMT_NV21}, + {IMGFMT_Y800, AV_PIX_FMT_GRAY8}, + {IMGFMT_Y8, AV_PIX_FMT_GRAY8}, + {IMGFMT_YVU9, AV_PIX_FMT_YUV410P}, + {IMGFMT_IF09, AV_PIX_FMT_YUV410P}, + {IMGFMT_YV12, AV_PIX_FMT_YUV420P}, + {IMGFMT_I420, AV_PIX_FMT_YUV420P}, + {IMGFMT_IYUV, AV_PIX_FMT_YUV420P}, + {IMGFMT_411P, AV_PIX_FMT_YUV411P}, + {IMGFMT_422P, AV_PIX_FMT_YUV422P}, + {IMGFMT_444P, AV_PIX_FMT_YUV444P}, + {IMGFMT_440P, AV_PIX_FMT_YUV440P}, + + {IMGFMT_420A, AV_PIX_FMT_YUVA420P}, + + {IMGFMT_420P16_LE, AV_PIX_FMT_YUV420P16LE}, + {IMGFMT_420P16_BE, AV_PIX_FMT_YUV420P16BE}, + {IMGFMT_422P16_LE, AV_PIX_FMT_YUV422P16LE}, + {IMGFMT_422P16_BE, AV_PIX_FMT_YUV422P16BE}, + {IMGFMT_444P16_LE, AV_PIX_FMT_YUV444P16LE}, + {IMGFMT_444P16_BE, AV_PIX_FMT_YUV444P16BE}, // YUVJ are YUV formats that use the full Y range and not just // 16 - 235 (see colorspaces.txt). // Currently they are all treated the same way. - {IMGFMT_YV12, PIX_FMT_YUVJ420P}, - {IMGFMT_422P, PIX_FMT_YUVJ422P}, - {IMGFMT_444P, PIX_FMT_YUVJ444P}, - {IMGFMT_440P, PIX_FMT_YUVJ440P}, - - {IMGFMT_XVMC_MOCO_MPEG2, PIX_FMT_XVMC_MPEG2_MC}, - {IMGFMT_XVMC_IDCT_MPEG2, PIX_FMT_XVMC_MPEG2_IDCT}, - {IMGFMT_VDPAU_MPEG1, PIX_FMT_VDPAU_MPEG1}, - {IMGFMT_VDPAU_MPEG2, PIX_FMT_VDPAU_MPEG2}, - {IMGFMT_VDPAU_H264, PIX_FMT_VDPAU_H264}, - {IMGFMT_VDPAU_WMV3, PIX_FMT_VDPAU_WMV3}, - {IMGFMT_VDPAU_VC1, PIX_FMT_VDPAU_VC1}, - {IMGFMT_VDPAU_MPEG4, PIX_FMT_VDPAU_MPEG4}, - {0, PIX_FMT_NONE} + {IMGFMT_YV12, AV_PIX_FMT_YUVJ420P}, + {IMGFMT_422P, AV_PIX_FMT_YUVJ422P}, + {IMGFMT_444P, AV_PIX_FMT_YUVJ444P}, + {IMGFMT_440P, AV_PIX_FMT_YUVJ440P}, + + {IMGFMT_XVMC_MOCO_MPEG2, AV_PIX_FMT_XVMC_MPEG2_MC}, + {IMGFMT_XVMC_IDCT_MPEG2, AV_PIX_FMT_XVMC_MPEG2_IDCT}, + {IMGFMT_VDPAU_MPEG1, AV_PIX_FMT_VDPAU_MPEG1}, + {IMGFMT_VDPAU_MPEG2, AV_PIX_FMT_VDPAU_MPEG2}, + {IMGFMT_VDPAU_H264, AV_PIX_FMT_VDPAU_H264}, + {IMGFMT_VDPAU_WMV3, AV_PIX_FMT_VDPAU_WMV3}, + {IMGFMT_VDPAU_VC1, AV_PIX_FMT_VDPAU_VC1}, + {IMGFMT_VDPAU_MPEG4, AV_PIX_FMT_VDPAU_MPEG4}, + {0, AV_PIX_FMT_NONE} }; //copied from vf.c @@ -301,14 +301,14 @@ struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat, { int flags, i; SwsFilter *dstFilterParam, *srcFilterParam; - enum PixelFormat dfmt, sfmt; + enum AVPixelFormat dfmt, sfmt; for(i=0; conversion_map[i].fmt && dstFormat != conversion_map[i].fmt; i++); dfmt= conversion_map[i].pix_fmt; for(i=0; conversion_map[i].fmt && srcFormat != conversion_map[i].fmt; i++); sfmt= conversion_map[i].pix_fmt; - if (srcFormat == IMGFMT_RGB8 || srcFormat == IMGFMT_BGR8) sfmt = PIX_FMT_PAL8; + if (srcFormat == IMGFMT_RGB8 || srcFormat == IMGFMT_BGR8) sfmt = AV_PIX_FMT_PAL8; sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam); return sws_getContext(srcW, srcH, sfmt, dstW, dstH, dfmt, flags , srcFilterParam, dstFilterParam, NULL); @@ -773,7 +773,7 @@ static int query_formats(AVFilterContext *ctx) { AVFilterFormats *avfmts=NULL; MPContext *m = ctx->priv; - enum PixelFormat lastpixfmt = PIX_FMT_NONE; + enum AVPixelFormat lastpixfmt = AV_PIX_FMT_NONE; int i; for(i=0; conversion_map[i].fmt; i++){ diff --git a/libavfilter/vf_overlay.c b/libavfilter/vf_overlay.c index c4bdcb78a6..b44c9f2b3e 100644 --- a/libavfilter/vf_overlay.c +++ b/libavfilter/vf_overlay.c @@ -157,18 +157,18 @@ static int query_formats(AVFilterContext *ctx) OverlayContext *over = ctx->priv; /* overlay formats contains alpha, for avoiding conversion with alpha information loss */ - const enum PixelFormat main_pix_fmts_yuv[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; - const enum PixelFormat overlay_pix_fmts_yuv[] = { PIX_FMT_YUVA420P, PIX_FMT_NONE }; - const enum PixelFormat main_pix_fmts_rgb[] = { - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_NONE + const enum AVPixelFormat main_pix_fmts_yuv[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; + const enum AVPixelFormat overlay_pix_fmts_yuv[] = { AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE }; + const enum AVPixelFormat main_pix_fmts_rgb[] = { + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_NONE }; - const enum PixelFormat overlay_pix_fmts_rgb[] = { - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_NONE + const enum AVPixelFormat overlay_pix_fmts_rgb[] = { + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_NONE }; AVFilterFormats *main_formats; @@ -189,9 +189,9 @@ static int query_formats(AVFilterContext *ctx) return 0; } -static const enum PixelFormat alpha_pix_fmts[] = { - PIX_FMT_YUVA420P, PIX_FMT_ARGB, PIX_FMT_ABGR, PIX_FMT_RGBA, - PIX_FMT_BGRA, PIX_FMT_NONE +static const enum AVPixelFormat alpha_pix_fmts[] = { + AV_PIX_FMT_YUVA420P, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, AV_PIX_FMT_RGBA, + AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE }; static int config_input_main(AVFilterLink *inlink) diff --git a/libavfilter/vf_removelogo.c b/libavfilter/vf_removelogo.c index 7154a54984..1b0201801d 100644 --- a/libavfilter/vf_removelogo.c +++ b/libavfilter/vf_removelogo.c @@ -191,7 +191,7 @@ static void convert_mask_to_strength_mask(uint8_t *data, int linesize, static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE }; + enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; } @@ -200,7 +200,7 @@ static int load_mask(uint8_t **mask, int *w, int *h, const char *filename, void *log_ctx) { int ret; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; uint8_t *src_data[4], *gray_data[4]; int src_linesize[4], gray_linesize[4]; @@ -209,7 +209,7 @@ static int load_mask(uint8_t **mask, int *w, int *h, return ret; /* convert the image to GRAY8 */ - if ((ret = ff_scale_image(gray_data, gray_linesize, *w, *h, PIX_FMT_GRAY8, + if ((ret = ff_scale_image(gray_data, gray_linesize, *w, *h, AV_PIX_FMT_GRAY8, src_data, src_linesize, *w, *h, pix_fmt, log_ctx)) < 0) goto end; diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index c7cbdfe2c8..5bc00d52a5 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -130,12 +130,12 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { AVFilterFormats *formats; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; int ret; if (ctx->inputs[0]) { formats = NULL; - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if ( sws_isSupportedInput(pix_fmt) && (ret = ff_add_format(&formats, pix_fmt)) < 0) { ff_formats_unref(&formats); @@ -145,8 +145,8 @@ static int query_formats(AVFilterContext *ctx) } if (ctx->outputs[0]) { formats = NULL; - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) - if ( (sws_isSupportedOutput(pix_fmt) || pix_fmt == PIX_FMT_PAL8) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) + if ( (sws_isSupportedOutput(pix_fmt) || pix_fmt == AV_PIX_FMT_PAL8) && (ret = ff_add_format(&formats, pix_fmt)) < 0) { ff_formats_unref(&formats); return ret; @@ -161,7 +161,7 @@ static int config_props(AVFilterLink *outlink) { AVFilterContext *ctx = outlink->src; AVFilterLink *inlink = outlink->src->inputs[0]; - enum PixelFormat outfmt = outlink->format; + enum AVPixelFormat outfmt = outlink->format; ScaleContext *scale = ctx->priv; int64_t w, h; double var_values[VARS_NB], res; @@ -228,7 +228,7 @@ static int config_props(AVFilterLink *outlink) scale->input_is_pal = av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PAL || av_pix_fmt_descriptors[inlink->format].flags & PIX_FMT_PSEUDOPAL; - if (outfmt == PIX_FMT_PAL8) outfmt = PIX_FMT_BGR8; + if (outfmt == AV_PIX_FMT_PAL8) outfmt = AV_PIX_FMT_BGR8; scale->output_is_pal = av_pix_fmt_descriptors[outfmt].flags & PIX_FMT_PAL || av_pix_fmt_descriptors[outfmt].flags & PIX_FMT_PSEUDOPAL; @@ -318,7 +318,7 @@ static int start_frame(AVFilterLink *link, AVFilterBufferRef *picref) outpicref->video->h = outlink->h; if(scale->output_is_pal) - ff_set_systematic_pal2((uint32_t*)outpicref->data[1], outlink->format == PIX_FMT_PAL8 ? PIX_FMT_BGR8 : outlink->format); + ff_set_systematic_pal2((uint32_t*)outpicref->data[1], outlink->format == AV_PIX_FMT_PAL8 ? AV_PIX_FMT_BGR8 : outlink->format); av_reduce(&outpicref->video->sample_aspect_ratio.num, &outpicref->video->sample_aspect_ratio.den, (int64_t)picref->video->sample_aspect_ratio.num * outlink->h * link->w, diff --git a/libavfilter/vf_select.c b/libavfilter/vf_select.c index 52b03b134b..c68618f002 100644 --- a/libavfilter/vf_select.c +++ b/libavfilter/vf_select.c @@ -408,9 +408,9 @@ static int query_formats(AVFilterContext *ctx) if (!select->do_scene_detect) { return ff_default_query_formats(ctx); } else { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); } diff --git a/libavfilter/vf_smartblur.c b/libavfilter/vf_smartblur.c index 73eb1c983f..e1f27ec21b 100644 --- a/libavfilter/vf_smartblur.c +++ b/libavfilter/vf_smartblur.c @@ -126,12 +126,12 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV444P, PIX_FMT_YUV422P, - PIX_FMT_YUV420P, PIX_FMT_YUV411P, - PIX_FMT_YUV410P, PIX_FMT_YUV440P, - PIX_FMT_GRAY8, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV411P, + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); @@ -154,8 +154,8 @@ static int alloc_sws_context(FilterParam *f, int width, int height, unsigned int sws_filter.lumH = sws_filter.lumV = vec; sws_filter.chrH = sws_filter.chrV = NULL; f->filter_context = sws_getCachedContext(NULL, - width, height, PIX_FMT_GRAY8, - width, height, PIX_FMT_GRAY8, + width, height, AV_PIX_FMT_GRAY8, + width, height, AV_PIX_FMT_GRAY8, flags, &sws_filter, NULL, NULL); sws_freeVec(vec); diff --git a/libavfilter/vf_super2xsai.c b/libavfilter/vf_super2xsai.c index 0b48155b12..f85674c1c5 100644 --- a/libavfilter/vf_super2xsai.c +++ b/libavfilter/vf_super2xsai.c @@ -232,12 +232,12 @@ static void super2xsai(AVFilterContext *ctx, static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGBA, PIX_FMT_BGRA, PIX_FMT_ARGB, PIX_FMT_ABGR, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_RGB565BE, PIX_FMT_BGR565BE, PIX_FMT_RGB555BE, PIX_FMT_BGR555BE, - PIX_FMT_RGB565LE, PIX_FMT_BGR565LE, PIX_FMT_RGB555LE, PIX_FMT_BGR555LE, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGBA, AV_PIX_FMT_BGRA, AV_PIX_FMT_ARGB, AV_PIX_FMT_ABGR, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565BE, AV_PIX_FMT_BGR565BE, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_BGR555BE, + AV_PIX_FMT_RGB565LE, AV_PIX_FMT_BGR565LE, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_BGR555LE, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); @@ -255,16 +255,16 @@ static int config_input(AVFilterLink *inlink) sai->bpp = 4; switch (inlink->format) { - case PIX_FMT_RGB24: - case PIX_FMT_BGR24: + case AV_PIX_FMT_RGB24: + case AV_PIX_FMT_BGR24: sai->bpp = 3; break; - case PIX_FMT_RGB565BE: - case PIX_FMT_BGR565BE: + case AV_PIX_FMT_RGB565BE: + case AV_PIX_FMT_BGR565BE: sai->is_be = 1; - case PIX_FMT_RGB565LE: - case PIX_FMT_BGR565LE: + case AV_PIX_FMT_RGB565LE: + case AV_PIX_FMT_BGR565LE: sai->hi_pixel_mask = 0xF7DEF7DE; sai->lo_pixel_mask = 0x08210821; sai->q_hi_pixel_mask = 0xE79CE79C; @@ -272,11 +272,11 @@ static int config_input(AVFilterLink *inlink) sai->bpp = 2; break; - case PIX_FMT_BGR555BE: - case PIX_FMT_RGB555BE: + case AV_PIX_FMT_BGR555BE: + case AV_PIX_FMT_RGB555BE: sai->is_be = 1; - case PIX_FMT_BGR555LE: - case PIX_FMT_RGB555LE: + case AV_PIX_FMT_BGR555LE: + case AV_PIX_FMT_RGB555LE: sai->hi_pixel_mask = 0x7BDE7BDE; sai->lo_pixel_mask = 0x04210421; sai->q_hi_pixel_mask = 0x739C739C; diff --git a/libavfilter/vf_swapuv.c b/libavfilter/vf_swapuv.c index 94015d9811..bfe71e80d9 100644 --- a/libavfilter/vf_swapuv.c +++ b/libavfilter/vf_swapuv.c @@ -61,13 +61,13 @@ static int start_frame(AVFilterLink *link, AVFilterBufferRef *inpicref) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, PIX_FMT_YUVA420P, - PIX_FMT_YUV444P, PIX_FMT_YUVJ444P, PIX_FMT_YUVA444P, - PIX_FMT_YUV440P, PIX_FMT_YUVJ440P, - PIX_FMT_YUV422P, PIX_FMT_YUVJ422P, - PIX_FMT_YUV411P, - PIX_FMT_NONE, + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVA444P, + AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P, + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUV411P, + AV_PIX_FMT_NONE, }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_thumbnail.c b/libavfilter/vf_thumbnail.c index 67ffc5168a..5936a1936d 100644 --- a/libavfilter/vf_thumbnail.c +++ b/libavfilter/vf_thumbnail.c @@ -211,9 +211,9 @@ static int poll_frame(AVFilterLink *link) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; diff --git a/libavfilter/vf_tinterlace.c b/libavfilter/vf_tinterlace.c index d41889afbd..0bfccfb267 100644 --- a/libavfilter/vf_tinterlace.c +++ b/libavfilter/vf_tinterlace.c @@ -62,19 +62,19 @@ typedef struct { } TInterlaceContext; #define FULL_SCALE_YUVJ_FORMATS \ - PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P -static enum PixelFormat full_scale_yuvj_pix_fmts[] = { - FULL_SCALE_YUVJ_FORMATS, PIX_FMT_NONE +static enum AVPixelFormat full_scale_yuvj_pix_fmts[] = { + FULL_SCALE_YUVJ_FORMATS, AV_PIX_FMT_NONE }; static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, - PIX_FMT_YUV444P, PIX_FMT_YUV410P, PIX_FMT_YUVA420P, - PIX_FMT_GRAY8, FULL_SCALE_YUVJ_FORMATS, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_GRAY8, FULL_SCALE_YUVJ_FORMATS, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); @@ -176,7 +176,7 @@ static int config_out_props(AVFilterLink *outlink) static inline void copy_picture_field(uint8_t *dst[4], int dst_linesize[4], const uint8_t *src[4], int src_linesize[4], - enum PixelFormat format, int w, int src_h, + enum AVPixelFormat format, int w, int src_h, int src_field, int interleave, int dst_field) { const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[format]; diff --git a/libavfilter/vf_transpose.c b/libavfilter/vf_transpose.c index 2671c584b0..dab5cc6030 100644 --- a/libavfilter/vf_transpose.c +++ b/libavfilter/vf_transpose.c @@ -86,25 +86,25 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_ARGB, PIX_FMT_RGBA, - PIX_FMT_ABGR, PIX_FMT_BGRA, - PIX_FMT_RGB24, PIX_FMT_BGR24, - PIX_FMT_RGB565BE, PIX_FMT_RGB565LE, - PIX_FMT_RGB555BE, PIX_FMT_RGB555LE, - PIX_FMT_BGR565BE, PIX_FMT_BGR565LE, - PIX_FMT_BGR555BE, PIX_FMT_BGR555LE, - PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE, - PIX_FMT_YUV420P16LE, PIX_FMT_YUV420P16BE, - PIX_FMT_YUV444P16LE, PIX_FMT_YUV444P16BE, - PIX_FMT_NV12, PIX_FMT_NV21, - PIX_FMT_RGB8, PIX_FMT_BGR8, - PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, - PIX_FMT_YUV444P, PIX_FMT_YUVJ444P, - PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, - PIX_FMT_YUV410P, - PIX_FMT_YUVA420P, PIX_FMT_GRAY8, - PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_ARGB, AV_PIX_FMT_RGBA, + AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA, + AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, + AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE, + AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE, + AV_PIX_FMT_BGR565BE, AV_PIX_FMT_BGR565LE, + AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE, + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE, + AV_PIX_FMT_YUV420P16LE, AV_PIX_FMT_YUV420P16BE, + AV_PIX_FMT_YUV444P16LE, AV_PIX_FMT_YUV444P16BE, + AV_PIX_FMT_NV12, AV_PIX_FMT_NV21, + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, + AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, + AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVJ444P, + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_unsharp.c b/libavfilter/vf_unsharp.c index 13fa108ed2..6943c65579 100644 --- a/libavfilter/vf_unsharp.c +++ b/libavfilter/vf_unsharp.c @@ -159,10 +159,10 @@ static av_cold int init(AVFilterContext *ctx, const char *args) static int query_formats(AVFilterContext *ctx) { - enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_YUV410P, - PIX_FMT_YUV411P, PIX_FMT_YUV440P, PIX_FMT_YUVJ420P, PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ444P, PIX_FMT_YUVJ440P, PIX_FMT_NONE + enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ440P, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vf_yadif.c b/libavfilter/vf_yadif.c index 7a21eb46fa..f14d9d7a29 100644 --- a/libavfilter/vf_yadif.c +++ b/libavfilter/vf_yadif.c @@ -367,29 +367,29 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, - PIX_FMT_YUV422P, - PIX_FMT_YUV444P, - PIX_FMT_YUV410P, - PIX_FMT_YUV411P, - PIX_FMT_GRAY8, - PIX_FMT_YUVJ420P, - PIX_FMT_YUVJ422P, - PIX_FMT_YUVJ444P, - AV_NE( PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE ), - PIX_FMT_YUV440P, - PIX_FMT_YUVJ440P, - AV_NE( PIX_FMT_YUV420P10BE, PIX_FMT_YUV420P10LE ), - AV_NE( PIX_FMT_YUV422P10BE, PIX_FMT_YUV422P10LE ), - AV_NE( PIX_FMT_YUV444P10BE, PIX_FMT_YUV444P10LE ), - AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ), - AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ), - AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ), - PIX_FMT_YUVA420P, - PIX_FMT_YUVA422P, - PIX_FMT_YUVA444P, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_YUV422P, + AV_PIX_FMT_YUV444P, + AV_PIX_FMT_YUV410P, + AV_PIX_FMT_YUV411P, + AV_PIX_FMT_GRAY8, + AV_PIX_FMT_YUVJ420P, + AV_PIX_FMT_YUVJ422P, + AV_PIX_FMT_YUVJ444P, + AV_NE( AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY16LE ), + AV_PIX_FMT_YUV440P, + AV_PIX_FMT_YUVJ440P, + AV_NE( AV_PIX_FMT_YUV420P10BE, AV_PIX_FMT_YUV420P10LE ), + AV_NE( AV_PIX_FMT_YUV422P10BE, AV_PIX_FMT_YUV422P10LE ), + AV_NE( AV_PIX_FMT_YUV444P10BE, AV_PIX_FMT_YUV444P10LE ), + AV_NE( AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_YUV420P16LE ), + AV_NE( AV_PIX_FMT_YUV422P16BE, AV_PIX_FMT_YUV422P16LE ), + AV_NE( AV_PIX_FMT_YUV444P16BE, AV_PIX_FMT_YUV444P16LE ), + AV_PIX_FMT_YUVA420P, + AV_PIX_FMT_YUVA422P, + AV_PIX_FMT_YUVA444P, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/video.c b/libavfilter/video.c index d0c95cd148..7bab974c66 100644 --- a/libavfilter/video.c +++ b/libavfilter/video.c @@ -94,7 +94,7 @@ AVFilterBufferRef *ff_default_get_video_buffer(AVFilterLink *link, int perms, in AVFilterBufferRef * avfilter_get_video_buffer_ref_from_arrays(uint8_t * const data[4], const int linesize[4], int perms, - int w, int h, enum PixelFormat format) + int w, int h, enum AVPixelFormat format) { AVFilterBuffer *pic = av_mallocz(sizeof(AVFilterBuffer)); AVFilterBufferRef *picref = av_mallocz(sizeof(AVFilterBufferRef)); diff --git a/libavfilter/vsrc_cellauto.c b/libavfilter/vsrc_cellauto.c index bfd44a158e..3a4726b553 100644 --- a/libavfilter/vsrc_cellauto.c +++ b/libavfilter/vsrc_cellauto.c @@ -330,7 +330,7 @@ static int request_frame(AVFilterLink *outlink) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { PIX_FMT_MONOBLACK, PIX_FMT_NONE }; + static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; } diff --git a/libavfilter/vsrc_life.c b/libavfilter/vsrc_life.c index 344f0fffb7..9ea41475c1 100644 --- a/libavfilter/vsrc_life.c +++ b/libavfilter/vsrc_life.c @@ -451,13 +451,13 @@ static int request_frame(AVFilterLink *outlink) static int query_formats(AVFilterContext *ctx) { LifeContext *life = ctx->priv; - enum PixelFormat pix_fmts[] = { PIX_FMT_NONE, PIX_FMT_NONE }; + enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_NONE, AV_PIX_FMT_NONE }; if (life->mold || memcmp(life-> life_color, "\xff\xff\xff", 3) || memcmp(life->death_color, "\x00\x00\x00", 3)) { - pix_fmts[0] = PIX_FMT_RGB24; + pix_fmts[0] = AV_PIX_FMT_RGB24; life->draw = fill_picture_rgb; } else { - pix_fmts[0] = PIX_FMT_MONOBLACK; + pix_fmts[0] = AV_PIX_FMT_MONOBLACK; life->draw = fill_picture_monoblack; } ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vsrc_mandelbrot.c b/libavfilter/vsrc_mandelbrot.c index 6bed9ce070..1fbf828085 100644 --- a/libavfilter/vsrc_mandelbrot.c +++ b/libavfilter/vsrc_mandelbrot.c @@ -153,9 +153,9 @@ static av_cold void uninit(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_BGR32, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_BGR32, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vsrc_mptestsrc.c b/libavfilter/vsrc_mptestsrc.c index febcbc84e3..9589b519ad 100644 --- a/libavfilter/vsrc_mptestsrc.c +++ b/libavfilter/vsrc_mptestsrc.c @@ -312,8 +312,8 @@ static int config_props(AVFilterLink *outlink) static int query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_YUV420P, PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c index 85d3789cec..38824b59d4 100644 --- a/libavfilter/vsrc_testsrc.c +++ b/libavfilter/vsrc_testsrc.c @@ -518,8 +518,8 @@ static av_cold int test_init(AVFilterContext *ctx, const char *args) static int test_query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGB24, PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; @@ -557,29 +557,29 @@ AVFILTER_DEFINE_CLASS(rgbtestsrc); #define A 3 static void rgbtest_put_pixel(uint8_t *dst, int dst_linesize, - int x, int y, int r, int g, int b, enum PixelFormat fmt, + int x, int y, int r, int g, int b, enum AVPixelFormat fmt, uint8_t rgba_map[4]) { int32_t v; uint8_t *p; switch (fmt) { - case PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break; - case PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break; - case PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break; - case PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break; - case PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break; - case PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break; - case PIX_FMT_RGB24: - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r >> 4) << 8) | ((g >> 4) << 4) | (b >> 4); break; + case AV_PIX_FMT_RGB444: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b >> 4) << 8) | ((g >> 4) << 4) | (r >> 4); break; + case AV_PIX_FMT_BGR555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<10) | ((g>>3)<<5) | (b>>3); break; + case AV_PIX_FMT_RGB555: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<10) | ((g>>3)<<5) | (r>>3); break; + case AV_PIX_FMT_BGR565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((r>>3)<<11) | ((g>>2)<<5) | (b>>3); break; + case AV_PIX_FMT_RGB565: ((uint16_t*)(dst + y*dst_linesize))[x] = ((b>>3)<<11) | ((g>>2)<<5) | (r>>3); break; + case AV_PIX_FMT_RGB24: + case AV_PIX_FMT_BGR24: v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8)); p = dst + 3*x + y*dst_linesize; AV_WL24(p, v); break; - case PIX_FMT_RGBA: - case PIX_FMT_BGRA: - case PIX_FMT_ARGB: - case PIX_FMT_ABGR: + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_ARGB: + case AV_PIX_FMT_ABGR: v = (r << (rgba_map[R]*8)) + (g << (rgba_map[G]*8)) + (b << (rgba_map[B]*8)) + (255 << (rgba_map[A]*8)); p = dst + 4*x + y*dst_linesize; AV_WL32(p, v); @@ -619,13 +619,13 @@ static av_cold int rgbtest_init(AVFilterContext *ctx, const char *args) static int rgbtest_query_formats(AVFilterContext *ctx) { - static const enum PixelFormat pix_fmts[] = { - PIX_FMT_RGBA, PIX_FMT_ARGB, PIX_FMT_BGRA, PIX_FMT_ABGR, - PIX_FMT_BGR24, PIX_FMT_RGB24, - PIX_FMT_RGB444, PIX_FMT_BGR444, - PIX_FMT_RGB565, PIX_FMT_BGR565, - PIX_FMT_RGB555, PIX_FMT_BGR555, - PIX_FMT_NONE + static const enum AVPixelFormat pix_fmts[] = { + AV_PIX_FMT_RGBA, AV_PIX_FMT_ARGB, AV_PIX_FMT_BGRA, AV_PIX_FMT_ABGR, + AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, + AV_PIX_FMT_RGB444, AV_PIX_FMT_BGR444, + AV_PIX_FMT_RGB565, AV_PIX_FMT_BGR565, + AV_PIX_FMT_RGB555, AV_PIX_FMT_BGR555, + AV_PIX_FMT_NONE }; ff_set_common_formats(ctx, ff_make_format_list(pix_fmts)); return 0; diff --git a/libavformat/bfi.c b/libavformat/bfi.c index c03a1deb29..446ef57fc9 100644 --- a/libavformat/bfi.c +++ b/libavformat/bfi.c @@ -90,7 +90,7 @@ static int bfi_read_header(AVFormatContext * s) avpriv_set_pts_info(vstream, 32, 1, fps); vstream->codec->codec_type = AVMEDIA_TYPE_VIDEO; vstream->codec->codec_id = AV_CODEC_ID_BFI; - vstream->codec->pix_fmt = PIX_FMT_PAL8; + vstream->codec->pix_fmt = AV_PIX_FMT_PAL8; /* Set up the audio codec now... */ astream->codec->codec_type = AVMEDIA_TYPE_AUDIO; diff --git a/libavformat/bmv.c b/libavformat/bmv.c index 474f4e3bc3..fe5db3f004 100644 --- a/libavformat/bmv.c +++ b/libavformat/bmv.c @@ -50,7 +50,7 @@ static int bmv_read_header(AVFormatContext *s) st->codec->codec_id = AV_CODEC_ID_BMV_VIDEO; st->codec->width = 640; st->codec->height = 429; - st->codec->pix_fmt = PIX_FMT_PAL8; + st->codec->pix_fmt = AV_PIX_FMT_PAL8; avpriv_set_pts_info(st, 16, 1, 12); ast = avformat_new_stream(s, 0); if (!ast) diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index 604f4ce833..a132edbadf 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -123,7 +123,7 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu (1 << 3) | /* recording mode: 1 -- original */ 7; buf[3] = (1 << 7) | /* direction: 1 -- forward */ - (c->sys->pix_fmt == PIX_FMT_YUV420P ? 0x20 : /* speed */ + (c->sys->pix_fmt == AV_PIX_FMT_YUV420P ? 0x20 : /* speed */ c->sys->ltc_divisor * 4); buf[4] = (1 << 7) | /* reserved -- always 1 */ 0x7f; /* genre category */ diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c index 0d02818fbf..b41fdb73e5 100644 --- a/libavformat/filmstripdec.c +++ b/libavformat/filmstripdec.c @@ -62,7 +62,7 @@ static int read_header(AVFormatContext *s) avio_skip(pb, 2); st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; - st->codec->pix_fmt = PIX_FMT_RGBA; + st->codec->pix_fmt = AV_PIX_FMT_RGBA; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = avio_rb16(pb); st->codec->height = avio_rb16(pb); diff --git a/libavformat/filmstripenc.c b/libavformat/filmstripenc.c index afbca5c6d9..99fbf0b570 100644 --- a/libavformat/filmstripenc.c +++ b/libavformat/filmstripenc.c @@ -35,8 +35,8 @@ typedef struct { static int write_header(AVFormatContext *s) { - if (s->streams[0]->codec->pix_fmt != PIX_FMT_RGBA) { - av_log(s, AV_LOG_ERROR, "only PIX_FMT_RGBA is supported\n"); + if (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_RGBA) { + av_log(s, AV_LOG_ERROR, "only AV_PIX_FMT_RGBA is supported\n"); return AVERROR_INVALIDDATA; } return 0; diff --git a/libavformat/gif.c b/libavformat/gif.c index 2cff81a493..31b01018ad 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -223,7 +223,7 @@ static int gif_image_write_image(AVIOContext *pb, put_bits(&p, 9, 0x0100); /* clear code */ for (i = (left < GIF_CHUNKS) ? left : GIF_CHUNKS; i; i--) { - if (pix_fmt == PIX_FMT_RGB24) { + if (pix_fmt == AV_PIX_FMT_RGB24) { v = gif_clut_index(ptr[0], ptr[1], ptr[2]); ptr += 3; } else { @@ -290,7 +290,7 @@ static int gif_write_header(AVFormatContext *s) // rate = video_enc->time_base.den; } - if (video_enc->pix_fmt != PIX_FMT_RGB24) { + if (video_enc->pix_fmt != AV_PIX_FMT_RGB24) { av_log(s, AV_LOG_ERROR, "ERROR: gif only handles the rgb24 pixel format. Use -pix_fmt rgb24.\n"); return AVERROR(EIO); @@ -327,7 +327,7 @@ static int gif_write_video(AVFormatContext *s, AVCodecContext *enc, avio_w8(pb, 0x00); gif_image_write_image(pb, 0, 0, enc->width, enc->height, - buf, enc->width * 3, PIX_FMT_RGB24); + buf, enc->width * 3, AV_PIX_FMT_RGB24); avio_flush(s->pb); return 0; diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 70370a4162..1c2ff5d399 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -209,7 +209,7 @@ static int gxf_write_mpeg_auxiliary(AVIOContext *pb, AVStream *st) size = snprintf(buffer, sizeof(buffer), "Ver 1\nBr %.6f\nIpg 1\nPpi %d\nBpiop %d\n" "Pix 0\nCf %d\nCg %d\nSl %d\nnl16 %d\nVi 1\nf1 1\n", (float)st->codec->bit_rate, sc->p_per_gop, sc->b_per_i_or_p, - st->codec->pix_fmt == PIX_FMT_YUV422P ? 2 : 1, sc->first_gop_closed == 1, + st->codec->pix_fmt == AV_PIX_FMT_YUV422P ? 2 : 1, sc->first_gop_closed == 1, starting_line, (st->codec->height + 15) / 16); av_assert0(size < sizeof(buffer)); avio_w8(pb, TRACK_MPG_AUX); @@ -503,7 +503,7 @@ static int gxf_write_umf_media_mpeg(AVIOContext *pb, AVStream *st) { GXFStreamContext *sc = st->priv_data; - if (st->codec->pix_fmt == PIX_FMT_YUV422P) + if (st->codec->pix_fmt == AV_PIX_FMT_YUV422P) avio_wl32(pb, 2); else avio_wl32(pb, 1); /* default to 420 */ @@ -772,7 +772,7 @@ static int gxf_write_header(AVFormatContext *s) media_info = 'M'; break; case AV_CODEC_ID_DVVIDEO: - if (st->codec->pix_fmt == PIX_FMT_YUV422P) { + if (st->codec->pix_fmt == AV_PIX_FMT_YUV422P) { sc->media_type += 2; sc->track_type = 6; gxf->flags |= 0x00002000; diff --git a/libavformat/icoenc.c b/libavformat/icoenc.c index e755b211ac..12f959ef5d 100644 --- a/libavformat/icoenc.c +++ b/libavformat/icoenc.c @@ -45,18 +45,18 @@ typedef struct { static int ico_check_attributes(AVFormatContext *s, const AVCodecContext *c) { if (c->codec_id == CODEC_ID_BMP) { - if (c->pix_fmt == PIX_FMT_PAL8 && PIX_FMT_RGB32 != PIX_FMT_BGRA) { + if (c->pix_fmt == AV_PIX_FMT_PAL8 && AV_PIX_FMT_RGB32 != AV_PIX_FMT_BGRA) { av_log(s, AV_LOG_ERROR, "Wrong endianness for bmp pixel format\n"); return AVERROR(EINVAL); - } else if (c->pix_fmt != PIX_FMT_PAL8 && - c->pix_fmt != PIX_FMT_RGB555LE && - c->pix_fmt != PIX_FMT_BGR24 && - c->pix_fmt != PIX_FMT_BGRA) { + } else if (c->pix_fmt != AV_PIX_FMT_PAL8 && + c->pix_fmt != AV_PIX_FMT_RGB555LE && + c->pix_fmt != AV_PIX_FMT_BGR24 && + c->pix_fmt != AV_PIX_FMT_BGRA) { av_log(s, AV_LOG_ERROR, "BMP must be 1bit, 4bit, 8bit, 16bit, 24bit, or 32bit\n"); return AVERROR(EINVAL); } } else if (c->codec_id == CODEC_ID_PNG) { - if (c->pix_fmt != PIX_FMT_RGBA) { + if (c->pix_fmt != AV_PIX_FMT_RGBA) { av_log(s, AV_LOG_ERROR, "PNG in ico requires pixel format to be rgba\n"); return AVERROR(EINVAL); } @@ -171,7 +171,7 @@ static int ico_write_trailer(AVFormatContext *s) avio_w8(pb, ico->images[i].height); if (s->streams[i]->codec->codec_id == CODEC_ID_BMP && - s->streams[i]->codec->pix_fmt == PIX_FMT_PAL8) { + s->streams[i]->codec->pix_fmt == AV_PIX_FMT_PAL8) { avio_w8(pb, (ico->images[i].bits >= 8) ? 0 : 1 << ico->images[i].bits); } else { avio_w8(pb, 0); diff --git a/libavformat/iff.c b/libavformat/iff.c index 0055283b0e..d559ad3c2b 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -238,9 +238,9 @@ static int iff_read_header(AVFormatContext *s) if ((fmt_size = avio_read(pb, fmt, sizeof(fmt))) < 0) return fmt_size; if (fmt_size == sizeof(deep_rgb24) && !memcmp(fmt, deep_rgb24, sizeof(deep_rgb24))) - st->codec->pix_fmt = PIX_FMT_RGB24; + st->codec->pix_fmt = AV_PIX_FMT_RGB24; else if (fmt_size == sizeof(deep_rgba) && !memcmp(fmt, deep_rgba, sizeof(deep_rgba))) - st->codec->pix_fmt = PIX_FMT_RGBA; + st->codec->pix_fmt = AV_PIX_FMT_RGBA; else { av_log_ask_for_sample(s, "unsupported color format\n"); return AVERROR_PATCHWELCOME; diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index d1edf04015..1190af30c8 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -191,7 +191,7 @@ static int read_header(AVFormatContext *s1) int first_index, last_index, ret = 0; int width = 0, height = 0; AVStream *st; - enum PixelFormat pix_fmt = PIX_FMT_NONE; + enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE; AVRational framerate; s1->ctx_flags |= AVFMTCTX_NOHEADER; @@ -201,7 +201,7 @@ static int read_header(AVFormatContext *s1) return AVERROR(ENOMEM); } - if (s->pixel_format && (pix_fmt = av_get_pix_fmt(s->pixel_format)) == PIX_FMT_NONE) { + if (s->pixel_format && (pix_fmt = av_get_pix_fmt(s->pixel_format)) == AV_PIX_FMT_NONE) { av_log(s1, AV_LOG_ERROR, "No such pixel format: %s.\n", s->pixel_format); return AVERROR(EINVAL); } @@ -317,7 +317,7 @@ static int read_header(AVFormatContext *s1) if (st->codec->codec_id == AV_CODEC_ID_LJPEG) st->codec->codec_id = AV_CODEC_ID_MJPEG; } - if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && pix_fmt != PIX_FMT_NONE) + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && pix_fmt != AV_PIX_FMT_NONE) st->codec->pix_fmt = pix_fmt; return 0; diff --git a/libavformat/lxfdec.c b/libavformat/lxfdec.c index 539a86a467..bf17d87a33 100644 --- a/libavformat/lxfdec.c +++ b/libavformat/lxfdec.c @@ -40,7 +40,7 @@ static const AVCodecTag lxf_tags[] = { { AV_CODEC_ID_DVVIDEO, 4 }, //DV25 { AV_CODEC_ID_DVVIDEO, 5 }, //DVCPRO { AV_CODEC_ID_DVVIDEO, 6 }, //DVCPRO50 - { AV_CODEC_ID_RAWVIDEO, 7 }, //PIX_FMT_ARGB, where alpha is used for chroma keying + { AV_CODEC_ID_RAWVIDEO, 7 }, //AV_PIX_FMT_ARGB, where alpha is used for chroma keying { AV_CODEC_ID_RAWVIDEO, 8 }, //16-bit chroma key { AV_CODEC_ID_MPEG2VIDEO, 9 }, //4:2:2 CBP ("Constrained Bytes per Gop") { AV_CODEC_ID_NONE, 0 }, diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 0e675855a0..2ec5d520ad 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -867,10 +867,10 @@ static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track) if (track->enc->width == 720) /* SD */ if (track->enc->height == 480) /* NTSC */ - if (track->enc->pix_fmt == PIX_FMT_YUV422P) tag = MKTAG('d','v','5','n'); + if (track->enc->pix_fmt == AV_PIX_FMT_YUV422P) tag = MKTAG('d','v','5','n'); else tag = MKTAG('d','v','c',' '); - else if (track->enc->pix_fmt == PIX_FMT_YUV422P) tag = MKTAG('d','v','5','p'); - else if (track->enc->pix_fmt == PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p'); + else if (track->enc->pix_fmt == AV_PIX_FMT_YUV422P) tag = MKTAG('d','v','5','p'); + else if (track->enc->pix_fmt == AV_PIX_FMT_YUV420P) tag = MKTAG('d','v','c','p'); else tag = MKTAG('d','v','p','p'); else if (track->enc->height == 720) /* HD 720 line */ if (track->enc->time_base.den == 50) tag = MKTAG('d','v','h','q'); @@ -887,25 +887,25 @@ static int mov_get_dv_codec_tag(AVFormatContext *s, MOVTrack *track) } static const struct { - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; uint32_t tag; unsigned bps; } mov_pix_fmt_tags[] = { - { PIX_FMT_YUYV422, MKTAG('y','u','v','2'), 0 }, - { PIX_FMT_YUYV422, MKTAG('y','u','v','s'), 0 }, - { PIX_FMT_UYVY422, MKTAG('2','v','u','y'), 0 }, - { PIX_FMT_RGB555BE,MKTAG('r','a','w',' '), 16 }, - { PIX_FMT_RGB555LE,MKTAG('L','5','5','5'), 16 }, - { PIX_FMT_RGB565LE,MKTAG('L','5','6','5'), 16 }, - { PIX_FMT_RGB565BE,MKTAG('B','5','6','5'), 16 }, - { PIX_FMT_GRAY16BE,MKTAG('b','1','6','g'), 16 }, - { PIX_FMT_RGB24, MKTAG('r','a','w',' '), 24 }, - { PIX_FMT_BGR24, MKTAG('2','4','B','G'), 24 }, - { PIX_FMT_ARGB, MKTAG('r','a','w',' '), 32 }, - { PIX_FMT_BGRA, MKTAG('B','G','R','A'), 32 }, - { PIX_FMT_RGBA, MKTAG('R','G','B','A'), 32 }, - { PIX_FMT_ABGR, MKTAG('A','B','G','R'), 32 }, - { PIX_FMT_RGB48BE, MKTAG('b','4','8','r'), 48 }, + { AV_PIX_FMT_YUYV422, MKTAG('y','u','v','2'), 0 }, + { AV_PIX_FMT_YUYV422, MKTAG('y','u','v','s'), 0 }, + { AV_PIX_FMT_UYVY422, MKTAG('2','v','u','y'), 0 }, + { AV_PIX_FMT_RGB555BE,MKTAG('r','a','w',' '), 16 }, + { AV_PIX_FMT_RGB555LE,MKTAG('L','5','5','5'), 16 }, + { AV_PIX_FMT_RGB565LE,MKTAG('L','5','6','5'), 16 }, + { AV_PIX_FMT_RGB565BE,MKTAG('B','5','6','5'), 16 }, + { AV_PIX_FMT_GRAY16BE,MKTAG('b','1','6','g'), 16 }, + { AV_PIX_FMT_RGB24, MKTAG('r','a','w',' '), 24 }, + { AV_PIX_FMT_BGR24, MKTAG('2','4','B','G'), 24 }, + { AV_PIX_FMT_ARGB, MKTAG('r','a','w',' '), 32 }, + { AV_PIX_FMT_BGRA, MKTAG('B','G','R','A'), 32 }, + { AV_PIX_FMT_RGBA, MKTAG('R','G','B','A'), 32 }, + { AV_PIX_FMT_ABGR, MKTAG('A','B','G','R'), 32 }, + { AV_PIX_FMT_RGB48BE, MKTAG('b','4','8','r'), 48 }, }; static int mov_get_rawvideo_codec_tag(AVFormatContext *s, MOVTrack *track) diff --git a/libavformat/mtv.c b/libavformat/mtv.c index cb50033a57..622a9b8f5e 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -136,7 +136,7 @@ static int mtv_read_header(AVFormatContext *s) avpriv_set_pts_info(st, 64, 1, mtv->video_fps); st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = AV_CODEC_ID_RAWVIDEO; - st->codec->pix_fmt = PIX_FMT_RGB565BE; + st->codec->pix_fmt = AV_PIX_FMT_RGB565BE; st->codec->width = mtv->img_width; st->codec->height = mtv->img_height; st->codec->sample_rate = mtv->video_fps; diff --git a/libavformat/mxf.c b/libavformat/mxf.c index 7230444b5f..4a4158a1d3 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -58,13 +58,13 @@ const MXFCodecUL ff_mxf_codec_uls[] = { }; const MXFCodecUL ff_mxf_pixel_format_uls[] = { - { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x01 }, 16, PIX_FMT_UYVY422 }, - { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x02 }, 16, PIX_FMT_YUYV422 }, - { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, PIX_FMT_NONE }, + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x01 }, 16, AV_PIX_FMT_UYVY422 }, + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x0A,0x04,0x01,0x02,0x01,0x01,0x02,0x01,0x02 }, 16, AV_PIX_FMT_YUYV422 }, + { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AV_PIX_FMT_NONE }, }; static const struct { - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; const char data[16]; } ff_mxf_pixel_layouts[] = { /** @@ -76,24 +76,24 @@ static const struct { * Note: Do not use these for encoding descriptors for little-endian formats until we * get samples or official word from SMPTE on how/if those can be encoded. */ - {PIX_FMT_ABGR, {'A', 8, 'B', 8, 'G', 8, 'R', 8 }}, - {PIX_FMT_ARGB, {'A', 8, 'R', 8, 'G', 8, 'B', 8 }}, - {PIX_FMT_BGR24, {'B', 8, 'G', 8, 'R', 8 }}, - {PIX_FMT_BGRA, {'B', 8, 'G', 8, 'R', 8, 'A', 8 }}, - {PIX_FMT_RGB24, {'R', 8, 'G', 8, 'B', 8 }}, - {PIX_FMT_RGB444BE,{'F', 4, 'R', 4, 'G', 4, 'B', 4 }}, - {PIX_FMT_RGB48BE, {'R', 8, 'r', 8, 'G', 8, 'g', 8, 'B', 8, 'b', 8 }}, - {PIX_FMT_RGB48BE, {'R', 16, 'G', 16, 'B', 16 }}, - {PIX_FMT_RGB48LE, {'r', 8, 'R', 8, 'g', 8, 'G', 8, 'b', 8, 'B', 8 }}, - {PIX_FMT_RGB555BE,{'F', 1, 'R', 5, 'G', 5, 'B', 5 }}, - {PIX_FMT_RGB565BE,{'R', 5, 'G', 6, 'B', 5 }}, - {PIX_FMT_RGBA, {'R', 8, 'G', 8, 'B', 8, 'A', 8 }}, - {PIX_FMT_PAL8, {'P', 8 }}, + {AV_PIX_FMT_ABGR, {'A', 8, 'B', 8, 'G', 8, 'R', 8 }}, + {AV_PIX_FMT_ARGB, {'A', 8, 'R', 8, 'G', 8, 'B', 8 }}, + {AV_PIX_FMT_BGR24, {'B', 8, 'G', 8, 'R', 8 }}, + {AV_PIX_FMT_BGRA, {'B', 8, 'G', 8, 'R', 8, 'A', 8 }}, + {AV_PIX_FMT_RGB24, {'R', 8, 'G', 8, 'B', 8 }}, + {AV_PIX_FMT_RGB444BE,{'F', 4, 'R', 4, 'G', 4, 'B', 4 }}, + {AV_PIX_FMT_RGB48BE, {'R', 8, 'r', 8, 'G', 8, 'g', 8, 'B', 8, 'b', 8 }}, + {AV_PIX_FMT_RGB48BE, {'R', 16, 'G', 16, 'B', 16 }}, + {AV_PIX_FMT_RGB48LE, {'r', 8, 'R', 8, 'g', 8, 'G', 8, 'b', 8, 'B', 8 }}, + {AV_PIX_FMT_RGB555BE,{'F', 1, 'R', 5, 'G', 5, 'B', 5 }}, + {AV_PIX_FMT_RGB565BE,{'R', 5, 'G', 6, 'B', 5 }}, + {AV_PIX_FMT_RGBA, {'R', 8, 'G', 8, 'B', 8, 'A', 8 }}, + {AV_PIX_FMT_PAL8, {'P', 8 }}, }; static const int num_pixel_layouts = FF_ARRAY_ELEMS(ff_mxf_pixel_layouts); -int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum PixelFormat *pix_fmt) +int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt) { int x; diff --git a/libavformat/mxf.h b/libavformat/mxf.h index a91d53fdb2..4c751e8eef 100644 --- a/libavformat/mxf.h +++ b/libavformat/mxf.h @@ -76,7 +76,7 @@ extern const MXFCodecUL ff_mxf_data_definition_uls[]; extern const MXFCodecUL ff_mxf_codec_uls[]; extern const MXFCodecUL ff_mxf_pixel_format_uls[]; -int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum PixelFormat *pix_fmt); +int ff_mxf_decode_pixel_layout(const char pixel_layout[16], enum AVPixelFormat *pix_fmt); const MXFSamplesPerFrame *ff_mxf_get_samples_per_frame(AVFormatContext *s, AVRational time_base); #define PRINT_KEY(pc, s, x) av_dlog(pc, "%s %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X %02X\n", s, \ diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index a503289582..bee368ee96 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -154,7 +154,7 @@ typedef struct { int linked_track_id; uint8_t *extradata; int extradata_size; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; } MXFDescriptor; typedef struct { @@ -801,7 +801,7 @@ static void mxf_read_pixel_layout(AVIOContext *pb, MXFDescriptor *descriptor) static int mxf_read_generic_descriptor(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) { MXFDescriptor *descriptor = arg; - descriptor->pix_fmt = PIX_FMT_NONE; + descriptor->pix_fmt = AV_PIX_FMT_NONE; switch(tag) { case 0x3F01: descriptor->sub_descriptors_count = avio_rb32(pb); @@ -1518,17 +1518,17 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) } if (st->codec->codec_id == AV_CODEC_ID_RAWVIDEO) { st->codec->pix_fmt = descriptor->pix_fmt; - if (st->codec->pix_fmt == PIX_FMT_NONE) { + if (st->codec->pix_fmt == AV_PIX_FMT_NONE) { pix_fmt_ul = mxf_get_codec_ul(ff_mxf_pixel_format_uls, &descriptor->essence_codec_ul); st->codec->pix_fmt = pix_fmt_ul->id; - if (st->codec->pix_fmt == PIX_FMT_NONE) { + if (st->codec->pix_fmt == AV_PIX_FMT_NONE) { /* support files created before RP224v10 by defaulting to UYVY422 if subsampling is 4:2:2 and component depth is 8-bit */ if (descriptor->horiz_subsampling == 2 && descriptor->vert_subsampling == 1 && descriptor->component_depth == 8) { - st->codec->pix_fmt = PIX_FMT_UYVY422; + st->codec->pix_fmt = AV_PIX_FMT_UYVY422; } } } diff --git a/libavformat/rawdec.c b/libavformat/rawdec.c index 974e58ca31..4020666ed8 100644 --- a/libavformat/rawdec.c +++ b/libavformat/rawdec.c @@ -76,14 +76,14 @@ int ff_raw_read_header(AVFormatContext *s) case AVMEDIA_TYPE_VIDEO: { FFRawVideoDemuxerContext *s1 = s->priv_data; int width = 0, height = 0, ret = 0; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; AVRational framerate; if (s1->video_size && (ret = av_parse_video_size(&width, &height, s1->video_size)) < 0) { av_log(s, AV_LOG_ERROR, "Couldn't parse video size.\n"); goto fail; } - if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == PIX_FMT_NONE) { + if ((pix_fmt = av_get_pix_fmt(s1->pixel_format)) == AV_PIX_FMT_NONE) { av_log(s, AV_LOG_ERROR, "No such pixel format: %s.\n", s1->pixel_format); ret = AVERROR(EINVAL); goto fail; diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c index 097d1a32bd..ae10c78304 100644 --- a/libavformat/rtpdec_xiph.c +++ b/libavformat/rtpdec_xiph.c @@ -312,11 +312,11 @@ static int xiph_parse_fmtp_pair(AVStream* stream, if (!strcmp(attr, "sampling")) { if (!strcmp(value, "YCbCr-4:2:0")) { - codec->pix_fmt = PIX_FMT_YUV420P; + codec->pix_fmt = AV_PIX_FMT_YUV420P; } else if (!strcmp(value, "YCbCr-4:4:2")) { - codec->pix_fmt = PIX_FMT_YUV422P; + codec->pix_fmt = AV_PIX_FMT_YUV422P; } else if (!strcmp(value, "YCbCr-4:4:4")) { - codec->pix_fmt = PIX_FMT_YUV444P; + codec->pix_fmt = AV_PIX_FMT_YUV444P; } else { av_log(codec, AV_LOG_ERROR, "Unsupported pixel format %s\n", attr); diff --git a/libavformat/rtpenc_jpeg.c b/libavformat/rtpenc_jpeg.c index b2cfb8d5c0..7eb0e23c6f 100644 --- a/libavformat/rtpenc_jpeg.c +++ b/libavformat/rtpenc_jpeg.c @@ -29,7 +29,7 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) RTPMuxContext *s = s1->priv_data; const uint8_t *qtables = NULL; int nb_qtables = 0; - uint8_t type = 1; /* default pixel format is PIX_FMT_YUVJ420P */ + uint8_t type = 1; /* default pixel format is AV_PIX_FMT_YUVJ420P */ uint8_t w, h; uint8_t *p; int off = 0; /* fragment offset of the current JPEG frame */ @@ -44,9 +44,9 @@ void ff_rtp_send_jpeg(AVFormatContext *s1, const uint8_t *buf, int size) h = s1->streams[0]->codec->height >> 3; /* check if pixel format is not the normal 420 case */ - if (s1->streams[0]->codec->pix_fmt == PIX_FMT_YUVJ422P) { + if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ422P) { type = 0; - } else if (s1->streams[0]->codec->pix_fmt == PIX_FMT_YUVJ420P) { + } else if (s1->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUVJ420P) { type = 1; } else { av_log(s1, AV_LOG_ERROR, "Unsupported pixel format\n"); diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 30941b7f89..9a4dec4bb2 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -521,13 +521,13 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c, return NULL; switch (c->pix_fmt) { - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: pix_fmt = "YCbCr-4:2:0"; break; - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P: pix_fmt = "YCbCr-4:2:2"; break; - case PIX_FMT_YUV444P: + case AV_PIX_FMT_YUV444P: pix_fmt = "YCbCr-4:4:4"; break; default: diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index d497d7b31f..1be2c5d042 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -151,7 +151,7 @@ static int film_read_header(AVFormatContext *s) if (film->video_type == AV_CODEC_ID_RAWVIDEO) { if (scratch[20] == 24) { - st->codec->pix_fmt = PIX_FMT_RGB24; + st->codec->pix_fmt = AV_PIX_FMT_RGB24; } else { av_log(s, AV_LOG_ERROR, "raw video is using unhandled %dbpp\n", scratch[20]); return -1; diff --git a/libavformat/siff.c b/libavformat/siff.c index df94dbfdd0..26c381753b 100644 --- a/libavformat/siff.c +++ b/libavformat/siff.c @@ -125,7 +125,7 @@ static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, AVIOContext *pb) st->codec->codec_tag = MKTAG('V', 'B', 'V', '1'); st->codec->width = width; st->codec->height = height; - st->codec->pix_fmt = PIX_FMT_PAL8; + st->codec->pix_fmt = AV_PIX_FMT_PAL8; avpriv_set_pts_info(st, 16, 1, 12); c->cur_frame = 0; diff --git a/libavformat/smacker.c b/libavformat/smacker.c index cf1ab858d8..829233f032 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -161,7 +161,7 @@ static int smacker_read_header(AVFormatContext *s) smk->videoindex = st->index; st->codec->width = smk->width; st->codec->height = smk->height; - st->codec->pix_fmt = PIX_FMT_PAL8; + st->codec->pix_fmt = AV_PIX_FMT_PAL8; st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = AV_CODEC_ID_SMACKVIDEO; st->codec->codec_tag = smk->magic; diff --git a/libavformat/tmv.c b/libavformat/tmv.c index 513436982c..acc3460cfd 100644 --- a/libavformat/tmv.c +++ b/libavformat/tmv.c @@ -124,7 +124,7 @@ static int tmv_read_header(AVFormatContext *s) vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = AV_CODEC_ID_TMV; - vst->codec->pix_fmt = PIX_FMT_PAL8; + vst->codec->pix_fmt = AV_PIX_FMT_PAL8; vst->codec->width = char_cols * 8; vst->codec->height = char_rows * 8; avpriv_set_pts_info(vst, 32, fps.den, fps.num); diff --git a/libavformat/utils.c b/libavformat/utils.c index 69ad761077..4399de7629 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2293,7 +2293,7 @@ static int has_codec_parameters(AVStream *st, const char **errmsg_ptr) case AVMEDIA_TYPE_VIDEO: if (!avctx->width) FAIL("unspecified size"); - if (st->info->found_decoder >= 0 && avctx->pix_fmt == PIX_FMT_NONE) + if (st->info->found_decoder >= 0 && avctx->pix_fmt == AV_PIX_FMT_NONE) FAIL("unspecified pixel format"); break; case AVMEDIA_TYPE_SUBTITLE: diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index b67209423c..cc13eafef1 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -58,53 +58,53 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf) inter = st->codec->coded_frame->top_field_first ? 't' : 'b'; switch (st->codec->pix_fmt) { - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: colorspace = " Cmono"; break; - case PIX_FMT_GRAY16: + case AV_PIX_FMT_GRAY16: colorspace = " Cmono16"; break; - case PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV411P: colorspace = " C411 XYSCSS=411"; break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: switch (st->codec->chroma_sample_location) { case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; break; case AVCHROMA_LOC_LEFT: colorspace = " C420mpeg2 XYSCSS=420MPEG2"; break; default: colorspace = " C420jpeg XYSCSS=420JPEG"; break; } break; - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P: colorspace = " C422 XYSCSS=422"; break; - case PIX_FMT_YUV444P: + case AV_PIX_FMT_YUV444P: colorspace = " C444 XYSCSS=444"; break; - case PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV420P9: colorspace = " C420p9 XYSCSS=420P9"; break; - case PIX_FMT_YUV422P9: + case AV_PIX_FMT_YUV422P9: colorspace = " C422p9 XYSCSS=422P9"; break; - case PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV444P9: colorspace = " C444p9 XYSCSS=444P9"; break; - case PIX_FMT_YUV420P10: + case AV_PIX_FMT_YUV420P10: colorspace = " C420p10 XYSCSS=420P10"; break; - case PIX_FMT_YUV422P10: + case AV_PIX_FMT_YUV422P10: colorspace = " C422p10 XYSCSS=422P10"; break; - case PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV444P10: colorspace = " C444p10 XYSCSS=444P10"; break; - case PIX_FMT_YUV420P16: + case AV_PIX_FMT_YUV420P16: colorspace = " C420p16 XYSCSS=420P16"; break; - case PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV422P16: colorspace = " C422p16 XYSCSS=422P16"; break; - case PIX_FMT_YUV444P16: + case AV_PIX_FMT_YUV444P16: colorspace = " C444p16 XYSCSS=444P16"; break; } @@ -155,22 +155,22 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) ptr = picture->data[0]; switch (st->codec->pix_fmt) { - case PIX_FMT_GRAY8: - case PIX_FMT_YUV411P: - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV444P: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV444P: break; - case PIX_FMT_GRAY16: - 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_YUV420P16: - case PIX_FMT_YUV422P16: - case PIX_FMT_YUV444P16: + case AV_PIX_FMT_GRAY16: + 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_YUV420P16: + case AV_PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV444P16: width *= 2; break; default: @@ -184,8 +184,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) ptr += picture->linesize[0]; } - if (st->codec->pix_fmt != PIX_FMT_GRAY8 && - st->codec->pix_fmt != PIX_FMT_GRAY16) { + if (st->codec->pix_fmt != AV_PIX_FMT_GRAY8 && + st->codec->pix_fmt != AV_PIX_FMT_GRAY16) { // Adjust for smaller Cb and Cr planes avcodec_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift, &v_chroma_shift); @@ -222,25 +222,25 @@ static int yuv4_write_header(AVFormatContext *s) } switch (s->streams[0]->codec->pix_fmt) { - case PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV411P: av_log(s, AV_LOG_WARNING, "Warning: generating rarely used 4:1:1 YUV " "stream, some mjpegtools might not work.\n"); break; - case PIX_FMT_GRAY8: - case PIX_FMT_GRAY16: - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV444P: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY16: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV444P: break; - 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_YUV420P16: - case PIX_FMT_YUV422P16: - case PIX_FMT_YUV444P16: + 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_YUV420P16: + case AV_PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV444P16: if (s->streams[0]->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL) { av_log(s, AV_LOG_ERROR, "'%s' is not a official yuv4mpegpipe pixel format. " "Use '-strict -1' to encode to this pixel format.\n", @@ -291,7 +291,7 @@ static int yuv4_read_header(AVFormatContext *s) AVIOContext *pb = s->pb; int width = -1, height = -1, raten = 0, rated = 0, aspectn = 0, aspectd = 0; - enum PixelFormat pix_fmt = PIX_FMT_NONE, alt_pix_fmt = PIX_FMT_NONE; + enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE, alt_pix_fmt = AV_PIX_FMT_NONE; enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED; AVStream *st; struct frame_attributes *s1 = s->priv_data; @@ -328,49 +328,49 @@ static int yuv4_read_header(AVFormatContext *s) break; case 'C': // Color space if (strncmp("420jpeg", tokstart, 7) == 0) { - pix_fmt = PIX_FMT_YUV420P; + pix_fmt = AV_PIX_FMT_YUV420P; chroma_sample_location = AVCHROMA_LOC_CENTER; } else if (strncmp("420mpeg2", tokstart, 8) == 0) { - pix_fmt = PIX_FMT_YUV420P; + pix_fmt = AV_PIX_FMT_YUV420P; chroma_sample_location = AVCHROMA_LOC_LEFT; } else if (strncmp("420paldv", tokstart, 8) == 0) { - pix_fmt = PIX_FMT_YUV420P; + pix_fmt = AV_PIX_FMT_YUV420P; chroma_sample_location = AVCHROMA_LOC_TOPLEFT; } else if (strncmp("420p16", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV420P16; + pix_fmt = AV_PIX_FMT_YUV420P16; } else if (strncmp("422p16", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV422P16; + pix_fmt = AV_PIX_FMT_YUV422P16; } else if (strncmp("444p16", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV444P16; + pix_fmt = AV_PIX_FMT_YUV444P16; } else if (strncmp("420p10", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV420P10; + pix_fmt = AV_PIX_FMT_YUV420P10; } else if (strncmp("422p10", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV422P10; + pix_fmt = AV_PIX_FMT_YUV422P10; } else if (strncmp("444p10", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV444P10; + pix_fmt = AV_PIX_FMT_YUV444P10; } else if (strncmp("420p9", tokstart, 5) == 0) { - pix_fmt = PIX_FMT_YUV420P9; + pix_fmt = AV_PIX_FMT_YUV420P9; } else if (strncmp("422p9", tokstart, 5) == 0) { - pix_fmt = PIX_FMT_YUV422P9; + pix_fmt = AV_PIX_FMT_YUV422P9; } else if (strncmp("444p9", tokstart, 5) == 0) { - pix_fmt = PIX_FMT_YUV444P9; + pix_fmt = AV_PIX_FMT_YUV444P9; } else if (strncmp("420", tokstart, 3) == 0) { - pix_fmt = PIX_FMT_YUV420P; + pix_fmt = AV_PIX_FMT_YUV420P; chroma_sample_location = AVCHROMA_LOC_CENTER; } else if (strncmp("411", tokstart, 3) == 0) { - pix_fmt = PIX_FMT_YUV411P; + pix_fmt = AV_PIX_FMT_YUV411P; } else if (strncmp("422", tokstart, 3) == 0) { - pix_fmt = PIX_FMT_YUV422P; + pix_fmt = AV_PIX_FMT_YUV422P; } else if (strncmp("444alpha", tokstart, 8) == 0 ) { av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 " "YUV4MPEG stream.\n"); return -1; } else if (strncmp("444", tokstart, 3) == 0) { - pix_fmt = PIX_FMT_YUV444P; + pix_fmt = AV_PIX_FMT_YUV444P; } else if (strncmp("mono16", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_GRAY16; + pix_fmt = AV_PIX_FMT_GRAY16; } else if (strncmp("mono", tokstart, 4) == 0) { - pix_fmt = PIX_FMT_GRAY8; + pix_fmt = AV_PIX_FMT_GRAY8; } else { av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown " "pixel format.\n"); @@ -418,35 +418,35 @@ static int yuv4_read_header(AVFormatContext *s) // Older nonstandard pixel format representation tokstart += 6; if (strncmp("420JPEG", tokstart, 7) == 0) - alt_pix_fmt = PIX_FMT_YUV420P; + alt_pix_fmt = AV_PIX_FMT_YUV420P; else if (strncmp("420MPEG2", tokstart, 8) == 0) - alt_pix_fmt = PIX_FMT_YUV420P; + alt_pix_fmt = AV_PIX_FMT_YUV420P; else if (strncmp("420PALDV", tokstart, 8) == 0) - alt_pix_fmt = PIX_FMT_YUV420P; + alt_pix_fmt = AV_PIX_FMT_YUV420P; else if (strncmp("420P9", tokstart, 5) == 0) - alt_pix_fmt = PIX_FMT_YUV420P9; + alt_pix_fmt = AV_PIX_FMT_YUV420P9; else if (strncmp("422P9", tokstart, 5) == 0) - alt_pix_fmt = PIX_FMT_YUV422P9; + alt_pix_fmt = AV_PIX_FMT_YUV422P9; else if (strncmp("444P9", tokstart, 5) == 0) - alt_pix_fmt = PIX_FMT_YUV444P9; + alt_pix_fmt = AV_PIX_FMT_YUV444P9; else if (strncmp("420P10", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV420P10; + alt_pix_fmt = AV_PIX_FMT_YUV420P10; else if (strncmp("422P10", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV422P10; + alt_pix_fmt = AV_PIX_FMT_YUV422P10; else if (strncmp("444P10", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV444P10; + alt_pix_fmt = AV_PIX_FMT_YUV444P10; else if (strncmp("420P16", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV420P16; + alt_pix_fmt = AV_PIX_FMT_YUV420P16; else if (strncmp("422P16", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV422P16; + alt_pix_fmt = AV_PIX_FMT_YUV422P16; else if (strncmp("444P16", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV444P16; + alt_pix_fmt = AV_PIX_FMT_YUV444P16; else if (strncmp("411", tokstart, 3) == 0) - alt_pix_fmt = PIX_FMT_YUV411P; + alt_pix_fmt = AV_PIX_FMT_YUV411P; else if (strncmp("422", tokstart, 3) == 0) - alt_pix_fmt = PIX_FMT_YUV422P; + alt_pix_fmt = AV_PIX_FMT_YUV422P; else if (strncmp("444", tokstart, 3) == 0) - alt_pix_fmt = PIX_FMT_YUV444P; + alt_pix_fmt = AV_PIX_FMT_YUV444P; } while (tokstart < header_end && *tokstart != 0x20) tokstart++; @@ -459,9 +459,9 @@ static int yuv4_read_header(AVFormatContext *s) return -1; } - if (pix_fmt == PIX_FMT_NONE) { - if (alt_pix_fmt == PIX_FMT_NONE) - pix_fmt = PIX_FMT_YUV420P; + if (pix_fmt == AV_PIX_FMT_NONE) { + if (alt_pix_fmt == AV_PIX_FMT_NONE) + pix_fmt = AV_PIX_FMT_YUV420P; else pix_fmt = alt_pix_fmt; } diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index a3d40877b1..6174a605bc 100644 --- a/libavutil/imgutils.c +++ b/libavutil/imgutils.c @@ -65,20 +65,20 @@ int image_get_linesize(int width, int plane, return linesize; } -int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane) +int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane) { const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; int max_step [4]; /* max pixel step for each plane */ int max_step_comp[4]; /* the component for each plane which has the max pixel step */ - if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) + if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) return AVERROR(EINVAL); av_image_fill_max_pixsteps(max_step, max_step_comp, desc); return image_get_linesize(width, plane, max_step[plane], max_step_comp[plane], desc); } -int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width) +int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width) { int i, ret; const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; @@ -87,7 +87,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt memset(linesizes, 0, 4*sizeof(linesizes[0])); - if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) + if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) return AVERROR(EINVAL); av_image_fill_max_pixsteps(max_step, max_step_comp, desc); @@ -100,7 +100,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt return 0; } -int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height, +int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height, uint8_t *ptr, const int linesizes[4]) { int i, total_size, size[4] = { 0 }, has_plane[4] = { 0 }; @@ -108,7 +108,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; memset(data , 0, sizeof(data[0])*4); - if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) + if ((unsigned)pix_fmt >= AV_PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL) return AVERROR(EINVAL); data[0] = ptr; @@ -142,7 +142,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh return total_size; } -int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt) +int ff_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt) { int i; @@ -150,27 +150,27 @@ int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt) int r, g, b; switch (pix_fmt) { - case PIX_FMT_RGB8: + case AV_PIX_FMT_RGB8: r = (i>>5 )*36; g = ((i>>2)&7)*36; b = (i&3 )*85; break; - case PIX_FMT_BGR8: + case AV_PIX_FMT_BGR8: b = (i>>6 )*85; g = ((i>>3)&7)*36; r = (i&7 )*36; break; - case PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_RGB4_BYTE: r = (i>>3 )*255; g = ((i>>1)&3)*85; b = (i&1 )*255; break; - case PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: b = (i>>3 )*255; g = ((i>>1)&3)*85; r = (i&1 )*255; break; - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: r = b = g = i; break; default: @@ -183,7 +183,7 @@ int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt) } int av_image_alloc(uint8_t *pointers[4], int linesizes[4], - int w, int h, enum PixelFormat pix_fmt, int align) + int w, int h, enum AVPixelFormat pix_fmt, int align) { int i, ret; uint8_t *buf; @@ -246,7 +246,7 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], - enum PixelFormat pix_fmt, int width, int height) + enum AVPixelFormat pix_fmt, int width, int height) { const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; @@ -281,7 +281,7 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4], const uint8_t *src, - enum PixelFormat pix_fmt, int width, int height, int align) + enum AVPixelFormat pix_fmt, int width, int height, int align) { int ret, i; @@ -300,7 +300,7 @@ int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4], return av_image_fill_pointers(dst_data, pix_fmt, height, (uint8_t *)src, dst_linesize); } -int av_image_get_buffer_size(enum PixelFormat pix_fmt, int width, int height, int align) +int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align) { uint8_t *data[4]; int linesize[4]; @@ -314,7 +314,7 @@ int av_image_get_buffer_size(enum PixelFormat pix_fmt, int width, int height, in int av_image_copy_to_buffer(uint8_t *dst, int dst_size, const uint8_t * const src_data[4], const int src_linesize[4], - enum PixelFormat pix_fmt, int width, int height, int align) + enum AVPixelFormat pix_fmt, int width, int height, int align) { int i, j, nb_planes = 0, linesize[4]; const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h index 3b1904bf3c..f10000cdc8 100644 --- a/libavutil/imgutils.h +++ b/libavutil/imgutils.h @@ -55,7 +55,7 @@ void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], * * @return the computed size in bytes */ -int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane); +int av_image_get_linesize(enum AVPixelFormat pix_fmt, int width, int plane); /** * Fill plane linesizes for an image with pixel format pix_fmt and @@ -64,7 +64,7 @@ int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane); * @param linesizes array to be filled with the linesize for each plane * @return >= 0 in case of success, a negative error code otherwise */ -int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width); +int av_image_fill_linesizes(int linesizes[4], enum AVPixelFormat pix_fmt, int width); /** * Fill plane data pointers for an image with pixel format pix_fmt and @@ -77,7 +77,7 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt * @return the size in bytes required for the image buffer, a negative * error code in case of failure */ -int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height, +int av_image_fill_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt, int height, uint8_t *ptr, const int linesizes[4]); /** @@ -91,7 +91,7 @@ int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int heigh * error code in case of failure */ int av_image_alloc(uint8_t *pointers[4], int linesizes[4], - int w, int h, enum PixelFormat pix_fmt, int align); + int w, int h, enum AVPixelFormat pix_fmt, int align); /** * Copy image plane from src to dst. @@ -114,7 +114,7 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, */ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], const uint8_t *src_data[4], const int src_linesizes[4], - enum PixelFormat pix_fmt, int width, int height); + enum AVPixelFormat pix_fmt, int width, int height); /** * Setup the data pointers and linesizes based on the specified image @@ -144,7 +144,7 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], */ int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4], const uint8_t *src, - enum PixelFormat pix_fmt, int width, int height, int align); + enum AVPixelFormat pix_fmt, int width, int height, int align); /** * Return the size in bytes of the amount of data required to store an @@ -152,7 +152,7 @@ int av_image_fill_arrays(uint8_t *dst_data[4], int dst_linesize[4], * * @param[in] align the assumed linesize alignment */ -int av_image_get_buffer_size(enum PixelFormat pix_fmt, int width, int height, int align); +int av_image_get_buffer_size(enum AVPixelFormat pix_fmt, int width, int height, int align); /** * Copy image data from an image into a buffer. @@ -173,7 +173,7 @@ int av_image_get_buffer_size(enum PixelFormat pix_fmt, int width, int height, in */ int av_image_copy_to_buffer(uint8_t *dst, int dst_size, const uint8_t * const src_data[4], const int src_linesize[4], - enum PixelFormat pix_fmt, int width, int height, int align); + enum AVPixelFormat pix_fmt, int width, int height, int align); /** * Check if the given dimension of an image is valid, meaning that all @@ -187,7 +187,7 @@ int av_image_copy_to_buffer(uint8_t *dst, int dst_size, */ int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx); -int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt); +int ff_set_systematic_pal2(uint32_t pal[256], enum AVPixelFormat pix_fmt); /** * @} diff --git a/libavutil/opt.c b/libavutil/opt.c index a10135b9c8..f2ce9789f7 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -265,19 +265,19 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags) return ret; case AV_OPT_TYPE_PIXEL_FMT: if (!val || !strcmp(val, "none")) - ret = PIX_FMT_NONE; + ret = AV_PIX_FMT_NONE; else { ret = av_get_pix_fmt(val); - if (ret == PIX_FMT_NONE) { + if (ret == AV_PIX_FMT_NONE) { char *tail; ret = strtol(val, &tail, 0); - if (*tail || (unsigned)ret >= PIX_FMT_NB) { + if (*tail || (unsigned)ret >= AV_PIX_FMT_NB) { av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\" as pixel format\n", val); return AVERROR(EINVAL); } } } - *(enum PixelFormat *)dst = ret; + *(enum AVPixelFormat *)dst = ret; return 0; } @@ -465,7 +465,7 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val) ret = snprintf(buf, sizeof(buf), "%dx%d", ((int *)dst)[0], ((int *)dst)[1]); break; case AV_OPT_TYPE_PIXEL_FMT: - ret = snprintf(buf, sizeof(buf), "%s", (char *)av_x_if_null(av_get_pix_fmt_name(*(enum PixelFormat *)dst), "none")); + ret = snprintf(buf, sizeof(buf), "%s", (char *)av_x_if_null(av_get_pix_fmt_name(*(enum AVPixelFormat *)dst), "none")); break; default: return AVERROR(EINVAL); @@ -990,7 +990,7 @@ typedef struct TestContext int flags; AVRational rational; int w, h; - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; } TestContext; #define OFFSET(x) offsetof(TestContext, x) diff --git a/libavutil/pixdesc.c b/libavutil/pixdesc.c index d64d300ea7..0958718b50 100644 --- a/libavutil/pixdesc.c +++ b/libavutil/pixdesc.c @@ -122,8 +122,8 @@ void av_write_image_line(const uint16_t *src, } } -const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { - [PIX_FMT_YUV420P] = { +const AVPixFmtDescriptor av_pix_fmt_descriptors[AV_PIX_FMT_NB] = { + [AV_PIX_FMT_YUV420P] = { .name = "yuv420p", .nb_components = 3, .log2_chroma_w = 1, @@ -135,7 +135,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUYV422] = { + [AV_PIX_FMT_YUYV422] = { .name = "yuyv422", .nb_components = 3, .log2_chroma_w = 1, @@ -146,7 +146,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { { 0, 3, 4, 0, 7 }, /* V */ }, }, - [PIX_FMT_RGB24] = { + [AV_PIX_FMT_RGB24] = { .name = "rgb24", .nb_components = 3, .log2_chroma_w = 0, @@ -158,7 +158,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_BGR24] = { + [AV_PIX_FMT_BGR24] = { .name = "bgr24", .nb_components = 3, .log2_chroma_w = 0, @@ -170,7 +170,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_YUV422P] = { + [AV_PIX_FMT_YUV422P] = { .name = "yuv422p", .nb_components = 3, .log2_chroma_w = 1, @@ -182,7 +182,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P] = { + [AV_PIX_FMT_YUV444P] = { .name = "yuv444p", .nb_components = 3, .log2_chroma_w = 0, @@ -194,7 +194,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV410P] = { + [AV_PIX_FMT_YUV410P] = { .name = "yuv410p", .nb_components = 3, .log2_chroma_w = 2, @@ -206,7 +206,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV411P] = { + [AV_PIX_FMT_YUV411P] = { .name = "yuv411p", .nb_components = 3, .log2_chroma_w = 2, @@ -218,7 +218,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_GRAY8] = { + [AV_PIX_FMT_GRAY8] = { .name = "gray", .nb_components = 1, .log2_chroma_w = 0, @@ -228,7 +228,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PSEUDOPAL, }, - [PIX_FMT_MONOWHITE] = { + [AV_PIX_FMT_MONOWHITE] = { .name = "monow", .nb_components = 1, .log2_chroma_w = 0, @@ -238,7 +238,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BITSTREAM, }, - [PIX_FMT_MONOBLACK] = { + [AV_PIX_FMT_MONOBLACK] = { .name = "monob", .nb_components = 1, .log2_chroma_w = 0, @@ -248,7 +248,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BITSTREAM, }, - [PIX_FMT_PAL8] = { + [AV_PIX_FMT_PAL8] = { .name = "pal8", .nb_components = 1, .log2_chroma_w = 0, @@ -258,7 +258,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PAL, }, - [PIX_FMT_YUVJ420P] = { + [AV_PIX_FMT_YUVJ420P] = { .name = "yuvj420p", .nb_components = 3, .log2_chroma_w = 1, @@ -270,7 +270,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUVJ422P] = { + [AV_PIX_FMT_YUVJ422P] = { .name = "yuvj422p", .nb_components = 3, .log2_chroma_w = 1, @@ -282,7 +282,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUVJ444P] = { + [AV_PIX_FMT_YUVJ444P] = { .name = "yuvj444p", .nb_components = 3, .log2_chroma_w = 0, @@ -294,15 +294,15 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_XVMC_MPEG2_MC] = { + [AV_PIX_FMT_XVMC_MPEG2_MC] = { .name = "xvmcmc", .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_XVMC_MPEG2_IDCT] = { + [AV_PIX_FMT_XVMC_MPEG2_IDCT] = { .name = "xvmcidct", .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_UYVY422] = { + [AV_PIX_FMT_UYVY422] = { .name = "uyvy422", .nb_components = 3, .log2_chroma_w = 1, @@ -313,7 +313,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { { 0, 3, 3, 0, 7 }, /* V */ }, }, - [PIX_FMT_UYYVYY411] = { + [AV_PIX_FMT_UYYVYY411] = { .name = "uyyvyy411", .nb_components = 3, .log2_chroma_w = 2, @@ -324,7 +324,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { { 0, 5, 4, 0, 7 }, /* V */ }, }, - [PIX_FMT_BGR8] = { + [AV_PIX_FMT_BGR8] = { .name = "bgr8", .nb_components = 3, .log2_chroma_w = 0, @@ -336,7 +336,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL, }, - [PIX_FMT_BGR4] = { + [AV_PIX_FMT_BGR4] = { .name = "bgr4", .nb_components = 3, .log2_chroma_w = 0, @@ -348,7 +348,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB, }, - [PIX_FMT_BGR4_BYTE] = { + [AV_PIX_FMT_BGR4_BYTE] = { .name = "bgr4_byte", .nb_components = 3, .log2_chroma_w = 0, @@ -360,7 +360,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL, }, - [PIX_FMT_RGB8] = { + [AV_PIX_FMT_RGB8] = { .name = "rgb8", .nb_components = 3, .log2_chroma_w = 0, @@ -372,7 +372,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL, }, - [PIX_FMT_RGB4] = { + [AV_PIX_FMT_RGB4] = { .name = "rgb4", .nb_components = 3, .log2_chroma_w = 0, @@ -384,7 +384,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BITSTREAM | PIX_FMT_RGB, }, - [PIX_FMT_RGB4_BYTE] = { + [AV_PIX_FMT_RGB4_BYTE] = { .name = "rgb4_byte", .nb_components = 3, .log2_chroma_w = 0, @@ -396,7 +396,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL, }, - [PIX_FMT_NV12] = { + [AV_PIX_FMT_NV12] = { .name = "nv12", .nb_components = 3, .log2_chroma_w = 1, @@ -408,7 +408,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_NV21] = { + [AV_PIX_FMT_NV21] = { .name = "nv21", .nb_components = 3, .log2_chroma_w = 1, @@ -420,7 +420,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_ARGB] = { + [AV_PIX_FMT_ARGB] = { .name = "argb", .nb_components = 4, .log2_chroma_w = 0, @@ -433,7 +433,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_RGBA] = { + [AV_PIX_FMT_RGBA] = { .name = "rgba", .nb_components = 4, .log2_chroma_w = 0, @@ -446,7 +446,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_ABGR] = { + [AV_PIX_FMT_ABGR] = { .name = "abgr", .nb_components = 4, .log2_chroma_w = 0, @@ -459,7 +459,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_BGRA] = { + [AV_PIX_FMT_BGRA] = { .name = "bgra", .nb_components = 4, .log2_chroma_w = 0, @@ -472,7 +472,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_0RGB] = { + [AV_PIX_FMT_0RGB] = { .name = "0rgb", .nb_components= 3, .log2_chroma_w= 0, @@ -484,7 +484,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_RGB0] = { + [AV_PIX_FMT_RGB0] = { .name = "rgb0", .nb_components= 3, .log2_chroma_w= 0, @@ -497,7 +497,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_0BGR] = { + [AV_PIX_FMT_0BGR] = { .name = "0bgr", .nb_components= 3, .log2_chroma_w= 0, @@ -509,7 +509,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_BGR0] = { + [AV_PIX_FMT_BGR0] = { .name = "bgr0", .nb_components= 3, .log2_chroma_w= 0, @@ -522,7 +522,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_GRAY16BE] = { + [AV_PIX_FMT_GRAY16BE] = { .name = "gray16be", .nb_components = 1, .log2_chroma_w = 0, @@ -532,7 +532,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE, }, - [PIX_FMT_GRAY16LE] = { + [AV_PIX_FMT_GRAY16LE] = { .name = "gray16le", .nb_components = 1, .log2_chroma_w = 0, @@ -541,7 +541,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { { 0, 1, 1, 0, 15 }, /* Y */ }, }, - [PIX_FMT_YUV440P] = { + [AV_PIX_FMT_YUV440P] = { .name = "yuv440p", .nb_components = 3, .log2_chroma_w = 0, @@ -553,7 +553,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUVJ440P] = { + [AV_PIX_FMT_YUVJ440P] = { .name = "yuvj440p", .nb_components = 3, .log2_chroma_w = 0, @@ -565,7 +565,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUVA420P] = { + [AV_PIX_FMT_YUVA420P] = { .name = "yuva420p", .nb_components = 4, .log2_chroma_w = 1, @@ -578,7 +578,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUVA422P] = { + [AV_PIX_FMT_YUVA422P] = { .name = "yuva422p", .nb_components = 4, .log2_chroma_w = 1, @@ -591,7 +591,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUVA444P] = { + [AV_PIX_FMT_YUVA444P] = { .name = "yuva444p", .nb_components = 4, .log2_chroma_w = 0, @@ -604,43 +604,43 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_VDPAU_H264] = { + [AV_PIX_FMT_VDPAU_H264] = { .name = "vdpau_h264", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_VDPAU_MPEG1] = { + [AV_PIX_FMT_VDPAU_MPEG1] = { .name = "vdpau_mpeg1", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_VDPAU_MPEG2] = { + [AV_PIX_FMT_VDPAU_MPEG2] = { .name = "vdpau_mpeg2", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_VDPAU_WMV3] = { + [AV_PIX_FMT_VDPAU_WMV3] = { .name = "vdpau_wmv3", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_VDPAU_VC1] = { + [AV_PIX_FMT_VDPAU_VC1] = { .name = "vdpau_vc1", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_VDPAU_MPEG4] = { + [AV_PIX_FMT_VDPAU_MPEG4] = { .name = "vdpau_mpeg4", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_RGB48BE] = { + [AV_PIX_FMT_RGB48BE] = { .name = "rgb48be", .nb_components = 3, .log2_chroma_w = 0, @@ -652,7 +652,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB | PIX_FMT_BE, }, - [PIX_FMT_RGB48LE] = { + [AV_PIX_FMT_RGB48LE] = { .name = "rgb48le", .nb_components = 3, .log2_chroma_w = 0, @@ -664,7 +664,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_RGBA64BE] = { + [AV_PIX_FMT_RGBA64BE] = { .name = "rgba64be", .nb_components= 4, .log2_chroma_w= 0, @@ -677,7 +677,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB | PIX_FMT_BE, }, - [PIX_FMT_RGBA64LE] = { + [AV_PIX_FMT_RGBA64LE] = { .name = "rgba64le", .nb_components= 4, .log2_chroma_w= 0, @@ -690,7 +690,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_RGB565BE] = { + [AV_PIX_FMT_RGB565BE] = { .name = "rgb565be", .nb_components = 3, .log2_chroma_w = 0, @@ -702,7 +702,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_RGB, }, - [PIX_FMT_RGB565LE] = { + [AV_PIX_FMT_RGB565LE] = { .name = "rgb565le", .nb_components = 3, .log2_chroma_w = 0, @@ -714,7 +714,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_RGB555BE] = { + [AV_PIX_FMT_RGB555BE] = { .name = "rgb555be", .nb_components = 3, .log2_chroma_w = 0, @@ -726,7 +726,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_RGB, }, - [PIX_FMT_RGB555LE] = { + [AV_PIX_FMT_RGB555LE] = { .name = "rgb555le", .nb_components = 3, .log2_chroma_w = 0, @@ -738,7 +738,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_RGB444BE] = { + [AV_PIX_FMT_RGB444BE] = { .name = "rgb444be", .nb_components = 3, .log2_chroma_w = 0, @@ -750,7 +750,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_RGB, }, - [PIX_FMT_RGB444LE] = { + [AV_PIX_FMT_RGB444LE] = { .name = "rgb444le", .nb_components = 3, .log2_chroma_w = 0, @@ -762,7 +762,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_BGR48BE] = { + [AV_PIX_FMT_BGR48BE] = { .name = "bgr48be", .nb_components = 3, .log2_chroma_w = 0, @@ -774,7 +774,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_RGB, }, - [PIX_FMT_BGR48LE] = { + [AV_PIX_FMT_BGR48LE] = { .name = "bgr48le", .nb_components = 3, .log2_chroma_w = 0, @@ -786,7 +786,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_BGRA64BE] = { + [AV_PIX_FMT_BGRA64BE] = { .name = "bgra64be", .nb_components= 4, .log2_chroma_w= 0, @@ -799,7 +799,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_RGB, }, - [PIX_FMT_BGRA64LE] = { + [AV_PIX_FMT_BGRA64LE] = { .name = "bgra64le", .nb_components= 4, .log2_chroma_w= 0, @@ -812,7 +812,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_BGR565BE] = { + [AV_PIX_FMT_BGR565BE] = { .name = "bgr565be", .nb_components = 3, .log2_chroma_w = 0, @@ -824,7 +824,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_RGB, }, - [PIX_FMT_BGR565LE] = { + [AV_PIX_FMT_BGR565LE] = { .name = "bgr565le", .nb_components = 3, .log2_chroma_w = 0, @@ -836,7 +836,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_BGR555BE] = { + [AV_PIX_FMT_BGR555BE] = { .name = "bgr555be", .nb_components = 3, .log2_chroma_w = 0, @@ -848,7 +848,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_RGB, }, - [PIX_FMT_BGR555LE] = { + [AV_PIX_FMT_BGR555LE] = { .name = "bgr555le", .nb_components = 3, .log2_chroma_w = 0, @@ -860,7 +860,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_BGR444BE] = { + [AV_PIX_FMT_BGR444BE] = { .name = "bgr444be", .nb_components = 3, .log2_chroma_w = 0, @@ -872,7 +872,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_RGB, }, - [PIX_FMT_BGR444LE] = { + [AV_PIX_FMT_BGR444LE] = { .name = "bgr444le", .nb_components = 3, .log2_chroma_w = 0, @@ -884,25 +884,25 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_RGB, }, - [PIX_FMT_VAAPI_MOCO] = { + [AV_PIX_FMT_VAAPI_MOCO] = { .name = "vaapi_moco", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_VAAPI_IDCT] = { + [AV_PIX_FMT_VAAPI_IDCT] = { .name = "vaapi_idct", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_VAAPI_VLD] = { + [AV_PIX_FMT_VAAPI_VLD] = { .name = "vaapi_vld", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_YUV420P9LE] = { + [AV_PIX_FMT_YUV420P9LE] = { .name = "yuv420p9le", .nb_components = 3, .log2_chroma_w = 1, @@ -914,7 +914,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P9BE] = { + [AV_PIX_FMT_YUV420P9BE] = { .name = "yuv420p9be", .nb_components = 3, .log2_chroma_w = 1, @@ -926,7 +926,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P10LE] = { + [AV_PIX_FMT_YUV420P10LE] = { .name = "yuv420p10le", .nb_components = 3, .log2_chroma_w = 1, @@ -938,7 +938,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P10BE] = { + [AV_PIX_FMT_YUV420P10BE] = { .name = "yuv420p10be", .nb_components = 3, .log2_chroma_w = 1, @@ -950,7 +950,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P12LE] = { + [AV_PIX_FMT_YUV420P12LE] = { .name = "yuv420p12le", .nb_components = 3, .log2_chroma_w = 1, @@ -962,7 +962,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P12BE] = { + [AV_PIX_FMT_YUV420P12BE] = { .name = "yuv420p12be", .nb_components = 3, .log2_chroma_w = 1, @@ -974,7 +974,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P14LE] = { + [AV_PIX_FMT_YUV420P14LE] = { .name = "yuv420p14le", .nb_components = 3, .log2_chroma_w = 1, @@ -986,7 +986,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P14BE] = { + [AV_PIX_FMT_YUV420P14BE] = { .name = "yuv420p14be", .nb_components = 3, .log2_chroma_w = 1, @@ -998,7 +998,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P16LE] = { + [AV_PIX_FMT_YUV420P16LE] = { .name = "yuv420p16le", .nb_components = 3, .log2_chroma_w = 1, @@ -1010,7 +1010,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV420P16BE] = { + [AV_PIX_FMT_YUV420P16BE] = { .name = "yuv420p16be", .nb_components = 3, .log2_chroma_w = 1, @@ -1022,7 +1022,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P9LE] = { + [AV_PIX_FMT_YUV422P9LE] = { .name = "yuv422p9le", .nb_components = 3, .log2_chroma_w = 1, @@ -1034,7 +1034,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P9BE] = { + [AV_PIX_FMT_YUV422P9BE] = { .name = "yuv422p9be", .nb_components = 3, .log2_chroma_w = 1, @@ -1046,7 +1046,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P10LE] = { + [AV_PIX_FMT_YUV422P10LE] = { .name = "yuv422p10le", .nb_components = 3, .log2_chroma_w = 1, @@ -1058,7 +1058,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P10BE] = { + [AV_PIX_FMT_YUV422P10BE] = { .name = "yuv422p10be", .nb_components = 3, .log2_chroma_w = 1, @@ -1070,7 +1070,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P12LE] = { + [AV_PIX_FMT_YUV422P12LE] = { .name = "yuv422p12le", .nb_components = 3, .log2_chroma_w = 1, @@ -1082,7 +1082,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P12BE] = { + [AV_PIX_FMT_YUV422P12BE] = { .name = "yuv422p12be", .nb_components = 3, .log2_chroma_w = 1, @@ -1094,7 +1094,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P14LE] = { + [AV_PIX_FMT_YUV422P14LE] = { .name = "yuv422p14le", .nb_components = 3, .log2_chroma_w = 1, @@ -1106,7 +1106,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P14BE] = { + [AV_PIX_FMT_YUV422P14BE] = { .name = "yuv422p14be", .nb_components = 3, .log2_chroma_w = 1, @@ -1118,7 +1118,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P16LE] = { + [AV_PIX_FMT_YUV422P16LE] = { .name = "yuv422p16le", .nb_components = 3, .log2_chroma_w = 1, @@ -1130,7 +1130,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV422P16BE] = { + [AV_PIX_FMT_YUV422P16BE] = { .name = "yuv422p16be", .nb_components = 3, .log2_chroma_w = 1, @@ -1142,7 +1142,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P16LE] = { + [AV_PIX_FMT_YUV444P16LE] = { .name = "yuv444p16le", .nb_components = 3, .log2_chroma_w = 0, @@ -1154,7 +1154,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P16BE] = { + [AV_PIX_FMT_YUV444P16BE] = { .name = "yuv444p16be", .nb_components = 3, .log2_chroma_w = 0, @@ -1166,7 +1166,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P10LE] = { + [AV_PIX_FMT_YUV444P10LE] = { .name = "yuv444p10le", .nb_components = 3, .log2_chroma_w = 0, @@ -1178,7 +1178,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P10BE] = { + [AV_PIX_FMT_YUV444P10BE] = { .name = "yuv444p10be", .nb_components = 3, .log2_chroma_w = 0, @@ -1190,7 +1190,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P9LE] = { + [AV_PIX_FMT_YUV444P9LE] = { .name = "yuv444p9le", .nb_components = 3, .log2_chroma_w = 0, @@ -1202,7 +1202,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P9BE] = { + [AV_PIX_FMT_YUV444P9BE] = { .name = "yuv444p9be", .nb_components = 3, .log2_chroma_w = 0, @@ -1214,7 +1214,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P12LE] = { + [AV_PIX_FMT_YUV444P12LE] = { .name = "yuv444p12le", .nb_components = 3, .log2_chroma_w = 0, @@ -1226,7 +1226,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P12BE] = { + [AV_PIX_FMT_YUV444P12BE] = { .name = "yuv444p12be", .nb_components = 3, .log2_chroma_w = 0, @@ -1238,7 +1238,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P14LE] = { + [AV_PIX_FMT_YUV444P14LE] = { .name = "yuv444p14le", .nb_components = 3, .log2_chroma_w = 0, @@ -1250,7 +1250,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR, }, - [PIX_FMT_YUV444P14BE] = { + [AV_PIX_FMT_YUV444P14BE] = { .name = "yuv444p14be", .nb_components = 3, .log2_chroma_w = 0, @@ -1262,19 +1262,19 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR, }, - [PIX_FMT_DXVA2_VLD] = { + [AV_PIX_FMT_DXVA2_VLD] = { .name = "dxva2_vld", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_VDA_VLD] = { + [AV_PIX_FMT_VDA_VLD] = { .name = "vda_vld", .log2_chroma_w = 1, .log2_chroma_h = 1, .flags = PIX_FMT_HWACCEL, }, - [PIX_FMT_GRAY8A] = { + [AV_PIX_FMT_GRAY8A] = { .name = "gray8a", .nb_components = 2, .comp = { @@ -1282,7 +1282,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { { 0, 1, 2, 0, 7 }, /* A */ }, }, - [PIX_FMT_GBRP] = { + [AV_PIX_FMT_GBRP] = { .name = "gbrp", .nb_components = 3, .log2_chroma_w = 0, @@ -1294,7 +1294,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP9LE] = { + [AV_PIX_FMT_GBRP9LE] = { .name = "gbrp9le", .nb_components = 3, .log2_chroma_w = 0, @@ -1306,7 +1306,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP9BE] = { + [AV_PIX_FMT_GBRP9BE] = { .name = "gbrp9be", .nb_components = 3, .log2_chroma_w = 0, @@ -1318,7 +1318,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP10LE] = { + [AV_PIX_FMT_GBRP10LE] = { .name = "gbrp10le", .nb_components = 3, .log2_chroma_w = 0, @@ -1330,7 +1330,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP10BE] = { + [AV_PIX_FMT_GBRP10BE] = { .name = "gbrp10be", .nb_components = 3, .log2_chroma_w = 0, @@ -1342,7 +1342,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP12LE] = { + [AV_PIX_FMT_GBRP12LE] = { .name = "gbrp12le", .nb_components = 3, .log2_chroma_w = 0, @@ -1354,7 +1354,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP12BE] = { + [AV_PIX_FMT_GBRP12BE] = { .name = "gbrp12be", .nb_components = 3, .log2_chroma_w = 0, @@ -1366,7 +1366,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP14LE] = { + [AV_PIX_FMT_GBRP14LE] = { .name = "gbrp14le", .nb_components = 3, .log2_chroma_w = 0, @@ -1378,7 +1378,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP14BE] = { + [AV_PIX_FMT_GBRP14BE] = { .name = "gbrp14be", .nb_components = 3, .log2_chroma_w = 0, @@ -1390,7 +1390,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_BE | PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP16LE] = { + [AV_PIX_FMT_GBRP16LE] = { .name = "gbrp16le", .nb_components = 3, .log2_chroma_w = 0, @@ -1402,7 +1402,7 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, .flags = PIX_FMT_PLANAR | PIX_FMT_RGB, }, - [PIX_FMT_GBRP16BE] = { + [AV_PIX_FMT_GBRP16BE] = { .name = "gbrp16be", .nb_components = 3, .log2_chroma_w = 0, @@ -1416,21 +1416,21 @@ const AVPixFmtDescriptor av_pix_fmt_descriptors[PIX_FMT_NB] = { }, }; -static enum PixelFormat get_pix_fmt_internal(const char *name) +static enum AVPixelFormat get_pix_fmt_internal(const char *name) { - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; - for (pix_fmt = 0; pix_fmt < PIX_FMT_NB; pix_fmt++) + for (pix_fmt = 0; pix_fmt < AV_PIX_FMT_NB; pix_fmt++) if (av_pix_fmt_descriptors[pix_fmt].name && !strcmp(av_pix_fmt_descriptors[pix_fmt].name, name)) return pix_fmt; - return PIX_FMT_NONE; + return AV_PIX_FMT_NONE; } -const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt) +const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt) { - return (unsigned)pix_fmt < PIX_FMT_NB ? + return (unsigned)pix_fmt < AV_PIX_FMT_NB ? av_pix_fmt_descriptors[pix_fmt].name : NULL; } @@ -1440,9 +1440,9 @@ const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt) # define X_NE(be, le) le #endif -enum PixelFormat av_get_pix_fmt(const char *name) +enum AVPixelFormat av_get_pix_fmt(const char *name) { - enum PixelFormat pix_fmt; + enum AVPixelFormat pix_fmt; if (!strcmp(name, "rgb32")) name = X_NE("argb", "bgra"); @@ -1450,7 +1450,7 @@ enum PixelFormat av_get_pix_fmt(const char *name) name = X_NE("abgr", "rgba"); pix_fmt = get_pix_fmt_internal(name); - if (pix_fmt == PIX_FMT_NONE) { + if (pix_fmt == AV_PIX_FMT_NONE) { char name2[32]; snprintf(name2, sizeof(name2), "%s%s", name, X_NE("be", "le")); @@ -1472,7 +1472,7 @@ int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc) return bits >> log2_pixels; } -char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt) +char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt) { /* print header */ if (pix_fmt < 0) { diff --git a/libavutil/pixdesc.h b/libavutil/pixdesc.h index 1fa916adcf..465c215190 100644 --- a/libavutil/pixdesc.h +++ b/libavutil/pixdesc.h @@ -149,9 +149,9 @@ void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesi * For example in a little-endian system, first looks for "gray16", * then for "gray16le". * - * Finally if no pixel format has been found, returns PIX_FMT_NONE. + * Finally if no pixel format has been found, returns AV_PIX_FMT_NONE. */ -enum PixelFormat av_get_pix_fmt(const char *name); +enum AVPixelFormat av_get_pix_fmt(const char *name); /** * Return the short name for a pixel format, NULL in case pix_fmt is @@ -159,7 +159,7 @@ enum PixelFormat av_get_pix_fmt(const char *name); * * @see av_get_pix_fmt(), av_get_pix_fmt_string() */ -const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt); +const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt); /** * Print in buf the string corresponding to the pixel format with @@ -171,7 +171,7 @@ const char *av_get_pix_fmt_name(enum PixelFormat pix_fmt); * corresponding info string, or a negative value to print the * corresponding header. */ -char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt); +char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt); /** * Return the number of bits per pixel used by the pixel format diff --git a/libavutil/pixfmt.h b/libavutil/pixfmt.h index 784cc618f0..4997bf2158 100644 --- a/libavutil/pixfmt.h +++ b/libavutil/pixfmt.h @@ -210,8 +210,8 @@ enum AVPixelFormat { #endif }; -#define PIX_FMT_Y400A PIX_FMT_GRAY8A -#define PIX_FMT_GBR24P PIX_FMT_GBRP +#define AV_PIX_FMT_Y400A AV_PIX_FMT_GRAY8A +#define AV_PIX_FMT_GBR24P AV_PIX_FMT_GBRP #if AV_HAVE_BIGENDIAN # define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be @@ -263,6 +263,9 @@ enum AVPixelFormat { #if FF_API_PIX_FMT #define PixelFormat AVPixelFormat +#define PIX_FMT_Y400A AV_PIX_FMT_Y400A +#define PIX_FMT_GBR24P AV_PIX_FMT_GBR24P + #define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le) #define PIX_FMT_RGB32 AV_PIX_FMT_RGB32 diff --git a/libavutil/utils.c b/libavutil/utils.c index 127c4b1461..01c940ce1f 100644 --- a/libavutil/utils.c +++ b/libavutil/utils.c @@ -28,7 +28,7 @@ unsigned avutil_version(void) { - av_assert0(PIX_FMT_VDA_VLD == 81); //check if the pix fmt enum has not had anything inserted or removed by mistake + av_assert0(AV_PIX_FMT_VDA_VLD == 81); //check if the pix fmt enum has not had anything inserted or removed by mistake av_assert0(AV_SAMPLE_FMT_DBLP == 9); av_assert0(AVMEDIA_TYPE_ATTACHMENT == 4); av_assert0(AV_PICTURE_TYPE_BI == 7); diff --git a/libswscale/bfin/swscale_bfin.c b/libswscale/bfin/swscale_bfin.c index a51b2af56c..2b93858e5c 100644 --- a/libswscale/bfin/swscale_bfin.c +++ b/libswscale/bfin/swscale_bfin.c @@ -73,12 +73,12 @@ static int yuyvtoyv12_unscaled(SwsContext *c, const uint8_t *src[], void ff_bfin_get_unscaled_swscale(SwsContext *c) { - if (c->dstFormat == PIX_FMT_YUV420P && c->srcFormat == PIX_FMT_UYVY422) { + if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_UYVY422) { av_log(NULL, AV_LOG_VERBOSE, "selecting Blackfin optimized uyvytoyv12_unscaled\n"); c->swScale = uyvytoyv12_unscaled; } - if (c->dstFormat == PIX_FMT_YUV420P && c->srcFormat == PIX_FMT_YUYV422) { + if (c->dstFormat == AV_PIX_FMT_YUV420P && c->srcFormat == AV_PIX_FMT_YUYV422) { av_log(NULL, AV_LOG_VERBOSE, "selecting Blackfin optimized yuyvtoyv12_unscaled\n"); c->swScale = yuyvtoyv12_unscaled; diff --git a/libswscale/bfin/yuv2rgb_bfin.c b/libswscale/bfin/yuv2rgb_bfin.c index dae7f314e7..e1b7afaaa7 100644 --- a/libswscale/bfin/yuv2rgb_bfin.c +++ b/libswscale/bfin/yuv2rgb_bfin.c @@ -173,22 +173,22 @@ SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c) SwsFunc f; switch (c->dstFormat) { - case PIX_FMT_RGB555: + case AV_PIX_FMT_RGB555: f = bfin_yuv420_rgb555; break; - case PIX_FMT_BGR555: + case AV_PIX_FMT_BGR555: f = bfin_yuv420_bgr555; break; - case PIX_FMT_RGB565: + case AV_PIX_FMT_RGB565: f = bfin_yuv420_rgb565; break; - case PIX_FMT_BGR565: + case AV_PIX_FMT_BGR565: f = bfin_yuv420_bgr565; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: f = bfin_yuv420_rgb24; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: f = bfin_yuv420_bgr24; break; default: diff --git a/libswscale/input.c b/libswscale/input.c index 9234646435..6d76068f9a 100644 --- a/libswscale/input.c +++ b/libswscale/input.c @@ -49,12 +49,12 @@ #define input_pixel(pos) (isBE(origin) ? AV_RB16(pos) : AV_RL16(pos)) -#define r ((origin == PIX_FMT_BGR48BE || origin == PIX_FMT_BGR48LE) ? b_r : r_b) -#define b ((origin == PIX_FMT_BGR48BE || origin == PIX_FMT_BGR48LE) ? r_b : b_r) +#define r ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? b_r : r_b) +#define b ((origin == AV_PIX_FMT_BGR48BE || origin == AV_PIX_FMT_BGR48LE) ? r_b : b_r) static av_always_inline void rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width, - enum PixelFormat origin) + enum AVPixelFormat origin) { int i; for (i = 0; i < width; i++) { @@ -69,7 +69,7 @@ rgb64ToY_c_template(uint16_t *dst, const uint16_t *src, int width, static av_always_inline void rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, - int width, enum PixelFormat origin) + int width, enum AVPixelFormat origin) { int i; av_assert1(src1==src2); @@ -86,7 +86,7 @@ rgb64ToUV_c_template(uint16_t *dstU, uint16_t *dstV, static av_always_inline void rgb64ToUV_half_c_template(uint16_t *dstU, uint16_t *dstV, const uint16_t *src1, const uint16_t *src2, - int width, enum PixelFormat origin) + int width, enum AVPixelFormat origin) { int i; av_assert1(src1==src2); @@ -129,12 +129,12 @@ static void pattern ## 64 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, uint8_t *_dstV rgb64ToUV_half_c_template(dstU, dstV, src1, src2, width, origin); \ } -rgb64funcs(rgb, LE, PIX_FMT_RGBA64LE) -rgb64funcs(rgb, BE, PIX_FMT_RGBA64BE) +rgb64funcs(rgb, LE, AV_PIX_FMT_RGBA64LE) +rgb64funcs(rgb, BE, AV_PIX_FMT_RGBA64BE) static av_always_inline void rgb48ToY_c_template(uint16_t *dst, const uint16_t *src, int width, - enum PixelFormat origin) + enum AVPixelFormat origin) { int i; for (i = 0; i < width; i++) { @@ -151,7 +151,7 @@ static av_always_inline void rgb48ToUV_c_template(uint16_t *dstU, const uint16_t *src1, const uint16_t *src2, int width, - enum PixelFormat origin) + enum AVPixelFormat origin) { int i; av_assert1(src1 == src2); @@ -170,7 +170,7 @@ static av_always_inline void rgb48ToUV_half_c_template(uint16_t *dstU, const uint16_t *src1, const uint16_t *src2, int width, - enum PixelFormat origin) + enum AVPixelFormat origin) { int i; av_assert1(src1 == src2); @@ -233,15 +233,15 @@ static void pattern ## 48 ## BE_LE ## ToUV_half_c(uint8_t *_dstU, \ rgb48ToUV_half_c_template(dstU, dstV, src1, src2, width, origin); \ } -rgb48funcs(rgb, LE, PIX_FMT_RGB48LE) -rgb48funcs(rgb, BE, PIX_FMT_RGB48BE) -rgb48funcs(bgr, LE, PIX_FMT_BGR48LE) -rgb48funcs(bgr, BE, PIX_FMT_BGR48BE) +rgb48funcs(rgb, LE, AV_PIX_FMT_RGB48LE) +rgb48funcs(rgb, BE, AV_PIX_FMT_RGB48BE) +rgb48funcs(bgr, LE, AV_PIX_FMT_BGR48LE) +rgb48funcs(bgr, BE, AV_PIX_FMT_BGR48BE) -#define input_pixel(i) ((origin == PIX_FMT_RGBA || \ - origin == PIX_FMT_BGRA || \ - origin == PIX_FMT_ARGB || \ - origin == PIX_FMT_ABGR) \ +#define input_pixel(i) ((origin == AV_PIX_FMT_RGBA || \ + origin == AV_PIX_FMT_BGRA || \ + origin == AV_PIX_FMT_ARGB || \ + origin == AV_PIX_FMT_ABGR) \ ? AV_RN32A(&src[(i) * 4]) \ : (isBE(origin) ? AV_RB16(&src[(i) * 2]) \ : AV_RL16(&src[(i) * 2]))) @@ -249,7 +249,7 @@ rgb48funcs(bgr, BE, PIX_FMT_BGR48BE) static av_always_inline void rgb16_32ToY_c_template(int16_t *dst, const uint8_t *src, int width, - enum PixelFormat origin, + enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, @@ -274,7 +274,7 @@ static av_always_inline void rgb16_32ToUV_c_template(int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, - enum PixelFormat origin, + enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, @@ -301,7 +301,7 @@ static av_always_inline void rgb16_32ToUV_half_c_template(int16_t *dstU, int16_t *dstV, const uint8_t *src, int width, - enum PixelFormat origin, + enum AVPixelFormat origin, int shr, int shg, int shb, int shp, int maskr, int maskg, @@ -325,8 +325,8 @@ static av_always_inline void rgb16_32ToUV_half_c_template(int16_t *dstU, b = (rb & maskb) >> shb; if (shp || - origin == PIX_FMT_BGR565LE || origin == PIX_FMT_BGR565BE || - origin == PIX_FMT_RGB565LE || origin == PIX_FMT_RGB565BE) { + origin == AV_PIX_FMT_BGR565LE || origin == AV_PIX_FMT_BGR565BE || + origin == AV_PIX_FMT_RGB565LE || origin == AV_PIX_FMT_RGB565BE) { g >>= shg; } else { g = (g & maskg) >> shg; @@ -369,22 +369,22 @@ static void name ## ToUV_half_c(uint8_t *dstU, uint8_t *dstV, \ rsh, gsh, bsh, S); \ } -rgb16_32_wrapper(PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8) -rgb16_32_wrapper(PIX_FMT_BGR32_1, bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8) -rgb16_32_wrapper(PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8) -rgb16_32_wrapper(PIX_FMT_RGB32_1, rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8) -rgb16_32_wrapper(PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8) -rgb16_32_wrapper(PIX_FMT_BGR555LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7) -rgb16_32_wrapper(PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4) -rgb16_32_wrapper(PIX_FMT_RGB565LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8) -rgb16_32_wrapper(PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7) -rgb16_32_wrapper(PIX_FMT_RGB444LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4) -rgb16_32_wrapper(PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8) -rgb16_32_wrapper(PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7) -rgb16_32_wrapper(PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4) -rgb16_32_wrapper(PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8) -rgb16_32_wrapper(PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7) -rgb16_32_wrapper(PIX_FMT_RGB444BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4) +rgb16_32_wrapper(AV_PIX_FMT_BGR32, bgr32, 16, 0, 0, 0, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8) +rgb16_32_wrapper(AV_PIX_FMT_BGR32_1, bgr321, 16, 0, 0, 8, 0xFF0000, 0xFF00, 0x00FF, 8, 0, 8, RGB2YUV_SHIFT + 8) +rgb16_32_wrapper(AV_PIX_FMT_RGB32, rgb32, 0, 0, 16, 0, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8) +rgb16_32_wrapper(AV_PIX_FMT_RGB32_1, rgb321, 0, 0, 16, 8, 0x00FF, 0xFF00, 0xFF0000, 8, 0, 8, RGB2YUV_SHIFT + 8) +rgb16_32_wrapper(AV_PIX_FMT_BGR565LE, bgr16le, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8) +rgb16_32_wrapper(AV_PIX_FMT_BGR555LE, bgr15le, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7) +rgb16_32_wrapper(AV_PIX_FMT_BGR444LE, bgr12le, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4) +rgb16_32_wrapper(AV_PIX_FMT_RGB565LE, rgb16le, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8) +rgb16_32_wrapper(AV_PIX_FMT_RGB555LE, rgb15le, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7) +rgb16_32_wrapper(AV_PIX_FMT_RGB444LE, rgb12le, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4) +rgb16_32_wrapper(AV_PIX_FMT_BGR565BE, bgr16be, 0, 0, 0, 0, 0x001F, 0x07E0, 0xF800, 11, 5, 0, RGB2YUV_SHIFT + 8) +rgb16_32_wrapper(AV_PIX_FMT_BGR555BE, bgr15be, 0, 0, 0, 0, 0x001F, 0x03E0, 0x7C00, 10, 5, 0, RGB2YUV_SHIFT + 7) +rgb16_32_wrapper(AV_PIX_FMT_BGR444BE, bgr12be, 0, 0, 0, 0, 0x000F, 0x00F0, 0x0F00, 8, 4, 0, RGB2YUV_SHIFT + 4) +rgb16_32_wrapper(AV_PIX_FMT_RGB565BE, rgb16be, 0, 0, 0, 0, 0xF800, 0x07E0, 0x001F, 0, 5, 11, RGB2YUV_SHIFT + 8) +rgb16_32_wrapper(AV_PIX_FMT_RGB555BE, rgb15be, 0, 0, 0, 0, 0x7C00, 0x03E0, 0x001F, 0, 5, 10, RGB2YUV_SHIFT + 7) +rgb16_32_wrapper(AV_PIX_FMT_RGB444BE, rgb12be, 0, 0, 0, 0, 0x0F00, 0x00F0, 0x000F, 0, 4, 8, RGB2YUV_SHIFT + 4) static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV, const uint8_t *gsrc, const uint8_t *bsrc, const uint8_t *rsrc, @@ -864,250 +864,250 @@ static void planar_rgb16be_to_uv(uint8_t *dstU, uint8_t *dstV, av_cold void ff_sws_init_input_funcs(SwsContext *c) { - enum PixelFormat srcFormat = c->srcFormat; + enum AVPixelFormat srcFormat = c->srcFormat; c->chrToYV12 = NULL; switch (srcFormat) { - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: c->chrToYV12 = yuy2ToUV_c; break; - case PIX_FMT_UYVY422: + case AV_PIX_FMT_UYVY422: c->chrToYV12 = uyvyToUV_c; break; - case PIX_FMT_NV12: + case AV_PIX_FMT_NV12: c->chrToYV12 = nv12ToUV_c; break; - case PIX_FMT_NV21: + case AV_PIX_FMT_NV21: c->chrToYV12 = nv21ToUV_c; break; - case PIX_FMT_RGB8: - case PIX_FMT_BGR8: - case PIX_FMT_PAL8: - case PIX_FMT_BGR4_BYTE: - case PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_PAL8: + case AV_PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_RGB4_BYTE: c->chrToYV12 = palToUV_c; break; - case PIX_FMT_GBRP9LE: + case AV_PIX_FMT_GBRP9LE: c->readChrPlanar = planar_rgb9le_to_uv; break; - case PIX_FMT_GBRP10LE: + case AV_PIX_FMT_GBRP10LE: c->readChrPlanar = planar_rgb10le_to_uv; break; - case PIX_FMT_GBRP12LE: + case AV_PIX_FMT_GBRP12LE: c->readChrPlanar = planar_rgb12le_to_uv; break; - case PIX_FMT_GBRP14LE: + case AV_PIX_FMT_GBRP14LE: c->readChrPlanar = planar_rgb14le_to_uv; break; - case PIX_FMT_GBRP16LE: + case AV_PIX_FMT_GBRP16LE: c->readChrPlanar = planar_rgb16le_to_uv; break; - case PIX_FMT_GBRP9BE: + case AV_PIX_FMT_GBRP9BE: c->readChrPlanar = planar_rgb9be_to_uv; break; - case PIX_FMT_GBRP10BE: + case AV_PIX_FMT_GBRP10BE: c->readChrPlanar = planar_rgb10be_to_uv; break; - case PIX_FMT_GBRP12BE: + case AV_PIX_FMT_GBRP12BE: c->readChrPlanar = planar_rgb12be_to_uv; break; - case PIX_FMT_GBRP14BE: + case AV_PIX_FMT_GBRP14BE: c->readChrPlanar = planar_rgb14be_to_uv; break; - case PIX_FMT_GBRP16BE: + case AV_PIX_FMT_GBRP16BE: c->readChrPlanar = planar_rgb16be_to_uv; break; - case PIX_FMT_GBRP: + case AV_PIX_FMT_GBRP: c->readChrPlanar = planar_rgb_to_uv; break; #if HAVE_BIGENDIAN - case PIX_FMT_YUV444P9LE: - case PIX_FMT_YUV422P9LE: - case PIX_FMT_YUV420P9LE: - case PIX_FMT_YUV422P10LE: - case PIX_FMT_YUV444P10LE: - case PIX_FMT_YUV420P10LE: - case PIX_FMT_YUV422P12LE: - case PIX_FMT_YUV444P12LE: - case PIX_FMT_YUV420P12LE: - case PIX_FMT_YUV422P14LE: - case PIX_FMT_YUV444P14LE: - case PIX_FMT_YUV420P14LE: - case PIX_FMT_YUV420P16LE: - case PIX_FMT_YUV422P16LE: - case PIX_FMT_YUV444P16LE: + case AV_PIX_FMT_YUV444P9LE: + case AV_PIX_FMT_YUV422P9LE: + case AV_PIX_FMT_YUV420P9LE: + case AV_PIX_FMT_YUV422P10LE: + case AV_PIX_FMT_YUV444P10LE: + case AV_PIX_FMT_YUV420P10LE: + case AV_PIX_FMT_YUV422P12LE: + case AV_PIX_FMT_YUV444P12LE: + case AV_PIX_FMT_YUV420P12LE: + case AV_PIX_FMT_YUV422P14LE: + case AV_PIX_FMT_YUV444P14LE: + case AV_PIX_FMT_YUV420P14LE: + case AV_PIX_FMT_YUV420P16LE: + case AV_PIX_FMT_YUV422P16LE: + case AV_PIX_FMT_YUV444P16LE: c->chrToYV12 = bswap16UV_c; break; #else - case PIX_FMT_YUV444P9BE: - case PIX_FMT_YUV422P9BE: - case PIX_FMT_YUV420P9BE: - case PIX_FMT_YUV444P10BE: - case PIX_FMT_YUV422P10BE: - case PIX_FMT_YUV420P10BE: - case PIX_FMT_YUV444P12BE: - case PIX_FMT_YUV422P12BE: - case PIX_FMT_YUV420P12BE: - case PIX_FMT_YUV444P14BE: - case PIX_FMT_YUV422P14BE: - case PIX_FMT_YUV420P14BE: - case PIX_FMT_YUV420P16BE: - case PIX_FMT_YUV422P16BE: - case PIX_FMT_YUV444P16BE: + case AV_PIX_FMT_YUV444P9BE: + case AV_PIX_FMT_YUV422P9BE: + case AV_PIX_FMT_YUV420P9BE: + case AV_PIX_FMT_YUV444P10BE: + case AV_PIX_FMT_YUV422P10BE: + case AV_PIX_FMT_YUV420P10BE: + case AV_PIX_FMT_YUV444P12BE: + case AV_PIX_FMT_YUV422P12BE: + case AV_PIX_FMT_YUV420P12BE: + case AV_PIX_FMT_YUV444P14BE: + case AV_PIX_FMT_YUV422P14BE: + case AV_PIX_FMT_YUV420P14BE: + case AV_PIX_FMT_YUV420P16BE: + case AV_PIX_FMT_YUV422P16BE: + case AV_PIX_FMT_YUV444P16BE: c->chrToYV12 = bswap16UV_c; break; #endif } if (c->chrSrcHSubSample) { switch (srcFormat) { - case PIX_FMT_RGBA64BE: + case AV_PIX_FMT_RGBA64BE: c->chrToYV12 = rgb64BEToUV_half_c; break; - case PIX_FMT_RGBA64LE: + case AV_PIX_FMT_RGBA64LE: c->chrToYV12 = rgb64LEToUV_half_c; break; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: c->chrToYV12 = rgb48BEToUV_half_c; break; - case PIX_FMT_RGB48LE: + case AV_PIX_FMT_RGB48LE: c->chrToYV12 = rgb48LEToUV_half_c; break; - case PIX_FMT_BGR48BE: + case AV_PIX_FMT_BGR48BE: c->chrToYV12 = bgr48BEToUV_half_c; break; - case PIX_FMT_BGR48LE: + case AV_PIX_FMT_BGR48LE: c->chrToYV12 = bgr48LEToUV_half_c; break; - case PIX_FMT_RGB32: + case AV_PIX_FMT_RGB32: c->chrToYV12 = bgr32ToUV_half_c; break; - case PIX_FMT_RGB32_1: + case AV_PIX_FMT_RGB32_1: c->chrToYV12 = bgr321ToUV_half_c; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: c->chrToYV12 = bgr24ToUV_half_c; break; - case PIX_FMT_BGR565LE: + case AV_PIX_FMT_BGR565LE: c->chrToYV12 = bgr16leToUV_half_c; break; - case PIX_FMT_BGR565BE: + case AV_PIX_FMT_BGR565BE: c->chrToYV12 = bgr16beToUV_half_c; break; - case PIX_FMT_BGR555LE: + case AV_PIX_FMT_BGR555LE: c->chrToYV12 = bgr15leToUV_half_c; break; - case PIX_FMT_BGR555BE: + case AV_PIX_FMT_BGR555BE: c->chrToYV12 = bgr15beToUV_half_c; break; - case PIX_FMT_GBR24P : + case AV_PIX_FMT_GBR24P : c->chrToYV12 = gbr24pToUV_half_c; break; - case PIX_FMT_BGR444LE: + case AV_PIX_FMT_BGR444LE: c->chrToYV12 = bgr12leToUV_half_c; break; - case PIX_FMT_BGR444BE: + case AV_PIX_FMT_BGR444BE: c->chrToYV12 = bgr12beToUV_half_c; break; - case PIX_FMT_BGR32: + case AV_PIX_FMT_BGR32: c->chrToYV12 = rgb32ToUV_half_c; break; - case PIX_FMT_BGR32_1: + case AV_PIX_FMT_BGR32_1: c->chrToYV12 = rgb321ToUV_half_c; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: c->chrToYV12 = rgb24ToUV_half_c; break; - case PIX_FMT_RGB565LE: + case AV_PIX_FMT_RGB565LE: c->chrToYV12 = rgb16leToUV_half_c; break; - case PIX_FMT_RGB565BE: + case AV_PIX_FMT_RGB565BE: c->chrToYV12 = rgb16beToUV_half_c; break; - case PIX_FMT_RGB555LE: + case AV_PIX_FMT_RGB555LE: c->chrToYV12 = rgb15leToUV_half_c; break; - case PIX_FMT_RGB555BE: + case AV_PIX_FMT_RGB555BE: c->chrToYV12 = rgb15beToUV_half_c; break; - case PIX_FMT_RGB444LE: + case AV_PIX_FMT_RGB444LE: c->chrToYV12 = rgb12leToUV_half_c; break; - case PIX_FMT_RGB444BE: + case AV_PIX_FMT_RGB444BE: c->chrToYV12 = rgb12beToUV_half_c; break; } } else { switch (srcFormat) { - case PIX_FMT_RGBA64BE: + case AV_PIX_FMT_RGBA64BE: c->chrToYV12 = rgb64BEToUV_c; break; - case PIX_FMT_RGBA64LE: + case AV_PIX_FMT_RGBA64LE: c->chrToYV12 = rgb64LEToUV_c; break; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: c->chrToYV12 = rgb48BEToUV_c; break; - case PIX_FMT_RGB48LE: + case AV_PIX_FMT_RGB48LE: c->chrToYV12 = rgb48LEToUV_c; break; - case PIX_FMT_BGR48BE: + case AV_PIX_FMT_BGR48BE: c->chrToYV12 = bgr48BEToUV_c; break; - case PIX_FMT_BGR48LE: + case AV_PIX_FMT_BGR48LE: c->chrToYV12 = bgr48LEToUV_c; break; - case PIX_FMT_RGB32: + case AV_PIX_FMT_RGB32: c->chrToYV12 = bgr32ToUV_c; break; - case PIX_FMT_RGB32_1: + case AV_PIX_FMT_RGB32_1: c->chrToYV12 = bgr321ToUV_c; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: c->chrToYV12 = bgr24ToUV_c; break; - case PIX_FMT_BGR565LE: + case AV_PIX_FMT_BGR565LE: c->chrToYV12 = bgr16leToUV_c; break; - case PIX_FMT_BGR565BE: + case AV_PIX_FMT_BGR565BE: c->chrToYV12 = bgr16beToUV_c; break; - case PIX_FMT_BGR555LE: + case AV_PIX_FMT_BGR555LE: c->chrToYV12 = bgr15leToUV_c; break; - case PIX_FMT_BGR555BE: + case AV_PIX_FMT_BGR555BE: c->chrToYV12 = bgr15beToUV_c; break; - case PIX_FMT_BGR444LE: + case AV_PIX_FMT_BGR444LE: c->chrToYV12 = bgr12leToUV_c; break; - case PIX_FMT_BGR444BE: + case AV_PIX_FMT_BGR444BE: c->chrToYV12 = bgr12beToUV_c; break; - case PIX_FMT_BGR32: + case AV_PIX_FMT_BGR32: c->chrToYV12 = rgb32ToUV_c; break; - case PIX_FMT_BGR32_1: + case AV_PIX_FMT_BGR32_1: c->chrToYV12 = rgb321ToUV_c; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: c->chrToYV12 = rgb24ToUV_c; break; - case PIX_FMT_RGB565LE: + case AV_PIX_FMT_RGB565LE: c->chrToYV12 = rgb16leToUV_c; break; - case PIX_FMT_RGB565BE: + case AV_PIX_FMT_RGB565BE: c->chrToYV12 = rgb16beToUV_c; break; - case PIX_FMT_RGB555LE: + case AV_PIX_FMT_RGB555LE: c->chrToYV12 = rgb15leToUV_c; break; - case PIX_FMT_RGB555BE: + case AV_PIX_FMT_RGB555BE: c->chrToYV12 = rgb15beToUV_c; break; - case PIX_FMT_RGB444LE: + case AV_PIX_FMT_RGB444LE: c->chrToYV12 = rgb12leToUV_c; break; - case PIX_FMT_RGB444BE: + case AV_PIX_FMT_RGB444BE: c->chrToYV12 = rgb12beToUV_c; break; } @@ -1116,187 +1116,187 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c) c->lumToYV12 = NULL; c->alpToYV12 = NULL; switch (srcFormat) { - case PIX_FMT_GBRP9LE: + case AV_PIX_FMT_GBRP9LE: c->readLumPlanar = planar_rgb9le_to_y; break; - case PIX_FMT_GBRP10LE: + case AV_PIX_FMT_GBRP10LE: c->readLumPlanar = planar_rgb10le_to_y; break; - case PIX_FMT_GBRP12LE: + case AV_PIX_FMT_GBRP12LE: c->readLumPlanar = planar_rgb12le_to_y; break; - case PIX_FMT_GBRP14LE: + case AV_PIX_FMT_GBRP14LE: c->readLumPlanar = planar_rgb14le_to_y; break; - case PIX_FMT_GBRP16LE: + case AV_PIX_FMT_GBRP16LE: c->readLumPlanar = planar_rgb16le_to_y; break; - case PIX_FMT_GBRP9BE: + case AV_PIX_FMT_GBRP9BE: c->readLumPlanar = planar_rgb9be_to_y; break; - case PIX_FMT_GBRP10BE: + case AV_PIX_FMT_GBRP10BE: c->readLumPlanar = planar_rgb10be_to_y; break; - case PIX_FMT_GBRP12BE: + case AV_PIX_FMT_GBRP12BE: c->readLumPlanar = planar_rgb12be_to_y; break; - case PIX_FMT_GBRP14BE: + case AV_PIX_FMT_GBRP14BE: c->readLumPlanar = planar_rgb14be_to_y; break; - case PIX_FMT_GBRP16BE: + case AV_PIX_FMT_GBRP16BE: c->readLumPlanar = planar_rgb16be_to_y; break; - case PIX_FMT_GBRP: + case AV_PIX_FMT_GBRP: c->readLumPlanar = planar_rgb_to_y; break; #if HAVE_BIGENDIAN - case PIX_FMT_YUV444P9LE: - case PIX_FMT_YUV422P9LE: - case PIX_FMT_YUV420P9LE: - case PIX_FMT_YUV444P10LE: - case PIX_FMT_YUV422P10LE: - case PIX_FMT_YUV420P10LE: - case PIX_FMT_YUV444P12LE: - case PIX_FMT_YUV422P12LE: - case PIX_FMT_YUV420P12LE: - case PIX_FMT_YUV444P14LE: - case PIX_FMT_YUV422P14LE: - case PIX_FMT_YUV420P14LE: - case PIX_FMT_YUV420P16LE: - case PIX_FMT_YUV422P16LE: - case PIX_FMT_YUV444P16LE: - case PIX_FMT_GRAY16LE: + case AV_PIX_FMT_YUV444P9LE: + case AV_PIX_FMT_YUV422P9LE: + case AV_PIX_FMT_YUV420P9LE: + case AV_PIX_FMT_YUV444P10LE: + case AV_PIX_FMT_YUV422P10LE: + case AV_PIX_FMT_YUV420P10LE: + case AV_PIX_FMT_YUV444P12LE: + case AV_PIX_FMT_YUV422P12LE: + case AV_PIX_FMT_YUV420P12LE: + case AV_PIX_FMT_YUV444P14LE: + case AV_PIX_FMT_YUV422P14LE: + case AV_PIX_FMT_YUV420P14LE: + case AV_PIX_FMT_YUV420P16LE: + case AV_PIX_FMT_YUV422P16LE: + case AV_PIX_FMT_YUV444P16LE: + case AV_PIX_FMT_GRAY16LE: c->lumToYV12 = bswap16Y_c; break; #else - case PIX_FMT_YUV444P9BE: - case PIX_FMT_YUV422P9BE: - case PIX_FMT_YUV420P9BE: - case PIX_FMT_YUV444P10BE: - case PIX_FMT_YUV422P10BE: - case PIX_FMT_YUV420P10BE: - case PIX_FMT_YUV444P12BE: - case PIX_FMT_YUV422P12BE: - case PIX_FMT_YUV420P12BE: - case PIX_FMT_YUV444P14BE: - case PIX_FMT_YUV422P14BE: - case PIX_FMT_YUV420P14BE: - case PIX_FMT_YUV420P16BE: - case PIX_FMT_YUV422P16BE: - case PIX_FMT_YUV444P16BE: - case PIX_FMT_GRAY16BE: + case AV_PIX_FMT_YUV444P9BE: + case AV_PIX_FMT_YUV422P9BE: + case AV_PIX_FMT_YUV420P9BE: + case AV_PIX_FMT_YUV444P10BE: + case AV_PIX_FMT_YUV422P10BE: + case AV_PIX_FMT_YUV420P10BE: + case AV_PIX_FMT_YUV444P12BE: + case AV_PIX_FMT_YUV422P12BE: + case AV_PIX_FMT_YUV420P12BE: + case AV_PIX_FMT_YUV444P14BE: + case AV_PIX_FMT_YUV422P14BE: + case AV_PIX_FMT_YUV420P14BE: + case AV_PIX_FMT_YUV420P16BE: + case AV_PIX_FMT_YUV422P16BE: + case AV_PIX_FMT_YUV444P16BE: + case AV_PIX_FMT_GRAY16BE: c->lumToYV12 = bswap16Y_c; break; #endif - case PIX_FMT_YUYV422: - case PIX_FMT_Y400A: + case AV_PIX_FMT_YUYV422: + case AV_PIX_FMT_Y400A: c->lumToYV12 = yuy2ToY_c; break; - case PIX_FMT_UYVY422: + case AV_PIX_FMT_UYVY422: c->lumToYV12 = uyvyToY_c; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: c->lumToYV12 = bgr24ToY_c; break; - case PIX_FMT_BGR565LE: + case AV_PIX_FMT_BGR565LE: c->lumToYV12 = bgr16leToY_c; break; - case PIX_FMT_BGR565BE: + case AV_PIX_FMT_BGR565BE: c->lumToYV12 = bgr16beToY_c; break; - case PIX_FMT_BGR555LE: + case AV_PIX_FMT_BGR555LE: c->lumToYV12 = bgr15leToY_c; break; - case PIX_FMT_BGR555BE: + case AV_PIX_FMT_BGR555BE: c->lumToYV12 = bgr15beToY_c; break; - case PIX_FMT_BGR444LE: + case AV_PIX_FMT_BGR444LE: c->lumToYV12 = bgr12leToY_c; break; - case PIX_FMT_BGR444BE: + case AV_PIX_FMT_BGR444BE: c->lumToYV12 = bgr12beToY_c; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: c->lumToYV12 = rgb24ToY_c; break; - case PIX_FMT_RGB565LE: + case AV_PIX_FMT_RGB565LE: c->lumToYV12 = rgb16leToY_c; break; - case PIX_FMT_RGB565BE: + case AV_PIX_FMT_RGB565BE: c->lumToYV12 = rgb16beToY_c; break; - case PIX_FMT_RGB555LE: + case AV_PIX_FMT_RGB555LE: c->lumToYV12 = rgb15leToY_c; break; - case PIX_FMT_RGB555BE: + case AV_PIX_FMT_RGB555BE: c->lumToYV12 = rgb15beToY_c; break; - case PIX_FMT_RGB444LE: + case AV_PIX_FMT_RGB444LE: c->lumToYV12 = rgb12leToY_c; break; - case PIX_FMT_RGB444BE: + case AV_PIX_FMT_RGB444BE: c->lumToYV12 = rgb12beToY_c; break; - case PIX_FMT_RGB8: - case PIX_FMT_BGR8: - case PIX_FMT_PAL8: - case PIX_FMT_BGR4_BYTE: - case PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: + case AV_PIX_FMT_PAL8: + case AV_PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_RGB4_BYTE: c->lumToYV12 = palToY_c; break; - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOBLACK: c->lumToYV12 = monoblack2Y_c; break; - case PIX_FMT_MONOWHITE: + case AV_PIX_FMT_MONOWHITE: c->lumToYV12 = monowhite2Y_c; break; - case PIX_FMT_RGB32: + case AV_PIX_FMT_RGB32: c->lumToYV12 = bgr32ToY_c; break; - case PIX_FMT_RGB32_1: + case AV_PIX_FMT_RGB32_1: c->lumToYV12 = bgr321ToY_c; break; - case PIX_FMT_BGR32: + case AV_PIX_FMT_BGR32: c->lumToYV12 = rgb32ToY_c; break; - case PIX_FMT_BGR32_1: + case AV_PIX_FMT_BGR32_1: c->lumToYV12 = rgb321ToY_c; break; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: c->lumToYV12 = rgb48BEToY_c; break; - case PIX_FMT_RGB48LE: + case AV_PIX_FMT_RGB48LE: c->lumToYV12 = rgb48LEToY_c; break; - case PIX_FMT_BGR48BE: + case AV_PIX_FMT_BGR48BE: c->lumToYV12 = bgr48BEToY_c; break; - case PIX_FMT_BGR48LE: + case AV_PIX_FMT_BGR48LE: c->lumToYV12 = bgr48LEToY_c; break; - case PIX_FMT_RGBA64BE: + case AV_PIX_FMT_RGBA64BE: c->lumToYV12 = rgb64BEToY_c; break; - case PIX_FMT_RGBA64LE: + case AV_PIX_FMT_RGBA64LE: c->lumToYV12 = rgb64LEToY_c; break; } if (c->alpPixBuf) { switch (srcFormat) { - case PIX_FMT_RGBA64LE: - case PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64ToA_c; break; - case PIX_FMT_BGRA: - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA64LE: + case AV_PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64ToA_c; break; + case AV_PIX_FMT_BGRA: + case AV_PIX_FMT_RGBA: c->alpToYV12 = rgbaToA_c; break; - case PIX_FMT_ABGR: - case PIX_FMT_ARGB: + case AV_PIX_FMT_ABGR: + case AV_PIX_FMT_ARGB: c->alpToYV12 = abgrToA_c; break; - case PIX_FMT_Y400A: + case AV_PIX_FMT_Y400A: c->alpToYV12 = uyvyToY_c; break; - case PIX_FMT_PAL8 : + case AV_PIX_FMT_PAL8 : c->alpToYV12 = palToA_c; break; } diff --git a/libswscale/options.c b/libswscale/options.c index 02047509d0..9cd4fc0607 100644 --- a/libswscale/options.c +++ b/libswscale/options.c @@ -56,8 +56,8 @@ static const AVOption options[] = { { "srch", "source height", OFFSET(srcH), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE }, { "dstw", "destination width", OFFSET(dstW), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE }, { "dsth", "destination height", OFFSET(dstH), AV_OPT_TYPE_INT, { .i64 = 16 }, 1, INT_MAX, VE }, - { "src_format", "source format", OFFSET(srcFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, PIX_FMT_NB - 1, VE }, - { "dst_format", "destination format", OFFSET(dstFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, PIX_FMT_NB - 1, VE }, + { "src_format", "source format", OFFSET(srcFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, AV_PIX_FMT_NB - 1, VE }, + { "dst_format", "destination format", OFFSET(dstFormat), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, AV_PIX_FMT_NB - 1, VE }, { "src_range", "source range", OFFSET(srcRange), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, 1, VE }, { "dst_range", "destination range", OFFSET(dstRange), AV_OPT_TYPE_INT, { .i64 = DEFAULT }, 0, 1, VE }, { "param0", "scaler param 0", OFFSET(param[0]), AV_OPT_TYPE_DOUBLE, { .dbl = SWS_PARAM_DEFAULT }, INT_MIN, INT_MAX, VE }, diff --git a/libswscale/output.c b/libswscale/output.c index 5039629b79..15591ae285 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -276,11 +276,11 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS const int16_t **chrUSrc, const int16_t **chrVSrc, uint8_t *dest, int chrDstW) { - enum PixelFormat dstFormat = c->dstFormat; + enum AVPixelFormat dstFormat = c->dstFormat; const uint8_t *chrDither = c->chrDither8; int i; - if (dstFormat == PIX_FMT_NV12) + if (dstFormat == AV_PIX_FMT_NV12) for (i=0; i<chrDstW; i++) { int u = chrDither[i & 7] << 12; int v = chrDither[(i + 3) & 7] << 12; @@ -312,7 +312,7 @@ static void yuv2nv12cX_c(SwsContext *c, const int16_t *chrFilter, int chrFilterS acc <<= 1; \ acc |= (val) >= (128 + 110) #define output_pixel(pos, acc) \ - if (target == PIX_FMT_MONOBLACK) { \ + if (target == AV_PIX_FMT_MONOBLACK) { \ pos = acc; \ } else { \ pos = ~acc; \ @@ -324,7 +324,7 @@ yuv2mono_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, - int y, enum PixelFormat target) + int y, enum AVPixelFormat target) { const uint8_t * const d128=dither_8x8_220[y&7]; int i; @@ -362,7 +362,7 @@ yuv2mono_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, - enum PixelFormat target) + enum AVPixelFormat target) { const int16_t *buf0 = buf[0], *buf1 = buf[1]; const uint8_t * const d128 = dither_8x8_220[y & 7]; @@ -397,7 +397,7 @@ static av_always_inline void yuv2mono_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, - int uvalpha, int y, enum PixelFormat target) + int uvalpha, int y, enum AVPixelFormat target) { const uint8_t * const d128 = dither_8x8_220[y & 7]; int i; @@ -453,11 +453,11 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \ y, fmt); \ } -YUV2PACKEDWRAPPER(yuv2mono,, white, PIX_FMT_MONOWHITE) -YUV2PACKEDWRAPPER(yuv2mono,, black, PIX_FMT_MONOBLACK) +YUV2PACKEDWRAPPER(yuv2mono,, white, AV_PIX_FMT_MONOWHITE) +YUV2PACKEDWRAPPER(yuv2mono,, black, AV_PIX_FMT_MONOBLACK) #define output_pixels(pos, Y1, U, Y2, V) \ - if (target == PIX_FMT_YUYV422) { \ + if (target == AV_PIX_FMT_YUYV422) { \ dest[pos + 0] = Y1; \ dest[pos + 1] = U; \ dest[pos + 2] = Y2; \ @@ -475,7 +475,7 @@ yuv2422_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, - int y, enum PixelFormat target) + int y, enum AVPixelFormat target) { int i; @@ -513,7 +513,7 @@ yuv2422_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, - enum PixelFormat target) + enum AVPixelFormat target) { const int16_t *buf0 = buf[0], *buf1 = buf[1], *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], @@ -543,7 +543,7 @@ static av_always_inline void yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, - int uvalpha, int y, enum PixelFormat target) + int uvalpha, int y, enum AVPixelFormat target) { const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; int i; @@ -596,11 +596,11 @@ yuv2422_1_c_template(SwsContext *c, const int16_t *buf0, #undef output_pixels -YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, PIX_FMT_YUYV422) -YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, PIX_FMT_UYVY422) +YUV2PACKEDWRAPPER(yuv2, 422, yuyv422, AV_PIX_FMT_YUYV422) +YUV2PACKEDWRAPPER(yuv2, 422, uyvy422, AV_PIX_FMT_UYVY422) -#define R_B ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? R : B) -#define B_R ((target == PIX_FMT_RGB48LE || target == PIX_FMT_RGB48BE) ? B : R) +#define R_B ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? R : B) +#define B_R ((target == AV_PIX_FMT_RGB48LE || target == AV_PIX_FMT_RGB48BE) ? B : R) #define output_pixel(pos, val) \ if (isBE(target)) { \ AV_WB16(pos, val); \ @@ -614,7 +614,7 @@ yuv2rgb48_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t *chrFilter, const int32_t **chrUSrc, const int32_t **chrVSrc, int chrFilterSize, const int32_t **alpSrc, uint16_t *dest, int dstW, - int y, enum PixelFormat target) + int y, enum AVPixelFormat target) { int i; @@ -672,7 +672,7 @@ yuv2rgb48_2_c_template(SwsContext *c, const int32_t *buf[2], const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf[2], uint16_t *dest, int dstW, int yalpha, int uvalpha, int y, - enum PixelFormat target) + enum AVPixelFormat target) { const int32_t *buf0 = buf[0], *buf1 = buf[1], *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], @@ -713,7 +713,7 @@ static av_always_inline void yuv2rgb48_1_c_template(SwsContext *c, const int32_t *buf0, const int32_t *ubuf[2], const int32_t *vbuf[2], const int32_t *abuf0, uint16_t *dest, int dstW, - int uvalpha, int y, enum PixelFormat target) + int uvalpha, int y, enum AVPixelFormat target) { const int32_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; int i; @@ -826,10 +826,10 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *_buf0, \ dstW, uvalpha, y, fmt); \ } -YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, PIX_FMT_RGB48BE) -YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, PIX_FMT_RGB48LE) -YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, PIX_FMT_BGR48BE) -YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, PIX_FMT_BGR48LE) +YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48be, AV_PIX_FMT_RGB48BE) +YUV2PACKED16WRAPPER(yuv2, rgb48, rgb48le, AV_PIX_FMT_RGB48LE) +YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48be, AV_PIX_FMT_BGR48BE) +YUV2PACKED16WRAPPER(yuv2, rgb48, bgr48le, AV_PIX_FMT_BGR48LE) /* * Write out 2 RGB pixels in the target pixel format. This function takes a @@ -843,23 +843,23 @@ static av_always_inline void yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, unsigned A1, unsigned A2, const void *_r, const void *_g, const void *_b, int y, - enum PixelFormat target, int hasAlpha) + enum AVPixelFormat target, int hasAlpha) { - if (target == PIX_FMT_ARGB || target == PIX_FMT_RGBA || - target == PIX_FMT_ABGR || target == PIX_FMT_BGRA) { + if (target == AV_PIX_FMT_ARGB || target == AV_PIX_FMT_RGBA || + target == AV_PIX_FMT_ABGR || target == AV_PIX_FMT_BGRA) { uint32_t *dest = (uint32_t *) _dest; const uint32_t *r = (const uint32_t *) _r; const uint32_t *g = (const uint32_t *) _g; const uint32_t *b = (const uint32_t *) _b; #if CONFIG_SMALL - int sh = hasAlpha ? ((target == PIX_FMT_RGB32_1 || target == PIX_FMT_BGR32_1) ? 0 : 24) : 0; + int sh = hasAlpha ? ((target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24) : 0; dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (hasAlpha ? A1 << sh : 0); dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (hasAlpha ? A2 << sh : 0); #else if (hasAlpha) { - int sh = (target == PIX_FMT_RGB32_1 || target == PIX_FMT_BGR32_1) ? 0 : 24; + int sh = (target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24; dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (A1 << sh); dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (A2 << sh); @@ -868,14 +868,14 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2]; } #endif - } else if (target == PIX_FMT_RGB24 || target == PIX_FMT_BGR24) { + } else if (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) { uint8_t *dest = (uint8_t *) _dest; const uint8_t *r = (const uint8_t *) _r; const uint8_t *g = (const uint8_t *) _g; const uint8_t *b = (const uint8_t *) _b; -#define r_b ((target == PIX_FMT_RGB24) ? r : b) -#define b_r ((target == PIX_FMT_RGB24) ? b : r) +#define r_b ((target == AV_PIX_FMT_RGB24) ? r : b) +#define b_r ((target == AV_PIX_FMT_RGB24) ? b : r) dest[i * 6 + 0] = r_b[Y1]; dest[i * 6 + 1] = g[Y1]; @@ -885,23 +885,23 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, dest[i * 6 + 5] = b_r[Y2]; #undef r_b #undef b_r - } else if (target == PIX_FMT_RGB565 || target == PIX_FMT_BGR565 || - target == PIX_FMT_RGB555 || target == PIX_FMT_BGR555 || - target == PIX_FMT_RGB444 || target == PIX_FMT_BGR444) { + } else if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565 || + target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555 || + target == AV_PIX_FMT_RGB444 || target == AV_PIX_FMT_BGR444) { uint16_t *dest = (uint16_t *) _dest; const uint16_t *r = (const uint16_t *) _r; const uint16_t *g = (const uint16_t *) _g; const uint16_t *b = (const uint16_t *) _b; int dr1, dg1, db1, dr2, dg2, db2; - if (target == PIX_FMT_RGB565 || target == PIX_FMT_BGR565) { + if (target == AV_PIX_FMT_RGB565 || target == AV_PIX_FMT_BGR565) { dr1 = dither_2x2_8[ y & 1 ][0]; dg1 = dither_2x2_4[ y & 1 ][0]; db1 = dither_2x2_8[(y & 1) ^ 1][0]; dr2 = dither_2x2_8[ y & 1 ][1]; dg2 = dither_2x2_4[ y & 1 ][1]; db2 = dither_2x2_8[(y & 1) ^ 1][1]; - } else if (target == PIX_FMT_RGB555 || target == PIX_FMT_BGR555) { + } else if (target == AV_PIX_FMT_RGB555 || target == AV_PIX_FMT_BGR555) { dr1 = dither_2x2_8[ y & 1 ][0]; dg1 = dither_2x2_8[ y & 1 ][1]; db1 = dither_2x2_8[(y & 1) ^ 1][0]; @@ -926,7 +926,7 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, const uint8_t *b = (const uint8_t *) _b; int dr1, dg1, db1, dr2, dg2, db2; - if (target == PIX_FMT_RGB8 || target == PIX_FMT_BGR8) { + if (target == AV_PIX_FMT_RGB8 || target == AV_PIX_FMT_BGR8) { const uint8_t * const d64 = dither_8x8_73[y & 7]; const uint8_t * const d32 = dither_8x8_32[y & 7]; dr1 = dg1 = d32[(i * 2 + 0) & 7]; @@ -942,7 +942,7 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2, dg2 = d64[(i * 2 + 1) & 7]; } - if (target == PIX_FMT_RGB4 || target == PIX_FMT_BGR4) { + if (target == AV_PIX_FMT_RGB4 || target == AV_PIX_FMT_BGR4) { dest[i] = r[Y1 + dr1] + g[Y1 + dg1] + b[Y1 + db1] + ((r[Y2 + dr2] + g[Y2 + dg2] + b[Y2 + db2]) << 4); } else { @@ -958,7 +958,7 @@ yuv2rgb_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, int dstW, - int y, enum PixelFormat target, int hasAlpha) + int y, enum AVPixelFormat target, int hasAlpha) { int i; @@ -1011,7 +1011,7 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2], const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf[2], uint8_t *dest, int dstW, int yalpha, int uvalpha, int y, - enum PixelFormat target, int hasAlpha) + enum AVPixelFormat target, int hasAlpha) { const int16_t *buf0 = buf[0], *buf1 = buf[1], *ubuf0 = ubuf[0], *ubuf1 = ubuf[1], @@ -1048,7 +1048,7 @@ static av_always_inline void yuv2rgb_1_c_template(SwsContext *c, const int16_t *buf0, const int16_t *ubuf[2], const int16_t *vbuf[2], const int16_t *abuf0, uint8_t *dest, int dstW, - int uvalpha, int y, enum PixelFormat target, + int uvalpha, int y, enum AVPixelFormat target, int hasAlpha) { const int16_t *ubuf0 = ubuf[0], *vbuf0 = vbuf[0]; @@ -1133,24 +1133,24 @@ static void name ## ext ## _1_c(SwsContext *c, const int16_t *buf0, \ } #if CONFIG_SMALL -YUV2RGBWRAPPER(yuv2rgb,, 32_1, PIX_FMT_RGB32_1, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) -YUV2RGBWRAPPER(yuv2rgb,, 32, PIX_FMT_RGB32, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) +YUV2RGBWRAPPER(yuv2rgb,, 32_1, AV_PIX_FMT_RGB32_1, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) +YUV2RGBWRAPPER(yuv2rgb,, 32, AV_PIX_FMT_RGB32, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) #else #if CONFIG_SWSCALE_ALPHA -YUV2RGBWRAPPER(yuv2rgb,, a32_1, PIX_FMT_RGB32_1, 1) -YUV2RGBWRAPPER(yuv2rgb,, a32, PIX_FMT_RGB32, 1) +YUV2RGBWRAPPER(yuv2rgb,, a32_1, AV_PIX_FMT_RGB32_1, 1) +YUV2RGBWRAPPER(yuv2rgb,, a32, AV_PIX_FMT_RGB32, 1) #endif -YUV2RGBWRAPPER(yuv2rgb,, x32_1, PIX_FMT_RGB32_1, 0) -YUV2RGBWRAPPER(yuv2rgb,, x32, PIX_FMT_RGB32, 0) +YUV2RGBWRAPPER(yuv2rgb,, x32_1, AV_PIX_FMT_RGB32_1, 0) +YUV2RGBWRAPPER(yuv2rgb,, x32, AV_PIX_FMT_RGB32, 0) #endif -YUV2RGBWRAPPER(yuv2, rgb, rgb24, PIX_FMT_RGB24, 0) -YUV2RGBWRAPPER(yuv2, rgb, bgr24, PIX_FMT_BGR24, 0) -YUV2RGBWRAPPER(yuv2rgb,, 16, PIX_FMT_RGB565, 0) -YUV2RGBWRAPPER(yuv2rgb,, 15, PIX_FMT_RGB555, 0) -YUV2RGBWRAPPER(yuv2rgb,, 12, PIX_FMT_RGB444, 0) -YUV2RGBWRAPPER(yuv2rgb,, 8, PIX_FMT_RGB8, 0) -YUV2RGBWRAPPER(yuv2rgb,, 4, PIX_FMT_RGB4, 0) -YUV2RGBWRAPPER(yuv2rgb,, 4b, PIX_FMT_RGB4_BYTE, 0) +YUV2RGBWRAPPER(yuv2, rgb, rgb24, AV_PIX_FMT_RGB24, 0) +YUV2RGBWRAPPER(yuv2, rgb, bgr24, AV_PIX_FMT_BGR24, 0) +YUV2RGBWRAPPER(yuv2rgb,, 16, AV_PIX_FMT_RGB565, 0) +YUV2RGBWRAPPER(yuv2rgb,, 15, AV_PIX_FMT_RGB555, 0) +YUV2RGBWRAPPER(yuv2rgb,, 12, AV_PIX_FMT_RGB444, 0) +YUV2RGBWRAPPER(yuv2rgb,, 8, AV_PIX_FMT_RGB8, 0) +YUV2RGBWRAPPER(yuv2rgb,, 4, AV_PIX_FMT_RGB4, 0) +YUV2RGBWRAPPER(yuv2rgb,, 4b, AV_PIX_FMT_RGB4_BYTE, 0) static av_always_inline void yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, @@ -1158,10 +1158,10 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, const int16_t *chrFilter, const int16_t **chrUSrc, const int16_t **chrVSrc, int chrFilterSize, const int16_t **alpSrc, uint8_t *dest, - int dstW, int y, enum PixelFormat target, int hasAlpha) + int dstW, int y, enum AVPixelFormat target, int hasAlpha) { int i; - int step = (target == PIX_FMT_RGB24 || target == PIX_FMT_BGR24) ? 3 : 4; + int step = (target == AV_PIX_FMT_RGB24 || target == AV_PIX_FMT_BGR24) ? 3 : 4; for (i = 0; i < dstW; i++) { int j; @@ -1202,35 +1202,35 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, } switch(target) { - case PIX_FMT_ARGB: + case AV_PIX_FMT_ARGB: dest[0] = hasAlpha ? A : 255; dest[1] = R >> 22; dest[2] = G >> 22; dest[3] = B >> 22; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: dest[0] = R >> 22; dest[1] = G >> 22; dest[2] = B >> 22; break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: dest[0] = R >> 22; dest[1] = G >> 22; dest[2] = B >> 22; dest[3] = hasAlpha ? A : 255; break; - case PIX_FMT_ABGR: + case AV_PIX_FMT_ABGR: dest[0] = hasAlpha ? A : 255; dest[1] = B >> 22; dest[2] = G >> 22; dest[3] = R >> 22; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: dest[0] = B >> 22; dest[1] = G >> 22; dest[2] = R >> 22; break; - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: dest[0] = B >> 22; dest[1] = G >> 22; dest[2] = R >> 22; @@ -1242,24 +1242,24 @@ yuv2rgb_full_X_c_template(SwsContext *c, const int16_t *lumFilter, } #if CONFIG_SMALL -YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) -YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) -YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) -YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) +YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) +YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) +YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) +YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB, CONFIG_SWSCALE_ALPHA && c->alpPixBuf) #else #if CONFIG_SWSCALE_ALPHA -YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, PIX_FMT_BGRA, 1) -YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, PIX_FMT_ABGR, 1) -YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, PIX_FMT_RGBA, 1) -YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, PIX_FMT_ARGB, 1) +YUV2RGBWRAPPERX(yuv2, rgb_full, bgra32_full, AV_PIX_FMT_BGRA, 1) +YUV2RGBWRAPPERX(yuv2, rgb_full, abgr32_full, AV_PIX_FMT_ABGR, 1) +YUV2RGBWRAPPERX(yuv2, rgb_full, rgba32_full, AV_PIX_FMT_RGBA, 1) +YUV2RGBWRAPPERX(yuv2, rgb_full, argb32_full, AV_PIX_FMT_ARGB, 1) #endif -YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, PIX_FMT_BGRA, 0) -YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, PIX_FMT_ABGR, 0) -YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, PIX_FMT_RGBA, 0) -YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, PIX_FMT_ARGB, 0) +YUV2RGBWRAPPERX(yuv2, rgb_full, bgrx32_full, AV_PIX_FMT_BGRA, 0) +YUV2RGBWRAPPERX(yuv2, rgb_full, xbgr32_full, AV_PIX_FMT_ABGR, 0) +YUV2RGBWRAPPERX(yuv2, rgb_full, rgbx32_full, AV_PIX_FMT_RGBA, 0) +YUV2RGBWRAPPERX(yuv2, rgb_full, xrgb32_full, AV_PIX_FMT_ARGB, 0) #endif -YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full, PIX_FMT_BGR24, 0) -YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full, PIX_FMT_RGB24, 0) +YUV2RGBWRAPPERX(yuv2, rgb_full, bgr24_full, AV_PIX_FMT_BGR24, 0) +YUV2RGBWRAPPERX(yuv2, rgb_full, rgb24_full, AV_PIX_FMT_RGB24, 0) av_cold void ff_sws_init_output_funcs(SwsContext *c, yuv2planar1_fn *yuv2plane1, @@ -1269,7 +1269,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, yuv2packed2_fn *yuv2packed2, yuv2packedX_fn *yuv2packedX) { - enum PixelFormat dstFormat = c->dstFormat; + enum AVPixelFormat dstFormat = c->dstFormat; if (is16BPS(dstFormat)) { *yuv2planeX = isBE(dstFormat) ? yuv2planeX_16BE_c : yuv2planeX_16LE_c; @@ -1285,13 +1285,13 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } else { *yuv2plane1 = yuv2plane1_8_c; *yuv2planeX = yuv2planeX_8_c; - if (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21) + if (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21) *yuv2nv12cX = yuv2nv12cX_c; } if(c->flags & SWS_FULL_CHR_H_INT) { switch (dstFormat) { - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: #if CONFIG_SMALL *yuv2packedX = yuv2rgba32_full_X_c; #else @@ -1305,7 +1305,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } #endif /* !CONFIG_SMALL */ break; - case PIX_FMT_ARGB: + case AV_PIX_FMT_ARGB: #if CONFIG_SMALL *yuv2packedX = yuv2argb32_full_X_c; #else @@ -1319,7 +1319,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } #endif /* !CONFIG_SMALL */ break; - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: #if CONFIG_SMALL *yuv2packedX = yuv2bgra32_full_X_c; #else @@ -1333,7 +1333,7 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } #endif /* !CONFIG_SMALL */ break; - case PIX_FMT_ABGR: + case AV_PIX_FMT_ABGR: #if CONFIG_SMALL *yuv2packedX = yuv2abgr32_full_X_c; #else @@ -1347,10 +1347,10 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } #endif /* !CONFIG_SMALL */ break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: *yuv2packedX = yuv2rgb24_full_X_c; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: *yuv2packedX = yuv2bgr24_full_X_c; break; } @@ -1359,28 +1359,28 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } else { YUV_PACKED: switch (dstFormat) { - case PIX_FMT_RGB48LE: + case AV_PIX_FMT_RGB48LE: *yuv2packed1 = yuv2rgb48le_1_c; *yuv2packed2 = yuv2rgb48le_2_c; *yuv2packedX = yuv2rgb48le_X_c; break; - case PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48BE: *yuv2packed1 = yuv2rgb48be_1_c; *yuv2packed2 = yuv2rgb48be_2_c; *yuv2packedX = yuv2rgb48be_X_c; break; - case PIX_FMT_BGR48LE: + case AV_PIX_FMT_BGR48LE: *yuv2packed1 = yuv2bgr48le_1_c; *yuv2packed2 = yuv2bgr48le_2_c; *yuv2packedX = yuv2bgr48le_X_c; break; - case PIX_FMT_BGR48BE: + case AV_PIX_FMT_BGR48BE: *yuv2packed1 = yuv2bgr48be_1_c; *yuv2packed2 = yuv2bgr48be_2_c; *yuv2packedX = yuv2bgr48be_X_c; break; - case PIX_FMT_RGB32: - case PIX_FMT_BGR32: + case AV_PIX_FMT_RGB32: + case AV_PIX_FMT_BGR32: #if CONFIG_SMALL *yuv2packed1 = yuv2rgb32_1_c; *yuv2packed2 = yuv2rgb32_2_c; @@ -1400,8 +1400,8 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } #endif /* !CONFIG_SMALL */ break; - case PIX_FMT_RGB32_1: - case PIX_FMT_BGR32_1: + case AV_PIX_FMT_RGB32_1: + case AV_PIX_FMT_BGR32_1: #if CONFIG_SMALL *yuv2packed1 = yuv2rgb32_1_1_c; *yuv2packed2 = yuv2rgb32_1_2_c; @@ -1421,54 +1421,54 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } #endif /* !CONFIG_SMALL */ break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: *yuv2packed1 = yuv2rgb24_1_c; *yuv2packed2 = yuv2rgb24_2_c; *yuv2packedX = yuv2rgb24_X_c; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: *yuv2packed1 = yuv2bgr24_1_c; *yuv2packed2 = yuv2bgr24_2_c; *yuv2packedX = yuv2bgr24_X_c; break; - case PIX_FMT_RGB565LE: - case PIX_FMT_RGB565BE: - case PIX_FMT_BGR565LE: - case PIX_FMT_BGR565BE: + case AV_PIX_FMT_RGB565LE: + case AV_PIX_FMT_RGB565BE: + case AV_PIX_FMT_BGR565LE: + case AV_PIX_FMT_BGR565BE: *yuv2packed1 = yuv2rgb16_1_c; *yuv2packed2 = yuv2rgb16_2_c; *yuv2packedX = yuv2rgb16_X_c; break; - case PIX_FMT_RGB555LE: - case PIX_FMT_RGB555BE: - case PIX_FMT_BGR555LE: - case PIX_FMT_BGR555BE: + case AV_PIX_FMT_RGB555LE: + case AV_PIX_FMT_RGB555BE: + case AV_PIX_FMT_BGR555LE: + case AV_PIX_FMT_BGR555BE: *yuv2packed1 = yuv2rgb15_1_c; *yuv2packed2 = yuv2rgb15_2_c; *yuv2packedX = yuv2rgb15_X_c; break; - case PIX_FMT_RGB444LE: - case PIX_FMT_RGB444BE: - case PIX_FMT_BGR444LE: - case PIX_FMT_BGR444BE: + case AV_PIX_FMT_RGB444LE: + case AV_PIX_FMT_RGB444BE: + case AV_PIX_FMT_BGR444LE: + case AV_PIX_FMT_BGR444BE: *yuv2packed1 = yuv2rgb12_1_c; *yuv2packed2 = yuv2rgb12_2_c; *yuv2packedX = yuv2rgb12_X_c; break; - case PIX_FMT_RGB8: - case PIX_FMT_BGR8: + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: *yuv2packed1 = yuv2rgb8_1_c; *yuv2packed2 = yuv2rgb8_2_c; *yuv2packedX = yuv2rgb8_X_c; break; - case PIX_FMT_RGB4: - case PIX_FMT_BGR4: + case AV_PIX_FMT_RGB4: + case AV_PIX_FMT_BGR4: *yuv2packed1 = yuv2rgb4_1_c; *yuv2packed2 = yuv2rgb4_2_c; *yuv2packedX = yuv2rgb4_X_c; break; - case PIX_FMT_RGB4_BYTE: - case PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: *yuv2packed1 = yuv2rgb4b_1_c; *yuv2packed2 = yuv2rgb4b_2_c; *yuv2packedX = yuv2rgb4b_X_c; @@ -1476,22 +1476,22 @@ av_cold void ff_sws_init_output_funcs(SwsContext *c, } } switch (dstFormat) { - case PIX_FMT_MONOWHITE: + case AV_PIX_FMT_MONOWHITE: *yuv2packed1 = yuv2monowhite_1_c; *yuv2packed2 = yuv2monowhite_2_c; *yuv2packedX = yuv2monowhite_X_c; break; - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOBLACK: *yuv2packed1 = yuv2monoblack_1_c; *yuv2packed2 = yuv2monoblack_2_c; *yuv2packedX = yuv2monoblack_X_c; break; - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: *yuv2packed1 = yuv2yuyv422_1_c; *yuv2packed2 = yuv2yuyv422_2_c; *yuv2packedX = yuv2yuyv422_X_c; break; - case PIX_FMT_UYVY422: + case AV_PIX_FMT_UYVY422: *yuv2packed1 = yuv2uyvy422_1_c; *yuv2packed2 = yuv2uyvy422_2_c; *yuv2packedX = yuv2uyvy422_X_c; diff --git a/libswscale/ppc/swscale_altivec.c b/libswscale/ppc/swscale_altivec.c index e013f03c3b..9ca2868cc8 100644 --- a/libswscale/ppc/swscale_altivec.c +++ b/libswscale/ppc/swscale_altivec.c @@ -287,7 +287,7 @@ static void hScale_altivec_real(SwsContext *c, int16_t *dst, int dstW, av_cold void ff_sws_init_swScale_altivec(SwsContext *c) { - enum PixelFormat dstFormat = c->dstFormat; + enum AVPixelFormat dstFormat = c->dstFormat; if (!(av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC)) return; @@ -296,7 +296,7 @@ av_cold void ff_sws_init_swScale_altivec(SwsContext *c) c->hyScale = c->hcScale = hScale_altivec_real; } if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && - dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 && + dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 && !c->alpPixBuf) { c->yuv2planeX = yuv2planeX_altivec; } @@ -305,22 +305,22 @@ av_cold void ff_sws_init_swScale_altivec(SwsContext *c) * match what's found in the body of ff_yuv2packedX_altivec() */ if (!(c->flags & (SWS_BITEXACT | SWS_FULL_CHR_H_INT)) && !c->alpPixBuf) { switch (c->dstFormat) { - case PIX_FMT_ABGR: + case AV_PIX_FMT_ABGR: c->yuv2packedX = ff_yuv2abgr_X_altivec; break; - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: c->yuv2packedX = ff_yuv2bgra_X_altivec; break; - case PIX_FMT_ARGB: + case AV_PIX_FMT_ARGB: c->yuv2packedX = ff_yuv2argb_X_altivec; break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: c->yuv2packedX = ff_yuv2rgba_X_altivec; break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: c->yuv2packedX = ff_yuv2bgr24_X_altivec; break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: c->yuv2packedX = ff_yuv2rgb24_X_altivec; break; } diff --git a/libswscale/ppc/yuv2rgb_altivec.c b/libswscale/ppc/yuv2rgb_altivec.c index ade134d779..a8501d9a10 100644 --- a/libswscale/ppc/yuv2rgb_altivec.c +++ b/libswscale/ppc/yuv2rgb_altivec.c @@ -548,41 +548,41 @@ av_cold SwsFunc ff_yuv2rgb_init_altivec(SwsContext *c) return NULL; switch (c->srcFormat) { - case PIX_FMT_YUV410P: - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV410P: + case AV_PIX_FMT_YUV420P: /*case IMGFMT_CLPL: ??? */ - case PIX_FMT_GRAY8: - case PIX_FMT_NV12: - case PIX_FMT_NV21: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_NV12: + case AV_PIX_FMT_NV21: if ((c->srcH & 0x1) != 0) return NULL; switch (c->dstFormat) { - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGB24\n"); return altivec_yuv2_rgb24; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGR24\n"); return altivec_yuv2_bgr24; - case PIX_FMT_ARGB: + case AV_PIX_FMT_ARGB: av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ARGB\n"); return altivec_yuv2_argb; - case PIX_FMT_ABGR: + case AV_PIX_FMT_ABGR: av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space ABGR\n"); return altivec_yuv2_abgr; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space RGBA\n"); return altivec_yuv2_rgba; - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space BGRA\n"); return altivec_yuv2_bgra; default: return NULL; } break; - case PIX_FMT_UYVY422: + case AV_PIX_FMT_UYVY422: switch (c->dstFormat) { - case PIX_FMT_BGR32: + case AV_PIX_FMT_BGR32: av_log(c, AV_LOG_WARNING, "ALTIVEC: Color Space UYVY -> RGB32\n"); return altivec_uyvy_rgb32; default: return NULL; @@ -631,7 +631,7 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c, const int16_t **alpSrc, uint8_t *dest, int dstW, int dstY, - enum PixelFormat target) + enum AVPixelFormat target) { int i, j; vector signed short X, X0, X1, Y0, U0, V0, Y1, U1, V1, U, V; @@ -706,22 +706,22 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c, B = vec_packclp(B0, B1); switch (target) { - case PIX_FMT_ABGR: + case AV_PIX_FMT_ABGR: out_abgr(R, G, B, out); break; - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: out_bgra(R, G, B, out); break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: out_rgba(R, G, B, out); break; - case PIX_FMT_ARGB: + case AV_PIX_FMT_ARGB: out_argb(R, G, B, out); break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: out_rgb24(R, G, B, out); break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: out_bgr24(R, G, B, out); break; default: @@ -798,22 +798,22 @@ static av_always_inline void ff_yuv2packedX_altivec(SwsContext *c, nout = (vector unsigned char *) scratch; switch (target) { - case PIX_FMT_ABGR: + case AV_PIX_FMT_ABGR: out_abgr(R, G, B, nout); break; - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: out_bgra(R, G, B, nout); break; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: out_rgba(R, G, B, nout); break; - case PIX_FMT_ARGB: + case AV_PIX_FMT_ARGB: out_argb(R, G, B, nout); break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: out_rgb24(R, G, B, nout); break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: out_bgr24(R, G, B, nout); break; default: @@ -846,9 +846,9 @@ void ff_yuv2 ## suffix ## _X_altivec(SwsContext *c, \ dest, dstW, dstY, pixfmt); \ } -YUV2PACKEDX_WRAPPER(abgr, PIX_FMT_ABGR); -YUV2PACKEDX_WRAPPER(bgra, PIX_FMT_BGRA); -YUV2PACKEDX_WRAPPER(argb, PIX_FMT_ARGB); -YUV2PACKEDX_WRAPPER(rgba, PIX_FMT_RGBA); -YUV2PACKEDX_WRAPPER(rgb24, PIX_FMT_RGB24); -YUV2PACKEDX_WRAPPER(bgr24, PIX_FMT_BGR24); +YUV2PACKEDX_WRAPPER(abgr, AV_PIX_FMT_ABGR); +YUV2PACKEDX_WRAPPER(bgra, AV_PIX_FMT_BGRA); +YUV2PACKEDX_WRAPPER(argb, AV_PIX_FMT_ARGB); +YUV2PACKEDX_WRAPPER(rgba, AV_PIX_FMT_RGBA); +YUV2PACKEDX_WRAPPER(rgb24, AV_PIX_FMT_RGB24); +YUV2PACKEDX_WRAPPER(bgr24, AV_PIX_FMT_BGR24); diff --git a/libswscale/ppc/yuv2yuv_altivec.c b/libswscale/ppc/yuv2yuv_altivec.c index af78782b54..60d50a7baa 100644 --- a/libswscale/ppc/yuv2yuv_altivec.c +++ b/libswscale/ppc/yuv2yuv_altivec.c @@ -182,13 +182,13 @@ static int yv12touyvy_unscaled_altivec(SwsContext *c, const uint8_t *src[], void ff_swscale_get_unscaled_altivec(SwsContext *c) { if ((av_get_cpu_flags() & AV_CPU_FLAG_ALTIVEC) && !(c->srcW & 15) && - !(c->flags & SWS_BITEXACT) && c->srcFormat == PIX_FMT_YUV420P) { - enum PixelFormat dstFormat = c->dstFormat; + !(c->flags & SWS_BITEXACT) && c->srcFormat == AV_PIX_FMT_YUV420P) { + enum AVPixelFormat dstFormat = c->dstFormat; // unscaled YV12 -> packed YUV, we want speed - if (dstFormat == PIX_FMT_YUYV422) + if (dstFormat == AV_PIX_FMT_YUYV422) c->swScale = yv12toyuy2_unscaled_altivec; - else if (dstFormat == PIX_FMT_UYVY422) + else if (dstFormat == AV_PIX_FMT_UYVY422) c->swScale = yv12touyvy_unscaled_altivec; } } diff --git a/libswscale/sparc/yuv2rgb_vis.c b/libswscale/sparc/yuv2rgb_vis.c index bb9ab22dbe..ed008377ad 100644 --- a/libswscale/sparc/yuv2rgb_vis.c +++ b/libswscale/sparc/yuv2rgb_vis.c @@ -199,11 +199,11 @@ av_cold SwsFunc ff_yuv2rgb_init_vis(SwsContext *c) c->sparc_coeffs[3] = (((int16_t)c->vOffset * (int16_t)c->vgCoeff >> 11) & 0xffff) * 0x0001000100010001ULL; c->sparc_coeffs[4] = (((int16_t)c->vOffset * (int16_t)c->vrCoeff >> 11) & 0xffff) * 0x0001000100010001ULL; - if (c->dstFormat == PIX_FMT_RGB32 && c->srcFormat == PIX_FMT_YUV422P && (c->dstW & 7) == 0) { + if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV422P && (c->dstW & 7) == 0) { av_log(c, AV_LOG_INFO, "SPARC VIS accelerated YUV422P -> RGB32 (WARNING: alpha value is wrong)\n"); return vis_422P_ARGB32; - } else if (c->dstFormat == PIX_FMT_RGB32 && c->srcFormat == PIX_FMT_YUV420P && (c->dstW & 7) == 0) { + } else if (c->dstFormat == AV_PIX_FMT_RGB32 && c->srcFormat == AV_PIX_FMT_YUV420P && (c->dstW & 7) == 0) { av_log(c, AV_LOG_INFO, "SPARC VIS accelerated YUV420P -> RGB32 (WARNING: alpha value is wrong)\n"); return vis_420P_ARGB32; diff --git a/libswscale/swscale-test.c b/libswscale/swscale-test.c index ef6c55ce02..03a887fc35 100644 --- a/libswscale/swscale-test.c +++ b/libswscale/swscale-test.c @@ -36,20 +36,20 @@ /* HACK Duplicated from swscale_internal.h. * Should be removed when a cleaner pixel format system exists. */ #define isGray(x) \ - ((x) == PIX_FMT_GRAY8 || \ - (x) == PIX_FMT_Y400A || \ - (x) == PIX_FMT_GRAY16BE || \ - (x) == PIX_FMT_GRAY16LE) + ((x) == AV_PIX_FMT_GRAY8 || \ + (x) == AV_PIX_FMT_Y400A || \ + (x) == AV_PIX_FMT_GRAY16BE || \ + (x) == AV_PIX_FMT_GRAY16LE) #define hasChroma(x) \ (!(isGray(x) || \ - (x) == PIX_FMT_MONOBLACK || \ - (x) == PIX_FMT_MONOWHITE)) + (x) == AV_PIX_FMT_MONOBLACK || \ + (x) == AV_PIX_FMT_MONOWHITE)) #define isALPHA(x) \ - ((x) == PIX_FMT_BGR32 || \ - (x) == PIX_FMT_BGR32_1 || \ - (x) == PIX_FMT_RGB32 || \ - (x) == PIX_FMT_RGB32_1 || \ - (x) == PIX_FMT_YUVA420P) + ((x) == AV_PIX_FMT_BGR32 || \ + (x) == AV_PIX_FMT_BGR32_1 || \ + (x) == AV_PIX_FMT_RGB32 || \ + (x) == AV_PIX_FMT_RGB32_1 || \ + (x) == AV_PIX_FMT_YUVA420P) static uint64_t getSSD(uint8_t *src1, uint8_t *src2, int stride1, int stride2, int w, int h) @@ -77,11 +77,11 @@ struct Results { // test by ref -> src -> dst -> out & compare out against ref // ref & out are YV12 static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, - enum PixelFormat srcFormat, enum PixelFormat dstFormat, + enum AVPixelFormat srcFormat, enum AVPixelFormat dstFormat, int srcW, int srcH, int dstW, int dstH, int flags, struct Results *r) { - static enum PixelFormat cur_srcFormat; + static enum AVPixelFormat cur_srcFormat; static int cur_srcW, cur_srcH; static uint8_t *src[4]; static int srcStride[4]; @@ -112,11 +112,11 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, goto end; } } - srcContext = sws_getContext(w, h, PIX_FMT_YUVA420P, srcW, srcH, + srcContext = sws_getContext(w, h, AV_PIX_FMT_YUVA420P, srcW, srcH, srcFormat, SWS_BILINEAR, NULL, NULL, NULL); if (!srcContext) { fprintf(stderr, "Failed to get %s ---> %s\n", - av_pix_fmt_descriptors[PIX_FMT_YUVA420P].name, + av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name, av_pix_fmt_descriptors[srcFormat].name); res = -1; goto end; @@ -187,12 +187,12 @@ static int doTest(uint8_t *ref[4], int refStride[4], int w, int h, } } outContext = sws_getContext(dstW, dstH, dstFormat, w, h, - PIX_FMT_YUVA420P, SWS_BILINEAR, + AV_PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL); if (!outContext) { fprintf(stderr, "Failed to get %s ---> %s\n", av_pix_fmt_descriptors[dstFormat].name, - av_pix_fmt_descriptors[PIX_FMT_YUVA420P].name); + av_pix_fmt_descriptors[AV_PIX_FMT_YUVA420P].name); res = -1; goto end; } @@ -235,8 +235,8 @@ end: } static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, - enum PixelFormat srcFormat_in, - enum PixelFormat dstFormat_in) + enum AVPixelFormat srcFormat_in, + enum AVPixelFormat dstFormat_in) { const int flags[] = { SWS_FAST_BILINEAR, SWS_BILINEAR, SWS_BICUBIC, SWS_X, SWS_POINT, SWS_AREA, 0 }; @@ -244,16 +244,16 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, const int srcH = h; const int dstW[] = { srcW - srcW / 3, srcW, srcW + srcW / 3, 0 }; const int dstH[] = { srcH - srcH / 3, srcH, srcH + srcH / 3, 0 }; - enum PixelFormat srcFormat, dstFormat; + enum AVPixelFormat srcFormat, dstFormat; - for (srcFormat = srcFormat_in != PIX_FMT_NONE ? srcFormat_in : 0; - srcFormat < PIX_FMT_NB; srcFormat++) { + for (srcFormat = srcFormat_in != AV_PIX_FMT_NONE ? srcFormat_in : 0; + srcFormat < AV_PIX_FMT_NB; srcFormat++) { if (!sws_isSupportedInput(srcFormat) || !sws_isSupportedOutput(srcFormat)) continue; - for (dstFormat = dstFormat_in != PIX_FMT_NONE ? dstFormat_in : 0; - dstFormat < PIX_FMT_NB; dstFormat++) { + for (dstFormat = dstFormat_in != AV_PIX_FMT_NONE ? dstFormat_in : 0; + dstFormat < AV_PIX_FMT_NB; dstFormat++) { int i, j, k; int res = 0; @@ -273,26 +273,26 @@ static void selfTest(uint8_t *ref[4], int refStride[4], int w, int h, srcFormat, dstFormat, srcW, srcH, dstW[i], dstH[j], flags[k], NULL); - if (dstFormat_in != PIX_FMT_NONE) + if (dstFormat_in != AV_PIX_FMT_NONE) break; } - if (srcFormat_in != PIX_FMT_NONE) + if (srcFormat_in != AV_PIX_FMT_NONE) break; } } static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp, - enum PixelFormat srcFormat_in, - enum PixelFormat dstFormat_in) + enum AVPixelFormat srcFormat_in, + enum AVPixelFormat dstFormat_in) { char buf[256]; while (fgets(buf, sizeof(buf), fp)) { struct Results r; - enum PixelFormat srcFormat; + enum AVPixelFormat srcFormat; char srcStr[12]; int srcW, srcH; - enum PixelFormat dstFormat; + enum AVPixelFormat dstFormat; char dstStr[12]; int dstW, dstH; int flags; @@ -311,12 +311,12 @@ static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp, srcFormat = av_get_pix_fmt(srcStr); dstFormat = av_get_pix_fmt(dstStr); - if (srcFormat == PIX_FMT_NONE || dstFormat == PIX_FMT_NONE) { + if (srcFormat == AV_PIX_FMT_NONE || dstFormat == AV_PIX_FMT_NONE) { fprintf(stderr, "malformed input file\n"); return -1; } - if ((srcFormat_in != PIX_FMT_NONE && srcFormat_in != srcFormat) || - (dstFormat_in != PIX_FMT_NONE && dstFormat_in != dstFormat)) + if ((srcFormat_in != AV_PIX_FMT_NONE && srcFormat_in != srcFormat) || + (dstFormat_in != AV_PIX_FMT_NONE && dstFormat_in != dstFormat)) continue; if (ret != 12) { printf("%s", buf); @@ -337,8 +337,8 @@ static int fileTest(uint8_t *ref[4], int refStride[4], int w, int h, FILE *fp, int main(int argc, char **argv) { - enum PixelFormat srcFormat = PIX_FMT_NONE; - enum PixelFormat dstFormat = PIX_FMT_NONE; + enum AVPixelFormat srcFormat = AV_PIX_FMT_NONE; + enum AVPixelFormat dstFormat = AV_PIX_FMT_NONE; uint8_t *rgb_data = av_malloc(W * H * 4); uint8_t *rgb_src[4] = { rgb_data, NULL, NULL, NULL }; int rgb_stride[4] = { 4 * W, 0, 0, 0 }; @@ -354,8 +354,8 @@ int main(int argc, char **argv) if (!rgb_data || !data) return -1; - sws = sws_getContext(W / 12, H / 12, PIX_FMT_RGB32, W, H, - PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL); + sws = sws_getContext(W / 12, H / 12, AV_PIX_FMT_RGB32, W, H, + AV_PIX_FMT_YUVA420P, SWS_BILINEAR, NULL, NULL, NULL); av_lfg_init(&rand, 1); @@ -380,13 +380,13 @@ int main(int argc, char **argv) goto end; } else if (!strcmp(argv[i], "-src")) { srcFormat = av_get_pix_fmt(argv[i + 1]); - if (srcFormat == PIX_FMT_NONE) { + if (srcFormat == AV_PIX_FMT_NONE) { fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]); return -1; } } else if (!strcmp(argv[i], "-dst")) { dstFormat = av_get_pix_fmt(argv[i + 1]); - if (dstFormat == PIX_FMT_NONE) { + if (dstFormat == AV_PIX_FMT_NONE) { fprintf(stderr, "invalid pixel format %s\n", argv[i + 1]); return -1; } diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 00a876195e..7c4324417d 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -72,7 +72,7 @@ static void hScale16To19_c(SwsContext *c, int16_t *_dst, int dstW, int bits = av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1; int sh = bits - 4; - if((isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15) + if((isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15) sh= 9; for (i = 0; i < dstW; i++) { @@ -97,7 +97,7 @@ static void hScale16To15_c(SwsContext *c, int16_t *dst, int dstW, int sh = av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1; if(sh<15) - sh= isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1; + sh= isAnyRGB(c->srcFormat) || c->srcFormat==AV_PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1; for (i = 0; i < dstW; i++) { int j; @@ -339,7 +339,7 @@ static int swScale(SwsContext *c, const uint8_t *src[], const int chrSrcW = c->chrSrcW; const int lumXInc = c->lumXInc; const int chrXInc = c->chrXInc; - const enum PixelFormat dstFormat = c->dstFormat; + const enum AVPixelFormat dstFormat = c->dstFormat; const int flags = c->flags; int32_t *vLumFilterPos = c->vLumFilterPos; int32_t *vChrFilterPos = c->vChrFilterPos; @@ -679,7 +679,7 @@ static int swScale(SwsContext *c, const uint8_t *src[], static av_cold void sws_init_swScale_c(SwsContext *c) { - enum PixelFormat srcFormat = c->srcFormat; + enum AVPixelFormat srcFormat = c->srcFormat; ff_sws_init_output_funcs(c, &c->yuv2plane1, &c->yuv2planeX, &c->yuv2nv12cX, &c->yuv2packed1, @@ -724,7 +724,7 @@ static av_cold void sws_init_swScale_c(SwsContext *c) } if (!(isGray(srcFormat) || isGray(c->dstFormat) || - srcFormat == PIX_FMT_MONOBLACK || srcFormat == PIX_FMT_MONOWHITE)) + srcFormat == AV_PIX_FMT_MONOBLACK || srcFormat == AV_PIX_FMT_MONOWHITE)) c->needs_hcscale = 1; } @@ -752,7 +752,7 @@ static void reset_ptr(const uint8_t *src[], int format) } } -static int check_image_pointers(const uint8_t * const data[4], enum PixelFormat pix_fmt, +static int check_image_pointers(const uint8_t * const data[4], enum AVPixelFormat pix_fmt, const int linesizes[4]) { const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt]; @@ -806,28 +806,28 @@ int attribute_align_arg sws_scale(struct SwsContext *c, if (usePal(c->srcFormat)) { for (i = 0; i < 256; i++) { int p, r, g, b, y, u, v, a = 0xff; - if (c->srcFormat == PIX_FMT_PAL8) { + if (c->srcFormat == AV_PIX_FMT_PAL8) { p = ((const uint32_t *)(srcSlice[1]))[i]; a = (p >> 24) & 0xFF; r = (p >> 16) & 0xFF; g = (p >> 8) & 0xFF; b = p & 0xFF; - } else if (c->srcFormat == PIX_FMT_RGB8) { + } else if (c->srcFormat == AV_PIX_FMT_RGB8) { r = ( i >> 5 ) * 36; g = ((i >> 2) & 7) * 36; b = ( i & 3) * 85; - } else if (c->srcFormat == PIX_FMT_BGR8) { + } else if (c->srcFormat == AV_PIX_FMT_BGR8) { b = ( i >> 6 ) * 85; g = ((i >> 3) & 7) * 36; r = ( i & 7) * 36; - } else if (c->srcFormat == PIX_FMT_RGB4_BYTE) { + } else if (c->srcFormat == AV_PIX_FMT_RGB4_BYTE) { r = ( i >> 3 ) * 255; g = ((i >> 1) & 3) * 85; b = ( i & 1) * 255; - } else if (c->srcFormat == PIX_FMT_GRAY8 || c->srcFormat == PIX_FMT_GRAY8A) { + } else if (c->srcFormat == AV_PIX_FMT_GRAY8 || c->srcFormat == AV_PIX_FMT_GRAY8A) { r = g = b = i; } else { - av_assert1(c->srcFormat == PIX_FMT_BGR4_BYTE); + av_assert1(c->srcFormat == AV_PIX_FMT_BGR4_BYTE); b = ( i >> 3 ) * 255; g = ((i >> 1) & 3) * 85; r = ( i & 1) * 255; @@ -849,27 +849,27 @@ int attribute_align_arg sws_scale(struct SwsContext *c, c->pal_yuv[i]= y + (u<<8) + (v<<16) + (a<<24); switch (c->dstFormat) { - case PIX_FMT_BGR32: + case AV_PIX_FMT_BGR32: #if !HAVE_BIGENDIAN - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: #endif c->pal_rgb[i]= r + (g<<8) + (b<<16) + (a<<24); break; - case PIX_FMT_BGR32_1: + case AV_PIX_FMT_BGR32_1: #if HAVE_BIGENDIAN - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: #endif c->pal_rgb[i]= a + (r<<8) + (g<<16) + (b<<24); break; - case PIX_FMT_RGB32_1: + case AV_PIX_FMT_RGB32_1: #if HAVE_BIGENDIAN - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: #endif c->pal_rgb[i]= a + (b<<8) + (g<<16) + (r<<24); break; - case PIX_FMT_RGB32: + case AV_PIX_FMT_RGB32: #if !HAVE_BIGENDIAN - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: #endif default: c->pal_rgb[i]= b + (g<<8) + (r<<16) + (a<<24); diff --git a/libswscale/swscale.h b/libswscale/swscale.h index 71cb5d8108..ea2116c1fa 100644 --- a/libswscale/swscale.h +++ b/libswscale/swscale.h @@ -134,13 +134,13 @@ struct SwsContext; * Return a positive value if pix_fmt is a supported input format, 0 * otherwise. */ -int sws_isSupportedInput(enum PixelFormat pix_fmt); +int sws_isSupportedInput(enum AVPixelFormat pix_fmt); /** * Return a positive value if pix_fmt is a supported output format, 0 * otherwise. */ -int sws_isSupportedOutput(enum PixelFormat pix_fmt); +int sws_isSupportedOutput(enum AVPixelFormat pix_fmt); /** * Allocate an empty SwsContext. This must be filled and passed to @@ -180,8 +180,8 @@ void sws_freeContext(struct SwsContext *swsContext); * written * @deprecated Use sws_getCachedContext() instead. */ -struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, - int dstW, int dstH, enum PixelFormat dstFormat, +struct SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, + int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param); #endif @@ -307,8 +307,8 @@ void sws_freeFilter(SwsFilter *filter); * are assumed to remain the same. */ struct SwsContext *sws_getCachedContext(struct SwsContext *context, - int srcW, int srcH, enum PixelFormat srcFormat, - int dstW, int dstH, enum PixelFormat dstFormat, + int srcW, int srcH, enum AVPixelFormat srcFormat, + int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param); diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h index 21b37ceeb8..9a055b64c8 100644 --- a/libswscale/swscale_internal.h +++ b/libswscale/swscale_internal.h @@ -242,8 +242,8 @@ typedef struct SwsContext { int chrDstH; ///< Height of destination chroma planes. int lumXInc, chrXInc; int lumYInc, chrYInc; - enum PixelFormat dstFormat; ///< Destination pixel format. - enum PixelFormat srcFormat; ///< Source pixel format. + enum AVPixelFormat dstFormat; ///< Destination pixel format. + enum AVPixelFormat srcFormat; ///< Source pixel format. int dstFormatBpp; ///< Number of bits per pixel of the destination pixel format. int srcFormatBpp; ///< Number of bits per pixel of the source pixel format. int dstBpc, srcBpc; @@ -552,7 +552,7 @@ void ff_bfin_get_unscaled_swscale(SwsContext *c); * @deprecated Use av_get_pix_fmt_name() instead. */ attribute_deprecated -const char *sws_format_name(enum PixelFormat format); +const char *sws_format_name(enum AVPixelFormat format); #endif #define is16BPS(x) \ @@ -583,79 +583,79 @@ const char *sws_format_name(enum PixelFormat format); av_pix_fmt_descriptors[x].nb_components <= 2) #else #define isGray(x) \ - ((x) == PIX_FMT_GRAY8 || \ - (x) == PIX_FMT_Y400A || \ - (x) == PIX_FMT_GRAY16BE || \ - (x) == PIX_FMT_GRAY16LE) + ((x) == AV_PIX_FMT_GRAY8 || \ + (x) == AV_PIX_FMT_Y400A || \ + (x) == AV_PIX_FMT_GRAY16BE || \ + (x) == AV_PIX_FMT_GRAY16LE) #endif #define isRGBinInt(x) \ ( \ - (x)==PIX_FMT_RGB48BE || \ - (x)==PIX_FMT_RGB48LE || \ - (x)==PIX_FMT_RGBA64BE || \ - (x)==PIX_FMT_RGBA64LE || \ - (x)==PIX_FMT_RGB32 || \ - (x)==PIX_FMT_RGB32_1 || \ - (x)==PIX_FMT_RGB24 || \ - (x)==PIX_FMT_RGB565BE || \ - (x)==PIX_FMT_RGB565LE || \ - (x)==PIX_FMT_RGB555BE || \ - (x)==PIX_FMT_RGB555LE || \ - (x)==PIX_FMT_RGB444BE || \ - (x)==PIX_FMT_RGB444LE || \ - (x)==PIX_FMT_RGB8 || \ - (x)==PIX_FMT_RGB4 || \ - (x)==PIX_FMT_RGB4_BYTE || \ - (x)==PIX_FMT_MONOBLACK || \ - (x)==PIX_FMT_MONOWHITE \ + (x) == AV_PIX_FMT_RGB48BE || \ + (x) == AV_PIX_FMT_RGB48LE || \ + (x) == AV_PIX_FMT_RGBA64BE || \ + (x) == AV_PIX_FMT_RGBA64LE || \ + (x) == AV_PIX_FMT_RGB32 || \ + (x) == AV_PIX_FMT_RGB32_1 || \ + (x) == AV_PIX_FMT_RGB24 || \ + (x) == AV_PIX_FMT_RGB565BE || \ + (x) == AV_PIX_FMT_RGB565LE || \ + (x) == AV_PIX_FMT_RGB555BE || \ + (x) == AV_PIX_FMT_RGB555LE || \ + (x) == AV_PIX_FMT_RGB444BE || \ + (x) == AV_PIX_FMT_RGB444LE || \ + (x) == AV_PIX_FMT_RGB8 || \ + (x) == AV_PIX_FMT_RGB4 || \ + (x) == AV_PIX_FMT_RGB4_BYTE || \ + (x) == AV_PIX_FMT_MONOBLACK || \ + (x) == AV_PIX_FMT_MONOWHITE \ ) #define isBGRinInt(x) \ ( \ - (x)==PIX_FMT_BGR48BE || \ - (x)==PIX_FMT_BGR48LE || \ - (x)==PIX_FMT_BGRA64BE || \ - (x)==PIX_FMT_BGRA64LE || \ - (x)==PIX_FMT_BGR32 || \ - (x)==PIX_FMT_BGR32_1 || \ - (x)==PIX_FMT_BGR24 || \ - (x)==PIX_FMT_BGR565BE || \ - (x)==PIX_FMT_BGR565LE || \ - (x)==PIX_FMT_BGR555BE || \ - (x)==PIX_FMT_BGR555LE || \ - (x)==PIX_FMT_BGR444BE || \ - (x)==PIX_FMT_BGR444LE || \ - (x)==PIX_FMT_BGR8 || \ - (x)==PIX_FMT_BGR4 || \ - (x)==PIX_FMT_BGR4_BYTE|| \ - (x)==PIX_FMT_MONOBLACK|| \ - (x)==PIX_FMT_MONOWHITE \ + (x) == AV_PIX_FMT_BGR48BE || \ + (x) == AV_PIX_FMT_BGR48LE || \ + (x) == AV_PIX_FMT_BGRA64BE || \ + (x) == AV_PIX_FMT_BGRA64LE || \ + (x) == AV_PIX_FMT_BGR32 || \ + (x) == AV_PIX_FMT_BGR32_1 || \ + (x) == AV_PIX_FMT_BGR24 || \ + (x) == AV_PIX_FMT_BGR565BE || \ + (x) == AV_PIX_FMT_BGR565LE || \ + (x) == AV_PIX_FMT_BGR555BE || \ + (x) == AV_PIX_FMT_BGR555LE || \ + (x) == AV_PIX_FMT_BGR444BE || \ + (x) == AV_PIX_FMT_BGR444LE || \ + (x) == AV_PIX_FMT_BGR8 || \ + (x) == AV_PIX_FMT_BGR4 || \ + (x) == AV_PIX_FMT_BGR4_BYTE || \ + (x) == AV_PIX_FMT_MONOBLACK || \ + (x) == AV_PIX_FMT_MONOWHITE \ ) #define isRGBinBytes(x) ( \ - (x)==PIX_FMT_RGB48BE \ - || (x)==PIX_FMT_RGB48LE \ - || (x)==PIX_FMT_RGBA64BE \ - || (x)==PIX_FMT_RGBA64LE \ - || (x)==PIX_FMT_RGBA \ - || (x)==PIX_FMT_ARGB \ - || (x)==PIX_FMT_RGB24 \ + (x) == AV_PIX_FMT_RGB48BE \ + || (x) == AV_PIX_FMT_RGB48LE \ + || (x) == AV_PIX_FMT_RGBA64BE \ + || (x) == AV_PIX_FMT_RGBA64LE \ + || (x) == AV_PIX_FMT_RGBA \ + || (x) == AV_PIX_FMT_ARGB \ + || (x) == AV_PIX_FMT_RGB24 \ ) #define isBGRinBytes(x) ( \ - (x)==PIX_FMT_BGR48BE \ - || (x)==PIX_FMT_BGR48LE \ - || (x)==PIX_FMT_BGRA64BE \ - || (x)==PIX_FMT_BGRA64LE \ - || (x)==PIX_FMT_BGRA \ - || (x)==PIX_FMT_ABGR \ - || (x)==PIX_FMT_BGR24 \ + (x) == AV_PIX_FMT_BGR48BE \ + || (x) == AV_PIX_FMT_BGR48LE \ + || (x) == AV_PIX_FMT_BGRA64BE \ + || (x) == AV_PIX_FMT_BGRA64LE \ + || (x) == AV_PIX_FMT_BGRA \ + || (x) == AV_PIX_FMT_ABGR \ + || (x) == AV_PIX_FMT_BGR24 \ ) #define isAnyRGB(x) \ ( \ isRGBinInt(x) || \ isBGRinInt(x) || \ - (x)==PIX_FMT_GBR24P \ + (x)==AV_PIX_FMT_GBR24P \ ) #define isALPHA(x) \ @@ -664,10 +664,10 @@ const char *sws_format_name(enum PixelFormat format); #if 1 #define isPacked(x) ( \ - (x)==PIX_FMT_PAL8 \ - || (x)==PIX_FMT_YUYV422 \ - || (x)==PIX_FMT_UYVY422 \ - || (x)==PIX_FMT_Y400A \ + (x)==AV_PIX_FMT_PAL8 \ + || (x)==AV_PIX_FMT_YUYV422 \ + || (x)==AV_PIX_FMT_UYVY422 \ + || (x)==AV_PIX_FMT_Y400A \ || isRGBinInt(x) \ || isBGRinInt(x) \ ) @@ -675,7 +675,7 @@ const char *sws_format_name(enum PixelFormat format); #define isPacked(x) \ ((av_pix_fmt_descriptors[x].nb_components >= 2 && \ !(av_pix_fmt_descriptors[x].flags & PIX_FMT_PLANAR)) || \ - (x) == PIX_FMT_PAL8) + (x) == AV_PIX_FMT_PAL8) #endif #define isPlanar(x) \ diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index de73287278..32a2d52c82 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -180,7 +180,7 @@ static int planarToNv12Wrapper(SwsContext *c, const uint8_t *src[], copyPlane(src[0], srcStride[0], srcSliceY, srcSliceH, c->srcW, dstParam[0], dstStride[0]); - if (c->dstFormat == PIX_FMT_NV12) + if (c->dstFormat == AV_PIX_FMT_NV12) interleaveBytes(src[1], src[2], dst, c->srcW / 2, srcSliceH / 2, srcStride[1], srcStride[2], dstStride[0]); else @@ -357,31 +357,31 @@ static int palToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[], int srcSliceY, int srcSliceH, uint8_t *dst[], int dstStride[]) { - const enum PixelFormat srcFormat = c->srcFormat; - const enum PixelFormat dstFormat = c->dstFormat; + const enum AVPixelFormat srcFormat = c->srcFormat; + const enum AVPixelFormat dstFormat = c->dstFormat; void (*conv)(const uint8_t *src, uint8_t *dst, int num_pixels, const uint8_t *palette) = NULL; int i; uint8_t *dstPtr = dst[0] + dstStride[0] * srcSliceY; const uint8_t *srcPtr = src[0]; - if (srcFormat == PIX_FMT_GRAY8A) { + if (srcFormat == AV_PIX_FMT_GRAY8A) { switch (dstFormat) { - case PIX_FMT_RGB32 : conv = gray8aToPacked32; break; - case PIX_FMT_BGR32 : conv = gray8aToPacked32; break; - case PIX_FMT_BGR32_1: conv = gray8aToPacked32_1; break; - case PIX_FMT_RGB32_1: conv = gray8aToPacked32_1; break; - case PIX_FMT_RGB24 : conv = gray8aToPacked24; break; - case PIX_FMT_BGR24 : conv = gray8aToPacked24; break; + case AV_PIX_FMT_RGB32 : conv = gray8aToPacked32; break; + case AV_PIX_FMT_BGR32 : conv = gray8aToPacked32; break; + case AV_PIX_FMT_BGR32_1: conv = gray8aToPacked32_1; break; + case AV_PIX_FMT_RGB32_1: conv = gray8aToPacked32_1; break; + case AV_PIX_FMT_RGB24 : conv = gray8aToPacked24; break; + case AV_PIX_FMT_BGR24 : conv = gray8aToPacked24; break; } } else if (usePal(srcFormat)) { switch (dstFormat) { - case PIX_FMT_RGB32 : conv = sws_convertPalette8ToPacked32; break; - case PIX_FMT_BGR32 : conv = sws_convertPalette8ToPacked32; break; - case PIX_FMT_BGR32_1: conv = sws_convertPalette8ToPacked32; break; - case PIX_FMT_RGB32_1: conv = sws_convertPalette8ToPacked32; break; - case PIX_FMT_RGB24 : conv = sws_convertPalette8ToPacked24; break; - case PIX_FMT_BGR24 : conv = sws_convertPalette8ToPacked24; break; + case AV_PIX_FMT_RGB32 : conv = sws_convertPalette8ToPacked32; break; + case AV_PIX_FMT_BGR32 : conv = sws_convertPalette8ToPacked32; break; + case AV_PIX_FMT_BGR32_1: conv = sws_convertPalette8ToPacked32; break; + case AV_PIX_FMT_RGB32_1: conv = sws_convertPalette8ToPacked32; break; + case AV_PIX_FMT_RGB24 : conv = sws_convertPalette8ToPacked24; break; + case AV_PIX_FMT_BGR24 : conv = sws_convertPalette8ToPacked24; break; } } @@ -451,7 +451,7 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], uint8_t *dst[], int dstStride[]) { int alpha_first = 0; - if (c->srcFormat != PIX_FMT_GBRP) { + if (c->srcFormat != AV_PIX_FMT_GBRP) { av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n", av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat)); @@ -459,32 +459,32 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], } switch (c->dstFormat) { - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] }, (int []) { srcStride[1], srcStride[0], srcStride[2] }, dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, c->srcW); break; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: gbr24ptopacked24((const uint8_t *[]) { src[2], src[0], src[1] }, (int []) { srcStride[2], srcStride[0], srcStride[1] }, dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, c->srcW); break; - case PIX_FMT_ARGB: + case AV_PIX_FMT_ARGB: alpha_first = 1; - case PIX_FMT_RGBA: + case AV_PIX_FMT_RGBA: gbr24ptopacked32((const uint8_t *[]) { src[2], src[0], src[1] }, (int []) { srcStride[2], srcStride[0], srcStride[1] }, dst[0] + srcSliceY * dstStride[0], dstStride[0], srcSliceH, alpha_first, c->srcW); break; - case PIX_FMT_ABGR: + case AV_PIX_FMT_ABGR: alpha_first = 1; - case PIX_FMT_BGRA: + case AV_PIX_FMT_BGRA: gbr24ptopacked32((const uint8_t *[]) { src[1], src[0], src[2] }, (int []) { srcStride[1], srcStride[0], srcStride[2] }, dst[0] + srcSliceY * dstStride[0], dstStride[0], @@ -502,32 +502,32 @@ static int planarRgbToRgbWrapper(SwsContext *c, const uint8_t *src[], } #define isRGBA32(x) ( \ - (x) == PIX_FMT_ARGB \ - || (x) == PIX_FMT_RGBA \ - || (x) == PIX_FMT_BGRA \ - || (x) == PIX_FMT_ABGR \ + (x) == AV_PIX_FMT_ARGB \ + || (x) == AV_PIX_FMT_RGBA \ + || (x) == AV_PIX_FMT_BGRA \ + || (x) == AV_PIX_FMT_ABGR \ ) #define isRGBA64(x) ( \ - (x) == PIX_FMT_RGBA64LE \ - || (x) == PIX_FMT_RGBA64BE \ - || (x) == PIX_FMT_BGRA64LE \ - || (x) == PIX_FMT_BGRA64BE \ + (x) == AV_PIX_FMT_RGBA64LE \ + || (x) == AV_PIX_FMT_RGBA64BE \ + || (x) == AV_PIX_FMT_BGRA64LE \ + || (x) == AV_PIX_FMT_BGRA64BE \ ) #define isRGB48(x) ( \ - (x) == PIX_FMT_RGB48LE \ - || (x) == PIX_FMT_RGB48BE \ - || (x) == PIX_FMT_BGR48LE \ - || (x) == PIX_FMT_BGR48BE \ + (x) == AV_PIX_FMT_RGB48LE \ + || (x) == AV_PIX_FMT_RGB48BE \ + || (x) == AV_PIX_FMT_BGR48LE \ + || (x) == AV_PIX_FMT_BGR48BE \ ) /* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */ typedef void (* rgbConvFn) (const uint8_t *, uint8_t *, int); static rgbConvFn findRgbConvFn(SwsContext *c) { - const enum PixelFormat srcFormat = c->srcFormat; - const enum PixelFormat dstFormat = c->dstFormat; + const enum AVPixelFormat srcFormat = c->srcFormat; + const enum AVPixelFormat dstFormat = c->dstFormat; const int srcId = c->srcFormatBpp; const int dstId = c->dstFormatBpp; rgbConvFn conv = NULL; @@ -536,7 +536,7 @@ static rgbConvFn findRgbConvFn(SwsContext *c) (((bpp + 7) >> 3) == 2 && \ (!(av_pix_fmt_descriptors[fmt].flags & PIX_FMT_BE) != !HAVE_BIGENDIAN)) -#define CONV_IS(src, dst) (srcFormat == PIX_FMT_##src && dstFormat == PIX_FMT_##dst) +#define CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst) if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) { if ( CONV_IS(ABGR, RGBA) @@ -627,8 +627,8 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[], int dstStride[]) { - const enum PixelFormat srcFormat = c->srcFormat; - const enum PixelFormat dstFormat = c->dstFormat; + const enum AVPixelFormat srcFormat = c->srcFormat; + const enum AVPixelFormat dstFormat = c->dstFormat; const int srcBpp = (c->srcFormatBpp + 7) >> 3; const int dstBpp = (c->dstFormatBpp + 7) >> 3; rgbConvFn conv = findRgbConvFn(c); @@ -642,11 +642,11 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[], int src_bswap = IS_NOT_NE(c->srcFormatBpp, srcFormat); int dst_bswap = IS_NOT_NE(c->dstFormatBpp, dstFormat); - if ((srcFormat == PIX_FMT_RGB32_1 || srcFormat == PIX_FMT_BGR32_1) && + if ((srcFormat == AV_PIX_FMT_RGB32_1 || srcFormat == AV_PIX_FMT_BGR32_1) && !isRGBA32(dstFormat)) srcPtr += ALT32_CORR; - if ((dstFormat == PIX_FMT_RGB32_1 || dstFormat == PIX_FMT_BGR32_1) && + if ((dstFormat == AV_PIX_FMT_RGB32_1 || dstFormat == AV_PIX_FMT_BGR32_1) && !isRGBA32(srcFormat)) dstPtr += ALT32_CORR; @@ -926,8 +926,8 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t *src[], void ff_get_unscaled_swscale(SwsContext *c) { - const enum PixelFormat srcFormat = c->srcFormat; - const enum PixelFormat dstFormat = c->dstFormat; + const enum AVPixelFormat srcFormat = c->srcFormat; + const enum AVPixelFormat dstFormat = c->dstFormat; const int flags = c->flags; const int dstH = c->dstH; int needsDither; @@ -937,26 +937,26 @@ void ff_get_unscaled_swscale(SwsContext *c) (c->dstFormatBpp < c->srcFormatBpp || (!isAnyRGB(srcFormat))); /* yv12_to_nv12 */ - if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) && - (dstFormat == PIX_FMT_NV12 || dstFormat == PIX_FMT_NV21)) { + if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) && + (dstFormat == AV_PIX_FMT_NV12 || dstFormat == AV_PIX_FMT_NV21)) { c->swScale = planarToNv12Wrapper; } /* yuv2bgr */ - if ((srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUV422P || - srcFormat == PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) && + if ((srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUV422P || + srcFormat == AV_PIX_FMT_YUVA420P) && isAnyRGB(dstFormat) && !(flags & SWS_ACCURATE_RND) && !(dstH & 1)) { c->swScale = ff_yuv2rgb_get_func_ptr(c); } - if (srcFormat == PIX_FMT_YUV410P && - (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P) && + if (srcFormat == AV_PIX_FMT_YUV410P && + (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && !(flags & SWS_BITEXACT)) { c->swScale = yvu9ToYv12Wrapper; } /* bgr24toYV12 */ - if (srcFormat == PIX_FMT_BGR24 && - (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P) && + if (srcFormat == AV_PIX_FMT_BGR24 && + (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) && !(flags & SWS_ACCURATE_RND)) c->swScale = bgr24ToYv12Wrapper; @@ -966,74 +966,74 @@ void ff_get_unscaled_swscale(SwsContext *c) c->swScale= rgbToRgbWrapper; #define isByteRGB(f) (\ - f == PIX_FMT_RGB32 ||\ - f == PIX_FMT_RGB32_1 ||\ - f == PIX_FMT_RGB24 ||\ - f == PIX_FMT_BGR32 ||\ - f == PIX_FMT_BGR32_1 ||\ - f == PIX_FMT_BGR24) + f == AV_PIX_FMT_RGB32 ||\ + f == AV_PIX_FMT_RGB32_1 ||\ + f == AV_PIX_FMT_RGB24 ||\ + f == AV_PIX_FMT_BGR32 ||\ + f == AV_PIX_FMT_BGR32_1 ||\ + f == AV_PIX_FMT_BGR24) if (isAnyRGB(srcFormat) && isPlanar(srcFormat) && isByteRGB(dstFormat)) c->swScale = planarRgbToRgbWrapper; /* bswap 16 bits per pixel/component packed formats */ - if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR444) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR48) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGRA64) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR555) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_BGR565) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_GRAY16) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB444) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB48) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGBA64) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB555) || - IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, PIX_FMT_RGB565)) + if (IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR444) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR48) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGRA64) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR555) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_BGR565) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_GRAY16) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB444) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB48) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGBA64) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB555) || + IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB565)) c->swScale = packed_16bpc_bswap; if (usePal(srcFormat) && isByteRGB(dstFormat)) c->swScale = palToRgbWrapper; - if (srcFormat == PIX_FMT_YUV422P) { - if (dstFormat == PIX_FMT_YUYV422) + if (srcFormat == AV_PIX_FMT_YUV422P) { + if (dstFormat == AV_PIX_FMT_YUYV422) c->swScale = yuv422pToYuy2Wrapper; - else if (dstFormat == PIX_FMT_UYVY422) + else if (dstFormat == AV_PIX_FMT_UYVY422) c->swScale = yuv422pToUyvyWrapper; } /* LQ converters if -sws 0 or -sws 4*/ if (c->flags&(SWS_FAST_BILINEAR|SWS_POINT)) { /* yv12_to_yuy2 */ - if (srcFormat == PIX_FMT_YUV420P || srcFormat == PIX_FMT_YUVA420P) { - if (dstFormat == PIX_FMT_YUYV422) + if (srcFormat == AV_PIX_FMT_YUV420P || srcFormat == AV_PIX_FMT_YUVA420P) { + if (dstFormat == AV_PIX_FMT_YUYV422) c->swScale = planarToYuy2Wrapper; - else if (dstFormat == PIX_FMT_UYVY422) + else if (dstFormat == AV_PIX_FMT_UYVY422) c->swScale = planarToUyvyWrapper; } } - if (srcFormat == PIX_FMT_YUYV422 && - (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P)) + if (srcFormat == AV_PIX_FMT_YUYV422 && + (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) c->swScale = yuyvToYuv420Wrapper; - if (srcFormat == PIX_FMT_UYVY422 && - (dstFormat == PIX_FMT_YUV420P || dstFormat == PIX_FMT_YUVA420P)) + if (srcFormat == AV_PIX_FMT_UYVY422 && + (dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P)) c->swScale = uyvyToYuv420Wrapper; - if (srcFormat == PIX_FMT_YUYV422 && dstFormat == PIX_FMT_YUV422P) + if (srcFormat == AV_PIX_FMT_YUYV422 && dstFormat == AV_PIX_FMT_YUV422P) c->swScale = yuyvToYuv422Wrapper; - if (srcFormat == PIX_FMT_UYVY422 && dstFormat == PIX_FMT_YUV422P) + if (srcFormat == AV_PIX_FMT_UYVY422 && dstFormat == AV_PIX_FMT_YUV422P) c->swScale = uyvyToYuv422Wrapper; -#define isPlanarGray(x) (isGray(x) && (x) != PIX_FMT_GRAY8A) +#define isPlanarGray(x) (isGray(x) && (x) != AV_PIX_FMT_GRAY8A) /* simple copy */ if ( srcFormat == dstFormat || - (srcFormat == PIX_FMT_YUVA420P && dstFormat == PIX_FMT_YUV420P) || - (srcFormat == PIX_FMT_YUV420P && dstFormat == PIX_FMT_YUVA420P) || + (srcFormat == AV_PIX_FMT_YUVA420P && dstFormat == AV_PIX_FMT_YUV420P) || + (srcFormat == AV_PIX_FMT_YUV420P && dstFormat == AV_PIX_FMT_YUVA420P) || (isPlanarYUV(srcFormat) && isPlanarGray(dstFormat)) || (isPlanarYUV(dstFormat) && isPlanarGray(srcFormat)) || (isPlanarGray(dstFormat) && isPlanarGray(srcFormat)) || (isPlanarYUV(srcFormat) && isPlanarYUV(dstFormat) && c->chrDstHSubSample == c->chrSrcHSubSample && c->chrDstVSubSample == c->chrSrcVSubSample && - dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 && - srcFormat != PIX_FMT_NV12 && srcFormat != PIX_FMT_NV21)) + dstFormat != AV_PIX_FMT_NV12 && dstFormat != AV_PIX_FMT_NV21 && + srcFormat != AV_PIX_FMT_NV12 && srcFormat != AV_PIX_FMT_NV21)) { if (isPacked(c->srcFormat)) c->swScale = packedCopyWrapper; diff --git a/libswscale/utils.c b/libswscale/utils.c index 4b14c737af..9c839d8dde 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -75,127 +75,127 @@ typedef struct FormatEntry { int is_supported_in, is_supported_out; } FormatEntry; -static const FormatEntry format_entries[PIX_FMT_NB] = { - [PIX_FMT_YUV420P] = { 1, 1 }, - [PIX_FMT_YUYV422] = { 1, 1 }, - [PIX_FMT_RGB24] = { 1, 1 }, - [PIX_FMT_BGR24] = { 1, 1 }, - [PIX_FMT_YUV422P] = { 1, 1 }, - [PIX_FMT_YUV444P] = { 1, 1 }, - [PIX_FMT_YUV410P] = { 1, 1 }, - [PIX_FMT_YUV411P] = { 1, 1 }, - [PIX_FMT_GRAY8] = { 1, 1 }, - [PIX_FMT_MONOWHITE] = { 1, 1 }, - [PIX_FMT_MONOBLACK] = { 1, 1 }, - [PIX_FMT_PAL8] = { 1, 0 }, - [PIX_FMT_YUVJ420P] = { 1, 1 }, - [PIX_FMT_YUVJ422P] = { 1, 1 }, - [PIX_FMT_YUVJ444P] = { 1, 1 }, - [PIX_FMT_UYVY422] = { 1, 1 }, - [PIX_FMT_UYYVYY411] = { 0, 0 }, - [PIX_FMT_BGR8] = { 1, 1 }, - [PIX_FMT_BGR4] = { 0, 1 }, - [PIX_FMT_BGR4_BYTE] = { 1, 1 }, - [PIX_FMT_RGB8] = { 1, 1 }, - [PIX_FMT_RGB4] = { 0, 1 }, - [PIX_FMT_RGB4_BYTE] = { 1, 1 }, - [PIX_FMT_NV12] = { 1, 1 }, - [PIX_FMT_NV21] = { 1, 1 }, - [PIX_FMT_ARGB] = { 1, 1 }, - [PIX_FMT_RGBA] = { 1, 1 }, - [PIX_FMT_ABGR] = { 1, 1 }, - [PIX_FMT_BGRA] = { 1, 1 }, - [PIX_FMT_0RGB] = { 1, 1 }, - [PIX_FMT_RGB0] = { 1, 1 }, - [PIX_FMT_0BGR] = { 1, 1 }, - [PIX_FMT_BGR0] = { 1, 1 }, - [PIX_FMT_GRAY16BE] = { 1, 1 }, - [PIX_FMT_GRAY16LE] = { 1, 1 }, - [PIX_FMT_YUV440P] = { 1, 1 }, - [PIX_FMT_YUVJ440P] = { 1, 1 }, - [PIX_FMT_YUVA420P] = { 1, 1 }, - [PIX_FMT_YUVA422P] = { 1, 1 }, - [PIX_FMT_YUVA444P] = { 1, 1 }, - [PIX_FMT_RGB48BE] = { 1, 1 }, - [PIX_FMT_RGB48LE] = { 1, 1 }, - [PIX_FMT_RGBA64BE] = { 1, 0 }, - [PIX_FMT_RGBA64LE] = { 1, 0 }, - [PIX_FMT_RGB565BE] = { 1, 1 }, - [PIX_FMT_RGB565LE] = { 1, 1 }, - [PIX_FMT_RGB555BE] = { 1, 1 }, - [PIX_FMT_RGB555LE] = { 1, 1 }, - [PIX_FMT_BGR565BE] = { 1, 1 }, - [PIX_FMT_BGR565LE] = { 1, 1 }, - [PIX_FMT_BGR555BE] = { 1, 1 }, - [PIX_FMT_BGR555LE] = { 1, 1 }, - [PIX_FMT_YUV420P16LE] = { 1, 1 }, - [PIX_FMT_YUV420P16BE] = { 1, 1 }, - [PIX_FMT_YUV422P16LE] = { 1, 1 }, - [PIX_FMT_YUV422P16BE] = { 1, 1 }, - [PIX_FMT_YUV444P16LE] = { 1, 1 }, - [PIX_FMT_YUV444P16BE] = { 1, 1 }, - [PIX_FMT_RGB444LE] = { 1, 1 }, - [PIX_FMT_RGB444BE] = { 1, 1 }, - [PIX_FMT_BGR444LE] = { 1, 1 }, - [PIX_FMT_BGR444BE] = { 1, 1 }, - [PIX_FMT_Y400A] = { 1, 0 }, - [PIX_FMT_BGR48BE] = { 1, 1 }, - [PIX_FMT_BGR48LE] = { 1, 1 }, - [PIX_FMT_BGRA64BE] = { 0, 0 }, - [PIX_FMT_BGRA64LE] = { 0, 0 }, - [PIX_FMT_YUV420P9BE] = { 1, 1 }, - [PIX_FMT_YUV420P9LE] = { 1, 1 }, - [PIX_FMT_YUV420P10BE] = { 1, 1 }, - [PIX_FMT_YUV420P10LE] = { 1, 1 }, - [PIX_FMT_YUV420P12BE] = { 1, 1 }, - [PIX_FMT_YUV420P12LE] = { 1, 1 }, - [PIX_FMT_YUV420P14BE] = { 1, 1 }, - [PIX_FMT_YUV420P14LE] = { 1, 1 }, - [PIX_FMT_YUV422P9BE] = { 1, 1 }, - [PIX_FMT_YUV422P9LE] = { 1, 1 }, - [PIX_FMT_YUV422P10BE] = { 1, 1 }, - [PIX_FMT_YUV422P10LE] = { 1, 1 }, - [PIX_FMT_YUV422P12BE] = { 1, 1 }, - [PIX_FMT_YUV422P12LE] = { 1, 1 }, - [PIX_FMT_YUV422P14BE] = { 1, 1 }, - [PIX_FMT_YUV422P14LE] = { 1, 1 }, - [PIX_FMT_YUV444P9BE] = { 1, 1 }, - [PIX_FMT_YUV444P9LE] = { 1, 1 }, - [PIX_FMT_YUV444P10BE] = { 1, 1 }, - [PIX_FMT_YUV444P10LE] = { 1, 1 }, - [PIX_FMT_YUV444P12BE] = { 1, 1 }, - [PIX_FMT_YUV444P12LE] = { 1, 1 }, - [PIX_FMT_YUV444P14BE] = { 1, 1 }, - [PIX_FMT_YUV444P14LE] = { 1, 1 }, - [PIX_FMT_GBRP] = { 1, 0 }, - [PIX_FMT_GBRP9LE] = { 1, 0 }, - [PIX_FMT_GBRP9BE] = { 1, 0 }, - [PIX_FMT_GBRP10LE] = { 1, 0 }, - [PIX_FMT_GBRP10BE] = { 1, 0 }, - [PIX_FMT_GBRP12LE] = { 1, 0 }, - [PIX_FMT_GBRP12BE] = { 1, 0 }, - [PIX_FMT_GBRP14LE] = { 1, 0 }, - [PIX_FMT_GBRP14BE] = { 1, 0 }, - [PIX_FMT_GBRP16LE] = { 1, 0 }, - [PIX_FMT_GBRP16BE] = { 1, 0 }, +static const FormatEntry format_entries[AV_PIX_FMT_NB] = { + [AV_PIX_FMT_YUV420P] = { 1, 1 }, + [AV_PIX_FMT_YUYV422] = { 1, 1 }, + [AV_PIX_FMT_RGB24] = { 1, 1 }, + [AV_PIX_FMT_BGR24] = { 1, 1 }, + [AV_PIX_FMT_YUV422P] = { 1, 1 }, + [AV_PIX_FMT_YUV444P] = { 1, 1 }, + [AV_PIX_FMT_YUV410P] = { 1, 1 }, + [AV_PIX_FMT_YUV411P] = { 1, 1 }, + [AV_PIX_FMT_GRAY8] = { 1, 1 }, + [AV_PIX_FMT_MONOWHITE] = { 1, 1 }, + [AV_PIX_FMT_MONOBLACK] = { 1, 1 }, + [AV_PIX_FMT_PAL8] = { 1, 0 }, + [AV_PIX_FMT_YUVJ420P] = { 1, 1 }, + [AV_PIX_FMT_YUVJ422P] = { 1, 1 }, + [AV_PIX_FMT_YUVJ444P] = { 1, 1 }, + [AV_PIX_FMT_UYVY422] = { 1, 1 }, + [AV_PIX_FMT_UYYVYY411] = { 0, 0 }, + [AV_PIX_FMT_BGR8] = { 1, 1 }, + [AV_PIX_FMT_BGR4] = { 0, 1 }, + [AV_PIX_FMT_BGR4_BYTE] = { 1, 1 }, + [AV_PIX_FMT_RGB8] = { 1, 1 }, + [AV_PIX_FMT_RGB4] = { 0, 1 }, + [AV_PIX_FMT_RGB4_BYTE] = { 1, 1 }, + [AV_PIX_FMT_NV12] = { 1, 1 }, + [AV_PIX_FMT_NV21] = { 1, 1 }, + [AV_PIX_FMT_ARGB] = { 1, 1 }, + [AV_PIX_FMT_RGBA] = { 1, 1 }, + [AV_PIX_FMT_ABGR] = { 1, 1 }, + [AV_PIX_FMT_BGRA] = { 1, 1 }, + [AV_PIX_FMT_0RGB] = { 1, 1 }, + [AV_PIX_FMT_RGB0] = { 1, 1 }, + [AV_PIX_FMT_0BGR] = { 1, 1 }, + [AV_PIX_FMT_BGR0] = { 1, 1 }, + [AV_PIX_FMT_GRAY16BE] = { 1, 1 }, + [AV_PIX_FMT_GRAY16LE] = { 1, 1 }, + [AV_PIX_FMT_YUV440P] = { 1, 1 }, + [AV_PIX_FMT_YUVJ440P] = { 1, 1 }, + [AV_PIX_FMT_YUVA420P] = { 1, 1 }, + [AV_PIX_FMT_YUVA422P] = { 1, 1 }, + [AV_PIX_FMT_YUVA444P] = { 1, 1 }, + [AV_PIX_FMT_RGB48BE] = { 1, 1 }, + [AV_PIX_FMT_RGB48LE] = { 1, 1 }, + [AV_PIX_FMT_RGBA64BE] = { 1, 0 }, + [AV_PIX_FMT_RGBA64LE] = { 1, 0 }, + [AV_PIX_FMT_RGB565BE] = { 1, 1 }, + [AV_PIX_FMT_RGB565LE] = { 1, 1 }, + [AV_PIX_FMT_RGB555BE] = { 1, 1 }, + [AV_PIX_FMT_RGB555LE] = { 1, 1 }, + [AV_PIX_FMT_BGR565BE] = { 1, 1 }, + [AV_PIX_FMT_BGR565LE] = { 1, 1 }, + [AV_PIX_FMT_BGR555BE] = { 1, 1 }, + [AV_PIX_FMT_BGR555LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P16LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P16BE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P16LE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P16BE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P16LE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P16BE] = { 1, 1 }, + [AV_PIX_FMT_RGB444LE] = { 1, 1 }, + [AV_PIX_FMT_RGB444BE] = { 1, 1 }, + [AV_PIX_FMT_BGR444LE] = { 1, 1 }, + [AV_PIX_FMT_BGR444BE] = { 1, 1 }, + [AV_PIX_FMT_Y400A] = { 1, 0 }, + [AV_PIX_FMT_BGR48BE] = { 1, 1 }, + [AV_PIX_FMT_BGR48LE] = { 1, 1 }, + [AV_PIX_FMT_BGRA64BE] = { 0, 0 }, + [AV_PIX_FMT_BGRA64LE] = { 0, 0 }, + [AV_PIX_FMT_YUV420P9BE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P9LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P10BE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P10LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P12BE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P12LE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P14BE] = { 1, 1 }, + [AV_PIX_FMT_YUV420P14LE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P9BE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P9LE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P10BE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P10LE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P12BE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P12LE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P14BE] = { 1, 1 }, + [AV_PIX_FMT_YUV422P14LE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P9BE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P9LE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P10BE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P10LE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P12BE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P12LE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P14BE] = { 1, 1 }, + [AV_PIX_FMT_YUV444P14LE] = { 1, 1 }, + [AV_PIX_FMT_GBRP] = { 1, 0 }, + [AV_PIX_FMT_GBRP9LE] = { 1, 0 }, + [AV_PIX_FMT_GBRP9BE] = { 1, 0 }, + [AV_PIX_FMT_GBRP10LE] = { 1, 0 }, + [AV_PIX_FMT_GBRP10BE] = { 1, 0 }, + [AV_PIX_FMT_GBRP12LE] = { 1, 0 }, + [AV_PIX_FMT_GBRP12BE] = { 1, 0 }, + [AV_PIX_FMT_GBRP14LE] = { 1, 0 }, + [AV_PIX_FMT_GBRP14BE] = { 1, 0 }, + [AV_PIX_FMT_GBRP16LE] = { 1, 0 }, + [AV_PIX_FMT_GBRP16BE] = { 1, 0 }, }; -int sws_isSupportedInput(enum PixelFormat pix_fmt) +int sws_isSupportedInput(enum AVPixelFormat pix_fmt) { - return (unsigned)pix_fmt < PIX_FMT_NB ? + return (unsigned)pix_fmt < AV_PIX_FMT_NB ? format_entries[pix_fmt].is_supported_in : 0; } -int sws_isSupportedOutput(enum PixelFormat pix_fmt) +int sws_isSupportedOutput(enum AVPixelFormat pix_fmt) { - return (unsigned)pix_fmt < PIX_FMT_NB ? + return (unsigned)pix_fmt < AV_PIX_FMT_NB ? format_entries[pix_fmt].is_supported_out : 0; } extern const int32_t ff_yuv2rgb_coeffs[8][4]; #if FF_API_SWS_FORMAT_NAME -const char *sws_format_name(enum PixelFormat format) +const char *sws_format_name(enum AVPixelFormat format) { return av_get_pix_fmt_name(format); } @@ -765,7 +765,7 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode, } #endif /* HAVE_MMXEXT_INLINE */ -static void getSubSampleFactors(int *h, int *v, enum PixelFormat format) +static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format) { *h = av_pix_fmt_descriptors[format].log2_chroma_w; *v = av_pix_fmt_descriptors[format].log2_chroma_h; @@ -817,33 +817,33 @@ int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, return 0; } -static int handle_jpeg(enum PixelFormat *format) +static int handle_jpeg(enum AVPixelFormat *format) { switch (*format) { - case PIX_FMT_YUVJ420P: - *format = PIX_FMT_YUV420P; + case AV_PIX_FMT_YUVJ420P: + *format = AV_PIX_FMT_YUV420P; return 1; - case PIX_FMT_YUVJ422P: - *format = PIX_FMT_YUV422P; + case AV_PIX_FMT_YUVJ422P: + *format = AV_PIX_FMT_YUV422P; return 1; - case PIX_FMT_YUVJ444P: - *format = PIX_FMT_YUV444P; + case AV_PIX_FMT_YUVJ444P: + *format = AV_PIX_FMT_YUV444P; return 1; - case PIX_FMT_YUVJ440P: - *format = PIX_FMT_YUV440P; + case AV_PIX_FMT_YUVJ440P: + *format = AV_PIX_FMT_YUV440P; return 1; default: return 0; } } -static int handle_0alpha(enum PixelFormat *format) +static int handle_0alpha(enum AVPixelFormat *format) { switch (*format) { - case PIX_FMT_0BGR : *format = PIX_FMT_ABGR ; return 1; - case PIX_FMT_BGR0 : *format = PIX_FMT_BGRA ; return 4; - case PIX_FMT_0RGB : *format = PIX_FMT_ARGB ; return 1; - case PIX_FMT_RGB0 : *format = PIX_FMT_RGBA ; return 4; + case AV_PIX_FMT_0BGR : *format = AV_PIX_FMT_ABGR ; return 1; + case AV_PIX_FMT_BGR0 : *format = AV_PIX_FMT_BGRA ; return 4; + case AV_PIX_FMT_0RGB : *format = AV_PIX_FMT_ARGB ; return 1; + case AV_PIX_FMT_RGB0 : *format = AV_PIX_FMT_RGBA ; return 4; default: return 0; } } @@ -871,8 +871,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, int dstH = c->dstH; int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 66, 16); int flags, cpu_flags; - enum PixelFormat srcFormat = c->srcFormat; - enum PixelFormat dstFormat = c->dstFormat; + enum AVPixelFormat srcFormat = c->srcFormat; + enum AVPixelFormat dstFormat = c->dstFormat; cpu_flags = av_get_cpu_flags(); flags = c->flags; @@ -963,12 +963,12 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, * chroma interpolation */ if (flags & SWS_FULL_CHR_H_INT && isAnyRGB(dstFormat) && - dstFormat != PIX_FMT_RGBA && - dstFormat != PIX_FMT_ARGB && - dstFormat != PIX_FMT_BGRA && - dstFormat != PIX_FMT_ABGR && - dstFormat != PIX_FMT_RGB24 && - dstFormat != PIX_FMT_BGR24) { + dstFormat != AV_PIX_FMT_RGBA && + dstFormat != AV_PIX_FMT_ARGB && + dstFormat != AV_PIX_FMT_BGRA && + dstFormat != AV_PIX_FMT_ABGR && + dstFormat != AV_PIX_FMT_RGB24 && + dstFormat != AV_PIX_FMT_BGR24) { av_log(c, AV_LOG_WARNING, "full chroma interpolation for destination format '%s' not yet implemented\n", av_get_pix_fmt_name(dstFormat)); @@ -986,9 +986,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, /* drop every other pixel for chroma calculation unless user * wants full chroma */ if (isAnyRGB(srcFormat) && !(flags & SWS_FULL_CHR_H_INP) && - srcFormat != PIX_FMT_RGB8 && srcFormat != PIX_FMT_BGR8 && - srcFormat != PIX_FMT_RGB4 && srcFormat != PIX_FMT_BGR4 && - srcFormat != PIX_FMT_RGB4_BYTE && srcFormat != PIX_FMT_BGR4_BYTE && + srcFormat != AV_PIX_FMT_RGB8 && srcFormat != AV_PIX_FMT_BGR8 && + srcFormat != AV_PIX_FMT_RGB4 && srcFormat != AV_PIX_FMT_BGR4 && + srcFormat != AV_PIX_FMT_RGB4_BYTE && srcFormat != AV_PIX_FMT_BGR4_BYTE && ((dstW >> c->chrDstHSubSample) <= (srcW >> 1) || (flags & SWS_FAST_BILINEAR))) c->chrSrcHSubSample = 1; @@ -1021,7 +1021,7 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, c->dstBpc = 1 + av_pix_fmt_descriptors[dstFormat].comp[0].depth_minus1; if (c->dstBpc < 8) c->dstBpc = 8; - if (isAnyRGB(srcFormat) || srcFormat == PIX_FMT_PAL8) + if (isAnyRGB(srcFormat) || srcFormat == AV_PIX_FMT_PAL8) c->srcBpc = 16; if (c->dstBpc == 16) dst_stride <<= 1; @@ -1264,9 +1264,9 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter, av_log(c, AV_LOG_INFO, "from %s to %s%s ", av_get_pix_fmt_name(srcFormat), #ifdef DITHER1XBPP - dstFormat == PIX_FMT_BGR555 || dstFormat == PIX_FMT_BGR565 || - dstFormat == PIX_FMT_RGB444BE || dstFormat == PIX_FMT_RGB444LE || - dstFormat == PIX_FMT_BGR444BE || dstFormat == PIX_FMT_BGR444LE ? + dstFormat == AV_PIX_FMT_BGR555 || dstFormat == AV_PIX_FMT_BGR565 || + dstFormat == AV_PIX_FMT_RGB444BE || dstFormat == AV_PIX_FMT_RGB444LE || + dstFormat == AV_PIX_FMT_BGR444BE || dstFormat == AV_PIX_FMT_BGR444LE ? "dithered " : "", #else "", @@ -1301,8 +1301,8 @@ fail: // FIXME replace things by appropriate error codes } #if FF_API_SWS_GETCONTEXT -SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, - int dstW, int dstH, enum PixelFormat dstFormat, +SwsContext *sws_getContext(int srcW, int srcH, enum AVPixelFormat srcFormat, + int dstW, int dstH, enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) { @@ -1714,9 +1714,9 @@ void sws_freeContext(SwsContext *c) } struct SwsContext *sws_getCachedContext(struct SwsContext *context, int srcW, - int srcH, enum PixelFormat srcFormat, + int srcH, enum AVPixelFormat srcFormat, int dstW, int dstH, - enum PixelFormat dstFormat, int flags, + enum AVPixelFormat dstFormat, int flags, SwsFilter *srcFilter, SwsFilter *dstFilter, const double *param) diff --git a/libswscale/x86/swscale.c b/libswscale/x86/swscale.c index de59a2b3e0..e6a0123eb9 100644 --- a/libswscale/x86/swscale.c +++ b/libswscale/x86/swscale.c @@ -113,7 +113,7 @@ void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufI const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input c->blueDither= ff_dither8[dstY&1]; - if (c->dstFormat == PIX_FMT_RGB555 || c->dstFormat == PIX_FMT_BGR555) + if (c->dstFormat == AV_PIX_FMT_RGB555 || c->dstFormat == AV_PIX_FMT_BGR555) c->greenDither= ff_dither8[dstY&1]; else c->greenDither= ff_dither4[dstY&1]; @@ -402,7 +402,7 @@ av_cold void ff_sws_init_swScale_mmx(SwsContext *c) } else if (c->srcBpc == 12) { \ hscalefn = c->dstBpc <= 14 ? ff_hscale12to15_ ## filtersize ## _ ## opt2 : \ ff_hscale12to19_ ## filtersize ## _ ## opt1; \ - } else if (c->srcBpc == 14 || ((c->srcFormat==PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15)) { \ + } else if (c->srcBpc == 14 || ((c->srcFormat==AV_PIX_FMT_PAL8||isAnyRGB(c->srcFormat)) && av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1<15)) { \ hscalefn = c->dstBpc <= 14 ? ff_hscale14to15_ ## filtersize ## _ ## opt2 : \ ff_hscale14to19_ ## filtersize ## _ ## opt1; \ } else { /* c->srcBpc == 16 */ \ @@ -433,7 +433,7 @@ switch(c->dstBpc){ \ default: av_assert0(c->dstBpc>8); \ } #define case_rgb(x, X, opt) \ - case PIX_FMT_ ## X: \ + case AV_PIX_FMT_ ## X: \ c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \ if (!c->chrSrcHSubSample) \ c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \ @@ -445,23 +445,23 @@ switch(c->dstBpc){ \ ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMXEXT); switch (c->srcFormat) { - case PIX_FMT_Y400A: + case AV_PIX_FMT_Y400A: c->lumToYV12 = ff_yuyvToY_mmx; if (c->alpPixBuf) c->alpToYV12 = ff_uyvyToY_mmx; break; - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: c->lumToYV12 = ff_yuyvToY_mmx; c->chrToYV12 = ff_yuyvToUV_mmx; break; - case PIX_FMT_UYVY422: + case AV_PIX_FMT_UYVY422: c->lumToYV12 = ff_uyvyToY_mmx; c->chrToYV12 = ff_uyvyToUV_mmx; break; - case PIX_FMT_NV12: + case AV_PIX_FMT_NV12: c->chrToYV12 = ff_nv12ToUV_mmx; break; - case PIX_FMT_NV21: + case AV_PIX_FMT_NV21: c->chrToYV12 = ff_nv21ToUV_mmx; break; case_rgb(rgb24, RGB24, mmx); @@ -494,23 +494,23 @@ switch(c->dstBpc){ \ ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2, sse2, 1); switch (c->srcFormat) { - case PIX_FMT_Y400A: + case AV_PIX_FMT_Y400A: c->lumToYV12 = ff_yuyvToY_sse2; if (c->alpPixBuf) c->alpToYV12 = ff_uyvyToY_sse2; break; - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: c->lumToYV12 = ff_yuyvToY_sse2; c->chrToYV12 = ff_yuyvToUV_sse2; break; - case PIX_FMT_UYVY422: + case AV_PIX_FMT_UYVY422: c->lumToYV12 = ff_uyvyToY_sse2; c->chrToYV12 = ff_uyvyToUV_sse2; break; - case PIX_FMT_NV12: + case AV_PIX_FMT_NV12: c->chrToYV12 = ff_nv12ToUV_sse2; break; - case PIX_FMT_NV21: + case AV_PIX_FMT_NV21: c->chrToYV12 = ff_nv21ToUV_sse2; break; case_rgb(rgb24, RGB24, sse2); @@ -550,16 +550,16 @@ switch(c->dstBpc){ \ ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx, avx, 1); switch (c->srcFormat) { - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: c->chrToYV12 = ff_yuyvToUV_avx; break; - case PIX_FMT_UYVY422: + case AV_PIX_FMT_UYVY422: c->chrToYV12 = ff_uyvyToUV_avx; break; - case PIX_FMT_NV12: + case AV_PIX_FMT_NV12: c->chrToYV12 = ff_nv12ToUV_avx; break; - case PIX_FMT_NV21: + case AV_PIX_FMT_NV21: c->chrToYV12 = ff_nv21ToUV_avx; break; case_rgb(rgb24, RGB24, avx); diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c index 370a0ebe1b..a09de1892a 100644 --- a/libswscale/x86/swscale_template.c +++ b/libswscale/x86/swscale_template.c @@ -1631,19 +1631,19 @@ static void RENAME(hcscale_fast)(SwsContext *c, int16_t *dst1, int16_t *dst2, static av_cold void RENAME(sws_init_swScale)(SwsContext *c) { - enum PixelFormat dstFormat = c->dstFormat; + enum AVPixelFormat dstFormat = c->dstFormat; c->use_mmx_vfilter= 0; - if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && dstFormat != PIX_FMT_NV12 - && dstFormat != PIX_FMT_NV21 && !(c->flags & SWS_BITEXACT)) { + if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && dstFormat != AV_PIX_FMT_NV12 + && dstFormat != AV_PIX_FMT_NV21 && !(c->flags & SWS_BITEXACT)) { if (c->flags & SWS_ACCURATE_RND) { if (!(c->flags & SWS_FULL_CHR_H_INT)) { switch (c->dstFormat) { - case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break; - case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break; - case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break; - case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break; - case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break; + case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break; + case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break; + case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break; + case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break; + case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break; default: break; } } @@ -1652,34 +1652,34 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) c->yuv2planeX = RENAME(yuv2yuvX ); if (!(c->flags & SWS_FULL_CHR_H_INT)) { switch (c->dstFormat) { - case PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break; - case PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break; - case PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break; - case PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break; - case PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break; + case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break; + case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break; + case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break; + case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break; + case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break; default: break; } } } if (!(c->flags & SWS_FULL_CHR_H_INT)) { switch (c->dstFormat) { - case PIX_FMT_RGB32: + case AV_PIX_FMT_RGB32: c->yuv2packed1 = RENAME(yuv2rgb32_1); c->yuv2packed2 = RENAME(yuv2rgb32_2); break; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: c->yuv2packed1 = RENAME(yuv2bgr24_1); c->yuv2packed2 = RENAME(yuv2bgr24_2); break; - case PIX_FMT_RGB555: + case AV_PIX_FMT_RGB555: c->yuv2packed1 = RENAME(yuv2rgb555_1); c->yuv2packed2 = RENAME(yuv2rgb555_2); break; - case PIX_FMT_RGB565: + case AV_PIX_FMT_RGB565: c->yuv2packed1 = RENAME(yuv2rgb565_1); c->yuv2packed2 = RENAME(yuv2rgb565_2); break; - case PIX_FMT_YUYV422: + case AV_PIX_FMT_YUYV422: c->yuv2packed1 = RENAME(yuv2yuyv422_1); c->yuv2packed2 = RENAME(yuv2yuyv422_2); break; diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c index 9a9220ddba..4d8e79d8d4 100644 --- a/libswscale/x86/yuv2rgb.c +++ b/libswscale/x86/yuv2rgb.c @@ -77,32 +77,32 @@ av_cold SwsFunc ff_yuv2rgb_init_mmx(SwsContext *c) #if HAVE_MMXEXT_INLINE if (cpu_flags & AV_CPU_FLAG_MMXEXT) { switch (c->dstFormat) { - case PIX_FMT_RGB24: return yuv420_rgb24_MMX2; - case PIX_FMT_BGR24: return yuv420_bgr24_MMX2; + case AV_PIX_FMT_RGB24: return yuv420_rgb24_MMX2; + case AV_PIX_FMT_BGR24: return yuv420_bgr24_MMX2; } } #endif if (cpu_flags & AV_CPU_FLAG_MMX) { switch (c->dstFormat) { - case PIX_FMT_RGB32: - if (c->srcFormat == PIX_FMT_YUVA420P) { + case AV_PIX_FMT_RGB32: + if (c->srcFormat == AV_PIX_FMT_YUVA420P) { #if HAVE_7REGS && CONFIG_SWSCALE_ALPHA return yuva420_rgb32_MMX; #endif break; } else return yuv420_rgb32_MMX; - case PIX_FMT_BGR32: - if (c->srcFormat == PIX_FMT_YUVA420P) { + case AV_PIX_FMT_BGR32: + if (c->srcFormat == AV_PIX_FMT_YUVA420P) { #if HAVE_7REGS && CONFIG_SWSCALE_ALPHA return yuva420_bgr32_MMX; #endif break; } else return yuv420_bgr32_MMX; - case PIX_FMT_RGB24: return yuv420_rgb24_MMX; - case PIX_FMT_BGR24: return yuv420_bgr24_MMX; - case PIX_FMT_RGB565: return yuv420_rgb16_MMX; - case PIX_FMT_RGB555: return yuv420_rgb15_MMX; + case AV_PIX_FMT_RGB24: return yuv420_rgb24_MMX; + case AV_PIX_FMT_BGR24: return yuv420_bgr24_MMX; + case AV_PIX_FMT_RGB565: return yuv420_rgb16_MMX; + case AV_PIX_FMT_RGB555: return yuv420_rgb15_MMX; } } #endif /* HAVE_INLINE_ASM */ diff --git a/libswscale/x86/yuv2rgb_template.c b/libswscale/x86/yuv2rgb_template.c index 79e48fd7f0..c879102cc4 100644 --- a/libswscale/x86/yuv2rgb_template.c +++ b/libswscale/x86/yuv2rgb_template.c @@ -43,7 +43,7 @@ if (h_size * depth > FFABS(dstStride[0])) \ h_size -= 8; \ \ - vshift = c->srcFormat != PIX_FMT_YUV422P; \ + vshift = c->srcFormat != AV_PIX_FMT_YUV422P; \ \ __asm__ volatile ("pxor %mm4, %mm4\n\t"); \ for (y = 0; y < srcSliceH; y++) { \ diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c index 073fa665cf..8af3e9037e 100644 --- a/libswscale/yuv2rgb.c +++ b/libswscale/yuv2rgb.c @@ -126,7 +126,7 @@ const int *sws_getCoefficients(int colorspace) { \ int y; \ \ - if (!alpha && c->srcFormat == PIX_FMT_YUV422P) { \ + if (!alpha && c->srcFormat == AV_PIX_FMT_YUV422P) { \ srcStride[1] *= 2; \ srcStride[2] *= 2; \ } \ @@ -625,42 +625,42 @@ SwsFunc ff_yuv2rgb_get_func_ptr(SwsContext *c) av_get_pix_fmt_name(c->srcFormat), av_get_pix_fmt_name(c->dstFormat)); switch (c->dstFormat) { - case PIX_FMT_BGR48BE: - case PIX_FMT_BGR48LE: + case AV_PIX_FMT_BGR48BE: + case AV_PIX_FMT_BGR48LE: return yuv2rgb_c_bgr48; - case PIX_FMT_RGB48BE: - case PIX_FMT_RGB48LE: + case AV_PIX_FMT_RGB48BE: + case AV_PIX_FMT_RGB48LE: return yuv2rgb_c_48; - case PIX_FMT_ARGB: - case PIX_FMT_ABGR: + case AV_PIX_FMT_ARGB: + case AV_PIX_FMT_ABGR: if (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) return yuva2argb_c; - case PIX_FMT_RGBA: - case PIX_FMT_BGRA: + case AV_PIX_FMT_RGBA: + case AV_PIX_FMT_BGRA: return (CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat)) ? yuva2rgba_c : yuv2rgb_c_32; - case PIX_FMT_RGB24: + case AV_PIX_FMT_RGB24: return yuv2rgb_c_24_rgb; - case PIX_FMT_BGR24: + case AV_PIX_FMT_BGR24: return yuv2rgb_c_24_bgr; - case PIX_FMT_RGB565: - case PIX_FMT_BGR565: + case AV_PIX_FMT_RGB565: + case AV_PIX_FMT_BGR565: return yuv2rgb_c_16_ordered_dither; - case PIX_FMT_RGB555: - case PIX_FMT_BGR555: + case AV_PIX_FMT_RGB555: + case AV_PIX_FMT_BGR555: return yuv2rgb_c_15_ordered_dither; - case PIX_FMT_RGB444: - case PIX_FMT_BGR444: + case AV_PIX_FMT_RGB444: + case AV_PIX_FMT_BGR444: return yuv2rgb_c_12_ordered_dither; - case PIX_FMT_RGB8: - case PIX_FMT_BGR8: + case AV_PIX_FMT_RGB8: + case AV_PIX_FMT_BGR8: return yuv2rgb_c_8_ordered_dither; - case PIX_FMT_RGB4: - case PIX_FMT_BGR4: + case AV_PIX_FMT_RGB4: + case AV_PIX_FMT_BGR4: return yuv2rgb_c_4_ordered_dither; - case PIX_FMT_RGB4_BYTE: - case PIX_FMT_BGR4_BYTE: + case AV_PIX_FMT_RGB4_BYTE: + case AV_PIX_FMT_BGR4_BYTE: return yuv2rgb_c_4b_ordered_dither; - case PIX_FMT_MONOBLACK: + case AV_PIX_FMT_MONOBLACK: return yuv2rgb_c_1_ordered_dither; } return NULL; @@ -707,25 +707,25 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], int fullRange, int brightness, int contrast, int saturation) { - const int isRgb = c->dstFormat == PIX_FMT_RGB32 || - c->dstFormat == PIX_FMT_RGB32_1 || - c->dstFormat == PIX_FMT_BGR24 || - c->dstFormat == PIX_FMT_RGB565BE || - c->dstFormat == PIX_FMT_RGB565LE || - c->dstFormat == PIX_FMT_RGB555BE || - c->dstFormat == PIX_FMT_RGB555LE || - c->dstFormat == PIX_FMT_RGB444BE || - c->dstFormat == PIX_FMT_RGB444LE || - c->dstFormat == PIX_FMT_RGB8 || - c->dstFormat == PIX_FMT_RGB4 || - c->dstFormat == PIX_FMT_RGB4_BYTE || - c->dstFormat == PIX_FMT_MONOBLACK; - const int isNotNe = c->dstFormat == PIX_FMT_NE(RGB565LE, RGB565BE) || - c->dstFormat == PIX_FMT_NE(RGB555LE, RGB555BE) || - c->dstFormat == PIX_FMT_NE(RGB444LE, RGB444BE) || - c->dstFormat == PIX_FMT_NE(BGR565LE, BGR565BE) || - c->dstFormat == PIX_FMT_NE(BGR555LE, BGR555BE) || - c->dstFormat == PIX_FMT_NE(BGR444LE, BGR444BE); + const int isRgb = c->dstFormat == AV_PIX_FMT_RGB32 || + c->dstFormat == AV_PIX_FMT_RGB32_1 || + c->dstFormat == AV_PIX_FMT_BGR24 || + c->dstFormat == AV_PIX_FMT_RGB565BE || + c->dstFormat == AV_PIX_FMT_RGB565LE || + c->dstFormat == AV_PIX_FMT_RGB555BE || + c->dstFormat == AV_PIX_FMT_RGB555LE || + c->dstFormat == AV_PIX_FMT_RGB444BE || + c->dstFormat == AV_PIX_FMT_RGB444LE || + c->dstFormat == AV_PIX_FMT_RGB8 || + c->dstFormat == AV_PIX_FMT_RGB4 || + c->dstFormat == AV_PIX_FMT_RGB4_BYTE || + c->dstFormat == AV_PIX_FMT_MONOBLACK; + const int isNotNe = c->dstFormat == AV_PIX_FMT_NE(RGB565LE, RGB565BE) || + c->dstFormat == AV_PIX_FMT_NE(RGB555LE, RGB555BE) || + c->dstFormat == AV_PIX_FMT_NE(RGB444LE, RGB444BE) || + c->dstFormat == AV_PIX_FMT_NE(BGR565LE, BGR565BE) || + c->dstFormat == AV_PIX_FMT_NE(BGR555LE, BGR555BE) || + c->dstFormat == AV_PIX_FMT_NE(BGR444LE, BGR444BE); const int bpp = c->dstFormatBpp; uint8_t *y_table; uint16_t *y_table16; @@ -893,8 +893,8 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4], fill_gv_table(c->table_gV, 1, cgv); break; case 32: - base = (c->dstFormat == PIX_FMT_RGB32_1 || - c->dstFormat == PIX_FMT_BGR32_1) ? 8 : 0; + base = (c->dstFormat == AV_PIX_FMT_RGB32_1 || + c->dstFormat == AV_PIX_FMT_BGR32_1) ? 8 : 0; rbase = base + (isRgb ? 16 : 0); gbase = base + 8; bbase = base + (isRgb ? 0 : 16); diff --git a/tools/fourcc2pixfmt.c b/tools/fourcc2pixfmt.c index 84d5af3eee..6ee085b369 100644 --- a/tools/fourcc2pixfmt.c +++ b/tools/fourcc2pixfmt.c @@ -44,11 +44,11 @@ static void usage(void) "-h print this help\n"); } -static void print_pix_fmt_fourccs(enum PixelFormat pix_fmt, char sep) +static void print_pix_fmt_fourccs(enum AVPixelFormat pix_fmt, char sep) { int i; - for (i = 0; ff_raw_pix_fmt_tags[i].pix_fmt != PIX_FMT_NONE; i++) { + for (i = 0; ff_raw_pix_fmt_tags[i].pix_fmt != AV_PIX_FMT_NONE; i++) { if (ff_raw_pix_fmt_tags[i].pix_fmt == pix_fmt) { char buf[32]; av_get_codec_tag_string(buf, sizeof(buf), ff_raw_pix_fmt_tags[i].fourcc); @@ -89,7 +89,7 @@ int main(int argc, char **argv) } if (list_fourcc_pix_fmt) { - for (i = 0; ff_raw_pix_fmt_tags[i].pix_fmt != PIX_FMT_NONE; i++) { + for (i = 0; ff_raw_pix_fmt_tags[i].pix_fmt != AV_PIX_FMT_NONE; i++) { char buf[32]; av_get_codec_tag_string(buf, sizeof(buf), ff_raw_pix_fmt_tags[i].fourcc); printf("%s: %s\n", buf, av_get_pix_fmt_name(ff_raw_pix_fmt_tags[i].pix_fmt)); @@ -97,7 +97,7 @@ int main(int argc, char **argv) } if (list_pix_fmt_fourccs) { - for (i = 0; i < PIX_FMT_NB; i++) { + for (i = 0; i < AV_PIX_FMT_NB; i++) { const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[i]; if (!pix_desc->name || pix_desc->flags & PIX_FMT_HWACCEL) continue; @@ -108,8 +108,8 @@ int main(int argc, char **argv) } if (pix_fmt_name) { - enum PixelFormat pix_fmt = av_get_pix_fmt(pix_fmt_name); - if (pix_fmt == PIX_FMT_NONE) { + enum AVPixelFormat pix_fmt = av_get_pix_fmt(pix_fmt_name); + if (pix_fmt == AV_PIX_FMT_NONE) { fprintf(stderr, "Invalid pixel format selected '%s'\n", pix_fmt_name); return 1; } |