Commit 716d413c authored by Anton Khirnov's avatar Anton Khirnov

Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat

parent 78071a14
......@@ -299,7 +299,7 @@ typedef struct OutputStream {
const char *attachment_filename;
int copy_initial_nonkeyframes;
enum PixelFormat pix_fmts[2];
enum AVPixelFormat pix_fmts[2];
} OutputStream;
typedef struct OutputFile {
......
......@@ -59,7 +59,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,
......
......@@ -846,7 +846,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
av_opt_get_int(sws_opts, "sws_flags", 0, &ost->sws_flags);
ost->pix_fmts[0] = ost->pix_fmts[1] = PIX_FMT_NONE;
ost->pix_fmts[0] = ost->pix_fmts[1] = AV_PIX_FMT_NONE;
return ost;
}
......@@ -904,7 +904,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
ost->frame_aspect_ratio = parse_frame_aspect_ratio(frame_aspect_ratio);
MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st);
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);
}
......
......@@ -106,7 +106,7 @@ typedef struct VideoPicture {
int width, height; /* source height & width */
int allocated;
int reallocate;
enum PixelFormat pix_fmt;
enum AVPixelFormat pix_fmt;
#if CONFIG_AVFILTER
AVFilterBufferRef *picref;
......@@ -1316,7 +1316,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
#if CONFIG_AVFILTER
AVPicture pict_src;
#else
int dst_pix_fmt = PIX_FMT_YUV420P;
int dst_pix_fmt = AV_PIX_FMT_YUV420P;
#endif
/* wait until we have space to put a new picture */
SDL_LockMutex(is->pictq_mutex);
......
......@@ -630,8 +630,8 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
&display_aspect_ratio));
}
probe_str("pix_fmt",
dec_ctx->pix_fmt != PIX_FMT_NONE ? av_pix_fmt_descriptors[dec_ctx->pix_fmt].name
: "unknown");
dec_ctx->pix_fmt != AV_PIX_FMT_NONE ?
av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
probe_int("level", dec_ctx->level);
break;
......
......@@ -686,8 +686,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",
......@@ -866,7 +866,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"
......@@ -882,7 +882,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];
printf("%c%c%c%c%c %-16s %d %2d\n",
sws_isSupportedInput (pix_fmt) ? 'I' : '.',
......
......@@ -416,7 +416,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
......
......@@ -2132,7 +2132,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=320:240:6:1:24
......
......@@ -900,9 +900,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;
}
......
......@@ -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
......@@ -95,7 +95,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if (planes == 4)
planes--;
px_inc = planes + (avctx->pix_fmt == PIX_FMT_RGB32);
px_inc = planes + (avctx->pix_fmt == AV_PIX_FMT_RGB32);
for (p = 0; p < planes; p++) {
/* Lines length pointer for this plane */
......@@ -170,7 +170,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
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;
......@@ -182,7 +182,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
......
......@@ -379,7 +379,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,
};
......@@ -44,7 +44,7 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx)
s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_BGR24;
avctx->pix_fmt = AV_PIX_FMT_BGR24;
return 0;
}
......
......@@ -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;
s->frame.reference = 1;
bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);
......
......@@ -74,7 +74,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 = ff_vga16_font;
......
......@@ -345,7 +345,7 @@ static void video_encode_example(const char *filename)
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;
/* open it */
if (avcodec_open2(c, codec, NULL) < 0) {
......
......@@ -553,7 +553,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;
a->inv_qscale= avctx->extradata[0];
if(a->inv_qscale == 0){
......@@ -649,7 +649,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
......@@ -662,7 +662,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
......@@ -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;
return 0;
}
......
......@@ -1011,7 +1011,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.
......@@ -1492,13 +1492,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 overriden 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.
......@@ -1545,7 +1545,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
......@@ -2931,7 +2931,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
......@@ -3032,7 +3032,7 @@ typedef struct AVHWAccel {
*
* Only hardware accelerated formats are supported here.
*/
enum PixelFormat pix_fmt;
enum AVPixelFormat pix_fmt;
/**
* Hardware accelerated codec capabilities.
......@@ -4135,7 +4135,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().
......@@ -4167,7 +4167,7 @@ void avpicture_free(AVPicture *picture);
* @return size of the image data in bytes
*/
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.
......@@ -4184,7 +4184,8 @@ int avpicture_fill(AVPicture *picture, uint8_t *ptr,
* @param[in] dest_size The size of 'dest'.
* @return The number of bytes written to dest, or a negative value (error code) on error.
*/
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);
/**
......@@ -4199,29 +4200,29 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
* @param height the height of the image
* @return Image data size in bytes or -1 on error (e.g. too large dimensions).
*/
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_picture_data_copy() above.
*/
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);
/**
......@@ -4244,14 +4245,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 */
......@@ -4277,7 +4278,7 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
* @param[in] has_alpha Whether the source pixel format alpha channel is used.
* @return Combination of flags informing you what kind of losses will occur.
*/
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
......@@ -4294,8 +4295,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
* pix_fmt_mask parameter.
*
* @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
*
......@@ -4306,7 +4307,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 */
......@@ -4321,17 +4322,17 @@ 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_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);
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);
/**
* @}
......
......@@ -157,7 +157,7 @@ avs_decode_frame(AVCodecContext * avctx,
static av_cold int avs_decode_init(AVCodecContext * avctx)
{
avctx->pix_fmt = PIX_FMT_PAL8;
avctx->pix_fmt = AV_PIX_FMT_PAL8;
avcodec_set_dimensions(avctx, 318, 198);
return 0;
}
......
......@@ -43,7 +43,7 @@ static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
vid->frame.reference = 1;
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;
}
......
......@@ -39,7 +39,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;
bfi->dst = av_mallocz(avctx->width * avctx->height);
return 0;
}
......
......@@ -1296,7 +1296,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);
......
......@@ -136,7 +136,7 @@ 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:
......@@ -155,21 +155,21 @@ static int bmp_decode_frame(AVCodecContext *avctx,
rgb[2] = 0;
}
avctx->pix_fmt = PIX_FMT_BGR24;
avctx->pix_fmt = AV_PIX_FMT_BGR24;
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);
......@@ -178,14 +178,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;
......@@ -196,7 +196,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;
}
......@@ -236,7 +236,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);
......
......@@ -37,23 +37,23 @@ static av_cold int bmp_encode_init(AVCodecContext *avctx){
avctx->coded_frame = &s->picture;
switch (avctx->pix_fmt) {
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:
......@@ -78,26 +78,26 @@ 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: