summaryrefslogtreecommitdiffstats
path: root/libavcodec/pnm.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/pnm.c')
-rw-r--r--libavcodec/pnm.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/libavcodec/pnm.c b/libavcodec/pnm.c
index a5cf766..c5c600b 100644
--- a/libavcodec/pnm.c
+++ b/libavcodec/pnm.c
@@ -68,14 +68,14 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
return -1;
if (s->type==1 || s->type==4) {
- avctx->pix_fmt = PIX_FMT_MONOWHITE;
+ avctx->pix_fmt = AV_PIX_FMT_MONOWHITE;
} else if (s->type==2 || s->type==5) {
if (avctx->codec_id == AV_CODEC_ID_PGMYUV)
- avctx->pix_fmt = PIX_FMT_YUV420P;
+ avctx->pix_fmt = AV_PIX_FMT_YUV420P;
else
- avctx->pix_fmt = PIX_FMT_GRAY8;
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8;
} else if (s->type==3 || s->type==6) {
- avctx->pix_fmt = PIX_FMT_RGB24;
+ avctx->pix_fmt = AV_PIX_FMT_RGB24;
} else if (s->type==7) {
w = -1;
h = -1;
@@ -115,26 +115,26 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
s->maxval = maxval;
if (depth == 1) {
if (maxval == 1) {
- avctx->pix_fmt = PIX_FMT_MONOBLACK;
+ avctx->pix_fmt = AV_PIX_FMT_MONOBLACK;
} else if (maxval == 255) {
- avctx->pix_fmt = PIX_FMT_GRAY8;
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8;
} else {
- avctx->pix_fmt = PIX_FMT_GRAY16BE;
+ avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
}
} else if (depth == 2) {
if (maxval == 255)
- avctx->pix_fmt = PIX_FMT_GRAY8A;
+ avctx->pix_fmt = AV_PIX_FMT_GRAY8A;
} else if (depth == 3) {
if (maxval < 256) {
- avctx->pix_fmt = PIX_FMT_RGB24;
+ avctx->pix_fmt = AV_PIX_FMT_RGB24;
} else {
- avctx->pix_fmt = PIX_FMT_RGB48BE;
+ avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
}
} else if (depth == 4) {
if (maxval < 256) {
- avctx->pix_fmt = PIX_FMT_RGBA;
+ avctx->pix_fmt = AV_PIX_FMT_RGBA;
} else {
- avctx->pix_fmt = PIX_FMT_RGBA64BE;
+ avctx->pix_fmt = AV_PIX_FMT_RGBA64BE;
}
} else {
return -1;
@@ -153,7 +153,7 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
avctx->width = w;
avctx->height = h;
- if (avctx->pix_fmt != PIX_FMT_MONOWHITE && avctx->pix_fmt != PIX_FMT_MONOBLACK) {
+ if (avctx->pix_fmt != AV_PIX_FMT_MONOWHITE && avctx->pix_fmt != AV_PIX_FMT_MONOBLACK) {
pnm_get(s, buf1, sizeof(buf1));
s->maxval = atoi(buf1);
if (s->maxval <= 0) {
@@ -161,23 +161,23 @@ int ff_pnm_decode_header(AVCodecContext *avctx, PNMContext * const s)
s->maxval = 255;
}
if (s->maxval >= 256) {
- if (avctx->pix_fmt == PIX_FMT_GRAY8) {
- avctx->pix_fmt = PIX_FMT_GRAY16BE;
+ if (avctx->pix_fmt == AV_PIX_FMT_GRAY8) {
+ avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
if (s->maxval != 65535)
- avctx->pix_fmt = PIX_FMT_GRAY16;
- } else if (avctx->pix_fmt == PIX_FMT_RGB24) {
+ avctx->pix_fmt = AV_PIX_FMT_GRAY16;
+ } else if (avctx->pix_fmt == AV_PIX_FMT_RGB24) {
if (s->maxval > 255)
- avctx->pix_fmt = PIX_FMT_RGB48BE;
+ avctx->pix_fmt = AV_PIX_FMT_RGB48BE;
} else {
av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n");
- avctx->pix_fmt = PIX_FMT_NONE;
+ avctx->pix_fmt = AV_PIX_FMT_NONE;
return -1;
}
}
}else
s->maxval=1;
/* more check if YUV420 */
- if (avctx->pix_fmt == PIX_FMT_YUV420P) {
+ if (avctx->pix_fmt == AV_PIX_FMT_YUV420P) {
if ((avctx->width & 1) != 0)
return -1;
h = (avctx->height * 2);
OpenPOWER on IntegriCloud