const char *attachment_filename;
int copy_initial_nonkeyframes;
- enum PixelFormat pix_fmts[2];
+ enum AVPixelFormat pix_fmts[2];
} OutputStream;
typedef struct OutputFile {
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,
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;
}
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);
}
int width, height; /* source height & width */
int allocated;
int reallocate;
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
#if CONFIG_AVFILTER
AVFilterBufferRef *picref;
#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);
&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;
}
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",
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"
# 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' : '.',
int linesize[4];
int h, w;
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
int refcount;
struct FrameBuffer **pool; ///< head of the buffer pool
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
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;
}
#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
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 */
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;
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
.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,
};
.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,
};
s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_BGR24;
+ avctx->pix_fmt = AV_PIX_FMT_BGR24;
return 0;
}
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);
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;
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) {
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){
.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
.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
/* 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;
}
/**
* 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.
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.
* - 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
*/
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
*
* Only hardware accelerated formats are supported here.
*/
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
/**
* Hardware accelerated codec capabilities.
* @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().
* @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.
* @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);
/**
* @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);
/**
* @{
*/
-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 */
* @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
* 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
*
* @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 */
* 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);
/**
* @}
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;
}
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;
}
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;
}
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);
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:
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);
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;
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;
}
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);
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:
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:
ff_set_systematic_pal2((uint32_t*)p->data[1], avctx->pix_fmt);
- 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;
}
.priv_data_size = sizeof(BMPContext),
.init = bmp_encode_init,
.encode2 = bmp_encode_frame,
- .pix_fmts = (const enum PixelFormat[]){
- PIX_FMT_BGR24,
- PIX_FMT_RGB555, PIX_FMT_RGB444, PIX_FMT_RGB565,
- 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_BGR24,
+ AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, AV_PIX_FMT_RGB565,
+ 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)"),
};
BMVDecContext * const c = avctx->priv_data;
c->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
c->pic.reference = 1;
if (avctx->get_buffer(avctx, &c->pic) < 0) {
static av_cold int decode_init(AVCodecContext *avctx)
{
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0;
}
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;
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;
}
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);
// 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;
}
s->frame.data[0] = NULL;
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);
}
.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"),
};
#endif
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);
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);
CamStudioContext *c = avctx->priv_data;
int stride;
switch (avctx->bits_per_coded_sample) {
- case 16: avctx->pix_fmt = PIX_FMT_RGB555; break;
- case 24: avctx->pix_fmt = PIX_FMT_BGR24; break;
- case 32: avctx->pix_fmt = PIX_FMT_RGB32; break;
+ case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
+ case 24: avctx->pix_fmt = AV_PIX_FMT_BGR24; break;
+ case 32: avctx->pix_fmt = AV_PIX_FMT_RGB32; break;
default:
av_log(avctx, AV_LOG_ERROR,
"CamStudio codec error: invalid depth %i bpp\n",
if (s->width & 0x3)
return -1;
s->height = avctx->height;
- avctx->pix_fmt = PIX_FMT_YUV411P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV411P;
return 0;
}
DfaContext *s = avctx->priv_data;
int ret;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
return ret;
};
/* [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.
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);
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);
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:
.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,
};
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;
break;
case 10:
- avctx->pix_fmt = PIX_FMT_RGB48;
+ avctx->pix_fmt = AV_PIX_FMT_RGB48;
target_packet_size = 6;
source_packet_size = 4;
break;
case 12:
case 16:
if (endian) {
- avctx->pix_fmt = PIX_FMT_RGB48BE;
+ avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
} else {
- avctx->pix_fmt = PIX_FMT_RGB48LE;
+ avctx->pix_fmt = AV_PIX_FMT_RGB48LE;
}
target_packet_size = 6;
source_packet_size = elements * 2;
s->descriptor = 50; /* RGB */
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;
default:
.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_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_NONE},
.long_name = NULL_IF_CONFIG_SMALL("DPX image"),
};
unsigned int i;
cin->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
cin->frame.data[0] = NULL;
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);
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 {
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++) {
* 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 */
.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)"),
};
.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,
.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,
.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,
.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,
.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,
.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,
.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,
.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,
.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,
.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,
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 */
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 {
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;
{
DxaDecContext * const c = avctx->priv_data;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
c->dsize = avctx->width * avctx->height * 2;
if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {
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);
.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,
.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,
.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,
.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,
static av_cold int cmv_decode_init(AVCodecContext *avctx){
CmvContext *s = avctx->priv_data;
s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0;
}
{
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);
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;
}
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;
return 0;
}
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;
}
{
Escape124Context *s = avctx->priv_data;
- avctx->pix_fmt = PIX_FMT_RGB555;
+ avctx->pix_fmt = AV_PIX_FMT_RGB555;
s->num_superblocks = ((unsigned)avctx->width / 8) *
((unsigned)avctx->height / 8);
avctx->coded_frame= &s->picture;
switch(avctx->pix_fmt){
- case PIX_FMT_YUV444P16:
- case PIX_FMT_YUV422P16:
- case PIX_FMT_YUV420P16:
+ case AV_PIX_FMT_YUV444P16:
+ case AV_PIX_FMT_YUV422P16:
+ case AV_PIX_FMT_YUV420P16:
if(avctx->bits_per_raw_sample <=8){
av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n");
return -1;
return -1;
}
s->version= FFMAX(s->version, 1);
- case PIX_FMT_YUV444P:
- case PIX_FMT_YUV422P:
- case PIX_FMT_YUV420P:
- 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_YUV411P:
+ case AV_PIX_FMT_YUV410P:
s->colorspace= 0;
break;
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
s->colorspace= 1;
break;
default:
if(f->colorspace==0){
if(f->avctx->bits_per_raw_sample<=8){
switch(16*f->chroma_h_shift + f->chroma_v_shift){
- case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; 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 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{
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;
av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\n");
return -1;
}
- f->avctx->pix_fmt= PIX_FMT_RGB32;
+ f->avctx->pix_fmt= AV_PIX_FMT_RGB32;
}else{
av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");
return -1;
.encode2 = encode_frame,
.close = common_end,
.capabilities = CODEC_CAP_SLICE_THREADS,
- .pix_fmts = (const enum PixelFormat[]){
- PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P,
- PIX_FMT_YUV410P, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16,
- PIX_FMT_YUV444P16, PIX_FMT_NONE
+ .pix_fmts = (const enum AVPixelFormat[]){
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
+ AV_PIX_FMT_YUV410P, AV_PIX_FMT_RGB32, AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16,
+ AV_PIX_FMT_YUV444P16, AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
};
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;
s->frame.data[0] = NULL;
return 0;
.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 */
.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 */
.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"),
};
}
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 :
{
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);
}
.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,
};
FrapsContext * const s = avctx->priv_data;
avctx->coded_frame = &s->frame;
- avctx->pix_fmt= PIX_FMT_NONE; /* set in decode_frame */
+ avctx->pix_fmt= AV_PIX_FMT_NONE; /* set in decode_frame */
s->avctx = avctx;
s->tmpbuf = NULL;
uint32_t *luma1,*luma2,*cb,*cr;
uint32_t offs[4];
int i, j, is_chroma, planes;
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
header = AV_RL32(buf);
version = header & 0xff;
if (header_size == 8)
buf+=4;
- 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);
}
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)
.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)"),
};
if (gif_read_header1(s) < 0)
return -1;
- 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);
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;
.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,
};
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;
7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10,
};
-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
};
/**
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 8:
if (CHROMA444) {
if (s->avctx->colorspace == AVCOL_SPC_RGB) {
- s->avctx->pix_fmt = PIX_FMT_GBRP;
+ s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
} else
- 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;
} 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 ?
.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),
};
#endif
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:
avctx->coded_frame = &s->picture;
switch (avctx->pix_fmt) {
- case PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUV420P:
s->bitstream_bpp = 12;
break;
- case PIX_FMT_YUV422P:
+ case AV_PIX_FMT_YUV422P:
s->bitstream_bpp = 16;
break;
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
s->bitstream_bpp = 24;
break;
default:
}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");
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]);
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;
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
- .pix_fmts = (const enum PixelFormat[]){
- PIX_FMT_YUV422P, PIX_FMT_RGB32, PIX_FMT_NONE
+ .pix_fmts = (const enum AVPixelFormat[]){
+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
};
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
- .pix_fmts = (const enum PixelFormat[]){
- PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_RGB32, PIX_FMT_NONE
+ .pix_fmts = (const enum AVPixelFormat[]){
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"),
};
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) {
if (avctx->bits_per_coded_sample <= 8) {
avctx->pix_fmt = (avctx->bits_per_coded_sample < 8 ||
- avctx->extradata_size) ? PIX_FMT_PAL8
- : PIX_FMT_GRAY8;
+ avctx->extradata_size) ? AV_PIX_FMT_PAL8
+ : AV_PIX_FMT_GRAY8;
} else if (avctx->bits_per_coded_sample <= 32) {
- avctx->pix_fmt = PIX_FMT_BGR32;
+ avctx->pix_fmt = AV_PIX_FMT_BGR32;
} else {
return AVERROR_INVALIDDATA;
}
} 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_GRAY8) {
+ } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != AV_PIX_FMT_GRAY8) {
if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 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);
buf += 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);
}
}
}
- } else if (avctx->pix_fmt == PIX_FMT_PAL8 || avctx->pix_fmt == PIX_FMT_GRAY8) { // IFF-PBM
+ } else if (avctx->pix_fmt == AV_PIX_FMT_PAL8 || avctx->pix_fmt == AV_PIX_FMT_GRAY8) { // IFF-PBM
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));
} 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_GRAY8) {
+ } else if (avctx->bits_per_coded_sample <= 8 && avctx->pix_fmt != AV_PIX_FMT_GRAY8) {
if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 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);
decodeplane8(row, s->planebuf, s->planesize, plane);
}
}
- } 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);
} 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] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUV422P] = {
+ [AV_PIX_FMT_YUV422P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUV444P] = {
+ [AV_PIX_FMT_YUV444P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUYV422] = {
+ [AV_PIX_FMT_YUYV422] = {
.nb_channels = 1,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_UYVY422] = {
+ [AV_PIX_FMT_UYVY422] = {
.nb_channels = 1,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_YUV410P] = {
+ [AV_PIX_FMT_YUV410P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUV411P] = {
+ [AV_PIX_FMT_YUV411P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUV440P] = {
+ [AV_PIX_FMT_YUV440P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUV420P16LE] = {
+ [AV_PIX_FMT_YUV420P16LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
- [PIX_FMT_YUV422P16LE] = {
+ [AV_PIX_FMT_YUV422P16LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
- [PIX_FMT_YUV444P16LE] = {
+ [AV_PIX_FMT_YUV444P16LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
- [PIX_FMT_YUV420P16BE] = {
+ [AV_PIX_FMT_YUV420P16BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
- [PIX_FMT_YUV422P16BE] = {
+ [AV_PIX_FMT_YUV422P16BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
- [PIX_FMT_YUV444P16BE] = {
+ [AV_PIX_FMT_YUV444P16BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
/* YUV formats with alpha plane */
- [PIX_FMT_YUVA420P] = {
+ [AV_PIX_FMT_YUVA420P] = {
.nb_channels = 4,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
},
/* JPEG YUV */
- [PIX_FMT_YUVJ420P] = {
+ [AV_PIX_FMT_YUVJ420P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUVJ422P] = {
+ [AV_PIX_FMT_YUVJ422P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUVJ444P] = {
+ [AV_PIX_FMT_YUVJ444P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_YUVJ440P] = {
+ [AV_PIX_FMT_YUVJ440P] = {
.nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR,
},
/* RGB formats */
- [PIX_FMT_RGB24] = {
+ [AV_PIX_FMT_RGB24] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_BGR24] = {
+ [AV_PIX_FMT_BGR24] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_ARGB] = {
+ [AV_PIX_FMT_ARGB] = {
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_RGB48BE] = {
+ [AV_PIX_FMT_RGB48BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 16,
},
- [PIX_FMT_RGB48LE] = {
+ [AV_PIX_FMT_RGB48LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 16,
},
- [PIX_FMT_RGB565BE] = {
+ [AV_PIX_FMT_RGB565BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
- [PIX_FMT_RGB565LE] = {
+ [AV_PIX_FMT_RGB565LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
- [PIX_FMT_RGB555BE] = {
+ [AV_PIX_FMT_RGB555BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
- [PIX_FMT_RGB555LE] = {
+ [AV_PIX_FMT_RGB555LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
- [PIX_FMT_RGB444BE] = {
+ [AV_PIX_FMT_RGB444BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 4,
},
- [PIX_FMT_RGB444LE] = {
+ [AV_PIX_FMT_RGB444LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
},
/* gray / mono formats */
- [PIX_FMT_GRAY16BE] = {
+ [AV_PIX_FMT_GRAY16BE] = {
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
- [PIX_FMT_GRAY16LE] = {
+ [AV_PIX_FMT_GRAY16LE] = {
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 16,
},
- [PIX_FMT_GRAY8] = {
+ [AV_PIX_FMT_GRAY8] = {
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_MONOWHITE] = {
+ [AV_PIX_FMT_MONOWHITE] = {
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 1,
},
- [PIX_FMT_MONOBLACK] = {
+ [AV_PIX_FMT_MONOBLACK] = {
.nb_channels = 1,
.color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR,
},
/* paletted formats */
- [PIX_FMT_PAL8] = {
+ [AV_PIX_FMT_PAL8] = {
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PALETTE,
.depth = 8,
},
- [PIX_FMT_UYYVYY411] = {
+ [AV_PIX_FMT_UYYVYY411] = {
.nb_channels = 1,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_ABGR] = {
+ [AV_PIX_FMT_ABGR] = {
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_BGR565BE] = {
+ [AV_PIX_FMT_BGR565BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
- [PIX_FMT_BGR565LE] = {
+ [AV_PIX_FMT_BGR565LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
- [PIX_FMT_BGR555BE] = {
+ [AV_PIX_FMT_BGR555BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
- [PIX_FMT_BGR555LE] = {
+ [AV_PIX_FMT_BGR555LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 5,
},
- [PIX_FMT_BGR444BE] = {
+ [AV_PIX_FMT_BGR444BE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 4,
},
- [PIX_FMT_BGR444LE] = {
+ [AV_PIX_FMT_BGR444LE] = {
.nb_channels = 3,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 4,
},
- [PIX_FMT_RGB8] = {
+ [AV_PIX_FMT_RGB8] = {
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_RGB4] = {
+ [AV_PIX_FMT_RGB4] = {
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 4,
},
- [PIX_FMT_RGB4_BYTE] = {
+ [AV_PIX_FMT_RGB4_BYTE] = {
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_BGR8] = {
+ [AV_PIX_FMT_BGR8] = {
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_BGR4] = {
+ [AV_PIX_FMT_BGR4] = {
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 4,
},
- [PIX_FMT_BGR4_BYTE] = {
+ [AV_PIX_FMT_BGR4_BYTE] = {
.nb_channels = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_NV12] = {
+ [AV_PIX_FMT_NV12] = {
.nb_channels = 2,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_NV21] = {
+ [AV_PIX_FMT_NV21] = {
.nb_channels = 2,
.color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR,
.depth = 8,
},
- [PIX_FMT_BGRA] = {
+ [AV_PIX_FMT_BGRA] = {
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
.depth = 8,
},
- [PIX_FMT_RGBA] = {
+ [AV_PIX_FMT_RGBA] = {
.nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED,
},
};
-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)
{
int ret;
return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize);
}
-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)
{
int i, j, nb_planes = 0, linesizes[4];
return 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)
{
AVPicture dummy_pict;
if(av_image_check_size(width, height, 0, NULL))
return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height);
}
-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;
loss = 0;
pf = &pix_fmt_info[dst_pix_fmt];
if (pf->depth < ps->depth ||
- ((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE ||
- dst_pix_fmt == PIX_FMT_BGR555BE || dst_pix_fmt == PIX_FMT_BGR555LE) &&
- (src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE ||
- src_pix_fmt == PIX_FMT_BGR565BE || src_pix_fmt == PIX_FMT_BGR565LE)))
+ ((dst_pix_fmt == AV_PIX_FMT_RGB555BE || dst_pix_fmt == AV_PIX_FMT_RGB555LE ||
+ dst_pix_fmt == AV_PIX_FMT_BGR555BE || dst_pix_fmt == AV_PIX_FMT_BGR555LE) &&
+ (src_pix_fmt == AV_PIX_FMT_RGB565BE || src_pix_fmt == AV_PIX_FMT_RGB565LE ||
+ src_pix_fmt == AV_PIX_FMT_BGR565BE || src_pix_fmt == AV_PIX_FMT_BGR565LE)))
loss |= FF_LOSS_DEPTH;
if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
return loss;
}
-static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
+static int avg_bits_per_pixel(enum AVPixelFormat pix_fmt)
{
int bits;
const PixFmtInfo *pf;
switch(pf->pixel_type) {
case FF_PIXEL_PACKED:
switch(pix_fmt) {
- case PIX_FMT_YUYV422:
- case PIX_FMT_UYVY422:
- case PIX_FMT_RGB565BE:
- case PIX_FMT_RGB565LE:
- case PIX_FMT_RGB555BE:
- case PIX_FMT_RGB555LE:
- case PIX_FMT_RGB444BE:
- case PIX_FMT_RGB444LE:
- case PIX_FMT_BGR565BE:
- case PIX_FMT_BGR565LE:
- case PIX_FMT_BGR555BE:
- case PIX_FMT_BGR555LE:
- case PIX_FMT_BGR444BE:
- case PIX_FMT_BGR444LE:
+ case AV_PIX_FMT_YUYV422:
+ case AV_PIX_FMT_UYVY422:
+ case AV_PIX_FMT_RGB565BE:
+ case AV_PIX_FMT_RGB565LE:
+ case AV_PIX_FMT_RGB555BE:
+ case AV_PIX_FMT_RGB555LE:
+ case AV_PIX_FMT_RGB444BE:
+ case AV_PIX_FMT_RGB444LE:
+ case AV_PIX_FMT_BGR565BE:
+ case AV_PIX_FMT_BGR565LE:
+ case AV_PIX_FMT_BGR555BE:
+ case AV_PIX_FMT_BGR555LE:
+ case AV_PIX_FMT_BGR444BE:
+ case AV_PIX_FMT_BGR444LE:
bits = 16;
break;
- case PIX_FMT_UYYVYY411:
+ case AV_PIX_FMT_UYYVYY411:
bits = 12;
break;
default:
return bits;
}
-static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_list,
- enum PixelFormat src_pix_fmt,
+static enum AVPixelFormat avcodec_find_best_pix_fmt1(enum AVPixelFormat *pix_fmt_list,
+ enum AVPixelFormat src_pix_fmt,
int has_alpha,
int loss_mask)
{
int dist, i, loss, min_dist;
- enum PixelFormat dst_pix_fmt;
+ enum AVPixelFormat dst_pix_fmt;
/* find exact color match with smallest size */
- dst_pix_fmt = PIX_FMT_NONE;
+ dst_pix_fmt = AV_PIX_FMT_NONE;
min_dist = 0x7fffffff;
i = 0;
- while (pix_fmt_list[i] != PIX_FMT_NONE) {
- enum PixelFormat pix_fmt = pix_fmt_list[i];
+ while (pix_fmt_list[i] != AV_PIX_FMT_NONE) {
+ enum AVPixelFormat pix_fmt = pix_fmt_list[i];
- if (i > PIX_FMT_NB) {
+ if (i > AV_PIX_FMT_NB) {
av_log(NULL, AV_LOG_ERROR, "Pixel format list longer than expected, "
"it is either not properly terminated or contains duplicates\n");
- return PIX_FMT_NONE;
+ return AV_PIX_FMT_NONE;
}
loss = avcodec_get_pix_fmt_loss(pix_fmt, src_pix_fmt, has_alpha) & loss_mask;
}
#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 list[64];
+ enum AVPixelFormat list[64];
int i, j = 0;
// test only the first 64 pixel formats to avoid undefined behaviour
if (pix_fmt_mask & (1ULL << i))
list[j++] = i;
}
- list[j] = PIX_FMT_NONE;
+ list[j] = AV_PIX_FMT_NONE;
return avcodec_find_best_pix_fmt2(list, src_pix_fmt, has_alpha, loss_ptr);
}
#endif /* FF_API_FIND_BEST_PIX_FMT */
-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)
{
- enum PixelFormat dst_pix_fmt;
+ enum AVPixelFormat dst_pix_fmt;
int loss_mask, i;
static const int loss_mask_order[] = {
~0, /* no loss first */
if (loss_mask == 0)
break;
}
- return PIX_FMT_NONE;
+ return AV_PIX_FMT_NONE;
found:
if (loss_ptr)
*loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
}
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, src->data,
src->linesize, pix_fmt, width, height);
int avpicture_alloc(AVPicture *picture,
- enum PixelFormat pix_fmt, int width, int height)
+ enum AVPixelFormat pix_fmt, int width, int height)
{
int ret;
}
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 || !is_yuv_planar(&pix_fmt_info[pix_fmt]))
+ if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB || !is_yuv_planar(&pix_fmt_info[pix_fmt]))
return -1;
y_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;
}
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;
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_info[pix_fmt])) return -1;
for (i = 0; i < 3; i++) {
}
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;
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;
}
}
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;
ctx->avctx = avctx;
ctx->width = avctx->width;
ctx->height = avctx->height;
- avctx->pix_fmt = PIX_FMT_YUV410P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV410P;
build_requant_tab();
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;
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;
}
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;
/**
* 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
* @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.
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);
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;
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
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);
zero = av_mallocz(p->linesize[0]);
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++) {
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++) {
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};
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};
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;
}
.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"),
};
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;
}
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;
c->setpal = 1;
}
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0;
}
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];
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;
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");
}
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");
}
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");
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");
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:
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;
}
.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"),
};
// 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
-
-#define GRAY_PIXEL_FORMATS PIX_FMT_GRAY8, PIX_FMT_Y400A, \
- PIX_FMT_GRAY16
-
-#define YUV_PIXEL_FORMATS PIX_FMT_YUV410P, PIX_FMT_YUV411P, \
- PIX_FMT_YUVA420P, \
- PIX_FMT_YUV420P, PIX_FMT_YUV422P, \
- PIX_FMT_YUV440P, PIX_FMT_YUV444P, \
- PIX_FMT_YUV420P9, PIX_FMT_YUV422P9, \
- PIX_FMT_YUV444P9, \
- PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, \
- PIX_FMT_YUV444P10, \
- PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, \
- PIX_FMT_YUV444P16
-
-static const enum PixelFormat rgb_pix_fmts[] = {RGB_PIXEL_FORMATS};
-static const enum PixelFormat gray_pix_fmts[] = {GRAY_PIXEL_FORMATS};
-static const enum PixelFormat yuv_pix_fmts[] = {YUV_PIXEL_FORMATS};
-static const enum PixelFormat any_pix_fmts[] = {RGB_PIXEL_FORMATS,
+#define RGB_PIXEL_FORMATS AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, \
+ AV_PIX_FMT_RGB48
+
+#define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8, AV_PIX_FMT_Y400A, \
+ 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_YUV440P, AV_PIX_FMT_YUV444P, \
+ 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_YUV420P16, AV_PIX_FMT_YUV422P16, \
+ AV_PIX_FMT_YUV444P16
+
+static const enum AVPixelFormat rgb_pix_fmts[] = {RGB_PIXEL_FORMATS};
+static const enum AVPixelFormat gray_pix_fmts[] = {GRAY_PIXEL_FORMATS};
+static const enum AVPixelFormat yuv_pix_fmts[] = {YUV_PIXEL_FORMATS};
+static const enum AVPixelFormat any_pix_fmts[] = {RGB_PIXEL_FORMATS,
GRAY_PIXEL_FORMATS,
YUV_PIXEL_FORMATS};
} LibOpenJPEGContext;
static int libopenjpeg_matches_pix_fmt(const opj_image_t *img,
- enum PixelFormat pix_fmt)
+ enum AVPixelFormat pix_fmt)
{
AVPixFmtDescriptor des = av_pix_fmt_descriptors[pix_fmt];
int match = 1;
return match;
}
-static enum PixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *image)
+static 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) {
}
}
- 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;
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");
ret = AVERROR_INVALIDDATA;
goto done;
sub_dy[2] = 1 << av_pix_fmt_descriptors[avctx->pix_fmt].log2_chroma_h;
switch (avctx->pix_fmt) {
- case PIX_FMT_GRAY8:
- case PIX_FMT_GRAY16:
- case PIX_FMT_Y400A:
+ case AV_PIX_FMT_GRAY8:
+ case AV_PIX_FMT_GRAY16:
+ case AV_PIX_FMT_Y400A:
color_space = CLRSPC_GRAY;
break;
- case PIX_FMT_RGB24:
- case PIX_FMT_RGBA:
- case PIX_FMT_RGB48:
+ case AV_PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGB48:
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_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_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_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:
color_space = CLRSPC_SYCC;
break;
default:
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_Y400A:
+ case AV_PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGBA:
+ case AV_PIX_FMT_Y400A:
libopenjpeg_copy_packed8(avctx, frame, image);
break;
- case PIX_FMT_RGB48:
+ case AV_PIX_FMT_RGB48:
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 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:
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_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_YUV444P16:
+ case AV_PIX_FMT_YUV422P16:
+ case AV_PIX_FMT_YUV420P16:
libopenjpeg_copy_unpacked16(avctx, frame, image);
break;
default:
.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_GRAY8, PIX_FMT_GRAY16, PIX_FMT_Y400A,
- PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUVA420P,
- PIX_FMT_YUV440P, PIX_FMT_YUV444P,
- PIX_FMT_YUV411P, PIX_FMT_YUV410P,
- PIX_FMT_YUV420P9, PIX_FMT_YUV422P9, PIX_FMT_YUV444P9,
- PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, PIX_FMT_YUV444P10,
- 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_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_Y400A,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ 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_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,
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 },
};
/**
/**
* Returns Libav 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]);
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)
.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"),
};
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");
.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"),
};
return AVERROR(EINVAL);
}
- avctx->pix_fmt = PIX_FMT_YUV420P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
return 0;
}
.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,
return 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;
};
return 0;
}
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;
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 av_cold void X264_init_static(AVCodec *codec)
.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,
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;
}
.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"),
};
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
s->header_bits= put_bits_count(&s->pb);
- if(avctx->pix_fmt == PIX_FMT_BGRA){
+ if(avctx->pix_fmt == AV_PIX_FMT_BGRA){
int x, y, i;
const int linesize= p->linesize[0];
uint16_t (*buffer)[4]= (void *) s->rd_scratchpad;
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);
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;
}
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) ;
switch (pix_fmt_id) {
case 0x11111100:
if (s->rgb)
- s->avctx->pix_fmt = PIX_FMT_BGRA;
+ s->avctx->pix_fmt = AV_PIX_FMT_BGRA;
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;
assert(s->nb_components == 3);
break;
case 0x11000000:
- s->avctx->pix_fmt = PIX_FMT_GRAY8;
+ s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
break;
case 0x12111100:
- 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;
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;
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;
break;
default:
av_log(s->avctx, AV_LOG_ERROR, "Unhandled pixel format 0x%x\n", pix_fmt_id);
}
if (s->ls) {
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])
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);
}
put_bits(&s->pb, 16, 17);
- if(lossless && s->avctx->pix_fmt == PIX_FMT_BGRA)
+ if(lossless && s->avctx->pix_fmt == AV_PIX_FMT_BGRA)
put_bits(&s->pb, 8, 9); /* 9 bits/component RCT */
else
put_bits(&s->pb, 8, 8); /* 8 bits/component */
.init = ff_MPV_encode_init,
.encode2 = ff_MPV_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("MJPEG (Motion JPEG)"),
};
s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
s->frame.reference = 1;
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;
return 0;
}
}
}
-static const enum PixelFormat pixfmt_xvmc_mpg2_420[] = {
- PIX_FMT_XVMC_MPEG2_IDCT,
- PIX_FMT_XVMC_MPEG2_MC,
- PIX_FMT_NONE };
+static const enum AVPixelFormat pixfmt_xvmc_mpg2_420[] = {
+ AV_PIX_FMT_XVMC_MPEG2_IDCT,
+ AV_PIX_FMT_XVMC_MPEG2_MC,
+ AV_PIX_FMT_NONE };
-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;
return avctx->get_format(avctx, pixfmt_xvmc_mpg2_420);
else if (avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU) {
if (avctx->codec_id == AV_CODEC_ID_MPEG1VIDEO)
- return PIX_FMT_VDPAU_MPEG1;
+ return AV_PIX_FMT_VDPAU_MPEG1;
else
- return PIX_FMT_VDPAU_MPEG2;
+ return AV_PIX_FMT_VDPAU_MPEG2;
} else {
if (s->chroma_format < 2)
return avctx->get_format(avctx, ff_hwaccel_pixfmt_list_420);
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;
}
}
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 ||
s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
if (avctx->idct_algo == FF_IDCT_AUTO)
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 ||
s->avctx->codec->capabilities & CODEC_CAP_HWACCEL_VDPAU)
if (avctx->idct_algo == FF_IDCT_AUTO)
avctx->idct_algo = FF_IDCT_SIMPLE;
}
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;
.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 | CODEC_CAP_SLICE_THREADS,
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
.priv_class = &mpeg1_class,
.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_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"),
.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 },
};
#endif
.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,
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 *restrict p,
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;
}
*/
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;
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_BGRA &&
- ((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_BGRA &&
+ ((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;
}
break;
case AV_CODEC_ID_MJPEG:
- 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;
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_BGRA) {
+ avctx->pix_fmt == AV_PIX_FMT_BGRA) {
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;
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;
.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,
};
.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,
};
.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,
};
.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,
};
.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,
};
switch (avctx->bits_per_coded_sample) {
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");
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;
}
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;
}
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;
}
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);
}
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;
}
}
}
- avctx->pix_fmt = PIX_FMT_YUV420P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
avctx->coded_frame = &c->pic;
init_coders(c);
}
}
- avctx->pix_fmt = PIX_FMT_YUV444P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV444P;
avctx->coded_frame = &c->pic;
return 0;
/* 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;
}
s->frame.data[0] = NULL;
}
/* 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);
}
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);
}
/**
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;
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->reget_buffer = avcodec_default_reget_buffer;
h = avctx->height;
w = avctx->width;
switch (avctx->pix_fmt) {
- case PIX_FMT_MONOWHITE:
+ case AV_PIX_FMT_MONOWHITE:
n = (w + 7) >> 3;
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_RGB24:
+ case AV_PIX_FMT_RGB24:
n = w * 3;
depth = 3;
maxval = 255;
tuple_type = "RGB";
break;
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
n = w * 4;
depth = 4;
maxval = 255;
ptr = p->data[0];
linesize = p->linesize[0];
- if (avctx->pix_fmt == PIX_FMT_RGB32) {
+ if (avctx->pix_fmt == AV_PIX_FMT_RGB32) {
int j;
unsigned int v;
.priv_data_size = sizeof(PNMContext),
.init = ff_pnm_init,
.encode2 = pam_encode_frame,
- .pix_fmts = (const enum PixelFormat[]){
- PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_GRAY8, PIX_FMT_MONOWHITE,
- PIX_FMT_NONE
+ .pix_fmts = (const enum AVPixelFormat[]){
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_GRAY8, AV_PIX_FMT_MONOWHITE,
+ AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
};
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:
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");
}
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 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:
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;
.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"),
};
static av_cold int init_decoder(AVCodecContext *avctx)
{
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0;
}
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)
if (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 == 8 &&
s->color_type == PNG_COLOR_TYPE_RGB_ALPHA) {
- avctx->pix_fmt = PIX_FMT_RGB32;
+ avctx->pix_fmt = AV_PIX_FMT_RGB32;
} else if (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 == 1 &&
s->color_type == PNG_COLOR_TYPE_GRAY) {
- 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_PALETTE) {
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
} 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 {
goto fail;
}
is_progressive = !!(avctx->flags & CODEC_FLAG_INTERLACED_DCT);
switch(avctx->pix_fmt) {
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB_ALPHA;
break;
- case PIX_FMT_RGB24:
+ case AV_PIX_FMT_RGB24:
bit_depth = 8;
color_type = PNG_COLOR_TYPE_RGB;
break;
- case PIX_FMT_GRAY8:
+ case AV_PIX_FMT_GRAY8:
bit_depth = 8;
color_type = PNG_COLOR_TYPE_GRAY;
break;
- case PIX_FMT_MONOBLACK:
+ case AV_PIX_FMT_MONOBLACK:
bit_depth = 1;
color_type = PNG_COLOR_TYPE_GRAY;
break;
- case PIX_FMT_PAL8:
+ case AV_PIX_FMT_PAL8:
bit_depth = 8;
color_type = PNG_COLOR_TYPE_PALETTE;
break;
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;
.priv_data_size = sizeof(PNGEncContext),
.init = png_enc_init,
.encode2 = encode_frame,
- .pix_fmts = (const enum PixelFormat[]){
- PIX_FMT_RGB24, PIX_FMT_RGB32, PIX_FMT_PAL8, PIX_FMT_GRAY8,
- PIX_FMT_MONOBLACK, PIX_FMT_NONE
+ .pix_fmts = (const enum AVPixelFormat[]){
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32, AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("PNG (Portable Network Graphics) image"),
};
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;
avctx->height = h;
if (depth == 1) {
if (maxval == 1)
- avctx->pix_fmt = PIX_FMT_MONOWHITE;
+ avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
else
- avctx->pix_fmt = PIX_FMT_GRAY8;
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8;
} else if (depth == 3) {
if (maxval < 256) {
- avctx->pix_fmt = PIX_FMT_RGB24;
+ avctx->pix_fmt = AV_PIX_FMT_RGB24;
} else {
av_log(avctx, AV_LOG_ERROR, "16-bit components are only supported for grayscale\n");
- avctx->pix_fmt = PIX_FMT_NONE;
+ avctx->pix_fmt = AV_PIX_FMT_NONE;
return -1;
}
} else if (depth == 4) {
- avctx->pix_fmt = PIX_FMT_RGB32;
+ avctx->pix_fmt = AV_PIX_FMT_RGB32;
} else {
return -1;
}
avctx->height = atoi(buf1);
if(av_image_check_size(avctx->width, avctx->height, 0, avctx))
return -1;
- if (avctx->pix_fmt != PIX_FMT_MONOWHITE) {
+ if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE) {
pnm_get(s, buf1, sizeof(buf1));
s->maxval = atoi(buf1);
if (s->maxval <= 0) {
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);
switch (avctx->pix_fmt) {
default:
return -1;
- case PIX_FMT_RGB48BE:
+ case AV_PIX_FMT_RGB48BE:
n = avctx->width * 6;
components=3;
sample_len=16;
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_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;
}
}
break;
- case PIX_FMT_YUV420P:
+ case AV_PIX_FMT_YUV420P:
{
unsigned char *ptr1, *ptr2;
}
}
break;
- case PIX_FMT_RGB32:
+ case AV_PIX_FMT_RGB32:
ptr = p->data[0];
linesize = p->linesize[0];
if (s->bytestream + avctx->width * avctx->height * 4 > s->bytestream_end)
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:
c = '5';
n = avctx->width;
h1 = (h * 3) / 2;
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);
}
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];
.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"),
};
.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
.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"),
};
.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
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,
#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,
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;
.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,
};
return -1;
}
- avctx->pix_fmt = PIX_FMT_RGB555;
+ avctx->pix_fmt = AV_PIX_FMT_RGB555;
if (buf_end - buf < offset)
return AVERROR_INVALIDDATA;
static av_cold int decode_init(AVCodecContext *avctx){
// QdrawContext * const a = avctx->priv_data;
- avctx->pix_fmt= PIX_FMT_PAL8;
+ avctx->pix_fmt= AV_PIX_FMT_PAL8;
return 0;
}
QpegContext * const a = avctx->priv_data;
a->avctx = avctx;
- avctx->pix_fmt= PIX_FMT_PAL8;
+ avctx->pix_fmt= AV_PIX_FMT_PAL8;
a->refdata = av_malloc(avctx->width * avctx->height);
return 0;
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:
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:
s->avctx=avctx;
switch (avctx->pix_fmt) {
- 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:
.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_NONE
+ .pix_fmts = (const enum AVPixelFormat[]){
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("QuickTime Animation (RLE) video"),
};
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();
#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_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_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_RGBA, MKTAG('R', 'G', 'B', 'A') },
- { PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') },
- { PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') },
- { PIX_FMT_ARGB, MKTAG('A', '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_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_Y400A, 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_RGBA, MKTAG('R', 'G', 'B', 'A') },
+ { AV_PIX_FMT_BGRA, MKTAG('B', 'G', 'R', 'A') },
+ { AV_PIX_FMT_ABGR, MKTAG('A', 'B', 'G', 'R') },
+ { AV_PIX_FMT_ARGB, MKTAG('A', '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_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_Y400A, MKTAG('Y', '2', 0 , 8 ) },
/* quicktime */
- { 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_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_BGRA, MKTAG('B', 'G', 'R', 'A') },
- { PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') },
- { 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_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_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_BGRA, MKTAG('B', 'G', 'R', 'A') },
+ { AV_PIX_FMT_RGBA, MKTAG('R', 'G', 'B', 'A') },
+ { 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 */
+ { AV_PIX_FMT_RGB565LE,MKTAG( 3 , 0 , 0 , 0 ) }, /* flipped RGB565LE */
+ { AV_PIX_FMT_YUV444P, MKTAG('Y', 'V', '2', '4') }, /* YUV444P, 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) {
#include "avcodec.h"
typedef struct PixelFormatTag {
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
unsigned int fourcc;
} PixelFormatTag;
} RawVideoContext;
static const PixelFormatTag pix_fmt_bps_avi[] = {
- { 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_RGB32, 32 },
- { PIX_FMT_NONE, 0 },
+ { 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_RGB32, 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 },
};
-static enum PixelFormat find_pix_fmt(const PixelFormatTag *tags, unsigned int fourcc)
+static enum AVPixelFormat 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)
avctx->pix_fmt = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
else if (avctx->codec_tag)
avctx->pix_fmt = 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 = find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
ff_set_systematic_pal2(context->palette, avctx->pix_fmt);
context->length = avpicture_get_size(avctx->pix_fmt, avctx->width, avctx->height);
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->buffer = av_malloc(context->length);
if (!context->buffer)
frame->reordered_opaque = avctx->reordered_opaque;
frame->pkt_pts = avctx->pkt->pts;
- if(buf_size < context->length - (avctx->pix_fmt==PIX_FMT_PAL8 ? 256*4 : 0))
+ if(buf_size < context->length - (avctx->pix_fmt==AV_PIX_FMT_PAL8 ? 256*4 : 0))
return -1;
//2bpp and 4bpp raw in avi and mov (yes this is ugly ...)
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]= 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) {
frame->palette_has_changed = 1;
}
}
- if(avctx->pix_fmt==PIX_FMT_BGR24 && ((frame->linesize[0]+3)&~3)*avctx->height <= buf_size)
+ if(avctx->pix_fmt==AV_PIX_FMT_BGR24 && ((frame->linesize[0]+3)&~3)*avctx->height <= buf_size)
frame->linesize[0] = (frame->linesize[0]+3)&~3;
if(context->flip)
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++) {
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;
int back_size;
int i;
s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
/** parse extra data */
if(!avctx->extradata || avctx->extradata_size < EXTRADATA1_SIZE){
s->height = avctx->height;
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;
}
.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"),
};
RpzaContext *s = avctx->priv_data;
s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_RGB555;
+ avctx->pix_fmt = AV_PIX_FMT_RGB555;
s->frame.data[0] = NULL;
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;
.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,
};
.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,
};
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;
}
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 && s->bytes_per_channel == 1) {
- avctx->pix_fmt = PIX_FMT_RGBA;
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
} else {
av_log(avctx, AV_LOG_ERROR, "wrong picture format\n");
return -1;
height = avctx->height;
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;
.priv_data_size = sizeof(SgiContext),
.init = encode_init,
.encode2 = encode_frame,
- .pix_fmts = (const enum PixelFormat[]){
- PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_GRAY8, PIX_FMT_NONE
+ .pix_fmts = (const enum AVPixelFormat[]){
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("SGI image"),
};
c->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
/* decode huffman trees from extradata */
SmcContext *s = avctx->priv_data;
s->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
s->frame.data[0] = NULL;
{
int ret;
- avctx->pix_fmt= PIX_FMT_YUV420P;
+ avctx->pix_fmt= AV_PIX_FMT_YUV420P;
if ((ret = ff_snow_common_init(avctx)) < 0) {
ff_snow_common_end(avctx->priv_data);
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:
switch (depth) {
case 1:
- avctx->pix_fmt = PIX_FMT_MONOWHITE;
+ avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
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;
default:
av_log(avctx, AV_LOG_ERROR, "invalid depth\n");
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:
.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"),
};
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;
.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"),
};
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;
}
.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"),
};
.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 },
};
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:
- avctx->pix_fmt = PIX_FMT_RGB555LE;
+ avctx->pix_fmt = AV_PIX_FMT_RGB555LE;
break;
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);
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;
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);
switch(avctx->pix_fmt) {
- case PIX_FMT_GRAY8:
+ case AV_PIX_FMT_GRAY8:
pkt->data[2] = TGA_BW; /* uncompressed grayscale image */
pkt->data[16] = 8; /* bpp */
break;
- case PIX_FMT_RGB555LE:
+ case AV_PIX_FMT_RGB555LE:
pkt->data[2] = TGA_RGB; /* uncompresses true-color image */
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;
.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_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_NONE
},
.long_name= NULL_IF_CONFIG_SMALL("Truevision Targa image"),
};
SeqVideoContext *seq = avctx->priv_data;
seq->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
seq->frame.data[0] = NULL;
switch (s->bpp * 10 + s->bppcount) {
case 11:
- s->avctx->pix_fmt = PIX_FMT_MONOBLACK;
+ s->avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
break;
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 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;
default:
av_log(s->avctx, AV_LOG_ERROR,
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 {
s->subsampling[1] = 1;
switch (avctx->pix_fmt) {
- case PIX_FMT_RGB48LE:
- case PIX_FMT_GRAY16LE:
- case PIX_FMT_RGB24:
- case PIX_FMT_GRAY8:
- case PIX_FMT_PAL8:
+ case AV_PIX_FMT_RGB48LE:
+ case AV_PIX_FMT_GRAY16LE:
+ case AV_PIX_FMT_RGB24:
+ case AV_PIX_FMT_GRAY8:
+ case AV_PIX_FMT_PAL8:
pfd = &av_pix_fmt_descriptors[avctx->pix_fmt];
s->bpp = av_get_bits_per_pixel(pfd);
if (pfd->flags & PIX_FMT_PAL) {
bpp_tab[i] = s->bpp / s->bpp_tab_size;
}
break;
- case PIX_FMT_MONOBLACK:
+ case AV_PIX_FMT_MONOBLACK:
s->bpp = 1;
s->photometric_interpretation = 1;
s->bpp_tab_size = 0;
break;
- case PIX_FMT_MONOWHITE:
+ case AV_PIX_FMT_MONOWHITE:
s->bpp = 1;
s->photometric_interpretation = 0;
s->bpp_tab_size = 0;
break;
- case PIX_FMT_YUV420P:
- case PIX_FMT_YUV422P:
- 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_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);
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);
.id = AV_CODEC_ID_TIFF,
.priv_data_size = sizeof(TiffEncoderContext),
.encode2 = encode_frame,
- .pix_fmts = (const enum PixelFormat[]) {
- PIX_FMT_RGB24, PIX_FMT_RGB48LE, PIX_FMT_PAL8,
- PIX_FMT_GRAY8, PIX_FMT_GRAY16LE,
- PIX_FMT_MONOBLACK, PIX_FMT_MONOWHITE,
- 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_RGB48LE, AV_PIX_FMT_PAL8,
+ AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16LE,
+ AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_MONOWHITE,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P,
+ AV_PIX_FMT_NONE
},
.long_name = NULL_IF_CONFIG_SMALL("TIFF image"),
.priv_class = &tiffenc_class,
static av_cold int tmv_decode_init(AVCodecContext *avctx)
{
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0;
}
}
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)
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);
// 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;
s->frame.data[0] = NULL;
l->avctx = avctx;
l->pic.data[0]=NULL;
- avctx->pix_fmt = PIX_FMT_BGR24;
+ avctx->pix_fmt = AV_PIX_FMT_BGR24;
ff_dsputil_init(&l->dsp, avctx);
}
/* 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) {
// 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 -1;
}
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");
}
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;
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;
s->ulti_codebook = ulti_codebook;
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_YUV420P9LE:
- case PIX_FMT_YUV420P9BE:
- case PIX_FMT_YUV420P10LE:
- case PIX_FMT_YUV420P10BE:
- case PIX_FMT_YUV422P9LE:
- case PIX_FMT_YUV422P9BE:
- case PIX_FMT_YUV422P10LE:
- case PIX_FMT_YUV422P10BE:
- case PIX_FMT_YUV444P9LE:
- case PIX_FMT_YUV444P9BE:
- case PIX_FMT_YUV444P10LE:
- case PIX_FMT_YUV444P10BE:
- case PIX_FMT_GBRP9LE:
- case PIX_FMT_GBRP9BE:
- case PIX_FMT_GBRP10LE:
- case PIX_FMT_GBRP10BE:
+ 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_YUV420P9LE:
+ case AV_PIX_FMT_YUV420P9BE:
+ case AV_PIX_FMT_YUV420P10LE:
+ case AV_PIX_FMT_YUV420P10BE:
+ case AV_PIX_FMT_YUV422P9LE:
+ case AV_PIX_FMT_YUV422P9BE:
+ case AV_PIX_FMT_YUV422P10LE:
+ case AV_PIX_FMT_YUV422P10BE:
+ case AV_PIX_FMT_YUV444P9LE:
+ case AV_PIX_FMT_YUV444P9BE:
+ case AV_PIX_FMT_YUV444P10LE:
+ case AV_PIX_FMT_YUV444P10BE:
+ case AV_PIX_FMT_GBRP9LE:
+ case AV_PIX_FMT_GBRP9BE:
+ case AV_PIX_FMT_GBRP10LE:
+ case AV_PIX_FMT_GBRP10BE:
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;
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];
}
}
}
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) {
av_log(avctx, AV_LOG_ERROR, "Specified pix_fmt is not supported\n");
ret = AVERROR(EINVAL);
goto free_and_end;
if (profile)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
" (%s)", profile);
- 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));
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;
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");
}
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,
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,
}
}
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,
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",
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");
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");
}
/* 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,
}
}
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);
}
}
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,
.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"),
};
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();
.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"),
};
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();
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) {
.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"),
};
.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,
.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,
.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,
.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,
.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,
.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,
VBDecContext * const c = avctx->priv_data;
c->avctx = avctx;
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
c->frame = av_mallocz(avctx->width * avctx->height);
c->prev_frame = av_mallocz(avctx->width * avctx->height);
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();
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;
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
.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
.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
{
vcr1_common_init(avctx);
- avctx->pix_fmt = PIX_FMT_YUV410P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV410P;
return 0;
}
.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,
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) {
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);
s->avctx = avctx;
s->width = FFALIGN(avctx->width, 16);
s->height = FFALIGN(avctx->height, 16);
- if (avctx->pix_fmt == PIX_FMT_NONE)
- avctx->pix_fmt = PIX_FMT_YUV420P;
+ if (avctx->pix_fmt == AV_PIX_FMT_NONE)
+ 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);
}
#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)
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);
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);
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) {
.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"),
};
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;
code_vlc.table = code_table;
code_vlc.table_allocated = 1 << CODE_VLC_BITS;
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);
.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"),
};
static av_cold int decode_init(AVCodecContext *avctx){
// VideoXLContext * const a = avctx->priv_data;
- avctx->pix_fmt= PIX_FMT_YUV411P;
+ avctx->pix_fmt= AV_PIX_FMT_YUV411P;
return 0;
}
#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;
}
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)
return AVERROR_INVALIDDATA;
if (pixdepth == 1)
- avctx->pix_fmt = PIX_FMT_MONOWHITE;
+ avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
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:
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;
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;
}
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;
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;
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;
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;
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;
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;
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_MONOWHITE:
+ case AV_PIX_FMT_MONOWHITE:
be = 1;
bitorder = 1;
bpp = 1;
.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_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_MONOWHITE,
+ AV_PIX_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("XWD (X Window Dump) image"),
};
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);
return -1;
}
- avctx->pix_fmt = PIX_FMT_PAL8;
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
s->num_pal_colors = avctx->extradata[0];
s->first_color[0] = avctx->extradata[1];
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,
// 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 */
.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"),
};
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 = width;
st->codec->height = height;
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 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;
return entry->pixfmt;
}
- return PIX_FMT_NONE;
+ return AV_PIX_FMT_NONE;
}
typedef struct {
{
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);
}
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");
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 */
};
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;
* (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_*
*
*
* This file is part of Libav.
};
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_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_RGB555, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 },
- { PIX_FMT_RGB565, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 },
- { PIX_FMT_BGR24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR24 },
- { PIX_FMT_RGB24, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB24 },
- { PIX_FMT_BGRA, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 },
- { 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_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_RGB555, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB555 },
+ { AV_PIX_FMT_RGB565, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_RGB565 },
+ { 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_BGRA, AV_CODEC_ID_RAWVIDEO, V4L2_PIX_FMT_BGR32 },
+ { 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 },
};
static int device_open(AVFormatContext *ctx)
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;
}
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;
}
}
- return PIX_FMT_NONE;
+ return AV_PIX_FMT_NONE;
}
static enum AVCodecID fmt_v4l2codec(uint32_t v4l2_fmt)
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++;
}
static uint32_t device_try_init(AVFormatContext *s1,
- enum PixelFormat pix_fmt,
+ enum AVPixelFormat pix_fmt,
int *width,
int *height,
enum AVCodecID *codec_id)
int res = 0;
uint32_t desired_format;
enum AVCodecID codec_id;
- enum PixelFormat pix_fmt = PIX_FMT_NONE;
+ enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE;
st = avformat_new_stream(s1, NULL);
if (!st) {
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);
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)
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. "
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;
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);
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);
}
break;
case 32:
- input_pixfmt = PIX_FMT_RGB32;
+ input_pixfmt = AV_PIX_FMT_RGB32;
break;
default:
av_log(s1, AV_LOG_ERROR, "image depth %i not supported ... aborting\n", image->bits_per_pixel);
link->srcpad = &src->output_pads[srcpad];
link->dstpad = &dst->input_pads[dstpad];
link->type = src->output_pads[srcpad].type;
- assert(PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);
+ assert(AV_PIX_FMT_NONE == -1 && AV_SAMPLE_FMT_NONE == -1);
link->format = -1;
return 0;
*/
AVFilterBufferRef *
avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], 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
/* video only */
int h, w;
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
AVRational pixel_aspect;
/* audio only */
av_log(ctx, AV_LOG_ERROR, "Expected 7 arguments, but %d found in '%s'\n", n, args);
return AVERROR(EINVAL);
}
- if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == PIX_FMT_NONE) {
+ if ((c->pix_fmt = av_get_pix_fmt(pix_fmt_str)) == AV_PIX_FMT_NONE) {
char *tail;
c->pix_fmt = strtol(pix_fmt_str, &tail, 10);
- if (*tail || c->pix_fmt < 0 || c->pix_fmt >= PIX_FMT_NB) {
+ if (*tail || c->pix_fmt < 0 || c->pix_fmt >= AV_PIX_FMT_NB) {
av_log(ctx, AV_LOG_ERROR, "Invalid pixel format string '%s'\n", pix_fmt_str);
return AVERROR(EINVAL);
}
enum { RED = 0, GREEN, BLUE, ALPHA };
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};
*is_packed_rgba = 1;
switch (pix_fmt) {
- case PIX_FMT_ARGB: rgba_map[ALPHA] = 0; rgba_map[RED ] = 1; rgba_map[GREEN] = 2; rgba_map[BLUE ] = 3; break;
- case PIX_FMT_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break;
- 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_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break;
+ 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_ABGR: rgba_map[ALPHA] = 0; rgba_map[BLUE ] = 1; rgba_map[GREEN] = 2; rgba_map[RED ] = 3; break;
+ 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_BGR24: rgba_map[BLUE ] = 0; rgba_map[GREEN] = 1; rgba_map[RED ] = 2; rgba_map[ALPHA] = 3; break;
default:
*is_packed_rgba = 0;
}
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],
{
const int *p;
- for (p = fmts; *p != PIX_FMT_NONE; p++) {
+ for (p = fmts; *p != AV_PIX_FMT_NONE; p++) {
if (fmt == *p)
return 1;
}
{
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++)
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));
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));
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));
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));
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));
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));
static int query_formats(AVFilterContext *ctx)
{
- static const enum PixelFormat pix_fmts[] = {
- PIX_FMT_ARGB, PIX_FMT_RGBA,
- PIX_FMT_ABGR, PIX_FMT_BGRA,
- PIX_FMT_RGB24, PIX_FMT_BGR24,
- PIX_FMT_YUV420P, PIX_FMT_YUV444P,
- PIX_FMT_YUV422P, PIX_FMT_YUV411P,
- PIX_FMT_YUV410P, PIX_FMT_YUV440P,
- PIX_FMT_NONE
+ static const 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_YUV420P, AV_PIX_FMT_YUV444P,
+ AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
+ AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P,
+ AV_PIX_FMT_NONE
};
ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
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_RGB24, PIX_FMT_BGR24,
- 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_RGB24, AV_PIX_FMT_BGR24,
+ AV_PIX_FMT_NONE
};
ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
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
* 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;
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
/* parse the list of formats */
for (cur = args; cur; cur = sep ? sep+1 : NULL) {
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;
}
pix_fmt_name[pix_fmt_name_len] = 0;
pix_fmt = av_get_pix_fmt(pix_fmt_name);
- if (pix_fmt == PIX_FMT_NONE) {
+ if (pix_fmt == AV_PIX_FMT_NONE) {
av_log(ctx, AV_LOG_ERROR, "Unknown pixel format: %s\n", pix_fmt_name);
return -1;
}
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;
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);
}
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));
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));
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));
#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);
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;
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));
}
#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 enum PixelFormat yuv_pix_fmts[] = { YUV_FORMATS, PIX_FMT_NONE };
-static enum PixelFormat rgb_pix_fmts[] = { RGB_FORMATS, PIX_FMT_NONE };
-static enum PixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, PIX_FMT_NONE };
+static enum AVPixelFormat yuv_pix_fmts[] = { YUV_FORMATS, AV_PIX_FMT_NONE };
+static enum AVPixelFormat rgb_pix_fmts[] = { RGB_FORMATS, AV_PIX_FMT_NONE };
+static enum AVPixelFormat all_pix_fmts[] = { RGB_FORMATS, YUV_FORMATS, AV_PIX_FMT_NONE };
static int query_formats(AVFilterContext *ctx)
{
LutContext *lut = ctx->priv;
- enum PixelFormat *pix_fmts = lut->is_rgb ? rgb_pix_fmts :
+ 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));
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;
if (lut->is_rgb) {
switch (inlink->format) {
- case PIX_FMT_ARGB: lut->rgba_map[A] = 0; lut->rgba_map[R] = 1; lut->rgba_map[G] = 2; lut->rgba_map[B] = 3; break;
- case PIX_FMT_ABGR: lut->rgba_map[A] = 0; lut->rgba_map[B] = 1; lut->rgba_map[G] = 2; lut->rgba_map[R] = 3; break;
- case PIX_FMT_RGBA:
- case PIX_FMT_RGB24: lut->rgba_map[R] = 0; lut->rgba_map[G] = 1; lut->rgba_map[B] = 2; lut->rgba_map[A] = 3; break;
- case PIX_FMT_BGRA:
- case PIX_FMT_BGR24: lut->rgba_map[B] = 0; lut->rgba_map[G] = 1; lut->rgba_map[R] = 2; lut->rgba_map[A] = 3; break;
+ case AV_PIX_FMT_ARGB: lut->rgba_map[A] = 0; lut->rgba_map[R] = 1; lut->rgba_map[G] = 2; lut->rgba_map[B] = 3; break;
+ case AV_PIX_FMT_ABGR: lut->rgba_map[A] = 0; lut->rgba_map[B] = 1; lut->rgba_map[G] = 2; lut->rgba_map[R] = 3; break;
+ case AV_PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGB24: lut->rgba_map[R] = 0; lut->rgba_map[G] = 1; lut->rgba_map[B] = 2; lut->rgba_map[A] = 3; break;
+ case AV_PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGR24: lut->rgba_map[B] = 0; lut->rgba_map[G] = 1; lut->rgba_map[R] = 2; lut->rgba_map[A] = 3; break;
}
lut->step = av_get_bits_per_pixel(desc) >> 3;
}
static int query_formats(AVFilterContext *ctx)
{
- const enum PixelFormat inout_pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_NONE };
- const enum PixelFormat blend_pix_fmts[] = { PIX_FMT_YUVA420P, PIX_FMT_NONE };
+ const enum AVPixelFormat inout_pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE };
+ const enum AVPixelFormat blend_pix_fmts[] = { AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE };
AVFilterFormats *inout_formats = ff_make_format_list(inout_pix_fmts);
AVFilterFormats *blend_formats = ff_make_format_list(blend_pix_fmts);
start_y = FFMAX(y, 0);
height = end_y - start_y;
- if (dst->format == PIX_FMT_BGR24 || dst->format == PIX_FMT_RGB24) {
+ if (dst->format == AV_PIX_FMT_BGR24 || dst->format == AV_PIX_FMT_RGB24) {
uint8_t *dp = dst->data[0] + x * 3 + start_y * dst->linesize[0];
uint8_t *sp = src->data[0];
- int b = dst->format == PIX_FMT_BGR24 ? 2 : 0;
- int r = dst->format == PIX_FMT_BGR24 ? 0 : 2;
+ int b = dst->format == AV_PIX_FMT_BGR24 ? 2 : 0;
+ int r = dst->format == AV_PIX_FMT_BGR24 ? 0 : 2;
if (y < 0)
sp += -y * src->linesize[0];
for (i = 0; i < height; i++) {
static int query_formats(AVFilterContext *ctx)
{
- static const enum PixelFormat pix_fmts[] = {
- PIX_FMT_ARGB, PIX_FMT_RGBA,
- PIX_FMT_ABGR, PIX_FMT_BGRA,
- PIX_FMT_RGB24, PIX_FMT_BGR24,
-
- 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_ARGB, AV_PIX_FMT_RGBA,
+ AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
+
+ 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));
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);
}
if (ctx->outputs[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_isSupportedOutput(pix_fmt)
&& (ret = ff_add_format(&formats, pix_fmt)) < 0) {
ff_formats_unref(&formats);
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_YUV422P16LE, PIX_FMT_YUV422P16BE,
- 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_YUV422P,
- PIX_FMT_YUV420P, PIX_FMT_YUVJ420P,
- PIX_FMT_YUV411P, PIX_FMT_YUV410P,
- PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P,
- PIX_FMT_YUV440P, PIX_FMT_YUVJ440P,
- 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_YUV422P16LE, AV_PIX_FMT_YUV422P16BE,
+ 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_YUV422P,
+ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P,
+ AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
+ AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P,
+ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUVJ440P,
+ AV_PIX_FMT_YUVA420P, AV_PIX_FMT_GRAY8,
+ AV_PIX_FMT_NONE
};
ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
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));
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));
AVFilterBufferRef *
avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], 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));
static int query_formats(AVFilterContext *ctx)
{
- static const enum PixelFormat pix_fmts[] = {
- PIX_FMT_ARGB, PIX_FMT_RGBA,
- PIX_FMT_ABGR, PIX_FMT_BGRA,
- PIX_FMT_RGB24, PIX_FMT_BGR24,
-
- 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_ARGB, AV_PIX_FMT_RGBA,
+ AV_PIX_FMT_ABGR, AV_PIX_FMT_BGRA,
+ AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24,
+
+ 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));
static int query_formats(AVFilterContext *ctx)
{
MovieContext *movie = ctx->priv;
- enum PixelFormat pix_fmts[] = { movie->codec_ctx->pix_fmt, PIX_FMT_NONE };
+ enum AVPixelFormat pix_fmts[] = { movie->codec_ctx->pix_fmt, AV_PIX_FMT_NONE };
ff_set_common_formats(ctx, ff_make_format_list(pix_fmts));
return 0;
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;
#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,
int 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));
p = dst + 4*x + y*dst_linesize;
AV_WL32(p, v);
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;
TestSourceContext *test = outlink->src->priv;
switch (outlink->format) {
- case PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break;
- case PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break;
- case PIX_FMT_RGBA:
- case PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break;
- case PIX_FMT_BGRA:
- case PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break;
+ case AV_PIX_FMT_ARGB: test->rgba_map[A] = 0; test->rgba_map[R] = 1; test->rgba_map[G] = 2; test->rgba_map[B] = 3; break;
+ case AV_PIX_FMT_ABGR: test->rgba_map[A] = 0; test->rgba_map[B] = 1; test->rgba_map[G] = 2; test->rgba_map[R] = 3; break;
+ case AV_PIX_FMT_RGBA:
+ case AV_PIX_FMT_RGB24: test->rgba_map[R] = 0; test->rgba_map[G] = 1; test->rgba_map[B] = 2; test->rgba_map[A] = 3; break;
+ case AV_PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGR24: test->rgba_map[B] = 0; test->rgba_map[G] = 1; test->rgba_map[R] = 2; test->rgba_map[A] = 3; break;
}
return config_props(outlink);
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;
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)
(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 */
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);
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;
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 {
// 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);
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;
size = snprintf(buffer, 1024, "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);
avio_w8(pb, TRACK_MPG_AUX);
avio_w8(pb, size + 1);
{
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 */
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;
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;
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);
}
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = ff_guess_image2_codec(s->path);
}
- 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;
{ 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 },
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');
}
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','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','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)
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;
};
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[] = {
/**
* 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;
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);
#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, \
(x)[0], (x)[1], (x)[2], (x)[3], (x)[4], (x)[5], (x)[6], (x)[7], (x)[8], (x)[9], (x)[10], (x)[11], (x)[12], (x)[13], (x)[14], (x)[15])
int linked_track_id;
uint8_t *extradata;
int extradata_size;
- enum PixelFormat pix_fmt;
+ enum AVPixelFormat pix_fmt;
} MXFDescriptor;
typedef struct {
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);
}
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;
}
}
}
#define STREAM_DURATION 5.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;
return st;
}
-static AVFrame *alloc_picture(enum PixelFormat pix_fmt, int width, int height)
+static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
{
AVFrame *picture;
uint8_t *picture_buf;
* picture is needed too. It is then converted to the required
* output format. */
tmp_picture = NULL;
- if (c->pix_fmt != PIX_FMT_YUV420P) {
- tmp_picture = alloc_picture(PIX_FMT_YUV420P, c->width, c->height);
+ if (c->pix_fmt != AV_PIX_FMT_YUV420P) {
+ tmp_picture = alloc_picture(AV_PIX_FMT_YUV420P, c->width, c->height);
if (!tmp_picture) {
fprintf(stderr, "Could not allocate temporary picture\n");
exit(1);
* 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 (img_convert_ctx == NULL) {
img_convert_ctx = sws_getContext(c->width, c->height,
- PIX_FMT_YUV420P,
+ AV_PIX_FMT_YUV420P,
c->width, c->height,
c->pix_fmt,
sws_flags, NULL, NULL, NULL);
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;
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);
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 */
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");
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:
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;
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;
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;
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);
break;
case AVMEDIA_TYPE_VIDEO:
val = avctx->width;
- 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)
return 0;
break;
default:
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_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;
}
ptr += picture->linesize[0];
}
- if (st->codec->pix_fmt != PIX_FMT_GRAY8) {
+ if (st->codec->pix_fmt != AV_PIX_FMT_GRAY8) {
// Adjust for smaller Cb and Cr planes
avcodec_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift,
&v_chroma_shift);
if (s->nb_streams != 1)
return AVERROR(EIO);
- if (s->streams[0]->codec->pix_fmt == PIX_FMT_YUV411P) {
+ if (s->streams[0]->codec->pix_fmt == AV_PIX_FMT_YUV411P) {
av_log(s, AV_LOG_ERROR, "Warning: generating rarely used 4:1:1 YUV "
"stream, some mjpegtools might not work.\n");
- } else if ((s->streams[0]->codec->pix_fmt != PIX_FMT_YUV420P) &&
- (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV422P) &&
- (s->streams[0]->codec->pix_fmt != PIX_FMT_GRAY8) &&
- (s->streams[0]->codec->pix_fmt != PIX_FMT_YUV444P)) {
+ } else if ((s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV420P) &&
+ (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV422P) &&
+ (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_GRAY8) &&
+ (s->streams[0]->codec->pix_fmt != AV_PIX_FMT_YUV444P)) {
av_log(s, AV_LOG_ERROR, "ERROR: yuv4mpeg only handles yuv444p, "
"yuv422p, yuv420p, yuv411p and gray pixel formats. "
"Use -pix_fmt to select one.\n");
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;
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("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("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");
// 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("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++;
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;
}
}
}
-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 */
return max_step[plane] * (((width + (1 << s) - 1)) >> s);
}
-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;
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
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);
if (desc->flags & PIX_FMT_BITSTREAM) {
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 };
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;
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;
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:
}
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;
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];
*
* @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
* @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
* @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]);
/**
* 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.
*/
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);
/**
* Check if the given dimension of an image is valid, meaning that all
*/
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);
/**
* @}
}
}
-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,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUYV422] = {
+ [AV_PIX_FMT_YUYV422] = {
.name = "yuyv422",
.nb_components = 3,
.log2_chroma_w = 1,
{ 0, 3, 4, 0, 7 }, /* V */
},
},
- [PIX_FMT_RGB24] = {
+ [AV_PIX_FMT_RGB24] = {
.name = "rgb24",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_BGR24] = {
+ [AV_PIX_FMT_BGR24] = {
.name = "bgr24",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_YUV422P] = {
+ [AV_PIX_FMT_YUV422P] = {
.name = "yuv422p",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV444P] = {
+ [AV_PIX_FMT_YUV444P] = {
.name = "yuv444p",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV410P] = {
+ [AV_PIX_FMT_YUV410P] = {
.name = "yuv410p",
.nb_components = 3,
.log2_chroma_w = 2,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV411P] = {
+ [AV_PIX_FMT_YUV411P] = {
.name = "yuv411p",
.nb_components = 3,
.log2_chroma_w = 2,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_GRAY8] = {
+ [AV_PIX_FMT_GRAY8] = {
.name = "gray",
.nb_components = 1,
.log2_chroma_w = 0,
{ 0, 0, 1, 0, 7 }, /* Y */
},
},
- [PIX_FMT_MONOWHITE] = {
+ [AV_PIX_FMT_MONOWHITE] = {
.name = "monow",
.nb_components = 1,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BITSTREAM,
},
- [PIX_FMT_MONOBLACK] = {
+ [AV_PIX_FMT_MONOBLACK] = {
.name = "monob",
.nb_components = 1,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BITSTREAM,
},
- [PIX_FMT_PAL8] = {
+ [AV_PIX_FMT_PAL8] = {
.name = "pal8",
.nb_components = 1,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PAL,
},
- [PIX_FMT_YUVJ420P] = {
+ [AV_PIX_FMT_YUVJ420P] = {
.name = "yuvj420p",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUVJ422P] = {
+ [AV_PIX_FMT_YUVJ422P] = {
.name = "yuvj422p",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUVJ444P] = {
+ [AV_PIX_FMT_YUVJ444P] = {
.name = "yuvj444p",
.nb_components = 3,
.log2_chroma_w = 0,
},
.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,
{ 0, 3, 3, 0, 7 }, /* V */
},
},
- [PIX_FMT_UYYVYY411] = {
+ [AV_PIX_FMT_UYYVYY411] = {
.name = "uyyvyy411",
.nb_components = 3,
.log2_chroma_w = 2,
{ 0, 5, 4, 0, 7 }, /* V */
},
},
- [PIX_FMT_BGR8] = {
+ [AV_PIX_FMT_BGR8] = {
.name = "bgr8",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
},
- [PIX_FMT_BGR4] = {
+ [AV_PIX_FMT_BGR4] = {
.name = "bgr4",
.nb_components = 3,
.log2_chroma_w = 0,
},
.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,
},
.flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
},
- [PIX_FMT_RGB8] = {
+ [AV_PIX_FMT_RGB8] = {
.name = "rgb8",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
},
- [PIX_FMT_RGB4] = {
+ [AV_PIX_FMT_RGB4] = {
.name = "rgb4",
.nb_components = 3,
.log2_chroma_w = 0,
},
.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,
},
.flags = PIX_FMT_RGB | PIX_FMT_PSEUDOPAL,
},
- [PIX_FMT_NV12] = {
+ [AV_PIX_FMT_NV12] = {
.name = "nv12",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_NV21] = {
+ [AV_PIX_FMT_NV21] = {
.name = "nv21",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_ARGB] = {
+ [AV_PIX_FMT_ARGB] = {
.name = "argb",
.nb_components = 4,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_RGBA] = {
+ [AV_PIX_FMT_RGBA] = {
.name = "rgba",
.nb_components = 4,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_ABGR] = {
+ [AV_PIX_FMT_ABGR] = {
.name = "abgr",
.nb_components = 4,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_BGRA] = {
+ [AV_PIX_FMT_BGRA] = {
.name = "bgra",
.nb_components = 4,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_GRAY16BE] = {
+ [AV_PIX_FMT_GRAY16BE] = {
.name = "gray16be",
.nb_components = 1,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE,
},
- [PIX_FMT_GRAY16LE] = {
+ [AV_PIX_FMT_GRAY16LE] = {
.name = "gray16le",
.nb_components = 1,
.log2_chroma_w = 0,
{ 0, 1, 1, 0, 15 }, /* Y */
},
},
- [PIX_FMT_YUV440P] = {
+ [AV_PIX_FMT_YUV440P] = {
.name = "yuv440p",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUVJ440P] = {
+ [AV_PIX_FMT_YUVJ440P] = {
.name = "yuvj440p",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUVA420P] = {
+ [AV_PIX_FMT_YUVA420P] = {
.name = "yuva420p",
.nb_components = 4,
.log2_chroma_w = 1,
},
.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,
},
.flags = PIX_FMT_RGB | PIX_FMT_BE,
},
- [PIX_FMT_RGB48LE] = {
+ [AV_PIX_FMT_RGB48LE] = {
.name = "rgb48le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_RGB565BE] = {
+ [AV_PIX_FMT_RGB565BE] = {
.name = "rgb565be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_RGB,
},
- [PIX_FMT_RGB565LE] = {
+ [AV_PIX_FMT_RGB565LE] = {
.name = "rgb565le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_RGB555BE] = {
+ [AV_PIX_FMT_RGB555BE] = {
.name = "rgb555be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_RGB,
},
- [PIX_FMT_RGB555LE] = {
+ [AV_PIX_FMT_RGB555LE] = {
.name = "rgb555le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_RGB444BE] = {
+ [AV_PIX_FMT_RGB444BE] = {
.name = "rgb444be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_RGB,
},
- [PIX_FMT_RGB444LE] = {
+ [AV_PIX_FMT_RGB444LE] = {
.name = "rgb444le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_BGR48BE] = {
+ [AV_PIX_FMT_BGR48BE] = {
.name = "bgr48be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_RGB,
},
- [PIX_FMT_BGR48LE] = {
+ [AV_PIX_FMT_BGR48LE] = {
.name = "bgr48le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_BGR565BE] = {
+ [AV_PIX_FMT_BGR565BE] = {
.name = "bgr565be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_RGB,
},
- [PIX_FMT_BGR565LE] = {
+ [AV_PIX_FMT_BGR565LE] = {
.name = "bgr565le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_BGR555BE] = {
+ [AV_PIX_FMT_BGR555BE] = {
.name = "bgr555be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_RGB,
},
- [PIX_FMT_BGR555LE] = {
+ [AV_PIX_FMT_BGR555LE] = {
.name = "bgr555le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_RGB,
},
- [PIX_FMT_BGR444BE] = {
+ [AV_PIX_FMT_BGR444BE] = {
.name = "bgr444be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_RGB,
},
- [PIX_FMT_BGR444LE] = {
+ [AV_PIX_FMT_BGR444LE] = {
.name = "bgr444le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.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_VDA_VLD] = {
+ [AV_PIX_FMT_VDA_VLD] = {
.name = "vda_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,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV420P9BE] = {
+ [AV_PIX_FMT_YUV420P9BE] = {
.name = "yuv420p9be",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV420P10LE] = {
+ [AV_PIX_FMT_YUV420P10LE] = {
.name = "yuv420p10le",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV420P10BE] = {
+ [AV_PIX_FMT_YUV420P10BE] = {
.name = "yuv420p10be",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV420P16LE] = {
+ [AV_PIX_FMT_YUV420P16LE] = {
.name = "yuv420p16le",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV420P16BE] = {
+ [AV_PIX_FMT_YUV420P16BE] = {
.name = "yuv420p16be",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV422P9LE] = {
+ [AV_PIX_FMT_YUV422P9LE] = {
.name = "yuv422p9le",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV422P9BE] = {
+ [AV_PIX_FMT_YUV422P9BE] = {
.name = "yuv422p9be",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV422P10LE] = {
+ [AV_PIX_FMT_YUV422P10LE] = {
.name = "yuv422p10le",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV422P10BE] = {
+ [AV_PIX_FMT_YUV422P10BE] = {
.name = "yuv422p10be",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV422P16LE] = {
+ [AV_PIX_FMT_YUV422P16LE] = {
.name = "yuv422p16le",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV422P16BE] = {
+ [AV_PIX_FMT_YUV422P16BE] = {
.name = "yuv422p16be",
.nb_components = 3,
.log2_chroma_w = 1,
},
.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV444P16LE] = {
+ [AV_PIX_FMT_YUV444P16LE] = {
.name = "yuv444p16le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV444P16BE] = {
+ [AV_PIX_FMT_YUV444P16BE] = {
.name = "yuv444p16be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV444P10LE] = {
+ [AV_PIX_FMT_YUV444P10LE] = {
.name = "yuv444p10le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV444P10BE] = {
+ [AV_PIX_FMT_YUV444P10BE] = {
.name = "yuv444p10be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_BE | PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV444P9LE] = {
+ [AV_PIX_FMT_YUV444P9LE] = {
.name = "yuv444p9le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PLANAR,
},
- [PIX_FMT_YUV444P9BE] = {
+ [AV_PIX_FMT_YUV444P9BE] = {
.name = "yuv444p9be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.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_Y400A] = {
+ [AV_PIX_FMT_Y400A] = {
.name = "y400a",
.nb_components = 2,
.comp = {
{ 0, 1, 2, 0, 7 }, /* A */
},
},
- [PIX_FMT_GBRP] = {
+ [AV_PIX_FMT_GBRP] = {
.name = "gbrp",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
},
- [PIX_FMT_GBRP9LE] = {
+ [AV_PIX_FMT_GBRP9LE] = {
.name = "gbrp9le",
.nb_components = 3,
.log2_chroma_w = 0,
},
.flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
},
- [PIX_FMT_GBRP9BE] = {
+ [AV_PIX_FMT_GBRP9BE] = {
.name = "gbrp9be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.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,
},
.flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
},
- [PIX_FMT_GBRP10BE] = {
+ [AV_PIX_FMT_GBRP10BE] = {
.name = "gbrp10be",
.nb_components = 3,
.log2_chroma_w = 0,
},
.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,
},
.flags = PIX_FMT_PLANAR | PIX_FMT_RGB,
},
- [PIX_FMT_GBRP16BE] = {
+ [AV_PIX_FMT_GBRP16BE] = {
.name = "gbrp16be",
.nb_components = 3,
.log2_chroma_w = 0,
},
};
-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;
}
# 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");
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"));
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) {
*
* Finally if no pixel format has been found, returns 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
*
* @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
* 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
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;
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:
#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 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++) {
const uint16_t *src1,
const uint16_t *src2,
int width,
- enum PixelFormat origin)
+ enum AVPixelFormat origin)
{
int i;
assert(src1 == src2);
const uint16_t *src1,
const uint16_t *src2,
int width,
- enum PixelFormat origin)
+ enum AVPixelFormat origin)
{
int i;
assert(src1 == src2);
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])))
static av_always_inline void rgb16_32ToY_c_template(uint8_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,
uint8_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,
uint8_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,
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;
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 abgrToA_c(uint8_t *dst, const uint8_t *src, int width,
uint32_t *unused)
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_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_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_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_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_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_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_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_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_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;
}
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_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_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_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_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_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_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;
}
if (c->alpPixBuf) {
switch (srcFormat) {
- case PIX_FMT_BGRA:
- case PIX_FMT_RGBA:
+ 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;
}
{ "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 },
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;
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; \
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;
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];
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;
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; \
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;
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],
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;
#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); \
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;
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],
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;
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
yuv2rgb_write(uint8_t *_dest, int i, unsigned Y1, unsigned 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);
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];
dest[i * 6 + 2] = b_r[Y1];
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];
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];
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 {
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;
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],
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];
}
#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,
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;
}
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;
dest += 4;
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;
}
#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,
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;
} 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
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_ARGB:
+ case AV_PIX_FMT_ARGB:
#if CONFIG_SMALL
*yuv2packedX = yuv2argb32_full_X_c;
#else
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_BGRA:
+ case AV_PIX_FMT_BGRA:
#if CONFIG_SMALL
*yuv2packedX = yuv2bgra32_full_X_c;
#else
}
#endif /* !CONFIG_SMALL */
break;
- case PIX_FMT_ABGR:
+ case AV_PIX_FMT_ABGR:
#if CONFIG_SMALL
*yuv2packedX = yuv2abgr32_full_X_c;
#else
}
#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;
}
} else {
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;
}
#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;
}
#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;
}
}
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;
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;
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;
}
* 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;
}
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;
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;
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:
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:
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);
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;
}
}
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;
/* 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)
// 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];
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;
}
}
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;
}
}
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 };
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;
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;
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);
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 };
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);
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;
}
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;
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,
}
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;
}
* 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
* 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
* 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);
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;
SwsFunc ff_yuv2rgb_get_func_ptr_bfin(SwsContext *c);
void ff_bfin_get_unscaled_swscale(SwsContext *c);
-const char *sws_format_name(enum PixelFormat format);
+const char *sws_format_name(enum AVPixelFormat format);
#define is16BPS(x) \
(av_pix_fmt_descriptors[x].comp[0].depth_minus1 == 15)
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_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_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_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_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 isAnyRGB(x) \
(isRGBinInt(x) || \
#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)
#define isPlanar(x) \
(av_pix_fmt_descriptors[x].nb_components >= 2 && \
#define usePal(x) ((av_pix_fmt_descriptors[x].flags & PIX_FMT_PAL) || \
(av_pix_fmt_descriptors[x].flags & PIX_FMT_PSEUDOPAL) || \
- (x) == PIX_FMT_Y400A)
+ (x) == AV_PIX_FMT_Y400A)
extern const uint64_t ff_dither4[2];
extern const uint64_t ff_dither8[2];
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
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_Y400A) {
+ if (srcFormat == AV_PIX_FMT_Y400A) {
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;
}
}
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));
}
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],
}
#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 \
)
/* {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;
if (IS_NOT_NE(srcId, srcFormat) || IS_NOT_NE(dstId, dstFormat))
return NULL;
-#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)
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);
} else {
const uint8_t *srcPtr = src[0];
uint8_t *dstPtr = dst[0];
- 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;
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;
(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;
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_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_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_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_RGB555) ||
+ IS_DIFFERENT_ENDIANESS(srcFormat, dstFormat, AV_PIX_FMT_RGB565))
c->swScale = packed_16bpc_bswap;
if ((usePal(srcFormat) && (
- dstFormat == PIX_FMT_RGB32 ||
- dstFormat == PIX_FMT_RGB32_1 ||
- dstFormat == PIX_FMT_RGB24 ||
- dstFormat == PIX_FMT_BGR32 ||
- dstFormat == PIX_FMT_BGR32_1 ||
- dstFormat == PIX_FMT_BGR24)))
+ dstFormat == AV_PIX_FMT_RGB32 ||
+ dstFormat == AV_PIX_FMT_RGB32_1 ||
+ dstFormat == AV_PIX_FMT_RGB24 ||
+ dstFormat == AV_PIX_FMT_BGR32 ||
+ dstFormat == AV_PIX_FMT_BGR32_1 ||
+ dstFormat == AV_PIX_FMT_BGR24)))
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;
/* 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) && isGray(dstFormat)) ||
(isPlanarYUV(dstFormat) && isGray(srcFormat)) ||
(isGray(dstFormat) && isGray(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;
}
}
-static int check_image_pointers(uint8_t *data[4], enum PixelFormat pix_fmt,
+static int check_image_pointers(uint8_t *data[4], enum AVPixelFormat pix_fmt,
const int linesizes[4])
{
const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
if (usePal(c->srcFormat)) {
for (i = 0; i < 256; i++) {
int p, r, g, b, y, u, v;
- if (c->srcFormat == PIX_FMT_PAL8) {
+ if (c->srcFormat == AV_PIX_FMT_PAL8) {
p = ((const uint32_t *)(srcSlice[1]))[i];
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_Y400A) {
+ } else if (c->srcFormat == AV_PIX_FMT_GRAY8 ||
+ c->srcFormat == AV_PIX_FMT_Y400A) {
r = g = b = i;
} else {
- assert(c->srcFormat == PIX_FMT_BGR4_BYTE);
+ assert(c->srcFormat == AV_PIX_FMT_BGR4_BYTE);
b = ( i >> 3 ) * 255;
g = ((i >> 1) & 3) * 85;
r = ( i & 1) * 255;
c->pal_yuv[i] = y + (u << 8) + (v << 16);
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);
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] = (r + (g << 8) + (b << 16)) << 8;
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] = (b + (g << 8) + (r << 16)) << 8;
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);
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_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_RGB48BE] = { 1, 1 },
- [PIX_FMT_RGB48LE] = { 1, 1 },
- [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_YUV420P9BE] = { 1, 1 },
- [PIX_FMT_YUV420P9LE] = { 1, 1 },
- [PIX_FMT_YUV420P10BE] = { 1, 1 },
- [PIX_FMT_YUV420P10LE] = { 1, 1 },
- [PIX_FMT_YUV422P9BE] = { 1, 1 },
- [PIX_FMT_YUV422P9LE] = { 1, 1 },
- [PIX_FMT_YUV422P10BE] = { 1, 1 },
- [PIX_FMT_YUV422P10LE] = { 1, 1 },
- [PIX_FMT_YUV444P9BE] = { 1, 1 },
- [PIX_FMT_YUV444P9LE] = { 1, 1 },
- [PIX_FMT_YUV444P10BE] = { 1, 1 },
- [PIX_FMT_YUV444P10LE] = { 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_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_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_RGB48BE] = { 1, 1 },
+ [AV_PIX_FMT_RGB48LE] = { 1, 1 },
+ [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_YUV420P9BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P9LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P10BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV420P10LE] = { 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_YUV444P9BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P9LE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P10BE] = { 1, 1 },
+ [AV_PIX_FMT_YUV444P10LE] = { 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_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];
-const char *sws_format_name(enum PixelFormat format)
+const char *sws_format_name(enum AVPixelFormat format)
{
- if ((unsigned)format < PIX_FMT_NB && av_pix_fmt_descriptors[format].name)
+ if ((unsigned)format < AV_PIX_FMT_NB && av_pix_fmt_descriptors[format].name)
return av_pix_fmt_descriptors[format].name;
else
return "Unknown format";
}
#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;
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;
int dst_stride = FFALIGN(dstW * sizeof(int16_t) + 16, 16);
int dst_stride_px = dst_stride >> 1;
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;
* 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_ERROR,
"full chroma interpolation for destination format '%s' not yet implemented\n",
sws_format_name(dstFormat));
/* 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;
av_log(c, AV_LOG_INFO, "from %s to %s%s ",
sws_format_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
"",
}
#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)
{
}
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)
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];
default: vscalefn = ff_yuv2plane1_8_ ## opt1; break; \
}
#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; \
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);
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);
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);
static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
{
- enum PixelFormat dstFormat = c->dstFormat;
+ enum AVPixelFormat dstFormat = c->dstFormat;
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) {
if (!(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;
}
}
} else {
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;
#if HAVE_INLINE_ASM
int cpu_flags = av_get_cpu_flags();
- if (c->srcFormat != PIX_FMT_YUV420P &&
- c->srcFormat != PIX_FMT_YUVA420P)
+ if (c->srcFormat != AV_PIX_FMT_YUV420P &&
+ c->srcFormat != AV_PIX_FMT_YUVA420P)
return NULL;
#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 */
if (h_size * depth > FFABS(dstStride[0])) \
h_size -= 8; \
\
- if (c->srcFormat == PIX_FMT_YUV422P) { \
+ if (c->srcFormat == AV_PIX_FMT_YUV422P) { \
srcStride[1] *= 2; \
srcStride[2] *= 2; \
} \
{ \
int y; \
\
- if (!alpha && c->srcFormat == PIX_FMT_YUV422P) { \
+ if (!alpha && c->srcFormat == AV_PIX_FMT_YUV422P) { \
srcStride[1] *= 2; \
srcStride[2] *= 2; \
} \
sws_format_name(c->srcFormat), sws_format_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:
- if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P)
+ case AV_PIX_FMT_ARGB:
+ case AV_PIX_FMT_ABGR:
+ if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P)
return yuva2argb_c;
- case PIX_FMT_RGBA:
- case PIX_FMT_BGRA:
- if (CONFIG_SWSCALE_ALPHA && c->srcFormat == PIX_FMT_YUVA420P)
+ case AV_PIX_FMT_RGBA:
+ case AV_PIX_FMT_BGRA:
+ if (CONFIG_SWSCALE_ALPHA && c->srcFormat == AV_PIX_FMT_YUVA420P)
return yuva2rgba_c;
else
return 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 PIX_FMT_RGB555:
- case PIX_FMT_BGR555:
+ case AV_PIX_FMT_RGB565:
+ case AV_PIX_FMT_BGR565:
+ case AV_PIX_FMT_RGB555:
+ case AV_PIX_FMT_BGR555:
return yuv2rgb_c_16;
- 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;
default:
assert(0);
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;
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);