Unified · Split
| @@ -159,8 +159,8 @@ static int decode_frame(AVCodecContext *avctx, · 158 unmodified lines | ||
| 159 | 159 | AVFrame *const p = data; |
| 160 | 160 | uint8_t *ptr[AV_NUM_DATA_POINTERS]; |
| 161 | 161 | uint32_t header_version, version = 0; |
| 162 | − char creator[101]; | |
| 163 | − char input_device[33]; | |
| 162 | + char creator[101] = { 0 }; | |
| 163 | + char input_device[33] = { 0 }; | |
| 164 | 164 | |
| 165 | 165 | unsigned int offset; |
| 166 | 166 | int magic_num, endian; |
| @@ -327,6 +327,10 @@ static int decode_frame(AVCodecContext *avctx, · 160 unmodified lines | ||
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | switch (descriptor) { |
| 330 | + case 1: // R | |
| 331 | + case 2: // G | |
| 332 | + case 3: // B | |
| 333 | + case 4: // A | |
| 330 | 334 | case 6: // Y |
| 331 | 335 | elements = 1; |
| 332 | 336 | yuv = 1; |
| @@ -385,8 +389,10 @@ static int decode_frame(AVCodecContext *avctx, · 52 unmodified lines | ||
| 385 | 389 | case 16: |
| 386 | 390 | stride = 2 * avctx->width * elements; |
| 387 | 391 | break; |
| 388 | − case 1: | |
| 389 | 392 | case 32: |
| 393 | + stride = 4 * avctx->width * elements; | |
| 394 | + break; | |
| 395 | + case 1: | |
| 390 | 396 | case 64: |
| 391 | 397 | avpriv_report_missing_feature(avctx, "Depth %d", bits_per_color); |
| 392 | 398 | return AVERROR_PATCHWELCOME; |
| @@ -499,6 +505,20 @@ static int decode_frame(AVCodecContext *avctx, · 106 unmodified lines | ||
| 499 | 505 | case 6120: |
| 500 | 506 | avctx->pix_fmt = AV_PIX_FMT_GRAY12; |
| 501 | 507 | break; |
| 508 | + case 1320: | |
| 509 | + case 2320: | |
| 510 | + case 3320: | |
| 511 | + case 4320: | |
| 512 | + case 6320: | |
| 513 | + avctx->pix_fmt = AV_PIX_FMT_GRAYF32LE; | |
| 514 | + break; | |
| 515 | + case 1321: | |
| 516 | + case 2321: | |
| 517 | + case 3321: | |
| 518 | + case 4321: | |
| 519 | + case 6321: | |
| 520 | + avctx->pix_fmt = AV_PIX_FMT_GRAYF32BE; | |
| 521 | + break; | |
| 502 | 522 | case 50081: |
| 503 | 523 | case 50080: |
| 504 | 524 | avctx->pix_fmt = AV_PIX_FMT_RGB24; |
| @@ -549,6 +569,18 @@ static int decode_frame(AVCodecContext *avctx, · 44 unmodified lines | ||
| 549 | 569 | case 51160: |
| 550 | 570 | avctx->pix_fmt = AV_PIX_FMT_RGBA64LE; |
| 551 | 571 | break; |
| 572 | + case 50320: | |
| 573 | + avctx->pix_fmt = AV_PIX_FMT_GBRPF32LE; | |
| 574 | + break; | |
| 575 | + case 50321: | |
| 576 | + avctx->pix_fmt = AV_PIX_FMT_GBRPF32BE; | |
| 577 | + break; | |
| 578 | + case 51320: | |
| 579 | + avctx->pix_fmt = AV_PIX_FMT_GBRAPF32LE; | |
| 580 | + break; | |
| 581 | + case 51321: | |
| 582 | + avctx->pix_fmt = AV_PIX_FMT_GBRAPF32BE; | |
| 583 | + break; | |
| 552 | 584 | case 100081: |
| 553 | 585 | avctx->pix_fmt = AV_PIX_FMT_UYVY422; |
| 554 | 586 | break; |
| @@ -559,7 +591,8 @@ static int decode_frame(AVCodecContext *avctx, · 4 unmodified lines | ||
| 559 | 591 | avctx->pix_fmt = AV_PIX_FMT_YUVA444P; |
| 560 | 592 | break; |
| 561 | 593 | default: |
| 562 | − av_log(avctx, AV_LOG_ERROR, "Unsupported format\n"); | |
| 594 | + av_log(avctx, AV_LOG_ERROR, "Unsupported format %d\n", | |
| 595 | + 1000 * descriptor + 10 * bits_per_color + endian); | |
| 563 | 596 | return AVERROR_PATCHWELCOME; |
| 564 | 597 | } |
| 565 | 598 | |
| @@ -657,6 +690,36 @@ static int decode_frame(AVCodecContext *avctx, · 91 unmodified lines | ||
| 657 | 690 | buf += need_align; |
| 658 | 691 | } |
| 659 | 692 | break; |
| 693 | + case 32: | |
| 694 | + if (elements == 1) { | |
| 695 | + av_image_copy_plane(ptr[0], p->linesize[0], | |
| 696 | + buf, stride, | |
| 697 | + elements * avctx->width * 4, avctx->height); | |
| 698 | + } else { | |
| 699 | + for (y = 0; y < avctx->height; y++) { | |
| 700 | + ptr[0] = p->data[0] + y * p->linesize[0]; | |
| 701 | + ptr[1] = p->data[1] + y * p->linesize[1]; | |
| 702 | + ptr[2] = p->data[2] + y * p->linesize[2]; | |
| 703 | + ptr[3] = p->data[3] + y * p->linesize[3]; | |
| 704 | + for (x = 0; x < avctx->width; x++) { | |
| 705 | + AV_WN32(ptr[2], AV_RN32(buf)); | |
| 706 | + AV_WN32(ptr[0], AV_RN32(buf + 4)); | |
| 707 | + AV_WN32(ptr[1], AV_RN32(buf + 8)); | |
| 708 | + if (avctx->pix_fmt == AV_PIX_FMT_GBRAPF32BE || | |
| 709 | + avctx->pix_fmt == AV_PIX_FMT_GBRAPF32LE) { | |
| 710 | + AV_WN32(ptr[3], AV_RN32(buf + 12)); | |
| 711 | + buf += 4; | |
| 712 | + ptr[3] += 4; | |
| 713 | + } | |
| 714 | + | |
| 715 | + buf += 12; | |
| 716 | + ptr[2] += 4; | |
| 717 | + ptr[0] += 4; | |
| 718 | + ptr[1] += 4; | |
| 719 | + } | |
| 720 | + } | |
| 721 | + } | |
| 722 | + break; | |
| 660 | 723 | case 16: |
| 661 | 724 | elements *= 2; |
| 662 | 725 | case 8: |