|
3 | 3 | #include <Python.h> |
4 | 4 | #include "avif/avif.h" |
5 | 5 |
|
6 | | -#if AVIF_VERSION < 80300 |
7 | | -#define AVIF_CHROMA_UPSAMPLING_AUTOMATIC AVIF_CHROMA_UPSAMPLING_BILINEAR |
8 | | -#define AVIF_CHROMA_UPSAMPLING_BEST_QUALITY AVIF_CHROMA_UPSAMPLING_BILINEAR |
9 | | -#define AVIF_CHROMA_UPSAMPLING_FASTEST AVIF_CHROMA_UPSAMPLING_NEAREST |
10 | | -#endif |
11 | | - |
12 | 6 | typedef struct { |
13 | 7 | avifPixelFormat subsampling; |
14 | 8 | int qmin; |
@@ -671,35 +665,18 @@ AvifDecoderNew(PyObject *self_, PyObject *args) { |
671 | 665 | PyObject *avif_bytes; |
672 | 666 | AvifDecoderObject *self = NULL; |
673 | 667 |
|
674 | | - char *upsampling_str; |
675 | 668 | char *codec_str; |
676 | 669 | avifCodecChoice codec; |
677 | | - avifChromaUpsampling upsampling; |
678 | 670 | int max_threads; |
679 | 671 |
|
680 | 672 | avifResult result; |
681 | 673 |
|
682 | 674 | if (!PyArg_ParseTuple( |
683 | | - args, "Sssi", &avif_bytes, &codec_str, &upsampling_str, &max_threads |
| 675 | + args, "Ssi", &avif_bytes, &codec_str, &max_threads |
684 | 676 | )) { |
685 | 677 | return NULL; |
686 | 678 | } |
687 | 679 |
|
688 | | - if (!strcmp(upsampling_str, "auto")) { |
689 | | - upsampling = AVIF_CHROMA_UPSAMPLING_AUTOMATIC; |
690 | | - } else if (!strcmp(upsampling_str, "fastest")) { |
691 | | - upsampling = AVIF_CHROMA_UPSAMPLING_FASTEST; |
692 | | - } else if (!strcmp(upsampling_str, "best")) { |
693 | | - upsampling = AVIF_CHROMA_UPSAMPLING_BEST_QUALITY; |
694 | | - } else if (!strcmp(upsampling_str, "nearest")) { |
695 | | - upsampling = AVIF_CHROMA_UPSAMPLING_NEAREST; |
696 | | - } else if (!strcmp(upsampling_str, "bilinear")) { |
697 | | - upsampling = AVIF_CHROMA_UPSAMPLING_BILINEAR; |
698 | | - } else { |
699 | | - PyErr_Format(PyExc_ValueError, "Invalid upsampling option: %s", upsampling_str); |
700 | | - return NULL; |
701 | | - } |
702 | | - |
703 | 680 | if (strcmp(codec_str, "auto") == 0) { |
704 | 681 | codec = AVIF_CODEC_CHOICE_AUTO; |
705 | 682 | } else { |
|
0 commit comments