diff --git a/libavcodec/psd.c b/libavcodec/psd.c
index 7587ed9..e48b379 100644
|
a
|
b
|
static int decode_frame(AVCodecContext *avctx, void *data,
|
| 332 | 332 | if (s->channel_count == 3) { |
| 333 | 333 | if (s->channel_depth == 8) { |
| 334 | 334 | avctx->pix_fmt = AV_PIX_FMT_GBRP; |
| 335 | | } else if (s->channel_depth == 16) { |
| | 335 | } else if (s->channel_depth == 16 || s->channel_depth == 32) { |
| 336 | 336 | avctx->pix_fmt = AV_PIX_FMT_GBRP16BE; |
| 337 | 337 | } else { |
| 338 | 338 | avpriv_report_missing_feature(avctx, "channel depth %d for rgb", s->channel_depth); |
| … |
… |
static int decode_frame(AVCodecContext *avctx, void *data,
|
| 341 | 341 | } else if (s->channel_count == 4) { |
| 342 | 342 | if (s->channel_depth == 8) { |
| 343 | 343 | avctx->pix_fmt = AV_PIX_FMT_GBRAP; |
| 344 | | } else if (s->channel_depth == 16) { |
| | 344 | } else if (s->channel_depth == 16 || s->channel_depth == 32) { |
| 345 | 345 | avctx->pix_fmt = AV_PIX_FMT_GBRAP16BE; |
| 346 | 346 | } else { |
| 347 | 347 | avpriv_report_missing_feature(avctx, "channel depth %d for rgb", s->channel_depth); |
| … |
… |
static int decode_frame(AVCodecContext *avctx, void *data,
|
| 356 | 356 | if (s->channel_count == 1) { |
| 357 | 357 | if (s->channel_depth == 8) { |
| 358 | 358 | avctx->pix_fmt = AV_PIX_FMT_GRAY8; |
| 359 | | } else if (s->channel_depth == 16) { |
| | 359 | } else if (s->channel_depth == 16 || s->channel_depth == 32) { |
| 360 | 360 | avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; |
| 361 | 361 | } else { |
| 362 | 362 | avpriv_report_missing_feature(avctx, "channel depth %d for grayscale", s->channel_depth); |
| … |
… |
static int decode_frame(AVCodecContext *avctx, void *data,
|
| 380 | 380 | avpriv_report_missing_feature(avctx, "color mode %d", s->color_mode); |
| 381 | 381 | return AVERROR_PATCHWELCOME; |
| 382 | 382 | } |
| | 383 | if (s->channel_depth == 32) |
| | 384 | av_log(avctx, AV_LOG_WARNING, "truncating 32bit channel_depth to 16bit\n"); |
| 383 | 385 | |
| 384 | 386 | if ((ret = ff_get_buffer(avctx, picture, 0)) < 0) |
| 385 | 387 | return ret; |
| … |
… |
static int decode_frame(AVCodecContext *avctx, void *data,
|
| 420 | 422 | } |
| 421 | 423 | } |
| 422 | 424 | } |
| | 425 | } else if (s->channel_depth == 32) { |
| | 426 | if (avctx->pix_fmt == AV_PIX_FMT_GRAY16BE) |
| | 427 | eq_channel[0] = 0; |
| | 428 | for (c = 0; c < s->channel_count; c++) { |
| | 429 | plane_number = eq_channel[c]; |
| | 430 | ptr = picture->data[plane_number];/* get the right plane */ |
| | 431 | for (y = 0; y < s->height; y++) { |
| | 432 | for (x = 0; x < s->width; x++) { |
| | 433 | // AV_WB16(ptr + 2 * x, AV_RB32(&ptr_data[4 * x]) >> 16); |
| | 434 | uint32_t v = AV_RB32(&ptr_data[4 * x]); |
| | 435 | v >>= 11; |
| | 436 | AV_WB16(ptr + 2 * x, v); |
| | 437 | } |
| | 438 | ptr += picture->linesize[plane_number]; |
| | 439 | ptr_data += s->width * s->pixel_size; |
| | 440 | } |
| | 441 | } |
| 423 | 442 | } else {/* Planar */ |
| 424 | 443 | if (s->channel_count == 1)/* gray 8 or gray 16be */ |
| 425 | 444 | eq_channel[0] = 0;/* assign first channel, to first plane */ |