}
}
break;
+ case AV_PIX_FMT_GRAYF32:
+ if (avctx->width * avctx->height * 4 > s->bytestream_end - s->bytestream)
+ return AVERROR_INVALIDDATA;
+ scale = 1.f / s->scale;
+ if (s->endian) {
+ float *g = (float *)p->data[0];
+ for (int i = 0; i < avctx->height; i++) {
+ for (int j = 0; j < avctx->width; j++) {
+ g[j] = av_int2float(AV_RL32(s->bytestream)) * scale;
+ s->bytestream += 4;
+ }
+ g += p->linesize[0] / 4;
+ }
+ } else {
+ float *g = (float *)p->data[0];
+ for (int i = 0; i < avctx->height; i++) {
+ for (int j = 0; j < avctx->width; j++) {
+ g[j] = av_int2float(AV_RB32(s->bytestream)) * scale;
+ s->bytestream += 4;
+ }
+ g += p->linesize[0] / 4;
+ }
+ }
+ break;
}
*got_frame = 1;
#if CONFIG_PGM_DECODER
-AVCodec ff_pgm_decoder = {
+const AVCodec ff_pgm_decoder = {
.name = "pgm",
.long_name = NULL_IF_CONFIG_SMALL("PGM (Portable GrayMap) image"),
.type = AVMEDIA_TYPE_VIDEO,
#endif
#if CONFIG_PGMYUV_DECODER
-AVCodec ff_pgmyuv_decoder = {
+const AVCodec ff_pgmyuv_decoder = {
.name = "pgmyuv",
.long_name = NULL_IF_CONFIG_SMALL("PGMYUV (Portable GrayMap YUV) image"),
.type = AVMEDIA_TYPE_VIDEO,
#endif
#if CONFIG_PPM_DECODER
-AVCodec ff_ppm_decoder = {
+const AVCodec ff_ppm_decoder = {
.name = "ppm",
.long_name = NULL_IF_CONFIG_SMALL("PPM (Portable PixelMap) image"),
.type = AVMEDIA_TYPE_VIDEO,
#endif
#if CONFIG_PBM_DECODER
-AVCodec ff_pbm_decoder = {
+const AVCodec ff_pbm_decoder = {
.name = "pbm",
.long_name = NULL_IF_CONFIG_SMALL("PBM (Portable BitMap) image"),
.type = AVMEDIA_TYPE_VIDEO,
#endif
#if CONFIG_PAM_DECODER
-AVCodec ff_pam_decoder = {
+const AVCodec ff_pam_decoder = {
.name = "pam",
.long_name = NULL_IF_CONFIG_SMALL("PAM (Portable AnyMap) image"),
.type = AVMEDIA_TYPE_VIDEO,
#endif
#if CONFIG_PFM_DECODER
-AVCodec ff_pfm_decoder = {
+const AVCodec ff_pfm_decoder = {
.name = "pfm",
.long_name = NULL_IF_CONFIG_SMALL("PFM (Portable FloatMap) image"),
.type = AVMEDIA_TYPE_VIDEO,