Parses the raw bitstream of the 'sato' Sample Transform derived image item and extracts the expression.
| 2275 | |
| 2276 | // Parses the raw bitstream of the 'sato' Sample Transform derived image item and extracts the expression. |
| 2277 | static avifResult avifParseSampleTransformImageBox(const uint8_t * raw, |
| 2278 | size_t rawLen, |
| 2279 | uint32_t numInputImageItems, |
| 2280 | avifSampleTransformExpression * expression, |
| 2281 | avifDiagnostics * diag) |
| 2282 | { |
| 2283 | BEGIN_STREAM(s, raw, rawLen, diag, "Box[sato]"); |
| 2284 | |
| 2285 | uint8_t version, reserved, bitDepth; |
| 2286 | AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &version, /*bitCount=*/2), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(2) version = 0; |
| 2287 | AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &reserved, /*bitCount=*/4), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(4) reserved; |
| 2288 | AVIF_CHECKERR(avifROStreamReadBitsU8(&s, &bitDepth, /*bitCount=*/2), AVIF_RESULT_BMFF_PARSE_FAILED); // unsigned int(2) bit_depth; |
| 2289 | AVIF_CHECKERR(version == 0, AVIF_RESULT_NOT_IMPLEMENTED); |
| 2290 | AVIF_CHECKERR(bitDepth == AVIF_SAMPLE_TRANSFORM_BIT_DEPTH_32, AVIF_RESULT_NOT_IMPLEMENTED); |
| 2291 | |
| 2292 | const avifResult result = avifParseSampleTransformTokens(&s, expression); |
| 2293 | if (result != AVIF_RESULT_OK) { |
| 2294 | avifArrayDestroy(expression); |
| 2295 | return result; |
| 2296 | } |
| 2297 | if (!avifSampleTransformExpressionIsValid(expression, numInputImageItems)) { |
| 2298 | avifArrayDestroy(expression); |
| 2299 | return AVIF_RESULT_BMFF_PARSE_FAILED; |
| 2300 | } |
| 2301 | return AVIF_RESULT_OK; |
| 2302 | } |
| 2303 | |
| 2304 | static const avifProperty * avifDecoderItemCodecConfigOrFirstCellCodecConfig(const avifDecoderItem * item) |
| 2305 | { |
no test coverage detected