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

pull/6/head
Anton Khirnov 12 years ago
parent 78071a1420
commit 716d413c13
  1. 2
      avconv.h
  2. 2
      avconv_filter.c
  3. 4
      avconv_opt.c
  4. 4
      avplay.c
  5. 4
      avprobe.c
  6. 8
      cmdutils.c
  7. 2
      cmdutils.h
  8. 2
      doc/filters.texi
  9. 4
      libavcodec/4xm.c
  10. 10
      libavcodec/8bps.c
  11. 4
      libavcodec/a64multienc.c
  12. 2
      libavcodec/aasc.c
  13. 2
      libavcodec/anm.c
  14. 2
      libavcodec/ansi.c
  15. 2
      libavcodec/api-example.c
  16. 6
      libavcodec/asv1.c
  17. 2
      libavcodec/aura.c
  18. 51
      libavcodec/avcodec.h
  19. 2
      libavcodec/avs.c
  20. 2
      libavcodec/bethsoftvideo.c
  21. 2
      libavcodec/bfi.c
  22. 2
      libavcodec/bink.c
  23. 24
      libavcodec/bmp.c
  24. 52
      libavcodec/bmpenc.c
  25. 2
      libavcodec/bmv.c
  26. 2
      libavcodec/c93.c
  27. 2
      libavcodec/cavs.c
  28. 2
      libavcodec/cdgraphics.c
  29. 4
      libavcodec/cdxl.c
  30. 4
      libavcodec/cinepak.c
  31. 6
      libavcodec/cljr.c
  32. 4
      libavcodec/cllc.c
  33. 6
      libavcodec/cscd.c
  34. 2
      libavcodec/cyuv.c
  35. 2
      libavcodec/dfa.c
  36. 6
      libavcodec/dirac.c
  37. 4
      libavcodec/dnxhddec.c
  38. 10
      libavcodec/dnxhdenc.c
  39. 10
      libavcodec/dpx.c
  40. 20
      libavcodec/dpxenc.c
  41. 2
      libavcodec/dsicinav.c
  42. 22
      libavcodec/dv.c
  43. 20
      libavcodec/dv_profile.c
  44. 2
      libavcodec/dv_profile.h
  45. 10
      libavcodec/dvdec.c
  46. 2
      libavcodec/dxa.c
  47. 2
      libavcodec/dxtory.c
  48. 2
      libavcodec/dxva2_h264.c
  49. 2
      libavcodec/dxva2_mpeg2.c
  50. 4
      libavcodec/dxva2_vc1.c
  51. 2
      libavcodec/eacmv.c
  52. 2
      libavcodec/eamad.c
  53. 2
      libavcodec/eatgq.c
  54. 2
      libavcodec/eatgv.c
  55. 2
      libavcodec/eatqi.c
  56. 2
      libavcodec/escape124.c
  57. 44
      libavcodec/ffv1.c
  58. 6
      libavcodec/flashsv.c
  59. 2
      libavcodec/flashsvenc.c
  60. 16
      libavcodec/flicvideo.c
  61. 2
      libavcodec/flvenc.c
  62. 6
      libavcodec/fraps.c
  63. 2
      libavcodec/frwu.c
  64. 6
      libavcodec/gif.c
  65. 2
      libavcodec/gifdec.c
  66. 2
      libavcodec/h261dec.c
  67. 2
      libavcodec/h261enc.c
  68. 2
      libavcodec/h263dec.c
  69. 42
      libavcodec/h264.c
  70. 32
      libavcodec/huffyuv.c
  71. 2
      libavcodec/idcinvideo.c
  72. 20
      libavcodec/iff.c
  73. 232
      libavcodec/imgconvert.c
  74. 2
      libavcodec/indeo2.c
  75. 2
      libavcodec/indeo3.c
  76. 2
      libavcodec/indeo4.c
  77. 2
      libavcodec/indeo5.c
  78. 6
      libavcodec/internal.h
  79. 2
      libavcodec/interplayvideo.c
  80. 22
      libavcodec/jpeglsenc.c
  81. 2
      libavcodec/jvdec.c
  82. 2
      libavcodec/kgv1dec.c
  83. 2
      libavcodec/kmvc.c
  84. 14
      libavcodec/lagarith.c
  85. 12
      libavcodec/lcldec.c
  86. 4
      libavcodec/lclenc.c
  87. 62
      libavcodec/libopenjpegdec.c
  88. 108
      libavcodec/libopenjpegenc.c
  89. 8
      libavcodec/libschroedinger.h
  90. 4
      libavcodec/libschroedingerdec.c
  91. 4
      libavcodec/libschroedingerenc.c
  92. 10
      libavcodec/libtheoraenc.c
  93. 2
      libavcodec/libvpxdec.c
  94. 2
      libavcodec/libvpxenc.c
  95. 52
      libavcodec/libx264.c
  96. 2
      libavcodec/libxavs.c
  97. 4
      libavcodec/libxvid.c
  98. 4
      libavcodec/ljpegenc.c
  99. 8
      libavcodec/loco.c
  100. 2
      libavcodec/mdec.c
  101. Some files were not shown because too many files have changed in this diff Show More

@ -299,7 +299,7 @@ typedef struct OutputStream {
const char *attachment_filename; const char *attachment_filename;
int copy_initial_nonkeyframes; int copy_initial_nonkeyframes;
enum PixelFormat pix_fmts[2]; enum AVPixelFormat pix_fmts[2];
} OutputStream; } OutputStream;
typedef struct OutputFile { typedef struct OutputFile {

@ -59,7 +59,7 @@ static char *choose_ ## var ## s(OutputStream *ost) \
return NULL; \ 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, ":") GET_PIX_FMT_NAME, ":")
DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts, DEF_CHOOSE_FORMAT(enum AVSampleFormat, sample_fmt, sample_fmts,

@ -846,7 +846,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
av_opt_get_int(sws_opts, "sws_flags", 0, &ost->sws_flags); 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; return ost;
} }
@ -904,7 +904,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc)
ost->frame_aspect_ratio = parse_frame_aspect_ratio(frame_aspect_ratio); ost->frame_aspect_ratio = parse_frame_aspect_ratio(frame_aspect_ratio);
MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st); 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); av_log(NULL, AV_LOG_FATAL, "Unknown pixel format requested: %s.\n", frame_pix_fmt);
exit(1); exit(1);
} }

@ -106,7 +106,7 @@ typedef struct VideoPicture {
int width, height; /* source height & width */ int width, height; /* source height & width */
int allocated; int allocated;
int reallocate; int reallocate;
enum PixelFormat pix_fmt; enum AVPixelFormat pix_fmt;
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
AVFilterBufferRef *picref; AVFilterBufferRef *picref;
@ -1316,7 +1316,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, int64_t
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
AVPicture pict_src; AVPicture pict_src;
#else #else
int dst_pix_fmt = PIX_FMT_YUV420P; int dst_pix_fmt = AV_PIX_FMT_YUV420P;
#endif #endif
/* wait until we have space to put a new picture */ /* wait until we have space to put a new picture */
SDL_LockMutex(is->pictq_mutex); SDL_LockMutex(is->pictq_mutex);

@ -630,8 +630,8 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
&display_aspect_ratio)); &display_aspect_ratio));
} }
probe_str("pix_fmt", probe_str("pix_fmt",
dec_ctx->pix_fmt != PIX_FMT_NONE ? av_pix_fmt_descriptors[dec_ctx->pix_fmt].name dec_ctx->pix_fmt != AV_PIX_FMT_NONE ?
: "unknown"); av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
probe_int("level", dec_ctx->level); probe_int("level", dec_ctx->level);
break; break;

@ -686,8 +686,8 @@ static void print_codec(const AVCodec *c)
} }
printf("\n"); printf("\n");
} }
PRINT_CODEC_SUPPORTED(c, pix_fmts, enum PixelFormat, "pixel formats", PRINT_CODEC_SUPPORTED(c, pix_fmts, enum AVPixelFormat, "pixel formats",
PIX_FMT_NONE, GET_PIX_FMT_NAME); AV_PIX_FMT_NONE, GET_PIX_FMT_NAME);
PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0, PRINT_CODEC_SUPPORTED(c, supported_samplerates, int, "sample rates", 0,
GET_SAMPLE_RATE_NAME); GET_SAMPLE_RATE_NAME);
PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats", PRINT_CODEC_SUPPORTED(c, sample_fmts, enum AVSampleFormat, "sample formats",
@ -866,7 +866,7 @@ int show_filters(void *optctx, const char *opt, const char *arg)
int show_pix_fmts(void *optctx, const char *opt, const char *arg) int show_pix_fmts(void *optctx, const char *opt, const char *arg)
{ {
enum PixelFormat pix_fmt; enum AVPixelFormat pix_fmt;
printf("Pixel formats:\n" printf("Pixel formats:\n"
"I.... = Supported Input format for conversion\n" "I.... = Supported Input format for conversion\n"
@ -882,7 +882,7 @@ int show_pix_fmts(void *optctx, const char *opt, const char *arg)
# define sws_isSupportedOutput(x) 0 # define sws_isSupportedOutput(x) 0
#endif #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]; const AVPixFmtDescriptor *pix_desc = &av_pix_fmt_descriptors[pix_fmt];
printf("%c%c%c%c%c %-16s %d %2d\n", printf("%c%c%c%c%c %-16s %d %2d\n",
sws_isSupportedInput (pix_fmt) ? 'I' : '.', sws_isSupportedInput (pix_fmt) ? 'I' : '.',

@ -416,7 +416,7 @@ typedef struct FrameBuffer {
int linesize[4]; int linesize[4];
int h, w; int h, w;
enum PixelFormat pix_fmt; enum AVPixelFormat pix_fmt;
int refcount; int refcount;
struct FrameBuffer **pool; ///< head of the buffer pool struct FrameBuffer **pool; ///< head of the buffer pool

@ -2132,7 +2132,7 @@ will instruct the source to accept video frames with size 320x240 and
with format "yuv410p", assuming 1/24 as the timestamps timebase and with format "yuv410p", assuming 1/24 as the timestamps timebase and
square pixels (1:1 sample aspect ratio). square pixels (1:1 sample aspect ratio).
Since the pixel format with name "yuv410p" corresponds to the number 6 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: this example corresponds to:
@example @example
buffer=320:240:6:1:24 buffer=320:240:6:1:24

@ -900,9 +900,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
init_vlcs(f); init_vlcs(f);
if (f->version > 2) if (f->version > 2)
avctx->pix_fmt = PIX_FMT_RGB565; avctx->pix_fmt = AV_PIX_FMT_RGB565;
else else
avctx->pix_fmt = PIX_FMT_BGR555; avctx->pix_fmt = AV_PIX_FMT_BGR555;
return 0; return 0;
} }

@ -40,8 +40,8 @@
#include "avcodec.h" #include "avcodec.h"
static const enum PixelFormat pixfmt_rgb24[] = { static const enum AVPixelFormat pixfmt_rgb24[] = {
PIX_FMT_BGR24, PIX_FMT_RGB32, PIX_FMT_NONE }; AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE };
/* /*
* Decoder context * Decoder context
@ -95,7 +95,7 @@ static int decode_frame(AVCodecContext *avctx, void *data,
if (planes == 4) if (planes == 4)
planes--; 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++) { for (p = 0; p < planes; p++) {
/* Lines length pointer for this plane */ /* Lines length pointer for this plane */
@ -170,7 +170,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
switch (avctx->bits_per_coded_sample) { switch (avctx->bits_per_coded_sample) {
case 8: case 8:
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
c->planes = 1; c->planes = 1;
c->planemap[0] = 0; // 1st plane is palette indexes c->planemap[0] = 0; // 1st plane is palette indexes
break; break;
@ -182,7 +182,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
c->planemap[2] = 0; // 3rd plane is blue c->planemap[2] = 0; // 3rd plane is blue
break; break;
case 32: case 32:
avctx->pix_fmt = PIX_FMT_RGB32; avctx->pix_fmt = AV_PIX_FMT_RGB32;
c->planes = 4; c->planes = 4;
#if HAVE_BIGENDIAN #if HAVE_BIGENDIAN
c->planemap[0] = 1; // 1st plane is red c->planemap[0] = 1; // 1st plane is red

@ -379,7 +379,7 @@ AVCodec ff_a64multi_encoder = {
.init = a64multi_init_encoder, .init = a64multi_init_encoder,
.encode2 = a64multi_encode_frame, .encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder, .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"), .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64"),
.capabilities = CODEC_CAP_DELAY, .capabilities = CODEC_CAP_DELAY,
}; };
@ -392,7 +392,7 @@ AVCodec ff_a64multi5_encoder = {
.init = a64multi_init_encoder, .init = a64multi_init_encoder,
.encode2 = a64multi_encode_frame, .encode2 = a64multi_encode_frame,
.close = a64multi_close_encoder, .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)"), .long_name = NULL_IF_CONFIG_SMALL("Multicolor charset for Commodore 64, extended with 5th color (colram)"),
.capabilities = CODEC_CAP_DELAY, .capabilities = CODEC_CAP_DELAY,
}; };

@ -44,7 +44,7 @@ static av_cold int aasc_decode_init(AVCodecContext *avctx)
s->avctx = avctx; s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_BGR24; avctx->pix_fmt = AV_PIX_FMT_BGR24;
return 0; return 0;
} }

@ -39,7 +39,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
AnmContext *s = avctx->priv_data; AnmContext *s = avctx->priv_data;
int i; int i;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
s->frame.reference = 1; s->frame.reference = 1;
bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size); bytestream2_init(&s->gb, avctx->extradata, avctx->extradata_size);

@ -74,7 +74,7 @@ typedef struct {
static av_cold int decode_init(AVCodecContext *avctx) static av_cold int decode_init(AVCodecContext *avctx)
{ {
AnsiContext *s = avctx->priv_data; AnsiContext *s = avctx->priv_data;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
/* defaults */ /* defaults */
s->font = ff_vga16_font; s->font = ff_vga16_font;

@ -345,7 +345,7 @@ static void video_encode_example(const char *filename)
c->time_base= (AVRational){1,25}; c->time_base= (AVRational){1,25};
c->gop_size = 10; /* emit one intra frame every ten frames */ c->gop_size = 10; /* emit one intra frame every ten frames */
c->max_b_frames=1; c->max_b_frames=1;
c->pix_fmt = PIX_FMT_YUV420P; c->pix_fmt = AV_PIX_FMT_YUV420P;
/* open it */ /* open it */
if (avcodec_open2(c, codec, NULL) < 0) { if (avcodec_open2(c, codec, NULL) < 0) {

@ -553,7 +553,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
common_init(avctx); common_init(avctx);
init_vlcs(a); init_vlcs(a);
ff_init_scantable(a->dsp.idct_permutation, &a->scantable, scantab); 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]; a->inv_qscale= avctx->extradata[0];
if(a->inv_qscale == 0){ if(a->inv_qscale == 0){
@ -649,7 +649,7 @@ AVCodec ff_asv1_encoder = {
.priv_data_size = sizeof(ASV1Context), .priv_data_size = sizeof(ASV1Context),
.init = encode_init, .init = encode_init,
.encode2 = encode_frame, .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"), .long_name = NULL_IF_CONFIG_SMALL("ASUS V1"),
}; };
#endif #endif
@ -662,7 +662,7 @@ AVCodec ff_asv2_encoder = {
.priv_data_size = sizeof(ASV1Context), .priv_data_size = sizeof(ASV1Context),
.init = encode_init, .init = encode_init,
.encode2 = encode_frame, .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"), .long_name = NULL_IF_CONFIG_SMALL("ASUS V2"),
}; };
#endif #endif

@ -39,7 +39,7 @@ static av_cold int aura_decode_init(AVCodecContext *avctx)
/* width needs to be divisible by 4 for this codec to work */ /* width needs to be divisible by 4 for this codec to work */
if (avctx->width & 0x3) if (avctx->width & 0x3)
return -1; return -1;
avctx->pix_fmt = PIX_FMT_YUV422P; avctx->pix_fmt = AV_PIX_FMT_YUV422P;
return 0; return 0;
} }

@ -1011,7 +1011,7 @@ typedef struct AVFrame {
/** /**
* format of the frame, -1 if unknown or unset * 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) * enum AVSampleFormat for audio)
* - encoding: unused * - encoding: unused
* - decoding: Read by user. * - decoding: Read by user.
@ -1492,13 +1492,13 @@ typedef struct AVCodecContext {
int gop_size; 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 set by the demuxer if known from headers.
* May be overriden by the decoder if it knows better. * May be overriden by the decoder if it knows better.
* - encoding: Set by user. * - encoding: Set by user.
* - decoding: Set by user if known, overridden by libavcodec if known * - 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. * Motion estimation algorithm used for video coding.
@ -1545,7 +1545,7 @@ typedef struct AVCodecContext {
* - encoding: unused * - encoding: unused
* - decoding: Set by user, if not set the native format will be chosen. * - 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 * maximum number of B-frames between non-B-frames
@ -2931,7 +2931,7 @@ typedef struct AVCodec {
*/ */
int capabilities; int capabilities;
const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} 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 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 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 const uint64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
@ -3032,7 +3032,7 @@ typedef struct AVHWAccel {
* *
* Only hardware accelerated formats are supported here. * Only hardware accelerated formats are supported here.
*/ */
enum PixelFormat pix_fmt; enum AVPixelFormat pix_fmt;
/** /**
* Hardware accelerated codec capabilities. * Hardware accelerated codec capabilities.
@ -4135,7 +4135,7 @@ void av_resample_close(struct AVResampleContext *c);
* @param height the height of the picture * @param height the height of the picture
* @return zero if successful, a negative value if not * @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(). * Free a picture previously allocated by avpicture_alloc().
@ -4167,7 +4167,7 @@ void avpicture_free(AVPicture *picture);
* @return size of the image data in bytes * @return size of the image data in bytes
*/ */
int avpicture_fill(AVPicture *picture, uint8_t *ptr, 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. * Copy pixel data from an AVPicture into a buffer.
@ -4184,7 +4184,8 @@ int avpicture_fill(AVPicture *picture, uint8_t *ptr,
* @param[in] dest_size The size of 'dest'. * @param[in] dest_size The size of 'dest'.
* @return The number of bytes written to dest, or a negative value (error code) on error. * @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); unsigned char *dest, int dest_size);
/** /**
@ -4199,29 +4200,29 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
* @param height the height of the image * @param height the height of the image
* @return Image data size in bytes or -1 on error (e.g. too large dimensions). * @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 * deinterlace - if not supported return -1
*/ */
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, 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. * Copy image src to dst. Wraps av_picture_data_copy() above.
*/ */
void av_picture_copy(AVPicture *dst, const AVPicture *src, 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. * Crop image top and left side.
*/ */
int av_picture_crop(AVPicture *dst, const AVPicture *src, 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. * 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); int padtop, int padbottom, int padleft, int padright, int *color);
/** /**
@ -4244,14 +4245,14 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
* @{ * @{
*/ */
void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); void avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
/** /**
* Return a value representing the fourCC code associated to the * Return a value representing the fourCC code associated to the
* pixel format pix_fmt, or 0 if no associated fourCC code can be * pixel format pix_fmt, or 0 if no associated fourCC code can be
* found. * 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_RESOLUTION 0x0001 /**< loss due to resolution change */
#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ #define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */
@ -4277,7 +4278,7 @@ unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt);
* @param[in] has_alpha Whether the source pixel format alpha channel is used. * @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. * @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); int has_alpha);
#if FF_API_FIND_BEST_PIX_FMT #if FF_API_FIND_BEST_PIX_FMT
@ -4294,8 +4295,8 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
* pix_fmt_mask parameter. * pix_fmt_mask parameter.
* *
* @code * @code
* src_pix_fmt = PIX_FMT_YUV420P; * src_pix_fmt = AV_PIX_FMT_YUV420P;
* pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24); * 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); * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss);
* @endcode * @endcode
* *
@ -4306,7 +4307,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
* @return The best pixel format to convert to or -1 if none was found. * @return The best pixel format to convert to or -1 if none was found.
*/ */
attribute_deprecated 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); int has_alpha, int *loss_ptr);
#endif /* FF_API_FIND_BEST_PIX_FMT */ #endif /* FF_API_FIND_BEST_PIX_FMT */
@ -4321,17 +4322,17 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
* pix_fmt_list parameter. * 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] src_pix_fmt source pixel format
* @param[in] has_alpha Whether the source pixel format alpha channel is used. * @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. * @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. * @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 AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
enum PixelFormat src_pix_fmt, enum AVPixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr); int has_alpha, int *loss_ptr);
enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt); enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
/** /**
* @} * @}

@ -157,7 +157,7 @@ avs_decode_frame(AVCodecContext * avctx,
static av_cold int avs_decode_init(AVCodecContext * avctx) 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); avcodec_set_dimensions(avctx, 318, 198);
return 0; return 0;
} }

@ -43,7 +43,7 @@ static av_cold int bethsoftvid_decode_init(AVCodecContext *avctx)
vid->frame.reference = 1; vid->frame.reference = 1;
vid->frame.buffer_hints = FF_BUFFER_HINTS_VALID | vid->frame.buffer_hints = FF_BUFFER_HINTS_VALID |
FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE; FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0; return 0;
} }

@ -39,7 +39,7 @@ typedef struct BFIContext {
static av_cold int bfi_decode_init(AVCodecContext *avctx) static av_cold int bfi_decode_init(AVCodecContext *avctx)
{ {
BFIContext *bfi = avctx->priv_data; 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); bfi->dst = av_mallocz(avctx->width * avctx->height);
return 0; return 0;
} }

@ -1296,7 +1296,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
return 1; 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; avctx->idct_algo = FF_IDCT_BINK;
ff_dsputil_init(&c->dsp, avctx); ff_dsputil_init(&c->dsp, avctx);

@ -136,7 +136,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
avctx->width = width; avctx->width = width;
avctx->height = height > 0? height: -height; avctx->height = height > 0? height: -height;
avctx->pix_fmt = PIX_FMT_NONE; avctx->pix_fmt = AV_PIX_FMT_NONE;
switch(depth){ switch(depth){
case 32: case 32:
@ -155,21 +155,21 @@ static int bmp_decode_frame(AVCodecContext *avctx,
rgb[2] = 0; rgb[2] = 0;
} }
avctx->pix_fmt = PIX_FMT_BGR24; avctx->pix_fmt = AV_PIX_FMT_BGR24;
break; break;
case 24: case 24:
avctx->pix_fmt = PIX_FMT_BGR24; avctx->pix_fmt = AV_PIX_FMT_BGR24;
break; break;
case 16: case 16:
if(comp == BMP_RGB) if(comp == BMP_RGB)
avctx->pix_fmt = PIX_FMT_RGB555; avctx->pix_fmt = AV_PIX_FMT_RGB555;
else if (comp == BMP_BITFIELDS) { else if (comp == BMP_BITFIELDS) {
if (rgb[0] == 0xF800 && rgb[1] == 0x07E0 && rgb[2] == 0x001F) 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) 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) 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 { else {
av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]); av_log(avctx, AV_LOG_ERROR, "Unknown bitfields %0X %0X %0X\n", rgb[0], rgb[1], rgb[2]);
return AVERROR(EINVAL); return AVERROR(EINVAL);
@ -178,14 +178,14 @@ static int bmp_decode_frame(AVCodecContext *avctx,
break; break;
case 8: case 8:
if(hsize - ihsize - 14 > 0) if(hsize - ihsize - 14 > 0)
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
else else
avctx->pix_fmt = PIX_FMT_GRAY8; avctx->pix_fmt = AV_PIX_FMT_GRAY8;
break; break;
case 1: case 1:
case 4: case 4:
if(hsize - ihsize - 14 > 0){ if(hsize - ihsize - 14 > 0){
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
}else{ }else{
av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1<<depth); av_log(avctx, AV_LOG_ERROR, "Unknown palette for %d-colour BMP\n", 1<<depth);
return -1; return -1;
@ -196,7 +196,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
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"); av_log(avctx, AV_LOG_ERROR, "unsupported pixel format\n");
return -1; return -1;
} }
@ -236,7 +236,7 @@ static int bmp_decode_frame(AVCodecContext *avctx,
linesize = p->linesize[0]; linesize = p->linesize[0];
} }
if(avctx->pix_fmt == PIX_FMT_PAL8){ if(avctx->pix_fmt == AV_PIX_FMT_PAL8){
int colors = 1 << depth; int colors = 1 << depth;
memset(p->data[1], 0, 1024); memset(p->data[1], 0, 1024);

@ -37,23 +37,23 @@ static av_cold int bmp_encode_init(AVCodecContext *avctx){
avctx->coded_frame = &s->picture; avctx->coded_frame = &s->picture;
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
case PIX_FMT_BGR24: case AV_PIX_FMT_BGR24:
avctx->bits_per_coded_sample = 24; avctx->bits_per_coded_sample = 24;
break; break;
case PIX_FMT_RGB555: case AV_PIX_FMT_RGB555:
case PIX_FMT_RGB565: case AV_PIX_FMT_RGB565:
case PIX_FMT_RGB444: case AV_PIX_FMT_RGB444:
avctx->bits_per_coded_sample = 16; avctx->bits_per_coded_sample = 16;
break; break;
case PIX_FMT_RGB8: case AV_PIX_FMT_RGB8:
case PIX_FMT_BGR8: case AV_PIX_FMT_BGR8:
case PIX_FMT_RGB4_BYTE: case AV_PIX_FMT_RGB4_BYTE:
case PIX_FMT_BGR4_BYTE: case AV_PIX_FMT_BGR4_BYTE:
case PIX_FMT_GRAY8: case AV_PIX_FMT_GRAY8:
case PIX_FMT_PAL8: case AV_PIX_FMT_PAL8:
avctx->bits_per_coded_sample = 8; avctx->bits_per_coded_sample = 8;
break; break;
case PIX_FMT_MONOBLACK: case AV_PIX_FMT_MONOBLACK:
avctx->bits_per_coded_sample = 1; avctx->bits_per_coded_sample = 1;
break; break;
default: default:
@ -78,26 +78,26 @@ static int bmp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
p->pict_type= AV_PICTURE_TYPE_I; p->pict_type= AV_PICTURE_TYPE_I;
p->key_frame= 1; p->key_frame= 1;
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
case PIX_FMT_RGB444: case AV_PIX_FMT_RGB444:
compression = BMP_BITFIELDS; compression = BMP_BITFIELDS;
pal = rgb444_masks; // abuse pal to hold color masks pal = rgb444_masks; // abuse pal to hold color masks
pal_entries = 3; pal_entries = 3;
break; break;
case PIX_FMT_RGB565: case AV_PIX_FMT_RGB565:
compression = BMP_BITFIELDS; compression = BMP_BITFIELDS;
pal = rgb565_masks; // abuse pal to hold color masks pal = rgb565_masks; // abuse pal to hold color masks
pal_entries = 3; pal_entries = 3;
break; break;
case PIX_FMT_RGB8: case AV_PIX_FMT_RGB8:
case PIX_FMT_BGR8: case AV_PIX_FMT_BGR8:
case PIX_FMT_RGB4_BYTE: case AV_PIX_FMT_RGB4_BYTE:
case PIX_FMT_BGR4_BYTE: case AV_PIX_FMT_BGR4_BYTE:
case PIX_FMT_GRAY8: case AV_PIX_FMT_GRAY8:
ff_set_systematic_pal2((uint32_t*)p->data[1], avctx->pix_fmt); 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]; pal = (uint32_t *)p->data[1];
break; break;
case PIX_FMT_MONOBLACK: case AV_PIX_FMT_MONOBLACK:
pal = monoblack_pal; pal = monoblack_pal;
break; break;
} }
@ -166,12 +166,12 @@ AVCodec ff_bmp_encoder = {
.priv_data_size = sizeof(BMPContext), .priv_data_size = sizeof(BMPContext),
.init = bmp_encode_init, .init = bmp_encode_init,
.encode2 = bmp_encode_frame, .encode2 = bmp_encode_frame,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_BGR24, AV_PIX_FMT_BGR24,
PIX_FMT_RGB555, PIX_FMT_RGB444, PIX_FMT_RGB565, AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, AV_PIX_FMT_RGB565,
PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, PIX_FMT_GRAY8, PIX_FMT_PAL8, 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,
PIX_FMT_MONOBLACK, AV_PIX_FMT_MONOBLACK,
PIX_FMT_NONE AV_PIX_FMT_NONE
}, },
.long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"), .long_name = NULL_IF_CONFIG_SMALL("BMP (Windows and OS/2 bitmap)"),
}; };

@ -266,7 +266,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
BMVDecContext * const c = avctx->priv_data; BMVDecContext * const c = avctx->priv_data;
c->avctx = avctx; c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
c->pic.reference = 1; c->pic.reference = 1;
if (avctx->get_buffer(avctx, &c->pic) < 0) { if (avctx->get_buffer(avctx, &c->pic) < 0) {

@ -47,7 +47,7 @@ typedef enum {
static av_cold int decode_init(AVCodecContext *avctx) static av_cold int decode_init(AVCodecContext *avctx)
{ {
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0; return 0;
} }

@ -712,7 +712,7 @@ av_cold int ff_cavs_init(AVCodecContext *avctx) {
ff_cavsdsp_init(&h->cdsp, avctx); ff_cavsdsp_init(&h->cdsp, avctx);
s->avctx = 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[0] = 0;
h->luma_scan[1] = 8; h->luma_scan[1] = 8;

@ -86,7 +86,7 @@ static av_cold int cdg_decode_init(AVCodecContext *avctx)
avctx->width = CDG_FULL_WIDTH; avctx->width = CDG_FULL_WIDTH;
avctx->height = CDG_FULL_HEIGHT; avctx->height = CDG_FULL_HEIGHT;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0; return 0;
} }

@ -247,11 +247,11 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
if (c->video_size < aligned_width * avctx->height * c->bpp / 8) if (c->video_size < aligned_width * avctx->height * c->bpp / 8)
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
if (!encoding && c->palette_size && c->bpp <= 8) { 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)) { } else if (encoding == 1 && (c->bpp == 6 || c->bpp == 8)) {
if (c->palette_size != (1 << (c->bpp - 1))) if (c->palette_size != (1 << (c->bpp - 1)))
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
avctx->pix_fmt = PIX_FMT_BGR24; avctx->pix_fmt = AV_PIX_FMT_BGR24;
} else { } else {
av_log_ask_for_sample(avctx, "unsupported encoding %d and bpp %d\n", av_log_ask_for_sample(avctx, "unsupported encoding %d and bpp %d\n",
encoding, c->bpp); encoding, c->bpp);

@ -407,10 +407,10 @@ static av_cold int cinepak_decode_init(AVCodecContext *avctx)
// check for paletted data // check for paletted data
if (avctx->bits_per_coded_sample != 8) { if (avctx->bits_per_coded_sample != 8) {
s->palette_video = 0; s->palette_video = 0;
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
} else { } else {
s->palette_video = 1; s->palette_video = 1;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
} }
s->frame.data[0] = NULL; s->frame.data[0] = NULL;

@ -102,7 +102,7 @@ static int decode_frame(AVCodecContext *avctx,
static av_cold int decode_init(AVCodecContext *avctx) static av_cold int decode_init(AVCodecContext *avctx)
{ {
avctx->pix_fmt = PIX_FMT_YUV411P; avctx->pix_fmt = AV_PIX_FMT_YUV411P;
return common_init(avctx); return common_init(avctx);
} }
@ -175,8 +175,8 @@ AVCodec ff_cljr_encoder = {
.priv_data_size = sizeof(CLJRContext), .priv_data_size = sizeof(CLJRContext),
.init = common_init, .init = common_init,
.encode2 = encode_frame, .encode2 = encode_frame,
.pix_fmts = (const enum PixelFormat[]) { PIX_FMT_YUV411P, .pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P,
PIX_FMT_NONE }, AV_PIX_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"), .long_name = NULL_IF_CONFIG_SMALL("Cirrus Logic AccuPak"),
}; };
#endif #endif

@ -330,7 +330,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
switch (coding_type) { switch (coding_type) {
case 1: case 1:
case 2: case 2:
avctx->pix_fmt = PIX_FMT_RGB24; avctx->pix_fmt = AV_PIX_FMT_RGB24;
avctx->bits_per_raw_sample = 8; avctx->bits_per_raw_sample = 8;
ret = avctx->get_buffer(avctx, pic); ret = avctx->get_buffer(avctx, pic);
@ -345,7 +345,7 @@ static int cllc_decode_frame(AVCodecContext *avctx, void *data,
break; break;
case 3: case 3:
avctx->pix_fmt = PIX_FMT_ARGB; avctx->pix_fmt = AV_PIX_FMT_ARGB;
avctx->bits_per_raw_sample = 8; avctx->bits_per_raw_sample = 8;
ret = avctx->get_buffer(avctx, pic); ret = avctx->get_buffer(avctx, pic);

@ -222,9 +222,9 @@ static av_cold int decode_init(AVCodecContext *avctx) {
CamStudioContext *c = avctx->priv_data; CamStudioContext *c = avctx->priv_data;
int stride; int stride;
switch (avctx->bits_per_coded_sample) { switch (avctx->bits_per_coded_sample) {
case 16: avctx->pix_fmt = PIX_FMT_RGB555; break; case 16: avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
case 24: avctx->pix_fmt = PIX_FMT_BGR24; break; case 24: 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: default:
av_log(avctx, AV_LOG_ERROR, av_log(avctx, AV_LOG_ERROR,
"CamStudio codec error: invalid depth %i bpp\n", "CamStudio codec error: invalid depth %i bpp\n",

@ -53,7 +53,7 @@ static av_cold int cyuv_decode_init(AVCodecContext *avctx)
if (s->width & 0x3) if (s->width & 0x3)
return -1; return -1;
s->height = avctx->height; s->height = avctx->height;
avctx->pix_fmt = PIX_FMT_YUV411P; avctx->pix_fmt = AV_PIX_FMT_YUV411P;
return 0; return 0;
} }

@ -38,7 +38,7 @@ static av_cold int dfa_decode_init(AVCodecContext *avctx)
DfaContext *s = avctx->priv_data; DfaContext *s = avctx->priv_data;
int ret; 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) if ((ret = av_image_check_size(avctx->width, avctx->height, 0, avctx)) < 0)
return ret; return ret;

@ -107,9 +107,9 @@ static const struct {
}; };
/* [DIRAC_STD] Table 10.2 Supported chroma sampling formats + luma Offset */ /* [DIRAC_STD] Table 10.2 Supported chroma sampling formats + luma Offset */
static const enum PixelFormat dirac_pix_fmt[2][3] = { static const enum AVPixelFormat dirac_pix_fmt[2][3] = {
{ PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV420P }, { AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P },
{ PIX_FMT_YUVJ444P, PIX_FMT_YUVJ422P, PIX_FMT_YUVJ420P }, { AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ420P },
}; };
/* [DIRAC_STD] 10.3 Parse Source Parameters. /* [DIRAC_STD] 10.3 Parse Source Parameters.

@ -124,7 +124,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height); av_dlog(ctx->avctx, "width %d, height %d\n", ctx->width, ctx->height);
if (buf[0x21] & 0x40) { 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; ctx->avctx->bits_per_raw_sample = 10;
if (ctx->bit_depth != 10) { if (ctx->bit_depth != 10) {
ff_dsputil_init(&ctx->dsp, ctx->avctx); ff_dsputil_init(&ctx->dsp, ctx->avctx);
@ -132,7 +132,7 @@ static int dnxhd_decode_header(DNXHDContext *ctx, const uint8_t *buf, int buf_si
ctx->decode_dct_block = dnxhd_decode_dct_block_10; ctx->decode_dct_block = dnxhd_decode_dct_block_10;
} }
} else { } else {
ctx->avctx->pix_fmt = PIX_FMT_YUV422P; ctx->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
ctx->avctx->bits_per_raw_sample = 8; ctx->avctx->bits_per_raw_sample = 8;
if (ctx->bit_depth != 8) { if (ctx->bit_depth != 8) {
ff_dsputil_init(&ctx->dsp, ctx->avctx); ff_dsputil_init(&ctx->dsp, ctx->avctx);

@ -233,10 +233,10 @@ static int dnxhd_encode_init(AVCodecContext *avctx)
int i, index, bit_depth; int i, index, bit_depth;
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
case PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
bit_depth = 8; bit_depth = 8;
break; break;
case PIX_FMT_YUV422P10: case AV_PIX_FMT_YUV422P10:
bit_depth = 10; bit_depth = 10;
break; break;
default: default:
@ -1005,9 +1005,9 @@ AVCodec ff_dnxhd_encoder = {
.encode2 = dnxhd_encode_picture, .encode2 = dnxhd_encode_picture,
.close = dnxhd_encode_end, .close = dnxhd_encode_end,
.capabilities = CODEC_CAP_SLICE_THREADS, .capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV422P, .pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P,
PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P10,
PIX_FMT_NONE }, AV_PIX_FMT_NONE },
.long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"), .long_name = NULL_IF_CONFIG_SMALL("VC3/DNxHD"),
.priv_class = &class, .priv_class = &class,
}; };

@ -126,24 +126,24 @@ static int decode_frame(AVCodecContext *avctx,
switch (bits_per_color) { switch (bits_per_color) {
case 8: case 8:
if (elements == 4) { if (elements == 4) {
avctx->pix_fmt = PIX_FMT_RGBA; avctx->pix_fmt = AV_PIX_FMT_RGBA;
} else { } else {
avctx->pix_fmt = PIX_FMT_RGB24; avctx->pix_fmt = AV_PIX_FMT_RGB24;
} }
source_packet_size = elements; source_packet_size = elements;
target_packet_size = elements; target_packet_size = elements;
break; break;
case 10: case 10:
avctx->pix_fmt = PIX_FMT_RGB48; avctx->pix_fmt = AV_PIX_FMT_RGB48;
target_packet_size = 6; target_packet_size = 6;
source_packet_size = 4; source_packet_size = 4;
break; break;
case 12: case 12:
case 16: case 16:
if (endian) { if (endian) {
avctx->pix_fmt = PIX_FMT_RGB48BE; avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
} else { } else {
avctx->pix_fmt = PIX_FMT_RGB48LE; avctx->pix_fmt = AV_PIX_FMT_RGB48LE;
} }
target_packet_size = 6; target_packet_size = 6;
source_packet_size = elements * 2; source_packet_size = elements * 2;

@ -45,14 +45,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
s->descriptor = 50; /* RGB */ s->descriptor = 50; /* RGB */
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
case PIX_FMT_RGB24: case AV_PIX_FMT_RGB24:
break; break;
case PIX_FMT_RGBA: case AV_PIX_FMT_RGBA:
s->descriptor = 51; /* RGBA */ s->descriptor = 51; /* RGBA */
break; break;
case PIX_FMT_RGB48LE: case AV_PIX_FMT_RGB48LE:
s->big_endian = 0; 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; s->bits_per_component = avctx->bits_per_raw_sample ? avctx->bits_per_raw_sample : 16;
break; break;
default: default:
@ -180,11 +180,11 @@ AVCodec ff_dpx_encoder = {
.priv_data_size = sizeof(DPXContext), .priv_data_size = sizeof(DPXContext),
.init = encode_init, .init = encode_init,
.encode2 = encode_frame, .encode2 = encode_frame,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_RGB24, AV_PIX_FMT_RGB24,
PIX_FMT_RGBA, AV_PIX_FMT_RGBA,
PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48LE,
PIX_FMT_RGB48BE, AV_PIX_FMT_RGB48BE,
PIX_FMT_NONE}, AV_PIX_FMT_NONE},
.long_name = NULL_IF_CONFIG_SMALL("DPX image"), .long_name = NULL_IF_CONFIG_SMALL("DPX image"),
}; };

@ -93,7 +93,7 @@ static av_cold int cinvideo_decode_init(AVCodecContext *avctx)
unsigned int i; unsigned int i;
cin->avctx = avctx; cin->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
cin->frame.data[0] = NULL; cin->frame.data[0] = NULL;

@ -137,19 +137,19 @@ static inline void dv_calc_mb_coordinates(const DVprofile *d, int chan, int seq,
break; break;
case 720: case 720:
switch (d->pix_fmt) { switch (d->pix_fmt) {
case PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
x = shuf3[m] + slot/3; x = shuf3[m] + slot/3;
y = serpent1[slot] + y = serpent1[slot] +
((((seq + off[m]) % d->difseg_size)<<1) + chan)*3; ((((seq + off[m]) % d->difseg_size)<<1) + chan)*3;
tbl[m] = (x<<1)|(y<<8); tbl[m] = (x<<1)|(y<<8);
break; break;
case PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
x = shuf3[m] + slot/3; x = shuf3[m] + slot/3;
y = serpent1[slot] + y = serpent1[slot] +
((seq + off[m]) % d->difseg_size)*3; ((seq + off[m]) % d->difseg_size)*3;
tbl[m] = (x<<1)|(y<<9); tbl[m] = (x<<1)|(y<<9);
break; break;
case PIX_FMT_YUV411P: case AV_PIX_FMT_YUV411P:
i = (seq + off[m]) % d->difseg_size; i = (seq + off[m]) % d->difseg_size;
k = slot + ((m==1||m==2)?3:0); k = slot + ((m==1||m==2)?3:0);
@ -677,8 +677,8 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y); dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);
/* initializing luminance blocks */ /* initializing luminance blocks */
if ((s->sys->pix_fmt == PIX_FMT_YUV420P) || if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) ||
(s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) || (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||
(s->sys->height >= 720 && mb_y != 134)) { (s->sys->height >= 720 && mb_y != 134)) {
y_stride = s->picture.linesize[0] << 3; y_stride = s->picture.linesize[0] << 3;
} else { } else {
@ -703,13 +703,13 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
enc_blk += 4; enc_blk += 4;
/* initializing chrominance blocks */ /* initializing chrominance blocks */
c_offset = (((mb_y >> (s->sys->pix_fmt == PIX_FMT_YUV420P)) * s->picture.linesize[1] + c_offset = (((mb_y >> (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->picture.linesize[1] +
(mb_x >> ((s->sys->pix_fmt == PIX_FMT_YUV411P) ? 2 : 1))) << 3); (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << 3);
for (j = 2; j; j--) { for (j = 2; j; j--) {
uint8_t *c_ptr = s->picture.data[j] + c_offset; uint8_t *c_ptr = s->picture.data[j] + c_offset;
linesize = s->picture.linesize[j]; linesize = s->picture.linesize[j];
y_stride = (mb_y == 134) ? 8 : (s->picture.linesize[j] << 3); 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* d;
uint8_t* b = scratch; uint8_t* b = scratch;
for (i = 0; i < 8; i++) { for (i = 0; i < 8; i++) {
@ -806,7 +806,7 @@ static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c,
* 2. It is not at all clear what STYPE is used for 4:2:0 PAL * 2. It is not at all clear what STYPE is used for 4:2:0 PAL
* compression scheme (if any). * 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; uint8_t aspect = 0;
if ((int)(av_q2d(c->avctx->sample_aspect_ratio) * c->avctx->width / c->avctx->height * 10) >= 17) /* 16:9 */ if ((int)(av_q2d(c->avctx->sample_aspect_ratio) * c->avctx->width / c->avctx->height * 10) >= 17) /* 16:9 */
@ -984,8 +984,8 @@ AVCodec ff_dvvideo_encoder = {
.init = dvvideo_init_encoder, .init = dvvideo_init_encoder,
.encode2 = dvvideo_encode_frame, .encode2 = dvvideo_encode_frame,
.capabilities = CODEC_CAP_SLICE_THREADS, .capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts = (const enum PixelFormat[]) { .pix_fmts = (const enum AVPixelFormat[]) {
PIX_FMT_YUV411P, PIX_FMT_YUV422P, PIX_FMT_YUV420P, PIX_FMT_NONE 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)"), .long_name = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
}; };

@ -90,7 +90,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{8, 9}, {32, 27}}, .sar = {{8, 9}, {32, 27}},
.work_chunks = &work_chunks_dv25ntsc[0], .work_chunks = &work_chunks_dv25ntsc[0],
.idct_factor = &dv_idct_factor_sd[0], .idct_factor = &dv_idct_factor_sd[0],
.pix_fmt = PIX_FMT_YUV411P, .pix_fmt = AV_PIX_FMT_YUV411P,
.bpm = 6, .bpm = 6,
.block_sizes = block_sizes_dv2550, .block_sizes = block_sizes_dv2550,
.audio_stride = 90, .audio_stride = 90,
@ -110,7 +110,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{16, 15}, {64, 45}}, .sar = {{16, 15}, {64, 45}},
.work_chunks = &work_chunks_dv25pal[0], .work_chunks = &work_chunks_dv25pal[0],
.idct_factor = &dv_idct_factor_sd[0], .idct_factor = &dv_idct_factor_sd[0],
.pix_fmt = PIX_FMT_YUV420P, .pix_fmt = AV_PIX_FMT_YUV420P,
.bpm = 6, .bpm = 6,
.block_sizes = block_sizes_dv2550, .block_sizes = block_sizes_dv2550,
.audio_stride = 108, .audio_stride = 108,
@ -130,7 +130,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{16, 15}, {64, 45}}, .sar = {{16, 15}, {64, 45}},
.work_chunks = &work_chunks_dv25pal411[0], .work_chunks = &work_chunks_dv25pal411[0],
.idct_factor = &dv_idct_factor_sd[0], .idct_factor = &dv_idct_factor_sd[0],
.pix_fmt = PIX_FMT_YUV411P, .pix_fmt = AV_PIX_FMT_YUV411P,
.bpm = 6, .bpm = 6,
.block_sizes = block_sizes_dv2550, .block_sizes = block_sizes_dv2550,
.audio_stride = 108, .audio_stride = 108,
@ -150,7 +150,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{8, 9}, {32, 27}}, .sar = {{8, 9}, {32, 27}},
.work_chunks = &work_chunks_dv50ntsc[0], .work_chunks = &work_chunks_dv50ntsc[0],
.idct_factor = &dv_idct_factor_sd[0], .idct_factor = &dv_idct_factor_sd[0],
.pix_fmt = PIX_FMT_YUV422P, .pix_fmt = AV_PIX_FMT_YUV422P,
.bpm = 6, .bpm = 6,
.block_sizes = block_sizes_dv2550, .block_sizes = block_sizes_dv2550,
.audio_stride = 90, .audio_stride = 90,
@ -170,7 +170,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{16, 15}, {64, 45}}, .sar = {{16, 15}, {64, 45}},
.work_chunks = &work_chunks_dv50pal[0], .work_chunks = &work_chunks_dv50pal[0],
.idct_factor = &dv_idct_factor_sd[0], .idct_factor = &dv_idct_factor_sd[0],
.pix_fmt = PIX_FMT_YUV422P, .pix_fmt = AV_PIX_FMT_YUV422P,
.bpm = 6, .bpm = 6,
.block_sizes = block_sizes_dv2550, .block_sizes = block_sizes_dv2550,
.audio_stride = 108, .audio_stride = 108,
@ -190,7 +190,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{1, 1}, {3, 2}}, .sar = {{1, 1}, {3, 2}},
.work_chunks = &work_chunks_dv100ntsci[0], .work_chunks = &work_chunks_dv100ntsci[0],
.idct_factor = &dv_idct_factor_hd1080[0], .idct_factor = &dv_idct_factor_hd1080[0],
.pix_fmt = PIX_FMT_YUV422P, .pix_fmt = AV_PIX_FMT_YUV422P,
.bpm = 8, .bpm = 8,
.block_sizes = block_sizes_dv100, .block_sizes = block_sizes_dv100,
.audio_stride = 90, .audio_stride = 90,
@ -210,7 +210,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{1, 1}, {4, 3}}, .sar = {{1, 1}, {4, 3}},
.work_chunks = &work_chunks_dv100pali[0], .work_chunks = &work_chunks_dv100pali[0],
.idct_factor = &dv_idct_factor_hd1080[0], .idct_factor = &dv_idct_factor_hd1080[0],
.pix_fmt = PIX_FMT_YUV422P, .pix_fmt = AV_PIX_FMT_YUV422P,
.bpm = 8, .bpm = 8,
.block_sizes = block_sizes_dv100, .block_sizes = block_sizes_dv100,
.audio_stride = 108, .audio_stride = 108,
@ -230,7 +230,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{1, 1}, {4, 3}}, .sar = {{1, 1}, {4, 3}},
.work_chunks = &work_chunks_dv100ntscp[0], .work_chunks = &work_chunks_dv100ntscp[0],
.idct_factor = &dv_idct_factor_hd720[0], .idct_factor = &dv_idct_factor_hd720[0],
.pix_fmt = PIX_FMT_YUV422P, .pix_fmt = AV_PIX_FMT_YUV422P,
.bpm = 8, .bpm = 8,
.block_sizes = block_sizes_dv100, .block_sizes = block_sizes_dv100,
.audio_stride = 90, .audio_stride = 90,
@ -250,7 +250,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{1, 1}, {4, 3}}, .sar = {{1, 1}, {4, 3}},
.work_chunks = &work_chunks_dv100palp[0], .work_chunks = &work_chunks_dv100palp[0],
.idct_factor = &dv_idct_factor_hd720[0], .idct_factor = &dv_idct_factor_hd720[0],
.pix_fmt = PIX_FMT_YUV422P, .pix_fmt = AV_PIX_FMT_YUV422P,
.bpm = 8, .bpm = 8,
.block_sizes = block_sizes_dv100, .block_sizes = block_sizes_dv100,
.audio_stride = 90, .audio_stride = 90,
@ -270,7 +270,7 @@ static const DVprofile dv_profiles[] = {
.sar = {{16, 15}, {64, 45}}, .sar = {{16, 15}, {64, 45}},
.work_chunks = &work_chunks_dv25pal[0], .work_chunks = &work_chunks_dv25pal[0],
.idct_factor = &dv_idct_factor_sd[0], .idct_factor = &dv_idct_factor_sd[0],
.pix_fmt = PIX_FMT_YUV420P, .pix_fmt = AV_PIX_FMT_YUV420P,
.bpm = 6, .bpm = 6,
.block_sizes = block_sizes_dv2550, .block_sizes = block_sizes_dv2550,
.audio_stride = 108, .audio_stride = 108,

@ -49,7 +49,7 @@ typedef struct DVprofile {
AVRational sar[2]; /* sample aspect ratios for 4:3 and 16:9 */ 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 */ DVwork_chunk *work_chunks; /* each thread gets its own chunk of frame to work on */
uint32_t *idct_factor; /* set of iDCT factor tables */ 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 */ int bpm; /* blocks per macroblock */
const uint8_t *block_sizes; /* AC block sizes, in bits */ const uint8_t *block_sizes; /* AC block sizes, in bits */
int audio_stride; /* size of audio_shuffle table */ int audio_stride; /* size of audio_shuffle table */

@ -253,8 +253,8 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y); dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);
/* idct_put'ting luminance */ /* idct_put'ting luminance */
if ((s->sys->pix_fmt == PIX_FMT_YUV420P) || if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) ||
(s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) || (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||
(s->sys->height >= 720 && mb_y != 134)) { (s->sys->height >= 720 && mb_y != 134)) {
y_stride = (s->picture.linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize)); y_stride = (s->picture.linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize));
} else { } else {
@ -274,11 +274,11 @@ static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
block += 4*64; block += 4*64;
/* idct_put'ting chrominance */ /* idct_put'ting chrominance */
c_offset = (((mb_y >> (s->sys->pix_fmt == PIX_FMT_YUV420P)) * s->picture.linesize[1] + c_offset = (((mb_y >> (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->picture.linesize[1] +
(mb_x >> ((s->sys->pix_fmt == PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize); (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize);
for (j = 2; j; j--) { for (j = 2; j; j--) {
uint8_t *c_ptr = s->picture.data[j] + c_offset; 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]; uint64_t aligned_pixels[64/8];
uint8_t *pixels = (uint8_t*)aligned_pixels; uint8_t *pixels = (uint8_t*)aligned_pixels;
uint8_t *c_ptr1, *ptr1; uint8_t *c_ptr1, *ptr1;

@ -292,7 +292,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
{ {
DxaDecContext * const c = avctx->priv_data; 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; c->dsize = avctx->width * avctx->height * 2;
if((c->decomp_buf = av_malloc(c->dsize)) == NULL) { if((c->decomp_buf = av_malloc(c->dsize)) == NULL) {

@ -26,7 +26,7 @@
static av_cold int decode_init(AVCodecContext *avctx) 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(); avctx->coded_frame = avcodec_alloc_frame();
if (!avctx->coded_frame) if (!avctx->coded_frame)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);

@ -443,7 +443,7 @@ AVHWAccel ff_h264_dxva2_hwaccel = {
.name = "h264_dxva2", .name = "h264_dxva2",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_H264, .id = AV_CODEC_ID_H264,
.pix_fmt = PIX_FMT_DXVA2_VLD, .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
.start_frame = start_frame, .start_frame = start_frame,
.decode_slice = decode_slice, .decode_slice = decode_slice,
.end_frame = end_frame, .end_frame = end_frame,

@ -264,7 +264,7 @@ AVHWAccel ff_mpeg2_dxva2_hwaccel = {
.name = "mpeg2_dxva2", .name = "mpeg2_dxva2",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_MPEG2VIDEO, .id = AV_CODEC_ID_MPEG2VIDEO,
.pix_fmt = PIX_FMT_DXVA2_VLD, .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
.start_frame = start_frame, .start_frame = start_frame,
.decode_slice = decode_slice, .decode_slice = decode_slice,
.end_frame = end_frame, .end_frame = end_frame,

@ -269,7 +269,7 @@ AVHWAccel ff_wmv3_dxva2_hwaccel = {
.name = "wmv3_dxva2", .name = "wmv3_dxva2",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_WMV3, .id = AV_CODEC_ID_WMV3,
.pix_fmt = PIX_FMT_DXVA2_VLD, .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
.start_frame = start_frame, .start_frame = start_frame,
.decode_slice = decode_slice, .decode_slice = decode_slice,
.end_frame = end_frame, .end_frame = end_frame,
@ -281,7 +281,7 @@ AVHWAccel ff_vc1_dxva2_hwaccel = {
.name = "vc1_dxva2", .name = "vc1_dxva2",
.type = AVMEDIA_TYPE_VIDEO, .type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_VC1, .id = AV_CODEC_ID_VC1,
.pix_fmt = PIX_FMT_DXVA2_VLD, .pix_fmt = AV_PIX_FMT_DXVA2_VLD,
.start_frame = start_frame, .start_frame = start_frame,
.decode_slice = decode_slice, .decode_slice = decode_slice,
.end_frame = end_frame, .end_frame = end_frame,

@ -45,7 +45,7 @@ typedef struct CmvContext {
static av_cold int cmv_decode_init(AVCodecContext *avctx){ static av_cold int cmv_decode_init(AVCodecContext *avctx){
CmvContext *s = avctx->priv_data; CmvContext *s = avctx->priv_data;
s->avctx = avctx; s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0; return 0;
} }

@ -61,7 +61,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
{ {
MadContext *s = avctx->priv_data; MadContext *s = avctx->priv_data;
s->avctx = avctx; s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
ff_dsputil_init(&s->dsp, avctx); ff_dsputil_init(&s->dsp, avctx);
ff_init_scantable_permutation(s->dsp.idct_permutation, FF_NO_IDCT_PERM); 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(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);

@ -53,7 +53,7 @@ static av_cold int tgq_decode_init(AVCodecContext *avctx){
ff_init_scantable_permutation(idct_permutation, FF_NO_IDCT_PERM); ff_init_scantable_permutation(idct_permutation, FF_NO_IDCT_PERM);
ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct); ff_init_scantable(idct_permutation, &s->scantable, ff_zigzag_direct);
avctx->time_base = (AVRational){1, 15}; avctx->time_base = (AVRational){1, 15};
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
return 0; return 0;
} }

@ -54,7 +54,7 @@ static av_cold int tgv_decode_init(AVCodecContext *avctx){
TgvContext *s = avctx->priv_data; TgvContext *s = avctx->priv_data;
s->avctx = avctx; s->avctx = avctx;
avctx->time_base = (AVRational){1, 15}; avctx->time_base = (AVRational){1, 15};
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0; return 0;
} }

@ -52,7 +52,7 @@ static av_cold int tqi_decode_init(AVCodecContext *avctx)
ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct); ff_init_scantable(s->dsp.idct_permutation, &s->intra_scantable, ff_zigzag_direct);
s->qscale = 1; s->qscale = 1;
avctx->time_base = (AVRational){1, 15}; avctx->time_base = (AVRational){1, 15};
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
ff_mpeg12_init_vlcs(); ff_mpeg12_init_vlcs();
return 0; return 0;
} }

@ -61,7 +61,7 @@ static av_cold int escape124_decode_init(AVCodecContext *avctx)
{ {
Escape124Context *s = avctx->priv_data; 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) * s->num_superblocks = ((unsigned)avctx->width / 8) *
((unsigned)avctx->height / 8); ((unsigned)avctx->height / 8);

@ -901,9 +901,9 @@ static av_cold int encode_init(AVCodecContext *avctx)
avctx->coded_frame= &s->picture; avctx->coded_frame= &s->picture;
switch(avctx->pix_fmt){ switch(avctx->pix_fmt){
case PIX_FMT_YUV444P16: case AV_PIX_FMT_YUV444P16:
case PIX_FMT_YUV422P16: case AV_PIX_FMT_YUV422P16:
case PIX_FMT_YUV420P16: case AV_PIX_FMT_YUV420P16:
if(avctx->bits_per_raw_sample <=8){ if(avctx->bits_per_raw_sample <=8){
av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n"); av_log(avctx, AV_LOG_ERROR, "bits_per_raw_sample invalid\n");
return -1; return -1;
@ -913,14 +913,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
return -1; return -1;
} }
s->version= FFMAX(s->version, 1); s->version= FFMAX(s->version, 1);
case PIX_FMT_YUV444P: case AV_PIX_FMT_YUV444P:
case PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
case PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
case PIX_FMT_YUV411P: case AV_PIX_FMT_YUV411P:
case PIX_FMT_YUV410P: case AV_PIX_FMT_YUV410P:
s->colorspace= 0; s->colorspace= 0;
break; break;
case PIX_FMT_RGB32: case AV_PIX_FMT_RGB32:
s->colorspace= 1; s->colorspace= 1;
break; break;
default: default:
@ -1547,20 +1547,20 @@ static int read_header(FFV1Context *f){
if(f->colorspace==0){ if(f->colorspace==0){
if(f->avctx->bits_per_raw_sample<=8){ if(f->avctx->bits_per_raw_sample<=8){
switch(16*f->chroma_h_shift + f->chroma_v_shift){ switch(16*f->chroma_h_shift + f->chroma_v_shift){
case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P; break; case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUV444P; break;
case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P; break; case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUV422P; break;
case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P; break; case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUV420P; break;
case 0x20: f->avctx->pix_fmt= PIX_FMT_YUV411P; break; case 0x20: f->avctx->pix_fmt= AV_PIX_FMT_YUV411P; break;
case 0x22: f->avctx->pix_fmt= PIX_FMT_YUV410P; break; case 0x22: f->avctx->pix_fmt= AV_PIX_FMT_YUV410P; break;
default: default:
av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
return -1; return -1;
} }
}else{ }else{
switch(16*f->chroma_h_shift + f->chroma_v_shift){ switch(16*f->chroma_h_shift + f->chroma_v_shift){
case 0x00: f->avctx->pix_fmt= PIX_FMT_YUV444P16; break; case 0x00: f->avctx->pix_fmt= AV_PIX_FMT_YUV444P16; break;
case 0x10: f->avctx->pix_fmt= PIX_FMT_YUV422P16; break; case 0x10: f->avctx->pix_fmt= AV_PIX_FMT_YUV422P16; break;
case 0x11: f->avctx->pix_fmt= PIX_FMT_YUV420P16; break; case 0x11: f->avctx->pix_fmt= AV_PIX_FMT_YUV420P16; break;
default: default:
av_log(f->avctx, AV_LOG_ERROR, "format not supported\n"); av_log(f->avctx, AV_LOG_ERROR, "format not supported\n");
return -1; return -1;
@ -1571,7 +1571,7 @@ static int read_header(FFV1Context *f){
av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\n"); av_log(f->avctx, AV_LOG_ERROR, "chroma subsampling not supported in this colorspace\n");
return -1; return -1;
} }
f->avctx->pix_fmt= PIX_FMT_RGB32; f->avctx->pix_fmt= AV_PIX_FMT_RGB32;
}else{ }else{
av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n"); av_log(f->avctx, AV_LOG_ERROR, "colorspace not supported\n");
return -1; return -1;
@ -1759,10 +1759,10 @@ AVCodec ff_ffv1_encoder = {
.encode2 = encode_frame, .encode2 = encode_frame,
.close = common_end, .close = common_end,
.capabilities = CODEC_CAP_SLICE_THREADS, .capabilities = CODEC_CAP_SLICE_THREADS,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_YUV420P, PIX_FMT_YUV444P, PIX_FMT_YUV422P, PIX_FMT_YUV411P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P,
PIX_FMT_YUV410P, PIX_FMT_RGB32, PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, AV_PIX_FMT_YUV410P, AV_PIX_FMT_RGB32, AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16,
PIX_FMT_YUV444P16, PIX_FMT_NONE AV_PIX_FMT_YUV444P16, AV_PIX_FMT_NONE
}, },
.long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"), .long_name = NULL_IF_CONFIG_SMALL("FFmpeg video codec #1"),
}; };

@ -114,7 +114,7 @@ static av_cold int flashsv_decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret); av_log(avctx, AV_LOG_ERROR, "Inflate init error: %d\n", zret);
return 1; return 1;
} }
avctx->pix_fmt = PIX_FMT_BGR24; avctx->pix_fmt = AV_PIX_FMT_BGR24;
s->frame.data[0] = NULL; s->frame.data[0] = NULL;
return 0; return 0;
@ -461,7 +461,7 @@ AVCodec ff_flashsv_decoder = {
.close = flashsv_decode_end, .close = flashsv_decode_end,
.decode = flashsv_decode_frame, .decode = flashsv_decode_frame,
.capabilities = CODEC_CAP_DR1, .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"), .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v1"),
}; };
#endif /* CONFIG_FLASHSV_DECODER */ #endif /* CONFIG_FLASHSV_DECODER */
@ -524,7 +524,7 @@ AVCodec ff_flashsv2_decoder = {
.close = flashsv2_decode_end, .close = flashsv2_decode_end,
.decode = flashsv_decode_frame, .decode = flashsv_decode_frame,
.capabilities = CODEC_CAP_DR1, .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"), .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video v2"),
}; };
#endif /* CONFIG_FLASHSV2_DECODER */ #endif /* CONFIG_FLASHSV2_DECODER */

@ -287,6 +287,6 @@ AVCodec ff_flashsv_encoder = {
.init = flashsv_encode_init, .init = flashsv_encode_init,
.encode2 = flashsv_encode_frame, .encode2 = flashsv_encode_frame,
.close = flashsv_encode_end, .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"), .long_name = NULL_IF_CONFIG_SMALL("Flash Screen Video"),
}; };

@ -111,10 +111,10 @@ static av_cold int flic_decode_init(AVCodecContext *avctx)
} }
switch (depth) { switch (depth) {
case 8 : avctx->pix_fmt = PIX_FMT_PAL8; break; case 8 : avctx->pix_fmt = AV_PIX_FMT_PAL8; break;
case 15 : avctx->pix_fmt = PIX_FMT_RGB555; break; case 15 : avctx->pix_fmt = AV_PIX_FMT_RGB555; break;
case 16 : avctx->pix_fmt = PIX_FMT_RGB565; break; case 16 : avctx->pix_fmt = AV_PIX_FMT_RGB565; break;
case 24 : avctx->pix_fmt = PIX_FMT_BGR24; /* Supposedly BGR, but havent any files to test with */ 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"); av_log(avctx, AV_LOG_ERROR, "24Bpp FLC/FLX is unsupported due to no test files.\n");
return -1; return -1;
default : default :
@ -701,16 +701,16 @@ static int flic_decode_frame(AVCodecContext *avctx,
{ {
const uint8_t *buf = avpkt->data; const uint8_t *buf = avpkt->data;
int buf_size = avpkt->size; 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, return flic_decode_frame_8BPP(avctx, data, data_size,
buf, buf_size); buf, buf_size);
} }
else if ((avctx->pix_fmt == PIX_FMT_RGB555) || else if ((avctx->pix_fmt == AV_PIX_FMT_RGB555) ||
(avctx->pix_fmt == PIX_FMT_RGB565)) { (avctx->pix_fmt == AV_PIX_FMT_RGB565)) {
return flic_decode_frame_15_16BPP(avctx, data, data_size, return flic_decode_frame_15_16BPP(avctx, data, data_size,
buf, buf_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, return flic_decode_frame_24BPP(avctx, data, data_size,
buf, buf_size); buf, buf_size);
} }

@ -94,7 +94,7 @@ AVCodec ff_flv_encoder = {
.init = ff_MPV_encode_init, .init = ff_MPV_encode_init,
.encode2 = ff_MPV_encode_picture, .encode2 = ff_MPV_encode_picture,
.close = ff_MPV_encode_end, .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)"), .long_name = NULL_IF_CONFIG_SMALL("FLV / Sorenson Spark / Sorenson H.263 (Flash Video)"),
.priv_class = &flv_class, .priv_class = &flv_class,
}; };

@ -61,7 +61,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
FrapsContext * const s = avctx->priv_data; FrapsContext * const s = avctx->priv_data;
avctx->coded_frame = &s->frame; 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->avctx = avctx;
s->tmpbuf = NULL; s->tmpbuf = NULL;
@ -139,7 +139,7 @@ static int decode_frame(AVCodecContext *avctx,
uint32_t *luma1,*luma2,*cb,*cr; uint32_t *luma1,*luma2,*cb,*cr;
uint32_t offs[4]; uint32_t offs[4];
int i, j, is_chroma, planes; int i, j, is_chroma, planes;
enum PixelFormat pix_fmt; enum AVPixelFormat pix_fmt;
header = AV_RL32(buf); header = AV_RL32(buf);
version = header & 0xff; version = header & 0xff;
@ -156,7 +156,7 @@ static int decode_frame(AVCodecContext *avctx,
if (header_size == 8) if (header_size == 8)
buf+=4; 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]) { if (avctx->pix_fmt != pix_fmt && f->data[0]) {
avctx->release_buffer(avctx, f); avctx->release_buffer(avctx, f);
} }

@ -29,7 +29,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
av_log(avctx, AV_LOG_ERROR, "frwu needs even width\n"); av_log(avctx, AV_LOG_ERROR, "frwu needs even width\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
avctx->pix_fmt = PIX_FMT_UYVY422; avctx->pix_fmt = AV_PIX_FMT_UYVY422;
avctx->coded_frame = avcodec_alloc_frame(); avctx->coded_frame = avcodec_alloc_frame();
if (!avctx->coded_frame) if (!avctx->coded_frame)

@ -187,9 +187,9 @@ AVCodec ff_gif_encoder = {
.init = gif_encode_init, .init = gif_encode_init,
.encode2 = gif_encode_frame, .encode2 = gif_encode_frame,
.close = gif_encode_close, .close = gif_encode_close,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_RGB8, PIX_FMT_BGR8, PIX_FMT_RGB4_BYTE, PIX_FMT_BGR4_BYTE, AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE,
PIX_FMT_GRAY8, PIX_FMT_PAL8, PIX_FMT_NONE AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE
}, },
.long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"), .long_name = NULL_IF_CONFIG_SMALL("GIF (Graphics Interchange Format)"),
}; };

@ -294,7 +294,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *data_size, A
if (gif_read_header1(s) < 0) if (gif_read_header1(s) < 0)
return -1; 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)) if (av_image_check_size(s->screen_width, s->screen_height, 0, avctx))
return -1; return -1;
avcodec_set_dimensions(avctx, s->screen_width, s->screen_height); avcodec_set_dimensions(avctx, s->screen_width, s->screen_height);

@ -85,7 +85,7 @@ static av_cold int h261_decode_init(AVCodecContext *avctx){
s->out_format = FMT_H261; s->out_format = FMT_H261;
s->low_delay= 1; s->low_delay= 1;
avctx->pix_fmt= PIX_FMT_YUV420P; avctx->pix_fmt= AV_PIX_FMT_YUV420P;
s->codec_id= avctx->codec->id; s->codec_id= avctx->codec->id;

@ -331,7 +331,7 @@ AVCodec ff_h261_encoder = {
.init = ff_MPV_encode_init, .init = ff_MPV_encode_init,
.encode2 = ff_MPV_encode_picture, .encode2 = ff_MPV_encode_picture,
.close = ff_MPV_encode_end, .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"), .long_name = NULL_IF_CONFIG_SMALL("H.261"),
.priv_class = &h261_class, .priv_class = &h261_class,
}; };

@ -59,7 +59,7 @@ av_cold int ff_h263_decode_init(AVCodecContext *avctx)
s->decode_mb= ff_h263_decode_mb; s->decode_mb= ff_h263_decode_mb;
s->low_delay= 1; s->low_delay= 1;
if (avctx->codec->id == AV_CODEC_ID_MSS2) if (avctx->codec->id == AV_CODEC_ID_MSS2)
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
else else
avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts); avctx->pix_fmt = avctx->get_format(avctx, avctx->codec->pix_fmts);
s->unrestricted_mv= 1; s->unrestricted_mv= 1;

@ -59,12 +59,12 @@ static const uint8_t div6[QP_MAX_NUM + 1] = {
7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 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[] = { static const enum AVPixelFormat hwaccel_pixfmt_list_h264_jpeg_420[] = {
PIX_FMT_DXVA2_VLD, AV_PIX_FMT_DXVA2_VLD,
PIX_FMT_VAAPI_VLD, AV_PIX_FMT_VAAPI_VLD,
PIX_FMT_VDA_VLD, AV_PIX_FMT_VDA_VLD,
PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ420P,
PIX_FMT_NONE AV_PIX_FMT_NONE
}; };
/** /**
@ -2502,35 +2502,35 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
case 9: case 9:
if (CHROMA444) { if (CHROMA444) {
if (s->avctx->colorspace == AVCOL_SPC_RGB) { if (s->avctx->colorspace == AVCOL_SPC_RGB) {
s->avctx->pix_fmt = PIX_FMT_GBRP9; s->avctx->pix_fmt = AV_PIX_FMT_GBRP9;
} else } else
s->avctx->pix_fmt = PIX_FMT_YUV444P9; s->avctx->pix_fmt = AV_PIX_FMT_YUV444P9;
} else if (CHROMA422) } else if (CHROMA422)
s->avctx->pix_fmt = PIX_FMT_YUV422P9; s->avctx->pix_fmt = AV_PIX_FMT_YUV422P9;
else else
s->avctx->pix_fmt = PIX_FMT_YUV420P9; s->avctx->pix_fmt = AV_PIX_FMT_YUV420P9;
break; break;
case 10: case 10:
if (CHROMA444) { if (CHROMA444) {
if (s->avctx->colorspace == AVCOL_SPC_RGB) { if (s->avctx->colorspace == AVCOL_SPC_RGB) {
s->avctx->pix_fmt = PIX_FMT_GBRP10; s->avctx->pix_fmt = AV_PIX_FMT_GBRP10;
} else } else
s->avctx->pix_fmt = PIX_FMT_YUV444P10; s->avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
} else if (CHROMA422) } else if (CHROMA422)
s->avctx->pix_fmt = PIX_FMT_YUV422P10; s->avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
else else
s->avctx->pix_fmt = PIX_FMT_YUV420P10; s->avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
break; break;
case 8: case 8:
if (CHROMA444) { if (CHROMA444) {
if (s->avctx->colorspace == AVCOL_SPC_RGB) { if (s->avctx->colorspace == AVCOL_SPC_RGB) {
s->avctx->pix_fmt = PIX_FMT_GBRP; s->avctx->pix_fmt = AV_PIX_FMT_GBRP;
} else } else
s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ444P s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ444P
: PIX_FMT_YUV444P; : AV_PIX_FMT_YUV444P;
} else if (CHROMA422) { } else if (CHROMA422) {
s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? PIX_FMT_YUVJ422P s->avctx->pix_fmt = s->avctx->color_range == AVCOL_RANGE_JPEG ? AV_PIX_FMT_YUVJ422P
: PIX_FMT_YUV422P; : AV_PIX_FMT_YUV422P;
} else { } else {
s->avctx->pix_fmt = s->avctx->get_format(s->avctx, s->avctx->pix_fmt = s->avctx->get_format(s->avctx,
s->avctx->codec->pix_fmts ? s->avctx->codec->pix_fmts ?
@ -4125,8 +4125,8 @@ AVCodec ff_h264_vdpau_decoder = {
.capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU, .capabilities = CODEC_CAP_DR1 | CODEC_CAP_DELAY | CODEC_CAP_HWACCEL_VDPAU,
.flush = flush_dpb, .flush = flush_dpb,
.long_name = NULL_IF_CONFIG_SMALL("H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)"), .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_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_VDPAU_H264,
PIX_FMT_NONE}, AV_PIX_FMT_NONE},
.profiles = NULL_IF_CONFIG_SMALL(profiles), .profiles = NULL_IF_CONFIG_SMALL(profiles),
}; };
#endif #endif

@ -456,21 +456,21 @@ static av_cold int decode_init(AVCodecContext *avctx)
switch (s->bitstream_bpp) { switch (s->bitstream_bpp) {
case 12: case 12:
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
break; break;
case 16: case 16:
if (s->yuy2) { if (s->yuy2) {
avctx->pix_fmt = PIX_FMT_YUYV422; avctx->pix_fmt = AV_PIX_FMT_YUYV422;
} else { } else {
avctx->pix_fmt = PIX_FMT_YUV422P; avctx->pix_fmt = AV_PIX_FMT_YUV422P;
} }
break; break;
case 24: case 24:
case 32: case 32:
if (s->bgr32) { if (s->bgr32) {
avctx->pix_fmt = PIX_FMT_RGB32; avctx->pix_fmt = AV_PIX_FMT_RGB32;
} else { } else {
avctx->pix_fmt = PIX_FMT_BGR24; avctx->pix_fmt = AV_PIX_FMT_BGR24;
} }
break; break;
default: default:
@ -545,13 +545,13 @@ static av_cold int encode_init(AVCodecContext *avctx)
avctx->coded_frame = &s->picture; avctx->coded_frame = &s->picture;
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
case PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
s->bitstream_bpp = 12; s->bitstream_bpp = 12;
break; break;
case PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
s->bitstream_bpp = 16; s->bitstream_bpp = 16;
break; break;
case PIX_FMT_RGB32: case AV_PIX_FMT_RGB32:
s->bitstream_bpp = 24; s->bitstream_bpp = 24;
break; break;
default: default:
@ -573,7 +573,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
}else s->context= 0; }else s->context= 0;
if (avctx->codec->id == AV_CODEC_ID_HUFFYUV) { 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, av_log(avctx, AV_LOG_ERROR,
"Error: YV12 is not supported by huffyuv; use " "Error: YV12 is not supported by huffyuv; use "
"vcodec=ffvhuff or format=422p\n"); "vcodec=ffvhuff or format=422p\n");
@ -1256,8 +1256,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
init_put_bits(&s->pb, pkt->data + size, pkt->size - size); init_put_bits(&s->pb, pkt->data + size, pkt->size - size);
if (avctx->pix_fmt == PIX_FMT_YUV422P || if (avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
avctx->pix_fmt == PIX_FMT_YUV420P) { avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
int lefty, leftu, leftv, y, cy; int lefty, leftu, leftv, y, cy;
put_bits(&s->pb, 8, leftv = p->data[2][0]); put_bits(&s->pb, 8, leftv = p->data[2][0]);
@ -1361,7 +1361,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
encode_422_bitstream(s, 0, width); 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]; uint8_t *data = p->data[0] + (height - 1) * p->linesize[0];
const int stride = -p->linesize[0]; const int stride = -p->linesize[0];
const int fake_stride = -fake_ystride; const int fake_stride = -fake_ystride;
@ -1479,8 +1479,8 @@ AVCodec ff_huffyuv_encoder = {
.init = encode_init, .init = encode_init,
.encode2 = encode_frame, .encode2 = encode_frame,
.close = encode_end, .close = encode_end,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_YUV422P, PIX_FMT_RGB32, PIX_FMT_NONE AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE
}, },
.long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"), .long_name = NULL_IF_CONFIG_SMALL("Huffyuv / HuffYUV"),
}; };
@ -1495,8 +1495,8 @@ AVCodec ff_ffvhuff_encoder = {
.init = encode_init, .init = encode_init,
.encode2 = encode_frame, .encode2 = encode_frame,
.close = encode_end, .close = encode_end,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_RGB32, PIX_FMT_NONE 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"), .long_name = NULL_IF_CONFIG_SMALL("Huffyuv FFmpeg variant"),
}; };

@ -151,7 +151,7 @@ static av_cold int idcin_decode_init(AVCodecContext *avctx)
unsigned char *histograms; unsigned char *histograms;
s->avctx = avctx; s->avctx = avctx;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
/* make sure the Huffman tables make it */ /* make sure the Huffman tables make it */
if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) { if (s->avctx->extradata_size != HUFFMAN_TABLE_SIZE) {

@ -152,10 +152,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (avctx->bits_per_coded_sample <= 8) { if (avctx->bits_per_coded_sample <= 8) {
avctx->pix_fmt = (avctx->bits_per_coded_sample < 8 || avctx->pix_fmt = (avctx->bits_per_coded_sample < 8 ||
avctx->extradata_size) ? PIX_FMT_PAL8 avctx->extradata_size) ? AV_PIX_FMT_PAL8
: PIX_FMT_GRAY8; : AV_PIX_FMT_GRAY8;
} else if (avctx->bits_per_coded_sample <= 32) { } else if (avctx->bits_per_coded_sample <= 32) {
avctx->pix_fmt = PIX_FMT_BGR32; avctx->pix_fmt = AV_PIX_FMT_BGR32;
} else { } else {
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -263,14 +263,14 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
} else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) { } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res; 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) if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)
return res; return res;
} }
s->init = 1; s->init = 1;
if (avctx->codec_tag == MKTAG('I','L','B','M')) { // interleaved 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++ ) { for(y = 0; y < avctx->height; y++ ) {
uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
memset(row, 0, avctx->width); memset(row, 0, avctx->width);
@ -279,7 +279,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
buf += s->planesize; buf += s->planesize;
} }
} }
} else { // PIX_FMT_BGR32 } else { // AV_PIX_FMT_BGR32
for(y = 0; y < avctx->height; y++ ) { for(y = 0; y < avctx->height; y++ ) {
uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]];
memset(row, 0, avctx->width << 2); memset(row, 0, avctx->width << 2);
@ -289,7 +289,7 @@ static int decode_frame_ilbm(AVCodecContext *avctx,
} }
} }
} }
} 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++ ) { for(y = 0; y < avctx->height; y++ ) {
uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]]; uint8_t *row = &s->frame.data[0][y * s->frame.linesize[0]];
memcpy(row, buf, FFMIN(avctx->width, buf_end - buf)); memcpy(row, buf, FFMIN(avctx->width, buf_end - buf));
@ -320,14 +320,14 @@ static int decode_frame_byterun1(AVCodecContext *avctx,
} else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) { } else if ((res = avctx->get_buffer(avctx, &s->frame)) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
return res; 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) if ((res = ff_cmap_read_palette(avctx, (uint32_t*)s->frame.data[1])) < 0)
return res; return res;
} }
s->init = 1; s->init = 1;
if (avctx->codec_tag == MKTAG('I','L','B','M')) { //interleaved 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++ ) { for(y = 0; y < avctx->height ; y++ ) {
uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ]; uint8_t *row = &s->frame.data[0][ y*s->frame.linesize[0] ];
memset(row, 0, avctx->width); memset(row, 0, avctx->width);
@ -336,7 +336,7 @@ static int decode_frame_byterun1(AVCodecContext *avctx,
decodeplane8(row, s->planebuf, s->planesize, plane); decodeplane8(row, s->planebuf, s->planesize, plane);
} }
} }
} else { //PIX_FMT_BGR32 } else { //AV_PIX_FMT_BGR32
for(y = 0; y < avctx->height ; y++ ) { for(y = 0; y < avctx->height ; y++ ) {
uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]]; uint8_t *row = &s->frame.data[0][y*s->frame.linesize[0]];
memset(row, 0, avctx->width << 2); memset(row, 0, avctx->width << 2);

@ -68,87 +68,87 @@ typedef struct PixFmtInfo {
} PixFmtInfo; } PixFmtInfo;
/* this table gives more information about formats */ /* 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 */ /* YUV formats */
[PIX_FMT_YUV420P] = { [AV_PIX_FMT_YUV420P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUV422P] = { [AV_PIX_FMT_YUV422P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUV444P] = { [AV_PIX_FMT_YUV444P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUYV422] = { [AV_PIX_FMT_YUYV422] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_UYVY422] = { [AV_PIX_FMT_UYVY422] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUV410P] = { [AV_PIX_FMT_YUV410P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUV411P] = { [AV_PIX_FMT_YUV411P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUV440P] = { [AV_PIX_FMT_YUV440P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUV420P16LE] = { [AV_PIX_FMT_YUV420P16LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_YUV422P16LE] = { [AV_PIX_FMT_YUV422P16LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_YUV444P16LE] = { [AV_PIX_FMT_YUV444P16LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_YUV420P16BE] = { [AV_PIX_FMT_YUV420P16BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_YUV422P16BE] = { [AV_PIX_FMT_YUV422P16BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_YUV444P16BE] = { [AV_PIX_FMT_YUV444P16BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
@ -157,7 +157,7 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
/* YUV formats with alpha plane */ /* YUV formats with alpha plane */
[PIX_FMT_YUVA420P] = { [AV_PIX_FMT_YUVA420P] = {
.nb_channels = 4, .nb_channels = 4,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
@ -165,25 +165,25 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
}, },
/* JPEG YUV */ /* JPEG YUV */
[PIX_FMT_YUVJ420P] = { [AV_PIX_FMT_YUVJ420P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG, .color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUVJ422P] = { [AV_PIX_FMT_YUVJ422P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG, .color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUVJ444P] = { [AV_PIX_FMT_YUVJ444P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG, .color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_YUVJ440P] = { [AV_PIX_FMT_YUVJ440P] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_YUV_JPEG, .color_type = FF_COLOR_YUV_JPEG,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
@ -191,67 +191,67 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
}, },
/* RGB formats */ /* RGB formats */
[PIX_FMT_RGB24] = { [AV_PIX_FMT_RGB24] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_BGR24] = { [AV_PIX_FMT_BGR24] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_ARGB] = { [AV_PIX_FMT_ARGB] = {
.nb_channels = 4, .is_alpha = 1, .nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_RGB48BE] = { [AV_PIX_FMT_RGB48BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_RGB48LE] = { [AV_PIX_FMT_RGB48LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_RGB565BE] = { [AV_PIX_FMT_RGB565BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 5, .depth = 5,
}, },
[PIX_FMT_RGB565LE] = { [AV_PIX_FMT_RGB565LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 5, .depth = 5,
}, },
[PIX_FMT_RGB555BE] = { [AV_PIX_FMT_RGB555BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 5, .depth = 5,
}, },
[PIX_FMT_RGB555LE] = { [AV_PIX_FMT_RGB555LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 5, .depth = 5,
}, },
[PIX_FMT_RGB444BE] = { [AV_PIX_FMT_RGB444BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 4, .depth = 4,
}, },
[PIX_FMT_RGB444LE] = { [AV_PIX_FMT_RGB444LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
@ -259,31 +259,31 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
}, },
/* gray / mono formats */ /* gray / mono formats */
[PIX_FMT_GRAY16BE] = { [AV_PIX_FMT_GRAY16BE] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_GRAY, .color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_GRAY16LE] = { [AV_PIX_FMT_GRAY16LE] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_GRAY, .color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 16, .depth = 16,
}, },
[PIX_FMT_GRAY8] = { [AV_PIX_FMT_GRAY8] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_GRAY, .color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_MONOWHITE] = { [AV_PIX_FMT_MONOWHITE] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_GRAY, .color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 1, .depth = 1,
}, },
[PIX_FMT_MONOBLACK] = { [AV_PIX_FMT_MONOBLACK] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_GRAY, .color_type = FF_COLOR_GRAY,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
@ -291,116 +291,116 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
}, },
/* paletted formats */ /* paletted formats */
[PIX_FMT_PAL8] = { [AV_PIX_FMT_PAL8] = {
.nb_channels = 4, .is_alpha = 1, .nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PALETTE, .pixel_type = FF_PIXEL_PALETTE,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_UYYVYY411] = { [AV_PIX_FMT_UYYVYY411] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_ABGR] = { [AV_PIX_FMT_ABGR] = {
.nb_channels = 4, .is_alpha = 1, .nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_BGR565BE] = { [AV_PIX_FMT_BGR565BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 5, .depth = 5,
}, },
[PIX_FMT_BGR565LE] = { [AV_PIX_FMT_BGR565LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 5, .depth = 5,
}, },
[PIX_FMT_BGR555BE] = { [AV_PIX_FMT_BGR555BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 5, .depth = 5,
}, },
[PIX_FMT_BGR555LE] = { [AV_PIX_FMT_BGR555LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 5, .depth = 5,
}, },
[PIX_FMT_BGR444BE] = { [AV_PIX_FMT_BGR444BE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 4, .depth = 4,
}, },
[PIX_FMT_BGR444LE] = { [AV_PIX_FMT_BGR444LE] = {
.nb_channels = 3, .nb_channels = 3,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 4, .depth = 4,
}, },
[PIX_FMT_RGB8] = { [AV_PIX_FMT_RGB8] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_RGB4] = { [AV_PIX_FMT_RGB4] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 4, .depth = 4,
}, },
[PIX_FMT_RGB4_BYTE] = { [AV_PIX_FMT_RGB4_BYTE] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_BGR8] = { [AV_PIX_FMT_BGR8] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_BGR4] = { [AV_PIX_FMT_BGR4] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 4, .depth = 4,
}, },
[PIX_FMT_BGR4_BYTE] = { [AV_PIX_FMT_BGR4_BYTE] = {
.nb_channels = 1, .nb_channels = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_NV12] = { [AV_PIX_FMT_NV12] = {
.nb_channels = 2, .nb_channels = 2,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_NV21] = { [AV_PIX_FMT_NV21] = {
.nb_channels = 2, .nb_channels = 2,
.color_type = FF_COLOR_YUV, .color_type = FF_COLOR_YUV,
.pixel_type = FF_PIXEL_PLANAR, .pixel_type = FF_PIXEL_PLANAR,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_BGRA] = { [AV_PIX_FMT_BGRA] = {
.nb_channels = 4, .is_alpha = 1, .nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
.depth = 8, .depth = 8,
}, },
[PIX_FMT_RGBA] = { [AV_PIX_FMT_RGBA] = {
.nb_channels = 4, .is_alpha = 1, .nb_channels = 4, .is_alpha = 1,
.color_type = FF_COLOR_RGB, .color_type = FF_COLOR_RGB,
.pixel_type = FF_PIXEL_PACKED, .pixel_type = FF_PIXEL_PACKED,
@ -408,19 +408,19 @@ static const PixFmtInfo pix_fmt_info[PIX_FMT_NB] = {
}, },
}; };
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; *h_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_w;
*v_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h; *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; return av_pix_fmt_descriptors[pix_fmt].flags & PIX_FMT_HWACCEL;
} }
int avpicture_fill(AVPicture *picture, uint8_t *ptr, 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; int ret;
@ -433,7 +433,7 @@ int avpicture_fill(AVPicture *picture, uint8_t *ptr,
return av_image_fill_pointers(picture->data, pix_fmt, height, ptr, picture->linesize); 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) unsigned char *dest, int dest_size)
{ {
int i, j, nb_planes = 0, linesizes[4]; int i, j, nb_planes = 0, linesizes[4];
@ -466,7 +466,7 @@ int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width,
return size; 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; AVPicture dummy_pict;
if(av_image_check_size(width, height, 0, NULL)) if(av_image_check_size(width, height, 0, NULL))
@ -477,7 +477,7 @@ int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height)
return avpicture_fill(&dummy_pict, NULL, pix_fmt, width, height); 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) int has_alpha)
{ {
const PixFmtInfo *pf, *ps; const PixFmtInfo *pf, *ps;
@ -491,10 +491,10 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
loss = 0; loss = 0;
pf = &pix_fmt_info[dst_pix_fmt]; pf = &pix_fmt_info[dst_pix_fmt];
if (pf->depth < ps->depth || if (pf->depth < ps->depth ||
((dst_pix_fmt == PIX_FMT_RGB555BE || dst_pix_fmt == PIX_FMT_RGB555LE || ((dst_pix_fmt == AV_PIX_FMT_RGB555BE || dst_pix_fmt == AV_PIX_FMT_RGB555LE ||
dst_pix_fmt == PIX_FMT_BGR555BE || dst_pix_fmt == PIX_FMT_BGR555LE) && dst_pix_fmt == AV_PIX_FMT_BGR555BE || dst_pix_fmt == AV_PIX_FMT_BGR555LE) &&
(src_pix_fmt == PIX_FMT_RGB565BE || src_pix_fmt == PIX_FMT_RGB565LE || (src_pix_fmt == AV_PIX_FMT_RGB565BE || src_pix_fmt == AV_PIX_FMT_RGB565LE ||
src_pix_fmt == PIX_FMT_BGR565BE || src_pix_fmt == PIX_FMT_BGR565LE))) src_pix_fmt == AV_PIX_FMT_BGR565BE || src_pix_fmt == AV_PIX_FMT_BGR565LE)))
loss |= FF_LOSS_DEPTH; loss |= FF_LOSS_DEPTH;
if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w || if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
dst_desc->log2_chroma_h > src_desc->log2_chroma_h) dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
@ -536,7 +536,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
return loss; return loss;
} }
static int avg_bits_per_pixel(enum PixelFormat pix_fmt) static int avg_bits_per_pixel(enum AVPixelFormat pix_fmt)
{ {
int bits; int bits;
const PixFmtInfo *pf; const PixFmtInfo *pf;
@ -546,23 +546,23 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
switch(pf->pixel_type) { switch(pf->pixel_type) {
case FF_PIXEL_PACKED: case FF_PIXEL_PACKED:
switch(pix_fmt) { switch(pix_fmt) {
case PIX_FMT_YUYV422: case AV_PIX_FMT_YUYV422:
case PIX_FMT_UYVY422: case AV_PIX_FMT_UYVY422:
case PIX_FMT_RGB565BE: case AV_PIX_FMT_RGB565BE:
case PIX_FMT_RGB565LE: case AV_PIX_FMT_RGB565LE:
case PIX_FMT_RGB555BE: case AV_PIX_FMT_RGB555BE:
case PIX_FMT_RGB555LE: case AV_PIX_FMT_RGB555LE:
case PIX_FMT_RGB444BE: case AV_PIX_FMT_RGB444BE:
case PIX_FMT_RGB444LE: case AV_PIX_FMT_RGB444LE:
case PIX_FMT_BGR565BE: case AV_PIX_FMT_BGR565BE:
case PIX_FMT_BGR565LE: case AV_PIX_FMT_BGR565LE:
case PIX_FMT_BGR555BE: case AV_PIX_FMT_BGR555BE:
case PIX_FMT_BGR555LE: case AV_PIX_FMT_BGR555LE:
case PIX_FMT_BGR444BE: case AV_PIX_FMT_BGR444BE:
case PIX_FMT_BGR444LE: case AV_PIX_FMT_BGR444LE:
bits = 16; bits = 16;
break; break;
case PIX_FMT_UYYVYY411: case AV_PIX_FMT_UYYVYY411:
bits = 12; bits = 12;
break; break;
default: default:
@ -588,25 +588,25 @@ static int avg_bits_per_pixel(enum PixelFormat pix_fmt)
return bits; return bits;
} }
static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_list, static enum AVPixelFormat avcodec_find_best_pix_fmt1(enum AVPixelFormat *pix_fmt_list,
enum PixelFormat src_pix_fmt, enum AVPixelFormat src_pix_fmt,
int has_alpha, int has_alpha,
int loss_mask) int loss_mask)
{ {
int dist, i, loss, min_dist; int dist, i, loss, min_dist;
enum PixelFormat dst_pix_fmt; enum AVPixelFormat dst_pix_fmt;
/* find exact color match with smallest size */ /* find exact color match with smallest size */
dst_pix_fmt = PIX_FMT_NONE; dst_pix_fmt = AV_PIX_FMT_NONE;
min_dist = 0x7fffffff; min_dist = 0x7fffffff;
i = 0; i = 0;
while (pix_fmt_list[i] != PIX_FMT_NONE) { while (pix_fmt_list[i] != AV_PIX_FMT_NONE) {
enum PixelFormat pix_fmt = pix_fmt_list[i]; 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, " av_log(NULL, AV_LOG_ERROR, "Pixel format list longer than expected, "
"it is either not properly terminated or contains duplicates\n"); "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; loss = avcodec_get_pix_fmt_loss(pix_fmt, src_pix_fmt, has_alpha) & loss_mask;
@ -623,10 +623,10 @@ static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_lis
} }
#if FF_API_FIND_BEST_PIX_FMT #if FF_API_FIND_BEST_PIX_FMT
enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, enum AVPixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum AVPixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr) int has_alpha, int *loss_ptr)
{ {
enum PixelFormat list[64]; enum AVPixelFormat list[64];
int i, j = 0; int i, j = 0;
// test only the first 64 pixel formats to avoid undefined behaviour // test only the first 64 pixel formats to avoid undefined behaviour
@ -634,17 +634,17 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
if (pix_fmt_mask & (1ULL << i)) if (pix_fmt_mask & (1ULL << i))
list[j++] = 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); return avcodec_find_best_pix_fmt2(list, src_pix_fmt, has_alpha, loss_ptr);
} }
#endif /* FF_API_FIND_BEST_PIX_FMT */ #endif /* FF_API_FIND_BEST_PIX_FMT */
enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list, enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
enum PixelFormat src_pix_fmt, enum AVPixelFormat src_pix_fmt,
int has_alpha, int *loss_ptr) int has_alpha, int *loss_ptr)
{ {
enum PixelFormat dst_pix_fmt; enum AVPixelFormat dst_pix_fmt;
int loss_mask, i; int loss_mask, i;
static const int loss_mask_order[] = { static const int loss_mask_order[] = {
~0, /* no loss first */ ~0, /* no loss first */
@ -667,7 +667,7 @@ enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,
if (loss_mask == 0) if (loss_mask == 0)
break; break;
} }
return PIX_FMT_NONE; return AV_PIX_FMT_NONE;
found: found:
if (loss_ptr) if (loss_ptr)
*loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha); *loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);
@ -675,7 +675,7 @@ enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,
} }
void av_picture_copy(AVPicture *dst, const AVPicture *src, 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, av_image_copy(dst->data, dst->linesize, src->data,
src->linesize, pix_fmt, width, height); src->linesize, pix_fmt, width, height);
@ -769,7 +769,7 @@ void ff_shrink88(uint8_t *dst, int dst_wrap,
int avpicture_alloc(AVPicture *picture, int avpicture_alloc(AVPicture *picture,
enum PixelFormat pix_fmt, int width, int height) enum AVPixelFormat pix_fmt, int width, int height)
{ {
int ret; int ret;
@ -795,12 +795,12 @@ static inline int is_yuv_planar(const PixFmtInfo *ps)
} }
int av_picture_crop(AVPicture *dst, const AVPicture *src, 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 y_shift;
int x_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; return -1;
y_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h; y_shift = av_pix_fmt_descriptors[pix_fmt].log2_chroma_h;
@ -817,7 +817,7 @@ int av_picture_crop(AVPicture *dst, const AVPicture *src,
} }
int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, 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) int *color)
{ {
uint8_t *optr; uint8_t *optr;
@ -826,7 +826,7 @@ int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width,
int yheight; int yheight;
int i, y; 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; !is_yuv_planar(&pix_fmt_info[pix_fmt])) return -1;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
@ -985,17 +985,17 @@ static void deinterlace_bottom_field_inplace(uint8_t *src1, int src_wrap,
} }
int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, 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; int i;
if (pix_fmt != PIX_FMT_YUV420P && if (pix_fmt != AV_PIX_FMT_YUV420P &&
pix_fmt != PIX_FMT_YUVJ420P && pix_fmt != AV_PIX_FMT_YUVJ420P &&
pix_fmt != PIX_FMT_YUV422P && pix_fmt != AV_PIX_FMT_YUV422P &&
pix_fmt != PIX_FMT_YUVJ422P && pix_fmt != AV_PIX_FMT_YUVJ422P &&
pix_fmt != PIX_FMT_YUV444P && pix_fmt != AV_PIX_FMT_YUV444P &&
pix_fmt != PIX_FMT_YUV411P && pix_fmt != AV_PIX_FMT_YUV411P &&
pix_fmt != PIX_FMT_GRAY8) pix_fmt != AV_PIX_FMT_GRAY8)
return -1; return -1;
if ((width & 3) != 0 || (height & 3) != 0) if ((width & 3) != 0 || (height & 3) != 0)
return -1; return -1;
@ -1003,22 +1003,22 @@ int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
for(i=0;i<3;i++) { for(i=0;i<3;i++) {
if (i == 1) { if (i == 1) {
switch(pix_fmt) { switch(pix_fmt) {
case PIX_FMT_YUVJ420P: case AV_PIX_FMT_YUVJ420P:
case PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
width >>= 1; width >>= 1;
height >>= 1; height >>= 1;
break; break;
case PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
case PIX_FMT_YUVJ422P: case AV_PIX_FMT_YUVJ422P:
width >>= 1; width >>= 1;
break; break;
case PIX_FMT_YUV411P: case AV_PIX_FMT_YUV411P:
width >>= 2; width >>= 2;
break; break;
default: default:
break; break;
} }
if (pix_fmt == PIX_FMT_GRAY8) { if (pix_fmt == AV_PIX_FMT_GRAY8) {
break; break;
} }
} }

@ -203,7 +203,7 @@ static av_cold int ir2_decode_init(AVCodecContext *avctx){
ic->avctx = avctx; ic->avctx = avctx;
avctx->pix_fmt= PIX_FMT_YUV410P; avctx->pix_fmt= AV_PIX_FMT_YUV410P;
ir2_vlc.table = vlc_tables; ir2_vlc.table = vlc_tables;
ir2_vlc.table_allocated = 1 << CODE_VLC_BITS; ir2_vlc.table_allocated = 1 << CODE_VLC_BITS;

@ -1009,7 +1009,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx->avctx = avctx; ctx->avctx = avctx;
ctx->width = avctx->width; ctx->width = avctx->width;
ctx->height = avctx->height; ctx->height = avctx->height;
avctx->pix_fmt = PIX_FMT_YUV410P; avctx->pix_fmt = AV_PIX_FMT_YUV410P;
build_requant_tab(); build_requant_tab();

@ -586,7 +586,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx->pic_conf.pic_width = 0; ctx->pic_conf.pic_width = 0;
ctx->pic_conf.pic_height = 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_pic_hdr = decode_pic_hdr;
ctx->decode_band_hdr = decode_band_hdr; ctx->decode_band_hdr = decode_band_hdr;

@ -627,7 +627,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
ctx->switch_buffers = switch_buffers; ctx->switch_buffers = switch_buffers;
ctx->is_nonnull_frame = is_nonnull_frame; ctx->is_nonnull_frame = is_nonnull_frame;
avctx->pix_fmt = PIX_FMT_YUV410P; avctx->pix_fmt = AV_PIX_FMT_YUV410P;
return 0; return 0;
} }

@ -36,7 +36,7 @@ typedef struct InternalBuffer {
int linesize[AV_NUM_DATA_POINTERS]; int linesize[AV_NUM_DATA_POINTERS];
int width; int width;
int height; int height;
enum PixelFormat pix_fmt; enum AVPixelFormat pix_fmt;
uint8_t **extended_data; uint8_t **extended_data;
int audio_data_size; int audio_data_size;
int nb_channels; int nb_channels;
@ -86,7 +86,7 @@ struct AVCodecDefault {
/** /**
* Determine whether pix_fmt is a hardware accelerated format. * 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 * Return the hardware accelerated codec for codec codec_id and
@ -96,7 +96,7 @@ int ff_is_hwaccel_pix_fmt(enum PixelFormat pix_fmt);
* @param pix_fmt the pixel format to match * @param pix_fmt the pixel format to match
* @return the hardware accelerated codec, or NULL if none was found. * @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. * Return the index into tab at which {a,b} match elements {[0],[1]} of tab.

@ -941,7 +941,7 @@ static av_cold int ipvideo_decode_init(AVCodecContext *avctx)
s->avctx = avctx; s->avctx = avctx;
s->is_16bpp = avctx->bits_per_coded_sample == 16; 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); ff_dsputil_init(&s->dsp, avctx);

@ -244,7 +244,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
p->pict_type= AV_PICTURE_TYPE_I; p->pict_type= AV_PICTURE_TYPE_I;
p->key_frame= 1; 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; comps = 1;
else else
comps = 3; comps = 3;
@ -264,7 +264,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
put_marker(&pb, SOI); put_marker(&pb, SOI);
put_marker(&pb, SOF48); put_marker(&pb, SOF48);
put_bits(&pb, 16, 8 + comps * 3); // header size depends on components 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->height);
put_bits(&pb, 16, avctx->width); put_bits(&pb, 16, avctx->width);
put_bits(&pb, 8, comps); // components put_bits(&pb, 8, comps); // components
@ -288,7 +288,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
state = av_mallocz(sizeof(JLSState)); state = av_mallocz(sizeof(JLSState));
/* initialize JPEG-LS state from JPEG parameters */ /* initialize JPEG-LS state from JPEG parameters */
state->near = near; 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_reset_coding_parameters(state, 0);
ff_jpegls_init_state(state); ff_jpegls_init_state(state);
@ -297,7 +297,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
zero = av_mallocz(p->linesize[0]); zero = av_mallocz(p->linesize[0]);
last = zero; last = zero;
cur = p->data[0]; cur = p->data[0];
if(avctx->pix_fmt == PIX_FMT_GRAY8){ if(avctx->pix_fmt == AV_PIX_FMT_GRAY8){
int t = 0; int t = 0;
for(i = 0; i < avctx->height; i++) { for(i = 0; i < avctx->height; i++) {
@ -306,7 +306,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
last = cur; last = cur;
cur += p->linesize[0]; cur += p->linesize[0];
} }
}else if(avctx->pix_fmt == PIX_FMT_GRAY16){ }else if(avctx->pix_fmt == AV_PIX_FMT_GRAY16){
int t = 0; int t = 0;
for(i = 0; i < avctx->height; i++) { for(i = 0; i < avctx->height; i++) {
@ -315,7 +315,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
last = cur; last = cur;
cur += p->linesize[0]; 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 j, width;
int Rc[3] = {0, 0, 0}; int Rc[3] = {0, 0, 0};
@ -328,7 +328,7 @@ static int encode_picture_ls(AVCodecContext *avctx, AVPacket *pkt,
last = cur; last = cur;
cur += s->picture.linesize[0]; 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 j, width;
int Rc[3] = {0, 0, 0}; int Rc[3] = {0, 0, 0};
@ -385,7 +385,7 @@ static av_cold int encode_init_ls(AVCodecContext *ctx) {
c->avctx = ctx; c->avctx = ctx;
ctx->coded_frame = &c->picture; 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"); av_log(ctx, AV_LOG_ERROR, "Only grayscale and RGB24/BGR24 images are supported\n");
return -1; return -1;
} }
@ -399,9 +399,9 @@ AVCodec ff_jpegls_encoder = { //FIXME avoid MPV_* lossless JPEG should not need
.priv_data_size = sizeof(JpeglsContext), .priv_data_size = sizeof(JpeglsContext),
.init = encode_init_ls, .init = encode_init_ls,
.encode2 = encode_picture_ls, .encode2 = encode_picture_ls,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_BGR24, PIX_FMT_RGB24, PIX_FMT_GRAY8, PIX_FMT_GRAY16, AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16,
PIX_FMT_NONE AV_PIX_FMT_NONE
}, },
.long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"), .long_name = NULL_IF_CONFIG_SMALL("JPEG-LS"),
}; };

@ -40,7 +40,7 @@ typedef struct JvContext {
static av_cold int decode_init(AVCodecContext *avctx) static av_cold int decode_init(AVCodecContext *avctx)
{ {
JvContext *s = avctx->priv_data; JvContext *s = avctx->priv_data;
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
ff_dsputil_init(&s->dsp, avctx); ff_dsputil_init(&s->dsp, avctx);
return 0; return 0;
} }

@ -169,7 +169,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
KgvContext * const c = avctx->priv_data; KgvContext * const c = avctx->priv_data;
c->avctx = avctx; c->avctx = avctx;
avctx->pix_fmt = PIX_FMT_RGB555; avctx->pix_fmt = AV_PIX_FMT_RGB555;
avctx->flags |= CODEC_FLAG_EMU_EDGE; avctx->flags |= CODEC_FLAG_EMU_EDGE;
return 0; return 0;

@ -397,7 +397,7 @@ static av_cold int decode_init(AVCodecContext * avctx)
c->setpal = 1; c->setpal = 1;
} }
avctx->pix_fmt = PIX_FMT_PAL8; avctx->pix_fmt = AV_PIX_FMT_PAL8;
return 0; return 0;
} }

@ -259,7 +259,7 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf,
if (line == 1) { if (line == 1) {
/* Second line, left predict first pixel, the rest of the line is median predicted /* 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 */ * 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 { } else {
/* Top left is 2 rows back, last pixel */ /* Top left is 2 rows back, last pixel */
TL = buf[width - (2 * stride) - 1]; TL = buf[width - (2 * stride) - 1];
@ -472,7 +472,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
return -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++) { for (i = 0; i < height; i++) {
lag_pred_line(l, dst, width, stride, i); lag_pred_line(l, dst, width, stride, i);
dst += stride; dst += stride;
@ -524,7 +524,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
switch (frametype) { switch (frametype) {
case FRAME_SOLID_RGBA: 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) { if (ff_thread_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
@ -539,14 +539,14 @@ static int lag_decode_frame(AVCodecContext *avctx,
} }
break; break;
case FRAME_ARITH_RGBA: case FRAME_ARITH_RGBA:
avctx->pix_fmt = PIX_FMT_RGB32; avctx->pix_fmt = AV_PIX_FMT_RGB32;
planes = 4; planes = 4;
offset_ry += 4; offset_ry += 4;
offs[3] = AV_RL32(buf + 9); offs[3] = AV_RL32(buf + 9);
case FRAME_ARITH_RGB24: case FRAME_ARITH_RGB24:
case FRAME_U_RGB24: case FRAME_U_RGB24:
if (frametype == FRAME_ARITH_RGB24 || frametype == 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) { if (ff_thread_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
@ -606,7 +606,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
} }
break; break;
case FRAME_ARITH_YUY2: 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) { if (ff_thread_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
@ -632,7 +632,7 @@ static int lag_decode_frame(AVCodecContext *avctx,
buf + offset_bv, buf_size - offset_bv); buf + offset_bv, buf_size - offset_bv);
break; break;
case FRAME_ARITH_YV12: 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) { if (ff_thread_get_buffer(avctx, p) < 0) {
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");

@ -495,37 +495,37 @@ static av_cold int decode_init(AVCodecContext *avctx)
case IMGTYPE_YUV111: case IMGTYPE_YUV111:
c->decomp_size = basesize * 3; c->decomp_size = basesize * 3;
max_decomp_size = max_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"); av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 1:1:1.\n");
break; break;
case IMGTYPE_YUV422: case IMGTYPE_YUV422:
c->decomp_size = basesize * 2; c->decomp_size = basesize * 2;
max_decomp_size = max_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"); av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:2.\n");
break; break;
case IMGTYPE_RGB24: case IMGTYPE_RGB24:
c->decomp_size = basesize * 3; c->decomp_size = basesize * 3;
max_decomp_size = max_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"); av_log(avctx, AV_LOG_DEBUG, "Image type is RGB 24.\n");
break; break;
case IMGTYPE_YUV411: case IMGTYPE_YUV411:
c->decomp_size = basesize / 2 * 3; c->decomp_size = basesize / 2 * 3;
max_decomp_size = max_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"); av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:1:1.\n");
break; break;
case IMGTYPE_YUV211: case IMGTYPE_YUV211:
c->decomp_size = basesize * 2; c->decomp_size = basesize * 2;
max_decomp_size = max_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"); av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 2:1:1.\n");
break; break;
case IMGTYPE_YUV420: case IMGTYPE_YUV420:
c->decomp_size = basesize / 2 * 3; c->decomp_size = basesize / 2 * 3;
max_decomp_size = max_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"); av_log(avctx, AV_LOG_DEBUG, "Image type is YUV 4:2:0.\n");
break; break;
default: default:

@ -89,7 +89,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
p->pict_type= AV_PICTURE_TYPE_I; p->pict_type= AV_PICTURE_TYPE_I;
p->key_frame= 1; 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"); av_log(avctx, AV_LOG_ERROR, "Format not supported!\n");
return -1; return -1;
} }
@ -192,6 +192,6 @@ AVCodec ff_zlib_encoder = {
.init = encode_init, .init = encode_init,
.encode2 = encode_frame, .encode2 = encode_frame,
.close = encode_end, .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"), .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
}; };

@ -40,27 +40,27 @@
// pix_fmts with lower bpp have to be listed before // pix_fmts with lower bpp have to be listed before
// similar pix_fmts with higher bpp. // similar pix_fmts with higher bpp.
#define RGB_PIXEL_FORMATS PIX_FMT_RGB24, PIX_FMT_RGBA, \ #define RGB_PIXEL_FORMATS AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, \
PIX_FMT_RGB48 AV_PIX_FMT_RGB48
#define GRAY_PIXEL_FORMATS PIX_FMT_GRAY8, PIX_FMT_Y400A, \ #define GRAY_PIXEL_FORMATS AV_PIX_FMT_GRAY8, AV_PIX_FMT_Y400A, \
PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
#define YUV_PIXEL_FORMATS PIX_FMT_YUV410P, PIX_FMT_YUV411P, \ #define YUV_PIXEL_FORMATS AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, \
PIX_FMT_YUVA420P, \ AV_PIX_FMT_YUVA420P, \
PIX_FMT_YUV420P, PIX_FMT_YUV422P, \ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, \
PIX_FMT_YUV440P, PIX_FMT_YUV444P, \ AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P, \
PIX_FMT_YUV420P9, PIX_FMT_YUV422P9, \ AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, \
PIX_FMT_YUV444P9, \ AV_PIX_FMT_YUV444P9, \
PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, \ AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, \
PIX_FMT_YUV444P10, \ AV_PIX_FMT_YUV444P10, \
PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, \ AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, \
PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
static const enum PixelFormat rgb_pix_fmts[] = {RGB_PIXEL_FORMATS}; static const enum AVPixelFormat rgb_pix_fmts[] = {RGB_PIXEL_FORMATS};
static const enum PixelFormat gray_pix_fmts[] = {GRAY_PIXEL_FORMATS}; static const enum AVPixelFormat gray_pix_fmts[] = {GRAY_PIXEL_FORMATS};
static const enum PixelFormat yuv_pix_fmts[] = {YUV_PIXEL_FORMATS}; static const enum AVPixelFormat yuv_pix_fmts[] = {YUV_PIXEL_FORMATS};
static const enum PixelFormat any_pix_fmts[] = {RGB_PIXEL_FORMATS, static const enum AVPixelFormat any_pix_fmts[] = {RGB_PIXEL_FORMATS,
GRAY_PIXEL_FORMATS, GRAY_PIXEL_FORMATS,
YUV_PIXEL_FORMATS}; YUV_PIXEL_FORMATS};
@ -73,7 +73,7 @@ typedef struct {
} LibOpenJPEGContext; } LibOpenJPEGContext;
static int libopenjpeg_matches_pix_fmt(const opj_image_t *img, 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]; AVPixFmtDescriptor des = av_pix_fmt_descriptors[pix_fmt];
int match = 1; int match = 1;
@ -110,10 +110,10 @@ static int libopenjpeg_matches_pix_fmt(const opj_image_t *img,
return match; 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; int index;
const enum PixelFormat *possible_fmts = NULL; const enum AVPixelFormat *possible_fmts = NULL;
int possible_fmts_nb = 0; int possible_fmts_nb = 0;
switch (image->color_space) { switch (image->color_space) {
@ -141,14 +141,14 @@ static enum PixelFormat libopenjpeg_guess_pix_fmt(const opj_image_t *image)
} }
} }
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; int i, component_plane;
if (pix_fmt == PIX_FMT_GRAY16) if (pix_fmt == AV_PIX_FMT_GRAY16)
return 0; return 0;
component_plane = av_pix_fmt_descriptors[pix_fmt].comp[0].plane; component_plane = av_pix_fmt_descriptors[pix_fmt].comp[0].plane;
@ -328,14 +328,14 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
avcodec_set_dimensions(avctx, width, height); 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)) 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); 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"); av_log(avctx, AV_LOG_ERROR, "Unable to determine pixel format\n");
ret = AVERROR_INVALIDDATA; ret = AVERROR_INVALIDDATA;
goto done; goto done;

@ -87,32 +87,32 @@ static opj_image_t *libopenjpeg_create_image(AVCodecContext *avctx,
sub_dy[2] = 1 << av_pix_fmt_descriptors[avctx->pix_fmt].log2_chroma_h; sub_dy[2] = 1 << av_pix_fmt_descriptors[avctx->pix_fmt].log2_chroma_h;
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
case PIX_FMT_GRAY8: case AV_PIX_FMT_GRAY8:
case PIX_FMT_GRAY16: case AV_PIX_FMT_GRAY16:
case PIX_FMT_Y400A: case AV_PIX_FMT_Y400A:
color_space = CLRSPC_GRAY; color_space = CLRSPC_GRAY;
break; break;
case PIX_FMT_RGB24: case AV_PIX_FMT_RGB24:
case PIX_FMT_RGBA: case AV_PIX_FMT_RGBA:
case PIX_FMT_RGB48: case AV_PIX_FMT_RGB48:
color_space = CLRSPC_SRGB; color_space = CLRSPC_SRGB;
break; break;
case PIX_FMT_YUV410P: case AV_PIX_FMT_YUV410P:
case PIX_FMT_YUV411P: case AV_PIX_FMT_YUV411P:
case PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
case PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
case PIX_FMT_YUV440P: case AV_PIX_FMT_YUV440P:
case PIX_FMT_YUV444P: case AV_PIX_FMT_YUV444P:
case PIX_FMT_YUVA420P: case AV_PIX_FMT_YUVA420P:
case PIX_FMT_YUV420P9: case AV_PIX_FMT_YUV420P9:
case PIX_FMT_YUV422P9: case AV_PIX_FMT_YUV422P9:
case PIX_FMT_YUV444P9: case AV_PIX_FMT_YUV444P9:
case PIX_FMT_YUV420P10: case AV_PIX_FMT_YUV420P10:
case PIX_FMT_YUV422P10: case AV_PIX_FMT_YUV422P10:
case PIX_FMT_YUV444P10: case AV_PIX_FMT_YUV444P10:
case PIX_FMT_YUV420P16: case AV_PIX_FMT_YUV420P16:
case PIX_FMT_YUV422P16: case AV_PIX_FMT_YUV422P16:
case PIX_FMT_YUV444P16: case AV_PIX_FMT_YUV444P16:
color_space = CLRSPC_SYCC; color_space = CLRSPC_SYCC;
break; break;
default: default:
@ -302,34 +302,34 @@ static int libopenjpeg_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1; image->y1 = (avctx->height - 1) * ctx->enc_params.subsampling_dy + 1;
switch (avctx->pix_fmt) { switch (avctx->pix_fmt) {
case PIX_FMT_RGB24: case AV_PIX_FMT_RGB24:
case PIX_FMT_RGBA: case AV_PIX_FMT_RGBA:
case PIX_FMT_Y400A: case AV_PIX_FMT_Y400A:
libopenjpeg_copy_packed8(avctx, frame, image); libopenjpeg_copy_packed8(avctx, frame, image);
break; break;
case PIX_FMT_RGB48: case AV_PIX_FMT_RGB48:
libopenjpeg_copy_packed16(avctx, frame, image); libopenjpeg_copy_packed16(avctx, frame, image);
break; break;
case PIX_FMT_GRAY8: case AV_PIX_FMT_GRAY8:
case PIX_FMT_YUV410P: case AV_PIX_FMT_YUV410P:
case PIX_FMT_YUV411P: case AV_PIX_FMT_YUV411P:
case PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
case PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
case PIX_FMT_YUV440P: case AV_PIX_FMT_YUV440P:
case PIX_FMT_YUV444P: case AV_PIX_FMT_YUV444P:
case PIX_FMT_YUVA420P: case AV_PIX_FMT_YUVA420P:
libopenjpeg_copy_unpacked8(avctx, frame, image); libopenjpeg_copy_unpacked8(avctx, frame, image);
break; break;
case PIX_FMT_GRAY16: case AV_PIX_FMT_GRAY16:
case PIX_FMT_YUV420P9: case AV_PIX_FMT_YUV420P9:
case PIX_FMT_YUV422P9: case AV_PIX_FMT_YUV422P9:
case PIX_FMT_YUV444P9: case AV_PIX_FMT_YUV444P9:
case PIX_FMT_YUV444P10: case AV_PIX_FMT_YUV444P10:
case PIX_FMT_YUV422P10: case AV_PIX_FMT_YUV422P10:
case PIX_FMT_YUV420P10: case AV_PIX_FMT_YUV420P10:
case PIX_FMT_YUV444P16: case AV_PIX_FMT_YUV444P16:
case PIX_FMT_YUV422P16: case AV_PIX_FMT_YUV422P16:
case PIX_FMT_YUV420P16: case AV_PIX_FMT_YUV420P16:
libopenjpeg_copy_unpacked16(avctx, frame, image); libopenjpeg_copy_unpacked16(avctx, frame, image);
break; break;
default: default:
@ -421,16 +421,16 @@ AVCodec ff_libopenjpeg_encoder = {
.encode2 = libopenjpeg_encode_frame, .encode2 = libopenjpeg_encode_frame,
.close = libopenjpeg_encode_close, .close = libopenjpeg_encode_close,
.capabilities = 0, .capabilities = 0,
.pix_fmts = (const enum PixelFormat[]) { .pix_fmts = (const enum AVPixelFormat[]) {
PIX_FMT_RGB24, PIX_FMT_RGBA, PIX_FMT_RGB48, AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48,
PIX_FMT_GRAY8, PIX_FMT_GRAY16, PIX_FMT_Y400A, AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, AV_PIX_FMT_Y400A,
PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUVA420P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUVA420P,
PIX_FMT_YUV440P, PIX_FMT_YUV444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P,
PIX_FMT_YUV411P, PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV410P,
PIX_FMT_YUV420P9, PIX_FMT_YUV422P9, PIX_FMT_YUV444P9, AV_PIX_FMT_YUV420P9, AV_PIX_FMT_YUV422P9, AV_PIX_FMT_YUV444P9,
PIX_FMT_YUV420P10, PIX_FMT_YUV422P10, PIX_FMT_YUV444P10, AV_PIX_FMT_YUV420P10, AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10,
PIX_FMT_YUV420P16, PIX_FMT_YUV422P16, PIX_FMT_YUV444P16, AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16,
PIX_FMT_NONE AV_PIX_FMT_NONE
}, },
.long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"), .long_name = NULL_IF_CONFIG_SMALL("OpenJPEG JPEG 2000"),
.priv_class = &class, .priv_class = &class,

@ -101,13 +101,13 @@ void *ff_schro_queue_pop(FFSchroQueue *queue);
void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *)); void ff_schro_queue_free(FFSchroQueue *queue, void (*free_func)(void *));
static const struct { static const struct {
enum PixelFormat ff_pix_fmt; enum AVPixelFormat ff_pix_fmt;
SchroChromaFormat schro_pix_fmt; SchroChromaFormat schro_pix_fmt;
SchroFrameFormat schro_frame_fmt; SchroFrameFormat schro_frame_fmt;
} schro_pixel_format_map[] = { } schro_pixel_format_map[] = {
{ PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 }, { AV_PIX_FMT_YUV420P, SCHRO_CHROMA_420, SCHRO_FRAME_FORMAT_U8_420 },
{ PIX_FMT_YUV422P, SCHRO_CHROMA_422, SCHRO_FRAME_FORMAT_U8_422 }, { AV_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_YUV444P, SCHRO_CHROMA_444, SCHRO_FRAME_FORMAT_U8_444 },
}; };
/** /**

@ -138,7 +138,7 @@ static SchroBuffer *find_next_parse_unit(SchroParseUnitContext *parse_ctx)
/** /**
* Returns Libav chroma format. * 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) / int num_formats = sizeof(schro_pixel_format_map) /
sizeof(schro_pixel_format_map[0]); sizeof(schro_pixel_format_map[0]);
@ -147,7 +147,7 @@ static enum PixelFormat get_chroma_format(SchroChromaFormat schro_pix_fmt)
for (idx = 0; idx < num_formats; ++idx) for (idx = 0; idx < num_formats; ++idx)
if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt) if (schro_pixel_format_map[idx].schro_pix_fmt == schro_pix_fmt)
return schro_pixel_format_map[idx].ff_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) static av_cold int libschroedinger_decode_init(AVCodecContext *avccontext)

@ -448,8 +448,8 @@ AVCodec ff_libschroedinger_encoder = {
.encode2 = libschroedinger_encode_frame, .encode2 = libschroedinger_encode_frame,
.close = libschroedinger_encode_close, .close = libschroedinger_encode_close,
.capabilities = CODEC_CAP_DELAY, .capabilities = CODEC_CAP_DELAY,
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE 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"), .long_name = NULL_IF_CONFIG_SMALL("libschroedinger Dirac 2.2"),
}; };

@ -187,11 +187,11 @@ static av_cold int encode_init(AVCodecContext* avc_context)
else else
t_info.colorspace = TH_CS_UNSPECIFIED; 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; 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; 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; t_info.pixel_fmt = TH_PF_444;
else { else {
av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n"); av_log(avc_context, AV_LOG_ERROR, "Unsupported pix_fmt\n");
@ -370,8 +370,8 @@ AVCodec ff_libtheora_encoder = {
.close = encode_close, .close = encode_close,
.encode2 = encode_frame, .encode2 = encode_frame,
.capabilities = CODEC_CAP_DELAY, // needed to get the statsfile summary .capabilities = CODEC_CAP_DELAY, // needed to get the statsfile summary
.pix_fmts = (const enum PixelFormat[]){ .pix_fmts = (const enum AVPixelFormat[]){
PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_YUV444P, PIX_FMT_NONE AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE
}, },
.long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"), .long_name = NULL_IF_CONFIG_SMALL("libtheora Theora"),
}; };

@ -54,7 +54,7 @@ static av_cold int vp8_init(AVCodecContext *avctx)
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
return 0; return 0;
} }

@ -580,7 +580,7 @@ AVCodec ff_libvpx_encoder = {
.encode2 = vp8_encode, .encode2 = vp8_encode,
.close = vp8_free, .close = vp8_free,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS, .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"), .long_name = NULL_IF_CONFIG_SMALL("libvpx VP8"),
.priv_class = &class, .priv_class = &class,
.defaults = defaults, .defaults = defaults,

@ -206,18 +206,18 @@ static av_cold int X264_close(AVCodecContext *avctx)
return 0; return 0;
} }
static int convert_pix_fmt(enum PixelFormat pix_fmt) static int convert_pix_fmt(enum AVPixelFormat pix_fmt)
{ {
switch (pix_fmt) { switch (pix_fmt) {
case PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
case PIX_FMT_YUVJ420P: case AV_PIX_FMT_YUVJ420P:
case PIX_FMT_YUV420P9: case AV_PIX_FMT_YUV420P9:
case PIX_FMT_YUV420P10: return X264_CSP_I420; case AV_PIX_FMT_YUV420P10: return X264_CSP_I420;
case PIX_FMT_YUV422P: case AV_PIX_FMT_YUV422P:
case PIX_FMT_YUV422P10: return X264_CSP_I422; case AV_PIX_FMT_YUV422P10: return X264_CSP_I422;
case PIX_FMT_YUV444P: case AV_PIX_FMT_YUV444P:
case PIX_FMT_YUV444P9: case AV_PIX_FMT_YUV444P9:
case PIX_FMT_YUV444P10: return X264_CSP_I444; case AV_PIX_FMT_YUV444P10: return X264_CSP_I444;
}; };
return 0; return 0;
} }
@ -402,7 +402,7 @@ static av_cold int X264_init(AVCodecContext *avctx)
x4->params.i_slice_count = avctx->slices; 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) if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
x4->params.b_repeat_headers = 0; x4->params.b_repeat_headers = 0;
@ -447,23 +447,23 @@ static av_cold int X264_init(AVCodecContext *avctx)
return 0; return 0;
} }
static const enum PixelFormat pix_fmts_8bit[] = { static const enum AVPixelFormat pix_fmts_8bit[] = {
PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P,
PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ420P,
PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P,
PIX_FMT_YUV444P, AV_PIX_FMT_YUV444P,
PIX_FMT_NONE AV_PIX_FMT_NONE
}; };
static const enum PixelFormat pix_fmts_9bit[] = { static const enum AVPixelFormat pix_fmts_9bit[] = {
PIX_FMT_YUV420P9, AV_PIX_FMT_YUV420P9,
PIX_FMT_YUV444P9, AV_PIX_FMT_YUV444P9,
PIX_FMT_NONE AV_PIX_FMT_NONE
}; };
static const enum PixelFormat pix_fmts_10bit[] = { static const enum AVPixelFormat pix_fmts_10bit[] = {
PIX_FMT_YUV420P10, AV_PIX_FMT_YUV420P10,
PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P10,
PIX_FMT_YUV444P10, AV_PIX_FMT_YUV444P10,
PIX_FMT_NONE AV_PIX_FMT_NONE
}; };
static av_cold void X264_init_static(AVCodec *codec) static av_cold void X264_init_static(AVCodec *codec)

@ -427,7 +427,7 @@ AVCodec ff_libxavs_encoder = {
.encode2 = XAVS_frame, .encode2 = XAVS_frame,
.close = XAVS_close, .close = XAVS_close,
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_AUTO_THREADS, .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)"), .long_name = NULL_IF_CONFIG_SMALL("libxavs Chinese AVS (Audio Video Standard)"),
.priv_class = &class, .priv_class = &class,
.defaults = xavs_defaults, .defaults = xavs_defaults,

@ -657,7 +657,7 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
xvid_enc_frame.length = pkt->size; xvid_enc_frame.length = pkt->size;
/* Initialize input image fields */ /* 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"); av_log(avctx, AV_LOG_ERROR, "Xvid: Color spaces other than 420p not supported\n");
return -1; return -1;
} }
@ -783,6 +783,6 @@ AVCodec ff_libxvid_encoder = {
.init = xvid_encode_init, .init = xvid_encode_init,
.encode2 = xvid_encode_frame, .encode2 = xvid_encode_frame,
.close = xvid_encode_close, .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"), .long_name = NULL_IF_CONFIG_SMALL("libxvidcore MPEG-4 part 2"),
}; };

@ -51,7 +51,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
const int mb_height = (height + s->mjpeg_vsample[0] - 1) / s->mjpeg_vsample[0]; const int mb_height = (height + s->mjpeg_vsample[0] - 1) / s->mjpeg_vsample[0];
int ret, max_pkt_size = FF_MIN_BUFFER_SIZE; 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; max_pkt_size += width * height * 3 * 4;
else { else {
max_pkt_size += mb_width * mb_height * 3 * 4 max_pkt_size += mb_width * mb_height * 3 * 4
@ -72,7 +72,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, AVPacket *pkt,
s->header_bits= put_bits_count(&s->pb); 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; int x, y, i;
const int linesize= p->linesize[0]; const int linesize= p->linesize[0];
uint16_t (*buffer)[4]= (void *) s->rd_scratchpad; uint16_t (*buffer)[4]= (void *) s->rd_scratchpad;

@ -254,16 +254,16 @@ static av_cold int decode_init(AVCodecContext *avctx){
l->mode = AV_RL32(avctx->extradata + 4); l->mode = AV_RL32(avctx->extradata + 4);
switch(l->mode) { switch(l->mode) {
case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY: case LOCO_CYUY2: case LOCO_YUY2: case LOCO_UYVY:
avctx->pix_fmt = PIX_FMT_YUV422P; avctx->pix_fmt = AV_PIX_FMT_YUV422P;
break; break;
case LOCO_CRGB: case LOCO_RGB: case LOCO_CRGB: case LOCO_RGB:
avctx->pix_fmt = PIX_FMT_BGR24; avctx->pix_fmt = AV_PIX_FMT_BGR24;
break; break;
case LOCO_CYV12: case LOCO_YV12: case LOCO_CYV12: case LOCO_YV12:
avctx->pix_fmt = PIX_FMT_YUV420P; avctx->pix_fmt = AV_PIX_FMT_YUV420P;
break; break;
case LOCO_CRGBA: case LOCO_RGBA: case LOCO_CRGBA: case LOCO_RGBA:
avctx->pix_fmt = PIX_FMT_RGB32; avctx->pix_fmt = AV_PIX_FMT_RGB32;
break; break;
default: default:
av_log(avctx, AV_LOG_INFO, "Unknown colorspace, index = %i\n", l->mode); av_log(avctx, AV_LOG_INFO, "Unknown colorspace, index = %i\n", l->mode);

@ -235,7 +235,7 @@ static av_cold int decode_init(AVCodecContext *avctx){
avctx->idct_algo = FF_IDCT_SIMPLE; avctx->idct_algo = FF_IDCT_SIMPLE;
p->qstride= 0; p->qstride= 0;
p->qscale_table= av_mallocz(a->mb_width); p->qscale_table= av_mallocz(a->mb_width);
avctx->pix_fmt= PIX_FMT_YUVJ420P; avctx->pix_fmt= AV_PIX_FMT_YUVJ420P;
return 0; return 0;
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save