| 1009 | } |
| 1010 | |
| 1011 | static void avifDecoderDataResetCodec(avifDecoderData * data) |
| 1012 | { |
| 1013 | for (unsigned int i = 0; i < data->tiles.count; ++i) { |
| 1014 | avifTile * tile = &data->tiles.tile[i]; |
| 1015 | if (tile->image) { |
| 1016 | avifImageFreePlanes(tile->image, AVIF_PLANES_ALL); // forget any pointers into codec image buffers |
| 1017 | } |
| 1018 | if (tile->codec) { |
| 1019 | // Check if tile->codec was created separately and destroy it in that case. |
| 1020 | if (tile->codec != data->codec && tile->codec != data->codecAlpha) { |
| 1021 | avifCodecDestroy(tile->codec); |
| 1022 | } |
| 1023 | tile->codec = NULL; |
| 1024 | } |
| 1025 | } |
| 1026 | for (int c = 0; c < AVIF_ITEM_CATEGORY_COUNT; ++c) { |
| 1027 | data->tileInfos[c].decodedTileCount = 0; |
| 1028 | } |
| 1029 | if (data->codec) { |
| 1030 | avifCodecDestroy(data->codec); |
| 1031 | data->codec = NULL; |
| 1032 | } |
| 1033 | if (data->codecAlpha) { |
| 1034 | avifCodecDestroy(data->codecAlpha); |
| 1035 | data->codecAlpha = NULL; |
| 1036 | } |
| 1037 | } |
| 1038 | |
| 1039 | static avifTile * avifDecoderDataCreateTile(avifDecoderData * data, avifCodecType codecType, uint32_t width, uint32_t height, uint8_t operatingPoint) |
| 1040 | { |
no test coverage detected